diff --git a/.github/classifier.yml b/.github/classifier.yml new file mode 100644 index 0000000000000000000000000000000000000000..0ab39eab812a3abb0c7980862d0ea332fe0c458a --- /dev/null +++ b/.github/classifier.yml @@ -0,0 +1,30 @@ +{ + perform: true, + alwaysRequireAssignee: false, + labelsRequiringAssignee: [ feature-request ], + autoAssignees: { + accessibility: [], + api: [], + css-less-sass: [], + debug: [], + editor: [], + emmet: [ ramya-rao-a ], + error-list: [], + extensions: [], + git: [], + hot-exit: [], + html: [], + i18n: [], + install-update: [], + integrated-terminal: [ Tyriar ], + javascript: [], + json: [], + languages basic: [], + markdown: [], + php: [ roblourens ], + search: [ roblourens ], + tasks: [], + typescript: [], + workbench: [], + } +} \ No newline at end of file diff --git a/.github/copycat.yml b/.github/copycat.yml new file mode 100644 index 0000000000000000000000000000000000000000..eccccc16b007d68a3b1706fdf200d5d7f1fe6141 --- /dev/null +++ b/.github/copycat.yml @@ -0,0 +1,5 @@ +{ + perform: true, + target_owner: 'chrmarti', + target_repo: 'testissues' +} \ No newline at end of file diff --git a/.github/insiders.yml b/.github/insiders.yml new file mode 100644 index 0000000000000000000000000000000000000000..28192b556e5b94fbe5e1e510bc35b8d4e2b3561d --- /dev/null +++ b/.github/insiders.yml @@ -0,0 +1,4 @@ +{ + insidersLabel: 'insiders', + perform: true +} \ No newline at end of file diff --git a/.github/new_release.yml b/.github/new_release.yml new file mode 100644 index 0000000000000000000000000000000000000000..dd0810063298baae547cf133f79632c42eced61d --- /dev/null +++ b/.github/new_release.yml @@ -0,0 +1,5 @@ +{ + newReleaseLabel: 'new release', + newReleases: ['1.13.1'], + perform: true +} \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index cb7e8ac93232b7189a62f89c51414e38d43e6ba5..e590f6b9e270d17b85c7ba5aa83fe8c653bfc801 100644 --- a/.travis.yml +++ b/.travis.yml @@ -44,7 +44,7 @@ script: - gulp electron --silent - gulp compile --silent --max_old_space_size=4096 - gulp optimize-vscode --silent --max_old_space_size=4096 - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./scripts/test.sh --coverage; else ./scripts/test.sh; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./scripts/test.sh --coverage --reporter dot; else ./scripts/test.sh --reporter dot; fi - ./scripts/test-integration.sh after_success: diff --git a/.vscode/launch.json b/.vscode/launch.json index d56ca22e59dda68a719c1debbc15cef0f389cb4d..39b72b995a8b45c2c2adc6ea250a29fd5d892b85 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -18,7 +18,6 @@ "name": "Attach to Extension Host", "protocol": "legacy", "port": 5870, - "sourceMaps": true, "restart": true, "outFiles": [ "${workspaceRoot}/out/**/*.js" @@ -30,7 +29,6 @@ "name": "Attach to Shared Process", "protocol": "legacy", "port": 5871, - "sourceMaps": true, "outFiles": [ "${workspaceRoot}/out/**/*.js" ] @@ -41,7 +39,6 @@ "protocol": "legacy", "name": "Attach to Search process", "port": 7890, - "sourceMaps": true, "outFiles": [ "${workspaceRoot}/out/**/*.js" ] @@ -52,7 +49,6 @@ "name": "Attach to CLI Process", "protocol": "legacy", "port": 5874, - "sourceMaps": true, "outFiles": [ "${workspaceRoot}/out/**/*.js" ] @@ -63,7 +59,6 @@ "name": "Attach to Main Process", "protocol": "legacy", "port": 5875, - "sourceMaps": true, "outFiles": [ "${workspaceRoot}/out/**/*.js" ] @@ -78,7 +73,6 @@ "--extensionDevelopmentPath=${workspaceRoot}/extensions/vscode-api-tests", "--extensionTestsPath=${workspaceRoot}/extensions/vscode-api-tests/out" ], - "sourceMaps": true, "outFiles": [ "${workspaceRoot}/out/**/*.js" ] @@ -93,7 +87,6 @@ "--extensionDevelopmentPath=${workspaceRoot}/extensions/vscode-colorize-tests", "--extensionTestsPath=${workspaceRoot}/extensions/vscode-colorize-tests/out" ], - "sourceMaps": true, "outFiles": [ "${workspaceRoot}/out/**/*.js" ] @@ -131,7 +124,6 @@ "program": "${workspaceRoot}/extensions/git/node_modules/mocha/bin/_mocha", "stopOnEntry": false, "cwd": "${workspaceRoot}/extensions/git", - "sourceMaps": true, "outFiles": [ "${workspaceRoot}/extensions/git/out/**/*.js" ] @@ -141,11 +133,36 @@ "type": "node", "request": "attach", "port": 5859, - "sourceMaps": true, "protocol": "legacy", "outFiles": [ "${workspaceRoot}/extensions/node_modules/typescript/lib/**/*.js" ] + }, + { + "type": "node", + "request": "launch", + "name": "Unit Tests", + "protocol": "legacy", + "program": "${workspaceRoot}/node_modules/mocha/bin/_mocha", + "runtimeExecutable": "${workspaceRoot}/.build/electron/Code - OSS.app/Contents/MacOS/Electron", + "windows": { + "runtimeExecutable": "${workspaceRoot}/.build/electron/Code - OSS.exe" + }, + "linux": { + "runtimeExecutable": "${workspaceRoot}/.build/electron/code-oss" + }, + "stopOnEntry": false, + "args": [ + "--timeout", + "2000" + ], + "cwd": "${workspaceRoot}", + "env": { + "ELECTRON_RUN_AS_NODE": "true" + }, + "outFiles": [ + "${workspaceRoot}/out/**/*.js" + ] } ], "compounds": [ diff --git a/.vscode/tasks.json b/.vscode/tasks.json index a52055b963655f25da9c517bc4920722ed623eb7..c53f11f15006e7111d6d992f73d520e9e1b67b7f 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -1,23 +1,14 @@ { - "version": "0.1.0", - "windows": { - "command": ".\\node_modules\\.bin\\gulp" - }, - "osx": { - "command": "./node_modules/.bin/gulp" - }, - "linux": { - "command": "./node_modules/.bin/gulp" - }, - "isShellCommand": true, + "version": "2.0.0", "tasks": [ { - "taskName": "watch", - "args": [ - "--no-color" - ], - "isBuildCommand": true, + "customize": "vscode.npm.run watch", + "taskName": "Build VS Code", + "group": "build", "isBackground": true, + "terminal": { + "reveal": "never" + }, "problemMatcher": { "owner": "typescript", "applyTo": "closedDocuments", @@ -30,45 +21,41 @@ "location": 2, "message": 3 }, - "watching": { + "background": { "beginsPattern": "Starting compilation", "endsPattern": "Finished compilation" } } }, { - "taskName": "tslint", - "args": [], - "problemMatcher": { - "owner": "tslint", - "fileLocation": [ - "relative", - "${workspaceRoot}" - ], - "severity": "warning", - "pattern": { - "regexp": "(.*)\\[(\\d+),\\s(\\d+)\\]:\\s(.*)$", // (.*)\[(\d+), (\d+)\]: (.*) - "file": 1, - "line": 2, - "column": 3, - "message": 4 - } + "customize": "gulp.tslint", + "taskName": "Run tslint", + "problemMatcher": ["$tslint4"] + }, + { + "taskName": "Run tests", + "type": "shell", + "command": "./scripts/test.sh", + "windows": { + "command": ".\\scripts\\test.bat" + }, + "group": "test", + "presentation": { + "echo": true, + "reveal": "always" } }, { - "taskName": "test", - "args": [ - "--no-color" - ], - "showOutput": "always", - "isTestCommand": true + "taskName": "Run Dev", + "type": "shell", + "command": "./scripts/code.sh", + "windows": { + "command": ".\\scripts\\code.bat" + } }, { - "taskName": "electron", - "args": [ - "--no-color" - ], - "showOutput": "never" + "customize": "gulp.electron", + "taskName": "Download electron" } ] } \ No newline at end of file diff --git a/ThirdPartyNotices.txt b/ThirdPartyNotices.txt index 49020843ae905539516c4fc7f7c3f9c733cb25b7..84e13002af2211e24e38ae14621cd518d6e0127a 100644 --- a/ThirdPartyNotices.txt +++ b/ThirdPartyNotices.txt @@ -1,68 +1,67 @@ -microsoft-vscode +dmicrosoft-vscode THIRD-PARTY SOFTWARE NOTICES AND INFORMATION Do Not Translate or Localize This project incorporates components from the projects listed below. The original copyright notices and the licenses under which Microsoft received such components are set forth below. Microsoft reserves all rights not expressly granted herein, whether by implication, estoppel or otherwise. -1. atom/language-c version 0.51.3 (https://github.com/atom/language-c) +1. atom/language-c (https://github.com/atom/language-c) 2. atom/language-clojure (https://github.com/atom/language-clojure) 3. atom/language-coffee-script (https://github.com/atom/language-coffee-script) 4. atom/language-css (https://github.com/atom/language-css) -5. atom/language-objective-c (https://github.com/atom/language-objective-c) -6. atom/language-sass version 0.52.0 (https://github.com/atom/language-sass) -7. atom/language-xml (https://github.com/atom/language-xml) -8. Benvie/JavaScriptNext.tmLanguage (https://github.com/Benvie/JavaScriptNext.tmLanguage) -9. chjj-marked version 0.3.2 (https://github.com/npmcomponent/chjj-marked) -10. chriskempson/tomorrow-theme (https://github.com/chriskempson/tomorrow-theme) -11. Colorsublime-Themes version 0.1.0 (https://github.com/Colorsublime/Colorsublime-Themes) -12. daaain/Handlebars (https://github.com/daaain/Handlebars) -13. davidrios/jade-tmbundle (https://github.com/davidrios/jade-tmbundle) -14. definitelytyped (https://github.com/DefinitelyTyped/DefinitelyTyped) -15. demyte/language-cshtml (https://github.com/demyte/language-cshtml) -16. dotnet/csharp-tmLanguage version 0.1.0 (https://github.com/dotnet/csharp-tmLanguage) -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. Ionic documentation version 1.2.4 (https://github.com/driftyco/ionic-site) -20. ionide/ionide-fsgrammar (https://github.com/ionide/ionide-fsgrammar) -21. js-beautify version 1.6.8 (https://github.com/beautify-web/js-beautify) -22. Jxck/assert version 1.0.0 (https://github.com/Jxck/assert) -23. language-docker (https://github.com/moby/moby) -24. language-go version 0.39.0 (https://github.com/atom/language-go) -25. language-less (https://github.com/atom/language-less) -26. language-php (https://github.com/atom/language-php) -27. language-rust version 0.4.9 (https://github.com/zargony/atom-language-rust) -28. MagicStack/MagicPython (https://github.com/MagicStack/MagicPython) -29. Microsoft/TypeScript-TmLanguage version 0.0.1 (https://github.com/Microsoft/TypeScript-TmLanguage) -30. octicons-code version 3.1.0 (https://octicons.github.com) -31. octicons-font version 3.1.0 (https://octicons.github.com) -32. seti-ui version 0.1.0 (https://github.com/jesseweed/seti-ui) -33. shaders-tmLanguage version 0.1.0 (https://github.com/tgjones/shaders-tmLanguage) -34. string_scorer version 0.1.20 (https://github.com/joshaven/string_score) -35. sublimehq/Packages (https://github.com/sublimehq/Packages) -36. SublimeText/PowerShell (https://github.com/SublimeText/PowerShell) -37. textmate/asp.vb.net.tmbundle (https://github.com/textmate/asp.vb.net.tmbundle) -38. textmate/c.tmbundle (https://github.com/textmate/c.tmbundle) -39. textmate/diff.tmbundle (https://github.com/textmate/diff.tmbundle) -40. textmate/git.tmbundle (https://github.com/textmate/git.tmbundle) -41. textmate/groovy.tmbundle (https://github.com/textmate/groovy.tmbundle) -42. textmate/html.tmbundle (https://github.com/textmate/html.tmbundle) -43. textmate/ini.tmbundle (https://github.com/textmate/ini.tmbundle) -44. textmate/java.tmbundle (https://github.com/textmate/java.tmbundle) -45. textmate/javadoc.tmbundle (https://github.com/textmate/javadoc.tmbundle) -46. textmate/javascript.tmbundle (https://github.com/textmate/javascript.tmbundle) -47. textmate/lua.tmbundle (https://github.com/textmate/lua.tmbundle) -48. textmate/make.tmbundle (https://github.com/textmate/make.tmbundle) -49. textmate/markdown.tmbundle (https://github.com/textmate/markdown.tmbundle) -50. textmate/perl.tmbundle (https://github.com/textmate/perl.tmbundle) -51. textmate/r.tmbundle (https://github.com/textmate/r.tmbundle) -52. textmate/ruby.tmbundle (https://github.com/textmate/ruby.tmbundle) -53. textmate/shellscript.tmbundle (https://github.com/textmate/shellscript.tmbundle) -54. textmate/sql.tmbundle (https://github.com/textmate/sql.tmbundle) -55. textmate/yaml.tmbundle (https://github.com/textmate/yaml.tmbundle) -56. typescript-legacy version 1.5 (https://github.com/Microsoft/TypeScript) -57. TypeScript-TmLanguage version 0.1.8 (https://github.com/Microsoft/TypeScript-TmLanguage) -58. vscode-swift version 0.0.1 (https://github.com/owensd/vscode-swift) +5. atom/language-java (https://github.com/atom/language-java) +6. atom/language-objective-c (https://github.com/atom/language-objective-c) +7. atom/language-sass version 0.52.0 (https://github.com/atom/language-sass) +8. atom/language-xml (https://github.com/atom/language-xml) +9. Benvie/JavaScriptNext.tmLanguage (https://github.com/Benvie/JavaScriptNext.tmLanguage) +10. chjj-marked version 0.3.2 (https://github.com/npmcomponent/chjj-marked) +11. chriskempson/tomorrow-theme (https://github.com/chriskempson/tomorrow-theme) +12. Colorsublime-Themes version 0.1.0 (https://github.com/Colorsublime/Colorsublime-Themes) +13. daaain/Handlebars (https://github.com/daaain/Handlebars) +14. davidrios/jade-tmbundle (https://github.com/davidrios/jade-tmbundle) +15. definitelytyped (https://github.com/DefinitelyTyped/DefinitelyTyped) +16. demyte/language-cshtml (https://github.com/demyte/language-cshtml) +17. dotnet/csharp-tmLanguage version 0.1.0 (https://github.com/dotnet/csharp-tmLanguage) +18. freebroccolo/atom-language-swift (https://github.com/freebroccolo/atom-language-swift) +19. HTML 5.1 W3C Working Draft version 08 October 2015 (http://www.w3.org/TR/2015/WD-html51-20151008/) +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. js-beautify version 1.6.8 (https://github.com/beautify-web/js-beautify) +23. Jxck/assert version 1.0.0 (https://github.com/Jxck/assert) +24. language-docker (https://github.com/moby/moby) +25. language-go version 0.39.0 (https://github.com/atom/language-go) +26. language-less (https://github.com/atom/language-less) +27. language-php (https://github.com/atom/language-php) +28. language-rust version 0.4.9 (https://github.com/zargony/atom-language-rust) +29. MagicStack/MagicPython (https://github.com/MagicStack/MagicPython) +30. Microsoft/TypeScript-TmLanguage version 0.0.1 (https://github.com/Microsoft/TypeScript-TmLanguage) +31. octicons-code version 3.1.0 (https://octicons.github.com) +32. octicons-font version 3.1.0 (https://octicons.github.com) +33. seti-ui version 0.1.0 (https://github.com/jesseweed/seti-ui) +34. shaders-tmLanguage version 0.1.0 (https://github.com/tgjones/shaders-tmLanguage) +35. string_scorer version 0.1.20 (https://github.com/joshaven/string_score) +36. sublimehq/Packages (https://github.com/sublimehq/Packages) +37. SublimeText/PowerShell (https://github.com/SublimeText/PowerShell) +38. textmate/asp.vb.net.tmbundle (https://github.com/textmate/asp.vb.net.tmbundle) +39. textmate/c.tmbundle (https://github.com/textmate/c.tmbundle) +40. textmate/diff.tmbundle (https://github.com/textmate/diff.tmbundle) +41. textmate/git.tmbundle (https://github.com/textmate/git.tmbundle) +42. textmate/groovy.tmbundle (https://github.com/textmate/groovy.tmbundle) +43. textmate/html.tmbundle (https://github.com/textmate/html.tmbundle) +44. textmate/ini.tmbundle (https://github.com/textmate/ini.tmbundle) +45. textmate/javascript.tmbundle (https://github.com/textmate/javascript.tmbundle) +46. textmate/lua.tmbundle (https://github.com/textmate/lua.tmbundle) +47. textmate/make.tmbundle (https://github.com/textmate/make.tmbundle) +48. textmate/markdown.tmbundle (https://github.com/textmate/markdown.tmbundle) +49. textmate/perl.tmbundle (https://github.com/textmate/perl.tmbundle) +50. textmate/r.tmbundle (https://github.com/textmate/r.tmbundle) +51. textmate/ruby.tmbundle (https://github.com/textmate/ruby.tmbundle) +52. textmate/shellscript.tmbundle (https://github.com/textmate/shellscript.tmbundle) +53. textmate/sql.tmbundle (https://github.com/textmate/sql.tmbundle) +54. textmate/yaml.tmbundle (https://github.com/textmate/yaml.tmbundle) +55. typescript-legacy version 1.5 (https://github.com/Microsoft/TypeScript) +56. TypeScript-TmLanguage version 0.1.8 (https://github.com/Microsoft/TypeScript-TmLanguage) +57. vscode-swift version 0.0.1 (https://github.com/owensd/vscode-swift) %% atom/language-c NOTICES AND INFORMATION BEGIN HERE @@ -246,6 +245,43 @@ suitability for any purpose. ========================================= END OF atom/language-css NOTICES AND INFORMATION +%% atom/language-java 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/textmate/java.tmbundle and distributed under the following +license, located in `README.mdown`: + +Permission to copy, use, modify, sell and distribute this +software is granted. This software is provided "as is" without +express or implied warranty, and with no claim as to its +suitability for any purpose. +========================================= +END OF atom/language-java NOTICES AND INFORMATION + %% atom/language-objective-c NOTICES AND INFORMATION BEGIN HERE ========================================= The MIT License (MIT) @@ -1701,42 +1737,6 @@ to the base-name name of the original file, and an extension of txt, html, or si ========================================= END OF textmate/ini.tmbundle NOTICES AND INFORMATION -%% textmate/java.tmbundle NOTICES AND INFORMATION BEGIN HERE -========================================= -Copyright (c) textmate-java.tmbundle project authors - -If not otherwise specified (see below), files in this repository fall under the following license: - -Permission to copy, use, modify, sell and distribute this -software is granted. This software is provided "as is" without -express or implied warranty, and with no claim as to its -suitability for any purpose. - -An exception is made for files in readable text which contain their own license information, -or files where an accompanying file exists (in the same directory) with a "-license" suffix added -to the base-name name of the original file, and an extension of txt, html, or similar. For example -"tidy" is accompanied by "tidy-license.txt". -========================================= -END OF textmate/java.tmbundle NOTICES AND INFORMATION - -%% textmate/javadoc.tmbundle NOTICES AND INFORMATION BEGIN HERE -========================================= -Copyright (c) textmate-javadoc.tmbundle project authors - -If not otherwise specified (see below), files in this repository fall under the following license: - -Permission to copy, use, modify, sell and distribute this -software is granted. This software is provided "as is" without -express or implied warranty, and with no claim as to its -suitability for any purpose. - -An exception is made for files in readable text which contain their own license information, -or files where an accompanying file exists (in the same directory) with a "-license" suffix added -to the base-name name of the original file, and an extension of txt, html, or similar. For example -"tidy" is accompanied by "tidy-license.txt". -========================================= -END OF textmate/javadoc.tmbundle NOTICES AND INFORMATION - %% textmate/javascript.tmbundle NOTICES AND INFORMATION BEGIN HERE ========================================= Copyright (c) textmate-javascript.tmbundle project authors diff --git a/appveyor.yml b/appveyor.yml index c18b32095bf3f6e4fe0a5610969307dab1c9644e..49e80fed313b4b73eae639586271e322ac28d7a8 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -4,7 +4,7 @@ environment: install: - ps: Install-Product node 7.4.0 x64 - - npm install -g npm --silent + - npm install -g npm@4 --silent - npm install -g gulp mocha --silent build_script: diff --git a/build/gulpfile.editor.js b/build/gulpfile.editor.js index 698941ad456f843482d5f0ff60da89059ce4ea89..4c0857170689e468faf3abee988cabada61dd27d 100644 --- a/build/gulpfile.editor.js +++ b/build/gulpfile.editor.js @@ -38,7 +38,6 @@ var editorResources = [ '!out-build/vs/base/browser/ui/splitview/**/*', '!out-build/vs/base/browser/ui/toolbar/**/*', '!out-build/vs/base/browser/ui/octiconLabel/**/*', - '!out-build/vs/editor/contrib/defineKeybinding/**/*', '!out-build/vs/workbench/**', '!**/test/**' ]; diff --git a/build/gulpfile.hygiene.js b/build/gulpfile.hygiene.js index 1c716b56f99c613199164a5333424aa12f09ef4f..f26b136d2ab9046827e540c19c882e965b0de06a 100644 --- a/build/gulpfile.hygiene.js +++ b/build/gulpfile.hygiene.js @@ -9,6 +9,7 @@ const gulp = require('gulp'); const filter = require('gulp-filter'); const es = require('event-stream'); const gulptslint = require('gulp-tslint'); +const gulpeslint = require('gulp-eslint'); const tsfmt = require('typescript-formatter'); const tslint = require('tslint'); @@ -95,8 +96,21 @@ const copyrightFilter = [ '!extensions/html/server/src/modes/typescript/*' ]; +const eslintFilter = [ + 'src/**/*.js', + '!src/vs/loader.js', + '!src/vs/css.js', + '!src/vs/nls.js', + '!src/vs/css.build.js', + '!src/vs/nls.build.js', + '!src/**/winjs.base.raw.js', + '!src/**/raw.marked.js', + '!**/test/**' +]; + const tslintFilter = [ 'src/**/*.ts', + 'test/**/*.ts', 'extensions/**/*.ts', '!**/fixtures/**', '!**/typings/**', @@ -124,6 +138,14 @@ function reportFailures(failures) { }); } +gulp.task('eslint', () => { + return gulp.src(all, { base: '.' }) + .pipe(filter(eslintFilter)) + .pipe(gulpeslint('src/.eslintrc')) + .pipe(gulpeslint.formatEach('compact')) + .pipe(gulpeslint.failAfterError()); +}); + gulp.task('tslint', () => { const options = { summarizeFailureOutput: true }; @@ -176,7 +198,6 @@ const hygiene = exports.hygiene = (some, options) => { }); const formatting = es.map(function (file, cb) { - tsfmt.processString(file.path, file.contents.toString('utf8'), { verify: true, tsfmt: true, @@ -209,17 +230,27 @@ const hygiene = exports.hygiene = (some, options) => { this.emit('data', file); }); - return gulp.src(some || all, { base: '.' }) + const result = gulp.src(some || all, { base: '.' }) .pipe(filter(f => !f.stat.isDirectory())) .pipe(filter(eolFilter)) .pipe(options.skipEOL ? es.through() : eol) .pipe(filter(indentationFilter)) .pipe(indentation) .pipe(filter(copyrightFilter)) - .pipe(copyrights) + .pipe(copyrights); + + const typescript = result .pipe(filter(tslintFilter)) .pipe(formatting) - .pipe(tsl) + .pipe(tsl); + + const javascript = result + .pipe(filter(eslintFilter)) + .pipe(gulpeslint('src/.eslintrc')) + .pipe(gulpeslint.formatEach('compact')) + .pipe(gulpeslint.failAfterError()); + + return es.merge(typescript, javascript) .pipe(es.through(null, function () { if (errorCount > 0) { this.emit('error', 'Hygiene failed with ' + errorCount + ' errors. Check \'build/gulpfile.hygiene.js\'.'); diff --git a/build/gulpfile.vscode.js b/build/gulpfile.vscode.js index 15d2edd0323db12464c5518544fa62e9cdf88da1..625afbc8b5dc7007694612cd4d581e527c1cdfd6 100644 --- a/build/gulpfile.vscode.js +++ b/build/gulpfile.vscode.js @@ -30,6 +30,9 @@ const product = require('../product.json'); const shrinkwrap = require('../npm-shrinkwrap.json'); const crypto = require('crypto'); const i18n = require('./lib/i18n'); +const glob = require('glob'); +const os = require('os'); +const cp = require('child_process'); const productDependencies = Object.keys(product.dependencies || {}); const dependencies = Object.keys(shrinkwrap.dependencies) @@ -42,8 +45,13 @@ const nodeModules = ['electron', 'original-fs'] // Build const builtInExtensions = [ - { name: 'ms-vscode.node-debug', version: '1.13.6' }, - { name: 'ms-vscode.node-debug2', version: '1.12.4' } + { name: 'ms-vscode.node-debug', version: '1.14.5' }, + { name: 'ms-vscode.node-debug2', version: '1.14.1' } +]; + +const excludedExtensions = [ + 'vscode-api-tests', + 'vscode-colorize-tests' ]; const vscodeEntryPoints = _.flatten([ @@ -84,6 +92,11 @@ const BUNDLED_FILE_HEADER = [ ' *--------------------------------------------------------*/' ].join('\n'); +var languages = ['chs', 'cht', 'jpn', 'kor', 'deu', 'fra', 'esn', 'rus', 'ita']; +if (process.env.VSCODE_QUALITY !== 'stable') { + languages = languages.concat(['ptb', 'hun', 'trk']); // Add languages requested by the community to non-stable builds +} + gulp.task('clean-optimized-vscode', util.rimraf('out-vscode')); gulp.task('optimize-vscode', ['clean-optimized-vscode', 'compile-build', 'compile-extensions-build'], common.optimizeTask({ entryPoints: vscodeEntryPoints, @@ -91,7 +104,8 @@ gulp.task('optimize-vscode', ['clean-optimized-vscode', 'compile-build', 'compil resources: vscodeResources, loaderConfig: common.loaderConfig(nodeModules), header: BUNDLED_FILE_HEADER, - out: 'out-vscode' + out: 'out-vscode', + languages: languages })); @@ -117,6 +131,8 @@ const config = { darwinIcon: 'resources/darwin/code.icns', darwinBundleIdentifier: product.darwinBundleIdentifier, darwinApplicationCategoryType: 'public.app-category.developer-tools', + darwinHelpBookFolder: 'VS Code HelpBook', + darwinHelpBookName: 'VS Code HelpBook', darwinBundleDocumentTypes: [{ name: product.nameLong + ' document', role: 'Editor', @@ -158,7 +174,6 @@ gulp.task('electron', ['clean-electron'], getElectron(process.arch)); gulp.task('electron-ia32', ['clean-electron'], getElectron('ia32')); gulp.task('electron-x64', ['clean-electron'], getElectron('x64')); -const languages = ['chs', 'cht', 'jpn', 'kor', 'deu', 'fra', 'esn', 'rus', 'ita', 'ptb']; /** * Compute checksums for some files. @@ -207,47 +222,49 @@ function packageTask(platform, arch, opts) { 'vs/workbench/electron-browser/workbench.main.js', 'vs/workbench/electron-browser/workbench.main.css', 'vs/workbench/electron-browser/bootstrap/index.html', - 'vs/workbench/electron-browser/bootstrap/index.js' + 'vs/workbench/electron-browser/bootstrap/index.js', + 'vs/workbench/electron-browser/bootstrap/preload.js' ]); const src = gulp.src(out + '/**', { base: '.' }) .pipe(rename(function (path) { path.dirname = path.dirname.replace(new RegExp('^' + out), 'out'); })) .pipe(util.setExecutableBit(['**/*.sh'])); - const extensionsList = [ - 'extensions/*/**', - '!extensions/*/src/**', - '!extensions/*/out/**/test/**', - '!extensions/*/test/**', - '!extensions/*/build/**', - '!extensions/**/node_modules/@types/**', - '!extensions/*/{client,server}/src/**', - '!extensions/*/{client,server}/test/**', - '!extensions/*/{client,server}/out/**/test/**', - '!extensions/*/{client,server}/out/**/typings/**', - '!extensions/**/.vscode/**', - '!extensions/**/tsconfig.json', - '!extensions/typescript/bin/**', - '!extensions/vscode-api-tests/**', - '!extensions/vscode-colorize-tests/**', - ...builtInExtensions.map(e => `!extensions/${e.name}/**`) - ]; - - const nlsFilter = filter('**/*.nls.json', { restore: true }); - const extensions = gulp.src(extensionsList, { base: '.' }) - // TODO@Dirk: this filter / buffer is here to make sure the nls.json files are buffered - .pipe(nlsFilter) - .pipe(buffer()) - .pipe(nlsDev.createAdditionalLanguageFiles(languages, path.join(__dirname, '..', 'i18n'))) - .pipe(nlsFilter.restore); + const root = path.resolve(path.join(__dirname, '..')); + const localExtensionDescriptions = glob.sync('extensions/*/package.json') + .map(manifestPath => { + const extensionPath = path.dirname(path.join(root, manifestPath)); + const extensionName = path.basename(extensionPath); + return { name: extensionName, path: extensionPath }; + }) + .filter(({ name }) => excludedExtensions.indexOf(name) === -1) + .filter(({ name }) => builtInExtensions.every(b => b.name !== name)); + + const localExtensions = es.merge(...localExtensionDescriptions.map(extension => { + const nlsFilter = filter('**/*.nls.json', { restore: true }); + + return ext.fromLocal(extension.path) + .pipe(rename(p => p.dirname = `extensions/${extension.name}/${p.dirname}`)) + // // TODO@Dirk: this filter / buffer is here to make sure the nls.json files are buffered + .pipe(nlsFilter) + .pipe(buffer()) + .pipe(nlsDev.createAdditionalLanguageFiles(languages, path.join(__dirname, '..', 'i18n'))) + .pipe(nlsFilter.restore); + })); + + const localExtensionDependencies = gulp.src('extensions/node_modules/**', { base: '.' }); const marketplaceExtensions = es.merge(...builtInExtensions.map(extension => { - return ext.src(extension.name, extension.version) + return ext.fromMarketplace(extension.name, extension.version) .pipe(rename(p => p.dirname = `extensions/${extension.name}/${p.dirname}`)); })); - const sources = es.merge(src, extensions, marketplaceExtensions) - .pipe(filter(['**', '!**/*.js.map'])); + const sources = es.merge( + src, + localExtensions, + localExtensionDependencies, + marketplaceExtensions + ).pipe(filter(['**', '!**/*.js.map'])); let version = packageJson.version; const quality = product.quality; @@ -274,7 +291,7 @@ function packageTask(platform, arch, opts) { const deps = gulp.src(depsSrc, { base: '.', dot: true }) .pipe(util.cleanNodeModule('fsevents', ['binding.gyp', 'fsevents.cc', 'build/**', 'src/**', 'test/**'], ['**/*.node'])) - .pipe(util.cleanNodeModule('oniguruma', ['binding.gyp', 'build/**', 'src/**', 'deps/**'], ['**/*.node'])) + .pipe(util.cleanNodeModule('oniguruma', ['binding.gyp', 'build/**', 'src/**', 'deps/**'], ['**/*.node', 'src/*.js'])) .pipe(util.cleanNodeModule('windows-mutex', ['binding.gyp', 'build/**', 'src/**'], ['**/*.node'])) .pipe(util.cleanNodeModule('native-keymap', ['binding.gyp', 'build/**', 'src/**', 'deps/**'], ['**/*.node'])) .pipe(util.cleanNodeModule('jschardet', ['dist/**'])) @@ -282,6 +299,7 @@ function packageTask(platform, arch, opts) { .pipe(util.cleanNodeModule('gc-signals', ['binding.gyp', 'build/**', 'src/**', 'deps/**'], ['**/*.node', 'src/index.js'])) .pipe(util.cleanNodeModule('v8-profiler', ['binding.gyp', 'build/**', 'src/**', 'deps/**'], ['**/*.node', 'src/index.js'])) .pipe(util.cleanNodeModule('node-pty', ['binding.gyp', 'build/**', 'src/**', 'tools/**'], ['build/Release/**'])) + .pipe(util.cleanNodeModule('nsfw', ['binding.gyp', 'build/**', 'src/**', 'openpa/**', 'includes/**'], ['**/*.node', '**/*.a'])) .pipe(util.cleanNodeModule('vsda', ['binding.gyp', 'README.md', 'build/**', '*.bat', '*.sh', '*.cpp', '*.h'], ['build/Release/vsda.node'])); let all = es.merge( @@ -353,6 +371,53 @@ gulp.task('vscode-linux-ia32-min', ['minify-vscode', 'clean-vscode-linux-ia32'], gulp.task('vscode-linux-x64-min', ['minify-vscode', 'clean-vscode-linux-x64'], packageTask('linux', 'x64', { minified: true })); gulp.task('vscode-linux-arm-min', ['minify-vscode', 'clean-vscode-linux-arm'], packageTask('linux', 'arm', { minified: true })); +// --- v8 snapshots --- + +function snapshotTask(platform, arch) { + + const destination = path.join(path.dirname(root), 'VSCode') + (platform ? '-' + platform : '') + (arch ? '-' + arch : ''); + const command = path.join(process.cwd(), 'node_modules/.bin/mksnapshot'); + + let startupBlobFilepath; + + if (platform === 'darwin') { + startupBlobFilepath = path.join(destination, 'Code - OSS.app/Contents/Frameworks/Electron Framework.framework/Resources/snapshot_blob.bin') + } else if (platform === 'windows') { + startupBlobFilepath = path.join(destination, 'snapshot_blob.bin') + // TODO + return () => { }; + } else if (platform === 'linux') { + // TODO + return () => { }; + } + + return () => { + const inputFile = fs.readFileSync(path.join(destination, 'Code - OSS.app/Contents/Resources/app/out/vs/loader.js')); + const wrappedInputFile = ` + var Monaco_Loader_Init; + (function() { + var doNotInitLoader = true; + ${inputFile.toString()}; + Monaco_Loader_Init = function() { + AMDLoader.init(); + CSSLoaderPlugin.init(); + NLSLoaderPlugin.init(); + + return define; + } + })(); + `; + const wrappedInputFilepath = path.join(os.tmpdir(), 'wrapped-loader.js'); + console.log(wrappedInputFilepath); + fs.writeFileSync(wrappedInputFilepath, wrappedInputFile); + + cp.execFileSync(command, [wrappedInputFilepath, `--startup_blob`, startupBlobFilepath]); + } +} + +gulp.task('vscode-darwin-snapshots', ['vscode-darwin'], snapshotTask('darwin', undefined)); + + // Transifex Localizations const vscodeLanguages = [ 'zh-hans', @@ -364,7 +429,9 @@ const vscodeLanguages = [ 'es', 'ru', 'it', - 'pt-br' + 'pt-br', + 'hu', + 'tr' ]; const setupDefaultLanguages = [ 'zh-hans', diff --git a/build/gulpfile.vscode.win32.js b/build/gulpfile.vscode.win32.js index a4ebd283ee00d670a6f35d6c75ff62823c0e0ff4..8630284bc1f6315424f24454c5df5255d2e9b55b 100644 --- a/build/gulpfile.vscode.win32.js +++ b/build/gulpfile.vscode.win32.js @@ -40,6 +40,9 @@ function packageInnoSetup(iss, options, cb) { function buildWin32Setup(arch) { return cb => { + const ia32AppId = product.win32AppId; + const x64AppId = product.win32x64AppId; + const definitions = { NameLong: product.nameLong, NameShort: product.nameShort, @@ -51,8 +54,12 @@ function buildWin32Setup(arch) { RegValueName: product.win32RegValueName, ShellNameShort: product.win32ShellNameShort, AppMutex: product.win32MutexName, - AppId: product.win32AppId, + Arch: arch, + AppId: arch === 'ia32' ? ia32AppId : x64AppId, + IncompatibleAppId: arch === 'ia32' ? x64AppId : ia32AppId, AppUserId: product.win32AppUserModelId, + ArchitecturesAllowed: arch === 'ia32' ? '' : 'x64', + ArchitecturesInstallIn64BitMode: arch === 'ia32' ? '' : 'x64', SourceDir: buildPath(arch), RepoDir: repoPath, OutputDir: setupDir(arch) @@ -70,9 +77,9 @@ gulp.task('vscode-win32-x64-setup', ['clean-vscode-win32-x64-setup'], buildWin32 function archiveWin32Setup(arch) { return cb => { - const args = ['a', '-tzip', zipPath(arch), buildPath(arch), '-r']; + const args = ['a', '-tzip', zipPath(arch), '.', '-r']; - cp.spawn(_7z, args, { stdio: 'inherit' }) + cp.spawn(_7z, args, { stdio: 'inherit', cwd: buildPath(arch) }) .on('error', cb) .on('exit', () => cb(null)); }; diff --git a/build/lib/bundle.js b/build/lib/bundle.js index 5a51bde215606c76480e462d98105407a0deccb1..89c5b9b50bd51151c5b38c3d4791d57de82c2982 100644 --- a/build/lib/bundle.js +++ b/build/lib/bundle.js @@ -31,6 +31,9 @@ function bundle(entryPoints, config, callback) { r.call({}, require, loaderModule, loaderModule.exports); var loader = loaderModule.exports; config.isBuild = true; + config.paths = config.paths || {}; + config.paths['vs/nls'] = 'out-build/vs/nls.build'; + config.paths['vs/css'] = 'out-build/vs/css.build'; loader.config(config); loader(['require'], function (localRequire) { var resolvePath = function (path) { diff --git a/build/lib/bundle.ts b/build/lib/bundle.ts index 99023978ecc253f3f4f1d97f5132710215af8287..e188ce44de1d7bfe48820f9142a1fc6116a769e6 100644 --- a/build/lib/bundle.ts +++ b/build/lib/bundle.ts @@ -91,6 +91,7 @@ interface IPartialBundleResult { export interface ILoaderConfig { isBuild?: boolean; + paths?: { [path: string]: any; }; } /** @@ -121,6 +122,9 @@ export function bundle(entryPoints: IEntryPoint[], config: ILoaderConfig, callba var loader: any = loaderModule.exports; config.isBuild = true; + config.paths = config.paths || {}; + config.paths['vs/nls'] = 'out-build/vs/nls.build'; + config.paths['vs/css'] = 'out-build/vs/css.build'; loader.config(config); loader(['require'], (localRequire) => { diff --git a/build/lib/compilation.js b/build/lib/compilation.js index d9691ebc1d2d97bcfecc3d46bf2bd27485eac01d..715ceeb4ede77e7d6cccb35c98ce5dd1efcbd255 100644 --- a/build/lib/compilation.js +++ b/build/lib/compilation.js @@ -41,7 +41,6 @@ function createCompile(build, emitError) { .pipe(tsFilter) .pipe(util.loadSourcemaps()) .pipe(ts(token)) - .pipe(build ? reloadTypeScriptNodeModule() : es.through()) .pipe(noDeclarationsFilter) .pipe(build ? nls() : es.through()) .pipe(noDeclarationsFilter.restore) @@ -58,7 +57,7 @@ function createCompile(build, emitError) { function compileTask(out, build) { return function () { var compile = createCompile(build, true); - var src = es.merge(gulp.src('src/**', { base: 'src' }), gulp.src('node_modules/typescript/lib/lib.d.ts'), gulp.src('node_modules/@types/**/index.d.ts')); + var src = es.merge(gulp.src('src/**', { base: 'src' }), gulp.src('node_modules/typescript/lib/lib.d.ts')); return src .pipe(compile()) .pipe(gulp.dest(out)) @@ -69,7 +68,7 @@ exports.compileTask = compileTask; function watchTask(out, build) { return function () { var compile = createCompile(build); - var src = es.merge(gulp.src('src/**', { base: 'src' }), gulp.src('node_modules/typescript/lib/lib.d.ts'), gulp.src('node_modules/@types/**/index.d.ts')); + var src = es.merge(gulp.src('src/**', { base: 'src' }), gulp.src('node_modules/typescript/lib/lib.d.ts')); var watchSrc = watch('src/**', { base: 'src' }); return watchSrc .pipe(util.incremental(compile, src, true)) diff --git a/build/lib/compilation.ts b/build/lib/compilation.ts index e347cc07d5a414b3ead42e04a8db9ed98817ebbe..f1ca31f36e8fbefc91f7dda653f3b877cf1b3e15 100644 --- a/build/lib/compilation.ts +++ b/build/lib/compilation.ts @@ -49,7 +49,7 @@ function createCompile(build: boolean, emitError?: boolean): (token?: util.ICanc .pipe(tsFilter) .pipe(util.loadSourcemaps()) .pipe(ts(token)) - .pipe(build ? reloadTypeScriptNodeModule() : es.through()) + // .pipe(build ? reloadTypeScriptNodeModule() : es.through()) .pipe(noDeclarationsFilter) .pipe(build ? nls() : es.through()) .pipe(noDeclarationsFilter.restore) @@ -73,7 +73,6 @@ export function compileTask(out: string, build: boolean): () => NodeJS.ReadWrite const src = es.merge( gulp.src('src/**', { base: 'src' }), gulp.src('node_modules/typescript/lib/lib.d.ts'), - gulp.src('node_modules/@types/**/index.d.ts') ); return src @@ -91,7 +90,6 @@ export function watchTask(out: string, build: boolean): () => NodeJS.ReadWriteSt const src = es.merge( gulp.src('src/**', { base: 'src' }), gulp.src('node_modules/typescript/lib/lib.d.ts'), - gulp.src('node_modules/@types/**/index.d.ts') ); const watchSrc = watch('src/**', { base: 'src' }); diff --git a/build/lib/extensions.js b/build/lib/extensions.js index b1b354abcff10a4015c10df53774b41a1114c5de..7989297a9470b09d54c0fce04642bc05719daa41 100644 --- a/build/lib/extensions.js +++ b/build/lib/extensions.js @@ -4,7 +4,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ Object.defineProperty(exports, "__esModule", { value: true }); -var event_stream_1 = require("event-stream"); +var es = require("event-stream"); var assign = require("object-assign"); var remote = require("gulp-remote-src"); var flatmap = require('gulp-flatmap'); @@ -14,8 +14,29 @@ var rename = require('gulp-rename'); var util = require('gulp-util'); var buffer = require('gulp-buffer'); var json = require('gulp-json-editor'); +var fs = require("fs"); +var path = require("path"); +var vsce = require("vsce"); +var File = require("vinyl"); +function fromLocal(extensionPath) { + var result = es.through(); + vsce.listFiles({ cwd: extensionPath }) + .then(function (fileNames) { + var files = fileNames + .map(function (fileName) { return path.join(extensionPath, fileName); }) + .map(function (filePath) { return new File({ + path: filePath, + base: extensionPath, + contents: fs.createReadStream(filePath) + }); }); + es.readArray(files).pipe(result); + }) + .catch(function (err) { return result.emit('error', err); }); + return result; +} +exports.fromLocal = fromLocal; function error(err) { - var result = event_stream_1.through(); + var result = es.through(); setTimeout(function () { return result.emit('error', err); }); return result; } @@ -23,7 +44,7 @@ var baseHeaders = { 'X-Market-Client-Id': 'VSCode Build', 'User-Agent': 'VSCode Build', }; -function src(extensionName, version) { +function fromMarketplace(extensionName, version) { var filterType = 7; var value = extensionName; var criterium = { filterType: filterType, value: value }; @@ -93,4 +114,4 @@ function src(extensionName, version) { })); })); } -exports.src = src; +exports.fromMarketplace = fromMarketplace; diff --git a/build/lib/extensions.ts b/build/lib/extensions.ts index 7955c55eac07388e36ed42437765b64c75100b7b..17349f7ee940f11d904096df398ee4c269f9eaef 100644 --- a/build/lib/extensions.ts +++ b/build/lib/extensions.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { through } from 'event-stream'; +import * as es from 'event-stream'; import { Stream } from 'stream'; import assign = require('object-assign'); import remote = require('gulp-remote-src'); @@ -14,9 +14,33 @@ const rename = require('gulp-rename'); const util = require('gulp-util'); const buffer = require('gulp-buffer'); const json = require('gulp-json-editor'); +import * as fs from 'fs'; +import * as path from 'path'; +import * as vsce from 'vsce'; +import * as File from 'vinyl'; + +export function fromLocal(extensionPath: string): Stream { + const result = es.through(); + + vsce.listFiles({ cwd: extensionPath }) + .then(fileNames => { + const files = fileNames + .map(fileName => path.join(extensionPath, fileName)) + .map(filePath => new File({ + path: filePath, + base: extensionPath, + contents: fs.createReadStream(filePath) as any + })); + + es.readArray(files).pipe(result); + }) + .catch(err => result.emit('error', err)); + + return result; +} function error(err: any): Stream { - const result = through(); + const result = es.through(); setTimeout(() => result.emit('error', err)); return result; } @@ -26,7 +50,7 @@ const baseHeaders = { 'User-Agent': 'VSCode Build', }; -export function src(extensionName: string, version: string): Stream { +export function fromMarketplace(extensionName: string, version: string): Stream { const filterType = 7; const value = extensionName; const criterium = { filterType, value }; diff --git a/build/lib/i18n.js b/build/lib/i18n.js index 3f16ccc97f1835c198b81856db10b9d5209c527c..1ade4703c61e4c5ce7516800f9121ff54b04778c 100644 --- a/build/lib/i18n.js +++ b/build/lib/i18n.js @@ -207,17 +207,6 @@ XLF.parse = function (xlfString) { }); }; exports.XLF = XLF; -var vscodeLanguages = [ - 'chs', - 'cht', - 'jpn', - 'kor', - 'deu', - 'fra', - 'esn', - 'rus', - 'ita' -]; var iso639_3_to_2 = { 'chs': 'zh-cn', 'cht': 'zh-tw', @@ -347,7 +336,7 @@ function escapeCharacters(value) { } return result.join(''); } -function processCoreBundleFormat(fileHeader, json, emitter) { +function processCoreBundleFormat(fileHeader, languages, json, emitter) { var keysSection = json.keys; var messageSection = json.messages; var bundleSection = json.bundles; @@ -375,8 +364,14 @@ function processCoreBundleFormat(fileHeader, json, emitter) { }); }); var languageDirectory = path.join(__dirname, '..', '..', 'i18n'); - var languages = sortLanguages(fs.readdirSync(languageDirectory).filter(function (item) { return fs.statSync(path.join(languageDirectory, item)).isDirectory(); })); - languages.forEach(function (language) { + var languageDirs; + if (languages) { + languageDirs = sortLanguages(languages); + } + else { + languageDirs = sortLanguages(fs.readdirSync(languageDirectory).filter(function (item) { return fs.statSync(path.join(languageDirectory, item)).isDirectory(); })); + } + languageDirs.forEach(function (language) { if (!language.iso639_2) { return; } @@ -448,7 +443,8 @@ function processCoreBundleFormat(fileHeader, json, emitter) { var value = statistics[key]; log(key + " has " + value + " untranslated strings."); }); - vscodeLanguages.forEach(function (language) { + languageDirs.forEach(function (dir) { + var language = dir.name; var iso639_2 = iso639_3_to_2[language]; if (!iso639_2) { log("\tCouldn't find iso639 2 mapping for language " + language + ". Using default language instead."); @@ -473,7 +469,7 @@ function processNlsFiles(opts) { this.emit('error', "Failed to read component file: " + file.relative); } if (BundledFormat.is(json)) { - processCoreBundleFormat(opts.fileHeader, json, this); + processCoreBundleFormat(opts.fileHeader, opts.languages, json, this); } } this.emit('data', file); @@ -505,55 +501,6 @@ function prepareXlfFiles(projectName, extensionName) { } exports.prepareXlfFiles = prepareXlfFiles; var editorProject = 'vscode-editor', workbenchProject = 'vscode-workbench', extensionsProject = 'vscode-extensions', setupProject = 'vscode-setup'; -/** - * Ensure to update those arrays when new resources are pushed to Transifex. - * Used because Transifex does not have API method to pull all project resources. - */ -var editorResources = [ - { name: 'vs/platform', project: editorProject }, - { name: 'vs/editor/contrib', project: editorProject }, - { name: 'vs/editor', project: editorProject }, - { name: 'vs/base', project: editorProject } -]; -var workbenchResources = [ - { name: 'vs/code', project: workbenchProject }, - { name: 'vs/workbench', project: workbenchProject }, - { name: 'vs/workbench/parts/cli', project: workbenchProject }, - { name: 'vs/workbench/parts/codeEditor', project: workbenchProject }, - { name: 'vs/workbench/parts/debug', project: workbenchProject }, - { name: 'vs/workbench/parts/emmet', project: workbenchProject }, - { name: 'vs/workbench/parts/execution', project: workbenchProject }, - { name: 'vs/workbench/parts/explorers', project: workbenchProject }, - { name: 'vs/workbench/parts/extensions', project: workbenchProject }, - { name: 'vs/workbench/parts/feedback', project: workbenchProject }, - { name: 'vs/workbench/parts/files', project: workbenchProject }, - { name: 'vs/workbench/parts/html', project: workbenchProject }, - { name: 'vs/workbench/parts/markers', project: workbenchProject }, - { name: 'vs/workbench/parts/nps', project: workbenchProject }, - { name: 'vs/workbench/parts/output', project: workbenchProject }, - { name: 'vs/workbench/parts/performance', project: workbenchProject }, - { name: 'vs/workbench/parts/preferences', project: workbenchProject }, - { name: 'vs/workbench/parts/quickopen', project: workbenchProject }, - { name: 'vs/workbench/parts/scm', project: workbenchProject }, - { name: 'vs/workbench/parts/search', project: workbenchProject }, - { name: 'vs/workbench/parts/snippets', project: workbenchProject }, - { name: 'vs/workbench/parts/tasks', project: workbenchProject }, - { name: 'vs/workbench/parts/terminal', project: workbenchProject }, - { name: 'vs/workbench/parts/themes', project: workbenchProject }, - { name: 'vs/workbench/parts/trust', project: workbenchProject }, - { name: 'vs/workbench/parts/update', project: workbenchProject }, - { name: 'vs/workbench/parts/watermark', project: workbenchProject }, - { name: 'vs/workbench/parts/welcome', project: workbenchProject }, - { name: 'vs/workbench/services/configuration', project: workbenchProject }, - { name: 'vs/workbench/services/editor', project: workbenchProject }, - { name: 'vs/workbench/services/files', project: workbenchProject }, - { name: 'vs/workbench/services/keybinding', project: workbenchProject }, - { name: 'vs/workbench/services/message', project: workbenchProject }, - { name: 'vs/workbench/services/mode', project: workbenchProject }, - { name: 'vs/workbench/services/textfile', project: workbenchProject }, - { name: 'vs/workbench/services/themes', project: workbenchProject }, - { name: 'setup_messages', project: workbenchProject } -]; function getResource(sourceFile) { var resource; if (/^vs\/platform/.test(sourceFile)) { @@ -824,10 +771,12 @@ function updateResource(project, slug, xlfFile, apiHostname, credentials) { function obtainProjectResources(projectName) { var resources = []; if (projectName === editorProject) { - resources = editorResources; + var json = fs.readFileSync('./build/lib/i18n.resources.json', 'utf8'); + resources = JSON.parse(json).editor; } else if (projectName === workbenchProject) { - resources = workbenchResources; + var json = fs.readFileSync('./build/lib/i18n.resources.json', 'utf8'); + resources = JSON.parse(json).workbench; } else if (projectName === extensionsProject) { var extensionsToLocalize = glob.sync('./extensions/**/*.nls.json').map(function (extension) { return extension.split('/')[2]; }); @@ -969,7 +918,9 @@ var encodings = { 'esn': 'CP1252', 'rus': 'CP1251', 'ita': 'CP1252', - 'ptb': 'CP1252' + 'ptb': 'CP1252', + 'hun': 'CP1250', + 'trk': 'CP1254' }; function createIslFile(base, originalFilePath, messages, language) { var content = []; diff --git a/build/lib/i18n.resources.json b/build/lib/i18n.resources.json new file mode 100644 index 0000000000000000000000000000000000000000..562ba4de46bc8b7d42529a532d4741b69575e885 --- /dev/null +++ b/build/lib/i18n.resources.json @@ -0,0 +1,194 @@ +{ + "editor": [ + { + "name": "vs/platform", + "project": "vscode-editor" + }, + { + "name": "vs/editor/contrib", + "project": "vscode-editor" + }, + { + "name": "vs/editor", + "project": "vscode-editor" + }, + { + "name": "vs/base", + "project": "vscode-editor" + } + ], + "workbench": [ + { + "name": "vs/code", + "project": "vscode-workbench" + }, + { + "name": "vs/workbench", + "project": "vscode-workbench" + }, + { + "name": "vs/workbench/parts/cli", + "project": "vscode-workbench" + }, + { + "name": "vs/workbench/parts/codeEditor", + "project": "vscode-workbench" + }, + { + "name": "vs/workbench/parts/debug", + "project": "vscode-workbench" + }, + { + "name": "vs/workbench/parts/emmet", + "project": "vscode-workbench" + }, + { + "name": "vs/workbench/parts/execution", + "project": "vscode-workbench" + }, + { + "name": "vs/workbench/parts/explorers", + "project": "vscode-workbench" + }, + { + "name": "vs/workbench/parts/extensions", + "project": "vscode-workbench" + }, + { + "name": "vs/workbench/parts/feedback", + "project": "vscode-workbench" + }, + { + "name": "vs/workbench/parts/files", + "project": "vscode-workbench" + }, + { + "name": "vs/workbench/parts/html", + "project": "vscode-workbench" + }, + { + "name": "vs/workbench/parts/markers", + "project": "vscode-workbench" + }, + { + "name": "vs/workbench/parts/nps", + "project": "vscode-workbench" + }, + { + "name": "vs/workbench/parts/output", + "project": "vscode-workbench" + }, + { + "name": "vs/workbench/parts/performance", + "project": "vscode-workbench" + }, + { + "name": "vs/workbench/parts/preferences", + "project": "vscode-workbench" + }, + { + "name": "vs/workbench/parts/quickopen", + "project": "vscode-workbench" + }, + { + "name": "vs/workbench/parts/relauncher", + "project": "vscode-workbench" + }, + { + "name": "vs/workbench/parts/scm", + "project": "vscode-workbench" + }, + { + "name": "vs/workbench/parts/search", + "project": "vscode-workbench" + }, + { + "name": "vs/workbench/parts/snippets", + "project": "vscode-workbench" + }, + { + "name": "vs/workbench/parts/surveys", + "project": "vscode-workbench" + }, + { + "name": "vs/workbench/parts/tasks", + "project": "vscode-workbench" + }, + { + "name": "vs/workbench/parts/terminal", + "project": "vscode-workbench" + }, + { + "name": "vs/workbench/parts/themes", + "project": "vscode-workbench" + }, + { + "name": "vs/workbench/parts/trust", + "project": "vscode-workbench" + }, + { + "name": "vs/workbench/parts/update", + "project": "vscode-workbench" + }, + { + "name": "vs/workbench/parts/views", + "project": "vscode-workbench" + }, + { + "name": "vs/workbench/parts/watermark", + "project": "vscode-workbench" + }, + { + "name": "vs/workbench/parts/welcome", + "project": "vscode-workbench" + }, + { + "name": "vs/workbench/services/configuration", + "project": "vscode-workbench" + }, + { + "name": "vs/workbench/services/crashReporter", + "project": "vscode-workbench" + }, + { + "name": "vs/workbench/services/editor", + "project": "vscode-workbench" + }, + { + "name": "vs/workbench/services/files", + "project": "vscode-workbench" + }, + { + "name": "vs/workbench/services/keybinding", + "project": "vscode-workbench" + }, + { + "name": "vs/workbench/services/message", + "project": "vscode-workbench" + }, + { + "name": "vs/workbench/services/mode", + "project": "vscode-workbench" + }, + { + "name": "vs/workbench/services/progress", + "project": "vscode-workbench" + }, + { + "name": "vs/workbench/services/textfile", + "project": "vscode-workbench" + }, + { + "name": "vs/workbench/services/textMate", + "project": "vscode-workbench" + }, + { + "name": "vs/workbench/services/themes", + "project": "vscode-workbench" + }, + { + "name": "setup_messages", + "project": "vscode-workbench" + } + ] +} \ No newline at end of file diff --git a/build/lib/i18n.ts b/build/lib/i18n.ts index 9667b01fa2fd8b19728603b26418a427c51e0fff..2d2724a4147ec8105d1ece55db3c5cd0e9be82be 100644 --- a/build/lib/i18n.ts +++ b/build/lib/i18n.ts @@ -272,18 +272,6 @@ export class XLF { }; } -const vscodeLanguages: string[] = [ - 'chs', - 'cht', - 'jpn', - 'kor', - 'deu', - 'fra', - 'esn', - 'rus', - 'ita' -]; - const iso639_3_to_2: Map = { 'chs': 'zh-cn', 'cht': 'zh-tw', @@ -420,7 +408,7 @@ function escapeCharacters(value: string): string { return result.join(''); } -function processCoreBundleFormat(fileHeader: string, json: BundledFormat, emitter: any) { +function processCoreBundleFormat(fileHeader: string, languages: string[], json: BundledFormat, emitter: any) { let keysSection = json.keys; let messageSection = json.messages; let bundleSection = json.bundles; @@ -450,8 +438,13 @@ function processCoreBundleFormat(fileHeader: string, json: BundledFormat, emitte }); let languageDirectory = path.join(__dirname, '..', '..', 'i18n'); - let languages = sortLanguages(fs.readdirSync(languageDirectory).filter((item) => fs.statSync(path.join(languageDirectory, item)).isDirectory())); - languages.forEach((language) => { + let languageDirs; + if (languages) { + languageDirs = sortLanguages(languages); + } else { + languageDirs = sortLanguages(fs.readdirSync(languageDirectory).filter((item) => fs.statSync(path.join(languageDirectory, item)).isDirectory())); + } + languageDirs.forEach((language) => { if (!language.iso639_2) { return; } @@ -523,7 +516,8 @@ function processCoreBundleFormat(fileHeader: string, json: BundledFormat, emitte let value = statistics[key]; log(`${key} has ${value} untranslated strings.`); }); - vscodeLanguages.forEach(language => { + languageDirs.forEach(dir => { + const language = dir.name; let iso639_2 = iso639_3_to_2[language]; if (!iso639_2) { log(`\tCouldn't find iso639 2 mapping for language ${language}. Using default language instead.`); @@ -536,7 +530,7 @@ function processCoreBundleFormat(fileHeader: string, json: BundledFormat, emitte }); } -export function processNlsFiles(opts: { fileHeader: string; }): ThroughStream { +export function processNlsFiles(opts: { fileHeader: string; languages: string[] }): ThroughStream { return through(function (file: File) { let fileName = path.basename(file.path); if (fileName === 'nls.metadata.json') { @@ -547,7 +541,7 @@ export function processNlsFiles(opts: { fileHeader: string; }): ThroughStream { this.emit('error', `Failed to read component file: ${file.relative}`); } if (BundledFormat.is(json)) { - processCoreBundleFormat(opts.fileHeader, json, this); + processCoreBundleFormat(opts.fileHeader, opts.languages, json, this); } } this.emit('data', file); @@ -584,56 +578,6 @@ const editorProject: string = 'vscode-editor', extensionsProject: string = 'vscode-extensions', setupProject: string = 'vscode-setup'; -/** - * Ensure to update those arrays when new resources are pushed to Transifex. - * Used because Transifex does not have API method to pull all project resources. - */ -const editorResources: Resource[] = [ - { name: 'vs/platform', project: editorProject }, - { name: 'vs/editor/contrib', project: editorProject }, - { name: 'vs/editor', project: editorProject }, - { name: 'vs/base', project: editorProject } -]; -const workbenchResources: Resource[] = [ - { name: 'vs/code', project: workbenchProject }, - { name: 'vs/workbench', project: workbenchProject }, - { name: 'vs/workbench/parts/cli', project: workbenchProject }, - { name: 'vs/workbench/parts/codeEditor', project: workbenchProject }, - { name: 'vs/workbench/parts/debug', project: workbenchProject }, - { name: 'vs/workbench/parts/emmet', project: workbenchProject }, - { name: 'vs/workbench/parts/execution', project: workbenchProject }, - { name: 'vs/workbench/parts/explorers', project: workbenchProject }, - { name: 'vs/workbench/parts/extensions', project: workbenchProject }, - { name: 'vs/workbench/parts/feedback', project: workbenchProject }, - { name: 'vs/workbench/parts/files', project: workbenchProject }, - { name: 'vs/workbench/parts/html', project: workbenchProject }, - { name: 'vs/workbench/parts/markers', project: workbenchProject }, - { name: 'vs/workbench/parts/nps', project: workbenchProject }, - { name: 'vs/workbench/parts/output', project: workbenchProject }, - { name: 'vs/workbench/parts/performance', project: workbenchProject }, - { name: 'vs/workbench/parts/preferences', project: workbenchProject }, - { name: 'vs/workbench/parts/quickopen', project: workbenchProject }, - { name: 'vs/workbench/parts/scm', project: workbenchProject }, - { name: 'vs/workbench/parts/search', project: workbenchProject }, - { name: 'vs/workbench/parts/snippets', project: workbenchProject }, - { name: 'vs/workbench/parts/tasks', project: workbenchProject }, - { name: 'vs/workbench/parts/terminal', project: workbenchProject }, - { name: 'vs/workbench/parts/themes', project: workbenchProject }, - { name: 'vs/workbench/parts/trust', project: workbenchProject }, - { name: 'vs/workbench/parts/update', project: workbenchProject }, - { name: 'vs/workbench/parts/watermark', project: workbenchProject }, - { name: 'vs/workbench/parts/welcome', project: workbenchProject }, - { name: 'vs/workbench/services/configuration', project: workbenchProject }, - { name: 'vs/workbench/services/editor', project: workbenchProject }, - { name: 'vs/workbench/services/files', project: workbenchProject }, - { name: 'vs/workbench/services/keybinding', project: workbenchProject }, - { name: 'vs/workbench/services/message', project: workbenchProject }, - { name: 'vs/workbench/services/mode', project: workbenchProject }, - { name: 'vs/workbench/services/textfile', project: workbenchProject }, - { name: 'vs/workbench/services/themes', project: workbenchProject }, - { name: 'setup_messages', project: workbenchProject } -]; - export function getResource(sourceFile: string): Resource { let resource: string; @@ -924,9 +868,11 @@ function obtainProjectResources(projectName: string): Resource[] { let resources: Resource[] = []; if (projectName === editorProject) { - resources = editorResources; + const json = fs.readFileSync('./build/lib/i18n.resources.json', 'utf8'); + resources = JSON.parse(json).editor; } else if (projectName === workbenchProject) { - resources = workbenchResources; + const json = fs.readFileSync('./build/lib/i18n.resources.json', 'utf8'); + resources = JSON.parse(json).workbench; } else if (projectName === extensionsProject) { let extensionsToLocalize: string[] = glob.sync('./extensions/**/*.nls.json').map(extension => extension.split('/')[2]); let resourcesToPull: string[] = []; @@ -1086,7 +1032,9 @@ const encodings: Map = { 'esn': 'CP1252', 'rus': 'CP1251', 'ita': 'CP1252', - 'ptb': 'CP1252' + 'ptb': 'CP1252', + 'hun': 'CP1250', + 'trk': 'CP1254' }; function createIslFile(base: string, originalFilePath: string, messages: Map, language: string): File { diff --git a/build/lib/nls.js b/build/lib/nls.js index da8e6a27a5338909f04f9352100ca5eb6c0d4118..99a77feb182c2012e71e32bd703fcf5f97401278 100644 --- a/build/lib/nls.js +++ b/build/lib/nls.js @@ -1,5 +1,9 @@ "use strict"; -var ts = require("./typescript/typescriptServices"); +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +var ts = require("typescript"); var lazy = require("lazy.js"); var event_stream_1 = require("event-stream"); var File = require("vinyl"); @@ -69,7 +73,7 @@ function nls() { return event_stream_1.duplex(input, output); } function isImportNode(node) { - return node.kind === 212 /* ImportDeclaration */ || node.kind === 211 /* ImportEqualsDeclaration */; + return node.kind === ts.SyntaxKind.ImportDeclaration || node.kind === ts.SyntaxKind.ImportEqualsDeclaration; } (function (nls_1) { function fileFrom(file, contents, path) { @@ -111,27 +115,27 @@ function isImportNode(node) { if (!ts.textSpanContainsTextSpan({ start: node.pos, length: node.end - node.pos }, textSpan)) { return CollectStepResult.No; } - return node.kind === 160 /* CallExpression */ ? CollectStepResult.YesAndRecurse : CollectStepResult.NoAndRecurse; + return node.kind === ts.SyntaxKind.CallExpression ? CollectStepResult.YesAndRecurse : CollectStepResult.NoAndRecurse; } function analyze(contents, options) { if (options === void 0) { options = {}; } var filename = 'file.ts'; var serviceHost = new SingleFileServiceHost(assign(clone(options), { noResolve: true }), filename, contents); var service = ts.createLanguageService(serviceHost); - var sourceFile = service.getSourceFile(filename); + var sourceFile = ts.createSourceFile(filename, contents, ts.ScriptTarget.ES5, true); // all imports var imports = lazy(collect(sourceFile, function (n) { return isImportNode(n) ? CollectStepResult.YesAndRecurse : CollectStepResult.NoAndRecurse; })); // import nls = require('vs/nls'); var importEqualsDeclarations = imports - .filter(function (n) { return n.kind === 211 /* ImportEqualsDeclaration */; }) + .filter(function (n) { return n.kind === ts.SyntaxKind.ImportEqualsDeclaration; }) .map(function (n) { return n; }) - .filter(function (d) { return d.moduleReference.kind === 222 /* ExternalModuleReference */; }) + .filter(function (d) { return d.moduleReference.kind === ts.SyntaxKind.ExternalModuleReference; }) .filter(function (d) { return d.moduleReference.expression.getText() === '\'vs/nls\''; }); // import ... from 'vs/nls'; var importDeclarations = imports - .filter(function (n) { return n.kind === 212 /* ImportDeclaration */; }) + .filter(function (n) { return n.kind === ts.SyntaxKind.ImportDeclaration; }) .map(function (n) { return n; }) - .filter(function (d) { return d.moduleSpecifier.kind === 8 /* StringLiteral */; }) + .filter(function (d) { return d.moduleSpecifier.kind === ts.SyntaxKind.StringLiteral; }) .filter(function (d) { return d.moduleSpecifier.getText() === '\'vs/nls\''; }) .filter(function (d) { return !!d.importClause && !!d.importClause.namedBindings; }); var nlsExpressions = importEqualsDeclarations @@ -143,7 +147,7 @@ function isImportNode(node) { }); }); // `nls.localize(...)` calls var nlsLocalizeCallExpressions = importDeclarations - .filter(function (d) { return d.importClause.namedBindings.kind === 214 /* NamespaceImport */; }) + .filter(function (d) { return d.importClause.namedBindings.kind === ts.SyntaxKind.NamespaceImport; }) .map(function (d) { return d.importClause.namedBindings.name; }) .concat(importEqualsDeclarations.map(function (d) { return d.name; })) .map(function (n) { return service.getReferencesAtPosition(filename, n.pos + 1); }) @@ -153,10 +157,10 @@ function isImportNode(node) { .map(function (a) { return lazy(a).last(); }) .filter(function (n) { return !!n; }) .map(function (n) { return n; }) - .filter(function (n) { return n.expression.kind === 158 /* PropertyAccessExpression */ && n.expression.name.getText() === 'localize'; }); + .filter(function (n) { return n.expression.kind === ts.SyntaxKind.PropertyAccessExpression && n.expression.name.getText() === 'localize'; }); // `localize` named imports var allLocalizeImportDeclarations = importDeclarations - .filter(function (d) { return d.importClause.namedBindings.kind === 215 /* NamedImports */; }) + .filter(function (d) { return d.importClause.namedBindings.kind === ts.SyntaxKind.NamedImports; }) .map(function (d) { return d.importClause.namedBindings.elements; }) .flatten(); // `localize` read-only references diff --git a/build/lib/nls.ts b/build/lib/nls.ts index 9fdc15dd0e751e1b4c0c33ba88de04b823d37c94..fcba7ac6e5e20b0bf56f7c0966c4d0e8bd4ad17b 100644 --- a/build/lib/nls.ts +++ b/build/lib/nls.ts @@ -1,4 +1,9 @@ -import * as ts from './typescript/typescriptServices'; +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import * as ts from 'typescript'; import * as lazy from 'lazy.js'; import { duplex, through } from 'event-stream'; import File = require('vinyl'); @@ -171,7 +176,7 @@ module nls { const filename = 'file.ts'; const serviceHost = new SingleFileServiceHost(assign(clone(options), { noResolve: true }), filename, contents); const service = ts.createLanguageService(serviceHost); - const sourceFile = service.getSourceFile(filename); + const sourceFile = ts.createSourceFile(filename, contents, ts.ScriptTarget.ES5, true); // all imports const imports = lazy(collect(sourceFile, n => isImportNode(n) ? CollectStepResult.YesAndRecurse : CollectStepResult.NoAndRecurse)); diff --git a/build/lib/optimize.js b/build/lib/optimize.js index d3bc1ee5c8c14c3f6ff1d0f0882d96618ae32f53..390538190a4b7ce096408e54eb23cc405a1494e2 100644 --- a/build/lib/optimize.js +++ b/build/lib/optimize.js @@ -10,6 +10,8 @@ var sourcemaps = require("gulp-sourcemaps"); var filter = require("gulp-filter"); var minifyCSS = require("gulp-cssnano"); var uglify = require("gulp-uglify"); +var composer = require("gulp-uglify/composer"); +var uglifyes = require("uglify-es"); var es = require("event-stream"); var concat = require("gulp-concat"); var VinylFile = require("vinyl"); @@ -163,7 +165,8 @@ function optimizeTask(opts) { includeContent: true })) .pipe(i18n.processNlsFiles({ - fileHeader: bundledFileHeader + fileHeader: bundledFileHeader, + languages: opts.languages })) .pipe(gulp.dest(out)); }; @@ -200,12 +203,13 @@ function uglifyWithCopyrights() { return false; }; }; + var minify = composer(uglifyes); var input = es.through(); var output = input .pipe(flatmap(function (stream, f) { - return stream.pipe(uglify({ - preserveComments: preserveComments(f), + return stream.pipe(minify({ output: { + comments: preserveComments(f), // linux tfs build agent is crashing, does this help?§ max_line_len: 3200000 } diff --git a/build/lib/optimize.ts b/build/lib/optimize.ts index 9dbaead5f7952424ab5e770eda63708807441038..083ed0e5860fad797f6f6fead52f3e9e2f3c66b5 100644 --- a/build/lib/optimize.ts +++ b/build/lib/optimize.ts @@ -11,6 +11,8 @@ import * as sourcemaps from 'gulp-sourcemaps'; import * as filter from 'gulp-filter'; import * as minifyCSS from 'gulp-cssnano'; import * as uglify from 'gulp-uglify'; +import * as composer from 'gulp-uglify/composer'; +import * as uglifyes from 'uglify-es'; import * as es from 'event-stream'; import * as concat from 'gulp-concat'; import * as VinylFile from 'vinyl'; @@ -158,6 +160,10 @@ export interface IOptimizeTaskOpts { * (out folder name) */ out: string; + /** + * (languages to process) + */ + languages: string[]; } export function optimizeTask(opts: IOptimizeTaskOpts): () => NodeJS.ReadWriteStream { const entryPoints = opts.entryPoints; @@ -228,7 +234,8 @@ export function optimizeTask(opts: IOptimizeTaskOpts): () => NodeJS.ReadWriteStr includeContent: true })) .pipe(i18n.processNlsFiles({ - fileHeader: bundledFileHeader + fileHeader: bundledFileHeader, + languages: opts.languages })) .pipe(gulp.dest(out)); }; @@ -271,12 +278,13 @@ function uglifyWithCopyrights(): NodeJS.ReadWriteStream { }; }; + const minify = composer(uglifyes); const input = es.through(); const output = input .pipe(flatmap((stream, f) => { - return stream.pipe(uglify({ - preserveComments: preserveComments(f), + return stream.pipe(minify({ output: { + comments: preserveComments(f), // linux tfs build agent is crashing, does this help?§ max_line_len: 3200000 } diff --git a/build/lib/tslint/importPatternsRule.js b/build/lib/tslint/importPatternsRule.js index 6bd94309cf86e987f48bd8fc3317ab013265ac49..5f11b0944efbb5d199462a4738e99781fa5ae685 100644 --- a/build/lib/tslint/importPatternsRule.js +++ b/build/lib/tslint/importPatternsRule.js @@ -14,8 +14,10 @@ var __extends = (this && this.__extends) || (function () { }; })(); Object.defineProperty(exports, "__esModule", { value: true }); +var ts = require("typescript"); var Lint = require("tslint"); var minimatch = require("minimatch"); +var path_1 = require("path"); var Rule = (function (_super) { __extends(Rule, _super); function Rule() { @@ -41,16 +43,39 @@ var ImportPatterns = (function (_super) { _this._config = _config; return _this; } + ImportPatterns.prototype.visitImportEqualsDeclaration = function (node) { + if (node.moduleReference.kind === ts.SyntaxKind.ExternalModuleReference) { + this._validateImport(node.moduleReference.expression.getText(), node); + } + }; ImportPatterns.prototype.visitImportDeclaration = function (node) { - var path = node.moduleSpecifier.getText(); + this._validateImport(node.moduleSpecifier.getText(), node); + }; + ImportPatterns.prototype._validateImport = function (path, node) { // remove quotes path = path.slice(1, -1); - // ignore relative paths + // resolve relative paths if (path[0] === '.') { - return; + path = path_1.join(this.getSourceFile().fileName, path); + } + var restrictions; + if (typeof this._config.restrictions === 'string') { + restrictions = [this._config.restrictions]; + } + else { + restrictions = this._config.restrictions; + } + var matched = false; + for (var _i = 0, restrictions_1 = restrictions; _i < restrictions_1.length; _i++) { + var pattern = restrictions_1[_i]; + if (minimatch(path, pattern)) { + matched = true; + break; + } } - if (!minimatch(path, this._config.restrictions)) { - this.addFailure(this.createFailure(node.getStart(), node.getWidth(), "Imports violates '" + this._config.restrictions + "'-restriction.")); + if (!matched) { + // None of the restrictions matched + this.addFailure(this.createFailure(node.getStart(), node.getWidth(), "Imports violates '" + restrictions.join(' or ') + "' restrictions. See https://github.com/Microsoft/vscode/wiki/Code-Organization")); } }; return ImportPatterns; diff --git a/build/lib/tslint/importPatternsRule.ts b/build/lib/tslint/importPatternsRule.ts index 469ceec743cc84b0f19a7fe28a3bd7fe8167e5b0..4c267fb24d979fa7518de8614427aff803de56be 100644 --- a/build/lib/tslint/importPatternsRule.ts +++ b/build/lib/tslint/importPatternsRule.ts @@ -6,10 +6,11 @@ import * as ts from 'typescript'; import * as Lint from 'tslint'; import * as minimatch from 'minimatch'; +import { join } from 'path'; interface ImportPatternsConfig { target: string; - restrictions: string; + restrictions: string | string[]; } export class Rule extends Lint.Rules.AbstractRule { @@ -34,19 +35,43 @@ class ImportPatterns extends Lint.RuleWalker { super(file, opts); } + protected visitImportEqualsDeclaration(node: ts.ImportEqualsDeclaration): void { + if (node.moduleReference.kind === ts.SyntaxKind.ExternalModuleReference) { + this._validateImport(node.moduleReference.expression.getText(), node); + } + } + protected visitImportDeclaration(node: ts.ImportDeclaration): void { - let path = node.moduleSpecifier.getText(); + this._validateImport(node.moduleSpecifier.getText(), node); + } + private _validateImport(path: string, node: ts.Node): void { // remove quotes path = path.slice(1, -1); - // ignore relative paths + // resolve relative paths if (path[0] === '.') { - return; + path = join(this.getSourceFile().fileName, path); + } + + let restrictions: string[]; + if (typeof this._config.restrictions === 'string') { + restrictions = [this._config.restrictions]; + } else { + restrictions = this._config.restrictions; + } + + let matched = false; + for (const pattern of restrictions) { + if (minimatch(path, pattern)) { + matched = true; + break; + } } - if (!minimatch(path, this._config.restrictions)) { - this.addFailure(this.createFailure(node.getStart(), node.getWidth(), `Imports violates '${this._config.restrictions}'-restriction.`)); + if (!matched) { + // None of the restrictions matched + this.addFailure(this.createFailure(node.getStart(), node.getWidth(), `Imports violates '${restrictions.join(' or ')}' restrictions. See https://github.com/Microsoft/vscode/wiki/Code-Organization`)); } } } diff --git a/build/lib/tslint/layeringRule.js b/build/lib/tslint/layeringRule.js index 37a60b2b44f4c1ed7f166754784536fc822a0ec4..31b19f3fb10cea135a327104db98a97df813ab53 100644 --- a/build/lib/tslint/layeringRule.js +++ b/build/lib/tslint/layeringRule.js @@ -14,6 +14,7 @@ var __extends = (this && this.__extends) || (function () { }; })(); Object.defineProperty(exports, "__esModule", { value: true }); +var ts = require("typescript"); var Lint = require("tslint"); var path_1 = require("path"); var Rule = (function (_super) { @@ -54,8 +55,15 @@ var LayeringRule = (function (_super) { _this._config = config; return _this; } + LayeringRule.prototype.visitImportEqualsDeclaration = function (node) { + if (node.moduleReference.kind === ts.SyntaxKind.ExternalModuleReference) { + this._validateImport(node.moduleReference.expression.getText(), node); + } + }; LayeringRule.prototype.visitImportDeclaration = function (node) { - var path = node.moduleSpecifier.getText(); + this._validateImport(node.moduleSpecifier.getText(), node); + }; + LayeringRule.prototype._validateImport = function (path, node) { // remove quotes path = path.slice(1, -1); if (path[0] === '.') { diff --git a/build/lib/tslint/layeringRule.ts b/build/lib/tslint/layeringRule.ts index c6e34623b2b1dbd086c34181b41551a690abbbd4..8217f11d92303fc1983c85dbd4096ed343053271 100644 --- a/build/lib/tslint/layeringRule.ts +++ b/build/lib/tslint/layeringRule.ts @@ -51,9 +51,17 @@ class LayeringRule extends Lint.RuleWalker { this._config = config; } + protected visitImportEqualsDeclaration(node: ts.ImportEqualsDeclaration): void { + if (node.moduleReference.kind === ts.SyntaxKind.ExternalModuleReference) { + this._validateImport(node.moduleReference.expression.getText(), node); + } + } + protected visitImportDeclaration(node: ts.ImportDeclaration): void { - let path = node.moduleSpecifier.getText(); + this._validateImport(node.moduleSpecifier.getText(), node); + } + private _validateImport(path: string, node: ts.Node): void { // remove quotes path = path.slice(1, -1); diff --git a/build/lib/tslint/noUnexternalizedStringsRule.js b/build/lib/tslint/noUnexternalizedStringsRule.js index db189931465f521f350aa798651b626c44c35dec..d6edfc0570a73ea46dd2b4099d0698f05d58dfef 100644 --- a/build/lib/tslint/noUnexternalizedStringsRule.js +++ b/build/lib/tslint/noUnexternalizedStringsRule.js @@ -70,10 +70,10 @@ var NoUnexternalizedStringsRuleWalker = (function (_super) { var _this = this; _super.prototype.visitSourceFile.call(this, node); Object.keys(this.usedKeys).forEach(function (key) { - var occurences = _this.usedKeys[key]; - if (occurences.length > 1) { - occurences.forEach(function (occurence) { - _this.addFailure((_this.createFailure(occurence.key.getStart(), occurence.key.getWidth(), "Duplicate key " + occurence.key.getText() + " with different message value."))); + var occurrences = _this.usedKeys[key]; + if (occurrences.length > 1) { + occurrences.forEach(function (occurrence) { + _this.addFailure((_this.createFailure(occurrence.key.getStart(), occurrence.key.getWidth(), "Duplicate key " + occurrence.key.getText() + " with different message value."))); }); } }); @@ -140,17 +140,17 @@ var NoUnexternalizedStringsRuleWalker = (function (_super) { }; NoUnexternalizedStringsRuleWalker.prototype.recordKey = function (keyNode, messageNode) { var text = keyNode.getText(); - var occurences = this.usedKeys[text]; - if (!occurences) { - occurences = []; - this.usedKeys[text] = occurences; + var occurrences = this.usedKeys[text]; + if (!occurrences) { + occurrences = []; + this.usedKeys[text] = occurrences; } if (messageNode) { - if (occurences.some(function (pair) { return pair.message ? pair.message.getText() === messageNode.getText() : false; })) { + if (occurrences.some(function (pair) { return pair.message ? pair.message.getText() === messageNode.getText() : false; })) { return; } } - occurences.push({ key: keyNode, message: messageNode }); + occurrences.push({ key: keyNode, message: messageNode }); }; NoUnexternalizedStringsRuleWalker.prototype.findDescribingParent = function (node) { var parent; diff --git a/build/lib/tslint/noUnexternalizedStringsRule.ts b/build/lib/tslint/noUnexternalizedStringsRule.ts index d7a2d8ca10015d55a6135ab1d71840b276f338a2..cbe457c5be5ca1c371600df2b6c31f42335e9908 100644 --- a/build/lib/tslint/noUnexternalizedStringsRule.ts +++ b/build/lib/tslint/noUnexternalizedStringsRule.ts @@ -82,10 +82,10 @@ class NoUnexternalizedStringsRuleWalker extends Lint.RuleWalker { protected visitSourceFile(node: ts.SourceFile): void { super.visitSourceFile(node); Object.keys(this.usedKeys).forEach(key => { - let occurences = this.usedKeys[key]; - if (occurences.length > 1) { - occurences.forEach(occurence => { - this.addFailure((this.createFailure(occurence.key.getStart(), occurence.key.getWidth(), `Duplicate key ${occurence.key.getText()} with different message value.`))); + let occurrences = this.usedKeys[key]; + if (occurrences.length > 1) { + occurrences.forEach(occurrence => { + this.addFailure((this.createFailure(occurrence.key.getStart(), occurrence.key.getWidth(), `Duplicate key ${occurrence.key.getText()} with different message value.`))); }); } }); @@ -157,17 +157,17 @@ class NoUnexternalizedStringsRuleWalker extends Lint.RuleWalker { private recordKey(keyNode: ts.StringLiteral, messageNode: ts.Node) { let text = keyNode.getText(); - let occurences: KeyMessagePair[] = this.usedKeys[text]; - if (!occurences) { - occurences = []; - this.usedKeys[text] = occurences; + let occurrences: KeyMessagePair[] = this.usedKeys[text]; + if (!occurrences) { + occurrences = []; + this.usedKeys[text] = occurrences; } if (messageNode) { - if (occurences.some(pair => pair.message ? pair.message.getText() === messageNode.getText() : false)) { + if (occurrences.some(pair => pair.message ? pair.message.getText() === messageNode.getText() : false)) { return; } } - occurences.push({ key: keyNode, message: messageNode }); + occurrences.push({ key: keyNode, message: messageNode }); } private findDescribingParent(node: ts.Node): { callInfo?: { callExpression: ts.CallExpression, argIndex: number }, ignoreUsage?: boolean; } { diff --git a/build/lib/tslint/translationRemindRule.js b/build/lib/tslint/translationRemindRule.js new file mode 100644 index 0000000000000000000000000000000000000000..d0ed1a024038d687160aa6b7ffaef15a7db7e763 --- /dev/null +++ b/build/lib/tslint/translationRemindRule.js @@ -0,0 +1,79 @@ +"use strict"; +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var Lint = require("tslint"); +var fs = require("fs"); +var Rule = (function (_super) { + __extends(Rule, _super); + function Rule() { + return _super !== null && _super.apply(this, arguments) || this; + } + Rule.prototype.apply = function (sourceFile) { + return this.applyWithWalker(new TranslationRemindRuleWalker(sourceFile, this.getOptions())); + }; + return Rule; +}(Lint.Rules.AbstractRule)); +exports.Rule = Rule; +var TranslationRemindRuleWalker = (function (_super) { + __extends(TranslationRemindRuleWalker, _super); + function TranslationRemindRuleWalker(file, opts) { + return _super.call(this, file, opts) || this; + } + TranslationRemindRuleWalker.prototype.visitImportDeclaration = function (node) { + var declaration = node.moduleSpecifier.getText(); + if (declaration !== "'" + TranslationRemindRuleWalker.NLS_MODULE + "'") { + return; + } + this.visitImportLikeDeclaration(node); + }; + TranslationRemindRuleWalker.prototype.visitImportEqualsDeclaration = function (node) { + var reference = node.moduleReference.getText(); + if (reference !== "require('" + TranslationRemindRuleWalker.NLS_MODULE + "')") { + return; + } + this.visitImportLikeDeclaration(node); + }; + TranslationRemindRuleWalker.prototype.visitImportLikeDeclaration = function (node) { + var currentFile = node.getSourceFile().fileName; + var matchService = currentFile.match(/vs\/workbench\/services\/\w+/); + var matchPart = currentFile.match(/vs\/workbench\/parts\/\w+/); + if (!matchService && !matchPart) { + return; + } + var resource = matchService ? matchService[0] : matchPart[0]; + var resourceDefined = false; + var json; + try { + json = fs.readFileSync('./build/lib/i18n.resources.json', 'utf8'); + } + catch (e) { + console.error('[translation-remind rule]: File with resources to pull from Transifex was not found. Aborting translation resource check for newly defined workbench part/service.'); + return; + } + var workbenchResources = JSON.parse(json).workbench; + workbenchResources.forEach(function (existingResource) { + if (existingResource.name === resource) { + resourceDefined = true; + return; + } + }); + if (!resourceDefined) { + this.addFailureAtNode(node, "Please add '" + resource + "' to ./builds/lib/i18n.resources.json file to use translations here."); + } + }; + return TranslationRemindRuleWalker; +}(Lint.RuleWalker)); +TranslationRemindRuleWalker.NLS_MODULE = 'vs/nls'; diff --git a/build/lib/tslint/translationRemindRule.ts b/build/lib/tslint/translationRemindRule.ts new file mode 100644 index 0000000000000000000000000000000000000000..6bc2a191619e59696bf9448b95fd4e5f28461d4d --- /dev/null +++ b/build/lib/tslint/translationRemindRule.ts @@ -0,0 +1,73 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import * as ts from 'typescript'; +import * as Lint from 'tslint'; +import * as fs from 'fs'; + +export class Rule extends Lint.Rules.AbstractRule { + public apply(sourceFile: ts.SourceFile): Lint.RuleFailure[] { + return this.applyWithWalker(new TranslationRemindRuleWalker(sourceFile, this.getOptions())); + } +} + +class TranslationRemindRuleWalker extends Lint.RuleWalker { + + private static NLS_MODULE: string = 'vs/nls'; + + constructor(file: ts.SourceFile, opts: Lint.IOptions) { + super(file, opts); + } + + protected visitImportDeclaration(node: ts.ImportDeclaration): void { + const declaration = node.moduleSpecifier.getText(); + if (declaration !== `'${TranslationRemindRuleWalker.NLS_MODULE}'`) { + return; + } + + this.visitImportLikeDeclaration(node); + } + + protected visitImportEqualsDeclaration(node: ts.ImportEqualsDeclaration): void { + const reference = node.moduleReference.getText(); + if (reference !== `require('${TranslationRemindRuleWalker.NLS_MODULE}')`) { + return; + } + + this.visitImportLikeDeclaration(node); + } + + private visitImportLikeDeclaration(node: ts.ImportDeclaration | ts.ImportEqualsDeclaration) { + const currentFile = node.getSourceFile().fileName; + const matchService = currentFile.match(/vs\/workbench\/services\/\w+/); + const matchPart = currentFile.match(/vs\/workbench\/parts\/\w+/); + if (!matchService && !matchPart) { + return; + } + + const resource = matchService ? matchService[0] : matchPart[0]; + let resourceDefined = false; + + let json; + try { + json = fs.readFileSync('./build/lib/i18n.resources.json', 'utf8'); + } catch (e) { + console.error('[translation-remind rule]: File with resources to pull from Transifex was not found. Aborting translation resource check for newly defined workbench part/service.'); + return; + } + const workbenchResources = JSON.parse(json).workbench; + + workbenchResources.forEach(existingResource => { + if (existingResource.name === resource) { + resourceDefined = true; + return; + } + }); + + if (!resourceDefined) { + this.addFailureAtNode(node, `Please add '${resource}' to ./builds/lib/i18n.resources.json file to use translations here.`); + } + } +} diff --git a/build/lib/typescript/OSSREADME.json b/build/lib/typescript/OSSREADME.json deleted file mode 100644 index 6fa824225ad451ac785b8c3d8bf4c051919934cf..0000000000000000000000000000000000000000 --- a/build/lib/typescript/OSSREADME.json +++ /dev/null @@ -1,70 +0,0 @@ -// ATTENTION - THIS DIRECTORY CONTAINS THIRD PARTY OPEN SOURCE MATERIALS: -[ - { - "name": "typescript-legacy", - "version": "1.5", - "license": "Apache2", - "repositoryURL": "https://github.com/Microsoft/TypeScript", - // Reason: LICENSE file does not include Copyright statement - "licenseDetail": [ - "Copyright (c) Microsoft Corporation. All rights reserved. ", - "", - "Apache License", - "", - "Version 2.0, January 2004", - "", - "http://www.apache.org/licenses/", - "", - "TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION", - "", - "1. Definitions.", - "", - "\"License\" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.", - "", - "\"Licensor\" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.", - "", - "\"Legal Entity\" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, \"control\" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.", - "", - "\"You\" (or \"Your\") shall mean an individual or Legal Entity exercising permissions granted by this License.", - "", - "\"Source\" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.", - "", - "\"Object\" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.", - "", - "\"Work\" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).", - "", - "\"Derivative Works\" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.", - "", - "\"Contribution\" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, \"submitted\" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as \"Not a Contribution.\"", - "", - "\"Contributor\" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.", - "", - "2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.", - "", - "3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.", - "", - "4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:", - "", - "You must give any other recipients of the Work or Derivative Works a copy of this License; and", - "", - "You must cause any modified files to carry prominent notices stating that You changed the files; and", - "", - "You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and", - "", - "If the Work includes a \"NOTICE\" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.", - "", - "5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.", - "", - "6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.", - "", - "7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.", - "", - "8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.", - "", - "9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.", - "", - "END OF TERMS AND CONDITIONS" - ], - "isDev": true - } -] \ No newline at end of file diff --git a/build/lib/typescript/typescriptServices.d.ts b/build/lib/typescript/typescriptServices.d.ts deleted file mode 100644 index 9b5cf8c4d50ffbe8632eaab6e0eb805c6f56d2f4..0000000000000000000000000000000000000000 --- a/build/lib/typescript/typescriptServices.d.ts +++ /dev/null @@ -1,1994 +0,0 @@ -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ - -declare module ts { - interface Map { - [index: string]: T; - } - interface FileMap { - get(fileName: string): T; - set(fileName: string, value: T): void; - contains(fileName: string): boolean; - remove(fileName: string): void; - forEachValue(f: (v: T) => void): void; - } - interface TextRange { - pos: number; - end: number; - } - const enum SyntaxKind { - Unknown = 0, - EndOfFileToken = 1, - SingleLineCommentTrivia = 2, - MultiLineCommentTrivia = 3, - NewLineTrivia = 4, - WhitespaceTrivia = 5, - ConflictMarkerTrivia = 6, - NumericLiteral = 7, - StringLiteral = 8, - RegularExpressionLiteral = 9, - NoSubstitutionTemplateLiteral = 10, - TemplateHead = 11, - TemplateMiddle = 12, - TemplateTail = 13, - OpenBraceToken = 14, - CloseBraceToken = 15, - OpenParenToken = 16, - CloseParenToken = 17, - OpenBracketToken = 18, - CloseBracketToken = 19, - DotToken = 20, - DotDotDotToken = 21, - SemicolonToken = 22, - CommaToken = 23, - LessThanToken = 24, - GreaterThanToken = 25, - LessThanEqualsToken = 26, - GreaterThanEqualsToken = 27, - EqualsEqualsToken = 28, - ExclamationEqualsToken = 29, - EqualsEqualsEqualsToken = 30, - ExclamationEqualsEqualsToken = 31, - EqualsGreaterThanToken = 32, - PlusToken = 33, - MinusToken = 34, - AsteriskToken = 35, - SlashToken = 36, - PercentToken = 37, - PlusPlusToken = 38, - MinusMinusToken = 39, - LessThanLessThanToken = 40, - GreaterThanGreaterThanToken = 41, - GreaterThanGreaterThanGreaterThanToken = 42, - AmpersandToken = 43, - BarToken = 44, - CaretToken = 45, - ExclamationToken = 46, - TildeToken = 47, - AmpersandAmpersandToken = 48, - BarBarToken = 49, - QuestionToken = 50, - ColonToken = 51, - AtToken = 52, - EqualsToken = 53, - PlusEqualsToken = 54, - MinusEqualsToken = 55, - AsteriskEqualsToken = 56, - SlashEqualsToken = 57, - PercentEqualsToken = 58, - LessThanLessThanEqualsToken = 59, - GreaterThanGreaterThanEqualsToken = 60, - GreaterThanGreaterThanGreaterThanEqualsToken = 61, - AmpersandEqualsToken = 62, - BarEqualsToken = 63, - CaretEqualsToken = 64, - Identifier = 65, - BreakKeyword = 66, - CaseKeyword = 67, - CatchKeyword = 68, - ClassKeyword = 69, - ConstKeyword = 70, - ContinueKeyword = 71, - DebuggerKeyword = 72, - DefaultKeyword = 73, - DeleteKeyword = 74, - DoKeyword = 75, - ElseKeyword = 76, - EnumKeyword = 77, - ExportKeyword = 78, - ExtendsKeyword = 79, - FalseKeyword = 80, - FinallyKeyword = 81, - ForKeyword = 82, - FunctionKeyword = 83, - IfKeyword = 84, - ImportKeyword = 85, - InKeyword = 86, - InstanceOfKeyword = 87, - NewKeyword = 88, - NullKeyword = 89, - ReturnKeyword = 90, - SuperKeyword = 91, - SwitchKeyword = 92, - ThisKeyword = 93, - ThrowKeyword = 94, - TrueKeyword = 95, - TryKeyword = 96, - TypeOfKeyword = 97, - VarKeyword = 98, - VoidKeyword = 99, - WhileKeyword = 100, - WithKeyword = 101, - ImplementsKeyword = 102, - InterfaceKeyword = 103, - LetKeyword = 104, - PackageKeyword = 105, - PrivateKeyword = 106, - ProtectedKeyword = 107, - PublicKeyword = 108, - StaticKeyword = 109, - YieldKeyword = 110, - AsKeyword = 111, - AnyKeyword = 112, - BooleanKeyword = 113, - ConstructorKeyword = 114, - DeclareKeyword = 115, - GetKeyword = 116, - IsKeyword = 117, - ModuleKeyword = 118, - NamespaceKeyword = 119, - RequireKeyword = 120, - NumberKeyword = 121, - SetKeyword = 122, - StringKeyword = 123, - SymbolKeyword = 124, - TypeKeyword = 125, - FromKeyword = 126, - OfKeyword = 127, - QualifiedName = 128, - ComputedPropertyName = 129, - TypeParameter = 130, - Parameter = 131, - Decorator = 132, - PropertySignature = 133, - PropertyDeclaration = 134, - MethodSignature = 135, - MethodDeclaration = 136, - Constructor = 137, - GetAccessor = 138, - SetAccessor = 139, - CallSignature = 140, - ConstructSignature = 141, - IndexSignature = 142, - TypePredicate = 143, - TypeReference = 144, - FunctionType = 145, - ConstructorType = 146, - TypeQuery = 147, - TypeLiteral = 148, - ArrayType = 149, - TupleType = 150, - UnionType = 151, - ParenthesizedType = 152, - ObjectBindingPattern = 153, - ArrayBindingPattern = 154, - BindingElement = 155, - ArrayLiteralExpression = 156, - ObjectLiteralExpression = 157, - PropertyAccessExpression = 158, - ElementAccessExpression = 159, - CallExpression = 160, - NewExpression = 161, - TaggedTemplateExpression = 162, - TypeAssertionExpression = 163, - ParenthesizedExpression = 164, - FunctionExpression = 165, - ArrowFunction = 166, - DeleteExpression = 167, - TypeOfExpression = 168, - VoidExpression = 169, - PrefixUnaryExpression = 170, - PostfixUnaryExpression = 171, - BinaryExpression = 172, - ConditionalExpression = 173, - TemplateExpression = 174, - YieldExpression = 175, - SpreadElementExpression = 176, - ClassExpression = 177, - OmittedExpression = 178, - ExpressionWithTypeArguments = 179, - TemplateSpan = 180, - SemicolonClassElement = 181, - Block = 182, - VariableStatement = 183, - EmptyStatement = 184, - ExpressionStatement = 185, - IfStatement = 186, - DoStatement = 187, - WhileStatement = 188, - ForStatement = 189, - ForInStatement = 190, - ForOfStatement = 191, - ContinueStatement = 192, - BreakStatement = 193, - ReturnStatement = 194, - WithStatement = 195, - SwitchStatement = 196, - LabeledStatement = 197, - ThrowStatement = 198, - TryStatement = 199, - DebuggerStatement = 200, - VariableDeclaration = 201, - VariableDeclarationList = 202, - FunctionDeclaration = 203, - ClassDeclaration = 204, - InterfaceDeclaration = 205, - TypeAliasDeclaration = 206, - EnumDeclaration = 207, - ModuleDeclaration = 208, - ModuleBlock = 209, - CaseBlock = 210, - ImportEqualsDeclaration = 211, - ImportDeclaration = 212, - ImportClause = 213, - NamespaceImport = 214, - NamedImports = 215, - ImportSpecifier = 216, - ExportAssignment = 217, - ExportDeclaration = 218, - NamedExports = 219, - ExportSpecifier = 220, - MissingDeclaration = 221, - ExternalModuleReference = 222, - CaseClause = 223, - DefaultClause = 224, - HeritageClause = 225, - CatchClause = 226, - PropertyAssignment = 227, - ShorthandPropertyAssignment = 228, - EnumMember = 229, - SourceFile = 230, - JSDocTypeExpression = 231, - JSDocAllType = 232, - JSDocUnknownType = 233, - JSDocArrayType = 234, - JSDocUnionType = 235, - JSDocTupleType = 236, - JSDocNullableType = 237, - JSDocNonNullableType = 238, - JSDocRecordType = 239, - JSDocRecordMember = 240, - JSDocTypeReference = 241, - JSDocOptionalType = 242, - JSDocFunctionType = 243, - JSDocVariadicType = 244, - JSDocConstructorType = 245, - JSDocThisType = 246, - JSDocComment = 247, - JSDocTag = 248, - JSDocParameterTag = 249, - JSDocReturnTag = 250, - JSDocTypeTag = 251, - JSDocTemplateTag = 252, - SyntaxList = 253, - Count = 254, - FirstAssignment = 53, - LastAssignment = 64, - FirstReservedWord = 66, - LastReservedWord = 101, - FirstKeyword = 66, - LastKeyword = 127, - FirstFutureReservedWord = 102, - LastFutureReservedWord = 110, - FirstTypeNode = 144, - LastTypeNode = 152, - FirstPunctuation = 14, - LastPunctuation = 64, - FirstToken = 0, - LastToken = 127, - FirstTriviaToken = 2, - LastTriviaToken = 6, - FirstLiteralToken = 7, - LastLiteralToken = 10, - FirstTemplateToken = 10, - LastTemplateToken = 13, - FirstBinaryOperator = 24, - LastBinaryOperator = 64, - FirstNode = 128, - } - const enum NodeFlags { - Export = 1, - Ambient = 2, - Public = 16, - Private = 32, - Protected = 64, - Static = 128, - Default = 256, - MultiLine = 512, - Synthetic = 1024, - DeclarationFile = 2048, - Let = 4096, - Const = 8192, - OctalLiteral = 16384, - Namespace = 32768, - ExportContext = 65536, - Modifier = 499, - AccessibilityModifier = 112, - BlockScoped = 12288, - } - interface Node extends TextRange { - kind: SyntaxKind; - flags: NodeFlags; - decorators?: NodeArray; - modifiers?: ModifiersArray; - parent?: Node; - } - interface NodeArray extends Array, TextRange { - hasTrailingComma?: boolean; - } - interface ModifiersArray extends NodeArray { - flags: number; - } - interface Identifier extends PrimaryExpression { - text: string; - originalKeywordKind?: SyntaxKind; - } - interface QualifiedName extends Node { - left: EntityName; - right: Identifier; - } - type EntityName = Identifier | QualifiedName; - type DeclarationName = Identifier | LiteralExpression | ComputedPropertyName | BindingPattern; - interface Declaration extends Node { - _declarationBrand: any; - name?: DeclarationName; - } - interface ComputedPropertyName extends Node { - expression: Expression; - } - interface Decorator extends Node { - expression: LeftHandSideExpression; - } - interface TypeParameterDeclaration extends Declaration { - name: Identifier; - constraint?: TypeNode; - expression?: Expression; - } - interface SignatureDeclaration extends Declaration { - typeParameters?: NodeArray; - parameters: NodeArray; - type?: TypeNode; - } - interface VariableDeclaration extends Declaration { - parent?: VariableDeclarationList; - name: Identifier | BindingPattern; - type?: TypeNode; - initializer?: Expression; - } - interface VariableDeclarationList extends Node { - declarations: NodeArray; - } - interface ParameterDeclaration extends Declaration { - dotDotDotToken?: Node; - name: Identifier | BindingPattern; - questionToken?: Node; - type?: TypeNode; - initializer?: Expression; - } - interface BindingElement extends Declaration { - propertyName?: Identifier; - dotDotDotToken?: Node; - name: Identifier | BindingPattern; - initializer?: Expression; - } - interface PropertyDeclaration extends Declaration, ClassElement { - name: DeclarationName; - questionToken?: Node; - type?: TypeNode; - initializer?: Expression; - } - interface ObjectLiteralElement extends Declaration { - _objectLiteralBrandBrand: any; - } - interface PropertyAssignment extends ObjectLiteralElement { - _propertyAssignmentBrand: any; - name: DeclarationName; - questionToken?: Node; - initializer: Expression; - } - interface ShorthandPropertyAssignment extends ObjectLiteralElement { - name: Identifier; - questionToken?: Node; - } - interface VariableLikeDeclaration extends Declaration { - propertyName?: Identifier; - dotDotDotToken?: Node; - name: DeclarationName; - questionToken?: Node; - type?: TypeNode; - initializer?: Expression; - } - interface BindingPattern extends Node { - elements: NodeArray; - } - /** - * Several node kinds share function-like features such as a signature, - * a name, and a body. These nodes should extend FunctionLikeDeclaration. - * Examples: - * FunctionDeclaration - * MethodDeclaration - * AccessorDeclaration - */ - interface FunctionLikeDeclaration extends SignatureDeclaration { - _functionLikeDeclarationBrand: any; - asteriskToken?: Node; - questionToken?: Node; - body?: Block | Expression; - } - interface FunctionDeclaration extends FunctionLikeDeclaration, Statement { - name?: Identifier; - body?: Block; - } - interface MethodDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement { - body?: Block; - } - interface ConstructorDeclaration extends FunctionLikeDeclaration, ClassElement { - body?: Block; - } - interface SemicolonClassElement extends ClassElement { - _semicolonClassElementBrand: any; - } - interface AccessorDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement { - _accessorDeclarationBrand: any; - body: Block; - } - interface IndexSignatureDeclaration extends SignatureDeclaration, ClassElement { - _indexSignatureDeclarationBrand: any; - } - interface TypeNode extends Node { - _typeNodeBrand: any; - } - interface FunctionOrConstructorTypeNode extends TypeNode, SignatureDeclaration { - _functionOrConstructorTypeNodeBrand: any; - } - interface TypeReferenceNode extends TypeNode { - typeName: EntityName; - typeArguments?: NodeArray; - } - interface TypePredicateNode extends TypeNode { - parameterName: Identifier; - type: TypeNode; - } - interface TypeQueryNode extends TypeNode { - exprName: EntityName; - } - interface TypeLiteralNode extends TypeNode, Declaration { - members: NodeArray; - } - interface ArrayTypeNode extends TypeNode { - elementType: TypeNode; - } - interface TupleTypeNode extends TypeNode { - elementTypes: NodeArray; - } - interface UnionTypeNode extends TypeNode { - types: NodeArray; - } - interface ParenthesizedTypeNode extends TypeNode { - type: TypeNode; - } - interface StringLiteral extends LiteralExpression, TypeNode { - _stringLiteralBrand: any; - } - interface Expression extends Node { - _expressionBrand: any; - contextualType?: Type; - } - interface UnaryExpression extends Expression { - _unaryExpressionBrand: any; - } - interface PrefixUnaryExpression extends UnaryExpression { - operator: SyntaxKind; - operand: UnaryExpression; - } - interface PostfixUnaryExpression extends PostfixExpression { - operand: LeftHandSideExpression; - operator: SyntaxKind; - } - interface PostfixExpression extends UnaryExpression { - _postfixExpressionBrand: any; - } - interface LeftHandSideExpression extends PostfixExpression { - _leftHandSideExpressionBrand: any; - } - interface MemberExpression extends LeftHandSideExpression { - _memberExpressionBrand: any; - } - interface PrimaryExpression extends MemberExpression { - _primaryExpressionBrand: any; - } - interface DeleteExpression extends UnaryExpression { - expression: UnaryExpression; - } - interface TypeOfExpression extends UnaryExpression { - expression: UnaryExpression; - } - interface VoidExpression extends UnaryExpression { - expression: UnaryExpression; - } - interface YieldExpression extends Expression { - asteriskToken?: Node; - expression?: Expression; - } - interface BinaryExpression extends Expression { - left: Expression; - operatorToken: Node; - right: Expression; - } - interface ConditionalExpression extends Expression { - condition: Expression; - questionToken: Node; - whenTrue: Expression; - colonToken: Node; - whenFalse: Expression; - } - interface FunctionExpression extends PrimaryExpression, FunctionLikeDeclaration { - name?: Identifier; - body: Block | Expression; - } - interface ArrowFunction extends Expression, FunctionLikeDeclaration { - equalsGreaterThanToken: Node; - } - interface LiteralExpression extends PrimaryExpression { - text: string; - isUnterminated?: boolean; - hasExtendedUnicodeEscape?: boolean; - } - interface TemplateExpression extends PrimaryExpression { - head: LiteralExpression; - templateSpans: NodeArray; - } - interface TemplateSpan extends Node { - expression: Expression; - literal: LiteralExpression; - } - interface ParenthesizedExpression extends PrimaryExpression { - expression: Expression; - } - interface ArrayLiteralExpression extends PrimaryExpression { - elements: NodeArray; - } - interface SpreadElementExpression extends Expression { - expression: Expression; - } - interface ObjectLiteralExpression extends PrimaryExpression, Declaration { - properties: NodeArray; - } - interface PropertyAccessExpression extends MemberExpression { - expression: LeftHandSideExpression; - dotToken: Node; - name: Identifier; - } - interface ElementAccessExpression extends MemberExpression { - expression: LeftHandSideExpression; - argumentExpression?: Expression; - } - interface CallExpression extends LeftHandSideExpression { - expression: LeftHandSideExpression; - typeArguments?: NodeArray; - arguments: NodeArray; - } - interface ExpressionWithTypeArguments extends TypeNode { - expression: LeftHandSideExpression; - typeArguments?: NodeArray; - } - interface NewExpression extends CallExpression, PrimaryExpression { - } - interface TaggedTemplateExpression extends MemberExpression { - tag: LeftHandSideExpression; - template: LiteralExpression | TemplateExpression; - } - type CallLikeExpression = CallExpression | NewExpression | TaggedTemplateExpression; - interface TypeAssertion extends UnaryExpression { - type: TypeNode; - expression: UnaryExpression; - } - interface Statement extends Node { - _statementBrand: any; - } - interface Block extends Statement { - statements: NodeArray; - } - interface VariableStatement extends Statement { - declarationList: VariableDeclarationList; - } - interface ExpressionStatement extends Statement { - expression: Expression; - } - interface IfStatement extends Statement { - expression: Expression; - thenStatement: Statement; - elseStatement?: Statement; - } - interface IterationStatement extends Statement { - statement: Statement; - } - interface DoStatement extends IterationStatement { - expression: Expression; - } - interface WhileStatement extends IterationStatement { - expression: Expression; - } - interface ForStatement extends IterationStatement { - initializer?: VariableDeclarationList | Expression; - condition?: Expression; - incrementor?: Expression; - } - interface ForInStatement extends IterationStatement { - initializer: VariableDeclarationList | Expression; - expression: Expression; - } - interface ForOfStatement extends IterationStatement { - initializer: VariableDeclarationList | Expression; - expression: Expression; - } - interface BreakOrContinueStatement extends Statement { - label?: Identifier; - } - interface ReturnStatement extends Statement { - expression?: Expression; - } - interface WithStatement extends Statement { - expression: Expression; - statement: Statement; - } - interface SwitchStatement extends Statement { - expression: Expression; - caseBlock: CaseBlock; - } - interface CaseBlock extends Node { - clauses: NodeArray; - } - interface CaseClause extends Node { - expression?: Expression; - statements: NodeArray; - } - interface DefaultClause extends Node { - statements: NodeArray; - } - type CaseOrDefaultClause = CaseClause | DefaultClause; - interface LabeledStatement extends Statement { - label: Identifier; - statement: Statement; - } - interface ThrowStatement extends Statement { - expression: Expression; - } - interface TryStatement extends Statement { - tryBlock: Block; - catchClause?: CatchClause; - finallyBlock?: Block; - } - interface CatchClause extends Node { - variableDeclaration: VariableDeclaration; - block: Block; - } - interface ClassLikeDeclaration extends Declaration { - name?: Identifier; - typeParameters?: NodeArray; - heritageClauses?: NodeArray; - members: NodeArray; - } - interface ClassDeclaration extends ClassLikeDeclaration, Statement { - } - interface ClassExpression extends ClassLikeDeclaration, PrimaryExpression { - } - interface ClassElement extends Declaration { - _classElementBrand: any; - } - interface InterfaceDeclaration extends Declaration, Statement { - name: Identifier; - typeParameters?: NodeArray; - heritageClauses?: NodeArray; - members: NodeArray; - } - interface HeritageClause extends Node { - token: SyntaxKind; - types?: NodeArray; - } - interface TypeAliasDeclaration extends Declaration, Statement { - name: Identifier; - typeParameters?: NodeArray; - type: TypeNode; - } - interface EnumMember extends Declaration { - name: DeclarationName; - initializer?: Expression; - } - interface EnumDeclaration extends Declaration, Statement { - name: Identifier; - members: NodeArray; - } - interface ModuleDeclaration extends Declaration, Statement { - name: Identifier | LiteralExpression; - body: ModuleBlock | ModuleDeclaration; - } - interface ModuleBlock extends Node, Statement { - statements: NodeArray; - } - interface ImportEqualsDeclaration extends Declaration, Statement { - name: Identifier; - moduleReference: EntityName | ExternalModuleReference; - } - interface ExternalModuleReference extends Node { - expression?: Expression; - } - interface ImportDeclaration extends Statement { - importClause?: ImportClause; - moduleSpecifier: Expression; - } - interface ImportClause extends Declaration { - name?: Identifier; - namedBindings?: NamespaceImport | NamedImports; - } - interface NamespaceImport extends Declaration { - name: Identifier; - } - interface ExportDeclaration extends Declaration, Statement { - exportClause?: NamedExports; - moduleSpecifier?: Expression; - } - interface NamedImportsOrExports extends Node { - elements: NodeArray; - } - type NamedImports = NamedImportsOrExports; - type NamedExports = NamedImportsOrExports; - interface ImportOrExportSpecifier extends Declaration { - propertyName?: Identifier; - name: Identifier; - } - type ImportSpecifier = ImportOrExportSpecifier; - type ExportSpecifier = ImportOrExportSpecifier; - interface ExportAssignment extends Declaration, Statement { - isExportEquals?: boolean; - expression: Expression; - } - interface FileReference extends TextRange { - fileName: string; - } - interface CommentRange extends TextRange { - hasTrailingNewLine?: boolean; - kind: SyntaxKind; - } - interface JSDocTypeExpression extends Node { - type: JSDocType; - } - interface JSDocType extends TypeNode { - _jsDocTypeBrand: any; - } - interface JSDocAllType extends JSDocType { - _JSDocAllTypeBrand: any; - } - interface JSDocUnknownType extends JSDocType { - _JSDocUnknownTypeBrand: any; - } - interface JSDocArrayType extends JSDocType { - elementType: JSDocType; - } - interface JSDocUnionType extends JSDocType { - types: NodeArray; - } - interface JSDocTupleType extends JSDocType { - types: NodeArray; - } - interface JSDocNonNullableType extends JSDocType { - type: JSDocType; - } - interface JSDocNullableType extends JSDocType { - type: JSDocType; - } - interface JSDocRecordType extends JSDocType, TypeLiteralNode { - members: NodeArray; - } - interface JSDocTypeReference extends JSDocType { - name: EntityName; - typeArguments: NodeArray; - } - interface JSDocOptionalType extends JSDocType { - type: JSDocType; - } - interface JSDocFunctionType extends JSDocType, SignatureDeclaration { - parameters: NodeArray; - type: JSDocType; - } - interface JSDocVariadicType extends JSDocType { - type: JSDocType; - } - interface JSDocConstructorType extends JSDocType { - type: JSDocType; - } - interface JSDocThisType extends JSDocType { - type: JSDocType; - } - interface JSDocRecordMember extends PropertyDeclaration { - name: Identifier | LiteralExpression; - type?: JSDocType; - } - interface JSDocComment extends Node { - tags: NodeArray; - } - interface JSDocTag extends Node { - atToken: Node; - tagName: Identifier; - } - interface JSDocTemplateTag extends JSDocTag { - typeParameters: NodeArray; - } - interface JSDocReturnTag extends JSDocTag { - typeExpression: JSDocTypeExpression; - } - interface JSDocTypeTag extends JSDocTag { - typeExpression: JSDocTypeExpression; - } - interface JSDocParameterTag extends JSDocTag { - preParameterName?: Identifier; - typeExpression?: JSDocTypeExpression; - postParameterName?: Identifier; - isBracketed: boolean; - } - interface SourceFile extends Declaration { - statements: NodeArray; - endOfFileToken: Node; - fileName: string; - text: string; - amdDependencies: { - path: string; - name: string; - }[]; - moduleName: string; - referencedFiles: FileReference[]; - /** - * lib.d.ts should have a reference comment like - * - * /// - * - * If any other file has this comment, it signals not to include lib.d.ts - * because this containing file is intended to act as a default library. - */ - hasNoDefaultLib: boolean; - languageVersion: ScriptTarget; - } - interface ScriptReferenceHost { - getCompilerOptions(): CompilerOptions; - getSourceFile(fileName: string): SourceFile; - getCurrentDirectory(): string; - } - interface ParseConfigHost { - readDirectory(rootDir: string, extension: string, exclude: string[]): string[]; - } - interface WriteFileCallback { - (fileName: string, data: string, writeByteOrderMark: boolean, onError?: (message: string) => void): void; - } - interface Program extends ScriptReferenceHost { - /** - * Get a list of files in the program - */ - getSourceFiles(): SourceFile[]; - /** - * Emits the JavaScript and declaration files. If targetSourceFile is not specified, then - * the JavaScript and declaration files will be produced for all the files in this program. - * If targetSourceFile is specified, then only the JavaScript and declaration for that - * specific file will be generated. - * - * If writeFile is not specified then the writeFile callback from the compiler host will be - * used for writing the JavaScript and declaration files. Otherwise, the writeFile parameter - * will be invoked when writing the JavaScript and declaration files. - */ - emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback): EmitResult; - getSyntacticDiagnostics(sourceFile?: SourceFile): Diagnostic[]; - getGlobalDiagnostics(): Diagnostic[]; - getSemanticDiagnostics(sourceFile?: SourceFile): Diagnostic[]; - getDeclarationDiagnostics(sourceFile?: SourceFile): Diagnostic[]; - /** - * Gets a type checker that can be used to semantically analyze source fils in the program. - */ - getTypeChecker(): TypeChecker; - } - interface SourceMapSpan { - /** Line number in the .js file. */ - emittedLine: number; - /** Column number in the .js file. */ - emittedColumn: number; - /** Line number in the .ts file. */ - sourceLine: number; - /** Column number in the .ts file. */ - sourceColumn: number; - /** Optional name (index into names array) associated with this span. */ - nameIndex?: number; - /** .ts file (index into sources array) associated with this span */ - sourceIndex: number; - } - interface SourceMapData { - sourceMapFilePath: string; - jsSourceMappingURL: string; - sourceMapFile: string; - sourceMapSourceRoot: string; - sourceMapSources: string[]; - sourceMapSourcesContent?: string[]; - inputSourceFileNames: string[]; - sourceMapNames?: string[]; - sourceMapMappings: string; - sourceMapDecodedMappings: SourceMapSpan[]; - } - /** Return code used by getEmitOutput function to indicate status of the function */ - enum ExitStatus { - Success = 0, - DiagnosticsPresent_OutputsSkipped = 1, - DiagnosticsPresent_OutputsGenerated = 2, - } - interface EmitResult { - emitSkipped: boolean; - diagnostics: Diagnostic[]; - } - interface TypeCheckerHost { - getCompilerOptions(): CompilerOptions; - getSourceFiles(): SourceFile[]; - getSourceFile(fileName: string): SourceFile; - } - interface TypeChecker { - getTypeOfSymbolAtLocation(symbol: Symbol, node: Node): Type; - getDeclaredTypeOfSymbol(symbol: Symbol): Type; - getPropertiesOfType(type: Type): Symbol[]; - getPropertyOfType(type: Type, propertyName: string): Symbol; - getSignaturesOfType(type: Type, kind: SignatureKind): Signature[]; - getIndexTypeOfType(type: Type, kind: IndexKind): Type; - getReturnTypeOfSignature(signature: Signature): Type; - getSymbolsInScope(location: Node, meaning: SymbolFlags): Symbol[]; - getSymbolAtLocation(node: Node): Symbol; - getShorthandAssignmentValueSymbol(location: Node): Symbol; - getTypeAtLocation(node: Node): Type; - typeToString(type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags): string; - symbolToString(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): string; - getSymbolDisplayBuilder(): SymbolDisplayBuilder; - getFullyQualifiedName(symbol: Symbol): string; - getAugmentedPropertiesOfType(type: Type): Symbol[]; - getRootSymbols(symbol: Symbol): Symbol[]; - getContextualType(node: Expression): Type; - getResolvedSignature(node: CallLikeExpression, candidatesOutArray?: Signature[]): Signature; - getSignatureFromDeclaration(declaration: SignatureDeclaration): Signature; - isImplementationOfOverload(node: FunctionLikeDeclaration): boolean; - isUndefinedSymbol(symbol: Symbol): boolean; - isArgumentsSymbol(symbol: Symbol): boolean; - getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number; - isValidPropertyAccess(node: PropertyAccessExpression | QualifiedName, propertyName: string): boolean; - getAliasedSymbol(symbol: Symbol): Symbol; - getExportsOfModule(moduleSymbol: Symbol): Symbol[]; - } - interface SymbolDisplayBuilder { - buildTypeDisplay(type: Type, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildSymbolDisplay(symbol: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags): void; - buildSignatureDisplay(signatures: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildParameterDisplay(parameter: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildTypeParameterDisplay(tp: TypeParameter, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildTypeParameterDisplayFromSymbol(symbol: Symbol, writer: SymbolWriter, enclosingDeclaraiton?: Node, flags?: TypeFormatFlags): void; - buildDisplayForParametersAndDelimiters(parameters: Symbol[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildDisplayForTypeParametersAndDelimiters(typeParameters: TypeParameter[], writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - buildReturnTypeDisplay(signature: Signature, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags): void; - } - interface SymbolWriter { - writeKeyword(text: string): void; - writeOperator(text: string): void; - writePunctuation(text: string): void; - writeSpace(text: string): void; - writeStringLiteral(text: string): void; - writeParameter(text: string): void; - writeSymbol(text: string, symbol: Symbol): void; - writeLine(): void; - increaseIndent(): void; - decreaseIndent(): void; - clear(): void; - trackSymbol(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): void; - } - const enum TypeFormatFlags { - None = 0, - WriteArrayAsGenericType = 1, - UseTypeOfFunction = 2, - NoTruncation = 4, - WriteArrowStyleSignature = 8, - WriteOwnNameForAnyLike = 16, - WriteTypeArgumentsOfSignature = 32, - InElementType = 64, - UseFullyQualifiedType = 128, - } - const enum SymbolFormatFlags { - None = 0, - WriteTypeParametersOrArguments = 1, - UseOnlyExternalAliasing = 2, - } - interface TypePredicate { - parameterName: string; - parameterIndex: number; - type: Type; - } - const enum SymbolFlags { - None = 0, - FunctionScopedVariable = 1, - BlockScopedVariable = 2, - Property = 4, - EnumMember = 8, - Function = 16, - Class = 32, - Interface = 64, - ConstEnum = 128, - RegularEnum = 256, - ValueModule = 512, - NamespaceModule = 1024, - TypeLiteral = 2048, - ObjectLiteral = 4096, - Method = 8192, - Constructor = 16384, - GetAccessor = 32768, - SetAccessor = 65536, - Signature = 131072, - TypeParameter = 262144, - TypeAlias = 524288, - ExportValue = 1048576, - ExportType = 2097152, - ExportNamespace = 4194304, - Alias = 8388608, - Instantiated = 16777216, - Merged = 33554432, - Transient = 67108864, - Prototype = 134217728, - UnionProperty = 268435456, - Optional = 536870912, - ExportStar = 1073741824, - Enum = 384, - Variable = 3, - Value = 107455, - Type = 793056, - Namespace = 1536, - Module = 1536, - Accessor = 98304, - FunctionScopedVariableExcludes = 107454, - BlockScopedVariableExcludes = 107455, - ParameterExcludes = 107455, - PropertyExcludes = 107455, - EnumMemberExcludes = 107455, - FunctionExcludes = 106927, - ClassExcludes = 899583, - InterfaceExcludes = 792992, - RegularEnumExcludes = 899327, - ConstEnumExcludes = 899967, - ValueModuleExcludes = 106639, - NamespaceModuleExcludes = 0, - MethodExcludes = 99263, - GetAccessorExcludes = 41919, - SetAccessorExcludes = 74687, - TypeParameterExcludes = 530912, - TypeAliasExcludes = 793056, - AliasExcludes = 8388608, - ModuleMember = 8914931, - ExportHasLocal = 944, - HasExports = 1952, - HasMembers = 6240, - BlockScoped = 418, - PropertyOrAccessor = 98308, - Export = 7340032, - } - interface Symbol { - flags: SymbolFlags; - name: string; - declarations?: Declaration[]; - valueDeclaration?: Declaration; - members?: SymbolTable; - exports?: SymbolTable; - } - interface SymbolTable { - [index: string]: Symbol; - } - const enum TypeFlags { - Any = 1, - String = 2, - Number = 4, - Boolean = 8, - Void = 16, - Undefined = 32, - Null = 64, - Enum = 128, - StringLiteral = 256, - TypeParameter = 512, - Class = 1024, - Interface = 2048, - Reference = 4096, - Tuple = 8192, - Union = 16384, - Anonymous = 32768, - Instantiated = 65536, - ObjectLiteral = 262144, - ESSymbol = 2097152, - StringLike = 258, - NumberLike = 132, - ObjectType = 48128, - } - interface Type { - flags: TypeFlags; - symbol?: Symbol; - } - interface StringLiteralType extends Type { - text: string; - } - interface ObjectType extends Type { - } - interface InterfaceType extends ObjectType { - typeParameters: TypeParameter[]; - outerTypeParameters: TypeParameter[]; - localTypeParameters: TypeParameter[]; - } - interface InterfaceTypeWithBaseTypes extends InterfaceType { - baseTypes: ObjectType[]; - } - interface InterfaceTypeWithDeclaredMembers extends InterfaceType { - declaredProperties: Symbol[]; - declaredCallSignatures: Signature[]; - declaredConstructSignatures: Signature[]; - declaredStringIndexType: Type; - declaredNumberIndexType: Type; - } - interface TypeReference extends ObjectType { - target: GenericType; - typeArguments: Type[]; - } - interface GenericType extends InterfaceType, TypeReference { - } - interface TupleType extends ObjectType { - elementTypes: Type[]; - baseArrayType: TypeReference; - } - interface UnionType extends Type { - types: Type[]; - } - interface TypeParameter extends Type { - constraint: Type; - } - const enum SignatureKind { - Call = 0, - Construct = 1, - } - interface Signature { - declaration: SignatureDeclaration; - typeParameters: TypeParameter[]; - parameters: Symbol[]; - typePredicate?: TypePredicate; - } - const enum IndexKind { - String = 0, - Number = 1, - } - interface DiagnosticMessage { - key: string; - category: DiagnosticCategory; - code: number; - } - /** - * A linked list of formatted diagnostic messages to be used as part of a multiline message. - * It is built from the bottom up, leaving the head to be the "main" diagnostic. - * While it seems that DiagnosticMessageChain is structurally similar to DiagnosticMessage, - * the difference is that messages are all preformatted in DMC. - */ - interface DiagnosticMessageChain { - messageText: string; - category: DiagnosticCategory; - code: number; - next?: DiagnosticMessageChain; - } - interface Diagnostic { - file: SourceFile; - start: number; - length: number; - messageText: string | DiagnosticMessageChain; - category: DiagnosticCategory; - code: number; - } - enum DiagnosticCategory { - Warning = 0, - Error = 1, - Message = 2, - } - interface CompilerOptions { - allowNonTsExtensions?: boolean; - charset?: string; - declaration?: boolean; - dependency?: boolean; - diagnostics?: boolean; - emitBOM?: boolean; - help?: boolean; - inlineSourceMap?: boolean; - inlineSources?: boolean; - listFiles?: boolean; - locale?: string; - mapRoot?: string; - module?: ModuleKind; - newLine?: NewLineKind; - noEmit?: boolean; - noEmitHelpers?: boolean; - noEmitOnError?: boolean; - noErrorTruncation?: boolean; - noImplicitAny?: boolean; - noLib?: boolean; - noResolve?: boolean; - out?: string; - outDir?: string; - preserveConstEnums?: boolean; - project?: string; - removeComments?: boolean; - rootDir?: string; - sourceMap?: boolean; - sourceRoot?: string; - suppressImplicitAnyIndexErrors?: boolean; - target?: ScriptTarget; - version?: boolean; - watch?: boolean; - isolatedModules?: boolean; - experimentalDecorators?: boolean; - emitDecoratorMetadata?: boolean; - [option: string]: string | number | boolean; - } - const enum ModuleKind { - None = 0, - CommonJS = 1, - AMD = 2, - UMD = 3, - System = 4, - } - const enum NewLineKind { - CarriageReturnLineFeed = 0, - LineFeed = 1, - } - interface LineAndCharacter { - line: number; - character: number; - } - const enum ScriptTarget { - ES3 = 0, - ES5 = 1, - ES6 = 2, - Latest = 2, - } - interface ParsedCommandLine { - options: CompilerOptions; - fileNames: string[]; - errors: Diagnostic[]; - } - interface CancellationToken { - isCancellationRequested(): boolean; - } - interface CompilerHost { - getSourceFile(fileName: string, languageVersion: ScriptTarget, onError?: (message: string) => void): SourceFile; - getDefaultLibFileName(options: CompilerOptions): string; - getCancellationToken?(): CancellationToken; - writeFile: WriteFileCallback; - getCurrentDirectory(): string; - getCanonicalFileName(fileName: string): string; - useCaseSensitiveFileNames(): boolean; - getNewLine(): string; - } - interface TextSpan { - start: number; - length: number; - } - interface TextChangeRange { - span: TextSpan; - newLength: number; - } -} -declare module ts { - interface System { - args: string[]; - newLine: string; - useCaseSensitiveFileNames: boolean; - write(s: string): void; - readFile(path: string, encoding?: string): string; - writeFile(path: string, data: string, writeByteOrderMark?: boolean): void; - watchFile?(path: string, callback: (path: string) => void): FileWatcher; - resolvePath(path: string): string; - fileExists(path: string): boolean; - directoryExists(path: string): boolean; - createDirectory(path: string): void; - getExecutingFilePath(): string; - getCurrentDirectory(): string; - readDirectory(path: string, extension?: string, exclude?: string[]): string[]; - getMemoryUsage?(): number; - exit(exitCode?: number): void; - } - interface FileWatcher { - close(): void; - } - var sys: System; -} -declare module ts { - interface ErrorCallback { - (message: DiagnosticMessage, length: number): void; - } - interface Scanner { - getStartPos(): number; - getToken(): SyntaxKind; - getTextPos(): number; - getTokenPos(): number; - getTokenText(): string; - getTokenValue(): string; - hasExtendedUnicodeEscape(): boolean; - hasPrecedingLineBreak(): boolean; - isIdentifier(): boolean; - isReservedWord(): boolean; - isUnterminated(): boolean; - reScanGreaterToken(): SyntaxKind; - reScanSlashToken(): SyntaxKind; - reScanTemplateToken(): SyntaxKind; - scan(): SyntaxKind; - setText(text: string, start?: number, length?: number): void; - setOnError(onError: ErrorCallback): void; - setScriptTarget(scriptTarget: ScriptTarget): void; - setTextPos(textPos: number): void; - lookAhead(callback: () => T): T; - tryScan(callback: () => T): T; - } - function tokenToString(t: SyntaxKind): string; - function getPositionOfLineAndCharacter(sourceFile: SourceFile, line: number, character: number): number; - function getLineAndCharacterOfPosition(sourceFile: SourceFile, position: number): LineAndCharacter; - function isWhiteSpace(ch: number): boolean; - function isLineBreak(ch: number): boolean; - function getLeadingCommentRanges(text: string, pos: number): CommentRange[]; - function getTrailingCommentRanges(text: string, pos: number): CommentRange[]; - function isIdentifierStart(ch: number, languageVersion: ScriptTarget): boolean; - function isIdentifierPart(ch: number, languageVersion: ScriptTarget): boolean; -} -declare module ts { - function getDefaultLibFileName(options: CompilerOptions): string; - function textSpanEnd(span: TextSpan): number; - function textSpanIsEmpty(span: TextSpan): boolean; - function textSpanContainsPosition(span: TextSpan, position: number): boolean; - function textSpanContainsTextSpan(span: TextSpan, other: TextSpan): boolean; - function textSpanOverlapsWith(span: TextSpan, other: TextSpan): boolean; - function textSpanOverlap(span1: TextSpan, span2: TextSpan): TextSpan; - function textSpanIntersectsWithTextSpan(span: TextSpan, other: TextSpan): boolean; - function textSpanIntersectsWith(span: TextSpan, start: number, length: number): boolean; - function textSpanIntersectsWithPosition(span: TextSpan, position: number): boolean; - function textSpanIntersection(span1: TextSpan, span2: TextSpan): TextSpan; - function createTextSpan(start: number, length: number): TextSpan; - function createTextSpanFromBounds(start: number, end: number): TextSpan; - function textChangeRangeNewSpan(range: TextChangeRange): TextSpan; - function textChangeRangeIsUnchanged(range: TextChangeRange): boolean; - function createTextChangeRange(span: TextSpan, newLength: number): TextChangeRange; - let unchangedTextChangeRange: TextChangeRange; - /** - * Called to merge all the changes that occurred across several versions of a script snapshot - * into a single change. i.e. if a user keeps making successive edits to a script we will - * have a text change from V1 to V2, V2 to V3, ..., Vn. - * - * This function will then merge those changes into a single change range valid between V1 and - * Vn. - */ - function collapseTextChangeRangesAcrossMultipleVersions(changes: TextChangeRange[]): TextChangeRange; - function getTypeParameterOwner(d: Declaration): Declaration; -} -declare module ts { - function getNodeConstructor(kind: SyntaxKind): new () => Node; - function createNode(kind: SyntaxKind): Node; - function forEachChild(node: Node, cbNode: (node: Node) => T, cbNodeArray?: (nodes: Node[]) => T): T; - function createSourceFile(fileName: string, sourceText: string, languageVersion: ScriptTarget, setParentNodes?: boolean): SourceFile; - function updateSourceFile(sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile; -} -declare module ts { - /** The version of the TypeScript compiler release */ - const version: string; - function findConfigFile(searchPath: string): string; - function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost; - function getPreEmitDiagnostics(program: Program, sourceFile?: SourceFile): Diagnostic[]; - function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain, newLine: string): string; - function createProgram(rootNames: string[], options: CompilerOptions, host?: CompilerHost): Program; -} -declare module ts { - function parseCommandLine(commandLine: string[]): ParsedCommandLine; - /** - * Read tsconfig.json file - * @param fileName The path to the config file - */ - function readConfigFile(fileName: string): { - config?: any; - error?: Diagnostic; - }; - /** - * Parse the text of the tsconfig.json file - * @param fileName The path to the config file - * @param jsonText The text of the config file - */ - function parseConfigFileText(fileName: string, jsonText: string): { - config?: any; - error?: Diagnostic; - }; - /** - * Parse the contents of a config file (tsconfig.json). - * @param json The contents of the config file to parse - * @param basePath A root directory to resolve relative path entries in the config - * file to. e.g. outDir - */ - function parseConfigFile(json: any, host: ParseConfigHost, basePath: string): ParsedCommandLine; -} -declare module ts { - /** The version of the language service API */ - let servicesVersion: string; - interface Node { - getSourceFile(): SourceFile; - getChildCount(sourceFile?: SourceFile): number; - getChildAt(index: number, sourceFile?: SourceFile): Node; - getChildren(sourceFile?: SourceFile): Node[]; - getStart(sourceFile?: SourceFile): number; - getFullStart(): number; - getEnd(): number; - getWidth(sourceFile?: SourceFile): number; - getFullWidth(): number; - getLeadingTriviaWidth(sourceFile?: SourceFile): number; - getFullText(sourceFile?: SourceFile): string; - getText(sourceFile?: SourceFile): string; - getFirstToken(sourceFile?: SourceFile): Node; - getLastToken(sourceFile?: SourceFile): Node; - } - interface Symbol { - getFlags(): SymbolFlags; - getName(): string; - getDeclarations(): Declaration[]; - getDocumentationComment(): SymbolDisplayPart[]; - } - interface Type { - getFlags(): TypeFlags; - getSymbol(): Symbol; - getProperties(): Symbol[]; - getProperty(propertyName: string): Symbol; - getApparentProperties(): Symbol[]; - getCallSignatures(): Signature[]; - getConstructSignatures(): Signature[]; - getStringIndexType(): Type; - getNumberIndexType(): Type; - } - interface Signature { - getDeclaration(): SignatureDeclaration; - getTypeParameters(): Type[]; - getParameters(): Symbol[]; - getReturnType(): Type; - getDocumentationComment(): SymbolDisplayPart[]; - } - interface SourceFile { - getLineAndCharacterOfPosition(pos: number): LineAndCharacter; - getLineStarts(): number[]; - getPositionOfLineAndCharacter(line: number, character: number): number; - update(newText: string, textChangeRange: TextChangeRange): SourceFile; - } - /** - * Represents an immutable snapshot of a script at a specified time.Once acquired, the - * snapshot is observably immutable. i.e. the same calls with the same parameters will return - * the same values. - */ - interface IScriptSnapshot { - /** Gets a portion of the script snapshot specified by [start, end). */ - getText(start: number, end: number): string; - /** Gets the length of this script snapshot. */ - getLength(): number; - /** - * Gets the TextChangeRange that describe how the text changed between this text and - * an older version. This information is used by the incremental parser to determine - * what sections of the script need to be re-parsed. 'undefined' can be returned if the - * change range cannot be determined. However, in that case, incremental parsing will - * not happen and the entire document will be re - parsed. - */ - getChangeRange(oldSnapshot: IScriptSnapshot): TextChangeRange; - } - module ScriptSnapshot { - function fromString(text: string): IScriptSnapshot; - } - interface PreProcessedFileInfo { - referencedFiles: FileReference[]; - importedFiles: FileReference[]; - isLibFile: boolean; - } - interface LanguageServiceHost { - getCompilationSettings(): CompilerOptions; - getNewLine?(): string; - getProjectVersion?(): string; - getScriptFileNames(): string[]; - getScriptVersion(fileName: string): string; - getScriptSnapshot(fileName: string): IScriptSnapshot; - getLocalizedDiagnosticMessages?(): any; - getCancellationToken?(): CancellationToken; - getCurrentDirectory(): string; - getDefaultLibFileName(options: CompilerOptions): string; - log?(s: string): void; - trace?(s: string): void; - error?(s: string): void; - useCaseSensitiveFileNames?(): boolean; - } - interface LanguageService { - cleanupSemanticCache(): void; - getSyntacticDiagnostics(fileName: string): Diagnostic[]; - getSemanticDiagnostics(fileName: string): Diagnostic[]; - getCompilerOptionsDiagnostics(): Diagnostic[]; - /** - * @deprecated Use getEncodedSyntacticClassifications instead. - */ - getSyntacticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; - /** - * @deprecated Use getEncodedSemanticClassifications instead. - */ - getSemanticClassifications(fileName: string, span: TextSpan): ClassifiedSpan[]; - getEncodedSyntacticClassifications(fileName: string, span: TextSpan): Classifications; - getEncodedSemanticClassifications(fileName: string, span: TextSpan): Classifications; - getCompletionsAtPosition(fileName: string, position: number): CompletionInfo; - getCompletionEntryDetails(fileName: string, position: number, entryName: string): CompletionEntryDetails; - getQuickInfoAtPosition(fileName: string, position: number): QuickInfo; - getNameOrDottedNameSpan(fileName: string, startPos: number, endPos: number): TextSpan; - getBreakpointStatementAtPosition(fileName: string, position: number): TextSpan; - getSignatureHelpItems(fileName: string, position: number): SignatureHelpItems; - getRenameInfo(fileName: string, position: number): RenameInfo; - findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean): RenameLocation[]; - getDefinitionAtPosition(fileName: string, position: number): DefinitionInfo[]; - getTypeDefinitionAtPosition(fileName: string, position: number): DefinitionInfo[]; - getReferencesAtPosition(fileName: string, position: number): ReferenceEntry[]; - findReferences(fileName: string, position: number): ReferencedSymbol[]; - getDocumentHighlights(fileName: string, position: number, filesToSearch: string[]): DocumentHighlights[]; - /** @deprecated */ - getOccurrencesAtPosition(fileName: string, position: number): ReferenceEntry[]; - getNavigateToItems(searchValue: string, maxResultCount?: number): NavigateToItem[]; - getNavigationBarItems(fileName: string): NavigationBarItem[]; - getOutliningSpans(fileName: string): OutliningSpan[]; - getTodoComments(fileName: string, descriptors: TodoCommentDescriptor[]): TodoComment[]; - getBraceMatchingAtPosition(fileName: string, position: number): TextSpan[]; - getIndentationAtPosition(fileName: string, position: number, options: EditorOptions): number; - getFormattingEditsForRange(fileName: string, start: number, end: number, options: FormatCodeOptions): TextChange[]; - getFormattingEditsForDocument(fileName: string, options: FormatCodeOptions): TextChange[]; - getFormattingEditsAfterKeystroke(fileName: string, position: number, key: string, options: FormatCodeOptions): TextChange[]; - getEmitOutput(fileName: string): EmitOutput; - getProgram(): Program; - getSourceFile(fileName: string): SourceFile; - dispose(): void; - } - interface Classifications { - spans: number[]; - endOfLineState: EndOfLineState; - } - interface ClassifiedSpan { - textSpan: TextSpan; - classificationType: string; - } - interface NavigationBarItem { - text: string; - kind: string; - kindModifiers: string; - spans: TextSpan[]; - childItems: NavigationBarItem[]; - indent: number; - bolded: boolean; - grayed: boolean; - } - interface TodoCommentDescriptor { - text: string; - priority: number; - } - interface TodoComment { - descriptor: TodoCommentDescriptor; - message: string; - position: number; - } - class TextChange { - span: TextSpan; - newText: string; - } - interface RenameLocation { - textSpan: TextSpan; - fileName: string; - } - interface ReferenceEntry { - textSpan: TextSpan; - fileName: string; - isWriteAccess: boolean; - } - interface DocumentHighlights { - fileName: string; - highlightSpans: HighlightSpan[]; - } - module HighlightSpanKind { - const none: string; - const definition: string; - const reference: string; - const writtenReference: string; - } - interface HighlightSpan { - textSpan: TextSpan; - kind: string; - } - interface NavigateToItem { - name: string; - kind: string; - kindModifiers: string; - matchKind: string; - isCaseSensitive: boolean; - fileName: string; - textSpan: TextSpan; - containerName: string; - containerKind: string; - } - interface EditorOptions { - IndentSize: number; - TabSize: number; - NewLineCharacter: string; - ConvertTabsToSpaces: boolean; - } - interface FormatCodeOptions extends EditorOptions { - InsertSpaceAfterCommaDelimiter: boolean; - InsertSpaceAfterSemicolonInForStatements: boolean; - InsertSpaceBeforeAndAfterBinaryOperators: boolean; - InsertSpaceAfterKeywordsInControlFlowStatements: boolean; - InsertSpaceAfterFunctionKeywordForAnonymousFunctions: boolean; - InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: boolean; - PlaceOpenBraceOnNewLineForFunctions: boolean; - PlaceOpenBraceOnNewLineForControlBlocks: boolean; - [s: string]: boolean | number | string; - } - interface DefinitionInfo { - fileName: string; - textSpan: TextSpan; - kind: string; - name: string; - containerKind: string; - containerName: string; - } - interface ReferencedSymbol { - definition: DefinitionInfo; - references: ReferenceEntry[]; - } - enum SymbolDisplayPartKind { - aliasName = 0, - className = 1, - enumName = 2, - fieldName = 3, - interfaceName = 4, - keyword = 5, - lineBreak = 6, - numericLiteral = 7, - stringLiteral = 8, - localName = 9, - methodName = 10, - moduleName = 11, - operator = 12, - parameterName = 13, - propertyName = 14, - punctuation = 15, - space = 16, - text = 17, - typeParameterName = 18, - enumMemberName = 19, - functionName = 20, - regularExpressionLiteral = 21, - } - interface SymbolDisplayPart { - text: string; - kind: string; - } - interface QuickInfo { - kind: string; - kindModifiers: string; - textSpan: TextSpan; - displayParts: SymbolDisplayPart[]; - documentation: SymbolDisplayPart[]; - } - interface RenameInfo { - canRename: boolean; - localizedErrorMessage: string; - displayName: string; - fullDisplayName: string; - kind: string; - kindModifiers: string; - triggerSpan: TextSpan; - } - interface SignatureHelpParameter { - name: string; - documentation: SymbolDisplayPart[]; - displayParts: SymbolDisplayPart[]; - isOptional: boolean; - } - /** - * Represents a single signature to show in signature help. - * The id is used for subsequent calls into the language service to ask questions about the - * signature help item in the context of any documents that have been updated. i.e. after - * an edit has happened, while signature help is still active, the host can ask important - * questions like 'what parameter is the user currently contained within?'. - */ - interface SignatureHelpItem { - isVariadic: boolean; - prefixDisplayParts: SymbolDisplayPart[]; - suffixDisplayParts: SymbolDisplayPart[]; - separatorDisplayParts: SymbolDisplayPart[]; - parameters: SignatureHelpParameter[]; - documentation: SymbolDisplayPart[]; - } - /** - * Represents a set of signature help items, and the preferred item that should be selected. - */ - interface SignatureHelpItems { - items: SignatureHelpItem[]; - applicableSpan: TextSpan; - selectedItemIndex: number; - argumentIndex: number; - argumentCount: number; - } - interface CompletionInfo { - isMemberCompletion: boolean; - isNewIdentifierLocation: boolean; - entries: CompletionEntry[]; - } - interface CompletionEntry { - name: string; - kind: string; - kindModifiers: string; - sortText: string; - } - interface CompletionEntryDetails { - name: string; - kind: string; - kindModifiers: string; - displayParts: SymbolDisplayPart[]; - documentation: SymbolDisplayPart[]; - } - interface OutliningSpan { - /** The span of the document to actually collapse. */ - textSpan: TextSpan; - /** The span of the document to display when the user hovers over the collapsed span. */ - hintSpan: TextSpan; - /** The text to display in the editor for the collapsed region. */ - bannerText: string; - /** - * Whether or not this region should be automatically collapsed when - * the 'Collapse to Definitions' command is invoked. - */ - autoCollapse: boolean; - } - interface EmitOutput { - outputFiles: OutputFile[]; - emitSkipped: boolean; - } - const enum OutputFileType { - JavaScript = 0, - SourceMap = 1, - Declaration = 2, - } - interface OutputFile { - name: string; - writeByteOrderMark: boolean; - text: string; - } - const enum EndOfLineState { - None = 0, - InMultiLineCommentTrivia = 1, - InSingleQuoteStringLiteral = 2, - InDoubleQuoteStringLiteral = 3, - InTemplateHeadOrNoSubstitutionTemplate = 4, - InTemplateMiddleOrTail = 5, - InTemplateSubstitutionPosition = 6, - } - enum TokenClass { - Punctuation = 0, - Keyword = 1, - Operator = 2, - Comment = 3, - Whitespace = 4, - Identifier = 5, - NumberLiteral = 6, - StringLiteral = 7, - RegExpLiteral = 8, - } - interface ClassificationResult { - finalLexState: EndOfLineState; - entries: ClassificationInfo[]; - } - interface ClassificationInfo { - length: number; - classification: TokenClass; - } - interface Classifier { - /** - * Gives lexical classifications of tokens on a line without any syntactic context. - * For instance, a token consisting of the text 'string' can be either an identifier - * named 'string' or the keyword 'string', however, because this classifier is not aware, - * it relies on certain heuristics to give acceptable results. For classifications where - * speed trumps accuracy, this function is preferable; however, for true accuracy, the - * syntactic classifier is ideal. In fact, in certain editing scenarios, combining the - * lexical, syntactic, and semantic classifiers may issue the best user experience. - * - * @param text The text of a line to classify. - * @param lexState The state of the lexical classifier at the end of the previous line. - * @param syntacticClassifierAbsent Whether the client is *not* using a syntactic classifier. - * If there is no syntactic classifier (syntacticClassifierAbsent=true), - * certain heuristics may be used in its place; however, if there is a - * syntactic classifier (syntacticClassifierAbsent=false), certain - * classifications which may be incorrectly categorized will be given - * back as Identifiers in order to allow the syntactic classifier to - * subsume the classification. - * @deprecated Use getLexicalClassifications instead. - */ - getClassificationsForLine(text: string, lexState: EndOfLineState, syntacticClassifierAbsent: boolean): ClassificationResult; - getEncodedLexicalClassifications(text: string, endOfLineState: EndOfLineState, syntacticClassifierAbsent: boolean): Classifications; - } - /** - * The document registry represents a store of SourceFile objects that can be shared between - * multiple LanguageService instances. A LanguageService instance holds on the SourceFile (AST) - * of files in the context. - * SourceFile objects account for most of the memory usage by the language service. Sharing - * the same DocumentRegistry instance between different instances of LanguageService allow - * for more efficient memory utilization since all projects will share at least the library - * file (lib.d.ts). - * - * A more advanced use of the document registry is to serialize sourceFile objects to disk - * and re-hydrate them when needed. - * - * To create a default DocumentRegistry, use createDocumentRegistry to create one, and pass it - * to all subsequent createLanguageService calls. - */ - interface DocumentRegistry { - /** - * Request a stored SourceFile with a given fileName and compilationSettings. - * The first call to acquire will call createLanguageServiceSourceFile to generate - * the SourceFile if was not found in the registry. - * - * @param fileName The name of the file requested - * @param compilationSettings Some compilation settings like target affects the - * shape of a the resulting SourceFile. This allows the DocumentRegistry to store - * multiple copies of the same file for different compilation settings. - * @parm scriptSnapshot Text of the file. Only used if the file was not found - * in the registry and a new one was created. - * @parm version Current version of the file. Only used if the file was not found - * in the registry and a new one was created. - */ - acquireDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string): SourceFile; - /** - * Request an updated version of an already existing SourceFile with a given fileName - * and compilationSettings. The update will in-turn call updateLanguageServiceSourceFile - * to get an updated SourceFile. - * - * @param fileName The name of the file requested - * @param compilationSettings Some compilation settings like target affects the - * shape of a the resulting SourceFile. This allows the DocumentRegistry to store - * multiple copies of the same file for different compilation settings. - * @param scriptSnapshot Text of the file. - * @param version Current version of the file. - */ - updateDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string): SourceFile; - /** - * Informs the DocumentRegistry that a file is not needed any longer. - * - * Note: It is not allowed to call release on a SourceFile that was not acquired from - * this registry originally. - * - * @param fileName The name of the file to be released - * @param compilationSettings The compilation settings used to acquire the file - */ - releaseDocument(fileName: string, compilationSettings: CompilerOptions): void; - } - module ScriptElementKind { - const unknown: string; - const warning: string; - const keyword: string; - const scriptElement: string; - const moduleElement: string; - const classElement: string; - const interfaceElement: string; - const typeElement: string; - const enumElement: string; - const variableElement: string; - const localVariableElement: string; - const functionElement: string; - const localFunctionElement: string; - const memberFunctionElement: string; - const memberGetAccessorElement: string; - const memberSetAccessorElement: string; - const memberVariableElement: string; - const constructorImplementationElement: string; - const callSignatureElement: string; - const indexSignatureElement: string; - const constructSignatureElement: string; - const parameterElement: string; - const typeParameterElement: string; - const primitiveType: string; - const label: string; - const alias: string; - const constElement: string; - const letElement: string; - } - module ScriptElementKindModifier { - const none: string; - const publicMemberModifier: string; - const privateMemberModifier: string; - const protectedMemberModifier: string; - const exportedModifier: string; - const ambientModifier: string; - const staticModifier: string; - } - class ClassificationTypeNames { - static comment: string; - static identifier: string; - static keyword: string; - static numericLiteral: string; - static operator: string; - static stringLiteral: string; - static whiteSpace: string; - static text: string; - static punctuation: string; - static className: string; - static enumName: string; - static interfaceName: string; - static moduleName: string; - static typeParameterName: string; - static typeAliasName: string; - static parameterName: string; - static docCommentTagName: string; - } - 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, - } - interface DisplayPartsSymbolWriter extends SymbolWriter { - displayParts(): SymbolDisplayPart[]; - } - function displayPartsToString(displayParts: SymbolDisplayPart[]): string; - function getDefaultCompilerOptions(): CompilerOptions; - class OperationCanceledException { - } - class CancellationTokenObject { - private cancellationToken; - static None: CancellationTokenObject; - constructor(cancellationToken: CancellationToken); - isCancellationRequested(): boolean; - throwIfCancellationRequested(): void; - } - function transpile(input: string, compilerOptions?: CompilerOptions, fileName?: string, diagnostics?: Diagnostic[], moduleName?: string): string; - function createLanguageServiceSourceFile(fileName: string, scriptSnapshot: IScriptSnapshot, scriptTarget: ScriptTarget, version: string, setNodeParents: boolean): SourceFile; - let disableIncrementalParsing: boolean; - function updateLanguageServiceSourceFile(sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile; - function createDocumentRegistry(useCaseSensitiveFileNames?: boolean): DocumentRegistry; - function preProcessFile(sourceText: string, readImportFiles?: boolean): PreProcessedFileInfo; - function createLanguageService(host: LanguageServiceHost, documentRegistry?: DocumentRegistry): LanguageService; - function createClassifier(): Classifier; - /** - * Get the path of the default library file (lib.d.ts) as distributed with the typescript - * node package. - * The functionality is not supported if the ts module is consumed outside of a node module. - */ - function getDefaultLibFilePath(options: CompilerOptions): string; -} -export = ts; \ No newline at end of file diff --git a/build/lib/typescript/typescriptServices.js b/build/lib/typescript/typescriptServices.js deleted file mode 100644 index 349ff6ad391a5153f111c8a1353826fcb833c6cc..0000000000000000000000000000000000000000 --- a/build/lib/typescript/typescriptServices.js +++ /dev/null @@ -1,44323 +0,0 @@ -var ts; -(function (ts) { - // token > SyntaxKind.Identifer => token is a keyword - (function (SyntaxKind) { - SyntaxKind[SyntaxKind["Unknown"] = 0] = "Unknown"; - SyntaxKind[SyntaxKind["EndOfFileToken"] = 1] = "EndOfFileToken"; - SyntaxKind[SyntaxKind["SingleLineCommentTrivia"] = 2] = "SingleLineCommentTrivia"; - SyntaxKind[SyntaxKind["MultiLineCommentTrivia"] = 3] = "MultiLineCommentTrivia"; - SyntaxKind[SyntaxKind["NewLineTrivia"] = 4] = "NewLineTrivia"; - SyntaxKind[SyntaxKind["WhitespaceTrivia"] = 5] = "WhitespaceTrivia"; - // We detect and provide better error recovery when we encounter a git merge marker. This - // allows us to edit files with git-conflict markers in them in a much more pleasant manner. - SyntaxKind[SyntaxKind["ConflictMarkerTrivia"] = 6] = "ConflictMarkerTrivia"; - // Literals - SyntaxKind[SyntaxKind["NumericLiteral"] = 7] = "NumericLiteral"; - SyntaxKind[SyntaxKind["StringLiteral"] = 8] = "StringLiteral"; - SyntaxKind[SyntaxKind["RegularExpressionLiteral"] = 9] = "RegularExpressionLiteral"; - SyntaxKind[SyntaxKind["NoSubstitutionTemplateLiteral"] = 10] = "NoSubstitutionTemplateLiteral"; - // Pseudo-literals - SyntaxKind[SyntaxKind["TemplateHead"] = 11] = "TemplateHead"; - SyntaxKind[SyntaxKind["TemplateMiddle"] = 12] = "TemplateMiddle"; - SyntaxKind[SyntaxKind["TemplateTail"] = 13] = "TemplateTail"; - // Punctuation - SyntaxKind[SyntaxKind["OpenBraceToken"] = 14] = "OpenBraceToken"; - SyntaxKind[SyntaxKind["CloseBraceToken"] = 15] = "CloseBraceToken"; - SyntaxKind[SyntaxKind["OpenParenToken"] = 16] = "OpenParenToken"; - SyntaxKind[SyntaxKind["CloseParenToken"] = 17] = "CloseParenToken"; - SyntaxKind[SyntaxKind["OpenBracketToken"] = 18] = "OpenBracketToken"; - SyntaxKind[SyntaxKind["CloseBracketToken"] = 19] = "CloseBracketToken"; - SyntaxKind[SyntaxKind["DotToken"] = 20] = "DotToken"; - SyntaxKind[SyntaxKind["DotDotDotToken"] = 21] = "DotDotDotToken"; - SyntaxKind[SyntaxKind["SemicolonToken"] = 22] = "SemicolonToken"; - SyntaxKind[SyntaxKind["CommaToken"] = 23] = "CommaToken"; - SyntaxKind[SyntaxKind["LessThanToken"] = 24] = "LessThanToken"; - SyntaxKind[SyntaxKind["GreaterThanToken"] = 25] = "GreaterThanToken"; - SyntaxKind[SyntaxKind["LessThanEqualsToken"] = 26] = "LessThanEqualsToken"; - SyntaxKind[SyntaxKind["GreaterThanEqualsToken"] = 27] = "GreaterThanEqualsToken"; - SyntaxKind[SyntaxKind["EqualsEqualsToken"] = 28] = "EqualsEqualsToken"; - SyntaxKind[SyntaxKind["ExclamationEqualsToken"] = 29] = "ExclamationEqualsToken"; - SyntaxKind[SyntaxKind["EqualsEqualsEqualsToken"] = 30] = "EqualsEqualsEqualsToken"; - SyntaxKind[SyntaxKind["ExclamationEqualsEqualsToken"] = 31] = "ExclamationEqualsEqualsToken"; - SyntaxKind[SyntaxKind["EqualsGreaterThanToken"] = 32] = "EqualsGreaterThanToken"; - SyntaxKind[SyntaxKind["PlusToken"] = 33] = "PlusToken"; - SyntaxKind[SyntaxKind["MinusToken"] = 34] = "MinusToken"; - SyntaxKind[SyntaxKind["AsteriskToken"] = 35] = "AsteriskToken"; - SyntaxKind[SyntaxKind["SlashToken"] = 36] = "SlashToken"; - SyntaxKind[SyntaxKind["PercentToken"] = 37] = "PercentToken"; - SyntaxKind[SyntaxKind["PlusPlusToken"] = 38] = "PlusPlusToken"; - SyntaxKind[SyntaxKind["MinusMinusToken"] = 39] = "MinusMinusToken"; - SyntaxKind[SyntaxKind["LessThanLessThanToken"] = 40] = "LessThanLessThanToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanToken"] = 41] = "GreaterThanGreaterThanToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanToken"] = 42] = "GreaterThanGreaterThanGreaterThanToken"; - SyntaxKind[SyntaxKind["AmpersandToken"] = 43] = "AmpersandToken"; - SyntaxKind[SyntaxKind["BarToken"] = 44] = "BarToken"; - SyntaxKind[SyntaxKind["CaretToken"] = 45] = "CaretToken"; - SyntaxKind[SyntaxKind["ExclamationToken"] = 46] = "ExclamationToken"; - SyntaxKind[SyntaxKind["TildeToken"] = 47] = "TildeToken"; - SyntaxKind[SyntaxKind["AmpersandAmpersandToken"] = 48] = "AmpersandAmpersandToken"; - SyntaxKind[SyntaxKind["BarBarToken"] = 49] = "BarBarToken"; - SyntaxKind[SyntaxKind["QuestionToken"] = 50] = "QuestionToken"; - SyntaxKind[SyntaxKind["ColonToken"] = 51] = "ColonToken"; - SyntaxKind[SyntaxKind["AtToken"] = 52] = "AtToken"; - // Assignments - SyntaxKind[SyntaxKind["EqualsToken"] = 53] = "EqualsToken"; - SyntaxKind[SyntaxKind["PlusEqualsToken"] = 54] = "PlusEqualsToken"; - SyntaxKind[SyntaxKind["MinusEqualsToken"] = 55] = "MinusEqualsToken"; - SyntaxKind[SyntaxKind["AsteriskEqualsToken"] = 56] = "AsteriskEqualsToken"; - SyntaxKind[SyntaxKind["SlashEqualsToken"] = 57] = "SlashEqualsToken"; - SyntaxKind[SyntaxKind["PercentEqualsToken"] = 58] = "PercentEqualsToken"; - SyntaxKind[SyntaxKind["LessThanLessThanEqualsToken"] = 59] = "LessThanLessThanEqualsToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanEqualsToken"] = 60] = "GreaterThanGreaterThanEqualsToken"; - SyntaxKind[SyntaxKind["GreaterThanGreaterThanGreaterThanEqualsToken"] = 61] = "GreaterThanGreaterThanGreaterThanEqualsToken"; - SyntaxKind[SyntaxKind["AmpersandEqualsToken"] = 62] = "AmpersandEqualsToken"; - SyntaxKind[SyntaxKind["BarEqualsToken"] = 63] = "BarEqualsToken"; - SyntaxKind[SyntaxKind["CaretEqualsToken"] = 64] = "CaretEqualsToken"; - // Identifiers - SyntaxKind[SyntaxKind["Identifier"] = 65] = "Identifier"; - // Reserved words - SyntaxKind[SyntaxKind["BreakKeyword"] = 66] = "BreakKeyword"; - SyntaxKind[SyntaxKind["CaseKeyword"] = 67] = "CaseKeyword"; - SyntaxKind[SyntaxKind["CatchKeyword"] = 68] = "CatchKeyword"; - SyntaxKind[SyntaxKind["ClassKeyword"] = 69] = "ClassKeyword"; - SyntaxKind[SyntaxKind["ConstKeyword"] = 70] = "ConstKeyword"; - SyntaxKind[SyntaxKind["ContinueKeyword"] = 71] = "ContinueKeyword"; - SyntaxKind[SyntaxKind["DebuggerKeyword"] = 72] = "DebuggerKeyword"; - SyntaxKind[SyntaxKind["DefaultKeyword"] = 73] = "DefaultKeyword"; - SyntaxKind[SyntaxKind["DeleteKeyword"] = 74] = "DeleteKeyword"; - SyntaxKind[SyntaxKind["DoKeyword"] = 75] = "DoKeyword"; - SyntaxKind[SyntaxKind["ElseKeyword"] = 76] = "ElseKeyword"; - SyntaxKind[SyntaxKind["EnumKeyword"] = 77] = "EnumKeyword"; - SyntaxKind[SyntaxKind["ExportKeyword"] = 78] = "ExportKeyword"; - SyntaxKind[SyntaxKind["ExtendsKeyword"] = 79] = "ExtendsKeyword"; - SyntaxKind[SyntaxKind["FalseKeyword"] = 80] = "FalseKeyword"; - SyntaxKind[SyntaxKind["FinallyKeyword"] = 81] = "FinallyKeyword"; - SyntaxKind[SyntaxKind["ForKeyword"] = 82] = "ForKeyword"; - SyntaxKind[SyntaxKind["FunctionKeyword"] = 83] = "FunctionKeyword"; - SyntaxKind[SyntaxKind["IfKeyword"] = 84] = "IfKeyword"; - SyntaxKind[SyntaxKind["ImportKeyword"] = 85] = "ImportKeyword"; - SyntaxKind[SyntaxKind["InKeyword"] = 86] = "InKeyword"; - SyntaxKind[SyntaxKind["InstanceOfKeyword"] = 87] = "InstanceOfKeyword"; - SyntaxKind[SyntaxKind["NewKeyword"] = 88] = "NewKeyword"; - SyntaxKind[SyntaxKind["NullKeyword"] = 89] = "NullKeyword"; - SyntaxKind[SyntaxKind["ReturnKeyword"] = 90] = "ReturnKeyword"; - SyntaxKind[SyntaxKind["SuperKeyword"] = 91] = "SuperKeyword"; - SyntaxKind[SyntaxKind["SwitchKeyword"] = 92] = "SwitchKeyword"; - SyntaxKind[SyntaxKind["ThisKeyword"] = 93] = "ThisKeyword"; - SyntaxKind[SyntaxKind["ThrowKeyword"] = 94] = "ThrowKeyword"; - SyntaxKind[SyntaxKind["TrueKeyword"] = 95] = "TrueKeyword"; - SyntaxKind[SyntaxKind["TryKeyword"] = 96] = "TryKeyword"; - SyntaxKind[SyntaxKind["TypeOfKeyword"] = 97] = "TypeOfKeyword"; - SyntaxKind[SyntaxKind["VarKeyword"] = 98] = "VarKeyword"; - SyntaxKind[SyntaxKind["VoidKeyword"] = 99] = "VoidKeyword"; - SyntaxKind[SyntaxKind["WhileKeyword"] = 100] = "WhileKeyword"; - SyntaxKind[SyntaxKind["WithKeyword"] = 101] = "WithKeyword"; - // Strict mode reserved words - SyntaxKind[SyntaxKind["ImplementsKeyword"] = 102] = "ImplementsKeyword"; - SyntaxKind[SyntaxKind["InterfaceKeyword"] = 103] = "InterfaceKeyword"; - SyntaxKind[SyntaxKind["LetKeyword"] = 104] = "LetKeyword"; - SyntaxKind[SyntaxKind["PackageKeyword"] = 105] = "PackageKeyword"; - SyntaxKind[SyntaxKind["PrivateKeyword"] = 106] = "PrivateKeyword"; - SyntaxKind[SyntaxKind["ProtectedKeyword"] = 107] = "ProtectedKeyword"; - SyntaxKind[SyntaxKind["PublicKeyword"] = 108] = "PublicKeyword"; - SyntaxKind[SyntaxKind["StaticKeyword"] = 109] = "StaticKeyword"; - SyntaxKind[SyntaxKind["YieldKeyword"] = 110] = "YieldKeyword"; - // Contextual keywords - SyntaxKind[SyntaxKind["AsKeyword"] = 111] = "AsKeyword"; - SyntaxKind[SyntaxKind["AnyKeyword"] = 112] = "AnyKeyword"; - SyntaxKind[SyntaxKind["BooleanKeyword"] = 113] = "BooleanKeyword"; - SyntaxKind[SyntaxKind["ConstructorKeyword"] = 114] = "ConstructorKeyword"; - SyntaxKind[SyntaxKind["DeclareKeyword"] = 115] = "DeclareKeyword"; - SyntaxKind[SyntaxKind["GetKeyword"] = 116] = "GetKeyword"; - SyntaxKind[SyntaxKind["IsKeyword"] = 117] = "IsKeyword"; - SyntaxKind[SyntaxKind["ModuleKeyword"] = 118] = "ModuleKeyword"; - SyntaxKind[SyntaxKind["NamespaceKeyword"] = 119] = "NamespaceKeyword"; - SyntaxKind[SyntaxKind["RequireKeyword"] = 120] = "RequireKeyword"; - SyntaxKind[SyntaxKind["NumberKeyword"] = 121] = "NumberKeyword"; - SyntaxKind[SyntaxKind["SetKeyword"] = 122] = "SetKeyword"; - SyntaxKind[SyntaxKind["StringKeyword"] = 123] = "StringKeyword"; - SyntaxKind[SyntaxKind["SymbolKeyword"] = 124] = "SymbolKeyword"; - SyntaxKind[SyntaxKind["TypeKeyword"] = 125] = "TypeKeyword"; - SyntaxKind[SyntaxKind["FromKeyword"] = 126] = "FromKeyword"; - SyntaxKind[SyntaxKind["OfKeyword"] = 127] = "OfKeyword"; - // Parse tree nodes - // Names - SyntaxKind[SyntaxKind["QualifiedName"] = 128] = "QualifiedName"; - SyntaxKind[SyntaxKind["ComputedPropertyName"] = 129] = "ComputedPropertyName"; - // Signature elements - SyntaxKind[SyntaxKind["TypeParameter"] = 130] = "TypeParameter"; - SyntaxKind[SyntaxKind["Parameter"] = 131] = "Parameter"; - SyntaxKind[SyntaxKind["Decorator"] = 132] = "Decorator"; - // TypeMember - SyntaxKind[SyntaxKind["PropertySignature"] = 133] = "PropertySignature"; - SyntaxKind[SyntaxKind["PropertyDeclaration"] = 134] = "PropertyDeclaration"; - SyntaxKind[SyntaxKind["MethodSignature"] = 135] = "MethodSignature"; - SyntaxKind[SyntaxKind["MethodDeclaration"] = 136] = "MethodDeclaration"; - SyntaxKind[SyntaxKind["Constructor"] = 137] = "Constructor"; - SyntaxKind[SyntaxKind["GetAccessor"] = 138] = "GetAccessor"; - SyntaxKind[SyntaxKind["SetAccessor"] = 139] = "SetAccessor"; - SyntaxKind[SyntaxKind["CallSignature"] = 140] = "CallSignature"; - SyntaxKind[SyntaxKind["ConstructSignature"] = 141] = "ConstructSignature"; - SyntaxKind[SyntaxKind["IndexSignature"] = 142] = "IndexSignature"; - // Type - SyntaxKind[SyntaxKind["TypePredicate"] = 143] = "TypePredicate"; - SyntaxKind[SyntaxKind["TypeReference"] = 144] = "TypeReference"; - SyntaxKind[SyntaxKind["FunctionType"] = 145] = "FunctionType"; - SyntaxKind[SyntaxKind["ConstructorType"] = 146] = "ConstructorType"; - SyntaxKind[SyntaxKind["TypeQuery"] = 147] = "TypeQuery"; - SyntaxKind[SyntaxKind["TypeLiteral"] = 148] = "TypeLiteral"; - SyntaxKind[SyntaxKind["ArrayType"] = 149] = "ArrayType"; - SyntaxKind[SyntaxKind["TupleType"] = 150] = "TupleType"; - SyntaxKind[SyntaxKind["UnionType"] = 151] = "UnionType"; - SyntaxKind[SyntaxKind["ParenthesizedType"] = 152] = "ParenthesizedType"; - // Binding patterns - SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 153] = "ObjectBindingPattern"; - SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 154] = "ArrayBindingPattern"; - SyntaxKind[SyntaxKind["BindingElement"] = 155] = "BindingElement"; - // Expression - SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 156] = "ArrayLiteralExpression"; - SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 157] = "ObjectLiteralExpression"; - SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 158] = "PropertyAccessExpression"; - SyntaxKind[SyntaxKind["ElementAccessExpression"] = 159] = "ElementAccessExpression"; - SyntaxKind[SyntaxKind["CallExpression"] = 160] = "CallExpression"; - SyntaxKind[SyntaxKind["NewExpression"] = 161] = "NewExpression"; - SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 162] = "TaggedTemplateExpression"; - SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 163] = "TypeAssertionExpression"; - SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 164] = "ParenthesizedExpression"; - SyntaxKind[SyntaxKind["FunctionExpression"] = 165] = "FunctionExpression"; - SyntaxKind[SyntaxKind["ArrowFunction"] = 166] = "ArrowFunction"; - SyntaxKind[SyntaxKind["DeleteExpression"] = 167] = "DeleteExpression"; - SyntaxKind[SyntaxKind["TypeOfExpression"] = 168] = "TypeOfExpression"; - SyntaxKind[SyntaxKind["VoidExpression"] = 169] = "VoidExpression"; - SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 170] = "PrefixUnaryExpression"; - SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 171] = "PostfixUnaryExpression"; - SyntaxKind[SyntaxKind["BinaryExpression"] = 172] = "BinaryExpression"; - SyntaxKind[SyntaxKind["ConditionalExpression"] = 173] = "ConditionalExpression"; - SyntaxKind[SyntaxKind["TemplateExpression"] = 174] = "TemplateExpression"; - SyntaxKind[SyntaxKind["YieldExpression"] = 175] = "YieldExpression"; - SyntaxKind[SyntaxKind["SpreadElementExpression"] = 176] = "SpreadElementExpression"; - SyntaxKind[SyntaxKind["ClassExpression"] = 177] = "ClassExpression"; - SyntaxKind[SyntaxKind["OmittedExpression"] = 178] = "OmittedExpression"; - SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 179] = "ExpressionWithTypeArguments"; - // Misc - SyntaxKind[SyntaxKind["TemplateSpan"] = 180] = "TemplateSpan"; - SyntaxKind[SyntaxKind["SemicolonClassElement"] = 181] = "SemicolonClassElement"; - // Element - SyntaxKind[SyntaxKind["Block"] = 182] = "Block"; - SyntaxKind[SyntaxKind["VariableStatement"] = 183] = "VariableStatement"; - SyntaxKind[SyntaxKind["EmptyStatement"] = 184] = "EmptyStatement"; - SyntaxKind[SyntaxKind["ExpressionStatement"] = 185] = "ExpressionStatement"; - SyntaxKind[SyntaxKind["IfStatement"] = 186] = "IfStatement"; - SyntaxKind[SyntaxKind["DoStatement"] = 187] = "DoStatement"; - SyntaxKind[SyntaxKind["WhileStatement"] = 188] = "WhileStatement"; - SyntaxKind[SyntaxKind["ForStatement"] = 189] = "ForStatement"; - SyntaxKind[SyntaxKind["ForInStatement"] = 190] = "ForInStatement"; - SyntaxKind[SyntaxKind["ForOfStatement"] = 191] = "ForOfStatement"; - SyntaxKind[SyntaxKind["ContinueStatement"] = 192] = "ContinueStatement"; - SyntaxKind[SyntaxKind["BreakStatement"] = 193] = "BreakStatement"; - SyntaxKind[SyntaxKind["ReturnStatement"] = 194] = "ReturnStatement"; - SyntaxKind[SyntaxKind["WithStatement"] = 195] = "WithStatement"; - SyntaxKind[SyntaxKind["SwitchStatement"] = 196] = "SwitchStatement"; - SyntaxKind[SyntaxKind["LabeledStatement"] = 197] = "LabeledStatement"; - SyntaxKind[SyntaxKind["ThrowStatement"] = 198] = "ThrowStatement"; - SyntaxKind[SyntaxKind["TryStatement"] = 199] = "TryStatement"; - SyntaxKind[SyntaxKind["DebuggerStatement"] = 200] = "DebuggerStatement"; - SyntaxKind[SyntaxKind["VariableDeclaration"] = 201] = "VariableDeclaration"; - SyntaxKind[SyntaxKind["VariableDeclarationList"] = 202] = "VariableDeclarationList"; - SyntaxKind[SyntaxKind["FunctionDeclaration"] = 203] = "FunctionDeclaration"; - SyntaxKind[SyntaxKind["ClassDeclaration"] = 204] = "ClassDeclaration"; - SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 205] = "InterfaceDeclaration"; - SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 206] = "TypeAliasDeclaration"; - SyntaxKind[SyntaxKind["EnumDeclaration"] = 207] = "EnumDeclaration"; - SyntaxKind[SyntaxKind["ModuleDeclaration"] = 208] = "ModuleDeclaration"; - SyntaxKind[SyntaxKind["ModuleBlock"] = 209] = "ModuleBlock"; - SyntaxKind[SyntaxKind["CaseBlock"] = 210] = "CaseBlock"; - SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 211] = "ImportEqualsDeclaration"; - SyntaxKind[SyntaxKind["ImportDeclaration"] = 212] = "ImportDeclaration"; - SyntaxKind[SyntaxKind["ImportClause"] = 213] = "ImportClause"; - SyntaxKind[SyntaxKind["NamespaceImport"] = 214] = "NamespaceImport"; - SyntaxKind[SyntaxKind["NamedImports"] = 215] = "NamedImports"; - SyntaxKind[SyntaxKind["ImportSpecifier"] = 216] = "ImportSpecifier"; - SyntaxKind[SyntaxKind["ExportAssignment"] = 217] = "ExportAssignment"; - SyntaxKind[SyntaxKind["ExportDeclaration"] = 218] = "ExportDeclaration"; - SyntaxKind[SyntaxKind["NamedExports"] = 219] = "NamedExports"; - SyntaxKind[SyntaxKind["ExportSpecifier"] = 220] = "ExportSpecifier"; - SyntaxKind[SyntaxKind["MissingDeclaration"] = 221] = "MissingDeclaration"; - // Module references - SyntaxKind[SyntaxKind["ExternalModuleReference"] = 222] = "ExternalModuleReference"; - // Clauses - SyntaxKind[SyntaxKind["CaseClause"] = 223] = "CaseClause"; - SyntaxKind[SyntaxKind["DefaultClause"] = 224] = "DefaultClause"; - SyntaxKind[SyntaxKind["HeritageClause"] = 225] = "HeritageClause"; - SyntaxKind[SyntaxKind["CatchClause"] = 226] = "CatchClause"; - // Property assignments - SyntaxKind[SyntaxKind["PropertyAssignment"] = 227] = "PropertyAssignment"; - SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 228] = "ShorthandPropertyAssignment"; - // Enum - SyntaxKind[SyntaxKind["EnumMember"] = 229] = "EnumMember"; - // Top-level nodes - SyntaxKind[SyntaxKind["SourceFile"] = 230] = "SourceFile"; - // JSDoc nodes. - SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 231] = "JSDocTypeExpression"; - // The * type. - SyntaxKind[SyntaxKind["JSDocAllType"] = 232] = "JSDocAllType"; - // The ? type. - SyntaxKind[SyntaxKind["JSDocUnknownType"] = 233] = "JSDocUnknownType"; - SyntaxKind[SyntaxKind["JSDocArrayType"] = 234] = "JSDocArrayType"; - SyntaxKind[SyntaxKind["JSDocUnionType"] = 235] = "JSDocUnionType"; - SyntaxKind[SyntaxKind["JSDocTupleType"] = 236] = "JSDocTupleType"; - SyntaxKind[SyntaxKind["JSDocNullableType"] = 237] = "JSDocNullableType"; - SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 238] = "JSDocNonNullableType"; - SyntaxKind[SyntaxKind["JSDocRecordType"] = 239] = "JSDocRecordType"; - SyntaxKind[SyntaxKind["JSDocRecordMember"] = 240] = "JSDocRecordMember"; - SyntaxKind[SyntaxKind["JSDocTypeReference"] = 241] = "JSDocTypeReference"; - SyntaxKind[SyntaxKind["JSDocOptionalType"] = 242] = "JSDocOptionalType"; - SyntaxKind[SyntaxKind["JSDocFunctionType"] = 243] = "JSDocFunctionType"; - SyntaxKind[SyntaxKind["JSDocVariadicType"] = 244] = "JSDocVariadicType"; - SyntaxKind[SyntaxKind["JSDocConstructorType"] = 245] = "JSDocConstructorType"; - SyntaxKind[SyntaxKind["JSDocThisType"] = 246] = "JSDocThisType"; - SyntaxKind[SyntaxKind["JSDocComment"] = 247] = "JSDocComment"; - SyntaxKind[SyntaxKind["JSDocTag"] = 248] = "JSDocTag"; - SyntaxKind[SyntaxKind["JSDocParameterTag"] = 249] = "JSDocParameterTag"; - SyntaxKind[SyntaxKind["JSDocReturnTag"] = 250] = "JSDocReturnTag"; - SyntaxKind[SyntaxKind["JSDocTypeTag"] = 251] = "JSDocTypeTag"; - SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 252] = "JSDocTemplateTag"; - // Synthesized list - SyntaxKind[SyntaxKind["SyntaxList"] = 253] = "SyntaxList"; - // Enum value count - SyntaxKind[SyntaxKind["Count"] = 254] = "Count"; - // Markers - SyntaxKind[SyntaxKind["FirstAssignment"] = 53] = "FirstAssignment"; - SyntaxKind[SyntaxKind["LastAssignment"] = 64] = "LastAssignment"; - SyntaxKind[SyntaxKind["FirstReservedWord"] = 66] = "FirstReservedWord"; - SyntaxKind[SyntaxKind["LastReservedWord"] = 101] = "LastReservedWord"; - SyntaxKind[SyntaxKind["FirstKeyword"] = 66] = "FirstKeyword"; - SyntaxKind[SyntaxKind["LastKeyword"] = 127] = "LastKeyword"; - SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = 102] = "FirstFutureReservedWord"; - SyntaxKind[SyntaxKind["LastFutureReservedWord"] = 110] = "LastFutureReservedWord"; - SyntaxKind[SyntaxKind["FirstTypeNode"] = 144] = "FirstTypeNode"; - SyntaxKind[SyntaxKind["LastTypeNode"] = 152] = "LastTypeNode"; - SyntaxKind[SyntaxKind["FirstPunctuation"] = 14] = "FirstPunctuation"; - SyntaxKind[SyntaxKind["LastPunctuation"] = 64] = "LastPunctuation"; - SyntaxKind[SyntaxKind["FirstToken"] = 0] = "FirstToken"; - SyntaxKind[SyntaxKind["LastToken"] = 127] = "LastToken"; - SyntaxKind[SyntaxKind["FirstTriviaToken"] = 2] = "FirstTriviaToken"; - SyntaxKind[SyntaxKind["LastTriviaToken"] = 6] = "LastTriviaToken"; - SyntaxKind[SyntaxKind["FirstLiteralToken"] = 7] = "FirstLiteralToken"; - SyntaxKind[SyntaxKind["LastLiteralToken"] = 10] = "LastLiteralToken"; - SyntaxKind[SyntaxKind["FirstTemplateToken"] = 10] = "FirstTemplateToken"; - SyntaxKind[SyntaxKind["LastTemplateToken"] = 13] = "LastTemplateToken"; - SyntaxKind[SyntaxKind["FirstBinaryOperator"] = 24] = "FirstBinaryOperator"; - SyntaxKind[SyntaxKind["LastBinaryOperator"] = 64] = "LastBinaryOperator"; - SyntaxKind[SyntaxKind["FirstNode"] = 128] = "FirstNode"; - })(ts.SyntaxKind || (ts.SyntaxKind = {})); - var SyntaxKind = ts.SyntaxKind; - (function (NodeFlags) { - NodeFlags[NodeFlags["Export"] = 1] = "Export"; - NodeFlags[NodeFlags["Ambient"] = 2] = "Ambient"; - NodeFlags[NodeFlags["Public"] = 16] = "Public"; - NodeFlags[NodeFlags["Private"] = 32] = "Private"; - NodeFlags[NodeFlags["Protected"] = 64] = "Protected"; - NodeFlags[NodeFlags["Static"] = 128] = "Static"; - NodeFlags[NodeFlags["Default"] = 256] = "Default"; - NodeFlags[NodeFlags["MultiLine"] = 512] = "MultiLine"; - NodeFlags[NodeFlags["Synthetic"] = 1024] = "Synthetic"; - NodeFlags[NodeFlags["DeclarationFile"] = 2048] = "DeclarationFile"; - NodeFlags[NodeFlags["Let"] = 4096] = "Let"; - NodeFlags[NodeFlags["Const"] = 8192] = "Const"; - NodeFlags[NodeFlags["OctalLiteral"] = 16384] = "OctalLiteral"; - NodeFlags[NodeFlags["Namespace"] = 32768] = "Namespace"; - NodeFlags[NodeFlags["ExportContext"] = 65536] = "ExportContext"; - NodeFlags[NodeFlags["Modifier"] = 499] = "Modifier"; - NodeFlags[NodeFlags["AccessibilityModifier"] = 112] = "AccessibilityModifier"; - NodeFlags[NodeFlags["BlockScoped"] = 12288] = "BlockScoped"; - })(ts.NodeFlags || (ts.NodeFlags = {})); - var NodeFlags = ts.NodeFlags; - /* @internal */ - (function (ParserContextFlags) { - ParserContextFlags[ParserContextFlags["None"] = 0] = "None"; - // Set if this node was parsed in strict mode. Used for grammar error checks, as well as - // checking if the node can be reused in incremental settings. - ParserContextFlags[ParserContextFlags["StrictMode"] = 1] = "StrictMode"; - // If this node was parsed in a context where 'in-expressions' are not allowed. - ParserContextFlags[ParserContextFlags["DisallowIn"] = 2] = "DisallowIn"; - // If this node was parsed in the 'yield' context created when parsing a generator. - ParserContextFlags[ParserContextFlags["Yield"] = 4] = "Yield"; - // If this node was parsed in the parameters of a generator. - ParserContextFlags[ParserContextFlags["GeneratorParameter"] = 8] = "GeneratorParameter"; - // If this node was parsed as part of a decorator - ParserContextFlags[ParserContextFlags["Decorator"] = 16] = "Decorator"; - // If the parser encountered an error when parsing the code that created this node. Note - // the parser only sets this directly on the node it creates right after encountering the - // error. - ParserContextFlags[ParserContextFlags["ThisNodeHasError"] = 32] = "ThisNodeHasError"; - // This node was parsed in a JavaScript file and can be processed differently. For example - // its type can be specified usign a JSDoc comment. - ParserContextFlags[ParserContextFlags["JavaScriptFile"] = 64] = "JavaScriptFile"; - // Context flags set directly by the parser. - ParserContextFlags[ParserContextFlags["ParserGeneratedFlags"] = 63] = "ParserGeneratedFlags"; - // Context flags computed by aggregating child flags upwards. - // Used during incremental parsing to determine if this node or any of its children had an - // error. Computed only once and then cached. - ParserContextFlags[ParserContextFlags["ThisNodeOrAnySubNodesHasError"] = 128] = "ThisNodeOrAnySubNodesHasError"; - // Used to know if we've computed data from children and cached it in this node. - ParserContextFlags[ParserContextFlags["HasAggregatedChildData"] = 256] = "HasAggregatedChildData"; - })(ts.ParserContextFlags || (ts.ParserContextFlags = {})); - var ParserContextFlags = ts.ParserContextFlags; - /* @internal */ - (function (RelationComparisonResult) { - RelationComparisonResult[RelationComparisonResult["Succeeded"] = 1] = "Succeeded"; - RelationComparisonResult[RelationComparisonResult["Failed"] = 2] = "Failed"; - RelationComparisonResult[RelationComparisonResult["FailedAndReported"] = 3] = "FailedAndReported"; - })(ts.RelationComparisonResult || (ts.RelationComparisonResult = {})); - var RelationComparisonResult = ts.RelationComparisonResult; - /** Return code used by getEmitOutput function to indicate status of the function */ - (function (ExitStatus) { - // Compiler ran successfully. Either this was a simple do-nothing compilation (for example, - // when -version or -help was provided, or this was a normal compilation, no diagnostics - // were produced, and all outputs were generated successfully. - ExitStatus[ExitStatus["Success"] = 0] = "Success"; - // Diagnostics were produced and because of them no code was generated. - ExitStatus[ExitStatus["DiagnosticsPresent_OutputsSkipped"] = 1] = "DiagnosticsPresent_OutputsSkipped"; - // Diagnostics were produced and outputs were generated in spite of them. - ExitStatus[ExitStatus["DiagnosticsPresent_OutputsGenerated"] = 2] = "DiagnosticsPresent_OutputsGenerated"; - })(ts.ExitStatus || (ts.ExitStatus = {})); - var ExitStatus = ts.ExitStatus; - (function (TypeFormatFlags) { - TypeFormatFlags[TypeFormatFlags["None"] = 0] = "None"; - TypeFormatFlags[TypeFormatFlags["WriteArrayAsGenericType"] = 1] = "WriteArrayAsGenericType"; - TypeFormatFlags[TypeFormatFlags["UseTypeOfFunction"] = 2] = "UseTypeOfFunction"; - TypeFormatFlags[TypeFormatFlags["NoTruncation"] = 4] = "NoTruncation"; - TypeFormatFlags[TypeFormatFlags["WriteArrowStyleSignature"] = 8] = "WriteArrowStyleSignature"; - TypeFormatFlags[TypeFormatFlags["WriteOwnNameForAnyLike"] = 16] = "WriteOwnNameForAnyLike"; - TypeFormatFlags[TypeFormatFlags["WriteTypeArgumentsOfSignature"] = 32] = "WriteTypeArgumentsOfSignature"; - TypeFormatFlags[TypeFormatFlags["InElementType"] = 64] = "InElementType"; - TypeFormatFlags[TypeFormatFlags["UseFullyQualifiedType"] = 128] = "UseFullyQualifiedType"; - })(ts.TypeFormatFlags || (ts.TypeFormatFlags = {})); - var TypeFormatFlags = ts.TypeFormatFlags; - (function (SymbolFormatFlags) { - SymbolFormatFlags[SymbolFormatFlags["None"] = 0] = "None"; - // Write symbols's type argument if it is instantiated symbol - // eg. class C { p: T } <-- Show p as C.p here - // var a: C; - // var p = a.p; <--- Here p is property of C so show it as C.p instead of just C.p - SymbolFormatFlags[SymbolFormatFlags["WriteTypeParametersOrArguments"] = 1] = "WriteTypeParametersOrArguments"; - // Use only external alias information to get the symbol name in the given context - // eg. module m { export class c { } } import x = m.c; - // When this flag is specified m.c will be used to refer to the class instead of alias symbol x - SymbolFormatFlags[SymbolFormatFlags["UseOnlyExternalAliasing"] = 2] = "UseOnlyExternalAliasing"; - })(ts.SymbolFormatFlags || (ts.SymbolFormatFlags = {})); - var SymbolFormatFlags = ts.SymbolFormatFlags; - /* @internal */ - (function (SymbolAccessibility) { - SymbolAccessibility[SymbolAccessibility["Accessible"] = 0] = "Accessible"; - SymbolAccessibility[SymbolAccessibility["NotAccessible"] = 1] = "NotAccessible"; - SymbolAccessibility[SymbolAccessibility["CannotBeNamed"] = 2] = "CannotBeNamed"; - })(ts.SymbolAccessibility || (ts.SymbolAccessibility = {})); - var SymbolAccessibility = ts.SymbolAccessibility; - (function (SymbolFlags) { - SymbolFlags[SymbolFlags["None"] = 0] = "None"; - SymbolFlags[SymbolFlags["FunctionScopedVariable"] = 1] = "FunctionScopedVariable"; - SymbolFlags[SymbolFlags["BlockScopedVariable"] = 2] = "BlockScopedVariable"; - SymbolFlags[SymbolFlags["Property"] = 4] = "Property"; - SymbolFlags[SymbolFlags["EnumMember"] = 8] = "EnumMember"; - SymbolFlags[SymbolFlags["Function"] = 16] = "Function"; - SymbolFlags[SymbolFlags["Class"] = 32] = "Class"; - SymbolFlags[SymbolFlags["Interface"] = 64] = "Interface"; - SymbolFlags[SymbolFlags["ConstEnum"] = 128] = "ConstEnum"; - SymbolFlags[SymbolFlags["RegularEnum"] = 256] = "RegularEnum"; - SymbolFlags[SymbolFlags["ValueModule"] = 512] = "ValueModule"; - SymbolFlags[SymbolFlags["NamespaceModule"] = 1024] = "NamespaceModule"; - SymbolFlags[SymbolFlags["TypeLiteral"] = 2048] = "TypeLiteral"; - SymbolFlags[SymbolFlags["ObjectLiteral"] = 4096] = "ObjectLiteral"; - SymbolFlags[SymbolFlags["Method"] = 8192] = "Method"; - SymbolFlags[SymbolFlags["Constructor"] = 16384] = "Constructor"; - SymbolFlags[SymbolFlags["GetAccessor"] = 32768] = "GetAccessor"; - SymbolFlags[SymbolFlags["SetAccessor"] = 65536] = "SetAccessor"; - SymbolFlags[SymbolFlags["Signature"] = 131072] = "Signature"; - SymbolFlags[SymbolFlags["TypeParameter"] = 262144] = "TypeParameter"; - SymbolFlags[SymbolFlags["TypeAlias"] = 524288] = "TypeAlias"; - SymbolFlags[SymbolFlags["ExportValue"] = 1048576] = "ExportValue"; - SymbolFlags[SymbolFlags["ExportType"] = 2097152] = "ExportType"; - SymbolFlags[SymbolFlags["ExportNamespace"] = 4194304] = "ExportNamespace"; - SymbolFlags[SymbolFlags["Alias"] = 8388608] = "Alias"; - SymbolFlags[SymbolFlags["Instantiated"] = 16777216] = "Instantiated"; - SymbolFlags[SymbolFlags["Merged"] = 33554432] = "Merged"; - SymbolFlags[SymbolFlags["Transient"] = 67108864] = "Transient"; - SymbolFlags[SymbolFlags["Prototype"] = 134217728] = "Prototype"; - SymbolFlags[SymbolFlags["UnionProperty"] = 268435456] = "UnionProperty"; - SymbolFlags[SymbolFlags["Optional"] = 536870912] = "Optional"; - SymbolFlags[SymbolFlags["ExportStar"] = 1073741824] = "ExportStar"; - SymbolFlags[SymbolFlags["Enum"] = 384] = "Enum"; - SymbolFlags[SymbolFlags["Variable"] = 3] = "Variable"; - SymbolFlags[SymbolFlags["Value"] = 107455] = "Value"; - SymbolFlags[SymbolFlags["Type"] = 793056] = "Type"; - SymbolFlags[SymbolFlags["Namespace"] = 1536] = "Namespace"; - SymbolFlags[SymbolFlags["Module"] = 1536] = "Module"; - SymbolFlags[SymbolFlags["Accessor"] = 98304] = "Accessor"; - // Variables can be redeclared, but can not redeclare a block-scoped declaration with the - // same name, or any other value that is not a variable, e.g. ValueModule or Class - SymbolFlags[SymbolFlags["FunctionScopedVariableExcludes"] = 107454] = "FunctionScopedVariableExcludes"; - // Block-scoped declarations are not allowed to be re-declared - // they can not merge with anything in the value space - SymbolFlags[SymbolFlags["BlockScopedVariableExcludes"] = 107455] = "BlockScopedVariableExcludes"; - SymbolFlags[SymbolFlags["ParameterExcludes"] = 107455] = "ParameterExcludes"; - SymbolFlags[SymbolFlags["PropertyExcludes"] = 107455] = "PropertyExcludes"; - SymbolFlags[SymbolFlags["EnumMemberExcludes"] = 107455] = "EnumMemberExcludes"; - SymbolFlags[SymbolFlags["FunctionExcludes"] = 106927] = "FunctionExcludes"; - SymbolFlags[SymbolFlags["ClassExcludes"] = 899583] = "ClassExcludes"; - SymbolFlags[SymbolFlags["InterfaceExcludes"] = 792992] = "InterfaceExcludes"; - SymbolFlags[SymbolFlags["RegularEnumExcludes"] = 899327] = "RegularEnumExcludes"; - SymbolFlags[SymbolFlags["ConstEnumExcludes"] = 899967] = "ConstEnumExcludes"; - SymbolFlags[SymbolFlags["ValueModuleExcludes"] = 106639] = "ValueModuleExcludes"; - SymbolFlags[SymbolFlags["NamespaceModuleExcludes"] = 0] = "NamespaceModuleExcludes"; - SymbolFlags[SymbolFlags["MethodExcludes"] = 99263] = "MethodExcludes"; - SymbolFlags[SymbolFlags["GetAccessorExcludes"] = 41919] = "GetAccessorExcludes"; - SymbolFlags[SymbolFlags["SetAccessorExcludes"] = 74687] = "SetAccessorExcludes"; - SymbolFlags[SymbolFlags["TypeParameterExcludes"] = 530912] = "TypeParameterExcludes"; - SymbolFlags[SymbolFlags["TypeAliasExcludes"] = 793056] = "TypeAliasExcludes"; - SymbolFlags[SymbolFlags["AliasExcludes"] = 8388608] = "AliasExcludes"; - SymbolFlags[SymbolFlags["ModuleMember"] = 8914931] = "ModuleMember"; - SymbolFlags[SymbolFlags["ExportHasLocal"] = 944] = "ExportHasLocal"; - SymbolFlags[SymbolFlags["HasExports"] = 1952] = "HasExports"; - SymbolFlags[SymbolFlags["HasMembers"] = 6240] = "HasMembers"; - SymbolFlags[SymbolFlags["BlockScoped"] = 418] = "BlockScoped"; - SymbolFlags[SymbolFlags["PropertyOrAccessor"] = 98308] = "PropertyOrAccessor"; - SymbolFlags[SymbolFlags["Export"] = 7340032] = "Export"; - /* @internal */ - // The set of things we consider semantically classifiable. Used to speed up the LS during - // classification. - SymbolFlags[SymbolFlags["Classifiable"] = 788448] = "Classifiable"; - })(ts.SymbolFlags || (ts.SymbolFlags = {})); - var SymbolFlags = ts.SymbolFlags; - /* @internal */ - (function (NodeCheckFlags) { - NodeCheckFlags[NodeCheckFlags["TypeChecked"] = 1] = "TypeChecked"; - NodeCheckFlags[NodeCheckFlags["LexicalThis"] = 2] = "LexicalThis"; - NodeCheckFlags[NodeCheckFlags["CaptureThis"] = 4] = "CaptureThis"; - NodeCheckFlags[NodeCheckFlags["EmitExtends"] = 8] = "EmitExtends"; - NodeCheckFlags[NodeCheckFlags["SuperInstance"] = 16] = "SuperInstance"; - NodeCheckFlags[NodeCheckFlags["SuperStatic"] = 32] = "SuperStatic"; - NodeCheckFlags[NodeCheckFlags["ContextChecked"] = 64] = "ContextChecked"; - // Values for enum members have been computed, and any errors have been reported for them. - NodeCheckFlags[NodeCheckFlags["EnumValuesComputed"] = 128] = "EnumValuesComputed"; - NodeCheckFlags[NodeCheckFlags["BlockScopedBindingInLoop"] = 256] = "BlockScopedBindingInLoop"; - NodeCheckFlags[NodeCheckFlags["EmitDecorate"] = 512] = "EmitDecorate"; - NodeCheckFlags[NodeCheckFlags["EmitParam"] = 1024] = "EmitParam"; - NodeCheckFlags[NodeCheckFlags["LexicalModuleMergesWithClass"] = 2048] = "LexicalModuleMergesWithClass"; - })(ts.NodeCheckFlags || (ts.NodeCheckFlags = {})); - var NodeCheckFlags = ts.NodeCheckFlags; - (function (TypeFlags) { - TypeFlags[TypeFlags["Any"] = 1] = "Any"; - TypeFlags[TypeFlags["String"] = 2] = "String"; - TypeFlags[TypeFlags["Number"] = 4] = "Number"; - TypeFlags[TypeFlags["Boolean"] = 8] = "Boolean"; - TypeFlags[TypeFlags["Void"] = 16] = "Void"; - TypeFlags[TypeFlags["Undefined"] = 32] = "Undefined"; - TypeFlags[TypeFlags["Null"] = 64] = "Null"; - TypeFlags[TypeFlags["Enum"] = 128] = "Enum"; - TypeFlags[TypeFlags["StringLiteral"] = 256] = "StringLiteral"; - TypeFlags[TypeFlags["TypeParameter"] = 512] = "TypeParameter"; - TypeFlags[TypeFlags["Class"] = 1024] = "Class"; - TypeFlags[TypeFlags["Interface"] = 2048] = "Interface"; - TypeFlags[TypeFlags["Reference"] = 4096] = "Reference"; - TypeFlags[TypeFlags["Tuple"] = 8192] = "Tuple"; - TypeFlags[TypeFlags["Union"] = 16384] = "Union"; - TypeFlags[TypeFlags["Anonymous"] = 32768] = "Anonymous"; - TypeFlags[TypeFlags["Instantiated"] = 65536] = "Instantiated"; - /* @internal */ - TypeFlags[TypeFlags["FromSignature"] = 131072] = "FromSignature"; - TypeFlags[TypeFlags["ObjectLiteral"] = 262144] = "ObjectLiteral"; - /* @internal */ - TypeFlags[TypeFlags["ContainsUndefinedOrNull"] = 524288] = "ContainsUndefinedOrNull"; - /* @internal */ - TypeFlags[TypeFlags["ContainsObjectLiteral"] = 1048576] = "ContainsObjectLiteral"; - TypeFlags[TypeFlags["ESSymbol"] = 2097152] = "ESSymbol"; - /* @internal */ - TypeFlags[TypeFlags["Intrinsic"] = 2097279] = "Intrinsic"; - /* @internal */ - TypeFlags[TypeFlags["Primitive"] = 2097662] = "Primitive"; - TypeFlags[TypeFlags["StringLike"] = 258] = "StringLike"; - TypeFlags[TypeFlags["NumberLike"] = 132] = "NumberLike"; - TypeFlags[TypeFlags["ObjectType"] = 48128] = "ObjectType"; - /* @internal */ - TypeFlags[TypeFlags["RequiresWidening"] = 1572864] = "RequiresWidening"; - })(ts.TypeFlags || (ts.TypeFlags = {})); - var TypeFlags = ts.TypeFlags; - (function (SignatureKind) { - SignatureKind[SignatureKind["Call"] = 0] = "Call"; - SignatureKind[SignatureKind["Construct"] = 1] = "Construct"; - })(ts.SignatureKind || (ts.SignatureKind = {})); - var SignatureKind = ts.SignatureKind; - (function (IndexKind) { - IndexKind[IndexKind["String"] = 0] = "String"; - IndexKind[IndexKind["Number"] = 1] = "Number"; - })(ts.IndexKind || (ts.IndexKind = {})); - var IndexKind = ts.IndexKind; - (function (DiagnosticCategory) { - DiagnosticCategory[DiagnosticCategory["Warning"] = 0] = "Warning"; - DiagnosticCategory[DiagnosticCategory["Error"] = 1] = "Error"; - DiagnosticCategory[DiagnosticCategory["Message"] = 2] = "Message"; - })(ts.DiagnosticCategory || (ts.DiagnosticCategory = {})); - var DiagnosticCategory = ts.DiagnosticCategory; - (function (ModuleKind) { - ModuleKind[ModuleKind["None"] = 0] = "None"; - ModuleKind[ModuleKind["CommonJS"] = 1] = "CommonJS"; - ModuleKind[ModuleKind["AMD"] = 2] = "AMD"; - ModuleKind[ModuleKind["UMD"] = 3] = "UMD"; - ModuleKind[ModuleKind["System"] = 4] = "System"; - })(ts.ModuleKind || (ts.ModuleKind = {})); - var ModuleKind = ts.ModuleKind; - (function (NewLineKind) { - NewLineKind[NewLineKind["CarriageReturnLineFeed"] = 0] = "CarriageReturnLineFeed"; - NewLineKind[NewLineKind["LineFeed"] = 1] = "LineFeed"; - })(ts.NewLineKind || (ts.NewLineKind = {})); - var NewLineKind = ts.NewLineKind; - (function (ScriptTarget) { - ScriptTarget[ScriptTarget["ES3"] = 0] = "ES3"; - ScriptTarget[ScriptTarget["ES5"] = 1] = "ES5"; - ScriptTarget[ScriptTarget["ES6"] = 2] = "ES6"; - ScriptTarget[ScriptTarget["Latest"] = 2] = "Latest"; - })(ts.ScriptTarget || (ts.ScriptTarget = {})); - var ScriptTarget = ts.ScriptTarget; - /* @internal */ - (function (CharacterCodes) { - CharacterCodes[CharacterCodes["nullCharacter"] = 0] = "nullCharacter"; - CharacterCodes[CharacterCodes["maxAsciiCharacter"] = 127] = "maxAsciiCharacter"; - CharacterCodes[CharacterCodes["lineFeed"] = 10] = "lineFeed"; - CharacterCodes[CharacterCodes["carriageReturn"] = 13] = "carriageReturn"; - CharacterCodes[CharacterCodes["lineSeparator"] = 8232] = "lineSeparator"; - CharacterCodes[CharacterCodes["paragraphSeparator"] = 8233] = "paragraphSeparator"; - CharacterCodes[CharacterCodes["nextLine"] = 133] = "nextLine"; - // Unicode 3.0 space characters - CharacterCodes[CharacterCodes["space"] = 32] = "space"; - CharacterCodes[CharacterCodes["nonBreakingSpace"] = 160] = "nonBreakingSpace"; - CharacterCodes[CharacterCodes["enQuad"] = 8192] = "enQuad"; - CharacterCodes[CharacterCodes["emQuad"] = 8193] = "emQuad"; - CharacterCodes[CharacterCodes["enSpace"] = 8194] = "enSpace"; - CharacterCodes[CharacterCodes["emSpace"] = 8195] = "emSpace"; - CharacterCodes[CharacterCodes["threePerEmSpace"] = 8196] = "threePerEmSpace"; - CharacterCodes[CharacterCodes["fourPerEmSpace"] = 8197] = "fourPerEmSpace"; - CharacterCodes[CharacterCodes["sixPerEmSpace"] = 8198] = "sixPerEmSpace"; - CharacterCodes[CharacterCodes["figureSpace"] = 8199] = "figureSpace"; - CharacterCodes[CharacterCodes["punctuationSpace"] = 8200] = "punctuationSpace"; - CharacterCodes[CharacterCodes["thinSpace"] = 8201] = "thinSpace"; - CharacterCodes[CharacterCodes["hairSpace"] = 8202] = "hairSpace"; - CharacterCodes[CharacterCodes["zeroWidthSpace"] = 8203] = "zeroWidthSpace"; - CharacterCodes[CharacterCodes["narrowNoBreakSpace"] = 8239] = "narrowNoBreakSpace"; - CharacterCodes[CharacterCodes["ideographicSpace"] = 12288] = "ideographicSpace"; - CharacterCodes[CharacterCodes["mathematicalSpace"] = 8287] = "mathematicalSpace"; - CharacterCodes[CharacterCodes["ogham"] = 5760] = "ogham"; - CharacterCodes[CharacterCodes["_"] = 95] = "_"; - CharacterCodes[CharacterCodes["$"] = 36] = "$"; - CharacterCodes[CharacterCodes["_0"] = 48] = "_0"; - CharacterCodes[CharacterCodes["_1"] = 49] = "_1"; - CharacterCodes[CharacterCodes["_2"] = 50] = "_2"; - CharacterCodes[CharacterCodes["_3"] = 51] = "_3"; - CharacterCodes[CharacterCodes["_4"] = 52] = "_4"; - CharacterCodes[CharacterCodes["_5"] = 53] = "_5"; - CharacterCodes[CharacterCodes["_6"] = 54] = "_6"; - CharacterCodes[CharacterCodes["_7"] = 55] = "_7"; - CharacterCodes[CharacterCodes["_8"] = 56] = "_8"; - CharacterCodes[CharacterCodes["_9"] = 57] = "_9"; - CharacterCodes[CharacterCodes["a"] = 97] = "a"; - CharacterCodes[CharacterCodes["b"] = 98] = "b"; - CharacterCodes[CharacterCodes["c"] = 99] = "c"; - CharacterCodes[CharacterCodes["d"] = 100] = "d"; - CharacterCodes[CharacterCodes["e"] = 101] = "e"; - CharacterCodes[CharacterCodes["f"] = 102] = "f"; - CharacterCodes[CharacterCodes["g"] = 103] = "g"; - CharacterCodes[CharacterCodes["h"] = 104] = "h"; - CharacterCodes[CharacterCodes["i"] = 105] = "i"; - CharacterCodes[CharacterCodes["j"] = 106] = "j"; - CharacterCodes[CharacterCodes["k"] = 107] = "k"; - CharacterCodes[CharacterCodes["l"] = 108] = "l"; - CharacterCodes[CharacterCodes["m"] = 109] = "m"; - CharacterCodes[CharacterCodes["n"] = 110] = "n"; - CharacterCodes[CharacterCodes["o"] = 111] = "o"; - CharacterCodes[CharacterCodes["p"] = 112] = "p"; - CharacterCodes[CharacterCodes["q"] = 113] = "q"; - CharacterCodes[CharacterCodes["r"] = 114] = "r"; - CharacterCodes[CharacterCodes["s"] = 115] = "s"; - CharacterCodes[CharacterCodes["t"] = 116] = "t"; - CharacterCodes[CharacterCodes["u"] = 117] = "u"; - CharacterCodes[CharacterCodes["v"] = 118] = "v"; - CharacterCodes[CharacterCodes["w"] = 119] = "w"; - CharacterCodes[CharacterCodes["x"] = 120] = "x"; - CharacterCodes[CharacterCodes["y"] = 121] = "y"; - CharacterCodes[CharacterCodes["z"] = 122] = "z"; - CharacterCodes[CharacterCodes["A"] = 65] = "A"; - CharacterCodes[CharacterCodes["B"] = 66] = "B"; - CharacterCodes[CharacterCodes["C"] = 67] = "C"; - CharacterCodes[CharacterCodes["D"] = 68] = "D"; - CharacterCodes[CharacterCodes["E"] = 69] = "E"; - CharacterCodes[CharacterCodes["F"] = 70] = "F"; - CharacterCodes[CharacterCodes["G"] = 71] = "G"; - CharacterCodes[CharacterCodes["H"] = 72] = "H"; - CharacterCodes[CharacterCodes["I"] = 73] = "I"; - CharacterCodes[CharacterCodes["J"] = 74] = "J"; - CharacterCodes[CharacterCodes["K"] = 75] = "K"; - CharacterCodes[CharacterCodes["L"] = 76] = "L"; - CharacterCodes[CharacterCodes["M"] = 77] = "M"; - CharacterCodes[CharacterCodes["N"] = 78] = "N"; - CharacterCodes[CharacterCodes["O"] = 79] = "O"; - CharacterCodes[CharacterCodes["P"] = 80] = "P"; - CharacterCodes[CharacterCodes["Q"] = 81] = "Q"; - CharacterCodes[CharacterCodes["R"] = 82] = "R"; - CharacterCodes[CharacterCodes["S"] = 83] = "S"; - CharacterCodes[CharacterCodes["T"] = 84] = "T"; - CharacterCodes[CharacterCodes["U"] = 85] = "U"; - CharacterCodes[CharacterCodes["V"] = 86] = "V"; - CharacterCodes[CharacterCodes["W"] = 87] = "W"; - CharacterCodes[CharacterCodes["X"] = 88] = "X"; - CharacterCodes[CharacterCodes["Y"] = 89] = "Y"; - CharacterCodes[CharacterCodes["Z"] = 90] = "Z"; - CharacterCodes[CharacterCodes["ampersand"] = 38] = "ampersand"; - CharacterCodes[CharacterCodes["asterisk"] = 42] = "asterisk"; - CharacterCodes[CharacterCodes["at"] = 64] = "at"; - CharacterCodes[CharacterCodes["backslash"] = 92] = "backslash"; - CharacterCodes[CharacterCodes["backtick"] = 96] = "backtick"; - CharacterCodes[CharacterCodes["bar"] = 124] = "bar"; - CharacterCodes[CharacterCodes["caret"] = 94] = "caret"; - CharacterCodes[CharacterCodes["closeBrace"] = 125] = "closeBrace"; - CharacterCodes[CharacterCodes["closeBracket"] = 93] = "closeBracket"; - CharacterCodes[CharacterCodes["closeParen"] = 41] = "closeParen"; - CharacterCodes[CharacterCodes["colon"] = 58] = "colon"; - CharacterCodes[CharacterCodes["comma"] = 44] = "comma"; - CharacterCodes[CharacterCodes["dot"] = 46] = "dot"; - CharacterCodes[CharacterCodes["doubleQuote"] = 34] = "doubleQuote"; - CharacterCodes[CharacterCodes["equals"] = 61] = "equals"; - CharacterCodes[CharacterCodes["exclamation"] = 33] = "exclamation"; - CharacterCodes[CharacterCodes["greaterThan"] = 62] = "greaterThan"; - CharacterCodes[CharacterCodes["hash"] = 35] = "hash"; - CharacterCodes[CharacterCodes["lessThan"] = 60] = "lessThan"; - CharacterCodes[CharacterCodes["minus"] = 45] = "minus"; - CharacterCodes[CharacterCodes["openBrace"] = 123] = "openBrace"; - CharacterCodes[CharacterCodes["openBracket"] = 91] = "openBracket"; - CharacterCodes[CharacterCodes["openParen"] = 40] = "openParen"; - CharacterCodes[CharacterCodes["percent"] = 37] = "percent"; - CharacterCodes[CharacterCodes["plus"] = 43] = "plus"; - CharacterCodes[CharacterCodes["question"] = 63] = "question"; - CharacterCodes[CharacterCodes["semicolon"] = 59] = "semicolon"; - CharacterCodes[CharacterCodes["singleQuote"] = 39] = "singleQuote"; - CharacterCodes[CharacterCodes["slash"] = 47] = "slash"; - CharacterCodes[CharacterCodes["tilde"] = 126] = "tilde"; - CharacterCodes[CharacterCodes["backspace"] = 8] = "backspace"; - CharacterCodes[CharacterCodes["formFeed"] = 12] = "formFeed"; - CharacterCodes[CharacterCodes["byteOrderMark"] = 65279] = "byteOrderMark"; - CharacterCodes[CharacterCodes["tab"] = 9] = "tab"; - CharacterCodes[CharacterCodes["verticalTab"] = 11] = "verticalTab"; - })(ts.CharacterCodes || (ts.CharacterCodes = {})); - var CharacterCodes = ts.CharacterCodes; -})(ts || (ts = {})); -/// -/* @internal */ -var ts; -(function (ts) { - // Ternary values are defined such that - // x & y is False if either x or y is False. - // x & y is Maybe if either x or y is Maybe, but neither x or y is False. - // x & y is True if both x and y are True. - // x | y is False if both x and y are False. - // x | y is Maybe if either x or y is Maybe, but neither x or y is True. - // x | y is True if either x or y is True. - (function (Ternary) { - Ternary[Ternary["False"] = 0] = "False"; - Ternary[Ternary["Maybe"] = 1] = "Maybe"; - Ternary[Ternary["True"] = -1] = "True"; - })(ts.Ternary || (ts.Ternary = {})); - var Ternary = ts.Ternary; - function createFileMap(getCanonicalFileName) { - var files = {}; - return { - get: get, - set: set, - contains: contains, - remove: remove, - forEachValue: forEachValueInMap - }; - function set(fileName, value) { - files[normalizeKey(fileName)] = value; - } - function get(fileName) { - return files[normalizeKey(fileName)]; - } - function contains(fileName) { - return hasProperty(files, normalizeKey(fileName)); - } - function remove(fileName) { - var key = normalizeKey(fileName); - delete files[key]; - } - function forEachValueInMap(f) { - forEachValue(files, f); - } - function normalizeKey(key) { - return getCanonicalFileName(normalizeSlashes(key)); - } - } - ts.createFileMap = createFileMap; - (function (Comparison) { - Comparison[Comparison["LessThan"] = -1] = "LessThan"; - Comparison[Comparison["EqualTo"] = 0] = "EqualTo"; - Comparison[Comparison["GreaterThan"] = 1] = "GreaterThan"; - })(ts.Comparison || (ts.Comparison = {})); - var Comparison = ts.Comparison; - function forEach(array, callback) { - if (array) { - for (var i = 0, len = array.length; i < len; i++) { - var result = callback(array[i], i); - if (result) { - return result; - } - } - } - return undefined; - } - ts.forEach = forEach; - function contains(array, value) { - if (array) { - for (var _i = 0; _i < array.length; _i++) { - var v = array[_i]; - if (v === value) { - return true; - } - } - } - return false; - } - ts.contains = contains; - function indexOf(array, value) { - if (array) { - for (var i = 0, len = array.length; i < len; i++) { - if (array[i] === value) { - return i; - } - } - } - return -1; - } - ts.indexOf = indexOf; - function countWhere(array, predicate) { - var count = 0; - if (array) { - for (var _i = 0; _i < array.length; _i++) { - var v = array[_i]; - if (predicate(v)) { - count++; - } - } - } - return count; - } - ts.countWhere = countWhere; - function filter(array, f) { - var result; - if (array) { - result = []; - for (var _i = 0; _i < array.length; _i++) { - var item = array[_i]; - if (f(item)) { - result.push(item); - } - } - } - return result; - } - ts.filter = filter; - function map(array, f) { - var result; - if (array) { - result = []; - for (var _i = 0; _i < array.length; _i++) { - var v = array[_i]; - result.push(f(v)); - } - } - return result; - } - ts.map = map; - function concatenate(array1, array2) { - if (!array2 || !array2.length) - return array1; - if (!array1 || !array1.length) - return array2; - return array1.concat(array2); - } - ts.concatenate = concatenate; - function deduplicate(array) { - var result; - if (array) { - result = []; - for (var _i = 0; _i < array.length; _i++) { - var item = array[_i]; - if (!contains(result, item)) { - result.push(item); - } - } - } - return result; - } - ts.deduplicate = deduplicate; - function sum(array, prop) { - var result = 0; - for (var _i = 0; _i < array.length; _i++) { - var v = array[_i]; - result += v[prop]; - } - return result; - } - ts.sum = sum; - function addRange(to, from) { - if (to && from) { - for (var _i = 0; _i < from.length; _i++) { - var v = from[_i]; - to.push(v); - } - } - } - ts.addRange = addRange; - function rangeEquals(array1, array2, pos, end) { - while (pos < end) { - if (array1[pos] !== array2[pos]) { - return false; - } - pos++; - } - return true; - } - ts.rangeEquals = rangeEquals; - /** - * Returns the last element of an array if non-empty, undefined otherwise. - */ - function lastOrUndefined(array) { - if (array.length === 0) { - return undefined; - } - return array[array.length - 1]; - } - ts.lastOrUndefined = lastOrUndefined; - function binarySearch(array, value) { - var low = 0; - var high = array.length - 1; - while (low <= high) { - var middle = low + ((high - low) >> 1); - var midValue = array[middle]; - if (midValue === value) { - return middle; - } - else if (midValue > value) { - high = middle - 1; - } - else { - low = middle + 1; - } - } - return ~low; - } - ts.binarySearch = binarySearch; - function reduceLeft(array, f, initial) { - if (array) { - var count = array.length; - if (count > 0) { - var pos = 0; - var result = arguments.length <= 2 ? array[pos++] : initial; - while (pos < count) { - result = f(result, array[pos++]); - } - return result; - } - } - return initial; - } - ts.reduceLeft = reduceLeft; - function reduceRight(array, f, initial) { - if (array) { - var pos = array.length - 1; - if (pos >= 0) { - var result = arguments.length <= 2 ? array[pos--] : initial; - while (pos >= 0) { - result = f(result, array[pos--]); - } - return result; - } - } - return initial; - } - ts.reduceRight = reduceRight; - var hasOwnProperty = Object.prototype.hasOwnProperty; - function hasProperty(map, key) { - return hasOwnProperty.call(map, key); - } - ts.hasProperty = hasProperty; - function getProperty(map, key) { - return hasOwnProperty.call(map, key) ? map[key] : undefined; - } - ts.getProperty = getProperty; - function isEmpty(map) { - for (var id in map) { - if (hasProperty(map, id)) { - return false; - } - } - return true; - } - ts.isEmpty = isEmpty; - function clone(object) { - var result = {}; - for (var id in object) { - result[id] = object[id]; - } - return result; - } - ts.clone = clone; - function extend(first, second) { - var result = {}; - for (var id in first) { - result[id] = first[id]; - } - for (var id in second) { - if (!hasProperty(result, id)) { - result[id] = second[id]; - } - } - return result; - } - ts.extend = extend; - function forEachValue(map, callback) { - var result; - for (var id in map) { - if (result = callback(map[id])) - break; - } - return result; - } - ts.forEachValue = forEachValue; - function forEachKey(map, callback) { - var result; - for (var id in map) { - if (result = callback(id)) - break; - } - return result; - } - ts.forEachKey = forEachKey; - function lookUp(map, key) { - return hasProperty(map, key) ? map[key] : undefined; - } - ts.lookUp = lookUp; - function copyMap(source, target) { - for (var p in source) { - target[p] = source[p]; - } - } - ts.copyMap = copyMap; - /** - * Creates a map from the elements of an array. - * - * @param array the array of input elements. - * @param makeKey a function that produces a key for a given element. - * - * This function makes no effort to avoid collisions; if any two elements produce - * the same key with the given 'makeKey' function, then the element with the higher - * index in the array will be the one associated with the produced key. - */ - function arrayToMap(array, makeKey) { - var result = {}; - forEach(array, function (value) { - result[makeKey(value)] = value; - }); - return result; - } - ts.arrayToMap = arrayToMap; - function memoize(callback) { - var value; - return function () { - if (callback) { - value = callback(); - callback = undefined; - } - return value; - }; - } - ts.memoize = memoize; - function formatStringFromArgs(text, args, baseIndex) { - baseIndex = baseIndex || 0; - return text.replace(/{(\d+)}/g, function (match, index) { return args[+index + baseIndex]; }); - } - ts.localizedDiagnosticMessages = undefined; - function getLocaleSpecificMessage(message) { - return ts.localizedDiagnosticMessages && ts.localizedDiagnosticMessages[message] - ? ts.localizedDiagnosticMessages[message] - : message; - } - ts.getLocaleSpecificMessage = getLocaleSpecificMessage; - function createFileDiagnostic(file, start, length, message) { - var end = start + length; - Debug.assert(start >= 0, "start must be non-negative, is " + start); - Debug.assert(length >= 0, "length must be non-negative, is " + length); - if (file) { - Debug.assert(start <= file.text.length, "start must be within the bounds of the file. " + start + " > " + file.text.length); - Debug.assert(end <= file.text.length, "end must be the bounds of the file. " + end + " > " + file.text.length); - } - var text = getLocaleSpecificMessage(message.key); - if (arguments.length > 4) { - text = formatStringFromArgs(text, arguments, 4); - } - return { - file: file, - start: start, - length: length, - messageText: text, - category: message.category, - code: message.code - }; - } - ts.createFileDiagnostic = createFileDiagnostic; - function createCompilerDiagnostic(message) { - var text = getLocaleSpecificMessage(message.key); - if (arguments.length > 1) { - text = formatStringFromArgs(text, arguments, 1); - } - return { - file: undefined, - start: undefined, - length: undefined, - messageText: text, - category: message.category, - code: message.code - }; - } - ts.createCompilerDiagnostic = createCompilerDiagnostic; - function chainDiagnosticMessages(details, message) { - var text = getLocaleSpecificMessage(message.key); - if (arguments.length > 2) { - text = formatStringFromArgs(text, arguments, 2); - } - return { - messageText: text, - category: message.category, - code: message.code, - next: details - }; - } - ts.chainDiagnosticMessages = chainDiagnosticMessages; - function concatenateDiagnosticMessageChains(headChain, tailChain) { - Debug.assert(!headChain.next); - headChain.next = tailChain; - return headChain; - } - ts.concatenateDiagnosticMessageChains = concatenateDiagnosticMessageChains; - function compareValues(a, b) { - if (a === b) - return 0 /* EqualTo */; - if (a === undefined) - return -1 /* LessThan */; - if (b === undefined) - return 1 /* GreaterThan */; - return a < b ? -1 /* LessThan */ : 1 /* GreaterThan */; - } - ts.compareValues = compareValues; - function getDiagnosticFileName(diagnostic) { - return diagnostic.file ? diagnostic.file.fileName : undefined; - } - function compareDiagnostics(d1, d2) { - return compareValues(getDiagnosticFileName(d1), getDiagnosticFileName(d2)) || - compareValues(d1.start, d2.start) || - compareValues(d1.length, d2.length) || - compareValues(d1.code, d2.code) || - compareMessageText(d1.messageText, d2.messageText) || - 0 /* EqualTo */; - } - ts.compareDiagnostics = compareDiagnostics; - function compareMessageText(text1, text2) { - while (text1 && text2) { - // We still have both chains. - var string1 = typeof text1 === "string" ? text1 : text1.messageText; - var string2 = typeof text2 === "string" ? text2 : text2.messageText; - var res = compareValues(string1, string2); - if (res) { - return res; - } - text1 = typeof text1 === "string" ? undefined : text1.next; - text2 = typeof text2 === "string" ? undefined : text2.next; - } - if (!text1 && !text2) { - // if the chains are done, then these messages are the same. - return 0 /* EqualTo */; - } - // We still have one chain remaining. The shorter chain should come first. - return text1 ? 1 /* GreaterThan */ : -1 /* LessThan */; - } - function sortAndDeduplicateDiagnostics(diagnostics) { - return deduplicateSortedDiagnostics(diagnostics.sort(compareDiagnostics)); - } - ts.sortAndDeduplicateDiagnostics = sortAndDeduplicateDiagnostics; - function deduplicateSortedDiagnostics(diagnostics) { - if (diagnostics.length < 2) { - return diagnostics; - } - var newDiagnostics = [diagnostics[0]]; - var previousDiagnostic = diagnostics[0]; - for (var i = 1; i < diagnostics.length; i++) { - var currentDiagnostic = diagnostics[i]; - var isDupe = compareDiagnostics(currentDiagnostic, previousDiagnostic) === 0 /* EqualTo */; - if (!isDupe) { - newDiagnostics.push(currentDiagnostic); - previousDiagnostic = currentDiagnostic; - } - } - return newDiagnostics; - } - ts.deduplicateSortedDiagnostics = deduplicateSortedDiagnostics; - function normalizeSlashes(path) { - return path.replace(/\\/g, "/"); - } - ts.normalizeSlashes = normalizeSlashes; - // Returns length of path root (i.e. length of "/", "x:/", "//server/share/, file:///user/files") - function getRootLength(path) { - if (path.charCodeAt(0) === 47 /* slash */) { - if (path.charCodeAt(1) !== 47 /* slash */) - return 1; - var p1 = path.indexOf("/", 2); - if (p1 < 0) - return 2; - var p2 = path.indexOf("/", p1 + 1); - if (p2 < 0) - return p1 + 1; - return p2 + 1; - } - if (path.charCodeAt(1) === 58 /* colon */) { - if (path.charCodeAt(2) === 47 /* slash */) - return 3; - return 2; - } - // Per RFC 1738 'file' URI schema has the shape file:/// - // if is omitted then it is assumed that host value is 'localhost', - // however slash after the omitted is not removed. - // file:///folder1/file1 - this is a correct URI - // file://folder2/file2 - this is an incorrect URI - if (path.lastIndexOf("file:///", 0) === 0) { - return "file:///".length; - } - var idx = path.indexOf('://'); - if (idx !== -1) { - return idx + "://".length; - } - return 0; - } - ts.getRootLength = getRootLength; - ts.directorySeparator = "/"; - function getNormalizedParts(normalizedSlashedPath, rootLength) { - var parts = normalizedSlashedPath.substr(rootLength).split(ts.directorySeparator); - var normalized = []; - for (var _i = 0; _i < parts.length; _i++) { - var part = parts[_i]; - if (part !== ".") { - if (part === ".." && normalized.length > 0 && lastOrUndefined(normalized) !== "..") { - normalized.pop(); - } - else { - // A part may be an empty string (which is 'falsy') if the path had consecutive slashes, - // e.g. "path//file.ts". Drop these before re-joining the parts. - if (part) { - normalized.push(part); - } - } - } - } - return normalized; - } - function normalizePath(path) { - path = normalizeSlashes(path); - var rootLength = getRootLength(path); - var normalized = getNormalizedParts(path, rootLength); - return path.substr(0, rootLength) + normalized.join(ts.directorySeparator); - } - ts.normalizePath = normalizePath; - function getDirectoryPath(path) { - return path.substr(0, Math.max(getRootLength(path), path.lastIndexOf(ts.directorySeparator))); - } - ts.getDirectoryPath = getDirectoryPath; - function isUrl(path) { - return path && !isRootedDiskPath(path) && path.indexOf("://") !== -1; - } - ts.isUrl = isUrl; - function isRootedDiskPath(path) { - return getRootLength(path) !== 0; - } - ts.isRootedDiskPath = isRootedDiskPath; - function normalizedPathComponents(path, rootLength) { - var normalizedParts = getNormalizedParts(path, rootLength); - return [path.substr(0, rootLength)].concat(normalizedParts); - } - function getNormalizedPathComponents(path, currentDirectory) { - path = normalizeSlashes(path); - var rootLength = getRootLength(path); - if (rootLength == 0) { - // If the path is not rooted it is relative to current directory - path = combinePaths(normalizeSlashes(currentDirectory), path); - rootLength = getRootLength(path); - } - return normalizedPathComponents(path, rootLength); - } - ts.getNormalizedPathComponents = getNormalizedPathComponents; - function getNormalizedAbsolutePath(fileName, currentDirectory) { - return getNormalizedPathFromPathComponents(getNormalizedPathComponents(fileName, currentDirectory)); - } - ts.getNormalizedAbsolutePath = getNormalizedAbsolutePath; - function getNormalizedPathFromPathComponents(pathComponents) { - if (pathComponents && pathComponents.length) { - return pathComponents[0] + pathComponents.slice(1).join(ts.directorySeparator); - } - } - ts.getNormalizedPathFromPathComponents = getNormalizedPathFromPathComponents; - function getNormalizedPathComponentsOfUrl(url) { - // Get root length of http://www.website.com/folder1/foler2/ - // In this example the root is: http://www.website.com/ - // normalized path components should be ["http://www.website.com/", "folder1", "folder2"] - var urlLength = url.length; - // Initial root length is http:// part - var rootLength = url.indexOf("://") + "://".length; - while (rootLength < urlLength) { - // Consume all immediate slashes in the protocol - // eg.initial rootlength is just file:// but it needs to consume another "/" in file:/// - if (url.charCodeAt(rootLength) === 47 /* slash */) { - rootLength++; - } - else { - // non slash character means we continue proceeding to next component of root search - break; - } - } - // there are no parts after http:// just return current string as the pathComponent - if (rootLength === urlLength) { - return [url]; - } - // Find the index of "/" after website.com so the root can be http://www.website.com/ (from existing http://) - var indexOfNextSlash = url.indexOf(ts.directorySeparator, rootLength); - if (indexOfNextSlash !== -1) { - // Found the "/" after the website.com so the root is length of http://www.website.com/ - // and get components afetr the root normally like any other folder components - rootLength = indexOfNextSlash + 1; - return normalizedPathComponents(url, rootLength); - } - else { - // Can't find the host assume the rest of the string as component - // but make sure we append "/" to it as root is not joined using "/" - // eg. if url passed in was http://website.com we want to use root as [http://website.com/] - // so that other path manipulations will be correct and it can be merged with relative paths correctly - return [url + ts.directorySeparator]; - } - } - function getNormalizedPathOrUrlComponents(pathOrUrl, currentDirectory) { - if (isUrl(pathOrUrl)) { - return getNormalizedPathComponentsOfUrl(pathOrUrl); - } - else { - return getNormalizedPathComponents(pathOrUrl, currentDirectory); - } - } - function getRelativePathToDirectoryOrUrl(directoryPathOrUrl, relativeOrAbsolutePath, currentDirectory, getCanonicalFileName, isAbsolutePathAnUrl) { - var pathComponents = getNormalizedPathOrUrlComponents(relativeOrAbsolutePath, currentDirectory); - var directoryComponents = getNormalizedPathOrUrlComponents(directoryPathOrUrl, currentDirectory); - if (directoryComponents.length > 1 && lastOrUndefined(directoryComponents) === "") { - // If the directory path given was of type test/cases/ then we really need components of directory to be only till its name - // that is ["test", "cases", ""] needs to be actually ["test", "cases"] - directoryComponents.length--; - } - // Find the component that differs - for (var joinStartIndex = 0; joinStartIndex < pathComponents.length && joinStartIndex < directoryComponents.length; joinStartIndex++) { - if (getCanonicalFileName(directoryComponents[joinStartIndex]) !== getCanonicalFileName(pathComponents[joinStartIndex])) { - break; - } - } - // Get the relative path - if (joinStartIndex) { - var relativePath = ""; - var relativePathComponents = pathComponents.slice(joinStartIndex, pathComponents.length); - for (; joinStartIndex < directoryComponents.length; joinStartIndex++) { - if (directoryComponents[joinStartIndex] !== "") { - relativePath = relativePath + ".." + ts.directorySeparator; - } - } - return relativePath + relativePathComponents.join(ts.directorySeparator); - } - // Cant find the relative path, get the absolute path - var absolutePath = getNormalizedPathFromPathComponents(pathComponents); - if (isAbsolutePathAnUrl && isRootedDiskPath(absolutePath)) { - absolutePath = "file:///" + absolutePath; - } - return absolutePath; - } - ts.getRelativePathToDirectoryOrUrl = getRelativePathToDirectoryOrUrl; - function getBaseFileName(path) { - var i = path.lastIndexOf(ts.directorySeparator); - return i < 0 ? path : path.substring(i + 1); - } - ts.getBaseFileName = getBaseFileName; - function combinePaths(path1, path2) { - if (!(path1 && path1.length)) - return path2; - if (!(path2 && path2.length)) - return path1; - if (getRootLength(path2) !== 0) - return path2; - if (path1.charAt(path1.length - 1) === ts.directorySeparator) - return path1 + path2; - return path1 + ts.directorySeparator + path2; - } - ts.combinePaths = combinePaths; - function fileExtensionIs(path, extension) { - var pathLen = path.length; - var extLen = extension.length; - return pathLen > extLen && path.substr(pathLen - extLen, extLen) === extension; - } - ts.fileExtensionIs = fileExtensionIs; - /** - * List of supported extensions in order of file resolution precedence. - */ - ts.supportedExtensions = [".ts", ".d.ts"]; - var extensionsToRemove = [".d.ts", ".ts", ".js"]; - function removeFileExtension(path) { - for (var _i = 0; _i < extensionsToRemove.length; _i++) { - var ext = extensionsToRemove[_i]; - if (fileExtensionIs(path, ext)) { - return path.substr(0, path.length - ext.length); - } - } - return path; - } - ts.removeFileExtension = removeFileExtension; - var backslashOrDoubleQuote = /[\"\\]/g; - var escapedCharsRegExp = /[\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g; - var escapedCharsMap = { - "\0": "\\0", - "\t": "\\t", - "\v": "\\v", - "\f": "\\f", - "\b": "\\b", - "\r": "\\r", - "\n": "\\n", - "\\": "\\\\", - "\"": "\\\"", - "\u2028": "\\u2028", - "\u2029": "\\u2029", - "\u0085": "\\u0085" // nextLine - }; - function Symbol(flags, name) { - this.flags = flags; - this.name = name; - this.declarations = undefined; - } - function Type(checker, flags) { - this.flags = flags; - } - function Signature(checker) { - } - ts.objectAllocator = { - getNodeConstructor: function (kind) { - function Node() { - } - Node.prototype = { - kind: kind, - pos: 0, - end: 0, - flags: 0, - parent: undefined - }; - return Node; - }, - getSymbolConstructor: function () { return Symbol; }, - getTypeConstructor: function () { return Type; }, - getSignatureConstructor: function () { return Signature; } - }; - (function (AssertionLevel) { - AssertionLevel[AssertionLevel["None"] = 0] = "None"; - AssertionLevel[AssertionLevel["Normal"] = 1] = "Normal"; - AssertionLevel[AssertionLevel["Aggressive"] = 2] = "Aggressive"; - AssertionLevel[AssertionLevel["VeryAggressive"] = 3] = "VeryAggressive"; - })(ts.AssertionLevel || (ts.AssertionLevel = {})); - var AssertionLevel = ts.AssertionLevel; - var Debug; - (function (Debug) { - var currentAssertionLevel = 0 /* None */; - function shouldAssert(level) { - return currentAssertionLevel >= level; - } - Debug.shouldAssert = shouldAssert; - function assert(expression, message, verboseDebugInfo) { - if (!expression) { - var verboseDebugString = ""; - if (verboseDebugInfo) { - verboseDebugString = "\r\nVerbose Debug Information: " + verboseDebugInfo(); - } - throw new Error("Debug Failure. False expression: " + (message || "") + verboseDebugString); - } - } - Debug.assert = assert; - function fail(message) { - Debug.assert(false, message); - } - Debug.fail = fail; - })(Debug = ts.Debug || (ts.Debug = {})); -})(ts || (ts = {})); -/// -var ts; -(function (ts) { - ts.sys = (function () { - function getWScriptSystem() { - var fso = new ActiveXObject("Scripting.FileSystemObject"); - var fileStream = new ActiveXObject("ADODB.Stream"); - fileStream.Type = 2 /*text*/; - var binaryStream = new ActiveXObject("ADODB.Stream"); - binaryStream.Type = 1 /*binary*/; - var args = []; - for (var i = 0; i < WScript.Arguments.length; i++) { - args[i] = WScript.Arguments.Item(i); - } - function readFile(fileName, encoding) { - if (!fso.FileExists(fileName)) { - return undefined; - } - fileStream.Open(); - try { - if (encoding) { - fileStream.Charset = encoding; - fileStream.LoadFromFile(fileName); - } - else { - // Load file and read the first two bytes into a string with no interpretation - fileStream.Charset = "x-ansi"; - fileStream.LoadFromFile(fileName); - var bom = fileStream.ReadText(2) || ""; - // Position must be at 0 before encoding can be changed - fileStream.Position = 0; - // [0xFF,0xFE] and [0xFE,0xFF] mean utf-16 (little or big endian), otherwise default to utf-8 - fileStream.Charset = bom.length >= 2 && (bom.charCodeAt(0) === 0xFF && bom.charCodeAt(1) === 0xFE || bom.charCodeAt(0) === 0xFE && bom.charCodeAt(1) === 0xFF) ? "unicode" : "utf-8"; - } - // ReadText method always strips byte order mark from resulting string - return fileStream.ReadText(); - } - catch (e) { - throw e; - } - finally { - fileStream.Close(); - } - } - function writeFile(fileName, data, writeByteOrderMark) { - fileStream.Open(); - binaryStream.Open(); - try { - // Write characters in UTF-8 encoding - fileStream.Charset = "utf-8"; - fileStream.WriteText(data); - // If we don't want the BOM, then skip it by setting the starting location to 3 (size of BOM). - // If not, start from position 0, as the BOM will be added automatically when charset==utf8. - if (writeByteOrderMark) { - fileStream.Position = 0; - } - else { - fileStream.Position = 3; - } - fileStream.CopyTo(binaryStream); - binaryStream.SaveToFile(fileName, 2 /*overwrite*/); - } - finally { - binaryStream.Close(); - fileStream.Close(); - } - } - function getCanonicalPath(path) { - return path.toLowerCase(); - } - function getNames(collection) { - var result = []; - for (var e = new Enumerator(collection); !e.atEnd(); e.moveNext()) { - result.push(e.item().Name); - } - return result.sort(); - } - function readDirectory(path, extension, exclude) { - var result = []; - exclude = ts.map(exclude, function (s) { return getCanonicalPath(ts.combinePaths(path, s)); }); - visitDirectory(path); - return result; - function visitDirectory(path) { - var folder = fso.GetFolder(path || "."); - var files = getNames(folder.files); - for (var _i = 0; _i < files.length; _i++) { - var current = files[_i]; - var name_1 = ts.combinePaths(path, current); - if ((!extension || ts.fileExtensionIs(name_1, extension)) && !ts.contains(exclude, getCanonicalPath(name_1))) { - result.push(name_1); - } - } - var subfolders = getNames(folder.subfolders); - for (var _a = 0; _a < subfolders.length; _a++) { - var current = subfolders[_a]; - var name_2 = ts.combinePaths(path, current); - if (!ts.contains(exclude, getCanonicalPath(name_2))) { - visitDirectory(name_2); - } - } - } - } - return { - args: args, - newLine: "\r\n", - useCaseSensitiveFileNames: false, - write: function (s) { - WScript.StdOut.Write(s); - }, - readFile: readFile, - writeFile: writeFile, - resolvePath: function (path) { - return fso.GetAbsolutePathName(path); - }, - fileExists: function (path) { - return fso.FileExists(path); - }, - directoryExists: function (path) { - return fso.FolderExists(path); - }, - createDirectory: function (directoryName) { - if (!this.directoryExists(directoryName)) { - fso.CreateFolder(directoryName); - } - }, - getExecutingFilePath: function () { - return WScript.ScriptFullName; - }, - getCurrentDirectory: function () { - return new ActiveXObject("WScript.Shell").CurrentDirectory; - }, - readDirectory: readDirectory, - exit: function (exitCode) { - try { - WScript.Quit(exitCode); - } - catch (e) { - } - } - }; - } - function getNodeSystem() { - var _fs = require("fs"); - var _path = require("path"); - var _os = require('os'); - var platform = _os.platform(); - // win32\win64 are case insensitive platforms, MacOS (darwin) by default is also case insensitive - var useCaseSensitiveFileNames = platform !== "win32" && platform !== "win64" && platform !== "darwin"; - function readFile(fileName, encoding) { - if (!_fs.existsSync(fileName)) { - return undefined; - } - var buffer = _fs.readFileSync(fileName); - var len = buffer.length; - if (len >= 2 && buffer[0] === 0xFE && buffer[1] === 0xFF) { - // Big endian UTF-16 byte order mark detected. Since big endian is not supported by node.js, - // flip all byte pairs and treat as little endian. - len &= ~1; - for (var i = 0; i < len; i += 2) { - var temp = buffer[i]; - buffer[i] = buffer[i + 1]; - buffer[i + 1] = temp; - } - return buffer.toString("utf16le", 2); - } - if (len >= 2 && buffer[0] === 0xFF && buffer[1] === 0xFE) { - // Little endian UTF-16 byte order mark detected - return buffer.toString("utf16le", 2); - } - if (len >= 3 && buffer[0] === 0xEF && buffer[1] === 0xBB && buffer[2] === 0xBF) { - // UTF-8 byte order mark detected - return buffer.toString("utf8", 3); - } - // Default is UTF-8 with no byte order mark - return buffer.toString("utf8"); - } - function writeFile(fileName, data, writeByteOrderMark) { - // If a BOM is required, emit one - if (writeByteOrderMark) { - data = '\uFEFF' + data; - } - _fs.writeFileSync(fileName, data, "utf8"); - } - function getCanonicalPath(path) { - return useCaseSensitiveFileNames ? path.toLowerCase() : path; - } - function readDirectory(path, extension, exclude) { - var result = []; - exclude = ts.map(exclude, function (s) { return getCanonicalPath(ts.combinePaths(path, s)); }); - visitDirectory(path); - return result; - function visitDirectory(path) { - var files = _fs.readdirSync(path || ".").sort(); - var directories = []; - for (var _i = 0; _i < files.length; _i++) { - var current = files[_i]; - var name = ts.combinePaths(path, current); - if (!ts.contains(exclude, getCanonicalPath(name))) { - var stat = _fs.statSync(name); - if (stat.isFile()) { - if (!extension || ts.fileExtensionIs(name, extension)) { - result.push(name); - } - } - else if (stat.isDirectory()) { - directories.push(name); - } - } - } - for (var _a = 0; _a < directories.length; _a++) { - var current = directories[_a]; - visitDirectory(current); - } - } - } - return { - args: process.argv.slice(2), - newLine: _os.EOL, - useCaseSensitiveFileNames: useCaseSensitiveFileNames, - write: function (s) { - // 1 is a standard descriptor for stdout - _fs.writeSync(1, s); - }, - readFile: readFile, - writeFile: writeFile, - watchFile: function (fileName, callback) { - // watchFile polls a file every 250ms, picking up file notifications. - _fs.watchFile(fileName, { persistent: true, interval: 250 }, fileChanged); - return { - close: function () { _fs.unwatchFile(fileName, fileChanged); } - }; - function fileChanged(curr, prev) { - if (+curr.mtime <= +prev.mtime) { - return; - } - callback(fileName); - } - ; - }, - resolvePath: function (path) { - return _path.resolve(path); - }, - fileExists: function (path) { - return _fs.existsSync(path); - }, - directoryExists: function (path) { - return _fs.existsSync(path) && _fs.statSync(path).isDirectory(); - }, - createDirectory: function (directoryName) { - if (!this.directoryExists(directoryName)) { - _fs.mkdirSync(directoryName); - } - }, - getExecutingFilePath: function () { - return __filename; - }, - getCurrentDirectory: function () { - return process.cwd(); - }, - readDirectory: readDirectory, - getMemoryUsage: function () { - if (global.gc) { - global.gc(); - } - return process.memoryUsage().heapUsed; - }, - exit: function (exitCode) { - process.exit(exitCode); - } - }; - } - if (typeof WScript !== "undefined" && typeof ActiveXObject === "function") { - return getWScriptSystem(); - } - else if (typeof module !== "undefined" && module.exports) { - return getNodeSystem(); - } - else { - return undefined; // Unsupported host - } - })(); -})(ts || (ts = {})); -// -/// -/* @internal */ -var ts; -(function (ts) { - ts.Diagnostics = { - Unterminated_string_literal: { code: 1002, category: ts.DiagnosticCategory.Error, key: "Unterminated string literal." }, - Identifier_expected: { code: 1003, category: ts.DiagnosticCategory.Error, key: "Identifier expected." }, - _0_expected: { code: 1005, category: ts.DiagnosticCategory.Error, key: "'{0}' expected." }, - A_file_cannot_have_a_reference_to_itself: { code: 1006, category: ts.DiagnosticCategory.Error, key: "A file cannot have a reference to itself." }, - Trailing_comma_not_allowed: { code: 1009, category: ts.DiagnosticCategory.Error, key: "Trailing comma not allowed." }, - Asterisk_Slash_expected: { code: 1010, category: ts.DiagnosticCategory.Error, key: "'*/' expected." }, - Unexpected_token: { code: 1012, category: ts.DiagnosticCategory.Error, key: "Unexpected token." }, - A_rest_parameter_must_be_last_in_a_parameter_list: { code: 1014, category: ts.DiagnosticCategory.Error, key: "A rest parameter must be last in a parameter list." }, - Parameter_cannot_have_question_mark_and_initializer: { code: 1015, category: ts.DiagnosticCategory.Error, key: "Parameter cannot have question mark and initializer." }, - A_required_parameter_cannot_follow_an_optional_parameter: { code: 1016, category: ts.DiagnosticCategory.Error, key: "A required parameter cannot follow an optional parameter." }, - An_index_signature_cannot_have_a_rest_parameter: { code: 1017, category: ts.DiagnosticCategory.Error, key: "An index signature cannot have a rest parameter." }, - An_index_signature_parameter_cannot_have_an_accessibility_modifier: { code: 1018, category: ts.DiagnosticCategory.Error, key: "An index signature parameter cannot have an accessibility modifier." }, - An_index_signature_parameter_cannot_have_a_question_mark: { code: 1019, category: ts.DiagnosticCategory.Error, key: "An index signature parameter cannot have a question mark." }, - An_index_signature_parameter_cannot_have_an_initializer: { code: 1020, category: ts.DiagnosticCategory.Error, key: "An index signature parameter cannot have an initializer." }, - An_index_signature_must_have_a_type_annotation: { code: 1021, category: ts.DiagnosticCategory.Error, key: "An index signature must have a type annotation." }, - An_index_signature_parameter_must_have_a_type_annotation: { code: 1022, category: ts.DiagnosticCategory.Error, key: "An index signature parameter must have a type annotation." }, - An_index_signature_parameter_type_must_be_string_or_number: { code: 1023, category: ts.DiagnosticCategory.Error, key: "An index signature parameter type must be 'string' or 'number'." }, - A_class_or_interface_declaration_can_only_have_one_extends_clause: { code: 1024, category: ts.DiagnosticCategory.Error, key: "A class or interface declaration can only have one 'extends' clause." }, - An_extends_clause_must_precede_an_implements_clause: { code: 1025, category: ts.DiagnosticCategory.Error, key: "An 'extends' clause must precede an 'implements' clause." }, - A_class_can_only_extend_a_single_class: { code: 1026, category: ts.DiagnosticCategory.Error, key: "A class can only extend a single class." }, - A_class_declaration_can_only_have_one_implements_clause: { code: 1027, category: ts.DiagnosticCategory.Error, key: "A class declaration can only have one 'implements' clause." }, - Accessibility_modifier_already_seen: { code: 1028, category: ts.DiagnosticCategory.Error, key: "Accessibility modifier already seen." }, - _0_modifier_must_precede_1_modifier: { code: 1029, category: ts.DiagnosticCategory.Error, key: "'{0}' modifier must precede '{1}' modifier." }, - _0_modifier_already_seen: { code: 1030, category: ts.DiagnosticCategory.Error, key: "'{0}' modifier already seen." }, - _0_modifier_cannot_appear_on_a_class_element: { code: 1031, category: ts.DiagnosticCategory.Error, key: "'{0}' modifier cannot appear on a class element." }, - An_interface_declaration_cannot_have_an_implements_clause: { code: 1032, category: ts.DiagnosticCategory.Error, key: "An interface declaration cannot have an 'implements' clause." }, - super_must_be_followed_by_an_argument_list_or_member_access: { code: 1034, category: ts.DiagnosticCategory.Error, key: "'super' must be followed by an argument list or member access." }, - Only_ambient_modules_can_use_quoted_names: { code: 1035, category: ts.DiagnosticCategory.Error, key: "Only ambient modules can use quoted names." }, - Statements_are_not_allowed_in_ambient_contexts: { code: 1036, category: ts.DiagnosticCategory.Error, key: "Statements are not allowed in ambient contexts." }, - A_declare_modifier_cannot_be_used_in_an_already_ambient_context: { code: 1038, category: ts.DiagnosticCategory.Error, key: "A 'declare' modifier cannot be used in an already ambient context." }, - Initializers_are_not_allowed_in_ambient_contexts: { code: 1039, category: ts.DiagnosticCategory.Error, key: "Initializers are not allowed in ambient contexts." }, - _0_modifier_cannot_appear_on_a_module_element: { code: 1044, category: ts.DiagnosticCategory.Error, key: "'{0}' modifier cannot appear on a module element." }, - A_declare_modifier_cannot_be_used_with_an_interface_declaration: { code: 1045, category: ts.DiagnosticCategory.Error, key: "A 'declare' modifier cannot be used with an interface declaration." }, - A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file: { code: 1046, category: ts.DiagnosticCategory.Error, key: "A 'declare' modifier is required for a top level declaration in a .d.ts file." }, - A_rest_parameter_cannot_be_optional: { code: 1047, category: ts.DiagnosticCategory.Error, key: "A rest parameter cannot be optional." }, - A_rest_parameter_cannot_have_an_initializer: { code: 1048, category: ts.DiagnosticCategory.Error, key: "A rest parameter cannot have an initializer." }, - A_set_accessor_must_have_exactly_one_parameter: { code: 1049, category: ts.DiagnosticCategory.Error, key: "A 'set' accessor must have exactly one parameter." }, - A_set_accessor_cannot_have_an_optional_parameter: { code: 1051, category: ts.DiagnosticCategory.Error, key: "A 'set' accessor cannot have an optional parameter." }, - A_set_accessor_parameter_cannot_have_an_initializer: { code: 1052, category: ts.DiagnosticCategory.Error, key: "A 'set' accessor parameter cannot have an initializer." }, - A_set_accessor_cannot_have_rest_parameter: { code: 1053, category: ts.DiagnosticCategory.Error, key: "A 'set' accessor cannot have rest parameter." }, - A_get_accessor_cannot_have_parameters: { code: 1054, category: ts.DiagnosticCategory.Error, key: "A 'get' accessor cannot have parameters." }, - Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher: { code: 1056, category: ts.DiagnosticCategory.Error, key: "Accessors are only available when targeting ECMAScript 5 and higher." }, - Enum_member_must_have_initializer: { code: 1061, category: ts.DiagnosticCategory.Error, key: "Enum member must have initializer." }, - An_export_assignment_cannot_be_used_in_a_namespace: { code: 1063, category: ts.DiagnosticCategory.Error, key: "An export assignment cannot be used in a namespace." }, - Ambient_enum_elements_can_only_have_integer_literal_initializers: { code: 1066, category: ts.DiagnosticCategory.Error, key: "Ambient enum elements can only have integer literal initializers." }, - Unexpected_token_A_constructor_method_accessor_or_property_was_expected: { code: 1068, category: ts.DiagnosticCategory.Error, key: "Unexpected token. A constructor, method, accessor, or property was expected." }, - A_declare_modifier_cannot_be_used_with_an_import_declaration: { code: 1079, category: ts.DiagnosticCategory.Error, key: "A 'declare' modifier cannot be used with an import declaration." }, - Invalid_reference_directive_syntax: { code: 1084, category: ts.DiagnosticCategory.Error, key: "Invalid 'reference' directive syntax." }, - Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher: { code: 1085, category: ts.DiagnosticCategory.Error, key: "Octal literals are not available when targeting ECMAScript 5 and higher." }, - An_accessor_cannot_be_declared_in_an_ambient_context: { code: 1086, category: ts.DiagnosticCategory.Error, key: "An accessor cannot be declared in an ambient context." }, - _0_modifier_cannot_appear_on_a_constructor_declaration: { code: 1089, category: ts.DiagnosticCategory.Error, key: "'{0}' modifier cannot appear on a constructor declaration." }, - _0_modifier_cannot_appear_on_a_parameter: { code: 1090, category: ts.DiagnosticCategory.Error, key: "'{0}' modifier cannot appear on a parameter." }, - Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement: { code: 1091, category: ts.DiagnosticCategory.Error, key: "Only a single variable declaration is allowed in a 'for...in' statement." }, - Type_parameters_cannot_appear_on_a_constructor_declaration: { code: 1092, category: ts.DiagnosticCategory.Error, key: "Type parameters cannot appear on a constructor declaration." }, - Type_annotation_cannot_appear_on_a_constructor_declaration: { code: 1093, category: ts.DiagnosticCategory.Error, key: "Type annotation cannot appear on a constructor declaration." }, - An_accessor_cannot_have_type_parameters: { code: 1094, category: ts.DiagnosticCategory.Error, key: "An accessor cannot have type parameters." }, - A_set_accessor_cannot_have_a_return_type_annotation: { code: 1095, category: ts.DiagnosticCategory.Error, key: "A 'set' accessor cannot have a return type annotation." }, - An_index_signature_must_have_exactly_one_parameter: { code: 1096, category: ts.DiagnosticCategory.Error, key: "An index signature must have exactly one parameter." }, - _0_list_cannot_be_empty: { code: 1097, category: ts.DiagnosticCategory.Error, key: "'{0}' list cannot be empty." }, - Type_parameter_list_cannot_be_empty: { code: 1098, category: ts.DiagnosticCategory.Error, key: "Type parameter list cannot be empty." }, - Type_argument_list_cannot_be_empty: { code: 1099, category: ts.DiagnosticCategory.Error, key: "Type argument list cannot be empty." }, - Invalid_use_of_0_in_strict_mode: { code: 1100, category: ts.DiagnosticCategory.Error, key: "Invalid use of '{0}' in strict mode." }, - with_statements_are_not_allowed_in_strict_mode: { code: 1101, category: ts.DiagnosticCategory.Error, key: "'with' statements are not allowed in strict mode." }, - delete_cannot_be_called_on_an_identifier_in_strict_mode: { code: 1102, category: ts.DiagnosticCategory.Error, key: "'delete' cannot be called on an identifier in strict mode." }, - A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement: { code: 1104, category: ts.DiagnosticCategory.Error, key: "A 'continue' statement can only be used within an enclosing iteration statement." }, - A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement: { code: 1105, category: ts.DiagnosticCategory.Error, key: "A 'break' statement can only be used within an enclosing iteration or switch statement." }, - Jump_target_cannot_cross_function_boundary: { code: 1107, category: ts.DiagnosticCategory.Error, key: "Jump target cannot cross function boundary." }, - A_return_statement_can_only_be_used_within_a_function_body: { code: 1108, category: ts.DiagnosticCategory.Error, key: "A 'return' statement can only be used within a function body." }, - Expression_expected: { code: 1109, category: ts.DiagnosticCategory.Error, key: "Expression expected." }, - Type_expected: { code: 1110, category: ts.DiagnosticCategory.Error, key: "Type expected." }, - A_class_member_cannot_be_declared_optional: { code: 1112, category: ts.DiagnosticCategory.Error, key: "A class member cannot be declared optional." }, - A_default_clause_cannot_appear_more_than_once_in_a_switch_statement: { code: 1113, category: ts.DiagnosticCategory.Error, key: "A 'default' clause cannot appear more than once in a 'switch' statement." }, - Duplicate_label_0: { code: 1114, category: ts.DiagnosticCategory.Error, key: "Duplicate label '{0}'" }, - A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement: { code: 1115, category: ts.DiagnosticCategory.Error, key: "A 'continue' statement can only jump to a label of an enclosing iteration statement." }, - A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement: { code: 1116, category: ts.DiagnosticCategory.Error, key: "A 'break' statement can only jump to a label of an enclosing statement." }, - An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode: { code: 1117, category: ts.DiagnosticCategory.Error, key: "An object literal cannot have multiple properties with the same name in strict mode." }, - An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name: { code: 1118, category: ts.DiagnosticCategory.Error, key: "An object literal cannot have multiple get/set accessors with the same name." }, - An_object_literal_cannot_have_property_and_accessor_with_the_same_name: { code: 1119, category: ts.DiagnosticCategory.Error, key: "An object literal cannot have property and accessor with the same name." }, - An_export_assignment_cannot_have_modifiers: { code: 1120, category: ts.DiagnosticCategory.Error, key: "An export assignment cannot have modifiers." }, - Octal_literals_are_not_allowed_in_strict_mode: { code: 1121, category: ts.DiagnosticCategory.Error, key: "Octal literals are not allowed in strict mode." }, - A_tuple_type_element_list_cannot_be_empty: { code: 1122, category: ts.DiagnosticCategory.Error, key: "A tuple type element list cannot be empty." }, - Variable_declaration_list_cannot_be_empty: { code: 1123, category: ts.DiagnosticCategory.Error, key: "Variable declaration list cannot be empty." }, - Digit_expected: { code: 1124, category: ts.DiagnosticCategory.Error, key: "Digit expected." }, - Hexadecimal_digit_expected: { code: 1125, category: ts.DiagnosticCategory.Error, key: "Hexadecimal digit expected." }, - Unexpected_end_of_text: { code: 1126, category: ts.DiagnosticCategory.Error, key: "Unexpected end of text." }, - Invalid_character: { code: 1127, category: ts.DiagnosticCategory.Error, key: "Invalid character." }, - Declaration_or_statement_expected: { code: 1128, category: ts.DiagnosticCategory.Error, key: "Declaration or statement expected." }, - Statement_expected: { code: 1129, category: ts.DiagnosticCategory.Error, key: "Statement expected." }, - case_or_default_expected: { code: 1130, category: ts.DiagnosticCategory.Error, key: "'case' or 'default' expected." }, - Property_or_signature_expected: { code: 1131, category: ts.DiagnosticCategory.Error, key: "Property or signature expected." }, - Enum_member_expected: { code: 1132, category: ts.DiagnosticCategory.Error, key: "Enum member expected." }, - Type_reference_expected: { code: 1133, category: ts.DiagnosticCategory.Error, key: "Type reference expected." }, - Variable_declaration_expected: { code: 1134, category: ts.DiagnosticCategory.Error, key: "Variable declaration expected." }, - Argument_expression_expected: { code: 1135, category: ts.DiagnosticCategory.Error, key: "Argument expression expected." }, - Property_assignment_expected: { code: 1136, category: ts.DiagnosticCategory.Error, key: "Property assignment expected." }, - Expression_or_comma_expected: { code: 1137, category: ts.DiagnosticCategory.Error, key: "Expression or comma expected." }, - Parameter_declaration_expected: { code: 1138, category: ts.DiagnosticCategory.Error, key: "Parameter declaration expected." }, - Type_parameter_declaration_expected: { code: 1139, category: ts.DiagnosticCategory.Error, key: "Type parameter declaration expected." }, - Type_argument_expected: { code: 1140, category: ts.DiagnosticCategory.Error, key: "Type argument expected." }, - String_literal_expected: { code: 1141, category: ts.DiagnosticCategory.Error, key: "String literal expected." }, - Line_break_not_permitted_here: { code: 1142, category: ts.DiagnosticCategory.Error, key: "Line break not permitted here." }, - or_expected: { code: 1144, category: ts.DiagnosticCategory.Error, key: "'{' or ';' expected." }, - Modifiers_not_permitted_on_index_signature_members: { code: 1145, category: ts.DiagnosticCategory.Error, key: "Modifiers not permitted on index signature members." }, - Declaration_expected: { code: 1146, category: ts.DiagnosticCategory.Error, key: "Declaration expected." }, - Import_declarations_in_a_namespace_cannot_reference_a_module: { code: 1147, category: ts.DiagnosticCategory.Error, key: "Import declarations in a namespace cannot reference a module." }, - Cannot_compile_modules_unless_the_module_flag_is_provided: { code: 1148, category: ts.DiagnosticCategory.Error, key: "Cannot compile modules unless the '--module' flag is provided." }, - File_name_0_differs_from_already_included_file_name_1_only_in_casing: { code: 1149, category: ts.DiagnosticCategory.Error, key: "File name '{0}' differs from already included file name '{1}' only in casing" }, - new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead: { code: 1150, category: ts.DiagnosticCategory.Error, key: "'new T[]' cannot be used to create an array. Use 'new Array()' instead." }, - var_let_or_const_expected: { code: 1152, category: ts.DiagnosticCategory.Error, key: "'var', 'let' or 'const' expected." }, - let_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1153, category: ts.DiagnosticCategory.Error, key: "'let' declarations are only available when targeting ECMAScript 6 and higher." }, - const_declarations_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1154, category: ts.DiagnosticCategory.Error, key: "'const' declarations are only available when targeting ECMAScript 6 and higher." }, - const_declarations_must_be_initialized: { code: 1155, category: ts.DiagnosticCategory.Error, key: "'const' declarations must be initialized" }, - const_declarations_can_only_be_declared_inside_a_block: { code: 1156, category: ts.DiagnosticCategory.Error, key: "'const' declarations can only be declared inside a block." }, - let_declarations_can_only_be_declared_inside_a_block: { code: 1157, category: ts.DiagnosticCategory.Error, key: "'let' declarations can only be declared inside a block." }, - Unterminated_template_literal: { code: 1160, category: ts.DiagnosticCategory.Error, key: "Unterminated template literal." }, - Unterminated_regular_expression_literal: { code: 1161, category: ts.DiagnosticCategory.Error, key: "Unterminated regular expression literal." }, - An_object_member_cannot_be_declared_optional: { code: 1162, category: ts.DiagnosticCategory.Error, key: "An object member cannot be declared optional." }, - A_yield_expression_is_only_allowed_in_a_generator_body: { code: 1163, category: ts.DiagnosticCategory.Error, key: "A 'yield' expression is only allowed in a generator body." }, - Computed_property_names_are_not_allowed_in_enums: { code: 1164, category: ts.DiagnosticCategory.Error, key: "Computed property names are not allowed in enums." }, - A_computed_property_name_in_an_ambient_context_must_directly_refer_to_a_built_in_symbol: { code: 1165, category: ts.DiagnosticCategory.Error, key: "A computed property name in an ambient context must directly refer to a built-in symbol." }, - A_computed_property_name_in_a_class_property_declaration_must_directly_refer_to_a_built_in_symbol: { code: 1166, category: ts.DiagnosticCategory.Error, key: "A computed property name in a class property declaration must directly refer to a built-in symbol." }, - Computed_property_names_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1167, category: ts.DiagnosticCategory.Error, key: "Computed property names are only available when targeting ECMAScript 6 and higher." }, - A_computed_property_name_in_a_method_overload_must_directly_refer_to_a_built_in_symbol: { code: 1168, category: ts.DiagnosticCategory.Error, key: "A computed property name in a method overload must directly refer to a built-in symbol." }, - A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol: { code: 1169, category: ts.DiagnosticCategory.Error, key: "A computed property name in an interface must directly refer to a built-in symbol." }, - A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol: { code: 1170, category: ts.DiagnosticCategory.Error, key: "A computed property name in a type literal must directly refer to a built-in symbol." }, - A_comma_expression_is_not_allowed_in_a_computed_property_name: { code: 1171, category: ts.DiagnosticCategory.Error, key: "A comma expression is not allowed in a computed property name." }, - extends_clause_already_seen: { code: 1172, category: ts.DiagnosticCategory.Error, key: "'extends' clause already seen." }, - extends_clause_must_precede_implements_clause: { code: 1173, category: ts.DiagnosticCategory.Error, key: "'extends' clause must precede 'implements' clause." }, - Classes_can_only_extend_a_single_class: { code: 1174, category: ts.DiagnosticCategory.Error, key: "Classes can only extend a single class." }, - implements_clause_already_seen: { code: 1175, category: ts.DiagnosticCategory.Error, key: "'implements' clause already seen." }, - Interface_declaration_cannot_have_implements_clause: { code: 1176, category: ts.DiagnosticCategory.Error, key: "Interface declaration cannot have 'implements' clause." }, - Binary_digit_expected: { code: 1177, category: ts.DiagnosticCategory.Error, key: "Binary digit expected." }, - Octal_digit_expected: { code: 1178, category: ts.DiagnosticCategory.Error, key: "Octal digit expected." }, - Unexpected_token_expected: { code: 1179, category: ts.DiagnosticCategory.Error, key: "Unexpected token. '{' expected." }, - Property_destructuring_pattern_expected: { code: 1180, category: ts.DiagnosticCategory.Error, key: "Property destructuring pattern expected." }, - Array_element_destructuring_pattern_expected: { code: 1181, category: ts.DiagnosticCategory.Error, key: "Array element destructuring pattern expected." }, - A_destructuring_declaration_must_have_an_initializer: { code: 1182, category: ts.DiagnosticCategory.Error, key: "A destructuring declaration must have an initializer." }, - Destructuring_declarations_are_not_allowed_in_ambient_contexts: { code: 1183, category: ts.DiagnosticCategory.Error, key: "Destructuring declarations are not allowed in ambient contexts." }, - An_implementation_cannot_be_declared_in_ambient_contexts: { code: 1184, category: ts.DiagnosticCategory.Error, key: "An implementation cannot be declared in ambient contexts." }, - Modifiers_cannot_appear_here: { code: 1184, category: ts.DiagnosticCategory.Error, key: "Modifiers cannot appear here." }, - Merge_conflict_marker_encountered: { code: 1185, category: ts.DiagnosticCategory.Error, key: "Merge conflict marker encountered." }, - A_rest_element_cannot_have_an_initializer: { code: 1186, category: ts.DiagnosticCategory.Error, key: "A rest element cannot have an initializer." }, - A_parameter_property_may_not_be_a_binding_pattern: { code: 1187, category: ts.DiagnosticCategory.Error, key: "A parameter property may not be a binding pattern." }, - Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement: { code: 1188, category: ts.DiagnosticCategory.Error, key: "Only a single variable declaration is allowed in a 'for...of' statement." }, - The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer: { code: 1189, category: ts.DiagnosticCategory.Error, key: "The variable declaration of a 'for...in' statement cannot have an initializer." }, - The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer: { code: 1190, category: ts.DiagnosticCategory.Error, key: "The variable declaration of a 'for...of' statement cannot have an initializer." }, - An_import_declaration_cannot_have_modifiers: { code: 1191, category: ts.DiagnosticCategory.Error, key: "An import declaration cannot have modifiers." }, - Module_0_has_no_default_export: { code: 1192, category: ts.DiagnosticCategory.Error, key: "Module '{0}' has no default export." }, - An_export_declaration_cannot_have_modifiers: { code: 1193, category: ts.DiagnosticCategory.Error, key: "An export declaration cannot have modifiers." }, - Export_declarations_are_not_permitted_in_a_namespace: { code: 1194, category: ts.DiagnosticCategory.Error, key: "Export declarations are not permitted in a namespace." }, - Catch_clause_variable_name_must_be_an_identifier: { code: 1195, category: ts.DiagnosticCategory.Error, key: "Catch clause variable name must be an identifier." }, - Catch_clause_variable_cannot_have_a_type_annotation: { code: 1196, category: ts.DiagnosticCategory.Error, key: "Catch clause variable cannot have a type annotation." }, - Catch_clause_variable_cannot_have_an_initializer: { code: 1197, category: ts.DiagnosticCategory.Error, key: "Catch clause variable cannot have an initializer." }, - An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive: { code: 1198, category: ts.DiagnosticCategory.Error, key: "An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive." }, - Unterminated_Unicode_escape_sequence: { code: 1199, category: ts.DiagnosticCategory.Error, key: "Unterminated Unicode escape sequence." }, - Line_terminator_not_permitted_before_arrow: { code: 1200, category: ts.DiagnosticCategory.Error, key: "Line terminator not permitted before arrow." }, - Import_assignment_cannot_be_used_when_targeting_ECMAScript_6_or_higher_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_or_import_d_from_mod_instead: { code: 1202, category: ts.DiagnosticCategory.Error, key: "Import assignment cannot be used when targeting ECMAScript 6 or higher. Consider using 'import * as ns from \"mod\"', 'import {a} from \"mod\"' or 'import d from \"mod\"' instead." }, - Export_assignment_cannot_be_used_when_targeting_ECMAScript_6_or_higher_Consider_using_export_default_instead: { code: 1203, category: ts.DiagnosticCategory.Error, key: "Export assignment cannot be used when targeting ECMAScript 6 or higher. Consider using 'export default' instead." }, - Cannot_compile_modules_into_commonjs_amd_system_or_umd_when_targeting_ES6_or_higher: { code: 1204, category: ts.DiagnosticCategory.Error, key: "Cannot compile modules into 'commonjs', 'amd', 'system' or 'umd' when targeting 'ES6' or higher." }, - Decorators_are_only_available_when_targeting_ECMAScript_5_and_higher: { code: 1205, category: ts.DiagnosticCategory.Error, key: "Decorators are only available when targeting ECMAScript 5 and higher." }, - Decorators_are_not_valid_here: { code: 1206, category: ts.DiagnosticCategory.Error, key: "Decorators are not valid here." }, - Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name: { code: 1207, category: ts.DiagnosticCategory.Error, key: "Decorators cannot be applied to multiple get/set accessors of the same name." }, - Cannot_compile_namespaces_when_the_isolatedModules_flag_is_provided: { code: 1208, category: ts.DiagnosticCategory.Error, key: "Cannot compile namespaces when the '--isolatedModules' flag is provided." }, - Ambient_const_enums_are_not_allowed_when_the_isolatedModules_flag_is_provided: { code: 1209, category: ts.DiagnosticCategory.Error, key: "Ambient const enums are not allowed when the '--isolatedModules' flag is provided." }, - Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode: { code: 1210, category: ts.DiagnosticCategory.Error, key: "Invalid use of '{0}'. Class definitions are automatically in strict mode." }, - A_class_declaration_without_the_default_modifier_must_have_a_name: { code: 1211, category: ts.DiagnosticCategory.Error, key: "A class declaration without the 'default' modifier must have a name" }, - Identifier_expected_0_is_a_reserved_word_in_strict_mode: { code: 1212, category: ts.DiagnosticCategory.Error, key: "Identifier expected. '{0}' is a reserved word in strict mode" }, - Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode: { code: 1213, category: ts.DiagnosticCategory.Error, key: "Identifier expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode." }, - Type_expected_0_is_a_reserved_word_in_strict_mode: { code: 1215, category: ts.DiagnosticCategory.Error, key: "Type expected. '{0}' is a reserved word in strict mode" }, - Type_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode: { code: 1216, category: ts.DiagnosticCategory.Error, key: "Type expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode." }, - Export_assignment_is_not_supported_when_module_flag_is_system: { code: 1218, category: ts.DiagnosticCategory.Error, key: "Export assignment is not supported when '--module' flag is 'system'." }, - Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Specify_experimentalDecorators_to_remove_this_warning: { code: 1219, category: ts.DiagnosticCategory.Error, key: "Experimental support for decorators is a feature that is subject to change in a future release. Specify '--experimentalDecorators' to remove this warning." }, - Generators_are_only_available_when_targeting_ECMAScript_6_or_higher: { code: 1220, category: ts.DiagnosticCategory.Error, key: "Generators are only available when targeting ECMAScript 6 or higher." }, - Generators_are_not_allowed_in_an_ambient_context: { code: 1221, category: ts.DiagnosticCategory.Error, key: "Generators are not allowed in an ambient context." }, - An_overload_signature_cannot_be_declared_as_a_generator: { code: 1222, category: ts.DiagnosticCategory.Error, key: "An overload signature cannot be declared as a generator." }, - _0_tag_already_specified: { code: 1223, category: ts.DiagnosticCategory.Error, key: "'{0}' tag already specified." }, - Signature_0_must_have_a_type_predicate: { code: 1224, category: ts.DiagnosticCategory.Error, key: "Signature '{0}' must have a type predicate." }, - Cannot_find_parameter_0: { code: 1225, category: ts.DiagnosticCategory.Error, key: "Cannot find parameter '{0}'." }, - Type_predicate_0_is_not_assignable_to_1: { code: 1226, category: ts.DiagnosticCategory.Error, key: "Type predicate '{0}' is not assignable to '{1}'." }, - Parameter_0_is_not_in_the_same_position_as_parameter_1: { code: 1227, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' is not in the same position as parameter '{1}'." }, - A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods: { code: 1228, category: ts.DiagnosticCategory.Error, key: "A type predicate is only allowed in return type position for functions and methods." }, - A_type_predicate_cannot_reference_a_rest_parameter: { code: 1229, category: ts.DiagnosticCategory.Error, key: "A type predicate cannot reference a rest parameter." }, - A_type_predicate_cannot_reference_element_0_in_a_binding_pattern: { code: 1230, category: ts.DiagnosticCategory.Error, key: "A type predicate cannot reference element '{0}' in a binding pattern." }, - An_export_assignment_can_only_be_used_in_a_module: { code: 1231, category: ts.DiagnosticCategory.Error, key: "An export assignment can only be used in a module." }, - An_import_declaration_can_only_be_used_in_a_namespace_or_module: { code: 1232, category: ts.DiagnosticCategory.Error, key: "An import declaration can only be used in a namespace or module." }, - An_export_declaration_can_only_be_used_in_a_module: { code: 1233, category: ts.DiagnosticCategory.Error, key: "An export declaration can only be used in a module." }, - An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file: { code: 1234, category: ts.DiagnosticCategory.Error, key: "An ambient module declaration is only allowed at the top level in a file." }, - A_namespace_declaration_is_only_allowed_in_a_namespace_or_module: { code: 1235, category: ts.DiagnosticCategory.Error, key: "A namespace declaration is only allowed in a namespace or module." }, - Duplicate_identifier_0: { code: 2300, category: ts.DiagnosticCategory.Error, key: "Duplicate identifier '{0}'." }, - Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2301, category: ts.DiagnosticCategory.Error, key: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor." }, - Static_members_cannot_reference_class_type_parameters: { code: 2302, category: ts.DiagnosticCategory.Error, key: "Static members cannot reference class type parameters." }, - Circular_definition_of_import_alias_0: { code: 2303, category: ts.DiagnosticCategory.Error, key: "Circular definition of import alias '{0}'." }, - Cannot_find_name_0: { code: 2304, category: ts.DiagnosticCategory.Error, key: "Cannot find name '{0}'." }, - Module_0_has_no_exported_member_1: { code: 2305, category: ts.DiagnosticCategory.Error, key: "Module '{0}' has no exported member '{1}'." }, - File_0_is_not_a_module: { code: 2306, category: ts.DiagnosticCategory.Error, key: "File '{0}' is not a module." }, - Cannot_find_module_0: { code: 2307, category: ts.DiagnosticCategory.Error, key: "Cannot find module '{0}'." }, - A_module_cannot_have_more_than_one_export_assignment: { code: 2308, category: ts.DiagnosticCategory.Error, key: "A module cannot have more than one export assignment." }, - An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements: { code: 2309, category: ts.DiagnosticCategory.Error, key: "An export assignment cannot be used in a module with other exported elements." }, - Type_0_recursively_references_itself_as_a_base_type: { code: 2310, category: ts.DiagnosticCategory.Error, key: "Type '{0}' recursively references itself as a base type." }, - A_class_may_only_extend_another_class: { code: 2311, category: ts.DiagnosticCategory.Error, key: "A class may only extend another class." }, - An_interface_may_only_extend_a_class_or_another_interface: { code: 2312, category: ts.DiagnosticCategory.Error, key: "An interface may only extend a class or another interface." }, - Constraint_of_a_type_parameter_cannot_reference_any_type_parameter_from_the_same_type_parameter_list: { code: 2313, category: ts.DiagnosticCategory.Error, key: "Constraint of a type parameter cannot reference any type parameter from the same type parameter list." }, - Generic_type_0_requires_1_type_argument_s: { code: 2314, category: ts.DiagnosticCategory.Error, key: "Generic type '{0}' requires {1} type argument(s)." }, - Type_0_is_not_generic: { code: 2315, category: ts.DiagnosticCategory.Error, key: "Type '{0}' is not generic." }, - Global_type_0_must_be_a_class_or_interface_type: { code: 2316, category: ts.DiagnosticCategory.Error, key: "Global type '{0}' must be a class or interface type." }, - Global_type_0_must_have_1_type_parameter_s: { code: 2317, category: ts.DiagnosticCategory.Error, key: "Global type '{0}' must have {1} type parameter(s)." }, - Cannot_find_global_type_0: { code: 2318, category: ts.DiagnosticCategory.Error, key: "Cannot find global type '{0}'." }, - Named_property_0_of_types_1_and_2_are_not_identical: { code: 2319, category: ts.DiagnosticCategory.Error, key: "Named property '{0}' of types '{1}' and '{2}' are not identical." }, - Interface_0_cannot_simultaneously_extend_types_1_and_2: { code: 2320, category: ts.DiagnosticCategory.Error, key: "Interface '{0}' cannot simultaneously extend types '{1}' and '{2}'." }, - Excessive_stack_depth_comparing_types_0_and_1: { code: 2321, category: ts.DiagnosticCategory.Error, key: "Excessive stack depth comparing types '{0}' and '{1}'." }, - Type_0_is_not_assignable_to_type_1: { code: 2322, category: ts.DiagnosticCategory.Error, key: "Type '{0}' is not assignable to type '{1}'." }, - Property_0_is_missing_in_type_1: { code: 2324, category: ts.DiagnosticCategory.Error, key: "Property '{0}' is missing in type '{1}'." }, - Property_0_is_private_in_type_1_but_not_in_type_2: { code: 2325, category: ts.DiagnosticCategory.Error, key: "Property '{0}' is private in type '{1}' but not in type '{2}'." }, - Types_of_property_0_are_incompatible: { code: 2326, category: ts.DiagnosticCategory.Error, key: "Types of property '{0}' are incompatible." }, - Property_0_is_optional_in_type_1_but_required_in_type_2: { code: 2327, category: ts.DiagnosticCategory.Error, key: "Property '{0}' is optional in type '{1}' but required in type '{2}'." }, - Types_of_parameters_0_and_1_are_incompatible: { code: 2328, category: ts.DiagnosticCategory.Error, key: "Types of parameters '{0}' and '{1}' are incompatible." }, - Index_signature_is_missing_in_type_0: { code: 2329, category: ts.DiagnosticCategory.Error, key: "Index signature is missing in type '{0}'." }, - Index_signatures_are_incompatible: { code: 2330, category: ts.DiagnosticCategory.Error, key: "Index signatures are incompatible." }, - this_cannot_be_referenced_in_a_module_or_namespace_body: { code: 2331, category: ts.DiagnosticCategory.Error, key: "'this' cannot be referenced in a module or namespace body." }, - this_cannot_be_referenced_in_current_location: { code: 2332, category: ts.DiagnosticCategory.Error, key: "'this' cannot be referenced in current location." }, - this_cannot_be_referenced_in_constructor_arguments: { code: 2333, category: ts.DiagnosticCategory.Error, key: "'this' cannot be referenced in constructor arguments." }, - this_cannot_be_referenced_in_a_static_property_initializer: { code: 2334, category: ts.DiagnosticCategory.Error, key: "'this' cannot be referenced in a static property initializer." }, - super_can_only_be_referenced_in_a_derived_class: { code: 2335, category: ts.DiagnosticCategory.Error, key: "'super' can only be referenced in a derived class." }, - super_cannot_be_referenced_in_constructor_arguments: { code: 2336, category: ts.DiagnosticCategory.Error, key: "'super' cannot be referenced in constructor arguments." }, - Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors: { code: 2337, category: ts.DiagnosticCategory.Error, key: "Super calls are not permitted outside constructors or in nested functions inside constructors" }, - super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class: { code: 2338, category: ts.DiagnosticCategory.Error, key: "'super' property access is permitted only in a constructor, member function, or member accessor of a derived class" }, - Property_0_does_not_exist_on_type_1: { code: 2339, category: ts.DiagnosticCategory.Error, key: "Property '{0}' does not exist on type '{1}'." }, - Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword: { code: 2340, category: ts.DiagnosticCategory.Error, key: "Only public and protected methods of the base class are accessible via the 'super' keyword" }, - Property_0_is_private_and_only_accessible_within_class_1: { code: 2341, category: ts.DiagnosticCategory.Error, key: "Property '{0}' is private and only accessible within class '{1}'." }, - An_index_expression_argument_must_be_of_type_string_number_symbol_or_any: { code: 2342, category: ts.DiagnosticCategory.Error, key: "An index expression argument must be of type 'string', 'number', 'symbol, or 'any'." }, - Type_0_does_not_satisfy_the_constraint_1: { code: 2344, category: ts.DiagnosticCategory.Error, key: "Type '{0}' does not satisfy the constraint '{1}'." }, - Argument_of_type_0_is_not_assignable_to_parameter_of_type_1: { code: 2345, category: ts.DiagnosticCategory.Error, key: "Argument of type '{0}' is not assignable to parameter of type '{1}'." }, - Supplied_parameters_do_not_match_any_signature_of_call_target: { code: 2346, category: ts.DiagnosticCategory.Error, key: "Supplied parameters do not match any signature of call target." }, - Untyped_function_calls_may_not_accept_type_arguments: { code: 2347, category: ts.DiagnosticCategory.Error, key: "Untyped function calls may not accept type arguments." }, - Value_of_type_0_is_not_callable_Did_you_mean_to_include_new: { code: 2348, category: ts.DiagnosticCategory.Error, key: "Value of type '{0}' is not callable. Did you mean to include 'new'?" }, - Cannot_invoke_an_expression_whose_type_lacks_a_call_signature: { code: 2349, category: ts.DiagnosticCategory.Error, key: "Cannot invoke an expression whose type lacks a call signature." }, - Only_a_void_function_can_be_called_with_the_new_keyword: { code: 2350, category: ts.DiagnosticCategory.Error, key: "Only a void function can be called with the 'new' keyword." }, - Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature: { code: 2351, category: ts.DiagnosticCategory.Error, key: "Cannot use 'new' with an expression whose type lacks a call or construct signature." }, - Neither_type_0_nor_type_1_is_assignable_to_the_other: { code: 2352, category: ts.DiagnosticCategory.Error, key: "Neither type '{0}' nor type '{1}' is assignable to the other." }, - No_best_common_type_exists_among_return_expressions: { code: 2354, category: ts.DiagnosticCategory.Error, key: "No best common type exists among return expressions." }, - A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value_or_consist_of_a_single_throw_statement: { code: 2355, category: ts.DiagnosticCategory.Error, key: "A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement." }, - An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type: { code: 2356, category: ts.DiagnosticCategory.Error, key: "An arithmetic operand must be of type 'any', 'number' or an enum type." }, - The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer: { code: 2357, category: ts.DiagnosticCategory.Error, key: "The operand of an increment or decrement operator must be a variable, property or indexer." }, - The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2358, category: ts.DiagnosticCategory.Error, key: "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter." }, - The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type: { code: 2359, category: ts.DiagnosticCategory.Error, key: "The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type." }, - The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol: { code: 2360, category: ts.DiagnosticCategory.Error, key: "The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'." }, - The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2361, category: ts.DiagnosticCategory.Error, key: "The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter" }, - The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2362, category: ts.DiagnosticCategory.Error, key: "The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, - The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: { code: 2363, category: ts.DiagnosticCategory.Error, key: "The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type." }, - Invalid_left_hand_side_of_assignment_expression: { code: 2364, category: ts.DiagnosticCategory.Error, key: "Invalid left-hand side of assignment expression." }, - Operator_0_cannot_be_applied_to_types_1_and_2: { code: 2365, category: ts.DiagnosticCategory.Error, key: "Operator '{0}' cannot be applied to types '{1}' and '{2}'." }, - Type_parameter_name_cannot_be_0: { code: 2368, category: ts.DiagnosticCategory.Error, key: "Type parameter name cannot be '{0}'" }, - A_parameter_property_is_only_allowed_in_a_constructor_implementation: { code: 2369, category: ts.DiagnosticCategory.Error, key: "A parameter property is only allowed in a constructor implementation." }, - A_rest_parameter_must_be_of_an_array_type: { code: 2370, category: ts.DiagnosticCategory.Error, key: "A rest parameter must be of an array type." }, - A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation: { code: 2371, category: ts.DiagnosticCategory.Error, key: "A parameter initializer is only allowed in a function or constructor implementation." }, - Parameter_0_cannot_be_referenced_in_its_initializer: { code: 2372, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' cannot be referenced in its initializer." }, - Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it: { code: 2373, category: ts.DiagnosticCategory.Error, key: "Initializer of parameter '{0}' cannot reference identifier '{1}' declared after it." }, - Duplicate_string_index_signature: { code: 2374, category: ts.DiagnosticCategory.Error, key: "Duplicate string index signature." }, - Duplicate_number_index_signature: { code: 2375, category: ts.DiagnosticCategory.Error, key: "Duplicate number index signature." }, - A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_or_has_parameter_properties: { code: 2376, category: ts.DiagnosticCategory.Error, key: "A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties." }, - Constructors_for_derived_classes_must_contain_a_super_call: { code: 2377, category: ts.DiagnosticCategory.Error, key: "Constructors for derived classes must contain a 'super' call." }, - A_get_accessor_must_return_a_value_or_consist_of_a_single_throw_statement: { code: 2378, category: ts.DiagnosticCategory.Error, key: "A 'get' accessor must return a value or consist of a single 'throw' statement." }, - Getter_and_setter_accessors_do_not_agree_in_visibility: { code: 2379, category: ts.DiagnosticCategory.Error, key: "Getter and setter accessors do not agree in visibility." }, - get_and_set_accessor_must_have_the_same_type: { code: 2380, category: ts.DiagnosticCategory.Error, key: "'get' and 'set' accessor must have the same type." }, - A_signature_with_an_implementation_cannot_use_a_string_literal_type: { code: 2381, category: ts.DiagnosticCategory.Error, key: "A signature with an implementation cannot use a string literal type." }, - Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature: { code: 2382, category: ts.DiagnosticCategory.Error, key: "Specialized overload signature is not assignable to any non-specialized signature." }, - Overload_signatures_must_all_be_exported_or_not_exported: { code: 2383, category: ts.DiagnosticCategory.Error, key: "Overload signatures must all be exported or not exported." }, - Overload_signatures_must_all_be_ambient_or_non_ambient: { code: 2384, category: ts.DiagnosticCategory.Error, key: "Overload signatures must all be ambient or non-ambient." }, - Overload_signatures_must_all_be_public_private_or_protected: { code: 2385, category: ts.DiagnosticCategory.Error, key: "Overload signatures must all be public, private or protected." }, - Overload_signatures_must_all_be_optional_or_required: { code: 2386, category: ts.DiagnosticCategory.Error, key: "Overload signatures must all be optional or required." }, - Function_overload_must_be_static: { code: 2387, category: ts.DiagnosticCategory.Error, key: "Function overload must be static." }, - Function_overload_must_not_be_static: { code: 2388, category: ts.DiagnosticCategory.Error, key: "Function overload must not be static." }, - Function_implementation_name_must_be_0: { code: 2389, category: ts.DiagnosticCategory.Error, key: "Function implementation name must be '{0}'." }, - Constructor_implementation_is_missing: { code: 2390, category: ts.DiagnosticCategory.Error, key: "Constructor implementation is missing." }, - Function_implementation_is_missing_or_not_immediately_following_the_declaration: { code: 2391, category: ts.DiagnosticCategory.Error, key: "Function implementation is missing or not immediately following the declaration." }, - Multiple_constructor_implementations_are_not_allowed: { code: 2392, category: ts.DiagnosticCategory.Error, key: "Multiple constructor implementations are not allowed." }, - Duplicate_function_implementation: { code: 2393, category: ts.DiagnosticCategory.Error, key: "Duplicate function implementation." }, - Overload_signature_is_not_compatible_with_function_implementation: { code: 2394, category: ts.DiagnosticCategory.Error, key: "Overload signature is not compatible with function implementation." }, - Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local: { code: 2395, category: ts.DiagnosticCategory.Error, key: "Individual declarations in merged declaration {0} must be all exported or all local." }, - Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters: { code: 2396, category: ts.DiagnosticCategory.Error, key: "Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters." }, - Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference: { code: 2399, category: ts.DiagnosticCategory.Error, key: "Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference." }, - Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference: { code: 2400, category: ts.DiagnosticCategory.Error, key: "Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference." }, - Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference: { code: 2401, category: ts.DiagnosticCategory.Error, key: "Duplicate identifier '_super'. Compiler uses '_super' to capture base class reference." }, - Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference: { code: 2402, category: ts.DiagnosticCategory.Error, key: "Expression resolves to '_super' that compiler uses to capture base class reference." }, - Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2: { code: 2403, category: ts.DiagnosticCategory.Error, key: "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'." }, - The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation: { code: 2404, category: ts.DiagnosticCategory.Error, key: "The left-hand side of a 'for...in' statement cannot use a type annotation." }, - The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any: { code: 2405, category: ts.DiagnosticCategory.Error, key: "The left-hand side of a 'for...in' statement must be of type 'string' or 'any'." }, - Invalid_left_hand_side_in_for_in_statement: { code: 2406, category: ts.DiagnosticCategory.Error, key: "Invalid left-hand side in 'for...in' statement." }, - The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter: { code: 2407, category: ts.DiagnosticCategory.Error, key: "The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter." }, - Setters_cannot_return_a_value: { code: 2408, category: ts.DiagnosticCategory.Error, key: "Setters cannot return a value." }, - Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class: { code: 2409, category: ts.DiagnosticCategory.Error, key: "Return type of constructor signature must be assignable to the instance type of the class" }, - All_symbols_within_a_with_block_will_be_resolved_to_any: { code: 2410, category: ts.DiagnosticCategory.Error, key: "All symbols within a 'with' block will be resolved to 'any'." }, - Property_0_of_type_1_is_not_assignable_to_string_index_type_2: { code: 2411, category: ts.DiagnosticCategory.Error, key: "Property '{0}' of type '{1}' is not assignable to string index type '{2}'." }, - Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2: { code: 2412, category: ts.DiagnosticCategory.Error, key: "Property '{0}' of type '{1}' is not assignable to numeric index type '{2}'." }, - Numeric_index_type_0_is_not_assignable_to_string_index_type_1: { code: 2413, category: ts.DiagnosticCategory.Error, key: "Numeric index type '{0}' is not assignable to string index type '{1}'." }, - Class_name_cannot_be_0: { code: 2414, category: ts.DiagnosticCategory.Error, key: "Class name cannot be '{0}'" }, - Class_0_incorrectly_extends_base_class_1: { code: 2415, category: ts.DiagnosticCategory.Error, key: "Class '{0}' incorrectly extends base class '{1}'." }, - Class_static_side_0_incorrectly_extends_base_class_static_side_1: { code: 2417, category: ts.DiagnosticCategory.Error, key: "Class static side '{0}' incorrectly extends base class static side '{1}'." }, - Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0: { code: 2419, category: ts.DiagnosticCategory.Error, key: "Type name '{0}' in extends clause does not reference constructor function for '{0}'." }, - Class_0_incorrectly_implements_interface_1: { code: 2420, category: ts.DiagnosticCategory.Error, key: "Class '{0}' incorrectly implements interface '{1}'." }, - A_class_may_only_implement_another_class_or_interface: { code: 2422, category: ts.DiagnosticCategory.Error, key: "A class may only implement another class or interface." }, - Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: { code: 2423, category: ts.DiagnosticCategory.Error, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member accessor." }, - Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property: { code: 2424, category: ts.DiagnosticCategory.Error, key: "Class '{0}' defines instance member function '{1}', but extended class '{2}' defines it as instance member property." }, - Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 2425, category: ts.DiagnosticCategory.Error, key: "Class '{0}' defines instance member property '{1}', but extended class '{2}' defines it as instance member function." }, - Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function: { code: 2426, category: ts.DiagnosticCategory.Error, key: "Class '{0}' defines instance member accessor '{1}', but extended class '{2}' defines it as instance member function." }, - Interface_name_cannot_be_0: { code: 2427, category: ts.DiagnosticCategory.Error, key: "Interface name cannot be '{0}'" }, - All_declarations_of_an_interface_must_have_identical_type_parameters: { code: 2428, category: ts.DiagnosticCategory.Error, key: "All declarations of an interface must have identical type parameters." }, - Interface_0_incorrectly_extends_interface_1: { code: 2430, category: ts.DiagnosticCategory.Error, key: "Interface '{0}' incorrectly extends interface '{1}'." }, - Enum_name_cannot_be_0: { code: 2431, category: ts.DiagnosticCategory.Error, key: "Enum name cannot be '{0}'" }, - In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element: { code: 2432, category: ts.DiagnosticCategory.Error, key: "In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element." }, - A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged: { code: 2433, category: ts.DiagnosticCategory.Error, key: "A namespace declaration cannot be in a different file from a class or function with which it is merged" }, - A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged: { code: 2434, category: ts.DiagnosticCategory.Error, key: "A namespace declaration cannot be located prior to a class or function with which it is merged" }, - Ambient_modules_cannot_be_nested_in_other_modules: { code: 2435, category: ts.DiagnosticCategory.Error, key: "Ambient modules cannot be nested in other modules." }, - Ambient_module_declaration_cannot_specify_relative_module_name: { code: 2436, category: ts.DiagnosticCategory.Error, key: "Ambient module declaration cannot specify relative module name." }, - Module_0_is_hidden_by_a_local_declaration_with_the_same_name: { code: 2437, category: ts.DiagnosticCategory.Error, key: "Module '{0}' is hidden by a local declaration with the same name" }, - Import_name_cannot_be_0: { code: 2438, category: ts.DiagnosticCategory.Error, key: "Import name cannot be '{0}'" }, - Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relative_module_name: { code: 2439, category: ts.DiagnosticCategory.Error, key: "Import or export declaration in an ambient module declaration cannot reference module through relative module name." }, - Import_declaration_conflicts_with_local_declaration_of_0: { code: 2440, category: ts.DiagnosticCategory.Error, key: "Import declaration conflicts with local declaration of '{0}'" }, - Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module: { code: 2441, category: ts.DiagnosticCategory.Error, key: "Duplicate identifier '{0}'. Compiler reserves name '{1}' in top level scope of a module." }, - Types_have_separate_declarations_of_a_private_property_0: { code: 2442, category: ts.DiagnosticCategory.Error, key: "Types have separate declarations of a private property '{0}'." }, - Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2: { code: 2443, category: ts.DiagnosticCategory.Error, key: "Property '{0}' is protected but type '{1}' is not a class derived from '{2}'." }, - Property_0_is_protected_in_type_1_but_public_in_type_2: { code: 2444, category: ts.DiagnosticCategory.Error, key: "Property '{0}' is protected in type '{1}' but public in type '{2}'." }, - Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses: { code: 2445, category: ts.DiagnosticCategory.Error, key: "Property '{0}' is protected and only accessible within class '{1}' and its subclasses." }, - Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1: { code: 2446, category: ts.DiagnosticCategory.Error, key: "Property '{0}' is protected and only accessible through an instance of class '{1}'." }, - The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead: { code: 2447, category: ts.DiagnosticCategory.Error, key: "The '{0}' operator is not allowed for boolean types. Consider using '{1}' instead." }, - Block_scoped_variable_0_used_before_its_declaration: { code: 2448, category: ts.DiagnosticCategory.Error, key: "Block-scoped variable '{0}' used before its declaration." }, - The_operand_of_an_increment_or_decrement_operator_cannot_be_a_constant: { code: 2449, category: ts.DiagnosticCategory.Error, key: "The operand of an increment or decrement operator cannot be a constant." }, - Left_hand_side_of_assignment_expression_cannot_be_a_constant: { code: 2450, category: ts.DiagnosticCategory.Error, key: "Left-hand side of assignment expression cannot be a constant." }, - Cannot_redeclare_block_scoped_variable_0: { code: 2451, category: ts.DiagnosticCategory.Error, key: "Cannot redeclare block-scoped variable '{0}'." }, - An_enum_member_cannot_have_a_numeric_name: { code: 2452, category: ts.DiagnosticCategory.Error, key: "An enum member cannot have a numeric name." }, - The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_type_arguments_explicitly: { code: 2453, category: ts.DiagnosticCategory.Error, key: "The type argument for type parameter '{0}' cannot be inferred from the usage. Consider specifying the type arguments explicitly." }, - Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0: { code: 2455, category: ts.DiagnosticCategory.Error, key: "Type argument candidate '{1}' is not a valid type argument because it is not a supertype of candidate '{0}'." }, - Type_alias_0_circularly_references_itself: { code: 2456, category: ts.DiagnosticCategory.Error, key: "Type alias '{0}' circularly references itself." }, - Type_alias_name_cannot_be_0: { code: 2457, category: ts.DiagnosticCategory.Error, key: "Type alias name cannot be '{0}'" }, - An_AMD_module_cannot_have_multiple_name_assignments: { code: 2458, category: ts.DiagnosticCategory.Error, key: "An AMD module cannot have multiple name assignments." }, - Type_0_has_no_property_1_and_no_string_index_signature: { code: 2459, category: ts.DiagnosticCategory.Error, key: "Type '{0}' has no property '{1}' and no string index signature." }, - Type_0_has_no_property_1: { code: 2460, category: ts.DiagnosticCategory.Error, key: "Type '{0}' has no property '{1}'." }, - Type_0_is_not_an_array_type: { code: 2461, category: ts.DiagnosticCategory.Error, key: "Type '{0}' is not an array type." }, - A_rest_element_must_be_last_in_an_array_destructuring_pattern: { code: 2462, category: ts.DiagnosticCategory.Error, key: "A rest element must be last in an array destructuring pattern" }, - A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature: { code: 2463, category: ts.DiagnosticCategory.Error, key: "A binding pattern parameter cannot be optional in an implementation signature." }, - A_computed_property_name_must_be_of_type_string_number_symbol_or_any: { code: 2464, category: ts.DiagnosticCategory.Error, key: "A computed property name must be of type 'string', 'number', 'symbol', or 'any'." }, - this_cannot_be_referenced_in_a_computed_property_name: { code: 2465, category: ts.DiagnosticCategory.Error, key: "'this' cannot be referenced in a computed property name." }, - super_cannot_be_referenced_in_a_computed_property_name: { code: 2466, category: ts.DiagnosticCategory.Error, key: "'super' cannot be referenced in a computed property name." }, - A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type: { code: 2467, category: ts.DiagnosticCategory.Error, key: "A computed property name cannot reference a type parameter from its containing type." }, - Cannot_find_global_value_0: { code: 2468, category: ts.DiagnosticCategory.Error, key: "Cannot find global value '{0}'." }, - The_0_operator_cannot_be_applied_to_type_symbol: { code: 2469, category: ts.DiagnosticCategory.Error, key: "The '{0}' operator cannot be applied to type 'symbol'." }, - Symbol_reference_does_not_refer_to_the_global_Symbol_constructor_object: { code: 2470, category: ts.DiagnosticCategory.Error, key: "'Symbol' reference does not refer to the global Symbol constructor object." }, - A_computed_property_name_of_the_form_0_must_be_of_type_symbol: { code: 2471, category: ts.DiagnosticCategory.Error, key: "A computed property name of the form '{0}' must be of type 'symbol'." }, - Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher: { code: 2472, category: ts.DiagnosticCategory.Error, key: "Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher." }, - Enum_declarations_must_all_be_const_or_non_const: { code: 2473, category: ts.DiagnosticCategory.Error, key: "Enum declarations must all be const or non-const." }, - In_const_enum_declarations_member_initializer_must_be_constant_expression: { code: 2474, category: ts.DiagnosticCategory.Error, key: "In 'const' enum declarations member initializer must be constant expression." }, - const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment: { code: 2475, category: ts.DiagnosticCategory.Error, key: "'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment." }, - A_const_enum_member_can_only_be_accessed_using_a_string_literal: { code: 2476, category: ts.DiagnosticCategory.Error, key: "A const enum member can only be accessed using a string literal." }, - const_enum_member_initializer_was_evaluated_to_a_non_finite_value: { code: 2477, category: ts.DiagnosticCategory.Error, key: "'const' enum member initializer was evaluated to a non-finite value." }, - const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN: { code: 2478, category: ts.DiagnosticCategory.Error, key: "'const' enum member initializer was evaluated to disallowed value 'NaN'." }, - Property_0_does_not_exist_on_const_enum_1: { code: 2479, category: ts.DiagnosticCategory.Error, key: "Property '{0}' does not exist on 'const' enum '{1}'." }, - let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations: { code: 2480, category: ts.DiagnosticCategory.Error, key: "'let' is not allowed to be used as a name in 'let' or 'const' declarations." }, - Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1: { code: 2481, category: ts.DiagnosticCategory.Error, key: "Cannot initialize outer scoped variable '{0}' in the same scope as block scoped declaration '{1}'." }, - The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation: { code: 2483, category: ts.DiagnosticCategory.Error, key: "The left-hand side of a 'for...of' statement cannot use a type annotation." }, - Export_declaration_conflicts_with_exported_declaration_of_0: { code: 2484, category: ts.DiagnosticCategory.Error, key: "Export declaration conflicts with exported declaration of '{0}'" }, - The_left_hand_side_of_a_for_of_statement_cannot_be_a_previously_defined_constant: { code: 2485, category: ts.DiagnosticCategory.Error, key: "The left-hand side of a 'for...of' statement cannot be a previously defined constant." }, - The_left_hand_side_of_a_for_in_statement_cannot_be_a_previously_defined_constant: { code: 2486, category: ts.DiagnosticCategory.Error, key: "The left-hand side of a 'for...in' statement cannot be a previously defined constant." }, - Invalid_left_hand_side_in_for_of_statement: { code: 2487, category: ts.DiagnosticCategory.Error, key: "Invalid left-hand side in 'for...of' statement." }, - Type_must_have_a_Symbol_iterator_method_that_returns_an_iterator: { code: 2488, category: ts.DiagnosticCategory.Error, key: "Type must have a '[Symbol.iterator]()' method that returns an iterator." }, - An_iterator_must_have_a_next_method: { code: 2489, category: ts.DiagnosticCategory.Error, key: "An iterator must have a 'next()' method." }, - The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property: { code: 2490, category: ts.DiagnosticCategory.Error, key: "The type returned by the 'next()' method of an iterator must have a 'value' property." }, - The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern: { code: 2491, category: ts.DiagnosticCategory.Error, key: "The left-hand side of a 'for...in' statement cannot be a destructuring pattern." }, - Cannot_redeclare_identifier_0_in_catch_clause: { code: 2492, category: ts.DiagnosticCategory.Error, key: "Cannot redeclare identifier '{0}' in catch clause" }, - Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2: { code: 2493, category: ts.DiagnosticCategory.Error, key: "Tuple type '{0}' with length '{1}' cannot be assigned to tuple with length '{2}'." }, - Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher: { code: 2494, category: ts.DiagnosticCategory.Error, key: "Using a string in a 'for...of' statement is only supported in ECMAScript 5 and higher." }, - Type_0_is_not_an_array_type_or_a_string_type: { code: 2495, category: ts.DiagnosticCategory.Error, key: "Type '{0}' is not an array type or a string type." }, - The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression: { code: 2496, category: ts.DiagnosticCategory.Error, key: "The 'arguments' object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression." }, - Module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct: { code: 2497, category: ts.DiagnosticCategory.Error, key: "Module '{0}' resolves to a non-module entity and cannot be imported using this construct." }, - Module_0_uses_export_and_cannot_be_used_with_export_Asterisk: { code: 2498, category: ts.DiagnosticCategory.Error, key: "Module '{0}' uses 'export =' and cannot be used with 'export *'." }, - An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments: { code: 2499, category: ts.DiagnosticCategory.Error, key: "An interface can only extend an identifier/qualified-name with optional type arguments." }, - A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments: { code: 2500, category: ts.DiagnosticCategory.Error, key: "A class can only implement an identifier/qualified-name with optional type arguments." }, - A_rest_element_cannot_contain_a_binding_pattern: { code: 2501, category: ts.DiagnosticCategory.Error, key: "A rest element cannot contain a binding pattern." }, - _0_is_referenced_directly_or_indirectly_in_its_own_type_annotation: { code: 2502, category: ts.DiagnosticCategory.Error, key: "'{0}' is referenced directly or indirectly in its own type annotation." }, - Cannot_find_namespace_0: { code: 2503, category: ts.DiagnosticCategory.Error, key: "Cannot find namespace '{0}'." }, - No_best_common_type_exists_among_yield_expressions: { code: 2504, category: ts.DiagnosticCategory.Error, key: "No best common type exists among yield expressions." }, - A_generator_cannot_have_a_void_type_annotation: { code: 2505, category: ts.DiagnosticCategory.Error, key: "A generator cannot have a 'void' type annotation." }, - Import_declaration_0_is_using_private_name_1: { code: 4000, category: ts.DiagnosticCategory.Error, key: "Import declaration '{0}' is using private name '{1}'." }, - Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { code: 4002, category: ts.DiagnosticCategory.Error, key: "Type parameter '{0}' of exported class has or is using private name '{1}'." }, - Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: { code: 4004, category: ts.DiagnosticCategory.Error, key: "Type parameter '{0}' of exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4006, category: ts.DiagnosticCategory.Error, key: "Type parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4008, category: ts.DiagnosticCategory.Error, key: "Type parameter '{0}' of call signature from exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: { code: 4010, category: ts.DiagnosticCategory.Error, key: "Type parameter '{0}' of public static method from exported class has or is using private name '{1}'." }, - Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: { code: 4012, category: ts.DiagnosticCategory.Error, key: "Type parameter '{0}' of public method from exported class has or is using private name '{1}'." }, - Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: { code: 4014, category: ts.DiagnosticCategory.Error, key: "Type parameter '{0}' of method from exported interface has or is using private name '{1}'." }, - Type_parameter_0_of_exported_function_has_or_is_using_private_name_1: { code: 4016, category: ts.DiagnosticCategory.Error, key: "Type parameter '{0}' of exported function has or is using private name '{1}'." }, - Implements_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4019, category: ts.DiagnosticCategory.Error, key: "Implements clause of exported class '{0}' has or is using private name '{1}'." }, - Extends_clause_of_exported_class_0_has_or_is_using_private_name_1: { code: 4020, category: ts.DiagnosticCategory.Error, key: "Extends clause of exported class '{0}' has or is using private name '{1}'." }, - Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1: { code: 4022, category: ts.DiagnosticCategory.Error, key: "Extends clause of exported interface '{0}' has or is using private name '{1}'." }, - Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4023, category: ts.DiagnosticCategory.Error, key: "Exported variable '{0}' has or is using name '{1}' from external module {2} but cannot be named." }, - Exported_variable_0_has_or_is_using_name_1_from_private_module_2: { code: 4024, category: ts.DiagnosticCategory.Error, key: "Exported variable '{0}' has or is using name '{1}' from private module '{2}'." }, - Exported_variable_0_has_or_is_using_private_name_1: { code: 4025, category: ts.DiagnosticCategory.Error, key: "Exported variable '{0}' has or is using private name '{1}'." }, - Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4026, category: ts.DiagnosticCategory.Error, key: "Public static property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4027, category: ts.DiagnosticCategory.Error, key: "Public static property '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, - Public_static_property_0_of_exported_class_has_or_is_using_private_name_1: { code: 4028, category: ts.DiagnosticCategory.Error, key: "Public static property '{0}' of exported class has or is using private name '{1}'." }, - Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4029, category: ts.DiagnosticCategory.Error, key: "Public property '{0}' of exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4030, category: ts.DiagnosticCategory.Error, key: "Public property '{0}' of exported class has or is using name '{1}' from private module '{2}'." }, - Public_property_0_of_exported_class_has_or_is_using_private_name_1: { code: 4031, category: ts.DiagnosticCategory.Error, key: "Public property '{0}' of exported class has or is using private name '{1}'." }, - Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4032, category: ts.DiagnosticCategory.Error, key: "Property '{0}' of exported interface has or is using name '{1}' from private module '{2}'." }, - Property_0_of_exported_interface_has_or_is_using_private_name_1: { code: 4033, category: ts.DiagnosticCategory.Error, key: "Property '{0}' of exported interface has or is using private name '{1}'." }, - Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4034, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of public static property setter from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_private_name_1: { code: 4035, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of public static property setter from exported class has or is using private name '{1}'." }, - Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4036, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of public property setter from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_private_name_1: { code: 4037, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of public property setter from exported class has or is using private name '{1}'." }, - Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4038, category: ts.DiagnosticCategory.Error, key: "Return type of public static property getter from exported class has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4039, category: ts.DiagnosticCategory.Error, key: "Return type of public static property getter from exported class has or is using name '{0}' from private module '{1}'." }, - Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_private_name_0: { code: 4040, category: ts.DiagnosticCategory.Error, key: "Return type of public static property getter from exported class has or is using private name '{0}'." }, - Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4041, category: ts.DiagnosticCategory.Error, key: "Return type of public property getter from exported class has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4042, category: ts.DiagnosticCategory.Error, key: "Return type of public property getter from exported class has or is using name '{0}' from private module '{1}'." }, - Return_type_of_public_property_getter_from_exported_class_has_or_is_using_private_name_0: { code: 4043, category: ts.DiagnosticCategory.Error, key: "Return type of public property getter from exported class has or is using private name '{0}'." }, - Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4044, category: ts.DiagnosticCategory.Error, key: "Return type of constructor signature from exported interface has or is using name '{0}' from private module '{1}'." }, - Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 4045, category: ts.DiagnosticCategory.Error, key: "Return type of constructor signature from exported interface has or is using private name '{0}'." }, - Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4046, category: ts.DiagnosticCategory.Error, key: "Return type of call signature from exported interface has or is using name '{0}' from private module '{1}'." }, - Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 4047, category: ts.DiagnosticCategory.Error, key: "Return type of call signature from exported interface has or is using private name '{0}'." }, - Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4048, category: ts.DiagnosticCategory.Error, key: "Return type of index signature from exported interface has or is using name '{0}' from private module '{1}'." }, - Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0: { code: 4049, category: ts.DiagnosticCategory.Error, key: "Return type of index signature from exported interface has or is using private name '{0}'." }, - Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4050, category: ts.DiagnosticCategory.Error, key: "Return type of public static method from exported class has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4051, category: ts.DiagnosticCategory.Error, key: "Return type of public static method from exported class has or is using name '{0}' from private module '{1}'." }, - Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0: { code: 4052, category: ts.DiagnosticCategory.Error, key: "Return type of public static method from exported class has or is using private name '{0}'." }, - Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4053, category: ts.DiagnosticCategory.Error, key: "Return type of public method from exported class has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: { code: 4054, category: ts.DiagnosticCategory.Error, key: "Return type of public method from exported class has or is using name '{0}' from private module '{1}'." }, - Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0: { code: 4055, category: ts.DiagnosticCategory.Error, key: "Return type of public method from exported class has or is using private name '{0}'." }, - Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1: { code: 4056, category: ts.DiagnosticCategory.Error, key: "Return type of method from exported interface has or is using name '{0}' from private module '{1}'." }, - Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0: { code: 4057, category: ts.DiagnosticCategory.Error, key: "Return type of method from exported interface has or is using private name '{0}'." }, - Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: { code: 4058, category: ts.DiagnosticCategory.Error, key: "Return type of exported function has or is using name '{0}' from external module {1} but cannot be named." }, - Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1: { code: 4059, category: ts.DiagnosticCategory.Error, key: "Return type of exported function has or is using name '{0}' from private module '{1}'." }, - Return_type_of_exported_function_has_or_is_using_private_name_0: { code: 4060, category: ts.DiagnosticCategory.Error, key: "Return type of exported function has or is using private name '{0}'." }, - Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4061, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of constructor from exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4062, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of constructor from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1: { code: 4063, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of constructor from exported class has or is using private name '{1}'." }, - Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4064, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of constructor signature from exported interface has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4065, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of constructor signature from exported interface has or is using private name '{1}'." }, - Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4066, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of call signature from exported interface has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: { code: 4067, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of call signature from exported interface has or is using private name '{1}'." }, - Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4068, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of public static method from exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4069, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of public static method from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: { code: 4070, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of public static method from exported class has or is using private name '{1}'." }, - Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4071, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of public method from exported class has or is using name '{1}' from external module {2} but cannot be named." }, - Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4072, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of public method from exported class has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: { code: 4073, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of public method from exported class has or is using private name '{1}'." }, - Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2: { code: 4074, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of method from exported interface has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: { code: 4075, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of method from exported interface has or is using private name '{1}'." }, - Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: { code: 4076, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of exported function has or is using name '{1}' from external module {2} but cannot be named." }, - Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2: { code: 4077, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of exported function has or is using name '{1}' from private module '{2}'." }, - Parameter_0_of_exported_function_has_or_is_using_private_name_1: { code: 4078, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' of exported function has or is using private name '{1}'." }, - Exported_type_alias_0_has_or_is_using_private_name_1: { code: 4081, category: ts.DiagnosticCategory.Error, key: "Exported type alias '{0}' has or is using private name '{1}'." }, - Default_export_of_the_module_has_or_is_using_private_name_0: { code: 4082, category: ts.DiagnosticCategory.Error, key: "Default export of the module has or is using private name '{0}'." }, - Loop_contains_block_scoped_variable_0_referenced_by_a_function_in_the_loop_This_is_only_supported_in_ECMAScript_6_or_higher: { code: 4091, category: ts.DiagnosticCategory.Error, key: "Loop contains block-scoped variable '{0}' referenced by a function in the loop. This is only supported in ECMAScript 6 or higher." }, - The_current_host_does_not_support_the_0_option: { code: 5001, category: ts.DiagnosticCategory.Error, key: "The current host does not support the '{0}' option." }, - Cannot_find_the_common_subdirectory_path_for_the_input_files: { code: 5009, category: ts.DiagnosticCategory.Error, key: "Cannot find the common subdirectory path for the input files." }, - Cannot_read_file_0_Colon_1: { code: 5012, category: ts.DiagnosticCategory.Error, key: "Cannot read file '{0}': {1}" }, - Unsupported_file_encoding: { code: 5013, category: ts.DiagnosticCategory.Error, key: "Unsupported file encoding." }, - Failed_to_parse_file_0_Colon_1: { code: 5014, category: ts.DiagnosticCategory.Error, key: "Failed to parse file '{0}': {1}." }, - Unknown_compiler_option_0: { code: 5023, category: ts.DiagnosticCategory.Error, key: "Unknown compiler option '{0}'." }, - Compiler_option_0_requires_a_value_of_type_1: { code: 5024, category: ts.DiagnosticCategory.Error, key: "Compiler option '{0}' requires a value of type {1}." }, - Could_not_write_file_0_Colon_1: { code: 5033, category: ts.DiagnosticCategory.Error, key: "Could not write file '{0}': {1}" }, - Option_mapRoot_cannot_be_specified_without_specifying_sourceMap_option: { code: 5038, category: ts.DiagnosticCategory.Error, key: "Option 'mapRoot' cannot be specified without specifying 'sourceMap' option." }, - Option_sourceRoot_cannot_be_specified_without_specifying_sourceMap_option: { code: 5039, category: ts.DiagnosticCategory.Error, key: "Option 'sourceRoot' cannot be specified without specifying 'sourceMap' option." }, - Option_noEmit_cannot_be_specified_with_option_out_or_outDir: { code: 5040, category: ts.DiagnosticCategory.Error, key: "Option 'noEmit' cannot be specified with option 'out' or 'outDir'." }, - Option_noEmit_cannot_be_specified_with_option_declaration: { code: 5041, category: ts.DiagnosticCategory.Error, key: "Option 'noEmit' cannot be specified with option 'declaration'." }, - Option_project_cannot_be_mixed_with_source_files_on_a_command_line: { code: 5042, category: ts.DiagnosticCategory.Error, key: "Option 'project' cannot be mixed with source files on a command line." }, - Option_sourceMap_cannot_be_specified_with_option_isolatedModules: { code: 5043, category: ts.DiagnosticCategory.Error, key: "Option 'sourceMap' cannot be specified with option 'isolatedModules'." }, - Option_declaration_cannot_be_specified_with_option_isolatedModules: { code: 5044, category: ts.DiagnosticCategory.Error, key: "Option 'declaration' cannot be specified with option 'isolatedModules'." }, - Option_noEmitOnError_cannot_be_specified_with_option_isolatedModules: { code: 5045, category: ts.DiagnosticCategory.Error, key: "Option 'noEmitOnError' cannot be specified with option 'isolatedModules'." }, - Option_out_cannot_be_specified_with_option_isolatedModules: { code: 5046, category: ts.DiagnosticCategory.Error, key: "Option 'out' cannot be specified with option 'isolatedModules'." }, - Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES6_or_higher: { code: 5047, category: ts.DiagnosticCategory.Error, key: "Option 'isolatedModules' can only be used when either option'--module' is provided or option 'target' is 'ES6' or higher." }, - Option_sourceMap_cannot_be_specified_with_option_inlineSourceMap: { code: 5048, category: ts.DiagnosticCategory.Error, key: "Option 'sourceMap' cannot be specified with option 'inlineSourceMap'." }, - Option_sourceRoot_cannot_be_specified_with_option_inlineSourceMap: { code: 5049, category: ts.DiagnosticCategory.Error, key: "Option 'sourceRoot' cannot be specified with option 'inlineSourceMap'." }, - Option_mapRoot_cannot_be_specified_with_option_inlineSourceMap: { code: 5050, category: ts.DiagnosticCategory.Error, key: "Option 'mapRoot' cannot be specified with option 'inlineSourceMap'." }, - Option_inlineSources_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided: { code: 5051, category: ts.DiagnosticCategory.Error, key: "Option 'inlineSources' can only be used when either option '--inlineSourceMap' or option '--sourceMap' is provided." }, - Concatenate_and_emit_output_to_single_file: { code: 6001, category: ts.DiagnosticCategory.Message, key: "Concatenate and emit output to single file." }, - Generates_corresponding_d_ts_file: { code: 6002, category: ts.DiagnosticCategory.Message, key: "Generates corresponding '.d.ts' file." }, - Specifies_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations: { code: 6003, category: ts.DiagnosticCategory.Message, key: "Specifies the location where debugger should locate map files instead of generated locations." }, - Specifies_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations: { code: 6004, category: ts.DiagnosticCategory.Message, key: "Specifies the location where debugger should locate TypeScript files instead of source locations." }, - Watch_input_files: { code: 6005, category: ts.DiagnosticCategory.Message, key: "Watch input files." }, - Redirect_output_structure_to_the_directory: { code: 6006, category: ts.DiagnosticCategory.Message, key: "Redirect output structure to the directory." }, - Do_not_erase_const_enum_declarations_in_generated_code: { code: 6007, category: ts.DiagnosticCategory.Message, key: "Do not erase const enum declarations in generated code." }, - Do_not_emit_outputs_if_any_errors_were_reported: { code: 6008, category: ts.DiagnosticCategory.Message, key: "Do not emit outputs if any errors were reported." }, - Do_not_emit_comments_to_output: { code: 6009, category: ts.DiagnosticCategory.Message, key: "Do not emit comments to output." }, - Do_not_emit_outputs: { code: 6010, category: ts.DiagnosticCategory.Message, key: "Do not emit outputs." }, - Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES6_experimental: { code: 6015, category: ts.DiagnosticCategory.Message, key: "Specify ECMAScript target version: 'ES3' (default), 'ES5', or 'ES6' (experimental)" }, - Specify_module_code_generation_Colon_commonjs_amd_system_or_umd: { code: 6016, category: ts.DiagnosticCategory.Message, key: "Specify module code generation: 'commonjs', 'amd', 'system' or 'umd'" }, - Print_this_message: { code: 6017, category: ts.DiagnosticCategory.Message, key: "Print this message." }, - Print_the_compiler_s_version: { code: 6019, category: ts.DiagnosticCategory.Message, key: "Print the compiler's version." }, - Compile_the_project_in_the_given_directory: { code: 6020, category: ts.DiagnosticCategory.Message, key: "Compile the project in the given directory." }, - Syntax_Colon_0: { code: 6023, category: ts.DiagnosticCategory.Message, key: "Syntax: {0}" }, - options: { code: 6024, category: ts.DiagnosticCategory.Message, key: "options" }, - file: { code: 6025, category: ts.DiagnosticCategory.Message, key: "file" }, - Examples_Colon_0: { code: 6026, category: ts.DiagnosticCategory.Message, key: "Examples: {0}" }, - Options_Colon: { code: 6027, category: ts.DiagnosticCategory.Message, key: "Options:" }, - Version_0: { code: 6029, category: ts.DiagnosticCategory.Message, key: "Version {0}" }, - Insert_command_line_options_and_files_from_a_file: { code: 6030, category: ts.DiagnosticCategory.Message, key: "Insert command line options and files from a file." }, - File_change_detected_Starting_incremental_compilation: { code: 6032, category: ts.DiagnosticCategory.Message, key: "File change detected. Starting incremental compilation..." }, - KIND: { code: 6034, category: ts.DiagnosticCategory.Message, key: "KIND" }, - FILE: { code: 6035, category: ts.DiagnosticCategory.Message, key: "FILE" }, - VERSION: { code: 6036, category: ts.DiagnosticCategory.Message, key: "VERSION" }, - LOCATION: { code: 6037, category: ts.DiagnosticCategory.Message, key: "LOCATION" }, - DIRECTORY: { code: 6038, category: ts.DiagnosticCategory.Message, key: "DIRECTORY" }, - Compilation_complete_Watching_for_file_changes: { code: 6042, category: ts.DiagnosticCategory.Message, key: "Compilation complete. Watching for file changes." }, - Generates_corresponding_map_file: { code: 6043, category: ts.DiagnosticCategory.Message, key: "Generates corresponding '.map' file." }, - Compiler_option_0_expects_an_argument: { code: 6044, category: ts.DiagnosticCategory.Error, key: "Compiler option '{0}' expects an argument." }, - Unterminated_quoted_string_in_response_file_0: { code: 6045, category: ts.DiagnosticCategory.Error, key: "Unterminated quoted string in response file '{0}'." }, - Argument_for_module_option_must_be_commonjs_amd_system_or_umd: { code: 6046, category: ts.DiagnosticCategory.Error, key: "Argument for '--module' option must be 'commonjs', 'amd', 'system' or 'umd'." }, - Argument_for_target_option_must_be_ES3_ES5_or_ES6: { code: 6047, category: ts.DiagnosticCategory.Error, key: "Argument for '--target' option must be 'ES3', 'ES5', or 'ES6'." }, - Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1: { code: 6048, category: ts.DiagnosticCategory.Error, key: "Locale must be of the form or -. For example '{0}' or '{1}'." }, - Unsupported_locale_0: { code: 6049, category: ts.DiagnosticCategory.Error, key: "Unsupported locale '{0}'." }, - Unable_to_open_file_0: { code: 6050, category: ts.DiagnosticCategory.Error, key: "Unable to open file '{0}'." }, - Corrupted_locale_file_0: { code: 6051, category: ts.DiagnosticCategory.Error, key: "Corrupted locale file {0}." }, - Raise_error_on_expressions_and_declarations_with_an_implied_any_type: { code: 6052, category: ts.DiagnosticCategory.Message, key: "Raise error on expressions and declarations with an implied 'any' type." }, - File_0_not_found: { code: 6053, category: ts.DiagnosticCategory.Error, key: "File '{0}' not found." }, - File_0_has_unsupported_extension_The_only_supported_extensions_are_1: { code: 6054, category: ts.DiagnosticCategory.Error, key: "File '{0}' has unsupported extension. The only supported extensions are {1}." }, - Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures: { code: 6055, category: ts.DiagnosticCategory.Message, key: "Suppress noImplicitAny errors for indexing objects lacking index signatures." }, - Do_not_emit_declarations_for_code_that_has_an_internal_annotation: { code: 6056, category: ts.DiagnosticCategory.Message, key: "Do not emit declarations for code that has an '@internal' annotation." }, - Preserve_new_lines_when_emitting_code: { code: 6057, category: ts.DiagnosticCategory.Message, key: "Preserve new-lines when emitting code." }, - Specifies_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir: { code: 6058, category: ts.DiagnosticCategory.Message, key: "Specifies the root directory of input files. Use to control the output directory structure with --outDir." }, - File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files: { code: 6059, category: ts.DiagnosticCategory.Error, key: "File '{0}' is not under 'rootDir' '{1}'. 'rootDir' is expected to contain all source files." }, - Specifies_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix: { code: 6060, category: ts.DiagnosticCategory.Message, key: "Specifies the end of line sequence to be used when emitting files: 'CRLF' (dos) or 'LF' (unix)." }, - NEWLINE: { code: 6061, category: ts.DiagnosticCategory.Message, key: "NEWLINE" }, - Argument_for_newLine_option_must_be_CRLF_or_LF: { code: 6062, category: ts.DiagnosticCategory.Error, key: "Argument for '--newLine' option must be 'CRLF' or 'LF'." }, - Option_experimentalDecorators_must_also_be_specified_when_option_emitDecoratorMetadata_is_specified: { code: 6064, category: ts.DiagnosticCategory.Error, key: "Option 'experimentalDecorators' must also be specified when option 'emitDecoratorMetadata' is specified." }, - Enables_experimental_support_for_ES7_decorators: { code: 6065, category: ts.DiagnosticCategory.Message, key: "Enables experimental support for ES7 decorators." }, - Enables_experimental_support_for_emitting_type_metadata_for_decorators: { code: 6066, category: ts.DiagnosticCategory.Message, key: "Enables experimental support for emitting type metadata for decorators." }, - Variable_0_implicitly_has_an_1_type: { code: 7005, category: ts.DiagnosticCategory.Error, key: "Variable '{0}' implicitly has an '{1}' type." }, - Parameter_0_implicitly_has_an_1_type: { code: 7006, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' implicitly has an '{1}' type." }, - Member_0_implicitly_has_an_1_type: { code: 7008, category: ts.DiagnosticCategory.Error, key: "Member '{0}' implicitly has an '{1}' type." }, - new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type: { code: 7009, category: ts.DiagnosticCategory.Error, key: "'new' expression, whose target lacks a construct signature, implicitly has an 'any' type." }, - _0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type: { code: 7010, category: ts.DiagnosticCategory.Error, key: "'{0}', which lacks return-type annotation, implicitly has an '{1}' return type." }, - Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: { code: 7011, category: ts.DiagnosticCategory.Error, key: "Function expression, which lacks return-type annotation, implicitly has an '{0}' return type." }, - Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { code: 7013, category: ts.DiagnosticCategory.Error, key: "Construct signature, which lacks return-type annotation, implicitly has an 'any' return type." }, - Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_type_annotation: { code: 7016, category: ts.DiagnosticCategory.Error, key: "Property '{0}' implicitly has type 'any', because its 'set' accessor lacks a type annotation." }, - Index_signature_of_object_type_implicitly_has_an_any_type: { code: 7017, category: ts.DiagnosticCategory.Error, key: "Index signature of object type implicitly has an 'any' type." }, - Object_literal_s_property_0_implicitly_has_an_1_type: { code: 7018, category: ts.DiagnosticCategory.Error, key: "Object literal's property '{0}' implicitly has an '{1}' type." }, - Rest_parameter_0_implicitly_has_an_any_type: { code: 7019, category: ts.DiagnosticCategory.Error, key: "Rest parameter '{0}' implicitly has an 'any[]' type." }, - Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: { code: 7020, category: ts.DiagnosticCategory.Error, key: "Call signature, which lacks return-type annotation, implicitly has an 'any' return type." }, - _0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer: { code: 7022, category: ts.DiagnosticCategory.Error, key: "'{0}' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer." }, - _0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions: { code: 7023, category: ts.DiagnosticCategory.Error, key: "'{0}' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions." }, - Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions: { code: 7024, category: ts.DiagnosticCategory.Error, key: "Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions." }, - Generator_implicitly_has_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type: { code: 7025, category: ts.DiagnosticCategory.Error, key: "Generator implicitly has type '{0}' because it does not yield any values. Consider supplying a return type." }, - You_cannot_rename_this_element: { code: 8000, category: ts.DiagnosticCategory.Error, key: "You cannot rename this element." }, - You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library: { code: 8001, category: ts.DiagnosticCategory.Error, key: "You cannot rename elements that are defined in the standard TypeScript library." }, - import_can_only_be_used_in_a_ts_file: { code: 8002, category: ts.DiagnosticCategory.Error, key: "'import ... =' can only be used in a .ts file." }, - export_can_only_be_used_in_a_ts_file: { code: 8003, category: ts.DiagnosticCategory.Error, key: "'export=' can only be used in a .ts file." }, - type_parameter_declarations_can_only_be_used_in_a_ts_file: { code: 8004, category: ts.DiagnosticCategory.Error, key: "'type parameter declarations' can only be used in a .ts file." }, - implements_clauses_can_only_be_used_in_a_ts_file: { code: 8005, category: ts.DiagnosticCategory.Error, key: "'implements clauses' can only be used in a .ts file." }, - interface_declarations_can_only_be_used_in_a_ts_file: { code: 8006, category: ts.DiagnosticCategory.Error, key: "'interface declarations' can only be used in a .ts file." }, - module_declarations_can_only_be_used_in_a_ts_file: { code: 8007, category: ts.DiagnosticCategory.Error, key: "'module declarations' can only be used in a .ts file." }, - type_aliases_can_only_be_used_in_a_ts_file: { code: 8008, category: ts.DiagnosticCategory.Error, key: "'type aliases' can only be used in a .ts file." }, - _0_can_only_be_used_in_a_ts_file: { code: 8009, category: ts.DiagnosticCategory.Error, key: "'{0}' can only be used in a .ts file." }, - types_can_only_be_used_in_a_ts_file: { code: 8010, category: ts.DiagnosticCategory.Error, key: "'types' can only be used in a .ts file." }, - type_arguments_can_only_be_used_in_a_ts_file: { code: 8011, category: ts.DiagnosticCategory.Error, key: "'type arguments' can only be used in a .ts file." }, - parameter_modifiers_can_only_be_used_in_a_ts_file: { code: 8012, category: ts.DiagnosticCategory.Error, key: "'parameter modifiers' can only be used in a .ts file." }, - property_declarations_can_only_be_used_in_a_ts_file: { code: 8014, category: ts.DiagnosticCategory.Error, key: "'property declarations' can only be used in a .ts file." }, - enum_declarations_can_only_be_used_in_a_ts_file: { code: 8015, category: ts.DiagnosticCategory.Error, key: "'enum declarations' can only be used in a .ts file." }, - type_assertion_expressions_can_only_be_used_in_a_ts_file: { code: 8016, category: ts.DiagnosticCategory.Error, key: "'type assertion expressions' can only be used in a .ts file." }, - decorators_can_only_be_used_in_a_ts_file: { code: 8017, category: ts.DiagnosticCategory.Error, key: "'decorators' can only be used in a .ts file." }, - Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_class_extends_clauses: { code: 9002, category: ts.DiagnosticCategory.Error, key: "Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses." }, - class_expressions_are_not_currently_supported: { code: 9003, category: ts.DiagnosticCategory.Error, key: "'class' expressions are not currently supported." } - }; -})(ts || (ts = {})); -/// -/// -var ts; -(function (ts) { - var textToToken = { - "any": 112 /* AnyKeyword */, - "as": 111 /* AsKeyword */, - "boolean": 113 /* BooleanKeyword */, - "break": 66 /* BreakKeyword */, - "case": 67 /* CaseKeyword */, - "catch": 68 /* CatchKeyword */, - "class": 69 /* ClassKeyword */, - "continue": 71 /* ContinueKeyword */, - "const": 70 /* ConstKeyword */, - "constructor": 114 /* ConstructorKeyword */, - "debugger": 72 /* DebuggerKeyword */, - "declare": 115 /* DeclareKeyword */, - "default": 73 /* DefaultKeyword */, - "delete": 74 /* DeleteKeyword */, - "do": 75 /* DoKeyword */, - "else": 76 /* ElseKeyword */, - "enum": 77 /* EnumKeyword */, - "export": 78 /* ExportKeyword */, - "extends": 79 /* ExtendsKeyword */, - "false": 80 /* FalseKeyword */, - "finally": 81 /* FinallyKeyword */, - "for": 82 /* ForKeyword */, - "from": 126 /* FromKeyword */, - "function": 83 /* FunctionKeyword */, - "get": 116 /* GetKeyword */, - "if": 84 /* IfKeyword */, - "implements": 102 /* ImplementsKeyword */, - "import": 85 /* ImportKeyword */, - "in": 86 /* InKeyword */, - "instanceof": 87 /* InstanceOfKeyword */, - "interface": 103 /* InterfaceKeyword */, - "is": 117 /* IsKeyword */, - "let": 104 /* LetKeyword */, - "module": 118 /* ModuleKeyword */, - "namespace": 119 /* NamespaceKeyword */, - "new": 88 /* NewKeyword */, - "null": 89 /* NullKeyword */, - "number": 121 /* NumberKeyword */, - "package": 105 /* PackageKeyword */, - "private": 106 /* PrivateKeyword */, - "protected": 107 /* ProtectedKeyword */, - "public": 108 /* PublicKeyword */, - "require": 120 /* RequireKeyword */, - "return": 90 /* ReturnKeyword */, - "set": 122 /* SetKeyword */, - "static": 109 /* StaticKeyword */, - "string": 123 /* StringKeyword */, - "super": 91 /* SuperKeyword */, - "switch": 92 /* SwitchKeyword */, - "symbol": 124 /* SymbolKeyword */, - "this": 93 /* ThisKeyword */, - "throw": 94 /* ThrowKeyword */, - "true": 95 /* TrueKeyword */, - "try": 96 /* TryKeyword */, - "type": 125 /* TypeKeyword */, - "typeof": 97 /* TypeOfKeyword */, - "var": 98 /* VarKeyword */, - "void": 99 /* VoidKeyword */, - "while": 100 /* WhileKeyword */, - "with": 101 /* WithKeyword */, - "yield": 110 /* YieldKeyword */, - "of": 127 /* OfKeyword */, - "{": 14 /* OpenBraceToken */, - "}": 15 /* CloseBraceToken */, - "(": 16 /* OpenParenToken */, - ")": 17 /* CloseParenToken */, - "[": 18 /* OpenBracketToken */, - "]": 19 /* CloseBracketToken */, - ".": 20 /* DotToken */, - "...": 21 /* DotDotDotToken */, - ";": 22 /* SemicolonToken */, - ",": 23 /* CommaToken */, - "<": 24 /* LessThanToken */, - ">": 25 /* GreaterThanToken */, - "<=": 26 /* LessThanEqualsToken */, - ">=": 27 /* GreaterThanEqualsToken */, - "==": 28 /* EqualsEqualsToken */, - "!=": 29 /* ExclamationEqualsToken */, - "===": 30 /* EqualsEqualsEqualsToken */, - "!==": 31 /* ExclamationEqualsEqualsToken */, - "=>": 32 /* EqualsGreaterThanToken */, - "+": 33 /* PlusToken */, - "-": 34 /* MinusToken */, - "*": 35 /* AsteriskToken */, - "/": 36 /* SlashToken */, - "%": 37 /* PercentToken */, - "++": 38 /* PlusPlusToken */, - "--": 39 /* MinusMinusToken */, - "<<": 40 /* LessThanLessThanToken */, - ">>": 41 /* GreaterThanGreaterThanToken */, - ">>>": 42 /* GreaterThanGreaterThanGreaterThanToken */, - "&": 43 /* AmpersandToken */, - "|": 44 /* BarToken */, - "^": 45 /* CaretToken */, - "!": 46 /* ExclamationToken */, - "~": 47 /* TildeToken */, - "&&": 48 /* AmpersandAmpersandToken */, - "||": 49 /* BarBarToken */, - "?": 50 /* QuestionToken */, - ":": 51 /* ColonToken */, - "=": 53 /* EqualsToken */, - "+=": 54 /* PlusEqualsToken */, - "-=": 55 /* MinusEqualsToken */, - "*=": 56 /* AsteriskEqualsToken */, - "/=": 57 /* SlashEqualsToken */, - "%=": 58 /* PercentEqualsToken */, - "<<=": 59 /* LessThanLessThanEqualsToken */, - ">>=": 60 /* GreaterThanGreaterThanEqualsToken */, - ">>>=": 61 /* GreaterThanGreaterThanGreaterThanEqualsToken */, - "&=": 62 /* AmpersandEqualsToken */, - "|=": 63 /* BarEqualsToken */, - "^=": 64 /* CaretEqualsToken */, - "@": 52 /* AtToken */ - }; - /* - As per ECMAScript Language Specification 3th Edition, Section 7.6: Identifiers - IdentifierStart :: - Can contain Unicode 3.0.0 categories: - Uppercase letter (Lu), - Lowercase letter (Ll), - Titlecase letter (Lt), - Modifier letter (Lm), - Other letter (Lo), or - Letter number (Nl). - IdentifierPart :: = - Can contain IdentifierStart + Unicode 3.0.0 categories: - Non-spacing mark (Mn), - Combining spacing mark (Mc), - Decimal number (Nd), or - Connector punctuation (Pc). - - Codepoint ranges for ES3 Identifiers are extracted from the Unicode 3.0.0 specification at: - http://www.unicode.org/Public/3.0-Update/UnicodeData-3.0.0.txt - */ - var unicodeES3IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1610, 1649, 1747, 1749, 1749, 1765, 1766, 1786, 1788, 1808, 1808, 1810, 1836, 1920, 1957, 2309, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2784, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3294, 3294, 3296, 3297, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3424, 3425, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3805, 3840, 3840, 3904, 3911, 3913, 3946, 3976, 3979, 4096, 4129, 4131, 4135, 4137, 4138, 4176, 4181, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6067, 6176, 6263, 6272, 6312, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8319, 8319, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12346, 12353, 12436, 12445, 12446, 12449, 12538, 12540, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65138, 65140, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; - var unicodeES3IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 543, 546, 563, 592, 685, 688, 696, 699, 705, 720, 721, 736, 740, 750, 750, 768, 846, 864, 866, 890, 890, 902, 902, 904, 906, 908, 908, 910, 929, 931, 974, 976, 983, 986, 1011, 1024, 1153, 1155, 1158, 1164, 1220, 1223, 1224, 1227, 1228, 1232, 1269, 1272, 1273, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1441, 1443, 1465, 1467, 1469, 1471, 1471, 1473, 1474, 1476, 1476, 1488, 1514, 1520, 1522, 1569, 1594, 1600, 1621, 1632, 1641, 1648, 1747, 1749, 1756, 1759, 1768, 1770, 1773, 1776, 1788, 1808, 1836, 1840, 1866, 1920, 1968, 2305, 2307, 2309, 2361, 2364, 2381, 2384, 2388, 2392, 2403, 2406, 2415, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2492, 2494, 2500, 2503, 2504, 2507, 2509, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2562, 2562, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2649, 2652, 2654, 2654, 2662, 2676, 2689, 2691, 2693, 2699, 2701, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2784, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2870, 2873, 2876, 2883, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2913, 2918, 2927, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 2997, 2999, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3031, 3031, 3047, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3134, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3168, 3169, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3262, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3297, 3302, 3311, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3368, 3370, 3385, 3390, 3395, 3398, 3400, 3402, 3405, 3415, 3415, 3424, 3425, 3430, 3439, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3805, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3946, 3953, 3972, 3974, 3979, 3984, 3991, 3993, 4028, 4038, 4038, 4096, 4129, 4131, 4135, 4137, 4138, 4140, 4146, 4150, 4153, 4160, 4169, 4176, 4185, 4256, 4293, 4304, 4342, 4352, 4441, 4447, 4514, 4520, 4601, 4608, 4614, 4616, 4678, 4680, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4742, 4744, 4744, 4746, 4749, 4752, 4782, 4784, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4814, 4816, 4822, 4824, 4846, 4848, 4878, 4880, 4880, 4882, 4885, 4888, 4894, 4896, 4934, 4936, 4954, 4969, 4977, 5024, 5108, 5121, 5740, 5743, 5750, 5761, 5786, 5792, 5866, 6016, 6099, 6112, 6121, 6160, 6169, 6176, 6263, 6272, 6313, 7680, 7835, 7840, 7929, 7936, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8255, 8256, 8319, 8319, 8400, 8412, 8417, 8417, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8497, 8499, 8505, 8544, 8579, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12346, 12353, 12436, 12441, 12442, 12445, 12446, 12449, 12542, 12549, 12588, 12593, 12686, 12704, 12727, 13312, 19893, 19968, 40869, 40960, 42124, 44032, 55203, 63744, 64045, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65056, 65059, 65075, 65076, 65101, 65103, 65136, 65138, 65140, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65381, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; - /* - As per ECMAScript Language Specification 5th Edition, Section 7.6: ISyntaxToken Names and Identifiers - IdentifierStart :: - Can contain Unicode 6.2 categories: - Uppercase letter (Lu), - Lowercase letter (Ll), - Titlecase letter (Lt), - Modifier letter (Lm), - Other letter (Lo), or - Letter number (Nl). - IdentifierPart :: - Can contain IdentifierStart + Unicode 6.2 categories: - Non-spacing mark (Mn), - Combining spacing mark (Mc), - Decimal number (Nd), - Connector punctuation (Pc), - , or - . - - Codepoint ranges for ES5 Identifiers are extracted from the Unicode 6.2 specification at: - http://www.unicode.org/Public/6.2.0/ucd/UnicodeData.txt - */ - var unicodeES5IdentifierStart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 880, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1488, 1514, 1520, 1522, 1568, 1610, 1646, 1647, 1649, 1747, 1749, 1749, 1765, 1766, 1774, 1775, 1786, 1788, 1791, 1791, 1808, 1808, 1810, 1839, 1869, 1957, 1969, 1969, 1994, 2026, 2036, 2037, 2042, 2042, 2048, 2069, 2074, 2074, 2084, 2084, 2088, 2088, 2112, 2136, 2208, 2208, 2210, 2220, 2308, 2361, 2365, 2365, 2384, 2384, 2392, 2401, 2417, 2423, 2425, 2431, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2493, 2493, 2510, 2510, 2524, 2525, 2527, 2529, 2544, 2545, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2649, 2652, 2654, 2654, 2674, 2676, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2749, 2749, 2768, 2768, 2784, 2785, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2877, 2877, 2908, 2909, 2911, 2913, 2929, 2929, 2947, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3024, 3024, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3133, 3160, 3161, 3168, 3169, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3261, 3261, 3294, 3294, 3296, 3297, 3313, 3314, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3389, 3406, 3406, 3424, 3425, 3450, 3455, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3585, 3632, 3634, 3635, 3648, 3654, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3760, 3762, 3763, 3773, 3773, 3776, 3780, 3782, 3782, 3804, 3807, 3840, 3840, 3904, 3911, 3913, 3948, 3976, 3980, 4096, 4138, 4159, 4159, 4176, 4181, 4186, 4189, 4193, 4193, 4197, 4198, 4206, 4208, 4213, 4225, 4238, 4238, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5905, 5920, 5937, 5952, 5969, 5984, 5996, 5998, 6000, 6016, 6067, 6103, 6103, 6108, 6108, 6176, 6263, 6272, 6312, 6314, 6314, 6320, 6389, 6400, 6428, 6480, 6509, 6512, 6516, 6528, 6571, 6593, 6599, 6656, 6678, 6688, 6740, 6823, 6823, 6917, 6963, 6981, 6987, 7043, 7072, 7086, 7087, 7098, 7141, 7168, 7203, 7245, 7247, 7258, 7293, 7401, 7404, 7406, 7409, 7413, 7414, 7424, 7615, 7680, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8305, 8305, 8319, 8319, 8336, 8348, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11502, 11506, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11648, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11823, 11823, 12293, 12295, 12321, 12329, 12337, 12341, 12344, 12348, 12353, 12438, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42527, 42538, 42539, 42560, 42606, 42623, 42647, 42656, 42735, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43009, 43011, 43013, 43015, 43018, 43020, 43042, 43072, 43123, 43138, 43187, 43250, 43255, 43259, 43259, 43274, 43301, 43312, 43334, 43360, 43388, 43396, 43442, 43471, 43471, 43520, 43560, 43584, 43586, 43588, 43595, 43616, 43638, 43642, 43642, 43648, 43695, 43697, 43697, 43701, 43702, 43705, 43709, 43712, 43712, 43714, 43714, 43739, 43741, 43744, 43754, 43762, 43764, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44002, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64285, 64287, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65136, 65140, 65142, 65276, 65313, 65338, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; - var unicodeES5IdentifierPart = [170, 170, 181, 181, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 768, 884, 886, 887, 890, 893, 902, 902, 904, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1155, 1159, 1162, 1319, 1329, 1366, 1369, 1369, 1377, 1415, 1425, 1469, 1471, 1471, 1473, 1474, 1476, 1477, 1479, 1479, 1488, 1514, 1520, 1522, 1552, 1562, 1568, 1641, 1646, 1747, 1749, 1756, 1759, 1768, 1770, 1788, 1791, 1791, 1808, 1866, 1869, 1969, 1984, 2037, 2042, 2042, 2048, 2093, 2112, 2139, 2208, 2208, 2210, 2220, 2276, 2302, 2304, 2403, 2406, 2415, 2417, 2423, 2425, 2431, 2433, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2561, 2563, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2641, 2641, 2649, 2652, 2654, 2654, 2662, 2677, 2689, 2691, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2787, 2790, 2799, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2915, 2918, 2927, 2929, 2929, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3024, 3024, 3031, 3031, 3046, 3055, 3073, 3075, 3077, 3084, 3086, 3088, 3090, 3112, 3114, 3123, 3125, 3129, 3133, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3160, 3161, 3168, 3171, 3174, 3183, 3202, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3260, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3299, 3302, 3311, 3313, 3314, 3330, 3331, 3333, 3340, 3342, 3344, 3346, 3386, 3389, 3396, 3398, 3400, 3402, 3406, 3415, 3415, 3424, 3427, 3430, 3439, 3450, 3455, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3719, 3720, 3722, 3722, 3725, 3725, 3732, 3735, 3737, 3743, 3745, 3747, 3749, 3749, 3751, 3751, 3754, 3755, 3757, 3769, 3771, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3807, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3948, 3953, 3972, 3974, 3991, 3993, 4028, 4038, 4038, 4096, 4169, 4176, 4253, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4957, 4959, 4992, 5007, 5024, 5108, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5872, 5888, 5900, 5902, 5908, 5920, 5940, 5952, 5971, 5984, 5996, 5998, 6000, 6002, 6003, 6016, 6099, 6103, 6103, 6108, 6109, 6112, 6121, 6155, 6157, 6160, 6169, 6176, 6263, 6272, 6314, 6320, 6389, 6400, 6428, 6432, 6443, 6448, 6459, 6470, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6617, 6656, 6683, 6688, 6750, 6752, 6780, 6783, 6793, 6800, 6809, 6823, 6823, 6912, 6987, 6992, 7001, 7019, 7027, 7040, 7155, 7168, 7223, 7232, 7241, 7245, 7293, 7376, 7378, 7380, 7414, 7424, 7654, 7676, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8204, 8205, 8255, 8256, 8276, 8276, 8305, 8305, 8319, 8319, 8336, 8348, 8400, 8412, 8417, 8417, 8421, 8432, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8473, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8493, 8495, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11647, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11744, 11775, 11823, 11823, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12348, 12353, 12438, 12441, 12442, 12445, 12447, 12449, 12538, 12540, 12543, 12549, 12589, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40908, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42539, 42560, 42607, 42612, 42621, 42623, 42647, 42655, 42737, 42775, 42783, 42786, 42888, 42891, 42894, 42896, 42899, 42912, 42922, 43000, 43047, 43072, 43123, 43136, 43204, 43216, 43225, 43232, 43255, 43259, 43259, 43264, 43309, 43312, 43347, 43360, 43388, 43392, 43456, 43471, 43481, 43520, 43574, 43584, 43597, 43600, 43609, 43616, 43638, 43642, 43643, 43648, 43714, 43739, 43741, 43744, 43759, 43762, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43968, 44010, 44012, 44013, 44016, 44025, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65024, 65039, 65056, 65062, 65075, 65076, 65101, 65103, 65136, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500,]; - function lookupInUnicodeMap(code, map) { - // Bail out quickly if it couldn't possibly be in the map. - if (code < map[0]) { - return false; - } - // Perform binary search in one of the Unicode range maps - var lo = 0; - var hi = map.length; - var mid; - while (lo + 1 < hi) { - mid = lo + (hi - lo) / 2; - // mid has to be even to catch a range's beginning - mid -= mid % 2; - if (map[mid] <= code && code <= map[mid + 1]) { - return true; - } - if (code < map[mid]) { - hi = mid; - } - else { - lo = mid + 2; - } - } - return false; - } - /* @internal */ function isUnicodeIdentifierStart(code, languageVersion) { - return languageVersion >= 1 /* ES5 */ ? - lookupInUnicodeMap(code, unicodeES5IdentifierStart) : - lookupInUnicodeMap(code, unicodeES3IdentifierStart); - } - ts.isUnicodeIdentifierStart = isUnicodeIdentifierStart; - function isUnicodeIdentifierPart(code, languageVersion) { - return languageVersion >= 1 /* ES5 */ ? - lookupInUnicodeMap(code, unicodeES5IdentifierPart) : - lookupInUnicodeMap(code, unicodeES3IdentifierPart); - } - function makeReverseMap(source) { - var result = []; - for (var name_3 in source) { - if (source.hasOwnProperty(name_3)) { - result[source[name_3]] = name_3; - } - } - return result; - } - var tokenStrings = makeReverseMap(textToToken); - function tokenToString(t) { - return tokenStrings[t]; - } - ts.tokenToString = tokenToString; - /* @internal */ - function stringToToken(s) { - return textToToken[s]; - } - ts.stringToToken = stringToToken; - /* @internal */ - function computeLineStarts(text) { - var result = new Array(); - var pos = 0; - var lineStart = 0; - while (pos < text.length) { - var ch = text.charCodeAt(pos++); - switch (ch) { - case 13 /* carriageReturn */: - if (text.charCodeAt(pos) === 10 /* lineFeed */) { - pos++; - } - case 10 /* lineFeed */: - result.push(lineStart); - lineStart = pos; - break; - default: - if (ch > 127 /* maxAsciiCharacter */ && isLineBreak(ch)) { - result.push(lineStart); - lineStart = pos; - } - break; - } - } - result.push(lineStart); - return result; - } - ts.computeLineStarts = computeLineStarts; - function getPositionOfLineAndCharacter(sourceFile, line, character) { - return computePositionOfLineAndCharacter(getLineStarts(sourceFile), line, character); - } - ts.getPositionOfLineAndCharacter = getPositionOfLineAndCharacter; - /* @internal */ - function computePositionOfLineAndCharacter(lineStarts, line, character) { - ts.Debug.assert(line >= 0 && line < lineStarts.length); - return lineStarts[line] + character; - } - ts.computePositionOfLineAndCharacter = computePositionOfLineAndCharacter; - /* @internal */ - function getLineStarts(sourceFile) { - return sourceFile.lineMap || (sourceFile.lineMap = computeLineStarts(sourceFile.text)); - } - ts.getLineStarts = getLineStarts; - /* @internal */ - function computeLineAndCharacterOfPosition(lineStarts, position) { - var lineNumber = ts.binarySearch(lineStarts, position); - if (lineNumber < 0) { - // If the actual position was not found, - // the binary search returns the negative value of the next line start - // e.g. if the line starts at [5, 10, 23, 80] and the position requested was 20 - // then the search will return -2 - lineNumber = ~lineNumber - 1; - } - return { - line: lineNumber, - character: position - lineStarts[lineNumber] - }; - } - ts.computeLineAndCharacterOfPosition = computeLineAndCharacterOfPosition; - function getLineAndCharacterOfPosition(sourceFile, position) { - return computeLineAndCharacterOfPosition(getLineStarts(sourceFile), position); - } - ts.getLineAndCharacterOfPosition = getLineAndCharacterOfPosition; - var hasOwnProperty = Object.prototype.hasOwnProperty; - function isWhiteSpace(ch) { - // Note: nextLine is in the Zs space, and should be considered to be a whitespace. - // It is explicitly not a line-break as it isn't in the exact set specified by EcmaScript. - return ch === 32 /* space */ || - ch === 9 /* tab */ || - ch === 11 /* verticalTab */ || - ch === 12 /* formFeed */ || - ch === 160 /* nonBreakingSpace */ || - ch === 133 /* nextLine */ || - ch === 5760 /* ogham */ || - ch >= 8192 /* enQuad */ && ch <= 8203 /* zeroWidthSpace */ || - ch === 8239 /* narrowNoBreakSpace */ || - ch === 8287 /* mathematicalSpace */ || - ch === 12288 /* ideographicSpace */ || - ch === 65279 /* byteOrderMark */; - } - ts.isWhiteSpace = isWhiteSpace; - function isLineBreak(ch) { - // ES5 7.3: - // The ECMAScript line terminator characters are listed in Table 3. - // Table 3: Line Terminator Characters - // Code Unit Value Name Formal Name - // \u000A Line Feed - // \u000D Carriage Return - // \u2028 Line separator - // \u2029 Paragraph separator - // Only the characters in Table 3 are treated as line terminators. Other new line or line - // breaking characters are treated as white space but not as line terminators. - return ch === 10 /* lineFeed */ || - ch === 13 /* carriageReturn */ || - ch === 8232 /* lineSeparator */ || - ch === 8233 /* paragraphSeparator */; - } - ts.isLineBreak = isLineBreak; - function isDigit(ch) { - return ch >= 48 /* _0 */ && ch <= 57 /* _9 */; - } - /* @internal */ - function isOctalDigit(ch) { - return ch >= 48 /* _0 */ && ch <= 55 /* _7 */; - } - ts.isOctalDigit = isOctalDigit; - /* @internal */ - function skipTrivia(text, pos, stopAfterLineBreak) { - while (true) { - var ch = text.charCodeAt(pos); - switch (ch) { - case 13 /* carriageReturn */: - if (text.charCodeAt(pos + 1) === 10 /* lineFeed */) { - pos++; - } - case 10 /* lineFeed */: - pos++; - if (stopAfterLineBreak) { - return pos; - } - continue; - case 9 /* tab */: - case 11 /* verticalTab */: - case 12 /* formFeed */: - case 32 /* space */: - pos++; - continue; - case 47 /* slash */: - if (text.charCodeAt(pos + 1) === 47 /* slash */) { - pos += 2; - while (pos < text.length) { - if (isLineBreak(text.charCodeAt(pos))) { - break; - } - pos++; - } - continue; - } - if (text.charCodeAt(pos + 1) === 42 /* asterisk */) { - pos += 2; - while (pos < text.length) { - if (text.charCodeAt(pos) === 42 /* asterisk */ && text.charCodeAt(pos + 1) === 47 /* slash */) { - pos += 2; - break; - } - pos++; - } - continue; - } - break; - case 60 /* lessThan */: - case 61 /* equals */: - case 62 /* greaterThan */: - if (isConflictMarkerTrivia(text, pos)) { - pos = scanConflictMarkerTrivia(text, pos); - continue; - } - break; - default: - if (ch > 127 /* maxAsciiCharacter */ && (isWhiteSpace(ch) || isLineBreak(ch))) { - pos++; - continue; - } - break; - } - return pos; - } - } - ts.skipTrivia = skipTrivia; - // All conflict markers consist of the same character repeated seven times. If it is - // a <<<<<<< or >>>>>>> marker then it is also followd by a space. - var mergeConflictMarkerLength = "<<<<<<<".length; - function isConflictMarkerTrivia(text, pos) { - ts.Debug.assert(pos >= 0); - // Conflict markers must be at the start of a line. - if (pos === 0 || isLineBreak(text.charCodeAt(pos - 1))) { - var ch = text.charCodeAt(pos); - if ((pos + mergeConflictMarkerLength) < text.length) { - for (var i = 0, n = mergeConflictMarkerLength; i < n; i++) { - if (text.charCodeAt(pos + i) !== ch) { - return false; - } - } - return ch === 61 /* equals */ || - text.charCodeAt(pos + mergeConflictMarkerLength) === 32 /* space */; - } - } - return false; - } - function scanConflictMarkerTrivia(text, pos, error) { - if (error) { - error(ts.Diagnostics.Merge_conflict_marker_encountered, mergeConflictMarkerLength); - } - var ch = text.charCodeAt(pos); - var len = text.length; - if (ch === 60 /* lessThan */ || ch === 62 /* greaterThan */) { - while (pos < len && !isLineBreak(text.charCodeAt(pos))) { - pos++; - } - } - else { - ts.Debug.assert(ch === 61 /* equals */); - // Consume everything from the start of the mid-conlict marker to the start of the next - // end-conflict marker. - while (pos < len) { - var ch_1 = text.charCodeAt(pos); - if (ch_1 === 62 /* greaterThan */ && isConflictMarkerTrivia(text, pos)) { - break; - } - pos++; - } - } - return pos; - } - // Extract comments from the given source text starting at the given position. If trailing is - // false, whitespace is skipped until the first line break and comments between that location - // and the next token are returned.If trailing is true, comments occurring between the given - // position and the next line break are returned.The return value is an array containing a - // TextRange for each comment. Single-line comment ranges include the beginning '//' characters - // but not the ending line break. Multi - line comment ranges include the beginning '/* and - // ending '*/' characters.The return value is undefined if no comments were found. - function getCommentRanges(text, pos, trailing) { - var result; - var collecting = trailing || pos === 0; - while (true) { - var ch = text.charCodeAt(pos); - switch (ch) { - case 13 /* carriageReturn */: - if (text.charCodeAt(pos + 1) === 10 /* lineFeed */) { - pos++; - } - case 10 /* lineFeed */: - pos++; - if (trailing) { - return result; - } - collecting = true; - if (result && result.length) { - ts.lastOrUndefined(result).hasTrailingNewLine = true; - } - continue; - case 9 /* tab */: - case 11 /* verticalTab */: - case 12 /* formFeed */: - case 32 /* space */: - pos++; - continue; - case 47 /* slash */: - var nextChar = text.charCodeAt(pos + 1); - var hasTrailingNewLine = false; - if (nextChar === 47 /* slash */ || nextChar === 42 /* asterisk */) { - var kind = nextChar === 47 /* slash */ ? 2 /* SingleLineCommentTrivia */ : 3 /* MultiLineCommentTrivia */; - var startPos = pos; - pos += 2; - if (nextChar === 47 /* slash */) { - while (pos < text.length) { - if (isLineBreak(text.charCodeAt(pos))) { - hasTrailingNewLine = true; - break; - } - pos++; - } - } - else { - while (pos < text.length) { - if (text.charCodeAt(pos) === 42 /* asterisk */ && text.charCodeAt(pos + 1) === 47 /* slash */) { - pos += 2; - break; - } - pos++; - } - } - if (collecting) { - if (!result) { - result = []; - } - result.push({ pos: startPos, end: pos, hasTrailingNewLine: hasTrailingNewLine, kind: kind }); - } - continue; - } - break; - default: - if (ch > 127 /* maxAsciiCharacter */ && (isWhiteSpace(ch) || isLineBreak(ch))) { - if (result && result.length && isLineBreak(ch)) { - ts.lastOrUndefined(result).hasTrailingNewLine = true; - } - pos++; - continue; - } - break; - } - return result; - } - } - function getLeadingCommentRanges(text, pos) { - return getCommentRanges(text, pos, false); - } - ts.getLeadingCommentRanges = getLeadingCommentRanges; - function getTrailingCommentRanges(text, pos) { - return getCommentRanges(text, pos, true); - } - ts.getTrailingCommentRanges = getTrailingCommentRanges; - function isIdentifierStart(ch, languageVersion) { - return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || - ch === 36 /* $ */ || ch === 95 /* _ */ || - ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierStart(ch, languageVersion); - } - ts.isIdentifierStart = isIdentifierStart; - function isIdentifierPart(ch, languageVersion) { - return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || - ch >= 48 /* _0 */ && ch <= 57 /* _9 */ || ch === 36 /* $ */ || ch === 95 /* _ */ || - ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierPart(ch, languageVersion); - } - ts.isIdentifierPart = isIdentifierPart; - /* @internal */ - // Creates a scanner over a (possibly unspecified) range of a piece of text. - function createScanner(languageVersion, skipTrivia, text, onError, start, length) { - // Current position (end position of text of current token) - var pos; - // end of text - var end; - // Start position of whitespace before current token - var startPos; - // Start position of text of current token - var tokenPos; - var token; - var tokenValue; - var precedingLineBreak; - var hasExtendedUnicodeEscape; - var tokenIsUnterminated; - setText(text, start, length); - return { - getStartPos: function () { return startPos; }, - getTextPos: function () { return pos; }, - getToken: function () { return token; }, - getTokenPos: function () { return tokenPos; }, - getTokenText: function () { return text.substring(tokenPos, pos); }, - getTokenValue: function () { return tokenValue; }, - hasExtendedUnicodeEscape: function () { return hasExtendedUnicodeEscape; }, - hasPrecedingLineBreak: function () { return precedingLineBreak; }, - isIdentifier: function () { return token === 65 /* Identifier */ || token > 101 /* LastReservedWord */; }, - isReservedWord: function () { return token >= 66 /* FirstReservedWord */ && token <= 101 /* LastReservedWord */; }, - isUnterminated: function () { return tokenIsUnterminated; }, - reScanGreaterToken: reScanGreaterToken, - reScanSlashToken: reScanSlashToken, - reScanTemplateToken: reScanTemplateToken, - scan: scan, - setText: setText, - setScriptTarget: setScriptTarget, - setOnError: setOnError, - setTextPos: setTextPos, - tryScan: tryScan, - lookAhead: lookAhead - }; - function error(message, length) { - if (onError) { - onError(message, length || 0); - } - } - function isIdentifierStart(ch) { - return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || - ch === 36 /* $ */ || ch === 95 /* _ */ || - ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierStart(ch, languageVersion); - } - function isIdentifierPart(ch) { - return ch >= 65 /* A */ && ch <= 90 /* Z */ || ch >= 97 /* a */ && ch <= 122 /* z */ || - ch >= 48 /* _0 */ && ch <= 57 /* _9 */ || ch === 36 /* $ */ || ch === 95 /* _ */ || - ch > 127 /* maxAsciiCharacter */ && isUnicodeIdentifierPart(ch, languageVersion); - } - function scanNumber() { - var start = pos; - while (isDigit(text.charCodeAt(pos))) - pos++; - if (text.charCodeAt(pos) === 46 /* dot */) { - pos++; - while (isDigit(text.charCodeAt(pos))) - pos++; - } - var end = pos; - if (text.charCodeAt(pos) === 69 /* E */ || text.charCodeAt(pos) === 101 /* e */) { - pos++; - if (text.charCodeAt(pos) === 43 /* plus */ || text.charCodeAt(pos) === 45 /* minus */) - pos++; - if (isDigit(text.charCodeAt(pos))) { - pos++; - while (isDigit(text.charCodeAt(pos))) - pos++; - end = pos; - } - else { - error(ts.Diagnostics.Digit_expected); - } - } - return +(text.substring(start, end)); - } - function scanOctalDigits() { - var start = pos; - while (isOctalDigit(text.charCodeAt(pos))) { - pos++; - } - return +(text.substring(start, pos)); - } - /** - * Scans the given number of hexadecimal digits in the text, - * returning -1 if the given number is unavailable. - */ - function scanExactNumberOfHexDigits(count) { - return scanHexDigits(count, false); - } - /** - * Scans as many hexadecimal digits as are available in the text, - * returning -1 if the given number of digits was unavailable. - */ - function scanMinimumNumberOfHexDigits(count) { - return scanHexDigits(count, true); - } - function scanHexDigits(minCount, scanAsManyAsPossible) { - var digits = 0; - var value = 0; - while (digits < minCount || scanAsManyAsPossible) { - var ch = text.charCodeAt(pos); - if (ch >= 48 /* _0 */ && ch <= 57 /* _9 */) { - value = value * 16 + ch - 48 /* _0 */; - } - else if (ch >= 65 /* A */ && ch <= 70 /* F */) { - value = value * 16 + ch - 65 /* A */ + 10; - } - else if (ch >= 97 /* a */ && ch <= 102 /* f */) { - value = value * 16 + ch - 97 /* a */ + 10; - } - else { - break; - } - pos++; - digits++; - } - if (digits < minCount) { - value = -1; - } - return value; - } - function scanString() { - var quote = text.charCodeAt(pos++); - var result = ""; - var start = pos; - while (true) { - if (pos >= end) { - result += text.substring(start, pos); - tokenIsUnterminated = true; - error(ts.Diagnostics.Unterminated_string_literal); - break; - } - var ch = text.charCodeAt(pos); - if (ch === quote) { - result += text.substring(start, pos); - pos++; - break; - } - if (ch === 92 /* backslash */) { - result += text.substring(start, pos); - result += scanEscapeSequence(); - start = pos; - continue; - } - if (isLineBreak(ch)) { - result += text.substring(start, pos); - tokenIsUnterminated = true; - error(ts.Diagnostics.Unterminated_string_literal); - break; - } - pos++; - } - return result; - } - /** - * Sets the current 'tokenValue' and returns a NoSubstitutionTemplateLiteral or - * a literal component of a TemplateExpression. - */ - function scanTemplateAndSetTokenValue() { - var startedWithBacktick = text.charCodeAt(pos) === 96 /* backtick */; - pos++; - var start = pos; - var contents = ""; - var resultingToken; - while (true) { - if (pos >= end) { - contents += text.substring(start, pos); - tokenIsUnterminated = true; - error(ts.Diagnostics.Unterminated_template_literal); - resultingToken = startedWithBacktick ? 10 /* NoSubstitutionTemplateLiteral */ : 13 /* TemplateTail */; - break; - } - var currChar = text.charCodeAt(pos); - // '`' - if (currChar === 96 /* backtick */) { - contents += text.substring(start, pos); - pos++; - resultingToken = startedWithBacktick ? 10 /* NoSubstitutionTemplateLiteral */ : 13 /* TemplateTail */; - break; - } - // '${' - if (currChar === 36 /* $ */ && pos + 1 < end && text.charCodeAt(pos + 1) === 123 /* openBrace */) { - contents += text.substring(start, pos); - pos += 2; - resultingToken = startedWithBacktick ? 11 /* TemplateHead */ : 12 /* TemplateMiddle */; - break; - } - // Escape character - if (currChar === 92 /* backslash */) { - contents += text.substring(start, pos); - contents += scanEscapeSequence(); - start = pos; - continue; - } - // Speculated ECMAScript 6 Spec 11.8.6.1: - // and LineTerminatorSequences are normalized to for Template Values - if (currChar === 13 /* carriageReturn */) { - contents += text.substring(start, pos); - pos++; - if (pos < end && text.charCodeAt(pos) === 10 /* lineFeed */) { - pos++; - } - contents += "\n"; - start = pos; - continue; - } - pos++; - } - ts.Debug.assert(resultingToken !== undefined); - tokenValue = contents; - return resultingToken; - } - function scanEscapeSequence() { - pos++; - if (pos >= end) { - error(ts.Diagnostics.Unexpected_end_of_text); - return ""; - } - var ch = text.charCodeAt(pos++); - switch (ch) { - case 48 /* _0 */: - return "\0"; - case 98 /* b */: - return "\b"; - case 116 /* t */: - return "\t"; - case 110 /* n */: - return "\n"; - case 118 /* v */: - return "\v"; - case 102 /* f */: - return "\f"; - case 114 /* r */: - return "\r"; - case 39 /* singleQuote */: - return "\'"; - case 34 /* doubleQuote */: - return "\""; - case 117 /* u */: - // '\u{DDDDDDDD}' - if (pos < end && text.charCodeAt(pos) === 123 /* openBrace */) { - hasExtendedUnicodeEscape = true; - pos++; - return scanExtendedUnicodeEscape(); - } - // '\uDDDD' - return scanHexadecimalEscape(4); - case 120 /* x */: - // '\xDD' - return scanHexadecimalEscape(2); - // when encountering a LineContinuation (i.e. a backslash and a line terminator sequence), - // the line terminator is interpreted to be "the empty code unit sequence". - case 13 /* carriageReturn */: - if (pos < end && text.charCodeAt(pos) === 10 /* lineFeed */) { - pos++; - } - // fall through - case 10 /* lineFeed */: - case 8232 /* lineSeparator */: - case 8233 /* paragraphSeparator */: - return ""; - default: - return String.fromCharCode(ch); - } - } - function scanHexadecimalEscape(numDigits) { - var escapedValue = scanExactNumberOfHexDigits(numDigits); - if (escapedValue >= 0) { - return String.fromCharCode(escapedValue); - } - else { - error(ts.Diagnostics.Hexadecimal_digit_expected); - return ""; - } - } - function scanExtendedUnicodeEscape() { - var escapedValue = scanMinimumNumberOfHexDigits(1); - var isInvalidExtendedEscape = false; - // Validate the value of the digit - if (escapedValue < 0) { - error(ts.Diagnostics.Hexadecimal_digit_expected); - isInvalidExtendedEscape = true; - } - else if (escapedValue > 0x10FFFF) { - error(ts.Diagnostics.An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive); - isInvalidExtendedEscape = true; - } - if (pos >= end) { - error(ts.Diagnostics.Unexpected_end_of_text); - isInvalidExtendedEscape = true; - } - else if (text.charCodeAt(pos) == 125 /* closeBrace */) { - // Only swallow the following character up if it's a '}'. - pos++; - } - else { - error(ts.Diagnostics.Unterminated_Unicode_escape_sequence); - isInvalidExtendedEscape = true; - } - if (isInvalidExtendedEscape) { - return ""; - } - return utf16EncodeAsString(escapedValue); - } - // Derived from the 10.1.1 UTF16Encoding of the ES6 Spec. - function utf16EncodeAsString(codePoint) { - ts.Debug.assert(0x0 <= codePoint && codePoint <= 0x10FFFF); - if (codePoint <= 65535) { - return String.fromCharCode(codePoint); - } - var codeUnit1 = Math.floor((codePoint - 65536) / 1024) + 0xD800; - var codeUnit2 = ((codePoint - 65536) % 1024) + 0xDC00; - return String.fromCharCode(codeUnit1, codeUnit2); - } - // Current character is known to be a backslash. Check for Unicode escape of the form '\uXXXX' - // and return code point value if valid Unicode escape is found. Otherwise return -1. - function peekUnicodeEscape() { - if (pos + 5 < end && text.charCodeAt(pos + 1) === 117 /* u */) { - var start_1 = pos; - pos += 2; - var value = scanExactNumberOfHexDigits(4); - pos = start_1; - return value; - } - return -1; - } - function scanIdentifierParts() { - var result = ""; - var start = pos; - while (pos < end) { - var ch = text.charCodeAt(pos); - if (isIdentifierPart(ch)) { - pos++; - } - else if (ch === 92 /* backslash */) { - ch = peekUnicodeEscape(); - if (!(ch >= 0 && isIdentifierPart(ch))) { - break; - } - result += text.substring(start, pos); - result += String.fromCharCode(ch); - // Valid Unicode escape is always six characters - pos += 6; - start = pos; - } - else { - break; - } - } - result += text.substring(start, pos); - return result; - } - function getIdentifierToken() { - // Reserved words are between 2 and 11 characters long and start with a lowercase letter - var len = tokenValue.length; - if (len >= 2 && len <= 11) { - var ch = tokenValue.charCodeAt(0); - if (ch >= 97 /* a */ && ch <= 122 /* z */ && hasOwnProperty.call(textToToken, tokenValue)) { - return token = textToToken[tokenValue]; - } - } - return token = 65 /* Identifier */; - } - function scanBinaryOrOctalDigits(base) { - ts.Debug.assert(base !== 2 || base !== 8, "Expected either base 2 or base 8"); - var value = 0; - // For counting number of digits; Valid binaryIntegerLiteral must have at least one binary digit following B or b. - // Similarly valid octalIntegerLiteral must have at least one octal digit following o or O. - var numberOfDigits = 0; - while (true) { - var ch = text.charCodeAt(pos); - var valueOfCh = ch - 48 /* _0 */; - if (!isDigit(ch) || valueOfCh >= base) { - break; - } - value = value * base + valueOfCh; - pos++; - numberOfDigits++; - } - // Invalid binaryIntegerLiteral or octalIntegerLiteral - if (numberOfDigits === 0) { - return -1; - } - return value; - } - function scan() { - startPos = pos; - hasExtendedUnicodeEscape = false; - precedingLineBreak = false; - tokenIsUnterminated = false; - while (true) { - tokenPos = pos; - if (pos >= end) { - return token = 1 /* EndOfFileToken */; - } - var ch = text.charCodeAt(pos); - switch (ch) { - case 10 /* lineFeed */: - case 13 /* carriageReturn */: - precedingLineBreak = true; - if (skipTrivia) { - pos++; - continue; - } - else { - if (ch === 13 /* carriageReturn */ && pos + 1 < end && text.charCodeAt(pos + 1) === 10 /* lineFeed */) { - // consume both CR and LF - pos += 2; - } - else { - pos++; - } - return token = 4 /* NewLineTrivia */; - } - case 9 /* tab */: - case 11 /* verticalTab */: - case 12 /* formFeed */: - case 32 /* space */: - if (skipTrivia) { - pos++; - continue; - } - else { - while (pos < end && isWhiteSpace(text.charCodeAt(pos))) { - pos++; - } - return token = 5 /* WhitespaceTrivia */; - } - case 33 /* exclamation */: - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - if (text.charCodeAt(pos + 2) === 61 /* equals */) { - return pos += 3, token = 31 /* ExclamationEqualsEqualsToken */; - } - return pos += 2, token = 29 /* ExclamationEqualsToken */; - } - return pos++, token = 46 /* ExclamationToken */; - case 34 /* doubleQuote */: - case 39 /* singleQuote */: - tokenValue = scanString(); - return token = 8 /* StringLiteral */; - case 96 /* backtick */: - return token = scanTemplateAndSetTokenValue(); - case 37 /* percent */: - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 58 /* PercentEqualsToken */; - } - return pos++, token = 37 /* PercentToken */; - case 38 /* ampersand */: - if (text.charCodeAt(pos + 1) === 38 /* ampersand */) { - return pos += 2, token = 48 /* AmpersandAmpersandToken */; - } - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 62 /* AmpersandEqualsToken */; - } - return pos++, token = 43 /* AmpersandToken */; - case 40 /* openParen */: - return pos++, token = 16 /* OpenParenToken */; - case 41 /* closeParen */: - return pos++, token = 17 /* CloseParenToken */; - case 42 /* asterisk */: - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 56 /* AsteriskEqualsToken */; - } - return pos++, token = 35 /* AsteriskToken */; - case 43 /* plus */: - if (text.charCodeAt(pos + 1) === 43 /* plus */) { - return pos += 2, token = 38 /* PlusPlusToken */; - } - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 54 /* PlusEqualsToken */; - } - return pos++, token = 33 /* PlusToken */; - case 44 /* comma */: - return pos++, token = 23 /* CommaToken */; - case 45 /* minus */: - if (text.charCodeAt(pos + 1) === 45 /* minus */) { - return pos += 2, token = 39 /* MinusMinusToken */; - } - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 55 /* MinusEqualsToken */; - } - return pos++, token = 34 /* MinusToken */; - case 46 /* dot */: - if (isDigit(text.charCodeAt(pos + 1))) { - tokenValue = "" + scanNumber(); - return token = 7 /* NumericLiteral */; - } - if (text.charCodeAt(pos + 1) === 46 /* dot */ && text.charCodeAt(pos + 2) === 46 /* dot */) { - return pos += 3, token = 21 /* DotDotDotToken */; - } - return pos++, token = 20 /* DotToken */; - case 47 /* slash */: - // Single-line comment - if (text.charCodeAt(pos + 1) === 47 /* slash */) { - pos += 2; - while (pos < end) { - if (isLineBreak(text.charCodeAt(pos))) { - break; - } - pos++; - } - if (skipTrivia) { - continue; - } - else { - return token = 2 /* SingleLineCommentTrivia */; - } - } - // Multi-line comment - if (text.charCodeAt(pos + 1) === 42 /* asterisk */) { - pos += 2; - var commentClosed = false; - while (pos < end) { - var ch_2 = text.charCodeAt(pos); - if (ch_2 === 42 /* asterisk */ && text.charCodeAt(pos + 1) === 47 /* slash */) { - pos += 2; - commentClosed = true; - break; - } - if (isLineBreak(ch_2)) { - precedingLineBreak = true; - } - pos++; - } - if (!commentClosed) { - error(ts.Diagnostics.Asterisk_Slash_expected); - } - if (skipTrivia) { - continue; - } - else { - tokenIsUnterminated = !commentClosed; - return token = 3 /* MultiLineCommentTrivia */; - } - } - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 57 /* SlashEqualsToken */; - } - return pos++, token = 36 /* SlashToken */; - case 48 /* _0 */: - if (pos + 2 < end && (text.charCodeAt(pos + 1) === 88 /* X */ || text.charCodeAt(pos + 1) === 120 /* x */)) { - pos += 2; - var value = scanMinimumNumberOfHexDigits(1); - if (value < 0) { - error(ts.Diagnostics.Hexadecimal_digit_expected); - value = 0; - } - tokenValue = "" + value; - return token = 7 /* NumericLiteral */; - } - else if (pos + 2 < end && (text.charCodeAt(pos + 1) === 66 /* B */ || text.charCodeAt(pos + 1) === 98 /* b */)) { - pos += 2; - var value = scanBinaryOrOctalDigits(2); - if (value < 0) { - error(ts.Diagnostics.Binary_digit_expected); - value = 0; - } - tokenValue = "" + value; - return token = 7 /* NumericLiteral */; - } - else if (pos + 2 < end && (text.charCodeAt(pos + 1) === 79 /* O */ || text.charCodeAt(pos + 1) === 111 /* o */)) { - pos += 2; - var value = scanBinaryOrOctalDigits(8); - if (value < 0) { - error(ts.Diagnostics.Octal_digit_expected); - value = 0; - } - tokenValue = "" + value; - return token = 7 /* NumericLiteral */; - } - // Try to parse as an octal - if (pos + 1 < end && isOctalDigit(text.charCodeAt(pos + 1))) { - tokenValue = "" + scanOctalDigits(); - return token = 7 /* NumericLiteral */; - } - // This fall-through is a deviation from the EcmaScript grammar. The grammar says that a leading zero - // can only be followed by an octal digit, a dot, or the end of the number literal. However, we are being - // permissive and allowing decimal digits of the form 08* and 09* (which many browsers also do). - case 49 /* _1 */: - case 50 /* _2 */: - case 51 /* _3 */: - case 52 /* _4 */: - case 53 /* _5 */: - case 54 /* _6 */: - case 55 /* _7 */: - case 56 /* _8 */: - case 57 /* _9 */: - tokenValue = "" + scanNumber(); - return token = 7 /* NumericLiteral */; - case 58 /* colon */: - return pos++, token = 51 /* ColonToken */; - case 59 /* semicolon */: - return pos++, token = 22 /* SemicolonToken */; - case 60 /* lessThan */: - if (isConflictMarkerTrivia(text, pos)) { - pos = scanConflictMarkerTrivia(text, pos, error); - if (skipTrivia) { - continue; - } - else { - return token = 6 /* ConflictMarkerTrivia */; - } - } - if (text.charCodeAt(pos + 1) === 60 /* lessThan */) { - if (text.charCodeAt(pos + 2) === 61 /* equals */) { - return pos += 3, token = 59 /* LessThanLessThanEqualsToken */; - } - return pos += 2, token = 40 /* LessThanLessThanToken */; - } - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 26 /* LessThanEqualsToken */; - } - return pos++, token = 24 /* LessThanToken */; - case 61 /* equals */: - if (isConflictMarkerTrivia(text, pos)) { - pos = scanConflictMarkerTrivia(text, pos, error); - if (skipTrivia) { - continue; - } - else { - return token = 6 /* ConflictMarkerTrivia */; - } - } - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - if (text.charCodeAt(pos + 2) === 61 /* equals */) { - return pos += 3, token = 30 /* EqualsEqualsEqualsToken */; - } - return pos += 2, token = 28 /* EqualsEqualsToken */; - } - if (text.charCodeAt(pos + 1) === 62 /* greaterThan */) { - return pos += 2, token = 32 /* EqualsGreaterThanToken */; - } - return pos++, token = 53 /* EqualsToken */; - case 62 /* greaterThan */: - if (isConflictMarkerTrivia(text, pos)) { - pos = scanConflictMarkerTrivia(text, pos, error); - if (skipTrivia) { - continue; - } - else { - return token = 6 /* ConflictMarkerTrivia */; - } - } - return pos++, token = 25 /* GreaterThanToken */; - case 63 /* question */: - return pos++, token = 50 /* QuestionToken */; - case 91 /* openBracket */: - return pos++, token = 18 /* OpenBracketToken */; - case 93 /* closeBracket */: - return pos++, token = 19 /* CloseBracketToken */; - case 94 /* caret */: - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 64 /* CaretEqualsToken */; - } - return pos++, token = 45 /* CaretToken */; - case 123 /* openBrace */: - return pos++, token = 14 /* OpenBraceToken */; - case 124 /* bar */: - if (text.charCodeAt(pos + 1) === 124 /* bar */) { - return pos += 2, token = 49 /* BarBarToken */; - } - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 63 /* BarEqualsToken */; - } - return pos++, token = 44 /* BarToken */; - case 125 /* closeBrace */: - return pos++, token = 15 /* CloseBraceToken */; - case 126 /* tilde */: - return pos++, token = 47 /* TildeToken */; - case 64 /* at */: - return pos++, token = 52 /* AtToken */; - case 92 /* backslash */: - var cookedChar = peekUnicodeEscape(); - if (cookedChar >= 0 && isIdentifierStart(cookedChar)) { - pos += 6; - tokenValue = String.fromCharCode(cookedChar) + scanIdentifierParts(); - return token = getIdentifierToken(); - } - error(ts.Diagnostics.Invalid_character); - return pos++, token = 0 /* Unknown */; - default: - if (isIdentifierStart(ch)) { - pos++; - while (pos < end && isIdentifierPart(ch = text.charCodeAt(pos))) - pos++; - tokenValue = text.substring(tokenPos, pos); - if (ch === 92 /* backslash */) { - tokenValue += scanIdentifierParts(); - } - return token = getIdentifierToken(); - } - else if (isWhiteSpace(ch)) { - pos++; - continue; - } - else if (isLineBreak(ch)) { - precedingLineBreak = true; - pos++; - continue; - } - error(ts.Diagnostics.Invalid_character); - return pos++, token = 0 /* Unknown */; - } - } - } - function reScanGreaterToken() { - if (token === 25 /* GreaterThanToken */) { - if (text.charCodeAt(pos) === 62 /* greaterThan */) { - if (text.charCodeAt(pos + 1) === 62 /* greaterThan */) { - if (text.charCodeAt(pos + 2) === 61 /* equals */) { - return pos += 3, token = 61 /* GreaterThanGreaterThanGreaterThanEqualsToken */; - } - return pos += 2, token = 42 /* GreaterThanGreaterThanGreaterThanToken */; - } - if (text.charCodeAt(pos + 1) === 61 /* equals */) { - return pos += 2, token = 60 /* GreaterThanGreaterThanEqualsToken */; - } - return pos++, token = 41 /* GreaterThanGreaterThanToken */; - } - if (text.charCodeAt(pos) === 61 /* equals */) { - return pos++, token = 27 /* GreaterThanEqualsToken */; - } - } - return token; - } - function reScanSlashToken() { - if (token === 36 /* SlashToken */ || token === 57 /* SlashEqualsToken */) { - var p = tokenPos + 1; - var inEscape = false; - var inCharacterClass = false; - while (true) { - // If we reach the end of a file, or hit a newline, then this is an unterminated - // regex. Report error and return what we have so far. - if (p >= end) { - tokenIsUnterminated = true; - error(ts.Diagnostics.Unterminated_regular_expression_literal); - break; - } - var ch = text.charCodeAt(p); - if (isLineBreak(ch)) { - tokenIsUnterminated = true; - error(ts.Diagnostics.Unterminated_regular_expression_literal); - break; - } - if (inEscape) { - // Parsing an escape character; - // reset the flag and just advance to the next char. - inEscape = false; - } - else if (ch === 47 /* slash */ && !inCharacterClass) { - // A slash within a character class is permissible, - // but in general it signals the end of the regexp literal. - p++; - break; - } - else if (ch === 91 /* openBracket */) { - inCharacterClass = true; - } - else if (ch === 92 /* backslash */) { - inEscape = true; - } - else if (ch === 93 /* closeBracket */) { - inCharacterClass = false; - } - p++; - } - while (p < end && isIdentifierPart(text.charCodeAt(p))) { - p++; - } - pos = p; - tokenValue = text.substring(tokenPos, pos); - token = 9 /* RegularExpressionLiteral */; - } - return token; - } - /** - * Unconditionally back up and scan a template expression portion. - */ - function reScanTemplateToken() { - ts.Debug.assert(token === 15 /* CloseBraceToken */, "'reScanTemplateToken' should only be called on a '}'"); - pos = tokenPos; - return token = scanTemplateAndSetTokenValue(); - } - function speculationHelper(callback, isLookahead) { - var savePos = pos; - var saveStartPos = startPos; - var saveTokenPos = tokenPos; - var saveToken = token; - var saveTokenValue = tokenValue; - var savePrecedingLineBreak = precedingLineBreak; - var result = callback(); - // If our callback returned something 'falsy' or we're just looking ahead, - // then unconditionally restore us to where we were. - if (!result || isLookahead) { - pos = savePos; - startPos = saveStartPos; - tokenPos = saveTokenPos; - token = saveToken; - tokenValue = saveTokenValue; - precedingLineBreak = savePrecedingLineBreak; - } - return result; - } - function lookAhead(callback) { - return speculationHelper(callback, true); - } - function tryScan(callback) { - return speculationHelper(callback, false); - } - function setText(newText, start, length) { - text = newText || ""; - end = length === undefined ? text.length : start + length; - setTextPos(start || 0); - } - function setOnError(errorCallback) { - onError = errorCallback; - } - function setScriptTarget(scriptTarget) { - languageVersion = scriptTarget; - } - function setTextPos(textPos) { - ts.Debug.assert(textPos >= 0); - pos = textPos; - startPos = textPos; - tokenPos = textPos; - token = 0 /* Unknown */; - precedingLineBreak = false; - tokenValue = undefined; - hasExtendedUnicodeEscape = false; - tokenIsUnterminated = false; - } - } - ts.createScanner = createScanner; -})(ts || (ts = {})); -/// -/* @internal */ -var ts; -(function (ts) { - ts.bindTime = 0; - (function (ModuleInstanceState) { - ModuleInstanceState[ModuleInstanceState["NonInstantiated"] = 0] = "NonInstantiated"; - ModuleInstanceState[ModuleInstanceState["Instantiated"] = 1] = "Instantiated"; - ModuleInstanceState[ModuleInstanceState["ConstEnumOnly"] = 2] = "ConstEnumOnly"; - })(ts.ModuleInstanceState || (ts.ModuleInstanceState = {})); - var ModuleInstanceState = ts.ModuleInstanceState; - function getModuleInstanceState(node) { - // A module is uninstantiated if it contains only - // 1. interface declarations, type alias declarations - if (node.kind === 205 /* InterfaceDeclaration */ || node.kind === 206 /* TypeAliasDeclaration */) { - return 0 /* NonInstantiated */; - } - else if (ts.isConstEnumDeclaration(node)) { - return 2 /* ConstEnumOnly */; - } - else if ((node.kind === 212 /* ImportDeclaration */ || node.kind === 211 /* ImportEqualsDeclaration */) && !(node.flags & 1 /* Export */)) { - return 0 /* NonInstantiated */; - } - else if (node.kind === 209 /* ModuleBlock */) { - var state = 0 /* NonInstantiated */; - ts.forEachChild(node, function (n) { - switch (getModuleInstanceState(n)) { - case 0 /* NonInstantiated */: - // child is non-instantiated - continue searching - return false; - case 2 /* ConstEnumOnly */: - // child is const enum only - record state and continue searching - state = 2 /* ConstEnumOnly */; - return false; - case 1 /* Instantiated */: - // child is instantiated - record state and stop - state = 1 /* Instantiated */; - return true; - } - }); - return state; - } - else if (node.kind === 208 /* ModuleDeclaration */) { - return getModuleInstanceState(node.body); - } - else { - return 1 /* Instantiated */; - } - } - ts.getModuleInstanceState = getModuleInstanceState; - var ContainerFlags; - (function (ContainerFlags) { - // The current node is not a container, and no container manipulation should happen before - // recursing into it. - ContainerFlags[ContainerFlags["None"] = 0] = "None"; - // The current node is a container. It should be set as the current container (and block- - // container) before recursing into it. The current node does not have locals. Examples: - // - // Classes, ObjectLiterals, TypeLiterals, Interfaces... - ContainerFlags[ContainerFlags["IsContainer"] = 1] = "IsContainer"; - // The current node is a block-scoped-container. It should be set as the current block- - // container before recursing into it. Examples: - // - // Blocks (when not parented by functions), Catch clauses, For/For-in/For-of statements... - ContainerFlags[ContainerFlags["IsBlockScopedContainer"] = 2] = "IsBlockScopedContainer"; - ContainerFlags[ContainerFlags["HasLocals"] = 4] = "HasLocals"; - // If the current node is a container that also container that also contains locals. Examples: - // - // Functions, Methods, Modules, Source-files. - ContainerFlags[ContainerFlags["IsContainerWithLocals"] = 5] = "IsContainerWithLocals"; - })(ContainerFlags || (ContainerFlags = {})); - function bindSourceFile(file) { - var start = new Date().getTime(); - bindSourceFileWorker(file); - ts.bindTime += new Date().getTime() - start; - } - ts.bindSourceFile = bindSourceFile; - function bindSourceFileWorker(file) { - var parent; - var container; - var blockScopeContainer; - var lastContainer; - var symbolCount = 0; - var Symbol = ts.objectAllocator.getSymbolConstructor(); - var classifiableNames = {}; - if (!file.locals) { - bind(file); - file.symbolCount = symbolCount; - file.classifiableNames = classifiableNames; - } - return; - function createSymbol(flags, name) { - symbolCount++; - return new Symbol(flags, name); - } - function addDeclarationToSymbol(symbol, node, symbolFlags) { - symbol.flags |= symbolFlags; - node.symbol = symbol; - if (!symbol.declarations) { - symbol.declarations = []; - } - symbol.declarations.push(node); - if (symbolFlags & 1952 /* HasExports */ && !symbol.exports) { - symbol.exports = {}; - } - if (symbolFlags & 6240 /* HasMembers */ && !symbol.members) { - symbol.members = {}; - } - if (symbolFlags & 107455 /* Value */ && !symbol.valueDeclaration) { - symbol.valueDeclaration = node; - } - } - // Should not be called on a declaration with a computed property name, - // unless it is a well known Symbol. - function getDeclarationName(node) { - if (node.name) { - if (node.kind === 208 /* ModuleDeclaration */ && node.name.kind === 8 /* StringLiteral */) { - return '"' + node.name.text + '"'; - } - if (node.name.kind === 129 /* ComputedPropertyName */) { - var nameExpression = node.name.expression; - ts.Debug.assert(ts.isWellKnownSymbolSyntactically(nameExpression)); - return ts.getPropertyNameForKnownSymbolName(nameExpression.name.text); - } - return node.name.text; - } - switch (node.kind) { - case 137 /* Constructor */: - return "__constructor"; - case 145 /* FunctionType */: - case 140 /* CallSignature */: - return "__call"; - case 146 /* ConstructorType */: - case 141 /* ConstructSignature */: - return "__new"; - case 142 /* IndexSignature */: - return "__index"; - case 218 /* ExportDeclaration */: - return "__export"; - case 217 /* ExportAssignment */: - return node.isExportEquals ? "export=" : "default"; - case 203 /* FunctionDeclaration */: - case 204 /* ClassDeclaration */: - return node.flags & 256 /* Default */ ? "default" : undefined; - } - } - function getDisplayName(node) { - return node.name ? ts.declarationNameToString(node.name) : getDeclarationName(node); - } - function declareSymbol(symbolTable, parent, node, includes, excludes) { - ts.Debug.assert(!ts.hasDynamicName(node)); - // The exported symbol for an export default function/class node is always named "default" - var name = node.flags & 256 /* Default */ && parent ? "default" : getDeclarationName(node); - var symbol; - if (name !== undefined) { - // Check and see if the symbol table already has a symbol with this name. If not, - // create a new symbol with this name and add it to the table. Note that we don't - // give the new symbol any flags *yet*. This ensures that it will not conflict - // witht he 'excludes' flags we pass in. - // - // If we do get an existing symbol, see if it conflicts with the new symbol we're - // creating. For example, a 'var' symbol and a 'class' symbol will conflict within - // the same symbol table. If we have a conflict, report the issue on each - // declaration we have for this symbol, and then create a new symbol for this - // declaration. - // - // If we created a new symbol, either because we didn't have a symbol with this name - // in the symbol table, or we conflicted with an existing symbol, then just add this - // node as the sole declaration of the new symbol. - // - // Otherwise, we'll be merging into a compatible existing symbol (for example when - // you have multiple 'vars' with the same name in the same container). In this case - // just add this node into the declarations list of the symbol. - symbol = ts.hasProperty(symbolTable, name) - ? symbolTable[name] - : (symbolTable[name] = createSymbol(0 /* None */, name)); - if (name && (includes & 788448 /* Classifiable */)) { - classifiableNames[name] = name; - } - if (symbol.flags & excludes) { - if (node.name) { - node.name.parent = node; - } - // Report errors every position with duplicate declaration - // Report errors on previous encountered declarations - var message = symbol.flags & 2 /* BlockScopedVariable */ - ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 - : ts.Diagnostics.Duplicate_identifier_0; - ts.forEach(symbol.declarations, function (declaration) { - file.bindDiagnostics.push(ts.createDiagnosticForNode(declaration.name || declaration, message, getDisplayName(declaration))); - }); - file.bindDiagnostics.push(ts.createDiagnosticForNode(node.name || node, message, getDisplayName(node))); - symbol = createSymbol(0 /* None */, name); - } - } - else { - symbol = createSymbol(0 /* None */, "__missing"); - } - addDeclarationToSymbol(symbol, node, includes); - symbol.parent = parent; - return symbol; - } - function declareModuleMember(node, symbolFlags, symbolExcludes) { - var hasExportModifier = ts.getCombinedNodeFlags(node) & 1 /* Export */; - if (symbolFlags & 8388608 /* Alias */) { - if (node.kind === 220 /* ExportSpecifier */ || (node.kind === 211 /* ImportEqualsDeclaration */ && hasExportModifier)) { - return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); - } - else { - return declareSymbol(container.locals, undefined, node, symbolFlags, symbolExcludes); - } - } - else { - // Exported module members are given 2 symbols: A local symbol that is classified with an ExportValue, - // ExportType, or ExportContainer flag, and an associated export symbol with all the correct flags set - // on it. There are 2 main reasons: - // - // 1. We treat locals and exports of the same name as mutually exclusive within a container. - // That means the binder will issue a Duplicate Identifier error if you mix locals and exports - // with the same name in the same container. - // TODO: Make this a more specific error and decouple it from the exclusion logic. - // 2. When we checkIdentifier in the checker, we set its resolved symbol to the local symbol, - // but return the export symbol (by calling getExportSymbolOfValueSymbolIfExported). That way - // when the emitter comes back to it, it knows not to qualify the name if it was found in a containing scope. - if (hasExportModifier || container.flags & 65536 /* ExportContext */) { - var exportKind = (symbolFlags & 107455 /* Value */ ? 1048576 /* ExportValue */ : 0) | - (symbolFlags & 793056 /* Type */ ? 2097152 /* ExportType */ : 0) | - (symbolFlags & 1536 /* Namespace */ ? 4194304 /* ExportNamespace */ : 0); - var local = declareSymbol(container.locals, undefined, node, exportKind, symbolExcludes); - local.exportSymbol = declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); - node.localSymbol = local; - return local; - } - else { - return declareSymbol(container.locals, undefined, node, symbolFlags, symbolExcludes); - } - } - } - // All container nodes are kept on a linked list in declaration order. This list is used by - // the getLocalNameOfContainer function in the type checker to validate that the local name - // used for a container is unique. - function bindChildren(node) { - // Before we recurse into a node's chilren, we first save the existing parent, container - // and block-container. Then after we pop out of processing the children, we restore - // these saved values. - var saveParent = parent; - var saveContainer = container; - var savedBlockScopeContainer = blockScopeContainer; - // This node will now be set as the parent of all of its children as we recurse into them. - parent = node; - // Depending on what kind of node this is, we may have to adjust the current container - // and block-container. If the current node is a container, then it is automatically - // considered the current block-container as well. Also, for containers that we know - // may contain locals, we proactively initialize the .locals field. We do this because - // it's highly likely that the .locals will be needed to place some child in (for example, - // a parameter, or variable declaration). - // - // However, we do not proactively create the .locals for block-containers because it's - // totally normal and common for block-containers to never actually have a block-scoped - // variable in them. We don't want to end up allocating an object for every 'block' we - // run into when most of them won't be necessary. - // - // Finally, if this is a block-container, then we clear out any existing .locals object - // it may contain within it. This happens in incremental scenarios. Because we can be - // reusing a node from a previous compilation, that node may have had 'locals' created - // for it. We must clear this so we don't accidently move any stale data forward from - // a previous compilation. - var containerFlags = getContainerFlags(node); - if (containerFlags & 1 /* IsContainer */) { - container = blockScopeContainer = node; - if (containerFlags & 4 /* HasLocals */) { - container.locals = {}; - } - addToContainerChain(container); - } - else if (containerFlags & 2 /* IsBlockScopedContainer */) { - blockScopeContainer = node; - blockScopeContainer.locals = undefined; - } - ts.forEachChild(node, bind); - container = saveContainer; - parent = saveParent; - blockScopeContainer = savedBlockScopeContainer; - } - function getContainerFlags(node) { - switch (node.kind) { - case 177 /* ClassExpression */: - case 204 /* ClassDeclaration */: - case 205 /* InterfaceDeclaration */: - case 207 /* EnumDeclaration */: - case 148 /* TypeLiteral */: - case 157 /* ObjectLiteralExpression */: - return 1 /* IsContainer */; - case 140 /* CallSignature */: - case 141 /* ConstructSignature */: - case 142 /* IndexSignature */: - case 136 /* MethodDeclaration */: - case 135 /* MethodSignature */: - case 203 /* FunctionDeclaration */: - case 137 /* Constructor */: - case 138 /* GetAccessor */: - case 139 /* SetAccessor */: - case 145 /* FunctionType */: - case 146 /* ConstructorType */: - case 165 /* FunctionExpression */: - case 166 /* ArrowFunction */: - case 208 /* ModuleDeclaration */: - case 230 /* SourceFile */: - case 206 /* TypeAliasDeclaration */: - return 5 /* IsContainerWithLocals */; - case 226 /* CatchClause */: - case 189 /* ForStatement */: - case 190 /* ForInStatement */: - case 191 /* ForOfStatement */: - case 210 /* CaseBlock */: - return 2 /* IsBlockScopedContainer */; - case 182 /* Block */: - // do not treat blocks directly inside a function as a block-scoped-container. - // Locals that reside in this block should go to the function locals. Othewise 'x' - // would not appear to be a redeclaration of a block scoped local in the following - // example: - // - // function foo() { - // var x; - // let x; - // } - // - // If we placed 'var x' into the function locals and 'let x' into the locals of - // the block, then there would be no collision. - // - // By not creating a new block-scoped-container here, we ensure that both 'var x' - // and 'let x' go into the Function-container's locals, and we do get a collision - // conflict. - return ts.isFunctionLike(node.parent) ? 0 /* None */ : 2 /* IsBlockScopedContainer */; - } - return 0 /* None */; - } - function addToContainerChain(next) { - if (lastContainer) { - lastContainer.nextContainer = next; - } - lastContainer = next; - } - function declareSymbolAndAddToSymbolTable(node, symbolFlags, symbolExcludes) { - // Just call this directly so that the return type of this function stays "void". - declareSymbolAndAddToSymbolTableWorker(node, symbolFlags, symbolExcludes); - } - function declareSymbolAndAddToSymbolTableWorker(node, symbolFlags, symbolExcludes) { - switch (container.kind) { - // Modules, source files, and classes need specialized handling for how their - // members are declared (for example, a member of a class will go into a specific - // symbol table depending on if it is static or not). We defer to specialized - // handlers to take care of declaring these child members. - case 208 /* ModuleDeclaration */: - return declareModuleMember(node, symbolFlags, symbolExcludes); - case 230 /* SourceFile */: - return declareSourceFileMember(node, symbolFlags, symbolExcludes); - case 177 /* ClassExpression */: - case 204 /* ClassDeclaration */: - return declareClassMember(node, symbolFlags, symbolExcludes); - case 207 /* EnumDeclaration */: - return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); - case 148 /* TypeLiteral */: - case 157 /* ObjectLiteralExpression */: - case 205 /* InterfaceDeclaration */: - // Interface/Object-types always have their children added to the 'members' of - // their container. They are only accessible through an instance of their - // container, and are never in scope otherwise (even inside the body of the - // object / type / interface declaring them). An exception is type parameters, - // which are in scope without qualification (similar to 'locals'). - return declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes); - case 145 /* FunctionType */: - case 146 /* ConstructorType */: - case 140 /* CallSignature */: - case 141 /* ConstructSignature */: - case 142 /* IndexSignature */: - case 136 /* MethodDeclaration */: - case 135 /* MethodSignature */: - case 137 /* Constructor */: - case 138 /* GetAccessor */: - case 139 /* SetAccessor */: - case 203 /* FunctionDeclaration */: - case 165 /* FunctionExpression */: - case 166 /* ArrowFunction */: - case 206 /* TypeAliasDeclaration */: - // All the children of these container types are never visible through another - // symbol (i.e. through another symbol's 'exports' or 'members'). Instead, - // they're only accessed 'lexically' (i.e. from code that exists underneath - // their container in the tree. To accomplish this, we simply add their declared - // symbol to the 'locals' of the container. These symbols can then be found as - // the type checker walks up the containers, checking them for matching names. - return declareSymbol(container.locals, undefined, node, symbolFlags, symbolExcludes); - } - } - function declareClassMember(node, symbolFlags, symbolExcludes) { - return node.flags & 128 /* Static */ - ? declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes) - : declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes); - } - function declareSourceFileMember(node, symbolFlags, symbolExcludes) { - return ts.isExternalModule(file) - ? declareModuleMember(node, symbolFlags, symbolExcludes) - : declareSymbol(file.locals, undefined, node, symbolFlags, symbolExcludes); - } - function isAmbientContext(node) { - while (node) { - if (node.flags & 2 /* Ambient */) { - return true; - } - node = node.parent; - } - return false; - } - function hasExportDeclarations(node) { - var body = node.kind === 230 /* SourceFile */ ? node : node.body; - if (body.kind === 230 /* SourceFile */ || body.kind === 209 /* ModuleBlock */) { - for (var _i = 0, _a = body.statements; _i < _a.length; _i++) { - var stat = _a[_i]; - if (stat.kind === 218 /* ExportDeclaration */ || stat.kind === 217 /* ExportAssignment */) { - return true; - } - } - } - return false; - } - function setExportContextFlag(node) { - // A declaration source file or ambient module declaration that contains no export declarations (but possibly regular - // declarations with export modifiers) is an export context in which declarations are implicitly exported. - if (isAmbientContext(node) && !hasExportDeclarations(node)) { - node.flags |= 65536 /* ExportContext */; - } - else { - node.flags &= ~65536 /* ExportContext */; - } - } - function bindModuleDeclaration(node) { - setExportContextFlag(node); - if (node.name.kind === 8 /* StringLiteral */) { - declareSymbolAndAddToSymbolTable(node, 512 /* ValueModule */, 106639 /* ValueModuleExcludes */); - } - else { - var state = getModuleInstanceState(node); - if (state === 0 /* NonInstantiated */) { - declareSymbolAndAddToSymbolTable(node, 1024 /* NamespaceModule */, 0 /* NamespaceModuleExcludes */); - } - else { - declareSymbolAndAddToSymbolTable(node, 512 /* ValueModule */, 106639 /* ValueModuleExcludes */); - var currentModuleIsConstEnumOnly = state === 2 /* ConstEnumOnly */; - if (node.symbol.constEnumOnlyModule === undefined) { - // non-merged case - use the current state - node.symbol.constEnumOnlyModule = currentModuleIsConstEnumOnly; - } - else { - // merged case: module is const enum only if all its pieces are non-instantiated or const enum - node.symbol.constEnumOnlyModule = node.symbol.constEnumOnlyModule && currentModuleIsConstEnumOnly; - } - } - } - } - function bindFunctionOrConstructorType(node) { - // For a given function symbol "<...>(...) => T" we want to generate a symbol identical - // to the one we would get for: { <...>(...): T } - // - // We do that by making an anonymous type literal symbol, and then setting the function - // symbol as its sole member. To the rest of the system, this symbol will be indistinguishable - // from an actual type literal symbol you would have gotten had you used the long form. - var symbol = createSymbol(131072 /* Signature */, getDeclarationName(node)); - addDeclarationToSymbol(symbol, node, 131072 /* Signature */); - var typeLiteralSymbol = createSymbol(2048 /* TypeLiteral */, "__type"); - addDeclarationToSymbol(typeLiteralSymbol, node, 2048 /* TypeLiteral */); - typeLiteralSymbol.members = (_a = {}, _a[symbol.name] = symbol, _a); - var _a; - } - function bindAnonymousDeclaration(node, symbolFlags, name) { - var symbol = createSymbol(symbolFlags, name); - addDeclarationToSymbol(symbol, node, symbolFlags); - } - function bindBlockScopedDeclaration(node, symbolFlags, symbolExcludes) { - switch (blockScopeContainer.kind) { - case 208 /* ModuleDeclaration */: - declareModuleMember(node, symbolFlags, symbolExcludes); - break; - case 230 /* SourceFile */: - if (ts.isExternalModule(container)) { - declareModuleMember(node, symbolFlags, symbolExcludes); - break; - } - // fall through. - default: - if (!blockScopeContainer.locals) { - blockScopeContainer.locals = {}; - addToContainerChain(blockScopeContainer); - } - declareSymbol(blockScopeContainer.locals, undefined, node, symbolFlags, symbolExcludes); - } - } - function bindBlockScopedVariableDeclaration(node) { - bindBlockScopedDeclaration(node, 2 /* BlockScopedVariable */, 107455 /* BlockScopedVariableExcludes */); - } - function getDestructuringParameterName(node) { - return "__" + ts.indexOf(node.parent.parameters, node); - } - function bind(node) { - node.parent = parent; - // First we bind declaration nodes to a symbol if possible. We'll both create a symbol - // and then potentially add the symbol to an appropriate symbol table. Possible - // destination symbol tables are: - // - // 1) The 'exports' table of the current container's symbol. - // 2) The 'members' table of the current container's symbol. - // 3) The 'locals' table of the current container. - // - // However, not all symbols will end up in any of these tables. 'Anonymous' symbols - // (like TypeLiterals for example) will not be put in any table. - bindWorker(node); - // Then we recurse into the children of the node to bind them as well. For certain - // symbols we do specialized work when we recurse. For example, we'll keep track of - // the current 'container' node when it changes. This helps us know which symbol table - // a local should go into for example. - bindChildren(node); - } - function bindWorker(node) { - switch (node.kind) { - case 130 /* TypeParameter */: - return declareSymbolAndAddToSymbolTable(node, 262144 /* TypeParameter */, 530912 /* TypeParameterExcludes */); - case 131 /* Parameter */: - return bindParameter(node); - case 201 /* VariableDeclaration */: - case 155 /* BindingElement */: - return bindVariableDeclarationOrBindingElement(node); - case 134 /* PropertyDeclaration */: - case 133 /* PropertySignature */: - return bindPropertyOrMethodOrAccessor(node, 4 /* Property */ | (node.questionToken ? 536870912 /* Optional */ : 0 /* None */), 107455 /* PropertyExcludes */); - case 227 /* PropertyAssignment */: - case 228 /* ShorthandPropertyAssignment */: - return bindPropertyOrMethodOrAccessor(node, 4 /* Property */, 107455 /* PropertyExcludes */); - case 229 /* EnumMember */: - return bindPropertyOrMethodOrAccessor(node, 8 /* EnumMember */, 107455 /* EnumMemberExcludes */); - case 140 /* CallSignature */: - case 141 /* ConstructSignature */: - case 142 /* IndexSignature */: - return declareSymbolAndAddToSymbolTable(node, 131072 /* Signature */, 0 /* None */); - case 136 /* MethodDeclaration */: - case 135 /* MethodSignature */: - // If this is an ObjectLiteralExpression method, then it sits in the same space - // as other properties in the object literal. So we use SymbolFlags.PropertyExcludes - // so that it will conflict with any other object literal members with the same - // name. - return bindPropertyOrMethodOrAccessor(node, 8192 /* Method */ | (node.questionToken ? 536870912 /* Optional */ : 0 /* None */), ts.isObjectLiteralMethod(node) ? 107455 /* PropertyExcludes */ : 99263 /* MethodExcludes */); - case 203 /* FunctionDeclaration */: - return declareSymbolAndAddToSymbolTable(node, 16 /* Function */, 106927 /* FunctionExcludes */); - case 137 /* Constructor */: - return declareSymbolAndAddToSymbolTable(node, 16384 /* Constructor */, 0 /* None */); - case 138 /* GetAccessor */: - return bindPropertyOrMethodOrAccessor(node, 32768 /* GetAccessor */, 41919 /* GetAccessorExcludes */); - case 139 /* SetAccessor */: - return bindPropertyOrMethodOrAccessor(node, 65536 /* SetAccessor */, 74687 /* SetAccessorExcludes */); - case 145 /* FunctionType */: - case 146 /* ConstructorType */: - return bindFunctionOrConstructorType(node); - case 148 /* TypeLiteral */: - return bindAnonymousDeclaration(node, 2048 /* TypeLiteral */, "__type"); - case 157 /* ObjectLiteralExpression */: - return bindAnonymousDeclaration(node, 4096 /* ObjectLiteral */, "__object"); - case 165 /* FunctionExpression */: - case 166 /* ArrowFunction */: - return bindAnonymousDeclaration(node, 16 /* Function */, "__function"); - case 177 /* ClassExpression */: - case 204 /* ClassDeclaration */: - return bindClassLikeDeclaration(node); - case 205 /* InterfaceDeclaration */: - return bindBlockScopedDeclaration(node, 64 /* Interface */, 792992 /* InterfaceExcludes */); - case 206 /* TypeAliasDeclaration */: - return bindBlockScopedDeclaration(node, 524288 /* TypeAlias */, 793056 /* TypeAliasExcludes */); - case 207 /* EnumDeclaration */: - return bindEnumDeclaration(node); - case 208 /* ModuleDeclaration */: - return bindModuleDeclaration(node); - case 211 /* ImportEqualsDeclaration */: - case 214 /* NamespaceImport */: - case 216 /* ImportSpecifier */: - case 220 /* ExportSpecifier */: - return declareSymbolAndAddToSymbolTable(node, 8388608 /* Alias */, 8388608 /* AliasExcludes */); - case 213 /* ImportClause */: - return bindImportClause(node); - case 218 /* ExportDeclaration */: - return bindExportDeclaration(node); - case 217 /* ExportAssignment */: - return bindExportAssignment(node); - case 230 /* SourceFile */: - return bindSourceFileIfExternalModule(); - } - } - function bindSourceFileIfExternalModule() { - setExportContextFlag(file); - if (ts.isExternalModule(file)) { - bindAnonymousDeclaration(file, 512 /* ValueModule */, '"' + ts.removeFileExtension(file.fileName) + '"'); - } - } - function bindExportAssignment(node) { - if (!container.symbol || !container.symbol.exports) { - // Export assignment in some sort of block construct - bindAnonymousDeclaration(node, 8388608 /* Alias */, getDeclarationName(node)); - } - else if (node.expression.kind === 65 /* Identifier */) { - // An export default clause with an identifier exports all meanings of that identifier - declareSymbol(container.symbol.exports, container.symbol, node, 8388608 /* Alias */, 107455 /* PropertyExcludes */ | 8388608 /* AliasExcludes */); - } - else { - // An export default clause with an expression exports a value - declareSymbol(container.symbol.exports, container.symbol, node, 4 /* Property */, 107455 /* PropertyExcludes */ | 8388608 /* AliasExcludes */); - } - } - function bindExportDeclaration(node) { - if (!container.symbol || !container.symbol.exports) { - // Export * in some sort of block construct - bindAnonymousDeclaration(node, 1073741824 /* ExportStar */, getDeclarationName(node)); - } - else if (!node.exportClause) { - // All export * declarations are collected in an __export symbol - declareSymbol(container.symbol.exports, container.symbol, node, 1073741824 /* ExportStar */, 0 /* None */); - } - } - function bindImportClause(node) { - if (node.name) { - declareSymbolAndAddToSymbolTable(node, 8388608 /* Alias */, 8388608 /* AliasExcludes */); - } - } - function bindClassLikeDeclaration(node) { - if (node.kind === 204 /* ClassDeclaration */) { - bindBlockScopedDeclaration(node, 32 /* Class */, 899583 /* ClassExcludes */); - } - else { - bindAnonymousDeclaration(node, 32 /* Class */, "__class"); - } - var symbol = node.symbol; - // TypeScript 1.0 spec (April 2014): 8.4 - // Every class automatically contains a static property member named 'prototype', the - // type of which is an instantiation of the class type with type Any supplied as a type - // argument for each type parameter. It is an error to explicitly declare a static - // property member with the name 'prototype'. - // - // Note: we check for this here because this class may be merging into a module. The - // module might have an exported variable called 'prototype'. We can't allow that as - // that would clash with the built-in 'prototype' for the class. - var prototypeSymbol = createSymbol(4 /* Property */ | 134217728 /* Prototype */, "prototype"); - if (ts.hasProperty(symbol.exports, prototypeSymbol.name)) { - if (node.name) { - node.name.parent = node; - } - file.bindDiagnostics.push(ts.createDiagnosticForNode(symbol.exports[prototypeSymbol.name].declarations[0], ts.Diagnostics.Duplicate_identifier_0, prototypeSymbol.name)); - } - symbol.exports[prototypeSymbol.name] = prototypeSymbol; - prototypeSymbol.parent = symbol; - } - function bindEnumDeclaration(node) { - return ts.isConst(node) - ? bindBlockScopedDeclaration(node, 128 /* ConstEnum */, 899967 /* ConstEnumExcludes */) - : bindBlockScopedDeclaration(node, 256 /* RegularEnum */, 899327 /* RegularEnumExcludes */); - } - function bindVariableDeclarationOrBindingElement(node) { - if (!ts.isBindingPattern(node.name)) { - if (ts.isBlockOrCatchScoped(node)) { - bindBlockScopedVariableDeclaration(node); - } - else if (ts.isParameterDeclaration(node)) { - // It is safe to walk up parent chain to find whether the node is a destructing parameter declaration - // because its parent chain has already been set up, since parents are set before descending into children. - // - // If node is a binding element in parameter declaration, we need to use ParameterExcludes. - // Using ParameterExcludes flag allows the compiler to report an error on duplicate identifiers in Parameter Declaration - // For example: - // function foo([a,a]) {} // Duplicate Identifier error - // function bar(a,a) {} // Duplicate Identifier error, parameter declaration in this case is handled in bindParameter - // // which correctly set excluded symbols - declareSymbolAndAddToSymbolTable(node, 1 /* FunctionScopedVariable */, 107455 /* ParameterExcludes */); - } - else { - declareSymbolAndAddToSymbolTable(node, 1 /* FunctionScopedVariable */, 107454 /* FunctionScopedVariableExcludes */); - } - } - } - function bindParameter(node) { - if (ts.isBindingPattern(node.name)) { - bindAnonymousDeclaration(node, 1 /* FunctionScopedVariable */, getDestructuringParameterName(node)); - } - else { - declareSymbolAndAddToSymbolTable(node, 1 /* FunctionScopedVariable */, 107455 /* ParameterExcludes */); - } - // If this is a property-parameter, then also declare the property symbol into the - // containing class. - if (node.flags & 112 /* AccessibilityModifier */ && - node.parent.kind === 137 /* Constructor */ && - (node.parent.parent.kind === 204 /* ClassDeclaration */ || node.parent.parent.kind === 177 /* ClassExpression */)) { - var classDeclaration = node.parent.parent; - declareSymbol(classDeclaration.symbol.members, classDeclaration.symbol, node, 4 /* Property */, 107455 /* PropertyExcludes */); - } - } - function bindPropertyOrMethodOrAccessor(node, symbolFlags, symbolExcludes) { - return ts.hasDynamicName(node) - ? bindAnonymousDeclaration(node, symbolFlags, "__computed") - : declareSymbolAndAddToSymbolTable(node, symbolFlags, symbolExcludes); - } - } -})(ts || (ts = {})); -/// -/* @internal */ -var ts; -(function (ts) { - function getDeclarationOfKind(symbol, kind) { - var declarations = symbol.declarations; - for (var _i = 0; _i < declarations.length; _i++) { - var declaration = declarations[_i]; - if (declaration.kind === kind) { - return declaration; - } - } - return undefined; - } - ts.getDeclarationOfKind = getDeclarationOfKind; - // Pool writers to avoid needing to allocate them for every symbol we write. - var stringWriters = []; - function getSingleLineStringWriter() { - if (stringWriters.length == 0) { - var str = ""; - var writeText = function (text) { return str += text; }; - return { - string: function () { return str; }, - writeKeyword: writeText, - writeOperator: writeText, - writePunctuation: writeText, - writeSpace: writeText, - writeStringLiteral: writeText, - writeParameter: writeText, - writeSymbol: writeText, - // Completely ignore indentation for string writers. And map newlines to - // a single space. - writeLine: function () { return str += " "; }, - increaseIndent: function () { }, - decreaseIndent: function () { }, - clear: function () { return str = ""; }, - trackSymbol: function () { } - }; - } - return stringWriters.pop(); - } - ts.getSingleLineStringWriter = getSingleLineStringWriter; - function releaseStringWriter(writer) { - writer.clear(); - stringWriters.push(writer); - } - ts.releaseStringWriter = releaseStringWriter; - function getFullWidth(node) { - return node.end - node.pos; - } - ts.getFullWidth = getFullWidth; - // Returns true if this node contains a parse error anywhere underneath it. - function containsParseError(node) { - aggregateChildData(node); - return (node.parserContextFlags & 128 /* ThisNodeOrAnySubNodesHasError */) !== 0; - } - ts.containsParseError = containsParseError; - function aggregateChildData(node) { - if (!(node.parserContextFlags & 256 /* HasAggregatedChildData */)) { - // A node is considered to contain a parse error if: - // a) the parser explicitly marked that it had an error - // b) any of it's children reported that it had an error. - var thisNodeOrAnySubNodesHasError = ((node.parserContextFlags & 32 /* ThisNodeHasError */) !== 0) || - ts.forEachChild(node, containsParseError); - // If so, mark ourselves accordingly. - if (thisNodeOrAnySubNodesHasError) { - node.parserContextFlags |= 128 /* ThisNodeOrAnySubNodesHasError */; - } - // Also mark that we've propogated the child information to this node. This way we can - // always consult the bit directly on this node without needing to check its children - // again. - node.parserContextFlags |= 256 /* HasAggregatedChildData */; - } - } - function getSourceFileOfNode(node) { - while (node && node.kind !== 230 /* SourceFile */) { - node = node.parent; - } - return node; - } - ts.getSourceFileOfNode = getSourceFileOfNode; - function getStartPositionOfLine(line, sourceFile) { - ts.Debug.assert(line >= 0); - return ts.getLineStarts(sourceFile)[line]; - } - ts.getStartPositionOfLine = getStartPositionOfLine; - // This is a useful function for debugging purposes. - function nodePosToString(node) { - var file = getSourceFileOfNode(node); - var loc = ts.getLineAndCharacterOfPosition(file, node.pos); - return file.fileName + "(" + (loc.line + 1) + "," + (loc.character + 1) + ")"; - } - ts.nodePosToString = nodePosToString; - function getStartPosOfNode(node) { - return node.pos; - } - ts.getStartPosOfNode = getStartPosOfNode; - // Returns true if this node is missing from the actual source code. 'missing' is different - // from 'undefined/defined'. When a node is undefined (which can happen for optional nodes - // in the tree), it is definitel missing. HOwever, a node may be defined, but still be - // missing. This happens whenever the parser knows it needs to parse something, but can't - // get anything in the source code that it expects at that location. For example: - // - // let a: ; - // - // Here, the Type in the Type-Annotation is not-optional (as there is a colon in the source - // code). So the parser will attempt to parse out a type, and will create an actual node. - // However, this node will be 'missing' in the sense that no actual source-code/tokens are - // contained within it. - function nodeIsMissing(node) { - if (!node) { - return true; - } - return node.pos === node.end && node.kind !== 1 /* EndOfFileToken */; - } - ts.nodeIsMissing = nodeIsMissing; - function nodeIsPresent(node) { - return !nodeIsMissing(node); - } - ts.nodeIsPresent = nodeIsPresent; - function getTokenPosOfNode(node, sourceFile) { - // With nodes that have no width (i.e. 'Missing' nodes), we actually *don't* - // want to skip trivia because this will launch us forward to the next token. - if (nodeIsMissing(node)) { - return node.pos; - } - return ts.skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.pos); - } - ts.getTokenPosOfNode = getTokenPosOfNode; - function getNonDecoratorTokenPosOfNode(node, sourceFile) { - if (nodeIsMissing(node) || !node.decorators) { - return getTokenPosOfNode(node, sourceFile); - } - return ts.skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.decorators.end); - } - ts.getNonDecoratorTokenPosOfNode = getNonDecoratorTokenPosOfNode; - function getSourceTextOfNodeFromSourceFile(sourceFile, node) { - if (nodeIsMissing(node)) { - return ""; - } - var text = sourceFile.text; - return text.substring(ts.skipTrivia(text, node.pos), node.end); - } - ts.getSourceTextOfNodeFromSourceFile = getSourceTextOfNodeFromSourceFile; - function getTextOfNodeFromSourceText(sourceText, node) { - if (nodeIsMissing(node)) { - return ""; - } - return sourceText.substring(ts.skipTrivia(sourceText, node.pos), node.end); - } - ts.getTextOfNodeFromSourceText = getTextOfNodeFromSourceText; - function getTextOfNode(node) { - return getSourceTextOfNodeFromSourceFile(getSourceFileOfNode(node), node); - } - ts.getTextOfNode = getTextOfNode; - // Add an extra underscore to identifiers that start with two underscores to avoid issues with magic names like '__proto__' - function escapeIdentifier(identifier) { - return identifier.length >= 2 && identifier.charCodeAt(0) === 95 /* _ */ && identifier.charCodeAt(1) === 95 /* _ */ ? "_" + identifier : identifier; - } - ts.escapeIdentifier = escapeIdentifier; - // Remove extra underscore from escaped identifier - function unescapeIdentifier(identifier) { - return identifier.length >= 3 && identifier.charCodeAt(0) === 95 /* _ */ && identifier.charCodeAt(1) === 95 /* _ */ && identifier.charCodeAt(2) === 95 /* _ */ ? identifier.substr(1) : identifier; - } - ts.unescapeIdentifier = unescapeIdentifier; - // Make an identifier from an external module name by extracting the string after the last "/" and replacing - // all non-alphanumeric characters with underscores - function makeIdentifierFromModuleName(moduleName) { - return ts.getBaseFileName(moduleName).replace(/\W/g, "_"); - } - ts.makeIdentifierFromModuleName = makeIdentifierFromModuleName; - function isBlockOrCatchScoped(declaration) { - return (getCombinedNodeFlags(declaration) & 12288 /* BlockScoped */) !== 0 || - isCatchClauseVariableDeclaration(declaration); - } - ts.isBlockOrCatchScoped = isBlockOrCatchScoped; - // Gets the nearest enclosing block scope container that has the provided node - // as a descendant, that is not the provided node. - function getEnclosingBlockScopeContainer(node) { - var current = node.parent; - while (current) { - if (isFunctionLike(current)) { - return current; - } - switch (current.kind) { - case 230 /* SourceFile */: - case 210 /* CaseBlock */: - case 226 /* CatchClause */: - case 208 /* ModuleDeclaration */: - case 189 /* ForStatement */: - case 190 /* ForInStatement */: - case 191 /* ForOfStatement */: - return current; - case 182 /* Block */: - // function block is not considered block-scope container - // see comment in binder.ts: bind(...), case for SyntaxKind.Block - if (!isFunctionLike(current.parent)) { - return current; - } - } - current = current.parent; - } - } - ts.getEnclosingBlockScopeContainer = getEnclosingBlockScopeContainer; - function isCatchClauseVariableDeclaration(declaration) { - return declaration && - declaration.kind === 201 /* VariableDeclaration */ && - declaration.parent && - declaration.parent.kind === 226 /* CatchClause */; - } - ts.isCatchClauseVariableDeclaration = isCatchClauseVariableDeclaration; - // Return display name of an identifier - // Computed property names will just be emitted as "[]", where is the source - // text of the expression in the computed property. - function declarationNameToString(name) { - return getFullWidth(name) === 0 ? "(Missing)" : getTextOfNode(name); - } - ts.declarationNameToString = declarationNameToString; - function createDiagnosticForNode(node, message, arg0, arg1, arg2) { - var sourceFile = getSourceFileOfNode(node); - var span = getErrorSpanForNode(sourceFile, node); - return ts.createFileDiagnostic(sourceFile, span.start, span.length, message, arg0, arg1, arg2); - } - ts.createDiagnosticForNode = createDiagnosticForNode; - function createDiagnosticForNodeFromMessageChain(node, messageChain) { - var sourceFile = getSourceFileOfNode(node); - var span = getErrorSpanForNode(sourceFile, node); - return { - file: sourceFile, - start: span.start, - length: span.length, - code: messageChain.code, - category: messageChain.category, - messageText: messageChain.next ? messageChain : messageChain.messageText - }; - } - ts.createDiagnosticForNodeFromMessageChain = createDiagnosticForNodeFromMessageChain; - function getSpanOfTokenAtPosition(sourceFile, pos) { - var scanner = ts.createScanner(sourceFile.languageVersion, true, sourceFile.text, undefined, pos); - scanner.scan(); - var start = scanner.getTokenPos(); - return ts.createTextSpanFromBounds(start, scanner.getTextPos()); - } - ts.getSpanOfTokenAtPosition = getSpanOfTokenAtPosition; - function getErrorSpanForNode(sourceFile, node) { - var errorNode = node; - switch (node.kind) { - case 230 /* SourceFile */: - var pos_1 = ts.skipTrivia(sourceFile.text, 0, false); - if (pos_1 === sourceFile.text.length) { - // file is empty - return span for the beginning of the file - return ts.createTextSpan(0, 0); - } - return getSpanOfTokenAtPosition(sourceFile, pos_1); - // This list is a work in progress. Add missing node kinds to improve their error - // spans. - case 201 /* VariableDeclaration */: - case 155 /* BindingElement */: - case 204 /* ClassDeclaration */: - case 177 /* ClassExpression */: - case 205 /* InterfaceDeclaration */: - case 208 /* ModuleDeclaration */: - case 207 /* EnumDeclaration */: - case 229 /* EnumMember */: - case 203 /* FunctionDeclaration */: - case 165 /* FunctionExpression */: - errorNode = node.name; - break; - } - if (errorNode === undefined) { - // If we don't have a better node, then just set the error on the first token of - // construct. - return getSpanOfTokenAtPosition(sourceFile, node.pos); - } - var pos = nodeIsMissing(errorNode) - ? errorNode.pos - : ts.skipTrivia(sourceFile.text, errorNode.pos); - return ts.createTextSpanFromBounds(pos, errorNode.end); - } - ts.getErrorSpanForNode = getErrorSpanForNode; - function isExternalModule(file) { - return file.externalModuleIndicator !== undefined; - } - ts.isExternalModule = isExternalModule; - function isDeclarationFile(file) { - return (file.flags & 2048 /* DeclarationFile */) !== 0; - } - ts.isDeclarationFile = isDeclarationFile; - function isConstEnumDeclaration(node) { - return node.kind === 207 /* EnumDeclaration */ && isConst(node); - } - ts.isConstEnumDeclaration = isConstEnumDeclaration; - function walkUpBindingElementsAndPatterns(node) { - while (node && (node.kind === 155 /* BindingElement */ || isBindingPattern(node))) { - node = node.parent; - } - return node; - } - // Returns the node flags for this node and all relevant parent nodes. This is done so that - // nodes like variable declarations and binding elements can returned a view of their flags - // that includes the modifiers from their container. i.e. flags like export/declare aren't - // stored on the variable declaration directly, but on the containing variable statement - // (if it has one). Similarly, flags for let/const are store on the variable declaration - // list. By calling this function, all those flags are combined so that the client can treat - // the node as if it actually had those flags. - function getCombinedNodeFlags(node) { - node = walkUpBindingElementsAndPatterns(node); - var flags = node.flags; - if (node.kind === 201 /* VariableDeclaration */) { - node = node.parent; - } - if (node && node.kind === 202 /* VariableDeclarationList */) { - flags |= node.flags; - node = node.parent; - } - if (node && node.kind === 183 /* VariableStatement */) { - flags |= node.flags; - } - return flags; - } - ts.getCombinedNodeFlags = getCombinedNodeFlags; - function isConst(node) { - return !!(getCombinedNodeFlags(node) & 8192 /* Const */); - } - ts.isConst = isConst; - function isLet(node) { - return !!(getCombinedNodeFlags(node) & 4096 /* Let */); - } - ts.isLet = isLet; - function isPrologueDirective(node) { - return node.kind === 185 /* ExpressionStatement */ && node.expression.kind === 8 /* StringLiteral */; - } - ts.isPrologueDirective = isPrologueDirective; - function getLeadingCommentRangesOfNode(node, sourceFileOfNode) { - // If parameter/type parameter, the prev token trailing comments are part of this node too - if (node.kind === 131 /* Parameter */ || node.kind === 130 /* TypeParameter */) { - // e.g. (/** blah */ a, /** blah */ b); - // e.g.: ( - // /** blah */ a, - // /** blah */ b); - return ts.concatenate(ts.getTrailingCommentRanges(sourceFileOfNode.text, node.pos), ts.getLeadingCommentRanges(sourceFileOfNode.text, node.pos)); - } - else { - return ts.getLeadingCommentRanges(sourceFileOfNode.text, node.pos); - } - } - ts.getLeadingCommentRangesOfNode = getLeadingCommentRangesOfNode; - function getJsDocComments(node, sourceFileOfNode) { - return ts.filter(getLeadingCommentRangesOfNode(node, sourceFileOfNode), isJsDocComment); - function isJsDocComment(comment) { - // True if the comment starts with '/**' but not if it is '/**/' - return sourceFileOfNode.text.charCodeAt(comment.pos + 1) === 42 /* asterisk */ && - sourceFileOfNode.text.charCodeAt(comment.pos + 2) === 42 /* asterisk */ && - sourceFileOfNode.text.charCodeAt(comment.pos + 3) !== 47 /* slash */; - } - } - ts.getJsDocComments = getJsDocComments; - ts.fullTripleSlashReferencePathRegEx = /^(\/\/\/\s*/; - function isTypeNode(node) { - if (144 /* FirstTypeNode */ <= node.kind && node.kind <= 152 /* LastTypeNode */) { - return true; - } - switch (node.kind) { - case 112 /* AnyKeyword */: - case 121 /* NumberKeyword */: - case 123 /* StringKeyword */: - case 113 /* BooleanKeyword */: - case 124 /* SymbolKeyword */: - return true; - case 99 /* VoidKeyword */: - return node.parent.kind !== 169 /* VoidExpression */; - case 8 /* StringLiteral */: - // Specialized signatures can have string literals as their parameters' type names - return node.parent.kind === 131 /* Parameter */; - case 179 /* ExpressionWithTypeArguments */: - return true; - // Identifiers and qualified names may be type nodes, depending on their context. Climb - // above them to find the lowest container - case 65 /* Identifier */: - // If the identifier is the RHS of a qualified name, then it's a type iff its parent is. - if (node.parent.kind === 128 /* QualifiedName */ && node.parent.right === node) { - node = node.parent; - } - else if (node.parent.kind === 158 /* PropertyAccessExpression */ && node.parent.name === node) { - node = node.parent; - } - // fall through - case 128 /* QualifiedName */: - case 158 /* PropertyAccessExpression */: - // At this point, node is either a qualified name or an identifier - ts.Debug.assert(node.kind === 65 /* Identifier */ || node.kind === 128 /* QualifiedName */ || node.kind === 158 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isTypeNode'."); - var parent_1 = node.parent; - if (parent_1.kind === 147 /* TypeQuery */) { - return false; - } - // Do not recursively call isTypeNode on the parent. In the example: - // - // let a: A.B.C; - // - // Calling isTypeNode would consider the qualified name A.B a type node. Only C or - // A.B.C is a type node. - if (144 /* FirstTypeNode */ <= parent_1.kind && parent_1.kind <= 152 /* LastTypeNode */) { - return true; - } - switch (parent_1.kind) { - case 179 /* ExpressionWithTypeArguments */: - return true; - case 130 /* TypeParameter */: - return node === parent_1.constraint; - case 134 /* PropertyDeclaration */: - case 133 /* PropertySignature */: - case 131 /* Parameter */: - case 201 /* VariableDeclaration */: - return node === parent_1.type; - case 203 /* FunctionDeclaration */: - case 165 /* FunctionExpression */: - case 166 /* ArrowFunction */: - case 137 /* Constructor */: - case 136 /* MethodDeclaration */: - case 135 /* MethodSignature */: - case 138 /* GetAccessor */: - case 139 /* SetAccessor */: - return node === parent_1.type; - case 140 /* CallSignature */: - case 141 /* ConstructSignature */: - case 142 /* IndexSignature */: - return node === parent_1.type; - case 163 /* TypeAssertionExpression */: - return node === parent_1.type; - case 160 /* CallExpression */: - case 161 /* NewExpression */: - return parent_1.typeArguments && ts.indexOf(parent_1.typeArguments, node) >= 0; - case 162 /* TaggedTemplateExpression */: - // TODO (drosen): TaggedTemplateExpressions may eventually support type arguments. - return false; - } - } - return false; - } - ts.isTypeNode = isTypeNode; - // Warning: This has the same semantics as the forEach family of functions, - // in that traversal terminates in the event that 'visitor' supplies a truthy value. - function forEachReturnStatement(body, visitor) { - return traverse(body); - function traverse(node) { - switch (node.kind) { - case 194 /* ReturnStatement */: - return visitor(node); - case 210 /* CaseBlock */: - case 182 /* Block */: - case 186 /* IfStatement */: - case 187 /* DoStatement */: - case 188 /* WhileStatement */: - case 189 /* ForStatement */: - case 190 /* ForInStatement */: - case 191 /* ForOfStatement */: - case 195 /* WithStatement */: - case 196 /* SwitchStatement */: - case 223 /* CaseClause */: - case 224 /* DefaultClause */: - case 197 /* LabeledStatement */: - case 199 /* TryStatement */: - case 226 /* CatchClause */: - return ts.forEachChild(node, traverse); - } - } - } - ts.forEachReturnStatement = forEachReturnStatement; - function forEachYieldExpression(body, visitor) { - return traverse(body); - function traverse(node) { - switch (node.kind) { - case 175 /* YieldExpression */: - visitor(node); - var operand = node.expression; - if (operand) { - traverse(operand); - } - case 207 /* EnumDeclaration */: - case 205 /* InterfaceDeclaration */: - case 208 /* ModuleDeclaration */: - case 206 /* TypeAliasDeclaration */: - case 204 /* ClassDeclaration */: - // These are not allowed inside a generator now, but eventually they may be allowed - // as local types. Regardless, any yield statements contained within them should be - // skipped in this traversal. - return; - default: - if (isFunctionLike(node)) { - var name_4 = node.name; - if (name_4 && name_4.kind === 129 /* ComputedPropertyName */) { - // Note that we will not include methods/accessors of a class because they would require - // first descending into the class. This is by design. - traverse(name_4.expression); - return; - } - } - else if (!isTypeNode(node)) { - // This is the general case, which should include mostly expressions and statements. - // Also includes NodeArrays. - ts.forEachChild(node, traverse); - } - } - } - } - ts.forEachYieldExpression = forEachYieldExpression; - function isVariableLike(node) { - if (node) { - switch (node.kind) { - case 155 /* BindingElement */: - case 229 /* EnumMember */: - case 131 /* Parameter */: - case 227 /* PropertyAssignment */: - case 134 /* PropertyDeclaration */: - case 133 /* PropertySignature */: - case 228 /* ShorthandPropertyAssignment */: - case 201 /* VariableDeclaration */: - return true; - } - } - return false; - } - ts.isVariableLike = isVariableLike; - function isAccessor(node) { - if (node) { - switch (node.kind) { - case 138 /* GetAccessor */: - case 139 /* SetAccessor */: - return true; - } - } - return false; - } - ts.isAccessor = isAccessor; - function isClassLike(node) { - if (node) { - return node.kind === 204 /* ClassDeclaration */ || node.kind === 177 /* ClassExpression */; - } - } - ts.isClassLike = isClassLike; - function isFunctionLike(node) { - if (node) { - switch (node.kind) { - case 137 /* Constructor */: - case 165 /* FunctionExpression */: - case 203 /* FunctionDeclaration */: - case 166 /* ArrowFunction */: - case 136 /* MethodDeclaration */: - case 135 /* MethodSignature */: - case 138 /* GetAccessor */: - case 139 /* SetAccessor */: - case 140 /* CallSignature */: - case 141 /* ConstructSignature */: - case 142 /* IndexSignature */: - case 145 /* FunctionType */: - case 146 /* ConstructorType */: - return true; - } - } - return false; - } - ts.isFunctionLike = isFunctionLike; - function isFunctionBlock(node) { - return node && node.kind === 182 /* Block */ && isFunctionLike(node.parent); - } - ts.isFunctionBlock = isFunctionBlock; - function isObjectLiteralMethod(node) { - return node && node.kind === 136 /* MethodDeclaration */ && node.parent.kind === 157 /* ObjectLiteralExpression */; - } - ts.isObjectLiteralMethod = isObjectLiteralMethod; - function getContainingFunction(node) { - while (true) { - node = node.parent; - if (!node || isFunctionLike(node)) { - return node; - } - } - } - ts.getContainingFunction = getContainingFunction; - function getThisContainer(node, includeArrowFunctions) { - while (true) { - node = node.parent; - if (!node) { - return undefined; - } - switch (node.kind) { - case 129 /* ComputedPropertyName */: - // If the grandparent node is an object literal (as opposed to a class), - // then the computed property is not a 'this' container. - // A computed property name in a class needs to be a this container - // so that we can error on it. - if (node.parent.parent.kind === 204 /* ClassDeclaration */) { - return node; - } - // If this is a computed property, then the parent should not - // make it a this container. The parent might be a property - // in an object literal, like a method or accessor. But in order for - // such a parent to be a this container, the reference must be in - // the *body* of the container. - node = node.parent; - break; - case 132 /* Decorator */: - // Decorators are always applied outside of the body of a class or method. - if (node.parent.kind === 131 /* Parameter */ && isClassElement(node.parent.parent)) { - // If the decorator's parent is a Parameter, we resolve the this container from - // the grandparent class declaration. - node = node.parent.parent; - } - else if (isClassElement(node.parent)) { - // If the decorator's parent is a class element, we resolve the 'this' container - // from the parent class declaration. - node = node.parent; - } - break; - case 166 /* ArrowFunction */: - if (!includeArrowFunctions) { - continue; - } - // Fall through - case 203 /* FunctionDeclaration */: - case 165 /* FunctionExpression */: - case 208 /* ModuleDeclaration */: - case 134 /* PropertyDeclaration */: - case 133 /* PropertySignature */: - case 136 /* MethodDeclaration */: - case 135 /* MethodSignature */: - case 137 /* Constructor */: - case 138 /* GetAccessor */: - case 139 /* SetAccessor */: - case 207 /* EnumDeclaration */: - case 230 /* SourceFile */: - return node; - } - } - } - ts.getThisContainer = getThisContainer; - function getSuperContainer(node, includeFunctions) { - while (true) { - node = node.parent; - if (!node) - return node; - switch (node.kind) { - case 129 /* ComputedPropertyName */: - // If the grandparent node is an object literal (as opposed to a class), - // then the computed property is not a 'super' container. - // A computed property name in a class needs to be a super container - // so that we can error on it. - if (node.parent.parent.kind === 204 /* ClassDeclaration */) { - return node; - } - // If this is a computed property, then the parent should not - // make it a super container. The parent might be a property - // in an object literal, like a method or accessor. But in order for - // such a parent to be a super container, the reference must be in - // the *body* of the container. - node = node.parent; - break; - case 132 /* Decorator */: - // Decorators are always applied outside of the body of a class or method. - if (node.parent.kind === 131 /* Parameter */ && isClassElement(node.parent.parent)) { - // If the decorator's parent is a Parameter, we resolve the this container from - // the grandparent class declaration. - node = node.parent.parent; - } - else if (isClassElement(node.parent)) { - // If the decorator's parent is a class element, we resolve the 'this' container - // from the parent class declaration. - node = node.parent; - } - break; - case 203 /* FunctionDeclaration */: - case 165 /* FunctionExpression */: - case 166 /* ArrowFunction */: - if (!includeFunctions) { - continue; - } - case 134 /* PropertyDeclaration */: - case 133 /* PropertySignature */: - case 136 /* MethodDeclaration */: - case 135 /* MethodSignature */: - case 137 /* Constructor */: - case 138 /* GetAccessor */: - case 139 /* SetAccessor */: - return node; - } - } - } - ts.getSuperContainer = getSuperContainer; - function getInvokedExpression(node) { - if (node.kind === 162 /* TaggedTemplateExpression */) { - return node.tag; - } - // Will either be a CallExpression or NewExpression. - return node.expression; - } - ts.getInvokedExpression = getInvokedExpression; - function nodeCanBeDecorated(node) { - switch (node.kind) { - case 204 /* ClassDeclaration */: - // classes are valid targets - return true; - case 134 /* PropertyDeclaration */: - // property declarations are valid if their parent is a class declaration. - return node.parent.kind === 204 /* ClassDeclaration */; - case 131 /* Parameter */: - // if the parameter's parent has a body and its grandparent is a class declaration, this is a valid target; - return node.parent.body && node.parent.parent.kind === 204 /* ClassDeclaration */; - case 138 /* GetAccessor */: - case 139 /* SetAccessor */: - case 136 /* MethodDeclaration */: - // if this method has a body and its parent is a class declaration, this is a valid target. - return node.body && node.parent.kind === 204 /* ClassDeclaration */; - } - return false; - } - ts.nodeCanBeDecorated = nodeCanBeDecorated; - function nodeIsDecorated(node) { - switch (node.kind) { - case 204 /* ClassDeclaration */: - if (node.decorators) { - return true; - } - return false; - case 134 /* PropertyDeclaration */: - case 131 /* Parameter */: - if (node.decorators) { - return true; - } - return false; - case 138 /* GetAccessor */: - if (node.body && node.decorators) { - return true; - } - return false; - case 136 /* MethodDeclaration */: - case 139 /* SetAccessor */: - if (node.body && node.decorators) { - return true; - } - return false; - } - return false; - } - ts.nodeIsDecorated = nodeIsDecorated; - function childIsDecorated(node) { - switch (node.kind) { - case 204 /* ClassDeclaration */: - return ts.forEach(node.members, nodeOrChildIsDecorated); - case 136 /* MethodDeclaration */: - case 139 /* SetAccessor */: - return ts.forEach(node.parameters, nodeIsDecorated); - } - return false; - } - ts.childIsDecorated = childIsDecorated; - function nodeOrChildIsDecorated(node) { - return nodeIsDecorated(node) || childIsDecorated(node); - } - ts.nodeOrChildIsDecorated = nodeOrChildIsDecorated; - function isExpression(node) { - switch (node.kind) { - case 93 /* ThisKeyword */: - case 91 /* SuperKeyword */: - case 89 /* NullKeyword */: - case 95 /* TrueKeyword */: - case 80 /* FalseKeyword */: - case 9 /* RegularExpressionLiteral */: - case 156 /* ArrayLiteralExpression */: - case 157 /* ObjectLiteralExpression */: - case 158 /* PropertyAccessExpression */: - case 159 /* ElementAccessExpression */: - case 160 /* CallExpression */: - case 161 /* NewExpression */: - case 162 /* TaggedTemplateExpression */: - case 163 /* TypeAssertionExpression */: - case 164 /* ParenthesizedExpression */: - case 165 /* FunctionExpression */: - case 177 /* ClassExpression */: - case 166 /* ArrowFunction */: - case 169 /* VoidExpression */: - case 167 /* DeleteExpression */: - case 168 /* TypeOfExpression */: - case 170 /* PrefixUnaryExpression */: - case 171 /* PostfixUnaryExpression */: - case 172 /* BinaryExpression */: - case 173 /* ConditionalExpression */: - case 176 /* SpreadElementExpression */: - case 174 /* TemplateExpression */: - case 10 /* NoSubstitutionTemplateLiteral */: - case 178 /* OmittedExpression */: - case 175 /* YieldExpression */: - return true; - case 128 /* QualifiedName */: - while (node.parent.kind === 128 /* QualifiedName */) { - node = node.parent; - } - return node.parent.kind === 147 /* TypeQuery */; - case 65 /* Identifier */: - if (node.parent.kind === 147 /* TypeQuery */) { - return true; - } - // fall through - case 7 /* NumericLiteral */: - case 8 /* StringLiteral */: - var parent_2 = node.parent; - switch (parent_2.kind) { - case 201 /* VariableDeclaration */: - case 131 /* Parameter */: - case 134 /* PropertyDeclaration */: - case 133 /* PropertySignature */: - case 229 /* EnumMember */: - case 227 /* PropertyAssignment */: - case 155 /* BindingElement */: - return parent_2.initializer === node; - case 185 /* ExpressionStatement */: - case 186 /* IfStatement */: - case 187 /* DoStatement */: - case 188 /* WhileStatement */: - case 194 /* ReturnStatement */: - case 195 /* WithStatement */: - case 196 /* SwitchStatement */: - case 223 /* CaseClause */: - case 198 /* ThrowStatement */: - case 196 /* SwitchStatement */: - return parent_2.expression === node; - case 189 /* ForStatement */: - var forStatement = parent_2; - return (forStatement.initializer === node && forStatement.initializer.kind !== 202 /* VariableDeclarationList */) || - forStatement.condition === node || - forStatement.incrementor === node; - case 190 /* ForInStatement */: - case 191 /* ForOfStatement */: - var forInStatement = parent_2; - return (forInStatement.initializer === node && forInStatement.initializer.kind !== 202 /* VariableDeclarationList */) || - forInStatement.expression === node; - case 163 /* TypeAssertionExpression */: - return node === parent_2.expression; - case 180 /* TemplateSpan */: - return node === parent_2.expression; - case 129 /* ComputedPropertyName */: - return node === parent_2.expression; - case 132 /* Decorator */: - return true; - default: - if (isExpression(parent_2)) { - return true; - } - } - } - return false; - } - ts.isExpression = isExpression; - function isInstantiatedModule(node, preserveConstEnums) { - var moduleState = ts.getModuleInstanceState(node); - return moduleState === 1 /* Instantiated */ || - (preserveConstEnums && moduleState === 2 /* ConstEnumOnly */); - } - ts.isInstantiatedModule = isInstantiatedModule; - function isExternalModuleImportEqualsDeclaration(node) { - return node.kind === 211 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 222 /* ExternalModuleReference */; - } - ts.isExternalModuleImportEqualsDeclaration = isExternalModuleImportEqualsDeclaration; - function getExternalModuleImportEqualsDeclarationExpression(node) { - ts.Debug.assert(isExternalModuleImportEqualsDeclaration(node)); - return node.moduleReference.expression; - } - ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression; - function isInternalModuleImportEqualsDeclaration(node) { - return node.kind === 211 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 222 /* ExternalModuleReference */; - } - ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration; - function getExternalModuleName(node) { - if (node.kind === 212 /* ImportDeclaration */) { - return node.moduleSpecifier; - } - if (node.kind === 211 /* ImportEqualsDeclaration */) { - var reference = node.moduleReference; - if (reference.kind === 222 /* ExternalModuleReference */) { - return reference.expression; - } - } - if (node.kind === 218 /* ExportDeclaration */) { - return node.moduleSpecifier; - } - } - ts.getExternalModuleName = getExternalModuleName; - function hasQuestionToken(node) { - if (node) { - switch (node.kind) { - case 131 /* Parameter */: - return node.questionToken !== undefined; - case 136 /* MethodDeclaration */: - case 135 /* MethodSignature */: - return node.questionToken !== undefined; - case 228 /* ShorthandPropertyAssignment */: - case 227 /* PropertyAssignment */: - case 134 /* PropertyDeclaration */: - case 133 /* PropertySignature */: - return node.questionToken !== undefined; - } - } - return false; - } - ts.hasQuestionToken = hasQuestionToken; - function isJSDocConstructSignature(node) { - return node.kind === 243 /* JSDocFunctionType */ && - node.parameters.length > 0 && - node.parameters[0].type.kind === 245 /* JSDocConstructorType */; - } - ts.isJSDocConstructSignature = isJSDocConstructSignature; - function getJSDocTag(node, kind) { - if (node && node.jsDocComment) { - for (var _i = 0, _a = node.jsDocComment.tags; _i < _a.length; _i++) { - var tag = _a[_i]; - if (tag.kind === kind) { - return tag; - } - } - } - } - function getJSDocTypeTag(node) { - return getJSDocTag(node, 251 /* JSDocTypeTag */); - } - ts.getJSDocTypeTag = getJSDocTypeTag; - function getJSDocReturnTag(node) { - return getJSDocTag(node, 250 /* JSDocReturnTag */); - } - ts.getJSDocReturnTag = getJSDocReturnTag; - function getJSDocTemplateTag(node) { - return getJSDocTag(node, 252 /* JSDocTemplateTag */); - } - ts.getJSDocTemplateTag = getJSDocTemplateTag; - function getCorrespondingJSDocParameterTag(parameter) { - if (parameter.name && parameter.name.kind === 65 /* Identifier */) { - // If it's a parameter, see if the parent has a jsdoc comment with an @param - // annotation. - var parameterName = parameter.name.text; - var docComment = parameter.parent.jsDocComment; - if (docComment) { - return ts.forEach(docComment.tags, function (t) { - if (t.kind === 249 /* JSDocParameterTag */) { - var parameterTag = t; - var name_5 = parameterTag.preParameterName || parameterTag.postParameterName; - if (name_5.text === parameterName) { - return t; - } - } - }); - } - } - } - ts.getCorrespondingJSDocParameterTag = getCorrespondingJSDocParameterTag; - function hasRestParameter(s) { - return isRestParameter(ts.lastOrUndefined(s.parameters)); - } - ts.hasRestParameter = hasRestParameter; - function isRestParameter(node) { - if (node) { - if (node.parserContextFlags & 64 /* JavaScriptFile */) { - if (node.type && node.type.kind === 244 /* JSDocVariadicType */) { - return true; - } - var paramTag = getCorrespondingJSDocParameterTag(node); - if (paramTag && paramTag.typeExpression) { - return paramTag.typeExpression.type.kind === 244 /* JSDocVariadicType */; - } - } - return node.dotDotDotToken !== undefined; - } - return false; - } - ts.isRestParameter = isRestParameter; - function isLiteralKind(kind) { - return 7 /* FirstLiteralToken */ <= kind && kind <= 10 /* LastLiteralToken */; - } - ts.isLiteralKind = isLiteralKind; - function isTextualLiteralKind(kind) { - return kind === 8 /* StringLiteral */ || kind === 10 /* NoSubstitutionTemplateLiteral */; - } - ts.isTextualLiteralKind = isTextualLiteralKind; - function isTemplateLiteralKind(kind) { - return 10 /* FirstTemplateToken */ <= kind && kind <= 13 /* LastTemplateToken */; - } - ts.isTemplateLiteralKind = isTemplateLiteralKind; - function isBindingPattern(node) { - return !!node && (node.kind === 154 /* ArrayBindingPattern */ || node.kind === 153 /* ObjectBindingPattern */); - } - ts.isBindingPattern = isBindingPattern; - function isInAmbientContext(node) { - while (node) { - if (node.flags & (2 /* Ambient */ | 2048 /* DeclarationFile */)) { - return true; - } - node = node.parent; - } - return false; - } - ts.isInAmbientContext = isInAmbientContext; - function isDeclaration(node) { - switch (node.kind) { - case 166 /* ArrowFunction */: - case 155 /* BindingElement */: - case 204 /* ClassDeclaration */: - case 137 /* Constructor */: - case 207 /* EnumDeclaration */: - case 229 /* EnumMember */: - case 220 /* ExportSpecifier */: - case 203 /* FunctionDeclaration */: - case 165 /* FunctionExpression */: - case 138 /* GetAccessor */: - case 213 /* ImportClause */: - case 211 /* ImportEqualsDeclaration */: - case 216 /* ImportSpecifier */: - case 205 /* InterfaceDeclaration */: - case 136 /* MethodDeclaration */: - case 135 /* MethodSignature */: - case 208 /* ModuleDeclaration */: - case 214 /* NamespaceImport */: - case 131 /* Parameter */: - case 227 /* PropertyAssignment */: - case 134 /* PropertyDeclaration */: - case 133 /* PropertySignature */: - case 139 /* SetAccessor */: - case 228 /* ShorthandPropertyAssignment */: - case 206 /* TypeAliasDeclaration */: - case 130 /* TypeParameter */: - case 201 /* VariableDeclaration */: - return true; - } - return false; - } - ts.isDeclaration = isDeclaration; - function isStatement(n) { - switch (n.kind) { - case 193 /* BreakStatement */: - case 192 /* ContinueStatement */: - case 200 /* DebuggerStatement */: - case 187 /* DoStatement */: - case 185 /* ExpressionStatement */: - case 184 /* EmptyStatement */: - case 190 /* ForInStatement */: - case 191 /* ForOfStatement */: - case 189 /* ForStatement */: - case 186 /* IfStatement */: - case 197 /* LabeledStatement */: - case 194 /* ReturnStatement */: - case 196 /* SwitchStatement */: - case 94 /* ThrowKeyword */: - case 199 /* TryStatement */: - case 183 /* VariableStatement */: - case 188 /* WhileStatement */: - case 195 /* WithStatement */: - case 217 /* ExportAssignment */: - return true; - default: - return false; - } - } - ts.isStatement = isStatement; - function isClassElement(n) { - switch (n.kind) { - case 137 /* Constructor */: - case 134 /* PropertyDeclaration */: - case 136 /* MethodDeclaration */: - case 138 /* GetAccessor */: - case 139 /* SetAccessor */: - case 135 /* MethodSignature */: - case 142 /* IndexSignature */: - return true; - default: - return false; - } - } - ts.isClassElement = isClassElement; - // True if the given identifier, string literal, or number literal is the name of a declaration node - function isDeclarationName(name) { - if (name.kind !== 65 /* Identifier */ && name.kind !== 8 /* StringLiteral */ && name.kind !== 7 /* NumericLiteral */) { - return false; - } - var parent = name.parent; - if (parent.kind === 216 /* ImportSpecifier */ || parent.kind === 220 /* ExportSpecifier */) { - if (parent.propertyName) { - return true; - } - } - if (isDeclaration(parent)) { - return parent.name === name; - } - return false; - } - ts.isDeclarationName = isDeclarationName; - // An alias symbol is created by one of the following declarations: - // import = ... - // import from ... - // import * as from ... - // import { x as } from ... - // export { x as } from ... - // export = ... - // export default ... - function isAliasSymbolDeclaration(node) { - return node.kind === 211 /* ImportEqualsDeclaration */ || - node.kind === 213 /* ImportClause */ && !!node.name || - node.kind === 214 /* NamespaceImport */ || - node.kind === 216 /* ImportSpecifier */ || - node.kind === 220 /* ExportSpecifier */ || - node.kind === 217 /* ExportAssignment */ && node.expression.kind === 65 /* Identifier */; - } - ts.isAliasSymbolDeclaration = isAliasSymbolDeclaration; - function getClassExtendsHeritageClauseElement(node) { - var heritageClause = getHeritageClause(node.heritageClauses, 79 /* ExtendsKeyword */); - return heritageClause && heritageClause.types.length > 0 ? heritageClause.types[0] : undefined; - } - ts.getClassExtendsHeritageClauseElement = getClassExtendsHeritageClauseElement; - function getClassImplementsHeritageClauseElements(node) { - var heritageClause = getHeritageClause(node.heritageClauses, 102 /* ImplementsKeyword */); - return heritageClause ? heritageClause.types : undefined; - } - ts.getClassImplementsHeritageClauseElements = getClassImplementsHeritageClauseElements; - function getInterfaceBaseTypeNodes(node) { - var heritageClause = getHeritageClause(node.heritageClauses, 79 /* ExtendsKeyword */); - return heritageClause ? heritageClause.types : undefined; - } - ts.getInterfaceBaseTypeNodes = getInterfaceBaseTypeNodes; - function getHeritageClause(clauses, kind) { - if (clauses) { - for (var _i = 0; _i < clauses.length; _i++) { - var clause = clauses[_i]; - if (clause.token === kind) { - return clause; - } - } - } - return undefined; - } - ts.getHeritageClause = getHeritageClause; - function tryResolveScriptReference(host, sourceFile, reference) { - if (!host.getCompilerOptions().noResolve) { - var referenceFileName = ts.isRootedDiskPath(reference.fileName) ? reference.fileName : ts.combinePaths(ts.getDirectoryPath(sourceFile.fileName), reference.fileName); - referenceFileName = ts.getNormalizedAbsolutePath(referenceFileName, host.getCurrentDirectory()); - return host.getSourceFile(referenceFileName); - } - } - ts.tryResolveScriptReference = tryResolveScriptReference; - function getAncestor(node, kind) { - while (node) { - if (node.kind === kind) { - return node; - } - node = node.parent; - } - return undefined; - } - ts.getAncestor = getAncestor; - function getFileReferenceFromReferencePath(comment, commentRange) { - var simpleReferenceRegEx = /^\/\/\/\s*/gim; - if (simpleReferenceRegEx.exec(comment)) { - if (isNoDefaultLibRegEx.exec(comment)) { - return { - isNoDefaultLib: true - }; - } - else { - var matchResult = ts.fullTripleSlashReferencePathRegEx.exec(comment); - if (matchResult) { - var start = commentRange.pos; - var end = commentRange.end; - return { - fileReference: { - pos: start, - end: end, - fileName: matchResult[3] - }, - isNoDefaultLib: false - }; - } - else { - return { - diagnosticMessage: ts.Diagnostics.Invalid_reference_directive_syntax, - isNoDefaultLib: false - }; - } - } - } - return undefined; - } - ts.getFileReferenceFromReferencePath = getFileReferenceFromReferencePath; - function isKeyword(token) { - return 66 /* FirstKeyword */ <= token && token <= 127 /* LastKeyword */; - } - ts.isKeyword = isKeyword; - function isTrivia(token) { - return 2 /* FirstTriviaToken */ <= token && token <= 6 /* LastTriviaToken */; - } - ts.isTrivia = isTrivia; - /** - * A declaration has a dynamic name if both of the following are true: - * 1. The declaration has a computed property name - * 2. The computed name is *not* expressed as Symbol., where name - * is a property of the Symbol constructor that denotes a built in - * Symbol. - */ - function hasDynamicName(declaration) { - return declaration.name && - declaration.name.kind === 129 /* ComputedPropertyName */ && - !isWellKnownSymbolSyntactically(declaration.name.expression); - } - ts.hasDynamicName = hasDynamicName; - /** - * Checks if the expression is of the form: - * Symbol.name - * where Symbol is literally the word "Symbol", and name is any identifierName - */ - function isWellKnownSymbolSyntactically(node) { - return node.kind === 158 /* PropertyAccessExpression */ && isESSymbolIdentifier(node.expression); - } - ts.isWellKnownSymbolSyntactically = isWellKnownSymbolSyntactically; - function getPropertyNameForPropertyNameNode(name) { - if (name.kind === 65 /* Identifier */ || name.kind === 8 /* StringLiteral */ || name.kind === 7 /* NumericLiteral */) { - return name.text; - } - if (name.kind === 129 /* ComputedPropertyName */) { - var nameExpression = name.expression; - if (isWellKnownSymbolSyntactically(nameExpression)) { - var rightHandSideName = nameExpression.name.text; - return getPropertyNameForKnownSymbolName(rightHandSideName); - } - } - return undefined; - } - ts.getPropertyNameForPropertyNameNode = getPropertyNameForPropertyNameNode; - function getPropertyNameForKnownSymbolName(symbolName) { - return "__@" + symbolName; - } - ts.getPropertyNameForKnownSymbolName = getPropertyNameForKnownSymbolName; - /** - * Includes the word "Symbol" with unicode escapes - */ - function isESSymbolIdentifier(node) { - return node.kind === 65 /* Identifier */ && node.text === "Symbol"; - } - ts.isESSymbolIdentifier = isESSymbolIdentifier; - function isModifier(token) { - switch (token) { - case 108 /* PublicKeyword */: - case 106 /* PrivateKeyword */: - case 107 /* ProtectedKeyword */: - case 109 /* StaticKeyword */: - case 78 /* ExportKeyword */: - case 115 /* DeclareKeyword */: - case 70 /* ConstKeyword */: - case 73 /* DefaultKeyword */: - return true; - } - return false; - } - ts.isModifier = isModifier; - function isParameterDeclaration(node) { - var root = getRootDeclaration(node); - return root.kind === 131 /* Parameter */; - } - ts.isParameterDeclaration = isParameterDeclaration; - function getRootDeclaration(node) { - while (node.kind === 155 /* BindingElement */) { - node = node.parent.parent; - } - return node; - } - ts.getRootDeclaration = getRootDeclaration; - function nodeStartsNewLexicalEnvironment(n) { - return isFunctionLike(n) || n.kind === 208 /* ModuleDeclaration */ || n.kind === 230 /* SourceFile */; - } - ts.nodeStartsNewLexicalEnvironment = nodeStartsNewLexicalEnvironment; - function nodeIsSynthesized(node) { - return node.pos === -1; - } - ts.nodeIsSynthesized = nodeIsSynthesized; - function createSynthesizedNode(kind, startsOnNewLine) { - var node = ts.createNode(kind); - node.pos = -1; - node.end = -1; - node.startsOnNewLine = startsOnNewLine; - return node; - } - ts.createSynthesizedNode = createSynthesizedNode; - function createSynthesizedNodeArray() { - var array = []; - array.pos = -1; - array.end = -1; - return array; - } - ts.createSynthesizedNodeArray = createSynthesizedNodeArray; - function createDiagnosticCollection() { - var nonFileDiagnostics = []; - var fileDiagnostics = {}; - var diagnosticsModified = false; - var modificationCount = 0; - return { - add: add, - getGlobalDiagnostics: getGlobalDiagnostics, - getDiagnostics: getDiagnostics, - getModificationCount: getModificationCount - }; - function getModificationCount() { - return modificationCount; - } - function add(diagnostic) { - var diagnostics; - if (diagnostic.file) { - diagnostics = fileDiagnostics[diagnostic.file.fileName]; - if (!diagnostics) { - diagnostics = []; - fileDiagnostics[diagnostic.file.fileName] = diagnostics; - } - } - else { - diagnostics = nonFileDiagnostics; - } - diagnostics.push(diagnostic); - diagnosticsModified = true; - modificationCount++; - } - function getGlobalDiagnostics() { - sortAndDeduplicate(); - return nonFileDiagnostics; - } - function getDiagnostics(fileName) { - sortAndDeduplicate(); - if (fileName) { - return fileDiagnostics[fileName] || []; - } - var allDiagnostics = []; - function pushDiagnostic(d) { - allDiagnostics.push(d); - } - ts.forEach(nonFileDiagnostics, pushDiagnostic); - for (var key in fileDiagnostics) { - if (ts.hasProperty(fileDiagnostics, key)) { - ts.forEach(fileDiagnostics[key], pushDiagnostic); - } - } - return ts.sortAndDeduplicateDiagnostics(allDiagnostics); - } - function sortAndDeduplicate() { - if (!diagnosticsModified) { - return; - } - diagnosticsModified = false; - nonFileDiagnostics = ts.sortAndDeduplicateDiagnostics(nonFileDiagnostics); - for (var key in fileDiagnostics) { - if (ts.hasProperty(fileDiagnostics, key)) { - fileDiagnostics[key] = ts.sortAndDeduplicateDiagnostics(fileDiagnostics[key]); - } - } - } - } - ts.createDiagnosticCollection = createDiagnosticCollection; - // This consists of the first 19 unprintable ASCII characters, canonical escapes, lineSeparator, - // paragraphSeparator, and nextLine. The latter three are just desirable to suppress new lines in - // the language service. These characters should be escaped when printing, and if any characters are added, - // the map below must be updated. Note that this regexp *does not* include the 'delete' character. - // There is no reason for this other than that JSON.stringify does not handle it either. - var escapedCharsRegExp = /[\\\"\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g; - var escapedCharsMap = { - "\0": "\\0", - "\t": "\\t", - "\v": "\\v", - "\f": "\\f", - "\b": "\\b", - "\r": "\\r", - "\n": "\\n", - "\\": "\\\\", - "\"": "\\\"", - "\u2028": "\\u2028", - "\u2029": "\\u2029", - "\u0085": "\\u0085" // nextLine - }; - /** - * Based heavily on the abstract 'Quote'/'QuoteJSONString' operation from ECMA-262 (24.3.2.2), - * but augmented for a few select characters (e.g. lineSeparator, paragraphSeparator, nextLine) - * Note that this doesn't actually wrap the input in double quotes. - */ - function escapeString(s) { - s = escapedCharsRegExp.test(s) ? s.replace(escapedCharsRegExp, getReplacement) : s; - return s; - function getReplacement(c) { - return escapedCharsMap[c] || get16BitUnicodeEscapeSequence(c.charCodeAt(0)); - } - } - ts.escapeString = escapeString; - function get16BitUnicodeEscapeSequence(charCode) { - var hexCharCode = charCode.toString(16).toUpperCase(); - var paddedHexCode = ("0000" + hexCharCode).slice(-4); - return "\\u" + paddedHexCode; - } - var nonAsciiCharacters = /[^\u0000-\u007F]/g; - function escapeNonAsciiCharacters(s) { - // Replace non-ASCII characters with '\uNNNN' escapes if any exist. - // Otherwise just return the original string. - return nonAsciiCharacters.test(s) ? - s.replace(nonAsciiCharacters, function (c) { return get16BitUnicodeEscapeSequence(c.charCodeAt(0)); }) : - s; - } - ts.escapeNonAsciiCharacters = escapeNonAsciiCharacters; - var indentStrings = ["", " "]; - function getIndentString(level) { - if (indentStrings[level] === undefined) { - indentStrings[level] = getIndentString(level - 1) + indentStrings[1]; - } - return indentStrings[level]; - } - ts.getIndentString = getIndentString; - function getIndentSize() { - return indentStrings[1].length; - } - ts.getIndentSize = getIndentSize; - function createTextWriter(newLine) { - var output = ""; - var indent = 0; - var lineStart = true; - var lineCount = 0; - var linePos = 0; - function write(s) { - if (s && s.length) { - if (lineStart) { - output += getIndentString(indent); - lineStart = false; - } - output += s; - } - } - function rawWrite(s) { - if (s !== undefined) { - if (lineStart) { - lineStart = false; - } - output += s; - } - } - function writeLiteral(s) { - if (s && s.length) { - write(s); - var lineStartsOfS = ts.computeLineStarts(s); - if (lineStartsOfS.length > 1) { - lineCount = lineCount + lineStartsOfS.length - 1; - linePos = output.length - s.length + ts.lastOrUndefined(lineStartsOfS); - } - } - } - function writeLine() { - if (!lineStart) { - output += newLine; - lineCount++; - linePos = output.length; - lineStart = true; - } - } - function writeTextOfNode(sourceFile, node) { - write(getSourceTextOfNodeFromSourceFile(sourceFile, node)); - } - return { - write: write, - rawWrite: rawWrite, - writeTextOfNode: writeTextOfNode, - writeLiteral: writeLiteral, - writeLine: writeLine, - increaseIndent: function () { return indent++; }, - decreaseIndent: function () { return indent--; }, - getIndent: function () { return indent; }, - getTextPos: function () { return output.length; }, - getLine: function () { return lineCount + 1; }, - getColumn: function () { return lineStart ? indent * getIndentSize() + 1 : output.length - linePos + 1; }, - getText: function () { return output; } - }; - } - ts.createTextWriter = createTextWriter; - function getOwnEmitOutputFilePath(sourceFile, host, extension) { - var compilerOptions = host.getCompilerOptions(); - var emitOutputFilePathWithoutExtension; - if (compilerOptions.outDir) { - emitOutputFilePathWithoutExtension = ts.removeFileExtension(getSourceFilePathInNewDir(sourceFile, host, compilerOptions.outDir)); - } - else { - emitOutputFilePathWithoutExtension = ts.removeFileExtension(sourceFile.fileName); - } - return emitOutputFilePathWithoutExtension + extension; - } - ts.getOwnEmitOutputFilePath = getOwnEmitOutputFilePath; - function getSourceFilePathInNewDir(sourceFile, host, newDirPath) { - var sourceFilePath = ts.getNormalizedAbsolutePath(sourceFile.fileName, host.getCurrentDirectory()); - sourceFilePath = sourceFilePath.replace(host.getCommonSourceDirectory(), ""); - return ts.combinePaths(newDirPath, sourceFilePath); - } - ts.getSourceFilePathInNewDir = getSourceFilePathInNewDir; - function writeFile(host, diagnostics, fileName, data, writeByteOrderMark) { - host.writeFile(fileName, data, writeByteOrderMark, function (hostErrorMessage) { - diagnostics.push(ts.createCompilerDiagnostic(ts.Diagnostics.Could_not_write_file_0_Colon_1, fileName, hostErrorMessage)); - }); - } - ts.writeFile = writeFile; - function getLineOfLocalPosition(currentSourceFile, pos) { - return ts.getLineAndCharacterOfPosition(currentSourceFile, pos).line; - } - ts.getLineOfLocalPosition = getLineOfLocalPosition; - function getFirstConstructorWithBody(node) { - return ts.forEach(node.members, function (member) { - if (member.kind === 137 /* Constructor */ && nodeIsPresent(member.body)) { - return member; - } - }); - } - ts.getFirstConstructorWithBody = getFirstConstructorWithBody; - function shouldEmitToOwnFile(sourceFile, compilerOptions) { - if (!isDeclarationFile(sourceFile)) { - if ((isExternalModule(sourceFile) || !compilerOptions.out)) { - // 1. in-browser single file compilation scenario - // 2. non .js file - return compilerOptions.isolatedModules || !ts.fileExtensionIs(sourceFile.fileName, ".js"); - } - return false; - } - return false; - } - ts.shouldEmitToOwnFile = shouldEmitToOwnFile; - function getAllAccessorDeclarations(declarations, accessor) { - var firstAccessor; - var secondAccessor; - var getAccessor; - var setAccessor; - if (hasDynamicName(accessor)) { - firstAccessor = accessor; - if (accessor.kind === 138 /* GetAccessor */) { - getAccessor = accessor; - } - else if (accessor.kind === 139 /* SetAccessor */) { - setAccessor = accessor; - } - else { - ts.Debug.fail("Accessor has wrong kind"); - } - } - else { - ts.forEach(declarations, function (member) { - if ((member.kind === 138 /* GetAccessor */ || member.kind === 139 /* SetAccessor */) - && (member.flags & 128 /* Static */) === (accessor.flags & 128 /* Static */)) { - var memberName = getPropertyNameForPropertyNameNode(member.name); - var accessorName = getPropertyNameForPropertyNameNode(accessor.name); - if (memberName === accessorName) { - if (!firstAccessor) { - firstAccessor = member; - } - else if (!secondAccessor) { - secondAccessor = member; - } - if (member.kind === 138 /* GetAccessor */ && !getAccessor) { - getAccessor = member; - } - if (member.kind === 139 /* SetAccessor */ && !setAccessor) { - setAccessor = member; - } - } - } - }); - } - return { - firstAccessor: firstAccessor, - secondAccessor: secondAccessor, - getAccessor: getAccessor, - setAccessor: setAccessor - }; - } - ts.getAllAccessorDeclarations = getAllAccessorDeclarations; - function emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, leadingComments) { - // If the leading comments start on different line than the start of node, write new line - if (leadingComments && leadingComments.length && node.pos !== leadingComments[0].pos && - getLineOfLocalPosition(currentSourceFile, node.pos) !== getLineOfLocalPosition(currentSourceFile, leadingComments[0].pos)) { - writer.writeLine(); - } - } - ts.emitNewLineBeforeLeadingComments = emitNewLineBeforeLeadingComments; - function emitComments(currentSourceFile, writer, comments, trailingSeparator, newLine, writeComment) { - var emitLeadingSpace = !trailingSeparator; - ts.forEach(comments, function (comment) { - if (emitLeadingSpace) { - writer.write(" "); - emitLeadingSpace = false; - } - writeComment(currentSourceFile, writer, comment, newLine); - if (comment.hasTrailingNewLine) { - writer.writeLine(); - } - else if (trailingSeparator) { - writer.write(" "); - } - else { - // Emit leading space to separate comment during next comment emit - emitLeadingSpace = true; - } - }); - } - ts.emitComments = emitComments; - function writeCommentRange(currentSourceFile, writer, comment, newLine) { - if (currentSourceFile.text.charCodeAt(comment.pos + 1) === 42 /* asterisk */) { - var firstCommentLineAndCharacter = ts.getLineAndCharacterOfPosition(currentSourceFile, comment.pos); - var lineCount = ts.getLineStarts(currentSourceFile).length; - var firstCommentLineIndent; - for (var pos = comment.pos, currentLine = firstCommentLineAndCharacter.line; pos < comment.end; currentLine++) { - var nextLineStart = (currentLine + 1) === lineCount - ? currentSourceFile.text.length + 1 - : getStartPositionOfLine(currentLine + 1, currentSourceFile); - if (pos !== comment.pos) { - // If we are not emitting first line, we need to write the spaces to adjust the alignment - if (firstCommentLineIndent === undefined) { - firstCommentLineIndent = calculateIndent(getStartPositionOfLine(firstCommentLineAndCharacter.line, currentSourceFile), comment.pos); - } - // These are number of spaces writer is going to write at current indent - var currentWriterIndentSpacing = writer.getIndent() * getIndentSize(); - // Number of spaces we want to be writing - // eg: Assume writer indent - // module m { - // /* starts at character 9 this is line 1 - // * starts at character pos 4 line --1 = 8 - 8 + 3 - // More left indented comment */ --2 = 8 - 8 + 2 - // class c { } - // } - // module m { - // /* this is line 1 -- Assume current writer indent 8 - // * line --3 = 8 - 4 + 5 - // More right indented comment */ --4 = 8 - 4 + 11 - // class c { } - // } - var spacesToEmit = currentWriterIndentSpacing - firstCommentLineIndent + calculateIndent(pos, nextLineStart); - if (spacesToEmit > 0) { - var numberOfSingleSpacesToEmit = spacesToEmit % getIndentSize(); - var indentSizeSpaceString = getIndentString((spacesToEmit - numberOfSingleSpacesToEmit) / getIndentSize()); - // Write indent size string ( in eg 1: = "", 2: "" , 3: string with 8 spaces 4: string with 12 spaces - writer.rawWrite(indentSizeSpaceString); - // Emit the single spaces (in eg: 1: 3 spaces, 2: 2 spaces, 3: 1 space, 4: 3 spaces) - while (numberOfSingleSpacesToEmit) { - writer.rawWrite(" "); - numberOfSingleSpacesToEmit--; - } - } - else { - // No spaces to emit write empty string - writer.rawWrite(""); - } - } - // Write the comment line text - writeTrimmedCurrentLine(pos, nextLineStart); - pos = nextLineStart; - } - } - else { - // Single line comment of style //.... - writer.write(currentSourceFile.text.substring(comment.pos, comment.end)); - } - function writeTrimmedCurrentLine(pos, nextLineStart) { - var end = Math.min(comment.end, nextLineStart - 1); - var currentLineText = currentSourceFile.text.substring(pos, end).replace(/^\s+|\s+$/g, ''); - if (currentLineText) { - // trimmed forward and ending spaces text - writer.write(currentLineText); - if (end !== comment.end) { - writer.writeLine(); - } - } - else { - // Empty string - make sure we write empty line - writer.writeLiteral(newLine); - } - } - function calculateIndent(pos, end) { - var currentLineIndent = 0; - for (; pos < end && ts.isWhiteSpace(currentSourceFile.text.charCodeAt(pos)); pos++) { - if (currentSourceFile.text.charCodeAt(pos) === 9 /* tab */) { - // Tabs = TabSize = indent size and go to next tabStop - currentLineIndent += getIndentSize() - (currentLineIndent % getIndentSize()); - } - else { - // Single space - currentLineIndent++; - } - } - return currentLineIndent; - } - } - ts.writeCommentRange = writeCommentRange; - function modifierToFlag(token) { - switch (token) { - case 109 /* StaticKeyword */: return 128 /* Static */; - case 108 /* PublicKeyword */: return 16 /* Public */; - case 107 /* ProtectedKeyword */: return 64 /* Protected */; - case 106 /* PrivateKeyword */: return 32 /* Private */; - case 78 /* ExportKeyword */: return 1 /* Export */; - case 115 /* DeclareKeyword */: return 2 /* Ambient */; - case 70 /* ConstKeyword */: return 8192 /* Const */; - case 73 /* DefaultKeyword */: return 256 /* Default */; - } - return 0; - } - ts.modifierToFlag = modifierToFlag; - function isLeftHandSideExpression(expr) { - if (expr) { - switch (expr.kind) { - case 158 /* PropertyAccessExpression */: - case 159 /* ElementAccessExpression */: - case 161 /* NewExpression */: - case 160 /* CallExpression */: - case 162 /* TaggedTemplateExpression */: - case 156 /* ArrayLiteralExpression */: - case 164 /* ParenthesizedExpression */: - case 157 /* ObjectLiteralExpression */: - case 177 /* ClassExpression */: - case 165 /* FunctionExpression */: - case 65 /* Identifier */: - case 9 /* RegularExpressionLiteral */: - case 7 /* NumericLiteral */: - case 8 /* StringLiteral */: - case 10 /* NoSubstitutionTemplateLiteral */: - case 174 /* TemplateExpression */: - case 80 /* FalseKeyword */: - case 89 /* NullKeyword */: - case 93 /* ThisKeyword */: - case 95 /* TrueKeyword */: - case 91 /* SuperKeyword */: - return true; - } - } - return false; - } - ts.isLeftHandSideExpression = isLeftHandSideExpression; - function isAssignmentOperator(token) { - return token >= 53 /* FirstAssignment */ && token <= 64 /* LastAssignment */; - } - ts.isAssignmentOperator = isAssignmentOperator; - // Returns false if this heritage clause element's expression contains something unsupported - // (i.e. not a name or dotted name). - function isSupportedExpressionWithTypeArguments(node) { - return isSupportedExpressionWithTypeArgumentsRest(node.expression); - } - ts.isSupportedExpressionWithTypeArguments = isSupportedExpressionWithTypeArguments; - function isSupportedExpressionWithTypeArgumentsRest(node) { - if (node.kind === 65 /* Identifier */) { - return true; - } - else if (node.kind === 158 /* PropertyAccessExpression */) { - return isSupportedExpressionWithTypeArgumentsRest(node.expression); - } - else { - return false; - } - } - function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return (node.parent.kind === 128 /* QualifiedName */ && node.parent.right === node) || - (node.parent.kind === 158 /* PropertyAccessExpression */ && node.parent.name === node); - } - ts.isRightSideOfQualifiedNameOrPropertyAccess = isRightSideOfQualifiedNameOrPropertyAccess; - function getLocalSymbolForExportDefault(symbol) { - return symbol && symbol.valueDeclaration && (symbol.valueDeclaration.flags & 256 /* Default */) ? symbol.valueDeclaration.localSymbol : undefined; - } - ts.getLocalSymbolForExportDefault = getLocalSymbolForExportDefault; - function isJavaScript(fileName) { - return ts.fileExtensionIs(fileName, ".js"); - } - ts.isJavaScript = isJavaScript; - /** - * Replace each instance of non-ascii characters by one, two, three, or four escape sequences - * representing the UTF-8 encoding of the character, and return the expanded char code list. - */ - function getExpandedCharCodes(input) { - var output = []; - var length = input.length; - var leadSurrogate = undefined; - for (var i = 0; i < length; i++) { - var charCode = input.charCodeAt(i); - // handel utf8 - if (charCode < 0x80) { - output.push(charCode); - } - else if (charCode < 0x800) { - output.push((charCode >> 6) | 192); - output.push((charCode & 63) | 128); - } - else if (charCode < 0x10000) { - output.push((charCode >> 12) | 224); - output.push(((charCode >> 6) & 63) | 128); - output.push((charCode & 63) | 128); - } - else if (charCode < 0x20000) { - output.push((charCode >> 18) | 240); - output.push(((charCode >> 12) & 63) | 128); - output.push(((charCode >> 6) & 63) | 128); - output.push((charCode & 63) | 128); - } - else { - ts.Debug.assert(false, "Unexpected code point"); - } - } - return output; - } - var base64Digits = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; - /** - * Converts a string to a base-64 encoded ASCII string. - */ - function convertToBase64(input) { - var result = ""; - var charCodes = getExpandedCharCodes(input); - var i = 0; - var length = charCodes.length; - var byte1, byte2, byte3, byte4; - while (i < length) { - // Convert every 6-bits in the input 3 character points - // into a base64 digit - byte1 = charCodes[i] >> 2; - byte2 = (charCodes[i] & 3) << 4 | charCodes[i + 1] >> 4; - byte3 = (charCodes[i + 1] & 15) << 2 | charCodes[i + 2] >> 6; - byte4 = charCodes[i + 2] & 63; - // We are out of characters in the input, set the extra - // digits to 64 (padding character). - if (i + 1 >= length) { - byte3 = byte4 = 64; - } - else if (i + 2 >= length) { - byte4 = 64; - } - // Write to the ouput - result += base64Digits.charAt(byte1) + base64Digits.charAt(byte2) + base64Digits.charAt(byte3) + base64Digits.charAt(byte4); - i += 3; - } - return result; - } - ts.convertToBase64 = convertToBase64; - var carriageReturnLineFeed = "\r\n"; - var lineFeed = "\n"; - function getNewLineCharacter(options) { - if (options.newLine === 0 /* CarriageReturnLineFeed */) { - return carriageReturnLineFeed; - } - else if (options.newLine === 1 /* LineFeed */) { - return lineFeed; - } - else if (ts.sys) { - return ts.sys.newLine; - } - return carriageReturnLineFeed; - } - ts.getNewLineCharacter = getNewLineCharacter; -})(ts || (ts = {})); -var ts; -(function (ts) { - function getDefaultLibFileName(options) { - return options.target === 2 /* ES6 */ ? "lib.es6.d.ts" : "lib.d.ts"; - } - ts.getDefaultLibFileName = getDefaultLibFileName; - function textSpanEnd(span) { - return span.start + span.length; - } - ts.textSpanEnd = textSpanEnd; - function textSpanIsEmpty(span) { - return span.length === 0; - } - ts.textSpanIsEmpty = textSpanIsEmpty; - function textSpanContainsPosition(span, position) { - return position >= span.start && position < textSpanEnd(span); - } - ts.textSpanContainsPosition = textSpanContainsPosition; - // Returns true if 'span' contains 'other'. - function textSpanContainsTextSpan(span, other) { - return other.start >= span.start && textSpanEnd(other) <= textSpanEnd(span); - } - ts.textSpanContainsTextSpan = textSpanContainsTextSpan; - function textSpanOverlapsWith(span, other) { - var overlapStart = Math.max(span.start, other.start); - var overlapEnd = Math.min(textSpanEnd(span), textSpanEnd(other)); - return overlapStart < overlapEnd; - } - ts.textSpanOverlapsWith = textSpanOverlapsWith; - function textSpanOverlap(span1, span2) { - var overlapStart = Math.max(span1.start, span2.start); - var overlapEnd = Math.min(textSpanEnd(span1), textSpanEnd(span2)); - if (overlapStart < overlapEnd) { - return createTextSpanFromBounds(overlapStart, overlapEnd); - } - return undefined; - } - ts.textSpanOverlap = textSpanOverlap; - function textSpanIntersectsWithTextSpan(span, other) { - return other.start <= textSpanEnd(span) && textSpanEnd(other) >= span.start; - } - ts.textSpanIntersectsWithTextSpan = textSpanIntersectsWithTextSpan; - function textSpanIntersectsWith(span, start, length) { - var end = start + length; - return start <= textSpanEnd(span) && end >= span.start; - } - ts.textSpanIntersectsWith = textSpanIntersectsWith; - function textSpanIntersectsWithPosition(span, position) { - return position <= textSpanEnd(span) && position >= span.start; - } - ts.textSpanIntersectsWithPosition = textSpanIntersectsWithPosition; - function textSpanIntersection(span1, span2) { - var intersectStart = Math.max(span1.start, span2.start); - var intersectEnd = Math.min(textSpanEnd(span1), textSpanEnd(span2)); - if (intersectStart <= intersectEnd) { - return createTextSpanFromBounds(intersectStart, intersectEnd); - } - return undefined; - } - ts.textSpanIntersection = textSpanIntersection; - function createTextSpan(start, length) { - if (start < 0) { - throw new Error("start < 0"); - } - if (length < 0) { - throw new Error("length < 0"); - } - return { start: start, length: length }; - } - ts.createTextSpan = createTextSpan; - function createTextSpanFromBounds(start, end) { - return createTextSpan(start, end - start); - } - ts.createTextSpanFromBounds = createTextSpanFromBounds; - function textChangeRangeNewSpan(range) { - return createTextSpan(range.span.start, range.newLength); - } - ts.textChangeRangeNewSpan = textChangeRangeNewSpan; - function textChangeRangeIsUnchanged(range) { - return textSpanIsEmpty(range.span) && range.newLength === 0; - } - ts.textChangeRangeIsUnchanged = textChangeRangeIsUnchanged; - function createTextChangeRange(span, newLength) { - if (newLength < 0) { - throw new Error("newLength < 0"); - } - return { span: span, newLength: newLength }; - } - ts.createTextChangeRange = createTextChangeRange; - ts.unchangedTextChangeRange = createTextChangeRange(createTextSpan(0, 0), 0); - /** - * Called to merge all the changes that occurred across several versions of a script snapshot - * into a single change. i.e. if a user keeps making successive edits to a script we will - * have a text change from V1 to V2, V2 to V3, ..., Vn. - * - * This function will then merge those changes into a single change range valid between V1 and - * Vn. - */ - function collapseTextChangeRangesAcrossMultipleVersions(changes) { - if (changes.length === 0) { - return ts.unchangedTextChangeRange; - } - if (changes.length === 1) { - return changes[0]; - } - // We change from talking about { { oldStart, oldLength }, newLength } to { oldStart, oldEnd, newEnd } - // as it makes things much easier to reason about. - var change0 = changes[0]; - var oldStartN = change0.span.start; - var oldEndN = textSpanEnd(change0.span); - var newEndN = oldStartN + change0.newLength; - for (var i = 1; i < changes.length; i++) { - var nextChange = changes[i]; - // Consider the following case: - // i.e. two edits. The first represents the text change range { { 10, 50 }, 30 }. i.e. The span starting - // at 10, with length 50 is reduced to length 30. The second represents the text change range { { 30, 30 }, 40 }. - // i.e. the span starting at 30 with length 30 is increased to length 40. - // - // 0 10 20 30 40 50 60 70 80 90 100 - // ------------------------------------------------------------------------------------------------------- - // | / - // | /---- - // T1 | /---- - // | /---- - // | /---- - // ------------------------------------------------------------------------------------------------------- - // | \ - // | \ - // T2 | \ - // | \ - // | \ - // ------------------------------------------------------------------------------------------------------- - // - // Merging these turns out to not be too difficult. First, determining the new start of the change is trivial - // it's just the min of the old and new starts. i.e.: - // - // 0 10 20 30 40 50 60 70 80 90 100 - // ------------------------------------------------------------*------------------------------------------ - // | / - // | /---- - // T1 | /---- - // | /---- - // | /---- - // ----------------------------------------$-------------------$------------------------------------------ - // . | \ - // . | \ - // T2 . | \ - // . | \ - // . | \ - // ----------------------------------------------------------------------*-------------------------------- - // - // (Note the dots represent the newly inferrred start. - // Determining the new and old end is also pretty simple. Basically it boils down to paying attention to the - // absolute positions at the asterixes, and the relative change between the dollar signs. Basically, we see - // which if the two $'s precedes the other, and we move that one forward until they line up. in this case that - // means: - // - // 0 10 20 30 40 50 60 70 80 90 100 - // --------------------------------------------------------------------------------*---------------------- - // | / - // | /---- - // T1 | /---- - // | /---- - // | /---- - // ------------------------------------------------------------$------------------------------------------ - // . | \ - // . | \ - // T2 . | \ - // . | \ - // . | \ - // ----------------------------------------------------------------------*-------------------------------- - // - // In other words (in this case), we're recognizing that the second edit happened after where the first edit - // ended with a delta of 20 characters (60 - 40). Thus, if we go back in time to where the first edit started - // that's the same as if we started at char 80 instead of 60. - // - // As it so happens, the same logic applies if the second edit precedes the first edit. In that case rahter - // than pusing the first edit forward to match the second, we'll push the second edit forward to match the - // first. - // - // In this case that means we have { oldStart: 10, oldEnd: 80, newEnd: 70 } or, in TextChangeRange - // semantics: { { start: 10, length: 70 }, newLength: 60 } - // - // The math then works out as follows. - // If we have { oldStart1, oldEnd1, newEnd1 } and { oldStart2, oldEnd2, newEnd2 } then we can compute the - // final result like so: - // - // { - // oldStart3: Min(oldStart1, oldStart2), - // oldEnd3 : Max(oldEnd1, oldEnd1 + (oldEnd2 - newEnd1)), - // newEnd3 : Max(newEnd2, newEnd2 + (newEnd1 - oldEnd2)) - // } - var oldStart1 = oldStartN; - var oldEnd1 = oldEndN; - var newEnd1 = newEndN; - var oldStart2 = nextChange.span.start; - var oldEnd2 = textSpanEnd(nextChange.span); - var newEnd2 = oldStart2 + nextChange.newLength; - oldStartN = Math.min(oldStart1, oldStart2); - oldEndN = Math.max(oldEnd1, oldEnd1 + (oldEnd2 - newEnd1)); - newEndN = Math.max(newEnd2, newEnd2 + (newEnd1 - oldEnd2)); - } - return createTextChangeRange(createTextSpanFromBounds(oldStartN, oldEndN), newEndN - oldStartN); - } - ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions; - function getTypeParameterOwner(d) { - if (d && d.kind === 130 /* TypeParameter */) { - for (var current = d; current; current = current.parent) { - if (ts.isFunctionLike(current) || ts.isClassLike(current) || current.kind === 205 /* InterfaceDeclaration */) { - return current; - } - } - } - } - ts.getTypeParameterOwner = getTypeParameterOwner; -})(ts || (ts = {})); -/// -/// -var ts; -(function (ts) { - var nodeConstructors = new Array(254 /* Count */); - /* @internal */ ts.parseTime = 0; - function getNodeConstructor(kind) { - return nodeConstructors[kind] || (nodeConstructors[kind] = ts.objectAllocator.getNodeConstructor(kind)); - } - ts.getNodeConstructor = getNodeConstructor; - function createNode(kind) { - return new (getNodeConstructor(kind))(); - } - ts.createNode = createNode; - function visitNode(cbNode, node) { - if (node) { - return cbNode(node); - } - } - function visitNodeArray(cbNodes, nodes) { - if (nodes) { - return cbNodes(nodes); - } - } - function visitEachNode(cbNode, nodes) { - if (nodes) { - for (var _i = 0; _i < nodes.length; _i++) { - var node = nodes[_i]; - var result = cbNode(node); - if (result) { - return result; - } - } - } - } - // Invokes a callback for each child of the given node. The 'cbNode' callback is invoked for all child nodes - // stored in properties. If a 'cbNodes' callback is specified, it is invoked for embedded arrays; otherwise, - // embedded arrays are flattened and the 'cbNode' callback is invoked for each element. If a callback returns - // a truthy value, iteration stops and that value is returned. Otherwise, undefined is returned. - function forEachChild(node, cbNode, cbNodeArray) { - if (!node) { - return; - } - // The visitXXX functions could be written as local functions that close over the cbNode and cbNodeArray - // callback parameters, but that causes a closure allocation for each invocation with noticeable effects - // on performance. - var visitNodes = cbNodeArray ? visitNodeArray : visitEachNode; - var cbNodes = cbNodeArray || cbNode; - switch (node.kind) { - case 128 /* QualifiedName */: - return visitNode(cbNode, node.left) || - visitNode(cbNode, node.right); - case 130 /* TypeParameter */: - return visitNode(cbNode, node.name) || - visitNode(cbNode, node.constraint) || - visitNode(cbNode, node.expression); - case 131 /* Parameter */: - case 134 /* PropertyDeclaration */: - case 133 /* PropertySignature */: - case 227 /* PropertyAssignment */: - case 228 /* ShorthandPropertyAssignment */: - case 201 /* VariableDeclaration */: - case 155 /* BindingElement */: - return visitNodes(cbNodes, node.decorators) || - visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.propertyName) || - visitNode(cbNode, node.dotDotDotToken) || - visitNode(cbNode, node.name) || - visitNode(cbNode, node.questionToken) || - visitNode(cbNode, node.type) || - visitNode(cbNode, node.initializer); - case 145 /* FunctionType */: - case 146 /* ConstructorType */: - case 140 /* CallSignature */: - case 141 /* ConstructSignature */: - case 142 /* IndexSignature */: - return visitNodes(cbNodes, node.decorators) || - visitNodes(cbNodes, node.modifiers) || - visitNodes(cbNodes, node.typeParameters) || - visitNodes(cbNodes, node.parameters) || - visitNode(cbNode, node.type); - case 136 /* MethodDeclaration */: - case 135 /* MethodSignature */: - case 137 /* Constructor */: - case 138 /* GetAccessor */: - case 139 /* SetAccessor */: - case 165 /* FunctionExpression */: - case 203 /* FunctionDeclaration */: - case 166 /* ArrowFunction */: - return visitNodes(cbNodes, node.decorators) || - visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.asteriskToken) || - visitNode(cbNode, node.name) || - visitNode(cbNode, node.questionToken) || - visitNodes(cbNodes, node.typeParameters) || - visitNodes(cbNodes, node.parameters) || - visitNode(cbNode, node.type) || - visitNode(cbNode, node.equalsGreaterThanToken) || - visitNode(cbNode, node.body); - case 144 /* TypeReference */: - return visitNode(cbNode, node.typeName) || - visitNodes(cbNodes, node.typeArguments); - case 143 /* TypePredicate */: - return visitNode(cbNode, node.parameterName) || - visitNode(cbNode, node.type); - case 147 /* TypeQuery */: - return visitNode(cbNode, node.exprName); - case 148 /* TypeLiteral */: - return visitNodes(cbNodes, node.members); - case 149 /* ArrayType */: - return visitNode(cbNode, node.elementType); - case 150 /* TupleType */: - return visitNodes(cbNodes, node.elementTypes); - case 151 /* UnionType */: - return visitNodes(cbNodes, node.types); - case 152 /* ParenthesizedType */: - return visitNode(cbNode, node.type); - case 153 /* ObjectBindingPattern */: - case 154 /* ArrayBindingPattern */: - return visitNodes(cbNodes, node.elements); - case 156 /* ArrayLiteralExpression */: - return visitNodes(cbNodes, node.elements); - case 157 /* ObjectLiteralExpression */: - return visitNodes(cbNodes, node.properties); - case 158 /* PropertyAccessExpression */: - return visitNode(cbNode, node.expression) || - visitNode(cbNode, node.dotToken) || - visitNode(cbNode, node.name); - case 159 /* ElementAccessExpression */: - return visitNode(cbNode, node.expression) || - visitNode(cbNode, node.argumentExpression); - case 160 /* CallExpression */: - case 161 /* NewExpression */: - return visitNode(cbNode, node.expression) || - visitNodes(cbNodes, node.typeArguments) || - visitNodes(cbNodes, node.arguments); - case 162 /* TaggedTemplateExpression */: - return visitNode(cbNode, node.tag) || - visitNode(cbNode, node.template); - case 163 /* TypeAssertionExpression */: - return visitNode(cbNode, node.type) || - visitNode(cbNode, node.expression); - case 164 /* ParenthesizedExpression */: - return visitNode(cbNode, node.expression); - case 167 /* DeleteExpression */: - return visitNode(cbNode, node.expression); - case 168 /* TypeOfExpression */: - return visitNode(cbNode, node.expression); - case 169 /* VoidExpression */: - return visitNode(cbNode, node.expression); - case 170 /* PrefixUnaryExpression */: - return visitNode(cbNode, node.operand); - case 175 /* YieldExpression */: - return visitNode(cbNode, node.asteriskToken) || - visitNode(cbNode, node.expression); - case 171 /* PostfixUnaryExpression */: - return visitNode(cbNode, node.operand); - case 172 /* BinaryExpression */: - return visitNode(cbNode, node.left) || - visitNode(cbNode, node.operatorToken) || - visitNode(cbNode, node.right); - case 173 /* ConditionalExpression */: - return visitNode(cbNode, node.condition) || - visitNode(cbNode, node.questionToken) || - visitNode(cbNode, node.whenTrue) || - visitNode(cbNode, node.colonToken) || - visitNode(cbNode, node.whenFalse); - case 176 /* SpreadElementExpression */: - return visitNode(cbNode, node.expression); - case 182 /* Block */: - case 209 /* ModuleBlock */: - return visitNodes(cbNodes, node.statements); - case 230 /* SourceFile */: - return visitNodes(cbNodes, node.statements) || - visitNode(cbNode, node.endOfFileToken); - case 183 /* VariableStatement */: - return visitNodes(cbNodes, node.decorators) || - visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.declarationList); - case 202 /* VariableDeclarationList */: - return visitNodes(cbNodes, node.declarations); - case 185 /* ExpressionStatement */: - return visitNode(cbNode, node.expression); - case 186 /* IfStatement */: - return visitNode(cbNode, node.expression) || - visitNode(cbNode, node.thenStatement) || - visitNode(cbNode, node.elseStatement); - case 187 /* DoStatement */: - return visitNode(cbNode, node.statement) || - visitNode(cbNode, node.expression); - case 188 /* WhileStatement */: - return visitNode(cbNode, node.expression) || - visitNode(cbNode, node.statement); - case 189 /* ForStatement */: - return visitNode(cbNode, node.initializer) || - visitNode(cbNode, node.condition) || - visitNode(cbNode, node.incrementor) || - visitNode(cbNode, node.statement); - case 190 /* ForInStatement */: - return visitNode(cbNode, node.initializer) || - visitNode(cbNode, node.expression) || - visitNode(cbNode, node.statement); - case 191 /* ForOfStatement */: - return visitNode(cbNode, node.initializer) || - visitNode(cbNode, node.expression) || - visitNode(cbNode, node.statement); - case 192 /* ContinueStatement */: - case 193 /* BreakStatement */: - return visitNode(cbNode, node.label); - case 194 /* ReturnStatement */: - return visitNode(cbNode, node.expression); - case 195 /* WithStatement */: - return visitNode(cbNode, node.expression) || - visitNode(cbNode, node.statement); - case 196 /* SwitchStatement */: - return visitNode(cbNode, node.expression) || - visitNode(cbNode, node.caseBlock); - case 210 /* CaseBlock */: - return visitNodes(cbNodes, node.clauses); - case 223 /* CaseClause */: - return visitNode(cbNode, node.expression) || - visitNodes(cbNodes, node.statements); - case 224 /* DefaultClause */: - return visitNodes(cbNodes, node.statements); - case 197 /* LabeledStatement */: - return visitNode(cbNode, node.label) || - visitNode(cbNode, node.statement); - case 198 /* ThrowStatement */: - return visitNode(cbNode, node.expression); - case 199 /* TryStatement */: - return visitNode(cbNode, node.tryBlock) || - visitNode(cbNode, node.catchClause) || - visitNode(cbNode, node.finallyBlock); - case 226 /* CatchClause */: - return visitNode(cbNode, node.variableDeclaration) || - visitNode(cbNode, node.block); - case 132 /* Decorator */: - return visitNode(cbNode, node.expression); - case 204 /* ClassDeclaration */: - case 177 /* ClassExpression */: - return visitNodes(cbNodes, node.decorators) || - visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.name) || - visitNodes(cbNodes, node.typeParameters) || - visitNodes(cbNodes, node.heritageClauses) || - visitNodes(cbNodes, node.members); - case 205 /* InterfaceDeclaration */: - return visitNodes(cbNodes, node.decorators) || - visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.name) || - visitNodes(cbNodes, node.typeParameters) || - visitNodes(cbNodes, node.heritageClauses) || - visitNodes(cbNodes, node.members); - case 206 /* TypeAliasDeclaration */: - return visitNodes(cbNodes, node.decorators) || - visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.name) || - visitNodes(cbNodes, node.typeParameters) || - visitNode(cbNode, node.type); - case 207 /* EnumDeclaration */: - return visitNodes(cbNodes, node.decorators) || - visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.name) || - visitNodes(cbNodes, node.members); - case 229 /* EnumMember */: - return visitNode(cbNode, node.name) || - visitNode(cbNode, node.initializer); - case 208 /* ModuleDeclaration */: - return visitNodes(cbNodes, node.decorators) || - visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.name) || - visitNode(cbNode, node.body); - case 211 /* ImportEqualsDeclaration */: - return visitNodes(cbNodes, node.decorators) || - visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.name) || - visitNode(cbNode, node.moduleReference); - case 212 /* ImportDeclaration */: - return visitNodes(cbNodes, node.decorators) || - visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.importClause) || - visitNode(cbNode, node.moduleSpecifier); - case 213 /* ImportClause */: - return visitNode(cbNode, node.name) || - visitNode(cbNode, node.namedBindings); - case 214 /* NamespaceImport */: - return visitNode(cbNode, node.name); - case 215 /* NamedImports */: - case 219 /* NamedExports */: - return visitNodes(cbNodes, node.elements); - case 218 /* ExportDeclaration */: - return visitNodes(cbNodes, node.decorators) || - visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.exportClause) || - visitNode(cbNode, node.moduleSpecifier); - case 216 /* ImportSpecifier */: - case 220 /* ExportSpecifier */: - return visitNode(cbNode, node.propertyName) || - visitNode(cbNode, node.name); - case 217 /* ExportAssignment */: - return visitNodes(cbNodes, node.decorators) || - visitNodes(cbNodes, node.modifiers) || - visitNode(cbNode, node.expression); - case 174 /* TemplateExpression */: - return visitNode(cbNode, node.head) || visitNodes(cbNodes, node.templateSpans); - case 180 /* TemplateSpan */: - return visitNode(cbNode, node.expression) || visitNode(cbNode, node.literal); - case 129 /* ComputedPropertyName */: - return visitNode(cbNode, node.expression); - case 225 /* HeritageClause */: - return visitNodes(cbNodes, node.types); - case 179 /* ExpressionWithTypeArguments */: - return visitNode(cbNode, node.expression) || - visitNodes(cbNodes, node.typeArguments); - case 222 /* ExternalModuleReference */: - return visitNode(cbNode, node.expression); - case 221 /* MissingDeclaration */: - return visitNodes(cbNodes, node.decorators); - case 231 /* JSDocTypeExpression */: - return visitNode(cbNode, node.type); - case 235 /* JSDocUnionType */: - return visitNodes(cbNodes, node.types); - case 236 /* JSDocTupleType */: - return visitNodes(cbNodes, node.types); - case 234 /* JSDocArrayType */: - return visitNode(cbNode, node.elementType); - case 238 /* JSDocNonNullableType */: - return visitNode(cbNode, node.type); - case 237 /* JSDocNullableType */: - return visitNode(cbNode, node.type); - case 239 /* JSDocRecordType */: - return visitNodes(cbNodes, node.members); - case 241 /* JSDocTypeReference */: - return visitNode(cbNode, node.name) || - visitNodes(cbNodes, node.typeArguments); - case 242 /* JSDocOptionalType */: - return visitNode(cbNode, node.type); - case 243 /* JSDocFunctionType */: - return visitNodes(cbNodes, node.parameters) || - visitNode(cbNode, node.type); - case 244 /* JSDocVariadicType */: - return visitNode(cbNode, node.type); - case 245 /* JSDocConstructorType */: - return visitNode(cbNode, node.type); - case 246 /* JSDocThisType */: - return visitNode(cbNode, node.type); - case 240 /* JSDocRecordMember */: - return visitNode(cbNode, node.name) || - visitNode(cbNode, node.type); - case 247 /* JSDocComment */: - return visitNodes(cbNodes, node.tags); - case 249 /* JSDocParameterTag */: - return visitNode(cbNode, node.preParameterName) || - visitNode(cbNode, node.typeExpression) || - visitNode(cbNode, node.postParameterName); - case 250 /* JSDocReturnTag */: - return visitNode(cbNode, node.typeExpression); - case 251 /* JSDocTypeTag */: - return visitNode(cbNode, node.typeExpression); - case 252 /* JSDocTemplateTag */: - return visitNodes(cbNodes, node.typeParameters); - } - } - ts.forEachChild = forEachChild; - function createSourceFile(fileName, sourceText, languageVersion, setParentNodes) { - if (setParentNodes === void 0) { setParentNodes = false; } - var start = new Date().getTime(); - var result = Parser.parseSourceFile(fileName, sourceText, languageVersion, undefined, setParentNodes); - ts.parseTime += new Date().getTime() - start; - return result; - } - ts.createSourceFile = createSourceFile; - // Produces a new SourceFile for the 'newText' provided. The 'textChangeRange' parameter - // indicates what changed between the 'text' that this SourceFile has and the 'newText'. - // The SourceFile will be created with the compiler attempting to reuse as many nodes from - // this file as possible. - // - // Note: this function mutates nodes from this SourceFile. That means any existing nodes - // from this SourceFile that are being held onto may change as a result (including - // becoming detached from any SourceFile). It is recommended that this SourceFile not - // be used once 'update' is called on it. - function updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks) { - return IncrementalParser.updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks); - } - ts.updateSourceFile = updateSourceFile; - /* @internal */ - function parseIsolatedJSDocComment(content, start, length) { - return Parser.JSDocParser.parseIsolatedJSDocComment(content, start, length); - } - ts.parseIsolatedJSDocComment = parseIsolatedJSDocComment; - /* @internal */ - // Exposed only for testing. - function parseJSDocTypeExpressionForTests(content, start, length) { - return Parser.JSDocParser.parseJSDocTypeExpressionForTests(content, start, length); - } - ts.parseJSDocTypeExpressionForTests = parseJSDocTypeExpressionForTests; - // Implement the parser as a singleton module. We do this for perf reasons because creating - // parser instances can actually be expensive enough to impact us on projects with many source - // files. - var Parser; - (function (Parser) { - // Share a single scanner across all calls to parse a source file. This helps speed things - // up by avoiding the cost of creating/compiling scanners over and over again. - var scanner = ts.createScanner(2 /* Latest */, true); - var disallowInAndDecoratorContext = 2 /* DisallowIn */ | 16 /* Decorator */; - var sourceFile; - var parseDiagnostics; - var syntaxCursor; - var token; - var sourceText; - var nodeCount; - var identifiers; - var identifierCount; - var parsingContext; - // Flags that dictate what parsing context we're in. For example: - // Whether or not we are in strict parsing mode. All that changes in strict parsing mode is - // that some tokens that would be considered identifiers may be considered keywords. - // - // When adding more parser context flags, consider which is the more common case that the - // flag will be in. This should be the 'false' state for that flag. The reason for this is - // that we don't store data in our nodes unless the value is in the *non-default* state. So, - // for example, more often than code 'allows-in' (or doesn't 'disallow-in'). We opt for - // 'disallow-in' set to 'false'. Otherwise, if we had 'allowsIn' set to 'true', then almost - // all nodes would need extra state on them to store this info. - // - // Note: 'allowIn' and 'allowYield' track 1:1 with the [in] and [yield] concepts in the ES6 - // grammar specification. - // - // An important thing about these context concepts. By default they are effectively inherited - // while parsing through every grammar production. i.e. if you don't change them, then when - // you parse a sub-production, it will have the same context values as the parent production. - // This is great most of the time. After all, consider all the 'expression' grammar productions - // and how nearly all of them pass along the 'in' and 'yield' context values: - // - // EqualityExpression[In, Yield] : - // RelationalExpression[?In, ?Yield] - // EqualityExpression[?In, ?Yield] == RelationalExpression[?In, ?Yield] - // EqualityExpression[?In, ?Yield] != RelationalExpression[?In, ?Yield] - // EqualityExpression[?In, ?Yield] === RelationalExpression[?In, ?Yield] - // EqualityExpression[?In, ?Yield] !== RelationalExpression[?In, ?Yield] - // - // Where you have to be careful is then understanding what the points are in the grammar - // where the values are *not* passed along. For example: - // - // SingleNameBinding[Yield,GeneratorParameter] - // [+GeneratorParameter]BindingIdentifier[Yield] Initializer[In]opt - // [~GeneratorParameter]BindingIdentifier[?Yield]Initializer[In, ?Yield]opt - // - // Here this is saying that if the GeneratorParameter context flag is set, that we should - // explicitly set the 'yield' context flag to false before calling into the BindingIdentifier - // and we should explicitly unset the 'yield' context flag before calling into the Initializer. - // production. Conversely, if the GeneratorParameter context flag is not set, then we - // should leave the 'yield' context flag alone. - // - // Getting this all correct is tricky and requires careful reading of the grammar to - // understand when these values should be changed versus when they should be inherited. - // - // Note: it should not be necessary to save/restore these flags during speculative/lookahead - // parsing. These context flags are naturally stored and restored through normal recursive - // descent parsing and unwinding. - var contextFlags; - // Whether or not we've had a parse error since creating the last AST node. If we have - // encountered an error, it will be stored on the next AST node we create. Parse errors - // can be broken down into three categories: - // - // 1) An error that occurred during scanning. For example, an unterminated literal, or a - // character that was completely not understood. - // - // 2) A token was expected, but was not present. This type of error is commonly produced - // by the 'parseExpected' function. - // - // 3) A token was present that no parsing function was able to consume. This type of error - // only occurs in the 'abortParsingListOrMoveToNextToken' function when the parser - // decides to skip the token. - // - // In all of these cases, we want to mark the next node as having had an error before it. - // With this mark, we can know in incremental settings if this node can be reused, or if - // we have to reparse it. If we don't keep this information around, we may just reuse the - // node. in that event we would then not produce the same errors as we did before, causing - // significant confusion problems. - // - // Note: it is necessary that this value be saved/restored during speculative/lookahead - // parsing. During lookahead parsing, we will often create a node. That node will have - // this value attached, and then this value will be set back to 'false'. If we decide to - // rewind, we must get back to the same value we had prior to the lookahead. - // - // Note: any errors at the end of the file that do not precede a regular node, should get - // attached to the EOF token. - var parseErrorBeforeNextFinishedNode = false; - function parseSourceFile(fileName, _sourceText, languageVersion, _syntaxCursor, setParentNodes) { - initializeState(fileName, _sourceText, languageVersion, _syntaxCursor); - var result = parseSourceFileWorker(fileName, languageVersion, setParentNodes); - clearState(); - return result; - } - Parser.parseSourceFile = parseSourceFile; - function initializeState(fileName, _sourceText, languageVersion, _syntaxCursor) { - sourceText = _sourceText; - syntaxCursor = _syntaxCursor; - parseDiagnostics = []; - parsingContext = 0; - identifiers = {}; - identifierCount = 0; - nodeCount = 0; - contextFlags = ts.isJavaScript(fileName) ? 64 /* JavaScriptFile */ : 0 /* None */; - parseErrorBeforeNextFinishedNode = false; - // Initialize and prime the scanner before parsing the source elements. - scanner.setText(sourceText); - scanner.setOnError(scanError); - scanner.setScriptTarget(languageVersion); - } - function clearState() { - // Clear out the text the scanner is pointing at, so it doesn't keep anything alive unnecessarily. - scanner.setText(""); - scanner.setOnError(undefined); - // Clear any data. We don't want to accidently hold onto it for too long. - parseDiagnostics = undefined; - sourceFile = undefined; - identifiers = undefined; - syntaxCursor = undefined; - sourceText = undefined; - } - function parseSourceFileWorker(fileName, languageVersion, setParentNodes) { - sourceFile = createSourceFile(fileName, languageVersion); - // Prime the scanner. - token = nextToken(); - processReferenceComments(sourceFile); - sourceFile.statements = parseList(0 /* SourceElements */, true, parseStatement); - ts.Debug.assert(token === 1 /* EndOfFileToken */); - sourceFile.endOfFileToken = parseTokenNode(); - setExternalModuleIndicator(sourceFile); - sourceFile.nodeCount = nodeCount; - sourceFile.identifierCount = identifierCount; - sourceFile.identifiers = identifiers; - sourceFile.parseDiagnostics = parseDiagnostics; - if (setParentNodes) { - fixupParentReferences(sourceFile); - } - // If this is a javascript file, proactively see if we can get JSDoc comments for - // relevant nodes in the file. We'll use these to provide typing informaion if they're - // available. - if (ts.isJavaScript(fileName)) { - addJSDocComments(); - } - return sourceFile; - } - function addJSDocComments() { - forEachChild(sourceFile, visit); - return; - function visit(node) { - // Add additional cases as necessary depending on how we see JSDoc comments used - // in the wild. - switch (node.kind) { - case 183 /* VariableStatement */: - case 203 /* FunctionDeclaration */: - case 131 /* Parameter */: - addJSDocComment(node); - } - forEachChild(node, visit); - } - } - function addJSDocComment(node) { - var comments = ts.getLeadingCommentRangesOfNode(node, sourceFile); - if (comments) { - for (var _i = 0; _i < comments.length; _i++) { - var comment = comments[_i]; - var jsDocComment = JSDocParser.parseJSDocComment(node, comment.pos, comment.end - comment.pos); - if (jsDocComment) { - node.jsDocComment = jsDocComment; - } - } - } - } - function fixupParentReferences(sourceFile) { - // normally parent references are set during binding. However, for clients that only need - // a syntax tree, and no semantic features, then the binding process is an unnecessary - // overhead. This functions allows us to set all the parents, without all the expense of - // binding. - var parent = sourceFile; - forEachChild(sourceFile, visitNode); - return; - function visitNode(n) { - // walk down setting parents that differ from the parent we think it should be. This - // allows us to quickly bail out of setting parents for subtrees during incremental - // parsing - if (n.parent !== parent) { - n.parent = parent; - var saveParent = parent; - parent = n; - forEachChild(n, visitNode); - parent = saveParent; - } - } - } - Parser.fixupParentReferences = fixupParentReferences; - function createSourceFile(fileName, languageVersion) { - var sourceFile = createNode(230 /* SourceFile */, 0); - sourceFile.pos = 0; - sourceFile.end = sourceText.length; - sourceFile.text = sourceText; - sourceFile.bindDiagnostics = []; - sourceFile.languageVersion = languageVersion; - sourceFile.fileName = ts.normalizePath(fileName); - sourceFile.flags = ts.fileExtensionIs(sourceFile.fileName, ".d.ts") ? 2048 /* DeclarationFile */ : 0; - return sourceFile; - } - function setContextFlag(val, flag) { - if (val) { - contextFlags |= flag; - } - else { - contextFlags &= ~flag; - } - } - function setStrictModeContext(val) { - setContextFlag(val, 1 /* StrictMode */); - } - function setDisallowInContext(val) { - setContextFlag(val, 2 /* DisallowIn */); - } - function setYieldContext(val) { - setContextFlag(val, 4 /* Yield */); - } - function setGeneratorParameterContext(val) { - setContextFlag(val, 8 /* GeneratorParameter */); - } - function setDecoratorContext(val) { - setContextFlag(val, 16 /* Decorator */); - } - function doOutsideOfContext(flags, func) { - var currentContextFlags = contextFlags & flags; - if (currentContextFlags) { - setContextFlag(false, currentContextFlags); - var result = func(); - setContextFlag(true, currentContextFlags); - return result; - } - // no need to do anything special as we are not in any of the requested contexts - return func(); - } - function allowInAnd(func) { - if (contextFlags & 2 /* DisallowIn */) { - setDisallowInContext(false); - var result = func(); - setDisallowInContext(true); - return result; - } - // no need to do anything special if 'in' is already allowed. - return func(); - } - function disallowInAnd(func) { - if (contextFlags & 2 /* DisallowIn */) { - // no need to do anything special if 'in' is already disallowed. - return func(); - } - setDisallowInContext(true); - var result = func(); - setDisallowInContext(false); - return result; - } - function doInYieldContext(func) { - if (contextFlags & 4 /* Yield */) { - // no need to do anything special if we're already in the [Yield] context. - return func(); - } - setYieldContext(true); - var result = func(); - setYieldContext(false); - return result; - } - function doOutsideOfYieldContext(func) { - if (contextFlags & 4 /* Yield */) { - setYieldContext(false); - var result = func(); - setYieldContext(true); - return result; - } - // no need to do anything special if we're not in the [Yield] context. - return func(); - } - function doInDecoratorContext(func) { - if (contextFlags & 16 /* Decorator */) { - // no need to do anything special if we're already in the [Decorator] context. - return func(); - } - setDecoratorContext(true); - var result = func(); - setDecoratorContext(false); - return result; - } - function inYieldContext() { - return (contextFlags & 4 /* Yield */) !== 0; - } - function inStrictModeContext() { - return (contextFlags & 1 /* StrictMode */) !== 0; - } - function inGeneratorParameterContext() { - return (contextFlags & 8 /* GeneratorParameter */) !== 0; - } - function inDisallowInContext() { - return (contextFlags & 2 /* DisallowIn */) !== 0; - } - function inDecoratorContext() { - return (contextFlags & 16 /* Decorator */) !== 0; - } - function parseErrorAtCurrentToken(message, arg0) { - var start = scanner.getTokenPos(); - var length = scanner.getTextPos() - start; - parseErrorAtPosition(start, length, message, arg0); - } - function parseErrorAtPosition(start, length, message, arg0) { - // Don't report another error if it would just be at the same position as the last error. - var lastError = ts.lastOrUndefined(parseDiagnostics); - if (!lastError || start !== lastError.start) { - parseDiagnostics.push(ts.createFileDiagnostic(sourceFile, start, length, message, arg0)); - } - // Mark that we've encountered an error. We'll set an appropriate bit on the next - // node we finish so that it can't be reused incrementally. - parseErrorBeforeNextFinishedNode = true; - } - function scanError(message, length) { - var pos = scanner.getTextPos(); - parseErrorAtPosition(pos, length || 0, message); - } - function getNodePos() { - return scanner.getStartPos(); - } - function getNodeEnd() { - return scanner.getStartPos(); - } - function nextToken() { - return token = scanner.scan(); - } - function getTokenPos(pos) { - return ts.skipTrivia(sourceText, pos); - } - function reScanGreaterToken() { - return token = scanner.reScanGreaterToken(); - } - function reScanSlashToken() { - return token = scanner.reScanSlashToken(); - } - function reScanTemplateToken() { - return token = scanner.reScanTemplateToken(); - } - function speculationHelper(callback, isLookAhead) { - // Keep track of the state we'll need to rollback to if lookahead fails (or if the - // caller asked us to always reset our state). - var saveToken = token; - var saveParseDiagnosticsLength = parseDiagnostics.length; - var saveParseErrorBeforeNextFinishedNode = parseErrorBeforeNextFinishedNode; - // Note: it is not actually necessary to save/restore the context flags here. That's - // because the saving/restorating of these flags happens naturally through the recursive - // descent nature of our parser. However, we still store this here just so we can - // assert that that invariant holds. - var saveContextFlags = contextFlags; - // If we're only looking ahead, then tell the scanner to only lookahead as well. - // Otherwise, if we're actually speculatively parsing, then tell the scanner to do the - // same. - var result = isLookAhead - ? scanner.lookAhead(callback) - : scanner.tryScan(callback); - ts.Debug.assert(saveContextFlags === contextFlags); - // If our callback returned something 'falsy' or we're just looking ahead, - // then unconditionally restore us to where we were. - if (!result || isLookAhead) { - token = saveToken; - parseDiagnostics.length = saveParseDiagnosticsLength; - parseErrorBeforeNextFinishedNode = saveParseErrorBeforeNextFinishedNode; - } - return result; - } - // Invokes the provided callback then unconditionally restores the parser to the state it - // was in immediately prior to invoking the callback. The result of invoking the callback - // is returned from this function. - function lookAhead(callback) { - return speculationHelper(callback, true); - } - // Invokes the provided callback. If the callback returns something falsy, then it restores - // the parser to the state it was in immediately prior to invoking the callback. If the - // callback returns something truthy, then the parser state is not rolled back. The result - // of invoking the callback is returned from this function. - function tryParse(callback) { - return speculationHelper(callback, false); - } - // Ignore strict mode flag because we will report an error in type checker instead. - function isIdentifier() { - if (token === 65 /* Identifier */) { - return true; - } - // If we have a 'yield' keyword, and we're in the [yield] context, then 'yield' is - // considered a keyword and is not an identifier. - if (token === 110 /* YieldKeyword */ && inYieldContext()) { - return false; - } - return token > 101 /* LastReservedWord */; - } - function parseExpected(kind, diagnosticMessage) { - if (token === kind) { - nextToken(); - return true; - } - // Report specific message if provided with one. Otherwise, report generic fallback message. - if (diagnosticMessage) { - parseErrorAtCurrentToken(diagnosticMessage); - } - else { - parseErrorAtCurrentToken(ts.Diagnostics._0_expected, ts.tokenToString(kind)); - } - return false; - } - function parseOptional(t) { - if (token === t) { - nextToken(); - return true; - } - return false; - } - function parseOptionalToken(t) { - if (token === t) { - return parseTokenNode(); - } - return undefined; - } - function parseExpectedToken(t, reportAtCurrentPosition, diagnosticMessage, arg0) { - return parseOptionalToken(t) || - createMissingNode(t, reportAtCurrentPosition, diagnosticMessage, arg0); - } - function parseTokenNode() { - var node = createNode(token); - nextToken(); - return finishNode(node); - } - function canParseSemicolon() { - // If there's a real semicolon, then we can always parse it out. - if (token === 22 /* SemicolonToken */) { - return true; - } - // We can parse out an optional semicolon in ASI cases in the following cases. - return token === 15 /* CloseBraceToken */ || token === 1 /* EndOfFileToken */ || scanner.hasPrecedingLineBreak(); - } - function parseSemicolon() { - if (canParseSemicolon()) { - if (token === 22 /* SemicolonToken */) { - // consume the semicolon if it was explicitly provided. - nextToken(); - } - return true; - } - else { - return parseExpected(22 /* SemicolonToken */); - } - } - function createNode(kind, pos) { - nodeCount++; - var node = new (nodeConstructors[kind] || (nodeConstructors[kind] = ts.objectAllocator.getNodeConstructor(kind)))(); - if (!(pos >= 0)) { - pos = scanner.getStartPos(); - } - node.pos = pos; - node.end = pos; - return node; - } - function finishNode(node, end) { - node.end = end === undefined ? scanner.getStartPos() : end; - if (contextFlags) { - node.parserContextFlags = contextFlags; - } - // Keep track on the node if we encountered an error while parsing it. If we did, then - // we cannot reuse the node incrementally. Once we've marked this node, clear out the - // flag so that we don't mark any subsequent nodes. - if (parseErrorBeforeNextFinishedNode) { - parseErrorBeforeNextFinishedNode = false; - node.parserContextFlags |= 32 /* ThisNodeHasError */; - } - return node; - } - function createMissingNode(kind, reportAtCurrentPosition, diagnosticMessage, arg0) { - if (reportAtCurrentPosition) { - parseErrorAtPosition(scanner.getStartPos(), 0, diagnosticMessage, arg0); - } - else { - parseErrorAtCurrentToken(diagnosticMessage, arg0); - } - var result = createNode(kind, scanner.getStartPos()); - result.text = ""; - return finishNode(result); - } - function internIdentifier(text) { - text = ts.escapeIdentifier(text); - return ts.hasProperty(identifiers, text) ? identifiers[text] : (identifiers[text] = text); - } - // An identifier that starts with two underscores has an extra underscore character prepended to it to avoid issues - // with magic property names like '__proto__'. The 'identifiers' object is used to share a single string instance for - // each identifier in order to reduce memory consumption. - function createIdentifier(isIdentifier, diagnosticMessage) { - identifierCount++; - if (isIdentifier) { - var node = createNode(65 /* Identifier */); - // Store original token kind if it is not just an Identifier so we can report appropriate error later in type checker - if (token !== 65 /* Identifier */) { - node.originalKeywordKind = token; - } - node.text = internIdentifier(scanner.getTokenValue()); - nextToken(); - return finishNode(node); - } - return createMissingNode(65 /* Identifier */, false, diagnosticMessage || ts.Diagnostics.Identifier_expected); - } - function parseIdentifier(diagnosticMessage) { - return createIdentifier(isIdentifier(), diagnosticMessage); - } - function parseIdentifierName() { - return createIdentifier(isIdentifierOrKeyword()); - } - function isLiteralPropertyName() { - return isIdentifierOrKeyword() || - token === 8 /* StringLiteral */ || - token === 7 /* NumericLiteral */; - } - function parsePropertyNameWorker(allowComputedPropertyNames) { - if (token === 8 /* StringLiteral */ || token === 7 /* NumericLiteral */) { - return parseLiteralNode(true); - } - if (allowComputedPropertyNames && token === 18 /* OpenBracketToken */) { - return parseComputedPropertyName(); - } - return parseIdentifierName(); - } - function parsePropertyName() { - return parsePropertyNameWorker(true); - } - function parseSimplePropertyName() { - return parsePropertyNameWorker(false); - } - function isSimplePropertyName() { - return token === 8 /* StringLiteral */ || token === 7 /* NumericLiteral */ || isIdentifierOrKeyword(); - } - function parseComputedPropertyName() { - // PropertyName[Yield,GeneratorParameter] : - // LiteralPropertyName - // [+GeneratorParameter] ComputedPropertyName - // [~GeneratorParameter] ComputedPropertyName[?Yield] - // - // ComputedPropertyName[Yield] : - // [ AssignmentExpression[In, ?Yield] ] - // - var node = createNode(129 /* ComputedPropertyName */); - parseExpected(18 /* OpenBracketToken */); - // We parse any expression (including a comma expression). But the grammar - // says that only an assignment expression is allowed, so the grammar checker - // will error if it sees a comma expression. - var yieldContext = inYieldContext(); - if (inGeneratorParameterContext()) { - setYieldContext(false); - } - node.expression = allowInAnd(parseExpression); - if (inGeneratorParameterContext()) { - setYieldContext(yieldContext); - } - parseExpected(19 /* CloseBracketToken */); - return finishNode(node); - } - function parseContextualModifier(t) { - return token === t && tryParse(nextTokenCanFollowModifier); - } - function nextTokenCanFollowModifier() { - if (token === 70 /* ConstKeyword */) { - // 'const' is only a modifier if followed by 'enum'. - return nextToken() === 77 /* EnumKeyword */; - } - if (token === 78 /* ExportKeyword */) { - nextToken(); - if (token === 73 /* DefaultKeyword */) { - return lookAhead(nextTokenIsClassOrFunction); - } - return token !== 35 /* AsteriskToken */ && token !== 14 /* OpenBraceToken */ && canFollowModifier(); - } - if (token === 73 /* DefaultKeyword */) { - return nextTokenIsClassOrFunction(); - } - nextToken(); - return canFollowModifier(); - } - function parseAnyContextualModifier() { - return ts.isModifier(token) && tryParse(nextTokenCanFollowModifier); - } - function canFollowModifier() { - return token === 18 /* OpenBracketToken */ - || token === 14 /* OpenBraceToken */ - || token === 35 /* AsteriskToken */ - || isLiteralPropertyName(); - } - function nextTokenIsClassOrFunction() { - nextToken(); - return token === 69 /* ClassKeyword */ || token === 83 /* FunctionKeyword */; - } - // True if positioned at the start of a list element - function isListElement(parsingContext, inErrorRecovery) { - var node = currentNode(parsingContext); - if (node) { - return true; - } - switch (parsingContext) { - case 0 /* SourceElements */: - case 1 /* BlockStatements */: - case 3 /* SwitchClauseStatements */: - // If we're in error recovery, then we don't want to treat ';' as an empty statement. - // The problem is that ';' can show up in far too many contexts, and if we see one - // and assume it's a statement, then we may bail out inappropriately from whatever - // we're parsing. For example, if we have a semicolon in the middle of a class, then - // we really don't want to assume the class is over and we're on a statement in the - // outer module. We just want to consume and move on. - return !(token === 22 /* SemicolonToken */ && inErrorRecovery) && isStartOfStatement(); - case 2 /* SwitchClauses */: - return token === 67 /* CaseKeyword */ || token === 73 /* DefaultKeyword */; - case 4 /* TypeMembers */: - return isStartOfTypeMember(); - case 5 /* ClassMembers */: - // We allow semicolons as class elements (as specified by ES6) as long as we're - // not in error recovery. If we're in error recovery, we don't want an errant - // semicolon to be treated as a class member (since they're almost always used - // for statements. - return lookAhead(isClassMemberStart) || (token === 22 /* SemicolonToken */ && !inErrorRecovery); - case 6 /* EnumMembers */: - // Include open bracket computed properties. This technically also lets in indexers, - // which would be a candidate for improved error reporting. - return token === 18 /* OpenBracketToken */ || isLiteralPropertyName(); - case 12 /* ObjectLiteralMembers */: - return token === 18 /* OpenBracketToken */ || token === 35 /* AsteriskToken */ || isLiteralPropertyName(); - case 9 /* ObjectBindingElements */: - return isLiteralPropertyName(); - case 7 /* HeritageClauseElement */: - // If we see { } then only consume it as an expression if it is followed by , or { - // That way we won't consume the body of a class in its heritage clause. - if (token === 14 /* OpenBraceToken */) { - return lookAhead(isValidHeritageClauseObjectLiteral); - } - if (!inErrorRecovery) { - return isStartOfLeftHandSideExpression() && !isHeritageClauseExtendsOrImplementsKeyword(); - } - else { - // If we're in error recovery we tighten up what we're willing to match. - // That way we don't treat something like "this" as a valid heritage clause - // element during recovery. - return isIdentifier() && !isHeritageClauseExtendsOrImplementsKeyword(); - } - case 8 /* VariableDeclarations */: - return isIdentifierOrPattern(); - case 10 /* ArrayBindingElements */: - return token === 23 /* CommaToken */ || token === 21 /* DotDotDotToken */ || isIdentifierOrPattern(); - case 15 /* TypeParameters */: - return isIdentifier(); - case 11 /* ArgumentExpressions */: - case 13 /* ArrayLiteralMembers */: - return token === 23 /* CommaToken */ || token === 21 /* DotDotDotToken */ || isStartOfExpression(); - case 14 /* Parameters */: - return isStartOfParameter(); - case 16 /* TypeArguments */: - case 17 /* TupleElementTypes */: - return token === 23 /* CommaToken */ || isStartOfType(); - case 18 /* HeritageClauses */: - return isHeritageClause(); - case 19 /* ImportOrExportSpecifiers */: - return isIdentifierOrKeyword(); - case 20 /* JSDocFunctionParameters */: - case 21 /* JSDocTypeArguments */: - case 23 /* JSDocTupleTypes */: - return JSDocParser.isJSDocType(); - case 22 /* JSDocRecordMembers */: - return isSimplePropertyName(); - } - ts.Debug.fail("Non-exhaustive case in 'isListElement'."); - } - function isValidHeritageClauseObjectLiteral() { - ts.Debug.assert(token === 14 /* OpenBraceToken */); - if (nextToken() === 15 /* CloseBraceToken */) { - // if we see "extends {}" then only treat the {} as what we're extending (and not - // the class body) if we have: - // - // extends {} { - // extends {}, - // extends {} extends - // extends {} implements - var next = nextToken(); - return next === 23 /* CommaToken */ || next === 14 /* OpenBraceToken */ || next === 79 /* ExtendsKeyword */ || next === 102 /* ImplementsKeyword */; - } - return true; - } - function nextTokenIsIdentifier() { - nextToken(); - return isIdentifier(); - } - function isHeritageClauseExtendsOrImplementsKeyword() { - if (token === 102 /* ImplementsKeyword */ || - token === 79 /* ExtendsKeyword */) { - return lookAhead(nextTokenIsStartOfExpression); - } - return false; - } - function nextTokenIsStartOfExpression() { - nextToken(); - return isStartOfExpression(); - } - // True if positioned at a list terminator - function isListTerminator(kind) { - if (token === 1 /* EndOfFileToken */) { - // Being at the end of the file ends all lists. - return true; - } - switch (kind) { - case 1 /* BlockStatements */: - case 2 /* SwitchClauses */: - case 4 /* TypeMembers */: - case 5 /* ClassMembers */: - case 6 /* EnumMembers */: - case 12 /* ObjectLiteralMembers */: - case 9 /* ObjectBindingElements */: - case 19 /* ImportOrExportSpecifiers */: - return token === 15 /* CloseBraceToken */; - case 3 /* SwitchClauseStatements */: - return token === 15 /* CloseBraceToken */ || token === 67 /* CaseKeyword */ || token === 73 /* DefaultKeyword */; - case 7 /* HeritageClauseElement */: - return token === 14 /* OpenBraceToken */ || token === 79 /* ExtendsKeyword */ || token === 102 /* ImplementsKeyword */; - case 8 /* VariableDeclarations */: - return isVariableDeclaratorListTerminator(); - case 15 /* TypeParameters */: - // Tokens other than '>' are here for better error recovery - return token === 25 /* GreaterThanToken */ || token === 16 /* OpenParenToken */ || token === 14 /* OpenBraceToken */ || token === 79 /* ExtendsKeyword */ || token === 102 /* ImplementsKeyword */; - case 11 /* ArgumentExpressions */: - // Tokens other than ')' are here for better error recovery - return token === 17 /* CloseParenToken */ || token === 22 /* SemicolonToken */; - case 13 /* ArrayLiteralMembers */: - case 17 /* TupleElementTypes */: - case 10 /* ArrayBindingElements */: - return token === 19 /* CloseBracketToken */; - case 14 /* Parameters */: - // Tokens other than ')' and ']' (the latter for index signatures) are here for better error recovery - return token === 17 /* CloseParenToken */ || token === 19 /* CloseBracketToken */ /*|| token === SyntaxKind.OpenBraceToken*/; - case 16 /* TypeArguments */: - // Tokens other than '>' are here for better error recovery - return token === 25 /* GreaterThanToken */ || token === 16 /* OpenParenToken */; - case 18 /* HeritageClauses */: - return token === 14 /* OpenBraceToken */ || token === 15 /* CloseBraceToken */; - case 20 /* JSDocFunctionParameters */: - return token === 17 /* CloseParenToken */ || token === 51 /* ColonToken */ || token === 15 /* CloseBraceToken */; - case 21 /* JSDocTypeArguments */: - return token === 25 /* GreaterThanToken */ || token === 15 /* CloseBraceToken */; - case 23 /* JSDocTupleTypes */: - return token === 19 /* CloseBracketToken */ || token === 15 /* CloseBraceToken */; - case 22 /* JSDocRecordMembers */: - return token === 15 /* CloseBraceToken */; - } - } - function isVariableDeclaratorListTerminator() { - // If we can consume a semicolon (either explicitly, or with ASI), then consider us done - // with parsing the list of variable declarators. - if (canParseSemicolon()) { - return true; - } - // in the case where we're parsing the variable declarator of a 'for-in' statement, we - // are done if we see an 'in' keyword in front of us. Same with for-of - if (isInOrOfKeyword(token)) { - return true; - } - // ERROR RECOVERY TWEAK: - // For better error recovery, if we see an '=>' then we just stop immediately. We've got an - // arrow function here and it's going to be very unlikely that we'll resynchronize and get - // another variable declaration. - if (token === 32 /* EqualsGreaterThanToken */) { - return true; - } - // Keep trying to parse out variable declarators. - return false; - } - // True if positioned at element or terminator of the current list or any enclosing list - function isInSomeParsingContext() { - for (var kind = 0; kind < 24 /* Count */; kind++) { - if (parsingContext & (1 << kind)) { - if (isListElement(kind, true) || isListTerminator(kind)) { - return true; - } - } - } - return false; - } - // Parses a list of elements - function parseList(kind, checkForStrictMode, parseElement) { - var saveParsingContext = parsingContext; - parsingContext |= 1 << kind; - var result = []; - result.pos = getNodePos(); - var savedStrictModeContext = inStrictModeContext(); - while (!isListTerminator(kind)) { - if (isListElement(kind, false)) { - var element = parseListElement(kind, parseElement); - result.push(element); - // test elements only if we are not already in strict mode - if (checkForStrictMode && !inStrictModeContext()) { - if (ts.isPrologueDirective(element)) { - if (isUseStrictPrologueDirective(element)) { - setStrictModeContext(true); - checkForStrictMode = false; - } - } - else { - checkForStrictMode = false; - } - } - continue; - } - if (abortParsingListOrMoveToNextToken(kind)) { - break; - } - } - setStrictModeContext(savedStrictModeContext); - result.end = getNodeEnd(); - parsingContext = saveParsingContext; - return result; - } - /// Should be called only on prologue directives (isPrologueDirective(node) should be true) - function isUseStrictPrologueDirective(node) { - ts.Debug.assert(ts.isPrologueDirective(node)); - var nodeText = ts.getTextOfNodeFromSourceText(sourceText, node.expression); - // Note: the node text must be exactly "use strict" or 'use strict'. It is not ok for the - // string to contain unicode escapes (as per ES5). - return nodeText === '"use strict"' || nodeText === "'use strict'"; - } - function parseListElement(parsingContext, parseElement) { - var node = currentNode(parsingContext); - if (node) { - return consumeNode(node); - } - return parseElement(); - } - function currentNode(parsingContext) { - // If there is an outstanding parse error that we've encountered, but not attached to - // some node, then we cannot get a node from the old source tree. This is because we - // want to mark the next node we encounter as being unusable. - // - // Note: This may be too conservative. Perhaps we could reuse the node and set the bit - // on it (or its leftmost child) as having the error. For now though, being conservative - // is nice and likely won't ever affect perf. - if (parseErrorBeforeNextFinishedNode) { - return undefined; - } - if (!syntaxCursor) { - // if we don't have a cursor, we could never return a node from the old tree. - return undefined; - } - var node = syntaxCursor.currentNode(scanner.getStartPos()); - // Can't reuse a missing node. - if (ts.nodeIsMissing(node)) { - return undefined; - } - // Can't reuse a node that intersected the change range. - if (node.intersectsChange) { - return undefined; - } - // Can't reuse a node that contains a parse error. This is necessary so that we - // produce the same set of errors again. - if (ts.containsParseError(node)) { - return undefined; - } - // We can only reuse a node if it was parsed under the same strict mode that we're - // currently in. i.e. if we originally parsed a node in non-strict mode, but then - // the user added 'using strict' at the top of the file, then we can't use that node - // again as the presense of strict mode may cause us to parse the tokens in the file - // differetly. - // - // Note: we *can* reuse tokens when the strict mode changes. That's because tokens - // are unaffected by strict mode. It's just the parser will decide what to do with it - // differently depending on what mode it is in. - // - // This also applies to all our other context flags as well. - var nodeContextFlags = node.parserContextFlags & 63 /* ParserGeneratedFlags */; - if (nodeContextFlags !== contextFlags) { - return undefined; - } - // Ok, we have a node that looks like it could be reused. Now verify that it is valid - // in the currest list parsing context that we're currently at. - if (!canReuseNode(node, parsingContext)) { - return undefined; - } - return node; - } - function consumeNode(node) { - // Move the scanner so it is after the node we just consumed. - scanner.setTextPos(node.end); - nextToken(); - return node; - } - function canReuseNode(node, parsingContext) { - switch (parsingContext) { - case 5 /* ClassMembers */: - return isReusableClassMember(node); - case 2 /* SwitchClauses */: - return isReusableSwitchClause(node); - case 0 /* SourceElements */: - case 1 /* BlockStatements */: - case 3 /* SwitchClauseStatements */: - return isReusableStatement(node); - case 6 /* EnumMembers */: - return isReusableEnumMember(node); - case 4 /* TypeMembers */: - return isReusableTypeMember(node); - case 8 /* VariableDeclarations */: - return isReusableVariableDeclaration(node); - case 14 /* Parameters */: - return isReusableParameter(node); - // Any other lists we do not care about reusing nodes in. But feel free to add if - // you can do so safely. Danger areas involve nodes that may involve speculative - // parsing. If speculative parsing is involved with the node, then the range the - // parser reached while looking ahead might be in the edited range (see the example - // in canReuseVariableDeclaratorNode for a good case of this). - case 18 /* HeritageClauses */: - // This would probably be safe to reuse. There is no speculative parsing with - // heritage clauses. - case 15 /* TypeParameters */: - // This would probably be safe to reuse. There is no speculative parsing with - // type parameters. Note that that's because type *parameters* only occur in - // unambiguous *type* contexts. While type *arguments* occur in very ambiguous - // *expression* contexts. - case 17 /* TupleElementTypes */: - // This would probably be safe to reuse. There is no speculative parsing with - // tuple types. - // Technically, type argument list types are probably safe to reuse. While - // speculative parsing is involved with them (since type argument lists are only - // produced from speculative parsing a < as a type argument list), we only have - // the types because speculative parsing succeeded. Thus, the lookahead never - // went past the end of the list and rewound. - case 16 /* TypeArguments */: - // Note: these are almost certainly not safe to ever reuse. Expressions commonly - // need a large amount of lookahead, and we should not reuse them as they may - // have actually intersected the edit. - case 11 /* ArgumentExpressions */: - // This is not safe to reuse for the same reason as the 'AssignmentExpression' - // cases. i.e. a property assignment may end with an expression, and thus might - // have lookahead far beyond it's old node. - case 12 /* ObjectLiteralMembers */: - // This is probably not safe to reuse. There can be speculative parsing with - // type names in a heritage clause. There can be generic names in the type - // name list, and there can be left hand side expressions (which can have type - // arguments.) - case 7 /* HeritageClauseElement */: - } - return false; - } - function isReusableClassMember(node) { - if (node) { - switch (node.kind) { - case 137 /* Constructor */: - case 142 /* IndexSignature */: - case 136 /* MethodDeclaration */: - case 138 /* GetAccessor */: - case 139 /* SetAccessor */: - case 134 /* PropertyDeclaration */: - case 181 /* SemicolonClassElement */: - return true; - } - } - return false; - } - function isReusableSwitchClause(node) { - if (node) { - switch (node.kind) { - case 223 /* CaseClause */: - case 224 /* DefaultClause */: - return true; - } - } - return false; - } - function isReusableStatement(node) { - if (node) { - switch (node.kind) { - case 203 /* FunctionDeclaration */: - case 183 /* VariableStatement */: - case 182 /* Block */: - case 186 /* IfStatement */: - case 185 /* ExpressionStatement */: - case 198 /* ThrowStatement */: - case 194 /* ReturnStatement */: - case 196 /* SwitchStatement */: - case 193 /* BreakStatement */: - case 192 /* ContinueStatement */: - case 190 /* ForInStatement */: - case 191 /* ForOfStatement */: - case 189 /* ForStatement */: - case 188 /* WhileStatement */: - case 195 /* WithStatement */: - case 184 /* EmptyStatement */: - case 199 /* TryStatement */: - case 197 /* LabeledStatement */: - case 187 /* DoStatement */: - case 200 /* DebuggerStatement */: - case 212 /* ImportDeclaration */: - case 211 /* ImportEqualsDeclaration */: - case 218 /* ExportDeclaration */: - case 217 /* ExportAssignment */: - case 208 /* ModuleDeclaration */: - case 204 /* ClassDeclaration */: - case 205 /* InterfaceDeclaration */: - case 207 /* EnumDeclaration */: - case 206 /* TypeAliasDeclaration */: - return true; - } - } - return false; - } - function isReusableEnumMember(node) { - return node.kind === 229 /* EnumMember */; - } - function isReusableTypeMember(node) { - if (node) { - switch (node.kind) { - case 141 /* ConstructSignature */: - case 135 /* MethodSignature */: - case 142 /* IndexSignature */: - case 133 /* PropertySignature */: - case 140 /* CallSignature */: - return true; - } - } - return false; - } - function isReusableVariableDeclaration(node) { - if (node.kind !== 201 /* VariableDeclaration */) { - return false; - } - // Very subtle incremental parsing bug. Consider the following code: - // - // let v = new List < A, B - // - // This is actually legal code. It's a list of variable declarators "v = new List() - // - // then we have a problem. "v = new List= 0) { - // Always preserve a trailing comma by marking it on the NodeArray - result.hasTrailingComma = true; - } - result.end = getNodeEnd(); - parsingContext = saveParsingContext; - return result; - } - function createMissingList() { - var pos = getNodePos(); - var result = []; - result.pos = pos; - result.end = pos; - return result; - } - function parseBracketedList(kind, parseElement, open, close) { - if (parseExpected(open)) { - var result = parseDelimitedList(kind, parseElement); - parseExpected(close); - return result; - } - return createMissingList(); - } - // The allowReservedWords parameter controls whether reserved words are permitted after the first dot - function parseEntityName(allowReservedWords, diagnosticMessage) { - var entity = parseIdentifier(diagnosticMessage); - while (parseOptional(20 /* DotToken */)) { - var node = createNode(128 /* QualifiedName */, entity.pos); - node.left = entity; - node.right = parseRightSideOfDot(allowReservedWords); - entity = finishNode(node); - } - return entity; - } - function parseRightSideOfDot(allowIdentifierNames) { - // Technically a keyword is valid here as all identifiers and keywords are identifier names. - // However, often we'll encounter this in error situations when the identifier or keyword - // is actually starting another valid construct. - // - // So, we check for the following specific case: - // - // name. - // identifierOrKeyword identifierNameOrKeyword - // - // Note: the newlines are important here. For example, if that above code - // were rewritten into: - // - // name.identifierOrKeyword - // identifierNameOrKeyword - // - // Then we would consider it valid. That's because ASI would take effect and - // the code would be implicitly: "name.identifierOrKeyword; identifierNameOrKeyword". - // In the first case though, ASI will not take effect because there is not a - // line terminator after the identifier or keyword. - if (scanner.hasPrecedingLineBreak() && isIdentifierOrKeyword()) { - var matchesPattern = lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine); - if (matchesPattern) { - // Report that we need an identifier. However, report it right after the dot, - // and not on the next token. This is because the next token might actually - // be an identifier and the error would be quite confusing. - return createMissingNode(65 /* Identifier */, true, ts.Diagnostics.Identifier_expected); - } - } - return allowIdentifierNames ? parseIdentifierName() : parseIdentifier(); - } - function parseTemplateExpression() { - var template = createNode(174 /* TemplateExpression */); - template.head = parseLiteralNode(); - ts.Debug.assert(template.head.kind === 11 /* TemplateHead */, "Template head has wrong token kind"); - var templateSpans = []; - templateSpans.pos = getNodePos(); - do { - templateSpans.push(parseTemplateSpan()); - } while (ts.lastOrUndefined(templateSpans).literal.kind === 12 /* TemplateMiddle */); - templateSpans.end = getNodeEnd(); - template.templateSpans = templateSpans; - return finishNode(template); - } - function parseTemplateSpan() { - var span = createNode(180 /* TemplateSpan */); - span.expression = allowInAnd(parseExpression); - var literal; - if (token === 15 /* CloseBraceToken */) { - reScanTemplateToken(); - literal = parseLiteralNode(); - } - else { - literal = parseExpectedToken(13 /* TemplateTail */, false, ts.Diagnostics._0_expected, ts.tokenToString(15 /* CloseBraceToken */)); - } - span.literal = literal; - return finishNode(span); - } - function parseLiteralNode(internName) { - var node = createNode(token); - var text = scanner.getTokenValue(); - node.text = internName ? internIdentifier(text) : text; - if (scanner.hasExtendedUnicodeEscape()) { - node.hasExtendedUnicodeEscape = true; - } - if (scanner.isUnterminated()) { - node.isUnterminated = true; - } - var tokenPos = scanner.getTokenPos(); - nextToken(); - finishNode(node); - // Octal literals are not allowed in strict mode or ES5 - // Note that theoretically the following condition would hold true literals like 009, - // which is not octal.But because of how the scanner separates the tokens, we would - // never get a token like this. Instead, we would get 00 and 9 as two separate tokens. - // We also do not need to check for negatives because any prefix operator would be part of a - // parent unary expression. - if (node.kind === 7 /* NumericLiteral */ - && sourceText.charCodeAt(tokenPos) === 48 /* _0 */ - && ts.isOctalDigit(sourceText.charCodeAt(tokenPos + 1))) { - node.flags |= 16384 /* OctalLiteral */; - } - return node; - } - // TYPES - function parseTypeReferenceOrTypePredicate() { - var typeName = parseEntityName(false, ts.Diagnostics.Type_expected); - if (typeName.kind === 65 /* Identifier */ && token === 117 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { - nextToken(); - var node_1 = createNode(143 /* TypePredicate */, typeName.pos); - node_1.parameterName = typeName; - node_1.type = parseType(); - return finishNode(node_1); - } - var node = createNode(144 /* TypeReference */, typeName.pos); - node.typeName = typeName; - if (!scanner.hasPrecedingLineBreak() && token === 24 /* LessThanToken */) { - node.typeArguments = parseBracketedList(16 /* TypeArguments */, parseType, 24 /* LessThanToken */, 25 /* GreaterThanToken */); - } - return finishNode(node); - } - function parseTypeQuery() { - var node = createNode(147 /* TypeQuery */); - parseExpected(97 /* TypeOfKeyword */); - node.exprName = parseEntityName(true); - return finishNode(node); - } - function parseTypeParameter() { - var node = createNode(130 /* TypeParameter */); - node.name = parseIdentifier(); - if (parseOptional(79 /* ExtendsKeyword */)) { - // It's not uncommon for people to write improper constraints to a generic. If the - // user writes a constraint that is an expression and not an actual type, then parse - // it out as an expression (so we can recover well), but report that a type is needed - // instead. - if (isStartOfType() || !isStartOfExpression()) { - node.constraint = parseType(); - } - else { - // It was not a type, and it looked like an expression. Parse out an expression - // here so we recover well. Note: it is important that we call parseUnaryExpression - // and not parseExpression here. If the user has: - // - // - // - // We do *not* want to consume the > as we're consuming the expression for "". - node.expression = parseUnaryExpressionOrHigher(); - } - } - return finishNode(node); - } - function parseTypeParameters() { - if (token === 24 /* LessThanToken */) { - return parseBracketedList(15 /* TypeParameters */, parseTypeParameter, 24 /* LessThanToken */, 25 /* GreaterThanToken */); - } - } - function parseParameterType() { - if (parseOptional(51 /* ColonToken */)) { - return token === 8 /* StringLiteral */ - ? parseLiteralNode(true) - : parseType(); - } - return undefined; - } - function isStartOfParameter() { - return token === 21 /* DotDotDotToken */ || isIdentifierOrPattern() || ts.isModifier(token) || token === 52 /* AtToken */; - } - function setModifiers(node, modifiers) { - if (modifiers) { - node.flags |= modifiers.flags; - node.modifiers = modifiers; - } - } - function parseParameter() { - var node = createNode(131 /* Parameter */); - node.decorators = parseDecorators(); - setModifiers(node, parseModifiers()); - node.dotDotDotToken = parseOptionalToken(21 /* DotDotDotToken */); - // SingleNameBinding[Yield,GeneratorParameter] : See 13.2.3 - // [+GeneratorParameter]BindingIdentifier[Yield]Initializer[In]opt - // [~GeneratorParameter]BindingIdentifier[?Yield]Initializer[In, ?Yield]opt - node.name = inGeneratorParameterContext() ? doInYieldContext(parseIdentifierOrPattern) : parseIdentifierOrPattern(); - if (ts.getFullWidth(node.name) === 0 && node.flags === 0 && ts.isModifier(token)) { - // in cases like - // 'use strict' - // function foo(static) - // isParameter('static') === true, because of isModifier('static') - // however 'static' is not a legal identifier in a strict mode. - // so result of this function will be ParameterDeclaration (flags = 0, name = missing, type = undefined, initializer = undefined) - // and current token will not change => parsing of the enclosing parameter list will last till the end of time (or OOM) - // to avoid this we'll advance cursor to the next token. - nextToken(); - } - node.questionToken = parseOptionalToken(50 /* QuestionToken */); - node.type = parseParameterType(); - node.initializer = inGeneratorParameterContext() ? doOutsideOfYieldContext(parseParameterInitializer) : parseParameterInitializer(); - // Do not check for initializers in an ambient context for parameters. This is not - // a grammar error because the grammar allows arbitrary call signatures in - // an ambient context. - // It is actually not necessary for this to be an error at all. The reason is that - // function/constructor implementations are syntactically disallowed in ambient - // contexts. In addition, parameter initializers are semantically disallowed in - // overload signatures. So parameter initializers are transitively disallowed in - // ambient contexts. - return finishNode(node); - } - function parseParameterInitializer() { - return parseInitializer(true); - } - function fillSignature(returnToken, yieldAndGeneratorParameterContext, requireCompleteParameterList, signature) { - var returnTokenRequired = returnToken === 32 /* EqualsGreaterThanToken */; - signature.typeParameters = parseTypeParameters(); - signature.parameters = parseParameterList(yieldAndGeneratorParameterContext, requireCompleteParameterList); - if (returnTokenRequired) { - parseExpected(returnToken); - signature.type = parseType(); - } - else if (parseOptional(returnToken)) { - signature.type = parseType(); - } - } - // Note: after careful analysis of the grammar, it does not appear to be possible to - // have 'Yield' And 'GeneratorParameter' not in sync. i.e. any production calling - // this FormalParameters production either always sets both to true, or always sets - // both to false. As such we only have a single parameter to represent both. - function parseParameterList(yieldAndGeneratorParameterContext, requireCompleteParameterList) { - // FormalParameters[Yield,GeneratorParameter] : - // ... - // - // FormalParameter[Yield,GeneratorParameter] : - // BindingElement[?Yield, ?GeneratorParameter] - // - // BindingElement[Yield, GeneratorParameter ] : See 13.2.3 - // SingleNameBinding[?Yield, ?GeneratorParameter] - // [+GeneratorParameter]BindingPattern[?Yield, GeneratorParameter]Initializer[In]opt - // [~GeneratorParameter]BindingPattern[?Yield]Initializer[In, ?Yield]opt - // - // SingleNameBinding[Yield, GeneratorParameter] : See 13.2.3 - // [+GeneratorParameter]BindingIdentifier[Yield]Initializer[In]opt - // [~GeneratorParameter]BindingIdentifier[?Yield]Initializer[In, ?Yield]opt - if (parseExpected(16 /* OpenParenToken */)) { - var savedYieldContext = inYieldContext(); - var savedGeneratorParameterContext = inGeneratorParameterContext(); - setYieldContext(yieldAndGeneratorParameterContext); - setGeneratorParameterContext(yieldAndGeneratorParameterContext); - var result = parseDelimitedList(14 /* Parameters */, parseParameter); - setYieldContext(savedYieldContext); - setGeneratorParameterContext(savedGeneratorParameterContext); - if (!parseExpected(17 /* CloseParenToken */) && requireCompleteParameterList) { - // Caller insisted that we had to end with a ) We didn't. So just return - // undefined here. - return undefined; - } - return result; - } - // We didn't even have an open paren. If the caller requires a complete parameter list, - // we definitely can't provide that. However, if they're ok with an incomplete one, - // then just return an empty set of parameters. - return requireCompleteParameterList ? undefined : createMissingList(); - } - function parseTypeMemberSemicolon() { - // We allow type members to be separated by commas or (possibly ASI) semicolons. - // First check if it was a comma. If so, we're done with the member. - if (parseOptional(23 /* CommaToken */)) { - return; - } - // Didn't have a comma. We must have a (possible ASI) semicolon. - parseSemicolon(); - } - function parseSignatureMember(kind) { - var node = createNode(kind); - if (kind === 141 /* ConstructSignature */) { - parseExpected(88 /* NewKeyword */); - } - fillSignature(51 /* ColonToken */, false, false, node); - parseTypeMemberSemicolon(); - return finishNode(node); - } - function isIndexSignature() { - if (token !== 18 /* OpenBracketToken */) { - return false; - } - return lookAhead(isUnambiguouslyIndexSignature); - } - function isUnambiguouslyIndexSignature() { - // The only allowed sequence is: - // - // [id: - // - // However, for error recovery, we also check the following cases: - // - // [... - // [id, - // [id?, - // [id?: - // [id?] - // [public id - // [private id - // [protected id - // [] - // - nextToken(); - if (token === 21 /* DotDotDotToken */ || token === 19 /* CloseBracketToken */) { - return true; - } - if (ts.isModifier(token)) { - nextToken(); - if (isIdentifier()) { - return true; - } - } - else if (!isIdentifier()) { - return false; - } - else { - // Skip the identifier - nextToken(); - } - // A colon signifies a well formed indexer - // A comma should be a badly formed indexer because comma expressions are not allowed - // in computed properties. - if (token === 51 /* ColonToken */ || token === 23 /* CommaToken */) { - return true; - } - // Question mark could be an indexer with an optional property, - // or it could be a conditional expression in a computed property. - if (token !== 50 /* QuestionToken */) { - return false; - } - // If any of the following tokens are after the question mark, it cannot - // be a conditional expression, so treat it as an indexer. - nextToken(); - return token === 51 /* ColonToken */ || token === 23 /* CommaToken */ || token === 19 /* CloseBracketToken */; - } - function parseIndexSignatureDeclaration(fullStart, decorators, modifiers) { - var node = createNode(142 /* IndexSignature */, fullStart); - node.decorators = decorators; - setModifiers(node, modifiers); - node.parameters = parseBracketedList(14 /* Parameters */, parseParameter, 18 /* OpenBracketToken */, 19 /* CloseBracketToken */); - node.type = parseTypeAnnotation(); - parseTypeMemberSemicolon(); - return finishNode(node); - } - function parsePropertyOrMethodSignature() { - var fullStart = scanner.getStartPos(); - var name = parsePropertyName(); - var questionToken = parseOptionalToken(50 /* QuestionToken */); - if (token === 16 /* OpenParenToken */ || token === 24 /* LessThanToken */) { - var method = createNode(135 /* MethodSignature */, fullStart); - method.name = name; - method.questionToken = questionToken; - // Method signatues don't exist in expression contexts. So they have neither - // [Yield] nor [GeneratorParameter] - fillSignature(51 /* ColonToken */, false, false, method); - parseTypeMemberSemicolon(); - return finishNode(method); - } - else { - var property = createNode(133 /* PropertySignature */, fullStart); - property.name = name; - property.questionToken = questionToken; - property.type = parseTypeAnnotation(); - parseTypeMemberSemicolon(); - return finishNode(property); - } - } - function isStartOfTypeMember() { - switch (token) { - case 16 /* OpenParenToken */: - case 24 /* LessThanToken */: - case 18 /* OpenBracketToken */: - return true; - default: - if (ts.isModifier(token)) { - var result = lookAhead(isStartOfIndexSignatureDeclaration); - if (result) { - return result; - } - } - return isLiteralPropertyName() && lookAhead(isTypeMemberWithLiteralPropertyName); - } - } - function isStartOfIndexSignatureDeclaration() { - while (ts.isModifier(token)) { - nextToken(); - } - return isIndexSignature(); - } - function isTypeMemberWithLiteralPropertyName() { - nextToken(); - return token === 16 /* OpenParenToken */ || - token === 24 /* LessThanToken */ || - token === 50 /* QuestionToken */ || - token === 51 /* ColonToken */ || - canParseSemicolon(); - } - function parseTypeMember() { - switch (token) { - case 16 /* OpenParenToken */: - case 24 /* LessThanToken */: - return parseSignatureMember(140 /* CallSignature */); - case 18 /* OpenBracketToken */: - // Indexer or computed property - return isIndexSignature() - ? parseIndexSignatureDeclaration(scanner.getStartPos(), undefined, undefined) - : parsePropertyOrMethodSignature(); - case 88 /* NewKeyword */: - if (lookAhead(isStartOfConstructSignature)) { - return parseSignatureMember(141 /* ConstructSignature */); - } - // fall through. - case 8 /* StringLiteral */: - case 7 /* NumericLiteral */: - return parsePropertyOrMethodSignature(); - default: - // Index declaration as allowed as a type member. But as per the grammar, - // they also allow modifiers. So we have to check for an index declaration - // that might be following modifiers. This ensures that things work properly - // when incrementally parsing as the parser will produce the Index declaration - // if it has the same text regardless of whether it is inside a class or an - // object type. - if (ts.isModifier(token)) { - var result = tryParse(parseIndexSignatureWithModifiers); - if (result) { - return result; - } - } - if (isIdentifierOrKeyword()) { - return parsePropertyOrMethodSignature(); - } - } - } - function parseIndexSignatureWithModifiers() { - var fullStart = scanner.getStartPos(); - var decorators = parseDecorators(); - var modifiers = parseModifiers(); - return isIndexSignature() - ? parseIndexSignatureDeclaration(fullStart, decorators, modifiers) - : undefined; - } - function isStartOfConstructSignature() { - nextToken(); - return token === 16 /* OpenParenToken */ || token === 24 /* LessThanToken */; - } - function parseTypeLiteral() { - var node = createNode(148 /* TypeLiteral */); - node.members = parseObjectTypeMembers(); - return finishNode(node); - } - function parseObjectTypeMembers() { - var members; - if (parseExpected(14 /* OpenBraceToken */)) { - members = parseList(4 /* TypeMembers */, false, parseTypeMember); - parseExpected(15 /* CloseBraceToken */); - } - else { - members = createMissingList(); - } - return members; - } - function parseTupleType() { - var node = createNode(150 /* TupleType */); - node.elementTypes = parseBracketedList(17 /* TupleElementTypes */, parseType, 18 /* OpenBracketToken */, 19 /* CloseBracketToken */); - return finishNode(node); - } - function parseParenthesizedType() { - var node = createNode(152 /* ParenthesizedType */); - parseExpected(16 /* OpenParenToken */); - node.type = parseType(); - parseExpected(17 /* CloseParenToken */); - return finishNode(node); - } - function parseFunctionOrConstructorType(kind) { - var node = createNode(kind); - if (kind === 146 /* ConstructorType */) { - parseExpected(88 /* NewKeyword */); - } - fillSignature(32 /* EqualsGreaterThanToken */, false, false, node); - return finishNode(node); - } - function parseKeywordAndNoDot() { - var node = parseTokenNode(); - return token === 20 /* DotToken */ ? undefined : node; - } - function parseNonArrayType() { - switch (token) { - case 112 /* AnyKeyword */: - case 123 /* StringKeyword */: - case 121 /* NumberKeyword */: - case 113 /* BooleanKeyword */: - case 124 /* SymbolKeyword */: - // If these are followed by a dot, then parse these out as a dotted type reference instead. - var node = tryParse(parseKeywordAndNoDot); - return node || parseTypeReferenceOrTypePredicate(); - case 99 /* VoidKeyword */: - return parseTokenNode(); - case 97 /* TypeOfKeyword */: - return parseTypeQuery(); - case 14 /* OpenBraceToken */: - return parseTypeLiteral(); - case 18 /* OpenBracketToken */: - return parseTupleType(); - case 16 /* OpenParenToken */: - return parseParenthesizedType(); - default: - return parseTypeReferenceOrTypePredicate(); - } - } - function isStartOfType() { - switch (token) { - case 112 /* AnyKeyword */: - case 123 /* StringKeyword */: - case 121 /* NumberKeyword */: - case 113 /* BooleanKeyword */: - case 124 /* SymbolKeyword */: - case 99 /* VoidKeyword */: - case 97 /* TypeOfKeyword */: - case 14 /* OpenBraceToken */: - case 18 /* OpenBracketToken */: - case 24 /* LessThanToken */: - case 88 /* NewKeyword */: - return true; - case 16 /* OpenParenToken */: - // Only consider '(' the start of a type if followed by ')', '...', an identifier, a modifier, - // or something that starts a type. We don't want to consider things like '(1)' a type. - return lookAhead(isStartOfParenthesizedOrFunctionType); - default: - return isIdentifier(); - } - } - function isStartOfParenthesizedOrFunctionType() { - nextToken(); - return token === 17 /* CloseParenToken */ || isStartOfParameter() || isStartOfType(); - } - function parseArrayTypeOrHigher() { - var type = parseNonArrayType(); - while (!scanner.hasPrecedingLineBreak() && parseOptional(18 /* OpenBracketToken */)) { - parseExpected(19 /* CloseBracketToken */); - var node = createNode(149 /* ArrayType */, type.pos); - node.elementType = type; - type = finishNode(node); - } - return type; - } - function parseUnionTypeOrHigher() { - var type = parseArrayTypeOrHigher(); - if (token === 44 /* BarToken */) { - var types = [type]; - types.pos = type.pos; - while (parseOptional(44 /* BarToken */)) { - types.push(parseArrayTypeOrHigher()); - } - types.end = getNodeEnd(); - var node = createNode(151 /* UnionType */, type.pos); - node.types = types; - type = finishNode(node); - } - return type; - } - function isStartOfFunctionType() { - if (token === 24 /* LessThanToken */) { - return true; - } - return token === 16 /* OpenParenToken */ && lookAhead(isUnambiguouslyStartOfFunctionType); - } - function isUnambiguouslyStartOfFunctionType() { - nextToken(); - if (token === 17 /* CloseParenToken */ || token === 21 /* DotDotDotToken */) { - // ( ) - // ( ... - return true; - } - if (isIdentifier() || ts.isModifier(token)) { - nextToken(); - if (token === 51 /* ColonToken */ || token === 23 /* CommaToken */ || - token === 50 /* QuestionToken */ || token === 53 /* EqualsToken */ || - isIdentifier() || ts.isModifier(token)) { - // ( id : - // ( id , - // ( id ? - // ( id = - // ( modifier id - return true; - } - if (token === 17 /* CloseParenToken */) { - nextToken(); - if (token === 32 /* EqualsGreaterThanToken */) { - // ( id ) => - return true; - } - } - } - return false; - } - function parseType() { - // The rules about 'yield' only apply to actual code/expression contexts. They don't - // apply to 'type' contexts. So we disable these parameters here before moving on. - var savedYieldContext = inYieldContext(); - var savedGeneratorParameterContext = inGeneratorParameterContext(); - setYieldContext(false); - setGeneratorParameterContext(false); - var result = parseTypeWorker(); - setYieldContext(savedYieldContext); - setGeneratorParameterContext(savedGeneratorParameterContext); - return result; - } - function parseTypeWorker() { - if (isStartOfFunctionType()) { - return parseFunctionOrConstructorType(145 /* FunctionType */); - } - if (token === 88 /* NewKeyword */) { - return parseFunctionOrConstructorType(146 /* ConstructorType */); - } - return parseUnionTypeOrHigher(); - } - function parseTypeAnnotation() { - return parseOptional(51 /* ColonToken */) ? parseType() : undefined; - } - // EXPRESSIONS - function isStartOfLeftHandSideExpression() { - switch (token) { - case 93 /* ThisKeyword */: - case 91 /* SuperKeyword */: - case 89 /* NullKeyword */: - case 95 /* TrueKeyword */: - case 80 /* FalseKeyword */: - case 7 /* NumericLiteral */: - case 8 /* StringLiteral */: - case 10 /* NoSubstitutionTemplateLiteral */: - case 11 /* TemplateHead */: - case 16 /* OpenParenToken */: - case 18 /* OpenBracketToken */: - case 14 /* OpenBraceToken */: - case 83 /* FunctionKeyword */: - case 69 /* ClassKeyword */: - case 88 /* NewKeyword */: - case 36 /* SlashToken */: - case 57 /* SlashEqualsToken */: - case 65 /* Identifier */: - return true; - default: - return isIdentifier(); - } - } - function isStartOfExpression() { - if (isStartOfLeftHandSideExpression()) { - return true; - } - switch (token) { - case 33 /* PlusToken */: - case 34 /* MinusToken */: - case 47 /* TildeToken */: - case 46 /* ExclamationToken */: - case 74 /* DeleteKeyword */: - case 97 /* TypeOfKeyword */: - case 99 /* VoidKeyword */: - case 38 /* PlusPlusToken */: - case 39 /* MinusMinusToken */: - case 24 /* LessThanToken */: - case 110 /* YieldKeyword */: - // Yield always starts an expression. Either it is an identifier (in which case - // it is definitely an expression). Or it's a keyword (either because we're in - // a generator, or in strict mode (or both)) and it started a yield expression. - return true; - default: - // Error tolerance. If we see the start of some binary operator, we consider - // that the start of an expression. That way we'll parse out a missing identifier, - // give a good message about an identifier being missing, and then consume the - // rest of the binary expression. - if (isBinaryOperator()) { - return true; - } - return isIdentifier(); - } - } - function isStartOfExpressionStatement() { - // As per the grammar, none of '{' or 'function' or 'class' can start an expression statement. - return token !== 14 /* OpenBraceToken */ && - token !== 83 /* FunctionKeyword */ && - token !== 69 /* ClassKeyword */ && - token !== 52 /* AtToken */ && - isStartOfExpression(); - } - function parseExpression() { - // Expression[in]: - // AssignmentExpression[in] - // Expression[in] , AssignmentExpression[in] - // clear the decorator context when parsing Expression, as it should be unambiguous when parsing a decorator - var saveDecoratorContext = inDecoratorContext(); - if (saveDecoratorContext) { - setDecoratorContext(false); - } - var expr = parseAssignmentExpressionOrHigher(); - var operatorToken; - while ((operatorToken = parseOptionalToken(23 /* CommaToken */))) { - expr = makeBinaryExpression(expr, operatorToken, parseAssignmentExpressionOrHigher()); - } - if (saveDecoratorContext) { - setDecoratorContext(true); - } - return expr; - } - function parseInitializer(inParameter) { - if (token !== 53 /* EqualsToken */) { - // It's not uncommon during typing for the user to miss writing the '=' token. Check if - // there is no newline after the last token and if we're on an expression. If so, parse - // this as an equals-value clause with a missing equals. - // NOTE: There are two places where we allow equals-value clauses. The first is in a - // variable declarator. The second is with a parameter. For variable declarators - // it's more likely that a { would be a allowed (as an object literal). While this - // is also allowed for parameters, the risk is that we consume the { as an object - // literal when it really will be for the block following the parameter. - if (scanner.hasPrecedingLineBreak() || (inParameter && token === 14 /* OpenBraceToken */) || !isStartOfExpression()) { - // preceding line break, open brace in a parameter (likely a function body) or current token is not an expression - - // do not try to parse initializer - return undefined; - } - } - // Initializer[In, Yield] : - // = AssignmentExpression[?In, ?Yield] - parseExpected(53 /* EqualsToken */); - return parseAssignmentExpressionOrHigher(); - } - function parseAssignmentExpressionOrHigher() { - // AssignmentExpression[in,yield]: - // 1) ConditionalExpression[?in,?yield] - // 2) LeftHandSideExpression = AssignmentExpression[?in,?yield] - // 3) LeftHandSideExpression AssignmentOperator AssignmentExpression[?in,?yield] - // 4) ArrowFunctionExpression[?in,?yield] - // 5) [+Yield] YieldExpression[?In] - // - // Note: for ease of implementation we treat productions '2' and '3' as the same thing. - // (i.e. they're both BinaryExpressions with an assignment operator in it). - // First, do the simple check if we have a YieldExpression (production '5'). - if (isYieldExpression()) { - return parseYieldExpression(); - } - // Then, check if we have an arrow function (production '4') that starts with a parenthesized - // parameter list. If we do, we must *not* recurse for productions 1, 2 or 3. An ArrowFunction is - // not a LeftHandSideExpression, nor does it start a ConditionalExpression. So we are done - // with AssignmentExpression if we see one. - var arrowExpression = tryParseParenthesizedArrowFunctionExpression(); - if (arrowExpression) { - return arrowExpression; - } - // Now try to see if we're in production '1', '2' or '3'. A conditional expression can - // start with a LogicalOrExpression, while the assignment productions can only start with - // LeftHandSideExpressions. - // - // So, first, we try to just parse out a BinaryExpression. If we get something that is a - // LeftHandSide or higher, then we can try to parse out the assignment expression part. - // Otherwise, we try to parse out the conditional expression bit. We want to allow any - // binary expression here, so we pass in the 'lowest' precedence here so that it matches - // and consumes anything. - var expr = parseBinaryExpressionOrHigher(0); - // To avoid a look-ahead, we did not handle the case of an arrow function with a single un-parenthesized - // parameter ('x => ...') above. We handle it here by checking if the parsed expression was a single - // identifier and the current token is an arrow. - if (expr.kind === 65 /* Identifier */ && token === 32 /* EqualsGreaterThanToken */) { - return parseSimpleArrowFunctionExpression(expr); - } - // Now see if we might be in cases '2' or '3'. - // If the expression was a LHS expression, and we have an assignment operator, then - // we're in '2' or '3'. Consume the assignment and return. - // - // Note: we call reScanGreaterToken so that we get an appropriately merged token - // for cases like > > = becoming >>= - if (ts.isLeftHandSideExpression(expr) && ts.isAssignmentOperator(reScanGreaterToken())) { - return makeBinaryExpression(expr, parseTokenNode(), parseAssignmentExpressionOrHigher()); - } - // It wasn't an assignment or a lambda. This is a conditional expression: - return parseConditionalExpressionRest(expr); - } - function isYieldExpression() { - if (token === 110 /* YieldKeyword */) { - // If we have a 'yield' keyword, and htis is a context where yield expressions are - // allowed, then definitely parse out a yield expression. - if (inYieldContext()) { - return true; - } - if (inStrictModeContext()) { - // If we're in strict mode, then 'yield' is a keyword, could only ever start - // a yield expression. - return true; - } - // We're in a context where 'yield expr' is not allowed. However, if we can - // definitely tell that the user was trying to parse a 'yield expr' and not - // just a normal expr that start with a 'yield' identifier, then parse out - // a 'yield expr'. We can then report an error later that they are only - // allowed in generator expressions. - // - // for example, if we see 'yield(foo)', then we'll have to treat that as an - // invocation expression of something called 'yield'. However, if we have - // 'yield foo' then that is not legal as a normal expression, so we can - // definitely recognize this as a yield expression. - // - // for now we just check if the next token is an identifier. More heuristics - // can be added here later as necessary. We just need to make sure that we - // don't accidently consume something legal. - return lookAhead(nextTokenIsIdentifierOnSameLine); - } - return false; - } - function nextTokenIsIdentifierOnSameLine() { - nextToken(); - return !scanner.hasPrecedingLineBreak() && isIdentifier(); - } - function parseYieldExpression() { - var node = createNode(175 /* YieldExpression */); - // YieldExpression[In] : - // yield - // yield [no LineTerminator here] [Lexical goal InputElementRegExp]AssignmentExpression[?In, Yield] - // yield [no LineTerminator here] * [Lexical goal InputElementRegExp]AssignmentExpression[?In, Yield] - nextToken(); - if (!scanner.hasPrecedingLineBreak() && - (token === 35 /* AsteriskToken */ || isStartOfExpression())) { - node.asteriskToken = parseOptionalToken(35 /* AsteriskToken */); - node.expression = parseAssignmentExpressionOrHigher(); - return finishNode(node); - } - else { - // if the next token is not on the same line as yield. or we don't have an '*' or - // the start of an expressin, then this is just a simple "yield" expression. - return finishNode(node); - } - } - function parseSimpleArrowFunctionExpression(identifier) { - ts.Debug.assert(token === 32 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); - var node = createNode(166 /* ArrowFunction */, identifier.pos); - var parameter = createNode(131 /* Parameter */, identifier.pos); - parameter.name = identifier; - finishNode(parameter); - node.parameters = [parameter]; - node.parameters.pos = parameter.pos; - node.parameters.end = parameter.end; - node.equalsGreaterThanToken = parseExpectedToken(32 /* EqualsGreaterThanToken */, false, ts.Diagnostics._0_expected, "=>"); - node.body = parseArrowFunctionExpressionBody(); - return finishNode(node); - } - function tryParseParenthesizedArrowFunctionExpression() { - var triState = isParenthesizedArrowFunctionExpression(); - if (triState === 0 /* False */) { - // It's definitely not a parenthesized arrow function expression. - return undefined; - } - // If we definitely have an arrow function, then we can just parse one, not requiring a - // following => or { token. Otherwise, we *might* have an arrow function. Try to parse - // it out, but don't allow any ambiguity, and return 'undefined' if this could be an - // expression instead. - var arrowFunction = triState === 1 /* True */ - ? parseParenthesizedArrowFunctionExpressionHead(true) - : tryParse(parsePossibleParenthesizedArrowFunctionExpressionHead); - if (!arrowFunction) { - // Didn't appear to actually be a parenthesized arrow function. Just bail out. - return undefined; - } - // If we have an arrow, then try to parse the body. Even if not, try to parse if we - // have an opening brace, just in case we're in an error state. - var lastToken = token; - arrowFunction.equalsGreaterThanToken = parseExpectedToken(32 /* EqualsGreaterThanToken */, false, ts.Diagnostics._0_expected, "=>"); - arrowFunction.body = (lastToken === 32 /* EqualsGreaterThanToken */ || lastToken === 14 /* OpenBraceToken */) - ? parseArrowFunctionExpressionBody() - : parseIdentifier(); - return finishNode(arrowFunction); - } - // True -> We definitely expect a parenthesized arrow function here. - // False -> There *cannot* be a parenthesized arrow function here. - // Unknown -> There *might* be a parenthesized arrow function here. - // Speculatively look ahead to be sure, and rollback if not. - function isParenthesizedArrowFunctionExpression() { - if (token === 16 /* OpenParenToken */ || token === 24 /* LessThanToken */) { - return lookAhead(isParenthesizedArrowFunctionExpressionWorker); - } - if (token === 32 /* EqualsGreaterThanToken */) { - // ERROR RECOVERY TWEAK: - // If we see a standalone => try to parse it as an arrow function expression as that's - // likely what the user intended to write. - return 1 /* True */; - } - // Definitely not a parenthesized arrow function. - return 0 /* False */; - } - function isParenthesizedArrowFunctionExpressionWorker() { - var first = token; - var second = nextToken(); - if (first === 16 /* OpenParenToken */) { - if (second === 17 /* CloseParenToken */) { - // Simple cases: "() =>", "(): ", and "() {". - // This is an arrow function with no parameters. - // The last one is not actually an arrow function, - // but this is probably what the user intended. - var third = nextToken(); - switch (third) { - case 32 /* EqualsGreaterThanToken */: - case 51 /* ColonToken */: - case 14 /* OpenBraceToken */: - return 1 /* True */; - default: - return 0 /* False */; - } - } - // If encounter "([" or "({", this could be the start of a binding pattern. - // Examples: - // ([ x ]) => { } - // ({ x }) => { } - // ([ x ]) - // ({ x }) - if (second === 18 /* OpenBracketToken */ || second === 14 /* OpenBraceToken */) { - return 2 /* Unknown */; - } - // Simple case: "(..." - // This is an arrow function with a rest parameter. - if (second === 21 /* DotDotDotToken */) { - return 1 /* True */; - } - // If we had "(" followed by something that's not an identifier, - // then this definitely doesn't look like a lambda. - // Note: we could be a little more lenient and allow - // "(public" or "(private". These would not ever actually be allowed, - // but we could provide a good error message instead of bailing out. - if (!isIdentifier()) { - return 0 /* False */; - } - // If we have something like "(a:", then we must have a - // type-annotated parameter in an arrow function expression. - if (nextToken() === 51 /* ColonToken */) { - return 1 /* True */; - } - // This *could* be a parenthesized arrow function. - // Return Unknown to let the caller know. - return 2 /* Unknown */; - } - else { - ts.Debug.assert(first === 24 /* LessThanToken */); - // If we have "<" not followed by an identifier, - // then this definitely is not an arrow function. - if (!isIdentifier()) { - return 0 /* False */; - } - // This *could* be a parenthesized arrow function. - return 2 /* Unknown */; - } - } - function parsePossibleParenthesizedArrowFunctionExpressionHead() { - return parseParenthesizedArrowFunctionExpressionHead(false); - } - function parseParenthesizedArrowFunctionExpressionHead(allowAmbiguity) { - var node = createNode(166 /* ArrowFunction */); - // Arrow functions are never generators. - // - // If we're speculatively parsing a signature for a parenthesized arrow function, then - // we have to have a complete parameter list. Otherwise we might see something like - // a => (b => c) - // And think that "(b =>" was actually a parenthesized arrow function with a missing - // close paren. - fillSignature(51 /* ColonToken */, false, !allowAmbiguity, node); - // If we couldn't get parameters, we definitely could not parse out an arrow function. - if (!node.parameters) { - return undefined; - } - // Parsing a signature isn't enough. - // Parenthesized arrow signatures often look like other valid expressions. - // For instance: - // - "(x = 10)" is an assignment expression parsed as a signature with a default parameter value. - // - "(x,y)" is a comma expression parsed as a signature with two parameters. - // - "a ? (b): c" will have "(b):" parsed as a signature with a return type annotation. - // - // So we need just a bit of lookahead to ensure that it can only be a signature. - if (!allowAmbiguity && token !== 32 /* EqualsGreaterThanToken */ && token !== 14 /* OpenBraceToken */) { - // Returning undefined here will cause our caller to rewind to where we started from. - return undefined; - } - return node; - } - function parseArrowFunctionExpressionBody() { - if (token === 14 /* OpenBraceToken */) { - return parseFunctionBlock(false, false); - } - if (token !== 22 /* SemicolonToken */ && - token !== 83 /* FunctionKeyword */ && - token !== 69 /* ClassKeyword */ && - isStartOfStatement() && - !isStartOfExpressionStatement()) { - // Check if we got a plain statement (i.e. no expression-statements, no function/class expressions/declarations) - // - // Here we try to recover from a potential error situation in the case where the - // user meant to supply a block. For example, if the user wrote: - // - // a => - // let v = 0; - // } - // - // they may be missing an open brace. Check to see if that's the case so we can - // try to recover better. If we don't do this, then the next close curly we see may end - // up preemptively closing the containing construct. - // - // Note: even when 'ignoreMissingOpenBrace' is passed as true, parseBody will still error. - return parseFunctionBlock(false, true); - } - return parseAssignmentExpressionOrHigher(); - } - function parseConditionalExpressionRest(leftOperand) { - // Note: we are passed in an expression which was produced from parseBinaryExpressionOrHigher. - var questionToken = parseOptionalToken(50 /* QuestionToken */); - if (!questionToken) { - return leftOperand; - } - // Note: we explicitly 'allowIn' in the whenTrue part of the condition expression, and - // we do not that for the 'whenFalse' part. - var node = createNode(173 /* ConditionalExpression */, leftOperand.pos); - node.condition = leftOperand; - node.questionToken = questionToken; - node.whenTrue = doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher); - node.colonToken = parseExpectedToken(51 /* ColonToken */, false, ts.Diagnostics._0_expected, ts.tokenToString(51 /* ColonToken */)); - node.whenFalse = parseAssignmentExpressionOrHigher(); - return finishNode(node); - } - function parseBinaryExpressionOrHigher(precedence) { - var leftOperand = parseUnaryExpressionOrHigher(); - return parseBinaryExpressionRest(precedence, leftOperand); - } - function isInOrOfKeyword(t) { - return t === 86 /* InKeyword */ || t === 127 /* OfKeyword */; - } - function parseBinaryExpressionRest(precedence, leftOperand) { - while (true) { - // We either have a binary operator here, or we're finished. We call - // reScanGreaterToken so that we merge token sequences like > and = into >= - reScanGreaterToken(); - var newPrecedence = getBinaryOperatorPrecedence(); - // Check the precedence to see if we should "take" this operator - if (newPrecedence <= precedence) { - break; - } - if (token === 86 /* InKeyword */ && inDisallowInContext()) { - break; - } - leftOperand = makeBinaryExpression(leftOperand, parseTokenNode(), parseBinaryExpressionOrHigher(newPrecedence)); - } - return leftOperand; - } - function isBinaryOperator() { - if (inDisallowInContext() && token === 86 /* InKeyword */) { - return false; - } - return getBinaryOperatorPrecedence() > 0; - } - function getBinaryOperatorPrecedence() { - switch (token) { - case 49 /* BarBarToken */: - return 1; - case 48 /* AmpersandAmpersandToken */: - return 2; - case 44 /* BarToken */: - return 3; - case 45 /* CaretToken */: - return 4; - case 43 /* AmpersandToken */: - return 5; - case 28 /* EqualsEqualsToken */: - case 29 /* ExclamationEqualsToken */: - case 30 /* EqualsEqualsEqualsToken */: - case 31 /* ExclamationEqualsEqualsToken */: - return 6; - case 24 /* LessThanToken */: - case 25 /* GreaterThanToken */: - case 26 /* LessThanEqualsToken */: - case 27 /* GreaterThanEqualsToken */: - case 87 /* InstanceOfKeyword */: - case 86 /* InKeyword */: - return 7; - case 40 /* LessThanLessThanToken */: - case 41 /* GreaterThanGreaterThanToken */: - case 42 /* GreaterThanGreaterThanGreaterThanToken */: - return 8; - case 33 /* PlusToken */: - case 34 /* MinusToken */: - return 9; - case 35 /* AsteriskToken */: - case 36 /* SlashToken */: - case 37 /* PercentToken */: - return 10; - } - // -1 is lower than all other precedences. Returning it will cause binary expression - // parsing to stop. - return -1; - } - function makeBinaryExpression(left, operatorToken, right) { - var node = createNode(172 /* BinaryExpression */, left.pos); - node.left = left; - node.operatorToken = operatorToken; - node.right = right; - return finishNode(node); - } - function parsePrefixUnaryExpression() { - var node = createNode(170 /* PrefixUnaryExpression */); - node.operator = token; - nextToken(); - node.operand = parseUnaryExpressionOrHigher(); - return finishNode(node); - } - function parseDeleteExpression() { - var node = createNode(167 /* DeleteExpression */); - nextToken(); - node.expression = parseUnaryExpressionOrHigher(); - return finishNode(node); - } - function parseTypeOfExpression() { - var node = createNode(168 /* TypeOfExpression */); - nextToken(); - node.expression = parseUnaryExpressionOrHigher(); - return finishNode(node); - } - function parseVoidExpression() { - var node = createNode(169 /* VoidExpression */); - nextToken(); - node.expression = parseUnaryExpressionOrHigher(); - return finishNode(node); - } - function parseUnaryExpressionOrHigher() { - switch (token) { - case 33 /* PlusToken */: - case 34 /* MinusToken */: - case 47 /* TildeToken */: - case 46 /* ExclamationToken */: - case 38 /* PlusPlusToken */: - case 39 /* MinusMinusToken */: - return parsePrefixUnaryExpression(); - case 74 /* DeleteKeyword */: - return parseDeleteExpression(); - case 97 /* TypeOfKeyword */: - return parseTypeOfExpression(); - case 99 /* VoidKeyword */: - return parseVoidExpression(); - case 24 /* LessThanToken */: - return parseTypeAssertion(); - default: - return parsePostfixExpressionOrHigher(); - } - } - function parsePostfixExpressionOrHigher() { - var expression = parseLeftHandSideExpressionOrHigher(); - ts.Debug.assert(ts.isLeftHandSideExpression(expression)); - if ((token === 38 /* PlusPlusToken */ || token === 39 /* MinusMinusToken */) && !scanner.hasPrecedingLineBreak()) { - var node = createNode(171 /* PostfixUnaryExpression */, expression.pos); - node.operand = expression; - node.operator = token; - nextToken(); - return finishNode(node); - } - return expression; - } - function parseLeftHandSideExpressionOrHigher() { - // Original Ecma: - // LeftHandSideExpression: See 11.2 - // NewExpression - // CallExpression - // - // Our simplification: - // - // LeftHandSideExpression: See 11.2 - // MemberExpression - // CallExpression - // - // See comment in parseMemberExpressionOrHigher on how we replaced NewExpression with - // MemberExpression to make our lives easier. - // - // to best understand the below code, it's important to see how CallExpression expands - // out into its own productions: - // - // CallExpression: - // MemberExpression Arguments - // CallExpression Arguments - // CallExpression[Expression] - // CallExpression.IdentifierName - // super ( ArgumentListopt ) - // super.IdentifierName - // - // Because of the recursion in these calls, we need to bottom out first. There are two - // bottom out states we can run into. Either we see 'super' which must start either of - // the last two CallExpression productions. Or we have a MemberExpression which either - // completes the LeftHandSideExpression, or starts the beginning of the first four - // CallExpression productions. - var expression = token === 91 /* SuperKeyword */ - ? parseSuperExpression() - : parseMemberExpressionOrHigher(); - // Now, we *may* be complete. However, we might have consumed the start of a - // CallExpression. As such, we need to consume the rest of it here to be complete. - return parseCallExpressionRest(expression); - } - function parseMemberExpressionOrHigher() { - // Note: to make our lives simpler, we decompose the the NewExpression productions and - // place ObjectCreationExpression and FunctionExpression into PrimaryExpression. - // like so: - // - // PrimaryExpression : See 11.1 - // this - // Identifier - // Literal - // ArrayLiteral - // ObjectLiteral - // (Expression) - // FunctionExpression - // new MemberExpression Arguments? - // - // MemberExpression : See 11.2 - // PrimaryExpression - // MemberExpression[Expression] - // MemberExpression.IdentifierName - // - // CallExpression : See 11.2 - // MemberExpression - // CallExpression Arguments - // CallExpression[Expression] - // CallExpression.IdentifierName - // - // Technically this is ambiguous. i.e. CallExpression defines: - // - // CallExpression: - // CallExpression Arguments - // - // If you see: "new Foo()" - // - // Then that could be treated as a single ObjectCreationExpression, or it could be - // treated as the invocation of "new Foo". We disambiguate that in code (to match - // the original grammar) by making sure that if we see an ObjectCreationExpression - // we always consume arguments if they are there. So we treat "new Foo()" as an - // object creation only, and not at all as an invocation) Another way to think - // about this is that for every "new" that we see, we will consume an argument list if - // it is there as part of the *associated* object creation node. Any additional - // argument lists we see, will become invocation expressions. - // - // Because there are no other places in the grammar now that refer to FunctionExpression - // or ObjectCreationExpression, it is safe to push down into the PrimaryExpression - // production. - // - // Because CallExpression and MemberExpression are left recursive, we need to bottom out - // of the recursion immediately. So we parse out a primary expression to start with. - var expression = parsePrimaryExpression(); - return parseMemberExpressionRest(expression); - } - function parseSuperExpression() { - var expression = parseTokenNode(); - if (token === 16 /* OpenParenToken */ || token === 20 /* DotToken */) { - return expression; - } - // If we have seen "super" it must be followed by '(' or '.'. - // If it wasn't then just try to parse out a '.' and report an error. - var node = createNode(158 /* PropertyAccessExpression */, expression.pos); - node.expression = expression; - node.dotToken = parseExpectedToken(20 /* DotToken */, false, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); - node.name = parseRightSideOfDot(true); - return finishNode(node); - } - function parseTypeAssertion() { - var node = createNode(163 /* TypeAssertionExpression */); - parseExpected(24 /* LessThanToken */); - node.type = parseType(); - parseExpected(25 /* GreaterThanToken */); - node.expression = parseUnaryExpressionOrHigher(); - return finishNode(node); - } - function parseMemberExpressionRest(expression) { - while (true) { - var dotToken = parseOptionalToken(20 /* DotToken */); - if (dotToken) { - var propertyAccess = createNode(158 /* PropertyAccessExpression */, expression.pos); - propertyAccess.expression = expression; - propertyAccess.dotToken = dotToken; - propertyAccess.name = parseRightSideOfDot(true); - expression = finishNode(propertyAccess); - continue; - } - // when in the [Decorator] context, we do not parse ElementAccess as it could be part of a ComputedPropertyName - if (!inDecoratorContext() && parseOptional(18 /* OpenBracketToken */)) { - var indexedAccess = createNode(159 /* ElementAccessExpression */, expression.pos); - indexedAccess.expression = expression; - // It's not uncommon for a user to write: "new Type[]". - // Check for that common pattern and report a better error message. - if (token !== 19 /* CloseBracketToken */) { - indexedAccess.argumentExpression = allowInAnd(parseExpression); - if (indexedAccess.argumentExpression.kind === 8 /* StringLiteral */ || indexedAccess.argumentExpression.kind === 7 /* NumericLiteral */) { - var literal = indexedAccess.argumentExpression; - literal.text = internIdentifier(literal.text); - } - } - parseExpected(19 /* CloseBracketToken */); - expression = finishNode(indexedAccess); - continue; - } - if (token === 10 /* NoSubstitutionTemplateLiteral */ || token === 11 /* TemplateHead */) { - var tagExpression = createNode(162 /* TaggedTemplateExpression */, expression.pos); - tagExpression.tag = expression; - tagExpression.template = token === 10 /* NoSubstitutionTemplateLiteral */ - ? parseLiteralNode() - : parseTemplateExpression(); - expression = finishNode(tagExpression); - continue; - } - return expression; - } - } - function parseCallExpressionRest(expression) { - while (true) { - expression = parseMemberExpressionRest(expression); - if (token === 24 /* LessThanToken */) { - // See if this is the start of a generic invocation. If so, consume it and - // keep checking for postfix expressions. Otherwise, it's just a '<' that's - // part of an arithmetic expression. Break out so we consume it higher in the - // stack. - var typeArguments = tryParse(parseTypeArgumentsInExpression); - if (!typeArguments) { - return expression; - } - var callExpr = createNode(160 /* CallExpression */, expression.pos); - callExpr.expression = expression; - callExpr.typeArguments = typeArguments; - callExpr.arguments = parseArgumentList(); - expression = finishNode(callExpr); - continue; - } - else if (token === 16 /* OpenParenToken */) { - var callExpr = createNode(160 /* CallExpression */, expression.pos); - callExpr.expression = expression; - callExpr.arguments = parseArgumentList(); - expression = finishNode(callExpr); - continue; - } - return expression; - } - } - function parseArgumentList() { - parseExpected(16 /* OpenParenToken */); - var result = parseDelimitedList(11 /* ArgumentExpressions */, parseArgumentExpression); - parseExpected(17 /* CloseParenToken */); - return result; - } - function parseTypeArgumentsInExpression() { - if (!parseOptional(24 /* LessThanToken */)) { - return undefined; - } - var typeArguments = parseDelimitedList(16 /* TypeArguments */, parseType); - if (!parseExpected(25 /* GreaterThanToken */)) { - // If it doesn't have the closing > then it's definitely not an type argument list. - return undefined; - } - // If we have a '<', then only parse this as a arugment list if the type arguments - // are complete and we have an open paren. if we don't, rewind and return nothing. - return typeArguments && canFollowTypeArgumentsInExpression() - ? typeArguments - : undefined; - } - function canFollowTypeArgumentsInExpression() { - switch (token) { - case 16 /* OpenParenToken */: // foo( - // this case are the only case where this token can legally follow a type argument - // list. So we definitely want to treat this as a type arg list. - case 20 /* DotToken */: // foo. - case 17 /* CloseParenToken */: // foo) - case 19 /* CloseBracketToken */: // foo] - case 51 /* ColonToken */: // foo: - case 22 /* SemicolonToken */: // foo; - case 50 /* QuestionToken */: // foo? - case 28 /* EqualsEqualsToken */: // foo == - case 30 /* EqualsEqualsEqualsToken */: // foo === - case 29 /* ExclamationEqualsToken */: // foo != - case 31 /* ExclamationEqualsEqualsToken */: // foo !== - case 48 /* AmpersandAmpersandToken */: // foo && - case 49 /* BarBarToken */: // foo || - case 45 /* CaretToken */: // foo ^ - case 43 /* AmpersandToken */: // foo & - case 44 /* BarToken */: // foo | - case 15 /* CloseBraceToken */: // foo } - case 1 /* EndOfFileToken */: - // these cases can't legally follow a type arg list. However, they're not legal - // expressions either. The user is probably in the middle of a generic type. So - // treat it as such. - return true; - case 23 /* CommaToken */: // foo, - case 14 /* OpenBraceToken */: // foo { - // We don't want to treat these as type arguments. Otherwise we'll parse this - // as an invocation expression. Instead, we want to parse out the expression - // in isolation from the type arguments. - default: - // Anything else treat as an expression. - return false; - } - } - function parsePrimaryExpression() { - switch (token) { - case 7 /* NumericLiteral */: - case 8 /* StringLiteral */: - case 10 /* NoSubstitutionTemplateLiteral */: - return parseLiteralNode(); - case 93 /* ThisKeyword */: - case 91 /* SuperKeyword */: - case 89 /* NullKeyword */: - case 95 /* TrueKeyword */: - case 80 /* FalseKeyword */: - return parseTokenNode(); - case 16 /* OpenParenToken */: - return parseParenthesizedExpression(); - case 18 /* OpenBracketToken */: - return parseArrayLiteralExpression(); - case 14 /* OpenBraceToken */: - return parseObjectLiteralExpression(); - case 69 /* ClassKeyword */: - return parseClassExpression(); - case 83 /* FunctionKeyword */: - return parseFunctionExpression(); - case 88 /* NewKeyword */: - return parseNewExpression(); - case 36 /* SlashToken */: - case 57 /* SlashEqualsToken */: - if (reScanSlashToken() === 9 /* RegularExpressionLiteral */) { - return parseLiteralNode(); - } - break; - case 11 /* TemplateHead */: - return parseTemplateExpression(); - } - return parseIdentifier(ts.Diagnostics.Expression_expected); - } - function parseParenthesizedExpression() { - var node = createNode(164 /* ParenthesizedExpression */); - parseExpected(16 /* OpenParenToken */); - node.expression = allowInAnd(parseExpression); - parseExpected(17 /* CloseParenToken */); - return finishNode(node); - } - function parseSpreadElement() { - var node = createNode(176 /* SpreadElementExpression */); - parseExpected(21 /* DotDotDotToken */); - node.expression = parseAssignmentExpressionOrHigher(); - return finishNode(node); - } - function parseArgumentOrArrayLiteralElement() { - return token === 21 /* DotDotDotToken */ ? parseSpreadElement() : - token === 23 /* CommaToken */ ? createNode(178 /* OmittedExpression */) : - parseAssignmentExpressionOrHigher(); - } - function parseArgumentExpression() { - return doOutsideOfContext(disallowInAndDecoratorContext, parseArgumentOrArrayLiteralElement); - } - function parseArrayLiteralExpression() { - var node = createNode(156 /* ArrayLiteralExpression */); - parseExpected(18 /* OpenBracketToken */); - if (scanner.hasPrecedingLineBreak()) - node.flags |= 512 /* MultiLine */; - node.elements = parseDelimitedList(13 /* ArrayLiteralMembers */, parseArgumentOrArrayLiteralElement); - parseExpected(19 /* CloseBracketToken */); - return finishNode(node); - } - function tryParseAccessorDeclaration(fullStart, decorators, modifiers) { - if (parseContextualModifier(116 /* GetKeyword */)) { - return parseAccessorDeclaration(138 /* GetAccessor */, fullStart, decorators, modifiers); - } - else if (parseContextualModifier(122 /* SetKeyword */)) { - return parseAccessorDeclaration(139 /* SetAccessor */, fullStart, decorators, modifiers); - } - return undefined; - } - function parseObjectLiteralElement() { - var fullStart = scanner.getStartPos(); - var decorators = parseDecorators(); - var modifiers = parseModifiers(); - var accessor = tryParseAccessorDeclaration(fullStart, decorators, modifiers); - if (accessor) { - return accessor; - } - var asteriskToken = parseOptionalToken(35 /* AsteriskToken */); - var tokenIsIdentifier = isIdentifier(); - var nameToken = token; - var propertyName = parsePropertyName(); - // Disallowing of optional property assignments happens in the grammar checker. - var questionToken = parseOptionalToken(50 /* QuestionToken */); - if (asteriskToken || token === 16 /* OpenParenToken */ || token === 24 /* LessThanToken */) { - return parseMethodDeclaration(fullStart, decorators, modifiers, asteriskToken, propertyName, questionToken); - } - // Parse to check if it is short-hand property assignment or normal property assignment - if ((token === 23 /* CommaToken */ || token === 15 /* CloseBraceToken */) && tokenIsIdentifier) { - var shorthandDeclaration = createNode(228 /* ShorthandPropertyAssignment */, fullStart); - shorthandDeclaration.name = propertyName; - shorthandDeclaration.questionToken = questionToken; - return finishNode(shorthandDeclaration); - } - else { - var propertyAssignment = createNode(227 /* PropertyAssignment */, fullStart); - propertyAssignment.name = propertyName; - propertyAssignment.questionToken = questionToken; - parseExpected(51 /* ColonToken */); - propertyAssignment.initializer = allowInAnd(parseAssignmentExpressionOrHigher); - return finishNode(propertyAssignment); - } - } - function parseObjectLiteralExpression() { - var node = createNode(157 /* ObjectLiteralExpression */); - parseExpected(14 /* OpenBraceToken */); - if (scanner.hasPrecedingLineBreak()) { - node.flags |= 512 /* MultiLine */; - } - node.properties = parseDelimitedList(12 /* ObjectLiteralMembers */, parseObjectLiteralElement, true); - parseExpected(15 /* CloseBraceToken */); - return finishNode(node); - } - function parseFunctionExpression() { - // GeneratorExpression : - // function * BindingIdentifier[Yield]opt (FormalParameters[Yield, GeneratorParameter]) { GeneratorBody[Yield] } - // FunctionExpression: - // function BindingIdentifieropt(FormalParameters) { FunctionBody } - var saveDecoratorContext = inDecoratorContext(); - if (saveDecoratorContext) { - setDecoratorContext(false); - } - var node = createNode(165 /* FunctionExpression */); - parseExpected(83 /* FunctionKeyword */); - node.asteriskToken = parseOptionalToken(35 /* AsteriskToken */); - node.name = node.asteriskToken ? doInYieldContext(parseOptionalIdentifier) : parseOptionalIdentifier(); - fillSignature(51 /* ColonToken */, !!node.asteriskToken, false, node); - node.body = parseFunctionBlock(!!node.asteriskToken, false); - if (saveDecoratorContext) { - setDecoratorContext(true); - } - return finishNode(node); - } - function parseOptionalIdentifier() { - return isIdentifier() ? parseIdentifier() : undefined; - } - function parseNewExpression() { - var node = createNode(161 /* NewExpression */); - parseExpected(88 /* NewKeyword */); - node.expression = parseMemberExpressionOrHigher(); - node.typeArguments = tryParse(parseTypeArgumentsInExpression); - if (node.typeArguments || token === 16 /* OpenParenToken */) { - node.arguments = parseArgumentList(); - } - return finishNode(node); - } - // STATEMENTS - function parseBlock(ignoreMissingOpenBrace, checkForStrictMode, diagnosticMessage) { - var node = createNode(182 /* Block */); - if (parseExpected(14 /* OpenBraceToken */, diagnosticMessage) || ignoreMissingOpenBrace) { - node.statements = parseList(1 /* BlockStatements */, checkForStrictMode, parseStatement); - parseExpected(15 /* CloseBraceToken */); - } - else { - node.statements = createMissingList(); - } - return finishNode(node); - } - function parseFunctionBlock(allowYield, ignoreMissingOpenBrace, diagnosticMessage) { - var savedYieldContext = inYieldContext(); - setYieldContext(allowYield); - // We may be in a [Decorator] context when parsing a function expression or - // arrow function. The body of the function is not in [Decorator] context. - var saveDecoratorContext = inDecoratorContext(); - if (saveDecoratorContext) { - setDecoratorContext(false); - } - var block = parseBlock(ignoreMissingOpenBrace, true, diagnosticMessage); - if (saveDecoratorContext) { - setDecoratorContext(true); - } - setYieldContext(savedYieldContext); - return block; - } - function parseEmptyStatement() { - var node = createNode(184 /* EmptyStatement */); - parseExpected(22 /* SemicolonToken */); - return finishNode(node); - } - function parseIfStatement() { - var node = createNode(186 /* IfStatement */); - parseExpected(84 /* IfKeyword */); - parseExpected(16 /* OpenParenToken */); - node.expression = allowInAnd(parseExpression); - parseExpected(17 /* CloseParenToken */); - node.thenStatement = parseStatement(); - node.elseStatement = parseOptional(76 /* ElseKeyword */) ? parseStatement() : undefined; - return finishNode(node); - } - function parseDoStatement() { - var node = createNode(187 /* DoStatement */); - parseExpected(75 /* DoKeyword */); - node.statement = parseStatement(); - parseExpected(100 /* WhileKeyword */); - parseExpected(16 /* OpenParenToken */); - node.expression = allowInAnd(parseExpression); - parseExpected(17 /* CloseParenToken */); - // From: https://mail.mozilla.org/pipermail/es-discuss/2011-August/016188.html - // 157 min --- All allen at wirfs-brock.com CONF --- "do{;}while(false)false" prohibited in - // spec but allowed in consensus reality. Approved -- this is the de-facto standard whereby - // do;while(0)x will have a semicolon inserted before x. - parseOptional(22 /* SemicolonToken */); - return finishNode(node); - } - function parseWhileStatement() { - var node = createNode(188 /* WhileStatement */); - parseExpected(100 /* WhileKeyword */); - parseExpected(16 /* OpenParenToken */); - node.expression = allowInAnd(parseExpression); - parseExpected(17 /* CloseParenToken */); - node.statement = parseStatement(); - return finishNode(node); - } - function parseForOrForInOrForOfStatement() { - var pos = getNodePos(); - parseExpected(82 /* ForKeyword */); - parseExpected(16 /* OpenParenToken */); - var initializer = undefined; - if (token !== 22 /* SemicolonToken */) { - if (token === 98 /* VarKeyword */ || token === 104 /* LetKeyword */ || token === 70 /* ConstKeyword */) { - initializer = parseVariableDeclarationList(true); - } - else { - initializer = disallowInAnd(parseExpression); - } - } - var forOrForInOrForOfStatement; - if (parseOptional(86 /* InKeyword */)) { - var forInStatement = createNode(190 /* ForInStatement */, pos); - forInStatement.initializer = initializer; - forInStatement.expression = allowInAnd(parseExpression); - parseExpected(17 /* CloseParenToken */); - forOrForInOrForOfStatement = forInStatement; - } - else if (parseOptional(127 /* OfKeyword */)) { - var forOfStatement = createNode(191 /* ForOfStatement */, pos); - forOfStatement.initializer = initializer; - forOfStatement.expression = allowInAnd(parseAssignmentExpressionOrHigher); - parseExpected(17 /* CloseParenToken */); - forOrForInOrForOfStatement = forOfStatement; - } - else { - var forStatement = createNode(189 /* ForStatement */, pos); - forStatement.initializer = initializer; - parseExpected(22 /* SemicolonToken */); - if (token !== 22 /* SemicolonToken */ && token !== 17 /* CloseParenToken */) { - forStatement.condition = allowInAnd(parseExpression); - } - parseExpected(22 /* SemicolonToken */); - if (token !== 17 /* CloseParenToken */) { - forStatement.incrementor = allowInAnd(parseExpression); - } - parseExpected(17 /* CloseParenToken */); - forOrForInOrForOfStatement = forStatement; - } - forOrForInOrForOfStatement.statement = parseStatement(); - return finishNode(forOrForInOrForOfStatement); - } - function parseBreakOrContinueStatement(kind) { - var node = createNode(kind); - parseExpected(kind === 193 /* BreakStatement */ ? 66 /* BreakKeyword */ : 71 /* ContinueKeyword */); - if (!canParseSemicolon()) { - node.label = parseIdentifier(); - } - parseSemicolon(); - return finishNode(node); - } - function parseReturnStatement() { - var node = createNode(194 /* ReturnStatement */); - parseExpected(90 /* ReturnKeyword */); - if (!canParseSemicolon()) { - node.expression = allowInAnd(parseExpression); - } - parseSemicolon(); - return finishNode(node); - } - function parseWithStatement() { - var node = createNode(195 /* WithStatement */); - parseExpected(101 /* WithKeyword */); - parseExpected(16 /* OpenParenToken */); - node.expression = allowInAnd(parseExpression); - parseExpected(17 /* CloseParenToken */); - node.statement = parseStatement(); - return finishNode(node); - } - function parseCaseClause() { - var node = createNode(223 /* CaseClause */); - parseExpected(67 /* CaseKeyword */); - node.expression = allowInAnd(parseExpression); - parseExpected(51 /* ColonToken */); - node.statements = parseList(3 /* SwitchClauseStatements */, false, parseStatement); - return finishNode(node); - } - function parseDefaultClause() { - var node = createNode(224 /* DefaultClause */); - parseExpected(73 /* DefaultKeyword */); - parseExpected(51 /* ColonToken */); - node.statements = parseList(3 /* SwitchClauseStatements */, false, parseStatement); - return finishNode(node); - } - function parseCaseOrDefaultClause() { - return token === 67 /* CaseKeyword */ ? parseCaseClause() : parseDefaultClause(); - } - function parseSwitchStatement() { - var node = createNode(196 /* SwitchStatement */); - parseExpected(92 /* SwitchKeyword */); - parseExpected(16 /* OpenParenToken */); - node.expression = allowInAnd(parseExpression); - parseExpected(17 /* CloseParenToken */); - var caseBlock = createNode(210 /* CaseBlock */, scanner.getStartPos()); - parseExpected(14 /* OpenBraceToken */); - caseBlock.clauses = parseList(2 /* SwitchClauses */, false, parseCaseOrDefaultClause); - parseExpected(15 /* CloseBraceToken */); - node.caseBlock = finishNode(caseBlock); - return finishNode(node); - } - function parseThrowStatement() { - // ThrowStatement[Yield] : - // throw [no LineTerminator here]Expression[In, ?Yield]; - // Because of automatic semicolon insertion, we need to report error if this - // throw could be terminated with a semicolon. Note: we can't call 'parseExpression' - // directly as that might consume an expression on the following line. - // We just return 'undefined' in that case. The actual error will be reported in the - // grammar walker. - var node = createNode(198 /* ThrowStatement */); - parseExpected(94 /* ThrowKeyword */); - node.expression = scanner.hasPrecedingLineBreak() ? undefined : allowInAnd(parseExpression); - parseSemicolon(); - return finishNode(node); - } - // TODO: Review for error recovery - function parseTryStatement() { - var node = createNode(199 /* TryStatement */); - parseExpected(96 /* TryKeyword */); - node.tryBlock = parseBlock(false, false); - node.catchClause = token === 68 /* CatchKeyword */ ? parseCatchClause() : undefined; - // If we don't have a catch clause, then we must have a finally clause. Try to parse - // one out no matter what. - if (!node.catchClause || token === 81 /* FinallyKeyword */) { - parseExpected(81 /* FinallyKeyword */); - node.finallyBlock = parseBlock(false, false); - } - return finishNode(node); - } - function parseCatchClause() { - var result = createNode(226 /* CatchClause */); - parseExpected(68 /* CatchKeyword */); - if (parseExpected(16 /* OpenParenToken */)) { - result.variableDeclaration = parseVariableDeclaration(); - } - parseExpected(17 /* CloseParenToken */); - result.block = parseBlock(false, false); - return finishNode(result); - } - function parseDebuggerStatement() { - var node = createNode(200 /* DebuggerStatement */); - parseExpected(72 /* DebuggerKeyword */); - parseSemicolon(); - return finishNode(node); - } - function parseExpressionOrLabeledStatement() { - // Avoiding having to do the lookahead for a labeled statement by just trying to parse - // out an expression, seeing if it is identifier and then seeing if it is followed by - // a colon. - var fullStart = scanner.getStartPos(); - var expression = allowInAnd(parseExpression); - if (expression.kind === 65 /* Identifier */ && parseOptional(51 /* ColonToken */)) { - var labeledStatement = createNode(197 /* LabeledStatement */, fullStart); - labeledStatement.label = expression; - labeledStatement.statement = parseStatement(); - return finishNode(labeledStatement); - } - else { - var expressionStatement = createNode(185 /* ExpressionStatement */, fullStart); - expressionStatement.expression = expression; - parseSemicolon(); - return finishNode(expressionStatement); - } - } - function isIdentifierOrKeyword() { - return token >= 65 /* Identifier */; - } - function nextTokenIsIdentifierOrKeywordOnSameLine() { - nextToken(); - return isIdentifierOrKeyword() && !scanner.hasPrecedingLineBreak(); - } - function isDeclaration() { - while (true) { - switch (token) { - case 98 /* VarKeyword */: - case 104 /* LetKeyword */: - case 70 /* ConstKeyword */: - case 83 /* FunctionKeyword */: - case 69 /* ClassKeyword */: - case 77 /* EnumKeyword */: - return true; - // 'declare', 'module', 'namespace', 'interface'* and 'type' are all legal JavaScript identifiers; - // however, an identifier cannot be followed by another identifier on the same line. This is what we - // count on to parse out the respective declarations. For instance, we exploit this to say that - // - // namespace n - // - // can be none other than the beginning of a namespace declaration, but need to respect that JavaScript sees - // - // namespace - // n - // - // as the identifier 'namespace' on one line followed by the identifier 'n' on another. - // We need to look one token ahead to see if it permissible to try parsing a declaration. - // - // *Note*: 'interface' is actually a strict mode reserved word. So while - // - // "use strict" - // interface - // I {} - // - // could be legal, it would add complexity for very little gain. - case 103 /* InterfaceKeyword */: - case 125 /* TypeKeyword */: - return nextTokenIsIdentifierOnSameLine(); - case 118 /* ModuleKeyword */: - case 119 /* NamespaceKeyword */: - return nextTokenIsIdentifierOrStringLiteralOnSameLine(); - case 115 /* DeclareKeyword */: - nextToken(); - // ASI takes effect for this modifier. - if (scanner.hasPrecedingLineBreak()) { - return false; - } - continue; - case 85 /* ImportKeyword */: - nextToken(); - return token === 8 /* StringLiteral */ || token === 35 /* AsteriskToken */ || - token === 14 /* OpenBraceToken */ || isIdentifierOrKeyword(); - case 78 /* ExportKeyword */: - nextToken(); - if (token === 53 /* EqualsToken */ || token === 35 /* AsteriskToken */ || - token === 14 /* OpenBraceToken */ || token === 73 /* DefaultKeyword */) { - return true; - } - continue; - case 108 /* PublicKeyword */: - case 106 /* PrivateKeyword */: - case 107 /* ProtectedKeyword */: - case 109 /* StaticKeyword */: - nextToken(); - continue; - default: - return false; - } - } - } - function isStartOfDeclaration() { - return lookAhead(isDeclaration); - } - function isStartOfStatement() { - switch (token) { - case 52 /* AtToken */: - case 22 /* SemicolonToken */: - case 14 /* OpenBraceToken */: - case 98 /* VarKeyword */: - case 104 /* LetKeyword */: - case 83 /* FunctionKeyword */: - case 69 /* ClassKeyword */: - case 77 /* EnumKeyword */: - case 84 /* IfKeyword */: - case 75 /* DoKeyword */: - case 100 /* WhileKeyword */: - case 82 /* ForKeyword */: - case 71 /* ContinueKeyword */: - case 66 /* BreakKeyword */: - case 90 /* ReturnKeyword */: - case 101 /* WithKeyword */: - case 92 /* SwitchKeyword */: - case 94 /* ThrowKeyword */: - case 96 /* TryKeyword */: - case 72 /* DebuggerKeyword */: - // 'catch' and 'finally' do not actually indicate that the code is part of a statement, - // however, we say they are here so that we may gracefully parse them and error later. - case 68 /* CatchKeyword */: - case 81 /* FinallyKeyword */: - return true; - case 70 /* ConstKeyword */: - case 78 /* ExportKeyword */: - case 85 /* ImportKeyword */: - return isStartOfDeclaration(); - case 115 /* DeclareKeyword */: - case 103 /* InterfaceKeyword */: - case 118 /* ModuleKeyword */: - case 119 /* NamespaceKeyword */: - case 125 /* TypeKeyword */: - // When these don't start a declaration, they're an identifier in an expression statement - return true; - case 108 /* PublicKeyword */: - case 106 /* PrivateKeyword */: - case 107 /* ProtectedKeyword */: - case 109 /* StaticKeyword */: - // When these don't start a declaration, they may be the start of a class member if an identifier - // immediately follows. Otherwise they're an identifier in an expression statement. - return isStartOfDeclaration() || !lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine); - default: - return isStartOfExpression(); - } - } - function nextTokenIsIdentifierOrStartOfDestructuringOnTheSameLine() { - nextToken(); - return !scanner.hasPrecedingLineBreak() && - (isIdentifier() || token === 14 /* OpenBraceToken */ || token === 18 /* OpenBracketToken */); - } - function isLetDeclaration() { - // It is let declaration if in strict mode or next token is identifier\open bracket\open curly on same line. - // otherwise it needs to be treated like identifier - return inStrictModeContext() || lookAhead(nextTokenIsIdentifierOrStartOfDestructuringOnTheSameLine); - } - function parseStatement() { - switch (token) { - case 22 /* SemicolonToken */: - return parseEmptyStatement(); - case 14 /* OpenBraceToken */: - return parseBlock(false, false); - case 98 /* VarKeyword */: - return parseVariableStatement(scanner.getStartPos(), undefined, undefined); - case 104 /* LetKeyword */: - if (isLetDeclaration()) { - return parseVariableStatement(scanner.getStartPos(), undefined, undefined); - } - break; - case 83 /* FunctionKeyword */: - return parseFunctionDeclaration(scanner.getStartPos(), undefined, undefined); - case 69 /* ClassKeyword */: - return parseClassDeclaration(scanner.getStartPos(), undefined, undefined); - case 84 /* IfKeyword */: - return parseIfStatement(); - case 75 /* DoKeyword */: - return parseDoStatement(); - case 100 /* WhileKeyword */: - return parseWhileStatement(); - case 82 /* ForKeyword */: - return parseForOrForInOrForOfStatement(); - case 71 /* ContinueKeyword */: - return parseBreakOrContinueStatement(192 /* ContinueStatement */); - case 66 /* BreakKeyword */: - return parseBreakOrContinueStatement(193 /* BreakStatement */); - case 90 /* ReturnKeyword */: - return parseReturnStatement(); - case 101 /* WithKeyword */: - return parseWithStatement(); - case 92 /* SwitchKeyword */: - return parseSwitchStatement(); - case 94 /* ThrowKeyword */: - return parseThrowStatement(); - case 96 /* TryKeyword */: - // Include 'catch' and 'finally' for error recovery. - case 68 /* CatchKeyword */: - case 81 /* FinallyKeyword */: - return parseTryStatement(); - case 72 /* DebuggerKeyword */: - return parseDebuggerStatement(); - case 52 /* AtToken */: - return parseDeclaration(); - case 103 /* InterfaceKeyword */: - case 125 /* TypeKeyword */: - case 118 /* ModuleKeyword */: - case 119 /* NamespaceKeyword */: - case 115 /* DeclareKeyword */: - case 70 /* ConstKeyword */: - case 77 /* EnumKeyword */: - case 78 /* ExportKeyword */: - case 85 /* ImportKeyword */: - case 106 /* PrivateKeyword */: - case 107 /* ProtectedKeyword */: - case 108 /* PublicKeyword */: - case 109 /* StaticKeyword */: - if (isStartOfDeclaration()) { - return parseDeclaration(); - } - break; - } - return parseExpressionOrLabeledStatement(); - } - function parseDeclaration() { - var fullStart = getNodePos(); - var decorators = parseDecorators(); - var modifiers = parseModifiers(); - switch (token) { - case 98 /* VarKeyword */: - case 104 /* LetKeyword */: - case 70 /* ConstKeyword */: - return parseVariableStatement(fullStart, decorators, modifiers); - case 83 /* FunctionKeyword */: - return parseFunctionDeclaration(fullStart, decorators, modifiers); - case 69 /* ClassKeyword */: - return parseClassDeclaration(fullStart, decorators, modifiers); - case 103 /* InterfaceKeyword */: - return parseInterfaceDeclaration(fullStart, decorators, modifiers); - case 125 /* TypeKeyword */: - return parseTypeAliasDeclaration(fullStart, decorators, modifiers); - case 77 /* EnumKeyword */: - return parseEnumDeclaration(fullStart, decorators, modifiers); - case 118 /* ModuleKeyword */: - case 119 /* NamespaceKeyword */: - return parseModuleDeclaration(fullStart, decorators, modifiers); - case 85 /* ImportKeyword */: - return parseImportDeclarationOrImportEqualsDeclaration(fullStart, decorators, modifiers); - case 78 /* ExportKeyword */: - nextToken(); - return token === 73 /* DefaultKeyword */ || token === 53 /* EqualsToken */ ? - parseExportAssignment(fullStart, decorators, modifiers) : - parseExportDeclaration(fullStart, decorators, modifiers); - default: - if (decorators) { - // We reached this point because we encountered decorators and/or modifiers and assumed a declaration - // would follow. For recovery and error reporting purposes, return an incomplete declaration. - var node = createMissingNode(221 /* MissingDeclaration */, true, ts.Diagnostics.Declaration_expected); - node.pos = fullStart; - node.decorators = decorators; - setModifiers(node, modifiers); - return finishNode(node); - } - } - } - function nextTokenIsIdentifierOrStringLiteralOnSameLine() { - nextToken(); - return !scanner.hasPrecedingLineBreak() && (isIdentifier() || token === 8 /* StringLiteral */); - } - function parseFunctionBlockOrSemicolon(isGenerator, diagnosticMessage) { - if (token !== 14 /* OpenBraceToken */ && canParseSemicolon()) { - parseSemicolon(); - return; - } - return parseFunctionBlock(isGenerator, false, diagnosticMessage); - } - // DECLARATIONS - function parseArrayBindingElement() { - if (token === 23 /* CommaToken */) { - return createNode(178 /* OmittedExpression */); - } - var node = createNode(155 /* BindingElement */); - node.dotDotDotToken = parseOptionalToken(21 /* DotDotDotToken */); - node.name = parseIdentifierOrPattern(); - node.initializer = parseInitializer(false); - return finishNode(node); - } - function parseObjectBindingElement() { - var node = createNode(155 /* BindingElement */); - // TODO(andersh): Handle computed properties - var tokenIsIdentifier = isIdentifier(); - var propertyName = parsePropertyName(); - if (tokenIsIdentifier && token !== 51 /* ColonToken */) { - node.name = propertyName; - } - else { - parseExpected(51 /* ColonToken */); - node.propertyName = propertyName; - node.name = parseIdentifierOrPattern(); - } - node.initializer = parseInitializer(false); - return finishNode(node); - } - function parseObjectBindingPattern() { - var node = createNode(153 /* ObjectBindingPattern */); - parseExpected(14 /* OpenBraceToken */); - node.elements = parseDelimitedList(9 /* ObjectBindingElements */, parseObjectBindingElement); - parseExpected(15 /* CloseBraceToken */); - return finishNode(node); - } - function parseArrayBindingPattern() { - var node = createNode(154 /* ArrayBindingPattern */); - parseExpected(18 /* OpenBracketToken */); - node.elements = parseDelimitedList(10 /* ArrayBindingElements */, parseArrayBindingElement); - parseExpected(19 /* CloseBracketToken */); - return finishNode(node); - } - function isIdentifierOrPattern() { - return token === 14 /* OpenBraceToken */ || token === 18 /* OpenBracketToken */ || isIdentifier(); - } - function parseIdentifierOrPattern() { - if (token === 18 /* OpenBracketToken */) { - return parseArrayBindingPattern(); - } - if (token === 14 /* OpenBraceToken */) { - return parseObjectBindingPattern(); - } - return parseIdentifier(); - } - function parseVariableDeclaration() { - var node = createNode(201 /* VariableDeclaration */); - node.name = parseIdentifierOrPattern(); - node.type = parseTypeAnnotation(); - if (!isInOrOfKeyword(token)) { - node.initializer = parseInitializer(false); - } - return finishNode(node); - } - function parseVariableDeclarationList(inForStatementInitializer) { - var node = createNode(202 /* VariableDeclarationList */); - switch (token) { - case 98 /* VarKeyword */: - break; - case 104 /* LetKeyword */: - node.flags |= 4096 /* Let */; - break; - case 70 /* ConstKeyword */: - node.flags |= 8192 /* Const */; - break; - default: - ts.Debug.fail(); - } - nextToken(); - // The user may have written the following: - // - // for (let of X) { } - // - // In this case, we want to parse an empty declaration list, and then parse 'of' - // as a keyword. The reason this is not automatic is that 'of' is a valid identifier. - // So we need to look ahead to determine if 'of' should be treated as a keyword in - // this context. - // The checker will then give an error that there is an empty declaration list. - if (token === 127 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) { - node.declarations = createMissingList(); - } - else { - var savedDisallowIn = inDisallowInContext(); - setDisallowInContext(inForStatementInitializer); - node.declarations = parseDelimitedList(8 /* VariableDeclarations */, parseVariableDeclaration); - setDisallowInContext(savedDisallowIn); - } - return finishNode(node); - } - function canFollowContextualOfKeyword() { - return nextTokenIsIdentifier() && nextToken() === 17 /* CloseParenToken */; - } - function parseVariableStatement(fullStart, decorators, modifiers) { - var node = createNode(183 /* VariableStatement */, fullStart); - node.decorators = decorators; - setModifiers(node, modifiers); - node.declarationList = parseVariableDeclarationList(false); - parseSemicolon(); - return finishNode(node); - } - function parseFunctionDeclaration(fullStart, decorators, modifiers) { - var node = createNode(203 /* FunctionDeclaration */, fullStart); - node.decorators = decorators; - setModifiers(node, modifiers); - parseExpected(83 /* FunctionKeyword */); - node.asteriskToken = parseOptionalToken(35 /* AsteriskToken */); - node.name = node.flags & 256 /* Default */ ? parseOptionalIdentifier() : parseIdentifier(); - fillSignature(51 /* ColonToken */, !!node.asteriskToken, false, node); - node.body = parseFunctionBlockOrSemicolon(!!node.asteriskToken, ts.Diagnostics.or_expected); - return finishNode(node); - } - function parseConstructorDeclaration(pos, decorators, modifiers) { - var node = createNode(137 /* Constructor */, pos); - node.decorators = decorators; - setModifiers(node, modifiers); - parseExpected(114 /* ConstructorKeyword */); - fillSignature(51 /* ColonToken */, false, false, node); - node.body = parseFunctionBlockOrSemicolon(false, ts.Diagnostics.or_expected); - return finishNode(node); - } - function parseMethodDeclaration(fullStart, decorators, modifiers, asteriskToken, name, questionToken, diagnosticMessage) { - var method = createNode(136 /* MethodDeclaration */, fullStart); - method.decorators = decorators; - setModifiers(method, modifiers); - method.asteriskToken = asteriskToken; - method.name = name; - method.questionToken = questionToken; - fillSignature(51 /* ColonToken */, !!asteriskToken, false, method); - method.body = parseFunctionBlockOrSemicolon(!!asteriskToken, diagnosticMessage); - return finishNode(method); - } - function parsePropertyDeclaration(fullStart, decorators, modifiers, name, questionToken) { - var property = createNode(134 /* PropertyDeclaration */, fullStart); - property.decorators = decorators; - setModifiers(property, modifiers); - property.name = name; - property.questionToken = questionToken; - property.type = parseTypeAnnotation(); - // For instance properties specifically, since they are evaluated inside the constructor, - // we do *not * want to parse yield expressions, so we specifically turn the yield context - // off. The grammar would look something like this: - // - // MemberVariableDeclaration[Yield]: - // AccessibilityModifier_opt PropertyName TypeAnnotation_opt Initialiser_opt[In]; - // AccessibilityModifier_opt static_opt PropertyName TypeAnnotation_opt Initialiser_opt[In, ?Yield]; - // - // The checker may still error in the static case to explicitly disallow the yield expression. - property.initializer = modifiers && modifiers.flags & 128 /* Static */ - ? allowInAnd(parseNonParameterInitializer) - : doOutsideOfContext(4 /* Yield */ | 2 /* DisallowIn */, parseNonParameterInitializer); - parseSemicolon(); - return finishNode(property); - } - function parsePropertyOrMethodDeclaration(fullStart, decorators, modifiers) { - var asteriskToken = parseOptionalToken(35 /* AsteriskToken */); - var name = parsePropertyName(); - // Note: this is not legal as per the grammar. But we allow it in the parser and - // report an error in the grammar checker. - var questionToken = parseOptionalToken(50 /* QuestionToken */); - if (asteriskToken || token === 16 /* OpenParenToken */ || token === 24 /* LessThanToken */) { - return parseMethodDeclaration(fullStart, decorators, modifiers, asteriskToken, name, questionToken, ts.Diagnostics.or_expected); - } - else { - return parsePropertyDeclaration(fullStart, decorators, modifiers, name, questionToken); - } - } - function parseNonParameterInitializer() { - return parseInitializer(false); - } - function parseAccessorDeclaration(kind, fullStart, decorators, modifiers) { - var node = createNode(kind, fullStart); - node.decorators = decorators; - setModifiers(node, modifiers); - node.name = parsePropertyName(); - fillSignature(51 /* ColonToken */, false, false, node); - node.body = parseFunctionBlockOrSemicolon(false); - return finishNode(node); - } - function isClassMemberModifier(idToken) { - switch (idToken) { - case 108 /* PublicKeyword */: - case 106 /* PrivateKeyword */: - case 107 /* ProtectedKeyword */: - case 109 /* StaticKeyword */: - return true; - default: - return false; - } - } - function isClassMemberStart() { - var idToken; - if (token === 52 /* AtToken */) { - return true; - } - // Eat up all modifiers, but hold on to the last one in case it is actually an identifier. - while (ts.isModifier(token)) { - idToken = token; - // If the idToken is a class modifier (protected, private, public, and static), it is - // certain that we are starting to parse class member. This allows better error recovery - // Example: - // public foo() ... // true - // public @dec blah ... // true; we will then report an error later - // export public ... // true; we will then report an error later - if (isClassMemberModifier(idToken)) { - return true; - } - nextToken(); - } - if (token === 35 /* AsteriskToken */) { - return true; - } - // Try to get the first property-like token following all modifiers. - // This can either be an identifier or the 'get' or 'set' keywords. - if (isLiteralPropertyName()) { - idToken = token; - nextToken(); - } - // Index signatures and computed properties are class members; we can parse. - if (token === 18 /* OpenBracketToken */) { - return true; - } - // If we were able to get any potential identifier... - if (idToken !== undefined) { - // If we have a non-keyword identifier, or if we have an accessor, then it's safe to parse. - if (!ts.isKeyword(idToken) || idToken === 122 /* SetKeyword */ || idToken === 116 /* GetKeyword */) { - return true; - } - // If it *is* a keyword, but not an accessor, check a little farther along - // to see if it should actually be parsed as a class member. - switch (token) { - case 16 /* OpenParenToken */: // Method declaration - case 24 /* LessThanToken */: // Generic Method declaration - case 51 /* ColonToken */: // Type Annotation for declaration - case 53 /* EqualsToken */: // Initializer for declaration - case 50 /* QuestionToken */: - return true; - default: - // Covers - // - Semicolons (declaration termination) - // - Closing braces (end-of-class, must be declaration) - // - End-of-files (not valid, but permitted so that it gets caught later on) - // - Line-breaks (enabling *automatic semicolon insertion*) - return canParseSemicolon(); - } - } - return false; - } - function parseDecorators() { - var decorators; - while (true) { - var decoratorStart = getNodePos(); - if (!parseOptional(52 /* AtToken */)) { - break; - } - if (!decorators) { - decorators = []; - decorators.pos = scanner.getStartPos(); - } - var decorator = createNode(132 /* Decorator */, decoratorStart); - decorator.expression = doInDecoratorContext(parseLeftHandSideExpressionOrHigher); - decorators.push(finishNode(decorator)); - } - if (decorators) { - decorators.end = getNodeEnd(); - } - return decorators; - } - function parseModifiers() { - var flags = 0; - var modifiers; - while (true) { - var modifierStart = scanner.getStartPos(); - var modifierKind = token; - if (!parseAnyContextualModifier()) { - break; - } - if (!modifiers) { - modifiers = []; - modifiers.pos = modifierStart; - } - flags |= ts.modifierToFlag(modifierKind); - modifiers.push(finishNode(createNode(modifierKind, modifierStart))); - } - if (modifiers) { - modifiers.flags = flags; - modifiers.end = scanner.getStartPos(); - } - return modifiers; - } - function parseClassElement() { - if (token === 22 /* SemicolonToken */) { - var result = createNode(181 /* SemicolonClassElement */); - nextToken(); - return finishNode(result); - } - var fullStart = getNodePos(); - var decorators = parseDecorators(); - var modifiers = parseModifiers(); - var accessor = tryParseAccessorDeclaration(fullStart, decorators, modifiers); - if (accessor) { - return accessor; - } - if (token === 114 /* ConstructorKeyword */) { - return parseConstructorDeclaration(fullStart, decorators, modifiers); - } - if (isIndexSignature()) { - return parseIndexSignatureDeclaration(fullStart, decorators, modifiers); - } - // It is very important that we check this *after* checking indexers because - // the [ token can start an index signature or a computed property name - if (isIdentifierOrKeyword() || - token === 8 /* StringLiteral */ || - token === 7 /* NumericLiteral */ || - token === 35 /* AsteriskToken */ || - token === 18 /* OpenBracketToken */) { - return parsePropertyOrMethodDeclaration(fullStart, decorators, modifiers); - } - if (decorators) { - // treat this as a property declaration with a missing name. - var name_6 = createMissingNode(65 /* Identifier */, true, ts.Diagnostics.Declaration_expected); - return parsePropertyDeclaration(fullStart, decorators, modifiers, name_6, undefined); - } - // 'isClassMemberStart' should have hinted not to attempt parsing. - ts.Debug.fail("Should not have attempted to parse class member declaration."); - } - function parseClassExpression() { - return parseClassDeclarationOrExpression( - /*fullStart*/ scanner.getStartPos(), - /*decorators*/ undefined, - /*modifiers*/ undefined, 177 /* ClassExpression */); - } - function parseClassDeclaration(fullStart, decorators, modifiers) { - return parseClassDeclarationOrExpression(fullStart, decorators, modifiers, 204 /* ClassDeclaration */); - } - function parseClassDeclarationOrExpression(fullStart, decorators, modifiers, kind) { - // In ES6 specification, All parts of a ClassDeclaration or a ClassExpression are strict mode code - var savedStrictModeContext = inStrictModeContext(); - setStrictModeContext(true); - var node = createNode(kind, fullStart); - node.decorators = decorators; - setModifiers(node, modifiers); - parseExpected(69 /* ClassKeyword */); - node.name = parseOptionalIdentifier(); - node.typeParameters = parseTypeParameters(); - node.heritageClauses = parseHeritageClauses(true); - if (parseExpected(14 /* OpenBraceToken */)) { - // ClassTail[Yield,GeneratorParameter] : See 14.5 - // [~GeneratorParameter]ClassHeritage[?Yield]opt { ClassBody[?Yield]opt } - // [+GeneratorParameter] ClassHeritageopt { ClassBodyopt } - node.members = inGeneratorParameterContext() - ? doOutsideOfYieldContext(parseClassMembers) - : parseClassMembers(); - parseExpected(15 /* CloseBraceToken */); - } - else { - node.members = createMissingList(); - } - var finishedNode = finishNode(node); - setStrictModeContext(savedStrictModeContext); - return finishedNode; - } - function parseHeritageClauses(isClassHeritageClause) { - // ClassTail[Yield,GeneratorParameter] : See 14.5 - // [~GeneratorParameter]ClassHeritage[?Yield]opt { ClassBody[?Yield]opt } - // [+GeneratorParameter] ClassHeritageopt { ClassBodyopt } - if (isHeritageClause()) { - return isClassHeritageClause && inGeneratorParameterContext() - ? doOutsideOfYieldContext(parseHeritageClausesWorker) - : parseHeritageClausesWorker(); - } - return undefined; - } - function parseHeritageClausesWorker() { - return parseList(18 /* HeritageClauses */, false, parseHeritageClause); - } - function parseHeritageClause() { - if (token === 79 /* ExtendsKeyword */ || token === 102 /* ImplementsKeyword */) { - var node = createNode(225 /* HeritageClause */); - node.token = token; - nextToken(); - node.types = parseDelimitedList(7 /* HeritageClauseElement */, parseExpressionWithTypeArguments); - return finishNode(node); - } - return undefined; - } - function parseExpressionWithTypeArguments() { - var node = createNode(179 /* ExpressionWithTypeArguments */); - node.expression = parseLeftHandSideExpressionOrHigher(); - if (token === 24 /* LessThanToken */) { - node.typeArguments = parseBracketedList(16 /* TypeArguments */, parseType, 24 /* LessThanToken */, 25 /* GreaterThanToken */); - } - return finishNode(node); - } - function isHeritageClause() { - return token === 79 /* ExtendsKeyword */ || token === 102 /* ImplementsKeyword */; - } - function parseClassMembers() { - return parseList(5 /* ClassMembers */, false, parseClassElement); - } - function parseInterfaceDeclaration(fullStart, decorators, modifiers) { - var node = createNode(205 /* InterfaceDeclaration */, fullStart); - node.decorators = decorators; - setModifiers(node, modifiers); - parseExpected(103 /* InterfaceKeyword */); - node.name = parseIdentifier(); - node.typeParameters = parseTypeParameters(); - node.heritageClauses = parseHeritageClauses(false); - node.members = parseObjectTypeMembers(); - return finishNode(node); - } - function parseTypeAliasDeclaration(fullStart, decorators, modifiers) { - var node = createNode(206 /* TypeAliasDeclaration */, fullStart); - node.decorators = decorators; - setModifiers(node, modifiers); - parseExpected(125 /* TypeKeyword */); - node.name = parseIdentifier(); - node.typeParameters = parseTypeParameters(); - parseExpected(53 /* EqualsToken */); - node.type = parseType(); - parseSemicolon(); - return finishNode(node); - } - // In an ambient declaration, the grammar only allows integer literals as initializers. - // In a non-ambient declaration, the grammar allows uninitialized members only in a - // ConstantEnumMemberSection, which starts at the beginning of an enum declaration - // or any time an integer literal initializer is encountered. - function parseEnumMember() { - var node = createNode(229 /* EnumMember */, scanner.getStartPos()); - node.name = parsePropertyName(); - node.initializer = allowInAnd(parseNonParameterInitializer); - return finishNode(node); - } - function parseEnumDeclaration(fullStart, decorators, modifiers) { - var node = createNode(207 /* EnumDeclaration */, fullStart); - node.decorators = decorators; - setModifiers(node, modifiers); - parseExpected(77 /* EnumKeyword */); - node.name = parseIdentifier(); - if (parseExpected(14 /* OpenBraceToken */)) { - node.members = parseDelimitedList(6 /* EnumMembers */, parseEnumMember); - parseExpected(15 /* CloseBraceToken */); - } - else { - node.members = createMissingList(); - } - return finishNode(node); - } - function parseModuleBlock() { - var node = createNode(209 /* ModuleBlock */, scanner.getStartPos()); - if (parseExpected(14 /* OpenBraceToken */)) { - node.statements = parseList(1 /* BlockStatements */, false, parseStatement); - parseExpected(15 /* CloseBraceToken */); - } - else { - node.statements = createMissingList(); - } - return finishNode(node); - } - function parseModuleOrNamespaceDeclaration(fullStart, decorators, modifiers, flags) { - var node = createNode(208 /* ModuleDeclaration */, fullStart); - node.decorators = decorators; - setModifiers(node, modifiers); - node.flags |= flags; - node.name = parseIdentifier(); - node.body = parseOptional(20 /* DotToken */) - ? parseModuleOrNamespaceDeclaration(getNodePos(), undefined, undefined, 1 /* Export */) - : parseModuleBlock(); - return finishNode(node); - } - function parseAmbientExternalModuleDeclaration(fullStart, decorators, modifiers) { - var node = createNode(208 /* ModuleDeclaration */, fullStart); - node.decorators = decorators; - setModifiers(node, modifiers); - node.name = parseLiteralNode(true); - node.body = parseModuleBlock(); - return finishNode(node); - } - function parseModuleDeclaration(fullStart, decorators, modifiers) { - var flags = modifiers ? modifiers.flags : 0; - if (parseOptional(119 /* NamespaceKeyword */)) { - flags |= 32768 /* Namespace */; - } - else { - parseExpected(118 /* ModuleKeyword */); - if (token === 8 /* StringLiteral */) { - return parseAmbientExternalModuleDeclaration(fullStart, decorators, modifiers); - } - } - return parseModuleOrNamespaceDeclaration(fullStart, decorators, modifiers, flags); - } - function isExternalModuleReference() { - return token === 120 /* RequireKeyword */ && - lookAhead(nextTokenIsOpenParen); - } - function nextTokenIsOpenParen() { - return nextToken() === 16 /* OpenParenToken */; - } - function nextTokenIsCommaOrFromKeyword() { - nextToken(); - return token === 23 /* CommaToken */ || - token === 126 /* FromKeyword */; - } - function parseImportDeclarationOrImportEqualsDeclaration(fullStart, decorators, modifiers) { - parseExpected(85 /* ImportKeyword */); - var afterImportPos = scanner.getStartPos(); - var identifier; - if (isIdentifier()) { - identifier = parseIdentifier(); - if (token !== 23 /* CommaToken */ && token !== 126 /* FromKeyword */) { - // ImportEquals declaration of type: - // import x = require("mod"); or - // import x = M.x; - var importEqualsDeclaration = createNode(211 /* ImportEqualsDeclaration */, fullStart); - importEqualsDeclaration.decorators = decorators; - setModifiers(importEqualsDeclaration, modifiers); - importEqualsDeclaration.name = identifier; - parseExpected(53 /* EqualsToken */); - importEqualsDeclaration.moduleReference = parseModuleReference(); - parseSemicolon(); - return finishNode(importEqualsDeclaration); - } - } - // Import statement - var importDeclaration = createNode(212 /* ImportDeclaration */, fullStart); - importDeclaration.decorators = decorators; - setModifiers(importDeclaration, modifiers); - // ImportDeclaration: - // import ImportClause from ModuleSpecifier ; - // import ModuleSpecifier; - if (identifier || - token === 35 /* AsteriskToken */ || - token === 14 /* OpenBraceToken */) { - importDeclaration.importClause = parseImportClause(identifier, afterImportPos); - parseExpected(126 /* FromKeyword */); - } - importDeclaration.moduleSpecifier = parseModuleSpecifier(); - parseSemicolon(); - return finishNode(importDeclaration); - } - function parseImportClause(identifier, fullStart) { - //ImportClause: - // ImportedDefaultBinding - // NameSpaceImport - // NamedImports - // ImportedDefaultBinding, NameSpaceImport - // ImportedDefaultBinding, NamedImports - var importClause = createNode(213 /* ImportClause */, fullStart); - if (identifier) { - // ImportedDefaultBinding: - // ImportedBinding - importClause.name = identifier; - } - // If there was no default import or if there is comma token after default import - // parse namespace or named imports - if (!importClause.name || - parseOptional(23 /* CommaToken */)) { - importClause.namedBindings = token === 35 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(215 /* NamedImports */); - } - return finishNode(importClause); - } - function parseModuleReference() { - return isExternalModuleReference() - ? parseExternalModuleReference() - : parseEntityName(false); - } - function parseExternalModuleReference() { - var node = createNode(222 /* ExternalModuleReference */); - parseExpected(120 /* RequireKeyword */); - parseExpected(16 /* OpenParenToken */); - node.expression = parseModuleSpecifier(); - parseExpected(17 /* CloseParenToken */); - return finishNode(node); - } - function parseModuleSpecifier() { - // We allow arbitrary expressions here, even though the grammar only allows string - // literals. We check to ensure that it is only a string literal later in the grammar - // walker. - var result = parseExpression(); - // Ensure the string being required is in our 'identifier' table. This will ensure - // that features like 'find refs' will look inside this file when search for its name. - if (result.kind === 8 /* StringLiteral */) { - internIdentifier(result.text); - } - return result; - } - function parseNamespaceImport() { - // NameSpaceImport: - // * as ImportedBinding - var namespaceImport = createNode(214 /* NamespaceImport */); - parseExpected(35 /* AsteriskToken */); - parseExpected(111 /* AsKeyword */); - namespaceImport.name = parseIdentifier(); - return finishNode(namespaceImport); - } - function parseNamedImportsOrExports(kind) { - var node = createNode(kind); - // NamedImports: - // { } - // { ImportsList } - // { ImportsList, } - // ImportsList: - // ImportSpecifier - // ImportsList, ImportSpecifier - node.elements = parseBracketedList(19 /* ImportOrExportSpecifiers */, kind === 215 /* NamedImports */ ? parseImportSpecifier : parseExportSpecifier, 14 /* OpenBraceToken */, 15 /* CloseBraceToken */); - return finishNode(node); - } - function parseExportSpecifier() { - return parseImportOrExportSpecifier(220 /* ExportSpecifier */); - } - function parseImportSpecifier() { - return parseImportOrExportSpecifier(216 /* ImportSpecifier */); - } - function parseImportOrExportSpecifier(kind) { - var node = createNode(kind); - // ImportSpecifier: - // BindingIdentifier - // IdentifierName as BindingIdentifier - // ExportSpecififer: - // IdentifierName - // IdentifierName as IdentifierName - var checkIdentifierIsKeyword = ts.isKeyword(token) && !isIdentifier(); - var checkIdentifierStart = scanner.getTokenPos(); - var checkIdentifierEnd = scanner.getTextPos(); - var identifierName = parseIdentifierName(); - if (token === 111 /* AsKeyword */) { - node.propertyName = identifierName; - parseExpected(111 /* AsKeyword */); - checkIdentifierIsKeyword = ts.isKeyword(token) && !isIdentifier(); - checkIdentifierStart = scanner.getTokenPos(); - checkIdentifierEnd = scanner.getTextPos(); - node.name = parseIdentifierName(); - } - else { - node.name = identifierName; - } - if (kind === 216 /* ImportSpecifier */ && checkIdentifierIsKeyword) { - // Report error identifier expected - parseErrorAtPosition(checkIdentifierStart, checkIdentifierEnd - checkIdentifierStart, ts.Diagnostics.Identifier_expected); - } - return finishNode(node); - } - function parseExportDeclaration(fullStart, decorators, modifiers) { - var node = createNode(218 /* ExportDeclaration */, fullStart); - node.decorators = decorators; - setModifiers(node, modifiers); - if (parseOptional(35 /* AsteriskToken */)) { - parseExpected(126 /* FromKeyword */); - node.moduleSpecifier = parseModuleSpecifier(); - } - else { - node.exportClause = parseNamedImportsOrExports(219 /* NamedExports */); - if (parseOptional(126 /* FromKeyword */)) { - node.moduleSpecifier = parseModuleSpecifier(); - } - } - parseSemicolon(); - return finishNode(node); - } - function parseExportAssignment(fullStart, decorators, modifiers) { - var node = createNode(217 /* ExportAssignment */, fullStart); - node.decorators = decorators; - setModifiers(node, modifiers); - if (parseOptional(53 /* EqualsToken */)) { - node.isExportEquals = true; - } - else { - parseExpected(73 /* DefaultKeyword */); - } - node.expression = parseAssignmentExpressionOrHigher(); - parseSemicolon(); - return finishNode(node); - } - function processReferenceComments(sourceFile) { - var triviaScanner = ts.createScanner(sourceFile.languageVersion, false, sourceText); - var referencedFiles = []; - var amdDependencies = []; - var amdModuleName; - // Keep scanning all the leading trivia in the file until we get to something that - // isn't trivia. Any single line comment will be analyzed to see if it is a - // reference comment. - while (true) { - var kind = triviaScanner.scan(); - if (kind === 5 /* WhitespaceTrivia */ || kind === 4 /* NewLineTrivia */ || kind === 3 /* MultiLineCommentTrivia */) { - continue; - } - if (kind !== 2 /* SingleLineCommentTrivia */) { - break; - } - var range = { pos: triviaScanner.getTokenPos(), end: triviaScanner.getTextPos(), kind: triviaScanner.getToken() }; - var comment = sourceText.substring(range.pos, range.end); - var referencePathMatchResult = ts.getFileReferenceFromReferencePath(comment, range); - if (referencePathMatchResult) { - var fileReference = referencePathMatchResult.fileReference; - sourceFile.hasNoDefaultLib = referencePathMatchResult.isNoDefaultLib; - var diagnosticMessage = referencePathMatchResult.diagnosticMessage; - if (fileReference) { - referencedFiles.push(fileReference); - } - if (diagnosticMessage) { - parseDiagnostics.push(ts.createFileDiagnostic(sourceFile, range.pos, range.end - range.pos, diagnosticMessage)); - } - } - else { - var amdModuleNameRegEx = /^\/\/\/\s*".length; - return parseErrorAtPosition(start, end - start, ts.Diagnostics.Type_argument_list_cannot_be_empty); - } - } - function parseQualifiedName(left) { - var result = createNode(128 /* QualifiedName */, left.pos); - result.left = left; - result.right = parseIdentifierName(); - return finishNode(result); - } - function parseJSDocRecordType() { - var result = createNode(239 /* JSDocRecordType */); - nextToken(); - result.members = parseDelimitedList(22 /* JSDocRecordMembers */, parseJSDocRecordMember); - checkForTrailingComma(result.members); - parseExpected(15 /* CloseBraceToken */); - return finishNode(result); - } - function parseJSDocRecordMember() { - var result = createNode(240 /* JSDocRecordMember */); - result.name = parseSimplePropertyName(); - if (token === 51 /* ColonToken */) { - nextToken(); - result.type = parseJSDocType(); - } - return finishNode(result); - } - function parseJSDocNonNullableType() { - var result = createNode(238 /* JSDocNonNullableType */); - nextToken(); - result.type = parseJSDocType(); - return finishNode(result); - } - function parseJSDocTupleType() { - var result = createNode(236 /* JSDocTupleType */); - nextToken(); - result.types = parseDelimitedList(23 /* JSDocTupleTypes */, parseJSDocType); - checkForTrailingComma(result.types); - parseExpected(19 /* CloseBracketToken */); - return finishNode(result); - } - function checkForTrailingComma(list) { - if (parseDiagnostics.length === 0 && list.hasTrailingComma) { - var start = list.end - ",".length; - parseErrorAtPosition(start, ",".length, ts.Diagnostics.Trailing_comma_not_allowed); - } - } - function parseJSDocUnionType() { - var result = createNode(235 /* JSDocUnionType */); - nextToken(); - result.types = parseJSDocTypeList(parseJSDocType()); - parseExpected(17 /* CloseParenToken */); - return finishNode(result); - } - function parseJSDocTypeList(firstType) { - ts.Debug.assert(!!firstType); - var types = []; - types.pos = firstType.pos; - types.push(firstType); - while (parseOptional(44 /* BarToken */)) { - types.push(parseJSDocType()); - } - types.end = scanner.getStartPos(); - return types; - } - function parseJSDocAllType() { - var result = createNode(232 /* JSDocAllType */); - nextToken(); - return finishNode(result); - } - function parseJSDocUnknownOrNullableType() { - var pos = scanner.getStartPos(); - // skip the ? - nextToken(); - // Need to lookahead to decide if this is a nullable or unknown type. - // Here are cases where we'll pick the unknown type: - // - // Foo(?, - // { a: ? } - // Foo(?) - // Foo - // Foo(?= - // (?| - if (token === 23 /* CommaToken */ || - token === 15 /* CloseBraceToken */ || - token === 17 /* CloseParenToken */ || - token === 25 /* GreaterThanToken */ || - token === 53 /* EqualsToken */ || - token === 44 /* BarToken */) { - var result = createNode(233 /* JSDocUnknownType */, pos); - return finishNode(result); - } - else { - var result = createNode(237 /* JSDocNullableType */, pos); - result.type = parseJSDocType(); - return finishNode(result); - } - } - function parseIsolatedJSDocComment(content, start, length) { - initializeState("file.js", content, 2 /* Latest */, undefined); - var jsDocComment = parseJSDocComment(undefined, start, length); - var diagnostics = parseDiagnostics; - clearState(); - return jsDocComment ? { jsDocComment: jsDocComment, diagnostics: diagnostics } : undefined; - } - JSDocParser.parseIsolatedJSDocComment = parseIsolatedJSDocComment; - function parseJSDocComment(parent, start, length) { - var comment = parseJSDocCommentWorker(start, length); - if (comment) { - fixupParentReferences(comment); - comment.parent = parent; - } - return comment; - } - JSDocParser.parseJSDocComment = parseJSDocComment; - function parseJSDocCommentWorker(start, length) { - var content = sourceText; - start = start || 0; - var end = length === undefined ? content.length : start + length; - length = end - start; - ts.Debug.assert(start >= 0); - ts.Debug.assert(start <= end); - ts.Debug.assert(end <= content.length); - var tags; - var pos; - // NOTE(cyrusn): This is essentially a handwritten scanner for JSDocComments. I - // considered using an actual Scanner, but this would complicate things. The - // scanner would need to know it was in a Doc Comment. Otherwise, it would then - // produce comments *inside* the doc comment. In the end it was just easier to - // write a simple scanner rather than go that route. - if (length >= "/** */".length) { - if (content.charCodeAt(start) === 47 /* slash */ && - content.charCodeAt(start + 1) === 42 /* asterisk */ && - content.charCodeAt(start + 2) === 42 /* asterisk */ && - content.charCodeAt(start + 3) !== 42 /* asterisk */) { - // Initially we can parse out a tag. We also have seen a starting asterisk. - // This is so that /** * @type */ doesn't parse. - var canParseTag = true; - var seenAsterisk = true; - for (pos = start + "/**".length; pos < end;) { - var ch = content.charCodeAt(pos); - pos++; - if (ch === 64 /* at */ && canParseTag) { - parseTag(); - // Once we parse out a tag, we cannot keep parsing out tags on this line. - canParseTag = false; - continue; - } - if (ts.isLineBreak(ch)) { - // After a line break, we can parse a tag, and we haven't seen as asterisk - // on the next line yet. - canParseTag = true; - seenAsterisk = false; - continue; - } - if (ts.isWhiteSpace(ch)) { - // Whitespace doesn't affect any of our parsing. - continue; - } - // Ignore the first asterisk on a line. - if (ch === 42 /* asterisk */) { - if (seenAsterisk) { - // If we've already seen an asterisk, then we can no longer parse a tag - // on this line. - canParseTag = false; - } - seenAsterisk = true; - continue; - } - // Anything else is doc comment text. We can't do anything with it. Because it - // wasn't a tag, we can no longer parse a tag on this line until we hit the next - // line break. - canParseTag = false; - } - } - } - return createJSDocComment(); - function createJSDocComment() { - if (!tags) { - return undefined; - } - var result = createNode(247 /* JSDocComment */, start); - result.tags = tags; - return finishNode(result, end); - } - function skipWhitespace() { - while (pos < end && ts.isWhiteSpace(content.charCodeAt(pos))) { - pos++; - } - } - function parseTag() { - ts.Debug.assert(content.charCodeAt(pos - 1) === 64 /* at */); - var atToken = createNode(52 /* AtToken */, pos - 1); - atToken.end = pos; - var startPos = pos; - var tagName = scanIdentifier(); - if (!tagName) { - return; - } - var tag = handleTag(atToken, tagName) || handleUnknownTag(atToken, tagName); - addTag(tag); - } - function handleTag(atToken, tagName) { - if (tagName) { - switch (tagName.text) { - case "param": - return handleParamTag(atToken, tagName); - case "return": - case "returns": - return handleReturnTag(atToken, tagName); - case "template": - return handleTemplateTag(atToken, tagName); - case "type": - return handleTypeTag(atToken, tagName); - } - } - return undefined; - } - function handleUnknownTag(atToken, tagName) { - var result = createNode(248 /* JSDocTag */, atToken.pos); - result.atToken = atToken; - result.tagName = tagName; - return finishNode(result, pos); - } - function addTag(tag) { - if (tag) { - if (!tags) { - tags = []; - tags.pos = tag.pos; - } - tags.push(tag); - tags.end = tag.end; - } - } - function tryParseTypeExpression() { - skipWhitespace(); - if (content.charCodeAt(pos) !== 123 /* openBrace */) { - return undefined; - } - var typeExpression = parseJSDocTypeExpression(pos, end - pos); - pos = typeExpression.end; - return typeExpression; - } - function handleParamTag(atToken, tagName) { - var typeExpression = tryParseTypeExpression(); - skipWhitespace(); - var name; - var isBracketed; - if (content.charCodeAt(pos) === 91 /* openBracket */) { - pos++; - skipWhitespace(); - name = scanIdentifier(); - isBracketed = true; - } - else { - name = scanIdentifier(); - } - if (!name) { - parseErrorAtPosition(pos, 0, ts.Diagnostics.Identifier_expected); - return undefined; - } - var preName, postName; - if (typeExpression) { - postName = name; - } - else { - preName = name; - } - if (!typeExpression) { - typeExpression = tryParseTypeExpression(); - } - var result = createNode(249 /* JSDocParameterTag */, atToken.pos); - result.atToken = atToken; - result.tagName = tagName; - result.preParameterName = preName; - result.typeExpression = typeExpression; - result.postParameterName = postName; - result.isBracketed = isBracketed; - return finishNode(result, pos); - } - function handleReturnTag(atToken, tagName) { - if (ts.forEach(tags, function (t) { return t.kind === 250 /* JSDocReturnTag */; })) { - parseErrorAtPosition(tagName.pos, pos - tagName.pos, ts.Diagnostics._0_tag_already_specified, tagName.text); - } - var result = createNode(250 /* JSDocReturnTag */, atToken.pos); - result.atToken = atToken; - result.tagName = tagName; - result.typeExpression = tryParseTypeExpression(); - return finishNode(result, pos); - } - function handleTypeTag(atToken, tagName) { - if (ts.forEach(tags, function (t) { return t.kind === 251 /* JSDocTypeTag */; })) { - parseErrorAtPosition(tagName.pos, pos - tagName.pos, ts.Diagnostics._0_tag_already_specified, tagName.text); - } - var result = createNode(251 /* JSDocTypeTag */, atToken.pos); - result.atToken = atToken; - result.tagName = tagName; - result.typeExpression = tryParseTypeExpression(); - return finishNode(result, pos); - } - function handleTemplateTag(atToken, tagName) { - if (ts.forEach(tags, function (t) { return t.kind === 252 /* JSDocTemplateTag */; })) { - parseErrorAtPosition(tagName.pos, pos - tagName.pos, ts.Diagnostics._0_tag_already_specified, tagName.text); - } - var typeParameters = []; - typeParameters.pos = pos; - while (true) { - skipWhitespace(); - var startPos = pos; - var name_7 = scanIdentifier(); - if (!name_7) { - parseErrorAtPosition(startPos, 0, ts.Diagnostics.Identifier_expected); - return undefined; - } - var typeParameter = createNode(130 /* TypeParameter */, name_7.pos); - typeParameter.name = name_7; - finishNode(typeParameter, pos); - typeParameters.push(typeParameter); - skipWhitespace(); - if (content.charCodeAt(pos) !== 44 /* comma */) { - break; - } - pos++; - } - typeParameters.end = pos; - var result = createNode(252 /* JSDocTemplateTag */, atToken.pos); - result.atToken = atToken; - result.tagName = tagName; - result.typeParameters = typeParameters; - return finishNode(result, pos); - } - function scanIdentifier() { - var startPos = pos; - for (; pos < end; pos++) { - var ch = content.charCodeAt(pos); - if (pos === startPos && ts.isIdentifierStart(ch, 2 /* Latest */)) { - continue; - } - else if (pos > startPos && ts.isIdentifierPart(ch, 2 /* Latest */)) { - continue; - } - break; - } - if (startPos === pos) { - return undefined; - } - var result = createNode(65 /* Identifier */, startPos); - result.text = content.substring(startPos, pos); - return finishNode(result, pos); - } - } - JSDocParser.parseJSDocCommentWorker = parseJSDocCommentWorker; - })(JSDocParser = Parser.JSDocParser || (Parser.JSDocParser = {})); - })(Parser || (Parser = {})); - var IncrementalParser; - (function (IncrementalParser) { - function updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks) { - aggressiveChecks = aggressiveChecks || ts.Debug.shouldAssert(2 /* Aggressive */); - checkChangeRange(sourceFile, newText, textChangeRange, aggressiveChecks); - if (ts.textChangeRangeIsUnchanged(textChangeRange)) { - // if the text didn't change, then we can just return our current source file as-is. - return sourceFile; - } - if (sourceFile.statements.length === 0) { - // If we don't have any statements in the current source file, then there's no real - // way to incrementally parse. So just do a full parse instead. - return Parser.parseSourceFile(sourceFile.fileName, newText, sourceFile.languageVersion, undefined, true); - } - // Make sure we're not trying to incrementally update a source file more than once. Once - // we do an update the original source file is considered unusbale from that point onwards. - // - // This is because we do incremental parsing in-place. i.e. we take nodes from the old - // tree and give them new positions and parents. From that point on, trusting the old - // tree at all is not possible as far too much of it may violate invariants. - var incrementalSourceFile = sourceFile; - ts.Debug.assert(!incrementalSourceFile.hasBeenIncrementallyParsed); - incrementalSourceFile.hasBeenIncrementallyParsed = true; - var oldText = sourceFile.text; - var syntaxCursor = createSyntaxCursor(sourceFile); - // Make the actual change larger so that we know to reparse anything whose lookahead - // might have intersected the change. - var changeRange = extendToAffectedRange(sourceFile, textChangeRange); - checkChangeRange(sourceFile, newText, changeRange, aggressiveChecks); - // Ensure that extending the affected range only moved the start of the change range - // earlier in the file. - ts.Debug.assert(changeRange.span.start <= textChangeRange.span.start); - ts.Debug.assert(ts.textSpanEnd(changeRange.span) === ts.textSpanEnd(textChangeRange.span)); - ts.Debug.assert(ts.textSpanEnd(ts.textChangeRangeNewSpan(changeRange)) === ts.textSpanEnd(ts.textChangeRangeNewSpan(textChangeRange))); - // The is the amount the nodes after the edit range need to be adjusted. It can be - // positive (if the edit added characters), negative (if the edit deleted characters) - // or zero (if this was a pure overwrite with nothing added/removed). - var delta = ts.textChangeRangeNewSpan(changeRange).length - changeRange.span.length; - // If we added or removed characters during the edit, then we need to go and adjust all - // the nodes after the edit. Those nodes may move forward (if we inserted chars) or they - // may move backward (if we deleted chars). - // - // Doing this helps us out in two ways. First, it means that any nodes/tokens we want - // to reuse are already at the appropriate position in the new text. That way when we - // reuse them, we don't have to figure out if they need to be adjusted. Second, it makes - // it very easy to determine if we can reuse a node. If the node's position is at where - // we are in the text, then we can reuse it. Otherwise we can't. If the node's position - // is ahead of us, then we'll need to rescan tokens. If the node's position is behind - // us, then we'll need to skip it or crumble it as appropriate - // - // We will also adjust the positions of nodes that intersect the change range as well. - // By doing this, we ensure that all the positions in the old tree are consistent, not - // just the positions of nodes entirely before/after the change range. By being - // consistent, we can then easily map from positions to nodes in the old tree easily. - // - // Also, mark any syntax elements that intersect the changed span. We know, up front, - // that we cannot reuse these elements. - updateTokenPositionsAndMarkElements(incrementalSourceFile, changeRange.span.start, ts.textSpanEnd(changeRange.span), ts.textSpanEnd(ts.textChangeRangeNewSpan(changeRange)), delta, oldText, newText, aggressiveChecks); - // Now that we've set up our internal incremental state just proceed and parse the - // source file in the normal fashion. When possible the parser will retrieve and - // reuse nodes from the old tree. - // - // Note: passing in 'true' for setNodeParents is very important. When incrementally - // parsing, we will be reusing nodes from the old tree, and placing it into new - // parents. If we don't set the parents now, we'll end up with an observably - // inconsistent tree. Setting the parents on the new tree should be very fast. We - // will immediately bail out of walking any subtrees when we can see that their parents - // are already correct. - var result = Parser.parseSourceFile(sourceFile.fileName, newText, sourceFile.languageVersion, syntaxCursor, true); - return result; - } - IncrementalParser.updateSourceFile = updateSourceFile; - function moveElementEntirelyPastChangeRange(element, isArray, delta, oldText, newText, aggressiveChecks) { - if (isArray) { - visitArray(element); - } - else { - visitNode(element); - } - return; - function visitNode(node) { - if (aggressiveChecks && shouldCheckNode(node)) { - var text = oldText.substring(node.pos, node.end); - } - // Ditch any existing LS children we may have created. This way we can avoid - // moving them forward. - if (node._children) { - node._children = undefined; - } - if (node.jsDocComment) { - node.jsDocComment = undefined; - } - node.pos += delta; - node.end += delta; - if (aggressiveChecks && shouldCheckNode(node)) { - ts.Debug.assert(text === newText.substring(node.pos, node.end)); - } - forEachChild(node, visitNode, visitArray); - checkNodePositions(node, aggressiveChecks); - } - function visitArray(array) { - array._children = undefined; - array.pos += delta; - array.end += delta; - for (var _i = 0; _i < array.length; _i++) { - var node = array[_i]; - visitNode(node); - } - } - } - function shouldCheckNode(node) { - switch (node.kind) { - case 8 /* StringLiteral */: - case 7 /* NumericLiteral */: - case 65 /* Identifier */: - return true; - } - return false; - } - function adjustIntersectingElement(element, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta) { - ts.Debug.assert(element.end >= changeStart, "Adjusting an element that was entirely before the change range"); - ts.Debug.assert(element.pos <= changeRangeOldEnd, "Adjusting an element that was entirely after the change range"); - ts.Debug.assert(element.pos <= element.end); - // We have an element that intersects the change range in some way. It may have its - // start, or its end (or both) in the changed range. We want to adjust any part - // that intersects such that the final tree is in a consistent state. i.e. all - // chlidren have spans within the span of their parent, and all siblings are ordered - // properly. - // We may need to update both the 'pos' and the 'end' of the element. - // If the 'pos' is before the start of the change, then we don't need to touch it. - // If it isn't, then the 'pos' must be inside the change. How we update it will - // depend if delta is positive or negative. If delta is positive then we have - // something like: - // - // -------------------AAA----------------- - // -------------------BBBCCCCCCC----------------- - // - // In this case, we consider any node that started in the change range to still be - // starting at the same position. - // - // however, if the delta is negative, then we instead have something like this: - // - // -------------------XXXYYYYYYY----------------- - // -------------------ZZZ----------------- - // - // In this case, any element that started in the 'X' range will keep its position. - // However any element htat started after that will have their pos adjusted to be - // at the end of the new range. i.e. any node that started in the 'Y' range will - // be adjusted to have their start at the end of the 'Z' range. - // - // The element will keep its position if possible. Or Move backward to the new-end - // if it's in the 'Y' range. - element.pos = Math.min(element.pos, changeRangeNewEnd); - // If the 'end' is after the change range, then we always adjust it by the delta - // amount. However, if the end is in the change range, then how we adjust it - // will depend on if delta is positive or negative. If delta is positive then we - // have something like: - // - // -------------------AAA----------------- - // -------------------BBBCCCCCCC----------------- - // - // In this case, we consider any node that ended inside the change range to keep its - // end position. - // - // however, if the delta is negative, then we instead have something like this: - // - // -------------------XXXYYYYYYY----------------- - // -------------------ZZZ----------------- - // - // In this case, any element that ended in the 'X' range will keep its position. - // However any element htat ended after that will have their pos adjusted to be - // at the end of the new range. i.e. any node that ended in the 'Y' range will - // be adjusted to have their end at the end of the 'Z' range. - if (element.end >= changeRangeOldEnd) { - // Element ends after the change range. Always adjust the end pos. - element.end += delta; - } - else { - // Element ends in the change range. The element will keep its position if - // possible. Or Move backward to the new-end if it's in the 'Y' range. - element.end = Math.min(element.end, changeRangeNewEnd); - } - ts.Debug.assert(element.pos <= element.end); - if (element.parent) { - ts.Debug.assert(element.pos >= element.parent.pos); - ts.Debug.assert(element.end <= element.parent.end); - } - } - function checkNodePositions(node, aggressiveChecks) { - if (aggressiveChecks) { - var pos = node.pos; - forEachChild(node, function (child) { - ts.Debug.assert(child.pos >= pos); - pos = child.end; - }); - ts.Debug.assert(pos <= node.end); - } - } - function updateTokenPositionsAndMarkElements(sourceFile, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta, oldText, newText, aggressiveChecks) { - visitNode(sourceFile); - return; - function visitNode(child) { - ts.Debug.assert(child.pos <= child.end); - if (child.pos > changeRangeOldEnd) { - // Node is entirely past the change range. We need to move both its pos and - // end, forward or backward appropriately. - moveElementEntirelyPastChangeRange(child, false, delta, oldText, newText, aggressiveChecks); - return; - } - // Check if the element intersects the change range. If it does, then it is not - // reusable. Also, we'll need to recurse to see what constituent portions we may - // be able to use. - var fullEnd = child.end; - if (fullEnd >= changeStart) { - child.intersectsChange = true; - child._children = undefined; - // Adjust the pos or end (or both) of the intersecting element accordingly. - adjustIntersectingElement(child, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta); - forEachChild(child, visitNode, visitArray); - checkNodePositions(child, aggressiveChecks); - return; - } - // Otherwise, the node is entirely before the change range. No need to do anything with it. - ts.Debug.assert(fullEnd < changeStart); - } - function visitArray(array) { - ts.Debug.assert(array.pos <= array.end); - if (array.pos > changeRangeOldEnd) { - // Array is entirely after the change range. We need to move it, and move any of - // its children. - moveElementEntirelyPastChangeRange(array, true, delta, oldText, newText, aggressiveChecks); - return; - } - // Check if the element intersects the change range. If it does, then it is not - // reusable. Also, we'll need to recurse to see what constituent portions we may - // be able to use. - var fullEnd = array.end; - if (fullEnd >= changeStart) { - array.intersectsChange = true; - array._children = undefined; - // Adjust the pos or end (or both) of the intersecting array accordingly. - adjustIntersectingElement(array, changeStart, changeRangeOldEnd, changeRangeNewEnd, delta); - for (var _i = 0; _i < array.length; _i++) { - var node = array[_i]; - visitNode(node); - } - return; - } - // Otherwise, the array is entirely before the change range. No need to do anything with it. - ts.Debug.assert(fullEnd < changeStart); - } - } - function extendToAffectedRange(sourceFile, changeRange) { - // Consider the following code: - // void foo() { /; } - // - // If the text changes with an insertion of / just before the semicolon then we end up with: - // void foo() { //; } - // - // If we were to just use the changeRange a is, then we would not rescan the { token - // (as it does not intersect the actual original change range). Because an edit may - // change the token touching it, we actually need to look back *at least* one token so - // that the prior token sees that change. - var maxLookahead = 1; - var start = changeRange.span.start; - // the first iteration aligns us with the change start. subsequent iteration move us to - // the left by maxLookahead tokens. We only need to do this as long as we're not at the - // start of the tree. - for (var i = 0; start > 0 && i <= maxLookahead; i++) { - var nearestNode = findNearestNodeStartingBeforeOrAtPosition(sourceFile, start); - ts.Debug.assert(nearestNode.pos <= start); - var position = nearestNode.pos; - start = Math.max(0, position - 1); - } - var finalSpan = ts.createTextSpanFromBounds(start, ts.textSpanEnd(changeRange.span)); - var finalLength = changeRange.newLength + (changeRange.span.start - start); - return ts.createTextChangeRange(finalSpan, finalLength); - } - function findNearestNodeStartingBeforeOrAtPosition(sourceFile, position) { - var bestResult = sourceFile; - var lastNodeEntirelyBeforePosition; - forEachChild(sourceFile, visit); - if (lastNodeEntirelyBeforePosition) { - var lastChildOfLastEntireNodeBeforePosition = getLastChild(lastNodeEntirelyBeforePosition); - if (lastChildOfLastEntireNodeBeforePosition.pos > bestResult.pos) { - bestResult = lastChildOfLastEntireNodeBeforePosition; - } - } - return bestResult; - function getLastChild(node) { - while (true) { - var lastChild = getLastChildWorker(node); - if (lastChild) { - node = lastChild; - } - else { - return node; - } - } - } - function getLastChildWorker(node) { - var last = undefined; - forEachChild(node, function (child) { - if (ts.nodeIsPresent(child)) { - last = child; - } - }); - return last; - } - function visit(child) { - if (ts.nodeIsMissing(child)) { - // Missing nodes are effectively invisible to us. We never even consider them - // When trying to find the nearest node before us. - return; - } - // If the child intersects this position, then this node is currently the nearest - // node that starts before the position. - if (child.pos <= position) { - if (child.pos >= bestResult.pos) { - // This node starts before the position, and is closer to the position than - // the previous best node we found. It is now the new best node. - bestResult = child; - } - // Now, the node may overlap the position, or it may end entirely before the - // position. If it overlaps with the position, then either it, or one of its - // children must be the nearest node before the position. So we can just - // recurse into this child to see if we can find something better. - if (position < child.end) { - // The nearest node is either this child, or one of the children inside - // of it. We've already marked this child as the best so far. Recurse - // in case one of the children is better. - forEachChild(child, visit); - // Once we look at the children of this node, then there's no need to - // continue any further. - return true; - } - else { - ts.Debug.assert(child.end <= position); - // The child ends entirely before this position. Say you have the following - // (where $ is the position) - // - // ? $ : <...> <...> - // - // We would want to find the nearest preceding node in "complex expr 2". - // To support that, we keep track of this node, and once we're done searching - // for a best node, we recurse down this node to see if we can find a good - // result in it. - // - // This approach allows us to quickly skip over nodes that are entirely - // before the position, while still allowing us to find any nodes in the - // last one that might be what we want. - lastNodeEntirelyBeforePosition = child; - } - } - else { - ts.Debug.assert(child.pos > position); - // We're now at a node that is entirely past the position we're searching for. - // This node (and all following nodes) could never contribute to the result, - // so just skip them by returning 'true' here. - return true; - } - } - } - function checkChangeRange(sourceFile, newText, textChangeRange, aggressiveChecks) { - var oldText = sourceFile.text; - if (textChangeRange) { - ts.Debug.assert((oldText.length - textChangeRange.span.length + textChangeRange.newLength) === newText.length); - if (aggressiveChecks || ts.Debug.shouldAssert(3 /* VeryAggressive */)) { - var oldTextPrefix = oldText.substr(0, textChangeRange.span.start); - var newTextPrefix = newText.substr(0, textChangeRange.span.start); - ts.Debug.assert(oldTextPrefix === newTextPrefix); - var oldTextSuffix = oldText.substring(ts.textSpanEnd(textChangeRange.span), oldText.length); - var newTextSuffix = newText.substring(ts.textSpanEnd(ts.textChangeRangeNewSpan(textChangeRange)), newText.length); - ts.Debug.assert(oldTextSuffix === newTextSuffix); - } - } - } - function createSyntaxCursor(sourceFile) { - var currentArray = sourceFile.statements; - var currentArrayIndex = 0; - ts.Debug.assert(currentArrayIndex < currentArray.length); - var current = currentArray[currentArrayIndex]; - var lastQueriedPosition = -1 /* Value */; - return { - currentNode: function (position) { - // Only compute the current node if the position is different than the last time - // we were asked. The parser commonly asks for the node at the same position - // twice. Once to know if can read an appropriate list element at a certain point, - // and then to actually read and consume the node. - if (position !== lastQueriedPosition) { - // Much of the time the parser will need the very next node in the array that - // we just returned a node from.So just simply check for that case and move - // forward in the array instead of searching for the node again. - if (current && current.end === position && currentArrayIndex < (currentArray.length - 1)) { - currentArrayIndex++; - current = currentArray[currentArrayIndex]; - } - // If we don't have a node, or the node we have isn't in the right position, - // then try to find a viable node at the position requested. - if (!current || current.pos !== position) { - findHighestListElementThatStartsAtPosition(position); - } - } - // Cache this query so that we don't do any extra work if the parser calls back - // into us. Note: this is very common as the parser will make pairs of calls like - // 'isListElement -> parseListElement'. If we were unable to find a node when - // called with 'isListElement', we don't want to redo the work when parseListElement - // is called immediately after. - lastQueriedPosition = position; - // Either we don'd have a node, or we have a node at the position being asked for. - ts.Debug.assert(!current || current.pos === position); - return current; - } - }; - // Finds the highest element in the tree we can find that starts at the provided position. - // The element must be a direct child of some node list in the tree. This way after we - // return it, we can easily return its next sibling in the list. - function findHighestListElementThatStartsAtPosition(position) { - // Clear out any cached state about the last node we found. - currentArray = undefined; - currentArrayIndex = -1 /* Value */; - current = undefined; - // Recurse into the source file to find the highest node at this position. - forEachChild(sourceFile, visitNode, visitArray); - return; - function visitNode(node) { - if (position >= node.pos && position < node.end) { - // Position was within this node. Keep searching deeper to find the node. - forEachChild(node, visitNode, visitArray); - // don't procede any futher in the search. - return true; - } - // position wasn't in this node, have to keep searching. - return false; - } - function visitArray(array) { - if (position >= array.pos && position < array.end) { - // position was in this array. Search through this array to see if we find a - // viable element. - for (var i = 0, n = array.length; i < n; i++) { - var child = array[i]; - if (child) { - if (child.pos === position) { - // Found the right node. We're done. - currentArray = array; - currentArrayIndex = i; - current = child; - return true; - } - else { - if (child.pos < position && position < child.end) { - // Position in somewhere within this child. Search in it and - // stop searching in this array. - forEachChild(child, visitNode, visitArray); - return true; - } - } - } - } - } - // position wasn't in this array, have to keep searching. - return false; - } - } - } - var InvalidPosition; - (function (InvalidPosition) { - InvalidPosition[InvalidPosition["Value"] = -1] = "Value"; - })(InvalidPosition || (InvalidPosition = {})); - })(IncrementalParser || (IncrementalParser = {})); -})(ts || (ts = {})); -/// -/* @internal */ -var ts; -(function (ts) { - var nextSymbolId = 1; - var nextNodeId = 1; - var nextMergeId = 1; - function getNodeId(node) { - if (!node.id) - node.id = nextNodeId++; - return node.id; - } - ts.getNodeId = getNodeId; - ts.checkTime = 0; - function getSymbolId(symbol) { - if (!symbol.id) { - symbol.id = nextSymbolId++; - } - return symbol.id; - } - ts.getSymbolId = getSymbolId; - function createTypeChecker(host, produceDiagnostics) { - var Symbol = ts.objectAllocator.getSymbolConstructor(); - var Type = ts.objectAllocator.getTypeConstructor(); - var Signature = ts.objectAllocator.getSignatureConstructor(); - var typeCount = 0; - var emptyArray = []; - var emptySymbols = {}; - var compilerOptions = host.getCompilerOptions(); - var languageVersion = compilerOptions.target || 0 /* ES3 */; - var emitResolver = createResolver(); - var undefinedSymbol = createSymbol(4 /* Property */ | 67108864 /* Transient */, "undefined"); - var argumentsSymbol = createSymbol(4 /* Property */ | 67108864 /* Transient */, "arguments"); - var checker = { - getNodeCount: function () { return ts.sum(host.getSourceFiles(), "nodeCount"); }, - getIdentifierCount: function () { return ts.sum(host.getSourceFiles(), "identifierCount"); }, - getSymbolCount: function () { return ts.sum(host.getSourceFiles(), "symbolCount"); }, - getTypeCount: function () { return typeCount; }, - isUndefinedSymbol: function (symbol) { return symbol === undefinedSymbol; }, - isArgumentsSymbol: function (symbol) { return symbol === argumentsSymbol; }, - getDiagnostics: getDiagnostics, - getGlobalDiagnostics: getGlobalDiagnostics, - getTypeOfSymbolAtLocation: getTypeOfSymbolAtLocation, - getDeclaredTypeOfSymbol: getDeclaredTypeOfSymbol, - getPropertiesOfType: getPropertiesOfType, - getPropertyOfType: getPropertyOfType, - getSignaturesOfType: getSignaturesOfType, - getIndexTypeOfType: getIndexTypeOfType, - getReturnTypeOfSignature: getReturnTypeOfSignature, - getSymbolsInScope: getSymbolsInScope, - getSymbolAtLocation: getSymbolAtLocation, - getShorthandAssignmentValueSymbol: getShorthandAssignmentValueSymbol, - getTypeAtLocation: getTypeAtLocation, - typeToString: typeToString, - getSymbolDisplayBuilder: getSymbolDisplayBuilder, - symbolToString: symbolToString, - getAugmentedPropertiesOfType: getAugmentedPropertiesOfType, - getRootSymbols: getRootSymbols, - getContextualType: getContextualType, - getFullyQualifiedName: getFullyQualifiedName, - getResolvedSignature: getResolvedSignature, - getConstantValue: getConstantValue, - isValidPropertyAccess: isValidPropertyAccess, - getSignatureFromDeclaration: getSignatureFromDeclaration, - isImplementationOfOverload: isImplementationOfOverload, - getAliasedSymbol: resolveAlias, - getEmitResolver: getEmitResolver, - getExportsOfModule: getExportsOfModuleAsArray - }; - var unknownSymbol = createSymbol(4 /* Property */ | 67108864 /* Transient */, "unknown"); - var resolvingSymbol = createSymbol(67108864 /* Transient */, "__resolving__"); - var anyType = createIntrinsicType(1 /* Any */, "any"); - var stringType = createIntrinsicType(2 /* String */, "string"); - var numberType = createIntrinsicType(4 /* Number */, "number"); - var booleanType = createIntrinsicType(8 /* Boolean */, "boolean"); - var esSymbolType = createIntrinsicType(2097152 /* ESSymbol */, "symbol"); - var voidType = createIntrinsicType(16 /* Void */, "void"); - var undefinedType = createIntrinsicType(32 /* Undefined */ | 524288 /* ContainsUndefinedOrNull */, "undefined"); - var nullType = createIntrinsicType(64 /* Null */ | 524288 /* ContainsUndefinedOrNull */, "null"); - var unknownType = createIntrinsicType(1 /* Any */, "unknown"); - var circularType = createIntrinsicType(1 /* Any */, "__circular__"); - var emptyObjectType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); - var emptyGenericType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); - emptyGenericType.instantiations = {}; - var anyFunctionType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); - var noConstraintType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); - var anySignature = createSignature(undefined, undefined, emptyArray, anyType, undefined, 0, false, false); - var unknownSignature = createSignature(undefined, undefined, emptyArray, unknownType, undefined, 0, false, false); - var globals = {}; - var globalESSymbolConstructorSymbol; - var globalObjectType; - var globalFunctionType; - var globalArrayType; - var globalStringType; - var globalNumberType; - var globalBooleanType; - var globalRegExpType; - var globalTemplateStringsArrayType; - var globalESSymbolType; - var globalIterableType; - var globalIteratorType; - var globalIterableIteratorType; - var anyArrayType; - var getGlobalClassDecoratorType; - var getGlobalParameterDecoratorType; - var getGlobalPropertyDecoratorType; - var getGlobalMethodDecoratorType; - var tupleTypes = {}; - var unionTypes = {}; - var stringLiteralTypes = {}; - var emitExtends = false; - var emitDecorate = false; - var emitParam = false; - var resolutionTargets = []; - var resolutionResults = []; - var mergedSymbols = []; - var symbolLinks = []; - var nodeLinks = []; - var potentialThisCollisions = []; - var diagnostics = ts.createDiagnosticCollection(); - var primitiveTypeInfo = { - "string": { - type: stringType, - flags: 258 /* StringLike */ - }, - "number": { - type: numberType, - flags: 132 /* NumberLike */ - }, - "boolean": { - type: booleanType, - flags: 8 /* Boolean */ - }, - "symbol": { - type: esSymbolType, - flags: 2097152 /* ESSymbol */ - } - }; - function getEmitResolver(sourceFile) { - // Ensure we have all the type information in place for this file so that all the - // emitter questions of this resolver will return the right information. - getDiagnostics(sourceFile); - return emitResolver; - } - function error(location, message, arg0, arg1, arg2) { - var diagnostic = location - ? ts.createDiagnosticForNode(location, message, arg0, arg1, arg2) - : ts.createCompilerDiagnostic(message, arg0, arg1, arg2); - diagnostics.add(diagnostic); - } - function createSymbol(flags, name) { - return new Symbol(flags, name); - } - function getExcludedSymbolFlags(flags) { - var result = 0; - if (flags & 2 /* BlockScopedVariable */) - result |= 107455 /* BlockScopedVariableExcludes */; - if (flags & 1 /* FunctionScopedVariable */) - result |= 107454 /* FunctionScopedVariableExcludes */; - if (flags & 4 /* Property */) - result |= 107455 /* PropertyExcludes */; - if (flags & 8 /* EnumMember */) - result |= 107455 /* EnumMemberExcludes */; - if (flags & 16 /* Function */) - result |= 106927 /* FunctionExcludes */; - if (flags & 32 /* Class */) - result |= 899583 /* ClassExcludes */; - if (flags & 64 /* Interface */) - result |= 792992 /* InterfaceExcludes */; - if (flags & 256 /* RegularEnum */) - result |= 899327 /* RegularEnumExcludes */; - if (flags & 128 /* ConstEnum */) - result |= 899967 /* ConstEnumExcludes */; - if (flags & 512 /* ValueModule */) - result |= 106639 /* ValueModuleExcludes */; - if (flags & 8192 /* Method */) - result |= 99263 /* MethodExcludes */; - if (flags & 32768 /* GetAccessor */) - result |= 41919 /* GetAccessorExcludes */; - if (flags & 65536 /* SetAccessor */) - result |= 74687 /* SetAccessorExcludes */; - if (flags & 262144 /* TypeParameter */) - result |= 530912 /* TypeParameterExcludes */; - if (flags & 524288 /* TypeAlias */) - result |= 793056 /* TypeAliasExcludes */; - if (flags & 8388608 /* Alias */) - result |= 8388608 /* AliasExcludes */; - return result; - } - function recordMergedSymbol(target, source) { - if (!source.mergeId) - source.mergeId = nextMergeId++; - mergedSymbols[source.mergeId] = target; - } - function cloneSymbol(symbol) { - var result = createSymbol(symbol.flags | 33554432 /* Merged */, symbol.name); - result.declarations = symbol.declarations.slice(0); - result.parent = symbol.parent; - if (symbol.valueDeclaration) - result.valueDeclaration = symbol.valueDeclaration; - if (symbol.constEnumOnlyModule) - result.constEnumOnlyModule = true; - if (symbol.members) - result.members = cloneSymbolTable(symbol.members); - if (symbol.exports) - result.exports = cloneSymbolTable(symbol.exports); - recordMergedSymbol(result, symbol); - return result; - } - function mergeSymbol(target, source) { - if (!(target.flags & getExcludedSymbolFlags(source.flags))) { - if (source.flags & 512 /* ValueModule */ && target.flags & 512 /* ValueModule */ && target.constEnumOnlyModule && !source.constEnumOnlyModule) { - // reset flag when merging instantiated module into value module that has only const enums - target.constEnumOnlyModule = false; - } - target.flags |= source.flags; - if (!target.valueDeclaration && source.valueDeclaration) - target.valueDeclaration = source.valueDeclaration; - ts.forEach(source.declarations, function (node) { - target.declarations.push(node); - }); - if (source.members) { - if (!target.members) - target.members = {}; - mergeSymbolTable(target.members, source.members); - } - if (source.exports) { - if (!target.exports) - target.exports = {}; - mergeSymbolTable(target.exports, source.exports); - } - recordMergedSymbol(target, source); - } - else { - var message = target.flags & 2 /* BlockScopedVariable */ || source.flags & 2 /* BlockScopedVariable */ - ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 : ts.Diagnostics.Duplicate_identifier_0; - ts.forEach(source.declarations, function (node) { - error(node.name ? node.name : node, message, symbolToString(source)); - }); - ts.forEach(target.declarations, function (node) { - error(node.name ? node.name : node, message, symbolToString(source)); - }); - } - } - function cloneSymbolTable(symbolTable) { - var result = {}; - for (var id in symbolTable) { - if (ts.hasProperty(symbolTable, id)) { - result[id] = symbolTable[id]; - } - } - return result; - } - function mergeSymbolTable(target, source) { - for (var id in source) { - if (ts.hasProperty(source, id)) { - if (!ts.hasProperty(target, id)) { - target[id] = source[id]; - } - else { - var symbol = target[id]; - if (!(symbol.flags & 33554432 /* Merged */)) { - target[id] = symbol = cloneSymbol(symbol); - } - mergeSymbol(symbol, source[id]); - } - } - } - } - function getSymbolLinks(symbol) { - if (symbol.flags & 67108864 /* Transient */) - return symbol; - var id = getSymbolId(symbol); - return symbolLinks[id] || (symbolLinks[id] = {}); - } - function getNodeLinks(node) { - var nodeId = getNodeId(node); - return nodeLinks[nodeId] || (nodeLinks[nodeId] = {}); - } - function getSourceFile(node) { - return ts.getAncestor(node, 230 /* SourceFile */); - } - function isGlobalSourceFile(node) { - return node.kind === 230 /* SourceFile */ && !ts.isExternalModule(node); - } - function getSymbol(symbols, name, meaning) { - if (meaning && ts.hasProperty(symbols, name)) { - var symbol = symbols[name]; - ts.Debug.assert((symbol.flags & 16777216 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); - if (symbol.flags & meaning) { - return symbol; - } - if (symbol.flags & 8388608 /* Alias */) { - var target = resolveAlias(symbol); - // Unknown symbol means an error occurred in alias resolution, treat it as positive answer to avoid cascading errors - if (target === unknownSymbol || target.flags & meaning) { - return symbol; - } - } - } - // return undefined if we can't find a symbol. - } - /** Returns true if node1 is defined before node 2**/ - function isDefinedBefore(node1, node2) { - var file1 = ts.getSourceFileOfNode(node1); - var file2 = ts.getSourceFileOfNode(node2); - if (file1 === file2) { - return node1.pos <= node2.pos; - } - if (!compilerOptions.out) { - return true; - } - var sourceFiles = host.getSourceFiles(); - return sourceFiles.indexOf(file1) <= sourceFiles.indexOf(file2); - } - // Resolve a given name for a given meaning at a given location. An error is reported if the name was not found and - // the nameNotFoundMessage argument is not undefined. Returns the resolved symbol, or undefined if no symbol with - // the given name can be found. - function resolveName(location, name, meaning, nameNotFoundMessage, nameArg) { - var result; - var lastLocation; - var propertyWithInvalidInitializer; - var errorLocation = location; - var grandparent; - loop: while (location) { - // Locals of a source file are not in scope (because they get merged into the global symbol table) - if (location.locals && !isGlobalSourceFile(location)) { - if (result = getSymbol(location.locals, name, meaning)) { - // Type parameters of a function are in scope in the entire function declaration, including the parameter - // list and return type. However, local types are only in scope in the function body. - if (!(meaning & 793056 /* Type */) || - !(result.flags & (793056 /* Type */ & ~262144 /* TypeParameter */)) || - !ts.isFunctionLike(location) || - lastLocation === location.body) { - break loop; - } - result = undefined; - } - } - switch (location.kind) { - case 230 /* SourceFile */: - if (!ts.isExternalModule(location)) - break; - case 208 /* ModuleDeclaration */: - if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 8914931 /* ModuleMember */)) { - if (result.flags & meaning || !(result.flags & 8388608 /* Alias */ && getDeclarationOfAliasSymbol(result).kind === 220 /* ExportSpecifier */)) { - break loop; - } - result = undefined; - } - else if (location.kind === 230 /* SourceFile */ || - (location.kind === 208 /* ModuleDeclaration */ && location.name.kind === 8 /* StringLiteral */)) { - result = getSymbolOfNode(location).exports["default"]; - var localSymbol = ts.getLocalSymbolForExportDefault(result); - if (result && localSymbol && (result.flags & meaning) && localSymbol.name === name) { - break loop; - } - result = undefined; - } - break; - case 207 /* EnumDeclaration */: - if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 8 /* EnumMember */)) { - break loop; - } - break; - case 134 /* PropertyDeclaration */: - case 133 /* PropertySignature */: - // TypeScript 1.0 spec (April 2014): 8.4.1 - // Initializer expressions for instance member variables are evaluated in the scope - // of the class constructor body but are not permitted to reference parameters or - // local variables of the constructor. This effectively means that entities from outer scopes - // by the same name as a constructor parameter or local variable are inaccessible - // in initializer expressions for instance member variables. - if (location.parent.kind === 204 /* ClassDeclaration */ && !(location.flags & 128 /* Static */)) { - var ctor = findConstructorDeclaration(location.parent); - if (ctor && ctor.locals) { - if (getSymbol(ctor.locals, name, meaning & 107455 /* Value */)) { - // Remember the property node, it will be used later to report appropriate error - propertyWithInvalidInitializer = location; - } - } - } - break; - case 204 /* ClassDeclaration */: - case 205 /* InterfaceDeclaration */: - if (result = getSymbol(getSymbolOfNode(location).members, name, meaning & 793056 /* Type */)) { - if (lastLocation && lastLocation.flags & 128 /* Static */) { - // TypeScript 1.0 spec (April 2014): 3.4.1 - // The scope of a type parameter extends over the entire declaration with which the type - // parameter list is associated, with the exception of static member declarations in classes. - error(errorLocation, ts.Diagnostics.Static_members_cannot_reference_class_type_parameters); - return undefined; - } - break loop; - } - break; - // It is not legal to reference a class's own type parameters from a computed property name that - // belongs to the class. For example: - // - // function foo() { return '' } - // class C { // <-- Class's own type parameter T - // [foo()]() { } // <-- Reference to T from class's own computed property - // } - // - case 129 /* ComputedPropertyName */: - grandparent = location.parent.parent; - if (grandparent.kind === 204 /* ClassDeclaration */ || grandparent.kind === 205 /* InterfaceDeclaration */) { - // A reference to this grandparent's type parameters would be an error - if (result = getSymbol(getSymbolOfNode(grandparent).members, name, meaning & 793056 /* Type */)) { - error(errorLocation, ts.Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type); - return undefined; - } - } - break; - case 136 /* MethodDeclaration */: - case 135 /* MethodSignature */: - case 137 /* Constructor */: - case 138 /* GetAccessor */: - case 139 /* SetAccessor */: - case 203 /* FunctionDeclaration */: - case 166 /* ArrowFunction */: - if (meaning & 3 /* Variable */ && name === "arguments") { - result = argumentsSymbol; - break loop; - } - break; - case 165 /* FunctionExpression */: - if (meaning & 3 /* Variable */ && name === "arguments") { - result = argumentsSymbol; - break loop; - } - if (meaning & 16 /* Function */) { - var functionName = location.name; - if (functionName && name === functionName.text) { - result = location.symbol; - break loop; - } - } - break; - case 177 /* ClassExpression */: - if (meaning & 32 /* Class */) { - var className = location.name; - if (className && name === className.text) { - result = location.symbol; - break loop; - } - } - break; - case 132 /* Decorator */: - // Decorators are resolved at the class declaration. Resolving at the parameter - // or member would result in looking up locals in the method. - // - // function y() {} - // class C { - // method(@y x, y) {} // <-- decorator y should be resolved at the class declaration, not the parameter. - // } - // - if (location.parent && location.parent.kind === 131 /* Parameter */) { - location = location.parent; - } - // - // function y() {} - // class C { - // @y method(x, y) {} // <-- decorator y should be resolved at the class declaration, not the method. - // } - // - if (location.parent && ts.isClassElement(location.parent)) { - location = location.parent; - } - break; - } - lastLocation = location; - location = location.parent; - } - if (!result) { - result = getSymbol(globals, name, meaning); - } - if (!result) { - if (nameNotFoundMessage) { - error(errorLocation, nameNotFoundMessage, typeof nameArg === "string" ? nameArg : ts.declarationNameToString(nameArg)); - } - return undefined; - } - // Perform extra checks only if error reporting was requested - if (nameNotFoundMessage) { - if (propertyWithInvalidInitializer) { - // We have a match, but the reference occurred within a property initializer and the identifier also binds - // to a local variable in the constructor where the code will be emitted. - var propertyName = propertyWithInvalidInitializer.name; - error(errorLocation, ts.Diagnostics.Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor, ts.declarationNameToString(propertyName), typeof nameArg === "string" ? nameArg : ts.declarationNameToString(nameArg)); - return undefined; - } - if (result.flags & 2 /* BlockScopedVariable */) { - checkResolvedBlockScopedVariable(result, errorLocation); - } - } - return result; - } - function checkResolvedBlockScopedVariable(result, errorLocation) { - ts.Debug.assert((result.flags & 2 /* BlockScopedVariable */) !== 0); - // Block-scoped variables cannot be used before their definition - var declaration = ts.forEach(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) ? d : undefined; }); - ts.Debug.assert(declaration !== undefined, "Block-scoped variable declaration is undefined"); - // first check if usage is lexically located after the declaration - var isUsedBeforeDeclaration = !isDefinedBefore(declaration, errorLocation); - if (!isUsedBeforeDeclaration) { - // lexical check succeeded however code still can be illegal. - // - block scoped variables cannot be used in its initializers - // let x = x; // illegal but usage is lexically after definition - // - in ForIn/ForOf statements variable cannot be contained in expression part - // for (let x in x) - // for (let x of x) - // climb up to the variable declaration skipping binding patterns - var variableDeclaration = ts.getAncestor(declaration, 201 /* VariableDeclaration */); - var container = ts.getEnclosingBlockScopeContainer(variableDeclaration); - if (variableDeclaration.parent.parent.kind === 183 /* VariableStatement */ || - variableDeclaration.parent.parent.kind === 189 /* ForStatement */) { - // variable statement/for statement case, - // use site should not be inside variable declaration (initializer of declaration or binding element) - isUsedBeforeDeclaration = isSameScopeDescendentOf(errorLocation, variableDeclaration, container); - } - else if (variableDeclaration.parent.parent.kind === 191 /* ForOfStatement */ || - variableDeclaration.parent.parent.kind === 190 /* ForInStatement */) { - // ForIn/ForOf case - use site should not be used in expression part - var expression = variableDeclaration.parent.parent.expression; - isUsedBeforeDeclaration = isSameScopeDescendentOf(errorLocation, expression, container); - } - } - if (isUsedBeforeDeclaration) { - error(errorLocation, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, ts.declarationNameToString(declaration.name)); - } - } - /* Starting from 'initial' node walk up the parent chain until 'stopAt' node is reached. - * If at any point current node is equal to 'parent' node - return true. - * Return false if 'stopAt' node is reached or isFunctionLike(current) === true. - */ - function isSameScopeDescendentOf(initial, parent, stopAt) { - if (!parent) { - return false; - } - for (var current = initial; current && current !== stopAt && !ts.isFunctionLike(current); current = current.parent) { - if (current === parent) { - return true; - } - } - return false; - } - function getAnyImportSyntax(node) { - if (ts.isAliasSymbolDeclaration(node)) { - if (node.kind === 211 /* ImportEqualsDeclaration */) { - return node; - } - while (node && node.kind !== 212 /* ImportDeclaration */) { - node = node.parent; - } - return node; - } - } - function getDeclarationOfAliasSymbol(symbol) { - return ts.forEach(symbol.declarations, function (d) { return ts.isAliasSymbolDeclaration(d) ? d : undefined; }); - } - function getTargetOfImportEqualsDeclaration(node) { - if (node.moduleReference.kind === 222 /* ExternalModuleReference */) { - return resolveExternalModuleSymbol(resolveExternalModuleName(node, ts.getExternalModuleImportEqualsDeclarationExpression(node))); - } - return getSymbolOfPartOfRightHandSideOfImportEquals(node.moduleReference, node); - } - function getTargetOfImportClause(node) { - var moduleSymbol = resolveExternalModuleName(node, node.parent.moduleSpecifier); - if (moduleSymbol) { - var exportDefaultSymbol = resolveSymbol(moduleSymbol.exports["default"]); - if (!exportDefaultSymbol) { - error(node.name, ts.Diagnostics.Module_0_has_no_default_export, symbolToString(moduleSymbol)); - } - return exportDefaultSymbol; - } - } - function getTargetOfNamespaceImport(node) { - var moduleSpecifier = node.parent.parent.moduleSpecifier; - return resolveESModuleSymbol(resolveExternalModuleName(node, moduleSpecifier), moduleSpecifier); - } - function getMemberOfModuleVariable(moduleSymbol, name) { - if (moduleSymbol.flags & 3 /* Variable */) { - var typeAnnotation = moduleSymbol.valueDeclaration.type; - if (typeAnnotation) { - return getPropertyOfType(getTypeFromTypeNode(typeAnnotation), name); - } - } - } - // This function creates a synthetic symbol that combines the value side of one symbol with the - // type/namespace side of another symbol. Consider this example: - // - // declare module graphics { - // interface Point { - // x: number; - // y: number; - // } - // } - // declare var graphics: { - // Point: new (x: number, y: number) => graphics.Point; - // } - // declare module "graphics" { - // export = graphics; - // } - // - // An 'import { Point } from "graphics"' needs to create a symbol that combines the value side 'Point' - // property with the type/namespace side interface 'Point'. - function combineValueAndTypeSymbols(valueSymbol, typeSymbol) { - if (valueSymbol.flags & (793056 /* Type */ | 1536 /* Namespace */)) { - return valueSymbol; - } - var result = createSymbol(valueSymbol.flags | typeSymbol.flags, valueSymbol.name); - result.declarations = ts.concatenate(valueSymbol.declarations, typeSymbol.declarations); - result.parent = valueSymbol.parent || typeSymbol.parent; - if (valueSymbol.valueDeclaration) - result.valueDeclaration = valueSymbol.valueDeclaration; - if (typeSymbol.members) - result.members = typeSymbol.members; - if (valueSymbol.exports) - result.exports = valueSymbol.exports; - return result; - } - function getExportOfModule(symbol, name) { - if (symbol.flags & 1536 /* Module */) { - var exports = getExportsOfSymbol(symbol); - if (ts.hasProperty(exports, name)) { - return resolveSymbol(exports[name]); - } - } - } - function getPropertyOfVariable(symbol, name) { - if (symbol.flags & 3 /* Variable */) { - var typeAnnotation = symbol.valueDeclaration.type; - if (typeAnnotation) { - return resolveSymbol(getPropertyOfType(getTypeFromTypeNode(typeAnnotation), name)); - } - } - } - function getExternalModuleMember(node, specifier) { - var moduleSymbol = resolveExternalModuleName(node, node.moduleSpecifier); - var targetSymbol = resolveESModuleSymbol(moduleSymbol, node.moduleSpecifier); - if (targetSymbol) { - var name_8 = specifier.propertyName || specifier.name; - if (name_8.text) { - var symbolFromModule = getExportOfModule(targetSymbol, name_8.text); - var symbolFromVariable = getPropertyOfVariable(targetSymbol, name_8.text); - var symbol = symbolFromModule && symbolFromVariable ? - combineValueAndTypeSymbols(symbolFromVariable, symbolFromModule) : - symbolFromModule || symbolFromVariable; - if (!symbol) { - error(name_8, ts.Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(moduleSymbol), ts.declarationNameToString(name_8)); - } - return symbol; - } - } - } - function getTargetOfImportSpecifier(node) { - return getExternalModuleMember(node.parent.parent.parent, node); - } - function getTargetOfExportSpecifier(node) { - return node.parent.parent.moduleSpecifier ? - getExternalModuleMember(node.parent.parent, node) : - resolveEntityName(node.propertyName || node.name, 107455 /* Value */ | 793056 /* Type */ | 1536 /* Namespace */); - } - function getTargetOfExportAssignment(node) { - return resolveEntityName(node.expression, 107455 /* Value */ | 793056 /* Type */ | 1536 /* Namespace */); - } - function getTargetOfAliasDeclaration(node) { - switch (node.kind) { - case 211 /* ImportEqualsDeclaration */: - return getTargetOfImportEqualsDeclaration(node); - case 213 /* ImportClause */: - return getTargetOfImportClause(node); - case 214 /* NamespaceImport */: - return getTargetOfNamespaceImport(node); - case 216 /* ImportSpecifier */: - return getTargetOfImportSpecifier(node); - case 220 /* ExportSpecifier */: - return getTargetOfExportSpecifier(node); - case 217 /* ExportAssignment */: - return getTargetOfExportAssignment(node); - } - } - function resolveSymbol(symbol) { - return symbol && symbol.flags & 8388608 /* Alias */ && !(symbol.flags & (107455 /* Value */ | 793056 /* Type */ | 1536 /* Namespace */)) ? resolveAlias(symbol) : symbol; - } - function resolveAlias(symbol) { - ts.Debug.assert((symbol.flags & 8388608 /* Alias */) !== 0, "Should only get Alias here."); - var links = getSymbolLinks(symbol); - if (!links.target) { - links.target = resolvingSymbol; - var node = getDeclarationOfAliasSymbol(symbol); - var target = getTargetOfAliasDeclaration(node); - if (links.target === resolvingSymbol) { - links.target = target || unknownSymbol; - } - else { - error(node, ts.Diagnostics.Circular_definition_of_import_alias_0, symbolToString(symbol)); - } - } - else if (links.target === resolvingSymbol) { - links.target = unknownSymbol; - } - return links.target; - } - function markExportAsReferenced(node) { - var symbol = getSymbolOfNode(node); - var target = resolveAlias(symbol); - if (target) { - var markAlias = (target === unknownSymbol && compilerOptions.isolatedModules) || - (target !== unknownSymbol && (target.flags & 107455 /* Value */) && !isConstEnumOrConstEnumOnlyModule(target)); - if (markAlias) { - markAliasSymbolAsReferenced(symbol); - } - } - } - // When an alias symbol is referenced, we need to mark the entity it references as referenced and in turn repeat that until - // we reach a non-alias or an exported entity (which is always considered referenced). We do this by checking the target of - // the alias as an expression (which recursively takes us back here if the target references another alias). - function markAliasSymbolAsReferenced(symbol) { - var links = getSymbolLinks(symbol); - if (!links.referenced) { - links.referenced = true; - var node = getDeclarationOfAliasSymbol(symbol); - if (node.kind === 217 /* ExportAssignment */) { - // export default - checkExpressionCached(node.expression); - } - else if (node.kind === 220 /* ExportSpecifier */) { - // export { } or export { as foo } - checkExpressionCached(node.propertyName || node.name); - } - else if (ts.isInternalModuleImportEqualsDeclaration(node)) { - // import foo = - checkExpressionCached(node.moduleReference); - } - } - } - // This function is only for imports with entity names - function getSymbolOfPartOfRightHandSideOfImportEquals(entityName, importDeclaration) { - if (!importDeclaration) { - importDeclaration = ts.getAncestor(entityName, 211 /* ImportEqualsDeclaration */); - ts.Debug.assert(importDeclaration !== undefined); - } - // There are three things we might try to look for. In the following examples, - // the search term is enclosed in |...|: - // - // import a = |b|; // Namespace - // import a = |b.c|; // Value, type, namespace - // import a = |b.c|.d; // Namespace - if (entityName.kind === 65 /* Identifier */ && ts.isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { - entityName = entityName.parent; - } - // Check for case 1 and 3 in the above example - if (entityName.kind === 65 /* Identifier */ || entityName.parent.kind === 128 /* QualifiedName */) { - return resolveEntityName(entityName, 1536 /* Namespace */); - } - else { - // Case 2 in above example - // entityName.kind could be a QualifiedName or a Missing identifier - ts.Debug.assert(entityName.parent.kind === 211 /* ImportEqualsDeclaration */); - return resolveEntityName(entityName, 107455 /* Value */ | 793056 /* Type */ | 1536 /* Namespace */); - } - } - function getFullyQualifiedName(symbol) { - return symbol.parent ? getFullyQualifiedName(symbol.parent) + "." + symbolToString(symbol) : symbolToString(symbol); - } - // Resolves a qualified name and any involved aliases - function resolveEntityName(name, meaning) { - if (ts.nodeIsMissing(name)) { - return undefined; - } - var symbol; - if (name.kind === 65 /* Identifier */) { - var message = meaning === 1536 /* Namespace */ ? ts.Diagnostics.Cannot_find_namespace_0 : ts.Diagnostics.Cannot_find_name_0; - symbol = resolveName(name, name.text, meaning, message, name); - if (!symbol) { - return undefined; - } - } - else if (name.kind === 128 /* QualifiedName */ || name.kind === 158 /* PropertyAccessExpression */) { - var left = name.kind === 128 /* QualifiedName */ ? name.left : name.expression; - var right = name.kind === 128 /* QualifiedName */ ? name.right : name.name; - var namespace = resolveEntityName(left, 1536 /* Namespace */); - if (!namespace || namespace === unknownSymbol || ts.nodeIsMissing(right)) { - return undefined; - } - symbol = getSymbol(getExportsOfSymbol(namespace), right.text, meaning); - if (!symbol) { - error(right, ts.Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(namespace), ts.declarationNameToString(right)); - return undefined; - } - } - else { - ts.Debug.fail("Unknown entity name kind."); - } - ts.Debug.assert((symbol.flags & 16777216 /* Instantiated */) === 0, "Should never get an instantiated symbol here."); - return symbol.flags & meaning ? symbol : resolveAlias(symbol); - } - function isExternalModuleNameRelative(moduleName) { - // TypeScript 1.0 spec (April 2014): 11.2.1 - // An external module name is "relative" if the first term is "." or "..". - return moduleName.substr(0, 2) === "./" || moduleName.substr(0, 3) === "../" || moduleName.substr(0, 2) === ".\\" || moduleName.substr(0, 3) === "..\\"; - } - function resolveExternalModuleName(location, moduleReferenceExpression) { - if (moduleReferenceExpression.kind !== 8 /* StringLiteral */) { - return; - } - var moduleReferenceLiteral = moduleReferenceExpression; - var searchPath = ts.getDirectoryPath(getSourceFile(location).fileName); - // Module names are escaped in our symbol table. However, string literal values aren't. - // Escape the name in the "require(...)" clause to ensure we find the right symbol. - var moduleName = ts.escapeIdentifier(moduleReferenceLiteral.text); - if (!moduleName) - return; - var isRelative = isExternalModuleNameRelative(moduleName); - if (!isRelative) { - var symbol = getSymbol(globals, '"' + moduleName + '"', 512 /* ValueModule */); - if (symbol) { - return symbol; - } - } - var fileName; - var sourceFile; - while (true) { - fileName = ts.normalizePath(ts.combinePaths(searchPath, moduleName)); - sourceFile = ts.forEach(ts.supportedExtensions, function (extension) { return host.getSourceFile(fileName + extension); }); - if (sourceFile || isRelative) { - break; - } - var parentPath = ts.getDirectoryPath(searchPath); - if (parentPath === searchPath) { - break; - } - searchPath = parentPath; - } - if (sourceFile) { - if (sourceFile.symbol) { - return sourceFile.symbol; - } - error(moduleReferenceLiteral, ts.Diagnostics.File_0_is_not_a_module, sourceFile.fileName); - return; - } - error(moduleReferenceLiteral, ts.Diagnostics.Cannot_find_module_0, moduleName); - } - // An external module with an 'export =' declaration resolves to the target of the 'export =' declaration, - // and an external module with no 'export =' declaration resolves to the module itself. - function resolveExternalModuleSymbol(moduleSymbol) { - return moduleSymbol && resolveSymbol(moduleSymbol.exports["export="]) || moduleSymbol; - } - // An external module with an 'export =' declaration may be referenced as an ES6 module provided the 'export =' - // references a symbol that is at least declared as a module or a variable. The target of the 'export =' may - // combine other declarations with the module or variable (e.g. a class/module, function/module, interface/variable). - function resolveESModuleSymbol(moduleSymbol, moduleReferenceExpression) { - var symbol = resolveExternalModuleSymbol(moduleSymbol); - if (symbol && !(symbol.flags & (1536 /* Module */ | 3 /* Variable */))) { - error(moduleReferenceExpression, ts.Diagnostics.Module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct, symbolToString(moduleSymbol)); - symbol = undefined; - } - return symbol; - } - function getExportAssignmentSymbol(moduleSymbol) { - return moduleSymbol.exports["export="]; - } - function getExportsOfModuleAsArray(moduleSymbol) { - return symbolsToArray(getExportsOfModule(moduleSymbol)); - } - function getExportsOfSymbol(symbol) { - return symbol.flags & 1536 /* Module */ ? getExportsOfModule(symbol) : symbol.exports || emptySymbols; - } - function getExportsOfModule(moduleSymbol) { - var links = getSymbolLinks(moduleSymbol); - return links.resolvedExports || (links.resolvedExports = getExportsForModule(moduleSymbol)); - } - function extendExportSymbols(target, source) { - for (var id in source) { - if (id !== "default" && !ts.hasProperty(target, id)) { - target[id] = source[id]; - } - } - } - function getExportsForModule(moduleSymbol) { - var result; - var visitedSymbols = []; - visit(moduleSymbol); - return result || moduleSymbol.exports; - // The ES6 spec permits export * declarations in a module to circularly reference the module itself. For example, - // module 'a' can 'export * from "b"' and 'b' can 'export * from "a"' without error. - function visit(symbol) { - if (symbol && symbol.flags & 1952 /* HasExports */ && !ts.contains(visitedSymbols, symbol)) { - visitedSymbols.push(symbol); - if (symbol !== moduleSymbol) { - if (!result) { - result = cloneSymbolTable(moduleSymbol.exports); - } - extendExportSymbols(result, symbol.exports); - } - // All export * declarations are collected in an __export symbol by the binder - var exportStars = symbol.exports["__export"]; - if (exportStars) { - for (var _i = 0, _a = exportStars.declarations; _i < _a.length; _i++) { - var node = _a[_i]; - visit(resolveExternalModuleName(node, node.moduleSpecifier)); - } - } - } - } - } - function getMergedSymbol(symbol) { - var merged; - return symbol && symbol.mergeId && (merged = mergedSymbols[symbol.mergeId]) ? merged : symbol; - } - function getSymbolOfNode(node) { - return getMergedSymbol(node.symbol); - } - function getParentOfSymbol(symbol) { - return getMergedSymbol(symbol.parent); - } - function getExportSymbolOfValueSymbolIfExported(symbol) { - return symbol && (symbol.flags & 1048576 /* ExportValue */) !== 0 - ? getMergedSymbol(symbol.exportSymbol) - : symbol; - } - function symbolIsValue(symbol) { - // If it is an instantiated symbol, then it is a value if the symbol it is an - // instantiation of is a value. - if (symbol.flags & 16777216 /* Instantiated */) { - return symbolIsValue(getSymbolLinks(symbol).target); - } - // If the symbol has the value flag, it is trivially a value. - if (symbol.flags & 107455 /* Value */) { - return true; - } - // If it is an alias, then it is a value if the symbol it resolves to is a value. - if (symbol.flags & 8388608 /* Alias */) { - return (resolveAlias(symbol).flags & 107455 /* Value */) !== 0; - } - return false; - } - function findConstructorDeclaration(node) { - var members = node.members; - for (var _i = 0; _i < members.length; _i++) { - var member = members[_i]; - if (member.kind === 137 /* Constructor */ && ts.nodeIsPresent(member.body)) { - return member; - } - } - } - function createType(flags) { - var result = new Type(checker, flags); - result.id = typeCount++; - return result; - } - function createIntrinsicType(kind, intrinsicName) { - var type = createType(kind); - type.intrinsicName = intrinsicName; - return type; - } - function createObjectType(kind, symbol) { - var type = createType(kind); - type.symbol = symbol; - return type; - } - // A reserved member name starts with two underscores, but the third character cannot be an underscore - // or the @ symbol. A third underscore indicates an escaped form of an identifer that started - // with at least two underscores. The @ character indicates that the name is denoted by a well known ES - // Symbol instance. - function isReservedMemberName(name) { - return name.charCodeAt(0) === 95 /* _ */ && - name.charCodeAt(1) === 95 /* _ */ && - name.charCodeAt(2) !== 95 /* _ */ && - name.charCodeAt(2) !== 64 /* at */; - } - function getNamedMembers(members) { - var result; - for (var id in members) { - if (ts.hasProperty(members, id)) { - if (!isReservedMemberName(id)) { - if (!result) - result = []; - var symbol = members[id]; - if (symbolIsValue(symbol)) { - result.push(symbol); - } - } - } - } - return result || emptyArray; - } - function setObjectTypeMembers(type, members, callSignatures, constructSignatures, stringIndexType, numberIndexType) { - type.members = members; - type.properties = getNamedMembers(members); - type.callSignatures = callSignatures; - type.constructSignatures = constructSignatures; - if (stringIndexType) - type.stringIndexType = stringIndexType; - if (numberIndexType) - type.numberIndexType = numberIndexType; - return type; - } - function createAnonymousType(symbol, members, callSignatures, constructSignatures, stringIndexType, numberIndexType) { - return setObjectTypeMembers(createObjectType(32768 /* Anonymous */, symbol), members, callSignatures, constructSignatures, stringIndexType, numberIndexType); - } - function forEachSymbolTableInScope(enclosingDeclaration, callback) { - var result; - for (var location_1 = enclosingDeclaration; location_1; location_1 = location_1.parent) { - // Locals of a source file are not in scope (because they get merged into the global symbol table) - if (location_1.locals && !isGlobalSourceFile(location_1)) { - if (result = callback(location_1.locals)) { - return result; - } - } - switch (location_1.kind) { - case 230 /* SourceFile */: - if (!ts.isExternalModule(location_1)) { - break; - } - case 208 /* ModuleDeclaration */: - if (result = callback(getSymbolOfNode(location_1).exports)) { - return result; - } - break; - case 204 /* ClassDeclaration */: - case 205 /* InterfaceDeclaration */: - if (result = callback(getSymbolOfNode(location_1).members)) { - return result; - } - break; - } - } - return callback(globals); - } - function getQualifiedLeftMeaning(rightMeaning) { - // If we are looking in value space, the parent meaning is value, other wise it is namespace - return rightMeaning === 107455 /* Value */ ? 107455 /* Value */ : 1536 /* Namespace */; - } - function getAccessibleSymbolChain(symbol, enclosingDeclaration, meaning, useOnlyExternalAliasing) { - function getAccessibleSymbolChainFromSymbolTable(symbols) { - function canQualifySymbol(symbolFromSymbolTable, meaning) { - // If the symbol is equivalent and doesn't need further qualification, this symbol is accessible - if (!needsQualification(symbolFromSymbolTable, enclosingDeclaration, meaning)) { - return true; - } - // If symbol needs qualification, make sure that parent is accessible, if it is then this symbol is accessible too - var accessibleParent = getAccessibleSymbolChain(symbolFromSymbolTable.parent, enclosingDeclaration, getQualifiedLeftMeaning(meaning), useOnlyExternalAliasing); - return !!accessibleParent; - } - function isAccessible(symbolFromSymbolTable, resolvedAliasSymbol) { - if (symbol === (resolvedAliasSymbol || symbolFromSymbolTable)) { - // if the symbolFromSymbolTable is not external module (it could be if it was determined as ambient external module and would be in globals table) - // and if symbolfrom symbolTable or alias resolution matches the symbol, - // check the symbol can be qualified, it is only then this symbol is accessible - return !ts.forEach(symbolFromSymbolTable.declarations, hasExternalModuleSymbol) && - canQualifySymbol(symbolFromSymbolTable, meaning); - } - } - // If symbol is directly available by its name in the symbol table - if (isAccessible(ts.lookUp(symbols, symbol.name))) { - return [symbol]; - } - // Check if symbol is any of the alias - return ts.forEachValue(symbols, function (symbolFromSymbolTable) { - if (symbolFromSymbolTable.flags & 8388608 /* Alias */ && symbolFromSymbolTable.name !== "export=") { - if (!useOnlyExternalAliasing || - // Is this external alias, then use it to name - ts.forEach(symbolFromSymbolTable.declarations, ts.isExternalModuleImportEqualsDeclaration)) { - var resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable); - if (isAccessible(symbolFromSymbolTable, resolveAlias(symbolFromSymbolTable))) { - return [symbolFromSymbolTable]; - } - // Look in the exported members, if we can find accessibleSymbolChain, symbol is accessible using this chain - // but only if the symbolFromSymbolTable can be qualified - var accessibleSymbolsFromExports = resolvedImportedSymbol.exports ? getAccessibleSymbolChainFromSymbolTable(resolvedImportedSymbol.exports) : undefined; - if (accessibleSymbolsFromExports && canQualifySymbol(symbolFromSymbolTable, getQualifiedLeftMeaning(meaning))) { - return [symbolFromSymbolTable].concat(accessibleSymbolsFromExports); - } - } - } - }); - } - if (symbol) { - return forEachSymbolTableInScope(enclosingDeclaration, getAccessibleSymbolChainFromSymbolTable); - } - } - function needsQualification(symbol, enclosingDeclaration, meaning) { - var qualify = false; - forEachSymbolTableInScope(enclosingDeclaration, function (symbolTable) { - // If symbol of this name is not available in the symbol table we are ok - if (!ts.hasProperty(symbolTable, symbol.name)) { - // Continue to the next symbol table - return false; - } - // If the symbol with this name is present it should refer to the symbol - var symbolFromSymbolTable = symbolTable[symbol.name]; - if (symbolFromSymbolTable === symbol) { - // No need to qualify - return true; - } - // Qualify if the symbol from symbol table has same meaning as expected - symbolFromSymbolTable = (symbolFromSymbolTable.flags & 8388608 /* Alias */) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; - if (symbolFromSymbolTable.flags & meaning) { - qualify = true; - return true; - } - // Continue to the next symbol table - return false; - }); - return qualify; - } - function isSymbolAccessible(symbol, enclosingDeclaration, meaning) { - if (symbol && enclosingDeclaration && !(symbol.flags & 262144 /* TypeParameter */)) { - var initialSymbol = symbol; - var meaningToLook = meaning; - while (symbol) { - // Symbol is accessible if it by itself is accessible - var accessibleSymbolChain = getAccessibleSymbolChain(symbol, enclosingDeclaration, meaningToLook, false); - if (accessibleSymbolChain) { - var hasAccessibleDeclarations = hasVisibleDeclarations(accessibleSymbolChain[0]); - if (!hasAccessibleDeclarations) { - return { - accessibility: 1 /* NotAccessible */, - errorSymbolName: symbolToString(initialSymbol, enclosingDeclaration, meaning), - errorModuleName: symbol !== initialSymbol ? symbolToString(symbol, enclosingDeclaration, 1536 /* Namespace */) : undefined - }; - } - return hasAccessibleDeclarations; - } - // If we haven't got the accessible symbol, it doesn't mean the symbol is actually inaccessible. - // It could be a qualified symbol and hence verify the path - // e.g.: - // module m { - // export class c { - // } - // } - // let x: typeof m.c - // In the above example when we start with checking if typeof m.c symbol is accessible, - // we are going to see if c can be accessed in scope directly. - // But it can't, hence the accessible is going to be undefined, but that doesn't mean m.c is inaccessible - // It is accessible if the parent m is accessible because then m.c can be accessed through qualification - meaningToLook = getQualifiedLeftMeaning(meaning); - symbol = getParentOfSymbol(symbol); - } - // This could be a symbol that is not exported in the external module - // or it could be a symbol from different external module that is not aliased and hence cannot be named - var symbolExternalModule = ts.forEach(initialSymbol.declarations, getExternalModuleContainer); - if (symbolExternalModule) { - var enclosingExternalModule = getExternalModuleContainer(enclosingDeclaration); - if (symbolExternalModule !== enclosingExternalModule) { - // name from different external module that is not visible - return { - accessibility: 2 /* CannotBeNamed */, - errorSymbolName: symbolToString(initialSymbol, enclosingDeclaration, meaning), - errorModuleName: symbolToString(symbolExternalModule) - }; - } - } - // Just a local name that is not accessible - return { - accessibility: 1 /* NotAccessible */, - errorSymbolName: symbolToString(initialSymbol, enclosingDeclaration, meaning) - }; - } - return { accessibility: 0 /* Accessible */ }; - function getExternalModuleContainer(declaration) { - for (; declaration; declaration = declaration.parent) { - if (hasExternalModuleSymbol(declaration)) { - return getSymbolOfNode(declaration); - } - } - } - } - function hasExternalModuleSymbol(declaration) { - return (declaration.kind === 208 /* ModuleDeclaration */ && declaration.name.kind === 8 /* StringLiteral */) || - (declaration.kind === 230 /* SourceFile */ && ts.isExternalModule(declaration)); - } - function hasVisibleDeclarations(symbol) { - var aliasesToMakeVisible; - if (ts.forEach(symbol.declarations, function (declaration) { return !getIsDeclarationVisible(declaration); })) { - return undefined; - } - return { accessibility: 0 /* Accessible */, aliasesToMakeVisible: aliasesToMakeVisible }; - function getIsDeclarationVisible(declaration) { - if (!isDeclarationVisible(declaration)) { - // Mark the unexported alias as visible if its parent is visible - // because these kind of aliases can be used to name types in declaration file - var anyImportSyntax = getAnyImportSyntax(declaration); - if (anyImportSyntax && - !(anyImportSyntax.flags & 1 /* Export */) && - isDeclarationVisible(anyImportSyntax.parent)) { - getNodeLinks(declaration).isVisible = true; - if (aliasesToMakeVisible) { - if (!ts.contains(aliasesToMakeVisible, anyImportSyntax)) { - aliasesToMakeVisible.push(anyImportSyntax); - } - } - else { - aliasesToMakeVisible = [anyImportSyntax]; - } - return true; - } - // Declaration is not visible - return false; - } - return true; - } - } - function isEntityNameVisible(entityName, enclosingDeclaration) { - // get symbol of the first identifier of the entityName - var meaning; - if (entityName.parent.kind === 147 /* TypeQuery */) { - // Typeof value - meaning = 107455 /* Value */ | 1048576 /* ExportValue */; - } - else if (entityName.kind === 128 /* QualifiedName */ || entityName.kind === 158 /* PropertyAccessExpression */ || - entityName.parent.kind === 211 /* ImportEqualsDeclaration */) { - // Left identifier from type reference or TypeAlias - // Entity name of the import declaration - meaning = 1536 /* Namespace */; - } - else { - // Type Reference or TypeAlias entity = Identifier - meaning = 793056 /* Type */; - } - var firstIdentifier = getFirstIdentifier(entityName); - var symbol = resolveName(enclosingDeclaration, firstIdentifier.text, meaning, undefined, undefined); - // Verify if the symbol is accessible - return (symbol && hasVisibleDeclarations(symbol)) || { - accessibility: 1 /* NotAccessible */, - errorSymbolName: ts.getTextOfNode(firstIdentifier), - errorNode: firstIdentifier - }; - } - function writeKeyword(writer, kind) { - writer.writeKeyword(ts.tokenToString(kind)); - } - function writePunctuation(writer, kind) { - writer.writePunctuation(ts.tokenToString(kind)); - } - function writeSpace(writer) { - writer.writeSpace(" "); - } - function symbolToString(symbol, enclosingDeclaration, meaning) { - var writer = ts.getSingleLineStringWriter(); - getSymbolDisplayBuilder().buildSymbolDisplay(symbol, writer, enclosingDeclaration, meaning); - var result = writer.string(); - ts.releaseStringWriter(writer); - return result; - } - function signatureToString(signature, enclosingDeclaration, flags) { - var writer = ts.getSingleLineStringWriter(); - getSymbolDisplayBuilder().buildSignatureDisplay(signature, writer, enclosingDeclaration, flags); - var result = writer.string(); - ts.releaseStringWriter(writer); - return result; - } - function typeToString(type, enclosingDeclaration, flags) { - var writer = ts.getSingleLineStringWriter(); - getSymbolDisplayBuilder().buildTypeDisplay(type, writer, enclosingDeclaration, flags); - var result = writer.string(); - ts.releaseStringWriter(writer); - var maxLength = compilerOptions.noErrorTruncation || flags & 4 /* NoTruncation */ ? undefined : 100; - if (maxLength && result.length >= maxLength) { - result = result.substr(0, maxLength - "...".length) + "..."; - } - return result; - } - function getTypeAliasForTypeLiteral(type) { - if (type.symbol && type.symbol.flags & 2048 /* TypeLiteral */) { - var node = type.symbol.declarations[0].parent; - while (node.kind === 152 /* ParenthesizedType */) { - node = node.parent; - } - if (node.kind === 206 /* TypeAliasDeclaration */) { - return getSymbolOfNode(node); - } - } - return undefined; - } - // This is for caching the result of getSymbolDisplayBuilder. Do not access directly. - var _displayBuilder; - function getSymbolDisplayBuilder() { - /** - * Writes only the name of the symbol out to the writer. Uses the original source text - * for the name of the symbol if it is available to match how the user inputted the name. - */ - function appendSymbolNameOnly(symbol, writer) { - if (symbol.declarations && symbol.declarations.length > 0) { - var declaration = symbol.declarations[0]; - if (declaration.name) { - writer.writeSymbol(ts.declarationNameToString(declaration.name), symbol); - return; - } - } - writer.writeSymbol(symbol.name, symbol); - } - /** - * Enclosing declaration is optional when we don't want to get qualified name in the enclosing declaration scope - * Meaning needs to be specified if the enclosing declaration is given - */ - function buildSymbolDisplay(symbol, writer, enclosingDeclaration, meaning, flags, typeFlags) { - var parentSymbol; - function appendParentTypeArgumentsAndSymbolName(symbol) { - if (parentSymbol) { - // Write type arguments of instantiated class/interface here - if (flags & 1 /* WriteTypeParametersOrArguments */) { - if (symbol.flags & 16777216 /* Instantiated */) { - buildDisplayForTypeArgumentsAndDelimiters(getTypeParametersOfClassOrInterface(parentSymbol), symbol.mapper, writer, enclosingDeclaration); - } - else { - buildTypeParameterDisplayFromSymbol(parentSymbol, writer, enclosingDeclaration); - } - } - writePunctuation(writer, 20 /* DotToken */); - } - parentSymbol = symbol; - appendSymbolNameOnly(symbol, writer); - } - // Let the writer know we just wrote out a symbol. The declaration emitter writer uses - // this to determine if an import it has previously seen (and not written out) needs - // to be written to the file once the walk of the tree is complete. - // - // NOTE(cyrusn): This approach feels somewhat unfortunate. A simple pass over the tree - // up front (for example, during checking) could determine if we need to emit the imports - // and we could then access that data during declaration emit. - writer.trackSymbol(symbol, enclosingDeclaration, meaning); - function walkSymbol(symbol, meaning) { - if (symbol) { - var accessibleSymbolChain = getAccessibleSymbolChain(symbol, enclosingDeclaration, meaning, !!(flags & 2 /* UseOnlyExternalAliasing */)); - if (!accessibleSymbolChain || - needsQualification(accessibleSymbolChain[0], enclosingDeclaration, accessibleSymbolChain.length === 1 ? meaning : getQualifiedLeftMeaning(meaning))) { - // Go up and add our parent. - walkSymbol(getParentOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol), getQualifiedLeftMeaning(meaning)); - } - if (accessibleSymbolChain) { - for (var _i = 0; _i < accessibleSymbolChain.length; _i++) { - var accessibleSymbol = accessibleSymbolChain[_i]; - appendParentTypeArgumentsAndSymbolName(accessibleSymbol); - } - } - else { - // If we didn't find accessible symbol chain for this symbol, break if this is external module - if (!parentSymbol && ts.forEach(symbol.declarations, hasExternalModuleSymbol)) { - return; - } - // if this is anonymous type break - if (symbol.flags & 2048 /* TypeLiteral */ || symbol.flags & 4096 /* ObjectLiteral */) { - return; - } - appendParentTypeArgumentsAndSymbolName(symbol); - } - } - } - // Get qualified name if the symbol is not a type parameter - // and there is an enclosing declaration or we specifically - // asked for it - var isTypeParameter = symbol.flags & 262144 /* TypeParameter */; - var typeFormatFlag = 128 /* UseFullyQualifiedType */ & typeFlags; - if (!isTypeParameter && (enclosingDeclaration || typeFormatFlag)) { - walkSymbol(symbol, meaning); - return; - } - return appendParentTypeArgumentsAndSymbolName(symbol); - } - function buildTypeDisplay(type, writer, enclosingDeclaration, globalFlags, symbolStack) { - var globalFlagsToPass = globalFlags & 16 /* WriteOwnNameForAnyLike */; - return writeType(type, globalFlags); - function writeType(type, flags) { - // Write undefined/null type as any - if (type.flags & 2097279 /* Intrinsic */) { - // Special handling for unknown / resolving types, they should show up as any and not unknown or __resolving - writer.writeKeyword(!(globalFlags & 16 /* WriteOwnNameForAnyLike */) && isTypeAny(type) - ? "any" - : type.intrinsicName); - } - else if (type.flags & 4096 /* Reference */) { - writeTypeReference(type, flags); - } - else if (type.flags & (1024 /* Class */ | 2048 /* Interface */ | 128 /* Enum */ | 512 /* TypeParameter */)) { - // The specified symbol flags need to be reinterpreted as type flags - buildSymbolDisplay(type.symbol, writer, enclosingDeclaration, 793056 /* Type */, 0 /* None */, flags); - } - else if (type.flags & 8192 /* Tuple */) { - writeTupleType(type); - } - else if (type.flags & 16384 /* Union */) { - writeUnionType(type, flags); - } - else if (type.flags & 32768 /* Anonymous */) { - writeAnonymousType(type, flags); - } - else if (type.flags & 256 /* StringLiteral */) { - writer.writeStringLiteral(type.text); - } - else { - // Should never get here - // { ... } - writePunctuation(writer, 14 /* OpenBraceToken */); - writeSpace(writer); - writePunctuation(writer, 21 /* DotDotDotToken */); - writeSpace(writer); - writePunctuation(writer, 15 /* CloseBraceToken */); - } - } - function writeTypeList(types, union) { - for (var i = 0; i < types.length; i++) { - if (i > 0) { - if (union) { - writeSpace(writer); - } - writePunctuation(writer, union ? 44 /* BarToken */ : 23 /* CommaToken */); - writeSpace(writer); - } - writeType(types[i], union ? 64 /* InElementType */ : 0 /* None */); - } - } - function writeSymbolTypeReference(symbol, typeArguments, pos, end) { - // Unnamed function expressions, arrow functions, and unnamed class expressions have reserved names that - // we don't want to display - if (!isReservedMemberName(symbol.name)) { - buildSymbolDisplay(symbol, writer, enclosingDeclaration, 793056 /* Type */); - } - if (pos < end) { - writePunctuation(writer, 24 /* LessThanToken */); - writeType(typeArguments[pos++], 0 /* None */); - while (pos < end) { - writePunctuation(writer, 23 /* CommaToken */); - writeSpace(writer); - writeType(typeArguments[pos++], 0 /* None */); - } - writePunctuation(writer, 25 /* GreaterThanToken */); - } - } - function writeTypeReference(type, flags) { - var typeArguments = type.typeArguments; - if (type.target === globalArrayType && !(flags & 1 /* WriteArrayAsGenericType */)) { - writeType(typeArguments[0], 64 /* InElementType */); - writePunctuation(writer, 18 /* OpenBracketToken */); - writePunctuation(writer, 19 /* CloseBracketToken */); - } - else { - // Write the type reference in the format f.g.C where A and B are type arguments - // for outer type parameters, and f and g are the respective declaring containers of those - // type parameters. - var outerTypeParameters = type.target.outerTypeParameters; - var i = 0; - if (outerTypeParameters) { - var length_1 = outerTypeParameters.length; - while (i < length_1) { - // Find group of type arguments for type parameters with the same declaring container. - var start = i; - var parent_3 = getParentSymbolOfTypeParameter(outerTypeParameters[i]); - do { - i++; - } while (i < length_1 && getParentSymbolOfTypeParameter(outerTypeParameters[i]) === parent_3); - // When type parameters are their own type arguments for the whole group (i.e. we have - // the default outer type arguments), we don't show the group. - if (!ts.rangeEquals(outerTypeParameters, typeArguments, start, i)) { - writeSymbolTypeReference(parent_3, typeArguments, start, i); - writePunctuation(writer, 20 /* DotToken */); - } - } - } - writeSymbolTypeReference(type.symbol, typeArguments, i, typeArguments.length); - } - } - function writeTupleType(type) { - writePunctuation(writer, 18 /* OpenBracketToken */); - writeTypeList(type.elementTypes, false); - writePunctuation(writer, 19 /* CloseBracketToken */); - } - function writeUnionType(type, flags) { - if (flags & 64 /* InElementType */) { - writePunctuation(writer, 16 /* OpenParenToken */); - } - writeTypeList(type.types, true); - if (flags & 64 /* InElementType */) { - writePunctuation(writer, 17 /* CloseParenToken */); - } - } - function writeAnonymousType(type, flags) { - var symbol = type.symbol; - if (symbol) { - // Always use 'typeof T' for type of class, enum, and module objects - if (symbol.flags & (32 /* Class */ | 384 /* Enum */ | 512 /* ValueModule */)) { - writeTypeofSymbol(type, flags); - } - else if (shouldWriteTypeOfFunctionSymbol()) { - writeTypeofSymbol(type, flags); - } - else if (ts.contains(symbolStack, symbol)) { - // If type is an anonymous type literal in a type alias declaration, use type alias name - var typeAlias = getTypeAliasForTypeLiteral(type); - if (typeAlias) { - // The specified symbol flags need to be reinterpreted as type flags - buildSymbolDisplay(typeAlias, writer, enclosingDeclaration, 793056 /* Type */, 0 /* None */, flags); - } - else { - // Recursive usage, use any - writeKeyword(writer, 112 /* AnyKeyword */); - } - } - else { - // Since instantiations of the same anonymous type have the same symbol, tracking symbols instead - // of types allows us to catch circular references to instantiations of the same anonymous type - if (!symbolStack) { - symbolStack = []; - } - symbolStack.push(symbol); - writeLiteralType(type, flags); - symbolStack.pop(); - } - } - else { - // Anonymous types with no symbol are never circular - writeLiteralType(type, flags); - } - function shouldWriteTypeOfFunctionSymbol() { - var isStaticMethodSymbol = !!(symbol.flags & 8192 /* Method */ && - ts.forEach(symbol.declarations, function (declaration) { return declaration.flags & 128 /* Static */; })); - var isNonLocalFunctionSymbol = !!(symbol.flags & 16 /* Function */) && - (symbol.parent || - ts.forEach(symbol.declarations, function (declaration) { - return declaration.parent.kind === 230 /* SourceFile */ || declaration.parent.kind === 209 /* ModuleBlock */; - })); - if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { - // typeof is allowed only for static/non local functions - return !!(flags & 2 /* UseTypeOfFunction */) || - (ts.contains(symbolStack, symbol)); // it is type of the symbol uses itself recursively - } - } - } - function writeTypeofSymbol(type, typeFormatFlags) { - writeKeyword(writer, 97 /* TypeOfKeyword */); - writeSpace(writer); - buildSymbolDisplay(type.symbol, writer, enclosingDeclaration, 107455 /* Value */, 0 /* None */, typeFormatFlags); - } - function getIndexerParameterName(type, indexKind, fallbackName) { - var declaration = getIndexDeclarationOfSymbol(type.symbol, indexKind); - if (!declaration) { - // declaration might not be found if indexer was added from the contextual type. - // in this case use fallback name - return fallbackName; - } - ts.Debug.assert(declaration.parameters.length !== 0); - return ts.declarationNameToString(declaration.parameters[0].name); - } - function writeLiteralType(type, flags) { - var resolved = resolveObjectOrUnionTypeMembers(type); - if (!resolved.properties.length && !resolved.stringIndexType && !resolved.numberIndexType) { - if (!resolved.callSignatures.length && !resolved.constructSignatures.length) { - writePunctuation(writer, 14 /* OpenBraceToken */); - writePunctuation(writer, 15 /* CloseBraceToken */); - return; - } - if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) { - if (flags & 64 /* InElementType */) { - writePunctuation(writer, 16 /* OpenParenToken */); - } - buildSignatureDisplay(resolved.callSignatures[0], writer, enclosingDeclaration, globalFlagsToPass | 8 /* WriteArrowStyleSignature */, symbolStack); - if (flags & 64 /* InElementType */) { - writePunctuation(writer, 17 /* CloseParenToken */); - } - return; - } - if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) { - if (flags & 64 /* InElementType */) { - writePunctuation(writer, 16 /* OpenParenToken */); - } - writeKeyword(writer, 88 /* NewKeyword */); - writeSpace(writer); - buildSignatureDisplay(resolved.constructSignatures[0], writer, enclosingDeclaration, globalFlagsToPass | 8 /* WriteArrowStyleSignature */, symbolStack); - if (flags & 64 /* InElementType */) { - writePunctuation(writer, 17 /* CloseParenToken */); - } - return; - } - } - writePunctuation(writer, 14 /* OpenBraceToken */); - writer.writeLine(); - writer.increaseIndent(); - for (var _i = 0, _a = resolved.callSignatures; _i < _a.length; _i++) { - var signature = _a[_i]; - buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, symbolStack); - writePunctuation(writer, 22 /* SemicolonToken */); - writer.writeLine(); - } - for (var _b = 0, _c = resolved.constructSignatures; _b < _c.length; _b++) { - var signature = _c[_b]; - writeKeyword(writer, 88 /* NewKeyword */); - writeSpace(writer); - buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, symbolStack); - writePunctuation(writer, 22 /* SemicolonToken */); - writer.writeLine(); - } - if (resolved.stringIndexType) { - // [x: string]: - writePunctuation(writer, 18 /* OpenBracketToken */); - writer.writeParameter(getIndexerParameterName(resolved, 0 /* String */, "x")); - writePunctuation(writer, 51 /* ColonToken */); - writeSpace(writer); - writeKeyword(writer, 123 /* StringKeyword */); - writePunctuation(writer, 19 /* CloseBracketToken */); - writePunctuation(writer, 51 /* ColonToken */); - writeSpace(writer); - writeType(resolved.stringIndexType, 0 /* None */); - writePunctuation(writer, 22 /* SemicolonToken */); - writer.writeLine(); - } - if (resolved.numberIndexType) { - // [x: number]: - writePunctuation(writer, 18 /* OpenBracketToken */); - writer.writeParameter(getIndexerParameterName(resolved, 1 /* Number */, "x")); - writePunctuation(writer, 51 /* ColonToken */); - writeSpace(writer); - writeKeyword(writer, 121 /* NumberKeyword */); - writePunctuation(writer, 19 /* CloseBracketToken */); - writePunctuation(writer, 51 /* ColonToken */); - writeSpace(writer); - writeType(resolved.numberIndexType, 0 /* None */); - writePunctuation(writer, 22 /* SemicolonToken */); - writer.writeLine(); - } - for (var _d = 0, _e = resolved.properties; _d < _e.length; _d++) { - var p = _e[_d]; - var t = getTypeOfSymbol(p); - if (p.flags & (16 /* Function */ | 8192 /* Method */) && !getPropertiesOfObjectType(t).length) { - var signatures = getSignaturesOfType(t, 0 /* Call */); - for (var _f = 0; _f < signatures.length; _f++) { - var signature = signatures[_f]; - buildSymbolDisplay(p, writer); - if (p.flags & 536870912 /* Optional */) { - writePunctuation(writer, 50 /* QuestionToken */); - } - buildSignatureDisplay(signature, writer, enclosingDeclaration, globalFlagsToPass, symbolStack); - writePunctuation(writer, 22 /* SemicolonToken */); - writer.writeLine(); - } - } - else { - buildSymbolDisplay(p, writer); - if (p.flags & 536870912 /* Optional */) { - writePunctuation(writer, 50 /* QuestionToken */); - } - writePunctuation(writer, 51 /* ColonToken */); - writeSpace(writer); - writeType(t, 0 /* None */); - writePunctuation(writer, 22 /* SemicolonToken */); - writer.writeLine(); - } - } - writer.decreaseIndent(); - writePunctuation(writer, 15 /* CloseBraceToken */); - } - } - function buildTypeParameterDisplayFromSymbol(symbol, writer, enclosingDeclaraiton, flags) { - var targetSymbol = getTargetSymbol(symbol); - if (targetSymbol.flags & 32 /* Class */ || targetSymbol.flags & 64 /* Interface */) { - buildDisplayForTypeParametersAndDelimiters(getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol), writer, enclosingDeclaraiton, flags); - } - } - function buildTypeParameterDisplay(tp, writer, enclosingDeclaration, flags, symbolStack) { - appendSymbolNameOnly(tp.symbol, writer); - var constraint = getConstraintOfTypeParameter(tp); - if (constraint) { - writeSpace(writer); - writeKeyword(writer, 79 /* ExtendsKeyword */); - writeSpace(writer); - buildTypeDisplay(constraint, writer, enclosingDeclaration, flags, symbolStack); - } - } - function buildParameterDisplay(p, writer, enclosingDeclaration, flags, symbolStack) { - var parameterNode = p.valueDeclaration; - if (ts.isRestParameter(parameterNode)) { - writePunctuation(writer, 21 /* DotDotDotToken */); - } - appendSymbolNameOnly(p, writer); - if (isOptionalParameter(parameterNode)) { - writePunctuation(writer, 50 /* QuestionToken */); - } - writePunctuation(writer, 51 /* ColonToken */); - writeSpace(writer); - buildTypeDisplay(getTypeOfSymbol(p), writer, enclosingDeclaration, flags, symbolStack); - } - function buildDisplayForTypeParametersAndDelimiters(typeParameters, writer, enclosingDeclaration, flags, symbolStack) { - if (typeParameters && typeParameters.length) { - writePunctuation(writer, 24 /* LessThanToken */); - for (var i = 0; i < typeParameters.length; i++) { - if (i > 0) { - writePunctuation(writer, 23 /* CommaToken */); - writeSpace(writer); - } - buildTypeParameterDisplay(typeParameters[i], writer, enclosingDeclaration, flags, symbolStack); - } - writePunctuation(writer, 25 /* GreaterThanToken */); - } - } - function buildDisplayForTypeArgumentsAndDelimiters(typeParameters, mapper, writer, enclosingDeclaration, flags, symbolStack) { - if (typeParameters && typeParameters.length) { - writePunctuation(writer, 24 /* LessThanToken */); - for (var i = 0; i < typeParameters.length; i++) { - if (i > 0) { - writePunctuation(writer, 23 /* CommaToken */); - writeSpace(writer); - } - buildTypeDisplay(mapper(typeParameters[i]), writer, enclosingDeclaration, 0 /* None */); - } - writePunctuation(writer, 25 /* GreaterThanToken */); - } - } - function buildDisplayForParametersAndDelimiters(parameters, writer, enclosingDeclaration, flags, symbolStack) { - writePunctuation(writer, 16 /* OpenParenToken */); - for (var i = 0; i < parameters.length; i++) { - if (i > 0) { - writePunctuation(writer, 23 /* CommaToken */); - writeSpace(writer); - } - buildParameterDisplay(parameters[i], writer, enclosingDeclaration, flags, symbolStack); - } - writePunctuation(writer, 17 /* CloseParenToken */); - } - function buildReturnTypeDisplay(signature, writer, enclosingDeclaration, flags, symbolStack) { - if (flags & 8 /* WriteArrowStyleSignature */) { - writeSpace(writer); - writePunctuation(writer, 32 /* EqualsGreaterThanToken */); - } - else { - writePunctuation(writer, 51 /* ColonToken */); - } - writeSpace(writer); - buildTypeDisplay(getReturnTypeOfSignature(signature), writer, enclosingDeclaration, flags, symbolStack); - } - function buildSignatureDisplay(signature, writer, enclosingDeclaration, flags, symbolStack) { - if (signature.target && (flags & 32 /* WriteTypeArgumentsOfSignature */)) { - // Instantiated signature, write type arguments instead - // This is achieved by passing in the mapper separately - buildDisplayForTypeArgumentsAndDelimiters(signature.target.typeParameters, signature.mapper, writer, enclosingDeclaration); - } - else { - buildDisplayForTypeParametersAndDelimiters(signature.typeParameters, writer, enclosingDeclaration, flags, symbolStack); - } - buildDisplayForParametersAndDelimiters(signature.parameters, writer, enclosingDeclaration, flags, symbolStack); - buildReturnTypeDisplay(signature, writer, enclosingDeclaration, flags, symbolStack); - } - return _displayBuilder || (_displayBuilder = { - symbolToString: symbolToString, - typeToString: typeToString, - buildSymbolDisplay: buildSymbolDisplay, - buildTypeDisplay: buildTypeDisplay, - buildTypeParameterDisplay: buildTypeParameterDisplay, - buildParameterDisplay: buildParameterDisplay, - buildDisplayForParametersAndDelimiters: buildDisplayForParametersAndDelimiters, - buildDisplayForTypeParametersAndDelimiters: buildDisplayForTypeParametersAndDelimiters, - buildDisplayForTypeArgumentsAndDelimiters: buildDisplayForTypeArgumentsAndDelimiters, - buildTypeParameterDisplayFromSymbol: buildTypeParameterDisplayFromSymbol, - buildSignatureDisplay: buildSignatureDisplay, - buildReturnTypeDisplay: buildReturnTypeDisplay - }); - } - function isDeclarationVisible(node) { - function getContainingExternalModule(node) { - for (; node; node = node.parent) { - if (node.kind === 208 /* ModuleDeclaration */) { - if (node.name.kind === 8 /* StringLiteral */) { - return node; - } - } - else if (node.kind === 230 /* SourceFile */) { - return ts.isExternalModule(node) ? node : undefined; - } - } - ts.Debug.fail("getContainingModule cant reach here"); - } - function isUsedInExportAssignment(node) { - // Get source File and see if it is external module and has export assigned symbol - var externalModule = getContainingExternalModule(node); - var exportAssignmentSymbol; - var resolvedExportSymbol; - if (externalModule) { - // This is export assigned symbol node - var externalModuleSymbol = getSymbolOfNode(externalModule); - exportAssignmentSymbol = getExportAssignmentSymbol(externalModuleSymbol); - var symbolOfNode = getSymbolOfNode(node); - if (isSymbolUsedInExportAssignment(symbolOfNode)) { - return true; - } - // if symbolOfNode is alias declaration, resolve the symbol declaration and check - if (symbolOfNode.flags & 8388608 /* Alias */) { - return isSymbolUsedInExportAssignment(resolveAlias(symbolOfNode)); - } - } - // Check if the symbol is used in export assignment - function isSymbolUsedInExportAssignment(symbol) { - if (exportAssignmentSymbol === symbol) { - return true; - } - if (exportAssignmentSymbol && !!(exportAssignmentSymbol.flags & 8388608 /* Alias */)) { - // if export assigned symbol is alias declaration, resolve the alias - resolvedExportSymbol = resolvedExportSymbol || resolveAlias(exportAssignmentSymbol); - if (resolvedExportSymbol === symbol) { - return true; - } - // Container of resolvedExportSymbol is visible - return ts.forEach(resolvedExportSymbol.declarations, function (current) { - while (current) { - if (current === node) { - return true; - } - current = current.parent; - } - }); - } - } - } - function determineIfDeclarationIsVisible() { - switch (node.kind) { - case 155 /* BindingElement */: - return isDeclarationVisible(node.parent.parent); - case 201 /* VariableDeclaration */: - if (ts.isBindingPattern(node.name) && - !node.name.elements.length) { - // If the binding pattern is empty, this variable declaration is not visible - return false; - } - // Otherwise fall through - case 208 /* ModuleDeclaration */: - case 204 /* ClassDeclaration */: - case 205 /* InterfaceDeclaration */: - case 206 /* TypeAliasDeclaration */: - case 203 /* FunctionDeclaration */: - case 207 /* EnumDeclaration */: - case 211 /* ImportEqualsDeclaration */: - var parent_4 = getDeclarationContainer(node); - // If the node is not exported or it is not ambient module element (except import declaration) - if (!(ts.getCombinedNodeFlags(node) & 1 /* Export */) && - !(node.kind !== 211 /* ImportEqualsDeclaration */ && parent_4.kind !== 230 /* SourceFile */ && ts.isInAmbientContext(parent_4))) { - return isGlobalSourceFile(parent_4); - } - // Exported members/ambient module elements (exception import declaration) are visible if parent is visible - return isDeclarationVisible(parent_4); - case 134 /* PropertyDeclaration */: - case 133 /* PropertySignature */: - case 138 /* GetAccessor */: - case 139 /* SetAccessor */: - case 136 /* MethodDeclaration */: - case 135 /* MethodSignature */: - if (node.flags & (32 /* Private */ | 64 /* Protected */)) { - // Private/protected properties/methods are not visible - return false; - } - // Public properties/methods are visible if its parents are visible, so let it fall into next case statement - case 137 /* Constructor */: - case 141 /* ConstructSignature */: - case 140 /* CallSignature */: - case 142 /* IndexSignature */: - case 131 /* Parameter */: - case 209 /* ModuleBlock */: - case 145 /* FunctionType */: - case 146 /* ConstructorType */: - case 148 /* TypeLiteral */: - case 144 /* TypeReference */: - case 149 /* ArrayType */: - case 150 /* TupleType */: - case 151 /* UnionType */: - case 152 /* ParenthesizedType */: - return isDeclarationVisible(node.parent); - // Default binding, import specifier and namespace import is visible - // only on demand so by default it is not visible - case 213 /* ImportClause */: - case 214 /* NamespaceImport */: - case 216 /* ImportSpecifier */: - return false; - // Type parameters are always visible - case 130 /* TypeParameter */: - // Source file is always visible - case 230 /* SourceFile */: - return true; - // Export assignements do not create name bindings outside the module - case 217 /* ExportAssignment */: - return false; - default: - ts.Debug.fail("isDeclarationVisible unknown: SyntaxKind: " + node.kind); - } - } - if (node) { - var links = getNodeLinks(node); - if (links.isVisible === undefined) { - links.isVisible = !!determineIfDeclarationIsVisible(); - } - return links.isVisible; - } - } - function collectLinkedAliases(node) { - var exportSymbol; - if (node.parent && node.parent.kind === 217 /* ExportAssignment */) { - exportSymbol = resolveName(node.parent, node.text, 107455 /* Value */ | 793056 /* Type */ | 1536 /* Namespace */, ts.Diagnostics.Cannot_find_name_0, node); - } - else if (node.parent.kind === 220 /* ExportSpecifier */) { - exportSymbol = getTargetOfExportSpecifier(node.parent); - } - var result = []; - if (exportSymbol) { - buildVisibleNodeList(exportSymbol.declarations); - } - return result; - function buildVisibleNodeList(declarations) { - ts.forEach(declarations, function (declaration) { - getNodeLinks(declaration).isVisible = true; - var resultNode = getAnyImportSyntax(declaration) || declaration; - if (!ts.contains(result, resultNode)) { - result.push(resultNode); - } - if (ts.isInternalModuleImportEqualsDeclaration(declaration)) { - // Add the referenced top container visible - var internalModuleReference = declaration.moduleReference; - var firstIdentifier = getFirstIdentifier(internalModuleReference); - var importSymbol = resolveName(declaration, firstIdentifier.text, 107455 /* Value */ | 793056 /* Type */ | 1536 /* Namespace */, ts.Diagnostics.Cannot_find_name_0, firstIdentifier); - buildVisibleNodeList(importSymbol.declarations); - } - }); - } - } - // Push an entry on the type resolution stack. If an entry with the given target is not already on the stack, - // a new entry with that target and an associated result value of true is pushed on the stack, and the value - // true is returned. Otherwise, a circularity has occurred and the result values of the existing entry and - // all entries pushed after it are changed to false, and the value false is returned. The target object provides - // a unique identity for a particular type resolution result: Symbol instances are used to track resolution of - // SymbolLinks.type, SymbolLinks instances are used to track resolution of SymbolLinks.declaredType, and - // Signature instances are used to track resolution of Signature.resolvedReturnType. - function pushTypeResolution(target) { - var i = 0; - var count = resolutionTargets.length; - while (i < count && resolutionTargets[i] !== target) { - i++; - } - if (i < count) { - do { - resolutionResults[i++] = false; - } while (i < count); - return false; - } - resolutionTargets.push(target); - resolutionResults.push(true); - return true; - } - // Pop an entry from the type resolution stack and return its associated result value. The result value will - // be true if no circularities were detected, or false if a circularity was found. - function popTypeResolution() { - resolutionTargets.pop(); - return resolutionResults.pop(); - } - function getDeclarationContainer(node) { - node = ts.getRootDeclaration(node); - // Parent chain: - // VaribleDeclaration -> VariableDeclarationList -> VariableStatement -> 'Declaration Container' - return node.kind === 201 /* VariableDeclaration */ ? node.parent.parent.parent : node.parent; - } - function getTypeOfPrototypeProperty(prototype) { - // TypeScript 1.0 spec (April 2014): 8.4 - // Every class automatically contains a static property member named 'prototype', - // the type of which is an instantiation of the class type with type Any supplied as a type argument for each type parameter. - // It is an error to explicitly declare a static property member with the name 'prototype'. - var classType = getDeclaredTypeOfSymbol(prototype.parent); - return classType.typeParameters ? createTypeReference(classType, ts.map(classType.typeParameters, function (_) { return anyType; })) : classType; - } - // Return the type of the given property in the given type, or undefined if no such property exists - function getTypeOfPropertyOfType(type, name) { - var prop = getPropertyOfType(type, name); - return prop ? getTypeOfSymbol(prop) : undefined; - } - function isTypeAny(type) { - return type && (type.flags & 1 /* Any */) !== 0; - } - // Return the inferred type for a binding element - function getTypeForBindingElement(declaration) { - var pattern = declaration.parent; - var parentType = getTypeForVariableLikeDeclaration(pattern.parent); - // If parent has the unknown (error) type, then so does this binding element - if (parentType === unknownType) { - return unknownType; - } - // If no type was specified or inferred for parent, or if the specified or inferred type is any, - // infer from the initializer of the binding element if one is present. Otherwise, go with the - // undefined or any type of the parent. - if (!parentType || isTypeAny(parentType)) { - if (declaration.initializer) { - return checkExpressionCached(declaration.initializer); - } - return parentType; - } - var type; - if (pattern.kind === 153 /* ObjectBindingPattern */) { - // Use explicitly specified property name ({ p: xxx } form), or otherwise the implied name ({ p } form) - var name_9 = declaration.propertyName || declaration.name; - // Use type of the specified property, or otherwise, for a numeric name, the type of the numeric index signature, - // or otherwise the type of the string index signature. - type = getTypeOfPropertyOfType(parentType, name_9.text) || - isNumericLiteralName(name_9.text) && getIndexTypeOfType(parentType, 1 /* Number */) || - getIndexTypeOfType(parentType, 0 /* String */); - if (!type) { - error(name_9, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(parentType), ts.declarationNameToString(name_9)); - return unknownType; - } - } - else { - // This elementType will be used if the specific property corresponding to this index is not - // present (aka the tuple element property). This call also checks that the parentType is in - // fact an iterable or array (depending on target language). - var elementType = checkIteratedTypeOrElementType(parentType, pattern, false); - if (!declaration.dotDotDotToken) { - if (isTypeAny(elementType)) { - return elementType; - } - // Use specific property type when parent is a tuple or numeric index type when parent is an array - var propName = "" + ts.indexOf(pattern.elements, declaration); - type = isTupleLikeType(parentType) - ? getTypeOfPropertyOfType(parentType, propName) - : elementType; - if (!type) { - if (isTupleType(parentType)) { - error(declaration, ts.Diagnostics.Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2, typeToString(parentType), parentType.elementTypes.length, pattern.elements.length); - } - else { - error(declaration, ts.Diagnostics.Type_0_has_no_property_1, typeToString(parentType), propName); - } - return unknownType; - } - } - else { - // Rest element has an array type with the same element type as the parent type - type = createArrayType(elementType); - } - } - return type; - } - // Return the inferred type for a variable, parameter, or property declaration - function getTypeForVariableLikeDeclaration(declaration) { - // A variable declared in a for..in statement is always of type any - if (declaration.parent.parent.kind === 190 /* ForInStatement */) { - return anyType; - } - if (declaration.parent.parent.kind === 191 /* ForOfStatement */) { - // checkRightHandSideOfForOf will return undefined if the for-of expression type was - // missing properties/signatures required to get its iteratedType (like - // [Symbol.iterator] or next). This may be because we accessed properties from anyType, - // or it may have led to an error inside getElementTypeOfIterable. - return checkRightHandSideOfForOf(declaration.parent.parent.expression) || anyType; - } - if (ts.isBindingPattern(declaration.parent)) { - return getTypeForBindingElement(declaration); - } - // Use type from type annotation if one is present - if (declaration.type) { - return getTypeFromTypeNode(declaration.type); - } - if (declaration.kind === 131 /* Parameter */) { - var func = declaration.parent; - // For a parameter of a set accessor, use the type of the get accessor if one is present - if (func.kind === 139 /* SetAccessor */ && !ts.hasDynamicName(func)) { - var getter = ts.getDeclarationOfKind(declaration.parent.symbol, 138 /* GetAccessor */); - if (getter) { - return getReturnTypeOfSignature(getSignatureFromDeclaration(getter)); - } - } - // Use contextual parameter type if one is available - var type = getContextuallyTypedParameterType(declaration); - if (type) { - return type; - } - } - // Use the type of the initializer expression if one is present - if (declaration.initializer) { - return checkExpressionCached(declaration.initializer); - } - // If it is a short-hand property assignment, use the type of the identifier - if (declaration.kind === 228 /* ShorthandPropertyAssignment */) { - return checkIdentifier(declaration.name); - } - // No type specified and nothing can be inferred - return undefined; - } - // Return the type implied by a binding pattern element. This is the type of the initializer of the element if - // one is present. Otherwise, if the element is itself a binding pattern, it is the type implied by the binding - // pattern. Otherwise, it is the type any. - function getTypeFromBindingElement(element) { - if (element.initializer) { - return getWidenedType(checkExpressionCached(element.initializer)); - } - if (ts.isBindingPattern(element.name)) { - return getTypeFromBindingPattern(element.name); - } - return anyType; - } - // Return the type implied by an object binding pattern - function getTypeFromObjectBindingPattern(pattern) { - var members = {}; - ts.forEach(pattern.elements, function (e) { - var flags = 4 /* Property */ | 67108864 /* Transient */ | (e.initializer ? 536870912 /* Optional */ : 0); - var name = e.propertyName || e.name; - var symbol = createSymbol(flags, name.text); - symbol.type = getTypeFromBindingElement(e); - members[symbol.name] = symbol; - }); - return createAnonymousType(undefined, members, emptyArray, emptyArray, undefined, undefined); - } - // Return the type implied by an array binding pattern - function getTypeFromArrayBindingPattern(pattern) { - var hasSpreadElement = false; - var elementTypes = []; - ts.forEach(pattern.elements, function (e) { - elementTypes.push(e.kind === 178 /* OmittedExpression */ || e.dotDotDotToken ? anyType : getTypeFromBindingElement(e)); - if (e.dotDotDotToken) { - hasSpreadElement = true; - } - }); - if (!elementTypes.length) { - return languageVersion >= 2 /* ES6 */ ? createIterableType(anyType) : anyArrayType; - } - else if (hasSpreadElement) { - var unionOfElements = getUnionType(elementTypes); - return languageVersion >= 2 /* ES6 */ ? createIterableType(unionOfElements) : createArrayType(unionOfElements); - } - // If the pattern has at least one element, and no rest element, then it should imply a tuple type. - return createTupleType(elementTypes); - } - // Return the type implied by a binding pattern. This is the type implied purely by the binding pattern itself - // and without regard to its context (i.e. without regard any type annotation or initializer associated with the - // declaration in which the binding pattern is contained). For example, the implied type of [x, y] is [any, any] - // and the implied type of { x, y: z = 1 } is { x: any; y: number; }. The type implied by a binding pattern is - // used as the contextual type of an initializer associated with the binding pattern. Also, for a destructuring - // parameter with no type annotation or initializer, the type implied by the binding pattern becomes the type of - // the parameter. - function getTypeFromBindingPattern(pattern) { - return pattern.kind === 153 /* ObjectBindingPattern */ - ? getTypeFromObjectBindingPattern(pattern) - : getTypeFromArrayBindingPattern(pattern); - } - // Return the type associated with a variable, parameter, or property declaration. In the simple case this is the type - // specified in a type annotation or inferred from an initializer. However, in the case of a destructuring declaration it - // is a bit more involved. For example: - // - // var [x, s = ""] = [1, "one"]; - // - // Here, the array literal [1, "one"] is contextually typed by the type [any, string], which is the implied type of the - // binding pattern [x, s = ""]. Because the contextual type is a tuple type, the resulting type of [1, "one"] is the - // tuple type [number, string]. Thus, the type inferred for 'x' is number and the type inferred for 's' is string. - function getWidenedTypeForVariableLikeDeclaration(declaration, reportErrors) { - var type = getTypeForVariableLikeDeclaration(declaration); - if (type) { - if (reportErrors) { - reportErrorsFromWidening(declaration, type); - } - // During a normal type check we'll never get to here with a property assignment (the check of the containing - // object literal uses a different path). We exclude widening only so that language services and type verification - // tools see the actual type. - return declaration.kind !== 227 /* PropertyAssignment */ ? getWidenedType(type) : type; - } - // If no type was specified and nothing could be inferred, and if the declaration specifies a binding pattern, use - // the type implied by the binding pattern - if (ts.isBindingPattern(declaration.name)) { - return getTypeFromBindingPattern(declaration.name); - } - // Rest parameters default to type any[], other parameters default to type any - type = declaration.dotDotDotToken ? anyArrayType : anyType; - // Report implicit any errors unless this is a private property within an ambient declaration - if (reportErrors && compilerOptions.noImplicitAny) { - var root = ts.getRootDeclaration(declaration); - if (!isPrivateWithinAmbient(root) && !(root.kind === 131 /* Parameter */ && isPrivateWithinAmbient(root.parent))) { - reportImplicitAnyError(declaration, type); - } - } - return type; - } - function getTypeOfVariableOrParameterOrProperty(symbol) { - var links = getSymbolLinks(symbol); - if (!links.type) { - // Handle prototype property - if (symbol.flags & 134217728 /* Prototype */) { - return links.type = getTypeOfPrototypeProperty(symbol); - } - // Handle catch clause variables - var declaration = symbol.valueDeclaration; - if (declaration.parent.kind === 226 /* CatchClause */) { - return links.type = anyType; - } - // Handle export default expressions - if (declaration.kind === 217 /* ExportAssignment */) { - return links.type = checkExpression(declaration.expression); - } - // Handle variable, parameter or property - if (!pushTypeResolution(symbol)) { - return unknownType; - } - var type = getWidenedTypeForVariableLikeDeclaration(declaration, true); - if (!popTypeResolution()) { - if (symbol.valueDeclaration.type) { - // Variable has type annotation that circularly references the variable itself - type = unknownType; - error(symbol.valueDeclaration, ts.Diagnostics._0_is_referenced_directly_or_indirectly_in_its_own_type_annotation, symbolToString(symbol)); - } - else { - // Variable has initializer that circularly references the variable itself - type = anyType; - if (compilerOptions.noImplicitAny) { - error(symbol.valueDeclaration, ts.Diagnostics._0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer, symbolToString(symbol)); - } - } - } - links.type = type; - } - return links.type; - } - function getSetAccessorTypeAnnotationNode(accessor) { - return accessor && accessor.parameters.length > 0 && accessor.parameters[0].type; - } - function getAnnotatedAccessorType(accessor) { - if (accessor) { - if (accessor.kind === 138 /* GetAccessor */) { - return accessor.type && getTypeFromTypeNode(accessor.type); - } - else { - var setterTypeAnnotation = getSetAccessorTypeAnnotationNode(accessor); - return setterTypeAnnotation && getTypeFromTypeNode(setterTypeAnnotation); - } - } - return undefined; - } - function getTypeOfAccessors(symbol) { - var links = getSymbolLinks(symbol); - if (!links.type) { - if (!pushTypeResolution(symbol)) { - return unknownType; - } - var getter = ts.getDeclarationOfKind(symbol, 138 /* GetAccessor */); - var setter = ts.getDeclarationOfKind(symbol, 139 /* SetAccessor */); - var type; - // First try to see if the user specified a return type on the get-accessor. - var getterReturnType = getAnnotatedAccessorType(getter); - if (getterReturnType) { - type = getterReturnType; - } - else { - // If the user didn't specify a return type, try to use the set-accessor's parameter type. - var setterParameterType = getAnnotatedAccessorType(setter); - if (setterParameterType) { - type = setterParameterType; - } - else { - // If there are no specified types, try to infer it from the body of the get accessor if it exists. - if (getter && getter.body) { - type = getReturnTypeFromBody(getter); - } - else { - if (compilerOptions.noImplicitAny) { - error(setter, ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_type_annotation, symbolToString(symbol)); - } - type = anyType; - } - } - } - if (!popTypeResolution()) { - type = anyType; - if (compilerOptions.noImplicitAny) { - var getter_1 = ts.getDeclarationOfKind(symbol, 138 /* GetAccessor */); - error(getter_1, ts.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, symbolToString(symbol)); - } - } - links.type = type; - } - return links.type; - } - function getTypeOfFuncClassEnumModule(symbol) { - var links = getSymbolLinks(symbol); - if (!links.type) { - links.type = createObjectType(32768 /* Anonymous */, symbol); - } - return links.type; - } - function getTypeOfEnumMember(symbol) { - var links = getSymbolLinks(symbol); - if (!links.type) { - links.type = getDeclaredTypeOfEnum(getParentOfSymbol(symbol)); - } - return links.type; - } - function getTypeOfAlias(symbol) { - var links = getSymbolLinks(symbol); - if (!links.type) { - var targetSymbol = resolveAlias(symbol); - // It only makes sense to get the type of a value symbol. If the result of resolving - // the alias is not a value, then it has no type. To get the type associated with a - // type symbol, call getDeclaredTypeOfSymbol. - // This check is important because without it, a call to getTypeOfSymbol could end - // up recursively calling getTypeOfAlias, causing a stack overflow. - links.type = targetSymbol.flags & 107455 /* Value */ - ? getTypeOfSymbol(targetSymbol) - : unknownType; - } - return links.type; - } - function getTypeOfInstantiatedSymbol(symbol) { - var links = getSymbolLinks(symbol); - if (!links.type) { - links.type = instantiateType(getTypeOfSymbol(links.target), links.mapper); - } - return links.type; - } - function getTypeOfSymbol(symbol) { - if (symbol.flags & 16777216 /* Instantiated */) { - return getTypeOfInstantiatedSymbol(symbol); - } - if (symbol.flags & (3 /* Variable */ | 4 /* Property */)) { - return getTypeOfVariableOrParameterOrProperty(symbol); - } - if (symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 384 /* Enum */ | 512 /* ValueModule */)) { - return getTypeOfFuncClassEnumModule(symbol); - } - if (symbol.flags & 8 /* EnumMember */) { - return getTypeOfEnumMember(symbol); - } - if (symbol.flags & 98304 /* Accessor */) { - return getTypeOfAccessors(symbol); - } - if (symbol.flags & 8388608 /* Alias */) { - return getTypeOfAlias(symbol); - } - return unknownType; - } - function getTargetType(type) { - return type.flags & 4096 /* Reference */ ? type.target : type; - } - function hasBaseType(type, checkBase) { - return check(type); - function check(type) { - var target = getTargetType(type); - return target === checkBase || ts.forEach(getBaseTypes(target), check); - } - } - // Appends the type parameters given by a list of declarations to a set of type parameters and returns the resulting set. - // The function allocates a new array if the input type parameter set is undefined, but otherwise it modifies the set - // in-place and returns the same array. - function appendTypeParameters(typeParameters, declarations) { - for (var _i = 0; _i < declarations.length; _i++) { - var declaration = declarations[_i]; - var tp = getDeclaredTypeOfTypeParameter(getSymbolOfNode(declaration)); - if (!typeParameters) { - typeParameters = [tp]; - } - else if (!ts.contains(typeParameters, tp)) { - typeParameters.push(tp); - } - } - return typeParameters; - } - // Appends the outer type parameters of a node to a set of type parameters and returns the resulting set. The function - // allocates a new array if the input type parameter set is undefined, but otherwise it modifies the set in-place and - // returns the same array. - function appendOuterTypeParameters(typeParameters, node) { - while (true) { - node = node.parent; - if (!node) { - return typeParameters; - } - if (node.kind === 204 /* ClassDeclaration */ || node.kind === 203 /* FunctionDeclaration */ || - node.kind === 165 /* FunctionExpression */ || node.kind === 136 /* MethodDeclaration */ || - node.kind === 166 /* ArrowFunction */) { - var declarations = node.typeParameters; - if (declarations) { - return appendTypeParameters(appendOuterTypeParameters(typeParameters, node), declarations); - } - } - } - } - // The outer type parameters are those defined by enclosing generic classes, methods, or functions. - function getOuterTypeParametersOfClassOrInterface(symbol) { - var kind = symbol.flags & 32 /* Class */ ? 204 /* ClassDeclaration */ : 205 /* InterfaceDeclaration */; - return appendOuterTypeParameters(undefined, ts.getDeclarationOfKind(symbol, kind)); - } - // The local type parameters are the combined set of type parameters from all declarations of the class, - // interface, or type alias. - function getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol) { - var result; - for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { - var node = _a[_i]; - if (node.kind === 205 /* InterfaceDeclaration */ || node.kind === 204 /* ClassDeclaration */ || node.kind === 206 /* TypeAliasDeclaration */) { - var declaration = node; - if (declaration.typeParameters) { - result = appendTypeParameters(result, declaration.typeParameters); - } - } - } - return result; - } - // The full set of type parameters for a generic class or interface type consists of its outer type parameters plus - // its locally declared type parameters. - function getTypeParametersOfClassOrInterface(symbol) { - return ts.concatenate(getOuterTypeParametersOfClassOrInterface(symbol), getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol)); - } - function getBaseTypes(type) { - var typeWithBaseTypes = type; - if (!typeWithBaseTypes.baseTypes) { - if (type.symbol.flags & 32 /* Class */) { - resolveBaseTypesOfClass(typeWithBaseTypes); - } - else if (type.symbol.flags & 64 /* Interface */) { - resolveBaseTypesOfInterface(typeWithBaseTypes); - } - else { - ts.Debug.fail("type must be class or interface"); - } - } - return typeWithBaseTypes.baseTypes; - } - function resolveBaseTypesOfClass(type) { - type.baseTypes = []; - var declaration = ts.getDeclarationOfKind(type.symbol, 204 /* ClassDeclaration */); - var baseTypeNode = ts.getClassExtendsHeritageClauseElement(declaration); - if (baseTypeNode) { - var baseType = getTypeFromTypeNode(baseTypeNode); - if (baseType !== unknownType) { - if (getTargetType(baseType).flags & 1024 /* Class */) { - if (type !== baseType && !hasBaseType(baseType, type)) { - type.baseTypes.push(baseType); - } - else { - error(declaration, ts.Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString(type, undefined, 1 /* WriteArrayAsGenericType */)); - } - } - else { - error(baseTypeNode, ts.Diagnostics.A_class_may_only_extend_another_class); - } - } - } - } - function resolveBaseTypesOfInterface(type) { - type.baseTypes = []; - for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) { - var declaration = _a[_i]; - if (declaration.kind === 205 /* InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) { - for (var _b = 0, _c = ts.getInterfaceBaseTypeNodes(declaration); _b < _c.length; _b++) { - var node = _c[_b]; - var baseType = getTypeFromTypeNode(node); - if (baseType !== unknownType) { - if (getTargetType(baseType).flags & (1024 /* Class */ | 2048 /* Interface */)) { - if (type !== baseType && !hasBaseType(baseType, type)) { - type.baseTypes.push(baseType); - } - else { - error(declaration, ts.Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString(type, undefined, 1 /* WriteArrayAsGenericType */)); - } - } - else { - error(node, ts.Diagnostics.An_interface_may_only_extend_a_class_or_another_interface); - } - } - } - } - } - } - function getDeclaredTypeOfClassOrInterface(symbol) { - var links = getSymbolLinks(symbol); - if (!links.declaredType) { - var kind = symbol.flags & 32 /* Class */ ? 1024 /* Class */ : 2048 /* Interface */; - var type = links.declaredType = createObjectType(kind, symbol); - var outerTypeParameters = getOuterTypeParametersOfClassOrInterface(symbol); - var localTypeParameters = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol); - if (outerTypeParameters || localTypeParameters) { - type.flags |= 4096 /* Reference */; - type.typeParameters = ts.concatenate(outerTypeParameters, localTypeParameters); - type.outerTypeParameters = outerTypeParameters; - type.localTypeParameters = localTypeParameters; - type.instantiations = {}; - type.instantiations[getTypeListId(type.typeParameters)] = type; - type.target = type; - type.typeArguments = type.typeParameters; - } - } - return links.declaredType; - } - function getDeclaredTypeOfTypeAlias(symbol) { - var links = getSymbolLinks(symbol); - if (!links.declaredType) { - // Note that we use the links object as the target here because the symbol object is used as the unique - // identity for resolution of the 'type' property in SymbolLinks. - if (!pushTypeResolution(links)) { - return unknownType; - } - var declaration = ts.getDeclarationOfKind(symbol, 206 /* TypeAliasDeclaration */); - var type = getTypeFromTypeNode(declaration.type); - if (popTypeResolution()) { - links.typeParameters = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(symbol); - if (links.typeParameters) { - // Initialize the instantiation cache for generic type aliases. The declared type corresponds to - // an instantiation of the type alias with the type parameters supplied as type arguments. - links.instantiations = {}; - links.instantiations[getTypeListId(links.typeParameters)] = type; - } - } - else { - type = unknownType; - error(declaration.name, ts.Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol)); - } - links.declaredType = type; - } - return links.declaredType; - } - function getDeclaredTypeOfEnum(symbol) { - var links = getSymbolLinks(symbol); - if (!links.declaredType) { - var type = createType(128 /* Enum */); - type.symbol = symbol; - links.declaredType = type; - } - return links.declaredType; - } - function getDeclaredTypeOfTypeParameter(symbol) { - var links = getSymbolLinks(symbol); - if (!links.declaredType) { - var type = createType(512 /* TypeParameter */); - type.symbol = symbol; - if (!ts.getDeclarationOfKind(symbol, 130 /* TypeParameter */).constraint) { - type.constraint = noConstraintType; - } - links.declaredType = type; - } - return links.declaredType; - } - function getDeclaredTypeOfAlias(symbol) { - var links = getSymbolLinks(symbol); - if (!links.declaredType) { - links.declaredType = getDeclaredTypeOfSymbol(resolveAlias(symbol)); - } - return links.declaredType; - } - function getDeclaredTypeOfSymbol(symbol) { - ts.Debug.assert((symbol.flags & 16777216 /* Instantiated */) === 0); - if (symbol.flags & (32 /* Class */ | 64 /* Interface */)) { - return getDeclaredTypeOfClassOrInterface(symbol); - } - if (symbol.flags & 524288 /* TypeAlias */) { - return getDeclaredTypeOfTypeAlias(symbol); - } - if (symbol.flags & 384 /* Enum */) { - return getDeclaredTypeOfEnum(symbol); - } - if (symbol.flags & 262144 /* TypeParameter */) { - return getDeclaredTypeOfTypeParameter(symbol); - } - if (symbol.flags & 8388608 /* Alias */) { - return getDeclaredTypeOfAlias(symbol); - } - return unknownType; - } - function createSymbolTable(symbols) { - var result = {}; - for (var _i = 0; _i < symbols.length; _i++) { - var symbol = symbols[_i]; - result[symbol.name] = symbol; - } - return result; - } - function createInstantiatedSymbolTable(symbols, mapper) { - var result = {}; - for (var _i = 0; _i < symbols.length; _i++) { - var symbol = symbols[_i]; - result[symbol.name] = instantiateSymbol(symbol, mapper); - } - return result; - } - function addInheritedMembers(symbols, baseSymbols) { - for (var _i = 0; _i < baseSymbols.length; _i++) { - var s = baseSymbols[_i]; - if (!ts.hasProperty(symbols, s.name)) { - symbols[s.name] = s; - } - } - } - function addInheritedSignatures(signatures, baseSignatures) { - if (baseSignatures) { - for (var _i = 0; _i < baseSignatures.length; _i++) { - var signature = baseSignatures[_i]; - signatures.push(signature); - } - } - } - function resolveDeclaredMembers(type) { - if (!type.declaredProperties) { - var symbol = type.symbol; - type.declaredProperties = getNamedMembers(symbol.members); - type.declaredCallSignatures = getSignaturesOfSymbol(symbol.members["__call"]); - type.declaredConstructSignatures = getSignaturesOfSymbol(symbol.members["__new"]); - type.declaredStringIndexType = getIndexTypeOfSymbol(symbol, 0 /* String */); - type.declaredNumberIndexType = getIndexTypeOfSymbol(symbol, 1 /* Number */); - } - return type; - } - function resolveClassOrInterfaceMembers(type) { - var target = resolveDeclaredMembers(type); - var members = target.symbol.members; - var callSignatures = target.declaredCallSignatures; - var constructSignatures = target.declaredConstructSignatures; - var stringIndexType = target.declaredStringIndexType; - var numberIndexType = target.declaredNumberIndexType; - var baseTypes = getBaseTypes(target); - if (baseTypes.length) { - members = createSymbolTable(target.declaredProperties); - for (var _i = 0; _i < baseTypes.length; _i++) { - var baseType = baseTypes[_i]; - addInheritedMembers(members, getPropertiesOfObjectType(baseType)); - callSignatures = ts.concatenate(callSignatures, getSignaturesOfType(baseType, 0 /* Call */)); - constructSignatures = ts.concatenate(constructSignatures, getSignaturesOfType(baseType, 1 /* Construct */)); - stringIndexType = stringIndexType || getIndexTypeOfType(baseType, 0 /* String */); - numberIndexType = numberIndexType || getIndexTypeOfType(baseType, 1 /* Number */); - } - } - setObjectTypeMembers(type, members, callSignatures, constructSignatures, stringIndexType, numberIndexType); - } - function resolveTypeReferenceMembers(type) { - var target = resolveDeclaredMembers(type.target); - var mapper = createTypeMapper(target.typeParameters, type.typeArguments); - var members = createInstantiatedSymbolTable(target.declaredProperties, mapper); - var callSignatures = instantiateList(target.declaredCallSignatures, mapper, instantiateSignature); - var constructSignatures = instantiateList(target.declaredConstructSignatures, mapper, instantiateSignature); - var stringIndexType = target.declaredStringIndexType ? instantiateType(target.declaredStringIndexType, mapper) : undefined; - var numberIndexType = target.declaredNumberIndexType ? instantiateType(target.declaredNumberIndexType, mapper) : undefined; - ts.forEach(getBaseTypes(target), function (baseType) { - var instantiatedBaseType = instantiateType(baseType, mapper); - addInheritedMembers(members, getPropertiesOfObjectType(instantiatedBaseType)); - callSignatures = ts.concatenate(callSignatures, getSignaturesOfType(instantiatedBaseType, 0 /* Call */)); - constructSignatures = ts.concatenate(constructSignatures, getSignaturesOfType(instantiatedBaseType, 1 /* Construct */)); - stringIndexType = stringIndexType || getIndexTypeOfType(instantiatedBaseType, 0 /* String */); - numberIndexType = numberIndexType || getIndexTypeOfType(instantiatedBaseType, 1 /* Number */); - }); - setObjectTypeMembers(type, members, callSignatures, constructSignatures, stringIndexType, numberIndexType); - } - function createSignature(declaration, typeParameters, parameters, resolvedReturnType, typePredicate, minArgumentCount, hasRestParameter, hasStringLiterals) { - var sig = new Signature(checker); - sig.declaration = declaration; - sig.typeParameters = typeParameters; - sig.parameters = parameters; - sig.resolvedReturnType = resolvedReturnType; - sig.typePredicate = typePredicate; - sig.minArgumentCount = minArgumentCount; - sig.hasRestParameter = hasRestParameter; - sig.hasStringLiterals = hasStringLiterals; - return sig; - } - function cloneSignature(sig) { - return createSignature(sig.declaration, sig.typeParameters, sig.parameters, sig.resolvedReturnType, sig.typePredicate, sig.minArgumentCount, sig.hasRestParameter, sig.hasStringLiterals); - } - function getDefaultConstructSignatures(classType) { - var baseTypes = getBaseTypes(classType); - if (baseTypes.length) { - var baseType = baseTypes[0]; - var baseSignatures = getSignaturesOfType(getTypeOfSymbol(baseType.symbol), 1 /* Construct */); - return ts.map(baseSignatures, function (baseSignature) { - var signature = baseType.flags & 4096 /* Reference */ ? - getSignatureInstantiation(baseSignature, baseType.typeArguments) : cloneSignature(baseSignature); - signature.typeParameters = classType.localTypeParameters; - signature.resolvedReturnType = classType; - return signature; - }); - } - return [createSignature(undefined, classType.localTypeParameters, emptyArray, classType, undefined, 0, false, false)]; - } - function createTupleTypeMemberSymbols(memberTypes) { - var members = {}; - for (var i = 0; i < memberTypes.length; i++) { - var symbol = createSymbol(4 /* Property */ | 67108864 /* Transient */, "" + i); - symbol.type = memberTypes[i]; - members[i] = symbol; - } - return members; - } - function resolveTupleTypeMembers(type) { - var arrayType = resolveObjectOrUnionTypeMembers(createArrayType(getUnionType(type.elementTypes))); - var members = createTupleTypeMemberSymbols(type.elementTypes); - addInheritedMembers(members, arrayType.properties); - setObjectTypeMembers(type, members, arrayType.callSignatures, arrayType.constructSignatures, arrayType.stringIndexType, arrayType.numberIndexType); - } - function signatureListsIdentical(s, t) { - if (s.length !== t.length) { - return false; - } - for (var i = 0; i < s.length; i++) { - if (!compareSignatures(s[i], t[i], false, compareTypes)) { - return false; - } - } - return true; - } - // If the lists of call or construct signatures in the given types are all identical except for return types, - // and if none of the signatures are generic, return a list of signatures that has substitutes a union of the - // return types of the corresponding signatures in each resulting signature. - function getUnionSignatures(types, kind) { - var signatureLists = ts.map(types, function (t) { return getSignaturesOfType(t, kind); }); - var signatures = signatureLists[0]; - for (var _i = 0; _i < signatures.length; _i++) { - var signature = signatures[_i]; - if (signature.typeParameters) { - return emptyArray; - } - } - for (var i_1 = 1; i_1 < signatureLists.length; i_1++) { - if (!signatureListsIdentical(signatures, signatureLists[i_1])) { - return emptyArray; - } - } - var result = ts.map(signatures, cloneSignature); - for (var i = 0; i < result.length; i++) { - var s = result[i]; - // Clear resolved return type we possibly got from cloneSignature - s.resolvedReturnType = undefined; - s.unionSignatures = ts.map(signatureLists, function (signatures) { return signatures[i]; }); - } - return result; - } - function getUnionIndexType(types, kind) { - var indexTypes = []; - for (var _i = 0; _i < types.length; _i++) { - var type = types[_i]; - var indexType = getIndexTypeOfType(type, kind); - if (!indexType) { - return undefined; - } - indexTypes.push(indexType); - } - return getUnionType(indexTypes); - } - function resolveUnionTypeMembers(type) { - // The members and properties collections are empty for union types. To get all properties of a union - // type use getPropertiesOfType (only the language service uses this). - var callSignatures = getUnionSignatures(type.types, 0 /* Call */); - var constructSignatures = getUnionSignatures(type.types, 1 /* Construct */); - var stringIndexType = getUnionIndexType(type.types, 0 /* String */); - var numberIndexType = getUnionIndexType(type.types, 1 /* Number */); - setObjectTypeMembers(type, emptySymbols, callSignatures, constructSignatures, stringIndexType, numberIndexType); - } - function resolveAnonymousTypeMembers(type) { - var symbol = type.symbol; - var members; - var callSignatures; - var constructSignatures; - var stringIndexType; - var numberIndexType; - if (symbol.flags & 2048 /* TypeLiteral */) { - members = symbol.members; - callSignatures = getSignaturesOfSymbol(members["__call"]); - constructSignatures = getSignaturesOfSymbol(members["__new"]); - stringIndexType = getIndexTypeOfSymbol(symbol, 0 /* String */); - numberIndexType = getIndexTypeOfSymbol(symbol, 1 /* Number */); - } - else { - // Combinations of function, class, enum and module - members = emptySymbols; - callSignatures = emptyArray; - constructSignatures = emptyArray; - if (symbol.flags & 1952 /* HasExports */) { - members = getExportsOfSymbol(symbol); - } - if (symbol.flags & (16 /* Function */ | 8192 /* Method */)) { - callSignatures = getSignaturesOfSymbol(symbol); - } - if (symbol.flags & 32 /* Class */) { - var classType = getDeclaredTypeOfClassOrInterface(symbol); - constructSignatures = getSignaturesOfSymbol(symbol.members["__constructor"]); - if (!constructSignatures.length) { - constructSignatures = getDefaultConstructSignatures(classType); - } - var baseTypes = getBaseTypes(classType); - if (baseTypes.length) { - members = createSymbolTable(getNamedMembers(members)); - addInheritedMembers(members, getPropertiesOfObjectType(getTypeOfSymbol(baseTypes[0].symbol))); - } - } - stringIndexType = undefined; - numberIndexType = (symbol.flags & 384 /* Enum */) ? stringType : undefined; - } - setObjectTypeMembers(type, members, callSignatures, constructSignatures, stringIndexType, numberIndexType); - } - function resolveObjectOrUnionTypeMembers(type) { - if (!type.members) { - if (type.flags & (1024 /* Class */ | 2048 /* Interface */)) { - resolveClassOrInterfaceMembers(type); - } - else if (type.flags & 32768 /* Anonymous */) { - resolveAnonymousTypeMembers(type); - } - else if (type.flags & 8192 /* Tuple */) { - resolveTupleTypeMembers(type); - } - else if (type.flags & 16384 /* Union */) { - resolveUnionTypeMembers(type); - } - else { - resolveTypeReferenceMembers(type); - } - } - return type; - } - // Return properties of an object type or an empty array for other types - function getPropertiesOfObjectType(type) { - if (type.flags & 48128 /* ObjectType */) { - return resolveObjectOrUnionTypeMembers(type).properties; - } - return emptyArray; - } - // If the given type is an object type and that type has a property by the given name, return - // the symbol for that property. Otherwise return undefined. - function getPropertyOfObjectType(type, name) { - if (type.flags & 48128 /* ObjectType */) { - var resolved = resolveObjectOrUnionTypeMembers(type); - if (ts.hasProperty(resolved.members, name)) { - var symbol = resolved.members[name]; - if (symbolIsValue(symbol)) { - return symbol; - } - } - } - } - function getPropertiesOfUnionType(type) { - var result = []; - ts.forEach(getPropertiesOfType(type.types[0]), function (prop) { - var unionProp = getPropertyOfUnionType(type, prop.name); - if (unionProp) { - result.push(unionProp); - } - }); - return result; - } - function getPropertiesOfType(type) { - type = getApparentType(type); - return type.flags & 16384 /* Union */ ? getPropertiesOfUnionType(type) : getPropertiesOfObjectType(type); - } - // For a type parameter, return the base constraint of the type parameter. For the string, number, - // boolean, and symbol primitive types, return the corresponding object types. Otherwise return the - // type itself. Note that the apparent type of a union type is the union type itself. - function getApparentType(type) { - if (type.flags & 16384 /* Union */) { - type = getReducedTypeOfUnionType(type); - } - if (type.flags & 512 /* TypeParameter */) { - do { - type = getConstraintOfTypeParameter(type); - } while (type && type.flags & 512 /* TypeParameter */); - if (!type) { - type = emptyObjectType; - } - } - if (type.flags & 258 /* StringLike */) { - type = globalStringType; - } - else if (type.flags & 132 /* NumberLike */) { - type = globalNumberType; - } - else if (type.flags & 8 /* Boolean */) { - type = globalBooleanType; - } - else if (type.flags & 2097152 /* ESSymbol */) { - type = globalESSymbolType; - } - return type; - } - function createUnionProperty(unionType, name) { - var types = unionType.types; - var props; - for (var _i = 0; _i < types.length; _i++) { - var current = types[_i]; - var type = getApparentType(current); - if (type !== unknownType) { - var prop = getPropertyOfType(type, name); - if (!prop || getDeclarationFlagsFromSymbol(prop) & (32 /* Private */ | 64 /* Protected */)) { - return undefined; - } - if (!props) { - props = [prop]; - } - else { - props.push(prop); - } - } - } - var propTypes = []; - var declarations = []; - for (var _a = 0; _a < props.length; _a++) { - var prop = props[_a]; - if (prop.declarations) { - declarations.push.apply(declarations, prop.declarations); - } - propTypes.push(getTypeOfSymbol(prop)); - } - var result = createSymbol(4 /* Property */ | 67108864 /* Transient */ | 268435456 /* UnionProperty */, name); - result.unionType = unionType; - result.declarations = declarations; - result.type = getUnionType(propTypes); - return result; - } - function getPropertyOfUnionType(type, name) { - var properties = type.resolvedProperties || (type.resolvedProperties = {}); - if (ts.hasProperty(properties, name)) { - return properties[name]; - } - var property = createUnionProperty(type, name); - if (property) { - properties[name] = property; - } - return property; - } - // Return the symbol for the property with the given name in the given type. Creates synthetic union properties when - // necessary, maps primitive types and type parameters are to their apparent types, and augments with properties from - // Object and Function as appropriate. - function getPropertyOfType(type, name) { - type = getApparentType(type); - if (type.flags & 48128 /* ObjectType */) { - var resolved = resolveObjectOrUnionTypeMembers(type); - if (ts.hasProperty(resolved.members, name)) { - var symbol = resolved.members[name]; - if (symbolIsValue(symbol)) { - return symbol; - } - } - if (resolved === anyFunctionType || resolved.callSignatures.length || resolved.constructSignatures.length) { - var symbol = getPropertyOfObjectType(globalFunctionType, name); - if (symbol) { - return symbol; - } - } - return getPropertyOfObjectType(globalObjectType, name); - } - if (type.flags & 16384 /* Union */) { - return getPropertyOfUnionType(type, name); - } - return undefined; - } - function getSignaturesOfObjectOrUnionType(type, kind) { - if (type.flags & (48128 /* ObjectType */ | 16384 /* Union */)) { - var resolved = resolveObjectOrUnionTypeMembers(type); - return kind === 0 /* Call */ ? resolved.callSignatures : resolved.constructSignatures; - } - return emptyArray; - } - // Return the signatures of the given kind in the given type. Creates synthetic union signatures when necessary and - // maps primitive types and type parameters are to their apparent types. - function getSignaturesOfType(type, kind) { - return getSignaturesOfObjectOrUnionType(getApparentType(type), kind); - } - function typeHasCallOrConstructSignatures(type) { - var apparentType = getApparentType(type); - if (apparentType.flags & (48128 /* ObjectType */ | 16384 /* Union */)) { - var resolved = resolveObjectOrUnionTypeMembers(type); - return resolved.callSignatures.length > 0 - || resolved.constructSignatures.length > 0; - } - return false; - } - function getIndexTypeOfObjectOrUnionType(type, kind) { - if (type.flags & (48128 /* ObjectType */ | 16384 /* Union */)) { - var resolved = resolveObjectOrUnionTypeMembers(type); - return kind === 0 /* String */ ? resolved.stringIndexType : resolved.numberIndexType; - } - } - // Return the index type of the given kind in the given type. Creates synthetic union index types when necessary and - // maps primitive types and type parameters are to their apparent types. - function getIndexTypeOfType(type, kind) { - return getIndexTypeOfObjectOrUnionType(getApparentType(type), kind); - } - // Return list of type parameters with duplicates removed (duplicate identifier errors are generated in the actual - // type checking functions). - function getTypeParametersFromDeclaration(typeParameterDeclarations) { - var result = []; - ts.forEach(typeParameterDeclarations, function (node) { - var tp = getDeclaredTypeOfTypeParameter(node.symbol); - if (!ts.contains(result, tp)) { - result.push(tp); - } - }); - return result; - } - function symbolsToArray(symbols) { - var result = []; - for (var id in symbols) { - if (!isReservedMemberName(id)) { - result.push(symbols[id]); - } - } - return result; - } - function isOptionalParameter(node) { - return ts.hasQuestionToken(node) || !!node.initializer; - } - function getSignatureFromDeclaration(declaration) { - var links = getNodeLinks(declaration); - if (!links.resolvedSignature) { - var classType = declaration.kind === 137 /* Constructor */ ? getDeclaredTypeOfClassOrInterface(declaration.parent.symbol) : undefined; - var typeParameters = classType ? classType.localTypeParameters : - declaration.typeParameters ? getTypeParametersFromDeclaration(declaration.typeParameters) : undefined; - var parameters = []; - var hasStringLiterals = false; - var minArgumentCount = -1; - for (var i = 0, n = declaration.parameters.length; i < n; i++) { - var param = declaration.parameters[i]; - parameters.push(param.symbol); - if (param.type && param.type.kind === 8 /* StringLiteral */) { - hasStringLiterals = true; - } - if (minArgumentCount < 0) { - if (param.initializer || param.questionToken || param.dotDotDotToken) { - minArgumentCount = i; - } - } - } - if (minArgumentCount < 0) { - minArgumentCount = declaration.parameters.length; - } - var returnType; - var typePredicate; - if (classType) { - returnType = classType; - } - else if (declaration.type) { - returnType = getTypeFromTypeNode(declaration.type); - if (declaration.type.kind === 143 /* TypePredicate */) { - var typePredicateNode = declaration.type; - typePredicate = { - parameterName: typePredicateNode.parameterName ? typePredicateNode.parameterName.text : undefined, - parameterIndex: typePredicateNode.parameterName ? getTypePredicateParameterIndex(declaration.parameters, typePredicateNode.parameterName) : undefined, - type: getTypeFromTypeNode(typePredicateNode.type) - }; - } - } - else { - // TypeScript 1.0 spec (April 2014): - // If only one accessor includes a type annotation, the other behaves as if it had the same type annotation. - if (declaration.kind === 138 /* GetAccessor */ && !ts.hasDynamicName(declaration)) { - var setter = ts.getDeclarationOfKind(declaration.symbol, 139 /* SetAccessor */); - returnType = getAnnotatedAccessorType(setter); - } - if (!returnType && ts.nodeIsMissing(declaration.body)) { - returnType = anyType; - } - } - links.resolvedSignature = createSignature(declaration, typeParameters, parameters, returnType, typePredicate, minArgumentCount, ts.hasRestParameter(declaration), hasStringLiterals); - } - return links.resolvedSignature; - } - function getSignaturesOfSymbol(symbol) { - if (!symbol) - return emptyArray; - var result = []; - for (var i = 0, len = symbol.declarations.length; i < len; i++) { - var node = symbol.declarations[i]; - switch (node.kind) { - case 145 /* FunctionType */: - case 146 /* ConstructorType */: - case 203 /* FunctionDeclaration */: - case 136 /* MethodDeclaration */: - case 135 /* MethodSignature */: - case 137 /* Constructor */: - case 140 /* CallSignature */: - case 141 /* ConstructSignature */: - case 142 /* IndexSignature */: - case 138 /* GetAccessor */: - case 139 /* SetAccessor */: - case 165 /* FunctionExpression */: - case 166 /* ArrowFunction */: - // Don't include signature if node is the implementation of an overloaded function. A node is considered - // an implementation node if it has a body and the previous node is of the same kind and immediately - // precedes the implementation node (i.e. has the same parent and ends where the implementation starts). - if (i > 0 && node.body) { - var previous = symbol.declarations[i - 1]; - if (node.parent === previous.parent && node.kind === previous.kind && node.pos === previous.end) { - break; - } - } - result.push(getSignatureFromDeclaration(node)); - } - } - return result; - } - function getReturnTypeOfSignature(signature) { - if (!signature.resolvedReturnType) { - if (!pushTypeResolution(signature)) { - return unknownType; - } - var type; - if (signature.target) { - type = instantiateType(getReturnTypeOfSignature(signature.target), signature.mapper); - } - else if (signature.unionSignatures) { - type = getUnionType(ts.map(signature.unionSignatures, getReturnTypeOfSignature)); - } - else { - type = getReturnTypeFromBody(signature.declaration); - } - if (!popTypeResolution()) { - type = anyType; - if (compilerOptions.noImplicitAny) { - var declaration = signature.declaration; - if (declaration.name) { - error(declaration.name, ts.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, ts.declarationNameToString(declaration.name)); - } - else { - error(declaration, ts.Diagnostics.Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions); - } - } - } - signature.resolvedReturnType = type; - } - return signature.resolvedReturnType; - } - function getRestTypeOfSignature(signature) { - if (signature.hasRestParameter) { - var type = getTypeOfSymbol(ts.lastOrUndefined(signature.parameters)); - if (type.flags & 4096 /* Reference */ && type.target === globalArrayType) { - return type.typeArguments[0]; - } - } - return anyType; - } - function getSignatureInstantiation(signature, typeArguments) { - return instantiateSignature(signature, createTypeMapper(signature.typeParameters, typeArguments), true); - } - function getErasedSignature(signature) { - if (!signature.typeParameters) - return signature; - if (!signature.erasedSignatureCache) { - if (signature.target) { - signature.erasedSignatureCache = instantiateSignature(getErasedSignature(signature.target), signature.mapper); - } - else { - signature.erasedSignatureCache = instantiateSignature(signature, createTypeEraser(signature.typeParameters), true); - } - } - return signature.erasedSignatureCache; - } - function getOrCreateTypeFromSignature(signature) { - // There are two ways to declare a construct signature, one is by declaring a class constructor - // using the constructor keyword, and the other is declaring a bare construct signature in an - // object type literal or interface (using the new keyword). Each way of declaring a constructor - // will result in a different declaration kind. - if (!signature.isolatedSignatureType) { - var isConstructor = signature.declaration.kind === 137 /* Constructor */ || signature.declaration.kind === 141 /* ConstructSignature */; - var type = createObjectType(32768 /* Anonymous */ | 131072 /* FromSignature */); - type.members = emptySymbols; - type.properties = emptyArray; - type.callSignatures = !isConstructor ? [signature] : emptyArray; - type.constructSignatures = isConstructor ? [signature] : emptyArray; - signature.isolatedSignatureType = type; - } - return signature.isolatedSignatureType; - } - function getIndexSymbol(symbol) { - return symbol.members["__index"]; - } - function getIndexDeclarationOfSymbol(symbol, kind) { - var syntaxKind = kind === 1 /* Number */ ? 121 /* NumberKeyword */ : 123 /* StringKeyword */; - var indexSymbol = getIndexSymbol(symbol); - if (indexSymbol) { - var len = indexSymbol.declarations.length; - for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) { - var decl = _a[_i]; - var node = decl; - if (node.parameters.length === 1) { - var parameter = node.parameters[0]; - if (parameter && parameter.type && parameter.type.kind === syntaxKind) { - return node; - } - } - } - } - return undefined; - } - function getIndexTypeOfSymbol(symbol, kind) { - var declaration = getIndexDeclarationOfSymbol(symbol, kind); - return declaration - ? declaration.type ? getTypeFromTypeNode(declaration.type) : anyType - : undefined; - } - function getConstraintOfTypeParameter(type) { - if (!type.constraint) { - if (type.target) { - var targetConstraint = getConstraintOfTypeParameter(type.target); - type.constraint = targetConstraint ? instantiateType(targetConstraint, type.mapper) : noConstraintType; - } - else { - type.constraint = getTypeFromTypeNode(ts.getDeclarationOfKind(type.symbol, 130 /* TypeParameter */).constraint); - } - } - return type.constraint === noConstraintType ? undefined : type.constraint; - } - function getParentSymbolOfTypeParameter(typeParameter) { - return getSymbolOfNode(ts.getDeclarationOfKind(typeParameter.symbol, 130 /* TypeParameter */).parent); - } - function getTypeListId(types) { - switch (types.length) { - case 1: - return "" + types[0].id; - case 2: - return types[0].id + "," + types[1].id; - default: - var result = ""; - for (var i = 0; i < types.length; i++) { - if (i > 0) { - result += ","; - } - result += types[i].id; - } - return result; - } - } - // This function is used to propagate widening flags when creating new object types references and union types. - // It is only necessary to do so if a constituent type might be the undefined type, the null type, or the type - // of an object literal (since those types have widening related information we need to track). - function getWideningFlagsOfTypes(types) { - var result = 0; - for (var _i = 0; _i < types.length; _i++) { - var type = types[_i]; - result |= type.flags; - } - return result & 1572864 /* RequiresWidening */; - } - function createTypeReference(target, typeArguments) { - var id = getTypeListId(typeArguments); - var type = target.instantiations[id]; - if (!type) { - var flags = 4096 /* Reference */ | getWideningFlagsOfTypes(typeArguments); - type = target.instantiations[id] = createObjectType(flags, target.symbol); - type.target = target; - type.typeArguments = typeArguments; - } - return type; - } - function isTypeParameterReferenceIllegalInConstraint(typeReferenceNode, typeParameterSymbol) { - var links = getNodeLinks(typeReferenceNode); - if (links.isIllegalTypeReferenceInConstraint !== undefined) { - return links.isIllegalTypeReferenceInConstraint; - } - // bubble up to the declaration - var currentNode = typeReferenceNode; - // forEach === exists - while (!ts.forEach(typeParameterSymbol.declarations, function (d) { return d.parent === currentNode.parent; })) { - currentNode = currentNode.parent; - } - // if last step was made from the type parameter this means that path has started somewhere in constraint which is illegal - links.isIllegalTypeReferenceInConstraint = currentNode.kind === 130 /* TypeParameter */; - return links.isIllegalTypeReferenceInConstraint; - } - function checkTypeParameterHasIllegalReferencesInConstraint(typeParameter) { - var typeParameterSymbol; - function check(n) { - if (n.kind === 144 /* TypeReference */ && n.typeName.kind === 65 /* Identifier */) { - var links = getNodeLinks(n); - if (links.isIllegalTypeReferenceInConstraint === undefined) { - var symbol = resolveName(typeParameter, n.typeName.text, 793056 /* Type */, undefined, undefined); - if (symbol && (symbol.flags & 262144 /* TypeParameter */)) { - // TypeScript 1.0 spec (April 2014): 3.4.1 - // Type parameters declared in a particular type parameter list - // may not be referenced in constraints in that type parameter list - // symbol.declaration.parent === typeParameter.parent - // -> typeParameter and symbol.declaration originate from the same type parameter list - // -> illegal for all declarations in symbol - // forEach === exists - links.isIllegalTypeReferenceInConstraint = ts.forEach(symbol.declarations, function (d) { return d.parent == typeParameter.parent; }); - } - } - if (links.isIllegalTypeReferenceInConstraint) { - error(typeParameter, ts.Diagnostics.Constraint_of_a_type_parameter_cannot_reference_any_type_parameter_from_the_same_type_parameter_list); - } - } - ts.forEachChild(n, check); - } - if (typeParameter.constraint) { - typeParameterSymbol = getSymbolOfNode(typeParameter); - check(typeParameter.constraint); - } - } - // Get type from reference to class or interface - function getTypeFromClassOrInterfaceReference(node, symbol) { - var type = getDeclaredTypeOfSymbol(symbol); - var typeParameters = type.localTypeParameters; - if (typeParameters) { - if (!node.typeArguments || node.typeArguments.length !== typeParameters.length) { - error(node, ts.Diagnostics.Generic_type_0_requires_1_type_argument_s, typeToString(type, undefined, 1 /* WriteArrayAsGenericType */), typeParameters.length); - return unknownType; - } - // In a type reference, the outer type parameters of the referenced class or interface are automatically - // supplied as type arguments and the type reference only specifies arguments for the local type parameters - // of the class or interface. - return createTypeReference(type, ts.concatenate(type.outerTypeParameters, ts.map(node.typeArguments, getTypeFromTypeNode))); - } - if (node.typeArguments) { - error(node, ts.Diagnostics.Type_0_is_not_generic, typeToString(type)); - return unknownType; - } - return type; - } - // Get type from reference to type alias. When a type alias is generic, the declared type of the type alias may include - // references to the type parameters of the alias. We replace those with the actual type arguments by instantiating the - // declared type. Instantiations are cached using the type identities of the type arguments as the key. - function getTypeFromTypeAliasReference(node, symbol) { - var type = getDeclaredTypeOfSymbol(symbol); - var links = getSymbolLinks(symbol); - var typeParameters = links.typeParameters; - if (typeParameters) { - if (!node.typeArguments || node.typeArguments.length !== typeParameters.length) { - error(node, ts.Diagnostics.Generic_type_0_requires_1_type_argument_s, symbolToString(symbol), typeParameters.length); - return unknownType; - } - var typeArguments = ts.map(node.typeArguments, getTypeFromTypeNode); - var id = getTypeListId(typeArguments); - return links.instantiations[id] || (links.instantiations[id] = instantiateType(type, createTypeMapper(typeParameters, typeArguments))); - } - if (node.typeArguments) { - error(node, ts.Diagnostics.Type_0_is_not_generic, symbolToString(symbol)); - return unknownType; - } - return type; - } - // Get type from reference to named type that cannot be generic (enum or type parameter) - function getTypeFromNonGenericTypeReference(node, symbol) { - if (symbol.flags & 262144 /* TypeParameter */ && isTypeParameterReferenceIllegalInConstraint(node, symbol)) { - // TypeScript 1.0 spec (April 2014): 3.4.1 - // Type parameters declared in a particular type parameter list - // may not be referenced in constraints in that type parameter list - // Implementation: such type references are resolved to 'unknown' type that usually denotes error - return unknownType; - } - if (node.typeArguments) { - error(node, ts.Diagnostics.Type_0_is_not_generic, symbolToString(symbol)); - return unknownType; - } - return getDeclaredTypeOfSymbol(symbol); - } - function getTypeFromTypeReference(node) { - var links = getNodeLinks(node); - if (!links.resolvedType) { - // We only support expressions that are simple qualified names. For other expressions this produces undefined. - var typeNameOrExpression = node.kind === 144 /* TypeReference */ ? node.typeName : - ts.isSupportedExpressionWithTypeArguments(node) ? node.expression : - undefined; - var symbol = typeNameOrExpression && resolveEntityName(typeNameOrExpression, 793056 /* Type */) || unknownSymbol; - var type = symbol === unknownSymbol ? unknownType : - symbol.flags & (32 /* Class */ | 64 /* Interface */) ? getTypeFromClassOrInterfaceReference(node, symbol) : - symbol.flags & 524288 /* TypeAlias */ ? getTypeFromTypeAliasReference(node, symbol) : - getTypeFromNonGenericTypeReference(node, symbol); - // Cache both the resolved symbol and the resolved type. The resolved symbol is needed in when we check the - // type reference in checkTypeReferenceOrExpressionWithTypeArguments. - links.resolvedSymbol = symbol; - links.resolvedType = type; - } - return links.resolvedType; - } - function getTypeFromTypeQueryNode(node) { - var links = getNodeLinks(node); - if (!links.resolvedType) { - // TypeScript 1.0 spec (April 2014): 3.6.3 - // The expression is processed as an identifier expression (section 4.3) - // or property access expression(section 4.10), - // the widened type(section 3.9) of which becomes the result. - links.resolvedType = getWidenedType(checkExpressionOrQualifiedName(node.exprName)); - } - return links.resolvedType; - } - function getTypeOfGlobalSymbol(symbol, arity) { - function getTypeDeclaration(symbol) { - var declarations = symbol.declarations; - for (var _i = 0; _i < declarations.length; _i++) { - var declaration = declarations[_i]; - switch (declaration.kind) { - case 204 /* ClassDeclaration */: - case 205 /* InterfaceDeclaration */: - case 207 /* EnumDeclaration */: - return declaration; - } - } - } - if (!symbol) { - return arity ? emptyGenericType : emptyObjectType; - } - var type = getDeclaredTypeOfSymbol(symbol); - if (!(type.flags & 48128 /* ObjectType */)) { - error(getTypeDeclaration(symbol), ts.Diagnostics.Global_type_0_must_be_a_class_or_interface_type, symbol.name); - return arity ? emptyGenericType : emptyObjectType; - } - if ((type.typeParameters ? type.typeParameters.length : 0) !== arity) { - error(getTypeDeclaration(symbol), ts.Diagnostics.Global_type_0_must_have_1_type_parameter_s, symbol.name, arity); - return arity ? emptyGenericType : emptyObjectType; - } - return type; - } - function getGlobalValueSymbol(name) { - return getGlobalSymbol(name, 107455 /* Value */, ts.Diagnostics.Cannot_find_global_value_0); - } - function getGlobalTypeSymbol(name) { - return getGlobalSymbol(name, 793056 /* Type */, ts.Diagnostics.Cannot_find_global_type_0); - } - function getGlobalSymbol(name, meaning, diagnostic) { - return resolveName(undefined, name, meaning, diagnostic, name); - } - function getGlobalType(name, arity) { - if (arity === void 0) { arity = 0; } - return getTypeOfGlobalSymbol(getGlobalTypeSymbol(name), arity); - } - function getGlobalESSymbolConstructorSymbol() { - return globalESSymbolConstructorSymbol || (globalESSymbolConstructorSymbol = getGlobalValueSymbol("Symbol")); - } - /** - * Instantiates a global type that is generic with some element type, and returns that instantiation. - */ - function createTypeFromGenericGlobalType(genericGlobalType, elementType) { - return genericGlobalType !== emptyGenericType ? createTypeReference(genericGlobalType, [elementType]) : emptyObjectType; - } - function createIterableType(elementType) { - return createTypeFromGenericGlobalType(globalIterableType, elementType); - } - function createIterableIteratorType(elementType) { - return createTypeFromGenericGlobalType(globalIterableIteratorType, elementType); - } - function createArrayType(elementType) { - return createTypeFromGenericGlobalType(globalArrayType, elementType); - } - function getTypeFromArrayTypeNode(node) { - var links = getNodeLinks(node); - if (!links.resolvedType) { - links.resolvedType = createArrayType(getTypeFromTypeNode(node.elementType)); - } - return links.resolvedType; - } - function createTupleType(elementTypes) { - var id = getTypeListId(elementTypes); - var type = tupleTypes[id]; - if (!type) { - type = tupleTypes[id] = createObjectType(8192 /* Tuple */); - type.elementTypes = elementTypes; - } - return type; - } - function getTypeFromTupleTypeNode(node) { - var links = getNodeLinks(node); - if (!links.resolvedType) { - links.resolvedType = createTupleType(ts.map(node.elementTypes, getTypeFromTypeNode)); - } - return links.resolvedType; - } - function addTypeToSortedSet(sortedSet, type) { - if (type.flags & 16384 /* Union */) { - addTypesToSortedSet(sortedSet, type.types); - } - else { - var i = 0; - var id = type.id; - while (i < sortedSet.length && sortedSet[i].id < id) { - i++; - } - if (i === sortedSet.length || sortedSet[i].id !== id) { - sortedSet.splice(i, 0, type); - } - } - } - function addTypesToSortedSet(sortedTypes, types) { - for (var _i = 0; _i < types.length; _i++) { - var type = types[_i]; - addTypeToSortedSet(sortedTypes, type); - } - } - function isSubtypeOfAny(candidate, types) { - for (var _i = 0; _i < types.length; _i++) { - var type = types[_i]; - if (candidate !== type && isTypeSubtypeOf(candidate, type)) { - return true; - } - } - return false; - } - function removeSubtypes(types) { - var i = types.length; - while (i > 0) { - i--; - if (isSubtypeOfAny(types[i], types)) { - types.splice(i, 1); - } - } - } - function containsTypeAny(types) { - for (var _i = 0; _i < types.length; _i++) { - var type = types[_i]; - if (isTypeAny(type)) { - return true; - } - } - return false; - } - function removeAllButLast(types, typeToRemove) { - var i = types.length; - while (i > 0 && types.length > 1) { - i--; - if (types[i] === typeToRemove) { - types.splice(i, 1); - } - } - } - // The noSubtypeReduction flag is there because it isn't possible to always do subtype reduction. The flag - // is true when creating a union type from a type node and when instantiating a union type. In both of those - // cases subtype reduction has to be deferred to properly support recursive union types. For example, a - // type alias of the form "type Item = string | (() => Item)" cannot be reduced during its declaration. - function getUnionType(types, noSubtypeReduction) { - if (types.length === 0) { - return emptyObjectType; - } - var sortedTypes = []; - addTypesToSortedSet(sortedTypes, types); - if (noSubtypeReduction) { - if (containsTypeAny(sortedTypes)) { - return anyType; - } - removeAllButLast(sortedTypes, undefinedType); - removeAllButLast(sortedTypes, nullType); - } - else { - removeSubtypes(sortedTypes); - } - if (sortedTypes.length === 1) { - return sortedTypes[0]; - } - var id = getTypeListId(sortedTypes); - var type = unionTypes[id]; - if (!type) { - type = unionTypes[id] = createObjectType(16384 /* Union */ | getWideningFlagsOfTypes(sortedTypes)); - type.types = sortedTypes; - type.reducedType = noSubtypeReduction ? undefined : type; - } - return type; - } - // Subtype reduction is basically an optimization we do to avoid excessively large union types, which take longer - // to process and look strange in quick info and error messages. Semantically there is no difference between the - // reduced type and the type itself. So, when we detect a circularity we simply say that the reduced type is the - // type itself. - function getReducedTypeOfUnionType(type) { - if (!type.reducedType) { - type.reducedType = circularType; - var reducedType = getUnionType(type.types, false); - if (type.reducedType === circularType) { - type.reducedType = reducedType; - } - } - else if (type.reducedType === circularType) { - type.reducedType = type; - } - return type.reducedType; - } - function getTypeFromUnionTypeNode(node) { - var links = getNodeLinks(node); - if (!links.resolvedType) { - links.resolvedType = getUnionType(ts.map(node.types, getTypeFromTypeNode), true); - } - return links.resolvedType; - } - function getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node) { - var links = getNodeLinks(node); - if (!links.resolvedType) { - // Deferred resolution of members is handled by resolveObjectTypeMembers - links.resolvedType = createObjectType(32768 /* Anonymous */, node.symbol); - } - return links.resolvedType; - } - function getStringLiteralType(node) { - if (ts.hasProperty(stringLiteralTypes, node.text)) { - return stringLiteralTypes[node.text]; - } - var type = stringLiteralTypes[node.text] = createType(256 /* StringLiteral */); - type.text = ts.getTextOfNode(node); - return type; - } - function getTypeFromStringLiteral(node) { - var links = getNodeLinks(node); - if (!links.resolvedType) { - links.resolvedType = getStringLiteralType(node); - } - return links.resolvedType; - } - function getTypeFromTypeNode(node) { - switch (node.kind) { - case 112 /* AnyKeyword */: - return anyType; - case 123 /* StringKeyword */: - return stringType; - case 121 /* NumberKeyword */: - return numberType; - case 113 /* BooleanKeyword */: - return booleanType; - case 124 /* SymbolKeyword */: - return esSymbolType; - case 99 /* VoidKeyword */: - return voidType; - case 8 /* StringLiteral */: - return getTypeFromStringLiteral(node); - case 144 /* TypeReference */: - return getTypeFromTypeReference(node); - case 143 /* TypePredicate */: - return booleanType; - case 179 /* ExpressionWithTypeArguments */: - return getTypeFromTypeReference(node); - case 147 /* TypeQuery */: - return getTypeFromTypeQueryNode(node); - case 149 /* ArrayType */: - return getTypeFromArrayTypeNode(node); - case 150 /* TupleType */: - return getTypeFromTupleTypeNode(node); - case 151 /* UnionType */: - return getTypeFromUnionTypeNode(node); - case 152 /* ParenthesizedType */: - return getTypeFromTypeNode(node.type); - case 145 /* FunctionType */: - case 146 /* ConstructorType */: - case 148 /* TypeLiteral */: - return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); - // This function assumes that an identifier or qualified name is a type expression - // Callers should first ensure this by calling isTypeNode - case 65 /* Identifier */: - case 128 /* QualifiedName */: - var symbol = getSymbolInfo(node); - return symbol && getDeclaredTypeOfSymbol(symbol); - default: - return unknownType; - } - } - function instantiateList(items, mapper, instantiator) { - if (items && items.length) { - var result = []; - for (var _i = 0; _i < items.length; _i++) { - var v = items[_i]; - result.push(instantiator(v, mapper)); - } - return result; - } - return items; - } - function createUnaryTypeMapper(source, target) { - return function (t) { return t === source ? target : t; }; - } - function createBinaryTypeMapper(source1, target1, source2, target2) { - return function (t) { return t === source1 ? target1 : t === source2 ? target2 : t; }; - } - function createTypeMapper(sources, targets) { - switch (sources.length) { - case 1: return createUnaryTypeMapper(sources[0], targets[0]); - case 2: return createBinaryTypeMapper(sources[0], targets[0], sources[1], targets[1]); - } - return function (t) { - for (var i = 0; i < sources.length; i++) { - if (t === sources[i]) { - return targets[i]; - } - } - return t; - }; - } - function createUnaryTypeEraser(source) { - return function (t) { return t === source ? anyType : t; }; - } - function createBinaryTypeEraser(source1, source2) { - return function (t) { return t === source1 || t === source2 ? anyType : t; }; - } - function createTypeEraser(sources) { - switch (sources.length) { - case 1: return createUnaryTypeEraser(sources[0]); - case 2: return createBinaryTypeEraser(sources[0], sources[1]); - } - return function (t) { - for (var _i = 0; _i < sources.length; _i++) { - var source = sources[_i]; - if (t === source) { - return anyType; - } - } - return t; - }; - } - function createInferenceMapper(context) { - return function (t) { - for (var i = 0; i < context.typeParameters.length; i++) { - if (t === context.typeParameters[i]) { - context.inferences[i].isFixed = true; - return getInferredType(context, i); - } - } - return t; - }; - } - function identityMapper(type) { - return type; - } - function combineTypeMappers(mapper1, mapper2) { - return function (t) { return instantiateType(mapper1(t), mapper2); }; - } - function instantiateTypeParameter(typeParameter, mapper) { - var result = createType(512 /* TypeParameter */); - result.symbol = typeParameter.symbol; - if (typeParameter.constraint) { - result.constraint = instantiateType(typeParameter.constraint, mapper); - } - else { - result.target = typeParameter; - result.mapper = mapper; - } - return result; - } - function instantiateSignature(signature, mapper, eraseTypeParameters) { - var freshTypeParameters; - var freshTypePredicate; - if (signature.typeParameters && !eraseTypeParameters) { - freshTypeParameters = instantiateList(signature.typeParameters, mapper, instantiateTypeParameter); - mapper = combineTypeMappers(createTypeMapper(signature.typeParameters, freshTypeParameters), mapper); - } - if (signature.typePredicate) { - freshTypePredicate = { - parameterName: signature.typePredicate.parameterName, - parameterIndex: signature.typePredicate.parameterIndex, - type: instantiateType(signature.typePredicate.type, mapper) - }; - } - var result = createSignature(signature.declaration, freshTypeParameters, instantiateList(signature.parameters, mapper, instantiateSymbol), signature.resolvedReturnType ? instantiateType(signature.resolvedReturnType, mapper) : undefined, freshTypePredicate, signature.minArgumentCount, signature.hasRestParameter, signature.hasStringLiterals); - result.target = signature; - result.mapper = mapper; - return result; - } - function instantiateSymbol(symbol, mapper) { - if (symbol.flags & 16777216 /* Instantiated */) { - var links = getSymbolLinks(symbol); - // If symbol being instantiated is itself a instantiation, fetch the original target and combine the - // type mappers. This ensures that original type identities are properly preserved and that aliases - // always reference a non-aliases. - symbol = links.target; - mapper = combineTypeMappers(links.mapper, mapper); - } - // Keep the flags from the symbol we're instantiating. Mark that is instantiated, and - // also transient so that we can just store data on it directly. - var result = createSymbol(16777216 /* Instantiated */ | 67108864 /* Transient */ | symbol.flags, symbol.name); - result.declarations = symbol.declarations; - result.parent = symbol.parent; - result.target = symbol; - result.mapper = mapper; - if (symbol.valueDeclaration) { - result.valueDeclaration = symbol.valueDeclaration; - } - return result; - } - function instantiateAnonymousType(type, mapper) { - // Mark the anonymous type as instantiated such that our infinite instantiation detection logic can recognize it - var result = createObjectType(32768 /* Anonymous */ | 65536 /* Instantiated */, type.symbol); - result.properties = instantiateList(getPropertiesOfObjectType(type), mapper, instantiateSymbol); - result.members = createSymbolTable(result.properties); - result.callSignatures = instantiateList(getSignaturesOfType(type, 0 /* Call */), mapper, instantiateSignature); - result.constructSignatures = instantiateList(getSignaturesOfType(type, 1 /* Construct */), mapper, instantiateSignature); - var stringIndexType = getIndexTypeOfType(type, 0 /* String */); - var numberIndexType = getIndexTypeOfType(type, 1 /* Number */); - if (stringIndexType) - result.stringIndexType = instantiateType(stringIndexType, mapper); - if (numberIndexType) - result.numberIndexType = instantiateType(numberIndexType, mapper); - return result; - } - function instantiateType(type, mapper) { - if (mapper !== identityMapper) { - if (type.flags & 512 /* TypeParameter */) { - return mapper(type); - } - if (type.flags & 32768 /* Anonymous */) { - return type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) ? - instantiateAnonymousType(type, mapper) : type; - } - if (type.flags & 4096 /* Reference */) { - return createTypeReference(type.target, instantiateList(type.typeArguments, mapper, instantiateType)); - } - if (type.flags & 8192 /* Tuple */) { - return createTupleType(instantiateList(type.elementTypes, mapper, instantiateType)); - } - if (type.flags & 16384 /* Union */) { - return getUnionType(instantiateList(type.types, mapper, instantiateType), true); - } - } - return type; - } - // Returns true if the given expression contains (at any level of nesting) a function or arrow expression - // that is subject to contextual typing. - function isContextSensitive(node) { - ts.Debug.assert(node.kind !== 136 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); - switch (node.kind) { - case 165 /* FunctionExpression */: - case 166 /* ArrowFunction */: - return isContextSensitiveFunctionLikeDeclaration(node); - case 157 /* ObjectLiteralExpression */: - return ts.forEach(node.properties, isContextSensitive); - case 156 /* ArrayLiteralExpression */: - return ts.forEach(node.elements, isContextSensitive); - case 173 /* ConditionalExpression */: - return isContextSensitive(node.whenTrue) || - isContextSensitive(node.whenFalse); - case 172 /* BinaryExpression */: - return node.operatorToken.kind === 49 /* BarBarToken */ && - (isContextSensitive(node.left) || isContextSensitive(node.right)); - case 227 /* PropertyAssignment */: - return isContextSensitive(node.initializer); - case 136 /* MethodDeclaration */: - case 135 /* MethodSignature */: - return isContextSensitiveFunctionLikeDeclaration(node); - case 164 /* ParenthesizedExpression */: - return isContextSensitive(node.expression); - } - return false; - } - function isContextSensitiveFunctionLikeDeclaration(node) { - return !node.typeParameters && node.parameters.length && !ts.forEach(node.parameters, function (p) { return p.type; }); - } - function getTypeWithoutConstructors(type) { - if (type.flags & 48128 /* ObjectType */) { - var resolved = resolveObjectOrUnionTypeMembers(type); - if (resolved.constructSignatures.length) { - var result = createObjectType(32768 /* Anonymous */, type.symbol); - result.members = resolved.members; - result.properties = resolved.properties; - result.callSignatures = resolved.callSignatures; - result.constructSignatures = emptyArray; - type = result; - } - } - return type; - } - // TYPE CHECKING - var subtypeRelation = {}; - var assignableRelation = {}; - var identityRelation = {}; - function isTypeIdenticalTo(source, target) { - return checkTypeRelatedTo(source, target, identityRelation, undefined); - } - function compareTypes(source, target) { - return checkTypeRelatedTo(source, target, identityRelation, undefined) ? -1 /* True */ : 0 /* False */; - } - function isTypeSubtypeOf(source, target) { - return checkTypeSubtypeOf(source, target, undefined); - } - function isTypeAssignableTo(source, target) { - return checkTypeAssignableTo(source, target, undefined); - } - function checkTypeSubtypeOf(source, target, errorNode, headMessage, containingMessageChain) { - return checkTypeRelatedTo(source, target, subtypeRelation, errorNode, headMessage, containingMessageChain); - } - function checkTypeAssignableTo(source, target, errorNode, headMessage) { - return checkTypeRelatedTo(source, target, assignableRelation, errorNode, headMessage); - } - function isSignatureAssignableTo(source, target) { - var sourceType = getOrCreateTypeFromSignature(source); - var targetType = getOrCreateTypeFromSignature(target); - return checkTypeRelatedTo(sourceType, targetType, assignableRelation, undefined); - } - function checkTypeRelatedTo(source, target, relation, errorNode, headMessage, containingMessageChain) { - var errorInfo; - var sourceStack; - var targetStack; - var maybeStack; - var expandingFlags; - var depth = 0; - var overflow = false; - var elaborateErrors = false; - ts.Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking"); - var result = isRelatedTo(source, target, errorNode !== undefined, headMessage); - if (overflow) { - error(errorNode, ts.Diagnostics.Excessive_stack_depth_comparing_types_0_and_1, typeToString(source), typeToString(target)); - } - else if (errorInfo) { - // If we already computed this relation, but in a context where we didn't want to report errors (e.g. overload resolution), - // then we'll only have a top-level error (e.g. 'Class X does not implement interface Y') without any details. If this happened, - // request a recompuation to get a complete error message. This will be skipped if we've already done this computation in a context - // where errors were being reported. - if (errorInfo.next === undefined) { - errorInfo = undefined; - elaborateErrors = true; - isRelatedTo(source, target, errorNode !== undefined, headMessage); - } - if (containingMessageChain) { - errorInfo = ts.concatenateDiagnosticMessageChains(containingMessageChain, errorInfo); - } - diagnostics.add(ts.createDiagnosticForNodeFromMessageChain(errorNode, errorInfo)); - } - return result !== 0 /* False */; - function reportError(message, arg0, arg1, arg2) { - errorInfo = ts.chainDiagnosticMessages(errorInfo, message, arg0, arg1, arg2); - } - // Compare two types and return - // Ternary.True if they are related with no assumptions, - // Ternary.Maybe if they are related with assumptions of other relationships, or - // Ternary.False if they are not related. - function isRelatedTo(source, target, reportErrors, headMessage) { - var result; - // both types are the same - covers 'they are the same primitive type or both are Any' or the same type parameter cases - if (source === target) - return -1 /* True */; - if (relation !== identityRelation) { - if (isTypeAny(target)) - return -1 /* True */; - if (source === undefinedType) - return -1 /* True */; - if (source === nullType && target !== undefinedType) - return -1 /* True */; - if (source.flags & 128 /* Enum */ && target === numberType) - return -1 /* True */; - if (source.flags & 256 /* StringLiteral */ && target === stringType) - return -1 /* True */; - if (relation === assignableRelation) { - if (isTypeAny(source)) - return -1 /* True */; - if (source === numberType && target.flags & 128 /* Enum */) - return -1 /* True */; - } - } - var saveErrorInfo = errorInfo; - if (source.flags & 16384 /* Union */ || target.flags & 16384 /* Union */) { - if (relation === identityRelation) { - if (source.flags & 16384 /* Union */ && target.flags & 16384 /* Union */) { - if (result = unionTypeRelatedToUnionType(source, target)) { - if (result &= unionTypeRelatedToUnionType(target, source)) { - return result; - } - } - } - else if (source.flags & 16384 /* Union */) { - if (result = unionTypeRelatedToType(source, target, reportErrors)) { - return result; - } - } - else { - if (result = unionTypeRelatedToType(target, source, reportErrors)) { - return result; - } - } - } - else { - if (source.flags & 16384 /* Union */) { - if (result = unionTypeRelatedToType(source, target, reportErrors)) { - return result; - } - } - else { - if (result = typeRelatedToUnionType(source, target, reportErrors)) { - return result; - } - } - } - } - else if (source.flags & 512 /* TypeParameter */ && target.flags & 512 /* TypeParameter */) { - if (result = typeParameterRelatedTo(source, target, reportErrors)) { - return result; - } - } - else if (source.flags & 4096 /* Reference */ && target.flags & 4096 /* Reference */ && source.target === target.target) { - // We have type references to same target type, see if relationship holds for all type arguments - if (result = typesRelatedTo(source.typeArguments, target.typeArguments, reportErrors)) { - return result; - } - } - // Even if relationship doesn't hold for unions, type parameters, or generic type references, - // it may hold in a structural comparison. - // Report structural errors only if we haven't reported any errors yet - var reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo; - // identity relation does not use apparent type - var sourceOrApparentType = relation === identityRelation ? source : getApparentType(source); - if (sourceOrApparentType.flags & 48128 /* ObjectType */ && target.flags & 48128 /* ObjectType */) { - if (result = objectTypeRelatedTo(sourceOrApparentType, target, reportStructuralErrors)) { - errorInfo = saveErrorInfo; - return result; - } - } - else if (source.flags & 512 /* TypeParameter */ && sourceOrApparentType.flags & 16384 /* Union */) { - // We clear the errors first because the following check often gives a better error than - // the union comparison above if it is applicable. - errorInfo = saveErrorInfo; - if (result = isRelatedTo(sourceOrApparentType, target, reportErrors)) { - return result; - } - } - if (reportErrors) { - headMessage = headMessage || ts.Diagnostics.Type_0_is_not_assignable_to_type_1; - var sourceType = typeToString(source); - var targetType = typeToString(target); - if (sourceType === targetType) { - sourceType = typeToString(source, undefined, 128 /* UseFullyQualifiedType */); - targetType = typeToString(target, undefined, 128 /* UseFullyQualifiedType */); - } - reportError(headMessage, sourceType, targetType); - } - return 0 /* False */; - } - function unionTypeRelatedToUnionType(source, target) { - var result = -1 /* True */; - var sourceTypes = source.types; - for (var _i = 0; _i < sourceTypes.length; _i++) { - var sourceType = sourceTypes[_i]; - var related = typeRelatedToUnionType(sourceType, target, false); - if (!related) { - return 0 /* False */; - } - result &= related; - } - return result; - } - function typeRelatedToUnionType(source, target, reportErrors) { - var targetTypes = target.types; - for (var i = 0, len = targetTypes.length; i < len; i++) { - var related = isRelatedTo(source, targetTypes[i], reportErrors && i === len - 1); - if (related) { - return related; - } - } - return 0 /* False */; - } - function unionTypeRelatedToType(source, target, reportErrors) { - var result = -1 /* True */; - var sourceTypes = source.types; - for (var _i = 0; _i < sourceTypes.length; _i++) { - var sourceType = sourceTypes[_i]; - var related = isRelatedTo(sourceType, target, reportErrors); - if (!related) { - return 0 /* False */; - } - result &= related; - } - return result; - } - function typesRelatedTo(sources, targets, reportErrors) { - var result = -1 /* True */; - for (var i = 0, len = sources.length; i < len; i++) { - var related = isRelatedTo(sources[i], targets[i], reportErrors); - if (!related) { - return 0 /* False */; - } - result &= related; - } - return result; - } - function typeParameterRelatedTo(source, target, reportErrors) { - if (relation === identityRelation) { - if (source.symbol.name !== target.symbol.name) { - return 0 /* False */; - } - // covers case when both type parameters does not have constraint (both equal to noConstraintType) - if (source.constraint === target.constraint) { - return -1 /* True */; - } - if (source.constraint === noConstraintType || target.constraint === noConstraintType) { - return 0 /* False */; - } - return isRelatedTo(source.constraint, target.constraint, reportErrors); - } - else { - while (true) { - var constraint = getConstraintOfTypeParameter(source); - if (constraint === target) - return -1 /* True */; - if (!(constraint && constraint.flags & 512 /* TypeParameter */)) - break; - source = constraint; - } - return 0 /* False */; - } - } - // Determine if two object types are related by structure. First, check if the result is already available in the global cache. - // Second, check if we have already started a comparison of the given two types in which case we assume the result to be true. - // Third, check if both types are part of deeply nested chains of generic type instantiations and if so assume the types are - // equal and infinitely expanding. Fourth, if we have reached a depth of 100 nested comparisons, assume we have runaway recursion - // and issue an error. Otherwise, actually compare the structure of the two types. - function objectTypeRelatedTo(source, target, reportErrors) { - if (overflow) { - return 0 /* False */; - } - var id = relation !== identityRelation || source.id < target.id ? source.id + "," + target.id : target.id + "," + source.id; - var related = relation[id]; - //let related: RelationComparisonResult = undefined; // relation[id]; - if (related !== undefined) { - // If we computed this relation already and it was failed and reported, or if we're not being asked to elaborate - // errors, we can use the cached value. Otherwise, recompute the relation - if (!elaborateErrors || (related === 3 /* FailedAndReported */)) { - return related === 1 /* Succeeded */ ? -1 /* True */ : 0 /* False */; - } - } - if (depth > 0) { - for (var i = 0; i < depth; i++) { - // If source and target are already being compared, consider them related with assumptions - if (maybeStack[i][id]) { - return 1 /* Maybe */; - } - } - if (depth === 100) { - overflow = true; - return 0 /* False */; - } - } - else { - sourceStack = []; - targetStack = []; - maybeStack = []; - expandingFlags = 0; - } - sourceStack[depth] = source; - targetStack[depth] = target; - maybeStack[depth] = {}; - maybeStack[depth][id] = 1 /* Succeeded */; - depth++; - var saveExpandingFlags = expandingFlags; - if (!(expandingFlags & 1) && isDeeplyNestedGeneric(source, sourceStack, depth)) - expandingFlags |= 1; - if (!(expandingFlags & 2) && isDeeplyNestedGeneric(target, targetStack, depth)) - expandingFlags |= 2; - var result; - if (expandingFlags === 3) { - result = 1 /* Maybe */; - } - else { - result = propertiesRelatedTo(source, target, reportErrors); - if (result) { - result &= signaturesRelatedTo(source, target, 0 /* Call */, reportErrors); - if (result) { - result &= signaturesRelatedTo(source, target, 1 /* Construct */, reportErrors); - if (result) { - result &= stringIndexTypesRelatedTo(source, target, reportErrors); - if (result) { - result &= numberIndexTypesRelatedTo(source, target, reportErrors); - } - } - } - } - } - expandingFlags = saveExpandingFlags; - depth--; - if (result) { - var maybeCache = maybeStack[depth]; - // If result is definitely true, copy assumptions to global cache, else copy to next level up - var destinationCache = (result === -1 /* True */ || depth === 0) ? relation : maybeStack[depth - 1]; - ts.copyMap(maybeCache, destinationCache); - } - else { - // A false result goes straight into global cache (when something is false under assumptions it - // will also be false without assumptions) - relation[id] = reportErrors ? 3 /* FailedAndReported */ : 2 /* Failed */; - } - return result; - } - function propertiesRelatedTo(source, target, reportErrors) { - if (relation === identityRelation) { - return propertiesIdenticalTo(source, target); - } - var result = -1 /* True */; - var properties = getPropertiesOfObjectType(target); - var requireOptionalProperties = relation === subtypeRelation && !(source.flags & 262144 /* ObjectLiteral */); - for (var _i = 0; _i < properties.length; _i++) { - var targetProp = properties[_i]; - var sourceProp = getPropertyOfType(source, targetProp.name); - if (sourceProp !== targetProp) { - if (!sourceProp) { - if (!(targetProp.flags & 536870912 /* Optional */) || requireOptionalProperties) { - if (reportErrors) { - reportError(ts.Diagnostics.Property_0_is_missing_in_type_1, symbolToString(targetProp), typeToString(source)); - } - return 0 /* False */; - } - } - else if (!(targetProp.flags & 134217728 /* Prototype */)) { - var sourceFlags = getDeclarationFlagsFromSymbol(sourceProp); - var targetFlags = getDeclarationFlagsFromSymbol(targetProp); - if (sourceFlags & 32 /* Private */ || targetFlags & 32 /* Private */) { - if (sourceProp.valueDeclaration !== targetProp.valueDeclaration) { - if (reportErrors) { - if (sourceFlags & 32 /* Private */ && targetFlags & 32 /* Private */) { - reportError(ts.Diagnostics.Types_have_separate_declarations_of_a_private_property_0, symbolToString(targetProp)); - } - else { - reportError(ts.Diagnostics.Property_0_is_private_in_type_1_but_not_in_type_2, symbolToString(targetProp), typeToString(sourceFlags & 32 /* Private */ ? source : target), typeToString(sourceFlags & 32 /* Private */ ? target : source)); - } - } - return 0 /* False */; - } - } - else if (targetFlags & 64 /* Protected */) { - var sourceDeclaredInClass = sourceProp.parent && sourceProp.parent.flags & 32 /* Class */; - var sourceClass = sourceDeclaredInClass ? getDeclaredTypeOfSymbol(sourceProp.parent) : undefined; - var targetClass = getDeclaredTypeOfSymbol(targetProp.parent); - if (!sourceClass || !hasBaseType(sourceClass, targetClass)) { - if (reportErrors) { - reportError(ts.Diagnostics.Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2, symbolToString(targetProp), typeToString(sourceClass || source), typeToString(targetClass)); - } - return 0 /* False */; - } - } - else if (sourceFlags & 64 /* Protected */) { - if (reportErrors) { - reportError(ts.Diagnostics.Property_0_is_protected_in_type_1_but_public_in_type_2, symbolToString(targetProp), typeToString(source), typeToString(target)); - } - return 0 /* False */; - } - var related = isRelatedTo(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp), reportErrors); - if (!related) { - if (reportErrors) { - reportError(ts.Diagnostics.Types_of_property_0_are_incompatible, symbolToString(targetProp)); - } - return 0 /* False */; - } - result &= related; - if (sourceProp.flags & 536870912 /* Optional */ && !(targetProp.flags & 536870912 /* Optional */)) { - // TypeScript 1.0 spec (April 2014): 3.8.3 - // S is a subtype of a type T, and T is a supertype of S if ... - // S' and T are object types and, for each member M in T.. - // M is a property and S' contains a property N where - // if M is a required property, N is also a required property - // (M - property in T) - // (N - property in S) - if (reportErrors) { - reportError(ts.Diagnostics.Property_0_is_optional_in_type_1_but_required_in_type_2, symbolToString(targetProp), typeToString(source), typeToString(target)); - } - return 0 /* False */; - } - } - } - } - return result; - } - function propertiesIdenticalTo(source, target) { - var sourceProperties = getPropertiesOfObjectType(source); - var targetProperties = getPropertiesOfObjectType(target); - if (sourceProperties.length !== targetProperties.length) { - return 0 /* False */; - } - var result = -1 /* True */; - for (var _i = 0; _i < sourceProperties.length; _i++) { - var sourceProp = sourceProperties[_i]; - var targetProp = getPropertyOfObjectType(target, sourceProp.name); - if (!targetProp) { - return 0 /* False */; - } - var related = compareProperties(sourceProp, targetProp, isRelatedTo); - if (!related) { - return 0 /* False */; - } - result &= related; - } - return result; - } - function signaturesRelatedTo(source, target, kind, reportErrors) { - if (relation === identityRelation) { - return signaturesIdenticalTo(source, target, kind); - } - if (target === anyFunctionType || source === anyFunctionType) { - return -1 /* True */; - } - var sourceSignatures = getSignaturesOfType(source, kind); - var targetSignatures = getSignaturesOfType(target, kind); - var result = -1 /* True */; - var saveErrorInfo = errorInfo; - outer: for (var _i = 0; _i < targetSignatures.length; _i++) { - var t = targetSignatures[_i]; - if (!t.hasStringLiterals || target.flags & 131072 /* FromSignature */) { - var localErrors = reportErrors; - for (var _a = 0; _a < sourceSignatures.length; _a++) { - var s = sourceSignatures[_a]; - if (!s.hasStringLiterals || source.flags & 131072 /* FromSignature */) { - var related = signatureRelatedTo(s, t, localErrors); - if (related) { - result &= related; - errorInfo = saveErrorInfo; - continue outer; - } - // Only report errors from the first failure - localErrors = false; - } - } - return 0 /* False */; - } - } - return result; - } - function signatureRelatedTo(source, target, reportErrors) { - if (source === target) { - return -1 /* True */; - } - if (!target.hasRestParameter && source.minArgumentCount > target.parameters.length) { - return 0 /* False */; - } - var sourceMax = source.parameters.length; - var targetMax = target.parameters.length; - var checkCount; - if (source.hasRestParameter && target.hasRestParameter) { - checkCount = sourceMax > targetMax ? sourceMax : targetMax; - sourceMax--; - targetMax--; - } - else if (source.hasRestParameter) { - sourceMax--; - checkCount = targetMax; - } - else if (target.hasRestParameter) { - targetMax--; - checkCount = sourceMax; - } - else { - checkCount = sourceMax < targetMax ? sourceMax : targetMax; - } - // Spec 1.0 Section 3.8.3 & 3.8.4: - // M and N (the signatures) are instantiated using type Any as the type argument for all type parameters declared by M and N - source = getErasedSignature(source); - target = getErasedSignature(target); - var result = -1 /* True */; - for (var i = 0; i < checkCount; i++) { - var s_1 = i < sourceMax ? getTypeOfSymbol(source.parameters[i]) : getRestTypeOfSignature(source); - var t_1 = i < targetMax ? getTypeOfSymbol(target.parameters[i]) : getRestTypeOfSignature(target); - var saveErrorInfo = errorInfo; - var related = isRelatedTo(s_1, t_1, reportErrors); - if (!related) { - related = isRelatedTo(t_1, s_1, false); - if (!related) { - if (reportErrors) { - reportError(ts.Diagnostics.Types_of_parameters_0_and_1_are_incompatible, source.parameters[i < sourceMax ? i : sourceMax].name, target.parameters[i < targetMax ? i : targetMax].name); - } - return 0 /* False */; - } - errorInfo = saveErrorInfo; - } - result &= related; - } - if (source.typePredicate && target.typePredicate) { - var hasDifferentParameterIndex = source.typePredicate.parameterIndex !== target.typePredicate.parameterIndex; - var hasDifferentTypes; - if (hasDifferentParameterIndex || - (hasDifferentTypes = !isTypeIdenticalTo(source.typePredicate.type, target.typePredicate.type))) { - if (reportErrors) { - var sourceParamText = source.typePredicate.parameterName; - var targetParamText = target.typePredicate.parameterName; - var sourceTypeText = typeToString(source.typePredicate.type); - var targetTypeText = typeToString(target.typePredicate.type); - if (hasDifferentParameterIndex) { - reportError(ts.Diagnostics.Parameter_0_is_not_in_the_same_position_as_parameter_1, sourceParamText, targetParamText); - } - else if (hasDifferentTypes) { - reportError(ts.Diagnostics.Type_0_is_not_assignable_to_type_1, sourceTypeText, targetTypeText); - } - reportError(ts.Diagnostics.Type_predicate_0_is_not_assignable_to_1, sourceParamText + " is " + sourceTypeText, targetParamText + " is " + targetTypeText); - } - return 0 /* False */; - } - } - else if (!source.typePredicate && target.typePredicate) { - if (reportErrors) { - reportError(ts.Diagnostics.Signature_0_must_have_a_type_predicate, signatureToString(source)); - } - return 0 /* False */; - } - var t = getReturnTypeOfSignature(target); - if (t === voidType) - return result; - var s = getReturnTypeOfSignature(source); - return result & isRelatedTo(s, t, reportErrors); - } - function signaturesIdenticalTo(source, target, kind) { - var sourceSignatures = getSignaturesOfType(source, kind); - var targetSignatures = getSignaturesOfType(target, kind); - if (sourceSignatures.length !== targetSignatures.length) { - return 0 /* False */; - } - var result = -1 /* True */; - for (var i = 0, len = sourceSignatures.length; i < len; ++i) { - var related = compareSignatures(sourceSignatures[i], targetSignatures[i], true, isRelatedTo); - if (!related) { - return 0 /* False */; - } - result &= related; - } - return result; - } - function stringIndexTypesRelatedTo(source, target, reportErrors) { - if (relation === identityRelation) { - return indexTypesIdenticalTo(0 /* String */, source, target); - } - var targetType = getIndexTypeOfType(target, 0 /* String */); - if (targetType) { - var sourceType = getIndexTypeOfType(source, 0 /* String */); - if (!sourceType) { - if (reportErrors) { - reportError(ts.Diagnostics.Index_signature_is_missing_in_type_0, typeToString(source)); - } - return 0 /* False */; - } - var related = isRelatedTo(sourceType, targetType, reportErrors); - if (!related) { - if (reportErrors) { - reportError(ts.Diagnostics.Index_signatures_are_incompatible); - } - return 0 /* False */; - } - return related; - } - return -1 /* True */; - } - function numberIndexTypesRelatedTo(source, target, reportErrors) { - if (relation === identityRelation) { - return indexTypesIdenticalTo(1 /* Number */, source, target); - } - var targetType = getIndexTypeOfType(target, 1 /* Number */); - if (targetType) { - var sourceStringType = getIndexTypeOfType(source, 0 /* String */); - var sourceNumberType = getIndexTypeOfType(source, 1 /* Number */); - if (!(sourceStringType || sourceNumberType)) { - if (reportErrors) { - reportError(ts.Diagnostics.Index_signature_is_missing_in_type_0, typeToString(source)); - } - return 0 /* False */; - } - var related; - if (sourceStringType && sourceNumberType) { - // If we know for sure we're testing both string and numeric index types then only report errors from the second one - related = isRelatedTo(sourceStringType, targetType, false) || isRelatedTo(sourceNumberType, targetType, reportErrors); - } - else { - related = isRelatedTo(sourceStringType || sourceNumberType, targetType, reportErrors); - } - if (!related) { - if (reportErrors) { - reportError(ts.Diagnostics.Index_signatures_are_incompatible); - } - return 0 /* False */; - } - return related; - } - return -1 /* True */; - } - function indexTypesIdenticalTo(indexKind, source, target) { - var targetType = getIndexTypeOfType(target, indexKind); - var sourceType = getIndexTypeOfType(source, indexKind); - if (!sourceType && !targetType) { - return -1 /* True */; - } - if (sourceType && targetType) { - return isRelatedTo(sourceType, targetType); - } - return 0 /* False */; - } - } - // Return true if the given type is part of a deeply nested chain of generic instantiations. We consider this to be the case - // when structural type comparisons have been started for 10 or more instantiations of the same generic type. It is possible, - // though highly unlikely, for this test to be true in a situation where a chain of instantiations is not infinitely expanding. - // Effectively, we will generate a false positive when two types are structurally equal to at least 10 levels, but unequal at - // some level beyond that. - function isDeeplyNestedGeneric(type, stack, depth) { - // We track type references (created by createTypeReference) and instantiated types (created by instantiateType) - if (type.flags & (4096 /* Reference */ | 65536 /* Instantiated */) && depth >= 5) { - var symbol = type.symbol; - var count = 0; - for (var i = 0; i < depth; i++) { - var t = stack[i]; - if (t.flags & (4096 /* Reference */ | 65536 /* Instantiated */) && t.symbol === symbol) { - count++; - if (count >= 5) - return true; - } - } - } - return false; - } - function isPropertyIdenticalTo(sourceProp, targetProp) { - return compareProperties(sourceProp, targetProp, compareTypes) !== 0 /* False */; - } - function compareProperties(sourceProp, targetProp, compareTypes) { - // Two members are considered identical when - // - they are public properties with identical names, optionality, and types, - // - they are private or protected properties originating in the same declaration and having identical types - if (sourceProp === targetProp) { - return -1 /* True */; - } - var sourcePropAccessibility = getDeclarationFlagsFromSymbol(sourceProp) & (32 /* Private */ | 64 /* Protected */); - var targetPropAccessibility = getDeclarationFlagsFromSymbol(targetProp) & (32 /* Private */ | 64 /* Protected */); - if (sourcePropAccessibility !== targetPropAccessibility) { - return 0 /* False */; - } - if (sourcePropAccessibility) { - if (getTargetSymbol(sourceProp) !== getTargetSymbol(targetProp)) { - return 0 /* False */; - } - } - else { - if ((sourceProp.flags & 536870912 /* Optional */) !== (targetProp.flags & 536870912 /* Optional */)) { - return 0 /* False */; - } - } - return compareTypes(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp)); - } - function compareSignatures(source, target, compareReturnTypes, compareTypes) { - if (source === target) { - return -1 /* True */; - } - if (source.parameters.length !== target.parameters.length || - source.minArgumentCount !== target.minArgumentCount || - source.hasRestParameter !== target.hasRestParameter) { - return 0 /* False */; - } - var result = -1 /* True */; - if (source.typeParameters && target.typeParameters) { - if (source.typeParameters.length !== target.typeParameters.length) { - return 0 /* False */; - } - for (var i = 0, len = source.typeParameters.length; i < len; ++i) { - var related = compareTypes(source.typeParameters[i], target.typeParameters[i]); - if (!related) { - return 0 /* False */; - } - result &= related; - } - } - else if (source.typeParameters || target.typeParameters) { - return 0 /* False */; - } - // Spec 1.0 Section 3.8.3 & 3.8.4: - // M and N (the signatures) are instantiated using type Any as the type argument for all type parameters declared by M and N - source = getErasedSignature(source); - target = getErasedSignature(target); - for (var i = 0, len = source.parameters.length; i < len; i++) { - var s = source.hasRestParameter && i === len - 1 ? getRestTypeOfSignature(source) : getTypeOfSymbol(source.parameters[i]); - var t = target.hasRestParameter && i === len - 1 ? getRestTypeOfSignature(target) : getTypeOfSymbol(target.parameters[i]); - var related = compareTypes(s, t); - if (!related) { - return 0 /* False */; - } - result &= related; - } - if (compareReturnTypes) { - result &= compareTypes(getReturnTypeOfSignature(source), getReturnTypeOfSignature(target)); - } - return result; - } - function isSupertypeOfEach(candidate, types) { - for (var _i = 0; _i < types.length; _i++) { - var type = types[_i]; - if (candidate !== type && !isTypeSubtypeOf(type, candidate)) - return false; - } - return true; - } - function getCommonSupertype(types) { - return ts.forEach(types, function (t) { return isSupertypeOfEach(t, types) ? t : undefined; }); - } - function reportNoCommonSupertypeError(types, errorLocation, errorMessageChainHead) { - // The downfallType/bestSupertypeDownfallType is the first type that caused a particular candidate - // to not be the common supertype. So if it weren't for this one downfallType (and possibly others), - // the type in question could have been the common supertype. - var bestSupertype; - var bestSupertypeDownfallType; - var bestSupertypeScore = 0; - for (var i = 0; i < types.length; i++) { - var score = 0; - var downfallType = undefined; - for (var j = 0; j < types.length; j++) { - if (isTypeSubtypeOf(types[j], types[i])) { - score++; - } - else if (!downfallType) { - downfallType = types[j]; - } - } - ts.Debug.assert(!!downfallType, "If there is no common supertype, each type should have a downfallType"); - if (score > bestSupertypeScore) { - bestSupertype = types[i]; - bestSupertypeDownfallType = downfallType; - bestSupertypeScore = score; - } - // types.length - 1 is the maximum score, given that getCommonSupertype returned false - if (bestSupertypeScore === types.length - 1) { - break; - } - } - // In the following errors, the {1} slot is before the {0} slot because checkTypeSubtypeOf supplies the - // subtype as the first argument to the error - checkTypeSubtypeOf(bestSupertypeDownfallType, bestSupertype, errorLocation, ts.Diagnostics.Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0, errorMessageChainHead); - } - function isArrayType(type) { - return type.flags & 4096 /* Reference */ && type.target === globalArrayType; - } - function isArrayLikeType(type) { - // A type is array-like if it is not the undefined or null type and if it is assignable to any[] - return !(type.flags & (32 /* Undefined */ | 64 /* Null */)) && isTypeAssignableTo(type, anyArrayType); - } - function isTupleLikeType(type) { - return !!getPropertyOfType(type, "0"); - } - /** - * Check if a Type was written as a tuple type literal. - * Prefer using isTupleLikeType() unless the use of `elementTypes` is required. - */ - function isTupleType(type) { - return (type.flags & 8192 /* Tuple */) && !!type.elementTypes; - } - function getWidenedTypeOfObjectLiteral(type) { - var properties = getPropertiesOfObjectType(type); - var members = {}; - ts.forEach(properties, function (p) { - var propType = getTypeOfSymbol(p); - var widenedType = getWidenedType(propType); - if (propType !== widenedType) { - var symbol = createSymbol(p.flags | 67108864 /* Transient */, p.name); - symbol.declarations = p.declarations; - symbol.parent = p.parent; - symbol.type = widenedType; - symbol.target = p; - if (p.valueDeclaration) - symbol.valueDeclaration = p.valueDeclaration; - p = symbol; - } - members[p.name] = p; - }); - var stringIndexType = getIndexTypeOfType(type, 0 /* String */); - var numberIndexType = getIndexTypeOfType(type, 1 /* Number */); - if (stringIndexType) - stringIndexType = getWidenedType(stringIndexType); - if (numberIndexType) - numberIndexType = getWidenedType(numberIndexType); - return createAnonymousType(type.symbol, members, emptyArray, emptyArray, stringIndexType, numberIndexType); - } - function getWidenedType(type) { - if (type.flags & 1572864 /* RequiresWidening */) { - if (type.flags & (32 /* Undefined */ | 64 /* Null */)) { - return anyType; - } - if (type.flags & 262144 /* ObjectLiteral */) { - return getWidenedTypeOfObjectLiteral(type); - } - if (type.flags & 16384 /* Union */) { - return getUnionType(ts.map(type.types, getWidenedType)); - } - if (isArrayType(type)) { - return createArrayType(getWidenedType(type.typeArguments[0])); - } - } - return type; - } - function reportWideningErrorsInType(type) { - if (type.flags & 16384 /* Union */) { - var errorReported = false; - ts.forEach(type.types, function (t) { - if (reportWideningErrorsInType(t)) { - errorReported = true; - } - }); - return errorReported; - } - if (isArrayType(type)) { - return reportWideningErrorsInType(type.typeArguments[0]); - } - if (type.flags & 262144 /* ObjectLiteral */) { - var errorReported = false; - ts.forEach(getPropertiesOfObjectType(type), function (p) { - var t = getTypeOfSymbol(p); - if (t.flags & 524288 /* ContainsUndefinedOrNull */) { - if (!reportWideningErrorsInType(t)) { - error(p.valueDeclaration, ts.Diagnostics.Object_literal_s_property_0_implicitly_has_an_1_type, p.name, typeToString(getWidenedType(t))); - } - errorReported = true; - } - }); - return errorReported; - } - return false; - } - function reportImplicitAnyError(declaration, type) { - var typeAsString = typeToString(getWidenedType(type)); - var diagnostic; - switch (declaration.kind) { - case 134 /* PropertyDeclaration */: - case 133 /* PropertySignature */: - diagnostic = ts.Diagnostics.Member_0_implicitly_has_an_1_type; - break; - case 131 /* Parameter */: - diagnostic = declaration.dotDotDotToken ? - ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : - ts.Diagnostics.Parameter_0_implicitly_has_an_1_type; - break; - case 203 /* FunctionDeclaration */: - case 136 /* MethodDeclaration */: - case 135 /* MethodSignature */: - case 138 /* GetAccessor */: - case 139 /* SetAccessor */: - case 165 /* FunctionExpression */: - case 166 /* ArrowFunction */: - if (!declaration.name) { - error(declaration, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); - return; - } - diagnostic = ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type; - break; - default: - diagnostic = ts.Diagnostics.Variable_0_implicitly_has_an_1_type; - } - error(declaration, diagnostic, ts.declarationNameToString(declaration.name), typeAsString); - } - function reportErrorsFromWidening(declaration, type) { - if (produceDiagnostics && compilerOptions.noImplicitAny && type.flags & 524288 /* ContainsUndefinedOrNull */) { - // Report implicit any error within type if possible, otherwise report error on declaration - if (!reportWideningErrorsInType(type)) { - reportImplicitAnyError(declaration, type); - } - } - } - function forEachMatchingParameterType(source, target, callback) { - var sourceMax = source.parameters.length; - var targetMax = target.parameters.length; - var count; - if (source.hasRestParameter && target.hasRestParameter) { - count = sourceMax > targetMax ? sourceMax : targetMax; - sourceMax--; - targetMax--; - } - else if (source.hasRestParameter) { - sourceMax--; - count = targetMax; - } - else if (target.hasRestParameter) { - targetMax--; - count = sourceMax; - } - else { - count = sourceMax < targetMax ? sourceMax : targetMax; - } - for (var i = 0; i < count; i++) { - var s = i < sourceMax ? getTypeOfSymbol(source.parameters[i]) : getRestTypeOfSignature(source); - var t = i < targetMax ? getTypeOfSymbol(target.parameters[i]) : getRestTypeOfSignature(target); - callback(s, t); - } - } - function createInferenceContext(typeParameters, inferUnionTypes) { - var inferences = []; - for (var _i = 0; _i < typeParameters.length; _i++) { - var unused = typeParameters[_i]; - inferences.push({ primary: undefined, secondary: undefined, isFixed: false }); - } - return { - typeParameters: typeParameters, - inferUnionTypes: inferUnionTypes, - inferences: inferences, - inferredTypes: new Array(typeParameters.length) - }; - } - function inferTypes(context, source, target) { - var sourceStack; - var targetStack; - var depth = 0; - var inferiority = 0; - inferFromTypes(source, target); - function isInProcess(source, target) { - for (var i = 0; i < depth; i++) { - if (source === sourceStack[i] && target === targetStack[i]) { - return true; - } - } - return false; - } - function inferFromTypes(source, target) { - if (source === anyFunctionType) { - return; - } - if (target.flags & 512 /* TypeParameter */) { - // If target is a type parameter, make an inference - var typeParameters = context.typeParameters; - for (var i = 0; i < typeParameters.length; i++) { - if (target === typeParameters[i]) { - var inferences = context.inferences[i]; - if (!inferences.isFixed) { - // Any inferences that are made to a type parameter in a union type are inferior - // to inferences made to a flat (non-union) type. This is because if we infer to - // T | string[], we really don't know if we should be inferring to T or not (because - // the correct constituent on the target side could be string[]). Therefore, we put - // such inferior inferences into a secondary bucket, and only use them if the primary - // bucket is empty. - var candidates = inferiority ? - inferences.secondary || (inferences.secondary = []) : - inferences.primary || (inferences.primary = []); - if (!ts.contains(candidates, source)) { - candidates.push(source); - } - } - return; - } - } - } - else if (source.flags & 4096 /* Reference */ && target.flags & 4096 /* Reference */ && source.target === target.target) { - // If source and target are references to the same generic type, infer from type arguments - var sourceTypes = source.typeArguments; - var targetTypes = target.typeArguments; - for (var i = 0; i < sourceTypes.length; i++) { - inferFromTypes(sourceTypes[i], targetTypes[i]); - } - } - else if (target.flags & 16384 /* Union */) { - var targetTypes = target.types; - var typeParameterCount = 0; - var typeParameter; - // First infer to each type in union that isn't a type parameter - for (var _i = 0; _i < targetTypes.length; _i++) { - var t = targetTypes[_i]; - if (t.flags & 512 /* TypeParameter */ && ts.contains(context.typeParameters, t)) { - typeParameter = t; - typeParameterCount++; - } - else { - inferFromTypes(source, t); - } - } - // If union contains a single naked type parameter, make a secondary inference to that type parameter - if (typeParameterCount === 1) { - inferiority++; - inferFromTypes(source, typeParameter); - inferiority--; - } - } - else if (source.flags & 16384 /* Union */) { - // Source is a union type, infer from each consituent type - var sourceTypes = source.types; - for (var _a = 0; _a < sourceTypes.length; _a++) { - var sourceType = sourceTypes[_a]; - inferFromTypes(sourceType, target); - } - } - else if (source.flags & 48128 /* ObjectType */ && (target.flags & (4096 /* Reference */ | 8192 /* Tuple */) || - (target.flags & 32768 /* Anonymous */) && target.symbol && target.symbol.flags & (8192 /* Method */ | 2048 /* TypeLiteral */))) { - // If source is an object type, and target is a type reference, a tuple type, the type of a method, or a type literal, infer from members - if (isInProcess(source, target)) { - return; - } - if (isDeeplyNestedGeneric(source, sourceStack, depth) && isDeeplyNestedGeneric(target, targetStack, depth)) { - return; - } - if (depth === 0) { - sourceStack = []; - targetStack = []; - } - sourceStack[depth] = source; - targetStack[depth] = target; - depth++; - inferFromProperties(source, target); - inferFromSignatures(source, target, 0 /* Call */); - inferFromSignatures(source, target, 1 /* Construct */); - inferFromIndexTypes(source, target, 0 /* String */, 0 /* String */); - inferFromIndexTypes(source, target, 1 /* Number */, 1 /* Number */); - inferFromIndexTypes(source, target, 0 /* String */, 1 /* Number */); - depth--; - } - } - function inferFromProperties(source, target) { - var properties = getPropertiesOfObjectType(target); - for (var _i = 0; _i < properties.length; _i++) { - var targetProp = properties[_i]; - var sourceProp = getPropertyOfObjectType(source, targetProp.name); - if (sourceProp) { - inferFromTypes(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp)); - } - } - } - function inferFromSignatures(source, target, kind) { - var sourceSignatures = getSignaturesOfType(source, kind); - var targetSignatures = getSignaturesOfType(target, kind); - var sourceLen = sourceSignatures.length; - var targetLen = targetSignatures.length; - var len = sourceLen < targetLen ? sourceLen : targetLen; - for (var i = 0; i < len; i++) { - inferFromSignature(getErasedSignature(sourceSignatures[sourceLen - len + i]), getErasedSignature(targetSignatures[targetLen - len + i])); - } - } - function inferFromSignature(source, target) { - forEachMatchingParameterType(source, target, inferFromTypes); - if (source.typePredicate && target.typePredicate) { - if (target.typePredicate.parameterIndex === source.typePredicate.parameterIndex) { - // Return types from type predicates are treated as booleans. In order to infer types - // from type predicates we would need to infer using the type within the type predicate - // (i.e. 'Foo' from 'x is Foo'). - inferFromTypes(source.typePredicate.type, target.typePredicate.type); - } - } - else { - inferFromTypes(getReturnTypeOfSignature(source), getReturnTypeOfSignature(target)); - } - } - function inferFromIndexTypes(source, target, sourceKind, targetKind) { - var targetIndexType = getIndexTypeOfType(target, targetKind); - if (targetIndexType) { - var sourceIndexType = getIndexTypeOfType(source, sourceKind); - if (sourceIndexType) { - inferFromTypes(sourceIndexType, targetIndexType); - } - } - } - } - function getInferenceCandidates(context, index) { - var inferences = context.inferences[index]; - return inferences.primary || inferences.secondary || emptyArray; - } - function getInferredType(context, index) { - var inferredType = context.inferredTypes[index]; - var inferenceSucceeded; - if (!inferredType) { - var inferences = getInferenceCandidates(context, index); - if (inferences.length) { - // Infer widened union or supertype, or the unknown type for no common supertype - var unionOrSuperType = context.inferUnionTypes ? getUnionType(inferences) : getCommonSupertype(inferences); - inferredType = unionOrSuperType ? getWidenedType(unionOrSuperType) : unknownType; - inferenceSucceeded = !!unionOrSuperType; - } - else { - // Infer the empty object type when no inferences were made. It is important to remember that - // in this case, inference still succeeds, meaning there is no error for not having inference - // candidates. An inference error only occurs when there are *conflicting* candidates, i.e. - // candidates with no common supertype. - inferredType = emptyObjectType; - inferenceSucceeded = true; - } - // Only do the constraint check if inference succeeded (to prevent cascading errors) - if (inferenceSucceeded) { - var constraint = getConstraintOfTypeParameter(context.typeParameters[index]); - inferredType = constraint && !isTypeAssignableTo(inferredType, constraint) ? constraint : inferredType; - } - else if (context.failedTypeParameterIndex === undefined || context.failedTypeParameterIndex > index) { - // If inference failed, it is necessary to record the index of the failed type parameter (the one we are on). - // It might be that inference has already failed on a later type parameter on a previous call to inferTypeArguments. - // So if this failure is on preceding type parameter, this type parameter is the new failure index. - context.failedTypeParameterIndex = index; - } - context.inferredTypes[index] = inferredType; - } - return inferredType; - } - function getInferredTypes(context) { - for (var i = 0; i < context.inferredTypes.length; i++) { - getInferredType(context, i); - } - return context.inferredTypes; - } - function hasAncestor(node, kind) { - return ts.getAncestor(node, kind) !== undefined; - } - // EXPRESSION TYPE CHECKING - function getResolvedSymbol(node) { - var links = getNodeLinks(node); - if (!links.resolvedSymbol) { - links.resolvedSymbol = (!ts.nodeIsMissing(node) && resolveName(node, node.text, 107455 /* Value */ | 1048576 /* ExportValue */, ts.Diagnostics.Cannot_find_name_0, node)) || unknownSymbol; - } - return links.resolvedSymbol; - } - function isInTypeQuery(node) { - // TypeScript 1.0 spec (April 2014): 3.6.3 - // A type query consists of the keyword typeof followed by an expression. - // The expression is restricted to a single identifier or a sequence of identifiers separated by periods - while (node) { - switch (node.kind) { - case 147 /* TypeQuery */: - return true; - case 65 /* Identifier */: - case 128 /* QualifiedName */: - node = node.parent; - continue; - default: - return false; - } - } - ts.Debug.fail("should not get here"); - } - // For a union type, remove all constituent types that are of the given type kind (when isOfTypeKind is true) - // or not of the given type kind (when isOfTypeKind is false) - function removeTypesFromUnionType(type, typeKind, isOfTypeKind, allowEmptyUnionResult) { - if (type.flags & 16384 /* Union */) { - var types = type.types; - if (ts.forEach(types, function (t) { return !!(t.flags & typeKind) === isOfTypeKind; })) { - // Above we checked if we have anything to remove, now use the opposite test to do the removal - var narrowedType = getUnionType(ts.filter(types, function (t) { return !(t.flags & typeKind) === isOfTypeKind; })); - if (allowEmptyUnionResult || narrowedType !== emptyObjectType) { - return narrowedType; - } - } - } - else if (allowEmptyUnionResult && !!(type.flags & typeKind) === isOfTypeKind) { - // Use getUnionType(emptyArray) instead of emptyObjectType in case the way empty union types - // are represented ever changes. - return getUnionType(emptyArray); - } - return type; - } - function hasInitializer(node) { - return !!(node.initializer || ts.isBindingPattern(node.parent) && hasInitializer(node.parent.parent)); - } - // Check if a given variable is assigned within a given syntax node - function isVariableAssignedWithin(symbol, node) { - var links = getNodeLinks(node); - if (links.assignmentChecks) { - var cachedResult = links.assignmentChecks[symbol.id]; - if (cachedResult !== undefined) { - return cachedResult; - } - } - else { - links.assignmentChecks = {}; - } - return links.assignmentChecks[symbol.id] = isAssignedIn(node); - function isAssignedInBinaryExpression(node) { - if (node.operatorToken.kind >= 53 /* FirstAssignment */ && node.operatorToken.kind <= 64 /* LastAssignment */) { - var n = node.left; - while (n.kind === 164 /* ParenthesizedExpression */) { - n = n.expression; - } - if (n.kind === 65 /* Identifier */ && getResolvedSymbol(n) === symbol) { - return true; - } - } - return ts.forEachChild(node, isAssignedIn); - } - function isAssignedInVariableDeclaration(node) { - if (!ts.isBindingPattern(node.name) && getSymbolOfNode(node) === symbol && hasInitializer(node)) { - return true; - } - return ts.forEachChild(node, isAssignedIn); - } - function isAssignedIn(node) { - switch (node.kind) { - case 172 /* BinaryExpression */: - return isAssignedInBinaryExpression(node); - case 201 /* VariableDeclaration */: - case 155 /* BindingElement */: - return isAssignedInVariableDeclaration(node); - case 153 /* ObjectBindingPattern */: - case 154 /* ArrayBindingPattern */: - case 156 /* ArrayLiteralExpression */: - case 157 /* ObjectLiteralExpression */: - case 158 /* PropertyAccessExpression */: - case 159 /* ElementAccessExpression */: - case 160 /* CallExpression */: - case 161 /* NewExpression */: - case 163 /* TypeAssertionExpression */: - case 164 /* ParenthesizedExpression */: - case 170 /* PrefixUnaryExpression */: - case 167 /* DeleteExpression */: - case 168 /* TypeOfExpression */: - case 169 /* VoidExpression */: - case 171 /* PostfixUnaryExpression */: - case 173 /* ConditionalExpression */: - case 176 /* SpreadElementExpression */: - case 182 /* Block */: - case 183 /* VariableStatement */: - case 185 /* ExpressionStatement */: - case 186 /* IfStatement */: - case 187 /* DoStatement */: - case 188 /* WhileStatement */: - case 189 /* ForStatement */: - case 190 /* ForInStatement */: - case 191 /* ForOfStatement */: - case 194 /* ReturnStatement */: - case 195 /* WithStatement */: - case 196 /* SwitchStatement */: - case 223 /* CaseClause */: - case 224 /* DefaultClause */: - case 197 /* LabeledStatement */: - case 198 /* ThrowStatement */: - case 199 /* TryStatement */: - case 226 /* CatchClause */: - return ts.forEachChild(node, isAssignedIn); - } - return false; - } - } - function resolveLocation(node) { - // Resolve location from top down towards node if it is a context sensitive expression - // That helps in making sure not assigning types as any when resolved out of order - var containerNodes = []; - for (var parent_5 = node.parent; parent_5; parent_5 = parent_5.parent) { - if ((ts.isExpression(parent_5) || ts.isObjectLiteralMethod(node)) && - isContextSensitive(parent_5)) { - containerNodes.unshift(parent_5); - } - } - ts.forEach(containerNodes, function (node) { getTypeOfNode(node); }); - } - function getSymbolAtLocation(node) { - resolveLocation(node); - return getSymbolInfo(node); - } - function getTypeAtLocation(node) { - resolveLocation(node); - return getTypeOfNode(node); - } - function getTypeOfSymbolAtLocation(symbol, node) { - resolveLocation(node); - // Get the narrowed type of symbol at given location instead of just getting - // the type of the symbol. - // eg. - // function foo(a: string | number) { - // if (typeof a === "string") { - // a/**/ - // } - // } - // getTypeOfSymbol for a would return type of parameter symbol string | number - // Unless we provide location /**/, checker wouldn't know how to narrow the type - // By using getNarrowedTypeOfSymbol would return string since it would be able to narrow - // it by typeguard in the if true condition - return getNarrowedTypeOfSymbol(symbol, node); - } - // Get the narrowed type of a given symbol at a given location - function getNarrowedTypeOfSymbol(symbol, node) { - var type = getTypeOfSymbol(symbol); - // Only narrow when symbol is variable of type any or an object, union, or type parameter type - if (node && symbol.flags & 3 /* Variable */) { - if (isTypeAny(type) || type.flags & (48128 /* ObjectType */ | 16384 /* Union */ | 512 /* TypeParameter */)) { - loop: while (node.parent) { - var child = node; - node = node.parent; - var narrowedType = type; - switch (node.kind) { - case 186 /* IfStatement */: - // In a branch of an if statement, narrow based on controlling expression - if (child !== node.expression) { - narrowedType = narrowType(type, node.expression, child === node.thenStatement); - } - break; - case 173 /* ConditionalExpression */: - // In a branch of a conditional expression, narrow based on controlling condition - if (child !== node.condition) { - narrowedType = narrowType(type, node.condition, child === node.whenTrue); - } - break; - case 172 /* BinaryExpression */: - // In the right operand of an && or ||, narrow based on left operand - if (child === node.right) { - if (node.operatorToken.kind === 48 /* AmpersandAmpersandToken */) { - narrowedType = narrowType(type, node.left, true); - } - else if (node.operatorToken.kind === 49 /* BarBarToken */) { - narrowedType = narrowType(type, node.left, false); - } - } - break; - case 230 /* SourceFile */: - case 208 /* ModuleDeclaration */: - case 203 /* FunctionDeclaration */: - case 136 /* MethodDeclaration */: - case 135 /* MethodSignature */: - case 138 /* GetAccessor */: - case 139 /* SetAccessor */: - case 137 /* Constructor */: - // Stop at the first containing function or module declaration - break loop; - } - // Use narrowed type if construct contains no assignments to variable - if (narrowedType !== type) { - if (isVariableAssignedWithin(symbol, node)) { - break; - } - type = narrowedType; - } - } - } - } - return type; - function narrowTypeByEquality(type, expr, assumeTrue) { - // Check that we have 'typeof ' on the left and string literal on the right - if (expr.left.kind !== 168 /* TypeOfExpression */ || expr.right.kind !== 8 /* StringLiteral */) { - return type; - } - var left = expr.left; - var right = expr.right; - if (left.expression.kind !== 65 /* Identifier */ || getResolvedSymbol(left.expression) !== symbol) { - return type; - } - var typeInfo = primitiveTypeInfo[right.text]; - if (expr.operatorToken.kind === 31 /* ExclamationEqualsEqualsToken */) { - assumeTrue = !assumeTrue; - } - if (assumeTrue) { - // Assumed result is true. If check was not for a primitive type, remove all primitive types - if (!typeInfo) { - return removeTypesFromUnionType(type, 258 /* StringLike */ | 132 /* NumberLike */ | 8 /* Boolean */ | 2097152 /* ESSymbol */, - /*isOfTypeKind*/ true, false); - } - // Check was for a primitive type, return that primitive type if it is a subtype - if (isTypeSubtypeOf(typeInfo.type, type)) { - return typeInfo.type; - } - // Otherwise, remove all types that aren't of the primitive type kind. This can happen when the type is - // union of enum types and other types. - return removeTypesFromUnionType(type, typeInfo.flags, false, false); - } - else { - // Assumed result is false. If check was for a primitive type, remove that primitive type - if (typeInfo) { - return removeTypesFromUnionType(type, typeInfo.flags, true, false); - } - // Otherwise we don't have enough information to do anything. - return type; - } - } - function narrowTypeByAnd(type, expr, assumeTrue) { - if (assumeTrue) { - // The assumed result is true, therefore we narrow assuming each operand to be true. - return narrowType(narrowType(type, expr.left, true), expr.right, true); - } - else { - // The assumed result is false. This means either the first operand was false, or the first operand was true - // and the second operand was false. We narrow with those assumptions and union the two resulting types. - return getUnionType([ - narrowType(type, expr.left, false), - narrowType(narrowType(type, expr.left, true), expr.right, false) - ]); - } - } - function narrowTypeByOr(type, expr, assumeTrue) { - if (assumeTrue) { - // The assumed result is true. This means either the first operand was true, or the first operand was false - // and the second operand was true. We narrow with those assumptions and union the two resulting types. - return getUnionType([ - narrowType(type, expr.left, true), - narrowType(narrowType(type, expr.left, false), expr.right, true) - ]); - } - else { - // The assumed result is false, therefore we narrow assuming each operand to be false. - return narrowType(narrowType(type, expr.left, false), expr.right, false); - } - } - function narrowTypeByInstanceof(type, expr, assumeTrue) { - // Check that type is not any, assumed result is true, and we have variable symbol on the left - if (isTypeAny(type) || !assumeTrue || expr.left.kind !== 65 /* Identifier */ || getResolvedSymbol(expr.left) !== symbol) { - return type; - } - // Check that right operand is a function type with a prototype property - var rightType = checkExpression(expr.right); - if (!isTypeSubtypeOf(rightType, globalFunctionType)) { - return type; - } - var targetType; - var prototypeProperty = getPropertyOfType(rightType, "prototype"); - if (prototypeProperty) { - // Target type is type of the prototype property - var prototypePropertyType = getTypeOfSymbol(prototypeProperty); - if (!isTypeAny(prototypePropertyType)) { - targetType = prototypePropertyType; - } - } - if (!targetType) { - // Target type is type of construct signature - var constructSignatures; - if (rightType.flags & 2048 /* Interface */) { - constructSignatures = resolveDeclaredMembers(rightType).declaredConstructSignatures; - } - else if (rightType.flags & 32768 /* Anonymous */) { - constructSignatures = getSignaturesOfType(rightType, 1 /* Construct */); - } - if (constructSignatures && constructSignatures.length) { - targetType = getUnionType(ts.map(constructSignatures, function (signature) { return getReturnTypeOfSignature(getErasedSignature(signature)); })); - } - } - if (targetType) { - return getNarrowedType(type, targetType); - } - return type; - } - function getNarrowedType(originalType, narrowedTypeCandidate) { - // Narrow to the target type if it's a subtype of the current type - if (isTypeSubtypeOf(narrowedTypeCandidate, originalType)) { - return narrowedTypeCandidate; - } - // If the current type is a union type, remove all constituents that aren't subtypes of the target. - if (originalType.flags & 16384 /* Union */) { - return getUnionType(ts.filter(originalType.types, function (t) { return isTypeSubtypeOf(t, narrowedTypeCandidate); })); - } - return originalType; - } - function narrowTypeByTypePredicate(type, expr, assumeTrue) { - if (type.flags & 1 /* Any */) { - return type; - } - var signature = getResolvedSignature(expr); - if (signature.typePredicate && - getSymbolAtLocation(expr.arguments[signature.typePredicate.parameterIndex]) === symbol) { - if (!assumeTrue) { - if (type.flags & 16384 /* Union */) { - return getUnionType(ts.filter(type.types, function (t) { return !isTypeSubtypeOf(t, signature.typePredicate.type); })); - } - return type; - } - return getNarrowedType(type, signature.typePredicate.type); - } - return type; - } - // Narrow the given type based on the given expression having the assumed boolean value. The returned type - // will be a subtype or the same type as the argument. - function narrowType(type, expr, assumeTrue) { - switch (expr.kind) { - case 160 /* CallExpression */: - return narrowTypeByTypePredicate(type, expr, assumeTrue); - case 164 /* ParenthesizedExpression */: - return narrowType(type, expr.expression, assumeTrue); - case 172 /* BinaryExpression */: - var operator = expr.operatorToken.kind; - if (operator === 30 /* EqualsEqualsEqualsToken */ || operator === 31 /* ExclamationEqualsEqualsToken */) { - return narrowTypeByEquality(type, expr, assumeTrue); - } - else if (operator === 48 /* AmpersandAmpersandToken */) { - return narrowTypeByAnd(type, expr, assumeTrue); - } - else if (operator === 49 /* BarBarToken */) { - return narrowTypeByOr(type, expr, assumeTrue); - } - else if (operator === 87 /* InstanceOfKeyword */) { - return narrowTypeByInstanceof(type, expr, assumeTrue); - } - break; - case 170 /* PrefixUnaryExpression */: - if (expr.operator === 46 /* ExclamationToken */) { - return narrowType(type, expr.operand, !assumeTrue); - } - break; - } - return type; - } - } - function checkIdentifier(node) { - var symbol = getResolvedSymbol(node); - // As noted in ECMAScript 6 language spec, arrow functions never have an arguments objects. - // Although in down-level emit of arrow function, we emit it using function expression which means that - // arguments objects will be bound to the inner object; emitting arrow function natively in ES6, arguments objects - // will be bound to non-arrow function that contain this arrow function. This results in inconsistent behavior. - // To avoid that we will give an error to users if they use arguments objects in arrow function so that they - // can explicitly bound arguments objects - if (symbol === argumentsSymbol && ts.getContainingFunction(node).kind === 166 /* ArrowFunction */ && languageVersion < 2 /* ES6 */) { - error(node, ts.Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression); - } - if (symbol.flags & 8388608 /* Alias */ && !isInTypeQuery(node) && !isConstEnumOrConstEnumOnlyModule(resolveAlias(symbol))) { - markAliasSymbolAsReferenced(symbol); - } - checkCollisionWithCapturedSuperVariable(node, node); - checkCollisionWithCapturedThisVariable(node, node); - checkBlockScopedBindingCapturedInLoop(node, symbol); - return getNarrowedTypeOfSymbol(getExportSymbolOfValueSymbolIfExported(symbol), node); - } - function isInsideFunction(node, threshold) { - var current = node; - while (current && current !== threshold) { - if (ts.isFunctionLike(current)) { - return true; - } - current = current.parent; - } - return false; - } - function checkBlockScopedBindingCapturedInLoop(node, symbol) { - if (languageVersion >= 2 /* ES6 */ || - (symbol.flags & 2 /* BlockScopedVariable */) === 0 || - symbol.valueDeclaration.parent.kind === 226 /* CatchClause */) { - return; - } - // - check if binding is used in some function - // (stop the walk when reaching container of binding declaration) - // - if first check succeeded - check if variable is declared inside the loop - // nesting structure: - // (variable declaration or binding element) -> variable declaration list -> container - var container = symbol.valueDeclaration; - while (container.kind !== 202 /* VariableDeclarationList */) { - container = container.parent; - } - // get the parent of variable declaration list - container = container.parent; - if (container.kind === 183 /* VariableStatement */) { - // if parent is variable statement - get its parent - container = container.parent; - } - var inFunction = isInsideFunction(node.parent, container); - var current = container; - while (current && !ts.nodeStartsNewLexicalEnvironment(current)) { - if (isIterationStatement(current, false)) { - if (inFunction) { - grammarErrorOnFirstToken(current, ts.Diagnostics.Loop_contains_block_scoped_variable_0_referenced_by_a_function_in_the_loop_This_is_only_supported_in_ECMAScript_6_or_higher, ts.declarationNameToString(node)); - } - // mark value declaration so during emit they can have a special handling - getNodeLinks(symbol.valueDeclaration).flags |= 256 /* BlockScopedBindingInLoop */; - break; - } - current = current.parent; - } - } - function captureLexicalThis(node, container) { - var classNode = container.parent && container.parent.kind === 204 /* ClassDeclaration */ ? container.parent : undefined; - getNodeLinks(node).flags |= 2 /* LexicalThis */; - if (container.kind === 134 /* PropertyDeclaration */ || container.kind === 137 /* Constructor */) { - getNodeLinks(classNode).flags |= 4 /* CaptureThis */; - } - else { - getNodeLinks(container).flags |= 4 /* CaptureThis */; - } - } - function checkThisExpression(node) { - // Stop at the first arrow function so that we can - // tell whether 'this' needs to be captured. - var container = ts.getThisContainer(node, true); - var needToCaptureLexicalThis = false; - // Now skip arrow functions to get the "real" owner of 'this'. - if (container.kind === 166 /* ArrowFunction */) { - container = ts.getThisContainer(container, false); - // When targeting es6, arrow function lexically bind "this" so we do not need to do the work of binding "this" in emitted code - needToCaptureLexicalThis = (languageVersion < 2 /* ES6 */); - } - switch (container.kind) { - case 208 /* ModuleDeclaration */: - error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_or_namespace_body); - // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks - break; - case 207 /* EnumDeclaration */: - error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location); - // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks - break; - case 137 /* Constructor */: - if (isInConstructorArgumentInitializer(node, container)) { - error(node, ts.Diagnostics.this_cannot_be_referenced_in_constructor_arguments); - } - break; - case 134 /* PropertyDeclaration */: - case 133 /* PropertySignature */: - if (container.flags & 128 /* Static */) { - error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer); - } - break; - case 129 /* ComputedPropertyName */: - error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_computed_property_name); - break; - } - if (needToCaptureLexicalThis) { - captureLexicalThis(node, container); - } - var classNode = container.parent && container.parent.kind === 204 /* ClassDeclaration */ ? container.parent : undefined; - if (classNode) { - var symbol = getSymbolOfNode(classNode); - return container.flags & 128 /* Static */ ? getTypeOfSymbol(symbol) : getDeclaredTypeOfSymbol(symbol); - } - return anyType; - } - function isInConstructorArgumentInitializer(node, constructorDecl) { - for (var n = node; n && n !== constructorDecl; n = n.parent) { - if (n.kind === 131 /* Parameter */) { - return true; - } - } - return false; - } - function checkSuperExpression(node) { - var isCallExpression = node.parent.kind === 160 /* CallExpression */ && node.parent.expression === node; - var enclosingClass = ts.getAncestor(node, 204 /* ClassDeclaration */); - var baseClass; - if (enclosingClass && ts.getClassExtendsHeritageClauseElement(enclosingClass)) { - var classType = getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingClass)); - var baseTypes = getBaseTypes(classType); - baseClass = baseTypes.length && baseTypes[0]; - } - if (!baseClass) { - error(node, ts.Diagnostics.super_can_only_be_referenced_in_a_derived_class); - return unknownType; - } - var container = ts.getSuperContainer(node, true); - if (container) { - var canUseSuperExpression = false; - var needToCaptureLexicalThis; - if (isCallExpression) { - // TS 1.0 SPEC (April 2014): 4.8.1 - // Super calls are only permitted in constructors of derived classes - canUseSuperExpression = container.kind === 137 /* Constructor */; - } - else { - // TS 1.0 SPEC (April 2014) - // 'super' property access is allowed - // - In a constructor, instance member function, instance member accessor, or instance member variable initializer where this references a derived class instance - // - In a static member function or static member accessor - // super property access might appear in arrow functions with arbitrary deep nesting - needToCaptureLexicalThis = false; - while (container && container.kind === 166 /* ArrowFunction */) { - container = ts.getSuperContainer(container, true); - needToCaptureLexicalThis = languageVersion < 2 /* ES6 */; - } - // topmost container must be something that is directly nested in the class declaration - if (container && container.parent && container.parent.kind === 204 /* ClassDeclaration */) { - if (container.flags & 128 /* Static */) { - canUseSuperExpression = - container.kind === 136 /* MethodDeclaration */ || - container.kind === 135 /* MethodSignature */ || - container.kind === 138 /* GetAccessor */ || - container.kind === 139 /* SetAccessor */; - } - else { - canUseSuperExpression = - container.kind === 136 /* MethodDeclaration */ || - container.kind === 135 /* MethodSignature */ || - container.kind === 138 /* GetAccessor */ || - container.kind === 139 /* SetAccessor */ || - container.kind === 134 /* PropertyDeclaration */ || - container.kind === 133 /* PropertySignature */ || - container.kind === 137 /* Constructor */; - } - } - } - if (canUseSuperExpression) { - var returnType; - if ((container.flags & 128 /* Static */) || isCallExpression) { - getNodeLinks(node).flags |= 32 /* SuperStatic */; - returnType = getTypeOfSymbol(baseClass.symbol); - } - else { - getNodeLinks(node).flags |= 16 /* SuperInstance */; - returnType = baseClass; - } - if (container.kind === 137 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { - // issue custom error message for super property access in constructor arguments (to be aligned with old compiler) - error(node, ts.Diagnostics.super_cannot_be_referenced_in_constructor_arguments); - returnType = unknownType; - } - if (!isCallExpression && needToCaptureLexicalThis) { - // call expressions are allowed only in constructors so they should always capture correct 'this' - // super property access expressions can also appear in arrow functions - - // in this case they should also use correct lexical this - captureLexicalThis(node.parent, container); - } - return returnType; - } - } - if (container && container.kind === 129 /* ComputedPropertyName */) { - error(node, ts.Diagnostics.super_cannot_be_referenced_in_a_computed_property_name); - } - else if (isCallExpression) { - error(node, ts.Diagnostics.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors); - } - else { - error(node, ts.Diagnostics.super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class); - } - return unknownType; - } - // Return contextual type of parameter or undefined if no contextual type is available - function getContextuallyTypedParameterType(parameter) { - if (isFunctionExpressionOrArrowFunction(parameter.parent)) { - var func = parameter.parent; - if (isContextSensitive(func)) { - var contextualSignature = getContextualSignature(func); - if (contextualSignature) { - var funcHasRestParameters = ts.hasRestParameter(func); - var len = func.parameters.length - (funcHasRestParameters ? 1 : 0); - var indexOfParameter = ts.indexOf(func.parameters, parameter); - if (indexOfParameter < len) { - return getTypeAtPosition(contextualSignature, indexOfParameter); - } - // If last parameter is contextually rest parameter get its type - if (indexOfParameter === (func.parameters.length - 1) && - funcHasRestParameters && contextualSignature.hasRestParameter && func.parameters.length >= contextualSignature.parameters.length) { - return getTypeOfSymbol(ts.lastOrUndefined(contextualSignature.parameters)); - } - } - } - } - return undefined; - } - // In a variable, parameter or property declaration with a type annotation, the contextual type of an initializer - // expression is the type of the variable, parameter or property. Otherwise, in a parameter declaration of a - // contextually typed function expression, the contextual type of an initializer expression is the contextual type - // of the parameter. Otherwise, in a variable or parameter declaration with a binding pattern name, the contextual - // type of an initializer expression is the type implied by the binding pattern. - function getContextualTypeForInitializerExpression(node) { - var declaration = node.parent; - if (node === declaration.initializer) { - if (declaration.type) { - return getTypeFromTypeNode(declaration.type); - } - if (declaration.kind === 131 /* Parameter */) { - var type = getContextuallyTypedParameterType(declaration); - if (type) { - return type; - } - } - if (ts.isBindingPattern(declaration.name)) { - return getTypeFromBindingPattern(declaration.name); - } - } - return undefined; - } - function getContextualTypeForReturnExpression(node) { - var func = ts.getContainingFunction(node); - if (func && !func.asteriskToken) { - return getContextualReturnType(func); - } - return undefined; - } - function getContextualTypeForYieldOperand(node) { - var func = ts.getContainingFunction(node); - if (func) { - var contextualReturnType = getContextualReturnType(func); - if (contextualReturnType) { - return node.asteriskToken - ? contextualReturnType - : getElementTypeOfIterableIterator(contextualReturnType); - } - } - return undefined; - } - function getContextualReturnType(functionDecl) { - // If the containing function has a return type annotation, is a constructor, or is a get accessor whose - // corresponding set accessor has a type annotation, return statements in the function are contextually typed - if (functionDecl.type || - functionDecl.kind === 137 /* Constructor */ || - functionDecl.kind === 138 /* GetAccessor */ && getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(functionDecl.symbol, 139 /* SetAccessor */))) { - return getReturnTypeOfSignature(getSignatureFromDeclaration(functionDecl)); - } - // Otherwise, if the containing function is contextually typed by a function type with exactly one call signature - // and that call signature is non-generic, return statements are contextually typed by the return type of the signature - var signature = getContextualSignatureForFunctionLikeDeclaration(functionDecl); - if (signature) { - return getReturnTypeOfSignature(signature); - } - return undefined; - } - // In a typed function call, an argument or substitution expression is contextually typed by the type of the corresponding parameter. - function getContextualTypeForArgument(callTarget, arg) { - var args = getEffectiveCallArguments(callTarget); - var argIndex = ts.indexOf(args, arg); - if (argIndex >= 0) { - var signature = getResolvedSignature(callTarget); - return getTypeAtPosition(signature, argIndex); - } - return undefined; - } - function getContextualTypeForSubstitutionExpression(template, substitutionExpression) { - if (template.parent.kind === 162 /* TaggedTemplateExpression */) { - return getContextualTypeForArgument(template.parent, substitutionExpression); - } - return undefined; - } - function getContextualTypeForBinaryOperand(node) { - var binaryExpression = node.parent; - var operator = binaryExpression.operatorToken.kind; - if (operator >= 53 /* FirstAssignment */ && operator <= 64 /* LastAssignment */) { - // In an assignment expression, the right operand is contextually typed by the type of the left operand. - if (node === binaryExpression.right) { - return checkExpression(binaryExpression.left); - } - } - else if (operator === 49 /* BarBarToken */) { - // When an || expression has a contextual type, the operands are contextually typed by that type. When an || - // expression has no contextual type, the right operand is contextually typed by the type of the left operand. - var type = getContextualType(binaryExpression); - if (!type && node === binaryExpression.right) { - type = checkExpression(binaryExpression.left); - } - return type; - } - return undefined; - } - // Apply a mapping function to a contextual type and return the resulting type. If the contextual type - // is a union type, the mapping function is applied to each constituent type and a union of the resulting - // types is returned. - function applyToContextualType(type, mapper) { - if (!(type.flags & 16384 /* Union */)) { - return mapper(type); - } - var types = type.types; - var mappedType; - var mappedTypes; - for (var _i = 0; _i < types.length; _i++) { - var current = types[_i]; - var t = mapper(current); - if (t) { - if (!mappedType) { - mappedType = t; - } - else if (!mappedTypes) { - mappedTypes = [mappedType, t]; - } - else { - mappedTypes.push(t); - } - } - } - return mappedTypes ? getUnionType(mappedTypes) : mappedType; - } - function getTypeOfPropertyOfContextualType(type, name) { - return applyToContextualType(type, function (t) { - var prop = getPropertyOfObjectType(t, name); - return prop ? getTypeOfSymbol(prop) : undefined; - }); - } - function getIndexTypeOfContextualType(type, kind) { - return applyToContextualType(type, function (t) { return getIndexTypeOfObjectOrUnionType(t, kind); }); - } - // Return true if the given contextual type is a tuple-like type - function contextualTypeIsTupleLikeType(type) { - return !!(type.flags & 16384 /* Union */ ? ts.forEach(type.types, isTupleLikeType) : isTupleLikeType(type)); - } - // Return true if the given contextual type provides an index signature of the given kind - function contextualTypeHasIndexSignature(type, kind) { - return !!(type.flags & 16384 /* Union */ ? ts.forEach(type.types, function (t) { return getIndexTypeOfObjectOrUnionType(t, kind); }) : getIndexTypeOfObjectOrUnionType(type, kind)); - } - // In an object literal contextually typed by a type T, the contextual type of a property assignment is the type of - // the matching property in T, if one exists. Otherwise, it is the type of the numeric index signature in T, if one - // exists. Otherwise, it is the type of the string index signature in T, if one exists. - function getContextualTypeForObjectLiteralMethod(node) { - ts.Debug.assert(ts.isObjectLiteralMethod(node)); - if (isInsideWithStatementBody(node)) { - // We cannot answer semantic questions within a with block, do not proceed any further - return undefined; - } - return getContextualTypeForObjectLiteralElement(node); - } - function getContextualTypeForObjectLiteralElement(element) { - var objectLiteral = element.parent; - var type = getContextualType(objectLiteral); - if (type) { - if (!ts.hasDynamicName(element)) { - // For a (non-symbol) computed property, there is no reason to look up the name - // in the type. It will just be "__computed", which does not appear in any - // SymbolTable. - var symbolName = getSymbolOfNode(element).name; - var propertyType = getTypeOfPropertyOfContextualType(type, symbolName); - if (propertyType) { - return propertyType; - } - } - return isNumericName(element.name) && getIndexTypeOfContextualType(type, 1 /* Number */) || - getIndexTypeOfContextualType(type, 0 /* String */); - } - return undefined; - } - // In an array literal contextually typed by a type T, the contextual type of an element expression at index N is - // the type of the property with the numeric name N in T, if one exists. Otherwise, if T has a numeric index signature, - // it is the type of the numeric index signature in T. Otherwise, in ES6 and higher, the contextual type is the iterated - // type of T. - function getContextualTypeForElementExpression(node) { - var arrayLiteral = node.parent; - var type = getContextualType(arrayLiteral); - if (type) { - var index = ts.indexOf(arrayLiteral.elements, node); - return getTypeOfPropertyOfContextualType(type, "" + index) - || getIndexTypeOfContextualType(type, 1 /* Number */) - || (languageVersion >= 2 /* ES6 */ ? getElementTypeOfIterable(type, undefined) : undefined); - } - return undefined; - } - // In a contextually typed conditional expression, the true/false expressions are contextually typed by the same type. - function getContextualTypeForConditionalOperand(node) { - var conditional = node.parent; - return node === conditional.whenTrue || node === conditional.whenFalse ? getContextualType(conditional) : undefined; - } - // Return the contextual type for a given expression node. During overload resolution, a contextual type may temporarily - // be "pushed" onto a node using the contextualType property. - function getContextualType(node) { - if (isInsideWithStatementBody(node)) { - // We cannot answer semantic questions within a with block, do not proceed any further - return undefined; - } - if (node.contextualType) { - return node.contextualType; - } - var parent = node.parent; - switch (parent.kind) { - case 201 /* VariableDeclaration */: - case 131 /* Parameter */: - case 134 /* PropertyDeclaration */: - case 133 /* PropertySignature */: - case 155 /* BindingElement */: - return getContextualTypeForInitializerExpression(node); - case 166 /* ArrowFunction */: - case 194 /* ReturnStatement */: - return getContextualTypeForReturnExpression(node); - case 175 /* YieldExpression */: - return getContextualTypeForYieldOperand(parent); - case 160 /* CallExpression */: - case 161 /* NewExpression */: - return getContextualTypeForArgument(parent, node); - case 163 /* TypeAssertionExpression */: - return getTypeFromTypeNode(parent.type); - case 172 /* BinaryExpression */: - return getContextualTypeForBinaryOperand(node); - case 227 /* PropertyAssignment */: - return getContextualTypeForObjectLiteralElement(parent); - case 156 /* ArrayLiteralExpression */: - return getContextualTypeForElementExpression(node); - case 173 /* ConditionalExpression */: - return getContextualTypeForConditionalOperand(node); - case 180 /* TemplateSpan */: - ts.Debug.assert(parent.parent.kind === 174 /* TemplateExpression */); - return getContextualTypeForSubstitutionExpression(parent.parent, node); - case 164 /* ParenthesizedExpression */: - return getContextualType(parent); - } - return undefined; - } - // If the given type is an object or union type, if that type has a single signature, and if - // that signature is non-generic, return the signature. Otherwise return undefined. - function getNonGenericSignature(type) { - var signatures = getSignaturesOfObjectOrUnionType(type, 0 /* Call */); - if (signatures.length === 1) { - var signature = signatures[0]; - if (!signature.typeParameters) { - return signature; - } - } - } - function isFunctionExpressionOrArrowFunction(node) { - return node.kind === 165 /* FunctionExpression */ || node.kind === 166 /* ArrowFunction */; - } - function getContextualSignatureForFunctionLikeDeclaration(node) { - // Only function expressions, arrow functions, and object literal methods are contextually typed. - return isFunctionExpressionOrArrowFunction(node) || ts.isObjectLiteralMethod(node) - ? getContextualSignature(node) - : undefined; - } - // Return the contextual signature for a given expression node. A contextual type provides a - // contextual signature if it has a single call signature and if that call signature is non-generic. - // If the contextual type is a union type, get the signature from each type possible and if they are - // all identical ignoring their return type, the result is same signature but with return type as - // union type of return types from these signatures - function getContextualSignature(node) { - ts.Debug.assert(node.kind !== 136 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); - var type = ts.isObjectLiteralMethod(node) - ? getContextualTypeForObjectLiteralMethod(node) - : getContextualType(node); - if (!type) { - return undefined; - } - if (!(type.flags & 16384 /* Union */)) { - return getNonGenericSignature(type); - } - var signatureList; - var types = type.types; - for (var _i = 0; _i < types.length; _i++) { - var current = types[_i]; - // The signature set of all constituent type with call signatures should match - // So number of signatures allowed is either 0 or 1 - if (signatureList && - getSignaturesOfObjectOrUnionType(current, 0 /* Call */).length > 1) { - return undefined; - } - var signature = getNonGenericSignature(current); - if (signature) { - if (!signatureList) { - // This signature will contribute to contextual union signature - signatureList = [signature]; - } - else if (!compareSignatures(signatureList[0], signature, false, compareTypes)) { - // Signatures aren't identical, do not use - return undefined; - } - else { - // Use this signature for contextual union signature - signatureList.push(signature); - } - } - } - // Result is union of signatures collected (return type is union of return types of this signature set) - var result; - if (signatureList) { - result = cloneSignature(signatureList[0]); - // Clear resolved return type we possibly got from cloneSignature - result.resolvedReturnType = undefined; - result.unionSignatures = signatureList; - } - return result; - } - // Presence of a contextual type mapper indicates inferential typing, except the identityMapper object is - // used as a special marker for other purposes. - function isInferentialContext(mapper) { - return mapper && mapper !== identityMapper; - } - // A node is an assignment target if it is on the left hand side of an '=' token, if it is parented by a property - // assignment in an object literal that is an assignment target, or if it is parented by an array literal that is - // an assignment target. Examples include 'a = xxx', '{ p: a } = xxx', '[{ p: a}] = xxx'. - function isAssignmentTarget(node) { - var parent = node.parent; - if (parent.kind === 172 /* BinaryExpression */ && parent.operatorToken.kind === 53 /* EqualsToken */ && parent.left === node) { - return true; - } - if (parent.kind === 227 /* PropertyAssignment */) { - return isAssignmentTarget(parent.parent); - } - if (parent.kind === 156 /* ArrayLiteralExpression */) { - return isAssignmentTarget(parent); - } - return false; - } - function checkSpreadElementExpression(node, contextualMapper) { - // It is usually not safe to call checkExpressionCached if we can be contextually typing. - // You can tell that we are contextually typing because of the contextualMapper parameter. - // While it is true that a spread element can have a contextual type, it does not do anything - // with this type. It is neither affected by it, nor does it propagate it to its operand. - // So the fact that contextualMapper is passed is not important, because the operand of a spread - // element is not contextually typed. - var arrayOrIterableType = checkExpressionCached(node.expression, contextualMapper); - return checkIteratedTypeOrElementType(arrayOrIterableType, node.expression, false); - } - function checkArrayLiteral(node, contextualMapper) { - var elements = node.elements; - if (!elements.length) { - return createArrayType(undefinedType); - } - var hasSpreadElement = false; - var elementTypes = []; - var inDestructuringPattern = isAssignmentTarget(node); - for (var _i = 0; _i < elements.length; _i++) { - var e = elements[_i]; - if (inDestructuringPattern && e.kind === 176 /* SpreadElementExpression */) { - // Given the following situation: - // var c: {}; - // [...c] = ["", 0]; - // - // c is represented in the tree as a spread element in an array literal. - // But c really functions as a rest element, and its purpose is to provide - // a contextual type for the right hand side of the assignment. Therefore, - // instead of calling checkExpression on "...c", which will give an error - // if c is not iterable/array-like, we need to act as if we are trying to - // get the contextual element type from it. So we do something similar to - // getContextualTypeForElementExpression, which will crucially not error - // if there is no index type / iterated type. - var restArrayType = checkExpression(e.expression, contextualMapper); - var restElementType = getIndexTypeOfType(restArrayType, 1 /* Number */) || - (languageVersion >= 2 /* ES6 */ ? getElementTypeOfIterable(restArrayType, undefined) : undefined); - if (restElementType) { - elementTypes.push(restElementType); - } - } - else { - var type = checkExpression(e, contextualMapper); - elementTypes.push(type); - } - hasSpreadElement = hasSpreadElement || e.kind === 176 /* SpreadElementExpression */; - } - if (!hasSpreadElement) { - var contextualType = getContextualType(node); - if (contextualType && contextualTypeIsTupleLikeType(contextualType) || inDestructuringPattern) { - return createTupleType(elementTypes); - } - } - return createArrayType(getUnionType(elementTypes)); - } - function isNumericName(name) { - return name.kind === 129 /* ComputedPropertyName */ ? isNumericComputedName(name) : isNumericLiteralName(name.text); - } - function isNumericComputedName(name) { - // It seems odd to consider an expression of type Any to result in a numeric name, - // but this behavior is consistent with checkIndexedAccess - return isTypeAnyOrAllConstituentTypesHaveKind(checkComputedPropertyName(name), 132 /* NumberLike */); - } - function isTypeAnyOrAllConstituentTypesHaveKind(type, kind) { - return isTypeAny(type) || allConstituentTypesHaveKind(type, kind); - } - function isNumericLiteralName(name) { - // The intent of numeric names is that - // - they are names with text in a numeric form, and that - // - setting properties/indexing with them is always equivalent to doing so with the numeric literal 'numLit', - // acquired by applying the abstract 'ToNumber' operation on the name's text. - // - // The subtlety is in the latter portion, as we cannot reliably say that anything that looks like a numeric literal is a numeric name. - // In fact, it is the case that the text of the name must be equal to 'ToString(numLit)' for this to hold. - // - // Consider the property name '"0xF00D"'. When one indexes with '0xF00D', they are actually indexing with the value of 'ToString(0xF00D)' - // according to the ECMAScript specification, so it is actually as if the user indexed with the string '"61453"'. - // Thus, the text of all numeric literals equivalent to '61543' such as '0xF00D', '0xf00D', '0170015', etc. are not valid numeric names - // because their 'ToString' representation is not equal to their original text. - // This is motivated by ECMA-262 sections 9.3.1, 9.8.1, 11.1.5, and 11.2.1. - // - // Here, we test whether 'ToString(ToNumber(name))' is exactly equal to 'name'. - // The '+' prefix operator is equivalent here to applying the abstract ToNumber operation. - // Applying the 'toString()' method on a number gives us the abstract ToString operation on a number. - // - // Note that this accepts the values 'Infinity', '-Infinity', and 'NaN', and that this is intentional. - // This is desired behavior, because when indexing with them as numeric entities, you are indexing - // with the strings '"Infinity"', '"-Infinity"', and '"NaN"' respectively. - return (+name).toString() === name; - } - function checkComputedPropertyName(node) { - var links = getNodeLinks(node.expression); - if (!links.resolvedType) { - links.resolvedType = checkExpression(node.expression); - // This will allow types number, string, symbol or any. It will also allow enums, the unknown - // type, and any union of these types (like string | number). - if (!isTypeAnyOrAllConstituentTypesHaveKind(links.resolvedType, 132 /* NumberLike */ | 258 /* StringLike */ | 2097152 /* ESSymbol */)) { - error(node, ts.Diagnostics.A_computed_property_name_must_be_of_type_string_number_symbol_or_any); - } - else { - checkThatExpressionIsProperSymbolReference(node.expression, links.resolvedType, true); - } - } - return links.resolvedType; - } - function checkObjectLiteral(node, contextualMapper) { - // Grammar checking - checkGrammarObjectLiteralExpression(node); - var propertiesTable = {}; - var propertiesArray = []; - var contextualType = getContextualType(node); - var typeFlags; - for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { - var memberDecl = _a[_i]; - var member = memberDecl.symbol; - if (memberDecl.kind === 227 /* PropertyAssignment */ || - memberDecl.kind === 228 /* ShorthandPropertyAssignment */ || - ts.isObjectLiteralMethod(memberDecl)) { - var type = void 0; - if (memberDecl.kind === 227 /* PropertyAssignment */) { - type = checkPropertyAssignment(memberDecl, contextualMapper); - } - else if (memberDecl.kind === 136 /* MethodDeclaration */) { - type = checkObjectLiteralMethod(memberDecl, contextualMapper); - } - else { - ts.Debug.assert(memberDecl.kind === 228 /* ShorthandPropertyAssignment */); - type = checkExpression(memberDecl.name, contextualMapper); - } - typeFlags |= type.flags; - var prop = createSymbol(4 /* Property */ | 67108864 /* Transient */ | member.flags, member.name); - prop.declarations = member.declarations; - prop.parent = member.parent; - if (member.valueDeclaration) { - prop.valueDeclaration = member.valueDeclaration; - } - prop.type = type; - prop.target = member; - member = prop; - } - else { - // TypeScript 1.0 spec (April 2014) - // A get accessor declaration is processed in the same manner as - // an ordinary function declaration(section 6.1) with no parameters. - // A set accessor declaration is processed in the same manner - // as an ordinary function declaration with a single parameter and a Void return type. - ts.Debug.assert(memberDecl.kind === 138 /* GetAccessor */ || memberDecl.kind === 139 /* SetAccessor */); - checkAccessorDeclaration(memberDecl); - } - if (!ts.hasDynamicName(memberDecl)) { - propertiesTable[member.name] = member; - } - propertiesArray.push(member); - } - var stringIndexType = getIndexType(0 /* String */); - var numberIndexType = getIndexType(1 /* Number */); - var result = createAnonymousType(node.symbol, propertiesTable, emptyArray, emptyArray, stringIndexType, numberIndexType); - result.flags |= 262144 /* ObjectLiteral */ | 1048576 /* ContainsObjectLiteral */ | (typeFlags & 524288 /* ContainsUndefinedOrNull */); - return result; - function getIndexType(kind) { - if (contextualType && contextualTypeHasIndexSignature(contextualType, kind)) { - var propTypes = []; - for (var i = 0; i < propertiesArray.length; i++) { - var propertyDecl = node.properties[i]; - if (kind === 0 /* String */ || isNumericName(propertyDecl.name)) { - // Do not call getSymbolOfNode(propertyDecl), as that will get the - // original symbol for the node. We actually want to get the symbol - // created by checkObjectLiteral, since that will be appropriately - // contextually typed and resolved. - var type = getTypeOfSymbol(propertiesArray[i]); - if (!ts.contains(propTypes, type)) { - propTypes.push(type); - } - } - } - var result_1 = propTypes.length ? getUnionType(propTypes) : undefinedType; - typeFlags |= result_1.flags; - return result_1; - } - return undefined; - } - } - // If a symbol is a synthesized symbol with no value declaration, we assume it is a property. Example of this are the synthesized - // '.prototype' property as well as synthesized tuple index properties. - function getDeclarationKindFromSymbol(s) { - return s.valueDeclaration ? s.valueDeclaration.kind : 134 /* PropertyDeclaration */; - } - function getDeclarationFlagsFromSymbol(s) { - return s.valueDeclaration ? ts.getCombinedNodeFlags(s.valueDeclaration) : s.flags & 134217728 /* Prototype */ ? 16 /* Public */ | 128 /* Static */ : 0; - } - function checkClassPropertyAccess(node, left, type, prop) { - var flags = getDeclarationFlagsFromSymbol(prop); - // Public properties are always accessible - if (!(flags & (32 /* Private */ | 64 /* Protected */))) { - return; - } - // Property is known to be private or protected at this point - // Get the declaring and enclosing class instance types - var enclosingClassDeclaration = ts.getAncestor(node, 204 /* ClassDeclaration */); - var enclosingClass = enclosingClassDeclaration ? getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingClassDeclaration)) : undefined; - var declaringClass = getDeclaredTypeOfSymbol(prop.parent); - // Private property is accessible if declaring and enclosing class are the same - if (flags & 32 /* Private */) { - if (declaringClass !== enclosingClass) { - error(node, ts.Diagnostics.Property_0_is_private_and_only_accessible_within_class_1, symbolToString(prop), typeToString(declaringClass)); - } - return; - } - // Property is known to be protected at this point - // All protected properties of a supertype are accessible in a super access - if (left.kind === 91 /* SuperKeyword */) { - return; - } - // A protected property is accessible in the declaring class and classes derived from it - if (!enclosingClass || !hasBaseType(enclosingClass, declaringClass)) { - error(node, ts.Diagnostics.Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses, symbolToString(prop), typeToString(declaringClass)); - return; - } - // No further restrictions for static properties - if (flags & 128 /* Static */) { - return; - } - // An instance property must be accessed through an instance of the enclosing class - if (!(getTargetType(type).flags & (1024 /* Class */ | 2048 /* Interface */) && hasBaseType(type, enclosingClass))) { - error(node, ts.Diagnostics.Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1, symbolToString(prop), typeToString(enclosingClass)); - } - } - function checkPropertyAccessExpression(node) { - return checkPropertyAccessExpressionOrQualifiedName(node, node.expression, node.name); - } - function checkQualifiedName(node) { - return checkPropertyAccessExpressionOrQualifiedName(node, node.left, node.right); - } - function checkPropertyAccessExpressionOrQualifiedName(node, left, right) { - var type = checkExpressionOrQualifiedName(left); - if (isTypeAny(type)) { - return type; - } - var apparentType = getApparentType(getWidenedType(type)); - if (apparentType === unknownType) { - // handle cases when type is Type parameter with invalid constraint - return unknownType; - } - var prop = getPropertyOfType(apparentType, right.text); - if (!prop) { - if (right.text) { - error(right, ts.Diagnostics.Property_0_does_not_exist_on_type_1, ts.declarationNameToString(right), typeToString(type)); - } - return unknownType; - } - getNodeLinks(node).resolvedSymbol = prop; - if (prop.parent && prop.parent.flags & 32 /* Class */) { - // TS 1.0 spec (April 2014): 4.8.2 - // - In a constructor, instance member function, instance member accessor, or - // instance member variable initializer where this references a derived class instance, - // a super property access is permitted and must specify a public instance member function of the base class. - // - In a static member function or static member accessor - // where this references the constructor function object of a derived class, - // a super property access is permitted and must specify a public static member function of the base class. - if (left.kind === 91 /* SuperKeyword */ && getDeclarationKindFromSymbol(prop) !== 136 /* MethodDeclaration */) { - error(right, ts.Diagnostics.Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword); - } - else { - checkClassPropertyAccess(node, left, type, prop); - } - } - return getTypeOfSymbol(prop); - } - function isValidPropertyAccess(node, propertyName) { - var left = node.kind === 158 /* PropertyAccessExpression */ - ? node.expression - : node.left; - var type = checkExpressionOrQualifiedName(left); - if (type !== unknownType && !isTypeAny(type)) { - var prop = getPropertyOfType(getWidenedType(type), propertyName); - if (prop && prop.parent && prop.parent.flags & 32 /* Class */) { - if (left.kind === 91 /* SuperKeyword */ && getDeclarationKindFromSymbol(prop) !== 136 /* MethodDeclaration */) { - return false; - } - else { - var modificationCount = diagnostics.getModificationCount(); - checkClassPropertyAccess(node, left, type, prop); - return diagnostics.getModificationCount() === modificationCount; - } - } - } - return true; - } - function checkIndexedAccess(node) { - // Grammar checking - if (!node.argumentExpression) { - var sourceFile = getSourceFile(node); - if (node.parent.kind === 161 /* NewExpression */ && node.parent.expression === node) { - var start = ts.skipTrivia(sourceFile.text, node.expression.end); - var end = node.end; - grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead); - } - else { - var start = node.end - "]".length; - var end = node.end; - grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.Expression_expected); - } - } - // Obtain base constraint such that we can bail out if the constraint is an unknown type - var objectType = getApparentType(checkExpression(node.expression)); - var indexType = node.argumentExpression ? checkExpression(node.argumentExpression) : unknownType; - if (objectType === unknownType) { - return unknownType; - } - var isConstEnum = isConstEnumObjectType(objectType); - if (isConstEnum && - (!node.argumentExpression || node.argumentExpression.kind !== 8 /* StringLiteral */)) { - error(node.argumentExpression, ts.Diagnostics.A_const_enum_member_can_only_be_accessed_using_a_string_literal); - return unknownType; - } - // TypeScript 1.0 spec (April 2014): 4.10 Property Access - // - If IndexExpr is a string literal or a numeric literal and ObjExpr's apparent type has a property with the name - // given by that literal(converted to its string representation in the case of a numeric literal), the property access is of the type of that property. - // - Otherwise, if ObjExpr's apparent type has a numeric index signature and IndexExpr is of type Any, the Number primitive type, or an enum type, - // the property access is of the type of that index signature. - // - Otherwise, if ObjExpr's apparent type has a string index signature and IndexExpr is of type Any, the String or Number primitive type, or an enum type, - // the property access is of the type of that index signature. - // - Otherwise, if IndexExpr is of type Any, the String or Number primitive type, or an enum type, the property access is of type Any. - // See if we can index as a property. - if (node.argumentExpression) { - var name_10 = getPropertyNameForIndexedAccess(node.argumentExpression, indexType); - if (name_10 !== undefined) { - var prop = getPropertyOfType(objectType, name_10); - if (prop) { - getNodeLinks(node).resolvedSymbol = prop; - return getTypeOfSymbol(prop); - } - else if (isConstEnum) { - error(node.argumentExpression, ts.Diagnostics.Property_0_does_not_exist_on_const_enum_1, name_10, symbolToString(objectType.symbol)); - return unknownType; - } - } - } - // Check for compatible indexer types. - if (isTypeAnyOrAllConstituentTypesHaveKind(indexType, 258 /* StringLike */ | 132 /* NumberLike */ | 2097152 /* ESSymbol */)) { - // Try to use a number indexer. - if (isTypeAnyOrAllConstituentTypesHaveKind(indexType, 132 /* NumberLike */)) { - var numberIndexType = getIndexTypeOfType(objectType, 1 /* Number */); - if (numberIndexType) { - return numberIndexType; - } - } - // Try to use string indexing. - var stringIndexType = getIndexTypeOfType(objectType, 0 /* String */); - if (stringIndexType) { - return stringIndexType; - } - // Fall back to any. - if (compilerOptions.noImplicitAny && !compilerOptions.suppressImplicitAnyIndexErrors && !isTypeAny(objectType)) { - error(node, ts.Diagnostics.Index_signature_of_object_type_implicitly_has_an_any_type); - } - return anyType; - } - // REVIEW: Users should know the type that was actually used. - error(node, ts.Diagnostics.An_index_expression_argument_must_be_of_type_string_number_symbol_or_any); - return unknownType; - } - /** - * If indexArgumentExpression is a string literal or number literal, returns its text. - * If indexArgumentExpression is a well known symbol, returns the property name corresponding - * to this symbol, as long as it is a proper symbol reference. - * Otherwise, returns undefined. - */ - function getPropertyNameForIndexedAccess(indexArgumentExpression, indexArgumentType) { - if (indexArgumentExpression.kind === 8 /* StringLiteral */ || indexArgumentExpression.kind === 7 /* NumericLiteral */) { - return indexArgumentExpression.text; - } - if (checkThatExpressionIsProperSymbolReference(indexArgumentExpression, indexArgumentType, false)) { - var rightHandSideName = indexArgumentExpression.name.text; - return ts.getPropertyNameForKnownSymbolName(rightHandSideName); - } - return undefined; - } - /** - * A proper symbol reference requires the following: - * 1. The property access denotes a property that exists - * 2. The expression is of the form Symbol. - * 3. The property access is of the primitive type symbol. - * 4. Symbol in this context resolves to the global Symbol object - */ - function checkThatExpressionIsProperSymbolReference(expression, expressionType, reportError) { - if (expressionType === unknownType) { - // There is already an error, so no need to report one. - return false; - } - if (!ts.isWellKnownSymbolSyntactically(expression)) { - return false; - } - // Make sure the property type is the primitive symbol type - if ((expressionType.flags & 2097152 /* ESSymbol */) === 0) { - if (reportError) { - error(expression, ts.Diagnostics.A_computed_property_name_of_the_form_0_must_be_of_type_symbol, ts.getTextOfNode(expression)); - } - return false; - } - // The name is Symbol., so make sure Symbol actually resolves to the - // global Symbol object - var leftHandSide = expression.expression; - var leftHandSideSymbol = getResolvedSymbol(leftHandSide); - if (!leftHandSideSymbol) { - return false; - } - var globalESSymbol = getGlobalESSymbolConstructorSymbol(); - if (!globalESSymbol) { - // Already errored when we tried to look up the symbol - return false; - } - if (leftHandSideSymbol !== globalESSymbol) { - if (reportError) { - error(leftHandSide, ts.Diagnostics.Symbol_reference_does_not_refer_to_the_global_Symbol_constructor_object); - } - return false; - } - return true; - } - function resolveUntypedCall(node) { - if (node.kind === 162 /* TaggedTemplateExpression */) { - checkExpression(node.template); - } - else { - ts.forEach(node.arguments, function (argument) { - checkExpression(argument); - }); - } - return anySignature; - } - function resolveErrorCall(node) { - resolveUntypedCall(node); - return unknownSignature; - } - // Re-order candidate signatures into the result array. Assumes the result array to be empty. - // The candidate list orders groups in reverse, but within a group signatures are kept in declaration order - // A nit here is that we reorder only signatures that belong to the same symbol, - // so order how inherited signatures are processed is still preserved. - // interface A { (x: string): void } - // interface B extends A { (x: 'foo'): string } - // let b: B; - // b('foo') // <- here overloads should be processed as [(x:'foo'): string, (x: string): void] - function reorderCandidates(signatures, result) { - var lastParent; - var lastSymbol; - var cutoffIndex = 0; - var index; - var specializedIndex = -1; - var spliceIndex; - ts.Debug.assert(!result.length); - for (var _i = 0; _i < signatures.length; _i++) { - var signature = signatures[_i]; - var symbol = signature.declaration && getSymbolOfNode(signature.declaration); - var parent_6 = signature.declaration && signature.declaration.parent; - if (!lastSymbol || symbol === lastSymbol) { - if (lastParent && parent_6 === lastParent) { - index++; - } - else { - lastParent = parent_6; - index = cutoffIndex; - } - } - else { - // current declaration belongs to a different symbol - // set cutoffIndex so re-orderings in the future won't change result set from 0 to cutoffIndex - index = cutoffIndex = result.length; - lastParent = parent_6; - } - lastSymbol = symbol; - // specialized signatures always need to be placed before non-specialized signatures regardless - // of the cutoff position; see GH#1133 - if (signature.hasStringLiterals) { - specializedIndex++; - spliceIndex = specializedIndex; - // The cutoff index always needs to be greater than or equal to the specialized signature index - // in order to prevent non-specialized signatures from being added before a specialized - // signature. - cutoffIndex++; - } - else { - spliceIndex = index; - } - result.splice(spliceIndex, 0, signature); - } - } - function getSpreadArgumentIndex(args) { - for (var i = 0; i < args.length; i++) { - if (args[i].kind === 176 /* SpreadElementExpression */) { - return i; - } - } - return -1; - } - function hasCorrectArity(node, args, signature) { - var adjustedArgCount; // Apparent number of arguments we will have in this call - var typeArguments; // Type arguments (undefined if none) - var callIsIncomplete; // In incomplete call we want to be lenient when we have too few arguments - if (node.kind === 162 /* TaggedTemplateExpression */) { - var tagExpression = node; - // Even if the call is incomplete, we'll have a missing expression as our last argument, - // so we can say the count is just the arg list length - adjustedArgCount = args.length; - typeArguments = undefined; - if (tagExpression.template.kind === 174 /* TemplateExpression */) { - // If a tagged template expression lacks a tail literal, the call is incomplete. - // Specifically, a template only can end in a TemplateTail or a Missing literal. - var templateExpression = tagExpression.template; - var lastSpan = ts.lastOrUndefined(templateExpression.templateSpans); - ts.Debug.assert(lastSpan !== undefined); // we should always have at least one span. - callIsIncomplete = ts.nodeIsMissing(lastSpan.literal) || !!lastSpan.literal.isUnterminated; - } - else { - // If the template didn't end in a backtick, or its beginning occurred right prior to EOF, - // then this might actually turn out to be a TemplateHead in the future; - // so we consider the call to be incomplete. - var templateLiteral = tagExpression.template; - ts.Debug.assert(templateLiteral.kind === 10 /* NoSubstitutionTemplateLiteral */); - callIsIncomplete = !!templateLiteral.isUnterminated; - } - } - else { - var callExpression = node; - if (!callExpression.arguments) { - // This only happens when we have something of the form: 'new C' - ts.Debug.assert(callExpression.kind === 161 /* NewExpression */); - return signature.minArgumentCount === 0; - } - // For IDE scenarios we may have an incomplete call, so a trailing comma is tantamount to adding another argument. - adjustedArgCount = callExpression.arguments.hasTrailingComma ? args.length + 1 : args.length; - // If we are missing the close paren, the call is incomplete. - callIsIncomplete = callExpression.arguments.end === callExpression.end; - typeArguments = callExpression.typeArguments; - } - // If the user supplied type arguments, but the number of type arguments does not match - // the declared number of type parameters, the call has an incorrect arity. - var hasRightNumberOfTypeArgs = !typeArguments || - (signature.typeParameters && typeArguments.length === signature.typeParameters.length); - if (!hasRightNumberOfTypeArgs) { - return false; - } - // If spread arguments are present, check that they correspond to a rest parameter. If so, no - // further checking is necessary. - var spreadArgIndex = getSpreadArgumentIndex(args); - if (spreadArgIndex >= 0) { - return signature.hasRestParameter && spreadArgIndex >= signature.parameters.length - 1; - } - // Too many arguments implies incorrect arity. - if (!signature.hasRestParameter && adjustedArgCount > signature.parameters.length) { - return false; - } - // If the call is incomplete, we should skip the lower bound check. - var hasEnoughArguments = adjustedArgCount >= signature.minArgumentCount; - return callIsIncomplete || hasEnoughArguments; - } - // If type has a single call signature and no other members, return that signature. Otherwise, return undefined. - function getSingleCallSignature(type) { - if (type.flags & 48128 /* ObjectType */) { - var resolved = resolveObjectOrUnionTypeMembers(type); - if (resolved.callSignatures.length === 1 && resolved.constructSignatures.length === 0 && - resolved.properties.length === 0 && !resolved.stringIndexType && !resolved.numberIndexType) { - return resolved.callSignatures[0]; - } - } - return undefined; - } - // Instantiate a generic signature in the context of a non-generic signature (section 3.8.5 in TypeScript spec) - function instantiateSignatureInContextOf(signature, contextualSignature, contextualMapper) { - var context = createInferenceContext(signature.typeParameters, true); - forEachMatchingParameterType(contextualSignature, signature, function (source, target) { - // Type parameters from outer context referenced by source type are fixed by instantiation of the source type - inferTypes(context, instantiateType(source, contextualMapper), target); - }); - return getSignatureInstantiation(signature, getInferredTypes(context)); - } - function inferTypeArguments(signature, args, excludeArgument, context) { - var typeParameters = signature.typeParameters; - var inferenceMapper = createInferenceMapper(context); - // Clear out all the inference results from the last time inferTypeArguments was called on this context - for (var i = 0; i < typeParameters.length; i++) { - // As an optimization, we don't have to clear (and later recompute) inferred types - // for type parameters that have already been fixed on the previous call to inferTypeArguments. - // It would be just as correct to reset all of them. But then we'd be repeating the same work - // for the type parameters that were fixed, namely the work done by getInferredType. - if (!context.inferences[i].isFixed) { - context.inferredTypes[i] = undefined; - } - } - // On this call to inferTypeArguments, we may get more inferences for certain type parameters that were not - // fixed last time. This means that a type parameter that failed inference last time may succeed this time, - // or vice versa. Therefore, the failedTypeParameterIndex is useless if it points to an unfixed type parameter, - // because it may change. So here we reset it. However, getInferredType will not revisit any type parameters - // that were previously fixed. So if a fixed type parameter failed previously, it will fail again because - // it will contain the exact same set of inferences. So if we reset the index from a fixed type parameter, - // we will lose information that we won't recover this time around. - if (context.failedTypeParameterIndex !== undefined && !context.inferences[context.failedTypeParameterIndex].isFixed) { - context.failedTypeParameterIndex = undefined; - } - // We perform two passes over the arguments. In the first pass we infer from all arguments, but use - // wildcards for all context sensitive function expressions. - for (var i = 0; i < args.length; i++) { - var arg = args[i]; - if (arg.kind !== 178 /* OmittedExpression */) { - var paramType = getTypeAtPosition(signature, i); - var argType = void 0; - if (i === 0 && args[i].parent.kind === 162 /* TaggedTemplateExpression */) { - argType = globalTemplateStringsArrayType; - } - else { - // For context sensitive arguments we pass the identityMapper, which is a signal to treat all - // context sensitive function expressions as wildcards - var mapper = excludeArgument && excludeArgument[i] !== undefined ? identityMapper : inferenceMapper; - argType = checkExpressionWithContextualType(arg, paramType, mapper); - } - inferTypes(context, argType, paramType); - } - } - // In the second pass we visit only context sensitive arguments, and only those that aren't excluded, this - // time treating function expressions normally (which may cause previously inferred type arguments to be fixed - // as we construct types for contextually typed parameters) - if (excludeArgument) { - for (var i = 0; i < args.length; i++) { - // No need to check for omitted args and template expressions, their exlusion value is always undefined - if (excludeArgument[i] === false) { - var arg = args[i]; - var paramType = getTypeAtPosition(signature, i); - inferTypes(context, checkExpressionWithContextualType(arg, paramType, inferenceMapper), paramType); - } - } - } - getInferredTypes(context); - } - function checkTypeArguments(signature, typeArguments, typeArgumentResultTypes, reportErrors) { - var typeParameters = signature.typeParameters; - var typeArgumentsAreAssignable = true; - for (var i = 0; i < typeParameters.length; i++) { - var typeArgNode = typeArguments[i]; - var typeArgument = getTypeFromTypeNode(typeArgNode); - // Do not push on this array! It has a preallocated length - typeArgumentResultTypes[i] = typeArgument; - if (typeArgumentsAreAssignable /* so far */) { - var constraint = getConstraintOfTypeParameter(typeParameters[i]); - if (constraint) { - typeArgumentsAreAssignable = checkTypeAssignableTo(typeArgument, constraint, reportErrors ? typeArgNode : undefined, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); - } - } - } - return typeArgumentsAreAssignable; - } - function checkApplicableSignature(node, args, signature, relation, excludeArgument, reportErrors) { - for (var i = 0; i < args.length; i++) { - var arg = args[i]; - if (arg.kind !== 178 /* OmittedExpression */) { - // Check spread elements against rest type (from arity check we know spread argument corresponds to a rest parameter) - var paramType = getTypeAtPosition(signature, i); - // A tagged template expression provides a special first argument, and string literals get string literal types - // unless we're reporting errors - var argType = i === 0 && node.kind === 162 /* TaggedTemplateExpression */ - ? globalTemplateStringsArrayType - : arg.kind === 8 /* StringLiteral */ && !reportErrors - ? getStringLiteralType(arg) - : checkExpressionWithContextualType(arg, paramType, excludeArgument && excludeArgument[i] ? identityMapper : undefined); - // Use argument expression as error location when reporting errors - if (!checkTypeRelatedTo(argType, paramType, relation, reportErrors ? arg : undefined, ts.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1)) { - return false; - } - } - } - return true; - } - /** - * Returns the effective arguments for an expression that works like a function invocation. - * - * If 'node' is a CallExpression or a NewExpression, then its argument list is returned. - * If 'node' is a TaggedTemplateExpression, a new argument list is constructed from the substitution - * expressions, where the first element of the list is the template for error reporting purposes. - */ - function getEffectiveCallArguments(node) { - var args; - if (node.kind === 162 /* TaggedTemplateExpression */) { - var template = node.template; - args = [template]; - if (template.kind === 174 /* TemplateExpression */) { - ts.forEach(template.templateSpans, function (span) { - args.push(span.expression); - }); - } - } - else { - args = node.arguments || emptyArray; - } - return args; - } - /** - * In a 'super' call, type arguments are not provided within the CallExpression node itself. - * Instead, they must be fetched from the class declaration's base type node. - * - * If 'node' is a 'super' call (e.g. super(...), new super(...)), then we attempt to fetch - * the type arguments off the containing class's first heritage clause (if one exists). Note that if - * type arguments are supplied on the 'super' call, they are ignored (though this is syntactically incorrect). - * - * In all other cases, the call's explicit type arguments are returned. - */ - function getEffectiveTypeArguments(callExpression) { - if (callExpression.expression.kind === 91 /* SuperKeyword */) { - var containingClass = ts.getAncestor(callExpression, 204 /* ClassDeclaration */); - var baseClassTypeNode = containingClass && ts.getClassExtendsHeritageClauseElement(containingClass); - return baseClassTypeNode && baseClassTypeNode.typeArguments; - } - else { - // Ordinary case - simple function invocation. - return callExpression.typeArguments; - } - } - function resolveCall(node, signatures, candidatesOutArray) { - var isTaggedTemplate = node.kind === 162 /* TaggedTemplateExpression */; - var typeArguments; - if (!isTaggedTemplate) { - typeArguments = getEffectiveTypeArguments(node); - // We already perform checking on the type arguments on the class declaration itself. - if (node.expression.kind !== 91 /* SuperKeyword */) { - ts.forEach(typeArguments, checkSourceElement); - } - } - var candidates = candidatesOutArray || []; - // reorderCandidates fills up the candidates array directly - reorderCandidates(signatures, candidates); - if (!candidates.length) { - error(node, ts.Diagnostics.Supplied_parameters_do_not_match_any_signature_of_call_target); - return resolveErrorCall(node); - } - var args = getEffectiveCallArguments(node); - // The following applies to any value of 'excludeArgument[i]': - // - true: the argument at 'i' is susceptible to a one-time permanent contextual typing. - // - undefined: the argument at 'i' is *not* susceptible to permanent contextual typing. - // - false: the argument at 'i' *was* and *has been* permanently contextually typed. - // - // The idea is that we will perform type argument inference & assignability checking once - // without using the susceptible parameters that are functions, and once more for each of those - // parameters, contextually typing each as we go along. - // - // For a tagged template, then the first argument be 'undefined' if necessary - // because it represents a TemplateStringsArray. - var excludeArgument; - for (var i = isTaggedTemplate ? 1 : 0; i < args.length; i++) { - if (isContextSensitive(args[i])) { - if (!excludeArgument) { - excludeArgument = new Array(args.length); - } - excludeArgument[i] = true; - } - } - // The following variables are captured and modified by calls to chooseOverload. - // If overload resolution or type argument inference fails, we want to report the - // best error possible. The best error is one which says that an argument was not - // assignable to a parameter. This implies that everything else about the overload - // was fine. So if there is any overload that is only incorrect because of an - // argument, we will report an error on that one. - // - // function foo(s: string) {} - // function foo(n: number) {} // Report argument error on this overload - // function foo() {} - // foo(true); - // - // If none of the overloads even made it that far, there are two possibilities. - // There was a problem with type arguments for some overload, in which case - // report an error on that. Or none of the overloads even had correct arity, - // in which case give an arity error. - // - // function foo(x: T, y: T) {} // Report type argument inference error - // function foo() {} - // foo(0, true); - // - var candidateForArgumentError; - var candidateForTypeArgumentError; - var resultOfFailedInference; - var result; - // Section 4.12.1: - // if the candidate list contains one or more signatures for which the type of each argument - // expression is a subtype of each corresponding parameter type, the return type of the first - // of those signatures becomes the return type of the function call. - // Otherwise, the return type of the first signature in the candidate list becomes the return - // type of the function call. - // - // Whether the call is an error is determined by assignability of the arguments. The subtype pass - // is just important for choosing the best signature. So in the case where there is only one - // signature, the subtype pass is useless. So skipping it is an optimization. - if (candidates.length > 1) { - result = chooseOverload(candidates, subtypeRelation); - } - if (!result) { - // Reinitialize these pointers for round two - candidateForArgumentError = undefined; - candidateForTypeArgumentError = undefined; - resultOfFailedInference = undefined; - result = chooseOverload(candidates, assignableRelation); - } - if (result) { - return result; - } - // No signatures were applicable. Now report errors based on the last applicable signature with - // no arguments excluded from assignability checks. - // If candidate is undefined, it means that no candidates had a suitable arity. In that case, - // skip the checkApplicableSignature check. - if (candidateForArgumentError) { - // excludeArgument is undefined, in this case also equivalent to [undefined, undefined, ...] - // The importance of excludeArgument is to prevent us from typing function expression parameters - // in arguments too early. If possible, we'd like to only type them once we know the correct - // overload. However, this matters for the case where the call is correct. When the call is - // an error, we don't need to exclude any arguments, although it would cause no harm to do so. - checkApplicableSignature(node, args, candidateForArgumentError, assignableRelation, undefined, true); - } - else if (candidateForTypeArgumentError) { - if (!isTaggedTemplate && typeArguments) { - checkTypeArguments(candidateForTypeArgumentError, typeArguments, [], true); - } - else { - ts.Debug.assert(resultOfFailedInference.failedTypeParameterIndex >= 0); - var failedTypeParameter = candidateForTypeArgumentError.typeParameters[resultOfFailedInference.failedTypeParameterIndex]; - var inferenceCandidates = getInferenceCandidates(resultOfFailedInference, resultOfFailedInference.failedTypeParameterIndex); - var diagnosticChainHead = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_type_arguments_explicitly, typeToString(failedTypeParameter)); - reportNoCommonSupertypeError(inferenceCandidates, node.expression || node.tag, diagnosticChainHead); - } - } - else { - error(node, ts.Diagnostics.Supplied_parameters_do_not_match_any_signature_of_call_target); - } - // No signature was applicable. We have already reported the errors for the invalid signature. - // If this is a type resolution session, e.g. Language Service, try to get better information that anySignature. - // Pick the first candidate that matches the arity. This way we can get a contextual type for cases like: - // declare function f(a: { xa: number; xb: number; }); - // f({ | - if (!produceDiagnostics) { - for (var _i = 0; _i < candidates.length; _i++) { - var candidate = candidates[_i]; - if (hasCorrectArity(node, args, candidate)) { - return candidate; - } - } - } - return resolveErrorCall(node); - function chooseOverload(candidates, relation) { - for (var _i = 0; _i < candidates.length; _i++) { - var originalCandidate = candidates[_i]; - if (!hasCorrectArity(node, args, originalCandidate)) { - continue; - } - var candidate = void 0; - var typeArgumentsAreValid = void 0; - var inferenceContext = originalCandidate.typeParameters - ? createInferenceContext(originalCandidate.typeParameters, false) - : undefined; - while (true) { - candidate = originalCandidate; - if (candidate.typeParameters) { - var typeArgumentTypes = void 0; - if (typeArguments) { - typeArgumentTypes = new Array(candidate.typeParameters.length); - typeArgumentsAreValid = checkTypeArguments(candidate, typeArguments, typeArgumentTypes, false); - } - else { - inferTypeArguments(candidate, args, excludeArgument, inferenceContext); - typeArgumentsAreValid = inferenceContext.failedTypeParameterIndex === undefined; - typeArgumentTypes = inferenceContext.inferredTypes; - } - if (!typeArgumentsAreValid) { - break; - } - candidate = getSignatureInstantiation(candidate, typeArgumentTypes); - } - if (!checkApplicableSignature(node, args, candidate, relation, excludeArgument, false)) { - break; - } - var index = excludeArgument ? ts.indexOf(excludeArgument, true) : -1; - if (index < 0) { - return candidate; - } - excludeArgument[index] = false; - } - // A post-mortem of this iteration of the loop. The signature was not applicable, - // so we want to track it as a candidate for reporting an error. If the candidate - // had no type parameters, or had no issues related to type arguments, we can - // report an error based on the arguments. If there was an issue with type - // arguments, then we can only report an error based on the type arguments. - if (originalCandidate.typeParameters) { - var instantiatedCandidate = candidate; - if (typeArgumentsAreValid) { - candidateForArgumentError = instantiatedCandidate; - } - else { - candidateForTypeArgumentError = originalCandidate; - if (!typeArguments) { - resultOfFailedInference = inferenceContext; - } - } - } - else { - ts.Debug.assert(originalCandidate === candidate); - candidateForArgumentError = originalCandidate; - } - } - return undefined; - } - } - function resolveCallExpression(node, candidatesOutArray) { - if (node.expression.kind === 91 /* SuperKeyword */) { - var superType = checkSuperExpression(node.expression); - if (superType !== unknownType) { - return resolveCall(node, getSignaturesOfType(superType, 1 /* Construct */), candidatesOutArray); - } - return resolveUntypedCall(node); - } - var funcType = checkExpression(node.expression); - var apparentType = getApparentType(funcType); - if (apparentType === unknownType) { - // Another error has already been reported - return resolveErrorCall(node); - } - // Technically, this signatures list may be incomplete. We are taking the apparent type, - // but we are not including call signatures that may have been added to the Object or - // Function interface, since they have none by default. This is a bit of a leap of faith - // that the user will not add any. - var callSignatures = getSignaturesOfType(apparentType, 0 /* Call */); - var constructSignatures = getSignaturesOfType(apparentType, 1 /* Construct */); - // TS 1.0 spec: 4.12 - // If FuncExpr is of type Any, or of an object type that has no call or construct signatures - // but is a subtype of the Function interface, the call is an untyped function call. In an - // untyped function call no TypeArgs are permitted, Args can be any argument list, no contextual - // types are provided for the argument expressions, and the result is always of type Any. - // We exclude union types because we may have a union of function types that happen to have - // no common signatures. - if (isTypeAny(funcType) || (!callSignatures.length && !constructSignatures.length && !(funcType.flags & 16384 /* Union */) && isTypeAssignableTo(funcType, globalFunctionType))) { - // The unknownType indicates that an error already occured (and was reported). No - // need to report another error in this case. - if (funcType !== unknownType && node.typeArguments) { - error(node, ts.Diagnostics.Untyped_function_calls_may_not_accept_type_arguments); - } - return resolveUntypedCall(node); - } - // If FuncExpr's apparent type(section 3.8.1) is a function type, the call is a typed function call. - // TypeScript employs overload resolution in typed function calls in order to support functions - // with multiple call signatures. - if (!callSignatures.length) { - if (constructSignatures.length) { - error(node, ts.Diagnostics.Value_of_type_0_is_not_callable_Did_you_mean_to_include_new, typeToString(funcType)); - } - else { - error(node, ts.Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature); - } - return resolveErrorCall(node); - } - return resolveCall(node, callSignatures, candidatesOutArray); - } - function resolveNewExpression(node, candidatesOutArray) { - if (node.arguments && languageVersion < 1 /* ES5 */) { - var spreadIndex = getSpreadArgumentIndex(node.arguments); - if (spreadIndex >= 0) { - error(node.arguments[spreadIndex], ts.Diagnostics.Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher); - } - } - var expressionType = checkExpression(node.expression); - // If ConstructExpr's apparent type(section 3.8.1) is an object type with one or - // more construct signatures, the expression is processed in the same manner as a - // function call, but using the construct signatures as the initial set of candidate - // signatures for overload resolution. The result type of the function call becomes - // the result type of the operation. - expressionType = getApparentType(expressionType); - if (expressionType === unknownType) { - // Another error has already been reported - return resolveErrorCall(node); - } - // TS 1.0 spec: 4.11 - // If ConstructExpr is of type Any, Args can be any argument - // list and the result of the operation is of type Any. - if (isTypeAny(expressionType)) { - if (node.typeArguments) { - error(node, ts.Diagnostics.Untyped_function_calls_may_not_accept_type_arguments); - } - return resolveUntypedCall(node); - } - // Technically, this signatures list may be incomplete. We are taking the apparent type, - // but we are not including construct signatures that may have been added to the Object or - // Function interface, since they have none by default. This is a bit of a leap of faith - // that the user will not add any. - var constructSignatures = getSignaturesOfType(expressionType, 1 /* Construct */); - if (constructSignatures.length) { - return resolveCall(node, constructSignatures, candidatesOutArray); - } - // If ConstructExpr's apparent type is an object type with no construct signatures but - // one or more call signatures, the expression is processed as a function call. A compile-time - // error occurs if the result of the function call is not Void. The type of the result of the - // operation is Any. - var callSignatures = getSignaturesOfType(expressionType, 0 /* Call */); - if (callSignatures.length) { - var signature = resolveCall(node, callSignatures, candidatesOutArray); - if (getReturnTypeOfSignature(signature) !== voidType) { - error(node, ts.Diagnostics.Only_a_void_function_can_be_called_with_the_new_keyword); - } - return signature; - } - error(node, ts.Diagnostics.Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature); - return resolveErrorCall(node); - } - function resolveTaggedTemplateExpression(node, candidatesOutArray) { - var tagType = checkExpression(node.tag); - var apparentType = getApparentType(tagType); - if (apparentType === unknownType) { - // Another error has already been reported - return resolveErrorCall(node); - } - var callSignatures = getSignaturesOfType(apparentType, 0 /* Call */); - if (isTypeAny(tagType) || (!callSignatures.length && !(tagType.flags & 16384 /* Union */) && isTypeAssignableTo(tagType, globalFunctionType))) { - return resolveUntypedCall(node); - } - if (!callSignatures.length) { - error(node, ts.Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature); - return resolveErrorCall(node); - } - return resolveCall(node, callSignatures, candidatesOutArray); - } - // candidatesOutArray is passed by signature help in the language service, and collectCandidates - // must fill it up with the appropriate candidate signatures - function getResolvedSignature(node, candidatesOutArray) { - var links = getNodeLinks(node); - // If getResolvedSignature has already been called, we will have cached the resolvedSignature. - // However, it is possible that either candidatesOutArray was not passed in the first time, - // or that a different candidatesOutArray was passed in. Therefore, we need to redo the work - // to correctly fill the candidatesOutArray. - if (!links.resolvedSignature || candidatesOutArray) { - links.resolvedSignature = anySignature; - if (node.kind === 160 /* CallExpression */) { - links.resolvedSignature = resolveCallExpression(node, candidatesOutArray); - } - else if (node.kind === 161 /* NewExpression */) { - links.resolvedSignature = resolveNewExpression(node, candidatesOutArray); - } - else if (node.kind === 162 /* TaggedTemplateExpression */) { - links.resolvedSignature = resolveTaggedTemplateExpression(node, candidatesOutArray); - } - else { - ts.Debug.fail("Branch in 'getResolvedSignature' should be unreachable."); - } - } - return links.resolvedSignature; - } - function checkCallExpression(node) { - // Grammar checking; stop grammar-checking if checkGrammarTypeArguments return true - checkGrammarTypeArguments(node, node.typeArguments) || checkGrammarArguments(node, node.arguments); - var signature = getResolvedSignature(node); - if (node.expression.kind === 91 /* SuperKeyword */) { - return voidType; - } - if (node.kind === 161 /* NewExpression */) { - var declaration = signature.declaration; - if (declaration && - declaration.kind !== 137 /* Constructor */ && - declaration.kind !== 141 /* ConstructSignature */ && - declaration.kind !== 146 /* ConstructorType */) { - // When resolved signature is a call signature (and not a construct signature) the result type is any - if (compilerOptions.noImplicitAny) { - error(node, ts.Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type); - } - return anyType; - } - } - return getReturnTypeOfSignature(signature); - } - function checkTaggedTemplateExpression(node) { - return getReturnTypeOfSignature(getResolvedSignature(node)); - } - function checkTypeAssertion(node) { - var exprType = checkExpression(node.expression); - var targetType = getTypeFromTypeNode(node.type); - if (produceDiagnostics && targetType !== unknownType) { - var widenedType = getWidenedType(exprType); - if (!(isTypeAssignableTo(targetType, widenedType))) { - checkTypeAssignableTo(exprType, targetType, node, ts.Diagnostics.Neither_type_0_nor_type_1_is_assignable_to_the_other); - } - } - return targetType; - } - function getTypeAtPosition(signature, pos) { - return signature.hasRestParameter ? - pos < signature.parameters.length - 1 ? getTypeOfSymbol(signature.parameters[pos]) : getRestTypeOfSignature(signature) : - pos < signature.parameters.length ? getTypeOfSymbol(signature.parameters[pos]) : anyType; - } - function assignContextualParameterTypes(signature, context, mapper) { - var len = signature.parameters.length - (signature.hasRestParameter ? 1 : 0); - for (var i = 0; i < len; i++) { - var parameter = signature.parameters[i]; - var links = getSymbolLinks(parameter); - links.type = instantiateType(getTypeAtPosition(context, i), mapper); - } - if (signature.hasRestParameter && context.hasRestParameter && signature.parameters.length >= context.parameters.length) { - var parameter = ts.lastOrUndefined(signature.parameters); - var links = getSymbolLinks(parameter); - links.type = instantiateType(getTypeOfSymbol(ts.lastOrUndefined(context.parameters)), mapper); - } - } - function getReturnTypeFromBody(func, contextualMapper) { - var contextualSignature = getContextualSignatureForFunctionLikeDeclaration(func); - if (!func.body) { - return unknownType; - } - var type; - if (func.body.kind !== 182 /* Block */) { - type = checkExpressionCached(func.body, contextualMapper); - } - else { - var types; - var funcIsGenerator = !!func.asteriskToken; - if (funcIsGenerator) { - types = checkAndAggregateYieldOperandTypes(func.body, contextualMapper); - if (types.length === 0) { - var iterableIteratorAny = createIterableIteratorType(anyType); - if (compilerOptions.noImplicitAny) { - error(func.asteriskToken, ts.Diagnostics.Generator_implicitly_has_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type, typeToString(iterableIteratorAny)); - } - return iterableIteratorAny; - } - } - else { - types = checkAndAggregateReturnExpressionTypes(func.body, contextualMapper); - if (types.length === 0) { - return voidType; - } - } - // When yield/return statements are contextually typed we allow the return type to be a union type. - // Otherwise we require the yield/return expressions to have a best common supertype. - type = contextualSignature ? getUnionType(types) : getCommonSupertype(types); - if (!type) { - if (funcIsGenerator) { - error(func, ts.Diagnostics.No_best_common_type_exists_among_yield_expressions); - return createIterableIteratorType(unknownType); - } - else { - error(func, ts.Diagnostics.No_best_common_type_exists_among_return_expressions); - return unknownType; - } - } - if (funcIsGenerator) { - type = createIterableIteratorType(type); - } - } - if (!contextualSignature) { - reportErrorsFromWidening(func, type); - } - return getWidenedType(type); - } - function checkAndAggregateYieldOperandTypes(body, contextualMapper) { - var aggregatedTypes = []; - ts.forEachYieldExpression(body, function (yieldExpression) { - var expr = yieldExpression.expression; - if (expr) { - var type = checkExpressionCached(expr, contextualMapper); - if (yieldExpression.asteriskToken) { - // A yield* expression effectively yields everything that its operand yields - type = checkElementTypeOfIterable(type, yieldExpression.expression); - } - if (!ts.contains(aggregatedTypes, type)) { - aggregatedTypes.push(type); - } - } - }); - return aggregatedTypes; - } - function checkAndAggregateReturnExpressionTypes(body, contextualMapper) { - var aggregatedTypes = []; - ts.forEachReturnStatement(body, function (returnStatement) { - var expr = returnStatement.expression; - if (expr) { - var type = checkExpressionCached(expr, contextualMapper); - if (!ts.contains(aggregatedTypes, type)) { - aggregatedTypes.push(type); - } - } - }); - return aggregatedTypes; - } - function bodyContainsAReturnStatement(funcBody) { - return ts.forEachReturnStatement(funcBody, function (returnStatement) { - return true; - }); - } - function bodyContainsSingleThrowStatement(body) { - return (body.statements.length === 1) && (body.statements[0].kind === 198 /* ThrowStatement */); - } - // TypeScript Specification 1.0 (6.3) - July 2014 - // An explicitly typed function whose return type isn't the Void or the Any type - // must have at least one return statement somewhere in its body. - // An exception to this rule is if the function implementation consists of a single 'throw' statement. - function checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(func, returnType) { - if (!produceDiagnostics) { - return; - } - // Functions that return 'void' or 'any' don't need any return expressions. - if (returnType === voidType || isTypeAny(returnType)) { - return; - } - // If all we have is a function signature, or an arrow function with an expression body, then there is nothing to check. - if (ts.nodeIsMissing(func.body) || func.body.kind !== 182 /* Block */) { - return; - } - var bodyBlock = func.body; - // Ensure the body has at least one return expression. - if (bodyContainsAReturnStatement(bodyBlock)) { - return; - } - // If there are no return expressions, then we need to check if - // the function body consists solely of a throw statement; - // this is to make an exception for unimplemented functions. - if (bodyContainsSingleThrowStatement(bodyBlock)) { - return; - } - // This function does not conform to the specification. - error(func.type, ts.Diagnostics.A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value_or_consist_of_a_single_throw_statement); - } - function checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper) { - ts.Debug.assert(node.kind !== 136 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); - // Grammar checking - var hasGrammarError = checkGrammarDeclarationNameInStrictMode(node) || checkGrammarFunctionLikeDeclaration(node); - if (!hasGrammarError && node.kind === 165 /* FunctionExpression */) { - checkGrammarFunctionName(node.name) || checkGrammarForGenerator(node); - } - // The identityMapper object is used to indicate that function expressions are wildcards - if (contextualMapper === identityMapper && isContextSensitive(node)) { - return anyFunctionType; - } - var links = getNodeLinks(node); - var type = getTypeOfSymbol(node.symbol); - // Check if function expression is contextually typed and assign parameter types if so - if (!(links.flags & 64 /* ContextChecked */)) { - var contextualSignature = getContextualSignature(node); - // If a type check is started at a function expression that is an argument of a function call, obtaining the - // contextual type may recursively get back to here during overload resolution of the call. If so, we will have - // already assigned contextual types. - if (!(links.flags & 64 /* ContextChecked */)) { - links.flags |= 64 /* ContextChecked */; - if (contextualSignature) { - var signature = getSignaturesOfType(type, 0 /* Call */)[0]; - if (isContextSensitive(node)) { - assignContextualParameterTypes(signature, contextualSignature, contextualMapper || identityMapper); - } - if (!node.type && !signature.resolvedReturnType) { - var returnType = getReturnTypeFromBody(node, contextualMapper); - if (!signature.resolvedReturnType) { - signature.resolvedReturnType = returnType; - } - } - } - checkSignatureDeclaration(node); - } - } - if (produceDiagnostics && node.kind !== 136 /* MethodDeclaration */ && node.kind !== 135 /* MethodSignature */) { - checkCollisionWithCapturedSuperVariable(node, node.name); - checkCollisionWithCapturedThisVariable(node, node.name); - } - return type; - } - function checkFunctionExpressionOrObjectLiteralMethodBody(node) { - ts.Debug.assert(node.kind !== 136 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); - if (node.type && !node.asteriskToken) { - checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNode(node.type)); - } - if (node.body) { - if (!node.type) { - // There are some checks that are only performed in getReturnTypeFromBody, that may produce errors - // we need. An example is the noImplicitAny errors resulting from widening the return expression - // of a function. Because checking of function expression bodies is deferred, there was never an - // appropriate time to do this during the main walk of the file (see the comment at the top of - // checkFunctionExpressionBodies). So it must be done now. - getReturnTypeOfSignature(getSignatureFromDeclaration(node)); - } - if (node.body.kind === 182 /* Block */) { - checkSourceElement(node.body); - } - else { - var exprType = checkExpression(node.body); - if (node.type) { - checkTypeAssignableTo(exprType, getTypeFromTypeNode(node.type), node.body, undefined); - } - checkFunctionExpressionBodies(node.body); - } - } - } - function checkArithmeticOperandType(operand, type, diagnostic) { - if (!isTypeAnyOrAllConstituentTypesHaveKind(type, 132 /* NumberLike */)) { - error(operand, diagnostic); - return false; - } - return true; - } - function checkReferenceExpression(n, invalidReferenceMessage, constantVariableMessage) { - function findSymbol(n) { - var symbol = getNodeLinks(n).resolvedSymbol; - // Because we got the symbol from the resolvedSymbol property, it might be of kind - // SymbolFlags.ExportValue. In this case it is necessary to get the actual export - // symbol, which will have the correct flags set on it. - return symbol && getExportSymbolOfValueSymbolIfExported(symbol); - } - function isReferenceOrErrorExpression(n) { - // TypeScript 1.0 spec (April 2014): - // Expressions are classified as values or references. - // References are the subset of expressions that are permitted as the target of an assignment. - // Specifically, references are combinations of identifiers(section 4.3), parentheses(section 4.7), - // and property accesses(section 4.10). - // All other expression constructs described in this chapter are classified as values. - switch (n.kind) { - case 65 /* Identifier */: { - var symbol = findSymbol(n); - // TypeScript 1.0 spec (April 2014): 4.3 - // An identifier expression that references a variable or parameter is classified as a reference. - // An identifier expression that references any other kind of entity is classified as a value(and therefore cannot be the target of an assignment). - return !symbol || symbol === unknownSymbol || symbol === argumentsSymbol || (symbol.flags & 3 /* Variable */) !== 0; - } - case 158 /* PropertyAccessExpression */: { - var symbol = findSymbol(n); - // TypeScript 1.0 spec (April 2014): 4.10 - // A property access expression is always classified as a reference. - // NOTE (not in spec): assignment to enum members should not be allowed - return !symbol || symbol === unknownSymbol || (symbol.flags & ~8 /* EnumMember */) !== 0; - } - case 159 /* ElementAccessExpression */: - // old compiler doesn't check indexed assess - return true; - case 164 /* ParenthesizedExpression */: - return isReferenceOrErrorExpression(n.expression); - default: - return false; - } - } - function isConstVariableReference(n) { - switch (n.kind) { - case 65 /* Identifier */: - case 158 /* PropertyAccessExpression */: { - var symbol = findSymbol(n); - return symbol && (symbol.flags & 3 /* Variable */) !== 0 && (getDeclarationFlagsFromSymbol(symbol) & 8192 /* Const */) !== 0; - } - case 159 /* ElementAccessExpression */: { - var index = n.argumentExpression; - var symbol = findSymbol(n.expression); - if (symbol && index && index.kind === 8 /* StringLiteral */) { - var name_11 = index.text; - var prop = getPropertyOfType(getTypeOfSymbol(symbol), name_11); - return prop && (prop.flags & 3 /* Variable */) !== 0 && (getDeclarationFlagsFromSymbol(prop) & 8192 /* Const */) !== 0; - } - return false; - } - case 164 /* ParenthesizedExpression */: - return isConstVariableReference(n.expression); - default: - return false; - } - } - if (!isReferenceOrErrorExpression(n)) { - error(n, invalidReferenceMessage); - return false; - } - if (isConstVariableReference(n)) { - error(n, constantVariableMessage); - return false; - } - return true; - } - function checkDeleteExpression(node) { - // Grammar checking - if (node.parserContextFlags & 1 /* StrictMode */ && node.expression.kind === 65 /* Identifier */) { - // When a delete operator occurs within strict mode code, a SyntaxError is thrown if its - // UnaryExpression is a direct reference to a variable, function argument, or function name - grammarErrorOnNode(node.expression, ts.Diagnostics.delete_cannot_be_called_on_an_identifier_in_strict_mode); - } - var operandType = checkExpression(node.expression); - return booleanType; - } - function checkTypeOfExpression(node) { - var operandType = checkExpression(node.expression); - return stringType; - } - function checkVoidExpression(node) { - var operandType = checkExpression(node.expression); - return undefinedType; - } - function checkPrefixUnaryExpression(node) { - // Grammar checking - // The identifier eval or arguments may not appear as the LeftHandSideExpression of an - // Assignment operator(11.13) or of a PostfixExpression(11.3) or as the UnaryExpression - // operated upon by a Prefix Increment(11.4.4) or a Prefix Decrement(11.4.5) operator - if ((node.operator === 38 /* PlusPlusToken */ || node.operator === 39 /* MinusMinusToken */)) { - checkGrammarEvalOrArgumentsInStrictMode(node, node.operand); - } - var operandType = checkExpression(node.operand); - switch (node.operator) { - case 33 /* PlusToken */: - case 34 /* MinusToken */: - case 47 /* TildeToken */: - if (someConstituentTypeHasKind(operandType, 2097152 /* ESSymbol */)) { - error(node.operand, ts.Diagnostics.The_0_operator_cannot_be_applied_to_type_symbol, ts.tokenToString(node.operator)); - } - return numberType; - case 46 /* ExclamationToken */: - return booleanType; - case 38 /* PlusPlusToken */: - case 39 /* MinusMinusToken */: - var ok = checkArithmeticOperandType(node.operand, operandType, ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type); - if (ok) { - // run check only if former checks succeeded to avoid reporting cascading errors - checkReferenceExpression(node.operand, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_cannot_be_a_constant); - } - return numberType; - } - return unknownType; - } - function checkPostfixUnaryExpression(node) { - // Grammar checking - // The identifier eval or arguments may not appear as the LeftHandSideExpression of an - // Assignment operator(11.13) or of a PostfixExpression(11.3) or as the UnaryExpression - // operated upon by a Prefix Increment(11.4.4) or a Prefix Decrement(11.4.5) operator. - checkGrammarEvalOrArgumentsInStrictMode(node, node.operand); - var operandType = checkExpression(node.operand); - var ok = checkArithmeticOperandType(node.operand, operandType, ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type); - if (ok) { - // run check only if former checks succeeded to avoid reporting cascading errors - checkReferenceExpression(node.operand, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_cannot_be_a_constant); - } - return numberType; - } - // Just like isTypeOfKind below, except that it returns true if *any* constituent - // has this kind. - function someConstituentTypeHasKind(type, kind) { - if (type.flags & kind) { - return true; - } - if (type.flags & 16384 /* Union */) { - var types = type.types; - for (var _i = 0; _i < types.length; _i++) { - var current = types[_i]; - if (current.flags & kind) { - return true; - } - } - return false; - } - return false; - } - // Return true if type has the given flags, or is a union type composed of types that all have those flags. - function allConstituentTypesHaveKind(type, kind) { - if (type.flags & kind) { - return true; - } - if (type.flags & 16384 /* Union */) { - var types = type.types; - for (var _i = 0; _i < types.length; _i++) { - var current = types[_i]; - if (!(current.flags & kind)) { - return false; - } - } - return true; - } - return false; - } - function isConstEnumObjectType(type) { - return type.flags & (48128 /* ObjectType */ | 32768 /* Anonymous */) && type.symbol && isConstEnumSymbol(type.symbol); - } - function isConstEnumSymbol(symbol) { - return (symbol.flags & 128 /* ConstEnum */) !== 0; - } - function checkInstanceOfExpression(node, leftType, rightType) { - // TypeScript 1.0 spec (April 2014): 4.15.4 - // The instanceof operator requires the left operand to be of type Any, an object type, or a type parameter type, - // and the right operand to be of type Any or a subtype of the 'Function' interface type. - // The result is always of the Boolean primitive type. - // NOTE: do not raise error if leftType is unknown as related error was already reported - if (allConstituentTypesHaveKind(leftType, 2097662 /* Primitive */)) { - error(node.left, ts.Diagnostics.The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); - } - // NOTE: do not raise error if right is unknown as related error was already reported - if (!(isTypeAny(rightType) || isTypeSubtypeOf(rightType, globalFunctionType))) { - error(node.right, ts.Diagnostics.The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type); - } - return booleanType; - } - function checkInExpression(node, leftType, rightType) { - // TypeScript 1.0 spec (April 2014): 4.15.5 - // The in operator requires the left operand to be of type Any, the String primitive type, or the Number primitive type, - // and the right operand to be of type Any, an object type, or a type parameter type. - // The result is always of the Boolean primitive type. - if (!isTypeAnyOrAllConstituentTypesHaveKind(leftType, 258 /* StringLike */ | 132 /* NumberLike */ | 2097152 /* ESSymbol */)) { - error(node.left, ts.Diagnostics.The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol); - } - if (!isTypeAnyOrAllConstituentTypesHaveKind(rightType, 48128 /* ObjectType */ | 512 /* TypeParameter */)) { - error(node.right, ts.Diagnostics.The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); - } - return booleanType; - } - function checkObjectLiteralAssignment(node, sourceType, contextualMapper) { - var properties = node.properties; - for (var _i = 0; _i < properties.length; _i++) { - var p = properties[_i]; - if (p.kind === 227 /* PropertyAssignment */ || p.kind === 228 /* ShorthandPropertyAssignment */) { - // TODO(andersh): Computed property support - var name_12 = p.name; - var type = isTypeAny(sourceType) - ? sourceType - : getTypeOfPropertyOfType(sourceType, name_12.text) || - isNumericLiteralName(name_12.text) && getIndexTypeOfType(sourceType, 1 /* Number */) || - getIndexTypeOfType(sourceType, 0 /* String */); - if (type) { - checkDestructuringAssignment(p.initializer || name_12, type); - } - else { - error(name_12, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(sourceType), ts.declarationNameToString(name_12)); - } - } - else { - error(p, ts.Diagnostics.Property_assignment_expected); - } - } - return sourceType; - } - function checkArrayLiteralAssignment(node, sourceType, contextualMapper) { - // This elementType will be used if the specific property corresponding to this index is not - // present (aka the tuple element property). This call also checks that the parentType is in - // fact an iterable or array (depending on target language). - var elementType = checkIteratedTypeOrElementType(sourceType, node, false) || unknownType; - var elements = node.elements; - for (var i = 0; i < elements.length; i++) { - var e = elements[i]; - if (e.kind !== 178 /* OmittedExpression */) { - if (e.kind !== 176 /* SpreadElementExpression */) { - var propName = "" + i; - var type = isTypeAny(sourceType) - ? sourceType - : isTupleLikeType(sourceType) - ? getTypeOfPropertyOfType(sourceType, propName) - : elementType; - if (type) { - checkDestructuringAssignment(e, type, contextualMapper); - } - else { - if (isTupleType(sourceType)) { - error(e, ts.Diagnostics.Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2, typeToString(sourceType), sourceType.elementTypes.length, elements.length); - } - else { - error(e, ts.Diagnostics.Type_0_has_no_property_1, typeToString(sourceType), propName); - } - } - } - else { - if (i < elements.length - 1) { - error(e, ts.Diagnostics.A_rest_element_must_be_last_in_an_array_destructuring_pattern); - } - else { - var restExpression = e.expression; - if (restExpression.kind === 172 /* BinaryExpression */ && restExpression.operatorToken.kind === 53 /* EqualsToken */) { - error(restExpression.operatorToken, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); - } - else { - checkDestructuringAssignment(restExpression, createArrayType(elementType), contextualMapper); - } - } - } - } - } - return sourceType; - } - function checkDestructuringAssignment(target, sourceType, contextualMapper) { - if (target.kind === 172 /* BinaryExpression */ && target.operatorToken.kind === 53 /* EqualsToken */) { - checkBinaryExpression(target, contextualMapper); - target = target.left; - } - if (target.kind === 157 /* ObjectLiteralExpression */) { - return checkObjectLiteralAssignment(target, sourceType, contextualMapper); - } - if (target.kind === 156 /* ArrayLiteralExpression */) { - return checkArrayLiteralAssignment(target, sourceType, contextualMapper); - } - return checkReferenceAssignment(target, sourceType, contextualMapper); - } - function checkReferenceAssignment(target, sourceType, contextualMapper) { - var targetType = checkExpression(target, contextualMapper); - if (checkReferenceExpression(target, ts.Diagnostics.Invalid_left_hand_side_of_assignment_expression, ts.Diagnostics.Left_hand_side_of_assignment_expression_cannot_be_a_constant)) { - checkTypeAssignableTo(sourceType, targetType, target, undefined); - } - return sourceType; - } - function checkBinaryExpression(node, contextualMapper) { - // Grammar checking - if (ts.isLeftHandSideExpression(node.left) && ts.isAssignmentOperator(node.operatorToken.kind)) { - // ECMA 262 (Annex C) The identifier eval or arguments may not appear as the LeftHandSideExpression of an - // Assignment operator(11.13) or of a PostfixExpression(11.3) - checkGrammarEvalOrArgumentsInStrictMode(node, node.left); - } - var operator = node.operatorToken.kind; - if (operator === 53 /* EqualsToken */ && (node.left.kind === 157 /* ObjectLiteralExpression */ || node.left.kind === 156 /* ArrayLiteralExpression */)) { - return checkDestructuringAssignment(node.left, checkExpression(node.right, contextualMapper), contextualMapper); - } - var leftType = checkExpression(node.left, contextualMapper); - var rightType = checkExpression(node.right, contextualMapper); - switch (operator) { - case 35 /* AsteriskToken */: - case 56 /* AsteriskEqualsToken */: - case 36 /* SlashToken */: - case 57 /* SlashEqualsToken */: - case 37 /* PercentToken */: - case 58 /* PercentEqualsToken */: - case 34 /* MinusToken */: - case 55 /* MinusEqualsToken */: - case 40 /* LessThanLessThanToken */: - case 59 /* LessThanLessThanEqualsToken */: - case 41 /* GreaterThanGreaterThanToken */: - case 60 /* GreaterThanGreaterThanEqualsToken */: - case 42 /* GreaterThanGreaterThanGreaterThanToken */: - case 61 /* GreaterThanGreaterThanGreaterThanEqualsToken */: - case 44 /* BarToken */: - case 63 /* BarEqualsToken */: - case 45 /* CaretToken */: - case 64 /* CaretEqualsToken */: - case 43 /* AmpersandToken */: - case 62 /* AmpersandEqualsToken */: - // TypeScript 1.0 spec (April 2014): 4.15.1 - // These operators require their operands to be of type Any, the Number primitive type, - // or an enum type. Operands of an enum type are treated - // as having the primitive type Number. If one operand is the null or undefined value, - // it is treated as having the type of the other operand. - // The result is always of the Number primitive type. - if (leftType.flags & (32 /* Undefined */ | 64 /* Null */)) - leftType = rightType; - if (rightType.flags & (32 /* Undefined */ | 64 /* Null */)) - rightType = leftType; - var suggestedOperator; - // if a user tries to apply a bitwise operator to 2 boolean operands - // try and return them a helpful suggestion - if ((leftType.flags & 8 /* Boolean */) && - (rightType.flags & 8 /* Boolean */) && - (suggestedOperator = getSuggestedBooleanOperator(node.operatorToken.kind)) !== undefined) { - error(node, ts.Diagnostics.The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead, ts.tokenToString(node.operatorToken.kind), ts.tokenToString(suggestedOperator)); - } - else { - // otherwise just check each operand separately and report errors as normal - var leftOk = checkArithmeticOperandType(node.left, leftType, ts.Diagnostics.The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type); - var rightOk = checkArithmeticOperandType(node.right, rightType, ts.Diagnostics.The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type); - if (leftOk && rightOk) { - checkAssignmentOperator(numberType); - } - } - return numberType; - case 33 /* PlusToken */: - case 54 /* PlusEqualsToken */: - // TypeScript 1.0 spec (April 2014): 4.15.2 - // The binary + operator requires both operands to be of the Number primitive type or an enum type, - // or at least one of the operands to be of type Any or the String primitive type. - // If one operand is the null or undefined value, it is treated as having the type of the other operand. - if (leftType.flags & (32 /* Undefined */ | 64 /* Null */)) - leftType = rightType; - if (rightType.flags & (32 /* Undefined */ | 64 /* Null */)) - rightType = leftType; - var resultType; - if (allConstituentTypesHaveKind(leftType, 132 /* NumberLike */) && allConstituentTypesHaveKind(rightType, 132 /* NumberLike */)) { - // Operands of an enum type are treated as having the primitive type Number. - // If both operands are of the Number primitive type, the result is of the Number primitive type. - resultType = numberType; - } - else { - if (allConstituentTypesHaveKind(leftType, 258 /* StringLike */) || allConstituentTypesHaveKind(rightType, 258 /* StringLike */)) { - // If one or both operands are of the String primitive type, the result is of the String primitive type. - resultType = stringType; - } - else if (isTypeAny(leftType) || isTypeAny(rightType)) { - // Otherwise, the result is of type Any. - // NOTE: unknown type here denotes error type. Old compiler treated this case as any type so do we. - resultType = leftType === unknownType || rightType === unknownType ? unknownType : anyType; - } - // Symbols are not allowed at all in arithmetic expressions - if (resultType && !checkForDisallowedESSymbolOperand(operator)) { - return resultType; - } - } - if (!resultType) { - reportOperatorError(); - return anyType; - } - if (operator === 54 /* PlusEqualsToken */) { - checkAssignmentOperator(resultType); - } - return resultType; - case 24 /* LessThanToken */: - case 25 /* GreaterThanToken */: - case 26 /* LessThanEqualsToken */: - case 27 /* GreaterThanEqualsToken */: - if (!checkForDisallowedESSymbolOperand(operator)) { - return booleanType; - } - // Fall through - case 28 /* EqualsEqualsToken */: - case 29 /* ExclamationEqualsToken */: - case 30 /* EqualsEqualsEqualsToken */: - case 31 /* ExclamationEqualsEqualsToken */: - if (!isTypeAssignableTo(leftType, rightType) && !isTypeAssignableTo(rightType, leftType)) { - reportOperatorError(); - } - return booleanType; - case 87 /* InstanceOfKeyword */: - return checkInstanceOfExpression(node, leftType, rightType); - case 86 /* InKeyword */: - return checkInExpression(node, leftType, rightType); - case 48 /* AmpersandAmpersandToken */: - return rightType; - case 49 /* BarBarToken */: - return getUnionType([leftType, rightType]); - case 53 /* EqualsToken */: - checkAssignmentOperator(rightType); - return rightType; - case 23 /* CommaToken */: - return rightType; - } - // Return true if there was no error, false if there was an error. - function checkForDisallowedESSymbolOperand(operator) { - var offendingSymbolOperand = someConstituentTypeHasKind(leftType, 2097152 /* ESSymbol */) ? node.left : - someConstituentTypeHasKind(rightType, 2097152 /* ESSymbol */) ? node.right : - undefined; - if (offendingSymbolOperand) { - error(offendingSymbolOperand, ts.Diagnostics.The_0_operator_cannot_be_applied_to_type_symbol, ts.tokenToString(operator)); - return false; - } - return true; - } - function getSuggestedBooleanOperator(operator) { - switch (operator) { - case 44 /* BarToken */: - case 63 /* BarEqualsToken */: - return 49 /* BarBarToken */; - case 45 /* CaretToken */: - case 64 /* CaretEqualsToken */: - return 31 /* ExclamationEqualsEqualsToken */; - case 43 /* AmpersandToken */: - case 62 /* AmpersandEqualsToken */: - return 48 /* AmpersandAmpersandToken */; - default: - return undefined; - } - } - function checkAssignmentOperator(valueType) { - if (produceDiagnostics && operator >= 53 /* FirstAssignment */ && operator <= 64 /* LastAssignment */) { - // TypeScript 1.0 spec (April 2014): 4.17 - // An assignment of the form - // VarExpr = ValueExpr - // requires VarExpr to be classified as a reference - // A compound assignment furthermore requires VarExpr to be classified as a reference (section 4.1) - // and the type of the non - compound operation to be assignable to the type of VarExpr. - var ok = checkReferenceExpression(node.left, ts.Diagnostics.Invalid_left_hand_side_of_assignment_expression, ts.Diagnostics.Left_hand_side_of_assignment_expression_cannot_be_a_constant); - // Use default messages - if (ok) { - // to avoid cascading errors check assignability only if 'isReference' check succeeded and no errors were reported - checkTypeAssignableTo(valueType, leftType, node.left, undefined); - } - } - } - function reportOperatorError() { - error(node, ts.Diagnostics.Operator_0_cannot_be_applied_to_types_1_and_2, ts.tokenToString(node.operatorToken.kind), typeToString(leftType), typeToString(rightType)); - } - } - function isYieldExpressionInClass(node) { - var current = node; - var parent = node.parent; - while (parent) { - if (ts.isFunctionLike(parent) && current === parent.body) { - return false; - } - else if (current.kind === 204 /* ClassDeclaration */ || current.kind === 177 /* ClassExpression */) { - return true; - } - current = parent; - parent = parent.parent; - } - return false; - } - function checkYieldExpression(node) { - // Grammar checking - if (!(node.parserContextFlags & 4 /* Yield */) || isYieldExpressionInClass(node)) { - grammarErrorOnFirstToken(node, ts.Diagnostics.A_yield_expression_is_only_allowed_in_a_generator_body); - } - if (node.expression) { - var func = ts.getContainingFunction(node); - // If the user's code is syntactically correct, the func should always have a star. After all, - // we are in a yield context. - if (func && func.asteriskToken) { - var expressionType = checkExpressionCached(node.expression, undefined); - var expressionElementType; - var nodeIsYieldStar = !!node.asteriskToken; - if (nodeIsYieldStar) { - expressionElementType = checkElementTypeOfIterable(expressionType, node.expression); - } - // There is no point in doing an assignability check if the function - // has no explicit return type because the return type is directly computed - // from the yield expressions. - if (func.type) { - var signatureElementType = getElementTypeOfIterableIterator(getTypeFromTypeNode(func.type)) || anyType; - if (nodeIsYieldStar) { - checkTypeAssignableTo(expressionElementType, signatureElementType, node.expression, undefined); - } - else { - checkTypeAssignableTo(expressionType, signatureElementType, node.expression, undefined); - } - } - } - } - // Both yield and yield* expressions have type 'any' - return anyType; - } - function checkConditionalExpression(node, contextualMapper) { - checkExpression(node.condition); - var type1 = checkExpression(node.whenTrue, contextualMapper); - var type2 = checkExpression(node.whenFalse, contextualMapper); - return getUnionType([type1, type2]); - } - function checkTemplateExpression(node) { - // We just want to check each expressions, but we are unconcerned with - // the type of each expression, as any value may be coerced into a string. - // It is worth asking whether this is what we really want though. - // A place where we actually *are* concerned with the expressions' types are - // in tagged templates. - ts.forEach(node.templateSpans, function (templateSpan) { - checkExpression(templateSpan.expression); - }); - return stringType; - } - function checkExpressionWithContextualType(node, contextualType, contextualMapper) { - var saveContextualType = node.contextualType; - node.contextualType = contextualType; - var result = checkExpression(node, contextualMapper); - node.contextualType = saveContextualType; - return result; - } - function checkExpressionCached(node, contextualMapper) { - var links = getNodeLinks(node); - if (!links.resolvedType) { - links.resolvedType = checkExpression(node, contextualMapper); - } - return links.resolvedType; - } - function checkPropertyAssignment(node, contextualMapper) { - // Do not use hasDynamicName here, because that returns false for well known symbols. - // We want to perform checkComputedPropertyName for all computed properties, including - // well known symbols. - if (node.name.kind === 129 /* ComputedPropertyName */) { - checkComputedPropertyName(node.name); - } - return checkExpression(node.initializer, contextualMapper); - } - function checkObjectLiteralMethod(node, contextualMapper) { - // Grammar checking - checkGrammarMethod(node); - // Do not use hasDynamicName here, because that returns false for well known symbols. - // We want to perform checkComputedPropertyName for all computed properties, including - // well known symbols. - if (node.name.kind === 129 /* ComputedPropertyName */) { - checkComputedPropertyName(node.name); - } - var uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper); - return instantiateTypeWithSingleGenericCallSignature(node, uninstantiatedType, contextualMapper); - } - function instantiateTypeWithSingleGenericCallSignature(node, type, contextualMapper) { - if (contextualMapper && contextualMapper !== identityMapper) { - var signature = getSingleCallSignature(type); - if (signature && signature.typeParameters) { - var contextualType = getContextualType(node); - if (contextualType) { - var contextualSignature = getSingleCallSignature(contextualType); - if (contextualSignature && !contextualSignature.typeParameters) { - return getOrCreateTypeFromSignature(instantiateSignatureInContextOf(signature, contextualSignature, contextualMapper)); - } - } - } - } - return type; - } - function checkExpression(node, contextualMapper) { - checkGrammarIdentifierInStrictMode(node); - return checkExpressionOrQualifiedName(node, contextualMapper); - } - // Checks an expression and returns its type. The contextualMapper parameter serves two purposes: When - // contextualMapper is not undefined and not equal to the identityMapper function object it indicates that the - // expression is being inferentially typed (section 4.12.2 in spec) and provides the type mapper to use in - // conjunction with the generic contextual type. When contextualMapper is equal to the identityMapper function - // object, it serves as an indicator that all contained function and arrow expressions should be considered to - // have the wildcard function type; this form of type check is used during overload resolution to exclude - // contextually typed function and arrow expressions in the initial phase. - function checkExpressionOrQualifiedName(node, contextualMapper) { - var type; - if (node.kind == 128 /* QualifiedName */) { - type = checkQualifiedName(node); - } - else { - var uninstantiatedType = checkExpressionWorker(node, contextualMapper); - type = instantiateTypeWithSingleGenericCallSignature(node, uninstantiatedType, contextualMapper); - } - if (isConstEnumObjectType(type)) { - // enum object type for const enums are only permitted in: - // - 'left' in property access - // - 'object' in indexed access - // - target in rhs of import statement - var ok = (node.parent.kind === 158 /* PropertyAccessExpression */ && node.parent.expression === node) || - (node.parent.kind === 159 /* ElementAccessExpression */ && node.parent.expression === node) || - ((node.kind === 65 /* Identifier */ || node.kind === 128 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node)); - if (!ok) { - error(node, ts.Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment); - } - } - return type; - } - function checkNumericLiteral(node) { - // Grammar checking - checkGrammarNumericLiteral(node); - return numberType; - } - function checkExpressionWorker(node, contextualMapper) { - switch (node.kind) { - case 65 /* Identifier */: - return checkIdentifier(node); - case 93 /* ThisKeyword */: - return checkThisExpression(node); - case 91 /* SuperKeyword */: - return checkSuperExpression(node); - case 89 /* NullKeyword */: - return nullType; - case 95 /* TrueKeyword */: - case 80 /* FalseKeyword */: - return booleanType; - case 7 /* NumericLiteral */: - return checkNumericLiteral(node); - case 174 /* TemplateExpression */: - return checkTemplateExpression(node); - case 8 /* StringLiteral */: - case 10 /* NoSubstitutionTemplateLiteral */: - return stringType; - case 9 /* RegularExpressionLiteral */: - return globalRegExpType; - case 156 /* ArrayLiteralExpression */: - return checkArrayLiteral(node, contextualMapper); - case 157 /* ObjectLiteralExpression */: - return checkObjectLiteral(node, contextualMapper); - case 158 /* PropertyAccessExpression */: - return checkPropertyAccessExpression(node); - case 159 /* ElementAccessExpression */: - return checkIndexedAccess(node); - case 160 /* CallExpression */: - case 161 /* NewExpression */: - return checkCallExpression(node); - case 162 /* TaggedTemplateExpression */: - return checkTaggedTemplateExpression(node); - case 163 /* TypeAssertionExpression */: - return checkTypeAssertion(node); - case 164 /* ParenthesizedExpression */: - return checkExpression(node.expression, contextualMapper); - case 177 /* ClassExpression */: - return checkClassExpression(node); - case 165 /* FunctionExpression */: - case 166 /* ArrowFunction */: - return checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper); - case 168 /* TypeOfExpression */: - return checkTypeOfExpression(node); - case 167 /* DeleteExpression */: - return checkDeleteExpression(node); - case 169 /* VoidExpression */: - return checkVoidExpression(node); - case 170 /* PrefixUnaryExpression */: - return checkPrefixUnaryExpression(node); - case 171 /* PostfixUnaryExpression */: - return checkPostfixUnaryExpression(node); - case 172 /* BinaryExpression */: - return checkBinaryExpression(node, contextualMapper); - case 173 /* ConditionalExpression */: - return checkConditionalExpression(node, contextualMapper); - case 176 /* SpreadElementExpression */: - return checkSpreadElementExpression(node, contextualMapper); - case 178 /* OmittedExpression */: - return undefinedType; - case 175 /* YieldExpression */: - return checkYieldExpression(node); - } - return unknownType; - } - // DECLARATION AND STATEMENT TYPE CHECKING - function checkTypeParameter(node) { - checkGrammarDeclarationNameInStrictMode(node); - // Grammar Checking - if (node.expression) { - grammarErrorOnFirstToken(node.expression, ts.Diagnostics.Type_expected); - } - checkSourceElement(node.constraint); - if (produceDiagnostics) { - checkTypeParameterHasIllegalReferencesInConstraint(node); - checkTypeNameIsReserved(node.name, ts.Diagnostics.Type_parameter_name_cannot_be_0); - } - // TODO: Check multiple declarations are identical - } - function checkParameter(node) { - // Grammar checking - // It is a SyntaxError if the Identifier "eval" or the Identifier "arguments" occurs as the - // Identifier in a PropertySetParameterList of a PropertyAssignment that is contained in strict code - // or if its FunctionBody is strict code(11.1.5). - // It is a SyntaxError if the identifier eval or arguments appears within a FormalParameterList of a - // strict mode FunctionLikeDeclaration or FunctionExpression(13.1) - // Grammar checking - checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarEvalOrArgumentsInStrictMode(node, node.name); - checkVariableLikeDeclaration(node); - var func = ts.getContainingFunction(node); - if (node.flags & 112 /* AccessibilityModifier */) { - func = ts.getContainingFunction(node); - if (!(func.kind === 137 /* Constructor */ && ts.nodeIsPresent(func.body))) { - error(node, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); - } - } - if (node.questionToken && ts.isBindingPattern(node.name) && func.body) { - error(node, ts.Diagnostics.A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature); - } - // Only check rest parameter type if it's not a binding pattern. Since binding patterns are - // not allowed in a rest parameter, we already have an error from checkGrammarParameterList. - if (node.dotDotDotToken && !ts.isBindingPattern(node.name) && !isArrayType(getTypeOfSymbol(node.symbol))) { - error(node, ts.Diagnostics.A_rest_parameter_must_be_of_an_array_type); - } - } - function isSyntacticallyValidGenerator(node) { - if (!node.asteriskToken || !node.body) { - return false; - } - return node.kind === 136 /* MethodDeclaration */ || - node.kind === 203 /* FunctionDeclaration */ || - node.kind === 165 /* FunctionExpression */; - } - function getTypePredicateParameterIndex(parameterList, parameter) { - if (parameterList) { - for (var i = 0; i < parameterList.length; i++) { - var param = parameterList[i]; - if (param.name.kind === 65 /* Identifier */ && - param.name.text === parameter.text) { - return i; - } - } - } - return -1; - } - function isInLegalTypePredicatePosition(node) { - switch (node.parent.kind) { - case 166 /* ArrowFunction */: - case 140 /* CallSignature */: - case 203 /* FunctionDeclaration */: - case 165 /* FunctionExpression */: - case 145 /* FunctionType */: - case 136 /* MethodDeclaration */: - case 135 /* MethodSignature */: - return node === node.parent.type; - } - return false; - } - function checkSignatureDeclaration(node) { - // Grammar checking - if (node.kind === 142 /* IndexSignature */) { - checkGrammarIndexSignature(node); - } - else if (node.kind === 145 /* FunctionType */ || node.kind === 203 /* FunctionDeclaration */ || node.kind === 146 /* ConstructorType */ || - node.kind === 140 /* CallSignature */ || node.kind === 137 /* Constructor */ || - node.kind === 141 /* ConstructSignature */) { - checkGrammarFunctionLikeDeclaration(node); - } - checkTypeParameters(node.typeParameters); - ts.forEach(node.parameters, checkParameter); - if (node.type) { - if (node.type.kind === 143 /* TypePredicate */) { - var typePredicate = getSignatureFromDeclaration(node).typePredicate; - var typePredicateNode = node.type; - if (isInLegalTypePredicatePosition(typePredicateNode)) { - if (typePredicate.parameterIndex >= 0) { - if (node.parameters[typePredicate.parameterIndex].dotDotDotToken) { - error(typePredicateNode.parameterName, ts.Diagnostics.A_type_predicate_cannot_reference_a_rest_parameter); - } - else { - checkTypeAssignableTo(typePredicate.type, getTypeAtLocation(node.parameters[typePredicate.parameterIndex]), typePredicateNode.type); - } - } - else if (typePredicateNode.parameterName) { - var hasReportedError = false; - for (var _i = 0, _a = node.parameters; _i < _a.length; _i++) { - var param = _a[_i]; - if (hasReportedError) { - break; - } - if (param.name.kind === 153 /* ObjectBindingPattern */ || - param.name.kind === 154 /* ArrayBindingPattern */) { - (function checkBindingPattern(pattern) { - for (var _i = 0, _a = pattern.elements; _i < _a.length; _i++) { - var element = _a[_i]; - if (element.name.kind === 65 /* Identifier */ && - element.name.text === typePredicate.parameterName) { - error(typePredicateNode.parameterName, ts.Diagnostics.A_type_predicate_cannot_reference_element_0_in_a_binding_pattern, typePredicate.parameterName); - hasReportedError = true; - break; - } - else if (element.name.kind === 154 /* ArrayBindingPattern */ || - element.name.kind === 153 /* ObjectBindingPattern */) { - checkBindingPattern(element.name); - } - } - })(param.name); - } - } - if (!hasReportedError) { - error(typePredicateNode.parameterName, ts.Diagnostics.Cannot_find_parameter_0, typePredicate.parameterName); - } - } - } - else { - error(typePredicateNode, ts.Diagnostics.A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods); - } - } - else { - checkSourceElement(node.type); - } - } - if (produceDiagnostics) { - checkCollisionWithArgumentsInGeneratedCode(node); - if (compilerOptions.noImplicitAny && !node.type) { - switch (node.kind) { - case 141 /* ConstructSignature */: - error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); - break; - case 140 /* CallSignature */: - error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); - break; - } - } - if (node.type) { - if (languageVersion >= 2 /* ES6 */ && isSyntacticallyValidGenerator(node)) { - var returnType = getTypeFromTypeNode(node.type); - if (returnType === voidType) { - error(node.type, ts.Diagnostics.A_generator_cannot_have_a_void_type_annotation); - } - else { - var generatorElementType = getElementTypeOfIterableIterator(returnType) || anyType; - var iterableIteratorInstantiation = createIterableIteratorType(generatorElementType); - // Naively, one could check that IterableIterator is assignable to the return type annotation. - // However, that would not catch the error in the following case. - // - // interface BadGenerator extends Iterable, Iterator { } - // function* g(): BadGenerator { } // Iterable and Iterator have different types! - // - checkTypeAssignableTo(iterableIteratorInstantiation, returnType, node.type); - } - } - } - } - checkSpecializedSignatureDeclaration(node); - } - function checkTypeForDuplicateIndexSignatures(node) { - if (node.kind === 205 /* InterfaceDeclaration */) { - var nodeSymbol = getSymbolOfNode(node); - // in case of merging interface declaration it is possible that we'll enter this check procedure several times for every declaration - // to prevent this run check only for the first declaration of a given kind - if (nodeSymbol.declarations.length > 0 && nodeSymbol.declarations[0] !== node) { - return; - } - } - // TypeScript 1.0 spec (April 2014) - // 3.7.4: An object type can contain at most one string index signature and one numeric index signature. - // 8.5: A class declaration can have at most one string index member declaration and one numeric index member declaration - var indexSymbol = getIndexSymbol(getSymbolOfNode(node)); - if (indexSymbol) { - var seenNumericIndexer = false; - var seenStringIndexer = false; - for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) { - var decl = _a[_i]; - var declaration = decl; - if (declaration.parameters.length === 1 && declaration.parameters[0].type) { - switch (declaration.parameters[0].type.kind) { - case 123 /* StringKeyword */: - if (!seenStringIndexer) { - seenStringIndexer = true; - } - else { - error(declaration, ts.Diagnostics.Duplicate_string_index_signature); - } - break; - case 121 /* NumberKeyword */: - if (!seenNumericIndexer) { - seenNumericIndexer = true; - } - else { - error(declaration, ts.Diagnostics.Duplicate_number_index_signature); - } - break; - } - } - } - } - } - function checkPropertyDeclaration(node) { - // Grammar checking - checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarProperty(node) || checkGrammarComputedPropertyName(node.name); - checkVariableLikeDeclaration(node); - } - function checkMethodDeclaration(node) { - // Grammar checking - checkGrammarMethod(node) || checkGrammarComputedPropertyName(node.name); - // Grammar checking for modifiers is done inside the function checkGrammarFunctionLikeDeclaration - checkFunctionLikeDeclaration(node); - } - function checkConstructorDeclaration(node) { - // Grammar check on signature of constructor and modifier of the constructor is done in checkSignatureDeclaration function. - checkSignatureDeclaration(node); - // Grammar check for checking only related to constructoDeclaration - checkGrammarConstructorTypeParameters(node) || checkGrammarConstructorTypeAnnotation(node); - checkSourceElement(node.body); - var symbol = getSymbolOfNode(node); - var firstDeclaration = ts.getDeclarationOfKind(symbol, node.kind); - // Only type check the symbol once - if (node === firstDeclaration) { - checkFunctionOrConstructorSymbol(symbol); - } - // exit early in the case of signature - super checks are not relevant to them - if (ts.nodeIsMissing(node.body)) { - return; - } - if (!produceDiagnostics) { - return; - } - function isSuperCallExpression(n) { - return n.kind === 160 /* CallExpression */ && n.expression.kind === 91 /* SuperKeyword */; - } - function containsSuperCall(n) { - if (isSuperCallExpression(n)) { - return true; - } - switch (n.kind) { - case 165 /* FunctionExpression */: - case 203 /* FunctionDeclaration */: - case 166 /* ArrowFunction */: - case 157 /* ObjectLiteralExpression */: return false; - default: return ts.forEachChild(n, containsSuperCall); - } - } - function markThisReferencesAsErrors(n) { - if (n.kind === 93 /* ThisKeyword */) { - error(n, ts.Diagnostics.this_cannot_be_referenced_in_current_location); - } - else if (n.kind !== 165 /* FunctionExpression */ && n.kind !== 203 /* FunctionDeclaration */) { - ts.forEachChild(n, markThisReferencesAsErrors); - } - } - function isInstancePropertyWithInitializer(n) { - return n.kind === 134 /* PropertyDeclaration */ && - !(n.flags & 128 /* Static */) && - !!n.initializer; - } - // TS 1.0 spec (April 2014): 8.3.2 - // Constructors of classes with no extends clause may not contain super calls, whereas - // constructors of derived classes must contain at least one super call somewhere in their function body. - if (ts.getClassExtendsHeritageClauseElement(node.parent)) { - if (containsSuperCall(node.body)) { - // The first statement in the body of a constructor must be a super call if both of the following are true: - // - The containing class is a derived class. - // - The constructor declares parameter properties - // or the containing class declares instance member variables with initializers. - var superCallShouldBeFirst = ts.forEach(node.parent.members, isInstancePropertyWithInitializer) || - ts.forEach(node.parameters, function (p) { return p.flags & (16 /* Public */ | 32 /* Private */ | 64 /* Protected */); }); - if (superCallShouldBeFirst) { - var statements = node.body.statements; - if (!statements.length || statements[0].kind !== 185 /* ExpressionStatement */ || !isSuperCallExpression(statements[0].expression)) { - error(node, ts.Diagnostics.A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_or_has_parameter_properties); - } - else { - // In such a required super call, it is a compile-time error for argument expressions to reference this. - markThisReferencesAsErrors(statements[0].expression); - } - } - } - else { - error(node, ts.Diagnostics.Constructors_for_derived_classes_must_contain_a_super_call); - } - } - } - function checkAccessorDeclaration(node) { - if (produceDiagnostics) { - // Grammar checking accessors - checkGrammarFunctionLikeDeclaration(node) || checkGrammarAccessor(node) || checkGrammarComputedPropertyName(node.name); - if (node.kind === 138 /* GetAccessor */) { - if (!ts.isInAmbientContext(node) && ts.nodeIsPresent(node.body) && !(bodyContainsAReturnStatement(node.body) || bodyContainsSingleThrowStatement(node.body))) { - error(node.name, ts.Diagnostics.A_get_accessor_must_return_a_value_or_consist_of_a_single_throw_statement); - } - } - if (!ts.hasDynamicName(node)) { - // TypeScript 1.0 spec (April 2014): 8.4.3 - // Accessors for the same member name must specify the same accessibility. - var otherKind = node.kind === 138 /* GetAccessor */ ? 139 /* SetAccessor */ : 138 /* GetAccessor */; - var otherAccessor = ts.getDeclarationOfKind(node.symbol, otherKind); - if (otherAccessor) { - if (((node.flags & 112 /* AccessibilityModifier */) !== (otherAccessor.flags & 112 /* AccessibilityModifier */))) { - error(node.name, ts.Diagnostics.Getter_and_setter_accessors_do_not_agree_in_visibility); - } - var currentAccessorType = getAnnotatedAccessorType(node); - var otherAccessorType = getAnnotatedAccessorType(otherAccessor); - // TypeScript 1.0 spec (April 2014): 4.5 - // If both accessors include type annotations, the specified types must be identical. - if (currentAccessorType && otherAccessorType) { - if (!isTypeIdenticalTo(currentAccessorType, otherAccessorType)) { - error(node, ts.Diagnostics.get_and_set_accessor_must_have_the_same_type); - } - } - } - } - getTypeOfAccessors(getSymbolOfNode(node)); - } - checkFunctionLikeDeclaration(node); - } - function checkMissingDeclaration(node) { - checkDecorators(node); - } - function checkTypeReferenceNode(node) { - checkGrammarTypeReferenceInStrictMode(node.typeName); - return checkTypeReferenceOrExpressionWithTypeArguments(node); - } - function checkExpressionWithTypeArguments(node) { - checkGrammarExpressionWithTypeArgumentsInStrictMode(node.expression); - return checkTypeReferenceOrExpressionWithTypeArguments(node); - } - function checkTypeReferenceOrExpressionWithTypeArguments(node) { - // Grammar checking - checkGrammarTypeArguments(node, node.typeArguments); - var type = getTypeFromTypeReference(node); - if (type !== unknownType && node.typeArguments) { - // Do type argument local checks only if referenced type is successfully resolved - var symbol = getNodeLinks(node).resolvedSymbol; - var typeParameters = symbol.flags & 524288 /* TypeAlias */ ? getSymbolLinks(symbol).typeParameters : type.target.localTypeParameters; - var len = node.typeArguments.length; - for (var i = 0; i < len; i++) { - checkSourceElement(node.typeArguments[i]); - var constraint = getConstraintOfTypeParameter(typeParameters[i]); - if (produceDiagnostics && constraint) { - var typeArgument = type.typeArguments[i]; - checkTypeAssignableTo(typeArgument, constraint, node, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); - } - } - } - } - function checkTypeQuery(node) { - getTypeFromTypeQueryNode(node); - } - function checkTypeLiteral(node) { - ts.forEach(node.members, checkSourceElement); - if (produceDiagnostics) { - var type = getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); - checkIndexConstraints(type); - checkTypeForDuplicateIndexSignatures(node); - } - } - function checkArrayType(node) { - checkSourceElement(node.elementType); - } - function checkTupleType(node) { - // Grammar checking - var hasErrorFromDisallowedTrailingComma = checkGrammarForDisallowedTrailingComma(node.elementTypes); - if (!hasErrorFromDisallowedTrailingComma && node.elementTypes.length === 0) { - grammarErrorOnNode(node, ts.Diagnostics.A_tuple_type_element_list_cannot_be_empty); - } - ts.forEach(node.elementTypes, checkSourceElement); - } - function checkUnionType(node) { - ts.forEach(node.types, checkSourceElement); - } - function isPrivateWithinAmbient(node) { - return (node.flags & 32 /* Private */) && ts.isInAmbientContext(node); - } - function checkSpecializedSignatureDeclaration(signatureDeclarationNode) { - if (!produceDiagnostics) { - return; - } - var signature = getSignatureFromDeclaration(signatureDeclarationNode); - if (!signature.hasStringLiterals) { - return; - } - // TypeScript 1.0 spec (April 2014): 3.7.2.2 - // Specialized signatures are not permitted in conjunction with a function body - if (ts.nodeIsPresent(signatureDeclarationNode.body)) { - error(signatureDeclarationNode, ts.Diagnostics.A_signature_with_an_implementation_cannot_use_a_string_literal_type); - return; - } - // TypeScript 1.0 spec (April 2014): 3.7.2.4 - // Every specialized call or construct signature in an object type must be assignable - // to at least one non-specialized call or construct signature in the same object type - var signaturesToCheck; - // Unnamed (call\construct) signatures in interfaces are inherited and not shadowed so examining just node symbol won't give complete answer. - // Use declaring type to obtain full list of signatures. - if (!signatureDeclarationNode.name && signatureDeclarationNode.parent && signatureDeclarationNode.parent.kind === 205 /* InterfaceDeclaration */) { - ts.Debug.assert(signatureDeclarationNode.kind === 140 /* CallSignature */ || signatureDeclarationNode.kind === 141 /* ConstructSignature */); - var signatureKind = signatureDeclarationNode.kind === 140 /* CallSignature */ ? 0 /* Call */ : 1 /* Construct */; - var containingSymbol = getSymbolOfNode(signatureDeclarationNode.parent); - var containingType = getDeclaredTypeOfSymbol(containingSymbol); - signaturesToCheck = getSignaturesOfType(containingType, signatureKind); - } - else { - signaturesToCheck = getSignaturesOfSymbol(getSymbolOfNode(signatureDeclarationNode)); - } - for (var _i = 0; _i < signaturesToCheck.length; _i++) { - var otherSignature = signaturesToCheck[_i]; - if (!otherSignature.hasStringLiterals && isSignatureAssignableTo(signature, otherSignature)) { - return; - } - } - error(signatureDeclarationNode, ts.Diagnostics.Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature); - } - function getEffectiveDeclarationFlags(n, flagsToCheck) { - var flags = ts.getCombinedNodeFlags(n); - if (n.parent.kind !== 205 /* InterfaceDeclaration */ && ts.isInAmbientContext(n)) { - if (!(flags & 2 /* Ambient */)) { - // It is nested in an ambient context, which means it is automatically exported - flags |= 1 /* Export */; - } - flags |= 2 /* Ambient */; - } - return flags & flagsToCheck; - } - function checkFunctionOrConstructorSymbol(symbol) { - if (!produceDiagnostics) { - return; - } - function getCanonicalOverload(overloads, implementation) { - // Consider the canonical set of flags to be the flags of the bodyDeclaration or the first declaration - // Error on all deviations from this canonical set of flags - // The caveat is that if some overloads are defined in lib.d.ts, we don't want to - // report the errors on those. To achieve this, we will say that the implementation is - // the canonical signature only if it is in the same container as the first overload - var implementationSharesContainerWithFirstOverload = implementation !== undefined && implementation.parent === overloads[0].parent; - return implementationSharesContainerWithFirstOverload ? implementation : overloads[0]; - } - function checkFlagAgreementBetweenOverloads(overloads, implementation, flagsToCheck, someOverloadFlags, allOverloadFlags) { - // Error if some overloads have a flag that is not shared by all overloads. To find the - // deviations, we XOR someOverloadFlags with allOverloadFlags - var someButNotAllOverloadFlags = someOverloadFlags ^ allOverloadFlags; - if (someButNotAllOverloadFlags !== 0) { - var canonicalFlags = getEffectiveDeclarationFlags(getCanonicalOverload(overloads, implementation), flagsToCheck); - ts.forEach(overloads, function (o) { - var deviation = getEffectiveDeclarationFlags(o, flagsToCheck) ^ canonicalFlags; - if (deviation & 1 /* Export */) { - error(o.name, ts.Diagnostics.Overload_signatures_must_all_be_exported_or_not_exported); - } - else if (deviation & 2 /* Ambient */) { - error(o.name, ts.Diagnostics.Overload_signatures_must_all_be_ambient_or_non_ambient); - } - else if (deviation & (32 /* Private */ | 64 /* Protected */)) { - error(o.name, ts.Diagnostics.Overload_signatures_must_all_be_public_private_or_protected); - } - }); - } - } - function checkQuestionTokenAgreementBetweenOverloads(overloads, implementation, someHaveQuestionToken, allHaveQuestionToken) { - if (someHaveQuestionToken !== allHaveQuestionToken) { - var canonicalHasQuestionToken = ts.hasQuestionToken(getCanonicalOverload(overloads, implementation)); - ts.forEach(overloads, function (o) { - var deviation = ts.hasQuestionToken(o) !== canonicalHasQuestionToken; - if (deviation) { - error(o.name, ts.Diagnostics.Overload_signatures_must_all_be_optional_or_required); - } - }); - } - } - var flagsToCheck = 1 /* Export */ | 2 /* Ambient */ | 32 /* Private */ | 64 /* Protected */; - var someNodeFlags = 0; - var allNodeFlags = flagsToCheck; - var someHaveQuestionToken = false; - var allHaveQuestionToken = true; - var hasOverloads = false; - var bodyDeclaration; - var lastSeenNonAmbientDeclaration; - var previousDeclaration; - var declarations = symbol.declarations; - var isConstructor = (symbol.flags & 16384 /* Constructor */) !== 0; - function reportImplementationExpectedError(node) { - if (node.name && ts.nodeIsMissing(node.name)) { - return; - } - var seen = false; - var subsequentNode = ts.forEachChild(node.parent, function (c) { - if (seen) { - return c; - } - else { - seen = c === node; - } - }); - if (subsequentNode) { - if (subsequentNode.kind === node.kind) { - var errorNode_1 = subsequentNode.name || subsequentNode; - // TODO(jfreeman): These are methods, so handle computed name case - if (node.name && subsequentNode.name && node.name.text === subsequentNode.name.text) { - // the only situation when this is possible (same kind\same name but different symbol) - mixed static and instance class members - ts.Debug.assert(node.kind === 136 /* MethodDeclaration */ || node.kind === 135 /* MethodSignature */); - ts.Debug.assert((node.flags & 128 /* Static */) !== (subsequentNode.flags & 128 /* Static */)); - var diagnostic = node.flags & 128 /* Static */ ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static; - error(errorNode_1, diagnostic); - return; - } - else if (ts.nodeIsPresent(subsequentNode.body)) { - error(errorNode_1, ts.Diagnostics.Function_implementation_name_must_be_0, ts.declarationNameToString(node.name)); - return; - } - } - } - var errorNode = node.name || node; - if (isConstructor) { - error(errorNode, ts.Diagnostics.Constructor_implementation_is_missing); - } - else { - error(errorNode, ts.Diagnostics.Function_implementation_is_missing_or_not_immediately_following_the_declaration); - } - } - // when checking exported function declarations across modules check only duplicate implementations - // names and consistency of modifiers are verified when we check local symbol - var isExportSymbolInsideModule = symbol.parent && symbol.parent.flags & 1536 /* Module */; - var duplicateFunctionDeclaration = false; - var multipleConstructorImplementation = false; - for (var _i = 0; _i < declarations.length; _i++) { - var current = declarations[_i]; - var node = current; - var inAmbientContext = ts.isInAmbientContext(node); - var inAmbientContextOrInterface = node.parent.kind === 205 /* InterfaceDeclaration */ || node.parent.kind === 148 /* TypeLiteral */ || inAmbientContext; - if (inAmbientContextOrInterface) { - // check if declarations are consecutive only if they are non-ambient - // 1. ambient declarations can be interleaved - // i.e. this is legal - // declare function foo(); - // declare function bar(); - // declare function foo(); - // 2. mixing ambient and non-ambient declarations is a separate error that will be reported - do not want to report an extra one - previousDeclaration = undefined; - } - if (node.kind === 203 /* FunctionDeclaration */ || node.kind === 136 /* MethodDeclaration */ || node.kind === 135 /* MethodSignature */ || node.kind === 137 /* Constructor */) { - var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); - someNodeFlags |= currentNodeFlags; - allNodeFlags &= currentNodeFlags; - someHaveQuestionToken = someHaveQuestionToken || ts.hasQuestionToken(node); - allHaveQuestionToken = allHaveQuestionToken && ts.hasQuestionToken(node); - if (ts.nodeIsPresent(node.body) && bodyDeclaration) { - if (isConstructor) { - multipleConstructorImplementation = true; - } - else { - duplicateFunctionDeclaration = true; - } - } - else if (!isExportSymbolInsideModule && previousDeclaration && previousDeclaration.parent === node.parent && previousDeclaration.end !== node.pos) { - reportImplementationExpectedError(previousDeclaration); - } - if (ts.nodeIsPresent(node.body)) { - if (!bodyDeclaration) { - bodyDeclaration = node; - } - } - else { - hasOverloads = true; - } - previousDeclaration = node; - if (!inAmbientContextOrInterface) { - lastSeenNonAmbientDeclaration = node; - } - } - } - if (multipleConstructorImplementation) { - ts.forEach(declarations, function (declaration) { - error(declaration, ts.Diagnostics.Multiple_constructor_implementations_are_not_allowed); - }); - } - if (duplicateFunctionDeclaration) { - ts.forEach(declarations, function (declaration) { - error(declaration.name, ts.Diagnostics.Duplicate_function_implementation); - }); - } - if (!isExportSymbolInsideModule && lastSeenNonAmbientDeclaration && !lastSeenNonAmbientDeclaration.body) { - reportImplementationExpectedError(lastSeenNonAmbientDeclaration); - } - if (hasOverloads) { - checkFlagAgreementBetweenOverloads(declarations, bodyDeclaration, flagsToCheck, someNodeFlags, allNodeFlags); - checkQuestionTokenAgreementBetweenOverloads(declarations, bodyDeclaration, someHaveQuestionToken, allHaveQuestionToken); - if (bodyDeclaration) { - var signatures = getSignaturesOfSymbol(symbol); - var bodySignature = getSignatureFromDeclaration(bodyDeclaration); - // If the implementation signature has string literals, we will have reported an error in - // checkSpecializedSignatureDeclaration - if (!bodySignature.hasStringLiterals) { - // TypeScript 1.0 spec (April 2014): 6.1 - // If a function declaration includes overloads, the overloads determine the call - // signatures of the type given to the function object - // and the function implementation signature must be assignable to that type - // - // TypeScript 1.0 spec (April 2014): 3.8.4 - // Note that specialized call and construct signatures (section 3.7.2.4) are not significant when determining assignment compatibility - // Consider checking against specialized signatures too. Not doing so creates a type hole: - // - // function g(x: "hi", y: boolean); - // function g(x: string, y: {}); - // function g(x: string, y: string) { } - // - // The implementation is completely unrelated to the specialized signature, yet we do not check this. - for (var _a = 0; _a < signatures.length; _a++) { - var signature = signatures[_a]; - if (!signature.hasStringLiterals && !isSignatureAssignableTo(bodySignature, signature)) { - error(signature.declaration, ts.Diagnostics.Overload_signature_is_not_compatible_with_function_implementation); - break; - } - } - } - } - } - } - function checkExportsOnMergedDeclarations(node) { - if (!produceDiagnostics) { - return; - } - // Exports should be checked only if enclosing module contains both exported and non exported declarations. - // In case if all declarations are non-exported check is unnecessary. - // if localSymbol is defined on node then node itself is exported - check is required - var symbol = node.localSymbol; - if (!symbol) { - // local symbol is undefined => this declaration is non-exported. - // however symbol might contain other declarations that are exported - symbol = getSymbolOfNode(node); - if (!(symbol.flags & 7340032 /* Export */)) { - // this is a pure local symbol (all declarations are non-exported) - no need to check anything - return; - } - } - // run the check only for the first declaration in the list - if (ts.getDeclarationOfKind(symbol, node.kind) !== node) { - return; - } - // we use SymbolFlags.ExportValue, SymbolFlags.ExportType and SymbolFlags.ExportNamespace - // to denote disjoint declarationSpaces (without making new enum type). - var exportedDeclarationSpaces = 0; - var nonExportedDeclarationSpaces = 0; - ts.forEach(symbol.declarations, function (d) { - var declarationSpaces = getDeclarationSpaces(d); - if (getEffectiveDeclarationFlags(d, 1 /* Export */)) { - exportedDeclarationSpaces |= declarationSpaces; - } - else { - nonExportedDeclarationSpaces |= declarationSpaces; - } - }); - var commonDeclarationSpace = exportedDeclarationSpaces & nonExportedDeclarationSpaces; - if (commonDeclarationSpace) { - // declaration spaces for exported and non-exported declarations intersect - ts.forEach(symbol.declarations, function (d) { - if (getDeclarationSpaces(d) & commonDeclarationSpace) { - error(d.name, ts.Diagnostics.Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local, ts.declarationNameToString(d.name)); - } - }); - } - function getDeclarationSpaces(d) { - switch (d.kind) { - case 205 /* InterfaceDeclaration */: - return 2097152 /* ExportType */; - case 208 /* ModuleDeclaration */: - return d.name.kind === 8 /* StringLiteral */ || ts.getModuleInstanceState(d) !== 0 /* NonInstantiated */ - ? 4194304 /* ExportNamespace */ | 1048576 /* ExportValue */ - : 4194304 /* ExportNamespace */; - case 204 /* ClassDeclaration */: - case 207 /* EnumDeclaration */: - return 2097152 /* ExportType */ | 1048576 /* ExportValue */; - case 211 /* ImportEqualsDeclaration */: - var result = 0; - var target = resolveAlias(getSymbolOfNode(d)); - ts.forEach(target.declarations, function (d) { result |= getDeclarationSpaces(d); }); - return result; - default: - return 1048576 /* ExportValue */; - } - } - } - /** Check a decorator */ - function checkDecorator(node) { - var expression = node.expression; - var exprType = checkExpression(expression); - switch (node.parent.kind) { - case 204 /* ClassDeclaration */: - var classSymbol = getSymbolOfNode(node.parent); - var classConstructorType = getTypeOfSymbol(classSymbol); - var classDecoratorType = instantiateSingleCallFunctionType(getGlobalClassDecoratorType(), [classConstructorType]); - checkTypeAssignableTo(exprType, classDecoratorType, node); - break; - case 134 /* PropertyDeclaration */: - checkTypeAssignableTo(exprType, getGlobalPropertyDecoratorType(), node); - break; - case 136 /* MethodDeclaration */: - case 138 /* GetAccessor */: - case 139 /* SetAccessor */: - var methodType = getTypeOfNode(node.parent); - var methodDecoratorType = instantiateSingleCallFunctionType(getGlobalMethodDecoratorType(), [methodType]); - checkTypeAssignableTo(exprType, methodDecoratorType, node); - break; - case 131 /* Parameter */: - checkTypeAssignableTo(exprType, getGlobalParameterDecoratorType(), node); - break; - } - } - /** Checks a type reference node as an expression. */ - function checkTypeNodeAsExpression(node) { - // When we are emitting type metadata for decorators, we need to try to check the type - // as if it were an expression so that we can emit the type in a value position when we - // serialize the type metadata. - if (node && node.kind === 144 /* TypeReference */) { - var type = getTypeFromTypeNode(node); - var shouldCheckIfUnknownType = type === unknownType && compilerOptions.isolatedModules; - if (!type || (!shouldCheckIfUnknownType && type.flags & (2097279 /* Intrinsic */ | 132 /* NumberLike */ | 258 /* StringLike */))) { - return; - } - if (shouldCheckIfUnknownType || type.symbol.valueDeclaration) { - checkExpressionOrQualifiedName(node.typeName); - } - } - } - /** - * Checks the type annotation of an accessor declaration or property declaration as - * an expression if it is a type reference to a type with a value declaration. - */ - function checkTypeAnnotationAsExpression(node) { - switch (node.kind) { - case 134 /* PropertyDeclaration */: - checkTypeNodeAsExpression(node.type); - break; - case 131 /* Parameter */: - checkTypeNodeAsExpression(node.type); - break; - case 136 /* MethodDeclaration */: - checkTypeNodeAsExpression(node.type); - break; - case 138 /* GetAccessor */: - checkTypeNodeAsExpression(node.type); - break; - case 139 /* SetAccessor */: - checkTypeNodeAsExpression(getSetAccessorTypeAnnotationNode(node)); - break; - } - } - /** Checks the type annotation of the parameters of a function/method or the constructor of a class as expressions */ - function checkParameterTypeAnnotationsAsExpressions(node) { - // ensure all type annotations with a value declaration are checked as an expression - for (var _i = 0, _a = node.parameters; _i < _a.length; _i++) { - var parameter = _a[_i]; - checkTypeAnnotationAsExpression(parameter); - } - } - /** Check the decorators of a node */ - function checkDecorators(node) { - if (!node.decorators) { - return; - } - // skip this check for nodes that cannot have decorators. These should have already had an error reported by - // checkGrammarDecorators. - if (!ts.nodeCanBeDecorated(node)) { - return; - } - if (!compilerOptions.experimentalDecorators) { - error(node, ts.Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Specify_experimentalDecorators_to_remove_this_warning); - } - if (compilerOptions.emitDecoratorMetadata) { - // we only need to perform these checks if we are emitting serialized type metadata for the target of a decorator. - switch (node.kind) { - case 204 /* ClassDeclaration */: - var constructor = ts.getFirstConstructorWithBody(node); - if (constructor) { - checkParameterTypeAnnotationsAsExpressions(constructor); - } - break; - case 136 /* MethodDeclaration */: - checkParameterTypeAnnotationsAsExpressions(node); - // fall-through - case 139 /* SetAccessor */: - case 138 /* GetAccessor */: - case 134 /* PropertyDeclaration */: - case 131 /* Parameter */: - checkTypeAnnotationAsExpression(node); - break; - } - } - emitDecorate = true; - if (node.kind === 131 /* Parameter */) { - emitParam = true; - } - ts.forEach(node.decorators, checkDecorator); - } - function checkFunctionDeclaration(node) { - if (produceDiagnostics) { - checkFunctionLikeDeclaration(node) || - checkGrammarFunctionName(node.name) || - checkGrammarForGenerator(node); - checkCollisionWithCapturedSuperVariable(node, node.name); - checkCollisionWithCapturedThisVariable(node, node.name); - checkCollisionWithRequireExportsInGeneratedCode(node, node.name); - } - } - function checkFunctionLikeDeclaration(node) { - checkGrammarDeclarationNameInStrictMode(node); - checkDecorators(node); - checkSignatureDeclaration(node); - // Do not use hasDynamicName here, because that returns false for well known symbols. - // We want to perform checkComputedPropertyName for all computed properties, including - // well known symbols. - if (node.name && node.name.kind === 129 /* ComputedPropertyName */) { - // This check will account for methods in class/interface declarations, - // as well as accessors in classes/object literals - checkComputedPropertyName(node.name); - } - if (!ts.hasDynamicName(node)) { - // first we want to check the local symbol that contain this declaration - // - if node.localSymbol !== undefined - this is current declaration is exported and localSymbol points to the local symbol - // - if node.localSymbol === undefined - this node is non-exported so we can just pick the result of getSymbolOfNode - var symbol = getSymbolOfNode(node); - var localSymbol = node.localSymbol || symbol; - var firstDeclaration = ts.getDeclarationOfKind(localSymbol, node.kind); - // Only type check the symbol once - if (node === firstDeclaration) { - checkFunctionOrConstructorSymbol(localSymbol); - } - if (symbol.parent) { - // run check once for the first declaration - if (ts.getDeclarationOfKind(symbol, node.kind) === node) { - // run check on export symbol to check that modifiers agree across all exported declarations - checkFunctionOrConstructorSymbol(symbol); - } - } - } - checkSourceElement(node.body); - if (node.type && !isAccessor(node.kind) && !node.asteriskToken) { - checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNode(node.type)); - } - if (produceDiagnostics && !node.type) { - // Report an implicit any error if there is no body, no explicit return type, and node is not a private method - // in an ambient context - if (compilerOptions.noImplicitAny && ts.nodeIsMissing(node.body) && !isPrivateWithinAmbient(node)) { - reportImplicitAnyError(node, anyType); - } - if (node.asteriskToken && ts.nodeIsPresent(node.body)) { - // A generator with a body and no type annotation can still cause errors. It can error if the - // yielded values have no common supertype, or it can give an implicit any error if it has no - // yielded values. The only way to trigger these errors is to try checking its return type. - getReturnTypeOfSignature(getSignatureFromDeclaration(node)); - } - } - } - function checkBlock(node) { - // Grammar checking for SyntaxKind.Block - if (node.kind === 182 /* Block */) { - checkGrammarStatementInAmbientContext(node); - } - ts.forEach(node.statements, checkSourceElement); - if (ts.isFunctionBlock(node) || node.kind === 209 /* ModuleBlock */) { - checkFunctionExpressionBodies(node); - } - } - function checkCollisionWithArgumentsInGeneratedCode(node) { - // no rest parameters \ declaration context \ overload - no codegen impact - if (!ts.hasRestParameter(node) || ts.isInAmbientContext(node) || ts.nodeIsMissing(node.body)) { - return; - } - ts.forEach(node.parameters, function (p) { - if (p.name && !ts.isBindingPattern(p.name) && p.name.text === argumentsSymbol.name) { - error(p, ts.Diagnostics.Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters); - } - }); - } - function needCollisionCheckForIdentifier(node, identifier, name) { - if (!(identifier && identifier.text === name)) { - return false; - } - if (node.kind === 134 /* PropertyDeclaration */ || - node.kind === 133 /* PropertySignature */ || - node.kind === 136 /* MethodDeclaration */ || - node.kind === 135 /* MethodSignature */ || - node.kind === 138 /* GetAccessor */ || - node.kind === 139 /* SetAccessor */) { - // it is ok to have member named '_super' or '_this' - member access is always qualified - return false; - } - if (ts.isInAmbientContext(node)) { - // ambient context - no codegen impact - return false; - } - var root = ts.getRootDeclaration(node); - if (root.kind === 131 /* Parameter */ && ts.nodeIsMissing(root.parent.body)) { - // just an overload - no codegen impact - return false; - } - return true; - } - function checkCollisionWithCapturedThisVariable(node, name) { - if (needCollisionCheckForIdentifier(node, name, "_this")) { - potentialThisCollisions.push(node); - } - } - // this function will run after checking the source file so 'CaptureThis' is correct for all nodes - function checkIfThisIsCapturedInEnclosingScope(node) { - var current = node; - while (current) { - if (getNodeCheckFlags(current) & 4 /* CaptureThis */) { - var isDeclaration_1 = node.kind !== 65 /* Identifier */; - if (isDeclaration_1) { - error(node.name, ts.Diagnostics.Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference); - } - else { - error(node, ts.Diagnostics.Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference); - } - return; - } - current = current.parent; - } - } - function checkCollisionWithCapturedSuperVariable(node, name) { - if (!needCollisionCheckForIdentifier(node, name, "_super")) { - return; - } - // bubble up and find containing type - var enclosingClass = ts.getAncestor(node, 204 /* ClassDeclaration */); - // if containing type was not found or it is ambient - exit (no codegen) - if (!enclosingClass || ts.isInAmbientContext(enclosingClass)) { - return; - } - if (ts.getClassExtendsHeritageClauseElement(enclosingClass)) { - var isDeclaration_2 = node.kind !== 65 /* Identifier */; - if (isDeclaration_2) { - error(node, ts.Diagnostics.Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference); - } - else { - error(node, ts.Diagnostics.Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference); - } - } - } - function checkCollisionWithRequireExportsInGeneratedCode(node, name) { - if (!needCollisionCheckForIdentifier(node, name, "require") && !needCollisionCheckForIdentifier(node, name, "exports")) { - return; - } - // Uninstantiated modules shouldnt do this check - if (node.kind === 208 /* ModuleDeclaration */ && ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { - return; - } - // In case of variable declaration, node.parent is variable statement so look at the variable statement's parent - var parent = getDeclarationContainer(node); - if (parent.kind === 230 /* SourceFile */ && ts.isExternalModule(parent)) { - // If the declaration happens to be in external module, report error that require and exports are reserved keywords - error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module, ts.declarationNameToString(name), ts.declarationNameToString(name)); - } - } - function checkVarDeclaredNamesNotShadowed(node) { - // - ScriptBody : StatementList - // It is a Syntax Error if any element of the LexicallyDeclaredNames of StatementList - // also occurs in the VarDeclaredNames of StatementList. - // - Block : { StatementList } - // It is a Syntax Error if any element of the LexicallyDeclaredNames of StatementList - // also occurs in the VarDeclaredNames of StatementList. - // Variable declarations are hoisted to the top of their function scope. They can shadow - // block scoped declarations, which bind tighter. this will not be flagged as duplicate definition - // by the binder as the declaration scope is different. - // A non-initialized declaration is a no-op as the block declaration will resolve before the var - // declaration. the problem is if the declaration has an initializer. this will act as a write to the - // block declared value. this is fine for let, but not const. - // Only consider declarations with initializers, uninitialized let declarations will not - // step on a let/const variable. - // Do not consider let and const declarations, as duplicate block-scoped declarations - // are handled by the binder. - // We are only looking for let declarations that step on let\const declarations from a - // different scope. e.g.: - // { - // const x = 0; // localDeclarationSymbol obtained after name resolution will correspond to this declaration - // let x = 0; // symbol for this declaration will be 'symbol' - // } - // skip block-scoped variables and parameters - if ((ts.getCombinedNodeFlags(node) & 12288 /* BlockScoped */) !== 0 || ts.isParameterDeclaration(node)) { - return; - } - // skip variable declarations that don't have initializers - // NOTE: in ES6 spec initializer is required in variable declarations where name is binding pattern - // so we'll always treat binding elements as initialized - if (node.kind === 201 /* VariableDeclaration */ && !node.initializer) { - return; - } - var symbol = getSymbolOfNode(node); - if (symbol.flags & 1 /* FunctionScopedVariable */) { - var localDeclarationSymbol = resolveName(node, node.name.text, 3 /* Variable */, undefined, undefined); - if (localDeclarationSymbol && - localDeclarationSymbol !== symbol && - localDeclarationSymbol.flags & 2 /* BlockScopedVariable */) { - if (getDeclarationFlagsFromSymbol(localDeclarationSymbol) & 12288 /* BlockScoped */) { - var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 202 /* VariableDeclarationList */); - var container = varDeclList.parent.kind === 183 /* VariableStatement */ && varDeclList.parent.parent - ? varDeclList.parent.parent - : undefined; - // names of block-scoped and function scoped variables can collide only - // if block scoped variable is defined in the function\module\source file scope (because of variable hoisting) - var namesShareScope = container && - (container.kind === 182 /* Block */ && ts.isFunctionLike(container.parent) || - container.kind === 209 /* ModuleBlock */ || - container.kind === 208 /* ModuleDeclaration */ || - container.kind === 230 /* SourceFile */); - // here we know that function scoped variable is shadowed by block scoped one - // if they are defined in the same scope - binder has already reported redeclaration error - // otherwise if variable has an initializer - show error that initialization will fail - // since LHS will be block scoped name instead of function scoped - if (!namesShareScope) { - var name_13 = symbolToString(localDeclarationSymbol); - error(node, ts.Diagnostics.Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1, name_13, name_13); - } - } - } - } - } - // Check that a parameter initializer contains no references to parameters declared to the right of itself - function checkParameterInitializer(node) { - if (ts.getRootDeclaration(node).kind !== 131 /* Parameter */) { - return; - } - var func = ts.getContainingFunction(node); - visit(node.initializer); - function visit(n) { - if (n.kind === 65 /* Identifier */) { - var referencedSymbol = getNodeLinks(n).resolvedSymbol; - // check FunctionLikeDeclaration.locals (stores parameters\function local variable) - // if it contains entry with a specified name and if this entry matches the resolved symbol - if (referencedSymbol && referencedSymbol !== unknownSymbol && getSymbol(func.locals, referencedSymbol.name, 107455 /* Value */) === referencedSymbol) { - if (referencedSymbol.valueDeclaration.kind === 131 /* Parameter */) { - if (referencedSymbol.valueDeclaration === node) { - error(n, ts.Diagnostics.Parameter_0_cannot_be_referenced_in_its_initializer, ts.declarationNameToString(node.name)); - return; - } - if (referencedSymbol.valueDeclaration.pos < node.pos) { - // legal case - parameter initializer references some parameter strictly on left of current parameter declaration - return; - } - } - error(n, ts.Diagnostics.Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it, ts.declarationNameToString(node.name), ts.declarationNameToString(n)); - } - } - else { - ts.forEachChild(n, visit); - } - } - } - // Check variable, parameter, or property declaration - function checkVariableLikeDeclaration(node) { - checkGrammarDeclarationNameInStrictMode(node); - checkDecorators(node); - checkSourceElement(node.type); - // For a computed property, just check the initializer and exit - // Do not use hasDynamicName here, because that returns false for well known symbols. - // We want to perform checkComputedPropertyName for all computed properties, including - // well known symbols. - if (node.name.kind === 129 /* ComputedPropertyName */) { - checkComputedPropertyName(node.name); - if (node.initializer) { - checkExpressionCached(node.initializer); - } - } - // For a binding pattern, check contained binding elements - if (ts.isBindingPattern(node.name)) { - ts.forEach(node.name.elements, checkSourceElement); - } - // For a parameter declaration with an initializer, error and exit if the containing function doesn't have a body - if (node.initializer && ts.getRootDeclaration(node).kind === 131 /* Parameter */ && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { - error(node, ts.Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation); - return; - } - // For a binding pattern, validate the initializer and exit - if (ts.isBindingPattern(node.name)) { - if (node.initializer) { - checkTypeAssignableTo(checkExpressionCached(node.initializer), getWidenedTypeForVariableLikeDeclaration(node), node, undefined); - checkParameterInitializer(node); - } - return; - } - var symbol = getSymbolOfNode(node); - var type = getTypeOfVariableOrParameterOrProperty(symbol); - if (node === symbol.valueDeclaration) { - // Node is the primary declaration of the symbol, just validate the initializer - if (node.initializer) { - checkTypeAssignableTo(checkExpressionCached(node.initializer), type, node, undefined); - checkParameterInitializer(node); - } - } - else { - // Node is a secondary declaration, check that type is identical to primary declaration and check that - // initializer is consistent with type associated with the node - var declarationType = getWidenedTypeForVariableLikeDeclaration(node); - if (type !== unknownType && declarationType !== unknownType && !isTypeIdenticalTo(type, declarationType)) { - error(node.name, ts.Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2, ts.declarationNameToString(node.name), typeToString(type), typeToString(declarationType)); - } - if (node.initializer) { - checkTypeAssignableTo(checkExpressionCached(node.initializer), declarationType, node, undefined); - } - } - if (node.kind !== 134 /* PropertyDeclaration */ && node.kind !== 133 /* PropertySignature */) { - // We know we don't have a binding pattern or computed name here - checkExportsOnMergedDeclarations(node); - if (node.kind === 201 /* VariableDeclaration */ || node.kind === 155 /* BindingElement */) { - checkVarDeclaredNamesNotShadowed(node); - } - checkCollisionWithCapturedSuperVariable(node, node.name); - checkCollisionWithCapturedThisVariable(node, node.name); - checkCollisionWithRequireExportsInGeneratedCode(node, node.name); - } - } - function checkVariableDeclaration(node) { - checkGrammarVariableDeclaration(node); - return checkVariableLikeDeclaration(node); - } - function checkBindingElement(node) { - checkGrammarBindingElement(node); - return checkVariableLikeDeclaration(node); - } - function checkVariableStatement(node) { - // Grammar checking - checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarVariableDeclarationList(node.declarationList) || checkGrammarForDisallowedLetOrConstStatement(node); - ts.forEach(node.declarationList.declarations, checkSourceElement); - } - function checkGrammarDisallowedModifiersInBlockOrObjectLiteralExpression(node) { - if (node.modifiers) { - if (inBlockOrObjectLiteralExpression(node)) { - return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); - } - } - } - function inBlockOrObjectLiteralExpression(node) { - while (node) { - if (node.kind === 182 /* Block */ || node.kind === 157 /* ObjectLiteralExpression */) { - return true; - } - node = node.parent; - } - } - function checkExpressionStatement(node) { - // Grammar checking - checkGrammarStatementInAmbientContext(node); - checkExpression(node.expression); - } - function checkIfStatement(node) { - // Grammar checking - checkGrammarStatementInAmbientContext(node); - checkExpression(node.expression); - checkSourceElement(node.thenStatement); - checkSourceElement(node.elseStatement); - } - function checkDoStatement(node) { - // Grammar checking - checkGrammarStatementInAmbientContext(node); - checkSourceElement(node.statement); - checkExpression(node.expression); - } - function checkWhileStatement(node) { - // Grammar checking - checkGrammarStatementInAmbientContext(node); - checkExpression(node.expression); - checkSourceElement(node.statement); - } - function checkForStatement(node) { - // Grammar checking - if (!checkGrammarStatementInAmbientContext(node)) { - if (node.initializer && node.initializer.kind == 202 /* VariableDeclarationList */) { - checkGrammarVariableDeclarationList(node.initializer); - } - } - if (node.initializer) { - if (node.initializer.kind === 202 /* VariableDeclarationList */) { - ts.forEach(node.initializer.declarations, checkVariableDeclaration); - } - else { - checkExpression(node.initializer); - } - } - if (node.condition) - checkExpression(node.condition); - if (node.incrementor) - checkExpression(node.incrementor); - checkSourceElement(node.statement); - } - function checkForOfStatement(node) { - checkGrammarForInOrForOfStatement(node); - // Check the LHS and RHS - // If the LHS is a declaration, just check it as a variable declaration, which will in turn check the RHS - // via checkRightHandSideOfForOf. - // If the LHS is an expression, check the LHS, as a destructuring assignment or as a reference. - // Then check that the RHS is assignable to it. - if (node.initializer.kind === 202 /* VariableDeclarationList */) { - checkForInOrForOfVariableDeclaration(node); - } - else { - var varExpr = node.initializer; - var iteratedType = checkRightHandSideOfForOf(node.expression); - // There may be a destructuring assignment on the left side - if (varExpr.kind === 156 /* ArrayLiteralExpression */ || varExpr.kind === 157 /* ObjectLiteralExpression */) { - // iteratedType may be undefined. In this case, we still want to check the structure of - // varExpr, in particular making sure it's a valid LeftHandSideExpression. But we'd like - // to short circuit the type relation checking as much as possible, so we pass the unknownType. - checkDestructuringAssignment(varExpr, iteratedType || unknownType); - } - else { - var leftType = checkExpression(varExpr); - checkReferenceExpression(varExpr, ts.Diagnostics.Invalid_left_hand_side_in_for_of_statement, - /*constantVariableMessage*/ ts.Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_be_a_previously_defined_constant); - // iteratedType will be undefined if the rightType was missing properties/signatures - // required to get its iteratedType (like [Symbol.iterator] or next). This may be - // because we accessed properties from anyType, or it may have led to an error inside - // getElementTypeOfIterable. - if (iteratedType) { - checkTypeAssignableTo(iteratedType, leftType, varExpr, undefined); - } - } - } - checkSourceElement(node.statement); - } - function checkForInStatement(node) { - // Grammar checking - checkGrammarForInOrForOfStatement(node); - // TypeScript 1.0 spec (April 2014): 5.4 - // In a 'for-in' statement of the form - // for (let VarDecl in Expr) Statement - // VarDecl must be a variable declaration without a type annotation that declares a variable of type Any, - // and Expr must be an expression of type Any, an object type, or a type parameter type. - if (node.initializer.kind === 202 /* VariableDeclarationList */) { - var variable = node.initializer.declarations[0]; - if (variable && ts.isBindingPattern(variable.name)) { - error(variable.name, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); - } - checkForInOrForOfVariableDeclaration(node); - } - else { - // In a 'for-in' statement of the form - // for (Var in Expr) Statement - // Var must be an expression classified as a reference of type Any or the String primitive type, - // and Expr must be an expression of type Any, an object type, or a type parameter type. - var varExpr = node.initializer; - var leftType = checkExpression(varExpr); - if (varExpr.kind === 156 /* ArrayLiteralExpression */ || varExpr.kind === 157 /* ObjectLiteralExpression */) { - error(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); - } - else if (!isTypeAnyOrAllConstituentTypesHaveKind(leftType, 258 /* StringLike */)) { - error(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any); - } - else { - // run check only former check succeeded to avoid cascading errors - checkReferenceExpression(varExpr, ts.Diagnostics.Invalid_left_hand_side_in_for_in_statement, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_previously_defined_constant); - } - } - var rightType = checkExpression(node.expression); - // unknownType is returned i.e. if node.expression is identifier whose name cannot be resolved - // in this case error about missing name is already reported - do not report extra one - if (!isTypeAnyOrAllConstituentTypesHaveKind(rightType, 48128 /* ObjectType */ | 512 /* TypeParameter */)) { - error(node.expression, ts.Diagnostics.The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter); - } - checkSourceElement(node.statement); - } - function checkForInOrForOfVariableDeclaration(iterationStatement) { - var variableDeclarationList = iterationStatement.initializer; - // checkGrammarForInOrForOfStatement will check that there is exactly one declaration. - if (variableDeclarationList.declarations.length >= 1) { - var decl = variableDeclarationList.declarations[0]; - checkVariableDeclaration(decl); - } - } - function checkRightHandSideOfForOf(rhsExpression) { - var expressionType = getTypeOfExpression(rhsExpression); - return checkIteratedTypeOrElementType(expressionType, rhsExpression, true); - } - function checkIteratedTypeOrElementType(inputType, errorNode, allowStringInput) { - if (isTypeAny(inputType)) { - return inputType; - } - if (languageVersion >= 2 /* ES6 */) { - return checkElementTypeOfIterable(inputType, errorNode); - } - if (allowStringInput) { - return checkElementTypeOfArrayOrString(inputType, errorNode); - } - if (isArrayLikeType(inputType)) { - var indexType = getIndexTypeOfType(inputType, 1 /* Number */); - if (indexType) { - return indexType; - } - } - error(errorNode, ts.Diagnostics.Type_0_is_not_an_array_type, typeToString(inputType)); - return unknownType; - } - /** - * When errorNode is undefined, it means we should not report any errors. - */ - function checkElementTypeOfIterable(iterable, errorNode) { - var elementType = getElementTypeOfIterable(iterable, errorNode); - // Now even though we have extracted the iteratedType, we will have to validate that the type - // passed in is actually an Iterable. - if (errorNode && elementType) { - checkTypeAssignableTo(iterable, createIterableType(elementType), errorNode); - } - return elementType || anyType; - } - /** - * We want to treat type as an iterable, and get the type it is an iterable of. The iterable - * must have the following structure (annotated with the names of the variables below): - * - * { // iterable - * [Symbol.iterator]: { // iteratorFunction - * (): Iterator - * } - * } - * - * T is the type we are after. At every level that involves analyzing return types - * of signatures, we union the return types of all the signatures. - * - * Another thing to note is that at any step of this process, we could run into a dead end, - * meaning either the property is missing, or we run into the anyType. If either of these things - * happens, we return undefined to signal that we could not find the iterated type. If a property - * is missing, and the previous step did not result in 'any', then we also give an error if the - * caller requested it. Then the caller can decide what to do in the case where there is no iterated - * type. This is different from returning anyType, because that would signify that we have matched the - * whole pattern and that T (above) is 'any'. - */ - function getElementTypeOfIterable(type, errorNode) { - if (isTypeAny(type)) { - return undefined; - } - var typeAsIterable = type; - if (!typeAsIterable.iterableElementType) { - // As an optimization, if the type is instantiated directly using the globalIterableType (Iterable), - // then just grab its type argument. - if ((type.flags & 4096 /* Reference */) && type.target === globalIterableType) { - typeAsIterable.iterableElementType = type.typeArguments[0]; - } - else { - var iteratorFunction = getTypeOfPropertyOfType(type, ts.getPropertyNameForKnownSymbolName("iterator")); - if (isTypeAny(iteratorFunction)) { - return undefined; - } - var iteratorFunctionSignatures = iteratorFunction ? getSignaturesOfType(iteratorFunction, 0 /* Call */) : emptyArray; - if (iteratorFunctionSignatures.length === 0) { - if (errorNode) { - error(errorNode, ts.Diagnostics.Type_must_have_a_Symbol_iterator_method_that_returns_an_iterator); - } - return undefined; - } - typeAsIterable.iterableElementType = getElementTypeOfIterator(getUnionType(ts.map(iteratorFunctionSignatures, getReturnTypeOfSignature)), errorNode); - } - } - return typeAsIterable.iterableElementType; - } - /** - * This function has very similar logic as getElementTypeOfIterable, except that it operates on - * Iterators instead of Iterables. Here is the structure: - * - * { // iterator - * next: { // iteratorNextFunction - * (): { // iteratorNextResult - * value: T // iteratorNextValue - * } - * } - * } - * - */ - function getElementTypeOfIterator(type, errorNode) { - if (isTypeAny(type)) { - return undefined; - } - var typeAsIterator = type; - if (!typeAsIterator.iteratorElementType) { - // As an optimization, if the type is instantiated directly using the globalIteratorType (Iterator), - // then just grab its type argument. - if ((type.flags & 4096 /* Reference */) && type.target === globalIteratorType) { - typeAsIterator.iteratorElementType = type.typeArguments[0]; - } - else { - var iteratorNextFunction = getTypeOfPropertyOfType(type, "next"); - if (isTypeAny(iteratorNextFunction)) { - return undefined; - } - var iteratorNextFunctionSignatures = iteratorNextFunction ? getSignaturesOfType(iteratorNextFunction, 0 /* Call */) : emptyArray; - if (iteratorNextFunctionSignatures.length === 0) { - if (errorNode) { - error(errorNode, ts.Diagnostics.An_iterator_must_have_a_next_method); - } - return undefined; - } - var iteratorNextResult = getUnionType(ts.map(iteratorNextFunctionSignatures, getReturnTypeOfSignature)); - if (isTypeAny(iteratorNextResult)) { - return undefined; - } - var iteratorNextValue = getTypeOfPropertyOfType(iteratorNextResult, "value"); - if (!iteratorNextValue) { - if (errorNode) { - error(errorNode, ts.Diagnostics.The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property); - } - return undefined; - } - typeAsIterator.iteratorElementType = iteratorNextValue; - } - } - return typeAsIterator.iteratorElementType; - } - function getElementTypeOfIterableIterator(type) { - if (isTypeAny(type)) { - return undefined; - } - // As an optimization, if the type is instantiated directly using the globalIterableIteratorType (IterableIterator), - // then just grab its type argument. - if ((type.flags & 4096 /* Reference */) && type.target === globalIterableIteratorType) { - return type.typeArguments[0]; - } - return getElementTypeOfIterable(type, undefined) || - getElementTypeOfIterator(type, undefined); - } - /** - * This function does the following steps: - * 1. Break up arrayOrStringType (possibly a union) into its string constituents and array constituents. - * 2. Take the element types of the array constituents. - * 3. Return the union of the element types, and string if there was a string constitutent. - * - * For example: - * string -> string - * number[] -> number - * string[] | number[] -> string | number - * string | number[] -> string | number - * string | string[] | number[] -> string | number - * - * It also errors if: - * 1. Some constituent is neither a string nor an array. - * 2. Some constituent is a string and target is less than ES5 (because in ES3 string is not indexable). - */ - function checkElementTypeOfArrayOrString(arrayOrStringType, errorNode) { - ts.Debug.assert(languageVersion < 2 /* ES6 */); - // After we remove all types that are StringLike, we will know if there was a string constituent - // based on whether the remaining type is the same as the initial type. - var arrayType = removeTypesFromUnionType(arrayOrStringType, 258 /* StringLike */, true, true); - var hasStringConstituent = arrayOrStringType !== arrayType; - var reportedError = false; - if (hasStringConstituent) { - if (languageVersion < 1 /* ES5 */) { - error(errorNode, ts.Diagnostics.Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher); - reportedError = true; - } - // Now that we've removed all the StringLike types, if no constituents remain, then the entire - // arrayOrStringType was a string. - if (arrayType === emptyObjectType) { - return stringType; - } - } - if (!isArrayLikeType(arrayType)) { - if (!reportedError) { - // Which error we report depends on whether there was a string constituent. For example, - // if the input type is number | string, we want to say that number is not an array type. - // But if the input was just number, we want to say that number is not an array type - // or a string type. - var diagnostic = hasStringConstituent - ? ts.Diagnostics.Type_0_is_not_an_array_type - : ts.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type; - error(errorNode, diagnostic, typeToString(arrayType)); - } - return hasStringConstituent ? stringType : unknownType; - } - var arrayElementType = getIndexTypeOfType(arrayType, 1 /* Number */) || unknownType; - if (hasStringConstituent) { - // This is just an optimization for the case where arrayOrStringType is string | string[] - if (arrayElementType.flags & 258 /* StringLike */) { - return stringType; - } - return getUnionType([arrayElementType, stringType]); - } - return arrayElementType; - } - function checkBreakOrContinueStatement(node) { - // Grammar checking - checkGrammarStatementInAmbientContext(node) || checkGrammarBreakOrContinueStatement(node); - // TODO: Check that target label is valid - } - function isGetAccessorWithAnnotatatedSetAccessor(node) { - return !!(node.kind === 138 /* GetAccessor */ && getSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(node.symbol, 139 /* SetAccessor */))); - } - function checkReturnStatement(node) { - // Grammar checking - if (!checkGrammarStatementInAmbientContext(node)) { - var functionBlock = ts.getContainingFunction(node); - if (!functionBlock) { - grammarErrorOnFirstToken(node, ts.Diagnostics.A_return_statement_can_only_be_used_within_a_function_body); - } - } - if (node.expression) { - var func = ts.getContainingFunction(node); - if (func) { - var signature = getSignatureFromDeclaration(func); - var returnType = getReturnTypeOfSignature(signature); - var exprType = checkExpressionCached(node.expression); - if (func.asteriskToken) { - // A generator does not need its return expressions checked against its return type. - // Instead, the yield expressions are checked against the element type. - // TODO: Check return expressions of generators when return type tracking is added - // for generators. - return; - } - if (func.kind === 139 /* SetAccessor */) { - error(node.expression, ts.Diagnostics.Setters_cannot_return_a_value); - } - else if (func.kind === 137 /* Constructor */) { - if (!isTypeAssignableTo(exprType, returnType)) { - error(node.expression, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); - } - } - else if (func.type || isGetAccessorWithAnnotatatedSetAccessor(func) || signature.typePredicate) { - checkTypeAssignableTo(exprType, returnType, node.expression, undefined); - } - } - } - } - function checkWithStatement(node) { - // Grammar checking for withStatement - if (!checkGrammarStatementInAmbientContext(node)) { - if (node.parserContextFlags & 1 /* StrictMode */) { - grammarErrorOnFirstToken(node, ts.Diagnostics.with_statements_are_not_allowed_in_strict_mode); - } - } - checkExpression(node.expression); - error(node.expression, ts.Diagnostics.All_symbols_within_a_with_block_will_be_resolved_to_any); - } - function checkSwitchStatement(node) { - // Grammar checking - checkGrammarStatementInAmbientContext(node); - var firstDefaultClause; - var hasDuplicateDefaultClause = false; - var expressionType = checkExpression(node.expression); - ts.forEach(node.caseBlock.clauses, function (clause) { - // Grammar check for duplicate default clauses, skip if we already report duplicate default clause - if (clause.kind === 224 /* DefaultClause */ && !hasDuplicateDefaultClause) { - if (firstDefaultClause === undefined) { - firstDefaultClause = clause; - } - else { - var sourceFile = ts.getSourceFileOfNode(node); - var start = ts.skipTrivia(sourceFile.text, clause.pos); - var end = clause.statements.length > 0 ? clause.statements[0].pos : clause.end; - grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.A_default_clause_cannot_appear_more_than_once_in_a_switch_statement); - hasDuplicateDefaultClause = true; - } - } - if (produceDiagnostics && clause.kind === 223 /* CaseClause */) { - var caseClause = clause; - // TypeScript 1.0 spec (April 2014):5.9 - // In a 'switch' statement, each 'case' expression must be of a type that is assignable to or from the type of the 'switch' expression. - var caseType = checkExpression(caseClause.expression); - if (!isTypeAssignableTo(expressionType, caseType)) { - // check 'expressionType isAssignableTo caseType' failed, try the reversed check and report errors if it fails - checkTypeAssignableTo(caseType, expressionType, caseClause.expression, undefined); - } - } - ts.forEach(clause.statements, checkSourceElement); - }); - } - function checkLabeledStatement(node) { - // Grammar checking - if (!checkGrammarStatementInAmbientContext(node)) { - var current = node.parent; - while (current) { - if (ts.isFunctionLike(current)) { - break; - } - if (current.kind === 197 /* LabeledStatement */ && current.label.text === node.label.text) { - var sourceFile = ts.getSourceFileOfNode(node); - grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, ts.getTextOfNodeFromSourceText(sourceFile.text, node.label)); - break; - } - current = current.parent; - } - } - // ensure that label is unique - checkSourceElement(node.statement); - } - function checkThrowStatement(node) { - // Grammar checking - if (!checkGrammarStatementInAmbientContext(node)) { - if (node.expression === undefined) { - grammarErrorAfterFirstToken(node, ts.Diagnostics.Line_break_not_permitted_here); - } - } - if (node.expression) { - checkExpression(node.expression); - } - } - function checkTryStatement(node) { - // Grammar checking - checkGrammarStatementInAmbientContext(node); - checkBlock(node.tryBlock); - var catchClause = node.catchClause; - if (catchClause) { - // Grammar checking - if (catchClause.variableDeclaration) { - if (catchClause.variableDeclaration.name.kind !== 65 /* Identifier */) { - grammarErrorOnFirstToken(catchClause.variableDeclaration.name, ts.Diagnostics.Catch_clause_variable_name_must_be_an_identifier); - } - else if (catchClause.variableDeclaration.type) { - grammarErrorOnFirstToken(catchClause.variableDeclaration.type, ts.Diagnostics.Catch_clause_variable_cannot_have_a_type_annotation); - } - else if (catchClause.variableDeclaration.initializer) { - grammarErrorOnFirstToken(catchClause.variableDeclaration.initializer, ts.Diagnostics.Catch_clause_variable_cannot_have_an_initializer); - } - else { - var identifierName = catchClause.variableDeclaration.name.text; - var locals = catchClause.block.locals; - if (locals && ts.hasProperty(locals, identifierName)) { - var localSymbol = locals[identifierName]; - if (localSymbol && (localSymbol.flags & 2 /* BlockScopedVariable */) !== 0) { - grammarErrorOnNode(localSymbol.valueDeclaration, ts.Diagnostics.Cannot_redeclare_identifier_0_in_catch_clause, identifierName); - } - } - // It is a SyntaxError if a TryStatement with a Catch occurs within strict code and the Identifier of the - // Catch production is eval or arguments - checkGrammarEvalOrArgumentsInStrictMode(node, catchClause.variableDeclaration.name); - } - } - checkBlock(catchClause.block); - } - if (node.finallyBlock) { - checkBlock(node.finallyBlock); - } - } - function checkIndexConstraints(type) { - var declaredNumberIndexer = getIndexDeclarationOfSymbol(type.symbol, 1 /* Number */); - var declaredStringIndexer = getIndexDeclarationOfSymbol(type.symbol, 0 /* String */); - var stringIndexType = getIndexTypeOfType(type, 0 /* String */); - var numberIndexType = getIndexTypeOfType(type, 1 /* Number */); - if (stringIndexType || numberIndexType) { - ts.forEach(getPropertiesOfObjectType(type), function (prop) { - var propType = getTypeOfSymbol(prop); - checkIndexConstraintForProperty(prop, propType, type, declaredStringIndexer, stringIndexType, 0 /* String */); - checkIndexConstraintForProperty(prop, propType, type, declaredNumberIndexer, numberIndexType, 1 /* Number */); - }); - if (type.flags & 1024 /* Class */ && type.symbol.valueDeclaration.kind === 204 /* ClassDeclaration */) { - var classDeclaration = type.symbol.valueDeclaration; - for (var _i = 0, _a = classDeclaration.members; _i < _a.length; _i++) { - var member = _a[_i]; - // Only process instance properties with computed names here. - // Static properties cannot be in conflict with indexers, - // and properties with literal names were already checked. - if (!(member.flags & 128 /* Static */) && ts.hasDynamicName(member)) { - var propType = getTypeOfSymbol(member.symbol); - checkIndexConstraintForProperty(member.symbol, propType, type, declaredStringIndexer, stringIndexType, 0 /* String */); - checkIndexConstraintForProperty(member.symbol, propType, type, declaredNumberIndexer, numberIndexType, 1 /* Number */); - } - } - } - } - var errorNode; - if (stringIndexType && numberIndexType) { - errorNode = declaredNumberIndexer || declaredStringIndexer; - // condition 'errorNode === undefined' may appear if types does not declare nor string neither number indexer - if (!errorNode && (type.flags & 2048 /* Interface */)) { - var someBaseTypeHasBothIndexers = ts.forEach(getBaseTypes(type), function (base) { return getIndexTypeOfType(base, 0 /* String */) && getIndexTypeOfType(base, 1 /* Number */); }); - errorNode = someBaseTypeHasBothIndexers ? undefined : type.symbol.declarations[0]; - } - } - if (errorNode && !isTypeAssignableTo(numberIndexType, stringIndexType)) { - error(errorNode, ts.Diagnostics.Numeric_index_type_0_is_not_assignable_to_string_index_type_1, typeToString(numberIndexType), typeToString(stringIndexType)); - } - function checkIndexConstraintForProperty(prop, propertyType, containingType, indexDeclaration, indexType, indexKind) { - if (!indexType) { - return; - } - // index is numeric and property name is not valid numeric literal - if (indexKind === 1 /* Number */ && !isNumericName(prop.valueDeclaration.name)) { - return; - } - // perform property check if property or indexer is declared in 'type' - // this allows to rule out cases when both property and indexer are inherited from the base class - var errorNode; - if (prop.valueDeclaration.name.kind === 129 /* ComputedPropertyName */ || prop.parent === containingType.symbol) { - errorNode = prop.valueDeclaration; - } - else if (indexDeclaration) { - errorNode = indexDeclaration; - } - else if (containingType.flags & 2048 /* Interface */) { - // for interfaces property and indexer might be inherited from different bases - // check if any base class already has both property and indexer. - // check should be performed only if 'type' is the first type that brings property\indexer together - var someBaseClassHasBothPropertyAndIndexer = ts.forEach(getBaseTypes(containingType), function (base) { return getPropertyOfObjectType(base, prop.name) && getIndexTypeOfType(base, indexKind); }); - errorNode = someBaseClassHasBothPropertyAndIndexer ? undefined : containingType.symbol.declarations[0]; - } - if (errorNode && !isTypeAssignableTo(propertyType, indexType)) { - var errorMessage = indexKind === 0 /* String */ - ? ts.Diagnostics.Property_0_of_type_1_is_not_assignable_to_string_index_type_2 - : ts.Diagnostics.Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2; - error(errorNode, errorMessage, symbolToString(prop), typeToString(propertyType), typeToString(indexType)); - } - } - } - function checkTypeNameIsReserved(name, message) { - // TS 1.0 spec (April 2014): 3.6.1 - // The predefined type keywords are reserved and cannot be used as names of user defined types. - switch (name.text) { - case "any": - case "number": - case "boolean": - case "string": - case "symbol": - case "void": - error(name, message, name.text); - } - } - // Check each type parameter and check that list has no duplicate type parameter declarations - function checkTypeParameters(typeParameterDeclarations) { - if (typeParameterDeclarations) { - for (var i = 0, n = typeParameterDeclarations.length; i < n; i++) { - var node = typeParameterDeclarations[i]; - checkTypeParameter(node); - if (produceDiagnostics) { - for (var j = 0; j < i; j++) { - if (typeParameterDeclarations[j].symbol === node.symbol) { - error(node.name, ts.Diagnostics.Duplicate_identifier_0, ts.declarationNameToString(node.name)); - } - } - } - } - } - } - function checkClassExpression(node) { - grammarErrorOnNode(node, ts.Diagnostics.class_expressions_are_not_currently_supported); - ts.forEach(node.members, checkSourceElement); - return unknownType; - } - function checkClassDeclaration(node) { - checkGrammarDeclarationNameInStrictMode(node); - // Grammar checking - if (!node.name && !(node.flags & 256 /* Default */)) { - grammarErrorOnFirstToken(node, ts.Diagnostics.A_class_declaration_without_the_default_modifier_must_have_a_name); - } - checkGrammarClassDeclarationHeritageClauses(node); - checkDecorators(node); - if (node.name) { - checkTypeNameIsReserved(node.name, ts.Diagnostics.Class_name_cannot_be_0); - checkCollisionWithCapturedThisVariable(node, node.name); - checkCollisionWithRequireExportsInGeneratedCode(node, node.name); - } - checkTypeParameters(node.typeParameters); - checkExportsOnMergedDeclarations(node); - var symbol = getSymbolOfNode(node); - var type = getDeclaredTypeOfSymbol(symbol); - var staticType = getTypeOfSymbol(symbol); - var baseTypeNode = ts.getClassExtendsHeritageClauseElement(node); - if (baseTypeNode) { - if (!ts.isSupportedExpressionWithTypeArguments(baseTypeNode)) { - error(baseTypeNode.expression, ts.Diagnostics.Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_class_extends_clauses); - } - emitExtends = emitExtends || !ts.isInAmbientContext(node); - checkExpressionWithTypeArguments(baseTypeNode); - } - var baseTypes = getBaseTypes(type); - if (baseTypes.length) { - if (produceDiagnostics) { - var baseType = baseTypes[0]; - checkTypeAssignableTo(type, baseType, node.name || node, ts.Diagnostics.Class_0_incorrectly_extends_base_class_1); - var staticBaseType = getTypeOfSymbol(baseType.symbol); - checkTypeAssignableTo(staticType, getTypeWithoutConstructors(staticBaseType), node.name || node, ts.Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1); - if (baseType.symbol !== resolveEntityName(baseTypeNode.expression, 107455 /* Value */)) { - error(baseTypeNode, ts.Diagnostics.Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0, typeToString(baseType)); - } - checkKindsOfPropertyMemberOverrides(type, baseType); - } - } - if (baseTypes.length || (baseTypeNode && compilerOptions.isolatedModules)) { - // Check that base type can be evaluated as expression - checkExpressionOrQualifiedName(baseTypeNode.expression); - } - var implementedTypeNodes = ts.getClassImplementsHeritageClauseElements(node); - if (implementedTypeNodes) { - ts.forEach(implementedTypeNodes, function (typeRefNode) { - if (!ts.isSupportedExpressionWithTypeArguments(typeRefNode)) { - error(typeRefNode.expression, ts.Diagnostics.A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments); - } - checkExpressionWithTypeArguments(typeRefNode); - if (produceDiagnostics) { - var t = getTypeFromTypeNode(typeRefNode); - if (t !== unknownType) { - var declaredType = (t.flags & 4096 /* Reference */) ? t.target : t; - if (declaredType.flags & (1024 /* Class */ | 2048 /* Interface */)) { - checkTypeAssignableTo(type, t, node.name || node, ts.Diagnostics.Class_0_incorrectly_implements_interface_1); - } - else { - error(typeRefNode, ts.Diagnostics.A_class_may_only_implement_another_class_or_interface); - } - } - } - }); - } - ts.forEach(node.members, checkSourceElement); - if (produceDiagnostics) { - checkIndexConstraints(type); - checkTypeForDuplicateIndexSignatures(node); - } - } - function getTargetSymbol(s) { - // if symbol is instantiated its flags are not copied from the 'target' - // so we'll need to get back original 'target' symbol to work with correct set of flags - return s.flags & 16777216 /* Instantiated */ ? getSymbolLinks(s).target : s; - } - function checkKindsOfPropertyMemberOverrides(type, baseType) { - // TypeScript 1.0 spec (April 2014): 8.2.3 - // A derived class inherits all members from its base class it doesn't override. - // Inheritance means that a derived class implicitly contains all non - overridden members of the base class. - // Both public and private property members are inherited, but only public property members can be overridden. - // A property member in a derived class is said to override a property member in a base class - // when the derived class property member has the same name and kind(instance or static) - // as the base class property member. - // The type of an overriding property member must be assignable(section 3.8.4) - // to the type of the overridden property member, or otherwise a compile - time error occurs. - // Base class instance member functions can be overridden by derived class instance member functions, - // but not by other kinds of members. - // Base class instance member variables and accessors can be overridden by - // derived class instance member variables and accessors, but not by other kinds of members. - // NOTE: assignability is checked in checkClassDeclaration - var baseProperties = getPropertiesOfObjectType(baseType); - for (var _i = 0; _i < baseProperties.length; _i++) { - var baseProperty = baseProperties[_i]; - var base = getTargetSymbol(baseProperty); - if (base.flags & 134217728 /* Prototype */) { - continue; - } - var derived = getTargetSymbol(getPropertyOfObjectType(type, base.name)); - if (derived) { - var baseDeclarationFlags = getDeclarationFlagsFromSymbol(base); - var derivedDeclarationFlags = getDeclarationFlagsFromSymbol(derived); - if ((baseDeclarationFlags & 32 /* Private */) || (derivedDeclarationFlags & 32 /* Private */)) { - // either base or derived property is private - not override, skip it - continue; - } - if ((baseDeclarationFlags & 128 /* Static */) !== (derivedDeclarationFlags & 128 /* Static */)) { - // value of 'static' is not the same for properties - not override, skip it - continue; - } - if ((base.flags & derived.flags & 8192 /* Method */) || ((base.flags & 98308 /* PropertyOrAccessor */) && (derived.flags & 98308 /* PropertyOrAccessor */))) { - // method is overridden with method or property/accessor is overridden with property/accessor - correct case - continue; - } - var errorMessage = void 0; - if (base.flags & 8192 /* Method */) { - if (derived.flags & 98304 /* Accessor */) { - errorMessage = ts.Diagnostics.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor; - } - else { - ts.Debug.assert((derived.flags & 4 /* Property */) !== 0); - errorMessage = ts.Diagnostics.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property; - } - } - else if (base.flags & 4 /* Property */) { - ts.Debug.assert((derived.flags & 8192 /* Method */) !== 0); - errorMessage = ts.Diagnostics.Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function; - } - else { - ts.Debug.assert((base.flags & 98304 /* Accessor */) !== 0); - ts.Debug.assert((derived.flags & 8192 /* Method */) !== 0); - errorMessage = ts.Diagnostics.Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function; - } - error(derived.valueDeclaration.name, errorMessage, typeToString(baseType), symbolToString(base), typeToString(type)); - } - } - } - function isAccessor(kind) { - return kind === 138 /* GetAccessor */ || kind === 139 /* SetAccessor */; - } - function areTypeParametersIdentical(list1, list2) { - if (!list1 && !list2) { - return true; - } - if (!list1 || !list2 || list1.length !== list2.length) { - return false; - } - // TypeScript 1.0 spec (April 2014): - // When a generic interface has multiple declarations, all declarations must have identical type parameter - // lists, i.e. identical type parameter names with identical constraints in identical order. - for (var i = 0, len = list1.length; i < len; i++) { - var tp1 = list1[i]; - var tp2 = list2[i]; - if (tp1.name.text !== tp2.name.text) { - return false; - } - if (!tp1.constraint && !tp2.constraint) { - continue; - } - if (!tp1.constraint || !tp2.constraint) { - return false; - } - if (!isTypeIdenticalTo(getTypeFromTypeNode(tp1.constraint), getTypeFromTypeNode(tp2.constraint))) { - return false; - } - } - return true; - } - function checkInheritedPropertiesAreIdentical(type, typeNode) { - var baseTypes = getBaseTypes(type); - if (baseTypes.length < 2) { - return true; - } - var seen = {}; - ts.forEach(resolveDeclaredMembers(type).declaredProperties, function (p) { seen[p.name] = { prop: p, containingType: type }; }); - var ok = true; - for (var _i = 0; _i < baseTypes.length; _i++) { - var base = baseTypes[_i]; - var properties = getPropertiesOfObjectType(base); - for (var _a = 0; _a < properties.length; _a++) { - var prop = properties[_a]; - if (!ts.hasProperty(seen, prop.name)) { - seen[prop.name] = { prop: prop, containingType: base }; - } - else { - var existing = seen[prop.name]; - var isInheritedProperty = existing.containingType !== type; - if (isInheritedProperty && !isPropertyIdenticalTo(existing.prop, prop)) { - ok = false; - var typeName1 = typeToString(existing.containingType); - var typeName2 = typeToString(base); - var errorInfo = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.Named_property_0_of_types_1_and_2_are_not_identical, symbolToString(prop), typeName1, typeName2); - errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Interface_0_cannot_simultaneously_extend_types_1_and_2, typeToString(type), typeName1, typeName2); - diagnostics.add(ts.createDiagnosticForNodeFromMessageChain(typeNode, errorInfo)); - } - } - } - } - return ok; - } - function checkInterfaceDeclaration(node) { - // Grammar checking - checkGrammarDeclarationNameInStrictMode(node) || checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarInterfaceDeclaration(node); - checkTypeParameters(node.typeParameters); - if (produceDiagnostics) { - checkTypeNameIsReserved(node.name, ts.Diagnostics.Interface_name_cannot_be_0); - checkExportsOnMergedDeclarations(node); - var symbol = getSymbolOfNode(node); - var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 205 /* InterfaceDeclaration */); - if (symbol.declarations.length > 1) { - if (node !== firstInterfaceDecl && !areTypeParametersIdentical(firstInterfaceDecl.typeParameters, node.typeParameters)) { - error(node.name, ts.Diagnostics.All_declarations_of_an_interface_must_have_identical_type_parameters); - } - } - // Only check this symbol once - if (node === firstInterfaceDecl) { - var type = getDeclaredTypeOfSymbol(symbol); - // run subsequent checks only if first set succeeded - if (checkInheritedPropertiesAreIdentical(type, node.name)) { - ts.forEach(getBaseTypes(type), function (baseType) { - checkTypeAssignableTo(type, baseType, node.name, ts.Diagnostics.Interface_0_incorrectly_extends_interface_1); - }); - checkIndexConstraints(type); - } - } - } - ts.forEach(ts.getInterfaceBaseTypeNodes(node), function (heritageElement) { - if (!ts.isSupportedExpressionWithTypeArguments(heritageElement)) { - error(heritageElement.expression, ts.Diagnostics.An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments); - } - checkExpressionWithTypeArguments(heritageElement); - }); - ts.forEach(node.members, checkSourceElement); - if (produceDiagnostics) { - checkTypeForDuplicateIndexSignatures(node); - } - } - function checkTypeAliasDeclaration(node) { - // Grammar checking - checkGrammarDecorators(node) || checkGrammarModifiers(node); - checkTypeNameIsReserved(node.name, ts.Diagnostics.Type_alias_name_cannot_be_0); - checkSourceElement(node.type); - } - function computeEnumMemberValues(node) { - var nodeLinks = getNodeLinks(node); - if (!(nodeLinks.flags & 128 /* EnumValuesComputed */)) { - var enumSymbol = getSymbolOfNode(node); - var enumType = getDeclaredTypeOfSymbol(enumSymbol); - var autoValue = 0; - var ambient = ts.isInAmbientContext(node); - var enumIsConst = ts.isConst(node); - ts.forEach(node.members, function (member) { - if (member.name.kind !== 129 /* ComputedPropertyName */ && isNumericLiteralName(member.name.text)) { - error(member.name, ts.Diagnostics.An_enum_member_cannot_have_a_numeric_name); - } - var initializer = member.initializer; - if (initializer) { - autoValue = getConstantValueForEnumMemberInitializer(initializer); - if (autoValue === undefined) { - if (enumIsConst) { - error(initializer, ts.Diagnostics.In_const_enum_declarations_member_initializer_must_be_constant_expression); - } - else if (!ambient) { - // Only here do we need to check that the initializer is assignable to the enum type. - // If it is a constant value (not undefined), it is syntactically constrained to be a number. - // Also, we do not need to check this for ambients because there is already - // a syntax error if it is not a constant. - checkTypeAssignableTo(checkExpression(initializer), enumType, initializer, undefined); - } - } - else if (enumIsConst) { - if (isNaN(autoValue)) { - error(initializer, ts.Diagnostics.const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN); - } - else if (!isFinite(autoValue)) { - error(initializer, ts.Diagnostics.const_enum_member_initializer_was_evaluated_to_a_non_finite_value); - } - } - } - else if (ambient && !enumIsConst) { - autoValue = undefined; - } - if (autoValue !== undefined) { - getNodeLinks(member).enumMemberValue = autoValue++; - } - }); - nodeLinks.flags |= 128 /* EnumValuesComputed */; - } - function getConstantValueForEnumMemberInitializer(initializer) { - return evalConstant(initializer); - function evalConstant(e) { - switch (e.kind) { - case 170 /* PrefixUnaryExpression */: - var value = evalConstant(e.operand); - if (value === undefined) { - return undefined; - } - switch (e.operator) { - case 33 /* PlusToken */: return value; - case 34 /* MinusToken */: return -value; - case 47 /* TildeToken */: return ~value; - } - return undefined; - case 172 /* BinaryExpression */: - var left = evalConstant(e.left); - if (left === undefined) { - return undefined; - } - var right = evalConstant(e.right); - if (right === undefined) { - return undefined; - } - switch (e.operatorToken.kind) { - case 44 /* BarToken */: return left | right; - case 43 /* AmpersandToken */: return left & right; - case 41 /* GreaterThanGreaterThanToken */: return left >> right; - case 42 /* GreaterThanGreaterThanGreaterThanToken */: return left >>> right; - case 40 /* LessThanLessThanToken */: return left << right; - case 45 /* CaretToken */: return left ^ right; - case 35 /* AsteriskToken */: return left * right; - case 36 /* SlashToken */: return left / right; - case 33 /* PlusToken */: return left + right; - case 34 /* MinusToken */: return left - right; - case 37 /* PercentToken */: return left % right; - } - return undefined; - case 7 /* NumericLiteral */: - return +e.text; - case 164 /* ParenthesizedExpression */: - return evalConstant(e.expression); - case 65 /* Identifier */: - case 159 /* ElementAccessExpression */: - case 158 /* PropertyAccessExpression */: - var member = initializer.parent; - var currentType = getTypeOfSymbol(getSymbolOfNode(member.parent)); - var enumType; - var propertyName; - if (e.kind === 65 /* Identifier */) { - // unqualified names can refer to member that reside in different declaration of the enum so just doing name resolution won't work. - // instead pick current enum type and later try to fetch member from the type - enumType = currentType; - propertyName = e.text; - } - else { - var expression; - if (e.kind === 159 /* ElementAccessExpression */) { - if (e.argumentExpression === undefined || - e.argumentExpression.kind !== 8 /* StringLiteral */) { - return undefined; - } - expression = e.expression; - propertyName = e.argumentExpression.text; - } - else { - expression = e.expression; - propertyName = e.name.text; - } - // expression part in ElementAccess\PropertyAccess should be either identifier or dottedName - var current = expression; - while (current) { - if (current.kind === 65 /* Identifier */) { - break; - } - else if (current.kind === 158 /* PropertyAccessExpression */) { - current = current.expression; - } - else { - return undefined; - } - } - enumType = checkExpression(expression); - // allow references to constant members of other enums - if (!(enumType.symbol && (enumType.symbol.flags & 384 /* Enum */))) { - return undefined; - } - } - if (propertyName === undefined) { - return undefined; - } - var property = getPropertyOfObjectType(enumType, propertyName); - if (!property || !(property.flags & 8 /* EnumMember */)) { - return undefined; - } - var propertyDecl = property.valueDeclaration; - // self references are illegal - if (member === propertyDecl) { - return undefined; - } - // illegal case: forward reference - if (!isDefinedBefore(propertyDecl, member)) { - return undefined; - } - return getNodeLinks(propertyDecl).enumMemberValue; - } - } - } - } - function checkEnumDeclaration(node) { - if (!produceDiagnostics) { - return; - } - // Grammar checking - checkGrammarDeclarationNameInStrictMode(node) || checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarEnumDeclaration(node); - checkTypeNameIsReserved(node.name, ts.Diagnostics.Enum_name_cannot_be_0); - checkCollisionWithCapturedThisVariable(node, node.name); - checkCollisionWithRequireExportsInGeneratedCode(node, node.name); - checkExportsOnMergedDeclarations(node); - computeEnumMemberValues(node); - var enumIsConst = ts.isConst(node); - if (compilerOptions.isolatedModules && enumIsConst && ts.isInAmbientContext(node)) { - error(node.name, ts.Diagnostics.Ambient_const_enums_are_not_allowed_when_the_isolatedModules_flag_is_provided); - } - // Spec 2014 - Section 9.3: - // It isn't possible for one enum declaration to continue the automatic numbering sequence of another, - // and when an enum type has multiple declarations, only one declaration is permitted to omit a value - // for the first member. - // - // Only perform this check once per symbol - var enumSymbol = getSymbolOfNode(node); - var firstDeclaration = ts.getDeclarationOfKind(enumSymbol, node.kind); - if (node === firstDeclaration) { - if (enumSymbol.declarations.length > 1) { - // check that const is placed\omitted on all enum declarations - ts.forEach(enumSymbol.declarations, function (decl) { - if (ts.isConstEnumDeclaration(decl) !== enumIsConst) { - error(decl.name, ts.Diagnostics.Enum_declarations_must_all_be_const_or_non_const); - } - }); - } - var seenEnumMissingInitialInitializer = false; - ts.forEach(enumSymbol.declarations, function (declaration) { - // return true if we hit a violation of the rule, false otherwise - if (declaration.kind !== 207 /* EnumDeclaration */) { - return false; - } - var enumDeclaration = declaration; - if (!enumDeclaration.members.length) { - return false; - } - var firstEnumMember = enumDeclaration.members[0]; - if (!firstEnumMember.initializer) { - if (seenEnumMissingInitialInitializer) { - error(firstEnumMember.name, ts.Diagnostics.In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element); - } - else { - seenEnumMissingInitialInitializer = true; - } - } - }); - } - } - function getFirstNonAmbientClassOrFunctionDeclaration(symbol) { - var declarations = symbol.declarations; - for (var _i = 0; _i < declarations.length; _i++) { - var declaration = declarations[_i]; - if ((declaration.kind === 204 /* ClassDeclaration */ || - (declaration.kind === 203 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) && - !ts.isInAmbientContext(declaration)) { - return declaration; - } - } - return undefined; - } - function inSameLexicalScope(node1, node2) { - var container1 = ts.getEnclosingBlockScopeContainer(node1); - var container2 = ts.getEnclosingBlockScopeContainer(node2); - if (isGlobalSourceFile(container1)) { - return isGlobalSourceFile(container2); - } - else if (isGlobalSourceFile(container2)) { - return false; - } - else { - return container1 === container2; - } - } - function checkModuleDeclaration(node) { - if (produceDiagnostics) { - // Grammar checking - var isAmbientExternalModule = node.name.kind === 8 /* StringLiteral */; - var contextErrorMessage = isAmbientExternalModule - ? ts.Diagnostics.An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file - : ts.Diagnostics.A_namespace_declaration_is_only_allowed_in_a_namespace_or_module; - if (checkGrammarModuleElementContext(node, contextErrorMessage)) { - // If we hit a module declaration in an illegal context, just bail out to avoid cascading errors. - return; - } - if (!checkGrammarDeclarationNameInStrictMode(node) && !checkGrammarDecorators(node) && !checkGrammarModifiers(node)) { - if (!ts.isInAmbientContext(node) && node.name.kind === 8 /* StringLiteral */) { - grammarErrorOnNode(node.name, ts.Diagnostics.Only_ambient_modules_can_use_quoted_names); - } - } - checkCollisionWithCapturedThisVariable(node, node.name); - checkCollisionWithRequireExportsInGeneratedCode(node, node.name); - checkExportsOnMergedDeclarations(node); - var symbol = getSymbolOfNode(node); - // The following checks only apply on a non-ambient instantiated module declaration. - if (symbol.flags & 512 /* ValueModule */ - && symbol.declarations.length > 1 - && !ts.isInAmbientContext(node) - && ts.isInstantiatedModule(node, compilerOptions.preserveConstEnums || compilerOptions.isolatedModules)) { - var firstNonAmbientClassOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol); - if (firstNonAmbientClassOrFunc) { - if (ts.getSourceFileOfNode(node) !== ts.getSourceFileOfNode(firstNonAmbientClassOrFunc)) { - error(node.name, ts.Diagnostics.A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged); - } - else if (node.pos < firstNonAmbientClassOrFunc.pos) { - error(node.name, ts.Diagnostics.A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged); - } - } - // if the module merges with a class declaration in the same lexical scope, - // we need to track this to ensure the correct emit. - var mergedClass = ts.getDeclarationOfKind(symbol, 204 /* ClassDeclaration */); - if (mergedClass && - inSameLexicalScope(node, mergedClass)) { - getNodeLinks(node).flags |= 2048 /* LexicalModuleMergesWithClass */; - } - } - // Checks for ambient external modules. - if (isAmbientExternalModule) { - if (!isGlobalSourceFile(node.parent)) { - error(node.name, ts.Diagnostics.Ambient_modules_cannot_be_nested_in_other_modules); - } - if (isExternalModuleNameRelative(node.name.text)) { - error(node.name, ts.Diagnostics.Ambient_module_declaration_cannot_specify_relative_module_name); - } - } - } - checkSourceElement(node.body); - } - function getFirstIdentifier(node) { - while (true) { - if (node.kind === 128 /* QualifiedName */) { - node = node.left; - } - else if (node.kind === 158 /* PropertyAccessExpression */) { - node = node.expression; - } - else { - break; - } - } - ts.Debug.assert(node.kind === 65 /* Identifier */); - return node; - } - function checkExternalImportOrExportDeclaration(node) { - var moduleName = ts.getExternalModuleName(node); - if (!ts.nodeIsMissing(moduleName) && moduleName.kind !== 8 /* StringLiteral */) { - error(moduleName, ts.Diagnostics.String_literal_expected); - return false; - } - var inAmbientExternalModule = node.parent.kind === 209 /* ModuleBlock */ && node.parent.parent.name.kind === 8 /* StringLiteral */; - if (node.parent.kind !== 230 /* SourceFile */ && !inAmbientExternalModule) { - error(moduleName, node.kind === 218 /* ExportDeclaration */ ? - ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace : - ts.Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module); - return false; - } - if (inAmbientExternalModule && isExternalModuleNameRelative(moduleName.text)) { - // TypeScript 1.0 spec (April 2013): 12.1.6 - // An ExternalImportDeclaration in an AmbientExternalModuleDeclaration may reference - // other external modules only through top - level external module names. - // Relative external module names are not permitted. - error(node, ts.Diagnostics.Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relative_module_name); - return false; - } - return true; - } - function checkAliasSymbol(node) { - var symbol = getSymbolOfNode(node); - var target = resolveAlias(symbol); - if (target !== unknownSymbol) { - var excludedMeanings = (symbol.flags & 107455 /* Value */ ? 107455 /* Value */ : 0) | - (symbol.flags & 793056 /* Type */ ? 793056 /* Type */ : 0) | - (symbol.flags & 1536 /* Namespace */ ? 1536 /* Namespace */ : 0); - if (target.flags & excludedMeanings) { - var message = node.kind === 220 /* ExportSpecifier */ ? - ts.Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : - ts.Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0; - error(node, message, symbolToString(symbol)); - } - } - } - function checkImportBinding(node) { - checkCollisionWithCapturedThisVariable(node, node.name); - checkCollisionWithRequireExportsInGeneratedCode(node, node.name); - checkAliasSymbol(node); - } - function checkImportDeclaration(node) { - if (checkGrammarModuleElementContext(node, ts.Diagnostics.An_import_declaration_can_only_be_used_in_a_namespace_or_module)) { - // If we hit an import declaration in an illegal context, just bail out to avoid cascading errors. - return; - } - if (!checkGrammarImportDeclarationNameInStrictMode(node) && !checkGrammarDecorators(node) && !checkGrammarModifiers(node) && (node.flags & 499 /* Modifier */)) { - grammarErrorOnFirstToken(node, ts.Diagnostics.An_import_declaration_cannot_have_modifiers); - } - if (checkExternalImportOrExportDeclaration(node)) { - var importClause = node.importClause; - if (importClause) { - if (importClause.name) { - checkImportBinding(importClause); - } - if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 214 /* NamespaceImport */) { - checkImportBinding(importClause.namedBindings); - } - else { - ts.forEach(importClause.namedBindings.elements, checkImportBinding); - } - } - } - } - } - function checkImportEqualsDeclaration(node) { - if (checkGrammarModuleElementContext(node, ts.Diagnostics.An_import_declaration_can_only_be_used_in_a_namespace_or_module)) { - // If we hit an import declaration in an illegal context, just bail out to avoid cascading errors. - return; - } - checkGrammarDeclarationNameInStrictMode(node) || checkGrammarDecorators(node) || checkGrammarModifiers(node); - if (ts.isInternalModuleImportEqualsDeclaration(node) || checkExternalImportOrExportDeclaration(node)) { - checkImportBinding(node); - if (node.flags & 1 /* Export */) { - markExportAsReferenced(node); - } - if (ts.isInternalModuleImportEqualsDeclaration(node)) { - var target = resolveAlias(getSymbolOfNode(node)); - if (target !== unknownSymbol) { - if (target.flags & 107455 /* Value */) { - // Target is a value symbol, check that it is not hidden by a local declaration with the same name - var moduleName = getFirstIdentifier(node.moduleReference); - if (!(resolveEntityName(moduleName, 107455 /* Value */ | 1536 /* Namespace */).flags & 1536 /* Namespace */)) { - error(moduleName, ts.Diagnostics.Module_0_is_hidden_by_a_local_declaration_with_the_same_name, ts.declarationNameToString(moduleName)); - } - } - if (target.flags & 793056 /* Type */) { - checkTypeNameIsReserved(node.name, ts.Diagnostics.Import_name_cannot_be_0); - } - } - } - else { - if (languageVersion >= 2 /* ES6 */) { - // Import equals declaration is deprecated in es6 or above - grammarErrorOnNode(node, ts.Diagnostics.Import_assignment_cannot_be_used_when_targeting_ECMAScript_6_or_higher_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_or_import_d_from_mod_instead); - } - } - } - } - function checkExportDeclaration(node) { - if (checkGrammarModuleElementContext(node, ts.Diagnostics.An_export_declaration_can_only_be_used_in_a_module)) { - // If we hit an export in an illegal context, just bail out to avoid cascading errors. - return; - } - if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && (node.flags & 499 /* Modifier */)) { - grammarErrorOnFirstToken(node, ts.Diagnostics.An_export_declaration_cannot_have_modifiers); - } - if (!node.moduleSpecifier || checkExternalImportOrExportDeclaration(node)) { - if (node.exportClause) { - // export { x, y } - // export { x, y } from "foo" - ts.forEach(node.exportClause.elements, checkExportSpecifier); - var inAmbientExternalModule = node.parent.kind === 209 /* ModuleBlock */ && node.parent.parent.name.kind === 8 /* StringLiteral */; - if (node.parent.kind !== 230 /* SourceFile */ && !inAmbientExternalModule) { - error(node, ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace); - } - } - else { - // export * from "foo" - var moduleSymbol = resolveExternalModuleName(node, node.moduleSpecifier); - if (moduleSymbol && moduleSymbol.exports["export="]) { - error(node.moduleSpecifier, ts.Diagnostics.Module_0_uses_export_and_cannot_be_used_with_export_Asterisk, symbolToString(moduleSymbol)); - } - } - } - } - function checkGrammarModuleElementContext(node, errorMessage) { - if (node.parent.kind !== 230 /* SourceFile */ && node.parent.kind !== 209 /* ModuleBlock */ && node.parent.kind !== 208 /* ModuleDeclaration */) { - return grammarErrorOnFirstToken(node, errorMessage); - } - } - function checkExportSpecifier(node) { - checkAliasSymbol(node); - if (!node.parent.parent.moduleSpecifier) { - markExportAsReferenced(node); - } - } - function checkExportAssignment(node) { - if (checkGrammarModuleElementContext(node, ts.Diagnostics.An_export_assignment_can_only_be_used_in_a_module)) { - // If we hit an export assignment in an illegal context, just bail out to avoid cascading errors. - return; - } - var container = node.parent.kind === 230 /* SourceFile */ ? node.parent : node.parent.parent; - if (container.kind === 208 /* ModuleDeclaration */ && container.name.kind === 65 /* Identifier */) { - error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace); - return; - } - // Grammar checking - if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && (node.flags & 499 /* Modifier */)) { - grammarErrorOnFirstToken(node, ts.Diagnostics.An_export_assignment_cannot_have_modifiers); - } - if (node.expression.kind === 65 /* Identifier */) { - markExportAsReferenced(node); - } - else { - checkExpressionCached(node.expression); - } - checkExternalModuleExports(container); - if (node.isExportEquals && !ts.isInAmbientContext(node)) { - if (languageVersion >= 2 /* ES6 */) { - // export assignment is deprecated in es6 or above - grammarErrorOnNode(node, ts.Diagnostics.Export_assignment_cannot_be_used_when_targeting_ECMAScript_6_or_higher_Consider_using_export_default_instead); - } - else if (compilerOptions.module === 4 /* System */) { - // system modules does not support export assignment - grammarErrorOnNode(node, ts.Diagnostics.Export_assignment_is_not_supported_when_module_flag_is_system); - } - } - } - function getModuleStatements(node) { - if (node.kind === 230 /* SourceFile */) { - return node.statements; - } - if (node.kind === 208 /* ModuleDeclaration */ && node.body.kind === 209 /* ModuleBlock */) { - return node.body.statements; - } - return emptyArray; - } - function hasExportedMembers(moduleSymbol) { - for (var id in moduleSymbol.exports) { - if (id !== "export=") { - return true; - } - } - return false; - } - function checkExternalModuleExports(node) { - var moduleSymbol = getSymbolOfNode(node); - var links = getSymbolLinks(moduleSymbol); - if (!links.exportsChecked) { - var exportEqualsSymbol = moduleSymbol.exports["export="]; - if (exportEqualsSymbol && hasExportedMembers(moduleSymbol)) { - var declaration = getDeclarationOfAliasSymbol(exportEqualsSymbol) || exportEqualsSymbol.valueDeclaration; - error(declaration, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements); - } - links.exportsChecked = true; - } - } - function checkTypePredicate(node) { - if (!isInLegalTypePredicatePosition(node)) { - error(node, ts.Diagnostics.A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods); - } - } - function checkSourceElement(node) { - if (!node) - return; - switch (node.kind) { - case 130 /* TypeParameter */: - return checkTypeParameter(node); - case 131 /* Parameter */: - return checkParameter(node); - case 134 /* PropertyDeclaration */: - case 133 /* PropertySignature */: - return checkPropertyDeclaration(node); - case 145 /* FunctionType */: - case 146 /* ConstructorType */: - case 140 /* CallSignature */: - case 141 /* ConstructSignature */: - return checkSignatureDeclaration(node); - case 142 /* IndexSignature */: - return checkSignatureDeclaration(node); - case 136 /* MethodDeclaration */: - case 135 /* MethodSignature */: - return checkMethodDeclaration(node); - case 137 /* Constructor */: - return checkConstructorDeclaration(node); - case 138 /* GetAccessor */: - case 139 /* SetAccessor */: - return checkAccessorDeclaration(node); - case 144 /* TypeReference */: - return checkTypeReferenceNode(node); - case 143 /* TypePredicate */: - return checkTypePredicate(node); - case 147 /* TypeQuery */: - return checkTypeQuery(node); - case 148 /* TypeLiteral */: - return checkTypeLiteral(node); - case 149 /* ArrayType */: - return checkArrayType(node); - case 150 /* TupleType */: - return checkTupleType(node); - case 151 /* UnionType */: - return checkUnionType(node); - case 152 /* ParenthesizedType */: - return checkSourceElement(node.type); - case 203 /* FunctionDeclaration */: - return checkFunctionDeclaration(node); - case 182 /* Block */: - case 209 /* ModuleBlock */: - return checkBlock(node); - case 183 /* VariableStatement */: - return checkVariableStatement(node); - case 185 /* ExpressionStatement */: - return checkExpressionStatement(node); - case 186 /* IfStatement */: - return checkIfStatement(node); - case 187 /* DoStatement */: - return checkDoStatement(node); - case 188 /* WhileStatement */: - return checkWhileStatement(node); - case 189 /* ForStatement */: - return checkForStatement(node); - case 190 /* ForInStatement */: - return checkForInStatement(node); - case 191 /* ForOfStatement */: - return checkForOfStatement(node); - case 192 /* ContinueStatement */: - case 193 /* BreakStatement */: - return checkBreakOrContinueStatement(node); - case 194 /* ReturnStatement */: - return checkReturnStatement(node); - case 195 /* WithStatement */: - return checkWithStatement(node); - case 196 /* SwitchStatement */: - return checkSwitchStatement(node); - case 197 /* LabeledStatement */: - return checkLabeledStatement(node); - case 198 /* ThrowStatement */: - return checkThrowStatement(node); - case 199 /* TryStatement */: - return checkTryStatement(node); - case 201 /* VariableDeclaration */: - return checkVariableDeclaration(node); - case 155 /* BindingElement */: - return checkBindingElement(node); - case 204 /* ClassDeclaration */: - return checkClassDeclaration(node); - case 205 /* InterfaceDeclaration */: - return checkInterfaceDeclaration(node); - case 206 /* TypeAliasDeclaration */: - return checkTypeAliasDeclaration(node); - case 207 /* EnumDeclaration */: - return checkEnumDeclaration(node); - case 208 /* ModuleDeclaration */: - return checkModuleDeclaration(node); - case 212 /* ImportDeclaration */: - return checkImportDeclaration(node); - case 211 /* ImportEqualsDeclaration */: - return checkImportEqualsDeclaration(node); - case 218 /* ExportDeclaration */: - return checkExportDeclaration(node); - case 217 /* ExportAssignment */: - return checkExportAssignment(node); - case 184 /* EmptyStatement */: - checkGrammarStatementInAmbientContext(node); - return; - case 200 /* DebuggerStatement */: - checkGrammarStatementInAmbientContext(node); - return; - case 221 /* MissingDeclaration */: - return checkMissingDeclaration(node); - } - } - // Function expression bodies are checked after all statements in the enclosing body. This is to ensure - // constructs like the following are permitted: - // let foo = function () { - // let s = foo(); - // return "hello"; - // } - // Here, performing a full type check of the body of the function expression whilst in the process of - // determining the type of foo would cause foo to be given type any because of the recursive reference. - // Delaying the type check of the body ensures foo has been assigned a type. - function checkFunctionExpressionBodies(node) { - switch (node.kind) { - case 165 /* FunctionExpression */: - case 166 /* ArrowFunction */: - ts.forEach(node.parameters, checkFunctionExpressionBodies); - checkFunctionExpressionOrObjectLiteralMethodBody(node); - break; - case 136 /* MethodDeclaration */: - case 135 /* MethodSignature */: - ts.forEach(node.decorators, checkFunctionExpressionBodies); - ts.forEach(node.parameters, checkFunctionExpressionBodies); - if (ts.isObjectLiteralMethod(node)) { - checkFunctionExpressionOrObjectLiteralMethodBody(node); - } - break; - case 137 /* Constructor */: - case 138 /* GetAccessor */: - case 139 /* SetAccessor */: - case 203 /* FunctionDeclaration */: - ts.forEach(node.parameters, checkFunctionExpressionBodies); - break; - case 195 /* WithStatement */: - checkFunctionExpressionBodies(node.expression); - break; - case 132 /* Decorator */: - case 131 /* Parameter */: - case 134 /* PropertyDeclaration */: - case 133 /* PropertySignature */: - case 153 /* ObjectBindingPattern */: - case 154 /* ArrayBindingPattern */: - case 155 /* BindingElement */: - case 156 /* ArrayLiteralExpression */: - case 157 /* ObjectLiteralExpression */: - case 227 /* PropertyAssignment */: - case 158 /* PropertyAccessExpression */: - case 159 /* ElementAccessExpression */: - case 160 /* CallExpression */: - case 161 /* NewExpression */: - case 162 /* TaggedTemplateExpression */: - case 174 /* TemplateExpression */: - case 180 /* TemplateSpan */: - case 163 /* TypeAssertionExpression */: - case 164 /* ParenthesizedExpression */: - case 168 /* TypeOfExpression */: - case 169 /* VoidExpression */: - case 167 /* DeleteExpression */: - case 170 /* PrefixUnaryExpression */: - case 171 /* PostfixUnaryExpression */: - case 172 /* BinaryExpression */: - case 173 /* ConditionalExpression */: - case 176 /* SpreadElementExpression */: - case 182 /* Block */: - case 209 /* ModuleBlock */: - case 183 /* VariableStatement */: - case 185 /* ExpressionStatement */: - case 186 /* IfStatement */: - case 187 /* DoStatement */: - case 188 /* WhileStatement */: - case 189 /* ForStatement */: - case 190 /* ForInStatement */: - case 191 /* ForOfStatement */: - case 192 /* ContinueStatement */: - case 193 /* BreakStatement */: - case 194 /* ReturnStatement */: - case 196 /* SwitchStatement */: - case 210 /* CaseBlock */: - case 223 /* CaseClause */: - case 224 /* DefaultClause */: - case 197 /* LabeledStatement */: - case 198 /* ThrowStatement */: - case 199 /* TryStatement */: - case 226 /* CatchClause */: - case 201 /* VariableDeclaration */: - case 202 /* VariableDeclarationList */: - case 204 /* ClassDeclaration */: - case 207 /* EnumDeclaration */: - case 229 /* EnumMember */: - case 217 /* ExportAssignment */: - case 230 /* SourceFile */: - ts.forEachChild(node, checkFunctionExpressionBodies); - break; - } - } - function checkSourceFile(node) { - var start = new Date().getTime(); - checkSourceFileWorker(node); - ts.checkTime += new Date().getTime() - start; - } - // Fully type check a source file and collect the relevant diagnostics. - function checkSourceFileWorker(node) { - var links = getNodeLinks(node); - if (!(links.flags & 1 /* TypeChecked */)) { - // Check whether the file has declared it is the default lib, - // and whether the user has specifically chosen to avoid checking it. - if (node.isDefaultLib && compilerOptions.skipDefaultLibCheck) { - return; - } - // Grammar checking - checkGrammarSourceFile(node); - emitExtends = false; - emitDecorate = false; - emitParam = false; - potentialThisCollisions.length = 0; - ts.forEach(node.statements, checkSourceElement); - checkFunctionExpressionBodies(node); - if (ts.isExternalModule(node)) { - checkExternalModuleExports(node); - } - if (potentialThisCollisions.length) { - ts.forEach(potentialThisCollisions, checkIfThisIsCapturedInEnclosingScope); - potentialThisCollisions.length = 0; - } - if (emitExtends) { - links.flags |= 8 /* EmitExtends */; - } - if (emitDecorate) { - links.flags |= 512 /* EmitDecorate */; - } - if (emitParam) { - links.flags |= 1024 /* EmitParam */; - } - links.flags |= 1 /* TypeChecked */; - } - } - function getDiagnostics(sourceFile) { - throwIfNonDiagnosticsProducing(); - if (sourceFile) { - checkSourceFile(sourceFile); - return diagnostics.getDiagnostics(sourceFile.fileName); - } - ts.forEach(host.getSourceFiles(), checkSourceFile); - return diagnostics.getDiagnostics(); - } - function getGlobalDiagnostics() { - throwIfNonDiagnosticsProducing(); - return diagnostics.getGlobalDiagnostics(); - } - function throwIfNonDiagnosticsProducing() { - if (!produceDiagnostics) { - throw new Error("Trying to get diagnostics from a type checker that does not produce them."); - } - } - // Language service support - function isInsideWithStatementBody(node) { - if (node) { - while (node.parent) { - if (node.parent.kind === 195 /* WithStatement */ && node.parent.statement === node) { - return true; - } - node = node.parent; - } - } - return false; - } - function getSymbolsInScope(location, meaning) { - var symbols = {}; - var memberFlags = 0; - if (isInsideWithStatementBody(location)) { - // We cannot answer semantic questions within a with block, do not proceed any further - return []; - } - populateSymbols(); - return symbolsToArray(symbols); - function populateSymbols() { - while (location) { - if (location.locals && !isGlobalSourceFile(location)) { - copySymbols(location.locals, meaning); - } - switch (location.kind) { - case 230 /* SourceFile */: - if (!ts.isExternalModule(location)) { - break; - } - case 208 /* ModuleDeclaration */: - copySymbols(getSymbolOfNode(location).exports, meaning & 8914931 /* ModuleMember */); - break; - case 207 /* EnumDeclaration */: - copySymbols(getSymbolOfNode(location).exports, meaning & 8 /* EnumMember */); - break; - case 204 /* ClassDeclaration */: - case 205 /* InterfaceDeclaration */: - if (!(memberFlags & 128 /* Static */)) { - copySymbols(getSymbolOfNode(location).members, meaning & 793056 /* Type */); - } - break; - case 165 /* FunctionExpression */: - if (location.name) { - copySymbol(location.symbol, meaning); - } - break; - } - memberFlags = location.flags; - location = location.parent; - } - copySymbols(globals, meaning); - } - // Returns 'true' if we should stop processing symbols. - function copySymbol(symbol, meaning) { - if (symbol.flags & meaning) { - var id = symbol.name; - if (!isReservedMemberName(id) && !ts.hasProperty(symbols, id)) { - symbols[id] = symbol; - } - } - } - function copySymbols(source, meaning) { - if (meaning) { - for (var id in source) { - if (ts.hasProperty(source, id)) { - copySymbol(source[id], meaning); - } - } - } - } - if (isInsideWithStatementBody(location)) { - // We cannot answer semantic questions within a with block, do not proceed any further - return []; - } - while (location) { - if (location.locals && !isGlobalSourceFile(location)) { - copySymbols(location.locals, meaning); - } - switch (location.kind) { - case 230 /* SourceFile */: - if (!ts.isExternalModule(location)) - break; - case 208 /* ModuleDeclaration */: - copySymbols(getSymbolOfNode(location).exports, meaning & 8914931 /* ModuleMember */); - break; - case 207 /* EnumDeclaration */: - copySymbols(getSymbolOfNode(location).exports, meaning & 8 /* EnumMember */); - break; - case 204 /* ClassDeclaration */: - case 205 /* InterfaceDeclaration */: - if (!(memberFlags & 128 /* Static */)) { - copySymbols(getSymbolOfNode(location).members, meaning & 793056 /* Type */); - } - break; - case 165 /* FunctionExpression */: - if (location.name) { - copySymbol(location.symbol, meaning); - } - break; - } - memberFlags = location.flags; - location = location.parent; - } - copySymbols(globals, meaning); - return symbolsToArray(symbols); - } - function isTypeDeclarationName(name) { - return name.kind == 65 /* Identifier */ && - isTypeDeclaration(name.parent) && - name.parent.name === name; - } - function isTypeDeclaration(node) { - switch (node.kind) { - case 130 /* TypeParameter */: - case 204 /* ClassDeclaration */: - case 205 /* InterfaceDeclaration */: - case 206 /* TypeAliasDeclaration */: - case 207 /* EnumDeclaration */: - return true; - } - } - // True if the given identifier is part of a type reference - function isTypeReferenceIdentifier(entityName) { - var node = entityName; - while (node.parent && node.parent.kind === 128 /* QualifiedName */) { - node = node.parent; - } - return node.parent && node.parent.kind === 144 /* TypeReference */; - } - function isHeritageClauseElementIdentifier(entityName) { - var node = entityName; - while (node.parent && node.parent.kind === 158 /* PropertyAccessExpression */) { - node = node.parent; - } - return node.parent && node.parent.kind === 179 /* ExpressionWithTypeArguments */; - } - function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) { - while (nodeOnRightSide.parent.kind === 128 /* QualifiedName */) { - nodeOnRightSide = nodeOnRightSide.parent; - } - if (nodeOnRightSide.parent.kind === 211 /* ImportEqualsDeclaration */) { - return nodeOnRightSide.parent.moduleReference === nodeOnRightSide && nodeOnRightSide.parent; - } - if (nodeOnRightSide.parent.kind === 217 /* ExportAssignment */) { - return nodeOnRightSide.parent.expression === nodeOnRightSide && nodeOnRightSide.parent; - } - return undefined; - } - function isInRightSideOfImportOrExportAssignment(node) { - return getLeftSideOfImportEqualsOrExportAssignment(node) !== undefined; - } - function getSymbolOfEntityNameOrPropertyAccessExpression(entityName) { - if (ts.isDeclarationName(entityName)) { - return getSymbolOfNode(entityName.parent); - } - if (entityName.parent.kind === 217 /* ExportAssignment */) { - return resolveEntityName(entityName, - /*all meanings*/ 107455 /* Value */ | 793056 /* Type */ | 1536 /* Namespace */ | 8388608 /* Alias */); - } - if (entityName.kind !== 158 /* PropertyAccessExpression */) { - if (isInRightSideOfImportOrExportAssignment(entityName)) { - // Since we already checked for ExportAssignment, this really could only be an Import - return getSymbolOfPartOfRightHandSideOfImportEquals(entityName); - } - } - if (ts.isRightSideOfQualifiedNameOrPropertyAccess(entityName)) { - entityName = entityName.parent; - } - if (isHeritageClauseElementIdentifier(entityName)) { - var meaning = entityName.parent.kind === 179 /* ExpressionWithTypeArguments */ ? 793056 /* Type */ : 1536 /* Namespace */; - meaning |= 8388608 /* Alias */; - return resolveEntityName(entityName, meaning); - } - else if (ts.isExpression(entityName)) { - if (ts.nodeIsMissing(entityName)) { - // Missing entity name. - return undefined; - } - if (entityName.kind === 65 /* Identifier */) { - // Include aliases in the meaning, this ensures that we do not follow aliases to where they point and instead - // return the alias symbol. - var meaning = 107455 /* Value */ | 8388608 /* Alias */; - return resolveEntityName(entityName, meaning); - } - else if (entityName.kind === 158 /* PropertyAccessExpression */) { - var symbol = getNodeLinks(entityName).resolvedSymbol; - if (!symbol) { - checkPropertyAccessExpression(entityName); - } - return getNodeLinks(entityName).resolvedSymbol; - } - else if (entityName.kind === 128 /* QualifiedName */) { - var symbol = getNodeLinks(entityName).resolvedSymbol; - if (!symbol) { - checkQualifiedName(entityName); - } - return getNodeLinks(entityName).resolvedSymbol; - } - } - else if (isTypeReferenceIdentifier(entityName)) { - var meaning = entityName.parent.kind === 144 /* TypeReference */ ? 793056 /* Type */ : 1536 /* Namespace */; - // Include aliases in the meaning, this ensures that we do not follow aliases to where they point and instead - // return the alias symbol. - meaning |= 8388608 /* Alias */; - return resolveEntityName(entityName, meaning); - } - // Do we want to return undefined here? - return undefined; - } - function getSymbolInfo(node) { - if (isInsideWithStatementBody(node)) { - // We cannot answer semantic questions within a with block, do not proceed any further - return undefined; - } - if (ts.isDeclarationName(node)) { - // This is a declaration, call getSymbolOfNode - return getSymbolOfNode(node.parent); - } - if (node.kind === 65 /* Identifier */ && isInRightSideOfImportOrExportAssignment(node)) { - return node.parent.kind === 217 /* ExportAssignment */ - ? getSymbolOfEntityNameOrPropertyAccessExpression(node) - : getSymbolOfPartOfRightHandSideOfImportEquals(node); - } - switch (node.kind) { - case 65 /* Identifier */: - case 158 /* PropertyAccessExpression */: - case 128 /* QualifiedName */: - return getSymbolOfEntityNameOrPropertyAccessExpression(node); - case 93 /* ThisKeyword */: - case 91 /* SuperKeyword */: - var type = checkExpression(node); - return type.symbol; - case 114 /* ConstructorKeyword */: - // constructor keyword for an overload, should take us to the definition if it exist - var constructorDeclaration = node.parent; - if (constructorDeclaration && constructorDeclaration.kind === 137 /* Constructor */) { - return constructorDeclaration.parent.symbol; - } - return undefined; - case 8 /* StringLiteral */: - // External module name in an import declaration - var moduleName; - if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && - ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) || - ((node.parent.kind === 212 /* ImportDeclaration */ || node.parent.kind === 218 /* ExportDeclaration */) && - node.parent.moduleSpecifier === node)) { - return resolveExternalModuleName(node, node); - } - // Intentional fall-through - case 7 /* NumericLiteral */: - // index access - if (node.parent.kind == 159 /* ElementAccessExpression */ && node.parent.argumentExpression === node) { - var objectType = checkExpression(node.parent.expression); - if (objectType === unknownType) - return undefined; - var apparentType = getApparentType(objectType); - if (apparentType === unknownType) - return undefined; - return getPropertyOfType(apparentType, node.text); - } - break; - } - return undefined; - } - function getShorthandAssignmentValueSymbol(location) { - // The function returns a value symbol of an identifier in the short-hand property assignment. - // This is necessary as an identifier in short-hand property assignment can contains two meaning: - // property name and property value. - if (location && location.kind === 228 /* ShorthandPropertyAssignment */) { - return resolveEntityName(location.name, 107455 /* Value */); - } - return undefined; - } - function getTypeOfNode(node) { - if (isInsideWithStatementBody(node)) { - // We cannot answer semantic questions within a with block, do not proceed any further - return unknownType; - } - if (ts.isTypeNode(node)) { - return getTypeFromTypeNode(node); - } - if (ts.isExpression(node)) { - return getTypeOfExpression(node); - } - if (isTypeDeclaration(node)) { - // In this case, we call getSymbolOfNode instead of getSymbolInfo because it is a declaration - var symbol = getSymbolOfNode(node); - return getDeclaredTypeOfSymbol(symbol); - } - if (isTypeDeclarationName(node)) { - var symbol = getSymbolInfo(node); - return symbol && getDeclaredTypeOfSymbol(symbol); - } - if (ts.isDeclaration(node)) { - // In this case, we call getSymbolOfNode instead of getSymbolInfo because it is a declaration - var symbol = getSymbolOfNode(node); - return getTypeOfSymbol(symbol); - } - if (ts.isDeclarationName(node)) { - var symbol = getSymbolInfo(node); - return symbol && getTypeOfSymbol(symbol); - } - if (isInRightSideOfImportOrExportAssignment(node)) { - var symbol = getSymbolInfo(node); - var declaredType = symbol && getDeclaredTypeOfSymbol(symbol); - return declaredType !== unknownType ? declaredType : getTypeOfSymbol(symbol); - } - return unknownType; - } - function getTypeOfExpression(expr) { - if (ts.isRightSideOfQualifiedNameOrPropertyAccess(expr)) { - expr = expr.parent; - } - return checkExpression(expr); - } - // Return the list of properties of the given type, augmented with properties from Function - // if the type has call or construct signatures - function getAugmentedPropertiesOfType(type) { - type = getApparentType(type); - var propsByName = createSymbolTable(getPropertiesOfType(type)); - if (getSignaturesOfType(type, 0 /* Call */).length || getSignaturesOfType(type, 1 /* Construct */).length) { - ts.forEach(getPropertiesOfType(globalFunctionType), function (p) { - if (!ts.hasProperty(propsByName, p.name)) { - propsByName[p.name] = p; - } - }); - } - return getNamedMembers(propsByName); - } - function getRootSymbols(symbol) { - if (symbol.flags & 268435456 /* UnionProperty */) { - var symbols = []; - var name_14 = symbol.name; - ts.forEach(getSymbolLinks(symbol).unionType.types, function (t) { - symbols.push(getPropertyOfType(t, name_14)); - }); - return symbols; - } - else if (symbol.flags & 67108864 /* Transient */) { - var target = getSymbolLinks(symbol).target; - if (target) { - return [target]; - } - } - return [symbol]; - } - // Emitter support - // When resolved as an expression identifier, if the given node references an exported entity, return the declaration - // node of the exported entity's container. Otherwise, return undefined. - function getReferencedExportContainer(node) { - var symbol = getReferencedValueSymbol(node); - if (symbol) { - if (symbol.flags & 1048576 /* ExportValue */) { - // If we reference an exported entity within the same module declaration, then whether - // we prefix depends on the kind of entity. SymbolFlags.ExportHasLocal encompasses all the - // kinds that we do NOT prefix. - var exportSymbol = getMergedSymbol(symbol.exportSymbol); - if (exportSymbol.flags & 944 /* ExportHasLocal */) { - return undefined; - } - symbol = exportSymbol; - } - var parentSymbol = getParentOfSymbol(symbol); - if (parentSymbol) { - if (parentSymbol.flags & 512 /* ValueModule */ && parentSymbol.valueDeclaration.kind === 230 /* SourceFile */) { - return parentSymbol.valueDeclaration; - } - for (var n = node.parent; n; n = n.parent) { - if ((n.kind === 208 /* ModuleDeclaration */ || n.kind === 207 /* EnumDeclaration */) && getSymbolOfNode(n) === parentSymbol) { - return n; - } - } - } - } - } - // When resolved as an expression identifier, if the given node references an import, return the declaration of - // that import. Otherwise, return undefined. - function getReferencedImportDeclaration(node) { - var symbol = getReferencedValueSymbol(node); - return symbol && symbol.flags & 8388608 /* Alias */ ? getDeclarationOfAliasSymbol(symbol) : undefined; - } - function isStatementWithLocals(node) { - switch (node.kind) { - case 182 /* Block */: - case 210 /* CaseBlock */: - case 189 /* ForStatement */: - case 190 /* ForInStatement */: - case 191 /* ForOfStatement */: - return true; - } - return false; - } - function isNestedRedeclarationSymbol(symbol) { - if (symbol.flags & 418 /* BlockScoped */) { - var links = getSymbolLinks(symbol); - if (links.isNestedRedeclaration === undefined) { - var container = ts.getEnclosingBlockScopeContainer(symbol.valueDeclaration); - links.isNestedRedeclaration = isStatementWithLocals(container) && - !!resolveName(container.parent, symbol.name, 107455 /* Value */, undefined, undefined); - } - return links.isNestedRedeclaration; - } - return false; - } - // When resolved as an expression identifier, if the given node references a nested block scoped entity with - // a name that hides an existing name, return the declaration of that entity. Otherwise, return undefined. - function getReferencedNestedRedeclaration(node) { - var symbol = getReferencedValueSymbol(node); - return symbol && isNestedRedeclarationSymbol(symbol) ? symbol.valueDeclaration : undefined; - } - // Return true if the given node is a declaration of a nested block scoped entity with a name that hides an - // existing name. - function isNestedRedeclaration(node) { - return isNestedRedeclarationSymbol(getSymbolOfNode(node)); - } - function isValueAliasDeclaration(node) { - switch (node.kind) { - case 211 /* ImportEqualsDeclaration */: - case 213 /* ImportClause */: - case 214 /* NamespaceImport */: - case 216 /* ImportSpecifier */: - case 220 /* ExportSpecifier */: - return isAliasResolvedToValue(getSymbolOfNode(node)); - case 218 /* ExportDeclaration */: - var exportClause = node.exportClause; - return exportClause && ts.forEach(exportClause.elements, isValueAliasDeclaration); - case 217 /* ExportAssignment */: - return node.expression && node.expression.kind === 65 /* Identifier */ ? isAliasResolvedToValue(getSymbolOfNode(node)) : true; - } - return false; - } - function isTopLevelValueImportEqualsWithEntityName(node) { - if (node.parent.kind !== 230 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) { - // parent is not source file or it is not reference to internal module - return false; - } - var isValue = isAliasResolvedToValue(getSymbolOfNode(node)); - return isValue && node.moduleReference && !ts.nodeIsMissing(node.moduleReference); - } - function isAliasResolvedToValue(symbol) { - var target = resolveAlias(symbol); - if (target === unknownSymbol && compilerOptions.isolatedModules) { - return true; - } - // const enums and modules that contain only const enums are not considered values from the emit perespective - return target !== unknownSymbol && target && target.flags & 107455 /* Value */ && !isConstEnumOrConstEnumOnlyModule(target); - } - function isConstEnumOrConstEnumOnlyModule(s) { - return isConstEnumSymbol(s) || s.constEnumOnlyModule; - } - function isReferencedAliasDeclaration(node, checkChildren) { - if (ts.isAliasSymbolDeclaration(node)) { - var symbol = getSymbolOfNode(node); - if (getSymbolLinks(symbol).referenced) { - return true; - } - } - if (checkChildren) { - return ts.forEachChild(node, function (node) { return isReferencedAliasDeclaration(node, checkChildren); }); - } - return false; - } - function isImplementationOfOverload(node) { - if (ts.nodeIsPresent(node.body)) { - var symbol = getSymbolOfNode(node); - var signaturesOfSymbol = getSignaturesOfSymbol(symbol); - // If this function body corresponds to function with multiple signature, it is implementation of overload - // e.g.: function foo(a: string): string; - // function foo(a: number): number; - // function foo(a: any) { // This is implementation of the overloads - // return a; - // } - return signaturesOfSymbol.length > 1 || - // If there is single signature for the symbol, it is overload if that signature isn't coming from the node - // e.g.: function foo(a: string): string; - // function foo(a: any) { // This is implementation of the overloads - // return a; - // } - (signaturesOfSymbol.length === 1 && signaturesOfSymbol[0].declaration !== node); - } - return false; - } - function getNodeCheckFlags(node) { - return getNodeLinks(node).flags; - } - function getEnumMemberValue(node) { - computeEnumMemberValues(node.parent); - return getNodeLinks(node).enumMemberValue; - } - function getConstantValue(node) { - if (node.kind === 229 /* EnumMember */) { - return getEnumMemberValue(node); - } - var symbol = getNodeLinks(node).resolvedSymbol; - if (symbol && (symbol.flags & 8 /* EnumMember */)) { - // inline property\index accesses only for const enums - if (ts.isConstEnumDeclaration(symbol.valueDeclaration.parent)) { - return getEnumMemberValue(symbol.valueDeclaration); - } - } - return undefined; - } - /** Serializes an EntityName (with substitutions) to an appropriate JS constructor value. Used by the __metadata decorator. */ - function serializeEntityName(node, fallbackPath) { - if (node.kind === 65 /* Identifier */) { - // TODO(ron.buckton): The getExpressionNameSubstitution function has been removed, but calling it - // here has no effect anyway as an identifier in a type name is not an expression. - // var substitution = getExpressionNameSubstitution(node, getGeneratedNameForNode); - // var text = substitution || (node).text; - var text = node.text; - if (fallbackPath) { - fallbackPath.push(text); - } - else { - return text; - } - } - else { - var left = serializeEntityName(node.left, fallbackPath); - var right = serializeEntityName(node.right, fallbackPath); - if (!fallbackPath) { - return left + "." + right; - } - } - } - /** Serializes a TypeReferenceNode to an appropriate JS constructor value. Used by the __metadata decorator. */ - function serializeTypeReferenceNode(node) { - // serialization of a TypeReferenceNode uses the following rules: - // - // * The serialized type of a TypeReference that is `void` is "void 0". - // * The serialized type of a TypeReference that is a `boolean` is "Boolean". - // * The serialized type of a TypeReference that is an enum or `number` is "Number". - // * The serialized type of a TypeReference that is a string literal or `string` is "String". - // * The serialized type of a TypeReference that is a tuple is "Array". - // * The serialized type of a TypeReference that is a `symbol` is "Symbol". - // * The serialized type of a TypeReference with a value declaration is its entity name. - // * The serialized type of a TypeReference with a call or construct signature is "Function". - // * The serialized type of any other type is "Object". - var type = getTypeFromTypeNode(node); - if (type.flags & 16 /* Void */) { - return "void 0"; - } - else if (type.flags & 8 /* Boolean */) { - return "Boolean"; - } - else if (type.flags & 132 /* NumberLike */) { - return "Number"; - } - else if (type.flags & 258 /* StringLike */) { - return "String"; - } - else if (type.flags & 8192 /* Tuple */) { - return "Array"; - } - else if (type.flags & 2097152 /* ESSymbol */) { - return "Symbol"; - } - else if (type === unknownType) { - var fallbackPath = []; - serializeEntityName(node.typeName, fallbackPath); - return fallbackPath; - } - else if (type.symbol && type.symbol.valueDeclaration) { - return serializeEntityName(node.typeName); - } - else if (typeHasCallOrConstructSignatures(type)) { - return "Function"; - } - return "Object"; - } - /** Serializes a TypeNode to an appropriate JS constructor value. Used by the __metadata decorator. */ - function serializeTypeNode(node) { - // serialization of a TypeNode uses the following rules: - // - // * The serialized type of `void` is "void 0" (undefined). - // * The serialized type of a parenthesized type is the serialized type of its nested type. - // * The serialized type of a Function or Constructor type is "Function". - // * The serialized type of an Array or Tuple type is "Array". - // * The serialized type of `boolean` is "Boolean". - // * The serialized type of `string` or a string-literal type is "String". - // * The serialized type of a type reference is handled by `serializeTypeReferenceNode`. - // * The serialized type of any other type node is "Object". - if (node) { - switch (node.kind) { - case 99 /* VoidKeyword */: - return "void 0"; - case 152 /* ParenthesizedType */: - return serializeTypeNode(node.type); - case 145 /* FunctionType */: - case 146 /* ConstructorType */: - return "Function"; - case 149 /* ArrayType */: - case 150 /* TupleType */: - return "Array"; - case 113 /* BooleanKeyword */: - return "Boolean"; - case 123 /* StringKeyword */: - case 8 /* StringLiteral */: - return "String"; - case 121 /* NumberKeyword */: - return "Number"; - case 144 /* TypeReference */: - return serializeTypeReferenceNode(node); - case 147 /* TypeQuery */: - case 148 /* TypeLiteral */: - case 151 /* UnionType */: - case 112 /* AnyKeyword */: - break; - default: - ts.Debug.fail("Cannot serialize unexpected type node."); - break; - } - } - return "Object"; - } - /** Serializes the type of a declaration to an appropriate JS constructor value. Used by the __metadata decorator for a class member. */ - function serializeTypeOfNode(node) { - // serialization of the type of a declaration uses the following rules: - // - // * The serialized type of a ClassDeclaration is "Function" - // * The serialized type of a ParameterDeclaration is the serialized type of its type annotation. - // * The serialized type of a PropertyDeclaration is the serialized type of its type annotation. - // * The serialized type of an AccessorDeclaration is the serialized type of the return type annotation of its getter or parameter type annotation of its setter. - // * The serialized type of any other FunctionLikeDeclaration is "Function". - // * The serialized type of any other node is "void 0". - // - // For rules on serializing type annotations, see `serializeTypeNode`. - switch (node.kind) { - case 204 /* ClassDeclaration */: return "Function"; - case 134 /* PropertyDeclaration */: return serializeTypeNode(node.type); - case 131 /* Parameter */: return serializeTypeNode(node.type); - case 138 /* GetAccessor */: return serializeTypeNode(node.type); - case 139 /* SetAccessor */: return serializeTypeNode(getSetAccessorTypeAnnotationNode(node)); - } - if (ts.isFunctionLike(node)) { - return "Function"; - } - return "void 0"; - } - /** Serializes the parameter types of a function or the constructor of a class. Used by the __metadata decorator for a method or set accessor. */ - function serializeParameterTypesOfNode(node) { - // serialization of parameter types uses the following rules: - // - // * If the declaration is a class, the parameters of the first constructor with a body are used. - // * If the declaration is function-like and has a body, the parameters of the function are used. - // - // For the rules on serializing the type of each parameter declaration, see `serializeTypeOfDeclaration`. - if (node) { - var valueDeclaration; - if (node.kind === 204 /* ClassDeclaration */) { - valueDeclaration = ts.getFirstConstructorWithBody(node); - } - else if (ts.isFunctionLike(node) && ts.nodeIsPresent(node.body)) { - valueDeclaration = node; - } - if (valueDeclaration) { - var result; - var parameters = valueDeclaration.parameters; - var parameterCount = parameters.length; - if (parameterCount > 0) { - result = new Array(parameterCount); - for (var i = 0; i < parameterCount; i++) { - if (parameters[i].dotDotDotToken) { - var parameterType = parameters[i].type; - if (parameterType.kind === 149 /* ArrayType */) { - parameterType = parameterType.elementType; - } - else if (parameterType.kind === 144 /* TypeReference */ && parameterType.typeArguments && parameterType.typeArguments.length === 1) { - parameterType = parameterType.typeArguments[0]; - } - else { - parameterType = undefined; - } - result[i] = serializeTypeNode(parameterType); - } - else { - result[i] = serializeTypeOfNode(parameters[i]); - } - } - return result; - } - } - } - return emptyArray; - } - /** Serializes the return type of function. Used by the __metadata decorator for a method. */ - function serializeReturnTypeOfNode(node) { - if (node && ts.isFunctionLike(node)) { - return serializeTypeNode(node.type); - } - return "void 0"; - } - function writeTypeOfDeclaration(declaration, enclosingDeclaration, flags, writer) { - // Get type of the symbol if this is the valid symbol otherwise get type at location - var symbol = getSymbolOfNode(declaration); - var type = symbol && !(symbol.flags & (2048 /* TypeLiteral */ | 131072 /* Signature */)) - ? getTypeOfSymbol(symbol) - : unknownType; - getSymbolDisplayBuilder().buildTypeDisplay(type, writer, enclosingDeclaration, flags); - } - function writeReturnTypeOfSignatureDeclaration(signatureDeclaration, enclosingDeclaration, flags, writer) { - var signature = getSignatureFromDeclaration(signatureDeclaration); - getSymbolDisplayBuilder().buildTypeDisplay(getReturnTypeOfSignature(signature), writer, enclosingDeclaration, flags); - } - function writeTypeOfExpression(expr, enclosingDeclaration, flags, writer) { - var type = getTypeOfExpression(expr); - getSymbolDisplayBuilder().buildTypeDisplay(type, writer, enclosingDeclaration, flags); - } - function hasGlobalName(name) { - return ts.hasProperty(globals, name); - } - function getReferencedValueSymbol(reference) { - return getNodeLinks(reference).resolvedSymbol || - resolveName(reference, reference.text, 107455 /* Value */ | 1048576 /* ExportValue */ | 8388608 /* Alias */, - /*nodeNotFoundMessage*/ undefined, undefined); - } - function getReferencedValueDeclaration(reference) { - ts.Debug.assert(!ts.nodeIsSynthesized(reference)); - var symbol = getReferencedValueSymbol(reference); - return symbol && getExportSymbolOfValueSymbolIfExported(symbol).valueDeclaration; - } - function getBlockScopedVariableId(n) { - ts.Debug.assert(!ts.nodeIsSynthesized(n)); - var isVariableDeclarationOrBindingElement = n.parent.kind === 155 /* BindingElement */ || (n.parent.kind === 201 /* VariableDeclaration */ && n.parent.name === n); - var symbol = (isVariableDeclarationOrBindingElement ? getSymbolOfNode(n.parent) : undefined) || - getNodeLinks(n).resolvedSymbol || - resolveName(n, n.text, 107455 /* Value */ | 8388608 /* Alias */, undefined, undefined); - var isLetOrConst = symbol && - (symbol.flags & 2 /* BlockScopedVariable */) && - symbol.valueDeclaration.parent.kind !== 226 /* CatchClause */; - if (isLetOrConst) { - // side-effect of calling this method: - // assign id to symbol if it was not yet set - getSymbolLinks(symbol); - return symbol.id; - } - return undefined; - } - function instantiateSingleCallFunctionType(functionType, typeArguments) { - if (functionType === unknownType) { - return unknownType; - } - var signature = getSingleCallSignature(functionType); - if (!signature) { - return unknownType; - } - var instantiatedSignature = getSignatureInstantiation(signature, typeArguments); - return getOrCreateTypeFromSignature(instantiatedSignature); - } - function createResolver() { - return { - getReferencedExportContainer: getReferencedExportContainer, - getReferencedImportDeclaration: getReferencedImportDeclaration, - getReferencedNestedRedeclaration: getReferencedNestedRedeclaration, - isNestedRedeclaration: isNestedRedeclaration, - isValueAliasDeclaration: isValueAliasDeclaration, - hasGlobalName: hasGlobalName, - isReferencedAliasDeclaration: isReferencedAliasDeclaration, - getNodeCheckFlags: getNodeCheckFlags, - isTopLevelValueImportEqualsWithEntityName: isTopLevelValueImportEqualsWithEntityName, - isDeclarationVisible: isDeclarationVisible, - isImplementationOfOverload: isImplementationOfOverload, - writeTypeOfDeclaration: writeTypeOfDeclaration, - writeReturnTypeOfSignatureDeclaration: writeReturnTypeOfSignatureDeclaration, - writeTypeOfExpression: writeTypeOfExpression, - isSymbolAccessible: isSymbolAccessible, - isEntityNameVisible: isEntityNameVisible, - getConstantValue: getConstantValue, - collectLinkedAliases: collectLinkedAliases, - getBlockScopedVariableId: getBlockScopedVariableId, - getReferencedValueDeclaration: getReferencedValueDeclaration, - serializeTypeOfNode: serializeTypeOfNode, - serializeParameterTypesOfNode: serializeParameterTypesOfNode, - serializeReturnTypeOfNode: serializeReturnTypeOfNode - }; - } - function initializeTypeChecker() { - // Bind all source files and propagate errors - ts.forEach(host.getSourceFiles(), function (file) { - ts.bindSourceFile(file); - }); - // Initialize global symbol table - ts.forEach(host.getSourceFiles(), function (file) { - if (!ts.isExternalModule(file)) { - mergeSymbolTable(globals, file.locals); - } - }); - // Initialize special symbols - getSymbolLinks(undefinedSymbol).type = undefinedType; - getSymbolLinks(argumentsSymbol).type = getGlobalType("IArguments"); - getSymbolLinks(unknownSymbol).type = unknownType; - globals[undefinedSymbol.name] = undefinedSymbol; - // Initialize special types - globalArrayType = getGlobalType("Array", 1); - globalObjectType = getGlobalType("Object"); - globalFunctionType = getGlobalType("Function"); - globalStringType = getGlobalType("String"); - globalNumberType = getGlobalType("Number"); - globalBooleanType = getGlobalType("Boolean"); - globalRegExpType = getGlobalType("RegExp"); - getGlobalClassDecoratorType = ts.memoize(function () { return getGlobalType("ClassDecorator"); }); - getGlobalPropertyDecoratorType = ts.memoize(function () { return getGlobalType("PropertyDecorator"); }); - getGlobalMethodDecoratorType = ts.memoize(function () { return getGlobalType("MethodDecorator"); }); - getGlobalParameterDecoratorType = ts.memoize(function () { return getGlobalType("ParameterDecorator"); }); - // If we're in ES6 mode, load the TemplateStringsArray. - // Otherwise, default to 'unknown' for the purposes of type checking in LS scenarios. - if (languageVersion >= 2 /* ES6 */) { - globalTemplateStringsArrayType = getGlobalType("TemplateStringsArray"); - globalESSymbolType = getGlobalType("Symbol"); - globalESSymbolConstructorSymbol = getGlobalValueSymbol("Symbol"); - globalIterableType = getGlobalType("Iterable", 1); - globalIteratorType = getGlobalType("Iterator", 1); - globalIterableIteratorType = getGlobalType("IterableIterator", 1); - } - else { - globalTemplateStringsArrayType = unknownType; - // Consider putting Symbol interface in lib.d.ts. On the plus side, putting it in lib.d.ts would make it - // extensible for Polyfilling Symbols. But putting it into lib.d.ts could also break users that have - // a global Symbol already, particularly if it is a class. - globalESSymbolType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); - globalESSymbolConstructorSymbol = undefined; - globalIterableType = emptyGenericType; - globalIteratorType = emptyGenericType; - globalIterableIteratorType = emptyGenericType; - } - anyArrayType = createArrayType(anyType); - } - // GRAMMAR CHECKING - function isReservedWordInStrictMode(node) { - // Check that originalKeywordKind is less than LastFutureReservedWord to see if an Identifier is a strict-mode reserved word - return (node.parserContextFlags & 1 /* StrictMode */) && - (102 /* FirstFutureReservedWord */ <= node.originalKeywordKind && node.originalKeywordKind <= 110 /* LastFutureReservedWord */); - } - function reportStrictModeGrammarErrorInClassDeclaration(identifier, message, arg0, arg1, arg2) { - // We are checking if this name is inside class declaration or class expression (which are under class definitions inside ES6 spec.) - // if so, we would like to give more explicit invalid usage error. - if (ts.getAncestor(identifier, 204 /* ClassDeclaration */) || ts.getAncestor(identifier, 177 /* ClassExpression */)) { - return grammarErrorOnNode(identifier, message, arg0); - } - return false; - } - function checkGrammarImportDeclarationNameInStrictMode(node) { - // Check if the import declaration used strict-mode reserved word in its names bindings - if (node.importClause) { - var impotClause = node.importClause; - if (impotClause.namedBindings) { - var nameBindings = impotClause.namedBindings; - if (nameBindings.kind === 214 /* NamespaceImport */) { - var name_15 = nameBindings.name; - if (isReservedWordInStrictMode(name_15)) { - var nameText = ts.declarationNameToString(name_15); - return grammarErrorOnNode(name_15, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText); - } - } - else if (nameBindings.kind === 215 /* NamedImports */) { - var reportError = false; - for (var _i = 0, _a = nameBindings.elements; _i < _a.length; _i++) { - var element = _a[_i]; - var name_16 = element.name; - if (isReservedWordInStrictMode(name_16)) { - var nameText = ts.declarationNameToString(name_16); - reportError = reportError || grammarErrorOnNode(name_16, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText); - } - } - return reportError; - } - } - } - return false; - } - function checkGrammarDeclarationNameInStrictMode(node) { - var name = node.name; - if (name && name.kind === 65 /* Identifier */ && isReservedWordInStrictMode(name)) { - var nameText = ts.declarationNameToString(name); - switch (node.kind) { - case 131 /* Parameter */: - case 201 /* VariableDeclaration */: - case 203 /* FunctionDeclaration */: - case 130 /* TypeParameter */: - case 155 /* BindingElement */: - case 205 /* InterfaceDeclaration */: - case 206 /* TypeAliasDeclaration */: - case 207 /* EnumDeclaration */: - return checkGrammarIdentifierInStrictMode(name); - case 204 /* ClassDeclaration */: - // Report an error if the class declaration uses strict-mode reserved word. - return grammarErrorOnNode(name, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode, nameText); - case 208 /* ModuleDeclaration */: - // Report an error if the module declaration uses strict-mode reserved word. - // TODO(yuisu): fix this when having external module in strict mode - return grammarErrorOnNode(name, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText); - case 211 /* ImportEqualsDeclaration */: - // TODO(yuisu): fix this when having external module in strict mode - return grammarErrorOnNode(name, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText); - } - } - return false; - } - function checkGrammarTypeReferenceInStrictMode(typeName) { - // Check if the type reference is using strict mode keyword - // Example: - // class C { - // foo(x: public){} // Error. - // } - if (typeName.kind === 65 /* Identifier */) { - checkGrammarTypeNameInStrictMode(typeName); - } - else if (typeName.kind === 128 /* QualifiedName */) { - // Walk from right to left and report a possible error at each Identifier in QualifiedName - // Example: - // x1: public.private.package // error at public and private - checkGrammarTypeNameInStrictMode(typeName.right); - checkGrammarTypeReferenceInStrictMode(typeName.left); - } - } - // This function will report an error for every identifier in property access expression - // whether it violates strict mode reserved words. - // Example: - // public // error at public - // public.private.package // error at public - // B.private.B // no error - function checkGrammarExpressionWithTypeArgumentsInStrictMode(expression) { - // Example: - // class C extends public // error at public - if (expression && expression.kind === 65 /* Identifier */) { - return checkGrammarIdentifierInStrictMode(expression); - } - else if (expression && expression.kind === 158 /* PropertyAccessExpression */) { - // Walk from left to right in PropertyAccessExpression until we are at the left most expression - // in PropertyAccessExpression. According to grammar production of MemberExpression, - // the left component expression is a PrimaryExpression (i.e. Identifier) while the other - // component after dots can be IdentifierName. - checkGrammarExpressionWithTypeArgumentsInStrictMode(expression.expression); - } - } - // The function takes an identifier itself or an expression which has SyntaxKind.Identifier. - function checkGrammarIdentifierInStrictMode(node, nameText) { - if (node && node.kind === 65 /* Identifier */ && isReservedWordInStrictMode(node)) { - if (!nameText) { - nameText = ts.declarationNameToString(node); - } - // TODO (yuisu): Fix when module is a strict mode - var errorReport = reportStrictModeGrammarErrorInClassDeclaration(node, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode, nameText) || - grammarErrorOnNode(node, ts.Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode, nameText); - return errorReport; - } - return false; - } - // The function takes an identifier when uses as a typeName in TypeReferenceNode - function checkGrammarTypeNameInStrictMode(node) { - if (node && node.kind === 65 /* Identifier */ && isReservedWordInStrictMode(node)) { - var nameText = ts.declarationNameToString(node); - // TODO (yuisu): Fix when module is a strict mode - var errorReport = reportStrictModeGrammarErrorInClassDeclaration(node, ts.Diagnostics.Type_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode, nameText) || - grammarErrorOnNode(node, ts.Diagnostics.Type_expected_0_is_a_reserved_word_in_strict_mode, nameText); - return errorReport; - } - return false; - } - function checkGrammarDecorators(node) { - if (!node.decorators) { - return false; - } - if (!ts.nodeCanBeDecorated(node)) { - return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_are_not_valid_here); - } - else if (languageVersion < 1 /* ES5 */) { - return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_are_only_available_when_targeting_ECMAScript_5_and_higher); - } - else if (node.kind === 138 /* GetAccessor */ || node.kind === 139 /* SetAccessor */) { - var accessors = ts.getAllAccessorDeclarations(node.parent.members, node); - if (accessors.firstAccessor.decorators && node === accessors.secondAccessor) { - return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name); - } - } - return false; - } - function checkGrammarModifiers(node) { - switch (node.kind) { - case 138 /* GetAccessor */: - case 139 /* SetAccessor */: - case 137 /* Constructor */: - case 134 /* PropertyDeclaration */: - case 133 /* PropertySignature */: - case 136 /* MethodDeclaration */: - case 135 /* MethodSignature */: - case 142 /* IndexSignature */: - case 208 /* ModuleDeclaration */: - case 212 /* ImportDeclaration */: - case 211 /* ImportEqualsDeclaration */: - case 218 /* ExportDeclaration */: - case 217 /* ExportAssignment */: - case 131 /* Parameter */: - break; - case 204 /* ClassDeclaration */: - case 205 /* InterfaceDeclaration */: - case 183 /* VariableStatement */: - case 203 /* FunctionDeclaration */: - case 206 /* TypeAliasDeclaration */: - if (node.modifiers && node.parent.kind !== 209 /* ModuleBlock */ && node.parent.kind !== 230 /* SourceFile */) { - return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); - } - break; - case 207 /* EnumDeclaration */: - if (node.modifiers && (node.modifiers.length > 1 || node.modifiers[0].kind !== 70 /* ConstKeyword */) && - node.parent.kind !== 209 /* ModuleBlock */ && node.parent.kind !== 230 /* SourceFile */) { - return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); - } - break; - default: - return false; - } - if (!node.modifiers) { - return; - } - var lastStatic, lastPrivate, lastProtected, lastDeclare; - var flags = 0; - for (var _i = 0, _a = node.modifiers; _i < _a.length; _i++) { - var modifier = _a[_i]; - switch (modifier.kind) { - case 108 /* PublicKeyword */: - case 107 /* ProtectedKeyword */: - case 106 /* PrivateKeyword */: - var text = void 0; - if (modifier.kind === 108 /* PublicKeyword */) { - text = "public"; - } - else if (modifier.kind === 107 /* ProtectedKeyword */) { - text = "protected"; - lastProtected = modifier; - } - else { - text = "private"; - lastPrivate = modifier; - } - if (flags & 112 /* AccessibilityModifier */) { - return grammarErrorOnNode(modifier, ts.Diagnostics.Accessibility_modifier_already_seen); - } - else if (flags & 128 /* Static */) { - return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, "static"); - } - else if (node.parent.kind === 209 /* ModuleBlock */ || node.parent.kind === 230 /* SourceFile */) { - return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, text); - } - flags |= ts.modifierToFlag(modifier.kind); - break; - case 109 /* StaticKeyword */: - if (flags & 128 /* Static */) { - return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "static"); - } - else if (node.parent.kind === 209 /* ModuleBlock */ || node.parent.kind === 230 /* SourceFile */) { - return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_element, "static"); - } - else if (node.kind === 131 /* Parameter */) { - return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); - } - flags |= 128 /* Static */; - lastStatic = modifier; - break; - case 78 /* ExportKeyword */: - if (flags & 1 /* Export */) { - return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "export"); - } - else if (flags & 2 /* Ambient */) { - return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "export", "declare"); - } - else if (node.parent.kind === 204 /* ClassDeclaration */) { - return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); - } - else if (node.kind === 131 /* Parameter */) { - return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); - } - flags |= 1 /* Export */; - break; - case 115 /* DeclareKeyword */: - if (flags & 2 /* Ambient */) { - return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "declare"); - } - else if (node.parent.kind === 204 /* ClassDeclaration */) { - return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); - } - else if (node.kind === 131 /* Parameter */) { - return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); - } - else if (ts.isInAmbientContext(node.parent) && node.parent.kind === 209 /* ModuleBlock */) { - return grammarErrorOnNode(modifier, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); - } - flags |= 2 /* Ambient */; - lastDeclare = modifier; - break; - } - } - if (node.kind === 137 /* Constructor */) { - if (flags & 128 /* Static */) { - return grammarErrorOnNode(lastStatic, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); - } - else if (flags & 64 /* Protected */) { - return grammarErrorOnNode(lastProtected, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "protected"); - } - else if (flags & 32 /* Private */) { - return grammarErrorOnNode(lastPrivate, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "private"); - } - } - else if ((node.kind === 212 /* ImportDeclaration */ || node.kind === 211 /* ImportEqualsDeclaration */) && flags & 2 /* Ambient */) { - return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_declare_modifier_cannot_be_used_with_an_import_declaration, "declare"); - } - else if (node.kind === 131 /* Parameter */ && (flags & 112 /* AccessibilityModifier */) && ts.isBindingPattern(node.name)) { - return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_may_not_be_a_binding_pattern); - } - } - function checkGrammarForDisallowedTrailingComma(list) { - if (list && list.hasTrailingComma) { - var start = list.end - ",".length; - var end = list.end; - var sourceFile = ts.getSourceFileOfNode(list[0]); - return grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.Trailing_comma_not_allowed); - } - } - function checkGrammarTypeParameterList(node, typeParameters, file) { - if (checkGrammarForDisallowedTrailingComma(typeParameters)) { - return true; - } - if (typeParameters && typeParameters.length === 0) { - var start = typeParameters.pos - "<".length; - var end = ts.skipTrivia(file.text, typeParameters.end) + ">".length; - return grammarErrorAtPos(file, start, end - start, ts.Diagnostics.Type_parameter_list_cannot_be_empty); - } - } - function checkGrammarParameterList(parameters) { - if (checkGrammarForDisallowedTrailingComma(parameters)) { - return true; - } - var seenOptionalParameter = false; - var parameterCount = parameters.length; - for (var i = 0; i < parameterCount; i++) { - var parameter = parameters[i]; - if (parameter.dotDotDotToken) { - if (i !== (parameterCount - 1)) { - return grammarErrorOnNode(parameter.dotDotDotToken, ts.Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list); - } - if (ts.isBindingPattern(parameter.name)) { - return grammarErrorOnNode(parameter.name, ts.Diagnostics.A_rest_element_cannot_contain_a_binding_pattern); - } - if (parameter.questionToken) { - return grammarErrorOnNode(parameter.questionToken, ts.Diagnostics.A_rest_parameter_cannot_be_optional); - } - if (parameter.initializer) { - return grammarErrorOnNode(parameter.name, ts.Diagnostics.A_rest_parameter_cannot_have_an_initializer); - } - } - else if (parameter.questionToken || parameter.initializer) { - seenOptionalParameter = true; - if (parameter.questionToken && parameter.initializer) { - return grammarErrorOnNode(parameter.name, ts.Diagnostics.Parameter_cannot_have_question_mark_and_initializer); - } - } - else { - if (seenOptionalParameter) { - return grammarErrorOnNode(parameter.name, ts.Diagnostics.A_required_parameter_cannot_follow_an_optional_parameter); - } - } - } - } - function checkGrammarFunctionLikeDeclaration(node) { - // Prevent cascading error by short-circuit - var file = ts.getSourceFileOfNode(node); - return checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarTypeParameterList(node, node.typeParameters, file) || - checkGrammarParameterList(node.parameters) || checkGrammarArrowFunction(node, file); - } - function checkGrammarArrowFunction(node, file) { - if (node.kind === 166 /* ArrowFunction */) { - var arrowFunction = node; - var startLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.pos).line; - var endLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.end).line; - if (startLine !== endLine) { - return grammarErrorOnNode(arrowFunction.equalsGreaterThanToken, ts.Diagnostics.Line_terminator_not_permitted_before_arrow); - } - } - return false; - } - function checkGrammarIndexSignatureParameters(node) { - var parameter = node.parameters[0]; - if (node.parameters.length !== 1) { - if (parameter) { - return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_must_have_exactly_one_parameter); - } - else { - return grammarErrorOnNode(node, ts.Diagnostics.An_index_signature_must_have_exactly_one_parameter); - } - } - if (parameter.dotDotDotToken) { - return grammarErrorOnNode(parameter.dotDotDotToken, ts.Diagnostics.An_index_signature_cannot_have_a_rest_parameter); - } - if (parameter.flags & 499 /* Modifier */) { - return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_cannot_have_an_accessibility_modifier); - } - if (parameter.questionToken) { - return grammarErrorOnNode(parameter.questionToken, ts.Diagnostics.An_index_signature_parameter_cannot_have_a_question_mark); - } - if (parameter.initializer) { - return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_cannot_have_an_initializer); - } - if (!parameter.type) { - return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_must_have_a_type_annotation); - } - if (parameter.type.kind !== 123 /* StringKeyword */ && parameter.type.kind !== 121 /* NumberKeyword */) { - return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_must_be_string_or_number); - } - if (!node.type) { - return grammarErrorOnNode(node, ts.Diagnostics.An_index_signature_must_have_a_type_annotation); - } - } - function checkGrammarForIndexSignatureModifier(node) { - if (node.flags & 499 /* Modifier */) { - grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_not_permitted_on_index_signature_members); - } - } - function checkGrammarIndexSignature(node) { - // Prevent cascading error by short-circuit - return checkGrammarDecorators(node) || checkGrammarModifiers(node) || checkGrammarIndexSignatureParameters(node) || checkGrammarForIndexSignatureModifier(node); - } - function checkGrammarForAtLeastOneTypeArgument(node, typeArguments) { - if (typeArguments && typeArguments.length === 0) { - var sourceFile = ts.getSourceFileOfNode(node); - var start = typeArguments.pos - "<".length; - var end = ts.skipTrivia(sourceFile.text, typeArguments.end) + ">".length; - return grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.Type_argument_list_cannot_be_empty); - } - } - function checkGrammarTypeArguments(node, typeArguments) { - return checkGrammarForDisallowedTrailingComma(typeArguments) || - checkGrammarForAtLeastOneTypeArgument(node, typeArguments); - } - function checkGrammarForOmittedArgument(node, arguments) { - if (arguments) { - var sourceFile = ts.getSourceFileOfNode(node); - for (var _i = 0; _i < arguments.length; _i++) { - var arg = arguments[_i]; - if (arg.kind === 178 /* OmittedExpression */) { - return grammarErrorAtPos(sourceFile, arg.pos, 0, ts.Diagnostics.Argument_expression_expected); - } - } - } - } - function checkGrammarArguments(node, arguments) { - return checkGrammarForDisallowedTrailingComma(arguments) || - checkGrammarForOmittedArgument(node, arguments); - } - function checkGrammarHeritageClause(node) { - var types = node.types; - if (checkGrammarForDisallowedTrailingComma(types)) { - return true; - } - if (types && types.length === 0) { - var listType = ts.tokenToString(node.token); - var sourceFile = ts.getSourceFileOfNode(node); - return grammarErrorAtPos(sourceFile, types.pos, 0, ts.Diagnostics._0_list_cannot_be_empty, listType); - } - } - function checkGrammarClassDeclarationHeritageClauses(node) { - var seenExtendsClause = false; - var seenImplementsClause = false; - if (!checkGrammarDecorators(node) && !checkGrammarModifiers(node) && node.heritageClauses) { - for (var _i = 0, _a = node.heritageClauses; _i < _a.length; _i++) { - var heritageClause = _a[_i]; - if (heritageClause.token === 79 /* ExtendsKeyword */) { - if (seenExtendsClause) { - return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.extends_clause_already_seen); - } - if (seenImplementsClause) { - return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.extends_clause_must_precede_implements_clause); - } - if (heritageClause.types.length > 1) { - return grammarErrorOnFirstToken(heritageClause.types[1], ts.Diagnostics.Classes_can_only_extend_a_single_class); - } - seenExtendsClause = true; - } - else { - ts.Debug.assert(heritageClause.token === 102 /* ImplementsKeyword */); - if (seenImplementsClause) { - return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.implements_clause_already_seen); - } - seenImplementsClause = true; - } - // Grammar checking heritageClause inside class declaration - checkGrammarHeritageClause(heritageClause); - } - } - } - function checkGrammarInterfaceDeclaration(node) { - var seenExtendsClause = false; - if (node.heritageClauses) { - for (var _i = 0, _a = node.heritageClauses; _i < _a.length; _i++) { - var heritageClause = _a[_i]; - if (heritageClause.token === 79 /* ExtendsKeyword */) { - if (seenExtendsClause) { - return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.extends_clause_already_seen); - } - seenExtendsClause = true; - } - else { - ts.Debug.assert(heritageClause.token === 102 /* ImplementsKeyword */); - return grammarErrorOnFirstToken(heritageClause, ts.Diagnostics.Interface_declaration_cannot_have_implements_clause); - } - // Grammar checking heritageClause inside class declaration - checkGrammarHeritageClause(heritageClause); - } - } - return false; - } - function checkGrammarComputedPropertyName(node) { - // If node is not a computedPropertyName, just skip the grammar checking - if (node.kind !== 129 /* ComputedPropertyName */) { - return false; - } - var computedPropertyName = node; - if (computedPropertyName.expression.kind === 172 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 23 /* CommaToken */) { - return grammarErrorOnNode(computedPropertyName.expression, ts.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name); - } - } - function checkGrammarForGenerator(node) { - if (node.asteriskToken) { - ts.Debug.assert(node.kind === 203 /* FunctionDeclaration */ || - node.kind === 165 /* FunctionExpression */ || - node.kind === 136 /* MethodDeclaration */); - if (ts.isInAmbientContext(node)) { - return grammarErrorOnNode(node.asteriskToken, ts.Diagnostics.Generators_are_not_allowed_in_an_ambient_context); - } - if (!node.body) { - return grammarErrorOnNode(node.asteriskToken, ts.Diagnostics.An_overload_signature_cannot_be_declared_as_a_generator); - } - if (languageVersion < 2 /* ES6 */) { - return grammarErrorOnNode(node.asteriskToken, ts.Diagnostics.Generators_are_only_available_when_targeting_ECMAScript_6_or_higher); - } - } - } - function checkGrammarFunctionName(name) { - // It is a SyntaxError if the identifier eval or arguments appears within a FormalParameterList of a strict mode FunctionDeclaration or FunctionExpression (13.1)) - return checkGrammarEvalOrArgumentsInStrictMode(name, name); - } - function checkGrammarForInvalidQuestionMark(node, questionToken, message) { - if (questionToken) { - return grammarErrorOnNode(questionToken, message); - } - } - function checkGrammarObjectLiteralExpression(node) { - var seen = {}; - var Property = 1; - var GetAccessor = 2; - var SetAccesor = 4; - var GetOrSetAccessor = GetAccessor | SetAccesor; - var inStrictMode = (node.parserContextFlags & 1 /* StrictMode */) !== 0; - for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { - var prop = _a[_i]; - var name_17 = prop.name; - if (prop.kind === 178 /* OmittedExpression */ || - name_17.kind === 129 /* ComputedPropertyName */) { - // If the name is not a ComputedPropertyName, the grammar checking will skip it - checkGrammarComputedPropertyName(name_17); - continue; - } - // ECMA-262 11.1.5 Object Initialiser - // If previous is not undefined then throw a SyntaxError exception if any of the following conditions are true - // a.This production is contained in strict code and IsDataDescriptor(previous) is true and - // IsDataDescriptor(propId.descriptor) is true. - // b.IsDataDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true. - // c.IsAccessorDescriptor(previous) is true and IsDataDescriptor(propId.descriptor) is true. - // d.IsAccessorDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true - // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields - var currentKind = void 0; - if (prop.kind === 227 /* PropertyAssignment */ || prop.kind === 228 /* ShorthandPropertyAssignment */) { - // Grammar checking for computedPropertName and shorthandPropertyAssignment - checkGrammarForInvalidQuestionMark(prop, prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional); - if (name_17.kind === 7 /* NumericLiteral */) { - checkGrammarNumericLiteral(name_17); - } - currentKind = Property; - } - else if (prop.kind === 136 /* MethodDeclaration */) { - currentKind = Property; - } - else if (prop.kind === 138 /* GetAccessor */) { - currentKind = GetAccessor; - } - else if (prop.kind === 139 /* SetAccessor */) { - currentKind = SetAccesor; - } - else { - ts.Debug.fail("Unexpected syntax kind:" + prop.kind); - } - if (!ts.hasProperty(seen, name_17.text)) { - seen[name_17.text] = currentKind; - } - else { - var existingKind = seen[name_17.text]; - if (currentKind === Property && existingKind === Property) { - if (inStrictMode) { - grammarErrorOnNode(name_17, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode); - } - } - else if ((currentKind & GetOrSetAccessor) && (existingKind & GetOrSetAccessor)) { - if (existingKind !== GetOrSetAccessor && currentKind !== existingKind) { - seen[name_17.text] = currentKind | existingKind; - } - else { - return grammarErrorOnNode(name_17, ts.Diagnostics.An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name); - } - } - else { - return grammarErrorOnNode(name_17, ts.Diagnostics.An_object_literal_cannot_have_property_and_accessor_with_the_same_name); - } - } - } - } - function checkGrammarForInOrForOfStatement(forInOrOfStatement) { - if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) { - return true; - } - if (forInOrOfStatement.initializer.kind === 202 /* VariableDeclarationList */) { - var variableList = forInOrOfStatement.initializer; - if (!checkGrammarVariableDeclarationList(variableList)) { - if (variableList.declarations.length > 1) { - var diagnostic = forInOrOfStatement.kind === 190 /* ForInStatement */ - ? ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement - : ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement; - return grammarErrorOnFirstToken(variableList.declarations[1], diagnostic); - } - var firstDeclaration = variableList.declarations[0]; - if (firstDeclaration.initializer) { - var diagnostic = forInOrOfStatement.kind === 190 /* ForInStatement */ - ? ts.Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer - : ts.Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer; - return grammarErrorOnNode(firstDeclaration.name, diagnostic); - } - if (firstDeclaration.type) { - var diagnostic = forInOrOfStatement.kind === 190 /* ForInStatement */ - ? ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation - : ts.Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation; - return grammarErrorOnNode(firstDeclaration, diagnostic); - } - } - } - return false; - } - function checkGrammarAccessor(accessor) { - var kind = accessor.kind; - if (languageVersion < 1 /* ES5 */) { - return grammarErrorOnNode(accessor.name, ts.Diagnostics.Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher); - } - else if (ts.isInAmbientContext(accessor)) { - return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_be_declared_in_an_ambient_context); - } - else if (accessor.body === undefined) { - return grammarErrorAtPos(ts.getSourceFileOfNode(accessor), accessor.end - 1, ";".length, ts.Diagnostics._0_expected, "{"); - } - else if (accessor.typeParameters) { - return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters); - } - else if (kind === 138 /* GetAccessor */ && accessor.parameters.length) { - return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_get_accessor_cannot_have_parameters); - } - else if (kind === 139 /* SetAccessor */) { - if (accessor.type) { - return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); - } - else if (accessor.parameters.length !== 1) { - return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter); - } - else { - var parameter = accessor.parameters[0]; - if (parameter.dotDotDotToken) { - return grammarErrorOnNode(parameter.dotDotDotToken, ts.Diagnostics.A_set_accessor_cannot_have_rest_parameter); - } - else if (parameter.flags & 499 /* Modifier */) { - return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); - } - else if (parameter.questionToken) { - return grammarErrorOnNode(parameter.questionToken, ts.Diagnostics.A_set_accessor_cannot_have_an_optional_parameter); - } - else if (parameter.initializer) { - return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_parameter_cannot_have_an_initializer); - } - } - } - } - function checkGrammarForNonSymbolComputedProperty(node, message) { - if (node.kind === 129 /* ComputedPropertyName */ && !ts.isWellKnownSymbolSyntactically(node.expression)) { - return grammarErrorOnNode(node, message); - } - } - function checkGrammarMethod(node) { - if (checkGrammarDisallowedModifiersInBlockOrObjectLiteralExpression(node) || - checkGrammarFunctionLikeDeclaration(node) || - checkGrammarForGenerator(node)) { - return true; - } - if (node.parent.kind === 157 /* ObjectLiteralExpression */) { - if (checkGrammarForInvalidQuestionMark(node, node.questionToken, ts.Diagnostics.A_class_member_cannot_be_declared_optional)) { - return true; - } - else if (node.body === undefined) { - return grammarErrorAtPos(getSourceFile(node), node.end - 1, ";".length, ts.Diagnostics._0_expected, "{"); - } - } - if (node.parent.kind === 204 /* ClassDeclaration */) { - if (checkGrammarForInvalidQuestionMark(node, node.questionToken, ts.Diagnostics.A_class_member_cannot_be_declared_optional)) { - return true; - } - // Technically, computed properties in ambient contexts is disallowed - // for property declarations and accessors too, not just methods. - // However, property declarations disallow computed names in general, - // and accessors are not allowed in ambient contexts in general, - // so this error only really matters for methods. - if (ts.isInAmbientContext(node)) { - return checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_an_ambient_context_must_directly_refer_to_a_built_in_symbol); - } - else if (!node.body) { - return checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_method_overload_must_directly_refer_to_a_built_in_symbol); - } - } - else if (node.parent.kind === 205 /* InterfaceDeclaration */) { - return checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol); - } - else if (node.parent.kind === 148 /* TypeLiteral */) { - return checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol); - } - } - function isIterationStatement(node, lookInLabeledStatements) { - switch (node.kind) { - case 189 /* ForStatement */: - case 190 /* ForInStatement */: - case 191 /* ForOfStatement */: - case 187 /* DoStatement */: - case 188 /* WhileStatement */: - return true; - case 197 /* LabeledStatement */: - return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements); - } - return false; - } - function checkGrammarBreakOrContinueStatement(node) { - var current = node; - while (current) { - if (ts.isFunctionLike(current)) { - return grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); - } - switch (current.kind) { - case 197 /* LabeledStatement */: - if (node.label && current.label.text === node.label.text) { - // found matching label - verify that label usage is correct - // continue can only target labels that are on iteration statements - var isMisplacedContinueLabel = node.kind === 192 /* ContinueStatement */ - && !isIterationStatement(current.statement, true); - if (isMisplacedContinueLabel) { - return grammarErrorOnNode(node, ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement); - } - return false; - } - break; - case 196 /* SwitchStatement */: - if (node.kind === 193 /* BreakStatement */ && !node.label) { - // unlabeled break within switch statement - ok - return false; - } - break; - default: - if (isIterationStatement(current, false) && !node.label) { - // unlabeled break or continue within iteration statement - ok - return false; - } - break; - } - current = current.parent; - } - if (node.label) { - var message = node.kind === 193 /* BreakStatement */ - ? ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement - : ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement; - return grammarErrorOnNode(node, message); - } - else { - var message = node.kind === 193 /* BreakStatement */ - ? ts.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement - : ts.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement; - return grammarErrorOnNode(node, message); - } - } - function checkGrammarBindingElement(node) { - if (node.dotDotDotToken) { - var elements = node.parent.elements; - if (node !== ts.lastOrUndefined(elements)) { - return grammarErrorOnNode(node, ts.Diagnostics.A_rest_element_must_be_last_in_an_array_destructuring_pattern); - } - if (node.name.kind === 154 /* ArrayBindingPattern */ || node.name.kind === 153 /* ObjectBindingPattern */) { - return grammarErrorOnNode(node.name, ts.Diagnostics.A_rest_element_cannot_contain_a_binding_pattern); - } - if (node.initializer) { - // Error on equals token which immediate precedes the initializer - return grammarErrorAtPos(ts.getSourceFileOfNode(node), node.initializer.pos - 1, 1, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); - } - } - // It is a SyntaxError if a VariableDeclaration or VariableDeclarationNoIn occurs within strict code - // and its Identifier is eval or arguments - return checkGrammarEvalOrArgumentsInStrictMode(node, node.name); - } - function checkGrammarVariableDeclaration(node) { - if (node.parent.parent.kind !== 190 /* ForInStatement */ && node.parent.parent.kind !== 191 /* ForOfStatement */) { - if (ts.isInAmbientContext(node)) { - if (node.initializer) { - // Error on equals token which immediate precedes the initializer - var equalsTokenLength = "=".length; - return grammarErrorAtPos(ts.getSourceFileOfNode(node), node.initializer.pos - equalsTokenLength, equalsTokenLength, ts.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); - } - } - else if (!node.initializer) { - if (ts.isBindingPattern(node.name) && !ts.isBindingPattern(node.parent)) { - return grammarErrorOnNode(node, ts.Diagnostics.A_destructuring_declaration_must_have_an_initializer); - } - if (ts.isConst(node)) { - return grammarErrorOnNode(node, ts.Diagnostics.const_declarations_must_be_initialized); - } - } - } - var checkLetConstNames = languageVersion >= 2 /* ES6 */ && (ts.isLet(node) || ts.isConst(node)); - // 1. LexicalDeclaration : LetOrConst BindingList ; - // It is a Syntax Error if the BoundNames of BindingList contains "let". - // 2. ForDeclaration: ForDeclaration : LetOrConst ForBinding - // It is a Syntax Error if the BoundNames of ForDeclaration contains "let". - // It is a SyntaxError if a VariableDeclaration or VariableDeclarationNoIn occurs within strict code - // and its Identifier is eval or arguments - return (checkLetConstNames && checkGrammarNameInLetOrConstDeclarations(node.name)) || - checkGrammarEvalOrArgumentsInStrictMode(node, node.name); - } - function checkGrammarNameInLetOrConstDeclarations(name) { - if (name.kind === 65 /* Identifier */) { - if (name.text === "let") { - return grammarErrorOnNode(name, ts.Diagnostics.let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations); - } - } - else { - var elements = name.elements; - for (var _i = 0; _i < elements.length; _i++) { - var element = elements[_i]; - if (element.kind !== 178 /* OmittedExpression */) { - checkGrammarNameInLetOrConstDeclarations(element.name); - } - } - } - } - function checkGrammarVariableDeclarationList(declarationList) { - var declarations = declarationList.declarations; - if (checkGrammarForDisallowedTrailingComma(declarationList.declarations)) { - return true; - } - if (!declarationList.declarations.length) { - return grammarErrorAtPos(ts.getSourceFileOfNode(declarationList), declarations.pos, declarations.end - declarations.pos, ts.Diagnostics.Variable_declaration_list_cannot_be_empty); - } - } - function allowLetAndConstDeclarations(parent) { - switch (parent.kind) { - case 186 /* IfStatement */: - case 187 /* DoStatement */: - case 188 /* WhileStatement */: - case 195 /* WithStatement */: - case 189 /* ForStatement */: - case 190 /* ForInStatement */: - case 191 /* ForOfStatement */: - return false; - case 197 /* LabeledStatement */: - return allowLetAndConstDeclarations(parent.parent); - } - return true; - } - function checkGrammarForDisallowedLetOrConstStatement(node) { - if (!allowLetAndConstDeclarations(node.parent)) { - if (ts.isLet(node.declarationList)) { - return grammarErrorOnNode(node, ts.Diagnostics.let_declarations_can_only_be_declared_inside_a_block); - } - else if (ts.isConst(node.declarationList)) { - return grammarErrorOnNode(node, ts.Diagnostics.const_declarations_can_only_be_declared_inside_a_block); - } - } - } - function isIntegerLiteral(expression) { - if (expression.kind === 170 /* PrefixUnaryExpression */) { - var unaryExpression = expression; - if (unaryExpression.operator === 33 /* PlusToken */ || unaryExpression.operator === 34 /* MinusToken */) { - expression = unaryExpression.operand; - } - } - if (expression.kind === 7 /* NumericLiteral */) { - // Allows for scientific notation since literalExpression.text was formed by - // coercing a number to a string. Sometimes this coercion can yield a string - // in scientific notation. - // We also don't need special logic for hex because a hex integer is converted - // to decimal when it is coerced. - return /^[0-9]+([eE]\+?[0-9]+)?$/.test(expression.text); - } - return false; - } - function checkGrammarEnumDeclaration(enumDecl) { - var enumIsConst = (enumDecl.flags & 8192 /* Const */) !== 0; - var hasError = false; - // skip checks below for const enums - they allow arbitrary initializers as long as they can be evaluated to constant expressions. - // since all values are known in compile time - it is not necessary to check that constant enum section precedes computed enum members. - if (!enumIsConst) { - var inConstantEnumMemberSection = true; - var inAmbientContext = ts.isInAmbientContext(enumDecl); - for (var _i = 0, _a = enumDecl.members; _i < _a.length; _i++) { - var node = _a[_i]; - // Do not use hasDynamicName here, because that returns false for well known symbols. - // We want to perform checkComputedPropertyName for all computed properties, including - // well known symbols. - if (node.name.kind === 129 /* ComputedPropertyName */) { - hasError = grammarErrorOnNode(node.name, ts.Diagnostics.Computed_property_names_are_not_allowed_in_enums); - } - else if (inAmbientContext) { - if (node.initializer && !isIntegerLiteral(node.initializer)) { - hasError = grammarErrorOnNode(node.name, ts.Diagnostics.Ambient_enum_elements_can_only_have_integer_literal_initializers) || hasError; - } - } - else if (node.initializer) { - inConstantEnumMemberSection = isIntegerLiteral(node.initializer); - } - else if (!inConstantEnumMemberSection) { - hasError = grammarErrorOnNode(node.name, ts.Diagnostics.Enum_member_must_have_initializer) || hasError; - } - } - } - return hasError; - } - function hasParseDiagnostics(sourceFile) { - return sourceFile.parseDiagnostics.length > 0; - } - function grammarErrorOnFirstToken(node, message, arg0, arg1, arg2) { - var sourceFile = ts.getSourceFileOfNode(node); - if (!hasParseDiagnostics(sourceFile)) { - var span = ts.getSpanOfTokenAtPosition(sourceFile, node.pos); - diagnostics.add(ts.createFileDiagnostic(sourceFile, span.start, span.length, message, arg0, arg1, arg2)); - return true; - } - } - function grammarErrorAtPos(sourceFile, start, length, message, arg0, arg1, arg2) { - if (!hasParseDiagnostics(sourceFile)) { - diagnostics.add(ts.createFileDiagnostic(sourceFile, start, length, message, arg0, arg1, arg2)); - return true; - } - } - function grammarErrorOnNode(node, message, arg0, arg1, arg2) { - var sourceFile = ts.getSourceFileOfNode(node); - if (!hasParseDiagnostics(sourceFile)) { - diagnostics.add(ts.createDiagnosticForNode(node, message, arg0, arg1, arg2)); - return true; - } - } - function checkGrammarEvalOrArgumentsInStrictMode(contextNode, name) { - if (name && name.kind === 65 /* Identifier */) { - var identifier = name; - if (contextNode && (contextNode.parserContextFlags & 1 /* StrictMode */) && isEvalOrArgumentsIdentifier(identifier)) { - var nameText = ts.declarationNameToString(identifier); - // We check first if the name is inside class declaration or class expression; if so give explicit message - // otherwise report generic error message. - // reportGrammarErrorInClassDeclaration only return true if grammar error is successfully reported and false otherwise - var reportErrorInClassDeclaration = reportStrictModeGrammarErrorInClassDeclaration(identifier, ts.Diagnostics.Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode, nameText); - if (!reportErrorInClassDeclaration) { - return grammarErrorOnNode(identifier, ts.Diagnostics.Invalid_use_of_0_in_strict_mode, nameText); - } - return reportErrorInClassDeclaration; - } - } - } - function isEvalOrArgumentsIdentifier(node) { - return node.kind === 65 /* Identifier */ && - (node.text === "eval" || node.text === "arguments"); - } - function checkGrammarConstructorTypeParameters(node) { - if (node.typeParameters) { - return grammarErrorAtPos(ts.getSourceFileOfNode(node), node.typeParameters.pos, node.typeParameters.end - node.typeParameters.pos, ts.Diagnostics.Type_parameters_cannot_appear_on_a_constructor_declaration); - } - } - function checkGrammarConstructorTypeAnnotation(node) { - if (node.type) { - return grammarErrorOnNode(node.type, ts.Diagnostics.Type_annotation_cannot_appear_on_a_constructor_declaration); - } - } - function checkGrammarProperty(node) { - if (node.parent.kind === 204 /* ClassDeclaration */) { - if (checkGrammarForInvalidQuestionMark(node, node.questionToken, ts.Diagnostics.A_class_member_cannot_be_declared_optional) || - checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_class_property_declaration_must_directly_refer_to_a_built_in_symbol)) { - return true; - } - } - else if (node.parent.kind === 205 /* InterfaceDeclaration */) { - if (checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_directly_refer_to_a_built_in_symbol)) { - return true; - } - } - else if (node.parent.kind === 148 /* TypeLiteral */) { - if (checkGrammarForNonSymbolComputedProperty(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_directly_refer_to_a_built_in_symbol)) { - return true; - } - } - if (ts.isInAmbientContext(node) && node.initializer) { - return grammarErrorOnFirstToken(node.initializer, ts.Diagnostics.Initializers_are_not_allowed_in_ambient_contexts); - } - } - function checkGrammarTopLevelElementForRequiredDeclareModifier(node) { - // A declare modifier is required for any top level .d.ts declaration except export=, export default, - // interfaces and imports categories: - // - // DeclarationElement: - // ExportAssignment - // export_opt InterfaceDeclaration - // export_opt ImportDeclaration - // export_opt ExternalImportDeclaration - // export_opt AmbientDeclaration - // - if (node.kind === 205 /* InterfaceDeclaration */ || - node.kind === 212 /* ImportDeclaration */ || - node.kind === 211 /* ImportEqualsDeclaration */ || - node.kind === 218 /* ExportDeclaration */ || - node.kind === 217 /* ExportAssignment */ || - (node.flags & 2 /* Ambient */) || - (node.flags & (1 /* Export */ | 256 /* Default */))) { - return false; - } - return grammarErrorOnFirstToken(node, ts.Diagnostics.A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file); - } - function checkGrammarTopLevelElementsForRequiredDeclareModifier(file) { - for (var _i = 0, _a = file.statements; _i < _a.length; _i++) { - var decl = _a[_i]; - if (ts.isDeclaration(decl) || decl.kind === 183 /* VariableStatement */) { - if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) { - return true; - } - } - } - } - function checkGrammarSourceFile(node) { - return ts.isInAmbientContext(node) && checkGrammarTopLevelElementsForRequiredDeclareModifier(node); - } - function checkGrammarStatementInAmbientContext(node) { - if (ts.isInAmbientContext(node)) { - // An accessors is already reported about the ambient context - if (isAccessor(node.parent.kind)) { - return getNodeLinks(node).hasReportedStatementInAmbientContext = true; - } - // Find containing block which is either Block, ModuleBlock, SourceFile - var links = getNodeLinks(node); - if (!links.hasReportedStatementInAmbientContext && ts.isFunctionLike(node.parent)) { - return getNodeLinks(node).hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts.Diagnostics.An_implementation_cannot_be_declared_in_ambient_contexts); - } - // We are either parented by another statement, or some sort of block. - // If we're in a block, we only want to really report an error once - // to prevent noisyness. So use a bit on the block to indicate if - // this has already been reported, and don't report if it has. - // - if (node.parent.kind === 182 /* Block */ || node.parent.kind === 209 /* ModuleBlock */ || node.parent.kind === 230 /* SourceFile */) { - var links_1 = getNodeLinks(node.parent); - // Check if the containing block ever report this error - if (!links_1.hasReportedStatementInAmbientContext) { - return links_1.hasReportedStatementInAmbientContext = grammarErrorOnFirstToken(node, ts.Diagnostics.Statements_are_not_allowed_in_ambient_contexts); - } - } - else { - } - } - } - function checkGrammarNumericLiteral(node) { - // Grammar checking - if (node.flags & 16384 /* OctalLiteral */) { - if (node.parserContextFlags & 1 /* StrictMode */) { - return grammarErrorOnNode(node, ts.Diagnostics.Octal_literals_are_not_allowed_in_strict_mode); - } - else if (languageVersion >= 1 /* ES5 */) { - return grammarErrorOnNode(node, ts.Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher); - } - } - } - function grammarErrorAfterFirstToken(node, message, arg0, arg1, arg2) { - var sourceFile = ts.getSourceFileOfNode(node); - if (!hasParseDiagnostics(sourceFile)) { - var span = ts.getSpanOfTokenAtPosition(sourceFile, node.pos); - diagnostics.add(ts.createFileDiagnostic(sourceFile, ts.textSpanEnd(span), 0, message, arg0, arg1, arg2)); - return true; - } - } - initializeTypeChecker(); - return checker; - } - ts.createTypeChecker = createTypeChecker; -})(ts || (ts = {})); -/// -/* @internal */ -var ts; -(function (ts) { - function getDeclarationDiagnostics(host, resolver, targetSourceFile) { - var diagnostics = []; - var jsFilePath = ts.getOwnEmitOutputFilePath(targetSourceFile, host, ".js"); - emitDeclarations(host, resolver, diagnostics, jsFilePath, targetSourceFile); - return diagnostics; - } - ts.getDeclarationDiagnostics = getDeclarationDiagnostics; - function emitDeclarations(host, resolver, diagnostics, jsFilePath, root) { - var newLine = host.getNewLine(); - var compilerOptions = host.getCompilerOptions(); - var languageVersion = compilerOptions.target || 0 /* ES3 */; - var write; - var writeLine; - var increaseIndent; - var decreaseIndent; - var writeTextOfNode; - var writer = createAndSetNewTextWriterWithSymbolWriter(); - var enclosingDeclaration; - var currentSourceFile; - var reportedDeclarationError = false; - var emitJsDocComments = compilerOptions.removeComments ? function (declaration) { } : writeJsDocComments; - var emit = compilerOptions.stripInternal ? stripInternal : emitNode; - var moduleElementDeclarationEmitInfo = []; - var asynchronousSubModuleDeclarationEmitInfo; - // Contains the reference paths that needs to go in the declaration file. - // Collecting this separately because reference paths need to be first thing in the declaration file - // and we could be collecting these paths from multiple files into single one with --out option - var referencePathsOutput = ""; - if (root) { - // Emitting just a single file, so emit references in this file only - if (!compilerOptions.noResolve) { - var addedGlobalFileReference = false; - ts.forEach(root.referencedFiles, function (fileReference) { - var referencedFile = ts.tryResolveScriptReference(host, root, fileReference); - // All the references that are not going to be part of same file - if (referencedFile && ((referencedFile.flags & 2048 /* DeclarationFile */) || - ts.shouldEmitToOwnFile(referencedFile, compilerOptions) || - !addedGlobalFileReference)) { - writeReferencePath(referencedFile); - if (!ts.isExternalModuleOrDeclarationFile(referencedFile)) { - addedGlobalFileReference = true; - } - } - }); - } - emitSourceFile(root); - // create asynchronous output for the importDeclarations - if (moduleElementDeclarationEmitInfo.length) { - var oldWriter = writer; - ts.forEach(moduleElementDeclarationEmitInfo, function (aliasEmitInfo) { - if (aliasEmitInfo.isVisible) { - ts.Debug.assert(aliasEmitInfo.node.kind === 212 /* ImportDeclaration */); - createAndSetNewTextWriterWithSymbolWriter(); - ts.Debug.assert(aliasEmitInfo.indent === 0); - writeImportDeclaration(aliasEmitInfo.node); - aliasEmitInfo.asynchronousOutput = writer.getText(); - } - }); - setWriter(oldWriter); - } - } - else { - // Emit references corresponding to this file - var emittedReferencedFiles = []; - ts.forEach(host.getSourceFiles(), function (sourceFile) { - if (!ts.isExternalModuleOrDeclarationFile(sourceFile)) { - // Check what references need to be added - if (!compilerOptions.noResolve) { - ts.forEach(sourceFile.referencedFiles, function (fileReference) { - var referencedFile = ts.tryResolveScriptReference(host, sourceFile, fileReference); - // If the reference file is a declaration file or an external module, emit that reference - if (referencedFile && (ts.isExternalModuleOrDeclarationFile(referencedFile) && - !ts.contains(emittedReferencedFiles, referencedFile))) { - writeReferencePath(referencedFile); - emittedReferencedFiles.push(referencedFile); - } - }); - } - emitSourceFile(sourceFile); - } - }); - } - return { - reportedDeclarationError: reportedDeclarationError, - moduleElementDeclarationEmitInfo: moduleElementDeclarationEmitInfo, - synchronousDeclarationOutput: writer.getText(), - referencePathsOutput: referencePathsOutput - }; - function hasInternalAnnotation(range) { - var text = currentSourceFile.text; - var comment = text.substring(range.pos, range.end); - return comment.indexOf("@internal") >= 0; - } - function stripInternal(node) { - if (node) { - var leadingCommentRanges = ts.getLeadingCommentRanges(currentSourceFile.text, node.pos); - if (ts.forEach(leadingCommentRanges, hasInternalAnnotation)) { - return; - } - emitNode(node); - } - } - function createAndSetNewTextWriterWithSymbolWriter() { - var writer = ts.createTextWriter(newLine); - writer.trackSymbol = trackSymbol; - writer.writeKeyword = writer.write; - writer.writeOperator = writer.write; - writer.writePunctuation = writer.write; - writer.writeSpace = writer.write; - writer.writeStringLiteral = writer.writeLiteral; - writer.writeParameter = writer.write; - writer.writeSymbol = writer.write; - setWriter(writer); - return writer; - } - function setWriter(newWriter) { - writer = newWriter; - write = newWriter.write; - writeTextOfNode = newWriter.writeTextOfNode; - writeLine = newWriter.writeLine; - increaseIndent = newWriter.increaseIndent; - decreaseIndent = newWriter.decreaseIndent; - } - function writeAsynchronousModuleElements(nodes) { - var oldWriter = writer; - ts.forEach(nodes, function (declaration) { - var nodeToCheck; - if (declaration.kind === 201 /* VariableDeclaration */) { - nodeToCheck = declaration.parent.parent; - } - else if (declaration.kind === 215 /* NamedImports */ || declaration.kind === 216 /* ImportSpecifier */ || declaration.kind === 213 /* ImportClause */) { - ts.Debug.fail("We should be getting ImportDeclaration instead to write"); - } - else { - nodeToCheck = declaration; - } - var moduleElementEmitInfo = ts.forEach(moduleElementDeclarationEmitInfo, function (declEmitInfo) { return declEmitInfo.node === nodeToCheck ? declEmitInfo : undefined; }); - if (!moduleElementEmitInfo && asynchronousSubModuleDeclarationEmitInfo) { - moduleElementEmitInfo = ts.forEach(asynchronousSubModuleDeclarationEmitInfo, function (declEmitInfo) { return declEmitInfo.node === nodeToCheck ? declEmitInfo : undefined; }); - } - // If the alias was marked as not visible when we saw its declaration, we would have saved the aliasEmitInfo, but if we haven't yet visited the alias declaration - // then we don't need to write it at this point. We will write it when we actually see its declaration - // Eg. - // export function bar(a: foo.Foo) { } - // import foo = require("foo"); - // Writing of function bar would mark alias declaration foo as visible but we haven't yet visited that declaration so do nothing, - // we would write alias foo declaration when we visit it since it would now be marked as visible - if (moduleElementEmitInfo) { - if (moduleElementEmitInfo.node.kind === 212 /* ImportDeclaration */) { - // we have to create asynchronous output only after we have collected complete information - // because it is possible to enable multiple bindings as asynchronously visible - moduleElementEmitInfo.isVisible = true; - } - else { - createAndSetNewTextWriterWithSymbolWriter(); - for (var declarationIndent = moduleElementEmitInfo.indent; declarationIndent; declarationIndent--) { - increaseIndent(); - } - if (nodeToCheck.kind === 208 /* ModuleDeclaration */) { - ts.Debug.assert(asynchronousSubModuleDeclarationEmitInfo === undefined); - asynchronousSubModuleDeclarationEmitInfo = []; - } - writeModuleElement(nodeToCheck); - if (nodeToCheck.kind === 208 /* ModuleDeclaration */) { - moduleElementEmitInfo.subModuleElementDeclarationEmitInfo = asynchronousSubModuleDeclarationEmitInfo; - asynchronousSubModuleDeclarationEmitInfo = undefined; - } - moduleElementEmitInfo.asynchronousOutput = writer.getText(); - } - } - }); - setWriter(oldWriter); - } - function handleSymbolAccessibilityError(symbolAccesibilityResult) { - if (symbolAccesibilityResult.accessibility === 0 /* Accessible */) { - // write the aliases - if (symbolAccesibilityResult && symbolAccesibilityResult.aliasesToMakeVisible) { - writeAsynchronousModuleElements(symbolAccesibilityResult.aliasesToMakeVisible); - } - } - else { - // Report error - reportedDeclarationError = true; - var errorInfo = writer.getSymbolAccessibilityDiagnostic(symbolAccesibilityResult); - if (errorInfo) { - if (errorInfo.typeName) { - diagnostics.push(ts.createDiagnosticForNode(symbolAccesibilityResult.errorNode || errorInfo.errorNode, errorInfo.diagnosticMessage, ts.getSourceTextOfNodeFromSourceFile(currentSourceFile, errorInfo.typeName), symbolAccesibilityResult.errorSymbolName, symbolAccesibilityResult.errorModuleName)); - } - else { - diagnostics.push(ts.createDiagnosticForNode(symbolAccesibilityResult.errorNode || errorInfo.errorNode, errorInfo.diagnosticMessage, symbolAccesibilityResult.errorSymbolName, symbolAccesibilityResult.errorModuleName)); - } - } - } - } - function trackSymbol(symbol, enclosingDeclaration, meaning) { - handleSymbolAccessibilityError(resolver.isSymbolAccessible(symbol, enclosingDeclaration, meaning)); - } - function writeTypeOfDeclaration(declaration, type, getSymbolAccessibilityDiagnostic) { - writer.getSymbolAccessibilityDiagnostic = getSymbolAccessibilityDiagnostic; - write(": "); - if (type) { - // Write the type - emitType(type); - } - else { - resolver.writeTypeOfDeclaration(declaration, enclosingDeclaration, 2 /* UseTypeOfFunction */, writer); - } - } - function writeReturnTypeAtSignature(signature, getSymbolAccessibilityDiagnostic) { - writer.getSymbolAccessibilityDiagnostic = getSymbolAccessibilityDiagnostic; - write(": "); - if (signature.type) { - // Write the type - emitType(signature.type); - } - else { - resolver.writeReturnTypeOfSignatureDeclaration(signature, enclosingDeclaration, 2 /* UseTypeOfFunction */, writer); - } - } - function emitLines(nodes) { - for (var _i = 0; _i < nodes.length; _i++) { - var node = nodes[_i]; - emit(node); - } - } - function emitSeparatedList(nodes, separator, eachNodeEmitFn, canEmitFn) { - var currentWriterPos = writer.getTextPos(); - for (var _i = 0; _i < nodes.length; _i++) { - var node = nodes[_i]; - if (!canEmitFn || canEmitFn(node)) { - if (currentWriterPos !== writer.getTextPos()) { - write(separator); - } - currentWriterPos = writer.getTextPos(); - eachNodeEmitFn(node); - } - } - } - function emitCommaList(nodes, eachNodeEmitFn, canEmitFn) { - emitSeparatedList(nodes, ", ", eachNodeEmitFn, canEmitFn); - } - function writeJsDocComments(declaration) { - if (declaration) { - var jsDocComments = ts.getJsDocComments(declaration, currentSourceFile); - ts.emitNewLineBeforeLeadingComments(currentSourceFile, writer, declaration, jsDocComments); - // jsDoc comments are emitted at /*leading comment1 */space/*leading comment*/space - ts.emitComments(currentSourceFile, writer, jsDocComments, true, newLine, ts.writeCommentRange); - } - } - function emitTypeWithNewGetSymbolAccessibilityDiagnostic(type, getSymbolAccessibilityDiagnostic) { - writer.getSymbolAccessibilityDiagnostic = getSymbolAccessibilityDiagnostic; - emitType(type); - } - function emitType(type) { - switch (type.kind) { - case 112 /* AnyKeyword */: - case 123 /* StringKeyword */: - case 121 /* NumberKeyword */: - case 113 /* BooleanKeyword */: - case 124 /* SymbolKeyword */: - case 99 /* VoidKeyword */: - case 8 /* StringLiteral */: - return writeTextOfNode(currentSourceFile, type); - case 179 /* ExpressionWithTypeArguments */: - return emitExpressionWithTypeArguments(type); - case 144 /* TypeReference */: - return emitTypeReference(type); - case 147 /* TypeQuery */: - return emitTypeQuery(type); - case 149 /* ArrayType */: - return emitArrayType(type); - case 150 /* TupleType */: - return emitTupleType(type); - case 151 /* UnionType */: - return emitUnionType(type); - case 152 /* ParenthesizedType */: - return emitParenType(type); - case 145 /* FunctionType */: - case 146 /* ConstructorType */: - return emitSignatureDeclarationWithJsDocComments(type); - case 148 /* TypeLiteral */: - return emitTypeLiteral(type); - case 65 /* Identifier */: - return emitEntityName(type); - case 128 /* QualifiedName */: - return emitEntityName(type); - } - function emitEntityName(entityName) { - var visibilityResult = resolver.isEntityNameVisible(entityName, - // Aliases can be written asynchronously so use correct enclosing declaration - entityName.parent.kind === 211 /* ImportEqualsDeclaration */ ? entityName.parent : enclosingDeclaration); - handleSymbolAccessibilityError(visibilityResult); - writeEntityName(entityName); - function writeEntityName(entityName) { - if (entityName.kind === 65 /* Identifier */) { - writeTextOfNode(currentSourceFile, entityName); - } - else { - var left = entityName.kind === 128 /* QualifiedName */ ? entityName.left : entityName.expression; - var right = entityName.kind === 128 /* QualifiedName */ ? entityName.right : entityName.name; - writeEntityName(left); - write("."); - writeTextOfNode(currentSourceFile, right); - } - } - } - function emitExpressionWithTypeArguments(node) { - if (ts.isSupportedExpressionWithTypeArguments(node)) { - ts.Debug.assert(node.expression.kind === 65 /* Identifier */ || node.expression.kind === 158 /* PropertyAccessExpression */); - emitEntityName(node.expression); - if (node.typeArguments) { - write("<"); - emitCommaList(node.typeArguments, emitType); - write(">"); - } - } - } - function emitTypeReference(type) { - emitEntityName(type.typeName); - if (type.typeArguments) { - write("<"); - emitCommaList(type.typeArguments, emitType); - write(">"); - } - } - function emitTypeQuery(type) { - write("typeof "); - emitEntityName(type.exprName); - } - function emitArrayType(type) { - emitType(type.elementType); - write("[]"); - } - function emitTupleType(type) { - write("["); - emitCommaList(type.elementTypes, emitType); - write("]"); - } - function emitUnionType(type) { - emitSeparatedList(type.types, " | ", emitType); - } - function emitParenType(type) { - write("("); - emitType(type.type); - write(")"); - } - function emitTypeLiteral(type) { - write("{"); - if (type.members.length) { - writeLine(); - increaseIndent(); - // write members - emitLines(type.members); - decreaseIndent(); - } - write("}"); - } - } - function emitSourceFile(node) { - currentSourceFile = node; - enclosingDeclaration = node; - emitLines(node.statements); - } - // Return a temp variable name to be used in `export default` statements. - // The temp name will be of the form _default_counter. - // Note that export default is only allowed at most once in a module, so we - // do not need to keep track of created temp names. - function getExportDefaultTempVariableName() { - var baseName = "_default"; - if (!ts.hasProperty(currentSourceFile.identifiers, baseName)) { - return baseName; - } - var count = 0; - while (true) { - var name_18 = baseName + "_" + (++count); - if (!ts.hasProperty(currentSourceFile.identifiers, name_18)) { - return name_18; - } - } - } - function emitExportAssignment(node) { - if (node.expression.kind === 65 /* Identifier */) { - write(node.isExportEquals ? "export = " : "export default "); - writeTextOfNode(currentSourceFile, node.expression); - } - else { - // Expression - var tempVarName = getExportDefaultTempVariableName(); - write("declare var "); - write(tempVarName); - write(": "); - writer.getSymbolAccessibilityDiagnostic = getDefaultExportAccessibilityDiagnostic; - resolver.writeTypeOfExpression(node.expression, enclosingDeclaration, 2 /* UseTypeOfFunction */, writer); - write(";"); - writeLine(); - write(node.isExportEquals ? "export = " : "export default "); - write(tempVarName); - } - write(";"); - writeLine(); - // Make all the declarations visible for the export name - if (node.expression.kind === 65 /* Identifier */) { - var nodes = resolver.collectLinkedAliases(node.expression); - // write each of these declarations asynchronously - writeAsynchronousModuleElements(nodes); - } - function getDefaultExportAccessibilityDiagnostic(diagnostic) { - return { - diagnosticMessage: ts.Diagnostics.Default_export_of_the_module_has_or_is_using_private_name_0, - errorNode: node - }; - } - } - function isModuleElementVisible(node) { - return resolver.isDeclarationVisible(node); - } - function emitModuleElement(node, isModuleElementVisible) { - if (isModuleElementVisible) { - writeModuleElement(node); - } - else if (node.kind === 211 /* ImportEqualsDeclaration */ || - (node.parent.kind === 230 /* SourceFile */ && ts.isExternalModule(currentSourceFile))) { - var isVisible; - if (asynchronousSubModuleDeclarationEmitInfo && node.parent.kind !== 230 /* SourceFile */) { - // Import declaration of another module that is visited async so lets put it in right spot - asynchronousSubModuleDeclarationEmitInfo.push({ - node: node, - outputPos: writer.getTextPos(), - indent: writer.getIndent(), - isVisible: isVisible - }); - } - else { - if (node.kind === 212 /* ImportDeclaration */) { - var importDeclaration = node; - if (importDeclaration.importClause) { - isVisible = (importDeclaration.importClause.name && resolver.isDeclarationVisible(importDeclaration.importClause)) || - isVisibleNamedBinding(importDeclaration.importClause.namedBindings); - } - } - moduleElementDeclarationEmitInfo.push({ - node: node, - outputPos: writer.getTextPos(), - indent: writer.getIndent(), - isVisible: isVisible - }); - } - } - } - function writeModuleElement(node) { - switch (node.kind) { - case 203 /* FunctionDeclaration */: - return writeFunctionDeclaration(node); - case 183 /* VariableStatement */: - return writeVariableStatement(node); - case 205 /* InterfaceDeclaration */: - return writeInterfaceDeclaration(node); - case 204 /* ClassDeclaration */: - return writeClassDeclaration(node); - case 206 /* TypeAliasDeclaration */: - return writeTypeAliasDeclaration(node); - case 207 /* EnumDeclaration */: - return writeEnumDeclaration(node); - case 208 /* ModuleDeclaration */: - return writeModuleDeclaration(node); - case 211 /* ImportEqualsDeclaration */: - return writeImportEqualsDeclaration(node); - case 212 /* ImportDeclaration */: - return writeImportDeclaration(node); - default: - ts.Debug.fail("Unknown symbol kind"); - } - } - function emitModuleElementDeclarationFlags(node) { - // If the node is parented in the current source file we need to emit export declare or just export - if (node.parent === currentSourceFile) { - // If the node is exported - if (node.flags & 1 /* Export */) { - write("export "); - } - if (node.flags & 256 /* Default */) { - write("default "); - } - else if (node.kind !== 205 /* InterfaceDeclaration */) { - write("declare "); - } - } - } - function emitClassMemberDeclarationFlags(node) { - if (node.flags & 32 /* Private */) { - write("private "); - } - else if (node.flags & 64 /* Protected */) { - write("protected "); - } - if (node.flags & 128 /* Static */) { - write("static "); - } - } - function writeImportEqualsDeclaration(node) { - // note usage of writer. methods instead of aliases created, just to make sure we are using - // correct writer especially to handle asynchronous alias writing - emitJsDocComments(node); - if (node.flags & 1 /* Export */) { - write("export "); - } - write("import "); - writeTextOfNode(currentSourceFile, node.name); - write(" = "); - if (ts.isInternalModuleImportEqualsDeclaration(node)) { - emitTypeWithNewGetSymbolAccessibilityDiagnostic(node.moduleReference, getImportEntityNameVisibilityError); - write(";"); - } - else { - write("require("); - writeTextOfNode(currentSourceFile, ts.getExternalModuleImportEqualsDeclarationExpression(node)); - write(");"); - } - writer.writeLine(); - function getImportEntityNameVisibilityError(symbolAccesibilityResult) { - return { - diagnosticMessage: ts.Diagnostics.Import_declaration_0_is_using_private_name_1, - errorNode: node, - typeName: node.name - }; - } - } - function isVisibleNamedBinding(namedBindings) { - if (namedBindings) { - if (namedBindings.kind === 214 /* NamespaceImport */) { - return resolver.isDeclarationVisible(namedBindings); - } - else { - return ts.forEach(namedBindings.elements, function (namedImport) { return resolver.isDeclarationVisible(namedImport); }); - } - } - } - function writeImportDeclaration(node) { - if (!node.importClause && !(node.flags & 1 /* Export */)) { - // do not write non-exported import declarations that don't have import clauses - return; - } - emitJsDocComments(node); - if (node.flags & 1 /* Export */) { - write("export "); - } - write("import "); - if (node.importClause) { - var currentWriterPos = writer.getTextPos(); - if (node.importClause.name && resolver.isDeclarationVisible(node.importClause)) { - writeTextOfNode(currentSourceFile, node.importClause.name); - } - if (node.importClause.namedBindings && isVisibleNamedBinding(node.importClause.namedBindings)) { - if (currentWriterPos !== writer.getTextPos()) { - // If the default binding was emitted, write the separated - write(", "); - } - if (node.importClause.namedBindings.kind === 214 /* NamespaceImport */) { - write("* as "); - writeTextOfNode(currentSourceFile, node.importClause.namedBindings.name); - } - else { - write("{ "); - emitCommaList(node.importClause.namedBindings.elements, emitImportOrExportSpecifier, resolver.isDeclarationVisible); - write(" }"); - } - } - write(" from "); - } - writeTextOfNode(currentSourceFile, node.moduleSpecifier); - write(";"); - writer.writeLine(); - } - function emitImportOrExportSpecifier(node) { - if (node.propertyName) { - writeTextOfNode(currentSourceFile, node.propertyName); - write(" as "); - } - writeTextOfNode(currentSourceFile, node.name); - } - function emitExportSpecifier(node) { - emitImportOrExportSpecifier(node); - // Make all the declarations visible for the export name - var nodes = resolver.collectLinkedAliases(node.propertyName || node.name); - // write each of these declarations asynchronously - writeAsynchronousModuleElements(nodes); - } - function emitExportDeclaration(node) { - emitJsDocComments(node); - write("export "); - if (node.exportClause) { - write("{ "); - emitCommaList(node.exportClause.elements, emitExportSpecifier); - write(" }"); - } - else { - write("*"); - } - if (node.moduleSpecifier) { - write(" from "); - writeTextOfNode(currentSourceFile, node.moduleSpecifier); - } - write(";"); - writer.writeLine(); - } - function writeModuleDeclaration(node) { - emitJsDocComments(node); - emitModuleElementDeclarationFlags(node); - write("module "); - writeTextOfNode(currentSourceFile, node.name); - while (node.body.kind !== 209 /* ModuleBlock */) { - node = node.body; - write("."); - writeTextOfNode(currentSourceFile, node.name); - } - var prevEnclosingDeclaration = enclosingDeclaration; - enclosingDeclaration = node; - write(" {"); - writeLine(); - increaseIndent(); - emitLines(node.body.statements); - decreaseIndent(); - write("}"); - writeLine(); - enclosingDeclaration = prevEnclosingDeclaration; - } - function writeTypeAliasDeclaration(node) { - emitJsDocComments(node); - emitModuleElementDeclarationFlags(node); - write("type "); - writeTextOfNode(currentSourceFile, node.name); - write(" = "); - emitTypeWithNewGetSymbolAccessibilityDiagnostic(node.type, getTypeAliasDeclarationVisibilityError); - write(";"); - writeLine(); - function getTypeAliasDeclarationVisibilityError(symbolAccesibilityResult) { - return { - diagnosticMessage: ts.Diagnostics.Exported_type_alias_0_has_or_is_using_private_name_1, - errorNode: node.type, - typeName: node.name - }; - } - } - function writeEnumDeclaration(node) { - emitJsDocComments(node); - emitModuleElementDeclarationFlags(node); - if (ts.isConst(node)) { - write("const "); - } - write("enum "); - writeTextOfNode(currentSourceFile, node.name); - write(" {"); - writeLine(); - increaseIndent(); - emitLines(node.members); - decreaseIndent(); - write("}"); - writeLine(); - } - function emitEnumMemberDeclaration(node) { - emitJsDocComments(node); - writeTextOfNode(currentSourceFile, node.name); - var enumMemberValue = resolver.getConstantValue(node); - if (enumMemberValue !== undefined) { - write(" = "); - write(enumMemberValue.toString()); - } - write(","); - writeLine(); - } - function isPrivateMethodTypeParameter(node) { - return node.parent.kind === 136 /* MethodDeclaration */ && (node.parent.flags & 32 /* Private */); - } - function emitTypeParameters(typeParameters) { - function emitTypeParameter(node) { - increaseIndent(); - emitJsDocComments(node); - decreaseIndent(); - writeTextOfNode(currentSourceFile, node.name); - // If there is constraint present and this is not a type parameter of the private method emit the constraint - if (node.constraint && !isPrivateMethodTypeParameter(node)) { - write(" extends "); - if (node.parent.kind === 145 /* FunctionType */ || - node.parent.kind === 146 /* ConstructorType */ || - (node.parent.parent && node.parent.parent.kind === 148 /* TypeLiteral */)) { - ts.Debug.assert(node.parent.kind === 136 /* MethodDeclaration */ || - node.parent.kind === 135 /* MethodSignature */ || - node.parent.kind === 145 /* FunctionType */ || - node.parent.kind === 146 /* ConstructorType */ || - node.parent.kind === 140 /* CallSignature */ || - node.parent.kind === 141 /* ConstructSignature */); - emitType(node.constraint); - } - else { - emitTypeWithNewGetSymbolAccessibilityDiagnostic(node.constraint, getTypeParameterConstraintVisibilityError); - } - } - function getTypeParameterConstraintVisibilityError(symbolAccesibilityResult) { - // Type parameter constraints are named by user so we should always be able to name it - var diagnosticMessage; - switch (node.parent.kind) { - case 204 /* ClassDeclaration */: - diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; - break; - case 205 /* InterfaceDeclaration */: - diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; - break; - case 141 /* ConstructSignature */: - diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; - break; - case 140 /* CallSignature */: - diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; - break; - case 136 /* MethodDeclaration */: - case 135 /* MethodSignature */: - if (node.parent.flags & 128 /* Static */) { - diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; - } - else if (node.parent.parent.kind === 204 /* ClassDeclaration */) { - diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; - } - else { - diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; - } - break; - case 203 /* FunctionDeclaration */: - diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; - break; - default: - ts.Debug.fail("This is unknown parent for type parameter: " + node.parent.kind); - } - return { - diagnosticMessage: diagnosticMessage, - errorNode: node, - typeName: node.name - }; - } - } - if (typeParameters) { - write("<"); - emitCommaList(typeParameters, emitTypeParameter); - write(">"); - } - } - function emitHeritageClause(typeReferences, isImplementsList) { - if (typeReferences) { - write(isImplementsList ? " implements " : " extends "); - emitCommaList(typeReferences, emitTypeOfTypeReference); - } - function emitTypeOfTypeReference(node) { - if (ts.isSupportedExpressionWithTypeArguments(node)) { - emitTypeWithNewGetSymbolAccessibilityDiagnostic(node, getHeritageClauseVisibilityError); - } - function getHeritageClauseVisibilityError(symbolAccesibilityResult) { - var diagnosticMessage; - // Heritage clause is written by user so it can always be named - if (node.parent.parent.kind === 204 /* ClassDeclaration */) { - // Class or Interface implemented/extended is inaccessible - diagnosticMessage = isImplementsList ? - ts.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 : - ts.Diagnostics.Extends_clause_of_exported_class_0_has_or_is_using_private_name_1; - } - else { - // interface is inaccessible - diagnosticMessage = ts.Diagnostics.Extends_clause_of_exported_interface_0_has_or_is_using_private_name_1; - } - return { - diagnosticMessage: diagnosticMessage, - errorNode: node, - typeName: node.parent.parent.name - }; - } - } - } - function writeClassDeclaration(node) { - function emitParameterProperties(constructorDeclaration) { - if (constructorDeclaration) { - ts.forEach(constructorDeclaration.parameters, function (param) { - if (param.flags & 112 /* AccessibilityModifier */) { - emitPropertyDeclaration(param); - } - }); - } - } - emitJsDocComments(node); - emitModuleElementDeclarationFlags(node); - write("class "); - writeTextOfNode(currentSourceFile, node.name); - var prevEnclosingDeclaration = enclosingDeclaration; - enclosingDeclaration = node; - emitTypeParameters(node.typeParameters); - var baseTypeNode = ts.getClassExtendsHeritageClauseElement(node); - if (baseTypeNode) { - emitHeritageClause([baseTypeNode], false); - } - emitHeritageClause(ts.getClassImplementsHeritageClauseElements(node), true); - write(" {"); - writeLine(); - increaseIndent(); - emitParameterProperties(ts.getFirstConstructorWithBody(node)); - emitLines(node.members); - decreaseIndent(); - write("}"); - writeLine(); - enclosingDeclaration = prevEnclosingDeclaration; - } - function writeInterfaceDeclaration(node) { - emitJsDocComments(node); - emitModuleElementDeclarationFlags(node); - write("interface "); - writeTextOfNode(currentSourceFile, node.name); - var prevEnclosingDeclaration = enclosingDeclaration; - enclosingDeclaration = node; - emitTypeParameters(node.typeParameters); - emitHeritageClause(ts.getInterfaceBaseTypeNodes(node), false); - write(" {"); - writeLine(); - increaseIndent(); - emitLines(node.members); - decreaseIndent(); - write("}"); - writeLine(); - enclosingDeclaration = prevEnclosingDeclaration; - } - function emitPropertyDeclaration(node) { - if (ts.hasDynamicName(node)) { - return; - } - emitJsDocComments(node); - emitClassMemberDeclarationFlags(node); - emitVariableDeclaration(node); - write(";"); - writeLine(); - } - function emitVariableDeclaration(node) { - // If we are emitting property it isn't moduleElement and hence we already know it needs to be emitted - // so there is no check needed to see if declaration is visible - if (node.kind !== 201 /* VariableDeclaration */ || resolver.isDeclarationVisible(node)) { - if (ts.isBindingPattern(node.name)) { - emitBindingPattern(node.name); - } - else { - // If this node is a computed name, it can only be a symbol, because we've already skipped - // it if it's not a well known symbol. In that case, the text of the name will be exactly - // what we want, namely the name expression enclosed in brackets. - writeTextOfNode(currentSourceFile, node.name); - // If optional property emit ? - if ((node.kind === 134 /* PropertyDeclaration */ || node.kind === 133 /* PropertySignature */) && ts.hasQuestionToken(node)) { - write("?"); - } - if ((node.kind === 134 /* PropertyDeclaration */ || node.kind === 133 /* PropertySignature */) && node.parent.kind === 148 /* TypeLiteral */) { - emitTypeOfVariableDeclarationFromTypeLiteral(node); - } - else if (!(node.flags & 32 /* Private */)) { - writeTypeOfDeclaration(node, node.type, getVariableDeclarationTypeVisibilityError); - } - } - } - function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccesibilityResult) { - if (node.kind === 201 /* VariableDeclaration */) { - return symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? - ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : - ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 : - ts.Diagnostics.Exported_variable_0_has_or_is_using_private_name_1; - } - else if (node.kind === 134 /* PropertyDeclaration */ || node.kind === 133 /* PropertySignature */) { - // TODO(jfreeman): Deal with computed properties in error reporting. - if (node.flags & 128 /* Static */) { - return symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? - ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : - ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : - ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; - } - else if (node.parent.kind === 204 /* ClassDeclaration */) { - return symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? - ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : - ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : - ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_private_name_1; - } - else { - // Interfaces cannot have types that cannot be named - return symbolAccesibilityResult.errorModuleName ? - ts.Diagnostics.Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2 : - ts.Diagnostics.Property_0_of_exported_interface_has_or_is_using_private_name_1; - } - } - } - function getVariableDeclarationTypeVisibilityError(symbolAccesibilityResult) { - var diagnosticMessage = getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccesibilityResult); - return diagnosticMessage !== undefined ? { - diagnosticMessage: diagnosticMessage, - errorNode: node, - typeName: node.name - } : undefined; - } - function emitBindingPattern(bindingPattern) { - // Only select non-omitted expression from the bindingPattern's elements. - // We have to do this to avoid emitting trailing commas. - // For example: - // original: var [, c,,] = [ 2,3,4] - // emitted: declare var c: number; // instead of declare var c:number, ; - var elements = []; - for (var _i = 0, _a = bindingPattern.elements; _i < _a.length; _i++) { - var element = _a[_i]; - if (element.kind !== 178 /* OmittedExpression */) { - elements.push(element); - } - } - emitCommaList(elements, emitBindingElement); - } - function emitBindingElement(bindingElement) { - function getBindingElementTypeVisibilityError(symbolAccesibilityResult) { - var diagnosticMessage = getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccesibilityResult); - return diagnosticMessage !== undefined ? { - diagnosticMessage: diagnosticMessage, - errorNode: bindingElement, - typeName: bindingElement.name - } : undefined; - } - if (bindingElement.name) { - if (ts.isBindingPattern(bindingElement.name)) { - emitBindingPattern(bindingElement.name); - } - else { - writeTextOfNode(currentSourceFile, bindingElement.name); - writeTypeOfDeclaration(bindingElement, undefined, getBindingElementTypeVisibilityError); - } - } - } - } - function emitTypeOfVariableDeclarationFromTypeLiteral(node) { - // if this is property of type literal, - // or is parameter of method/call/construct/index signature of type literal - // emit only if type is specified - if (node.type) { - write(": "); - emitType(node.type); - } - } - function isVariableStatementVisible(node) { - return ts.forEach(node.declarationList.declarations, function (varDeclaration) { return resolver.isDeclarationVisible(varDeclaration); }); - } - function writeVariableStatement(node) { - emitJsDocComments(node); - emitModuleElementDeclarationFlags(node); - if (ts.isLet(node.declarationList)) { - write("let "); - } - else if (ts.isConst(node.declarationList)) { - write("const "); - } - else { - write("var "); - } - emitCommaList(node.declarationList.declarations, emitVariableDeclaration, resolver.isDeclarationVisible); - write(";"); - writeLine(); - } - function emitAccessorDeclaration(node) { - if (ts.hasDynamicName(node)) { - return; - } - var accessors = ts.getAllAccessorDeclarations(node.parent.members, node); - var accessorWithTypeAnnotation; - if (node === accessors.firstAccessor) { - emitJsDocComments(accessors.getAccessor); - emitJsDocComments(accessors.setAccessor); - emitClassMemberDeclarationFlags(node); - writeTextOfNode(currentSourceFile, node.name); - if (!(node.flags & 32 /* Private */)) { - accessorWithTypeAnnotation = node; - var type = getTypeAnnotationFromAccessor(node); - if (!type) { - // couldn't get type for the first accessor, try the another one - var anotherAccessor = node.kind === 138 /* GetAccessor */ ? accessors.setAccessor : accessors.getAccessor; - type = getTypeAnnotationFromAccessor(anotherAccessor); - if (type) { - accessorWithTypeAnnotation = anotherAccessor; - } - } - writeTypeOfDeclaration(node, type, getAccessorDeclarationTypeVisibilityError); - } - write(";"); - writeLine(); - } - function getTypeAnnotationFromAccessor(accessor) { - if (accessor) { - return accessor.kind === 138 /* GetAccessor */ - ? accessor.type // Getter - return type - : accessor.parameters.length > 0 - ? accessor.parameters[0].type // Setter parameter type - : undefined; - } - } - function getAccessorDeclarationTypeVisibilityError(symbolAccesibilityResult) { - var diagnosticMessage; - if (accessorWithTypeAnnotation.kind === 139 /* SetAccessor */) { - // Setters have to have type named and cannot infer it so, the type should always be named - if (accessorWithTypeAnnotation.parent.flags & 128 /* Static */) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - ts.Diagnostics.Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2 : - ts.Diagnostics.Parameter_0_of_public_static_property_setter_from_exported_class_has_or_is_using_private_name_1; - } - else { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - ts.Diagnostics.Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_name_1_from_private_module_2 : - ts.Diagnostics.Parameter_0_of_public_property_setter_from_exported_class_has_or_is_using_private_name_1; - } - return { - diagnosticMessage: diagnosticMessage, - errorNode: accessorWithTypeAnnotation.parameters[0], - // TODO(jfreeman): Investigate why we are passing node.name instead of node.parameters[0].name - typeName: accessorWithTypeAnnotation.name - }; - } - else { - if (accessorWithTypeAnnotation.flags & 128 /* Static */) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? - ts.Diagnostics.Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : - ts.Diagnostics.Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1 : - ts.Diagnostics.Return_type_of_public_static_property_getter_from_exported_class_has_or_is_using_private_name_0; - } - else { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? - ts.Diagnostics.Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : - ts.Diagnostics.Return_type_of_public_property_getter_from_exported_class_has_or_is_using_name_0_from_private_module_1 : - ts.Diagnostics.Return_type_of_public_property_getter_from_exported_class_has_or_is_using_private_name_0; - } - return { - diagnosticMessage: diagnosticMessage, - errorNode: accessorWithTypeAnnotation.name, - typeName: undefined - }; - } - } - } - function writeFunctionDeclaration(node) { - if (ts.hasDynamicName(node)) { - return; - } - // If we are emitting Method/Constructor it isn't moduleElement and hence already determined to be emitting - // so no need to verify if the declaration is visible - if (!resolver.isImplementationOfOverload(node)) { - emitJsDocComments(node); - if (node.kind === 203 /* FunctionDeclaration */) { - emitModuleElementDeclarationFlags(node); - } - else if (node.kind === 136 /* MethodDeclaration */) { - emitClassMemberDeclarationFlags(node); - } - if (node.kind === 203 /* FunctionDeclaration */) { - write("function "); - writeTextOfNode(currentSourceFile, node.name); - } - else if (node.kind === 137 /* Constructor */) { - write("constructor"); - } - else { - writeTextOfNode(currentSourceFile, node.name); - if (ts.hasQuestionToken(node)) { - write("?"); - } - } - emitSignatureDeclaration(node); - } - } - function emitSignatureDeclarationWithJsDocComments(node) { - emitJsDocComments(node); - emitSignatureDeclaration(node); - } - function emitSignatureDeclaration(node) { - // Construct signature or constructor type write new Signature - if (node.kind === 141 /* ConstructSignature */ || node.kind === 146 /* ConstructorType */) { - write("new "); - } - emitTypeParameters(node.typeParameters); - if (node.kind === 142 /* IndexSignature */) { - write("["); - } - else { - write("("); - } - var prevEnclosingDeclaration = enclosingDeclaration; - enclosingDeclaration = node; - // Parameters - emitCommaList(node.parameters, emitParameterDeclaration); - if (node.kind === 142 /* IndexSignature */) { - write("]"); - } - else { - write(")"); - } - // If this is not a constructor and is not private, emit the return type - var isFunctionTypeOrConstructorType = node.kind === 145 /* FunctionType */ || node.kind === 146 /* ConstructorType */; - if (isFunctionTypeOrConstructorType || node.parent.kind === 148 /* TypeLiteral */) { - // Emit type literal signature return type only if specified - if (node.type) { - write(isFunctionTypeOrConstructorType ? " => " : ": "); - emitType(node.type); - } - } - else if (node.kind !== 137 /* Constructor */ && !(node.flags & 32 /* Private */)) { - writeReturnTypeAtSignature(node, getReturnTypeVisibilityError); - } - enclosingDeclaration = prevEnclosingDeclaration; - if (!isFunctionTypeOrConstructorType) { - write(";"); - writeLine(); - } - function getReturnTypeVisibilityError(symbolAccesibilityResult) { - var diagnosticMessage; - switch (node.kind) { - case 141 /* ConstructSignature */: - // Interfaces cannot have return types that cannot be named - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : - ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0; - break; - case 140 /* CallSignature */: - // Interfaces cannot have return types that cannot be named - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : - ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0; - break; - case 142 /* IndexSignature */: - // Interfaces cannot have return types that cannot be named - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : - ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0; - break; - case 136 /* MethodDeclaration */: - case 135 /* MethodSignature */: - if (node.flags & 128 /* Static */) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? - ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : - ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : - ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0; - } - else if (node.parent.kind === 204 /* ClassDeclaration */) { - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? - ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : - ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : - ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0; - } - else { - // Interfaces cannot have return types that cannot be named - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : - ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; - } - break; - case 203 /* FunctionDeclaration */: - diagnosticMessage = symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? - ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : - ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1 : - ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_private_name_0; - break; - default: - ts.Debug.fail("This is unknown kind for signature: " + node.kind); - } - return { - diagnosticMessage: diagnosticMessage, - errorNode: node.name || node - }; - } - } - function emitParameterDeclaration(node) { - increaseIndent(); - emitJsDocComments(node); - if (node.dotDotDotToken) { - write("..."); - } - if (ts.isBindingPattern(node.name)) { - // For bindingPattern, we can't simply writeTextOfNode from the source file - // because we want to omit the initializer and using writeTextOfNode will result in initializer get emitted. - // Therefore, we will have to recursively emit each element in the bindingPattern. - emitBindingPattern(node.name); - } - else { - writeTextOfNode(currentSourceFile, node.name); - } - if (node.initializer || ts.hasQuestionToken(node)) { - write("?"); - } - decreaseIndent(); - if (node.parent.kind === 145 /* FunctionType */ || - node.parent.kind === 146 /* ConstructorType */ || - node.parent.parent.kind === 148 /* TypeLiteral */) { - emitTypeOfVariableDeclarationFromTypeLiteral(node); - } - else if (!(node.parent.flags & 32 /* Private */)) { - writeTypeOfDeclaration(node, node.type, getParameterDeclarationTypeVisibilityError); - } - function getParameterDeclarationTypeVisibilityError(symbolAccesibilityResult) { - var diagnosticMessage = getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccesibilityResult); - return diagnosticMessage !== undefined ? { - diagnosticMessage: diagnosticMessage, - errorNode: node, - typeName: node.name - } : undefined; - } - function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccesibilityResult) { - switch (node.parent.kind) { - case 137 /* Constructor */: - return symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? - ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : - ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2 : - ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1; - case 141 /* ConstructSignature */: - // Interfaces cannot have parameter types that cannot be named - return symbolAccesibilityResult.errorModuleName ? - ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : - ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; - case 140 /* CallSignature */: - // Interfaces cannot have parameter types that cannot be named - return symbolAccesibilityResult.errorModuleName ? - ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : - ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; - case 136 /* MethodDeclaration */: - case 135 /* MethodSignature */: - if (node.parent.flags & 128 /* Static */) { - return symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? - ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : - ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : - ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; - } - else if (node.parent.parent.kind === 204 /* ClassDeclaration */) { - return symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? - ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : - ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : - ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; - } - else { - // Interfaces cannot have parameter types that cannot be named - return symbolAccesibilityResult.errorModuleName ? - ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : - ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; - } - case 203 /* FunctionDeclaration */: - return symbolAccesibilityResult.errorModuleName ? - symbolAccesibilityResult.accessibility === 2 /* CannotBeNamed */ ? - ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : - ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2 : - ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_private_name_1; - default: - ts.Debug.fail("This is unknown parent for parameter: " + node.parent.kind); - } - } - function emitBindingPattern(bindingPattern) { - // We have to explicitly emit square bracket and bracket because these tokens are not store inside the node. - if (bindingPattern.kind === 153 /* ObjectBindingPattern */) { - write("{"); - emitCommaList(bindingPattern.elements, emitBindingElement); - write("}"); - } - else if (bindingPattern.kind === 154 /* ArrayBindingPattern */) { - write("["); - var elements = bindingPattern.elements; - emitCommaList(elements, emitBindingElement); - if (elements && elements.hasTrailingComma) { - write(", "); - } - write("]"); - } - } - function emitBindingElement(bindingElement) { - function getBindingElementTypeVisibilityError(symbolAccesibilityResult) { - var diagnosticMessage = getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccesibilityResult); - return diagnosticMessage !== undefined ? { - diagnosticMessage: diagnosticMessage, - errorNode: bindingElement, - typeName: bindingElement.name - } : undefined; - } - if (bindingElement.kind === 178 /* OmittedExpression */) { - // If bindingElement is an omittedExpression (i.e. containing elision), - // we will emit blank space (although this may differ from users' original code, - // it allows emitSeparatedList to write separator appropriately) - // Example: - // original: function foo([, x, ,]) {} - // emit : function foo([ , x, , ]) {} - write(" "); - } - else if (bindingElement.kind === 155 /* BindingElement */) { - if (bindingElement.propertyName) { - // bindingElement has propertyName property in the following case: - // { y: [a,b,c] ...} -> bindingPattern will have a property called propertyName for "y" - // We have to explicitly emit the propertyName before descending into its binding elements. - // Example: - // original: function foo({y: [a,b,c]}) {} - // emit : declare function foo({y: [a, b, c]}: { y: [any, any, any] }) void; - writeTextOfNode(currentSourceFile, bindingElement.propertyName); - write(": "); - // If bindingElement has propertyName property, then its name must be another bindingPattern of SyntaxKind.ObjectBindingPattern - emitBindingPattern(bindingElement.name); - } - else if (bindingElement.name) { - if (ts.isBindingPattern(bindingElement.name)) { - // If it is a nested binding pattern, we will recursively descend into each element and emit each one separately. - // In the case of rest element, we will omit rest element. - // Example: - // original: function foo([a, [[b]], c] = [1,[["string"]], 3]) {} - // emit : declare function foo([a, [[b]], c]: [number, [[string]], number]): void; - // original with rest: function foo([a, ...c]) {} - // emit : declare function foo([a, ...c]): void; - emitBindingPattern(bindingElement.name); - } - else { - ts.Debug.assert(bindingElement.name.kind === 65 /* Identifier */); - // If the node is just an identifier, we will simply emit the text associated with the node's name - // Example: - // original: function foo({y = 10, x}) {} - // emit : declare function foo({y, x}: {number, any}): void; - if (bindingElement.dotDotDotToken) { - write("..."); - } - writeTextOfNode(currentSourceFile, bindingElement.name); - } - } - } - } - } - function emitNode(node) { - switch (node.kind) { - case 203 /* FunctionDeclaration */: - case 208 /* ModuleDeclaration */: - case 211 /* ImportEqualsDeclaration */: - case 205 /* InterfaceDeclaration */: - case 204 /* ClassDeclaration */: - case 206 /* TypeAliasDeclaration */: - case 207 /* EnumDeclaration */: - return emitModuleElement(node, isModuleElementVisible(node)); - case 183 /* VariableStatement */: - return emitModuleElement(node, isVariableStatementVisible(node)); - case 212 /* ImportDeclaration */: - // Import declaration without import clause is visible, otherwise it is not visible - return emitModuleElement(node, !node.importClause); - case 218 /* ExportDeclaration */: - return emitExportDeclaration(node); - case 137 /* Constructor */: - case 136 /* MethodDeclaration */: - case 135 /* MethodSignature */: - return writeFunctionDeclaration(node); - case 141 /* ConstructSignature */: - case 140 /* CallSignature */: - case 142 /* IndexSignature */: - return emitSignatureDeclarationWithJsDocComments(node); - case 138 /* GetAccessor */: - case 139 /* SetAccessor */: - return emitAccessorDeclaration(node); - case 134 /* PropertyDeclaration */: - case 133 /* PropertySignature */: - return emitPropertyDeclaration(node); - case 229 /* EnumMember */: - return emitEnumMemberDeclaration(node); - case 217 /* ExportAssignment */: - return emitExportAssignment(node); - case 230 /* SourceFile */: - return emitSourceFile(node); - } - } - function writeReferencePath(referencedFile) { - var declFileName = referencedFile.flags & 2048 /* DeclarationFile */ - ? referencedFile.fileName // Declaration file, use declaration file name - : ts.shouldEmitToOwnFile(referencedFile, compilerOptions) - ? ts.getOwnEmitOutputFilePath(referencedFile, host, ".d.ts") // Own output file so get the .d.ts file - : ts.removeFileExtension(compilerOptions.out) + ".d.ts"; // Global out file - declFileName = ts.getRelativePathToDirectoryOrUrl(ts.getDirectoryPath(ts.normalizeSlashes(jsFilePath)), declFileName, host.getCurrentDirectory(), host.getCanonicalFileName, - /*isAbsolutePathAnUrl*/ false); - referencePathsOutput += "/// " + newLine; - } - } - /* @internal */ - function writeDeclarationFile(jsFilePath, sourceFile, host, resolver, diagnostics) { - var emitDeclarationResult = emitDeclarations(host, resolver, diagnostics, jsFilePath, sourceFile); - // TODO(shkamat): Should we not write any declaration file if any of them can produce error, - // or should we just not write this file like we are doing now - if (!emitDeclarationResult.reportedDeclarationError) { - var declarationOutput = emitDeclarationResult.referencePathsOutput - + getDeclarationOutput(emitDeclarationResult.synchronousDeclarationOutput, emitDeclarationResult.moduleElementDeclarationEmitInfo); - ts.writeFile(host, diagnostics, ts.removeFileExtension(jsFilePath) + ".d.ts", declarationOutput, host.getCompilerOptions().emitBOM); - } - function getDeclarationOutput(synchronousDeclarationOutput, moduleElementDeclarationEmitInfo) { - var appliedSyncOutputPos = 0; - var declarationOutput = ""; - // apply asynchronous additions to the synchronous output - ts.forEach(moduleElementDeclarationEmitInfo, function (aliasEmitInfo) { - if (aliasEmitInfo.asynchronousOutput) { - declarationOutput += synchronousDeclarationOutput.substring(appliedSyncOutputPos, aliasEmitInfo.outputPos); - declarationOutput += getDeclarationOutput(aliasEmitInfo.asynchronousOutput, aliasEmitInfo.subModuleElementDeclarationEmitInfo); - appliedSyncOutputPos = aliasEmitInfo.outputPos; - } - }); - declarationOutput += synchronousDeclarationOutput.substring(appliedSyncOutputPos); - return declarationOutput; - } - } - ts.writeDeclarationFile = writeDeclarationFile; -})(ts || (ts = {})); -/// -/// -/* @internal */ -var ts; -(function (ts) { - function isExternalModuleOrDeclarationFile(sourceFile) { - return ts.isExternalModule(sourceFile) || ts.isDeclarationFile(sourceFile); - } - ts.isExternalModuleOrDeclarationFile = isExternalModuleOrDeclarationFile; - // Flags enum to track count of temp variables and a few dedicated names - var TempFlags; - (function (TempFlags) { - TempFlags[TempFlags["Auto"] = 0] = "Auto"; - TempFlags[TempFlags["CountMask"] = 268435455] = "CountMask"; - TempFlags[TempFlags["_i"] = 268435456] = "_i"; - })(TempFlags || (TempFlags = {})); - // targetSourceFile is when users only want one file in entire project to be emitted. This is used in compileOnSave feature - function emitFiles(resolver, host, targetSourceFile) { - // emit output for the __extends helper function - var extendsHelper = "\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n __.prototype = b.prototype;\n d.prototype = new __();\n};"; - // emit output for the __decorate helper function - var decorateHelper = "\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") return Reflect.decorate(decorators, target, key, desc);\n switch (arguments.length) {\n case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);\n case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);\n case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);\n }\n};"; - // emit output for the __metadata helper function - var metadataHelper = "\nvar __metadata = (this && this.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};"; - // emit output for the __param helper function - var paramHelper = "\nvar __param = (this && this.__param) || function (paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n};"; - var compilerOptions = host.getCompilerOptions(); - var languageVersion = compilerOptions.target || 0 /* ES3 */; - var sourceMapDataList = compilerOptions.sourceMap || compilerOptions.inlineSourceMap ? [] : undefined; - var diagnostics = []; - var newLine = host.getNewLine(); - if (targetSourceFile === undefined) { - ts.forEach(host.getSourceFiles(), function (sourceFile) { - if (ts.shouldEmitToOwnFile(sourceFile, compilerOptions)) { - var jsFilePath = ts.getOwnEmitOutputFilePath(sourceFile, host, ".js"); - emitFile(jsFilePath, sourceFile); - } - }); - if (compilerOptions.out) { - emitFile(compilerOptions.out); - } - } - else { - // targetSourceFile is specified (e.g calling emitter from language service or calling getSemanticDiagnostic from language service) - if (ts.shouldEmitToOwnFile(targetSourceFile, compilerOptions)) { - var jsFilePath = ts.getOwnEmitOutputFilePath(targetSourceFile, host, ".js"); - emitFile(jsFilePath, targetSourceFile); - } - else if (!ts.isDeclarationFile(targetSourceFile) && compilerOptions.out) { - emitFile(compilerOptions.out); - } - } - // Sort and make the unique list of diagnostics - diagnostics = ts.sortAndDeduplicateDiagnostics(diagnostics); - return { - emitSkipped: false, - diagnostics: diagnostics, - sourceMaps: sourceMapDataList - }; - function isNodeDescendentOf(node, ancestor) { - while (node) { - if (node === ancestor) - return true; - node = node.parent; - } - return false; - } - function isUniqueLocalName(name, container) { - for (var node = container; isNodeDescendentOf(node, container); node = node.nextContainer) { - if (node.locals && ts.hasProperty(node.locals, name)) { - // We conservatively include alias symbols to cover cases where they're emitted as locals - if (node.locals[name].flags & (107455 /* Value */ | 1048576 /* ExportValue */ | 8388608 /* Alias */)) { - return false; - } - } - } - return true; - } - function emitJavaScript(jsFilePath, root) { - var writer = ts.createTextWriter(newLine); - var write = writer.write; - var writeTextOfNode = writer.writeTextOfNode; - var writeLine = writer.writeLine; - var increaseIndent = writer.increaseIndent; - var decreaseIndent = writer.decreaseIndent; - var currentSourceFile; - // name of an exporter function if file is a System external module - // System.register([...], function () {...}) - // exporting in System modules looks like: - // export var x; ... x = 1 - // => - // var x;... exporter("x", x = 1) - var exportFunctionForFile; - var generatedNameSet = {}; - var nodeToGeneratedName = []; - var computedPropertyNamesToGeneratedNames; - var extendsEmitted = false; - var decorateEmitted = false; - var paramEmitted = false; - var tempFlags = 0; - var tempVariables; - var tempParameters; - var externalImports; - var exportSpecifiers; - var exportEquals; - var hasExportStars; - /** Write emitted output to disk */ - var writeEmittedFiles = writeJavaScriptFile; - var detachedCommentsInfo; - var writeComment = ts.writeCommentRange; - /** Emit a node */ - var emit = emitNodeWithoutSourceMap; - /** Called just before starting emit of a node */ - var emitStart = function (node) { }; - /** Called once the emit of the node is done */ - var emitEnd = function (node) { }; - /** Emit the text for the given token that comes after startPos - * This by default writes the text provided with the given tokenKind - * but if optional emitFn callback is provided the text is emitted using the callback instead of default text - * @param tokenKind the kind of the token to search and emit - * @param startPos the position in the source to start searching for the token - * @param emitFn if given will be invoked to emit the text instead of actual token emit */ - var emitToken = emitTokenText; - /** Called to before starting the lexical scopes as in function/class in the emitted code because of node - * @param scopeDeclaration node that starts the lexical scope - * @param scopeName Optional name of this scope instead of deducing one from the declaration node */ - var scopeEmitStart = function (scopeDeclaration, scopeName) { }; - /** Called after coming out of the scope */ - var scopeEmitEnd = function () { }; - /** Sourcemap data that will get encoded */ - var sourceMapData; - if (compilerOptions.sourceMap || compilerOptions.inlineSourceMap) { - initializeEmitterWithSourceMaps(); - } - if (root) { - // Do not call emit directly. It does not set the currentSourceFile. - emitSourceFile(root); - } - else { - ts.forEach(host.getSourceFiles(), function (sourceFile) { - if (!isExternalModuleOrDeclarationFile(sourceFile)) { - emitSourceFile(sourceFile); - } - }); - } - writeLine(); - writeEmittedFiles(writer.getText(), compilerOptions.emitBOM); - if (compilerOptions.dependency && root && compilerOptions.module) { - emitDependencyFile(root); - } - return; - function emitDependencyFile(sourceFile) { - var depFile = ts.removeFileExtension(jsFilePath) + '.dep.json'; - var runtime = []; - var compileTime = []; - for (var _a = 0, _b = root.amdDependencies; _a < _b.length; _a++) { - var node = _b[_a]; - runtime.push(node.path); - } - function processExternalDeclaration(node) { - var name = getExternalModuleNameText(node); - if (name) { - if (name.length >= 2) { - var first = name[0]; - var last = name[name.length - 1]; - if ((first == '"' || first == "'") && (last == '"' || last == "'")) { - name = name.substring(1, name.length - 1); - } - } - if (isExternalDepedency(node)) { - runtime.push(name); - } - else { - compileTime.push(name); - } - } - } - function isExternalDepedency(node) { - for (var _a = 0; _a < externalImports.length; _a++) { - var external_1 = externalImports[_a]; - if (node === external_1) { - return true; - } - } - return false; - } - for (var _c = 0, _d = root.statements; _c < _d.length; _c++) { - var node = _d[_c]; - var name_19; - switch (node.kind) { - case 212 /* ImportDeclaration */: - processExternalDeclaration(node); - break; - case 211 /* ImportEqualsDeclaration */: - processExternalDeclaration(node); - break; - case 218 /* ExportDeclaration */: - var exportDeclaration = node; - if (exportDeclaration.moduleSpecifier) { - processExternalDeclaration(node); - } - break; - } - } - var dep = { - filePath: root.fileName, - compileTime: compileTime, - runtime: runtime - }; - ts.writeFile(host, [], depFile, JSON.stringify(dep, null, 4), compilerOptions.emitBOM); - } - function emitSourceFile(sourceFile) { - currentSourceFile = sourceFile; - exportFunctionForFile = undefined; - emit(sourceFile); - } - function isUniqueName(name) { - return !resolver.hasGlobalName(name) && - !ts.hasProperty(currentSourceFile.identifiers, name) && - !ts.hasProperty(generatedNameSet, name); - } - // Return the next available name in the pattern _a ... _z, _0, _1, ... - // TempFlags._i or TempFlags._n may be used to express a preference for that dedicated name. - // Note that names generated by makeTempVariableName and makeUniqueName will never conflict. - function makeTempVariableName(flags) { - if (flags && !(tempFlags & flags)) { - var name = flags === 268435456 /* _i */ ? "_i" : "_n"; - if (isUniqueName(name)) { - tempFlags |= flags; - return name; - } - } - while (true) { - var count = tempFlags & 268435455 /* CountMask */; - tempFlags++; - // Skip over 'i' and 'n' - if (count !== 8 && count !== 13) { - var name_20 = count < 26 ? "_" + String.fromCharCode(97 /* a */ + count) : "_" + (count - 26); - if (isUniqueName(name_20)) { - return name_20; - } - } - } - } - // Generate a name that is unique within the current file and doesn't conflict with any names - // in global scope. The name is formed by adding an '_n' suffix to the specified base name, - // where n is a positive integer. Note that names generated by makeTempVariableName and - // makeUniqueName are guaranteed to never conflict. - function makeUniqueName(baseName) { - // Find the first unique 'name_n', where n is a positive number - if (baseName.charCodeAt(baseName.length - 1) !== 95 /* _ */) { - baseName += "_"; - } - var i = 1; - while (true) { - var generatedName = baseName + i; - if (isUniqueName(generatedName)) { - return generatedNameSet[generatedName] = generatedName; - } - i++; - } - } - function generateNameForModuleOrEnum(node) { - var name = node.name.text; - // Use module/enum name itself if it is unique, otherwise make a unique variation - return isUniqueLocalName(name, node) ? name : makeUniqueName(name); - } - function generateNameForImportOrExportDeclaration(node) { - var expr = ts.getExternalModuleName(node); - var baseName = expr.kind === 8 /* StringLiteral */ ? - ts.escapeIdentifier(ts.makeIdentifierFromModuleName(expr.text)) : "module"; - return makeUniqueName(baseName); - } - function generateNameForExportDefault() { - return makeUniqueName("default"); - } - function generateNameForNode(node) { - switch (node.kind) { - case 65 /* Identifier */: - return makeUniqueName(node.text); - case 208 /* ModuleDeclaration */: - case 207 /* EnumDeclaration */: - return generateNameForModuleOrEnum(node); - case 212 /* ImportDeclaration */: - case 218 /* ExportDeclaration */: - return generateNameForImportOrExportDeclaration(node); - case 203 /* FunctionDeclaration */: - case 204 /* ClassDeclaration */: - case 177 /* ClassExpression */: - case 217 /* ExportAssignment */: - return generateNameForExportDefault(); - } - } - function getGeneratedNameForNode(node) { - var id = ts.getNodeId(node); - return nodeToGeneratedName[id] || (nodeToGeneratedName[id] = ts.unescapeIdentifier(generateNameForNode(node))); - } - function initializeEmitterWithSourceMaps() { - var sourceMapDir; // The directory in which sourcemap will be - // Current source map file and its index in the sources list - var sourceMapSourceIndex = -1; - // Names and its index map - var sourceMapNameIndexMap = {}; - var sourceMapNameIndices = []; - function getSourceMapNameIndex() { - return sourceMapNameIndices.length ? ts.lastOrUndefined(sourceMapNameIndices) : -1; - } - // Last recorded and encoded spans - var lastRecordedSourceMapSpan; - var lastEncodedSourceMapSpan = { - emittedLine: 1, - emittedColumn: 1, - sourceLine: 1, - sourceColumn: 1, - sourceIndex: 0 - }; - var lastEncodedNameIndex = 0; - // Encoding for sourcemap span - function encodeLastRecordedSourceMapSpan() { - if (!lastRecordedSourceMapSpan || lastRecordedSourceMapSpan === lastEncodedSourceMapSpan) { - return; - } - var prevEncodedEmittedColumn = lastEncodedSourceMapSpan.emittedColumn; - // Line/Comma delimiters - if (lastEncodedSourceMapSpan.emittedLine == lastRecordedSourceMapSpan.emittedLine) { - // Emit comma to separate the entry - if (sourceMapData.sourceMapMappings) { - sourceMapData.sourceMapMappings += ","; - } - } - else { - // Emit line delimiters - for (var encodedLine = lastEncodedSourceMapSpan.emittedLine; encodedLine < lastRecordedSourceMapSpan.emittedLine; encodedLine++) { - sourceMapData.sourceMapMappings += ";"; - } - prevEncodedEmittedColumn = 1; - } - // 1. Relative Column 0 based - sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.emittedColumn - prevEncodedEmittedColumn); - // 2. Relative sourceIndex - sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.sourceIndex - lastEncodedSourceMapSpan.sourceIndex); - // 3. Relative sourceLine 0 based - sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.sourceLine - lastEncodedSourceMapSpan.sourceLine); - // 4. Relative sourceColumn 0 based - sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.sourceColumn - lastEncodedSourceMapSpan.sourceColumn); - // 5. Relative namePosition 0 based - if (lastRecordedSourceMapSpan.nameIndex >= 0) { - sourceMapData.sourceMapMappings += base64VLQFormatEncode(lastRecordedSourceMapSpan.nameIndex - lastEncodedNameIndex); - lastEncodedNameIndex = lastRecordedSourceMapSpan.nameIndex; - } - lastEncodedSourceMapSpan = lastRecordedSourceMapSpan; - sourceMapData.sourceMapDecodedMappings.push(lastEncodedSourceMapSpan); - function base64VLQFormatEncode(inValue) { - function base64FormatEncode(inValue) { - if (inValue < 64) { - return 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.charAt(inValue); - } - throw TypeError(inValue + ": not a 64 based value"); - } - // Add a new least significant bit that has the sign of the value. - // if negative number the least significant bit that gets added to the number has value 1 - // else least significant bit value that gets added is 0 - // eg. -1 changes to binary : 01 [1] => 3 - // +1 changes to binary : 01 [0] => 2 - if (inValue < 0) { - inValue = ((-inValue) << 1) + 1; - } - else { - inValue = inValue << 1; - } - // Encode 5 bits at a time starting from least significant bits - var encodedStr = ""; - do { - var currentDigit = inValue & 31; // 11111 - inValue = inValue >> 5; - if (inValue > 0) { - // There are still more digits to decode, set the msb (6th bit) - currentDigit = currentDigit | 32; - } - encodedStr = encodedStr + base64FormatEncode(currentDigit); - } while (inValue > 0); - return encodedStr; - } - } - function recordSourceMapSpan(pos) { - var sourceLinePos = ts.getLineAndCharacterOfPosition(currentSourceFile, pos); - // Convert the location to be one-based. - sourceLinePos.line++; - sourceLinePos.character++; - var emittedLine = writer.getLine(); - var emittedColumn = writer.getColumn(); - // If this location wasn't recorded or the location in source is going backwards, record the span - if (!lastRecordedSourceMapSpan || - lastRecordedSourceMapSpan.emittedLine != emittedLine || - lastRecordedSourceMapSpan.emittedColumn != emittedColumn || - (lastRecordedSourceMapSpan.sourceIndex === sourceMapSourceIndex && - (lastRecordedSourceMapSpan.sourceLine > sourceLinePos.line || - (lastRecordedSourceMapSpan.sourceLine === sourceLinePos.line && lastRecordedSourceMapSpan.sourceColumn > sourceLinePos.character)))) { - // Encode the last recordedSpan before assigning new - encodeLastRecordedSourceMapSpan(); - // New span - lastRecordedSourceMapSpan = { - emittedLine: emittedLine, - emittedColumn: emittedColumn, - sourceLine: sourceLinePos.line, - sourceColumn: sourceLinePos.character, - nameIndex: getSourceMapNameIndex(), - sourceIndex: sourceMapSourceIndex - }; - } - else { - // Take the new pos instead since there is no change in emittedLine and column since last location - lastRecordedSourceMapSpan.sourceLine = sourceLinePos.line; - lastRecordedSourceMapSpan.sourceColumn = sourceLinePos.character; - lastRecordedSourceMapSpan.sourceIndex = sourceMapSourceIndex; - } - } - function recordEmitNodeStartSpan(node) { - // Get the token pos after skipping to the token (ignoring the leading trivia) - recordSourceMapSpan(ts.skipTrivia(currentSourceFile.text, node.pos)); - } - function recordEmitNodeEndSpan(node) { - recordSourceMapSpan(node.end); - } - function writeTextWithSpanRecord(tokenKind, startPos, emitFn) { - var tokenStartPos = ts.skipTrivia(currentSourceFile.text, startPos); - recordSourceMapSpan(tokenStartPos); - var tokenEndPos = emitTokenText(tokenKind, tokenStartPos, emitFn); - recordSourceMapSpan(tokenEndPos); - return tokenEndPos; - } - function recordNewSourceFileStart(node) { - // Add the file to tsFilePaths - // If sourceroot option: Use the relative path corresponding to the common directory path - // otherwise source locations relative to map file location - var sourcesDirectoryPath = compilerOptions.sourceRoot ? host.getCommonSourceDirectory() : sourceMapDir; - sourceMapData.sourceMapSources.push(ts.getRelativePathToDirectoryOrUrl(sourcesDirectoryPath, node.fileName, host.getCurrentDirectory(), host.getCanonicalFileName, - /*isAbsolutePathAnUrl*/ true)); - sourceMapSourceIndex = sourceMapData.sourceMapSources.length - 1; - // The one that can be used from program to get the actual source file - sourceMapData.inputSourceFileNames.push(node.fileName); - if (compilerOptions.inlineSources) { - if (!sourceMapData.sourceMapSourcesContent) { - sourceMapData.sourceMapSourcesContent = []; - } - sourceMapData.sourceMapSourcesContent.push(node.text); - } - } - function recordScopeNameOfNode(node, scopeName) { - function recordScopeNameIndex(scopeNameIndex) { - sourceMapNameIndices.push(scopeNameIndex); - } - function recordScopeNameStart(scopeName) { - var scopeNameIndex = -1; - if (scopeName) { - var parentIndex = getSourceMapNameIndex(); - if (parentIndex !== -1) { - // Child scopes are always shown with a dot (even if they have no name), - // unless it is a computed property. Then it is shown with brackets, - // but the brackets are included in the name. - var name_21 = node.name; - if (!name_21 || name_21.kind !== 129 /* ComputedPropertyName */) { - scopeName = "." + scopeName; - } - scopeName = sourceMapData.sourceMapNames[parentIndex] + scopeName; - } - scopeNameIndex = ts.getProperty(sourceMapNameIndexMap, scopeName); - if (scopeNameIndex === undefined) { - scopeNameIndex = sourceMapData.sourceMapNames.length; - sourceMapData.sourceMapNames.push(scopeName); - sourceMapNameIndexMap[scopeName] = scopeNameIndex; - } - } - recordScopeNameIndex(scopeNameIndex); - } - if (scopeName) { - // The scope was already given a name use it - recordScopeNameStart(scopeName); - } - else if (node.kind === 203 /* FunctionDeclaration */ || - node.kind === 165 /* FunctionExpression */ || - node.kind === 136 /* MethodDeclaration */ || - node.kind === 135 /* MethodSignature */ || - node.kind === 138 /* GetAccessor */ || - node.kind === 139 /* SetAccessor */ || - node.kind === 208 /* ModuleDeclaration */ || - node.kind === 204 /* ClassDeclaration */ || - node.kind === 207 /* EnumDeclaration */) { - // Declaration and has associated name use it - if (node.name) { - var name_22 = node.name; - // For computed property names, the text will include the brackets - scopeName = name_22.kind === 129 /* ComputedPropertyName */ - ? ts.getTextOfNode(name_22) - : node.name.text; - } - recordScopeNameStart(scopeName); - } - else { - // Block just use the name from upper level scope - recordScopeNameIndex(getSourceMapNameIndex()); - } - } - function recordScopeNameEnd() { - sourceMapNameIndices.pop(); - } - ; - function writeCommentRangeWithMap(curentSourceFile, writer, comment, newLine) { - recordSourceMapSpan(comment.pos); - ts.writeCommentRange(currentSourceFile, writer, comment, newLine); - recordSourceMapSpan(comment.end); - } - function serializeSourceMapContents(version, file, sourceRoot, sources, names, mappings, sourcesContent) { - if (typeof JSON !== "undefined") { - var map_1 = { - version: version, - file: file, - sourceRoot: sourceRoot, - sources: sources, - names: names, - mappings: mappings - }; - if (sourcesContent !== undefined) { - map_1.sourcesContent = sourcesContent; - } - return JSON.stringify(map_1); - } - return "{\"version\":" + version + ",\"file\":\"" + ts.escapeString(file) + "\",\"sourceRoot\":\"" + ts.escapeString(sourceRoot) + "\",\"sources\":[" + serializeStringArray(sources) + "],\"names\":[" + serializeStringArray(names) + "],\"mappings\":\"" + ts.escapeString(mappings) + "\" " + (sourcesContent !== undefined ? ",\"sourcesContent\":[" + serializeStringArray(sourcesContent) + "]" : "") + "}"; - function serializeStringArray(list) { - var output = ""; - for (var i = 0, n = list.length; i < n; i++) { - if (i) { - output += ","; - } - output += "\"" + ts.escapeString(list[i]) + "\""; - } - return output; - } - } - function writeJavaScriptAndSourceMapFile(emitOutput, writeByteOrderMark) { - encodeLastRecordedSourceMapSpan(); - var sourceMapText = serializeSourceMapContents(3, sourceMapData.sourceMapFile, sourceMapData.sourceMapSourceRoot, sourceMapData.sourceMapSources, sourceMapData.sourceMapNames, sourceMapData.sourceMapMappings, sourceMapData.sourceMapSourcesContent); - sourceMapDataList.push(sourceMapData); - var sourceMapUrl; - if (compilerOptions.inlineSourceMap) { - // Encode the sourceMap into the sourceMap url - var base64SourceMapText = ts.convertToBase64(sourceMapText); - sourceMapUrl = "//# sourceMappingURL=data:application/json;base64," + base64SourceMapText; - } - else { - // Write source map file - ts.writeFile(host, diagnostics, sourceMapData.sourceMapFilePath, sourceMapText, false); - sourceMapUrl = "//# sourceMappingURL=" + sourceMapData.jsSourceMappingURL; - } - // Write sourcemap url to the js file and write the js file - writeJavaScriptFile(emitOutput + sourceMapUrl, writeByteOrderMark); - } - // Initialize source map data - var sourceMapJsFile = ts.getBaseFileName(ts.normalizeSlashes(jsFilePath)); - sourceMapData = { - sourceMapFilePath: jsFilePath + ".map", - jsSourceMappingURL: sourceMapJsFile + ".map", - sourceMapFile: sourceMapJsFile, - sourceMapSourceRoot: compilerOptions.sourceRoot || "", - sourceMapSources: [], - inputSourceFileNames: [], - sourceMapNames: [], - sourceMapMappings: "", - sourceMapSourcesContent: undefined, - sourceMapDecodedMappings: [] - }; - // Normalize source root and make sure it has trailing "/" so that it can be used to combine paths with the - // relative paths of the sources list in the sourcemap - sourceMapData.sourceMapSourceRoot = ts.normalizeSlashes(sourceMapData.sourceMapSourceRoot); - if (sourceMapData.sourceMapSourceRoot.length && sourceMapData.sourceMapSourceRoot.charCodeAt(sourceMapData.sourceMapSourceRoot.length - 1) !== 47 /* slash */) { - sourceMapData.sourceMapSourceRoot += ts.directorySeparator; - } - if (compilerOptions.mapRoot) { - sourceMapDir = ts.normalizeSlashes(compilerOptions.mapRoot); - if (root) { - // For modules or multiple emit files the mapRoot will have directory structure like the sources - // So if src\a.ts and src\lib\b.ts are compiled together user would be moving the maps into mapRoot\a.js.map and mapRoot\lib\b.js.map - sourceMapDir = ts.getDirectoryPath(ts.getSourceFilePathInNewDir(root, host, sourceMapDir)); - } - if (!ts.isRootedDiskPath(sourceMapDir) && !ts.isUrl(sourceMapDir)) { - // The relative paths are relative to the common directory - sourceMapDir = ts.combinePaths(host.getCommonSourceDirectory(), sourceMapDir); - sourceMapData.jsSourceMappingURL = ts.getRelativePathToDirectoryOrUrl(ts.getDirectoryPath(ts.normalizePath(jsFilePath)), ts.combinePaths(sourceMapDir, sourceMapData.jsSourceMappingURL), host.getCurrentDirectory(), host.getCanonicalFileName, - /*isAbsolutePathAnUrl*/ true); - } - else { - sourceMapData.jsSourceMappingURL = ts.combinePaths(sourceMapDir, sourceMapData.jsSourceMappingURL); - } - } - else { - sourceMapDir = ts.getDirectoryPath(ts.normalizePath(jsFilePath)); - } - function emitNodeWithSourceMap(node) { - if (node) { - if (ts.nodeIsSynthesized(node)) { - return emitNodeWithoutSourceMap(node); - } - if (node.kind != 230 /* SourceFile */) { - recordEmitNodeStartSpan(node); - emitNodeWithoutSourceMap(node); - recordEmitNodeEndSpan(node); - } - else { - recordNewSourceFileStart(node); - emitNodeWithoutSourceMap(node); - } - } - } - writeEmittedFiles = writeJavaScriptAndSourceMapFile; - emit = emitNodeWithSourceMap; - emitStart = recordEmitNodeStartSpan; - emitEnd = recordEmitNodeEndSpan; - emitToken = writeTextWithSpanRecord; - scopeEmitStart = recordScopeNameOfNode; - scopeEmitEnd = recordScopeNameEnd; - writeComment = writeCommentRangeWithMap; - } - function writeJavaScriptFile(emitOutput, writeByteOrderMark) { - ts.writeFile(host, diagnostics, jsFilePath, emitOutput, writeByteOrderMark); - } - // Create a temporary variable with a unique unused name. - function createTempVariable(flags) { - var result = ts.createSynthesizedNode(65 /* Identifier */); - result.text = makeTempVariableName(flags); - return result; - } - function recordTempDeclaration(name) { - if (!tempVariables) { - tempVariables = []; - } - tempVariables.push(name); - } - function createAndRecordTempVariable(flags) { - var temp = createTempVariable(flags); - recordTempDeclaration(temp); - return temp; - } - function emitTempDeclarations(newLine) { - if (tempVariables) { - if (newLine) { - writeLine(); - } - else { - write(" "); - } - write("var "); - emitCommaList(tempVariables); - write(";"); - } - } - function emitTokenText(tokenKind, startPos, emitFn) { - var tokenString = ts.tokenToString(tokenKind); - if (emitFn) { - emitFn(); - } - else { - write(tokenString); - } - return startPos + tokenString.length; - } - function emitOptional(prefix, node) { - if (node) { - write(prefix); - emit(node); - } - } - function emitParenthesizedIf(node, parenthesized) { - if (parenthesized) { - write("("); - } - emit(node); - if (parenthesized) { - write(")"); - } - } - function emitTrailingCommaIfPresent(nodeList) { - if (nodeList.hasTrailingComma) { - write(","); - } - } - function emitLinePreservingList(parent, nodes, allowTrailingComma, spacesBetweenBraces) { - ts.Debug.assert(nodes.length > 0); - increaseIndent(); - if (nodeStartPositionsAreOnSameLine(parent, nodes[0])) { - if (spacesBetweenBraces) { - write(" "); - } - } - else { - writeLine(); - } - for (var i = 0, n = nodes.length; i < n; i++) { - if (i) { - if (nodeEndIsOnSameLineAsNodeStart(nodes[i - 1], nodes[i])) { - write(", "); - } - else { - write(","); - writeLine(); - } - } - emit(nodes[i]); - } - if (nodes.hasTrailingComma && allowTrailingComma) { - write(","); - } - decreaseIndent(); - if (nodeEndPositionsAreOnSameLine(parent, ts.lastOrUndefined(nodes))) { - if (spacesBetweenBraces) { - write(" "); - } - } - else { - writeLine(); - } - } - function emitList(nodes, start, count, multiLine, trailingComma, leadingComma, noTrailingNewLine, emitNode) { - if (!emitNode) { - emitNode = emit; - } - for (var i = 0; i < count; i++) { - if (multiLine) { - if (i || leadingComma) { - write(","); - } - writeLine(); - } - else { - if (i || leadingComma) { - write(", "); - } - } - emitNode(nodes[start + i]); - leadingComma = true; - } - if (trailingComma) { - write(","); - } - if (multiLine && !noTrailingNewLine) { - writeLine(); - } - return count; - } - function emitCommaList(nodes) { - if (nodes) { - emitList(nodes, 0, nodes.length, false, false); - } - } - function emitLines(nodes) { - emitLinesStartingAt(nodes, 0); - } - function emitLinesStartingAt(nodes, startIndex) { - for (var i = startIndex; i < nodes.length; i++) { - writeLine(); - emit(nodes[i]); - } - } - function isBinaryOrOctalIntegerLiteral(node, text) { - if (node.kind === 7 /* NumericLiteral */ && text.length > 1) { - switch (text.charCodeAt(1)) { - case 98 /* b */: - case 66 /* B */: - case 111 /* o */: - case 79 /* O */: - return true; - } - } - return false; - } - function emitLiteral(node) { - var text = getLiteralText(node); - if ((compilerOptions.sourceMap || compilerOptions.inlineSourceMap) && (node.kind === 8 /* StringLiteral */ || ts.isTemplateLiteralKind(node.kind))) { - writer.writeLiteral(text); - } - else if (languageVersion < 2 /* ES6 */ && isBinaryOrOctalIntegerLiteral(node, text)) { - write(node.text); - } - else { - write(text); - } - } - function getLiteralText(node) { - // Any template literal or string literal with an extended escape - // (e.g. "\u{0067}") will need to be downleveled as a escaped string literal. - if (languageVersion < 2 /* ES6 */ && (ts.isTemplateLiteralKind(node.kind) || node.hasExtendedUnicodeEscape)) { - return getQuotedEscapedLiteralText('"', node.text, '"'); - } - // If we don't need to downlevel and we can reach the original source text using - // the node's parent reference, then simply get the text as it was originally written. - if (node.parent) { - return ts.getSourceTextOfNodeFromSourceFile(currentSourceFile, node); - } - // If we can't reach the original source text, use the canonical form if it's a number, - // or an escaped quoted form of the original text if it's string-like. - switch (node.kind) { - case 8 /* StringLiteral */: - return getQuotedEscapedLiteralText('"', node.text, '"'); - case 10 /* NoSubstitutionTemplateLiteral */: - return getQuotedEscapedLiteralText('`', node.text, '`'); - case 11 /* TemplateHead */: - return getQuotedEscapedLiteralText('`', node.text, '${'); - case 12 /* TemplateMiddle */: - return getQuotedEscapedLiteralText('}', node.text, '${'); - case 13 /* TemplateTail */: - return getQuotedEscapedLiteralText('}', node.text, '`'); - case 7 /* NumericLiteral */: - return node.text; - } - ts.Debug.fail("Literal kind '" + node.kind + "' not accounted for."); - } - function getQuotedEscapedLiteralText(leftQuote, text, rightQuote) { - return leftQuote + ts.escapeNonAsciiCharacters(ts.escapeString(text)) + rightQuote; - } - function emitDownlevelRawTemplateLiteral(node) { - // Find original source text, since we need to emit the raw strings of the tagged template. - // The raw strings contain the (escaped) strings of what the user wrote. - // Examples: `\n` is converted to "\\n", a template string with a newline to "\n". - var text = ts.getSourceTextOfNodeFromSourceFile(currentSourceFile, node); - // text contains the original source, it will also contain quotes ("`"), dolar signs and braces ("${" and "}"), - // thus we need to remove those characters. - // First template piece starts with "`", others with "}" - // Last template piece ends with "`", others with "${" - var isLast = node.kind === 10 /* NoSubstitutionTemplateLiteral */ || node.kind === 13 /* TemplateTail */; - text = text.substring(1, text.length - (isLast ? 1 : 2)); - // Newline normalization: - // ES6 Spec 11.8.6.1 - Static Semantics of TV's and TRV's - // and LineTerminatorSequences are normalized to for both TV and TRV. - text = text.replace(/\r\n?/g, "\n"); - text = ts.escapeString(text); - write('"' + text + '"'); - } - function emitDownlevelTaggedTemplateArray(node, literalEmitter) { - write("["); - if (node.template.kind === 10 /* NoSubstitutionTemplateLiteral */) { - literalEmitter(node.template); - } - else { - literalEmitter(node.template.head); - ts.forEach(node.template.templateSpans, function (child) { - write(", "); - literalEmitter(child.literal); - }); - } - write("]"); - } - function emitDownlevelTaggedTemplate(node) { - var tempVariable = createAndRecordTempVariable(0 /* Auto */); - write("("); - emit(tempVariable); - write(" = "); - emitDownlevelTaggedTemplateArray(node, emit); - write(", "); - emit(tempVariable); - write(".raw = "); - emitDownlevelTaggedTemplateArray(node, emitDownlevelRawTemplateLiteral); - write(", "); - emitParenthesizedIf(node.tag, needsParenthesisForPropertyAccessOrInvocation(node.tag)); - write("("); - emit(tempVariable); - // Now we emit the expressions - if (node.template.kind === 174 /* TemplateExpression */) { - ts.forEach(node.template.templateSpans, function (templateSpan) { - write(", "); - var needsParens = templateSpan.expression.kind === 172 /* BinaryExpression */ - && templateSpan.expression.operatorToken.kind === 23 /* CommaToken */; - emitParenthesizedIf(templateSpan.expression, needsParens); - }); - } - write("))"); - } - function emitTemplateExpression(node) { - // In ES6 mode and above, we can simply emit each portion of a template in order, but in - // ES3 & ES5 we must convert the template expression into a series of string concatenations. - if (languageVersion >= 2 /* ES6 */) { - ts.forEachChild(node, emit); - return; - } - var emitOuterParens = ts.isExpression(node.parent) - && templateNeedsParens(node, node.parent); - if (emitOuterParens) { - write("("); - } - var headEmitted = false; - if (shouldEmitTemplateHead()) { - emitLiteral(node.head); - headEmitted = true; - } - for (var i = 0, n = node.templateSpans.length; i < n; i++) { - var templateSpan = node.templateSpans[i]; - // Check if the expression has operands and binds its operands less closely than binary '+'. - // If it does, we need to wrap the expression in parentheses. Otherwise, something like - // `abc${ 1 << 2 }` - // becomes - // "abc" + 1 << 2 + "" - // which is really - // ("abc" + 1) << (2 + "") - // rather than - // "abc" + (1 << 2) + "" - var needsParens = templateSpan.expression.kind !== 164 /* ParenthesizedExpression */ - && comparePrecedenceToBinaryPlus(templateSpan.expression) !== 1 /* GreaterThan */; - if (i > 0 || headEmitted) { - // If this is the first span and the head was not emitted, then this templateSpan's - // expression will be the first to be emitted. Don't emit the preceding ' + ' in that - // case. - write(" + "); - } - emitParenthesizedIf(templateSpan.expression, needsParens); - // Only emit if the literal is non-empty. - // The binary '+' operator is left-associative, so the first string concatenation - // with the head will force the result up to this point to be a string. - // Emitting a '+ ""' has no semantic effect for middles and tails. - if (templateSpan.literal.text.length !== 0) { - write(" + "); - emitLiteral(templateSpan.literal); - } - } - if (emitOuterParens) { - write(")"); - } - function shouldEmitTemplateHead() { - // If this expression has an empty head literal and the first template span has a non-empty - // literal, then emitting the empty head literal is not necessary. - // `${ foo } and ${ bar }` - // can be emitted as - // foo + " and " + bar - // This is because it is only required that one of the first two operands in the emit - // output must be a string literal, so that the other operand and all following operands - // are forced into strings. - // - // If the first template span has an empty literal, then the head must still be emitted. - // `${ foo }${ bar }` - // must still be emitted as - // "" + foo + bar - // There is always atleast one templateSpan in this code path, since - // NoSubstitutionTemplateLiterals are directly emitted via emitLiteral() - ts.Debug.assert(node.templateSpans.length !== 0); - return node.head.text.length !== 0 || node.templateSpans[0].literal.text.length === 0; - } - function templateNeedsParens(template, parent) { - switch (parent.kind) { - case 160 /* CallExpression */: - case 161 /* NewExpression */: - return parent.expression === template; - case 162 /* TaggedTemplateExpression */: - case 164 /* ParenthesizedExpression */: - return false; - default: - return comparePrecedenceToBinaryPlus(parent) !== -1 /* LessThan */; - } - } - /** - * Returns whether the expression has lesser, greater, - * or equal precedence to the binary '+' operator - */ - function comparePrecedenceToBinaryPlus(expression) { - // All binary expressions have lower precedence than '+' apart from '*', '/', and '%' - // which have greater precedence and '-' which has equal precedence. - // All unary operators have a higher precedence apart from yield. - // Arrow functions and conditionals have a lower precedence, - // although we convert the former into regular function expressions in ES5 mode, - // and in ES6 mode this function won't get called anyway. - // - // TODO (drosen): Note that we need to account for the upcoming 'yield' and - // spread ('...') unary operators that are anticipated for ES6. - switch (expression.kind) { - case 172 /* BinaryExpression */: - switch (expression.operatorToken.kind) { - case 35 /* AsteriskToken */: - case 36 /* SlashToken */: - case 37 /* PercentToken */: - return 1 /* GreaterThan */; - case 33 /* PlusToken */: - case 34 /* MinusToken */: - return 0 /* EqualTo */; - default: - return -1 /* LessThan */; - } - case 175 /* YieldExpression */: - case 173 /* ConditionalExpression */: - return -1 /* LessThan */; - default: - return 1 /* GreaterThan */; - } - } - } - function emitTemplateSpan(span) { - emit(span.expression); - emit(span.literal); - } - // This function specifically handles numeric/string literals for enum and accessor 'identifiers'. - // In a sense, it does not actually emit identifiers as much as it declares a name for a specific property. - // For example, this is utilized when feeding in a result to Object.defineProperty. - function emitExpressionForPropertyName(node) { - ts.Debug.assert(node.kind !== 155 /* BindingElement */); - if (node.kind === 8 /* StringLiteral */) { - emitLiteral(node); - } - else if (node.kind === 129 /* ComputedPropertyName */) { - // if this is a decorated computed property, we will need to capture the result - // of the property expression so that we can apply decorators later. This is to ensure - // we don't introduce unintended side effects: - // - // class C { - // [_a = x]() { } - // } - // - // The emit for the decorated computed property decorator is: - // - // Object.defineProperty(C.prototype, _a, __decorate([dec], C.prototype, _a, Object.getOwnPropertyDescriptor(C.prototype, _a))); - // - if (ts.nodeIsDecorated(node.parent)) { - if (!computedPropertyNamesToGeneratedNames) { - computedPropertyNamesToGeneratedNames = []; - } - var generatedName = computedPropertyNamesToGeneratedNames[ts.getNodeId(node)]; - if (generatedName) { - // we have already generated a variable for this node, write that value instead. - write(generatedName); - return; - } - generatedName = createAndRecordTempVariable(0 /* Auto */).text; - computedPropertyNamesToGeneratedNames[ts.getNodeId(node)] = generatedName; - write(generatedName); - write(" = "); - } - emit(node.expression); - } - else { - write("\""); - if (node.kind === 7 /* NumericLiteral */) { - write(node.text); - } - else { - writeTextOfNode(currentSourceFile, node); - } - write("\""); - } - } - function isExpressionIdentifier(node) { - var parent = node.parent; - switch (parent.kind) { - case 156 /* ArrayLiteralExpression */: - case 172 /* BinaryExpression */: - case 160 /* CallExpression */: - case 223 /* CaseClause */: - case 129 /* ComputedPropertyName */: - case 173 /* ConditionalExpression */: - case 132 /* Decorator */: - case 167 /* DeleteExpression */: - case 187 /* DoStatement */: - case 159 /* ElementAccessExpression */: - case 217 /* ExportAssignment */: - case 185 /* ExpressionStatement */: - case 179 /* ExpressionWithTypeArguments */: - case 189 /* ForStatement */: - case 190 /* ForInStatement */: - case 191 /* ForOfStatement */: - case 186 /* IfStatement */: - case 161 /* NewExpression */: - case 164 /* ParenthesizedExpression */: - case 171 /* PostfixUnaryExpression */: - case 170 /* PrefixUnaryExpression */: - case 194 /* ReturnStatement */: - case 228 /* ShorthandPropertyAssignment */: - case 176 /* SpreadElementExpression */: - case 196 /* SwitchStatement */: - case 162 /* TaggedTemplateExpression */: - case 180 /* TemplateSpan */: - case 198 /* ThrowStatement */: - case 163 /* TypeAssertionExpression */: - case 168 /* TypeOfExpression */: - case 169 /* VoidExpression */: - case 188 /* WhileStatement */: - case 195 /* WithStatement */: - case 175 /* YieldExpression */: - return true; - case 155 /* BindingElement */: - case 229 /* EnumMember */: - case 131 /* Parameter */: - case 227 /* PropertyAssignment */: - case 134 /* PropertyDeclaration */: - case 201 /* VariableDeclaration */: - return parent.initializer === node; - case 158 /* PropertyAccessExpression */: - return parent.expression === node; - case 166 /* ArrowFunction */: - case 165 /* FunctionExpression */: - return parent.body === node; - case 211 /* ImportEqualsDeclaration */: - return parent.moduleReference === node; - case 128 /* QualifiedName */: - return parent.left === node; - } - return false; - } - function emitExpressionIdentifier(node) { - var container = resolver.getReferencedExportContainer(node); - if (container) { - if (container.kind === 230 /* SourceFile */) { - // Identifier references module export - if (languageVersion < 2 /* ES6 */ && compilerOptions.module !== 4 /* System */) { - write("exports."); - } - } - else { - // Identifier references namespace export - write(getGeneratedNameForNode(container)); - write("."); - } - } - else if (languageVersion < 2 /* ES6 */) { - var declaration = resolver.getReferencedImportDeclaration(node); - if (declaration) { - if (declaration.kind === 213 /* ImportClause */) { - // Identifier references default import - write(getGeneratedNameForNode(declaration.parent)); - write(languageVersion === 0 /* ES3 */ ? '["default"]' : ".default"); - return; - } - else if (declaration.kind === 216 /* ImportSpecifier */) { - // Identifier references named import - write(getGeneratedNameForNode(declaration.parent.parent.parent)); - write("."); - writeTextOfNode(currentSourceFile, declaration.propertyName || declaration.name); - return; - } - } - declaration = resolver.getReferencedNestedRedeclaration(node); - if (declaration) { - write(getGeneratedNameForNode(declaration.name)); - return; - } - } - writeTextOfNode(currentSourceFile, node); - } - function isNameOfNestedRedeclaration(node) { - if (languageVersion < 2 /* ES6 */) { - var parent_7 = node.parent; - switch (parent_7.kind) { - case 155 /* BindingElement */: - case 204 /* ClassDeclaration */: - case 207 /* EnumDeclaration */: - case 201 /* VariableDeclaration */: - return parent_7.name === node && resolver.isNestedRedeclaration(parent_7); - } - } - return false; - } - function emitIdentifier(node) { - if (!node.parent) { - write(node.text); - } - else if (isExpressionIdentifier(node)) { - emitExpressionIdentifier(node); - } - else if (isNameOfNestedRedeclaration(node)) { - write(getGeneratedNameForNode(node)); - } - else { - writeTextOfNode(currentSourceFile, node); - } - } - function emitThis(node) { - if (resolver.getNodeCheckFlags(node) & 2 /* LexicalThis */) { - write("_this"); - } - else { - write("this"); - } - } - function emitSuper(node) { - if (languageVersion >= 2 /* ES6 */) { - write("super"); - } - else { - var flags = resolver.getNodeCheckFlags(node); - if (flags & 16 /* SuperInstance */) { - write("_super.prototype"); - } - else { - write("_super"); - } - } - } - function emitObjectBindingPattern(node) { - write("{ "); - var elements = node.elements; - emitList(elements, 0, elements.length, false, elements.hasTrailingComma); - write(" }"); - } - function emitArrayBindingPattern(node) { - write("["); - var elements = node.elements; - emitList(elements, 0, elements.length, false, elements.hasTrailingComma); - write("]"); - } - function emitBindingElement(node) { - if (node.propertyName) { - emit(node.propertyName); - write(": "); - } - if (node.dotDotDotToken) { - write("..."); - } - if (ts.isBindingPattern(node.name)) { - emit(node.name); - } - else { - emitModuleMemberName(node); - } - emitOptional(" = ", node.initializer); - } - function emitSpreadElementExpression(node) { - write("..."); - emit(node.expression); - } - function emitYieldExpression(node) { - write(ts.tokenToString(110 /* YieldKeyword */)); - if (node.asteriskToken) { - write("*"); - } - if (node.expression) { - write(" "); - emit(node.expression); - } - } - function needsParenthesisForPropertyAccessOrInvocation(node) { - switch (node.kind) { - case 65 /* Identifier */: - case 156 /* ArrayLiteralExpression */: - case 158 /* PropertyAccessExpression */: - case 159 /* ElementAccessExpression */: - case 160 /* CallExpression */: - case 164 /* ParenthesizedExpression */: - // This list is not exhaustive and only includes those cases that are relevant - // to the check in emitArrayLiteral. More cases can be added as needed. - return false; - } - return true; - } - function emitListWithSpread(elements, needsUniqueCopy, multiLine, trailingComma, useConcat) { - var pos = 0; - var group = 0; - var length = elements.length; - while (pos < length) { - // Emit using the pattern .concat(, , ...) - if (group === 1 && useConcat) { - write(".concat("); - } - else if (group > 0) { - write(", "); - } - var e = elements[pos]; - if (e.kind === 176 /* SpreadElementExpression */) { - e = e.expression; - emitParenthesizedIf(e, group === 0 && needsParenthesisForPropertyAccessOrInvocation(e)); - pos++; - if (pos === length && group === 0 && needsUniqueCopy && e.kind !== 156 /* ArrayLiteralExpression */) { - write(".slice()"); - } - } - else { - var i = pos; - while (i < length && elements[i].kind !== 176 /* SpreadElementExpression */) { - i++; - } - write("["); - if (multiLine) { - increaseIndent(); - } - emitList(elements, pos, i - pos, multiLine, trailingComma && i === length); - if (multiLine) { - decreaseIndent(); - } - write("]"); - pos = i; - } - group++; - } - if (group > 1) { - if (useConcat) { - write(")"); - } - } - } - function isSpreadElementExpression(node) { - return node.kind === 176 /* SpreadElementExpression */; - } - function emitArrayLiteral(node) { - var elements = node.elements; - if (elements.length === 0) { - write("[]"); - } - else if (languageVersion >= 2 /* ES6 */ || !ts.forEach(elements, isSpreadElementExpression)) { - write("["); - emitLinePreservingList(node, node.elements, elements.hasTrailingComma, false); - write("]"); - } - else { - emitListWithSpread(elements, true, (node.flags & 512 /* MultiLine */) !== 0, - /*trailingComma*/ elements.hasTrailingComma, true); - } - } - function emitObjectLiteralBody(node, numElements) { - if (numElements === 0) { - write("{}"); - return; - } - write("{"); - if (numElements > 0) { - var properties = node.properties; - // If we are not doing a downlevel transformation for object literals, - // then try to preserve the original shape of the object literal. - // Otherwise just try to preserve the formatting. - if (numElements === properties.length) { - emitLinePreservingList(node, properties, languageVersion >= 1 /* ES5 */, true); - } - else { - var multiLine = (node.flags & 512 /* MultiLine */) !== 0; - if (!multiLine) { - write(" "); - } - else { - increaseIndent(); - } - emitList(properties, 0, numElements, multiLine, false); - if (!multiLine) { - write(" "); - } - else { - decreaseIndent(); - } - } - } - write("}"); - } - function emitDownlevelObjectLiteralWithComputedProperties(node, firstComputedPropertyIndex) { - var multiLine = (node.flags & 512 /* MultiLine */) !== 0; - var properties = node.properties; - write("("); - if (multiLine) { - increaseIndent(); - } - // For computed properties, we need to create a unique handle to the object - // literal so we can modify it without risking internal assignments tainting the object. - var tempVar = createAndRecordTempVariable(0 /* Auto */); - // Write out the first non-computed properties - // (or all properties if none of them are computed), - // then emit the rest through indexing on the temp variable. - emit(tempVar); - write(" = "); - emitObjectLiteralBody(node, firstComputedPropertyIndex); - for (var i = firstComputedPropertyIndex, n = properties.length; i < n; i++) { - writeComma(); - var property = properties[i]; - emitStart(property); - if (property.kind === 138 /* GetAccessor */ || property.kind === 139 /* SetAccessor */) { - // TODO (drosen): Reconcile with 'emitMemberFunctions'. - var accessors = ts.getAllAccessorDeclarations(node.properties, property); - if (property !== accessors.firstAccessor) { - continue; - } - write("Object.defineProperty("); - emit(tempVar); - write(", "); - emitStart(node.name); - emitExpressionForPropertyName(property.name); - emitEnd(property.name); - write(", {"); - increaseIndent(); - if (accessors.getAccessor) { - writeLine(); - emitLeadingComments(accessors.getAccessor); - write("get: "); - emitStart(accessors.getAccessor); - write("function "); - emitSignatureAndBody(accessors.getAccessor); - emitEnd(accessors.getAccessor); - emitTrailingComments(accessors.getAccessor); - write(","); - } - if (accessors.setAccessor) { - writeLine(); - emitLeadingComments(accessors.setAccessor); - write("set: "); - emitStart(accessors.setAccessor); - write("function "); - emitSignatureAndBody(accessors.setAccessor); - emitEnd(accessors.setAccessor); - emitTrailingComments(accessors.setAccessor); - write(","); - } - writeLine(); - write("enumerable: true,"); - writeLine(); - write("configurable: true"); - decreaseIndent(); - writeLine(); - write("})"); - emitEnd(property); - } - else { - emitLeadingComments(property); - emitStart(property.name); - emit(tempVar); - emitMemberAccessForPropertyName(property.name); - emitEnd(property.name); - write(" = "); - if (property.kind === 227 /* PropertyAssignment */) { - emit(property.initializer); - } - else if (property.kind === 228 /* ShorthandPropertyAssignment */) { - emitExpressionIdentifier(property.name); - } - else if (property.kind === 136 /* MethodDeclaration */) { - emitFunctionDeclaration(property); - } - else { - ts.Debug.fail("ObjectLiteralElement type not accounted for: " + property.kind); - } - } - emitEnd(property); - } - writeComma(); - emit(tempVar); - if (multiLine) { - decreaseIndent(); - writeLine(); - } - write(")"); - function writeComma() { - if (multiLine) { - write(","); - writeLine(); - } - else { - write(", "); - } - } - } - function emitObjectLiteral(node) { - var properties = node.properties; - if (languageVersion < 2 /* ES6 */) { - var numProperties = properties.length; - // Find the first computed property. - // Everything until that point can be emitted as part of the initial object literal. - var numInitialNonComputedProperties = numProperties; - for (var i = 0, n = properties.length; i < n; i++) { - if (properties[i].name.kind === 129 /* ComputedPropertyName */) { - numInitialNonComputedProperties = i; - break; - } - } - var hasComputedProperty = numInitialNonComputedProperties !== properties.length; - if (hasComputedProperty) { - emitDownlevelObjectLiteralWithComputedProperties(node, numInitialNonComputedProperties); - return; - } - } - // Ordinary case: either the object has no computed properties - // or we're compiling with an ES6+ target. - emitObjectLiteralBody(node, properties.length); - } - function createBinaryExpression(left, operator, right, startsOnNewLine) { - var result = ts.createSynthesizedNode(172 /* BinaryExpression */, startsOnNewLine); - result.operatorToken = ts.createSynthesizedNode(operator); - result.left = left; - result.right = right; - return result; - } - function createPropertyAccessExpression(expression, name) { - var result = ts.createSynthesizedNode(158 /* PropertyAccessExpression */); - result.expression = parenthesizeForAccess(expression); - result.dotToken = ts.createSynthesizedNode(20 /* DotToken */); - result.name = name; - return result; - } - function createElementAccessExpression(expression, argumentExpression) { - var result = ts.createSynthesizedNode(159 /* ElementAccessExpression */); - result.expression = parenthesizeForAccess(expression); - result.argumentExpression = argumentExpression; - return result; - } - function parenthesizeForAccess(expr) { - // When diagnosing whether the expression needs parentheses, the decision should be based - // on the innermost expression in a chain of nested type assertions. - while (expr.kind === 163 /* TypeAssertionExpression */) { - expr = expr.expression; - } - // isLeftHandSideExpression is almost the correct criterion for when it is not necessary - // to parenthesize the expression before a dot. The known exceptions are: - // - // NewExpression: - // new C.x -> not the same as (new C).x - // NumberLiteral - // 1.x -> not the same as (1).x - // - if (ts.isLeftHandSideExpression(expr) && - expr.kind !== 161 /* NewExpression */ && - expr.kind !== 7 /* NumericLiteral */) { - return expr; - } - var node = ts.createSynthesizedNode(164 /* ParenthesizedExpression */); - node.expression = expr; - return node; - } - function emitComputedPropertyName(node) { - write("["); - emitExpressionForPropertyName(node); - write("]"); - } - function emitMethod(node) { - if (languageVersion >= 2 /* ES6 */ && node.asteriskToken) { - write("*"); - } - emit(node.name); - if (languageVersion < 2 /* ES6 */) { - write(": function "); - } - emitSignatureAndBody(node); - } - function emitPropertyAssignment(node) { - emit(node.name); - write(": "); - emit(node.initializer); - } - // Return true if identifier resolves to an exported member of a namespace - function isNamespaceExportReference(node) { - var container = resolver.getReferencedExportContainer(node); - return container && container.kind !== 230 /* SourceFile */; - } - function emitShorthandPropertyAssignment(node) { - // The name property of a short-hand property assignment is considered an expression position, so here - // we manually emit the identifier to avoid rewriting. - writeTextOfNode(currentSourceFile, node.name); - // If emitting pre-ES6 code, or if the name requires rewriting when resolved as an expression identifier, - // we emit a normal property assignment. For example: - // module m { - // export let y; - // } - // module m { - // let obj = { y }; - // } - // Here we need to emit obj = { y : m.y } regardless of the output target. - if (languageVersion < 2 /* ES6 */ || isNamespaceExportReference(node.name)) { - // Emit identifier as an identifier - write(": "); - emit(node.name); - } - } - function tryEmitConstantValue(node) { - if (compilerOptions.isolatedModules) { - // do not inline enum values in separate compilation mode - return false; - } - var constantValue = resolver.getConstantValue(node); - if (constantValue !== undefined) { - write(constantValue.toString()); - if (!compilerOptions.removeComments) { - var propertyName = node.kind === 158 /* PropertyAccessExpression */ ? ts.declarationNameToString(node.name) : ts.getTextOfNode(node.argumentExpression); - write(" /* " + propertyName + " */"); - } - return true; - } - return false; - } - // Returns 'true' if the code was actually indented, false otherwise. - // If the code is not indented, an optional valueToWriteWhenNotIndenting will be - // emitted instead. - function indentIfOnDifferentLines(parent, node1, node2, valueToWriteWhenNotIndenting) { - var realNodesAreOnDifferentLines = !ts.nodeIsSynthesized(parent) && !nodeEndIsOnSameLineAsNodeStart(node1, node2); - // Always use a newline for synthesized code if the synthesizer desires it. - var synthesizedNodeIsOnDifferentLine = synthesizedNodeStartsOnNewLine(node2); - if (realNodesAreOnDifferentLines || synthesizedNodeIsOnDifferentLine) { - increaseIndent(); - writeLine(); - return true; - } - else { - if (valueToWriteWhenNotIndenting) { - write(valueToWriteWhenNotIndenting); - } - return false; - } - } - function emitPropertyAccess(node) { - if (tryEmitConstantValue(node)) { - return; - } - emit(node.expression); - var indentedBeforeDot = indentIfOnDifferentLines(node, node.expression, node.dotToken); - write("."); - var indentedAfterDot = indentIfOnDifferentLines(node, node.dotToken, node.name); - emit(node.name); - decreaseIndentIf(indentedBeforeDot, indentedAfterDot); - } - function emitQualifiedName(node) { - emit(node.left); - write("."); - emit(node.right); - } - function emitIndexedAccess(node) { - if (tryEmitConstantValue(node)) { - return; - } - emit(node.expression); - write("["); - emit(node.argumentExpression); - write("]"); - } - function hasSpreadElement(elements) { - return ts.forEach(elements, function (e) { return e.kind === 176 /* SpreadElementExpression */; }); - } - function skipParentheses(node) { - while (node.kind === 164 /* ParenthesizedExpression */ || node.kind === 163 /* TypeAssertionExpression */) { - node = node.expression; - } - return node; - } - function emitCallTarget(node) { - if (node.kind === 65 /* Identifier */ || node.kind === 93 /* ThisKeyword */ || node.kind === 91 /* SuperKeyword */) { - emit(node); - return node; - } - var temp = createAndRecordTempVariable(0 /* Auto */); - write("("); - emit(temp); - write(" = "); - emit(node); - write(")"); - return temp; - } - function emitCallWithSpread(node) { - var target; - var expr = skipParentheses(node.expression); - if (expr.kind === 158 /* PropertyAccessExpression */) { - // Target will be emitted as "this" argument - target = emitCallTarget(expr.expression); - write("."); - emit(expr.name); - } - else if (expr.kind === 159 /* ElementAccessExpression */) { - // Target will be emitted as "this" argument - target = emitCallTarget(expr.expression); - write("["); - emit(expr.argumentExpression); - write("]"); - } - else if (expr.kind === 91 /* SuperKeyword */) { - target = expr; - write("_super"); - } - else { - emit(node.expression); - } - write(".apply("); - if (target) { - if (target.kind === 91 /* SuperKeyword */) { - // Calls of form super(...) and super.foo(...) - emitThis(target); - } - else { - // Calls of form obj.foo(...) - emit(target); - } - } - else { - // Calls of form foo(...) - write("void 0"); - } - write(", "); - emitListWithSpread(node.arguments, false, false, false, true); - write(")"); - } - function emitCallExpression(node) { - if (languageVersion < 2 /* ES6 */ && hasSpreadElement(node.arguments)) { - emitCallWithSpread(node); - return; - } - var superCall = false; - if (node.expression.kind === 91 /* SuperKeyword */) { - emitSuper(node.expression); - superCall = true; - } - else { - emit(node.expression); - superCall = node.expression.kind === 158 /* PropertyAccessExpression */ && node.expression.expression.kind === 91 /* SuperKeyword */; - } - if (superCall && languageVersion < 2 /* ES6 */) { - write(".call("); - emitThis(node.expression); - if (node.arguments.length) { - write(", "); - emitCommaList(node.arguments); - } - write(")"); - } - else { - write("("); - emitCommaList(node.arguments); - write(")"); - } - } - function emitNewExpression(node) { - write("new "); - // Spread operator logic is supported in new expressions in ES5 using a combination - // of Function.prototype.bind() and Function.prototype.apply(). - // - // Example: - // - // var args = [1, 2, 3, 4, 5]; - // new Array(...args); - // - // is compiled into the following ES5: - // - // var args = [1, 2, 3, 4, 5]; - // new (Array.bind.apply(Array, [void 0].concat(args))); - // - // The 'thisArg' to 'bind' is ignored when invoking the result of 'bind' with 'new', - // Thus, we set it to undefined ('void 0'). - if (languageVersion === 1 /* ES5 */ && - node.arguments && - hasSpreadElement(node.arguments)) { - write("("); - var target = emitCallTarget(node.expression); - write(".bind.apply("); - emit(target); - write(", [void 0].concat("); - emitListWithSpread(node.arguments, false, false, false, false); - write(")))"); - write("()"); - } - else { - emit(node.expression); - if (node.arguments) { - write("("); - emitCommaList(node.arguments); - write(")"); - } - } - } - function emitTaggedTemplateExpression(node) { - if (languageVersion >= 2 /* ES6 */) { - emit(node.tag); - write(" "); - emit(node.template); - } - else { - emitDownlevelTaggedTemplate(node); - } - } - function emitParenExpression(node) { - // If the node is synthesized, it means the emitter put the parentheses there, - // not the user. If we didn't want them, the emitter would not have put them - // there. - if (!ts.nodeIsSynthesized(node) && node.parent.kind !== 166 /* ArrowFunction */) { - if (node.expression.kind === 163 /* TypeAssertionExpression */) { - var operand = node.expression.expression; - // Make sure we consider all nested cast expressions, e.g.: - // (-A).x; - while (operand.kind == 163 /* TypeAssertionExpression */) { - operand = operand.expression; - } - // We have an expression of the form: (SubExpr) - // Emitting this as (SubExpr) is really not desirable. We would like to emit the subexpr as is. - // Omitting the parentheses, however, could cause change in the semantics of the generated - // code if the casted expression has a lower precedence than the rest of the expression, e.g.: - // (new A).foo should be emitted as (new A).foo and not new A.foo - // (typeof A).toString() should be emitted as (typeof A).toString() and not typeof A.toString() - // new (A()) should be emitted as new (A()) and not new A() - // (function foo() { })() should be emitted as an IIF (function foo(){})() and not declaration function foo(){} () - if (operand.kind !== 170 /* PrefixUnaryExpression */ && - operand.kind !== 169 /* VoidExpression */ && - operand.kind !== 168 /* TypeOfExpression */ && - operand.kind !== 167 /* DeleteExpression */ && - operand.kind !== 171 /* PostfixUnaryExpression */ && - operand.kind !== 161 /* NewExpression */ && - !(operand.kind === 160 /* CallExpression */ && node.parent.kind === 161 /* NewExpression */) && - !(operand.kind === 165 /* FunctionExpression */ && node.parent.kind === 160 /* CallExpression */)) { - emit(operand); - return; - } - } - } - write("("); - emit(node.expression); - write(")"); - } - function emitDeleteExpression(node) { - write(ts.tokenToString(74 /* DeleteKeyword */)); - write(" "); - emit(node.expression); - } - function emitVoidExpression(node) { - write(ts.tokenToString(99 /* VoidKeyword */)); - write(" "); - emit(node.expression); - } - function emitTypeOfExpression(node) { - write(ts.tokenToString(97 /* TypeOfKeyword */)); - write(" "); - emit(node.expression); - } - function isNameOfExportedSourceLevelDeclarationInSystemExternalModule(node) { - if (!isCurrentFileSystemExternalModule() || node.kind !== 65 /* Identifier */ || ts.nodeIsSynthesized(node)) { - return false; - } - var isVariableDeclarationOrBindingElement = node.parent && (node.parent.kind === 201 /* VariableDeclaration */ || node.parent.kind === 155 /* BindingElement */); - var targetDeclaration = isVariableDeclarationOrBindingElement - ? node.parent - : resolver.getReferencedValueDeclaration(node); - return isSourceFileLevelDeclarationInSystemJsModule(targetDeclaration, true); - } - function emitPrefixUnaryExpression(node) { - var exportChanged = isNameOfExportedSourceLevelDeclarationInSystemExternalModule(node.operand); - if (exportChanged) { - // emit - // ++x - // as - // exports('x', ++x) - write(exportFunctionForFile + "(\""); - emitNodeWithoutSourceMap(node.operand); - write("\", "); - } - write(ts.tokenToString(node.operator)); - // In some cases, we need to emit a space between the operator and the operand. One obvious case - // is when the operator is an identifier, like delete or typeof. We also need to do this for plus - // and minus expressions in certain cases. Specifically, consider the following two cases (parens - // are just for clarity of exposition, and not part of the source code): - // - // (+(+1)) - // (+(++1)) - // - // We need to emit a space in both cases. In the first case, the absence of a space will make - // the resulting expression a prefix increment operation. And in the second, it will make the resulting - // expression a prefix increment whose operand is a plus expression - (++(+x)) - // The same is true of minus of course. - if (node.operand.kind === 170 /* PrefixUnaryExpression */) { - var operand = node.operand; - if (node.operator === 33 /* PlusToken */ && (operand.operator === 33 /* PlusToken */ || operand.operator === 38 /* PlusPlusToken */)) { - write(" "); - } - else if (node.operator === 34 /* MinusToken */ && (operand.operator === 34 /* MinusToken */ || operand.operator === 39 /* MinusMinusToken */)) { - write(" "); - } - } - emit(node.operand); - if (exportChanged) { - write(")"); - } - } - function emitPostfixUnaryExpression(node) { - var exportChanged = isNameOfExportedSourceLevelDeclarationInSystemExternalModule(node.operand); - if (exportChanged) { - // export function returns the value that was passes as the second argument - // however for postfix unary expressions result value should be the value before modification. - // emit 'x++' as '(export('x', ++x) - 1)' and 'x--' as '(export('x', --x) + 1)' - write("(" + exportFunctionForFile + "(\""); - emitNodeWithoutSourceMap(node.operand); - write("\", "); - write(ts.tokenToString(node.operator)); - emit(node.operand); - if (node.operator === 38 /* PlusPlusToken */) { - write(") - 1)"); - } - else { - write(") + 1)"); - } - } - else { - emit(node.operand); - write(ts.tokenToString(node.operator)); - } - } - function shouldHoistDeclarationInSystemJsModule(node) { - return isSourceFileLevelDeclarationInSystemJsModule(node, false); - } - /* - * Checks if given node is a source file level declaration (not nested in module/function). - * If 'isExported' is true - then declaration must also be exported. - * This function is used in two cases: - * - check if node is a exported source file level value to determine - * if we should also export the value after its it changed - * - check if node is a source level declaration to emit it differently, - * i.e non-exported variable statement 'var x = 1' is hoisted so - * we we emit variable statement 'var' should be dropped. - */ - function isSourceFileLevelDeclarationInSystemJsModule(node, isExported) { - if (!node || languageVersion >= 2 /* ES6 */ || !isCurrentFileSystemExternalModule()) { - return false; - } - var current = node; - while (current) { - if (current.kind === 230 /* SourceFile */) { - return !isExported || ((ts.getCombinedNodeFlags(node) & 1 /* Export */) !== 0); - } - else if (ts.isFunctionLike(current) || current.kind === 209 /* ModuleBlock */) { - return false; - } - else { - current = current.parent; - } - } - } - function emitBinaryExpression(node) { - if (languageVersion < 2 /* ES6 */ && node.operatorToken.kind === 53 /* EqualsToken */ && - (node.left.kind === 157 /* ObjectLiteralExpression */ || node.left.kind === 156 /* ArrayLiteralExpression */)) { - emitDestructuring(node, node.parent.kind === 185 /* ExpressionStatement */); - } - else { - var exportChanged = node.operatorToken.kind >= 53 /* FirstAssignment */ && - node.operatorToken.kind <= 64 /* LastAssignment */ && - isNameOfExportedSourceLevelDeclarationInSystemExternalModule(node.left); - if (exportChanged) { - // emit assignment 'x y' as 'exports("x", x y)' - write(exportFunctionForFile + "(\""); - emitNodeWithoutSourceMap(node.left); - write("\", "); - } - emit(node.left); - var indentedBeforeOperator = indentIfOnDifferentLines(node, node.left, node.operatorToken, node.operatorToken.kind !== 23 /* CommaToken */ ? " " : undefined); - write(ts.tokenToString(node.operatorToken.kind)); - var indentedAfterOperator = indentIfOnDifferentLines(node, node.operatorToken, node.right, " "); - emit(node.right); - decreaseIndentIf(indentedBeforeOperator, indentedAfterOperator); - if (exportChanged) { - write(")"); - } - } - } - function synthesizedNodeStartsOnNewLine(node) { - return ts.nodeIsSynthesized(node) && node.startsOnNewLine; - } - function emitConditionalExpression(node) { - emit(node.condition); - var indentedBeforeQuestion = indentIfOnDifferentLines(node, node.condition, node.questionToken, " "); - write("?"); - var indentedAfterQuestion = indentIfOnDifferentLines(node, node.questionToken, node.whenTrue, " "); - emit(node.whenTrue); - decreaseIndentIf(indentedBeforeQuestion, indentedAfterQuestion); - var indentedBeforeColon = indentIfOnDifferentLines(node, node.whenTrue, node.colonToken, " "); - write(":"); - var indentedAfterColon = indentIfOnDifferentLines(node, node.colonToken, node.whenFalse, " "); - emit(node.whenFalse); - decreaseIndentIf(indentedBeforeColon, indentedAfterColon); - } - // Helper function to decrease the indent if we previously indented. Allows multiple - // previous indent values to be considered at a time. This also allows caller to just - // call this once, passing in all their appropriate indent values, instead of needing - // to call this helper function multiple times. - function decreaseIndentIf(value1, value2) { - if (value1) { - decreaseIndent(); - } - if (value2) { - decreaseIndent(); - } - } - function isSingleLineEmptyBlock(node) { - if (node && node.kind === 182 /* Block */) { - var block = node; - return block.statements.length === 0 && nodeEndIsOnSameLineAsNodeStart(block, block); - } - } - function emitBlock(node) { - if (isSingleLineEmptyBlock(node)) { - emitToken(14 /* OpenBraceToken */, node.pos); - write(" "); - emitToken(15 /* CloseBraceToken */, node.statements.end); - return; - } - emitToken(14 /* OpenBraceToken */, node.pos); - increaseIndent(); - scopeEmitStart(node.parent); - if (node.kind === 209 /* ModuleBlock */) { - ts.Debug.assert(node.parent.kind === 208 /* ModuleDeclaration */); - emitCaptureThisForNodeIfNecessary(node.parent); - } - emitLines(node.statements); - if (node.kind === 209 /* ModuleBlock */) { - emitTempDeclarations(true); - } - decreaseIndent(); - writeLine(); - emitToken(15 /* CloseBraceToken */, node.statements.end); - scopeEmitEnd(); - } - function emitEmbeddedStatement(node) { - if (node.kind === 182 /* Block */) { - write(" "); - emit(node); - } - else { - increaseIndent(); - writeLine(); - emit(node); - decreaseIndent(); - } - } - function emitExpressionStatement(node) { - emitParenthesizedIf(node.expression, node.expression.kind === 166 /* ArrowFunction */); - write(";"); - } - function emitIfStatement(node) { - var endPos = emitToken(84 /* IfKeyword */, node.pos); - write(" "); - endPos = emitToken(16 /* OpenParenToken */, endPos); - emit(node.expression); - emitToken(17 /* CloseParenToken */, node.expression.end); - emitEmbeddedStatement(node.thenStatement); - if (node.elseStatement) { - writeLine(); - emitToken(76 /* ElseKeyword */, node.thenStatement.end); - if (node.elseStatement.kind === 186 /* IfStatement */) { - write(" "); - emit(node.elseStatement); - } - else { - emitEmbeddedStatement(node.elseStatement); - } - } - } - function emitDoStatement(node) { - write("do"); - emitEmbeddedStatement(node.statement); - if (node.statement.kind === 182 /* Block */) { - write(" "); - } - else { - writeLine(); - } - write("while ("); - emit(node.expression); - write(");"); - } - function emitWhileStatement(node) { - write("while ("); - emit(node.expression); - write(")"); - emitEmbeddedStatement(node.statement); - } - /** - * Returns true if start of variable declaration list was emitted. - * Returns false if nothing was written - this can happen for source file level variable declarations - * in system modules where such variable declarations are hoisted. - */ - function tryEmitStartOfVariableDeclarationList(decl, startPos) { - if (shouldHoistVariable(decl, true)) { - // variables in variable declaration list were already hoisted - return false; - } - var tokenKind = 98 /* VarKeyword */; - if (decl && languageVersion >= 2 /* ES6 */) { - if (ts.isLet(decl)) { - tokenKind = 104 /* LetKeyword */; - } - else if (ts.isConst(decl)) { - tokenKind = 70 /* ConstKeyword */; - } - } - if (startPos !== undefined) { - emitToken(tokenKind, startPos); - write(" "); - } - else { - switch (tokenKind) { - case 98 /* VarKeyword */: - write("var "); - break; - case 104 /* LetKeyword */: - write("let "); - break; - case 70 /* ConstKeyword */: - write("const "); - break; - } - } - return true; - } - function emitVariableDeclarationListSkippingUninitializedEntries(list) { - var started = false; - for (var _a = 0, _b = list.declarations; _a < _b.length; _a++) { - var decl = _b[_a]; - if (!decl.initializer) { - continue; - } - if (!started) { - started = true; - } - else { - write(", "); - } - emit(decl); - } - return started; - } - function emitForStatement(node) { - var endPos = emitToken(82 /* ForKeyword */, node.pos); - write(" "); - endPos = emitToken(16 /* OpenParenToken */, endPos); - if (node.initializer && node.initializer.kind === 202 /* VariableDeclarationList */) { - var variableDeclarationList = node.initializer; - var startIsEmitted = tryEmitStartOfVariableDeclarationList(variableDeclarationList, endPos); - if (startIsEmitted) { - emitCommaList(variableDeclarationList.declarations); - } - else { - emitVariableDeclarationListSkippingUninitializedEntries(variableDeclarationList); - } - } - else if (node.initializer) { - emit(node.initializer); - } - write(";"); - emitOptional(" ", node.condition); - write(";"); - emitOptional(" ", node.incrementor); - write(")"); - emitEmbeddedStatement(node.statement); - } - function emitForInOrForOfStatement(node) { - if (languageVersion < 2 /* ES6 */ && node.kind === 191 /* ForOfStatement */) { - return emitDownLevelForOfStatement(node); - } - var endPos = emitToken(82 /* ForKeyword */, node.pos); - write(" "); - endPos = emitToken(16 /* OpenParenToken */, endPos); - if (node.initializer.kind === 202 /* VariableDeclarationList */) { - var variableDeclarationList = node.initializer; - if (variableDeclarationList.declarations.length >= 1) { - tryEmitStartOfVariableDeclarationList(variableDeclarationList, endPos); - emit(variableDeclarationList.declarations[0]); - } - } - else { - emit(node.initializer); - } - if (node.kind === 190 /* ForInStatement */) { - write(" in "); - } - else { - write(" of "); - } - emit(node.expression); - emitToken(17 /* CloseParenToken */, node.expression.end); - emitEmbeddedStatement(node.statement); - } - function emitDownLevelForOfStatement(node) { - // The following ES6 code: - // - // for (let v of expr) { } - // - // should be emitted as - // - // for (let _i = 0, _a = expr; _i < _a.length; _i++) { - // let v = _a[_i]; - // } - // - // where _a and _i are temps emitted to capture the RHS and the counter, - // respectively. - // When the left hand side is an expression instead of a let declaration, - // the "let v" is not emitted. - // When the left hand side is a let/const, the v is renamed if there is - // another v in scope. - // Note that all assignments to the LHS are emitted in the body, including - // all destructuring. - // Note also that because an extra statement is needed to assign to the LHS, - // for-of bodies are always emitted as blocks. - var endPos = emitToken(82 /* ForKeyword */, node.pos); - write(" "); - endPos = emitToken(16 /* OpenParenToken */, endPos); - // Do not emit the LHS let declaration yet, because it might contain destructuring. - // Do not call recordTempDeclaration because we are declaring the temps - // right here. Recording means they will be declared later. - // In the case where the user wrote an identifier as the RHS, like this: - // - // for (let v of arr) { } - // - // we don't want to emit a temporary variable for the RHS, just use it directly. - var rhsIsIdentifier = node.expression.kind === 65 /* Identifier */; - var counter = createTempVariable(268435456 /* _i */); - var rhsReference = rhsIsIdentifier ? node.expression : createTempVariable(0 /* Auto */); - // This is the let keyword for the counter and rhsReference. The let keyword for - // the LHS will be emitted inside the body. - emitStart(node.expression); - write("var "); - // _i = 0 - emitNodeWithoutSourceMap(counter); - write(" = 0"); - emitEnd(node.expression); - if (!rhsIsIdentifier) { - // , _a = expr - write(", "); - emitStart(node.expression); - emitNodeWithoutSourceMap(rhsReference); - write(" = "); - emitNodeWithoutSourceMap(node.expression); - emitEnd(node.expression); - } - write("; "); - // _i < _a.length; - emitStart(node.initializer); - emitNodeWithoutSourceMap(counter); - write(" < "); - emitNodeWithoutSourceMap(rhsReference); - write(".length"); - emitEnd(node.initializer); - write("; "); - // _i++) - emitStart(node.initializer); - emitNodeWithoutSourceMap(counter); - write("++"); - emitEnd(node.initializer); - emitToken(17 /* CloseParenToken */, node.expression.end); - // Body - write(" {"); - writeLine(); - increaseIndent(); - // Initialize LHS - // let v = _a[_i]; - var rhsIterationValue = createElementAccessExpression(rhsReference, counter); - emitStart(node.initializer); - if (node.initializer.kind === 202 /* VariableDeclarationList */) { - write("var "); - var variableDeclarationList = node.initializer; - if (variableDeclarationList.declarations.length > 0) { - var declaration = variableDeclarationList.declarations[0]; - if (ts.isBindingPattern(declaration.name)) { - // This works whether the declaration is a var, let, or const. - // It will use rhsIterationValue _a[_i] as the initializer. - emitDestructuring(declaration, false, rhsIterationValue); - } - else { - // The following call does not include the initializer, so we have - // to emit it separately. - emitNodeWithoutSourceMap(declaration); - write(" = "); - emitNodeWithoutSourceMap(rhsIterationValue); - } - } - else { - // It's an empty declaration list. This can only happen in an error case, if the user wrote - // for (let of []) {} - emitNodeWithoutSourceMap(createTempVariable(0 /* Auto */)); - write(" = "); - emitNodeWithoutSourceMap(rhsIterationValue); - } - } - else { - // Initializer is an expression. Emit the expression in the body, so that it's - // evaluated on every iteration. - var assignmentExpression = createBinaryExpression(node.initializer, 53 /* EqualsToken */, rhsIterationValue, false); - if (node.initializer.kind === 156 /* ArrayLiteralExpression */ || node.initializer.kind === 157 /* ObjectLiteralExpression */) { - // This is a destructuring pattern, so call emitDestructuring instead of emit. Calling emit will not work, because it will cause - // the BinaryExpression to be passed in instead of the expression statement, which will cause emitDestructuring to crash. - emitDestructuring(assignmentExpression, true, undefined); - } - else { - emitNodeWithoutSourceMap(assignmentExpression); - } - } - emitEnd(node.initializer); - write(";"); - if (node.statement.kind === 182 /* Block */) { - emitLines(node.statement.statements); - } - else { - writeLine(); - emit(node.statement); - } - writeLine(); - decreaseIndent(); - write("}"); - } - function emitBreakOrContinueStatement(node) { - emitToken(node.kind === 193 /* BreakStatement */ ? 66 /* BreakKeyword */ : 71 /* ContinueKeyword */, node.pos); - emitOptional(" ", node.label); - write(";"); - } - function emitReturnStatement(node) { - emitToken(90 /* ReturnKeyword */, node.pos); - emitOptional(" ", node.expression); - write(";"); - } - function emitWithStatement(node) { - write("with ("); - emit(node.expression); - write(")"); - emitEmbeddedStatement(node.statement); - } - function emitSwitchStatement(node) { - var endPos = emitToken(92 /* SwitchKeyword */, node.pos); - write(" "); - emitToken(16 /* OpenParenToken */, endPos); - emit(node.expression); - endPos = emitToken(17 /* CloseParenToken */, node.expression.end); - write(" "); - emitCaseBlock(node.caseBlock, endPos); - } - function emitCaseBlock(node, startPos) { - emitToken(14 /* OpenBraceToken */, startPos); - increaseIndent(); - emitLines(node.clauses); - decreaseIndent(); - writeLine(); - emitToken(15 /* CloseBraceToken */, node.clauses.end); - } - function nodeStartPositionsAreOnSameLine(node1, node2) { - return ts.getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node1.pos)) === - ts.getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node2.pos)); - } - function nodeEndPositionsAreOnSameLine(node1, node2) { - return ts.getLineOfLocalPosition(currentSourceFile, node1.end) === - ts.getLineOfLocalPosition(currentSourceFile, node2.end); - } - function nodeEndIsOnSameLineAsNodeStart(node1, node2) { - return ts.getLineOfLocalPosition(currentSourceFile, node1.end) === - ts.getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node2.pos)); - } - function emitCaseOrDefaultClause(node) { - if (node.kind === 223 /* CaseClause */) { - write("case "); - emit(node.expression); - write(":"); - } - else { - write("default:"); - } - if (node.statements.length === 1 && nodeStartPositionsAreOnSameLine(node, node.statements[0])) { - write(" "); - emit(node.statements[0]); - } - else { - increaseIndent(); - emitLines(node.statements); - decreaseIndent(); - } - } - function emitThrowStatement(node) { - write("throw "); - emit(node.expression); - write(";"); - } - function emitTryStatement(node) { - write("try "); - emit(node.tryBlock); - emit(node.catchClause); - if (node.finallyBlock) { - writeLine(); - write("finally "); - emit(node.finallyBlock); - } - } - function emitCatchClause(node) { - writeLine(); - var endPos = emitToken(68 /* CatchKeyword */, node.pos); - write(" "); - emitToken(16 /* OpenParenToken */, endPos); - emit(node.variableDeclaration); - emitToken(17 /* CloseParenToken */, node.variableDeclaration ? node.variableDeclaration.end : endPos); - write(" "); - emitBlock(node.block); - } - function emitDebuggerStatement(node) { - emitToken(72 /* DebuggerKeyword */, node.pos); - write(";"); - } - function emitLabelledStatement(node) { - emit(node.label); - write(": "); - emit(node.statement); - } - function getContainingModule(node) { - do { - node = node.parent; - } while (node && node.kind !== 208 /* ModuleDeclaration */); - return node; - } - function emitContainingModuleName(node) { - var container = getContainingModule(node); - write(container ? getGeneratedNameForNode(container) : "exports"); - } - function emitModuleMemberName(node) { - emitStart(node.name); - if (ts.getCombinedNodeFlags(node) & 1 /* Export */) { - var container = getContainingModule(node); - if (container) { - write(getGeneratedNameForNode(container)); - write("."); - } - else if (languageVersion < 2 /* ES6 */ && compilerOptions.module !== 4 /* System */) { - write("exports."); - } - } - emitNodeWithoutSourceMap(node.name); - emitEnd(node.name); - } - function createVoidZero() { - var zero = ts.createSynthesizedNode(7 /* NumericLiteral */); - zero.text = "0"; - var result = ts.createSynthesizedNode(169 /* VoidExpression */); - result.expression = zero; - return result; - } - function emitExportMemberAssignment(node) { - if (node.flags & 1 /* Export */) { - writeLine(); - emitStart(node); - // emit call to exporter only for top level nodes - if (compilerOptions.module === 4 /* System */ && node.parent === currentSourceFile) { - // emit export default as - // export("default", ) - write(exportFunctionForFile + "(\""); - if (node.flags & 256 /* Default */) { - write("default"); - } - else { - emitNodeWithoutSourceMap(node.name); - } - write("\", "); - emitDeclarationName(node); - write(")"); - } - else { - if (node.flags & 256 /* Default */) { - if (languageVersion === 0 /* ES3 */) { - write("exports[\"default\"]"); - } - else { - write("exports.default"); - } - } - else { - emitModuleMemberName(node); - } - write(" = "); - emitDeclarationName(node); - } - emitEnd(node); - write(";"); - } - } - function emitExportMemberAssignments(name) { - if (!exportEquals && exportSpecifiers && ts.hasProperty(exportSpecifiers, name.text)) { - for (var _a = 0, _b = exportSpecifiers[name.text]; _a < _b.length; _a++) { - var specifier = _b[_a]; - writeLine(); - if (compilerOptions.module === 4 /* System */) { - emitStart(specifier.name); - write(exportFunctionForFile + "(\""); - emitNodeWithoutSourceMap(specifier.name); - write("\", "); - emitExpressionIdentifier(name); - write(")"); - emitEnd(specifier.name); - } - else { - emitStart(specifier.name); - emitContainingModuleName(specifier); - write("."); - emitNodeWithoutSourceMap(specifier.name); - emitEnd(specifier.name); - write(" = "); - emitExpressionIdentifier(name); - } - write(";"); - } - } - } - function emitDestructuring(root, isAssignmentExpressionStatement, value) { - var emitCount = 0; - // An exported declaration is actually emitted as an assignment (to a property on the module object), so - // temporary variables in an exported declaration need to have real declarations elsewhere - // Also temporary variables should be explicitly allocated for source level declarations when module target is system - // because actual variable declarations are hoisted - var canDefineTempVariablesInPlace = false; - if (root.kind === 201 /* VariableDeclaration */) { - var isExported = ts.getCombinedNodeFlags(root) & 1 /* Export */; - var isSourceLevelForSystemModuleKind = shouldHoistDeclarationInSystemJsModule(root); - canDefineTempVariablesInPlace = !isExported && !isSourceLevelForSystemModuleKind; - } - else if (root.kind === 131 /* Parameter */) { - canDefineTempVariablesInPlace = true; - } - if (root.kind === 172 /* BinaryExpression */) { - emitAssignmentExpression(root); - } - else { - ts.Debug.assert(!isAssignmentExpressionStatement); - emitBindingElement(root, value); - } - function emitAssignment(name, value) { - if (emitCount++) { - write(", "); - } - var isVariableDeclarationOrBindingElement = name.parent && (name.parent.kind === 201 /* VariableDeclaration */ || name.parent.kind === 155 /* BindingElement */); - var exportChanged = isNameOfExportedSourceLevelDeclarationInSystemExternalModule(name); - if (exportChanged) { - write(exportFunctionForFile + "(\""); - emitNodeWithoutSourceMap(name); - write("\", "); - } - if (isVariableDeclarationOrBindingElement) { - emitModuleMemberName(name.parent); - } - else { - emit(name); - } - write(" = "); - emit(value); - if (exportChanged) { - write(")"); - } - } - function ensureIdentifier(expr) { - if (expr.kind !== 65 /* Identifier */) { - var identifier = createTempVariable(0 /* Auto */); - if (!canDefineTempVariablesInPlace) { - recordTempDeclaration(identifier); - } - emitAssignment(identifier, expr); - expr = identifier; - } - return expr; - } - function createDefaultValueCheck(value, defaultValue) { - // The value expression will be evaluated twice, so for anything but a simple identifier - // we need to generate a temporary variable - value = ensureIdentifier(value); - // Return the expression 'value === void 0 ? defaultValue : value' - var equals = ts.createSynthesizedNode(172 /* BinaryExpression */); - equals.left = value; - equals.operatorToken = ts.createSynthesizedNode(30 /* EqualsEqualsEqualsToken */); - equals.right = createVoidZero(); - return createConditionalExpression(equals, defaultValue, value); - } - function createConditionalExpression(condition, whenTrue, whenFalse) { - var cond = ts.createSynthesizedNode(173 /* ConditionalExpression */); - cond.condition = condition; - cond.questionToken = ts.createSynthesizedNode(50 /* QuestionToken */); - cond.whenTrue = whenTrue; - cond.colonToken = ts.createSynthesizedNode(51 /* ColonToken */); - cond.whenFalse = whenFalse; - return cond; - } - function createNumericLiteral(value) { - var node = ts.createSynthesizedNode(7 /* NumericLiteral */); - node.text = "" + value; - return node; - } - function createPropertyAccessForDestructuringProperty(object, propName) { - // We create a synthetic copy of the identifier in order to avoid the rewriting that might - // otherwise occur when the identifier is emitted. - var syntheticName = ts.createSynthesizedNode(propName.kind); - syntheticName.text = propName.text; - if (syntheticName.kind !== 65 /* Identifier */) { - return createElementAccessExpression(object, syntheticName); - } - return createPropertyAccessExpression(object, syntheticName); - } - function createSliceCall(value, sliceIndex) { - var call = ts.createSynthesizedNode(160 /* CallExpression */); - var sliceIdentifier = ts.createSynthesizedNode(65 /* Identifier */); - sliceIdentifier.text = "slice"; - call.expression = createPropertyAccessExpression(value, sliceIdentifier); - call.arguments = ts.createSynthesizedNodeArray(); - call.arguments[0] = createNumericLiteral(sliceIndex); - return call; - } - function emitObjectLiteralAssignment(target, value) { - var properties = target.properties; - if (properties.length !== 1) { - // For anything but a single element destructuring we need to generate a temporary - // to ensure value is evaluated exactly once. - value = ensureIdentifier(value); - } - for (var _a = 0; _a < properties.length; _a++) { - var p = properties[_a]; - if (p.kind === 227 /* PropertyAssignment */ || p.kind === 228 /* ShorthandPropertyAssignment */) { - var propName = p.name; - emitDestructuringAssignment(p.initializer || propName, createPropertyAccessForDestructuringProperty(value, propName)); - } - } - } - function emitArrayLiteralAssignment(target, value) { - var elements = target.elements; - if (elements.length !== 1) { - // For anything but a single element destructuring we need to generate a temporary - // to ensure value is evaluated exactly once. - value = ensureIdentifier(value); - } - for (var i = 0; i < elements.length; i++) { - var e = elements[i]; - if (e.kind !== 178 /* OmittedExpression */) { - if (e.kind !== 176 /* SpreadElementExpression */) { - emitDestructuringAssignment(e, createElementAccessExpression(value, createNumericLiteral(i))); - } - else if (i === elements.length - 1) { - emitDestructuringAssignment(e.expression, createSliceCall(value, i)); - } - } - } - } - function emitDestructuringAssignment(target, value) { - if (target.kind === 172 /* BinaryExpression */ && target.operatorToken.kind === 53 /* EqualsToken */) { - value = createDefaultValueCheck(value, target.right); - target = target.left; - } - if (target.kind === 157 /* ObjectLiteralExpression */) { - emitObjectLiteralAssignment(target, value); - } - else if (target.kind === 156 /* ArrayLiteralExpression */) { - emitArrayLiteralAssignment(target, value); - } - else { - emitAssignment(target, value); - } - } - function emitAssignmentExpression(root) { - var target = root.left; - var value = root.right; - if (isAssignmentExpressionStatement) { - emitDestructuringAssignment(target, value); - } - else { - if (root.parent.kind !== 164 /* ParenthesizedExpression */) { - write("("); - } - value = ensureIdentifier(value); - emitDestructuringAssignment(target, value); - write(", "); - emit(value); - if (root.parent.kind !== 164 /* ParenthesizedExpression */) { - write(")"); - } - } - } - function emitBindingElement(target, value) { - if (target.initializer) { - // Combine value and initializer - value = value ? createDefaultValueCheck(value, target.initializer) : target.initializer; - } - else if (!value) { - // Use 'void 0' in absence of value and initializer - value = createVoidZero(); - } - if (ts.isBindingPattern(target.name)) { - var pattern = target.name; - var elements = pattern.elements; - if (elements.length !== 1) { - // For anything but a single element destructuring we need to generate a temporary - // to ensure value is evaluated exactly once. - value = ensureIdentifier(value); - } - for (var i = 0; i < elements.length; i++) { - var element = elements[i]; - if (pattern.kind === 153 /* ObjectBindingPattern */) { - // Rewrite element to a declaration with an initializer that fetches property - var propName = element.propertyName || element.name; - emitBindingElement(element, createPropertyAccessForDestructuringProperty(value, propName)); - } - else if (element.kind !== 178 /* OmittedExpression */) { - if (!element.dotDotDotToken) { - // Rewrite element to a declaration that accesses array element at index i - emitBindingElement(element, createElementAccessExpression(value, createNumericLiteral(i))); - } - else if (i === elements.length - 1) { - emitBindingElement(element, createSliceCall(value, i)); - } - } - } - } - else { - emitAssignment(target.name, value); - } - } - } - function emitVariableDeclaration(node) { - if (ts.isBindingPattern(node.name)) { - if (languageVersion < 2 /* ES6 */) { - emitDestructuring(node, false); - } - else { - emit(node.name); - emitOptional(" = ", node.initializer); - } - } - else { - var initializer = node.initializer; - if (!initializer && languageVersion < 2 /* ES6 */) { - // downlevel emit for non-initialized let bindings defined in loops - // for (...) { let x; } - // should be - // for (...) { var = void 0; } - // this is necessary to preserve ES6 semantic in scenarios like - // for (...) { let x; console.log(x); x = 1 } // assignment on one iteration should not affect other iterations - var isUninitializedLet = (resolver.getNodeCheckFlags(node) & 256 /* BlockScopedBindingInLoop */) && - (getCombinedFlagsForIdentifier(node.name) & 4096 /* Let */); - // NOTE: default initialization should not be added to let bindings in for-in\for-of statements - if (isUninitializedLet && - node.parent.parent.kind !== 190 /* ForInStatement */ && - node.parent.parent.kind !== 191 /* ForOfStatement */) { - initializer = createVoidZero(); - } - } - var exportChanged = isNameOfExportedSourceLevelDeclarationInSystemExternalModule(node.name); - if (exportChanged) { - write(exportFunctionForFile + "(\""); - emitNodeWithoutSourceMap(node.name); - write("\", "); - } - emitModuleMemberName(node); - emitOptional(" = ", initializer); - if (exportChanged) { - write(")"); - } - } - } - function emitExportVariableAssignments(node) { - if (node.kind === 178 /* OmittedExpression */) { - return; - } - var name = node.name; - if (name.kind === 65 /* Identifier */) { - emitExportMemberAssignments(name); - } - else if (ts.isBindingPattern(name)) { - ts.forEach(name.elements, emitExportVariableAssignments); - } - } - function getCombinedFlagsForIdentifier(node) { - if (!node.parent || (node.parent.kind !== 201 /* VariableDeclaration */ && node.parent.kind !== 155 /* BindingElement */)) { - return 0; - } - return ts.getCombinedNodeFlags(node.parent); - } - function isES6ExportedDeclaration(node) { - return !!(node.flags & 1 /* Export */) && - languageVersion >= 2 /* ES6 */ && - node.parent.kind === 230 /* SourceFile */; - } - function emitVariableStatement(node) { - var startIsEmitted = false; - if (node.flags & 1 /* Export */) { - if (isES6ExportedDeclaration(node)) { - // Exported ES6 module member - write("export "); - startIsEmitted = tryEmitStartOfVariableDeclarationList(node.declarationList); - } - } - else { - startIsEmitted = tryEmitStartOfVariableDeclarationList(node.declarationList); - } - if (startIsEmitted) { - emitCommaList(node.declarationList.declarations); - write(";"); - } - else { - var atLeastOneItem = emitVariableDeclarationListSkippingUninitializedEntries(node.declarationList); - if (atLeastOneItem) { - write(";"); - } - } - if (languageVersion < 2 /* ES6 */ && node.parent === currentSourceFile) { - ts.forEach(node.declarationList.declarations, emitExportVariableAssignments); - } - } - function shouldEmitLeadingAndTrailingCommentsForVariableStatement(node) { - // If we're not exporting the variables, there's nothing special here. - // Always emit comments for these nodes. - if (!(node.flags & 1 /* Export */)) { - return true; - } - // If we are exporting, but it's a top-level ES6 module exports, - // we'll emit the declaration list verbatim, so emit comments too. - if (isES6ExportedDeclaration(node)) { - return true; - } - // Otherwise, only emit if we have at least one initializer present. - for (var _a = 0, _b = node.declarationList.declarations; _a < _b.length; _a++) { - var declaration = _b[_a]; - if (declaration.initializer) { - return true; - } - } - return false; - } - function emitParameter(node) { - if (languageVersion < 2 /* ES6 */) { - if (ts.isBindingPattern(node.name)) { - var name_23 = createTempVariable(0 /* Auto */); - if (!tempParameters) { - tempParameters = []; - } - tempParameters.push(name_23); - emit(name_23); - } - else { - emit(node.name); - } - } - else { - if (node.dotDotDotToken) { - write("..."); - } - emit(node.name); - emitOptional(" = ", node.initializer); - } - } - function emitDefaultValueAssignments(node) { - if (languageVersion < 2 /* ES6 */) { - var tempIndex = 0; - ts.forEach(node.parameters, function (p) { - // A rest parameter cannot have a binding pattern or an initializer, - // so let's just ignore it. - if (p.dotDotDotToken) { - return; - } - if (ts.isBindingPattern(p.name)) { - writeLine(); - write("var "); - emitDestructuring(p, false, tempParameters[tempIndex]); - write(";"); - tempIndex++; - } - else if (p.initializer) { - writeLine(); - emitStart(p); - write("if ("); - emitNodeWithoutSourceMap(p.name); - write(" === void 0)"); - emitEnd(p); - write(" { "); - emitStart(p); - emitNodeWithoutSourceMap(p.name); - write(" = "); - emitNodeWithoutSourceMap(p.initializer); - emitEnd(p); - write("; }"); - } - }); - } - } - function emitRestParameter(node) { - if (languageVersion < 2 /* ES6 */ && ts.hasRestParameter(node)) { - var restIndex = node.parameters.length - 1; - var restParam = node.parameters[restIndex]; - // A rest parameter cannot have a binding pattern, so let's just ignore it if it does. - if (ts.isBindingPattern(restParam.name)) { - return; - } - var tempName = createTempVariable(268435456 /* _i */).text; - writeLine(); - emitLeadingComments(restParam); - emitStart(restParam); - write("var "); - emitNodeWithoutSourceMap(restParam.name); - write(" = [];"); - emitEnd(restParam); - emitTrailingComments(restParam); - writeLine(); - write("for ("); - emitStart(restParam); - write("var " + tempName + " = " + restIndex + ";"); - emitEnd(restParam); - write(" "); - emitStart(restParam); - write(tempName + " < arguments.length;"); - emitEnd(restParam); - write(" "); - emitStart(restParam); - write(tempName + "++"); - emitEnd(restParam); - write(") {"); - increaseIndent(); - writeLine(); - emitStart(restParam); - emitNodeWithoutSourceMap(restParam.name); - write("[" + tempName + " - " + restIndex + "] = arguments[" + tempName + "];"); - emitEnd(restParam); - decreaseIndent(); - writeLine(); - write("}"); - } - } - function emitAccessor(node) { - write(node.kind === 138 /* GetAccessor */ ? "get " : "set "); - emit(node.name); - emitSignatureAndBody(node); - } - function shouldEmitAsArrowFunction(node) { - return node.kind === 166 /* ArrowFunction */ && languageVersion >= 2 /* ES6 */; - } - function emitDeclarationName(node) { - if (node.name) { - emitNodeWithoutSourceMap(node.name); - } - else { - write(getGeneratedNameForNode(node)); - } - } - function shouldEmitFunctionName(node) { - if (node.kind === 165 /* FunctionExpression */) { - // Emit name if one is present - return !!node.name; - } - if (node.kind === 203 /* FunctionDeclaration */) { - // Emit name if one is present, or emit generated name in down-level case (for export default case) - return !!node.name || languageVersion < 2 /* ES6 */; - } - } - function emitFunctionDeclaration(node) { - if (ts.nodeIsMissing(node.body)) { - return emitOnlyPinnedOrTripleSlashComments(node); - } - if (node.kind !== 136 /* MethodDeclaration */ && node.kind !== 135 /* MethodSignature */) { - // Methods will emit the comments as part of emitting method declaration - emitLeadingComments(node); - } - // For targeting below es6, emit functions-like declaration including arrow function using function keyword. - // When targeting ES6, emit arrow function natively in ES6 by omitting function keyword and using fat arrow instead - if (!shouldEmitAsArrowFunction(node)) { - if (isES6ExportedDeclaration(node)) { - write("export "); - if (node.flags & 256 /* Default */) { - write("default "); - } - } - write("function"); - if (languageVersion >= 2 /* ES6 */ && node.asteriskToken) { - write("*"); - } - write(" "); - } - if (shouldEmitFunctionName(node)) { - emitDeclarationName(node); - } - emitSignatureAndBody(node); - if (languageVersion < 2 /* ES6 */ && node.kind === 203 /* FunctionDeclaration */ && node.parent === currentSourceFile && node.name) { - emitExportMemberAssignments(node.name); - } - if (node.kind !== 136 /* MethodDeclaration */ && node.kind !== 135 /* MethodSignature */) { - emitTrailingComments(node); - } - } - function emitCaptureThisForNodeIfNecessary(node) { - if (resolver.getNodeCheckFlags(node) & 4 /* CaptureThis */) { - writeLine(); - emitStart(node); - write("var _this = this;"); - emitEnd(node); - } - } - function emitSignatureParameters(node) { - increaseIndent(); - write("("); - if (node) { - var parameters = node.parameters; - var omitCount = languageVersion < 2 /* ES6 */ && ts.hasRestParameter(node) ? 1 : 0; - emitList(parameters, 0, parameters.length - omitCount, false, false); - } - write(")"); - decreaseIndent(); - } - function emitSignatureParametersForArrow(node) { - // Check whether the parameter list needs parentheses and preserve no-parenthesis - if (node.parameters.length === 1 && node.pos === node.parameters[0].pos) { - emit(node.parameters[0]); - return; - } - emitSignatureParameters(node); - } - function emitSignatureAndBody(node) { - var saveTempFlags = tempFlags; - var saveTempVariables = tempVariables; - var saveTempParameters = tempParameters; - tempFlags = 0; - tempVariables = undefined; - tempParameters = undefined; - // When targeting ES6, emit arrow function natively in ES6 - if (shouldEmitAsArrowFunction(node)) { - emitSignatureParametersForArrow(node); - write(" =>"); - } - else { - emitSignatureParameters(node); - } - if (!node.body) { - // There can be no body when there are parse errors. Just emit an empty block - // in that case. - write(" { }"); - } - else if (node.body.kind === 182 /* Block */) { - emitBlockFunctionBody(node, node.body); - } - else { - emitExpressionFunctionBody(node, node.body); - } - if (!isES6ExportedDeclaration(node)) { - emitExportMemberAssignment(node); - } - tempFlags = saveTempFlags; - tempVariables = saveTempVariables; - tempParameters = saveTempParameters; - } - // Returns true if any preamble code was emitted. - function emitFunctionBodyPreamble(node) { - emitCaptureThisForNodeIfNecessary(node); - emitDefaultValueAssignments(node); - emitRestParameter(node); - } - function emitExpressionFunctionBody(node, body) { - if (languageVersion < 2 /* ES6 */) { - emitDownLevelExpressionFunctionBody(node, body); - return; - } - // For es6 and higher we can emit the expression as is. However, in the case - // where the expression might end up looking like a block when emitted, we'll - // also wrap it in parentheses first. For example if you have: a => {} - // then we need to generate: a => ({}) - write(" "); - // Unwrap all type assertions. - var current = body; - while (current.kind === 163 /* TypeAssertionExpression */) { - current = current.expression; - } - emitParenthesizedIf(body, current.kind === 157 /* ObjectLiteralExpression */); - } - function emitDownLevelExpressionFunctionBody(node, body) { - write(" {"); - scopeEmitStart(node); - increaseIndent(); - var outPos = writer.getTextPos(); - emitDetachedComments(node.body); - emitFunctionBodyPreamble(node); - var preambleEmitted = writer.getTextPos() !== outPos; - decreaseIndent(); - // If we didn't have to emit any preamble code, then attempt to keep the arrow - // function on one line. - if (!preambleEmitted && nodeStartPositionsAreOnSameLine(node, body)) { - write(" "); - emitStart(body); - write("return "); - emit(body); - emitEnd(body); - write(";"); - emitTempDeclarations(false); - write(" "); - } - else { - increaseIndent(); - writeLine(); - emitLeadingComments(node.body); - write("return "); - emit(body); - write(";"); - emitTrailingComments(node.body); - emitTempDeclarations(true); - decreaseIndent(); - writeLine(); - } - emitStart(node.body); - write("}"); - emitEnd(node.body); - scopeEmitEnd(); - } - function emitBlockFunctionBody(node, body) { - write(" {"); - scopeEmitStart(node); - var initialTextPos = writer.getTextPos(); - increaseIndent(); - emitDetachedComments(body.statements); - // Emit all the directive prologues (like "use strict"). These have to come before - // any other preamble code we write (like parameter initializers). - var startIndex = emitDirectivePrologues(body.statements, true); - emitFunctionBodyPreamble(node); - decreaseIndent(); - var preambleEmitted = writer.getTextPos() !== initialTextPos; - if (!preambleEmitted && nodeEndIsOnSameLineAsNodeStart(body, body)) { - for (var _a = 0, _b = body.statements; _a < _b.length; _a++) { - var statement = _b[_a]; - write(" "); - emit(statement); - } - emitTempDeclarations(false); - write(" "); - emitLeadingCommentsOfPosition(body.statements.end); - } - else { - increaseIndent(); - emitLinesStartingAt(body.statements, startIndex); - emitTempDeclarations(true); - writeLine(); - emitLeadingCommentsOfPosition(body.statements.end); - decreaseIndent(); - } - emitToken(15 /* CloseBraceToken */, body.statements.end); - scopeEmitEnd(); - } - function findInitialSuperCall(ctor) { - if (ctor.body) { - var statement = ctor.body.statements[0]; - if (statement && statement.kind === 185 /* ExpressionStatement */) { - var expr = statement.expression; - if (expr && expr.kind === 160 /* CallExpression */) { - var func = expr.expression; - if (func && func.kind === 91 /* SuperKeyword */) { - return statement; - } - } - } - } - } - function emitParameterPropertyAssignments(node) { - ts.forEach(node.parameters, function (param) { - if (param.flags & 112 /* AccessibilityModifier */) { - writeLine(); - emitStart(param); - emitStart(param.name); - write("this."); - emitNodeWithoutSourceMap(param.name); - emitEnd(param.name); - write(" = "); - emit(param.name); - write(";"); - emitEnd(param); - } - }); - } - function emitMemberAccessForPropertyName(memberName) { - // TODO: (jfreeman,drosen): comment on why this is emitNodeWithoutSourceMap instead of emit here. - if (memberName.kind === 8 /* StringLiteral */ || memberName.kind === 7 /* NumericLiteral */) { - write("["); - emitNodeWithoutSourceMap(memberName); - write("]"); - } - else if (memberName.kind === 129 /* ComputedPropertyName */) { - emitComputedPropertyName(memberName); - } - else { - write("."); - emitNodeWithoutSourceMap(memberName); - } - } - function getInitializedProperties(node, isStatic) { - var properties = []; - for (var _a = 0, _b = node.members; _a < _b.length; _a++) { - var member = _b[_a]; - if (member.kind === 134 /* PropertyDeclaration */ && isStatic === ((member.flags & 128 /* Static */) !== 0) && member.initializer) { - properties.push(member); - } - } - return properties; - } - function emitPropertyDeclarations(node, properties) { - for (var _a = 0; _a < properties.length; _a++) { - var property = properties[_a]; - emitPropertyDeclaration(node, property); - } - } - function emitPropertyDeclaration(node, property, receiver, isExpression) { - writeLine(); - emitLeadingComments(property); - emitStart(property); - emitStart(property.name); - if (receiver) { - emit(receiver); - } - else { - if (property.flags & 128 /* Static */) { - emitDeclarationName(node); - } - else { - write("this"); - } - } - emitMemberAccessForPropertyName(property.name); - emitEnd(property.name); - write(" = "); - emit(property.initializer); - if (!isExpression) { - write(";"); - } - emitEnd(property); - emitTrailingComments(property); - } - function emitMemberFunctionsForES5AndLower(node) { - ts.forEach(node.members, function (member) { - if (member.kind === 181 /* SemicolonClassElement */) { - writeLine(); - write(";"); - } - else if (member.kind === 136 /* MethodDeclaration */ || node.kind === 135 /* MethodSignature */) { - if (!member.body) { - return emitOnlyPinnedOrTripleSlashComments(member); - } - writeLine(); - emitLeadingComments(member); - emitStart(member); - emitStart(member.name); - emitClassMemberPrefix(node, member); - emitMemberAccessForPropertyName(member.name); - emitEnd(member.name); - write(" = "); - emitStart(member); - emitFunctionDeclaration(member); - emitEnd(member); - emitEnd(member); - write(";"); - emitTrailingComments(member); - } - else if (member.kind === 138 /* GetAccessor */ || member.kind === 139 /* SetAccessor */) { - var accessors = ts.getAllAccessorDeclarations(node.members, member); - if (member === accessors.firstAccessor) { - writeLine(); - emitStart(member); - write("Object.defineProperty("); - emitStart(member.name); - emitClassMemberPrefix(node, member); - write(", "); - emitExpressionForPropertyName(member.name); - emitEnd(member.name); - write(", {"); - increaseIndent(); - if (accessors.getAccessor) { - writeLine(); - emitLeadingComments(accessors.getAccessor); - write("get: "); - emitStart(accessors.getAccessor); - write("function "); - emitSignatureAndBody(accessors.getAccessor); - emitEnd(accessors.getAccessor); - emitTrailingComments(accessors.getAccessor); - write(","); - } - if (accessors.setAccessor) { - writeLine(); - emitLeadingComments(accessors.setAccessor); - write("set: "); - emitStart(accessors.setAccessor); - write("function "); - emitSignatureAndBody(accessors.setAccessor); - emitEnd(accessors.setAccessor); - emitTrailingComments(accessors.setAccessor); - write(","); - } - writeLine(); - write("enumerable: true,"); - writeLine(); - write("configurable: true"); - decreaseIndent(); - writeLine(); - write("});"); - emitEnd(member); - } - } - }); - } - function emitMemberFunctionsForES6AndHigher(node) { - for (var _a = 0, _b = node.members; _a < _b.length; _a++) { - var member = _b[_a]; - if ((member.kind === 136 /* MethodDeclaration */ || node.kind === 135 /* MethodSignature */) && !member.body) { - emitOnlyPinnedOrTripleSlashComments(member); - } - else if (member.kind === 136 /* MethodDeclaration */ || - member.kind === 138 /* GetAccessor */ || - member.kind === 139 /* SetAccessor */) { - writeLine(); - emitLeadingComments(member); - emitStart(member); - if (member.flags & 128 /* Static */) { - write("static "); - } - if (member.kind === 138 /* GetAccessor */) { - write("get "); - } - else if (member.kind === 139 /* SetAccessor */) { - write("set "); - } - if (member.asteriskToken) { - write("*"); - } - emit(member.name); - emitSignatureAndBody(member); - emitEnd(member); - emitTrailingComments(member); - } - else if (member.kind === 181 /* SemicolonClassElement */) { - writeLine(); - write(";"); - } - } - } - function emitConstructor(node, baseTypeElement) { - var saveTempFlags = tempFlags; - var saveTempVariables = tempVariables; - var saveTempParameters = tempParameters; - tempFlags = 0; - tempVariables = undefined; - tempParameters = undefined; - emitConstructorWorker(node, baseTypeElement); - tempFlags = saveTempFlags; - tempVariables = saveTempVariables; - tempParameters = saveTempParameters; - } - function emitConstructorWorker(node, baseTypeElement) { - // Check if we have property assignment inside class declaration. - // If there is property assignment, we need to emit constructor whether users define it or not - // If there is no property assignment, we can omit constructor if users do not define it - var hasInstancePropertyWithInitializer = false; - // Emit the constructor overload pinned comments - ts.forEach(node.members, function (member) { - if (member.kind === 137 /* Constructor */ && !member.body) { - emitOnlyPinnedOrTripleSlashComments(member); - } - // Check if there is any non-static property assignment - if (member.kind === 134 /* PropertyDeclaration */ && member.initializer && (member.flags & 128 /* Static */) === 0) { - hasInstancePropertyWithInitializer = true; - } - }); - var ctor = ts.getFirstConstructorWithBody(node); - // For target ES6 and above, if there is no user-defined constructor and there is no property assignment - // do not emit constructor in class declaration. - if (languageVersion >= 2 /* ES6 */ && !ctor && !hasInstancePropertyWithInitializer) { - return; - } - if (ctor) { - emitLeadingComments(ctor); - } - emitStart(ctor || node); - if (languageVersion < 2 /* ES6 */) { - write("function "); - emitDeclarationName(node); - emitSignatureParameters(ctor); - } - else { - write("constructor"); - if (ctor) { - emitSignatureParameters(ctor); - } - else { - // Based on EcmaScript6 section 14.5.14: Runtime Semantics: ClassDefinitionEvaluation. - // If constructor is empty, then, - // If ClassHeritageopt is present, then - // Let constructor be the result of parsing the String "constructor(... args){ super (...args);}" using the syntactic grammar with the goal symbol MethodDefinition. - // Else, - // Let constructor be the result of parsing the String "constructor( ){ }" using the syntactic grammar with the goal symbol MethodDefinition - if (baseTypeElement) { - write("(...args)"); - } - else { - write("()"); - } - } - } - write(" {"); - scopeEmitStart(node, "constructor"); - increaseIndent(); - if (ctor) { - emitDetachedComments(ctor.body.statements); - } - emitCaptureThisForNodeIfNecessary(node); - if (ctor) { - emitDefaultValueAssignments(ctor); - emitRestParameter(ctor); - if (baseTypeElement) { - var superCall = findInitialSuperCall(ctor); - if (superCall) { - writeLine(); - emit(superCall); - } - } - emitParameterPropertyAssignments(ctor); - } - else { - if (baseTypeElement) { - writeLine(); - emitStart(baseTypeElement); - if (languageVersion < 2 /* ES6 */) { - write("_super.apply(this, arguments);"); - } - else { - write("super(...args);"); - } - emitEnd(baseTypeElement); - } - } - emitPropertyDeclarations(node, getInitializedProperties(node, false)); - if (ctor) { - var statements = ctor.body.statements; - if (superCall) { - statements = statements.slice(1); - } - emitLines(statements); - } - emitTempDeclarations(true); - writeLine(); - if (ctor) { - emitLeadingCommentsOfPosition(ctor.body.statements.end); - } - decreaseIndent(); - emitToken(15 /* CloseBraceToken */, ctor ? ctor.body.statements.end : node.members.end); - scopeEmitEnd(); - emitEnd(ctor || node); - if (ctor) { - emitTrailingComments(ctor); - } - } - function emitClassExpression(node) { - return emitClassLikeDeclaration(node); - } - function emitClassDeclaration(node) { - return emitClassLikeDeclaration(node); - } - function emitClassLikeDeclaration(node) { - if (languageVersion < 2 /* ES6 */) { - emitClassLikeDeclarationBelowES6(node); - } - else { - emitClassLikeDeclarationForES6AndHigher(node); - } - } - function emitClassLikeDeclarationForES6AndHigher(node) { - var thisNodeIsDecorated = ts.nodeIsDecorated(node); - if (node.kind === 204 /* ClassDeclaration */) { - if (thisNodeIsDecorated) { - // To preserve the correct runtime semantics when decorators are applied to the class, - // the emit needs to follow one of the following rules: - // - // * For a local class declaration: - // - // @dec class C { - // } - // - // The emit should be: - // - // let C = class { - // }; - // Object.defineProperty(C, "name", { value: "C", configurable: true }); - // C = __decorate([dec], C); - // - // * For an exported class declaration: - // - // @dec export class C { - // } - // - // The emit should be: - // - // export let C = class { - // }; - // Object.defineProperty(C, "name", { value: "C", configurable: true }); - // C = __decorate([dec], C); - // - // * For a default export of a class declaration with a name: - // - // @dec default export class C { - // } - // - // The emit should be: - // - // let C = class { - // } - // Object.defineProperty(C, "name", { value: "C", configurable: true }); - // C = __decorate([dec], C); - // export default C; - // - // * For a default export of a class declaration without a name: - // - // @dec default export class { - // } - // - // The emit should be: - // - // let _default = class { - // } - // _default = __decorate([dec], _default); - // export default _default; - // - if (isES6ExportedDeclaration(node) && !(node.flags & 256 /* Default */)) { - write("export "); - } - write("let "); - emitDeclarationName(node); - write(" = "); - } - else if (isES6ExportedDeclaration(node)) { - write("export "); - if (node.flags & 256 /* Default */) { - write("default "); - } - } - } - // If the class has static properties, and it's a class expression, then we'll need - // to specialize the emit a bit. for a class expression of the form: - // - // class C { static a = 1; static b = 2; ... } - // - // We'll emit: - // - // (_temp = class C { ... }, _temp.a = 1, _temp.b = 2, _temp) - // - // This keeps the expression as an expression, while ensuring that the static parts - // of it have been initialized by the time it is used. - var staticProperties = getInitializedProperties(node, true); - var isClassExpressionWithStaticProperties = staticProperties.length > 0 && node.kind === 177 /* ClassExpression */; - var tempVariable; - if (isClassExpressionWithStaticProperties) { - tempVariable = createAndRecordTempVariable(0 /* Auto */); - write("("); - increaseIndent(); - emit(tempVariable); - write(" = "); - } - write("class"); - // check if this is an "export default class" as it may not have a name. Do not emit the name if the class is decorated. - if ((node.name || !(node.flags & 256 /* Default */)) && !thisNodeIsDecorated) { - write(" "); - emitDeclarationName(node); - } - var baseTypeNode = ts.getClassExtendsHeritageClauseElement(node); - if (baseTypeNode) { - write(" extends "); - emit(baseTypeNode.expression); - } - write(" {"); - increaseIndent(); - scopeEmitStart(node); - writeLine(); - emitConstructor(node, baseTypeNode); - emitMemberFunctionsForES6AndHigher(node); - decreaseIndent(); - writeLine(); - emitToken(15 /* CloseBraceToken */, node.members.end); - scopeEmitEnd(); - // TODO(rbuckton): Need to go back to `let _a = class C {}` approach, removing the defineProperty call for now. - // For a decorated class, we need to assign its name (if it has one). This is because we emit - // the class as a class expression to avoid the double-binding of the identifier: - // - // let C = class { - // } - // Object.defineProperty(C, "name", { value: "C", configurable: true }); - // - if (thisNodeIsDecorated) { - write(";"); - } - // Emit static property assignment. Because classDeclaration is lexically evaluated, - // it is safe to emit static property assignment after classDeclaration - // From ES6 specification: - // HasLexicalDeclaration (N) : Determines if the argument identifier has a binding in this environment record that was created using - // a lexical declaration such as a LexicalDeclaration or a ClassDeclaration. - if (isClassExpressionWithStaticProperties) { - for (var _a = 0; _a < staticProperties.length; _a++) { - var property = staticProperties[_a]; - write(","); - writeLine(); - emitPropertyDeclaration(node, property, tempVariable, true); - } - write(","); - writeLine(); - emit(tempVariable); - decreaseIndent(); - write(")"); - } - else { - writeLine(); - emitPropertyDeclarations(node, staticProperties); - emitDecoratorsOfClass(node); - } - // If this is an exported class, but not on the top level (i.e. on an internal - // module), export it - if (!isES6ExportedDeclaration(node) && (node.flags & 1 /* Export */)) { - writeLine(); - emitStart(node); - emitModuleMemberName(node); - write(" = "); - emitDeclarationName(node); - emitEnd(node); - write(";"); - } - else if (isES6ExportedDeclaration(node) && (node.flags & 256 /* Default */) && thisNodeIsDecorated) { - // if this is a top level default export of decorated class, write the export after the declaration. - writeLine(); - write("export default "); - emitDeclarationName(node); - write(";"); - } - } - function emitClassLikeDeclarationBelowES6(node) { - if (node.kind === 204 /* ClassDeclaration */) { - // source file level classes in system modules are hoisted so 'var's for them are already defined - if (!shouldHoistDeclarationInSystemJsModule(node)) { - write("var "); - } - emitDeclarationName(node); - write(" = "); - } - write("(function ("); - var baseTypeNode = ts.getClassExtendsHeritageClauseElement(node); - if (baseTypeNode) { - write("_super"); - } - write(") {"); - var saveTempFlags = tempFlags; - var saveTempVariables = tempVariables; - var saveTempParameters = tempParameters; - var saveComputedPropertyNamesToGeneratedNames = computedPropertyNamesToGeneratedNames; - tempFlags = 0; - tempVariables = undefined; - tempParameters = undefined; - computedPropertyNamesToGeneratedNames = undefined; - increaseIndent(); - scopeEmitStart(node); - if (baseTypeNode) { - writeLine(); - emitStart(baseTypeNode); - write("__extends("); - emitDeclarationName(node); - write(", _super);"); - emitEnd(baseTypeNode); - } - writeLine(); - emitConstructor(node, baseTypeNode); - emitMemberFunctionsForES5AndLower(node); - emitPropertyDeclarations(node, getInitializedProperties(node, true)); - writeLine(); - emitDecoratorsOfClass(node); - writeLine(); - emitToken(15 /* CloseBraceToken */, node.members.end, function () { - write("return "); - emitDeclarationName(node); - }); - write(";"); - emitTempDeclarations(true); - tempFlags = saveTempFlags; - tempVariables = saveTempVariables; - tempParameters = saveTempParameters; - computedPropertyNamesToGeneratedNames = saveComputedPropertyNamesToGeneratedNames; - decreaseIndent(); - writeLine(); - emitToken(15 /* CloseBraceToken */, node.members.end); - scopeEmitEnd(); - emitStart(node); - write(")("); - if (baseTypeNode) { - emit(baseTypeNode.expression); - } - write(")"); - if (node.kind === 204 /* ClassDeclaration */) { - write(";"); - } - emitEnd(node); - if (node.kind === 204 /* ClassDeclaration */) { - emitExportMemberAssignment(node); - } - if (languageVersion < 2 /* ES6 */ && node.parent === currentSourceFile && node.name) { - emitExportMemberAssignments(node.name); - } - } - function emitClassMemberPrefix(node, member) { - emitDeclarationName(node); - if (!(member.flags & 128 /* Static */)) { - write(".prototype"); - } - } - function emitDecoratorsOfClass(node) { - emitDecoratorsOfMembers(node, 0); - emitDecoratorsOfMembers(node, 128 /* Static */); - emitDecoratorsOfConstructor(node); - } - function emitDecoratorsOfConstructor(node) { - var decorators = node.decorators; - var constructor = ts.getFirstConstructorWithBody(node); - var hasDecoratedParameters = constructor && ts.forEach(constructor.parameters, ts.nodeIsDecorated); - // skip decoration of the constructor if neither it nor its parameters are decorated - if (!decorators && !hasDecoratedParameters) { - return; - } - // Emit the call to __decorate. Given the class: - // - // @dec - // class C { - // } - // - // The emit for the class is: - // - // C = __decorate([dec], C); - // - writeLine(); - emitStart(node); - emitDeclarationName(node); - write(" = __decorate(["); - increaseIndent(); - writeLine(); - var decoratorCount = decorators ? decorators.length : 0; - var argumentsWritten = emitList(decorators, 0, decoratorCount, true, false, false, true, function (decorator) { - emitStart(decorator); - emit(decorator.expression); - emitEnd(decorator); - }); - argumentsWritten += emitDecoratorsOfParameters(constructor, argumentsWritten > 0); - emitSerializedTypeMetadata(node, argumentsWritten >= 0); - decreaseIndent(); - writeLine(); - write("], "); - emitDeclarationName(node); - write(");"); - emitEnd(node); - writeLine(); - } - function emitDecoratorsOfMembers(node, staticFlag) { - for (var _a = 0, _b = node.members; _a < _b.length; _a++) { - var member = _b[_a]; - // only emit members in the correct group - if ((member.flags & 128 /* Static */) !== staticFlag) { - continue; - } - // skip members that cannot be decorated (such as the constructor) - if (!ts.nodeCanBeDecorated(member)) { - continue; - } - // skip a member if it or any of its parameters are not decorated - if (!ts.nodeOrChildIsDecorated(member)) { - continue; - } - // skip an accessor declaration if it is not the first accessor - var decorators = void 0; - var functionLikeMember = void 0; - if (ts.isAccessor(member)) { - var accessors = ts.getAllAccessorDeclarations(node.members, member); - if (member !== accessors.firstAccessor) { - continue; - } - // get the decorators from the first accessor with decorators - decorators = accessors.firstAccessor.decorators; - if (!decorators && accessors.secondAccessor) { - decorators = accessors.secondAccessor.decorators; - } - // we only decorate parameters of the set accessor - functionLikeMember = accessors.setAccessor; - } - else { - decorators = member.decorators; - // we only decorate the parameters here if this is a method - if (member.kind === 136 /* MethodDeclaration */) { - functionLikeMember = member; - } - } - // Emit the call to __decorate. Given the following: - // - // class C { - // @dec method(@dec2 x) {} - // @dec get accessor() {} - // @dec prop; - // } - // - // The emit for a method is: - // - // Object.defineProperty(C.prototype, "method", - // __decorate([ - // dec, - // __param(0, dec2), - // __metadata("design:type", Function), - // __metadata("design:paramtypes", [Object]), - // __metadata("design:returntype", void 0) - // ], C.prototype, "method", Object.getOwnPropertyDescriptor(C.prototype, "method"))); - // - // The emit for an accessor is: - // - // Object.defineProperty(C.prototype, "accessor", - // __decorate([ - // dec - // ], C.prototype, "accessor", Object.getOwnPropertyDescriptor(C.prototype, "accessor"))); - // - // The emit for a property is: - // - // __decorate([ - // dec - // ], C.prototype, "prop"); - // - writeLine(); - emitStart(member); - if (member.kind !== 134 /* PropertyDeclaration */) { - write("Object.defineProperty("); - emitStart(member.name); - emitClassMemberPrefix(node, member); - write(", "); - emitExpressionForPropertyName(member.name); - emitEnd(member.name); - write(","); - increaseIndent(); - writeLine(); - } - write("__decorate(["); - increaseIndent(); - writeLine(); - var decoratorCount = decorators ? decorators.length : 0; - var argumentsWritten = emitList(decorators, 0, decoratorCount, true, false, false, true, function (decorator) { - emitStart(decorator); - emit(decorator.expression); - emitEnd(decorator); - }); - argumentsWritten += emitDecoratorsOfParameters(functionLikeMember, argumentsWritten > 0); - emitSerializedTypeMetadata(member, argumentsWritten > 0); - decreaseIndent(); - writeLine(); - write("], "); - emitStart(member.name); - emitClassMemberPrefix(node, member); - write(", "); - emitExpressionForPropertyName(member.name); - emitEnd(member.name); - if (member.kind !== 134 /* PropertyDeclaration */) { - write(", Object.getOwnPropertyDescriptor("); - emitStart(member.name); - emitClassMemberPrefix(node, member); - write(", "); - emitExpressionForPropertyName(member.name); - emitEnd(member.name); - write("))"); - decreaseIndent(); - } - write(");"); - emitEnd(member); - writeLine(); - } - } - function emitDecoratorsOfParameters(node, leadingComma) { - var argumentsWritten = 0; - if (node) { - var parameterIndex = 0; - for (var _a = 0, _b = node.parameters; _a < _b.length; _a++) { - var parameter = _b[_a]; - if (ts.nodeIsDecorated(parameter)) { - var decorators = parameter.decorators; - argumentsWritten += emitList(decorators, 0, decorators.length, true, false, leadingComma, true, function (decorator) { - emitStart(decorator); - write("__param(" + parameterIndex + ", "); - emit(decorator.expression); - write(")"); - emitEnd(decorator); - }); - leadingComma = true; - } - ++parameterIndex; - } - } - return argumentsWritten; - } - function shouldEmitTypeMetadata(node) { - // This method determines whether to emit the "design:type" metadata based on the node's kind. - // The caller should have already tested whether the node has decorators and whether the emitDecoratorMetadata - // compiler option is set. - switch (node.kind) { - case 136 /* MethodDeclaration */: - case 138 /* GetAccessor */: - case 139 /* SetAccessor */: - case 134 /* PropertyDeclaration */: - return true; - } - return false; - } - function shouldEmitReturnTypeMetadata(node) { - // This method determines whether to emit the "design:returntype" metadata based on the node's kind. - // The caller should have already tested whether the node has decorators and whether the emitDecoratorMetadata - // compiler option is set. - switch (node.kind) { - case 136 /* MethodDeclaration */: - return true; - } - return false; - } - function shouldEmitParamTypesMetadata(node) { - // This method determines whether to emit the "design:paramtypes" metadata based on the node's kind. - // The caller should have already tested whether the node has decorators and whether the emitDecoratorMetadata - // compiler option is set. - switch (node.kind) { - case 204 /* ClassDeclaration */: - case 136 /* MethodDeclaration */: - case 139 /* SetAccessor */: - return true; - } - return false; - } - function emitSerializedTypeMetadata(node, writeComma) { - // This method emits the serialized type metadata for a decorator target. - // The caller should have already tested whether the node has decorators. - var argumentsWritten = 0; - if (compilerOptions.emitDecoratorMetadata) { - if (shouldEmitTypeMetadata(node)) { - var serializedType = resolver.serializeTypeOfNode(node); - if (serializedType) { - if (writeComma) { - write(", "); - } - writeLine(); - write("__metadata('design:type', "); - emitSerializedType(node, serializedType); - write(")"); - argumentsWritten++; - } - } - if (shouldEmitParamTypesMetadata(node)) { - var serializedTypes = resolver.serializeParameterTypesOfNode(node); - if (serializedTypes) { - if (writeComma || argumentsWritten) { - write(", "); - } - writeLine(); - write("__metadata('design:paramtypes', ["); - for (var i = 0; i < serializedTypes.length; ++i) { - if (i > 0) { - write(", "); - } - emitSerializedType(node, serializedTypes[i]); - } - write("])"); - argumentsWritten++; - } - } - if (shouldEmitReturnTypeMetadata(node)) { - var serializedType = resolver.serializeReturnTypeOfNode(node); - if (serializedType) { - if (writeComma || argumentsWritten) { - write(", "); - } - writeLine(); - write("__metadata('design:returntype', "); - emitSerializedType(node, serializedType); - write(")"); - argumentsWritten++; - } - } - } - return argumentsWritten; - } - function serializeTypeNameSegment(location, path, index) { - switch (index) { - case 0: - return "typeof " + path[index] + " !== 'undefined' && " + path[index]; - case 1: - return serializeTypeNameSegment(location, path, index - 1) + "." + path[index]; - default: - var temp = createAndRecordTempVariable(0 /* Auto */).text; - return "(" + temp + " = " + serializeTypeNameSegment(location, path, index - 1) + ") && " + temp + "." + path[index]; - } - } - function emitSerializedType(location, name) { - if (typeof name === "string") { - write(name); - return; - } - else { - ts.Debug.assert(name.length > 0, "Invalid serialized type name"); - write("(" + serializeTypeNameSegment(location, name, name.length - 1) + ") || Object"); - } - } - function emitInterfaceDeclaration(node) { - emitOnlyPinnedOrTripleSlashComments(node); - } - function shouldEmitEnumDeclaration(node) { - var isConstEnum = ts.isConst(node); - return !isConstEnum || compilerOptions.preserveConstEnums || compilerOptions.isolatedModules; - } - function emitEnumDeclaration(node) { - // const enums are completely erased during compilation. - if (!shouldEmitEnumDeclaration(node)) { - return; - } - if (!shouldHoistDeclarationInSystemJsModule(node)) { - // do not emit var if variable was already hoisted - if (!(node.flags & 1 /* Export */) || isES6ExportedDeclaration(node)) { - emitStart(node); - if (isES6ExportedDeclaration(node)) { - write("export "); - } - write("var "); - emit(node.name); - emitEnd(node); - write(";"); - } - } - writeLine(); - emitStart(node); - write("(function ("); - emitStart(node.name); - write(getGeneratedNameForNode(node)); - emitEnd(node.name); - write(") {"); - increaseIndent(); - scopeEmitStart(node); - emitLines(node.members); - decreaseIndent(); - writeLine(); - emitToken(15 /* CloseBraceToken */, node.members.end); - scopeEmitEnd(); - write(")("); - emitModuleMemberName(node); - write(" || ("); - emitModuleMemberName(node); - write(" = {}));"); - emitEnd(node); - if (!isES6ExportedDeclaration(node) && node.flags & 1 /* Export */ && !shouldHoistDeclarationInSystemJsModule(node)) { - // do not emit var if variable was already hoisted - writeLine(); - emitStart(node); - write("var "); - emit(node.name); - write(" = "); - emitModuleMemberName(node); - emitEnd(node); - write(";"); - } - if (languageVersion < 2 /* ES6 */ && node.parent === currentSourceFile) { - if (compilerOptions.module === 4 /* System */ && (node.flags & 1 /* Export */)) { - // write the call to exporter for enum - writeLine(); - write(exportFunctionForFile + "(\""); - emitDeclarationName(node); - write("\", "); - emitDeclarationName(node); - write(");"); - } - emitExportMemberAssignments(node.name); - } - } - function emitEnumMember(node) { - var enumParent = node.parent; - emitStart(node); - write(getGeneratedNameForNode(enumParent)); - write("["); - write(getGeneratedNameForNode(enumParent)); - write("["); - emitExpressionForPropertyName(node.name); - write("] = "); - writeEnumMemberDeclarationValue(node); - write("] = "); - emitExpressionForPropertyName(node.name); - emitEnd(node); - write(";"); - } - function writeEnumMemberDeclarationValue(member) { - var value = resolver.getConstantValue(member); - if (value !== undefined) { - write(value.toString()); - return; - } - else if (member.initializer) { - emit(member.initializer); - } - else { - write("undefined"); - } - } - function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { - if (moduleDeclaration.body.kind === 208 /* ModuleDeclaration */) { - var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); - return recursiveInnerModule || moduleDeclaration.body; - } - } - function shouldEmitModuleDeclaration(node) { - return ts.isInstantiatedModule(node, compilerOptions.preserveConstEnums || compilerOptions.isolatedModules); - } - function isModuleMergedWithES6Class(node) { - return languageVersion === 2 /* ES6 */ && !!(resolver.getNodeCheckFlags(node) & 2048 /* LexicalModuleMergesWithClass */); - } - function emitModuleDeclaration(node) { - // Emit only if this module is non-ambient. - var shouldEmit = shouldEmitModuleDeclaration(node); - if (!shouldEmit) { - return emitOnlyPinnedOrTripleSlashComments(node); - } - var hoistedInDeclarationScope = shouldHoistDeclarationInSystemJsModule(node); - var emitVarForModule = !hoistedInDeclarationScope && !isModuleMergedWithES6Class(node); - if (emitVarForModule) { - emitStart(node); - if (isES6ExportedDeclaration(node)) { - write("export "); - } - write("var "); - emit(node.name); - write(";"); - emitEnd(node); - writeLine(); - } - emitStart(node); - write("(function ("); - emitStart(node.name); - write(getGeneratedNameForNode(node)); - emitEnd(node.name); - write(") "); - if (node.body.kind === 209 /* ModuleBlock */) { - var saveTempFlags = tempFlags; - var saveTempVariables = tempVariables; - tempFlags = 0; - tempVariables = undefined; - emit(node.body); - tempFlags = saveTempFlags; - tempVariables = saveTempVariables; - } - else { - write("{"); - increaseIndent(); - scopeEmitStart(node); - emitCaptureThisForNodeIfNecessary(node); - writeLine(); - emit(node.body); - decreaseIndent(); - writeLine(); - var moduleBlock = getInnerMostModuleDeclarationFromDottedModule(node).body; - emitToken(15 /* CloseBraceToken */, moduleBlock.statements.end); - scopeEmitEnd(); - } - write(")("); - // write moduleDecl = containingModule.m only if it is not exported es6 module member - if ((node.flags & 1 /* Export */) && !isES6ExportedDeclaration(node)) { - emit(node.name); - write(" = "); - } - emitModuleMemberName(node); - write(" || ("); - emitModuleMemberName(node); - write(" = {}));"); - emitEnd(node); - if (!isES6ExportedDeclaration(node) && node.name.kind === 65 /* Identifier */ && node.parent === currentSourceFile) { - if (compilerOptions.module === 4 /* System */ && (node.flags & 1 /* Export */)) { - writeLine(); - write(exportFunctionForFile + "(\""); - emitDeclarationName(node); - write("\", "); - emitDeclarationName(node); - write(");"); - } - emitExportMemberAssignments(node.name); - } - } - function emitRequire(moduleName) { - if (moduleName.kind === 8 /* StringLiteral */) { - write("require("); - emitStart(moduleName); - emitLiteral(moduleName); - emitEnd(moduleName); - emitToken(17 /* CloseParenToken */, moduleName.end); - } - else { - write("require()"); - } - } - function getNamespaceDeclarationNode(node) { - if (node.kind === 211 /* ImportEqualsDeclaration */) { - return node; - } - var importClause = node.importClause; - if (importClause && importClause.namedBindings && importClause.namedBindings.kind === 214 /* NamespaceImport */) { - return importClause.namedBindings; - } - } - function isDefaultImport(node) { - return node.kind === 212 /* ImportDeclaration */ && node.importClause && !!node.importClause.name; - } - function emitExportImportAssignments(node) { - if (ts.isAliasSymbolDeclaration(node) && resolver.isValueAliasDeclaration(node)) { - emitExportMemberAssignments(node.name); - } - ts.forEachChild(node, emitExportImportAssignments); - } - function emitImportDeclaration(node) { - if (languageVersion < 2 /* ES6 */) { - return emitExternalImportDeclaration(node); - } - // ES6 import - if (node.importClause) { - var shouldEmitDefaultBindings = resolver.isReferencedAliasDeclaration(node.importClause); - var shouldEmitNamedBindings = node.importClause.namedBindings && resolver.isReferencedAliasDeclaration(node.importClause.namedBindings, true); - if (shouldEmitDefaultBindings || shouldEmitNamedBindings) { - write("import "); - emitStart(node.importClause); - if (shouldEmitDefaultBindings) { - emit(node.importClause.name); - if (shouldEmitNamedBindings) { - write(", "); - } - } - if (shouldEmitNamedBindings) { - emitLeadingComments(node.importClause.namedBindings); - emitStart(node.importClause.namedBindings); - if (node.importClause.namedBindings.kind === 214 /* NamespaceImport */) { - write("* as "); - emit(node.importClause.namedBindings.name); - } - else { - write("{ "); - emitExportOrImportSpecifierList(node.importClause.namedBindings.elements, resolver.isReferencedAliasDeclaration); - write(" }"); - } - emitEnd(node.importClause.namedBindings); - emitTrailingComments(node.importClause.namedBindings); - } - emitEnd(node.importClause); - write(" from "); - emit(node.moduleSpecifier); - write(";"); - } - } - else { - write("import "); - emit(node.moduleSpecifier); - write(";"); - } - } - function emitExternalImportDeclaration(node) { - if (ts.contains(externalImports, node)) { - var isExportedImport = node.kind === 211 /* ImportEqualsDeclaration */ && (node.flags & 1 /* Export */) !== 0; - var namespaceDeclaration = getNamespaceDeclarationNode(node); - if (compilerOptions.module !== 2 /* AMD */) { - emitLeadingComments(node); - emitStart(node); - if (namespaceDeclaration && !isDefaultImport(node)) { - // import x = require("foo") - // import * as x from "foo" - if (!isExportedImport) - write("var "); - emitModuleMemberName(namespaceDeclaration); - write(" = "); - } - else { - // import "foo" - // import x from "foo" - // import { x, y } from "foo" - // import d, * as x from "foo" - // import d, { x, y } from "foo" - var isNakedImport = 212 /* ImportDeclaration */ && !node.importClause; - if (!isNakedImport) { - write("var "); - write(getGeneratedNameForNode(node)); - write(" = "); - } - } - emitRequire(ts.getExternalModuleName(node)); - if (namespaceDeclaration && isDefaultImport(node)) { - // import d, * as x from "foo" - write(", "); - emitModuleMemberName(namespaceDeclaration); - write(" = "); - write(getGeneratedNameForNode(node)); - } - write(";"); - emitEnd(node); - emitExportImportAssignments(node); - emitTrailingComments(node); - } - else { - if (isExportedImport) { - emitModuleMemberName(namespaceDeclaration); - write(" = "); - emit(namespaceDeclaration.name); - write(";"); - } - else if (namespaceDeclaration && isDefaultImport(node)) { - // import d, * as x from "foo" - write("var "); - emitModuleMemberName(namespaceDeclaration); - write(" = "); - write(getGeneratedNameForNode(node)); - write(";"); - } - emitExportImportAssignments(node); - } - } - } - function emitImportEqualsDeclaration(node) { - if (ts.isExternalModuleImportEqualsDeclaration(node)) { - emitExternalImportDeclaration(node); - return; - } - // preserve old compiler's behavior: emit 'var' for import declaration (even if we do not consider them referenced) when - // - current file is not external module - // - import declaration is top level and target is value imported by entity name - if (resolver.isReferencedAliasDeclaration(node) || - (!ts.isExternalModule(currentSourceFile) && resolver.isTopLevelValueImportEqualsWithEntityName(node))) { - emitLeadingComments(node); - emitStart(node); - if (isES6ExportedDeclaration(node)) { - write("export "); - write("var "); - } - else if (!(node.flags & 1 /* Export */)) { - write("var "); - } - emitModuleMemberName(node); - write(" = "); - emit(node.moduleReference); - write(";"); - emitEnd(node); - emitExportImportAssignments(node); - emitTrailingComments(node); - } - } - function emitExportDeclaration(node) { - ts.Debug.assert(compilerOptions.module !== 4 /* System */); - if (languageVersion < 2 /* ES6 */) { - if (node.moduleSpecifier && (!node.exportClause || resolver.isValueAliasDeclaration(node))) { - emitStart(node); - var generatedName = getGeneratedNameForNode(node); - if (node.exportClause) { - // export { x, y, ... } from "foo" - if (compilerOptions.module !== 2 /* AMD */) { - write("var "); - write(generatedName); - write(" = "); - emitRequire(ts.getExternalModuleName(node)); - write(";"); - } - for (var _a = 0, _b = node.exportClause.elements; _a < _b.length; _a++) { - var specifier = _b[_a]; - if (resolver.isValueAliasDeclaration(specifier)) { - writeLine(); - emitStart(specifier); - emitContainingModuleName(specifier); - write("."); - emitNodeWithoutSourceMap(specifier.name); - write(" = "); - write(generatedName); - write("."); - emitNodeWithoutSourceMap(specifier.propertyName || specifier.name); - write(";"); - emitEnd(specifier); - } - } - } - else { - // export * from "foo" - writeLine(); - write("__export("); - if (compilerOptions.module !== 2 /* AMD */) { - emitRequire(ts.getExternalModuleName(node)); - } - else { - write(generatedName); - } - write(");"); - } - emitEnd(node); - } - } - else { - if (!node.exportClause || resolver.isValueAliasDeclaration(node)) { - emitStart(node); - write("export "); - if (node.exportClause) { - // export { x, y, ... } - write("{ "); - emitExportOrImportSpecifierList(node.exportClause.elements, resolver.isValueAliasDeclaration); - write(" }"); - } - else { - write("*"); - } - if (node.moduleSpecifier) { - write(" from "); - emitNodeWithoutSourceMap(node.moduleSpecifier); - } - write(";"); - emitEnd(node); - } - } - } - function emitExportOrImportSpecifierList(specifiers, shouldEmit) { - ts.Debug.assert(languageVersion >= 2 /* ES6 */); - var needsComma = false; - for (var _a = 0; _a < specifiers.length; _a++) { - var specifier = specifiers[_a]; - if (shouldEmit(specifier)) { - if (needsComma) { - write(", "); - } - emitStart(specifier); - if (specifier.propertyName) { - emitNodeWithoutSourceMap(specifier.propertyName); - write(" as "); - } - emitNodeWithoutSourceMap(specifier.name); - emitEnd(specifier); - needsComma = true; - } - } - } - function emitExportAssignment(node) { - if (!node.isExportEquals && resolver.isValueAliasDeclaration(node)) { - if (languageVersion >= 2 /* ES6 */) { - writeLine(); - emitStart(node); - write("export default "); - var expression = node.expression; - emit(expression); - if (expression.kind !== 203 /* FunctionDeclaration */ && - expression.kind !== 204 /* ClassDeclaration */) { - write(";"); - } - emitEnd(node); - } - else { - writeLine(); - emitStart(node); - if (compilerOptions.module === 4 /* System */) { - write(exportFunctionForFile + "(\"default\","); - emit(node.expression); - write(")"); - } - else { - emitContainingModuleName(node); - if (languageVersion === 0 /* ES3 */) { - write("[\"default\"] = "); - } - else { - write(".default = "); - } - emit(node.expression); - } - write(";"); - emitEnd(node); - } - } - } - function collectExternalModuleInfo(sourceFile) { - externalImports = []; - exportSpecifiers = {}; - exportEquals = undefined; - hasExportStars = false; - for (var _a = 0, _b = sourceFile.statements; _a < _b.length; _a++) { - var node = _b[_a]; - switch (node.kind) { - case 212 /* ImportDeclaration */: - if (!node.importClause || - resolver.isReferencedAliasDeclaration(node.importClause, true)) { - // import "mod" - // import x from "mod" where x is referenced - // import * as x from "mod" where x is referenced - // import { x, y } from "mod" where at least one import is referenced - externalImports.push(node); - } - break; - case 211 /* ImportEqualsDeclaration */: - if (node.moduleReference.kind === 222 /* ExternalModuleReference */ && resolver.isReferencedAliasDeclaration(node)) { - // import x = require("mod") where x is referenced - externalImports.push(node); - } - break; - case 218 /* ExportDeclaration */: - if (node.moduleSpecifier) { - if (!node.exportClause) { - // export * from "mod" - externalImports.push(node); - hasExportStars = true; - } - else if (resolver.isValueAliasDeclaration(node)) { - // export { x, y } from "mod" where at least one export is a value symbol - externalImports.push(node); - } - } - else { - // export { x, y } - for (var _c = 0, _d = node.exportClause.elements; _c < _d.length; _c++) { - var specifier = _d[_c]; - var name_24 = (specifier.propertyName || specifier.name).text; - (exportSpecifiers[name_24] || (exportSpecifiers[name_24] = [])).push(specifier); - } - } - break; - case 217 /* ExportAssignment */: - if (node.isExportEquals && !exportEquals) { - // export = x - exportEquals = node; - } - break; - } - } - } - function emitExportStarHelper() { - if (hasExportStars) { - writeLine(); - write("function __export(m) {"); - increaseIndent(); - writeLine(); - write("for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];"); - decreaseIndent(); - writeLine(); - write("}"); - } - } - function getLocalNameForExternalImport(node) { - var namespaceDeclaration = getNamespaceDeclarationNode(node); - if (namespaceDeclaration && !isDefaultImport(node)) { - return ts.getSourceTextOfNodeFromSourceFile(currentSourceFile, namespaceDeclaration.name); - } - if (node.kind === 212 /* ImportDeclaration */ && node.importClause) { - return getGeneratedNameForNode(node); - } - if (node.kind === 218 /* ExportDeclaration */ && node.moduleSpecifier) { - return getGeneratedNameForNode(node); - } - } - function getExternalModuleNameText(importNode) { - var moduleName = ts.getExternalModuleName(importNode); - if (moduleName.kind === 8 /* StringLiteral */) { - return getLiteralText(moduleName); - } - return undefined; - } - function emitVariableDeclarationsForImports() { - if (externalImports.length === 0) { - return; - } - writeLine(); - var started = false; - for (var _a = 0; _a < externalImports.length; _a++) { - var importNode = externalImports[_a]; - // do not create variable declaration for exports and imports that lack import clause - var skipNode = importNode.kind === 218 /* ExportDeclaration */ || - (importNode.kind === 212 /* ImportDeclaration */ && !importNode.importClause); - if (skipNode) { - continue; - } - if (!started) { - write("var "); - started = true; - } - else { - write(", "); - } - write(getLocalNameForExternalImport(importNode)); - } - if (started) { - write(";"); - } - } - function emitLocalStorageForExportedNamesIfNecessary(exportedDeclarations) { - // when resolving exports local exported entries/indirect exported entries in the module - // should always win over entries with similar names that were added via star exports - // to support this we store names of local/indirect exported entries in a set. - // this set is used to filter names brought by star expors. - if (!hasExportStars) { - // local names set is needed only in presence of star exports - return undefined; - } - // local names set should only be added if we have anything exported - if (!exportedDeclarations && ts.isEmpty(exportSpecifiers)) { - // no exported declarations (export var ...) or export specifiers (export {x}) - // check if we have any non star export declarations. - var hasExportDeclarationWithExportClause = false; - for (var _a = 0; _a < externalImports.length; _a++) { - var externalImport = externalImports[_a]; - if (externalImport.kind === 218 /* ExportDeclaration */ && externalImport.exportClause) { - hasExportDeclarationWithExportClause = true; - break; - } - } - if (!hasExportDeclarationWithExportClause) { - // we still need to emit exportStar helper - return emitExportStarFunction(undefined); - } - } - var exportedNamesStorageRef = makeUniqueName("exportedNames"); - writeLine(); - write("var " + exportedNamesStorageRef + " = {"); - increaseIndent(); - var started = false; - if (exportedDeclarations) { - for (var i = 0; i < exportedDeclarations.length; ++i) { - // write name of exported declaration, i.e 'export var x...' - writeExportedName(exportedDeclarations[i]); - } - } - if (exportSpecifiers) { - for (var n in exportSpecifiers) { - for (var _b = 0, _c = exportSpecifiers[n]; _b < _c.length; _b++) { - var specifier = _c[_b]; - // write name of export specified, i.e. 'export {x}' - writeExportedName(specifier.name); - } - } - } - for (var _d = 0; _d < externalImports.length; _d++) { - var externalImport = externalImports[_d]; - if (externalImport.kind !== 218 /* ExportDeclaration */) { - continue; - } - var exportDecl = externalImport; - if (!exportDecl.exportClause) { - // export * from ... - continue; - } - for (var _e = 0, _f = exportDecl.exportClause.elements; _e < _f.length; _e++) { - var element = _f[_e]; - // write name of indirectly exported entry, i.e. 'export {x} from ...' - writeExportedName(element.name || element.propertyName); - } - } - decreaseIndent(); - writeLine(); - write("};"); - return emitExportStarFunction(exportedNamesStorageRef); - function emitExportStarFunction(localNames) { - var exportStarFunction = makeUniqueName("exportStar"); - writeLine(); - // define an export star helper function - write("function " + exportStarFunction + "(m) {"); - increaseIndent(); - writeLine(); - write("for(var n in m) {"); - increaseIndent(); - writeLine(); - write("if (n !== \"default\""); - if (localNames) { - write("&& !" + localNames + ".hasOwnProperty(n)"); - } - write(") " + exportFunctionForFile + "(n, m[n]);"); - decreaseIndent(); - writeLine(); - write("}"); - decreaseIndent(); - writeLine(); - write("}"); - return exportStarFunction; - } - function writeExportedName(node) { - // do not record default exports - // they are local to module and never overwritten (explicitly skipped) by star export - if (node.kind !== 65 /* Identifier */ && node.flags & 256 /* Default */) { - return; - } - if (started) { - write(","); - } - else { - started = true; - } - writeLine(); - write("'"); - if (node.kind === 65 /* Identifier */) { - emitNodeWithoutSourceMap(node); - } - else { - emitDeclarationName(node); - } - write("': true"); - } - } - function processTopLevelVariableAndFunctionDeclarations(node) { - // per ES6 spec: - // 15.2.1.16.4 ModuleDeclarationInstantiation() Concrete Method - // - var declarations are initialized to undefined - 14.a.ii - // - function/generator declarations are instantiated - 16.a.iv - // this means that after module is instantiated but before its evaluation - // exported functions are already accessible at import sites - // in theory we should hoist only exported functions and its dependencies - // in practice to simplify things we'll hoist all source level functions and variable declaration - // including variables declarations for module and class declarations - var hoistedVars; - var hoistedFunctionDeclarations; - var exportedDeclarations; - visit(node); - if (hoistedVars) { - writeLine(); - write("var "); - var seen = {}; - for (var i = 0; i < hoistedVars.length; ++i) { - var local = hoistedVars[i]; - var name_25 = local.kind === 65 /* Identifier */ - ? local - : local.name; - if (name_25) { - // do not emit duplicate entries (in case of declaration merging) in the list of hoisted variables - var text = ts.unescapeIdentifier(name_25.text); - if (ts.hasProperty(seen, text)) { - continue; - } - else { - seen[text] = text; - } - } - if (i !== 0) { - write(", "); - } - if (local.kind === 204 /* ClassDeclaration */ || local.kind === 208 /* ModuleDeclaration */ || local.kind === 207 /* EnumDeclaration */) { - emitDeclarationName(local); - } - else { - emit(local); - } - var flags = ts.getCombinedNodeFlags(local.kind === 65 /* Identifier */ ? local.parent : local); - if (flags & 1 /* Export */) { - if (!exportedDeclarations) { - exportedDeclarations = []; - } - exportedDeclarations.push(local); - } - } - write(";"); - } - if (hoistedFunctionDeclarations) { - for (var _a = 0; _a < hoistedFunctionDeclarations.length; _a++) { - var f = hoistedFunctionDeclarations[_a]; - writeLine(); - emit(f); - if (f.flags & 1 /* Export */) { - if (!exportedDeclarations) { - exportedDeclarations = []; - } - exportedDeclarations.push(f); - } - } - } - return exportedDeclarations; - function visit(node) { - if (node.flags & 2 /* Ambient */) { - return; - } - if (node.kind === 203 /* FunctionDeclaration */) { - if (!hoistedFunctionDeclarations) { - hoistedFunctionDeclarations = []; - } - hoistedFunctionDeclarations.push(node); - return; - } - if (node.kind === 204 /* ClassDeclaration */) { - if (!hoistedVars) { - hoistedVars = []; - } - hoistedVars.push(node); - return; - } - if (node.kind === 207 /* EnumDeclaration */) { - if (shouldEmitEnumDeclaration(node)) { - if (!hoistedVars) { - hoistedVars = []; - } - hoistedVars.push(node); - } - return; - } - if (node.kind === 208 /* ModuleDeclaration */) { - if (shouldEmitModuleDeclaration(node)) { - if (!hoistedVars) { - hoistedVars = []; - } - hoistedVars.push(node); - } - return; - } - if (node.kind === 201 /* VariableDeclaration */ || node.kind === 155 /* BindingElement */) { - if (shouldHoistVariable(node, false)) { - var name_26 = node.name; - if (name_26.kind === 65 /* Identifier */) { - if (!hoistedVars) { - hoistedVars = []; - } - hoistedVars.push(name_26); - } - else { - ts.forEachChild(name_26, visit); - } - } - return; - } - if (ts.isBindingPattern(node)) { - ts.forEach(node.elements, visit); - return; - } - if (!ts.isDeclaration(node)) { - ts.forEachChild(node, visit); - } - } - } - function shouldHoistVariable(node, checkIfSourceFileLevelDecl) { - if (checkIfSourceFileLevelDecl && !shouldHoistDeclarationInSystemJsModule(node)) { - return false; - } - // hoist variable if - // - it is not block scoped - // - it is top level block scoped - // if block scoped variables are nested in some another block then - // no other functions can use them except ones that are defined at least in the same block - return (ts.getCombinedNodeFlags(node) & 12288 /* BlockScoped */) === 0 || - ts.getEnclosingBlockScopeContainer(node).kind === 230 /* SourceFile */; - } - function isCurrentFileSystemExternalModule() { - return compilerOptions.module === 4 /* System */ && ts.isExternalModule(currentSourceFile); - } - function emitSystemModuleBody(node, startIndex) { - // shape of the body in system modules: - // function (exports) { - // - // - // - // return { - // setters: [ - // - // ], - // execute: function() { - // - // } - // } - // - // } - // I.e: - // import {x} from 'file1' - // var y = 1; - // export function foo() { return y + x(); } - // console.log(y); - // will be transformed to - // function(exports) { - // var file1; // local alias - // var y; - // function foo() { return y + file1.x(); } - // exports("foo", foo); - // return { - // setters: [ - // function(v) { file1 = v } - // ], - // execute(): function() { - // y = 1; - // console.log(y); - // } - // }; - // } - emitVariableDeclarationsForImports(); - writeLine(); - var exportedDeclarations = processTopLevelVariableAndFunctionDeclarations(node); - var exportStarFunction = emitLocalStorageForExportedNamesIfNecessary(exportedDeclarations); - writeLine(); - write("return {"); - increaseIndent(); - writeLine(); - emitSetters(exportStarFunction); - writeLine(); - emitExecute(node, startIndex); - decreaseIndent(); - writeLine(); - write("}"); // return - emitTempDeclarations(true); - } - function emitSetters(exportStarFunction) { - write("setters:["); - for (var i = 0; i < externalImports.length; ++i) { - if (i !== 0) { - write(","); - } - writeLine(); - increaseIndent(); - var importNode = externalImports[i]; - var importVariableName = getLocalNameForExternalImport(importNode) || ""; - var parameterName = "_" + importVariableName; - write("function (" + parameterName + ") {"); - switch (importNode.kind) { - case 212 /* ImportDeclaration */: - if (!importNode.importClause) { - // 'import "..."' case - // module is imported only for side-effects, setter body will be empty - break; - } - // fall-through - case 211 /* ImportEqualsDeclaration */: - ts.Debug.assert(importVariableName !== ""); - increaseIndent(); - writeLine(); - // save import into the local - write(importVariableName + " = " + parameterName + ";"); - writeLine(); - var defaultName = importNode.kind === 212 /* ImportDeclaration */ - ? importNode.importClause.name - : importNode.name; - if (defaultName) { - // emit re-export for imported default name - // import n1 from 'foo1' - // import n2 = require('foo2') - // export {n1} - // export {n2} - emitExportMemberAssignments(defaultName); - writeLine(); - } - if (importNode.kind === 212 /* ImportDeclaration */ && - importNode.importClause.namedBindings) { - var namedBindings = importNode.importClause.namedBindings; - if (namedBindings.kind === 214 /* NamespaceImport */) { - // emit re-export for namespace - // import * as n from 'foo' - // export {n} - emitExportMemberAssignments(namedBindings.name); - writeLine(); - } - else { - // emit re-exports for named imports - // import {a, b} from 'foo' - // export {a, b as c} - for (var _a = 0, _b = namedBindings.elements; _a < _b.length; _a++) { - var element = _b[_a]; - emitExportMemberAssignments(element.name || element.propertyName); - writeLine(); - } - } - } - decreaseIndent(); - break; - case 218 /* ExportDeclaration */: - ts.Debug.assert(importVariableName !== ""); - increaseIndent(); - if (importNode.exportClause) { - // export {a, b as c} from 'foo' - // emit as: - // exports('a', _foo["a"]) - // exports('c', _foo["b"]) - for (var _c = 0, _d = importNode.exportClause.elements; _c < _d.length; _c++) { - var e = _d[_c]; - writeLine(); - write(exportFunctionForFile + "(\""); - emitNodeWithoutSourceMap(e.name); - write("\", " + parameterName + "[\""); - emitNodeWithoutSourceMap(e.propertyName || e.name); - write("\"]);"); - } - } - else { - writeLine(); - // export * from 'foo' - // emit as: - // exportStar(_foo); - write(exportStarFunction + "(" + parameterName + ");"); - } - writeLine(); - decreaseIndent(); - break; - } - write("}"); - decreaseIndent(); - } - write("],"); - } - function emitExecute(node, startIndex) { - write("execute: function() {"); - increaseIndent(); - writeLine(); - for (var i = startIndex; i < node.statements.length; ++i) { - var statement = node.statements[i]; - // - imports/exports are not emitted for system modules - // - function declarations are not emitted because they were already hoisted - switch (statement.kind) { - case 218 /* ExportDeclaration */: - case 212 /* ImportDeclaration */: - case 211 /* ImportEqualsDeclaration */: - case 203 /* FunctionDeclaration */: - continue; - } - writeLine(); - emit(statement); - } - decreaseIndent(); - writeLine(); - write("}"); // execute - } - function emitSystemModule(node, startIndex) { - collectExternalModuleInfo(node); - // System modules has the following shape - // System.register(['dep-1', ... 'dep-n'], function(exports) {/* module body function */}) - // 'exports' here is a function 'exports(name: string, value: T): T' that is used to publish exported values. - // 'exports' returns its 'value' argument so in most cases expressions - // that mutate exported values can be rewritten as: - // expr -> exports('name', expr). - // The only exception in this rule is postfix unary operators, - // see comment to 'emitPostfixUnaryExpression' for more details - ts.Debug.assert(!exportFunctionForFile); - // make sure that name of 'exports' function does not conflict with existing identifiers - exportFunctionForFile = makeUniqueName("exports"); - write("System.register("); - if (node.moduleName) { - write("\"" + node.moduleName + "\", "); - } - write("["); - for (var i = 0; i < externalImports.length; ++i) { - var text = getExternalModuleNameText(externalImports[i]); - if (i !== 0) { - write(", "); - } - write(text); - } - write("], function(" + exportFunctionForFile + ") {"); - writeLine(); - increaseIndent(); - emitCaptureThisForNodeIfNecessary(node); - emitSystemModuleBody(node, startIndex); - decreaseIndent(); - writeLine(); - write("});"); - } - function emitAMDDependencies(node, includeNonAmdDependencies) { - // An AMD define function has the following shape: - // define(id?, dependencies?, factory); - // - // This has the shape of - // define(name, ["module1", "module2"], function (module1Alias) { - // The location of the alias in the parameter list in the factory function needs to - // match the position of the module name in the dependency list. - // - // To ensure this is true in cases of modules with no aliases, e.g.: - // `import "module"` or `` - // we need to add modules without alias names to the end of the dependencies list - var aliasedModuleNames = []; // names of modules with corresponding parameter in the - // factory function. - var unaliasedModuleNames = []; // names of modules with no corresponding parameters in - // factory function. - var importAliasNames = []; // names of the parameters in the factory function; these - // parameters need to match the indexes of the corresponding - // module names in aliasedModuleNames. - // Fill in amd-dependency tags - for (var _a = 0, _b = node.amdDependencies; _a < _b.length; _a++) { - var amdDependency = _b[_a]; - if (amdDependency.name) { - aliasedModuleNames.push("\"" + amdDependency.path + "\""); - importAliasNames.push(amdDependency.name); - } - else { - unaliasedModuleNames.push("\"" + amdDependency.path + "\""); - } - } - for (var _c = 0; _c < externalImports.length; _c++) { - var importNode = externalImports[_c]; - // Find the name of the external module - var externalModuleName = getExternalModuleNameText(importNode); - // Find the name of the module alias, if there is one - var importAliasName = getLocalNameForExternalImport(importNode); - if (includeNonAmdDependencies && importAliasName) { - aliasedModuleNames.push(externalModuleName); - importAliasNames.push(importAliasName); - } - else { - unaliasedModuleNames.push(externalModuleName); - } - } - write("[\"require\", \"exports\""); - if (aliasedModuleNames.length) { - write(", "); - write(aliasedModuleNames.join(", ")); - } - if (unaliasedModuleNames.length) { - write(", "); - write(unaliasedModuleNames.join(", ")); - } - write("], function (require, exports"); - if (importAliasNames.length) { - write(", "); - write(importAliasNames.join(", ")); - } - } - function emitAMDModule(node, startIndex) { - collectExternalModuleInfo(node); - writeLine(); - write("define("); - if (node.moduleName) { - write("\"" + node.moduleName + "\", "); - } - emitAMDDependencies(node, true); - write(") {"); - increaseIndent(); - emitExportStarHelper(); - emitCaptureThisForNodeIfNecessary(node); - emitLinesStartingAt(node.statements, startIndex); - emitTempDeclarations(true); - emitExportEquals(true); - decreaseIndent(); - writeLine(); - write("});"); - } - function emitCommonJSModule(node, startIndex) { - collectExternalModuleInfo(node); - emitExportStarHelper(); - emitCaptureThisForNodeIfNecessary(node); - emitLinesStartingAt(node.statements, startIndex); - emitTempDeclarations(true); - emitExportEquals(false); - } - function emitUMDModule(node, startIndex) { - collectExternalModuleInfo(node); - // Module is detected first to support Browserify users that load into a browser with an AMD loader - writeLines("(function (deps, factory) {\n if (typeof module === 'object' && typeof module.exports === 'object') {\n var v = factory(require, exports); if (v !== undefined) module.exports = v;\n }\n else if (typeof define === 'function' && define.amd) {\n define(deps, factory);\n }\n})("); - emitAMDDependencies(node, false); - write(") {"); - increaseIndent(); - emitExportStarHelper(); - emitCaptureThisForNodeIfNecessary(node); - emitLinesStartingAt(node.statements, startIndex); - emitTempDeclarations(true); - emitExportEquals(true); - decreaseIndent(); - writeLine(); - write("});"); - } - function emitES6Module(node, startIndex) { - externalImports = undefined; - exportSpecifiers = undefined; - exportEquals = undefined; - hasExportStars = false; - emitCaptureThisForNodeIfNecessary(node); - emitLinesStartingAt(node.statements, startIndex); - emitTempDeclarations(true); - // Emit exportDefault if it exists will happen as part - // or normal statement emit. - } - function emitExportEquals(emitAsReturn) { - if (exportEquals && resolver.isValueAliasDeclaration(exportEquals)) { - writeLine(); - emitStart(exportEquals); - write(emitAsReturn ? "return " : "module.exports = "); - emit(exportEquals.expression); - write(";"); - emitEnd(exportEquals); - } - } - function emitDirectivePrologues(statements, startWithNewLine) { - for (var i = 0; i < statements.length; ++i) { - if (ts.isPrologueDirective(statements[i])) { - if (startWithNewLine || i > 0) { - writeLine(); - } - emit(statements[i]); - } - else { - // return index of the first non prologue directive - return i; - } - } - return statements.length; - } - function writeLines(text) { - var lines = text.split(/\r\n|\r|\n/g); - for (var i = 0; i < lines.length; ++i) { - var line = lines[i]; - if (line.length) { - writeLine(); - write(line); - } - } - } - function emitSourceFileNode(node) { - // Start new file on new line - writeLine(); - emitDetachedComments(node); - // emit prologue directives prior to __extends - var startIndex = emitDirectivePrologues(node.statements, false); - // Only emit helpers if the user did not say otherwise. - if (!compilerOptions.noEmitHelpers) { - // Only Emit __extends function when target ES5. - // For target ES6 and above, we can emit classDeclaration as is. - if ((languageVersion < 2 /* ES6 */) && (!extendsEmitted && resolver.getNodeCheckFlags(node) & 8 /* EmitExtends */)) { - writeLines(extendsHelper); - extendsEmitted = true; - } - if (!decorateEmitted && resolver.getNodeCheckFlags(node) & 512 /* EmitDecorate */) { - writeLines(decorateHelper); - if (compilerOptions.emitDecoratorMetadata) { - writeLines(metadataHelper); - } - decorateEmitted = true; - } - if (!paramEmitted && resolver.getNodeCheckFlags(node) & 1024 /* EmitParam */) { - writeLines(paramHelper); - paramEmitted = true; - } - } - if (ts.isExternalModule(node) || compilerOptions.isolatedModules) { - if (languageVersion >= 2 /* ES6 */) { - emitES6Module(node, startIndex); - } - else if (compilerOptions.module === 2 /* AMD */) { - emitAMDModule(node, startIndex); - } - else if (compilerOptions.module === 4 /* System */) { - emitSystemModule(node, startIndex); - } - else if (compilerOptions.module === 3 /* UMD */) { - emitUMDModule(node, startIndex); - } - else { - emitCommonJSModule(node, startIndex); - } - } - else { - externalImports = undefined; - exportSpecifiers = undefined; - exportEquals = undefined; - hasExportStars = false; - emitCaptureThisForNodeIfNecessary(node); - emitLinesStartingAt(node.statements, startIndex); - emitTempDeclarations(true); - } - emitLeadingComments(node.endOfFileToken); - } - function emitNodeWithoutSourceMap(node) { - if (!node) { - return; - } - if (node.flags & 2 /* Ambient */) { - return emitOnlyPinnedOrTripleSlashComments(node); - } - var emitComments = shouldEmitLeadingAndTrailingComments(node); - if (emitComments) { - emitLeadingComments(node); - } - emitJavaScriptWorker(node); - if (emitComments) { - emitTrailingComments(node); - } - } - function shouldEmitLeadingAndTrailingComments(node) { - switch (node.kind) { - // All of these entities are emitted in a specialized fashion. As such, we allow - // the specialized methods for each to handle the comments on the nodes. - case 205 /* InterfaceDeclaration */: - case 203 /* FunctionDeclaration */: - case 212 /* ImportDeclaration */: - case 211 /* ImportEqualsDeclaration */: - case 206 /* TypeAliasDeclaration */: - case 217 /* ExportAssignment */: - return false; - case 183 /* VariableStatement */: - return shouldEmitLeadingAndTrailingCommentsForVariableStatement(node); - case 208 /* ModuleDeclaration */: - // Only emit the leading/trailing comments for a module if we're actually - // emitting the module as well. - return shouldEmitModuleDeclaration(node); - case 207 /* EnumDeclaration */: - // Only emit the leading/trailing comments for an enum if we're actually - // emitting the module as well. - return shouldEmitEnumDeclaration(node); - } - // If this is the expression body of an arrow function that we're down-leveling, - // then we don't want to emit comments when we emit the body. It will have already - // been taken care of when we emitted the 'return' statement for the function - // expression body. - if (node.kind !== 182 /* Block */ && - node.parent && - node.parent.kind === 166 /* ArrowFunction */ && - node.parent.body === node && - compilerOptions.target <= 1 /* ES5 */) { - return false; - } - // Emit comments for everything else. - return true; - } - function emitJavaScriptWorker(node) { - // Check if the node can be emitted regardless of the ScriptTarget - switch (node.kind) { - case 65 /* Identifier */: - return emitIdentifier(node); - case 131 /* Parameter */: - return emitParameter(node); - case 136 /* MethodDeclaration */: - case 135 /* MethodSignature */: - return emitMethod(node); - case 138 /* GetAccessor */: - case 139 /* SetAccessor */: - return emitAccessor(node); - case 93 /* ThisKeyword */: - return emitThis(node); - case 91 /* SuperKeyword */: - return emitSuper(node); - case 89 /* NullKeyword */: - return write("null"); - case 95 /* TrueKeyword */: - return write("true"); - case 80 /* FalseKeyword */: - return write("false"); - case 7 /* NumericLiteral */: - case 8 /* StringLiteral */: - case 9 /* RegularExpressionLiteral */: - case 10 /* NoSubstitutionTemplateLiteral */: - case 11 /* TemplateHead */: - case 12 /* TemplateMiddle */: - case 13 /* TemplateTail */: - return emitLiteral(node); - case 174 /* TemplateExpression */: - return emitTemplateExpression(node); - case 180 /* TemplateSpan */: - return emitTemplateSpan(node); - case 128 /* QualifiedName */: - return emitQualifiedName(node); - case 153 /* ObjectBindingPattern */: - return emitObjectBindingPattern(node); - case 154 /* ArrayBindingPattern */: - return emitArrayBindingPattern(node); - case 155 /* BindingElement */: - return emitBindingElement(node); - case 156 /* ArrayLiteralExpression */: - return emitArrayLiteral(node); - case 157 /* ObjectLiteralExpression */: - return emitObjectLiteral(node); - case 227 /* PropertyAssignment */: - return emitPropertyAssignment(node); - case 228 /* ShorthandPropertyAssignment */: - return emitShorthandPropertyAssignment(node); - case 129 /* ComputedPropertyName */: - return emitComputedPropertyName(node); - case 158 /* PropertyAccessExpression */: - return emitPropertyAccess(node); - case 159 /* ElementAccessExpression */: - return emitIndexedAccess(node); - case 160 /* CallExpression */: - return emitCallExpression(node); - case 161 /* NewExpression */: - return emitNewExpression(node); - case 162 /* TaggedTemplateExpression */: - return emitTaggedTemplateExpression(node); - case 163 /* TypeAssertionExpression */: - return emit(node.expression); - case 164 /* ParenthesizedExpression */: - return emitParenExpression(node); - case 203 /* FunctionDeclaration */: - case 165 /* FunctionExpression */: - case 166 /* ArrowFunction */: - return emitFunctionDeclaration(node); - case 167 /* DeleteExpression */: - return emitDeleteExpression(node); - case 168 /* TypeOfExpression */: - return emitTypeOfExpression(node); - case 169 /* VoidExpression */: - return emitVoidExpression(node); - case 170 /* PrefixUnaryExpression */: - return emitPrefixUnaryExpression(node); - case 171 /* PostfixUnaryExpression */: - return emitPostfixUnaryExpression(node); - case 172 /* BinaryExpression */: - return emitBinaryExpression(node); - case 173 /* ConditionalExpression */: - return emitConditionalExpression(node); - case 176 /* SpreadElementExpression */: - return emitSpreadElementExpression(node); - case 175 /* YieldExpression */: - return emitYieldExpression(node); - case 178 /* OmittedExpression */: - return; - case 182 /* Block */: - case 209 /* ModuleBlock */: - return emitBlock(node); - case 183 /* VariableStatement */: - return emitVariableStatement(node); - case 184 /* EmptyStatement */: - return write(";"); - case 185 /* ExpressionStatement */: - return emitExpressionStatement(node); - case 186 /* IfStatement */: - return emitIfStatement(node); - case 187 /* DoStatement */: - return emitDoStatement(node); - case 188 /* WhileStatement */: - return emitWhileStatement(node); - case 189 /* ForStatement */: - return emitForStatement(node); - case 191 /* ForOfStatement */: - case 190 /* ForInStatement */: - return emitForInOrForOfStatement(node); - case 192 /* ContinueStatement */: - case 193 /* BreakStatement */: - return emitBreakOrContinueStatement(node); - case 194 /* ReturnStatement */: - return emitReturnStatement(node); - case 195 /* WithStatement */: - return emitWithStatement(node); - case 196 /* SwitchStatement */: - return emitSwitchStatement(node); - case 223 /* CaseClause */: - case 224 /* DefaultClause */: - return emitCaseOrDefaultClause(node); - case 197 /* LabeledStatement */: - return emitLabelledStatement(node); - case 198 /* ThrowStatement */: - return emitThrowStatement(node); - case 199 /* TryStatement */: - return emitTryStatement(node); - case 226 /* CatchClause */: - return emitCatchClause(node); - case 200 /* DebuggerStatement */: - return emitDebuggerStatement(node); - case 201 /* VariableDeclaration */: - return emitVariableDeclaration(node); - case 177 /* ClassExpression */: - return emitClassExpression(node); - case 204 /* ClassDeclaration */: - return emitClassDeclaration(node); - case 205 /* InterfaceDeclaration */: - return emitInterfaceDeclaration(node); - case 207 /* EnumDeclaration */: - return emitEnumDeclaration(node); - case 229 /* EnumMember */: - return emitEnumMember(node); - case 208 /* ModuleDeclaration */: - return emitModuleDeclaration(node); - case 212 /* ImportDeclaration */: - return emitImportDeclaration(node); - case 211 /* ImportEqualsDeclaration */: - return emitImportEqualsDeclaration(node); - case 218 /* ExportDeclaration */: - return emitExportDeclaration(node); - case 217 /* ExportAssignment */: - return emitExportAssignment(node); - case 230 /* SourceFile */: - return emitSourceFileNode(node); - } - } - function hasDetachedComments(pos) { - return detachedCommentsInfo !== undefined && ts.lastOrUndefined(detachedCommentsInfo).nodePos === pos; - } - function getLeadingCommentsWithoutDetachedComments() { - // get the leading comments from detachedPos - var leadingComments = ts.getLeadingCommentRanges(currentSourceFile.text, ts.lastOrUndefined(detachedCommentsInfo).detachedCommentEndPos); - if (detachedCommentsInfo.length - 1) { - detachedCommentsInfo.pop(); - } - else { - detachedCommentsInfo = undefined; - } - return leadingComments; - } - function filterComments(ranges, onlyPinnedOrTripleSlashComments) { - // If we're removing comments, then we want to strip out all but the pinned or - // triple slash comments. - if (ranges && onlyPinnedOrTripleSlashComments) { - ranges = ts.filter(ranges, isPinnedOrTripleSlashComment); - if (ranges.length === 0) { - return undefined; - } - } - return ranges; - } - function getLeadingCommentsToEmit(node) { - // Emit the leading comments only if the parent's pos doesn't match because parent should take care of emitting these comments - if (node.parent) { - if (node.parent.kind === 230 /* SourceFile */ || node.pos !== node.parent.pos) { - if (hasDetachedComments(node.pos)) { - // get comments without detached comments - return getLeadingCommentsWithoutDetachedComments(); - } - else { - // get the leading comments from the node - return ts.getLeadingCommentRangesOfNode(node, currentSourceFile); - } - } - } - } - function getTrailingCommentsToEmit(node) { - // Emit the trailing comments only if the parent's pos doesn't match because parent should take care of emitting these comments - if (node.parent) { - if (node.parent.kind === 230 /* SourceFile */ || node.end !== node.parent.end) { - return ts.getTrailingCommentRanges(currentSourceFile.text, node.end); - } - } - } - function emitOnlyPinnedOrTripleSlashComments(node) { - emitLeadingCommentsWorker(node, true); - } - function emitLeadingComments(node) { - return emitLeadingCommentsWorker(node, compilerOptions.removeComments); - } - function emitLeadingCommentsWorker(node, onlyPinnedOrTripleSlashComments) { - // If the caller only wants pinned or triple slash comments, then always filter - // down to that set. Otherwise, filter based on the current compiler options. - var leadingComments = filterComments(getLeadingCommentsToEmit(node), onlyPinnedOrTripleSlashComments); - ts.emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, leadingComments); - // Leading comments are emitted at /*leading comment1 */space/*leading comment*/space - ts.emitComments(currentSourceFile, writer, leadingComments, true, newLine, writeComment); - } - function emitTrailingComments(node) { - // Emit the trailing comments only if the parent's end doesn't match - var trailingComments = filterComments(getTrailingCommentsToEmit(node), compilerOptions.removeComments); - // trailing comments are emitted at space/*trailing comment1 */space/*trailing comment*/ - ts.emitComments(currentSourceFile, writer, trailingComments, false, newLine, writeComment); - } - function emitLeadingCommentsOfPosition(pos) { - var leadingComments; - if (hasDetachedComments(pos)) { - // get comments without detached comments - leadingComments = getLeadingCommentsWithoutDetachedComments(); - } - else { - // get the leading comments from the node - leadingComments = ts.getLeadingCommentRanges(currentSourceFile.text, pos); - } - leadingComments = filterComments(leadingComments, compilerOptions.removeComments); - ts.emitNewLineBeforeLeadingComments(currentSourceFile, writer, { pos: pos, end: pos }, leadingComments); - // Leading comments are emitted at /*leading comment1 */space/*leading comment*/space - ts.emitComments(currentSourceFile, writer, leadingComments, true, newLine, writeComment); - } - function emitDetachedComments(node) { - var leadingComments = ts.getLeadingCommentRanges(currentSourceFile.text, node.pos); - if (leadingComments) { - var detachedComments = []; - var lastComment; - ts.forEach(leadingComments, function (comment) { - if (lastComment) { - var lastCommentLine = ts.getLineOfLocalPosition(currentSourceFile, lastComment.end); - var commentLine = ts.getLineOfLocalPosition(currentSourceFile, comment.pos); - if (commentLine >= lastCommentLine + 2) { - // There was a blank line between the last comment and this comment. This - // comment is not part of the copyright comments. Return what we have so - // far. - return detachedComments; - } - } - detachedComments.push(comment); - lastComment = comment; - }); - if (detachedComments.length) { - // All comments look like they could have been part of the copyright header. Make - // sure there is at least one blank line between it and the node. If not, it's not - // a copyright header. - var lastCommentLine = ts.getLineOfLocalPosition(currentSourceFile, ts.lastOrUndefined(detachedComments).end); - var nodeLine = ts.getLineOfLocalPosition(currentSourceFile, ts.skipTrivia(currentSourceFile.text, node.pos)); - if (nodeLine >= lastCommentLine + 2) { - // Valid detachedComments - ts.emitNewLineBeforeLeadingComments(currentSourceFile, writer, node, leadingComments); - ts.emitComments(currentSourceFile, writer, detachedComments, true, newLine, writeComment); - var currentDetachedCommentInfo = { nodePos: node.pos, detachedCommentEndPos: ts.lastOrUndefined(detachedComments).end }; - if (detachedCommentsInfo) { - detachedCommentsInfo.push(currentDetachedCommentInfo); - } - else { - detachedCommentsInfo = [currentDetachedCommentInfo]; - } - } - } - } - } - function isPinnedOrTripleSlashComment(comment) { - if (currentSourceFile.text.charCodeAt(comment.pos + 1) === 42 /* asterisk */) { - return currentSourceFile.text.charCodeAt(comment.pos + 2) === 33 /* exclamation */; - } - else if (currentSourceFile.text.charCodeAt(comment.pos + 1) === 47 /* slash */ && - comment.pos + 2 < comment.end && - currentSourceFile.text.charCodeAt(comment.pos + 2) === 47 /* slash */ && - currentSourceFile.text.substring(comment.pos, comment.end).match(ts.fullTripleSlashReferencePathRegEx)) { - return true; - } - } - } - function emitFile(jsFilePath, sourceFile) { - emitJavaScript(jsFilePath, sourceFile); - if (compilerOptions.declaration) { - ts.writeDeclarationFile(jsFilePath, sourceFile, host, resolver, diagnostics); - } - } - } - ts.emitFiles = emitFiles; -})(ts || (ts = {})); -/// -/// -var ts; -(function (ts) { - /* @internal */ ts.programTime = 0; - /* @internal */ ts.emitTime = 0; - /* @internal */ ts.ioReadTime = 0; - /* @internal */ ts.ioWriteTime = 0; - /** The version of the TypeScript compiler release */ - ts.version = "1.5.3"; - function findConfigFile(searchPath) { - var fileName = "tsconfig.json"; - while (true) { - if (ts.sys.fileExists(fileName)) { - return fileName; - } - var parentPath = ts.getDirectoryPath(searchPath); - if (parentPath === searchPath) { - break; - } - searchPath = parentPath; - fileName = "../" + fileName; - } - return undefined; - } - ts.findConfigFile = findConfigFile; - function createCompilerHost(options, setParentNodes) { - var currentDirectory; - var existingDirectories = {}; - function getCanonicalFileName(fileName) { - // if underlying system can distinguish between two files whose names differs only in cases then file name already in canonical form. - // otherwise use toLowerCase as a canonical form. - return ts.sys.useCaseSensitiveFileNames ? fileName : fileName.toLowerCase(); - } - // returned by CScript sys environment - var unsupportedFileEncodingErrorCode = -2147024809; - function getSourceFile(fileName, languageVersion, onError) { - var text; - try { - var start = new Date().getTime(); - text = ts.sys.readFile(fileName, options.charset); - ts.ioReadTime += new Date().getTime() - start; - } - catch (e) { - if (onError) { - onError(e.number === unsupportedFileEncodingErrorCode - ? ts.createCompilerDiagnostic(ts.Diagnostics.Unsupported_file_encoding).messageText - : e.message); - } - text = ""; - } - return text !== undefined ? ts.createSourceFile(fileName, text, languageVersion, setParentNodes) : undefined; - } - function directoryExists(directoryPath) { - if (ts.hasProperty(existingDirectories, directoryPath)) { - return true; - } - if (ts.sys.directoryExists(directoryPath)) { - existingDirectories[directoryPath] = true; - return true; - } - return false; - } - function ensureDirectoriesExist(directoryPath) { - if (directoryPath.length > ts.getRootLength(directoryPath) && !directoryExists(directoryPath)) { - var parentDirectory = ts.getDirectoryPath(directoryPath); - ensureDirectoriesExist(parentDirectory); - ts.sys.createDirectory(directoryPath); - } - } - function writeFile(fileName, data, writeByteOrderMark, onError) { - try { - var start = new Date().getTime(); - ensureDirectoriesExist(ts.getDirectoryPath(ts.normalizePath(fileName))); - ts.sys.writeFile(fileName, data, writeByteOrderMark); - ts.ioWriteTime += new Date().getTime() - start; - } - catch (e) { - if (onError) { - onError(e.message); - } - } - } - var newLine = ts.getNewLineCharacter(options); - return { - getSourceFile: getSourceFile, - getDefaultLibFileName: function (options) { return ts.combinePaths(ts.getDirectoryPath(ts.normalizePath(ts.sys.getExecutingFilePath())), ts.getDefaultLibFileName(options)); }, - writeFile: writeFile, - getCurrentDirectory: function () { return currentDirectory || (currentDirectory = ts.sys.getCurrentDirectory()); }, - useCaseSensitiveFileNames: function () { return ts.sys.useCaseSensitiveFileNames; }, - getCanonicalFileName: getCanonicalFileName, - getNewLine: function () { return newLine; } - }; - } - ts.createCompilerHost = createCompilerHost; - function getPreEmitDiagnostics(program, sourceFile) { - var diagnostics = program.getSyntacticDiagnostics(sourceFile).concat(program.getGlobalDiagnostics()).concat(program.getSemanticDiagnostics(sourceFile)); - if (program.getCompilerOptions().declaration) { - diagnostics.concat(program.getDeclarationDiagnostics(sourceFile)); - } - return ts.sortAndDeduplicateDiagnostics(diagnostics); - } - ts.getPreEmitDiagnostics = getPreEmitDiagnostics; - function flattenDiagnosticMessageText(messageText, newLine) { - if (typeof messageText === "string") { - return messageText; - } - else { - var diagnosticChain = messageText; - var result = ""; - var indent = 0; - while (diagnosticChain) { - if (indent) { - result += newLine; - for (var i = 0; i < indent; i++) { - result += " "; - } - } - result += diagnosticChain.messageText; - indent++; - diagnosticChain = diagnosticChain.next; - } - return result; - } - } - ts.flattenDiagnosticMessageText = flattenDiagnosticMessageText; - function createProgram(rootNames, options, host) { - var program; - var files = []; - var diagnostics = ts.createDiagnosticCollection(); - var commonSourceDirectory; - var diagnosticsProducingTypeChecker; - var noDiagnosticsTypeChecker; - var classifiableNames; - var skipDefaultLib = options.noLib; - var start = new Date().getTime(); - host = host || createCompilerHost(options); - var filesByName = ts.createFileMap(function (fileName) { return host.getCanonicalFileName(fileName); }); - ts.forEach(rootNames, function (name) { return processRootFile(name, false); }); - // Do not process the default library if: - // - The '--noLib' flag is used. - // - A 'no-default-lib' reference comment is encountered in - // processing the root files. - if (!skipDefaultLib) { - processRootFile(host.getDefaultLibFileName(options), true); - } - verifyCompilerOptions(); - ts.programTime += new Date().getTime() - start; - program = { - getSourceFile: getSourceFile, - getSourceFiles: function () { return files; }, - getCompilerOptions: function () { return options; }, - getSyntacticDiagnostics: getSyntacticDiagnostics, - getGlobalDiagnostics: getGlobalDiagnostics, - getSemanticDiagnostics: getSemanticDiagnostics, - getDeclarationDiagnostics: getDeclarationDiagnostics, - getCompilerOptionsDiagnostics: getCompilerOptionsDiagnostics, - getTypeChecker: getTypeChecker, - getClassifiableNames: getClassifiableNames, - getDiagnosticsProducingTypeChecker: getDiagnosticsProducingTypeChecker, - getCommonSourceDirectory: function () { return commonSourceDirectory; }, - emit: emit, - getCurrentDirectory: function () { return host.getCurrentDirectory(); }, - getNodeCount: function () { return getDiagnosticsProducingTypeChecker().getNodeCount(); }, - getIdentifierCount: function () { return getDiagnosticsProducingTypeChecker().getIdentifierCount(); }, - getSymbolCount: function () { return getDiagnosticsProducingTypeChecker().getSymbolCount(); }, - getTypeCount: function () { return getDiagnosticsProducingTypeChecker().getTypeCount(); } - }; - return program; - function getClassifiableNames() { - if (!classifiableNames) { - // Initialize a checker so that all our files are bound. - getTypeChecker(); - classifiableNames = {}; - for (var _i = 0; _i < files.length; _i++) { - var sourceFile = files[_i]; - ts.copyMap(sourceFile.classifiableNames, classifiableNames); - } - } - return classifiableNames; - } - function getEmitHost(writeFileCallback) { - return { - getCanonicalFileName: function (fileName) { return host.getCanonicalFileName(fileName); }, - getCommonSourceDirectory: program.getCommonSourceDirectory, - getCompilerOptions: program.getCompilerOptions, - getCurrentDirectory: function () { return host.getCurrentDirectory(); }, - getNewLine: function () { return host.getNewLine(); }, - getSourceFile: program.getSourceFile, - getSourceFiles: program.getSourceFiles, - writeFile: writeFileCallback || (function (fileName, data, writeByteOrderMark, onError) { return host.writeFile(fileName, data, writeByteOrderMark, onError); }) - }; - } - function getDiagnosticsProducingTypeChecker() { - return diagnosticsProducingTypeChecker || (diagnosticsProducingTypeChecker = ts.createTypeChecker(program, true)); - } - function getTypeChecker() { - return noDiagnosticsTypeChecker || (noDiagnosticsTypeChecker = ts.createTypeChecker(program, false)); - } - function emit(sourceFile, writeFileCallback) { - // If the noEmitOnError flag is set, then check if we have any errors so far. If so, - // immediately bail out. - if (options.noEmitOnError && getPreEmitDiagnostics(this).length > 0) { - return { diagnostics: [], sourceMaps: undefined, emitSkipped: true }; - } - // Create the emit resolver outside of the "emitTime" tracking code below. That way - // any cost associated with it (like type checking) are appropriate associated with - // the type-checking counter. - // - // If the -out option is specified, we should not pass the source file to getEmitResolver. - // This is because in the -out scenario all files need to be emitted, and therefore all - // files need to be type checked. And the way to specify that all files need to be type - // checked is to not pass the file to getEmitResolver. - var emitResolver = getDiagnosticsProducingTypeChecker().getEmitResolver(options.out ? undefined : sourceFile); - var start = new Date().getTime(); - var emitResult = ts.emitFiles(emitResolver, getEmitHost(writeFileCallback), sourceFile); - ts.emitTime += new Date().getTime() - start; - return emitResult; - } - function getSourceFile(fileName) { - return filesByName.get(fileName); - } - function getDiagnosticsHelper(sourceFile, getDiagnostics) { - if (sourceFile) { - return getDiagnostics(sourceFile); - } - var allDiagnostics = []; - ts.forEach(program.getSourceFiles(), function (sourceFile) { - ts.addRange(allDiagnostics, getDiagnostics(sourceFile)); - }); - return ts.sortAndDeduplicateDiagnostics(allDiagnostics); - } - function getSyntacticDiagnostics(sourceFile) { - return getDiagnosticsHelper(sourceFile, getSyntacticDiagnosticsForFile); - } - function getSemanticDiagnostics(sourceFile) { - return getDiagnosticsHelper(sourceFile, getSemanticDiagnosticsForFile); - } - function getDeclarationDiagnostics(sourceFile) { - return getDiagnosticsHelper(sourceFile, getDeclarationDiagnosticsForFile); - } - function getSyntacticDiagnosticsForFile(sourceFile) { - return sourceFile.parseDiagnostics; - } - function getSemanticDiagnosticsForFile(sourceFile) { - var typeChecker = getDiagnosticsProducingTypeChecker(); - ts.Debug.assert(!!sourceFile.bindDiagnostics); - var bindDiagnostics = sourceFile.bindDiagnostics; - var checkDiagnostics = typeChecker.getDiagnostics(sourceFile); - var programDiagnostics = diagnostics.getDiagnostics(sourceFile.fileName); - return bindDiagnostics.concat(checkDiagnostics).concat(programDiagnostics); - } - function getDeclarationDiagnosticsForFile(sourceFile) { - if (!ts.isDeclarationFile(sourceFile)) { - var resolver = getDiagnosticsProducingTypeChecker().getEmitResolver(sourceFile); - // Don't actually write any files since we're just getting diagnostics. - var writeFile = function () { }; - return ts.getDeclarationDiagnostics(getEmitHost(writeFile), resolver, sourceFile); - } - } - function getCompilerOptionsDiagnostics() { - var allDiagnostics = []; - ts.addRange(allDiagnostics, diagnostics.getGlobalDiagnostics()); - return ts.sortAndDeduplicateDiagnostics(allDiagnostics); - } - function getGlobalDiagnostics() { - var typeChecker = getDiagnosticsProducingTypeChecker(); - var allDiagnostics = []; - ts.addRange(allDiagnostics, typeChecker.getGlobalDiagnostics()); - ts.addRange(allDiagnostics, diagnostics.getGlobalDiagnostics()); - return ts.sortAndDeduplicateDiagnostics(allDiagnostics); - } - function hasExtension(fileName) { - return ts.getBaseFileName(fileName).indexOf(".") >= 0; - } - function processRootFile(fileName, isDefaultLib) { - processSourceFile(ts.normalizePath(fileName), isDefaultLib); - } - function processSourceFile(fileName, isDefaultLib, refFile, refPos, refEnd) { - var start; - var length; - var extensions; - var diagnosticArgument; - if (refEnd !== undefined && refPos !== undefined) { - start = refPos; - length = refEnd - refPos; - } - var diagnostic; - if (hasExtension(fileName)) { - if (!options.allowNonTsExtensions && !ts.forEach(ts.supportedExtensions, function (extension) { return ts.fileExtensionIs(host.getCanonicalFileName(fileName), extension); })) { - diagnostic = ts.Diagnostics.File_0_has_unsupported_extension_The_only_supported_extensions_are_1; - diagnosticArgument = [fileName, "'" + ts.supportedExtensions.join("', '") + "'"]; - } - else if (!findSourceFile(fileName, isDefaultLib, refFile, refPos, refEnd)) { - diagnostic = ts.Diagnostics.File_0_not_found; - diagnosticArgument = [fileName]; - } - else if (refFile && host.getCanonicalFileName(fileName) === host.getCanonicalFileName(refFile.fileName)) { - diagnostic = ts.Diagnostics.A_file_cannot_have_a_reference_to_itself; - diagnosticArgument = [fileName]; - } - } - else { - var nonTsFile = options.allowNonTsExtensions && findSourceFile(fileName, isDefaultLib, refFile, refPos, refEnd); - if (!nonTsFile) { - if (options.allowNonTsExtensions) { - diagnostic = ts.Diagnostics.File_0_not_found; - diagnosticArgument = [fileName]; - } - else if (!ts.forEach(ts.supportedExtensions, function (extension) { return findSourceFile(fileName + extension, isDefaultLib, refFile, refPos, refEnd); })) { - diagnostic = ts.Diagnostics.File_0_not_found; - fileName += ".ts"; - diagnosticArgument = [fileName]; - } - } - } - if (diagnostic) { - if (refFile) { - diagnostics.add(ts.createFileDiagnostic.apply(void 0, [refFile, start, length, diagnostic].concat(diagnosticArgument))); - } - else { - diagnostics.add(ts.createCompilerDiagnostic.apply(void 0, [diagnostic].concat(diagnosticArgument))); - } - } - } - // Get source file from normalized fileName - function findSourceFile(fileName, isDefaultLib, refFile, refStart, refLength) { - var canonicalName = host.getCanonicalFileName(ts.normalizeSlashes(fileName)); - if (filesByName.contains(canonicalName)) { - // We've already looked for this file, use cached result - return getSourceFileFromCache(fileName, canonicalName, false); - } - else { - var normalizedAbsolutePath = ts.getNormalizedAbsolutePath(fileName, host.getCurrentDirectory()); - var canonicalAbsolutePath = host.getCanonicalFileName(normalizedAbsolutePath); - if (filesByName.contains(canonicalAbsolutePath)) { - return getSourceFileFromCache(normalizedAbsolutePath, canonicalAbsolutePath, true); - } - // We haven't looked for this file, do so now and cache result - var file = host.getSourceFile(fileName, options.target, function (hostErrorMessage) { - if (refFile) { - diagnostics.add(ts.createFileDiagnostic(refFile, refStart, refLength, ts.Diagnostics.Cannot_read_file_0_Colon_1, fileName, hostErrorMessage)); - } - else { - diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_read_file_0_Colon_1, fileName, hostErrorMessage)); - } - }); - filesByName.set(canonicalName, file); - if (file) { - skipDefaultLib = skipDefaultLib || file.hasNoDefaultLib; - // Set the source file for normalized absolute path - filesByName.set(canonicalAbsolutePath, file); - if (!options.noResolve) { - var basePath = ts.getDirectoryPath(fileName); - processReferencedFiles(file, basePath); - processImportedModules(file, basePath); - } - if (isDefaultLib) { - file.isDefaultLib = true; - files.unshift(file); - } - else { - files.push(file); - } - } - return file; - } - function getSourceFileFromCache(fileName, canonicalName, useAbsolutePath) { - var file = filesByName.get(canonicalName); - if (file && host.useCaseSensitiveFileNames()) { - var sourceFileName = useAbsolutePath ? ts.getNormalizedAbsolutePath(file.fileName, host.getCurrentDirectory()) : file.fileName; - if (canonicalName !== sourceFileName) { - diagnostics.add(ts.createFileDiagnostic(refFile, refStart, refLength, ts.Diagnostics.File_name_0_differs_from_already_included_file_name_1_only_in_casing, fileName, sourceFileName)); - } - } - return file; - } - } - function processReferencedFiles(file, basePath) { - ts.forEach(file.referencedFiles, function (ref) { - var referencedFileName = ts.isRootedDiskPath(ref.fileName) ? ref.fileName : ts.combinePaths(basePath, ref.fileName); - processSourceFile(ts.normalizePath(referencedFileName), false, file, ref.pos, ref.end); - }); - } - function processImportedModules(file, basePath) { - ts.forEach(file.statements, function (node) { - if (node.kind === 212 /* ImportDeclaration */ || node.kind === 211 /* ImportEqualsDeclaration */ || node.kind === 218 /* ExportDeclaration */) { - var moduleNameExpr = ts.getExternalModuleName(node); - if (moduleNameExpr && moduleNameExpr.kind === 8 /* StringLiteral */) { - var moduleNameText = moduleNameExpr.text; - if (moduleNameText) { - var searchPath = basePath; - var searchName; - while (true) { - searchName = ts.normalizePath(ts.combinePaths(searchPath, moduleNameText)); - if (ts.forEach(ts.supportedExtensions, function (extension) { return findModuleSourceFile(searchName + extension, moduleNameExpr); })) { - break; - } - var parentPath = ts.getDirectoryPath(searchPath); - if (parentPath === searchPath) { - break; - } - searchPath = parentPath; - } - } - } - } - else if (node.kind === 208 /* ModuleDeclaration */ && node.name.kind === 8 /* StringLiteral */ && (node.flags & 2 /* Ambient */ || ts.isDeclarationFile(file))) { - // TypeScript 1.0 spec (April 2014): 12.1.6 - // An AmbientExternalModuleDeclaration declares an external module. - // This type of declaration is permitted only in the global module. - // The StringLiteral must specify a top - level external module name. - // Relative external module names are not permitted - ts.forEachChild(node.body, function (node) { - if (ts.isExternalModuleImportEqualsDeclaration(node) && - ts.getExternalModuleImportEqualsDeclarationExpression(node).kind === 8 /* StringLiteral */) { - var nameLiteral = ts.getExternalModuleImportEqualsDeclarationExpression(node); - var moduleName = nameLiteral.text; - if (moduleName) { - // TypeScript 1.0 spec (April 2014): 12.1.6 - // An ExternalImportDeclaration in anAmbientExternalModuleDeclaration may reference other external modules - // only through top - level external module names. Relative external module names are not permitted. - var searchName = ts.normalizePath(ts.combinePaths(basePath, moduleName)); - ts.forEach(ts.supportedExtensions, function (extension) { return findModuleSourceFile(searchName + extension, nameLiteral); }); - } - } - }); - } - }); - function findModuleSourceFile(fileName, nameLiteral) { - return findSourceFile(fileName, false, file, nameLiteral.pos, nameLiteral.end - nameLiteral.pos); - } - } - function computeCommonSourceDirectory(sourceFiles) { - var commonPathComponents; - var currentDirectory = host.getCurrentDirectory(); - ts.forEach(files, function (sourceFile) { - // Each file contributes into common source file path - if (ts.isDeclarationFile(sourceFile)) { - return; - } - var sourcePathComponents = ts.getNormalizedPathComponents(sourceFile.fileName, currentDirectory); - sourcePathComponents.pop(); // The base file name is not part of the common directory path - if (!commonPathComponents) { - // first file - commonPathComponents = sourcePathComponents; - return; - } - for (var i = 0, n = Math.min(commonPathComponents.length, sourcePathComponents.length); i < n; i++) { - if (commonPathComponents[i] !== sourcePathComponents[i]) { - if (i === 0) { - diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_find_the_common_subdirectory_path_for_the_input_files)); - return; - } - // New common path found that is 0 -> i-1 - commonPathComponents.length = i; - break; - } - } - // If the sourcePathComponents was shorter than the commonPathComponents, truncate to the sourcePathComponents - if (sourcePathComponents.length < commonPathComponents.length) { - commonPathComponents.length = sourcePathComponents.length; - } - }); - return ts.getNormalizedPathFromPathComponents(commonPathComponents); - } - function checkSourceFilesBelongToPath(sourceFiles, rootDirectory) { - var allFilesBelongToPath = true; - if (sourceFiles) { - var currentDirectory = host.getCurrentDirectory(); - var absoluteRootDirectoryPath = host.getCanonicalFileName(ts.getNormalizedAbsolutePath(rootDirectory, currentDirectory)); - for (var _i = 0; _i < sourceFiles.length; _i++) { - var sourceFile = sourceFiles[_i]; - if (!ts.isDeclarationFile(sourceFile)) { - var absoluteSourceFilePath = host.getCanonicalFileName(ts.getNormalizedAbsolutePath(sourceFile.fileName, currentDirectory)); - if (absoluteSourceFilePath.indexOf(absoluteRootDirectoryPath) !== 0) { - diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files, sourceFile.fileName, options.rootDir)); - allFilesBelongToPath = false; - } - } - } - } - return allFilesBelongToPath; - } - function verifyCompilerOptions() { - if (options.isolatedModules) { - if (options.sourceMap) { - diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_sourceMap_cannot_be_specified_with_option_isolatedModules)); - } - if (options.declaration) { - diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_declaration_cannot_be_specified_with_option_isolatedModules)); - } - if (options.noEmitOnError) { - diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_noEmitOnError_cannot_be_specified_with_option_isolatedModules)); - } - if (options.out) { - diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_out_cannot_be_specified_with_option_isolatedModules)); - } - } - if (options.inlineSourceMap) { - if (options.sourceMap) { - diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_sourceMap_cannot_be_specified_with_option_inlineSourceMap)); - } - if (options.mapRoot) { - diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_mapRoot_cannot_be_specified_with_option_inlineSourceMap)); - } - if (options.sourceRoot) { - diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_sourceRoot_cannot_be_specified_with_option_inlineSourceMap)); - } - } - if (options.inlineSources) { - if (!options.sourceMap && !options.inlineSourceMap) { - diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_inlineSources_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided)); - } - } - if (!options.sourceMap && (options.mapRoot || options.sourceRoot)) { - // Error to specify --mapRoot or --sourceRoot without mapSourceFiles - if (options.mapRoot) { - diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_mapRoot_cannot_be_specified_without_specifying_sourceMap_option)); - } - if (options.sourceRoot) { - diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_sourceRoot_cannot_be_specified_without_specifying_sourceMap_option)); - } - return; - } - var languageVersion = options.target || 0 /* ES3 */; - var firstExternalModuleSourceFile = ts.forEach(files, function (f) { return ts.isExternalModule(f) ? f : undefined; }); - if (options.isolatedModules) { - if (!options.module && languageVersion < 2 /* ES6 */) { - diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES6_or_higher)); - } - var firstNonExternalModuleSourceFile = ts.forEach(files, function (f) { return !ts.isExternalModule(f) && !ts.isDeclarationFile(f) ? f : undefined; }); - if (firstNonExternalModuleSourceFile) { - var span = ts.getErrorSpanForNode(firstNonExternalModuleSourceFile, firstNonExternalModuleSourceFile); - diagnostics.add(ts.createFileDiagnostic(firstNonExternalModuleSourceFile, span.start, span.length, ts.Diagnostics.Cannot_compile_namespaces_when_the_isolatedModules_flag_is_provided)); - } - } - else if (firstExternalModuleSourceFile && languageVersion < 2 /* ES6 */ && !options.module) { - // We cannot use createDiagnosticFromNode because nodes do not have parents yet - var span = ts.getErrorSpanForNode(firstExternalModuleSourceFile, firstExternalModuleSourceFile.externalModuleIndicator); - diagnostics.add(ts.createFileDiagnostic(firstExternalModuleSourceFile, span.start, span.length, ts.Diagnostics.Cannot_compile_modules_unless_the_module_flag_is_provided)); - } - // Cannot specify module gen target when in es6 or above - if (options.module && languageVersion >= 2 /* ES6 */) { - diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_compile_modules_into_commonjs_amd_system_or_umd_when_targeting_ES6_or_higher)); - } - // there has to be common source directory if user specified --outdir || --sourceRoot - // if user specified --mapRoot, there needs to be common source directory if there would be multiple files being emitted - if (options.outDir || - options.sourceRoot || - (options.mapRoot && - (!options.out || firstExternalModuleSourceFile !== undefined))) { - if (options.rootDir && checkSourceFilesBelongToPath(files, options.rootDir)) { - // If a rootDir is specified and is valid use it as the commonSourceDirectory - commonSourceDirectory = ts.getNormalizedAbsolutePath(options.rootDir, host.getCurrentDirectory()); - } - else { - // Compute the commonSourceDirectory from the input files - commonSourceDirectory = computeCommonSourceDirectory(files); - } - if (commonSourceDirectory && commonSourceDirectory[commonSourceDirectory.length - 1] !== ts.directorySeparator) { - // Make sure directory path ends with directory separator so this string can directly - // used to replace with "" to get the relative path of the source file and the relative path doesn't - // start with / making it rooted path - commonSourceDirectory += ts.directorySeparator; - } - } - if (options.noEmit) { - if (options.out || options.outDir) { - diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_noEmit_cannot_be_specified_with_option_out_or_outDir)); - } - if (options.declaration) { - diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_noEmit_cannot_be_specified_with_option_declaration)); - } - } - if (options.emitDecoratorMetadata && - !options.experimentalDecorators) { - diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_experimentalDecorators_must_also_be_specified_when_option_emitDecoratorMetadata_is_specified)); - } - } - } - ts.createProgram = createProgram; -})(ts || (ts = {})); -/// -/// -/// -/// -var ts; -(function (ts) { - /* @internal */ - ts.optionDeclarations = [ - { - name: "charset", - type: "string" - }, - { - name: "declaration", - shortName: "d", - type: "boolean", - description: ts.Diagnostics.Generates_corresponding_d_ts_file - }, - { - name: "diagnostics", - type: "boolean" - }, - { - name: "emitBOM", - type: "boolean" - }, - { - name: "help", - shortName: "h", - type: "boolean", - description: ts.Diagnostics.Print_this_message - }, - { - name: "inlineSourceMap", - type: "boolean" - }, - { - name: "inlineSources", - type: "boolean" - }, - { - name: "listFiles", - type: "boolean" - }, - { - name: "locale", - type: "string" - }, - { - name: "mapRoot", - type: "string", - isFilePath: true, - description: ts.Diagnostics.Specifies_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations, - paramType: ts.Diagnostics.LOCATION - }, - { - name: "module", - shortName: "m", - type: { - "commonjs": 1 /* CommonJS */, - "amd": 2 /* AMD */, - "system": 4 /* System */, - "umd": 3 /* UMD */ - }, - description: ts.Diagnostics.Specify_module_code_generation_Colon_commonjs_amd_system_or_umd, - paramType: ts.Diagnostics.KIND, - error: ts.Diagnostics.Argument_for_module_option_must_be_commonjs_amd_system_or_umd - }, - { - name: "newLine", - type: { - "crlf": 0 /* CarriageReturnLineFeed */, - "lf": 1 /* LineFeed */ - }, - description: ts.Diagnostics.Specifies_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix, - paramType: ts.Diagnostics.NEWLINE, - error: ts.Diagnostics.Argument_for_newLine_option_must_be_CRLF_or_LF - }, - { - name: "noEmit", - type: "boolean", - description: ts.Diagnostics.Do_not_emit_outputs - }, - { - name: "noEmitHelpers", - type: "boolean" - }, - { - name: "noEmitOnError", - type: "boolean", - description: ts.Diagnostics.Do_not_emit_outputs_if_any_errors_were_reported - }, - { - name: "noImplicitAny", - type: "boolean", - description: ts.Diagnostics.Raise_error_on_expressions_and_declarations_with_an_implied_any_type - }, - { - name: "noLib", - type: "boolean" - }, - { - name: "noResolve", - type: "boolean" - }, - { - name: "skipDefaultLibCheck", - type: "boolean" - }, - { - name: "out", - type: "string", - description: ts.Diagnostics.Concatenate_and_emit_output_to_single_file, - paramType: ts.Diagnostics.FILE - }, - { - name: "outDir", - type: "string", - isFilePath: true, - description: ts.Diagnostics.Redirect_output_structure_to_the_directory, - paramType: ts.Diagnostics.DIRECTORY - }, - { - name: "preserveConstEnums", - type: "boolean", - description: ts.Diagnostics.Do_not_erase_const_enum_declarations_in_generated_code - }, - { - name: "project", - shortName: "p", - type: "string", - isFilePath: true, - description: ts.Diagnostics.Compile_the_project_in_the_given_directory, - paramType: ts.Diagnostics.DIRECTORY - }, - { - name: "removeComments", - type: "boolean", - description: ts.Diagnostics.Do_not_emit_comments_to_output - }, - { - name: "rootDir", - type: "string", - isFilePath: true, - description: ts.Diagnostics.Specifies_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir, - paramType: ts.Diagnostics.LOCATION - }, - { - name: "isolatedModules", - type: "boolean" - }, - { - name: "sourceMap", - type: "boolean", - description: ts.Diagnostics.Generates_corresponding_map_file - }, - { - name: "sourceRoot", - type: "string", - isFilePath: true, - description: ts.Diagnostics.Specifies_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations, - paramType: ts.Diagnostics.LOCATION - }, - { - name: "suppressImplicitAnyIndexErrors", - type: "boolean", - description: ts.Diagnostics.Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures - }, - { - name: "stripInternal", - type: "boolean", - description: ts.Diagnostics.Do_not_emit_declarations_for_code_that_has_an_internal_annotation, - experimental: true - }, - { - name: "target", - shortName: "t", - type: { "es3": 0 /* ES3 */, "es5": 1 /* ES5 */, "es6": 2 /* ES6 */ }, - description: ts.Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_ES5_or_ES6_experimental, - paramType: ts.Diagnostics.VERSION, - error: ts.Diagnostics.Argument_for_target_option_must_be_ES3_ES5_or_ES6 - }, - { - name: "version", - shortName: "v", - type: "boolean", - description: ts.Diagnostics.Print_the_compiler_s_version - }, - { - name: "watch", - shortName: "w", - type: "boolean", - description: ts.Diagnostics.Watch_input_files - }, - { - name: "experimentalDecorators", - type: "boolean", - description: ts.Diagnostics.Enables_experimental_support_for_ES7_decorators - }, - { - name: "emitDecoratorMetadata", - type: "boolean", - experimental: true, - description: ts.Diagnostics.Enables_experimental_support_for_emitting_type_metadata_for_decorators - } - ]; - function parseCommandLine(commandLine) { - var options = {}; - var fileNames = []; - var errors = []; - var shortOptionNames = {}; - var optionNameMap = {}; - ts.forEach(ts.optionDeclarations, function (option) { - optionNameMap[option.name.toLowerCase()] = option; - if (option.shortName) { - shortOptionNames[option.shortName] = option.name; - } - }); - parseStrings(commandLine); - return { - options: options, - fileNames: fileNames, - errors: errors - }; - function parseStrings(args) { - var i = 0; - while (i < args.length) { - var s = args[i++]; - if (s.charCodeAt(0) === 64 /* at */) { - parseResponseFile(s.slice(1)); - } - else if (s.charCodeAt(0) === 45 /* minus */) { - s = s.slice(s.charCodeAt(1) === 45 /* minus */ ? 2 : 1).toLowerCase(); - // Try to translate short option names to their full equivalents. - if (ts.hasProperty(shortOptionNames, s)) { - s = shortOptionNames[s]; - } - if (ts.hasProperty(optionNameMap, s)) { - var opt = optionNameMap[s]; - // Check to see if no argument was provided (e.g. "--locale" is the last command-line argument). - if (!args[i] && opt.type !== "boolean") { - errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Compiler_option_0_expects_an_argument, opt.name)); - } - switch (opt.type) { - case "number": - options[opt.name] = parseInt(args[i++]); - break; - case "boolean": - options[opt.name] = true; - break; - case "string": - options[opt.name] = args[i++] || ""; - break; - // If not a primitive, the possible types are specified in what is effectively a map of options. - default: - var map = opt.type; - var key = (args[i++] || "").toLowerCase(); - if (ts.hasProperty(map, key)) { - options[opt.name] = map[key]; - } - else { - errors.push(ts.createCompilerDiagnostic(opt.error)); - } - } - } - else { - errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Unknown_compiler_option_0, s)); - } - } - else { - fileNames.push(s); - } - } - } - function parseResponseFile(fileName) { - var text = ts.sys.readFile(fileName); - if (!text) { - errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.File_0_not_found, fileName)); - return; - } - var args = []; - var pos = 0; - while (true) { - while (pos < text.length && text.charCodeAt(pos) <= 32 /* space */) - pos++; - if (pos >= text.length) - break; - var start = pos; - if (text.charCodeAt(start) === 34 /* doubleQuote */) { - pos++; - while (pos < text.length && text.charCodeAt(pos) !== 34 /* doubleQuote */) - pos++; - if (pos < text.length) { - args.push(text.substring(start + 1, pos)); - pos++; - } - else { - errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Unterminated_quoted_string_in_response_file_0, fileName)); - } - } - else { - while (text.charCodeAt(pos) > 32 /* space */) - pos++; - args.push(text.substring(start, pos)); - } - } - parseStrings(args); - } - } - ts.parseCommandLine = parseCommandLine; - /** - * Read tsconfig.json file - * @param fileName The path to the config file - */ - function readConfigFile(fileName) { - try { - var text = ts.sys.readFile(fileName); - } - catch (e) { - return { error: ts.createCompilerDiagnostic(ts.Diagnostics.Cannot_read_file_0_Colon_1, fileName, e.message) }; - } - return parseConfigFileText(fileName, text); - } - ts.readConfigFile = readConfigFile; - /** - * Parse the text of the tsconfig.json file - * @param fileName The path to the config file - * @param jsonText The text of the config file - */ - function parseConfigFileText(fileName, jsonText) { - try { - return { config: /\S/.test(jsonText) ? JSON.parse(jsonText) : {} }; - } - catch (e) { - return { error: ts.createCompilerDiagnostic(ts.Diagnostics.Failed_to_parse_file_0_Colon_1, fileName, e.message) }; - } - } - ts.parseConfigFileText = parseConfigFileText; - /** - * Parse the contents of a config file (tsconfig.json). - * @param json The contents of the config file to parse - * @param basePath A root directory to resolve relative path entries in the config - * file to. e.g. outDir - */ - function parseConfigFile(json, host, basePath) { - var errors = []; - return { - options: getCompilerOptions(), - fileNames: getFileNames(), - errors: errors - }; - function getCompilerOptions() { - var options = {}; - var optionNameMap = {}; - ts.forEach(ts.optionDeclarations, function (option) { - optionNameMap[option.name] = option; - }); - var jsonOptions = json["compilerOptions"]; - if (jsonOptions) { - for (var id in jsonOptions) { - if (ts.hasProperty(optionNameMap, id)) { - var opt = optionNameMap[id]; - var optType = opt.type; - var value = jsonOptions[id]; - var expectedType = typeof optType === "string" ? optType : "string"; - if (typeof value === expectedType) { - if (typeof optType !== "string") { - var key = value.toLowerCase(); - if (ts.hasProperty(optType, key)) { - value = optType[key]; - } - else { - errors.push(ts.createCompilerDiagnostic(opt.error)); - value = 0; - } - } - if (opt.isFilePath) { - value = ts.normalizePath(ts.combinePaths(basePath, value)); - } - options[opt.name] = value; - } - else { - errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Compiler_option_0_requires_a_value_of_type_1, id, expectedType)); - } - } - else { - errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Unknown_compiler_option_0, id)); - } - } - } - return options; - } - function getFileNames() { - var fileNames = []; - if (ts.hasProperty(json, "files")) { - if (json["files"] instanceof Array) { - fileNames = ts.map(json["files"], function (s) { return ts.combinePaths(basePath, s); }); - } - } - else { - var exclude = json["exclude"] instanceof Array ? ts.map(json["exclude"], ts.normalizeSlashes) : undefined; - var sysFiles = host.readDirectory(basePath, ".ts", exclude); - for (var i = 0; i < sysFiles.length; i++) { - var name = sysFiles[i]; - if (!ts.fileExtensionIs(name, ".d.ts") || !ts.contains(sysFiles, name.substr(0, name.length - 5) + ".ts")) { - fileNames.push(name); - } - } - } - return fileNames; - } - } - ts.parseConfigFile = parseConfigFile; -})(ts || (ts = {})); -/* @internal */ -var ts; -(function (ts) { - var OutliningElementsCollector; - (function (OutliningElementsCollector) { - function collectElements(sourceFile) { - var elements = []; - var collapseText = "..."; - function addOutliningSpan(hintSpanNode, startElement, endElement, autoCollapse) { - if (hintSpanNode && startElement && endElement) { - var span = { - textSpan: ts.createTextSpanFromBounds(startElement.pos, endElement.end), - hintSpan: ts.createTextSpanFromBounds(hintSpanNode.getStart(), hintSpanNode.end), - bannerText: collapseText, - autoCollapse: autoCollapse - }; - elements.push(span); - } - } - function addOutliningSpanComments(commentSpan, autoCollapse) { - if (commentSpan) { - var span = { - textSpan: ts.createTextSpanFromBounds(commentSpan.pos, commentSpan.end), - hintSpan: ts.createTextSpanFromBounds(commentSpan.pos, commentSpan.end), - bannerText: collapseText, - autoCollapse: autoCollapse - }; - elements.push(span); - } - } - function addOutliningForLeadingCommentsForNode(n) { - var comments = ts.getLeadingCommentRangesOfNode(n, sourceFile); - if (comments) { - var firstSingleLineCommentStart = -1; - var lastSingleLineCommentEnd = -1; - var isFirstSingleLineComment = true; - var singleLineCommentCount = 0; - for (var _i = 0; _i < comments.length; _i++) { - var currentComment = comments[_i]; - // For single line comments, combine consecutive ones (2 or more) into - // a single span from the start of the first till the end of the last - if (currentComment.kind === 2 /* SingleLineCommentTrivia */) { - if (isFirstSingleLineComment) { - firstSingleLineCommentStart = currentComment.pos; - } - isFirstSingleLineComment = false; - lastSingleLineCommentEnd = currentComment.end; - singleLineCommentCount++; - } - else if (currentComment.kind === 3 /* MultiLineCommentTrivia */) { - combineAndAddMultipleSingleLineComments(singleLineCommentCount, firstSingleLineCommentStart, lastSingleLineCommentEnd); - addOutliningSpanComments(currentComment, false); - singleLineCommentCount = 0; - lastSingleLineCommentEnd = -1; - isFirstSingleLineComment = true; - } - } - combineAndAddMultipleSingleLineComments(singleLineCommentCount, firstSingleLineCommentStart, lastSingleLineCommentEnd); - } - } - function combineAndAddMultipleSingleLineComments(count, start, end) { - // Only outline spans of two or more consecutive single line comments - if (count > 1) { - var multipleSingleLineComments = { - pos: start, - end: end, - kind: 2 /* SingleLineCommentTrivia */ - }; - addOutliningSpanComments(multipleSingleLineComments, false); - } - } - function autoCollapse(node) { - return ts.isFunctionBlock(node) && node.parent.kind !== 166 /* ArrowFunction */; - } - var depth = 0; - var maxDepth = 20; - function walk(n) { - if (depth > maxDepth) { - return; - } - if (ts.isDeclaration(n)) { - addOutliningForLeadingCommentsForNode(n); - } - switch (n.kind) { - case 182 /* Block */: - if (!ts.isFunctionBlock(n)) { - var parent_8 = n.parent; - var openBrace = ts.findChildOfKind(n, 14 /* OpenBraceToken */, sourceFile); - var closeBrace = ts.findChildOfKind(n, 15 /* CloseBraceToken */, sourceFile); - // Check if the block is standalone, or 'attached' to some parent statement. - // If the latter, we want to collaps the block, but consider its hint span - // to be the entire span of the parent. - if (parent_8.kind === 187 /* DoStatement */ || - parent_8.kind === 190 /* ForInStatement */ || - parent_8.kind === 191 /* ForOfStatement */ || - parent_8.kind === 189 /* ForStatement */ || - parent_8.kind === 186 /* IfStatement */ || - parent_8.kind === 188 /* WhileStatement */ || - parent_8.kind === 195 /* WithStatement */ || - parent_8.kind === 226 /* CatchClause */) { - addOutliningSpan(parent_8, openBrace, closeBrace, autoCollapse(n)); - break; - } - if (parent_8.kind === 199 /* TryStatement */) { - // Could be the try-block, or the finally-block. - var tryStatement = parent_8; - if (tryStatement.tryBlock === n) { - addOutliningSpan(parent_8, openBrace, closeBrace, autoCollapse(n)); - break; - } - else if (tryStatement.finallyBlock === n) { - var finallyKeyword = ts.findChildOfKind(tryStatement, 81 /* FinallyKeyword */, sourceFile); - if (finallyKeyword) { - addOutliningSpan(finallyKeyword, openBrace, closeBrace, autoCollapse(n)); - break; - } - } - } - // Block was a standalone block. In this case we want to only collapse - // the span of the block, independent of any parent span. - var span = ts.createTextSpanFromBounds(n.getStart(), n.end); - elements.push({ - textSpan: span, - hintSpan: span, - bannerText: collapseText, - autoCollapse: autoCollapse(n) - }); - break; - } - // Fallthrough. - case 209 /* ModuleBlock */: { - var openBrace = ts.findChildOfKind(n, 14 /* OpenBraceToken */, sourceFile); - var closeBrace = ts.findChildOfKind(n, 15 /* CloseBraceToken */, sourceFile); - addOutliningSpan(n.parent, openBrace, closeBrace, autoCollapse(n)); - break; - } - case 204 /* ClassDeclaration */: - case 205 /* InterfaceDeclaration */: - case 207 /* EnumDeclaration */: - case 157 /* ObjectLiteralExpression */: - case 210 /* CaseBlock */: { - var openBrace = ts.findChildOfKind(n, 14 /* OpenBraceToken */, sourceFile); - var closeBrace = ts.findChildOfKind(n, 15 /* CloseBraceToken */, sourceFile); - addOutliningSpan(n, openBrace, closeBrace, autoCollapse(n)); - break; - } - case 156 /* ArrayLiteralExpression */: - var openBracket = ts.findChildOfKind(n, 18 /* OpenBracketToken */, sourceFile); - var closeBracket = ts.findChildOfKind(n, 19 /* CloseBracketToken */, sourceFile); - addOutliningSpan(n, openBracket, closeBracket, autoCollapse(n)); - break; - } - depth++; - ts.forEachChild(n, walk); - depth--; - } - walk(sourceFile); - return elements; - } - OutliningElementsCollector.collectElements = collectElements; - })(OutliningElementsCollector = ts.OutliningElementsCollector || (ts.OutliningElementsCollector = {})); -})(ts || (ts = {})); -/* @internal */ -var ts; -(function (ts) { - var NavigateTo; - (function (NavigateTo) { - function getNavigateToItems(program, cancellationToken, searchValue, maxResultCount) { - var patternMatcher = ts.createPatternMatcher(searchValue); - var rawItems = []; - // Search the declarations in all files and output matched NavigateToItem into array of NavigateToItem[] - ts.forEach(program.getSourceFiles(), function (sourceFile) { - cancellationToken.throwIfCancellationRequested(); - var nameToDeclarations = sourceFile.getNamedDeclarations(); - for (var name_27 in nameToDeclarations) { - var declarations = ts.getProperty(nameToDeclarations, name_27); - if (declarations) { - // First do a quick check to see if the name of the declaration matches the - // last portion of the (possibly) dotted name they're searching for. - var matches = patternMatcher.getMatchesForLastSegmentOfPattern(name_27); - if (!matches) { - continue; - } - for (var _i = 0; _i < declarations.length; _i++) { - var declaration = declarations[_i]; - // It was a match! If the pattern has dots in it, then also see if the - // declaration container matches as well. - if (patternMatcher.patternContainsDots) { - var containers = getContainers(declaration); - if (!containers) { - return undefined; - } - matches = patternMatcher.getMatches(containers, name_27); - if (!matches) { - continue; - } - } - var fileName = sourceFile.fileName; - var matchKind = bestMatchKind(matches); - rawItems.push({ name: name_27, fileName: fileName, matchKind: matchKind, isCaseSensitive: allMatchesAreCaseSensitive(matches), declaration: declaration }); - } - } - } - }); - rawItems.sort(compareNavigateToItems); - if (maxResultCount !== undefined) { - rawItems = rawItems.slice(0, maxResultCount); - } - var items = ts.map(rawItems, createNavigateToItem); - return items; - function allMatchesAreCaseSensitive(matches) { - ts.Debug.assert(matches.length > 0); - // This is a case sensitive match, only if all the submatches were case sensitive. - for (var _i = 0; _i < matches.length; _i++) { - var match = matches[_i]; - if (!match.isCaseSensitive) { - return false; - } - } - return true; - } - function getTextOfIdentifierOrLiteral(node) { - if (node) { - if (node.kind === 65 /* Identifier */ || - node.kind === 8 /* StringLiteral */ || - node.kind === 7 /* NumericLiteral */) { - return node.text; - } - } - return undefined; - } - function tryAddSingleDeclarationName(declaration, containers) { - if (declaration && declaration.name) { - var text = getTextOfIdentifierOrLiteral(declaration.name); - if (text !== undefined) { - containers.unshift(text); - } - else if (declaration.name.kind === 129 /* ComputedPropertyName */) { - return tryAddComputedPropertyName(declaration.name.expression, containers, true); - } - else { - // Don't know how to add this. - return false; - } - } - return true; - } - // Only added the names of computed properties if they're simple dotted expressions, like: - // - // [X.Y.Z]() { } - function tryAddComputedPropertyName(expression, containers, includeLastPortion) { - var text = getTextOfIdentifierOrLiteral(expression); - if (text !== undefined) { - if (includeLastPortion) { - containers.unshift(text); - } - return true; - } - if (expression.kind === 158 /* PropertyAccessExpression */) { - var propertyAccess = expression; - if (includeLastPortion) { - containers.unshift(propertyAccess.name.text); - } - return tryAddComputedPropertyName(propertyAccess.expression, containers, true); - } - return false; - } - function getContainers(declaration) { - var containers = []; - // First, if we started with a computed property name, then add all but the last - // portion into the container array. - if (declaration.name.kind === 129 /* ComputedPropertyName */) { - if (!tryAddComputedPropertyName(declaration.name.expression, containers, false)) { - return undefined; - } - } - // Now, walk up our containers, adding all their names to the container array. - declaration = ts.getContainerNode(declaration); - while (declaration) { - if (!tryAddSingleDeclarationName(declaration, containers)) { - return undefined; - } - declaration = ts.getContainerNode(declaration); - } - return containers; - } - function bestMatchKind(matches) { - ts.Debug.assert(matches.length > 0); - var bestMatchKind = ts.PatternMatchKind.camelCase; - for (var _i = 0; _i < matches.length; _i++) { - var match = matches[_i]; - var kind = match.kind; - if (kind < bestMatchKind) { - bestMatchKind = kind; - } - } - return bestMatchKind; - } - // This means "compare in a case insensitive manner." - var baseSensitivity = { sensitivity: "base" }; - function compareNavigateToItems(i1, i2) { - // TODO(cyrusn): get the gamut of comparisons that VS already uses here. - // Right now we just sort by kind first, and then by name of the item. - // We first sort case insensitively. So "Aaa" will come before "bar". - // Then we sort case sensitively, so "aaa" will come before "Aaa". - return i1.matchKind - i2.matchKind || - i1.name.localeCompare(i2.name, undefined, baseSensitivity) || - i1.name.localeCompare(i2.name); - } - function createNavigateToItem(rawItem) { - var declaration = rawItem.declaration; - var container = ts.getContainerNode(declaration); - return { - name: rawItem.name, - kind: ts.getNodeKind(declaration), - kindModifiers: ts.getNodeModifiers(declaration), - matchKind: ts.PatternMatchKind[rawItem.matchKind], - isCaseSensitive: rawItem.isCaseSensitive, - fileName: rawItem.fileName, - textSpan: ts.createTextSpanFromBounds(declaration.getStart(), declaration.getEnd()), - // TODO(jfreeman): What should be the containerName when the container has a computed name? - containerName: container && container.name ? container.name.text : "", - containerKind: container && container.name ? ts.getNodeKind(container) : "" - }; - } - } - NavigateTo.getNavigateToItems = getNavigateToItems; - })(NavigateTo = ts.NavigateTo || (ts.NavigateTo = {})); -})(ts || (ts = {})); -/// -/* @internal */ -var ts; -(function (ts) { - var NavigationBar; - (function (NavigationBar) { - function getNavigationBarItems(sourceFile) { - // If the source file has any child items, then it included in the tree - // and takes lexical ownership of all other top-level items. - var hasGlobalNode = false; - return getItemsWorker(getTopLevelNodes(sourceFile), createTopLevelItem); - function getIndent(node) { - // If we have a global node in the tree, - // then it adds an extra layer of depth to all subnodes. - var indent = hasGlobalNode ? 1 : 0; - var current = node.parent; - while (current) { - switch (current.kind) { - case 208 /* ModuleDeclaration */: - // If we have a module declared as A.B.C, it is more "intuitive" - // to say it only has a single layer of depth - do { - current = current.parent; - } while (current.kind === 208 /* ModuleDeclaration */); - // fall through - case 204 /* ClassDeclaration */: - case 207 /* EnumDeclaration */: - case 205 /* InterfaceDeclaration */: - case 203 /* FunctionDeclaration */: - indent++; - } - current = current.parent; - } - return indent; - } - function getChildNodes(nodes) { - var childNodes = []; - function visit(node) { - switch (node.kind) { - case 183 /* VariableStatement */: - ts.forEach(node.declarationList.declarations, visit); - break; - case 153 /* ObjectBindingPattern */: - case 154 /* ArrayBindingPattern */: - ts.forEach(node.elements, visit); - break; - case 218 /* ExportDeclaration */: - // Handle named exports case e.g.: - // export {a, b as B} from "mod"; - if (node.exportClause) { - ts.forEach(node.exportClause.elements, visit); - } - break; - case 212 /* ImportDeclaration */: - var importClause = node.importClause; - if (importClause) { - // Handle default import case e.g.: - // import d from "mod"; - if (importClause.name) { - childNodes.push(importClause); - } - // Handle named bindings in imports e.g.: - // import * as NS from "mod"; - // import {a, b as B} from "mod"; - if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 214 /* NamespaceImport */) { - childNodes.push(importClause.namedBindings); - } - else { - ts.forEach(importClause.namedBindings.elements, visit); - } - } - } - break; - case 155 /* BindingElement */: - case 201 /* VariableDeclaration */: - if (ts.isBindingPattern(node.name)) { - visit(node.name); - break; - } - // Fall through - case 204 /* ClassDeclaration */: - case 207 /* EnumDeclaration */: - case 205 /* InterfaceDeclaration */: - case 208 /* ModuleDeclaration */: - case 203 /* FunctionDeclaration */: - case 211 /* ImportEqualsDeclaration */: - case 216 /* ImportSpecifier */: - case 220 /* ExportSpecifier */: - childNodes.push(node); - break; - } - } - //for (let i = 0, n = nodes.length; i < n; i++) { - // let node = nodes[i]; - // if (node.kind === SyntaxKind.ClassDeclaration || - // node.kind === SyntaxKind.EnumDeclaration || - // node.kind === SyntaxKind.InterfaceDeclaration || - // node.kind === SyntaxKind.ModuleDeclaration || - // node.kind === SyntaxKind.FunctionDeclaration) { - // childNodes.push(node); - // } - // else if (node.kind === SyntaxKind.VariableStatement) { - // childNodes.push.apply(childNodes, (node).declarations); - // } - //} - ts.forEach(nodes, visit); - return sortNodes(childNodes); - } - function getTopLevelNodes(node) { - var topLevelNodes = []; - topLevelNodes.push(node); - addTopLevelNodes(node.statements, topLevelNodes); - return topLevelNodes; - } - function sortNodes(nodes) { - return nodes.slice(0).sort(function (n1, n2) { - if (n1.name && n2.name) { - return ts.getPropertyNameForPropertyNameNode(n1.name).localeCompare(ts.getPropertyNameForPropertyNameNode(n2.name)); - } - else if (n1.name) { - return 1; - } - else if (n2.name) { - return -1; - } - else { - return n1.kind - n2.kind; - } - }); - } - function addTopLevelNodes(nodes, topLevelNodes) { - nodes = sortNodes(nodes); - for (var _i = 0; _i < nodes.length; _i++) { - var node = nodes[_i]; - switch (node.kind) { - case 204 /* ClassDeclaration */: - case 207 /* EnumDeclaration */: - case 205 /* InterfaceDeclaration */: - topLevelNodes.push(node); - break; - case 208 /* ModuleDeclaration */: - var moduleDeclaration = node; - topLevelNodes.push(node); - addTopLevelNodes(getInnermostModule(moduleDeclaration).body.statements, topLevelNodes); - break; - case 203 /* FunctionDeclaration */: - var functionDeclaration = node; - if (isTopLevelFunctionDeclaration(functionDeclaration)) { - topLevelNodes.push(node); - addTopLevelNodes(functionDeclaration.body.statements, topLevelNodes); - } - break; - } - } - } - function isTopLevelFunctionDeclaration(functionDeclaration) { - if (functionDeclaration.kind === 203 /* FunctionDeclaration */) { - // A function declaration is 'top level' if it contains any function declarations - // within it. - if (functionDeclaration.body && functionDeclaration.body.kind === 182 /* Block */) { - // Proper function declarations can only have identifier names - if (ts.forEach(functionDeclaration.body.statements, function (s) { return s.kind === 203 /* FunctionDeclaration */ && !isEmpty(s.name.text); })) { - return true; - } - // Or if it is not parented by another function. i.e all functions - // at module scope are 'top level'. - if (!ts.isFunctionBlock(functionDeclaration.parent)) { - return true; - } - } - } - return false; - } - function getItemsWorker(nodes, createItem) { - var items = []; - var keyToItem = {}; - for (var _i = 0; _i < nodes.length; _i++) { - var child = nodes[_i]; - var item = createItem(child); - if (item !== undefined) { - if (item.text.length > 0) { - var key = item.text + "-" + item.kind + "-" + item.indent; - var itemWithSameName = keyToItem[key]; - if (itemWithSameName) { - // We had an item with the same name. Merge these items together. - merge(itemWithSameName, item); - } - else { - keyToItem[key] = item; - items.push(item); - } - } - } - } - return items; - } - function merge(target, source) { - // First, add any spans in the source to the target. - target.spans.push.apply(target.spans, source.spans); - if (source.childItems) { - if (!target.childItems) { - target.childItems = []; - } - // Next, recursively merge or add any children in the source as appropriate. - outer: for (var _i = 0, _a = source.childItems; _i < _a.length; _i++) { - var sourceChild = _a[_i]; - for (var _b = 0, _c = target.childItems; _b < _c.length; _b++) { - var targetChild = _c[_b]; - if (targetChild.text === sourceChild.text && targetChild.kind === sourceChild.kind) { - // Found a match. merge them. - merge(targetChild, sourceChild); - continue outer; - } - } - // Didn't find a match, just add this child to the list. - target.childItems.push(sourceChild); - } - } - } - function createChildItem(node) { - switch (node.kind) { - case 131 /* Parameter */: - if (ts.isBindingPattern(node.name)) { - break; - } - if ((node.flags & 499 /* Modifier */) === 0) { - return undefined; - } - return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberVariableElement); - case 136 /* MethodDeclaration */: - case 135 /* MethodSignature */: - return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberFunctionElement); - case 138 /* GetAccessor */: - return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberGetAccessorElement); - case 139 /* SetAccessor */: - return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberSetAccessorElement); - case 142 /* IndexSignature */: - return createItem(node, "[]", ts.ScriptElementKind.indexSignatureElement); - case 229 /* EnumMember */: - return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberVariableElement); - case 140 /* CallSignature */: - return createItem(node, "()", ts.ScriptElementKind.callSignatureElement); - case 141 /* ConstructSignature */: - return createItem(node, "new()", ts.ScriptElementKind.constructSignatureElement); - case 134 /* PropertyDeclaration */: - case 133 /* PropertySignature */: - return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.memberVariableElement); - case 203 /* FunctionDeclaration */: - return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.functionElement); - case 201 /* VariableDeclaration */: - case 155 /* BindingElement */: - var variableDeclarationNode; - var name_28; - if (node.kind === 155 /* BindingElement */) { - name_28 = node.name; - variableDeclarationNode = node; - // binding elements are added only for variable declarations - // bubble up to the containing variable declaration - while (variableDeclarationNode && variableDeclarationNode.kind !== 201 /* VariableDeclaration */) { - variableDeclarationNode = variableDeclarationNode.parent; - } - ts.Debug.assert(variableDeclarationNode !== undefined); - } - else { - ts.Debug.assert(!ts.isBindingPattern(node.name)); - variableDeclarationNode = node; - name_28 = node.name; - } - if (ts.isConst(variableDeclarationNode)) { - return createItem(node, getTextOfNode(name_28), ts.ScriptElementKind.constElement); - } - else if (ts.isLet(variableDeclarationNode)) { - return createItem(node, getTextOfNode(name_28), ts.ScriptElementKind.letElement); - } - else { - return createItem(node, getTextOfNode(name_28), ts.ScriptElementKind.variableElement); - } - case 137 /* Constructor */: - return createItem(node, "constructor", ts.ScriptElementKind.constructorImplementationElement); - case 220 /* ExportSpecifier */: - case 216 /* ImportSpecifier */: - case 211 /* ImportEqualsDeclaration */: - case 213 /* ImportClause */: - case 214 /* NamespaceImport */: - return createItem(node, getTextOfNode(node.name), ts.ScriptElementKind.alias); - } - return undefined; - function createItem(node, name, scriptElementKind) { - return getNavigationBarItem(name, scriptElementKind, ts.getNodeModifiers(node), [getNodeSpan(node)]); - } - } - function isEmpty(text) { - return !text || text.trim() === ""; - } - function getNavigationBarItem(text, kind, kindModifiers, spans, childItems, indent) { - if (childItems === void 0) { childItems = []; } - if (indent === void 0) { indent = 0; } - if (isEmpty(text)) { - return undefined; - } - return { - text: text, - kind: kind, - kindModifiers: kindModifiers, - spans: spans, - childItems: childItems, - indent: indent, - bolded: false, - grayed: false - }; - } - function createTopLevelItem(node) { - switch (node.kind) { - case 230 /* SourceFile */: - return createSourceFileItem(node); - case 204 /* ClassDeclaration */: - return createClassItem(node); - case 207 /* EnumDeclaration */: - return createEnumItem(node); - case 205 /* InterfaceDeclaration */: - return createIterfaceItem(node); - case 208 /* ModuleDeclaration */: - return createModuleItem(node); - case 203 /* FunctionDeclaration */: - return createFunctionItem(node); - } - return undefined; - function getModuleName(moduleDeclaration) { - // We want to maintain quotation marks. - if (moduleDeclaration.name.kind === 8 /* StringLiteral */) { - return getTextOfNode(moduleDeclaration.name); - } - // Otherwise, we need to aggregate each identifier to build up the qualified name. - var result = []; - result.push(moduleDeclaration.name.text); - while (moduleDeclaration.body && moduleDeclaration.body.kind === 208 /* ModuleDeclaration */) { - moduleDeclaration = moduleDeclaration.body; - result.push(moduleDeclaration.name.text); - } - return result.join("."); - } - function createModuleItem(node) { - var moduleName = getModuleName(node); - var childItems = getItemsWorker(getChildNodes(getInnermostModule(node).body.statements), createChildItem); - return getNavigationBarItem(moduleName, ts.ScriptElementKind.moduleElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); - } - function createFunctionItem(node) { - if (node.body && node.body.kind === 182 /* Block */) { - var childItems = getItemsWorker(sortNodes(node.body.statements), createChildItem); - return getNavigationBarItem(!node.name ? "default" : node.name.text, ts.ScriptElementKind.functionElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); - } - return undefined; - } - function createSourceFileItem(node) { - var childItems = getItemsWorker(getChildNodes(node.statements), createChildItem); - if (childItems === undefined || childItems.length === 0) { - return undefined; - } - hasGlobalNode = true; - var rootName = ts.isExternalModule(node) - ? "\"" + ts.escapeString(ts.getBaseFileName(ts.removeFileExtension(ts.normalizePath(node.fileName)))) + "\"" - : ""; - return getNavigationBarItem(rootName, ts.ScriptElementKind.moduleElement, ts.ScriptElementKindModifier.none, [getNodeSpan(node)], childItems); - } - function createClassItem(node) { - var childItems; - if (node.members) { - var constructor = ts.forEach(node.members, function (member) { - return member.kind === 137 /* Constructor */ && member; - }); - // Add the constructor parameters in as children of the class (for property parameters). - // Note that *all non-binding pattern named* parameters will be added to the nodes array, but parameters that - // are not properties will be filtered out later by createChildItem. - var nodes = removeDynamicallyNamedProperties(node); - if (constructor) { - nodes.push.apply(nodes, ts.filter(constructor.parameters, function (p) { return !ts.isBindingPattern(p.name); })); - } - childItems = getItemsWorker(sortNodes(nodes), createChildItem); - } - var nodeName = !node.name ? "default" : node.name.text; - return getNavigationBarItem(nodeName, ts.ScriptElementKind.classElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); - } - function createEnumItem(node) { - var childItems = getItemsWorker(sortNodes(removeComputedProperties(node)), createChildItem); - return getNavigationBarItem(node.name.text, ts.ScriptElementKind.enumElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); - } - function createIterfaceItem(node) { - var childItems = getItemsWorker(sortNodes(removeDynamicallyNamedProperties(node)), createChildItem); - return getNavigationBarItem(node.name.text, ts.ScriptElementKind.interfaceElement, ts.getNodeModifiers(node), [getNodeSpan(node)], childItems, getIndent(node)); - } - } - function removeComputedProperties(node) { - return ts.filter(node.members, function (member) { return member.name === undefined || member.name.kind !== 129 /* ComputedPropertyName */; }); - } - /** - * Like removeComputedProperties, but retains the properties with well known symbol names - */ - function removeDynamicallyNamedProperties(node) { - return ts.filter(node.members, function (member) { return !ts.hasDynamicName(member); }); - } - function getInnermostModule(node) { - while (node.body.kind === 208 /* ModuleDeclaration */) { - node = node.body; - } - return node; - } - function getNodeSpan(node) { - return node.kind === 230 /* SourceFile */ - ? ts.createTextSpanFromBounds(node.getFullStart(), node.getEnd()) - : ts.createTextSpanFromBounds(node.getStart(), node.getEnd()); - } - function getTextOfNode(node) { - return ts.getTextOfNodeFromSourceText(sourceFile.text, node); - } - } - NavigationBar.getNavigationBarItems = getNavigationBarItems; - })(NavigationBar = ts.NavigationBar || (ts.NavigationBar = {})); -})(ts || (ts = {})); -/* @internal */ -var ts; -(function (ts) { - // Note(cyrusn): this enum is ordered from strongest match type to weakest match type. - (function (PatternMatchKind) { - PatternMatchKind[PatternMatchKind["exact"] = 0] = "exact"; - PatternMatchKind[PatternMatchKind["prefix"] = 1] = "prefix"; - PatternMatchKind[PatternMatchKind["substring"] = 2] = "substring"; - PatternMatchKind[PatternMatchKind["camelCase"] = 3] = "camelCase"; - })(ts.PatternMatchKind || (ts.PatternMatchKind = {})); - var PatternMatchKind = ts.PatternMatchKind; - function createPatternMatch(kind, punctuationStripped, isCaseSensitive, camelCaseWeight) { - return { - kind: kind, - punctuationStripped: punctuationStripped, - isCaseSensitive: isCaseSensitive, - camelCaseWeight: camelCaseWeight - }; - } - function createPatternMatcher(pattern) { - // We'll often see the same candidate string many times when searching (For example, when - // we see the name of a module that is used everywhere, or the name of an overload). As - // such, we cache the information we compute about the candidate for the life of this - // pattern matcher so we don't have to compute it multiple times. - var stringToWordSpans = {}; - pattern = pattern.trim(); - var fullPatternSegment = createSegment(pattern); - var dotSeparatedSegments = pattern.split(".").map(function (p) { return createSegment(p.trim()); }); - var invalidPattern = dotSeparatedSegments.length === 0 || ts.forEach(dotSeparatedSegments, segmentIsInvalid); - return { - getMatches: getMatches, - getMatchesForLastSegmentOfPattern: getMatchesForLastSegmentOfPattern, - patternContainsDots: dotSeparatedSegments.length > 1 - }; - // Quick checks so we can bail out when asked to match a candidate. - function skipMatch(candidate) { - return invalidPattern || !candidate; - } - function getMatchesForLastSegmentOfPattern(candidate) { - if (skipMatch(candidate)) { - return undefined; - } - return matchSegment(candidate, ts.lastOrUndefined(dotSeparatedSegments)); - } - function getMatches(candidateContainers, candidate) { - if (skipMatch(candidate)) { - return undefined; - } - // First, check that the last part of the dot separated pattern matches the name of the - // candidate. If not, then there's no point in proceeding and doing the more - // expensive work. - var candidateMatch = matchSegment(candidate, ts.lastOrUndefined(dotSeparatedSegments)); - if (!candidateMatch) { - return undefined; - } - candidateContainers = candidateContainers || []; - // -1 because the last part was checked against the name, and only the rest - // of the parts are checked against the container. - if (dotSeparatedSegments.length - 1 > candidateContainers.length) { - // There weren't enough container parts to match against the pattern parts. - // So this definitely doesn't match. - return undefined; - } - // So far so good. Now break up the container for the candidate and check if all - // the dotted parts match up correctly. - var totalMatch = candidateMatch; - for (var i = dotSeparatedSegments.length - 2, j = candidateContainers.length - 1; i >= 0; i--, j--) { - var segment = dotSeparatedSegments[i]; - var containerName = candidateContainers[j]; - var containerMatch = matchSegment(containerName, segment); - if (!containerMatch) { - // This container didn't match the pattern piece. So there's no match at all. - return undefined; - } - ts.addRange(totalMatch, containerMatch); - } - // Success, this symbol's full name matched against the dotted name the user was asking - // about. - return totalMatch; - } - function getWordSpans(word) { - if (!ts.hasProperty(stringToWordSpans, word)) { - stringToWordSpans[word] = breakIntoWordSpans(word); - } - return stringToWordSpans[word]; - } - function matchTextChunk(candidate, chunk, punctuationStripped) { - var index = indexOfIgnoringCase(candidate, chunk.textLowerCase); - if (index === 0) { - if (chunk.text.length === candidate.length) { - // a) Check if the part matches the candidate entirely, in an case insensitive or - // sensitive manner. If it does, return that there was an exact match. - return createPatternMatch(PatternMatchKind.exact, punctuationStripped, candidate === chunk.text); - } - else { - // b) Check if the part is a prefix of the candidate, in a case insensitive or sensitive - // manner. If it does, return that there was a prefix match. - return createPatternMatch(PatternMatchKind.prefix, punctuationStripped, startsWith(candidate, chunk.text)); - } - } - var isLowercase = chunk.isLowerCase; - if (isLowercase) { - if (index > 0) { - // c) If the part is entirely lowercase, then check if it is contained anywhere in the - // candidate in a case insensitive manner. If so, return that there was a substring - // match. - // - // Note: We only have a substring match if the lowercase part is prefix match of some - // word part. That way we don't match something like 'Class' when the user types 'a'. - // But we would match 'FooAttribute' (since 'Attribute' starts with 'a'). - var wordSpans = getWordSpans(candidate); - for (var _i = 0; _i < wordSpans.length; _i++) { - var span = wordSpans[_i]; - if (partStartsWith(candidate, span, chunk.text, true)) { - return createPatternMatch(PatternMatchKind.substring, punctuationStripped, - /*isCaseSensitive:*/ partStartsWith(candidate, span, chunk.text, false)); - } - } - } - } - else { - // d) If the part was not entirely lowercase, then check if it is contained in the - // candidate in a case *sensitive* manner. If so, return that there was a substring - // match. - if (candidate.indexOf(chunk.text) > 0) { - return createPatternMatch(PatternMatchKind.substring, punctuationStripped, true); - } - } - if (!isLowercase) { - // e) If the part was not entirely lowercase, then attempt a camel cased match as well. - if (chunk.characterSpans.length > 0) { - var candidateParts = getWordSpans(candidate); - var camelCaseWeight = tryCamelCaseMatch(candidate, candidateParts, chunk, false); - if (camelCaseWeight !== undefined) { - return createPatternMatch(PatternMatchKind.camelCase, punctuationStripped, true, camelCaseWeight); - } - camelCaseWeight = tryCamelCaseMatch(candidate, candidateParts, chunk, true); - if (camelCaseWeight !== undefined) { - return createPatternMatch(PatternMatchKind.camelCase, punctuationStripped, false, camelCaseWeight); - } - } - } - if (isLowercase) { - // f) Is the pattern a substring of the candidate starting on one of the candidate's word boundaries? - // We could check every character boundary start of the candidate for the pattern. However, that's - // an m * n operation in the wost case. Instead, find the first instance of the pattern - // substring, and see if it starts on a capital letter. It seems unlikely that the user will try to - // filter the list based on a substring that starts on a capital letter and also with a lowercase one. - // (Pattern: fogbar, Candidate: quuxfogbarFogBar). - if (chunk.text.length < candidate.length) { - if (index > 0 && isUpperCaseLetter(candidate.charCodeAt(index))) { - return createPatternMatch(PatternMatchKind.substring, punctuationStripped, false); - } - } - } - return undefined; - } - function containsSpaceOrAsterisk(text) { - for (var i = 0; i < text.length; i++) { - var ch = text.charCodeAt(i); - if (ch === 32 /* space */ || ch === 42 /* asterisk */) { - return true; - } - } - return false; - } - function matchSegment(candidate, segment) { - // First check if the segment matches as is. This is also useful if the segment contains - // characters we would normally strip when splitting into parts that we also may want to - // match in the candidate. For example if the segment is "@int" and the candidate is - // "@int", then that will show up as an exact match here. - // - // Note: if the segment contains a space or an asterisk then we must assume that it's a - // multi-word segment. - if (!containsSpaceOrAsterisk(segment.totalTextChunk.text)) { - var match = matchTextChunk(candidate, segment.totalTextChunk, false); - if (match) { - return [match]; - } - } - // The logic for pattern matching is now as follows: - // - // 1) Break the segment passed in into words. Breaking is rather simple and a - // good way to think about it that if gives you all the individual alphanumeric words - // of the pattern. - // - // 2) For each word try to match the word against the candidate value. - // - // 3) Matching is as follows: - // - // a) Check if the word matches the candidate entirely, in an case insensitive or - // sensitive manner. If it does, return that there was an exact match. - // - // b) Check if the word is a prefix of the candidate, in a case insensitive or - // sensitive manner. If it does, return that there was a prefix match. - // - // c) If the word is entirely lowercase, then check if it is contained anywhere in the - // candidate in a case insensitive manner. If so, return that there was a substring - // match. - // - // Note: We only have a substring match if the lowercase part is prefix match of - // some word part. That way we don't match something like 'Class' when the user - // types 'a'. But we would match 'FooAttribute' (since 'Attribute' starts with - // 'a'). - // - // d) If the word was not entirely lowercase, then check if it is contained in the - // candidate in a case *sensitive* manner. If so, return that there was a substring - // match. - // - // e) If the word was not entirely lowercase, then attempt a camel cased match as - // well. - // - // f) The word is all lower case. Is it a case insensitive substring of the candidate starting - // on a part boundary of the candidate? - // - // Only if all words have some sort of match is the pattern considered matched. - var subWordTextChunks = segment.subWordTextChunks; - var matches = undefined; - for (var _i = 0; _i < subWordTextChunks.length; _i++) { - var subWordTextChunk = subWordTextChunks[_i]; - // Try to match the candidate with this word - var result = matchTextChunk(candidate, subWordTextChunk, true); - if (!result) { - return undefined; - } - matches = matches || []; - matches.push(result); - } - return matches; - } - function partStartsWith(candidate, candidateSpan, pattern, ignoreCase, patternSpan) { - var patternPartStart = patternSpan ? patternSpan.start : 0; - var patternPartLength = patternSpan ? patternSpan.length : pattern.length; - if (patternPartLength > candidateSpan.length) { - // Pattern part is longer than the candidate part. There can never be a match. - return false; - } - if (ignoreCase) { - for (var i = 0; i < patternPartLength; i++) { - var ch1 = pattern.charCodeAt(patternPartStart + i); - var ch2 = candidate.charCodeAt(candidateSpan.start + i); - if (toLowerCase(ch1) !== toLowerCase(ch2)) { - return false; - } - } - } - else { - for (var i = 0; i < patternPartLength; i++) { - var ch1 = pattern.charCodeAt(patternPartStart + i); - var ch2 = candidate.charCodeAt(candidateSpan.start + i); - if (ch1 !== ch2) { - return false; - } - } - } - return true; - } - function tryCamelCaseMatch(candidate, candidateParts, chunk, ignoreCase) { - var chunkCharacterSpans = chunk.characterSpans; - // Note: we may have more pattern parts than candidate parts. This is because multiple - // pattern parts may match a candidate part. For example "SiUI" against "SimpleUI". - // We'll have 3 pattern parts Si/U/I against two candidate parts Simple/UI. However, U - // and I will both match in UI. - var currentCandidate = 0; - var currentChunkSpan = 0; - var firstMatch = undefined; - var contiguous = undefined; - while (true) { - // Let's consider our termination cases - if (currentChunkSpan === chunkCharacterSpans.length) { - // We did match! We shall assign a weight to this - var weight = 0; - // Was this contiguous? - if (contiguous) { - weight += 1; - } - // Did we start at the beginning of the candidate? - if (firstMatch === 0) { - weight += 2; - } - return weight; - } - else if (currentCandidate === candidateParts.length) { - // No match, since we still have more of the pattern to hit - return undefined; - } - var candidatePart = candidateParts[currentCandidate]; - var gotOneMatchThisCandidate = false; - // Consider the case of matching SiUI against SimpleUIElement. The candidate parts - // will be Simple/UI/Element, and the pattern parts will be Si/U/I. We'll match 'Si' - // against 'Simple' first. Then we'll match 'U' against 'UI'. However, we want to - // still keep matching pattern parts against that candidate part. - for (; currentChunkSpan < chunkCharacterSpans.length; currentChunkSpan++) { - var chunkCharacterSpan = chunkCharacterSpans[currentChunkSpan]; - if (gotOneMatchThisCandidate) { - // We've already gotten one pattern part match in this candidate. We will - // only continue trying to consumer pattern parts if the last part and this - // part are both upper case. - if (!isUpperCaseLetter(chunk.text.charCodeAt(chunkCharacterSpans[currentChunkSpan - 1].start)) || - !isUpperCaseLetter(chunk.text.charCodeAt(chunkCharacterSpans[currentChunkSpan].start))) { - break; - } - } - if (!partStartsWith(candidate, candidatePart, chunk.text, ignoreCase, chunkCharacterSpan)) { - break; - } - gotOneMatchThisCandidate = true; - firstMatch = firstMatch === undefined ? currentCandidate : firstMatch; - // If we were contiguous, then keep that value. If we weren't, then keep that - // value. If we don't know, then set the value to 'true' as an initial match is - // obviously contiguous. - contiguous = contiguous === undefined ? true : contiguous; - candidatePart = ts.createTextSpan(candidatePart.start + chunkCharacterSpan.length, candidatePart.length - chunkCharacterSpan.length); - } - // Check if we matched anything at all. If we didn't, then we need to unset the - // contiguous bit if we currently had it set. - // If we haven't set the bit yet, then that means we haven't matched anything so - // far, and we don't want to change that. - if (!gotOneMatchThisCandidate && contiguous !== undefined) { - contiguous = false; - } - // Move onto the next candidate. - currentCandidate++; - } - } - } - ts.createPatternMatcher = createPatternMatcher; - // Helper function to compare two matches to determine which is better. Matches are first - // ordered by kind (so all prefix matches always beat all substring matches). Then, if the - // match is a camel case match, the relative weights of the match are used to determine - // which is better (with a greater weight being better). Then if the match is of the same - // type, then a case sensitive match is considered better than an insensitive one. - function patternMatchCompareTo(match1, match2) { - return compareType(match1, match2) || - compareCamelCase(match1, match2) || - compareCase(match1, match2) || - comparePunctuation(match1, match2); - } - function comparePunctuation(result1, result2) { - // Consider a match to be better if it was successful without stripping punctuation - // versus a match that had to strip punctuation to succeed. - if (result1.punctuationStripped !== result2.punctuationStripped) { - return result1.punctuationStripped ? 1 : -1; - } - return 0; - } - function compareCase(result1, result2) { - if (result1.isCaseSensitive !== result2.isCaseSensitive) { - return result1.isCaseSensitive ? -1 : 1; - } - return 0; - } - function compareType(result1, result2) { - return result1.kind - result2.kind; - } - function compareCamelCase(result1, result2) { - if (result1.kind === PatternMatchKind.camelCase && result2.kind === PatternMatchKind.camelCase) { - // Swap the values here. If result1 has a higher weight, then we want it to come - // first. - return result2.camelCaseWeight - result1.camelCaseWeight; - } - return 0; - } - function createSegment(text) { - return { - totalTextChunk: createTextChunk(text), - subWordTextChunks: breakPatternIntoTextChunks(text) - }; - } - // A segment is considered invalid if we couldn't find any words in it. - function segmentIsInvalid(segment) { - return segment.subWordTextChunks.length === 0; - } - function isUpperCaseLetter(ch) { - // Fast check for the ascii range. - if (ch >= 65 /* A */ && ch <= 90 /* Z */) { - return true; - } - if (ch < 127 /* maxAsciiCharacter */ || !ts.isUnicodeIdentifierStart(ch, 2 /* Latest */)) { - return false; - } - // TODO: find a way to determine this for any unicode characters in a - // non-allocating manner. - var str = String.fromCharCode(ch); - return str === str.toUpperCase(); - } - function isLowerCaseLetter(ch) { - // Fast check for the ascii range. - if (ch >= 97 /* a */ && ch <= 122 /* z */) { - return true; - } - if (ch < 127 /* maxAsciiCharacter */ || !ts.isUnicodeIdentifierStart(ch, 2 /* Latest */)) { - return false; - } - // TODO: find a way to determine this for any unicode characters in a - // non-allocating manner. - var str = String.fromCharCode(ch); - return str === str.toLowerCase(); - } - function containsUpperCaseLetter(string) { - for (var i = 0, n = string.length; i < n; i++) { - if (isUpperCaseLetter(string.charCodeAt(i))) { - return true; - } - } - return false; - } - function startsWith(string, search) { - for (var i = 0, n = search.length; i < n; i++) { - if (string.charCodeAt(i) !== search.charCodeAt(i)) { - return false; - } - } - return true; - } - // Assumes 'value' is already lowercase. - function indexOfIgnoringCase(string, value) { - for (var i = 0, n = string.length - value.length; i <= n; i++) { - if (startsWithIgnoringCase(string, value, i)) { - return i; - } - } - return -1; - } - // Assumes 'value' is already lowercase. - function startsWithIgnoringCase(string, value, start) { - for (var i = 0, n = value.length; i < n; i++) { - var ch1 = toLowerCase(string.charCodeAt(i + start)); - var ch2 = value.charCodeAt(i); - if (ch1 !== ch2) { - return false; - } - } - return true; - } - function toLowerCase(ch) { - // Fast convert for the ascii range. - if (ch >= 65 /* A */ && ch <= 90 /* Z */) { - return 97 /* a */ + (ch - 65 /* A */); - } - if (ch < 127 /* maxAsciiCharacter */) { - return ch; - } - // TODO: find a way to compute this for any unicode characters in a - // non-allocating manner. - return String.fromCharCode(ch).toLowerCase().charCodeAt(0); - } - function isDigit(ch) { - // TODO(cyrusn): Find a way to support this for unicode digits. - return ch >= 48 /* _0 */ && ch <= 57 /* _9 */; - } - function isWordChar(ch) { - return isUpperCaseLetter(ch) || isLowerCaseLetter(ch) || isDigit(ch) || ch === 95 /* _ */ || ch === 36 /* $ */; - } - function breakPatternIntoTextChunks(pattern) { - var result = []; - var wordStart = 0; - var wordLength = 0; - for (var i = 0; i < pattern.length; i++) { - var ch = pattern.charCodeAt(i); - if (isWordChar(ch)) { - if (wordLength++ === 0) { - wordStart = i; - } - } - else { - if (wordLength > 0) { - result.push(createTextChunk(pattern.substr(wordStart, wordLength))); - wordLength = 0; - } - } - } - if (wordLength > 0) { - result.push(createTextChunk(pattern.substr(wordStart, wordLength))); - } - return result; - } - function createTextChunk(text) { - var textLowerCase = text.toLowerCase(); - return { - text: text, - textLowerCase: textLowerCase, - isLowerCase: text === textLowerCase, - characterSpans: breakIntoCharacterSpans(text) - }; - } - /* @internal */ function breakIntoCharacterSpans(identifier) { - return breakIntoSpans(identifier, false); - } - ts.breakIntoCharacterSpans = breakIntoCharacterSpans; - /* @internal */ function breakIntoWordSpans(identifier) { - return breakIntoSpans(identifier, true); - } - ts.breakIntoWordSpans = breakIntoWordSpans; - function breakIntoSpans(identifier, word) { - var result = []; - var wordStart = 0; - for (var i = 1, n = identifier.length; i < n; i++) { - var lastIsDigit = isDigit(identifier.charCodeAt(i - 1)); - var currentIsDigit = isDigit(identifier.charCodeAt(i)); - var hasTransitionFromLowerToUpper = transitionFromLowerToUpper(identifier, word, i); - var hasTransitionFromUpperToLower = transitionFromUpperToLower(identifier, word, i, wordStart); - if (charIsPunctuation(identifier.charCodeAt(i - 1)) || - charIsPunctuation(identifier.charCodeAt(i)) || - lastIsDigit != currentIsDigit || - hasTransitionFromLowerToUpper || - hasTransitionFromUpperToLower) { - if (!isAllPunctuation(identifier, wordStart, i)) { - result.push(ts.createTextSpan(wordStart, i - wordStart)); - } - wordStart = i; - } - } - if (!isAllPunctuation(identifier, wordStart, identifier.length)) { - result.push(ts.createTextSpan(wordStart, identifier.length - wordStart)); - } - return result; - } - function charIsPunctuation(ch) { - switch (ch) { - case 33 /* exclamation */: - case 34 /* doubleQuote */: - case 35 /* hash */: - case 37 /* percent */: - case 38 /* ampersand */: - case 39 /* singleQuote */: - case 40 /* openParen */: - case 41 /* closeParen */: - case 42 /* asterisk */: - case 44 /* comma */: - case 45 /* minus */: - case 46 /* dot */: - case 47 /* slash */: - case 58 /* colon */: - case 59 /* semicolon */: - case 63 /* question */: - case 64 /* at */: - case 91 /* openBracket */: - case 92 /* backslash */: - case 93 /* closeBracket */: - case 95 /* _ */: - case 123 /* openBrace */: - case 125 /* closeBrace */: - return true; - } - return false; - } - function isAllPunctuation(identifier, start, end) { - for (var i = start; i < end; i++) { - var ch = identifier.charCodeAt(i); - // We don't consider _ or $ as punctuation as there may be things with that name. - if (!charIsPunctuation(ch) || ch === 95 /* _ */ || ch === 36 /* $ */) { - return false; - } - } - return true; - } - function transitionFromUpperToLower(identifier, word, index, wordStart) { - if (word) { - // Cases this supports: - // 1) IDisposable -> I, Disposable - // 2) UIElement -> UI, Element - // 3) HTMLDocument -> HTML, Document - // - // etc. - if (index != wordStart && - index + 1 < identifier.length) { - var currentIsUpper = isUpperCaseLetter(identifier.charCodeAt(index)); - var nextIsLower = isLowerCaseLetter(identifier.charCodeAt(index + 1)); - if (currentIsUpper && nextIsLower) { - // We have a transition from an upper to a lower letter here. But we only - // want to break if all the letters that preceded are uppercase. i.e. if we - // have "Foo" we don't want to break that into "F, oo". But if we have - // "IFoo" or "UIFoo", then we want to break that into "I, Foo" and "UI, - // Foo". i.e. the last uppercase letter belongs to the lowercase letters - // that follows. Note: this will make the following not split properly: - // "HELLOthere". However, these sorts of names do not show up in .Net - // programs. - for (var i = wordStart; i < index; i++) { - if (!isUpperCaseLetter(identifier.charCodeAt(i))) { - return false; - } - } - return true; - } - } - } - return false; - } - function transitionFromLowerToUpper(identifier, word, index) { - var lastIsUpper = isUpperCaseLetter(identifier.charCodeAt(index - 1)); - var currentIsUpper = isUpperCaseLetter(identifier.charCodeAt(index)); - // See if the casing indicates we're starting a new word. Note: if we're breaking on - // words, then just seeing an upper case character isn't enough. Instead, it has to - // be uppercase and the previous character can't be uppercase. - // - // For example, breaking "AddMetadata" on words would make: Add Metadata - // - // on characters would be: A dd M etadata - // - // Break "AM" on words would be: AM - // - // on characters would be: A M - // - // We break the search string on characters. But we break the symbol name on words. - var transition = word - ? (currentIsUpper && !lastIsUpper) - : currentIsUpper; - return transition; - } -})(ts || (ts = {})); -/// -/* @internal */ -var ts; -(function (ts) { - var SignatureHelp; - (function (SignatureHelp) { - // A partially written generic type expression is not guaranteed to have the correct syntax tree. the expression could be parsed as less than/greater than expression or a comma expression - // or some other combination depending on what the user has typed so far. For the purposes of signature help we need to consider any location after "<" as a possible generic type reference. - // To do this, the method will back parse the expression starting at the position required. it will try to parse the current expression as a generic type expression, if it did succeed it - // will return the generic identifier that started the expression (e.g. "foo" in "foo(#a, b) -> The token introduces a list, and should begin a sig help session - // Case 2: - // fo#o#(a, b)# -> The token is either not associated with a list, or ends a list, so the session should end - // Case 3: - // foo(a#, #b#) -> The token is buried inside a list, and should give sig help - // Find out if 'node' is an argument, a type argument, or neither - if (node.kind === 24 /* LessThanToken */ || - node.kind === 16 /* OpenParenToken */) { - // Find the list that starts right *after* the < or ( token. - // If the user has just opened a list, consider this item 0. - var list = getChildListThatStartsWithOpenerToken(callExpression, node, sourceFile); - var isTypeArgList = callExpression.typeArguments && callExpression.typeArguments.pos === list.pos; - ts.Debug.assert(list !== undefined); - return { - kind: isTypeArgList ? 0 /* TypeArguments */ : 1 /* CallArguments */, - invocation: callExpression, - argumentsSpan: getApplicableSpanForArguments(list), - argumentIndex: 0, - argumentCount: getArgumentCount(list) - }; - } - // findListItemInfo can return undefined if we are not in parent's argument list - // or type argument list. This includes cases where the cursor is: - // - To the right of the closing paren, non-substitution template, or template tail. - // - Between the type arguments and the arguments (greater than token) - // - On the target of the call (parent.func) - // - On the 'new' keyword in a 'new' expression - var listItemInfo = ts.findListItemInfo(node); - if (listItemInfo) { - var list = listItemInfo.list; - var isTypeArgList = callExpression.typeArguments && callExpression.typeArguments.pos === list.pos; - var argumentIndex = getArgumentIndex(list, node); - var argumentCount = getArgumentCount(list); - ts.Debug.assert(argumentIndex === 0 || argumentIndex < argumentCount, "argumentCount < argumentIndex, " + argumentCount + " < " + argumentIndex); - return { - kind: isTypeArgList ? 0 /* TypeArguments */ : 1 /* CallArguments */, - invocation: callExpression, - argumentsSpan: getApplicableSpanForArguments(list), - argumentIndex: argumentIndex, - argumentCount: argumentCount - }; - } - } - else if (node.kind === 10 /* NoSubstitutionTemplateLiteral */ && node.parent.kind === 162 /* TaggedTemplateExpression */) { - // Check if we're actually inside the template; - // otherwise we'll fall out and return undefined. - if (ts.isInsideTemplateLiteral(node, position)) { - return getArgumentListInfoForTemplate(node.parent, 0); - } - } - else if (node.kind === 11 /* TemplateHead */ && node.parent.parent.kind === 162 /* TaggedTemplateExpression */) { - var templateExpression = node.parent; - var tagExpression = templateExpression.parent; - ts.Debug.assert(templateExpression.kind === 174 /* TemplateExpression */); - var argumentIndex = ts.isInsideTemplateLiteral(node, position) ? 0 : 1; - return getArgumentListInfoForTemplate(tagExpression, argumentIndex); - } - else if (node.parent.kind === 180 /* TemplateSpan */ && node.parent.parent.parent.kind === 162 /* TaggedTemplateExpression */) { - var templateSpan = node.parent; - var templateExpression = templateSpan.parent; - var tagExpression = templateExpression.parent; - ts.Debug.assert(templateExpression.kind === 174 /* TemplateExpression */); - // If we're just after a template tail, don't show signature help. - if (node.kind === 13 /* TemplateTail */ && !ts.isInsideTemplateLiteral(node, position)) { - return undefined; - } - var spanIndex = templateExpression.templateSpans.indexOf(templateSpan); - var argumentIndex = getArgumentIndexForTemplatePiece(spanIndex, node); - return getArgumentListInfoForTemplate(tagExpression, argumentIndex); - } - return undefined; - } - function getArgumentIndex(argumentsList, node) { - // The list we got back can include commas. In the presence of errors it may - // also just have nodes without commas. For example "Foo(a b c)" will have 3 - // args without commas. We want to find what index we're at. So we count - // forward until we hit ourselves, only incrementing the index if it isn't a - // comma. - // - // Note: the subtlety around trailing commas (in getArgumentCount) does not apply - // here. That's because we're only walking forward until we hit the node we're - // on. In that case, even if we're after the trailing comma, we'll still see - // that trailing comma in the list, and we'll have generated the appropriate - // arg index. - var argumentIndex = 0; - var listChildren = argumentsList.getChildren(); - for (var _i = 0; _i < listChildren.length; _i++) { - var child = listChildren[_i]; - if (child === node) { - break; - } - if (child.kind !== 23 /* CommaToken */) { - argumentIndex++; - } - } - return argumentIndex; - } - function getArgumentCount(argumentsList) { - // The argument count for a list is normally the number of non-comma children it has. - // For example, if you have "Foo(a,b)" then there will be three children of the arg - // list 'a' '' 'b'. So, in this case the arg count will be 2. However, there - // is a small subtlety. If you have "Foo(a,)", then the child list will just have - // 'a' ''. So, in the case where the last child is a comma, we increase the - // arg count by one to compensate. - // - // Note: this subtlety only applies to the last comma. If you had "Foo(a,," then - // we'll have: 'a' '' '' - // That will give us 2 non-commas. We then add one for the last comma, givin us an - // arg count of 3. - var listChildren = argumentsList.getChildren(); - var argumentCount = ts.countWhere(listChildren, function (arg) { return arg.kind !== 23 /* CommaToken */; }); - if (listChildren.length > 0 && ts.lastOrUndefined(listChildren).kind === 23 /* CommaToken */) { - argumentCount++; - } - return argumentCount; - } - // spanIndex is either the index for a given template span. - // This does not give appropriate results for a NoSubstitutionTemplateLiteral - function getArgumentIndexForTemplatePiece(spanIndex, node) { - // Because the TemplateStringsArray is the first argument, we have to offset each substitution expression by 1. - // There are three cases we can encounter: - // 1. We are precisely in the template literal (argIndex = 0). - // 2. We are in or to the right of the substitution expression (argIndex = spanIndex + 1). - // 3. We are directly to the right of the template literal, but because we look for the token on the left, - // not enough to put us in the substitution expression; we should consider ourselves part of - // the *next* span's expression by offsetting the index (argIndex = (spanIndex + 1) + 1). - // - // Example: f `# abcd $#{# 1 + 1# }# efghi ${ #"#hello"# } # ` - // ^ ^ ^ ^ ^ ^ ^ ^ ^ - // Case: 1 1 3 2 1 3 2 2 1 - ts.Debug.assert(position >= node.getStart(), "Assumed 'position' could not occur before node."); - if (ts.isTemplateLiteralKind(node.kind)) { - if (ts.isInsideTemplateLiteral(node, position)) { - return 0; - } - return spanIndex + 2; - } - return spanIndex + 1; - } - function getArgumentListInfoForTemplate(tagExpression, argumentIndex) { - // argumentCount is either 1 or (numSpans + 1) to account for the template strings array argument. - var argumentCount = tagExpression.template.kind === 10 /* NoSubstitutionTemplateLiteral */ - ? 1 - : tagExpression.template.templateSpans.length + 1; - ts.Debug.assert(argumentIndex === 0 || argumentIndex < argumentCount, "argumentCount < argumentIndex, " + argumentCount + " < " + argumentIndex); - return { - kind: 2 /* TaggedTemplateArguments */, - invocation: tagExpression, - argumentsSpan: getApplicableSpanForTaggedTemplate(tagExpression), - argumentIndex: argumentIndex, - argumentCount: argumentCount - }; - } - function getApplicableSpanForArguments(argumentsList) { - // We use full start and skip trivia on the end because we want to include trivia on - // both sides. For example, - // - // foo( /*comment */ a, b, c /*comment*/ ) - // | | - // - // The applicable span is from the first bar to the second bar (inclusive, - // but not including parentheses) - var applicableSpanStart = argumentsList.getFullStart(); - var applicableSpanEnd = ts.skipTrivia(sourceFile.text, argumentsList.getEnd(), false); - return ts.createTextSpan(applicableSpanStart, applicableSpanEnd - applicableSpanStart); - } - function getApplicableSpanForTaggedTemplate(taggedTemplate) { - var template = taggedTemplate.template; - var applicableSpanStart = template.getStart(); - var applicableSpanEnd = template.getEnd(); - // We need to adjust the end position for the case where the template does not have a tail. - // Otherwise, we will not show signature help past the expression. - // For example, - // - // ` ${ 1 + 1 foo(10) - // | | - // - // This is because a Missing node has no width. However, what we actually want is to include trivia - // leading up to the next token in case the user is about to type in a TemplateMiddle or TemplateTail. - if (template.kind === 174 /* TemplateExpression */) { - var lastSpan = ts.lastOrUndefined(template.templateSpans); - if (lastSpan.literal.getFullWidth() === 0) { - applicableSpanEnd = ts.skipTrivia(sourceFile.text, applicableSpanEnd, false); - } - } - return ts.createTextSpan(applicableSpanStart, applicableSpanEnd - applicableSpanStart); - } - function getContainingArgumentInfo(node) { - for (var n = node; n.kind !== 230 /* SourceFile */; n = n.parent) { - if (ts.isFunctionBlock(n)) { - return undefined; - } - // If the node is not a subspan of its parent, this is a big problem. - // There have been crashes that might be caused by this violation. - if (n.pos < n.parent.pos || n.end > n.parent.end) { - ts.Debug.fail("Node of kind " + n.kind + " is not a subspan of its parent of kind " + n.parent.kind); - } - var argumentInfo_1 = getImmediatelyContainingArgumentInfo(n); - if (argumentInfo_1) { - return argumentInfo_1; - } - } - return undefined; - } - function getChildListThatStartsWithOpenerToken(parent, openerToken, sourceFile) { - var children = parent.getChildren(sourceFile); - var indexOfOpenerToken = children.indexOf(openerToken); - ts.Debug.assert(indexOfOpenerToken >= 0 && children.length > indexOfOpenerToken + 1); - return children[indexOfOpenerToken + 1]; - } - /** - * The selectedItemIndex could be negative for several reasons. - * 1. There are too many arguments for all of the overloads - * 2. None of the overloads were type compatible - * The solution here is to try to pick the best overload by picking - * either the first one that has an appropriate number of parameters, - * or the one with the most parameters. - */ - function selectBestInvalidOverloadIndex(candidates, argumentCount) { - var maxParamsSignatureIndex = -1; - var maxParams = -1; - for (var i = 0; i < candidates.length; i++) { - var candidate = candidates[i]; - if (candidate.hasRestParameter || candidate.parameters.length >= argumentCount) { - return i; - } - if (candidate.parameters.length > maxParams) { - maxParams = candidate.parameters.length; - maxParamsSignatureIndex = i; - } - } - return maxParamsSignatureIndex; - } - function createSignatureHelpItems(candidates, bestSignature, argumentListInfo) { - var applicableSpan = argumentListInfo.argumentsSpan; - var isTypeParameterList = argumentListInfo.kind === 0 /* TypeArguments */; - var invocation = argumentListInfo.invocation; - var callTarget = ts.getInvokedExpression(invocation); - var callTargetSymbol = typeChecker.getSymbolAtLocation(callTarget); - var callTargetDisplayParts = callTargetSymbol && ts.symbolToDisplayParts(typeChecker, callTargetSymbol, undefined, undefined); - var items = ts.map(candidates, function (candidateSignature) { - var signatureHelpParameters; - var prefixDisplayParts = []; - var suffixDisplayParts = []; - if (callTargetDisplayParts) { - prefixDisplayParts.push.apply(prefixDisplayParts, callTargetDisplayParts); - } - if (isTypeParameterList) { - prefixDisplayParts.push(ts.punctuationPart(24 /* LessThanToken */)); - var typeParameters = candidateSignature.typeParameters; - signatureHelpParameters = typeParameters && typeParameters.length > 0 ? ts.map(typeParameters, createSignatureHelpParameterForTypeParameter) : emptyArray; - suffixDisplayParts.push(ts.punctuationPart(25 /* GreaterThanToken */)); - var parameterParts = ts.mapToDisplayParts(function (writer) { - return typeChecker.getSymbolDisplayBuilder().buildDisplayForParametersAndDelimiters(candidateSignature.parameters, writer, invocation); - }); - suffixDisplayParts.push.apply(suffixDisplayParts, parameterParts); - } - else { - var typeParameterParts = ts.mapToDisplayParts(function (writer) { - return typeChecker.getSymbolDisplayBuilder().buildDisplayForTypeParametersAndDelimiters(candidateSignature.typeParameters, writer, invocation); - }); - prefixDisplayParts.push.apply(prefixDisplayParts, typeParameterParts); - prefixDisplayParts.push(ts.punctuationPart(16 /* OpenParenToken */)); - var parameters = candidateSignature.parameters; - signatureHelpParameters = parameters.length > 0 ? ts.map(parameters, createSignatureHelpParameterForParameter) : emptyArray; - suffixDisplayParts.push(ts.punctuationPart(17 /* CloseParenToken */)); - } - var returnTypeParts = ts.mapToDisplayParts(function (writer) { - return typeChecker.getSymbolDisplayBuilder().buildReturnTypeDisplay(candidateSignature, writer, invocation); - }); - suffixDisplayParts.push.apply(suffixDisplayParts, returnTypeParts); - return { - isVariadic: candidateSignature.hasRestParameter, - prefixDisplayParts: prefixDisplayParts, - suffixDisplayParts: suffixDisplayParts, - separatorDisplayParts: [ts.punctuationPart(23 /* CommaToken */), ts.spacePart()], - parameters: signatureHelpParameters, - documentation: candidateSignature.getDocumentationComment() - }; - }); - var argumentIndex = argumentListInfo.argumentIndex; - // argumentCount is the *apparent* number of arguments. - var argumentCount = argumentListInfo.argumentCount; - var selectedItemIndex = candidates.indexOf(bestSignature); - if (selectedItemIndex < 0) { - selectedItemIndex = selectBestInvalidOverloadIndex(candidates, argumentCount); - } - ts.Debug.assert(argumentIndex === 0 || argumentIndex < argumentCount, "argumentCount < argumentIndex, " + argumentCount + " < " + argumentIndex); - return { - items: items, - applicableSpan: applicableSpan, - selectedItemIndex: selectedItemIndex, - argumentIndex: argumentIndex, - argumentCount: argumentCount - }; - function createSignatureHelpParameterForParameter(parameter) { - var displayParts = ts.mapToDisplayParts(function (writer) { - return typeChecker.getSymbolDisplayBuilder().buildParameterDisplay(parameter, writer, invocation); - }); - var isOptional = ts.hasQuestionToken(parameter.valueDeclaration); - return { - name: parameter.name, - documentation: parameter.getDocumentationComment(), - displayParts: displayParts, - isOptional: isOptional - }; - } - function createSignatureHelpParameterForTypeParameter(typeParameter) { - var displayParts = ts.mapToDisplayParts(function (writer) { - return typeChecker.getSymbolDisplayBuilder().buildTypeParameterDisplay(typeParameter, writer, invocation); - }); - return { - name: typeParameter.symbol.name, - documentation: emptyArray, - displayParts: displayParts, - isOptional: false - }; - } - } - } - SignatureHelp.getSignatureHelpItems = getSignatureHelpItems; - })(SignatureHelp = ts.SignatureHelp || (ts.SignatureHelp = {})); -})(ts || (ts = {})); -// These utilities are common to multiple language service features. -/* @internal */ -var ts; -(function (ts) { - function getEndLinePosition(line, sourceFile) { - ts.Debug.assert(line >= 0); - var lineStarts = sourceFile.getLineStarts(); - var lineIndex = line; - if (lineIndex + 1 === lineStarts.length) { - // last line - return EOF - return sourceFile.text.length - 1; - } - else { - // current line start - var start = lineStarts[lineIndex]; - // take the start position of the next line -1 = it should be some line break - var pos = lineStarts[lineIndex + 1] - 1; - ts.Debug.assert(ts.isLineBreak(sourceFile.text.charCodeAt(pos))); - // walk backwards skipping line breaks, stop the the beginning of current line. - // i.e: - // - // $ <- end of line for this position should match the start position - while (start <= pos && ts.isLineBreak(sourceFile.text.charCodeAt(pos))) { - pos--; - } - return pos; - } - } - ts.getEndLinePosition = getEndLinePosition; - function getLineStartPositionForPosition(position, sourceFile) { - var lineStarts = sourceFile.getLineStarts(); - var line = sourceFile.getLineAndCharacterOfPosition(position).line; - return lineStarts[line]; - } - ts.getLineStartPositionForPosition = getLineStartPositionForPosition; - function rangeContainsRange(r1, r2) { - return startEndContainsRange(r1.pos, r1.end, r2); - } - ts.rangeContainsRange = rangeContainsRange; - function startEndContainsRange(start, end, range) { - return start <= range.pos && end >= range.end; - } - ts.startEndContainsRange = startEndContainsRange; - function rangeContainsStartEnd(range, start, end) { - return range.pos <= start && range.end >= end; - } - ts.rangeContainsStartEnd = rangeContainsStartEnd; - function rangeOverlapsWithStartEnd(r1, start, end) { - return startEndOverlapsWithStartEnd(r1.pos, r1.end, start, end); - } - ts.rangeOverlapsWithStartEnd = rangeOverlapsWithStartEnd; - function startEndOverlapsWithStartEnd(start1, end1, start2, end2) { - var start = Math.max(start1, start2); - var end = Math.min(end1, end2); - return start < end; - } - ts.startEndOverlapsWithStartEnd = startEndOverlapsWithStartEnd; - function positionBelongsToNode(candidate, position, sourceFile) { - return candidate.end > position || !isCompletedNode(candidate, sourceFile); - } - ts.positionBelongsToNode = positionBelongsToNode; - function isCompletedNode(n, sourceFile) { - if (ts.nodeIsMissing(n)) { - return false; - } - switch (n.kind) { - case 204 /* ClassDeclaration */: - case 205 /* InterfaceDeclaration */: - case 207 /* EnumDeclaration */: - case 157 /* ObjectLiteralExpression */: - case 153 /* ObjectBindingPattern */: - case 148 /* TypeLiteral */: - case 182 /* Block */: - case 209 /* ModuleBlock */: - case 210 /* CaseBlock */: - return nodeEndsWith(n, 15 /* CloseBraceToken */, sourceFile); - case 226 /* CatchClause */: - return isCompletedNode(n.block, sourceFile); - case 161 /* NewExpression */: - if (!n.arguments) { - return true; - } - // fall through - case 160 /* CallExpression */: - case 164 /* ParenthesizedExpression */: - case 152 /* ParenthesizedType */: - return nodeEndsWith(n, 17 /* CloseParenToken */, sourceFile); - case 145 /* FunctionType */: - case 146 /* ConstructorType */: - return isCompletedNode(n.type, sourceFile); - case 137 /* Constructor */: - case 138 /* GetAccessor */: - case 139 /* SetAccessor */: - case 203 /* FunctionDeclaration */: - case 165 /* FunctionExpression */: - case 136 /* MethodDeclaration */: - case 135 /* MethodSignature */: - case 141 /* ConstructSignature */: - case 140 /* CallSignature */: - case 166 /* ArrowFunction */: - if (n.body) { - return isCompletedNode(n.body, sourceFile); - } - if (n.type) { - return isCompletedNode(n.type, sourceFile); - } - // Even though type parameters can be unclosed, we can get away with - // having at least a closing paren. - return hasChildOfKind(n, 17 /* CloseParenToken */, sourceFile); - case 208 /* ModuleDeclaration */: - return n.body && isCompletedNode(n.body, sourceFile); - case 186 /* IfStatement */: - if (n.elseStatement) { - return isCompletedNode(n.elseStatement, sourceFile); - } - return isCompletedNode(n.thenStatement, sourceFile); - case 185 /* ExpressionStatement */: - return isCompletedNode(n.expression, sourceFile); - case 156 /* ArrayLiteralExpression */: - case 154 /* ArrayBindingPattern */: - case 159 /* ElementAccessExpression */: - case 129 /* ComputedPropertyName */: - case 150 /* TupleType */: - return nodeEndsWith(n, 19 /* CloseBracketToken */, sourceFile); - case 142 /* IndexSignature */: - if (n.type) { - return isCompletedNode(n.type, sourceFile); - } - return hasChildOfKind(n, 19 /* CloseBracketToken */, sourceFile); - case 223 /* CaseClause */: - case 224 /* DefaultClause */: - // there is no such thing as terminator token for CaseClause/DefaultClause so for simplicitly always consider them non-completed - return false; - case 189 /* ForStatement */: - case 190 /* ForInStatement */: - case 191 /* ForOfStatement */: - case 188 /* WhileStatement */: - return isCompletedNode(n.statement, sourceFile); - case 187 /* DoStatement */: - // rough approximation: if DoStatement has While keyword - then if node is completed is checking the presence of ')'; - var hasWhileKeyword = findChildOfKind(n, 100 /* WhileKeyword */, sourceFile); - if (hasWhileKeyword) { - return nodeEndsWith(n, 17 /* CloseParenToken */, sourceFile); - } - return isCompletedNode(n.statement, sourceFile); - case 147 /* TypeQuery */: - return isCompletedNode(n.exprName, sourceFile); - case 168 /* TypeOfExpression */: - case 167 /* DeleteExpression */: - case 169 /* VoidExpression */: - case 175 /* YieldExpression */: - case 176 /* SpreadElementExpression */: - var unaryWordExpression = n; - return isCompletedNode(unaryWordExpression.expression, sourceFile); - case 162 /* TaggedTemplateExpression */: - return isCompletedNode(n.template, sourceFile); - case 174 /* TemplateExpression */: - var lastSpan = ts.lastOrUndefined(n.templateSpans); - return isCompletedNode(lastSpan, sourceFile); - case 180 /* TemplateSpan */: - return ts.nodeIsPresent(n.literal); - case 170 /* PrefixUnaryExpression */: - return isCompletedNode(n.operand, sourceFile); - case 172 /* BinaryExpression */: - return isCompletedNode(n.right, sourceFile); - case 173 /* ConditionalExpression */: - return isCompletedNode(n.whenFalse, sourceFile); - default: - return true; - } - } - ts.isCompletedNode = isCompletedNode; - /* - * Checks if node ends with 'expectedLastToken'. - * If child at position 'length - 1' is 'SemicolonToken' it is skipped and 'expectedLastToken' is compared with child at position 'length - 2'. - */ - function nodeEndsWith(n, expectedLastToken, sourceFile) { - var children = n.getChildren(sourceFile); - if (children.length) { - var last = ts.lastOrUndefined(children); - if (last.kind === expectedLastToken) { - return true; - } - else if (last.kind === 22 /* SemicolonToken */ && children.length !== 1) { - return children[children.length - 2].kind === expectedLastToken; - } - } - return false; - } - function findListItemInfo(node) { - var list = findContainingList(node); - // It is possible at this point for syntaxList to be undefined, either if - // node.parent had no list child, or if none of its list children contained - // the span of node. If this happens, return undefined. The caller should - // handle this case. - if (!list) { - return undefined; - } - var children = list.getChildren(); - var listItemIndex = ts.indexOf(children, node); - return { - listItemIndex: listItemIndex, - list: list - }; - } - ts.findListItemInfo = findListItemInfo; - function hasChildOfKind(n, kind, sourceFile) { - return !!findChildOfKind(n, kind, sourceFile); - } - ts.hasChildOfKind = hasChildOfKind; - function findChildOfKind(n, kind, sourceFile) { - return ts.forEach(n.getChildren(sourceFile), function (c) { return c.kind === kind && c; }); - } - ts.findChildOfKind = findChildOfKind; - function findContainingList(node) { - // The node might be a list element (nonsynthetic) or a comma (synthetic). Either way, it will - // be parented by the container of the SyntaxList, not the SyntaxList itself. - // In order to find the list item index, we first need to locate SyntaxList itself and then search - // for the position of the relevant node (or comma). - var syntaxList = ts.forEach(node.parent.getChildren(), function (c) { - // find syntax list that covers the span of the node - if (c.kind === 253 /* SyntaxList */ && c.pos <= node.pos && c.end >= node.end) { - return c; - } - }); - // Either we didn't find an appropriate list, or the list must contain us. - ts.Debug.assert(!syntaxList || ts.contains(syntaxList.getChildren(), node)); - return syntaxList; - } - ts.findContainingList = findContainingList; - /* Gets the token whose text has range [start, end) and - * position >= start and (position < end or (position === end && token is keyword or identifier)) - */ - function getTouchingWord(sourceFile, position) { - return getTouchingToken(sourceFile, position, function (n) { return isWord(n.kind); }); - } - ts.getTouchingWord = getTouchingWord; - /* Gets the token whose text has range [start, end) and position >= start - * and (position < end or (position === end && token is keyword or identifier or numeric\string litera)) - */ - function getTouchingPropertyName(sourceFile, position) { - return getTouchingToken(sourceFile, position, function (n) { return isPropertyName(n.kind); }); - } - ts.getTouchingPropertyName = getTouchingPropertyName; - /** Returns the token if position is in [start, end) or if position === end and includeItemAtEndPosition(token) === true */ - function getTouchingToken(sourceFile, position, includeItemAtEndPosition) { - return getTokenAtPositionWorker(sourceFile, position, false, includeItemAtEndPosition); - } - ts.getTouchingToken = getTouchingToken; - /** Returns a token if position is in [start-of-leading-trivia, end) */ - function getTokenAtPosition(sourceFile, position) { - return getTokenAtPositionWorker(sourceFile, position, true, undefined); - } - ts.getTokenAtPosition = getTokenAtPosition; - /** Get the token whose text contains the position */ - function getTokenAtPositionWorker(sourceFile, position, allowPositionInLeadingTrivia, includeItemAtEndPosition) { - var current = sourceFile; - outer: while (true) { - if (isToken(current)) { - // exit early - return current; - } - // find the child that contains 'position' - for (var i = 0, n = current.getChildCount(sourceFile); i < n; i++) { - var child = current.getChildAt(i); - var start = allowPositionInLeadingTrivia ? child.getFullStart() : child.getStart(sourceFile); - if (start <= position) { - var end = child.getEnd(); - if (position < end || (position === end && child.kind === 1 /* EndOfFileToken */)) { - current = child; - continue outer; - } - else if (includeItemAtEndPosition && end === position) { - var previousToken = findPrecedingToken(position, sourceFile, child); - if (previousToken && includeItemAtEndPosition(previousToken)) { - return previousToken; - } - } - } - } - return current; - } - } - /** - * The token on the left of the position is the token that strictly includes the position - * or sits to the left of the cursor if it is on a boundary. For example - * - * fo|o -> will return foo - * foo |bar -> will return foo - * - */ - function findTokenOnLeftOfPosition(file, position) { - // Ideally, getTokenAtPosition should return a token. However, it is currently - // broken, so we do a check to make sure the result was indeed a token. - var tokenAtPosition = getTokenAtPosition(file, position); - if (isToken(tokenAtPosition) && position > tokenAtPosition.getStart(file) && position < tokenAtPosition.getEnd()) { - return tokenAtPosition; - } - return findPrecedingToken(position, file); - } - ts.findTokenOnLeftOfPosition = findTokenOnLeftOfPosition; - function findNextToken(previousToken, parent) { - return find(parent); - function find(n) { - if (isToken(n) && n.pos === previousToken.end) { - // this is token that starts at the end of previous token - return it - return n; - } - var children = n.getChildren(); - for (var _i = 0; _i < children.length; _i++) { - var child = children[_i]; - var shouldDiveInChildNode = - // previous token is enclosed somewhere in the child - (child.pos <= previousToken.pos && child.end > previousToken.end) || - // previous token ends exactly at the beginning of child - (child.pos === previousToken.end); - if (shouldDiveInChildNode && nodeHasTokens(child)) { - return find(child); - } - } - return undefined; - } - } - ts.findNextToken = findNextToken; - function findPrecedingToken(position, sourceFile, startNode) { - return find(startNode || sourceFile); - function findRightmostToken(n) { - if (isToken(n)) { - return n; - } - var children = n.getChildren(); - var candidate = findRightmostChildNodeWithTokens(children, children.length); - return candidate && findRightmostToken(candidate); - } - function find(n) { - if (isToken(n)) { - return n; - } - var children = n.getChildren(); - for (var i = 0, len = children.length; i < len; i++) { - var child = children[i]; - if (nodeHasTokens(child)) { - if (position <= child.end) { - if (child.getStart(sourceFile) >= position) { - // actual start of the node is past the position - previous token should be at the end of previous child - var candidate = findRightmostChildNodeWithTokens(children, i); - return candidate && findRightmostToken(candidate); - } - else { - // candidate should be in this node - return find(child); - } - } - } - } - ts.Debug.assert(startNode !== undefined || n.kind === 230 /* SourceFile */); - // Here we know that none of child token nodes embrace the position, - // the only known case is when position is at the end of the file. - // Try to find the rightmost token in the file without filtering. - // Namely we are skipping the check: 'position < node.end' - if (children.length) { - var candidate = findRightmostChildNodeWithTokens(children, children.length); - return candidate && findRightmostToken(candidate); - } - } - /// finds last node that is considered as candidate for search (isCandidate(node) === true) starting from 'exclusiveStartPosition' - function findRightmostChildNodeWithTokens(children, exclusiveStartPosition) { - for (var i = exclusiveStartPosition - 1; i >= 0; --i) { - if (nodeHasTokens(children[i])) { - return children[i]; - } - } - } - } - ts.findPrecedingToken = findPrecedingToken; - function nodeHasTokens(n) { - // If we have a token or node that has a non-zero width, it must have tokens. - // Note, that getWidth() does not take trivia into account. - return n.getWidth() !== 0; - } - function getNodeModifiers(node) { - var flags = ts.getCombinedNodeFlags(node); - var result = []; - if (flags & 32 /* Private */) - result.push(ts.ScriptElementKindModifier.privateMemberModifier); - if (flags & 64 /* Protected */) - result.push(ts.ScriptElementKindModifier.protectedMemberModifier); - if (flags & 16 /* Public */) - result.push(ts.ScriptElementKindModifier.publicMemberModifier); - if (flags & 128 /* Static */) - result.push(ts.ScriptElementKindModifier.staticModifier); - if (flags & 1 /* Export */) - result.push(ts.ScriptElementKindModifier.exportedModifier); - if (ts.isInAmbientContext(node)) - result.push(ts.ScriptElementKindModifier.ambientModifier); - return result.length > 0 ? result.join(',') : ts.ScriptElementKindModifier.none; - } - ts.getNodeModifiers = getNodeModifiers; - function getTypeArgumentOrTypeParameterList(node) { - if (node.kind === 144 /* TypeReference */ || node.kind === 160 /* CallExpression */) { - return node.typeArguments; - } - if (ts.isFunctionLike(node) || node.kind === 204 /* ClassDeclaration */ || node.kind === 205 /* InterfaceDeclaration */) { - return node.typeParameters; - } - return undefined; - } - ts.getTypeArgumentOrTypeParameterList = getTypeArgumentOrTypeParameterList; - function isToken(n) { - return n.kind >= 0 /* FirstToken */ && n.kind <= 127 /* LastToken */; - } - ts.isToken = isToken; - function isWord(kind) { - return kind === 65 /* Identifier */ || ts.isKeyword(kind); - } - ts.isWord = isWord; - function isPropertyName(kind) { - return kind === 8 /* StringLiteral */ || kind === 7 /* NumericLiteral */ || isWord(kind); - } - function isComment(kind) { - return kind === 2 /* SingleLineCommentTrivia */ || kind === 3 /* MultiLineCommentTrivia */; - } - ts.isComment = isComment; - function isPunctuation(kind) { - return 14 /* FirstPunctuation */ <= kind && kind <= 64 /* LastPunctuation */; - } - ts.isPunctuation = isPunctuation; - function isInsideTemplateLiteral(node, position) { - return ts.isTemplateLiteralKind(node.kind) - && (node.getStart() < position && position < node.getEnd()) || (!!node.isUnterminated && position === node.getEnd()); - } - ts.isInsideTemplateLiteral = isInsideTemplateLiteral; - function isAccessibilityModifier(kind) { - switch (kind) { - case 108 /* PublicKeyword */: - case 106 /* PrivateKeyword */: - case 107 /* ProtectedKeyword */: - return true; - } - return false; - } - ts.isAccessibilityModifier = isAccessibilityModifier; - function compareDataObjects(dst, src) { - for (var e in dst) { - if (typeof dst[e] === "object") { - if (!compareDataObjects(dst[e], src[e])) { - return false; - } - } - else if (typeof dst[e] !== "function") { - if (dst[e] !== src[e]) { - return false; - } - } - } - return true; - } - ts.compareDataObjects = compareDataObjects; -})(ts || (ts = {})); -// Display-part writer helpers -/* @internal */ -var ts; -(function (ts) { - function isFirstDeclarationOfSymbolParameter(symbol) { - return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 131 /* Parameter */; - } - ts.isFirstDeclarationOfSymbolParameter = isFirstDeclarationOfSymbolParameter; - var displayPartWriter = getDisplayPartWriter(); - function getDisplayPartWriter() { - var displayParts; - var lineStart; - var indent; - resetWriter(); - return { - displayParts: function () { return displayParts; }, - writeKeyword: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.keyword); }, - writeOperator: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.operator); }, - writePunctuation: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.punctuation); }, - writeSpace: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.space); }, - writeStringLiteral: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.stringLiteral); }, - writeParameter: function (text) { return writeKind(text, ts.SymbolDisplayPartKind.parameterName); }, - writeSymbol: writeSymbol, - writeLine: writeLine, - increaseIndent: function () { indent++; }, - decreaseIndent: function () { indent--; }, - clear: resetWriter, - trackSymbol: function () { } - }; - function writeIndent() { - if (lineStart) { - var indentString = ts.getIndentString(indent); - if (indentString) { - displayParts.push(displayPart(indentString, ts.SymbolDisplayPartKind.space)); - } - lineStart = false; - } - } - function writeKind(text, kind) { - writeIndent(); - displayParts.push(displayPart(text, kind)); - } - function writeSymbol(text, symbol) { - writeIndent(); - displayParts.push(symbolPart(text, symbol)); - } - function writeLine() { - displayParts.push(lineBreakPart()); - lineStart = true; - } - function resetWriter() { - displayParts = []; - lineStart = true; - indent = 0; - } - } - function symbolPart(text, symbol) { - return displayPart(text, displayPartKind(symbol), symbol); - function displayPartKind(symbol) { - var flags = symbol.flags; - if (flags & 3 /* Variable */) { - return isFirstDeclarationOfSymbolParameter(symbol) ? ts.SymbolDisplayPartKind.parameterName : ts.SymbolDisplayPartKind.localName; - } - else if (flags & 4 /* Property */) { - return ts.SymbolDisplayPartKind.propertyName; - } - else if (flags & 32768 /* GetAccessor */) { - return ts.SymbolDisplayPartKind.propertyName; - } - else if (flags & 65536 /* SetAccessor */) { - return ts.SymbolDisplayPartKind.propertyName; - } - else if (flags & 8 /* EnumMember */) { - return ts.SymbolDisplayPartKind.enumMemberName; - } - else if (flags & 16 /* Function */) { - return ts.SymbolDisplayPartKind.functionName; - } - else if (flags & 32 /* Class */) { - return ts.SymbolDisplayPartKind.className; - } - else if (flags & 64 /* Interface */) { - return ts.SymbolDisplayPartKind.interfaceName; - } - else if (flags & 384 /* Enum */) { - return ts.SymbolDisplayPartKind.enumName; - } - else if (flags & 1536 /* Module */) { - return ts.SymbolDisplayPartKind.moduleName; - } - else if (flags & 8192 /* Method */) { - return ts.SymbolDisplayPartKind.methodName; - } - else if (flags & 262144 /* TypeParameter */) { - return ts.SymbolDisplayPartKind.typeParameterName; - } - else if (flags & 524288 /* TypeAlias */) { - return ts.SymbolDisplayPartKind.aliasName; - } - else if (flags & 8388608 /* Alias */) { - return ts.SymbolDisplayPartKind.aliasName; - } - return ts.SymbolDisplayPartKind.text; - } - } - ts.symbolPart = symbolPart; - function displayPart(text, kind, symbol) { - return { - text: text, - kind: ts.SymbolDisplayPartKind[kind] - }; - } - ts.displayPart = displayPart; - function spacePart() { - return displayPart(" ", ts.SymbolDisplayPartKind.space); - } - ts.spacePart = spacePart; - function keywordPart(kind) { - return displayPart(ts.tokenToString(kind), ts.SymbolDisplayPartKind.keyword); - } - ts.keywordPart = keywordPart; - function punctuationPart(kind) { - return displayPart(ts.tokenToString(kind), ts.SymbolDisplayPartKind.punctuation); - } - ts.punctuationPart = punctuationPart; - function operatorPart(kind) { - return displayPart(ts.tokenToString(kind), ts.SymbolDisplayPartKind.operator); - } - ts.operatorPart = operatorPart; - function textOrKeywordPart(text) { - var kind = ts.stringToToken(text); - return kind === undefined - ? textPart(text) - : keywordPart(kind); - } - ts.textOrKeywordPart = textOrKeywordPart; - function textPart(text) { - return displayPart(text, ts.SymbolDisplayPartKind.text); - } - ts.textPart = textPart; - function lineBreakPart() { - return displayPart("\n", ts.SymbolDisplayPartKind.lineBreak); - } - ts.lineBreakPart = lineBreakPart; - function mapToDisplayParts(writeDisplayParts) { - writeDisplayParts(displayPartWriter); - var result = displayPartWriter.displayParts(); - displayPartWriter.clear(); - return result; - } - ts.mapToDisplayParts = mapToDisplayParts; - function typeToDisplayParts(typechecker, type, enclosingDeclaration, flags) { - return mapToDisplayParts(function (writer) { - typechecker.getSymbolDisplayBuilder().buildTypeDisplay(type, writer, enclosingDeclaration, flags); - }); - } - ts.typeToDisplayParts = typeToDisplayParts; - function symbolToDisplayParts(typeChecker, symbol, enclosingDeclaration, meaning, flags) { - return mapToDisplayParts(function (writer) { - typeChecker.getSymbolDisplayBuilder().buildSymbolDisplay(symbol, writer, enclosingDeclaration, meaning, flags); - }); - } - ts.symbolToDisplayParts = symbolToDisplayParts; - function signatureToDisplayParts(typechecker, signature, enclosingDeclaration, flags) { - return mapToDisplayParts(function (writer) { - typechecker.getSymbolDisplayBuilder().buildSignatureDisplay(signature, writer, enclosingDeclaration, flags); - }); - } - ts.signatureToDisplayParts = signatureToDisplayParts; -})(ts || (ts = {})); -/// -/// -/* @internal */ -var ts; -(function (ts) { - var formatting; - (function (formatting) { - var scanner = ts.createScanner(2 /* Latest */, false); - var ScanAction; - (function (ScanAction) { - ScanAction[ScanAction["Scan"] = 0] = "Scan"; - ScanAction[ScanAction["RescanGreaterThanToken"] = 1] = "RescanGreaterThanToken"; - ScanAction[ScanAction["RescanSlashToken"] = 2] = "RescanSlashToken"; - ScanAction[ScanAction["RescanTemplateToken"] = 3] = "RescanTemplateToken"; - })(ScanAction || (ScanAction = {})); - function getFormattingScanner(sourceFile, startPos, endPos) { - scanner.setText(sourceFile.text); - scanner.setTextPos(startPos); - var wasNewLine = true; - var leadingTrivia; - var trailingTrivia; - var savedPos; - var lastScanAction; - var lastTokenInfo; - return { - advance: advance, - readTokenInfo: readTokenInfo, - isOnToken: isOnToken, - lastTrailingTriviaWasNewLine: function () { return wasNewLine; }, - close: function () { - lastTokenInfo = undefined; - scanner.setText(undefined); - } - }; - function advance() { - lastTokenInfo = undefined; - var isStarted = scanner.getStartPos() !== startPos; - if (isStarted) { - if (trailingTrivia) { - ts.Debug.assert(trailingTrivia.length !== 0); - wasNewLine = ts.lastOrUndefined(trailingTrivia).kind === 4 /* NewLineTrivia */; - } - else { - wasNewLine = false; - } - } - leadingTrivia = undefined; - trailingTrivia = undefined; - if (!isStarted) { - scanner.scan(); - } - var t; - var pos = scanner.getStartPos(); - // Read leading trivia and token - while (pos < endPos) { - var t_2 = scanner.getToken(); - if (!ts.isTrivia(t_2)) { - break; - } - // consume leading trivia - scanner.scan(); - var item = { - pos: pos, - end: scanner.getStartPos(), - kind: t_2 - }; - pos = scanner.getStartPos(); - if (!leadingTrivia) { - leadingTrivia = []; - } - leadingTrivia.push(item); - } - savedPos = scanner.getStartPos(); - } - function shouldRescanGreaterThanToken(node) { - if (node) { - switch (node.kind) { - case 27 /* GreaterThanEqualsToken */: - case 60 /* GreaterThanGreaterThanEqualsToken */: - case 61 /* GreaterThanGreaterThanGreaterThanEqualsToken */: - case 42 /* GreaterThanGreaterThanGreaterThanToken */: - case 41 /* GreaterThanGreaterThanToken */: - return true; - } - } - return false; - } - function shouldRescanSlashToken(container) { - return container.kind === 9 /* RegularExpressionLiteral */; - } - function shouldRescanTemplateToken(container) { - return container.kind === 12 /* TemplateMiddle */ || - container.kind === 13 /* TemplateTail */; - } - function startsWithSlashToken(t) { - return t === 36 /* SlashToken */ || t === 57 /* SlashEqualsToken */; - } - function readTokenInfo(n) { - if (!isOnToken()) { - // scanner is not on the token (either advance was not called yet or scanner is already past the end position) - return { - leadingTrivia: leadingTrivia, - trailingTrivia: undefined, - token: undefined - }; - } - // normally scanner returns the smallest available token - // check the kind of context node to determine if scanner should have more greedy behavior and consume more text. - var expectedScanAction = shouldRescanGreaterThanToken(n) - ? 1 /* RescanGreaterThanToken */ - : shouldRescanSlashToken(n) - ? 2 /* RescanSlashToken */ - : shouldRescanTemplateToken(n) - ? 3 /* RescanTemplateToken */ - : 0 /* Scan */; - if (lastTokenInfo && expectedScanAction === lastScanAction) { - // readTokenInfo was called before with the same expected scan action. - // No need to re-scan text, return existing 'lastTokenInfo' - // it is ok to call fixTokenKind here since it does not affect - // what portion of text is consumed. In opposize rescanning can change it, - // i.e. for '>=' when originally scanner eats just one character - // and rescanning forces it to consume more. - return fixTokenKind(lastTokenInfo, n); - } - if (scanner.getStartPos() !== savedPos) { - ts.Debug.assert(lastTokenInfo !== undefined); - // readTokenInfo was called before but scan action differs - rescan text - scanner.setTextPos(savedPos); - scanner.scan(); - } - var currentToken = scanner.getToken(); - if (expectedScanAction === 1 /* RescanGreaterThanToken */ && currentToken === 25 /* GreaterThanToken */) { - currentToken = scanner.reScanGreaterToken(); - ts.Debug.assert(n.kind === currentToken); - lastScanAction = 1 /* RescanGreaterThanToken */; - } - else if (expectedScanAction === 2 /* RescanSlashToken */ && startsWithSlashToken(currentToken)) { - currentToken = scanner.reScanSlashToken(); - ts.Debug.assert(n.kind === currentToken); - lastScanAction = 2 /* RescanSlashToken */; - } - else if (expectedScanAction === 3 /* RescanTemplateToken */ && currentToken === 15 /* CloseBraceToken */) { - currentToken = scanner.reScanTemplateToken(); - lastScanAction = 3 /* RescanTemplateToken */; - } - else { - lastScanAction = 0 /* Scan */; - } - var token = { - pos: scanner.getStartPos(), - end: scanner.getTextPos(), - kind: currentToken - }; - // consume trailing trivia - if (trailingTrivia) { - trailingTrivia = undefined; - } - while (scanner.getStartPos() < endPos) { - currentToken = scanner.scan(); - if (!ts.isTrivia(currentToken)) { - break; - } - var trivia = { - pos: scanner.getStartPos(), - end: scanner.getTextPos(), - kind: currentToken - }; - if (!trailingTrivia) { - trailingTrivia = []; - } - trailingTrivia.push(trivia); - if (currentToken === 4 /* NewLineTrivia */) { - // move past new line - scanner.scan(); - break; - } - } - lastTokenInfo = { - leadingTrivia: leadingTrivia, - trailingTrivia: trailingTrivia, - token: token - }; - return fixTokenKind(lastTokenInfo, n); - } - function isOnToken() { - var current = (lastTokenInfo && lastTokenInfo.token.kind) || scanner.getToken(); - var startPos = (lastTokenInfo && lastTokenInfo.token.pos) || scanner.getStartPos(); - return startPos < endPos && current !== 1 /* EndOfFileToken */ && !ts.isTrivia(current); - } - // when containing node in the tree is token - // but its kind differs from the kind that was returned by the scanner, - // then kind needs to be fixed. This might happen in cases - // when parser interprets token differently, i.e keyword treated as identifier - function fixTokenKind(tokenInfo, container) { - if (ts.isToken(container) && tokenInfo.token.kind !== container.kind) { - tokenInfo.token.kind = container.kind; - } - return tokenInfo; - } - } - formatting.getFormattingScanner = getFormattingScanner; - })(formatting = ts.formatting || (ts.formatting = {})); -})(ts || (ts = {})); -/// -/* @internal */ -var ts; -(function (ts) { - var formatting; - (function (formatting) { - var FormattingContext = (function () { - function FormattingContext(sourceFile, formattingRequestKind) { - this.sourceFile = sourceFile; - this.formattingRequestKind = formattingRequestKind; - } - FormattingContext.prototype.updateContext = function (currentRange, currentTokenParent, nextRange, nextTokenParent, commonParent) { - ts.Debug.assert(currentRange !== undefined, "currentTokenSpan is null"); - ts.Debug.assert(currentTokenParent !== undefined, "currentTokenParent is null"); - ts.Debug.assert(nextRange !== undefined, "nextTokenSpan is null"); - ts.Debug.assert(nextTokenParent !== undefined, "nextTokenParent is null"); - ts.Debug.assert(commonParent !== undefined, "commonParent is null"); - this.currentTokenSpan = currentRange; - this.currentTokenParent = currentTokenParent; - this.nextTokenSpan = nextRange; - this.nextTokenParent = nextTokenParent; - this.contextNode = commonParent; - // drop cached results - this.contextNodeAllOnSameLine = undefined; - this.nextNodeAllOnSameLine = undefined; - this.tokensAreOnSameLine = undefined; - this.contextNodeBlockIsOnOneLine = undefined; - this.nextNodeBlockIsOnOneLine = undefined; - }; - FormattingContext.prototype.ContextNodeAllOnSameLine = function () { - if (this.contextNodeAllOnSameLine === undefined) { - this.contextNodeAllOnSameLine = this.NodeIsOnOneLine(this.contextNode); - } - return this.contextNodeAllOnSameLine; - }; - FormattingContext.prototype.NextNodeAllOnSameLine = function () { - if (this.nextNodeAllOnSameLine === undefined) { - this.nextNodeAllOnSameLine = this.NodeIsOnOneLine(this.nextTokenParent); - } - return this.nextNodeAllOnSameLine; - }; - FormattingContext.prototype.TokensAreOnSameLine = function () { - if (this.tokensAreOnSameLine === undefined) { - var startLine = this.sourceFile.getLineAndCharacterOfPosition(this.currentTokenSpan.pos).line; - var endLine = this.sourceFile.getLineAndCharacterOfPosition(this.nextTokenSpan.pos).line; - this.tokensAreOnSameLine = (startLine == endLine); - } - return this.tokensAreOnSameLine; - }; - FormattingContext.prototype.ContextNodeBlockIsOnOneLine = function () { - if (this.contextNodeBlockIsOnOneLine === undefined) { - this.contextNodeBlockIsOnOneLine = this.BlockIsOnOneLine(this.contextNode); - } - return this.contextNodeBlockIsOnOneLine; - }; - FormattingContext.prototype.NextNodeBlockIsOnOneLine = function () { - if (this.nextNodeBlockIsOnOneLine === undefined) { - this.nextNodeBlockIsOnOneLine = this.BlockIsOnOneLine(this.nextTokenParent); - } - return this.nextNodeBlockIsOnOneLine; - }; - FormattingContext.prototype.NodeIsOnOneLine = function (node) { - var startLine = this.sourceFile.getLineAndCharacterOfPosition(node.getStart(this.sourceFile)).line; - var endLine = this.sourceFile.getLineAndCharacterOfPosition(node.getEnd()).line; - return startLine == endLine; - }; - FormattingContext.prototype.BlockIsOnOneLine = function (node) { - var openBrace = ts.findChildOfKind(node, 14 /* OpenBraceToken */, this.sourceFile); - var closeBrace = ts.findChildOfKind(node, 15 /* CloseBraceToken */, this.sourceFile); - if (openBrace && closeBrace) { - var startLine = this.sourceFile.getLineAndCharacterOfPosition(openBrace.getEnd()).line; - var endLine = this.sourceFile.getLineAndCharacterOfPosition(closeBrace.getStart(this.sourceFile)).line; - return startLine === endLine; - } - return false; - }; - return FormattingContext; - })(); - formatting.FormattingContext = FormattingContext; - })(formatting = ts.formatting || (ts.formatting = {})); -})(ts || (ts = {})); -/// -/* @internal */ -var ts; -(function (ts) { - var formatting; - (function (formatting) { - (function (FormattingRequestKind) { - FormattingRequestKind[FormattingRequestKind["FormatDocument"] = 0] = "FormatDocument"; - FormattingRequestKind[FormattingRequestKind["FormatSelection"] = 1] = "FormatSelection"; - FormattingRequestKind[FormattingRequestKind["FormatOnEnter"] = 2] = "FormatOnEnter"; - FormattingRequestKind[FormattingRequestKind["FormatOnSemicolon"] = 3] = "FormatOnSemicolon"; - FormattingRequestKind[FormattingRequestKind["FormatOnClosingCurlyBrace"] = 4] = "FormatOnClosingCurlyBrace"; - })(formatting.FormattingRequestKind || (formatting.FormattingRequestKind = {})); - var FormattingRequestKind = formatting.FormattingRequestKind; - })(formatting = ts.formatting || (ts.formatting = {})); -})(ts || (ts = {})); -/// -/* @internal */ -var ts; -(function (ts) { - var formatting; - (function (formatting) { - var Rule = (function () { - function Rule(Descriptor, Operation, Flag) { - if (Flag === void 0) { Flag = 0 /* None */; } - this.Descriptor = Descriptor; - this.Operation = Operation; - this.Flag = Flag; - } - Rule.prototype.toString = function () { - return "[desc=" + this.Descriptor + "," + - "operation=" + this.Operation + "," + - "flag=" + this.Flag + "]"; - }; - return Rule; - })(); - formatting.Rule = Rule; - })(formatting = ts.formatting || (ts.formatting = {})); -})(ts || (ts = {})); -/// -/* @internal */ -var ts; -(function (ts) { - var formatting; - (function (formatting) { - (function (RuleAction) { - RuleAction[RuleAction["Ignore"] = 1] = "Ignore"; - RuleAction[RuleAction["Space"] = 2] = "Space"; - RuleAction[RuleAction["NewLine"] = 4] = "NewLine"; - RuleAction[RuleAction["Delete"] = 8] = "Delete"; - })(formatting.RuleAction || (formatting.RuleAction = {})); - var RuleAction = formatting.RuleAction; - })(formatting = ts.formatting || (ts.formatting = {})); -})(ts || (ts = {})); -/// -/* @internal */ -var ts; -(function (ts) { - var formatting; - (function (formatting) { - var RuleDescriptor = (function () { - function RuleDescriptor(LeftTokenRange, RightTokenRange) { - this.LeftTokenRange = LeftTokenRange; - this.RightTokenRange = RightTokenRange; - } - RuleDescriptor.prototype.toString = function () { - return "[leftRange=" + this.LeftTokenRange + "," + - "rightRange=" + this.RightTokenRange + "]"; - }; - RuleDescriptor.create1 = function (left, right) { - return RuleDescriptor.create4(formatting.Shared.TokenRange.FromToken(left), formatting.Shared.TokenRange.FromToken(right)); - }; - RuleDescriptor.create2 = function (left, right) { - return RuleDescriptor.create4(left, formatting.Shared.TokenRange.FromToken(right)); - }; - RuleDescriptor.create3 = function (left, right) { - return RuleDescriptor.create4(formatting.Shared.TokenRange.FromToken(left), right); - }; - RuleDescriptor.create4 = function (left, right) { - return new RuleDescriptor(left, right); - }; - return RuleDescriptor; - })(); - formatting.RuleDescriptor = RuleDescriptor; - })(formatting = ts.formatting || (ts.formatting = {})); -})(ts || (ts = {})); -/// -/* @internal */ -var ts; -(function (ts) { - var formatting; - (function (formatting) { - (function (RuleFlags) { - RuleFlags[RuleFlags["None"] = 0] = "None"; - RuleFlags[RuleFlags["CanDeleteNewLines"] = 1] = "CanDeleteNewLines"; - })(formatting.RuleFlags || (formatting.RuleFlags = {})); - var RuleFlags = formatting.RuleFlags; - })(formatting = ts.formatting || (ts.formatting = {})); -})(ts || (ts = {})); -/// -/* @internal */ -var ts; -(function (ts) { - var formatting; - (function (formatting) { - var RuleOperation = (function () { - function RuleOperation() { - this.Context = null; - this.Action = null; - } - RuleOperation.prototype.toString = function () { - return "[context=" + this.Context + "," + - "action=" + this.Action + "]"; - }; - RuleOperation.create1 = function (action) { - return RuleOperation.create2(formatting.RuleOperationContext.Any, action); - }; - RuleOperation.create2 = function (context, action) { - var result = new RuleOperation(); - result.Context = context; - result.Action = action; - return result; - }; - return RuleOperation; - })(); - formatting.RuleOperation = RuleOperation; - })(formatting = ts.formatting || (ts.formatting = {})); -})(ts || (ts = {})); -/// -/* @internal */ -var ts; -(function (ts) { - var formatting; - (function (formatting) { - var RuleOperationContext = (function () { - function RuleOperationContext() { - var funcs = []; - for (var _i = 0; _i < arguments.length; _i++) { - funcs[_i - 0] = arguments[_i]; - } - this.customContextChecks = funcs; - } - RuleOperationContext.prototype.IsAny = function () { - return this == RuleOperationContext.Any; - }; - RuleOperationContext.prototype.InContext = function (context) { - if (this.IsAny()) { - return true; - } - for (var _i = 0, _a = this.customContextChecks; _i < _a.length; _i++) { - var check = _a[_i]; - if (!check(context)) { - return false; - } - } - return true; - }; - RuleOperationContext.Any = new RuleOperationContext(); - return RuleOperationContext; - })(); - formatting.RuleOperationContext = RuleOperationContext; - })(formatting = ts.formatting || (ts.formatting = {})); -})(ts || (ts = {})); -/// -/* @internal */ -var ts; -(function (ts) { - var formatting; - (function (formatting) { - var Rules = (function () { - function Rules() { - /// - /// Common Rules - /// - // Leave comments alone - this.IgnoreBeforeComment = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.Comments), formatting.RuleOperation.create1(1 /* Ignore */)); - this.IgnoreAfterLineComment = new formatting.Rule(formatting.RuleDescriptor.create3(2 /* SingleLineCommentTrivia */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create1(1 /* Ignore */)); - // Space after keyword but not before ; or : or ? - this.NoSpaceBeforeSemicolon = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 22 /* SemicolonToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); - this.NoSpaceBeforeColon = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 51 /* ColonToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 8 /* Delete */)); - this.NoSpaceBeforeQuestionMark = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 50 /* QuestionToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 8 /* Delete */)); - this.SpaceAfterColon = new formatting.Rule(formatting.RuleDescriptor.create3(51 /* ColonToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 2 /* Space */)); - this.SpaceAfterQuestionMarkInConditionalOperator = new formatting.Rule(formatting.RuleDescriptor.create3(50 /* QuestionToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsConditionalOperatorContext), 2 /* Space */)); - this.NoSpaceAfterQuestionMark = new formatting.Rule(formatting.RuleDescriptor.create3(50 /* QuestionToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); - this.SpaceAfterSemicolon = new formatting.Rule(formatting.RuleDescriptor.create3(22 /* SemicolonToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); - // Space after }. - this.SpaceAfterCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create3(15 /* CloseBraceToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsAfterCodeBlockContext), 2 /* Space */)); - // Special case for (}, else) and (}, while) since else & while tokens are not part of the tree which makes SpaceAfterCloseBrace rule not applied - this.SpaceBetweenCloseBraceAndElse = new formatting.Rule(formatting.RuleDescriptor.create1(15 /* CloseBraceToken */, 76 /* ElseKeyword */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); - this.SpaceBetweenCloseBraceAndWhile = new formatting.Rule(formatting.RuleDescriptor.create1(15 /* CloseBraceToken */, 100 /* WhileKeyword */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); - this.NoSpaceAfterCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create3(15 /* CloseBraceToken */, formatting.Shared.TokenRange.FromTokens([17 /* CloseParenToken */, 19 /* CloseBracketToken */, 23 /* CommaToken */, 22 /* SemicolonToken */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); - // No space for indexer and dot - this.NoSpaceBeforeDot = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 20 /* DotToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); - this.NoSpaceAfterDot = new formatting.Rule(formatting.RuleDescriptor.create3(20 /* DotToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); - this.NoSpaceBeforeOpenBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 18 /* OpenBracketToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); - this.NoSpaceAfterOpenBracket = new formatting.Rule(formatting.RuleDescriptor.create3(18 /* OpenBracketToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); - this.NoSpaceBeforeCloseBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 19 /* CloseBracketToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); - this.NoSpaceAfterCloseBracket = new formatting.Rule(formatting.RuleDescriptor.create3(19 /* CloseBracketToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBeforeBlockInFunctionDeclarationContext), 8 /* Delete */)); - // Place a space before open brace in a function declaration - this.FunctionOpenBraceLeftTokenRange = formatting.Shared.TokenRange.AnyIncludingMultilineComments; - this.SpaceBeforeOpenBraceInFunction = new formatting.Rule(formatting.RuleDescriptor.create2(this.FunctionOpenBraceLeftTokenRange, 14 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext, Rules.IsBeforeBlockContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 2 /* Space */), 1 /* CanDeleteNewLines */); - // Place a space before open brace in a TypeScript declaration that has braces as children (class, module, enum, etc) - this.TypeScriptOpenBraceLeftTokenRange = formatting.Shared.TokenRange.FromTokens([65 /* Identifier */, 3 /* MultiLineCommentTrivia */]); - this.SpaceBeforeOpenBraceInTypeScriptDeclWithBlock = new formatting.Rule(formatting.RuleDescriptor.create2(this.TypeScriptOpenBraceLeftTokenRange, 14 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsTypeScriptDeclWithBlockContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 2 /* Space */), 1 /* CanDeleteNewLines */); - // Place a space before open brace in a control flow construct - this.ControlOpenBraceLeftTokenRange = formatting.Shared.TokenRange.FromTokens([17 /* CloseParenToken */, 3 /* MultiLineCommentTrivia */, 75 /* DoKeyword */, 96 /* TryKeyword */, 81 /* FinallyKeyword */, 76 /* ElseKeyword */]); - this.SpaceBeforeOpenBraceInControl = new formatting.Rule(formatting.RuleDescriptor.create2(this.ControlOpenBraceLeftTokenRange, 14 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsControlDeclContext, Rules.IsNotFormatOnEnter, Rules.IsSameLineTokenOrBeforeMultilineBlockContext), 2 /* Space */), 1 /* CanDeleteNewLines */); - // Insert a space after { and before } in single-line contexts, but remove space from empty object literals {}. - this.SpaceAfterOpenBrace = new formatting.Rule(formatting.RuleDescriptor.create3(14 /* OpenBraceToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 2 /* Space */)); - this.SpaceBeforeCloseBrace = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 15 /* CloseBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSingleLineBlockContext), 2 /* Space */)); - this.NoSpaceBetweenEmptyBraceBrackets = new formatting.Rule(formatting.RuleDescriptor.create1(14 /* OpenBraceToken */, 15 /* CloseBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsObjectContext), 8 /* Delete */)); - // Insert new line after { and before } in multi-line contexts. - this.NewLineAfterOpenBraceInBlockContext = new formatting.Rule(formatting.RuleDescriptor.create3(14 /* OpenBraceToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsMultilineBlockContext), 4 /* NewLine */)); - // For functions and control block place } on a new line [multi-line rule] - this.NewLineBeforeCloseBraceInBlockContext = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.AnyIncludingMultilineComments, 15 /* CloseBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsMultilineBlockContext), 4 /* NewLine */)); - // Special handling of unary operators. - // Prefix operators generally shouldn't have a space between - // them and their target unary expression. - this.NoSpaceAfterUnaryPrefixOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.UnaryPrefixOperators, formatting.Shared.TokenRange.UnaryPrefixExpressions), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 8 /* Delete */)); - this.NoSpaceAfterUnaryPreincrementOperator = new formatting.Rule(formatting.RuleDescriptor.create3(38 /* PlusPlusToken */, formatting.Shared.TokenRange.UnaryPreincrementExpressions), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); - this.NoSpaceAfterUnaryPredecrementOperator = new formatting.Rule(formatting.RuleDescriptor.create3(39 /* MinusMinusToken */, formatting.Shared.TokenRange.UnaryPredecrementExpressions), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); - this.NoSpaceBeforeUnaryPostincrementOperator = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.UnaryPostincrementExpressions, 38 /* PlusPlusToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); - this.NoSpaceBeforeUnaryPostdecrementOperator = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.UnaryPostdecrementExpressions, 39 /* MinusMinusToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); - // More unary operator special-casing. - // DevDiv 181814: Be careful when removing leading whitespace - // around unary operators. Examples: - // 1 - -2 --X--> 1--2 - // a + ++b --X--> a+++b - this.SpaceAfterPostincrementWhenFollowedByAdd = new formatting.Rule(formatting.RuleDescriptor.create1(38 /* PlusPlusToken */, 33 /* PlusToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); - this.SpaceAfterAddWhenFollowedByUnaryPlus = new formatting.Rule(formatting.RuleDescriptor.create1(33 /* PlusToken */, 33 /* PlusToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); - this.SpaceAfterAddWhenFollowedByPreincrement = new formatting.Rule(formatting.RuleDescriptor.create1(33 /* PlusToken */, 38 /* PlusPlusToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); - this.SpaceAfterPostdecrementWhenFollowedBySubtract = new formatting.Rule(formatting.RuleDescriptor.create1(39 /* MinusMinusToken */, 34 /* MinusToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); - this.SpaceAfterSubtractWhenFollowedByUnaryMinus = new formatting.Rule(formatting.RuleDescriptor.create1(34 /* MinusToken */, 34 /* MinusToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); - this.SpaceAfterSubtractWhenFollowedByPredecrement = new formatting.Rule(formatting.RuleDescriptor.create1(34 /* MinusToken */, 39 /* MinusMinusToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); - this.NoSpaceBeforeComma = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 23 /* CommaToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); - this.SpaceAfterCertainKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([98 /* VarKeyword */, 94 /* ThrowKeyword */, 88 /* NewKeyword */, 74 /* DeleteKeyword */, 90 /* ReturnKeyword */, 97 /* TypeOfKeyword */]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); - this.SpaceAfterLetConstInVariableDeclaration = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([104 /* LetKeyword */, 70 /* ConstKeyword */]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsStartOfVariableDeclarationList), 2 /* Space */)); - this.NoSpaceBeforeOpenParenInFuncCall = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 16 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsFunctionCallOrNewContext, Rules.IsPreviousTokenNotComma), 8 /* Delete */)); - this.SpaceAfterFunctionInFuncDecl = new formatting.Rule(formatting.RuleDescriptor.create3(83 /* FunctionKeyword */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2 /* Space */)); - this.NoSpaceBeforeOpenParenInFuncDecl = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 16 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsFunctionDeclContext), 8 /* Delete */)); - this.SpaceAfterVoidOperator = new formatting.Rule(formatting.RuleDescriptor.create3(99 /* VoidKeyword */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsVoidOpContext), 2 /* Space */)); - this.NoSpaceBetweenReturnAndSemicolon = new formatting.Rule(formatting.RuleDescriptor.create1(90 /* ReturnKeyword */, 22 /* SemicolonToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); - // Add a space between statements. All keywords except (do,else,case) has open/close parens after them. - // So, we have a rule to add a space for [),Any], [do,Any], [else,Any], and [case,Any] - this.SpaceBetweenStatements = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([17 /* CloseParenToken */, 75 /* DoKeyword */, 76 /* ElseKeyword */, 67 /* CaseKeyword */]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotForContext), 2 /* Space */)); - // This low-pri rule takes care of "try {" and "finally {" in case the rule SpaceBeforeOpenBraceInControl didn't execute on FormatOnEnter. - this.SpaceAfterTryFinally = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([96 /* TryKeyword */, 81 /* FinallyKeyword */]), 14 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); - // get x() {} - // set x(val) {} - this.SpaceAfterGetSetInMember = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([116 /* GetKeyword */, 122 /* SetKeyword */]), 65 /* Identifier */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2 /* Space */)); - // Special case for binary operators (that are keywords). For these we have to add a space and shouldn't follow any user options. - this.SpaceBeforeBinaryKeywordOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.BinaryKeywordOperators), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); - this.SpaceAfterBinaryKeywordOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.BinaryKeywordOperators, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); - // TypeScript-specific higher priority rules - // Treat constructor as an identifier in a function declaration, and remove spaces between constructor and following left parentheses - this.NoSpaceAfterConstructor = new formatting.Rule(formatting.RuleDescriptor.create1(114 /* ConstructorKeyword */, 16 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); - // Use of module as a function call. e.g.: import m2 = module("m2"); - this.NoSpaceAfterModuleImport = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.FromTokens([118 /* ModuleKeyword */, 120 /* RequireKeyword */]), 16 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); - // Add a space around certain TypeScript keywords - this.SpaceAfterCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([69 /* ClassKeyword */, 115 /* DeclareKeyword */, 77 /* EnumKeyword */, 78 /* ExportKeyword */, 79 /* ExtendsKeyword */, 116 /* GetKeyword */, 102 /* ImplementsKeyword */, 85 /* ImportKeyword */, 103 /* InterfaceKeyword */, 118 /* ModuleKeyword */, 119 /* NamespaceKeyword */, 106 /* PrivateKeyword */, 108 /* PublicKeyword */, 122 /* SetKeyword */, 109 /* StaticKeyword */]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); - this.SpaceBeforeCertainTypeScriptKeywords = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([79 /* ExtendsKeyword */, 102 /* ImplementsKeyword */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); - // Treat string literals in module names as identifiers, and add a space between the literal and the opening Brace braces, e.g.: module "m2" { - this.SpaceAfterModuleName = new formatting.Rule(formatting.RuleDescriptor.create1(8 /* StringLiteral */, 14 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsModuleDeclContext), 2 /* Space */)); - // Lambda expressions - this.SpaceAfterArrow = new formatting.Rule(formatting.RuleDescriptor.create3(32 /* EqualsGreaterThanToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); - // Optional parameters and let args - this.NoSpaceAfterEllipsis = new formatting.Rule(formatting.RuleDescriptor.create1(21 /* DotDotDotToken */, 65 /* Identifier */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); - this.NoSpaceAfterOptionalParameters = new formatting.Rule(formatting.RuleDescriptor.create3(50 /* QuestionToken */, formatting.Shared.TokenRange.FromTokens([17 /* CloseParenToken */, 23 /* CommaToken */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsNotBinaryOpContext), 8 /* Delete */)); - // generics - this.NoSpaceBeforeOpenAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.TypeNames, 24 /* LessThanToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 8 /* Delete */)); - this.NoSpaceBetweenCloseParenAndAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create1(17 /* CloseParenToken */, 24 /* LessThanToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 8 /* Delete */)); - this.NoSpaceAfterOpenAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create3(24 /* LessThanToken */, formatting.Shared.TokenRange.TypeNames), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 8 /* Delete */)); - this.NoSpaceBeforeCloseAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 25 /* GreaterThanToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 8 /* Delete */)); - this.NoSpaceAfterCloseAngularBracket = new formatting.Rule(formatting.RuleDescriptor.create3(25 /* GreaterThanToken */, formatting.Shared.TokenRange.FromTokens([16 /* OpenParenToken */, 18 /* OpenBracketToken */, 25 /* GreaterThanToken */, 23 /* CommaToken */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsTypeArgumentOrParameterContext), 8 /* Delete */)); - // Remove spaces in empty interface literals. e.g.: x: {} - this.NoSpaceBetweenEmptyInterfaceBraceBrackets = new formatting.Rule(formatting.RuleDescriptor.create1(14 /* OpenBraceToken */, 15 /* CloseBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsObjectTypeContext), 8 /* Delete */)); - // decorators - this.SpaceBeforeAt = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 52 /* AtToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); - this.NoSpaceAfterAt = new formatting.Rule(formatting.RuleDescriptor.create3(52 /* AtToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); - this.SpaceAfterDecorator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.FromTokens([65 /* Identifier */, 78 /* ExportKeyword */, 73 /* DefaultKeyword */, 69 /* ClassKeyword */, 109 /* StaticKeyword */, 108 /* PublicKeyword */, 106 /* PrivateKeyword */, 107 /* ProtectedKeyword */, 116 /* GetKeyword */, 122 /* SetKeyword */, 18 /* OpenBracketToken */, 35 /* AsteriskToken */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsEndOfDecoratorContextOnSameLine), 2 /* Space */)); - this.NoSpaceBetweenFunctionKeywordAndStar = new formatting.Rule(formatting.RuleDescriptor.create1(83 /* FunctionKeyword */, 35 /* AsteriskToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclarationOrFunctionExpressionContext), 8 /* Delete */)); - this.SpaceAfterStarInGeneratorDeclaration = new formatting.Rule(formatting.RuleDescriptor.create3(35 /* AsteriskToken */, formatting.Shared.TokenRange.FromTokens([65 /* Identifier */, 16 /* OpenParenToken */])), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclarationOrFunctionExpressionContext), 2 /* Space */)); - this.NoSpaceBetweenYieldKeywordAndStar = new formatting.Rule(formatting.RuleDescriptor.create1(110 /* YieldKeyword */, 35 /* AsteriskToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsYieldOrYieldStarWithOperand), 8 /* Delete */)); - this.SpaceBetweenYieldOrYieldStarAndOperand = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.FromTokens([110 /* YieldKeyword */, 35 /* AsteriskToken */]), formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsYieldOrYieldStarWithOperand), 2 /* Space */)); - // These rules are higher in priority than user-configurable rules. - this.HighPriorityCommonRules = - [ - this.IgnoreBeforeComment, this.IgnoreAfterLineComment, - this.NoSpaceBeforeColon, this.SpaceAfterColon, this.NoSpaceBeforeQuestionMark, this.SpaceAfterQuestionMarkInConditionalOperator, - this.NoSpaceAfterQuestionMark, - this.NoSpaceBeforeDot, this.NoSpaceAfterDot, - this.NoSpaceAfterUnaryPrefixOperator, - this.NoSpaceAfterUnaryPreincrementOperator, this.NoSpaceAfterUnaryPredecrementOperator, - this.NoSpaceBeforeUnaryPostincrementOperator, this.NoSpaceBeforeUnaryPostdecrementOperator, - this.SpaceAfterPostincrementWhenFollowedByAdd, - this.SpaceAfterAddWhenFollowedByUnaryPlus, this.SpaceAfterAddWhenFollowedByPreincrement, - this.SpaceAfterPostdecrementWhenFollowedBySubtract, - this.SpaceAfterSubtractWhenFollowedByUnaryMinus, this.SpaceAfterSubtractWhenFollowedByPredecrement, - this.NoSpaceAfterCloseBrace, - this.SpaceAfterOpenBrace, this.SpaceBeforeCloseBrace, this.NewLineBeforeCloseBraceInBlockContext, - this.SpaceAfterCloseBrace, this.SpaceBetweenCloseBraceAndElse, this.SpaceBetweenCloseBraceAndWhile, this.NoSpaceBetweenEmptyBraceBrackets, - this.NoSpaceBetweenFunctionKeywordAndStar, this.SpaceAfterStarInGeneratorDeclaration, - this.SpaceAfterFunctionInFuncDecl, this.NewLineAfterOpenBraceInBlockContext, this.SpaceAfterGetSetInMember, - this.NoSpaceBetweenYieldKeywordAndStar, this.SpaceBetweenYieldOrYieldStarAndOperand, - this.NoSpaceBetweenReturnAndSemicolon, - this.SpaceAfterCertainKeywords, - this.SpaceAfterLetConstInVariableDeclaration, - this.NoSpaceBeforeOpenParenInFuncCall, - this.SpaceBeforeBinaryKeywordOperator, this.SpaceAfterBinaryKeywordOperator, - this.SpaceAfterVoidOperator, - // TypeScript-specific rules - this.NoSpaceAfterConstructor, this.NoSpaceAfterModuleImport, - this.SpaceAfterCertainTypeScriptKeywords, this.SpaceBeforeCertainTypeScriptKeywords, - this.SpaceAfterModuleName, - this.SpaceAfterArrow, - this.NoSpaceAfterEllipsis, - this.NoSpaceAfterOptionalParameters, - this.NoSpaceBetweenEmptyInterfaceBraceBrackets, - this.NoSpaceBeforeOpenAngularBracket, - this.NoSpaceBetweenCloseParenAndAngularBracket, - this.NoSpaceAfterOpenAngularBracket, - this.NoSpaceBeforeCloseAngularBracket, - this.NoSpaceAfterCloseAngularBracket, - this.SpaceBeforeAt, - this.NoSpaceAfterAt, - this.SpaceAfterDecorator, - ]; - // These rules are lower in priority than user-configurable rules. - this.LowPriorityCommonRules = - [ - this.NoSpaceBeforeSemicolon, - this.SpaceBeforeOpenBraceInControl, this.SpaceBeforeOpenBraceInFunction, this.SpaceBeforeOpenBraceInTypeScriptDeclWithBlock, - this.NoSpaceBeforeComma, - this.NoSpaceBeforeOpenBracket, this.NoSpaceAfterOpenBracket, - this.NoSpaceBeforeCloseBracket, this.NoSpaceAfterCloseBracket, - this.SpaceAfterSemicolon, - this.NoSpaceBeforeOpenParenInFuncDecl, - this.SpaceBetweenStatements, this.SpaceAfterTryFinally - ]; - /// - /// Rules controlled by user options - /// - // Insert space after comma delimiter - this.SpaceAfterComma = new formatting.Rule(formatting.RuleDescriptor.create3(23 /* CommaToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); - this.NoSpaceAfterComma = new formatting.Rule(formatting.RuleDescriptor.create3(23 /* CommaToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); - // Insert space before and after binary operators - this.SpaceBeforeBinaryOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.BinaryOperators), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); - this.SpaceAfterBinaryOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.BinaryOperators, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 2 /* Space */)); - this.NoSpaceBeforeBinaryOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.Any, formatting.Shared.TokenRange.BinaryOperators), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 8 /* Delete */)); - this.NoSpaceAfterBinaryOperator = new formatting.Rule(formatting.RuleDescriptor.create4(formatting.Shared.TokenRange.BinaryOperators, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsBinaryOpContext), 8 /* Delete */)); - // Insert space after keywords in control flow statements - this.SpaceAfterKeywordInControl = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Keywords, 16 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsControlDeclContext), 2 /* Space */)); - this.NoSpaceAfterKeywordInControl = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Keywords, 16 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsControlDeclContext), 8 /* Delete */)); - // Open Brace braces after function - //TypeScript: Function can have return types, which can be made of tons of different token kinds - this.NewLineBeforeOpenBraceInFunction = new formatting.Rule(formatting.RuleDescriptor.create2(this.FunctionOpenBraceLeftTokenRange, 14 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext, Rules.IsBeforeMultilineBlockContext), 4 /* NewLine */), 1 /* CanDeleteNewLines */); - // Open Brace braces after TypeScript module/class/interface - this.NewLineBeforeOpenBraceInTypeScriptDeclWithBlock = new formatting.Rule(formatting.RuleDescriptor.create2(this.TypeScriptOpenBraceLeftTokenRange, 14 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsTypeScriptDeclWithBlockContext, Rules.IsBeforeMultilineBlockContext), 4 /* NewLine */), 1 /* CanDeleteNewLines */); - // Open Brace braces after control block - this.NewLineBeforeOpenBraceInControl = new formatting.Rule(formatting.RuleDescriptor.create2(this.ControlOpenBraceLeftTokenRange, 14 /* OpenBraceToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsControlDeclContext, Rules.IsBeforeMultilineBlockContext), 4 /* NewLine */), 1 /* CanDeleteNewLines */); - // Insert space after semicolon in for statement - this.SpaceAfterSemicolonInFor = new formatting.Rule(formatting.RuleDescriptor.create3(22 /* SemicolonToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsForContext), 2 /* Space */)); - this.NoSpaceAfterSemicolonInFor = new formatting.Rule(formatting.RuleDescriptor.create3(22 /* SemicolonToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext, Rules.IsForContext), 8 /* Delete */)); - // Insert space after opening and before closing nonempty parenthesis - this.SpaceAfterOpenParen = new formatting.Rule(formatting.RuleDescriptor.create3(16 /* OpenParenToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); - this.SpaceBeforeCloseParen = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 17 /* CloseParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 2 /* Space */)); - this.NoSpaceBetweenParens = new formatting.Rule(formatting.RuleDescriptor.create1(16 /* OpenParenToken */, 17 /* CloseParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); - this.NoSpaceAfterOpenParen = new formatting.Rule(formatting.RuleDescriptor.create3(16 /* OpenParenToken */, formatting.Shared.TokenRange.Any), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); - this.NoSpaceBeforeCloseParen = new formatting.Rule(formatting.RuleDescriptor.create2(formatting.Shared.TokenRange.Any, 17 /* CloseParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsSameLineTokenContext), 8 /* Delete */)); - // Insert space after function keyword for anonymous functions - this.SpaceAfterAnonymousFunctionKeyword = new formatting.Rule(formatting.RuleDescriptor.create1(83 /* FunctionKeyword */, 16 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 2 /* Space */)); - this.NoSpaceAfterAnonymousFunctionKeyword = new formatting.Rule(formatting.RuleDescriptor.create1(83 /* FunctionKeyword */, 16 /* OpenParenToken */), formatting.RuleOperation.create2(new formatting.RuleOperationContext(Rules.IsFunctionDeclContext), 8 /* Delete */)); - } - Rules.prototype.getRuleName = function (rule) { - var o = this; - for (var name_29 in o) { - if (o[name_29] === rule) { - return name_29; - } - } - throw new Error("Unknown rule"); - }; - /// - /// Contexts - /// - Rules.IsForContext = function (context) { - return context.contextNode.kind === 189 /* ForStatement */; - }; - Rules.IsNotForContext = function (context) { - return !Rules.IsForContext(context); - }; - Rules.IsBinaryOpContext = function (context) { - switch (context.contextNode.kind) { - case 172 /* BinaryExpression */: - case 173 /* ConditionalExpression */: - case 143 /* TypePredicate */: - return true; - // equals in binding elements: function foo([[x, y] = [1, 2]]) - case 155 /* BindingElement */: - // equals in type X = ... - case 206 /* TypeAliasDeclaration */: - // equal in import a = module('a'); - case 211 /* ImportEqualsDeclaration */: - // equal in let a = 0; - case 201 /* VariableDeclaration */: - // equal in p = 0; - case 131 /* Parameter */: - case 229 /* EnumMember */: - case 134 /* PropertyDeclaration */: - case 133 /* PropertySignature */: - return context.currentTokenSpan.kind === 53 /* EqualsToken */ || context.nextTokenSpan.kind === 53 /* EqualsToken */; - // "in" keyword in for (let x in []) { } - case 190 /* ForInStatement */: - return context.currentTokenSpan.kind === 86 /* InKeyword */ || context.nextTokenSpan.kind === 86 /* InKeyword */; - // Technically, "of" is not a binary operator, but format it the same way as "in" - case 191 /* ForOfStatement */: - return context.currentTokenSpan.kind === 127 /* OfKeyword */ || context.nextTokenSpan.kind === 127 /* OfKeyword */; - } - return false; - }; - Rules.IsNotBinaryOpContext = function (context) { - return !Rules.IsBinaryOpContext(context); - }; - Rules.IsConditionalOperatorContext = function (context) { - return context.contextNode.kind === 173 /* ConditionalExpression */; - }; - Rules.IsSameLineTokenOrBeforeMultilineBlockContext = function (context) { - //// This check is mainly used inside SpaceBeforeOpenBraceInControl and SpaceBeforeOpenBraceInFunction. - //// - //// Ex: - //// if (1) { .... - //// * ) and { are on the same line so apply the rule. Here we don't care whether it's same or multi block context - //// - //// Ex: - //// if (1) - //// { ... } - //// * ) and { are on differnet lines. We only need to format if the block is multiline context. So in this case we don't format. - //// - //// Ex: - //// if (1) - //// { ... - //// } - //// * ) and { are on differnet lines. We only need to format if the block is multiline context. So in this case we format. - return context.TokensAreOnSameLine() || Rules.IsBeforeMultilineBlockContext(context); - }; - // This check is done before an open brace in a control construct, a function, or a typescript block declaration - Rules.IsBeforeMultilineBlockContext = function (context) { - return Rules.IsBeforeBlockContext(context) && !(context.NextNodeAllOnSameLine() || context.NextNodeBlockIsOnOneLine()); - }; - Rules.IsMultilineBlockContext = function (context) { - return Rules.IsBlockContext(context) && !(context.ContextNodeAllOnSameLine() || context.ContextNodeBlockIsOnOneLine()); - }; - Rules.IsSingleLineBlockContext = function (context) { - return Rules.IsBlockContext(context) && (context.ContextNodeAllOnSameLine() || context.ContextNodeBlockIsOnOneLine()); - }; - Rules.IsBlockContext = function (context) { - return Rules.NodeIsBlockContext(context.contextNode); - }; - Rules.IsBeforeBlockContext = function (context) { - return Rules.NodeIsBlockContext(context.nextTokenParent); - }; - // IMPORTANT!!! This method must return true ONLY for nodes with open and close braces as immediate children - Rules.NodeIsBlockContext = function (node) { - if (Rules.NodeIsTypeScriptDeclWithBlockContext(node)) { - // This means we are in a context that looks like a block to the user, but in the grammar is actually not a node (it's a class, module, enum, object type literal, etc). - return true; - } - switch (node.kind) { - case 182 /* Block */: - case 210 /* CaseBlock */: - case 157 /* ObjectLiteralExpression */: - case 209 /* ModuleBlock */: - return true; - } - return false; - }; - Rules.IsFunctionDeclContext = function (context) { - switch (context.contextNode.kind) { - case 203 /* FunctionDeclaration */: - case 136 /* MethodDeclaration */: - case 135 /* MethodSignature */: - //case SyntaxKind.MemberFunctionDeclaration: - case 138 /* GetAccessor */: - case 139 /* SetAccessor */: - ///case SyntaxKind.MethodSignature: - case 140 /* CallSignature */: - case 165 /* FunctionExpression */: - case 137 /* Constructor */: - case 166 /* ArrowFunction */: - //case SyntaxKind.ConstructorDeclaration: - //case SyntaxKind.SimpleArrowFunctionExpression: - //case SyntaxKind.ParenthesizedArrowFunctionExpression: - case 205 /* InterfaceDeclaration */: - return true; - } - return false; - }; - Rules.IsFunctionDeclarationOrFunctionExpressionContext = function (context) { - return context.contextNode.kind === 203 /* FunctionDeclaration */ || context.contextNode.kind === 165 /* FunctionExpression */; - }; - Rules.IsTypeScriptDeclWithBlockContext = function (context) { - return Rules.NodeIsTypeScriptDeclWithBlockContext(context.contextNode); - }; - Rules.NodeIsTypeScriptDeclWithBlockContext = function (node) { - switch (node.kind) { - case 204 /* ClassDeclaration */: - case 205 /* InterfaceDeclaration */: - case 207 /* EnumDeclaration */: - case 148 /* TypeLiteral */: - case 208 /* ModuleDeclaration */: - return true; - } - return false; - }; - Rules.IsAfterCodeBlockContext = function (context) { - switch (context.currentTokenParent.kind) { - case 204 /* ClassDeclaration */: - case 208 /* ModuleDeclaration */: - case 207 /* EnumDeclaration */: - case 182 /* Block */: - case 226 /* CatchClause */: - case 209 /* ModuleBlock */: - case 196 /* SwitchStatement */: - return true; - } - return false; - }; - Rules.IsControlDeclContext = function (context) { - switch (context.contextNode.kind) { - case 186 /* IfStatement */: - case 196 /* SwitchStatement */: - case 189 /* ForStatement */: - case 190 /* ForInStatement */: - case 191 /* ForOfStatement */: - case 188 /* WhileStatement */: - case 199 /* TryStatement */: - case 187 /* DoStatement */: - case 195 /* WithStatement */: - // TODO - // case SyntaxKind.ElseClause: - case 226 /* CatchClause */: - return true; - default: - return false; - } - }; - Rules.IsObjectContext = function (context) { - return context.contextNode.kind === 157 /* ObjectLiteralExpression */; - }; - Rules.IsFunctionCallContext = function (context) { - return context.contextNode.kind === 160 /* CallExpression */; - }; - Rules.IsNewContext = function (context) { - return context.contextNode.kind === 161 /* NewExpression */; - }; - Rules.IsFunctionCallOrNewContext = function (context) { - return Rules.IsFunctionCallContext(context) || Rules.IsNewContext(context); - }; - Rules.IsPreviousTokenNotComma = function (context) { - return context.currentTokenSpan.kind !== 23 /* CommaToken */; - }; - Rules.IsSameLineTokenContext = function (context) { - return context.TokensAreOnSameLine(); - }; - Rules.IsNotBeforeBlockInFunctionDeclarationContext = function (context) { - return !Rules.IsFunctionDeclContext(context) && !Rules.IsBeforeBlockContext(context); - }; - Rules.IsEndOfDecoratorContextOnSameLine = function (context) { - return context.TokensAreOnSameLine() && - context.contextNode.decorators && - Rules.NodeIsInDecoratorContext(context.currentTokenParent) && - !Rules.NodeIsInDecoratorContext(context.nextTokenParent); - }; - Rules.NodeIsInDecoratorContext = function (node) { - while (ts.isExpression(node)) { - node = node.parent; - } - return node.kind === 132 /* Decorator */; - }; - Rules.IsStartOfVariableDeclarationList = function (context) { - return context.currentTokenParent.kind === 202 /* VariableDeclarationList */ && - context.currentTokenParent.getStart(context.sourceFile) === context.currentTokenSpan.pos; - }; - Rules.IsNotFormatOnEnter = function (context) { - return context.formattingRequestKind != 2 /* FormatOnEnter */; - }; - Rules.IsModuleDeclContext = function (context) { - return context.contextNode.kind === 208 /* ModuleDeclaration */; - }; - Rules.IsObjectTypeContext = function (context) { - return context.contextNode.kind === 148 /* TypeLiteral */; // && context.contextNode.parent.kind !== SyntaxKind.InterfaceDeclaration; - }; - Rules.IsTypeArgumentOrParameter = function (token, parent) { - if (token.kind !== 24 /* LessThanToken */ && token.kind !== 25 /* GreaterThanToken */) { - return false; - } - switch (parent.kind) { - case 144 /* TypeReference */: - case 204 /* ClassDeclaration */: - case 205 /* InterfaceDeclaration */: - case 203 /* FunctionDeclaration */: - case 165 /* FunctionExpression */: - case 166 /* ArrowFunction */: - case 136 /* MethodDeclaration */: - case 135 /* MethodSignature */: - case 140 /* CallSignature */: - case 141 /* ConstructSignature */: - case 160 /* CallExpression */: - case 161 /* NewExpression */: - return true; - default: - return false; - } - }; - Rules.IsTypeArgumentOrParameterContext = function (context) { - return Rules.IsTypeArgumentOrParameter(context.currentTokenSpan, context.currentTokenParent) || - Rules.IsTypeArgumentOrParameter(context.nextTokenSpan, context.nextTokenParent); - }; - Rules.IsVoidOpContext = function (context) { - return context.currentTokenSpan.kind === 99 /* VoidKeyword */ && context.currentTokenParent.kind === 169 /* VoidExpression */; - }; - Rules.IsYieldOrYieldStarWithOperand = function (context) { - return context.contextNode.kind === 175 /* YieldExpression */ && context.contextNode.expression !== undefined; - }; - return Rules; - })(); - formatting.Rules = Rules; - })(formatting = ts.formatting || (ts.formatting = {})); -})(ts || (ts = {})); -/// -/* @internal */ -var ts; -(function (ts) { - var formatting; - (function (formatting) { - var RulesMap = (function () { - function RulesMap() { - this.map = []; - this.mapRowLength = 0; - } - RulesMap.create = function (rules) { - var result = new RulesMap(); - result.Initialize(rules); - return result; - }; - RulesMap.prototype.Initialize = function (rules) { - this.mapRowLength = 127 /* LastToken */ + 1; - this.map = new Array(this.mapRowLength * this.mapRowLength); //new Array(this.mapRowLength * this.mapRowLength); - // This array is used only during construction of the rulesbucket in the map - var rulesBucketConstructionStateList = new Array(this.map.length); //new Array(this.map.length); - this.FillRules(rules, rulesBucketConstructionStateList); - return this.map; - }; - RulesMap.prototype.FillRules = function (rules, rulesBucketConstructionStateList) { - var _this = this; - rules.forEach(function (rule) { - _this.FillRule(rule, rulesBucketConstructionStateList); - }); - }; - RulesMap.prototype.GetRuleBucketIndex = function (row, column) { - var rulesBucketIndex = (row * this.mapRowLength) + column; - //Debug.Assert(rulesBucketIndex < this.map.Length, "Trying to access an index outside the array."); - return rulesBucketIndex; - }; - RulesMap.prototype.FillRule = function (rule, rulesBucketConstructionStateList) { - var _this = this; - var specificRule = rule.Descriptor.LeftTokenRange != formatting.Shared.TokenRange.Any && - rule.Descriptor.RightTokenRange != formatting.Shared.TokenRange.Any; - rule.Descriptor.LeftTokenRange.GetTokens().forEach(function (left) { - rule.Descriptor.RightTokenRange.GetTokens().forEach(function (right) { - var rulesBucketIndex = _this.GetRuleBucketIndex(left, right); - var rulesBucket = _this.map[rulesBucketIndex]; - if (rulesBucket == undefined) { - rulesBucket = _this.map[rulesBucketIndex] = new RulesBucket(); - } - rulesBucket.AddRule(rule, specificRule, rulesBucketConstructionStateList, rulesBucketIndex); - }); - }); - }; - RulesMap.prototype.GetRule = function (context) { - var bucketIndex = this.GetRuleBucketIndex(context.currentTokenSpan.kind, context.nextTokenSpan.kind); - var bucket = this.map[bucketIndex]; - if (bucket != null) { - for (var _i = 0, _a = bucket.Rules(); _i < _a.length; _i++) { - var rule = _a[_i]; - if (rule.Operation.Context.InContext(context)) { - return rule; - } - } - } - return null; - }; - return RulesMap; - })(); - formatting.RulesMap = RulesMap; - var MaskBitSize = 5; - var Mask = 0x1f; - (function (RulesPosition) { - RulesPosition[RulesPosition["IgnoreRulesSpecific"] = 0] = "IgnoreRulesSpecific"; - RulesPosition[RulesPosition["IgnoreRulesAny"] = MaskBitSize * 1] = "IgnoreRulesAny"; - RulesPosition[RulesPosition["ContextRulesSpecific"] = MaskBitSize * 2] = "ContextRulesSpecific"; - RulesPosition[RulesPosition["ContextRulesAny"] = MaskBitSize * 3] = "ContextRulesAny"; - RulesPosition[RulesPosition["NoContextRulesSpecific"] = MaskBitSize * 4] = "NoContextRulesSpecific"; - RulesPosition[RulesPosition["NoContextRulesAny"] = MaskBitSize * 5] = "NoContextRulesAny"; - })(formatting.RulesPosition || (formatting.RulesPosition = {})); - var RulesPosition = formatting.RulesPosition; - var RulesBucketConstructionState = (function () { - function RulesBucketConstructionState() { - //// The Rules list contains all the inserted rules into a rulebucket in the following order: - //// 1- Ignore rules with specific token combination - //// 2- Ignore rules with any token combination - //// 3- Context rules with specific token combination - //// 4- Context rules with any token combination - //// 5- Non-context rules with specific token combination - //// 6- Non-context rules with any token combination - //// - //// The member rulesInsertionIndexBitmap is used to describe the number of rules - //// in each sub-bucket (above) hence can be used to know the index of where to insert - //// the next rule. It's a bitmap which contains 6 different sections each is given 5 bits. - //// - //// Example: - //// In order to insert a rule to the end of sub-bucket (3), we get the index by adding - //// the values in the bitmap segments 3rd, 2nd, and 1st. - this.rulesInsertionIndexBitmap = 0; - } - RulesBucketConstructionState.prototype.GetInsertionIndex = function (maskPosition) { - var index = 0; - var pos = 0; - var indexBitmap = this.rulesInsertionIndexBitmap; - while (pos <= maskPosition) { - index += (indexBitmap & Mask); - indexBitmap >>= MaskBitSize; - pos += MaskBitSize; - } - return index; - }; - RulesBucketConstructionState.prototype.IncreaseInsertionIndex = function (maskPosition) { - var value = (this.rulesInsertionIndexBitmap >> maskPosition) & Mask; - value++; - ts.Debug.assert((value & Mask) == value, "Adding more rules into the sub-bucket than allowed. Maximum allowed is 32 rules."); - var temp = this.rulesInsertionIndexBitmap & ~(Mask << maskPosition); - temp |= value << maskPosition; - this.rulesInsertionIndexBitmap = temp; - }; - return RulesBucketConstructionState; - })(); - formatting.RulesBucketConstructionState = RulesBucketConstructionState; - var RulesBucket = (function () { - function RulesBucket() { - this.rules = []; - } - RulesBucket.prototype.Rules = function () { - return this.rules; - }; - RulesBucket.prototype.AddRule = function (rule, specificTokens, constructionState, rulesBucketIndex) { - var position; - if (rule.Operation.Action == 1 /* Ignore */) { - position = specificTokens ? - RulesPosition.IgnoreRulesSpecific : - RulesPosition.IgnoreRulesAny; - } - else if (!rule.Operation.Context.IsAny()) { - position = specificTokens ? - RulesPosition.ContextRulesSpecific : - RulesPosition.ContextRulesAny; - } - else { - position = specificTokens ? - RulesPosition.NoContextRulesSpecific : - RulesPosition.NoContextRulesAny; - } - var state = constructionState[rulesBucketIndex]; - if (state === undefined) { - state = constructionState[rulesBucketIndex] = new RulesBucketConstructionState(); - } - var index = state.GetInsertionIndex(position); - this.rules.splice(index, 0, rule); - state.IncreaseInsertionIndex(position); - }; - return RulesBucket; - })(); - formatting.RulesBucket = RulesBucket; - })(formatting = ts.formatting || (ts.formatting = {})); -})(ts || (ts = {})); -/// -/* @internal */ -var ts; -(function (ts) { - var formatting; - (function (formatting) { - var Shared; - (function (Shared) { - var TokenRangeAccess = (function () { - function TokenRangeAccess(from, to, except) { - this.tokens = []; - for (var token = from; token <= to; token++) { - if (except.indexOf(token) < 0) { - this.tokens.push(token); - } - } - } - TokenRangeAccess.prototype.GetTokens = function () { - return this.tokens; - }; - TokenRangeAccess.prototype.Contains = function (token) { - return this.tokens.indexOf(token) >= 0; - }; - return TokenRangeAccess; - })(); - Shared.TokenRangeAccess = TokenRangeAccess; - var TokenValuesAccess = (function () { - function TokenValuesAccess(tks) { - this.tokens = tks && tks.length ? tks : []; - } - TokenValuesAccess.prototype.GetTokens = function () { - return this.tokens; - }; - TokenValuesAccess.prototype.Contains = function (token) { - return this.tokens.indexOf(token) >= 0; - }; - return TokenValuesAccess; - })(); - Shared.TokenValuesAccess = TokenValuesAccess; - var TokenSingleValueAccess = (function () { - function TokenSingleValueAccess(token) { - this.token = token; - } - TokenSingleValueAccess.prototype.GetTokens = function () { - return [this.token]; - }; - TokenSingleValueAccess.prototype.Contains = function (tokenValue) { - return tokenValue == this.token; - }; - return TokenSingleValueAccess; - })(); - Shared.TokenSingleValueAccess = TokenSingleValueAccess; - var TokenAllAccess = (function () { - function TokenAllAccess() { - } - TokenAllAccess.prototype.GetTokens = function () { - var result = []; - for (var token = 0 /* FirstToken */; token <= 127 /* LastToken */; token++) { - result.push(token); - } - return result; - }; - TokenAllAccess.prototype.Contains = function (tokenValue) { - return true; - }; - TokenAllAccess.prototype.toString = function () { - return "[allTokens]"; - }; - return TokenAllAccess; - })(); - Shared.TokenAllAccess = TokenAllAccess; - var TokenRange = (function () { - function TokenRange(tokenAccess) { - this.tokenAccess = tokenAccess; - } - TokenRange.FromToken = function (token) { - return new TokenRange(new TokenSingleValueAccess(token)); - }; - TokenRange.FromTokens = function (tokens) { - return new TokenRange(new TokenValuesAccess(tokens)); - }; - TokenRange.FromRange = function (f, to, except) { - if (except === void 0) { except = []; } - return new TokenRange(new TokenRangeAccess(f, to, except)); - }; - TokenRange.AllTokens = function () { - return new TokenRange(new TokenAllAccess()); - }; - TokenRange.prototype.GetTokens = function () { - return this.tokenAccess.GetTokens(); - }; - TokenRange.prototype.Contains = function (token) { - return this.tokenAccess.Contains(token); - }; - TokenRange.prototype.toString = function () { - return this.tokenAccess.toString(); - }; - TokenRange.Any = TokenRange.AllTokens(); - TokenRange.AnyIncludingMultilineComments = TokenRange.FromTokens(TokenRange.Any.GetTokens().concat([3 /* MultiLineCommentTrivia */])); - TokenRange.Keywords = TokenRange.FromRange(66 /* FirstKeyword */, 127 /* LastKeyword */); - TokenRange.BinaryOperators = TokenRange.FromRange(24 /* FirstBinaryOperator */, 64 /* LastBinaryOperator */); - TokenRange.BinaryKeywordOperators = TokenRange.FromTokens([86 /* InKeyword */, 87 /* InstanceOfKeyword */, 127 /* OfKeyword */, 117 /* IsKeyword */]); - TokenRange.UnaryPrefixOperators = TokenRange.FromTokens([38 /* PlusPlusToken */, 39 /* MinusMinusToken */, 47 /* TildeToken */, 46 /* ExclamationToken */]); - TokenRange.UnaryPrefixExpressions = TokenRange.FromTokens([7 /* NumericLiteral */, 65 /* Identifier */, 16 /* OpenParenToken */, 18 /* OpenBracketToken */, 14 /* OpenBraceToken */, 93 /* ThisKeyword */, 88 /* NewKeyword */]); - TokenRange.UnaryPreincrementExpressions = TokenRange.FromTokens([65 /* Identifier */, 16 /* OpenParenToken */, 93 /* ThisKeyword */, 88 /* NewKeyword */]); - TokenRange.UnaryPostincrementExpressions = TokenRange.FromTokens([65 /* Identifier */, 17 /* CloseParenToken */, 19 /* CloseBracketToken */, 88 /* NewKeyword */]); - TokenRange.UnaryPredecrementExpressions = TokenRange.FromTokens([65 /* Identifier */, 16 /* OpenParenToken */, 93 /* ThisKeyword */, 88 /* NewKeyword */]); - TokenRange.UnaryPostdecrementExpressions = TokenRange.FromTokens([65 /* Identifier */, 17 /* CloseParenToken */, 19 /* CloseBracketToken */, 88 /* NewKeyword */]); - TokenRange.Comments = TokenRange.FromTokens([2 /* SingleLineCommentTrivia */, 3 /* MultiLineCommentTrivia */]); - TokenRange.TypeNames = TokenRange.FromTokens([65 /* Identifier */, 121 /* NumberKeyword */, 123 /* StringKeyword */, 113 /* BooleanKeyword */, 124 /* SymbolKeyword */, 99 /* VoidKeyword */, 112 /* AnyKeyword */]); - return TokenRange; - })(); - Shared.TokenRange = TokenRange; - })(Shared = formatting.Shared || (formatting.Shared = {})); - })(formatting = ts.formatting || (ts.formatting = {})); -})(ts || (ts = {})); -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/* @internal */ -var ts; -(function (ts) { - var formatting; - (function (formatting) { - var RulesProvider = (function () { - function RulesProvider() { - this.globalRules = new formatting.Rules(); - } - RulesProvider.prototype.getRuleName = function (rule) { - return this.globalRules.getRuleName(rule); - }; - RulesProvider.prototype.getRuleByName = function (name) { - return this.globalRules[name]; - }; - RulesProvider.prototype.getRulesMap = function () { - return this.rulesMap; - }; - RulesProvider.prototype.ensureUpToDate = function (options) { - if (this.options == null || !ts.compareDataObjects(this.options, options)) { - var activeRules = this.createActiveRules(options); - var rulesMap = formatting.RulesMap.create(activeRules); - this.activeRules = activeRules; - this.rulesMap = rulesMap; - this.options = ts.clone(options); - } - }; - RulesProvider.prototype.createActiveRules = function (options) { - var rules = this.globalRules.HighPriorityCommonRules.slice(0); - if (options.InsertSpaceAfterCommaDelimiter) { - rules.push(this.globalRules.SpaceAfterComma); - } - else { - rules.push(this.globalRules.NoSpaceAfterComma); - } - if (options.InsertSpaceAfterFunctionKeywordForAnonymousFunctions) { - rules.push(this.globalRules.SpaceAfterAnonymousFunctionKeyword); - } - else { - rules.push(this.globalRules.NoSpaceAfterAnonymousFunctionKeyword); - } - if (options.InsertSpaceAfterKeywordsInControlFlowStatements) { - rules.push(this.globalRules.SpaceAfterKeywordInControl); - } - else { - rules.push(this.globalRules.NoSpaceAfterKeywordInControl); - } - if (options.InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis) { - rules.push(this.globalRules.SpaceAfterOpenParen); - rules.push(this.globalRules.SpaceBeforeCloseParen); - rules.push(this.globalRules.NoSpaceBetweenParens); - } - else { - rules.push(this.globalRules.NoSpaceAfterOpenParen); - rules.push(this.globalRules.NoSpaceBeforeCloseParen); - rules.push(this.globalRules.NoSpaceBetweenParens); - } - if (options.InsertSpaceAfterSemicolonInForStatements) { - rules.push(this.globalRules.SpaceAfterSemicolonInFor); - } - else { - rules.push(this.globalRules.NoSpaceAfterSemicolonInFor); - } - if (options.InsertSpaceBeforeAndAfterBinaryOperators) { - rules.push(this.globalRules.SpaceBeforeBinaryOperator); - rules.push(this.globalRules.SpaceAfterBinaryOperator); - } - else { - rules.push(this.globalRules.NoSpaceBeforeBinaryOperator); - rules.push(this.globalRules.NoSpaceAfterBinaryOperator); - } - if (options.PlaceOpenBraceOnNewLineForControlBlocks) { - rules.push(this.globalRules.NewLineBeforeOpenBraceInControl); - } - if (options.PlaceOpenBraceOnNewLineForFunctions) { - rules.push(this.globalRules.NewLineBeforeOpenBraceInFunction); - rules.push(this.globalRules.NewLineBeforeOpenBraceInTypeScriptDeclWithBlock); - } - rules = rules.concat(this.globalRules.LowPriorityCommonRules); - return rules; - }; - return RulesProvider; - })(); - formatting.RulesProvider = RulesProvider; - })(formatting = ts.formatting || (ts.formatting = {})); -})(ts || (ts = {})); -/// -/// -/// -/// -/* @internal */ -var ts; -(function (ts) { - var formatting; - (function (formatting) { - var Constants; - (function (Constants) { - Constants[Constants["Unknown"] = -1] = "Unknown"; - })(Constants || (Constants = {})); - function formatOnEnter(position, sourceFile, rulesProvider, options) { - var line = sourceFile.getLineAndCharacterOfPosition(position).line; - if (line === 0) { - return []; - } - // get the span for the previous\current line - var span = { - // get start position for the previous line - pos: ts.getStartPositionOfLine(line - 1, sourceFile), - // get end position for the current line (end value is exclusive so add 1 to the result) - end: ts.getEndLinePosition(line, sourceFile) + 1 - }; - return formatSpan(span, sourceFile, options, rulesProvider, 2 /* FormatOnEnter */); - } - formatting.formatOnEnter = formatOnEnter; - function formatOnSemicolon(position, sourceFile, rulesProvider, options) { - return formatOutermostParent(position, 22 /* SemicolonToken */, sourceFile, options, rulesProvider, 3 /* FormatOnSemicolon */); - } - formatting.formatOnSemicolon = formatOnSemicolon; - function formatOnClosingCurly(position, sourceFile, rulesProvider, options) { - return formatOutermostParent(position, 15 /* CloseBraceToken */, sourceFile, options, rulesProvider, 4 /* FormatOnClosingCurlyBrace */); - } - formatting.formatOnClosingCurly = formatOnClosingCurly; - function formatDocument(sourceFile, rulesProvider, options) { - var span = { - pos: 0, - end: sourceFile.text.length - }; - return formatSpan(span, sourceFile, options, rulesProvider, 0 /* FormatDocument */); - } - formatting.formatDocument = formatDocument; - function formatSelection(start, end, sourceFile, rulesProvider, options) { - // format from the beginning of the line - var span = { - pos: ts.getLineStartPositionForPosition(start, sourceFile), - end: end - }; - return formatSpan(span, sourceFile, options, rulesProvider, 1 /* FormatSelection */); - } - formatting.formatSelection = formatSelection; - function formatOutermostParent(position, expectedLastToken, sourceFile, options, rulesProvider, requestKind) { - var parent = findOutermostParent(position, expectedLastToken, sourceFile); - if (!parent) { - return []; - } - var span = { - pos: ts.getLineStartPositionForPosition(parent.getStart(sourceFile), sourceFile), - end: parent.end - }; - return formatSpan(span, sourceFile, options, rulesProvider, requestKind); - } - function findOutermostParent(position, expectedTokenKind, sourceFile) { - var precedingToken = ts.findPrecedingToken(position, sourceFile); - // when it is claimed that trigger character was typed at given position - // we verify that there is a token with a matching kind whose end is equal to position (because the character was just typed). - // If this condition is not hold - then trigger character was typed in some other context, - // i.e.in comment and thus should not trigger autoformatting - if (!precedingToken || - precedingToken.kind !== expectedTokenKind || - position !== precedingToken.getEnd()) { - return undefined; - } - // walk up and search for the parent node that ends at the same position with precedingToken. - // for cases like this - // - // let x = 1; - // while (true) { - // } - // after typing close curly in while statement we want to reformat just the while statement. - // However if we just walk upwards searching for the parent that has the same end value - - // we'll end up with the whole source file. isListElement allows to stop on the list element level - var current = precedingToken; - while (current && - current.parent && - current.parent.end === precedingToken.end && - !isListElement(current.parent, current)) { - current = current.parent; - } - return current; - } - // Returns true if node is a element in some list in parent - // i.e. parent is class declaration with the list of members and node is one of members. - function isListElement(parent, node) { - switch (parent.kind) { - case 204 /* ClassDeclaration */: - case 205 /* InterfaceDeclaration */: - return ts.rangeContainsRange(parent.members, node); - case 208 /* ModuleDeclaration */: - var body = parent.body; - return body && body.kind === 182 /* Block */ && ts.rangeContainsRange(body.statements, node); - case 230 /* SourceFile */: - case 182 /* Block */: - case 209 /* ModuleBlock */: - return ts.rangeContainsRange(parent.statements, node); - case 226 /* CatchClause */: - return ts.rangeContainsRange(parent.block.statements, node); - } - return false; - } - /** find node that fully contains given text range */ - function findEnclosingNode(range, sourceFile) { - return find(sourceFile); - function find(n) { - var candidate = ts.forEachChild(n, function (c) { return ts.startEndContainsRange(c.getStart(sourceFile), c.end, range) && c; }); - if (candidate) { - var result = find(candidate); - if (result) { - return result; - } - } - return n; - } - } - /** formatting is not applied to ranges that contain parse errors. - * This function will return a predicate that for a given text range will tell - * if there are any parse errors that overlap with the range. - */ - function prepareRangeContainsErrorFunction(errors, originalRange) { - if (!errors.length) { - return rangeHasNoErrors; - } - // pick only errors that fall in range - var sorted = errors - .filter(function (d) { return ts.rangeOverlapsWithStartEnd(originalRange, d.start, d.start + d.length); }) - .sort(function (e1, e2) { return e1.start - e2.start; }); - if (!sorted.length) { - return rangeHasNoErrors; - } - var index = 0; - return function (r) { - // in current implementation sequence of arguments [r1, r2...] is monotonically increasing. - // 'index' tracks the index of the most recent error that was checked. - while (true) { - if (index >= sorted.length) { - // all errors in the range were already checked -> no error in specified range - return false; - } - var error = sorted[index]; - if (r.end <= error.start) { - // specified range ends before the error refered by 'index' - no error in range - return false; - } - if (ts.startEndOverlapsWithStartEnd(r.pos, r.end, error.start, error.start + error.length)) { - // specified range overlaps with error range - return true; - } - index++; - } - }; - function rangeHasNoErrors(r) { - return false; - } - } - /** - * Start of the original range might fall inside the comment - scanner will not yield appropriate results - * This function will look for token that is located before the start of target range - * and return its end as start position for the scanner. - */ - function getScanStartPosition(enclosingNode, originalRange, sourceFile) { - var start = enclosingNode.getStart(sourceFile); - if (start === originalRange.pos && enclosingNode.end === originalRange.end) { - return start; - } - var precedingToken = ts.findPrecedingToken(originalRange.pos, sourceFile); - if (!precedingToken) { - // no preceding token found - start from the beginning of enclosing node - return enclosingNode.pos; - } - // preceding token ends after the start of original range (i.e when originaRange.pos falls in the middle of literal) - // start from the beginning of enclosingNode to handle the entire 'originalRange' - if (precedingToken.end >= originalRange.pos) { - return enclosingNode.pos; - } - return precedingToken.end; - } - /* - * For cases like - * if (a || - * b ||$ - * c) {...} - * If we hit Enter at $ we want line ' b ||' to be indented. - * Formatting will be applied to the last two lines. - * Node that fully encloses these lines is binary expression 'a ||...'. - * Initial indentation for this node will be 0. - * Binary expressions don't introduce new indentation scopes, however it is possible - * that some parent node on the same line does - like if statement in this case. - * Note that we are considering parents only from the same line with initial node - - * if parent is on the different line - its delta was already contributed - * to the initial indentation. - */ - function getOwnOrInheritedDelta(n, options, sourceFile) { - var previousLine = -1 /* Unknown */; - var childKind = 0 /* Unknown */; - while (n) { - var line = sourceFile.getLineAndCharacterOfPosition(n.getStart(sourceFile)).line; - if (previousLine !== -1 /* Unknown */ && line !== previousLine) { - break; - } - if (formatting.SmartIndenter.shouldIndentChildNode(n.kind, childKind)) { - return options.IndentSize; - } - previousLine = line; - childKind = n.kind; - n = n.parent; - } - return 0; - } - function formatSpan(originalRange, sourceFile, options, rulesProvider, requestKind) { - var rangeContainsError = prepareRangeContainsErrorFunction(sourceFile.parseDiagnostics, originalRange); - // formatting context is used by rules provider - var formattingContext = new formatting.FormattingContext(sourceFile, requestKind); - // find the smallest node that fully wraps the range and compute the initial indentation for the node - var enclosingNode = findEnclosingNode(originalRange, sourceFile); - var formattingScanner = formatting.getFormattingScanner(sourceFile, getScanStartPosition(enclosingNode, originalRange, sourceFile), originalRange.end); - var initialIndentation = formatting.SmartIndenter.getIndentationForNode(enclosingNode, originalRange, sourceFile, options); - var previousRangeHasError; - var previousRange; - var previousParent; - var previousRangeStartLine; - var lastIndentedLine; - var indentationOnLastIndentedLine; - var edits = []; - formattingScanner.advance(); - if (formattingScanner.isOnToken()) { - var startLine = sourceFile.getLineAndCharacterOfPosition(enclosingNode.getStart(sourceFile)).line; - var undecoratedStartLine = startLine; - if (enclosingNode.decorators) { - undecoratedStartLine = sourceFile.getLineAndCharacterOfPosition(ts.getNonDecoratorTokenPosOfNode(enclosingNode, sourceFile)).line; - } - var delta = getOwnOrInheritedDelta(enclosingNode, options, sourceFile); - processNode(enclosingNode, enclosingNode, startLine, undecoratedStartLine, initialIndentation, delta); - } - formattingScanner.close(); - return edits; - // local functions - /** Tries to compute the indentation for a list element. - * If list element is not in range then - * function will pick its actual indentation - * so it can be pushed downstream as inherited indentation. - * If list element is in the range - its indentation will be equal - * to inherited indentation from its predecessors. - */ - function tryComputeIndentationForListItem(startPos, endPos, parentStartLine, range, inheritedIndentation) { - if (ts.rangeOverlapsWithStartEnd(range, startPos, endPos)) { - if (inheritedIndentation !== -1 /* Unknown */) { - return inheritedIndentation; - } - } - else { - var startLine = sourceFile.getLineAndCharacterOfPosition(startPos).line; - var startLinePosition = ts.getLineStartPositionForPosition(startPos, sourceFile); - var column = formatting.SmartIndenter.findFirstNonWhitespaceColumn(startLinePosition, startPos, sourceFile, options); - if (startLine !== parentStartLine || startPos === column) { - return column; - } - } - return -1 /* Unknown */; - } - function computeIndentation(node, startLine, inheritedIndentation, parent, parentDynamicIndentation, effectiveParentStartLine) { - var indentation = inheritedIndentation; - if (indentation === -1 /* Unknown */) { - if (isSomeBlock(node.kind)) { - // blocks should be indented in - // - other blocks - // - source file - // - switch\default clauses - if (isSomeBlock(parent.kind) || - parent.kind === 230 /* SourceFile */ || - parent.kind === 223 /* CaseClause */ || - parent.kind === 224 /* DefaultClause */) { - indentation = parentDynamicIndentation.getIndentation() + parentDynamicIndentation.getDelta(); - } - else { - indentation = parentDynamicIndentation.getIndentation(); - } - } - else { - if (formatting.SmartIndenter.childStartsOnTheSameLineWithElseInIfStatement(parent, node, startLine, sourceFile)) { - indentation = parentDynamicIndentation.getIndentation(); - } - else { - indentation = parentDynamicIndentation.getIndentation() + parentDynamicIndentation.getDelta(); - } - } - } - var delta = formatting.SmartIndenter.shouldIndentChildNode(node.kind, 0 /* Unknown */) ? options.IndentSize : 0; - if (effectiveParentStartLine === startLine) { - // if node is located on the same line with the parent - // - inherit indentation from the parent - // - push children if either parent of node itself has non-zero delta - indentation = startLine === lastIndentedLine - ? indentationOnLastIndentedLine - : parentDynamicIndentation.getIndentation(); - delta = Math.min(options.IndentSize, parentDynamicIndentation.getDelta() + delta); - } - return { - indentation: indentation, - delta: delta - }; - } - function getFirstNonDecoratorTokenOfNode(node) { - if (node.modifiers && node.modifiers.length) { - return node.modifiers[0].kind; - } - switch (node.kind) { - case 204 /* ClassDeclaration */: return 69 /* ClassKeyword */; - case 205 /* InterfaceDeclaration */: return 103 /* InterfaceKeyword */; - case 203 /* FunctionDeclaration */: return 83 /* FunctionKeyword */; - case 207 /* EnumDeclaration */: return 207 /* EnumDeclaration */; - case 138 /* GetAccessor */: return 116 /* GetKeyword */; - case 139 /* SetAccessor */: return 122 /* SetKeyword */; - case 136 /* MethodDeclaration */: - if (node.asteriskToken) { - return 35 /* AsteriskToken */; - } - // fall-through - case 134 /* PropertyDeclaration */: - case 131 /* Parameter */: - return node.name.kind; - } - } - function getDynamicIndentation(node, nodeStartLine, indentation, delta) { - return { - getIndentationForComment: function (kind) { - switch (kind) { - // preceding comment to the token that closes the indentation scope inherits the indentation from the scope - // .. { - // // comment - // } - case 15 /* CloseBraceToken */: - case 19 /* CloseBracketToken */: - return indentation + delta; - } - return indentation; - }, - getIndentationForToken: function (line, kind) { - if (nodeStartLine !== line && node.decorators) { - if (kind === getFirstNonDecoratorTokenOfNode(node)) { - // if this token is the first token following the list of decorators, we do not need to indent - return indentation; - } - } - switch (kind) { - // open and close brace, 'else' and 'while' (in do statement) tokens has indentation of the parent - case 14 /* OpenBraceToken */: - case 15 /* CloseBraceToken */: - case 18 /* OpenBracketToken */: - case 19 /* CloseBracketToken */: - case 76 /* ElseKeyword */: - case 100 /* WhileKeyword */: - case 52 /* AtToken */: - return indentation; - default: - // if token line equals to the line of containing node (this is a first token in the node) - use node indentation - return nodeStartLine !== line ? indentation + delta : indentation; - } - }, - getIndentation: function () { return indentation; }, - getDelta: function () { return delta; }, - recomputeIndentation: function (lineAdded) { - if (node.parent && formatting.SmartIndenter.shouldIndentChildNode(node.parent.kind, node.kind)) { - if (lineAdded) { - indentation += options.IndentSize; - } - else { - indentation -= options.IndentSize; - } - if (formatting.SmartIndenter.shouldIndentChildNode(node.kind, 0 /* Unknown */)) { - delta = options.IndentSize; - } - else { - delta = 0; - } - } - } - }; - } - function processNode(node, contextNode, nodeStartLine, undecoratedNodeStartLine, indentation, delta) { - if (!ts.rangeOverlapsWithStartEnd(originalRange, node.getStart(sourceFile), node.getEnd())) { - return; - } - var nodeDynamicIndentation = getDynamicIndentation(node, nodeStartLine, indentation, delta); - // a useful observations when tracking context node - // / - // [a] - // / | \ - // [b] [c] [d] - // node 'a' is a context node for nodes 'b', 'c', 'd' - // except for the leftmost leaf token in [b] - in this case context node ('e') is located somewhere above 'a' - // this rule can be applied recursively to child nodes of 'a'. - // - // context node is set to parent node value after processing every child node - // context node is set to parent of the token after processing every token - var childContextNode = contextNode; - // if there are any tokens that logically belong to node and interleave child nodes - // such tokens will be consumed in processChildNode for for the child that follows them - ts.forEachChild(node, function (child) { - processChildNode(child, -1 /* Unknown */, node, nodeDynamicIndentation, nodeStartLine, undecoratedNodeStartLine, false); - }, function (nodes) { - processChildNodes(nodes, node, nodeStartLine, nodeDynamicIndentation); - }); - // proceed any tokens in the node that are located after child nodes - while (formattingScanner.isOnToken()) { - var tokenInfo = formattingScanner.readTokenInfo(node); - if (tokenInfo.token.end > node.end) { - break; - } - consumeTokenAndAdvanceScanner(tokenInfo, node, nodeDynamicIndentation); - } - function processChildNode(child, inheritedIndentation, parent, parentDynamicIndentation, parentStartLine, undecoratedParentStartLine, isListItem) { - var childStartPos = child.getStart(sourceFile); - var childStartLine = sourceFile.getLineAndCharacterOfPosition(childStartPos).line; - var undecoratedChildStartLine = childStartLine; - if (child.decorators) { - undecoratedChildStartLine = sourceFile.getLineAndCharacterOfPosition(ts.getNonDecoratorTokenPosOfNode(child, sourceFile)).line; - } - // if child is a list item - try to get its indentation - var childIndentationAmount = -1 /* Unknown */; - if (isListItem) { - childIndentationAmount = tryComputeIndentationForListItem(childStartPos, child.end, parentStartLine, originalRange, inheritedIndentation); - if (childIndentationAmount !== -1 /* Unknown */) { - inheritedIndentation = childIndentationAmount; - } - } - // child node is outside the target range - do not dive inside - if (!ts.rangeOverlapsWithStartEnd(originalRange, child.pos, child.end)) { - return inheritedIndentation; - } - if (child.getFullWidth() === 0) { - return inheritedIndentation; - } - while (formattingScanner.isOnToken()) { - // proceed any parent tokens that are located prior to child.getStart() - var tokenInfo = formattingScanner.readTokenInfo(node); - if (tokenInfo.token.end > childStartPos) { - // stop when formatting scanner advances past the beginning of the child - break; - } - consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation); - } - if (!formattingScanner.isOnToken()) { - return inheritedIndentation; - } - if (ts.isToken(child)) { - // if child node is a token, it does not impact indentation, proceed it using parent indentation scope rules - var tokenInfo = formattingScanner.readTokenInfo(child); - ts.Debug.assert(tokenInfo.token.end === child.end); - consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation); - return inheritedIndentation; - } - var effectiveParentStartLine = child.kind === 132 /* Decorator */ ? childStartLine : undecoratedParentStartLine; - var childIndentation = computeIndentation(child, childStartLine, childIndentationAmount, node, parentDynamicIndentation, effectiveParentStartLine); - processNode(child, childContextNode, childStartLine, undecoratedChildStartLine, childIndentation.indentation, childIndentation.delta); - childContextNode = node; - return inheritedIndentation; - } - function processChildNodes(nodes, parent, parentStartLine, parentDynamicIndentation) { - var listStartToken = getOpenTokenForList(parent, nodes); - var listEndToken = getCloseTokenForOpenToken(listStartToken); - var listDynamicIndentation = parentDynamicIndentation; - var startLine = parentStartLine; - if (listStartToken !== 0 /* Unknown */) { - // introduce a new indentation scope for lists (including list start and end tokens) - while (formattingScanner.isOnToken()) { - var tokenInfo = formattingScanner.readTokenInfo(parent); - if (tokenInfo.token.end > nodes.pos) { - // stop when formatting scanner moves past the beginning of node list - break; - } - else if (tokenInfo.token.kind === listStartToken) { - // consume list start token - startLine = sourceFile.getLineAndCharacterOfPosition(tokenInfo.token.pos).line; - var indentation_1 = computeIndentation(tokenInfo.token, startLine, -1 /* Unknown */, parent, parentDynamicIndentation, startLine); - listDynamicIndentation = getDynamicIndentation(parent, parentStartLine, indentation_1.indentation, indentation_1.delta); - consumeTokenAndAdvanceScanner(tokenInfo, parent, listDynamicIndentation); - } - else { - // consume any tokens that precede the list as child elements of 'node' using its indentation scope - consumeTokenAndAdvanceScanner(tokenInfo, parent, parentDynamicIndentation); - } - } - } - var inheritedIndentation = -1 /* Unknown */; - for (var _i = 0; _i < nodes.length; _i++) { - var child = nodes[_i]; - inheritedIndentation = processChildNode(child, inheritedIndentation, node, listDynamicIndentation, startLine, startLine, true); - } - if (listEndToken !== 0 /* Unknown */) { - if (formattingScanner.isOnToken()) { - var tokenInfo = formattingScanner.readTokenInfo(parent); - // consume the list end token only if it is still belong to the parent - // there might be the case when current token matches end token but does not considered as one - // function (x: function) <-- - // without this check close paren will be interpreted as list end token for function expression which is wrong - if (tokenInfo.token.kind === listEndToken && ts.rangeContainsRange(parent, tokenInfo.token)) { - // consume list end token - consumeTokenAndAdvanceScanner(tokenInfo, parent, listDynamicIndentation); - } - } - } - } - function consumeTokenAndAdvanceScanner(currentTokenInfo, parent, dynamicIndentation) { - ts.Debug.assert(ts.rangeContainsRange(parent, currentTokenInfo.token)); - var lastTriviaWasNewLine = formattingScanner.lastTrailingTriviaWasNewLine(); - var indentToken = false; - if (currentTokenInfo.leadingTrivia) { - processTrivia(currentTokenInfo.leadingTrivia, parent, childContextNode, dynamicIndentation); - } - var lineAdded; - var isTokenInRange = ts.rangeContainsRange(originalRange, currentTokenInfo.token); - var tokenStart = sourceFile.getLineAndCharacterOfPosition(currentTokenInfo.token.pos); - if (isTokenInRange) { - var rangeHasError = rangeContainsError(currentTokenInfo.token); - // save prevStartLine since processRange will overwrite this value with current ones - var prevStartLine = previousRangeStartLine; - lineAdded = processRange(currentTokenInfo.token, tokenStart, parent, childContextNode, dynamicIndentation); - if (rangeHasError) { - // do not indent comments\token if token range overlaps with some error - indentToken = false; - } - else { - if (lineAdded !== undefined) { - indentToken = lineAdded; - } - else { - indentToken = lastTriviaWasNewLine && tokenStart.line !== prevStartLine; - } - } - } - if (currentTokenInfo.trailingTrivia) { - processTrivia(currentTokenInfo.trailingTrivia, parent, childContextNode, dynamicIndentation); - } - if (indentToken) { - var indentNextTokenOrTrivia = true; - if (currentTokenInfo.leadingTrivia) { - for (var _i = 0, _a = currentTokenInfo.leadingTrivia; _i < _a.length; _i++) { - var triviaItem = _a[_i]; - if (!ts.rangeContainsRange(originalRange, triviaItem)) { - continue; - } - switch (triviaItem.kind) { - case 3 /* MultiLineCommentTrivia */: - var commentIndentation = dynamicIndentation.getIndentationForComment(currentTokenInfo.token.kind); - indentMultilineComment(triviaItem, commentIndentation, !indentNextTokenOrTrivia); - indentNextTokenOrTrivia = false; - break; - case 2 /* SingleLineCommentTrivia */: - if (indentNextTokenOrTrivia) { - var commentIndentation_1 = dynamicIndentation.getIndentationForComment(currentTokenInfo.token.kind); - insertIndentation(triviaItem.pos, commentIndentation_1, false); - indentNextTokenOrTrivia = false; - } - break; - case 4 /* NewLineTrivia */: - indentNextTokenOrTrivia = true; - break; - } - } - } - // indent token only if is it is in target range and does not overlap with any error ranges - if (isTokenInRange && !rangeContainsError(currentTokenInfo.token)) { - var tokenIndentation = dynamicIndentation.getIndentationForToken(tokenStart.line, currentTokenInfo.token.kind); - insertIndentation(currentTokenInfo.token.pos, tokenIndentation, lineAdded); - lastIndentedLine = tokenStart.line; - indentationOnLastIndentedLine = tokenIndentation; - } - } - formattingScanner.advance(); - childContextNode = parent; - } - } - function processTrivia(trivia, parent, contextNode, dynamicIndentation) { - for (var _i = 0; _i < trivia.length; _i++) { - var triviaItem = trivia[_i]; - if (ts.isComment(triviaItem.kind) && ts.rangeContainsRange(originalRange, triviaItem)) { - var triviaItemStart = sourceFile.getLineAndCharacterOfPosition(triviaItem.pos); - processRange(triviaItem, triviaItemStart, parent, contextNode, dynamicIndentation); - } - } - } - function processRange(range, rangeStart, parent, contextNode, dynamicIndentation) { - var rangeHasError = rangeContainsError(range); - var lineAdded; - if (!rangeHasError && !previousRangeHasError) { - if (!previousRange) { - // trim whitespaces starting from the beginning of the span up to the current line - var originalStart = sourceFile.getLineAndCharacterOfPosition(originalRange.pos); - trimTrailingWhitespacesForLines(originalStart.line, rangeStart.line); - } - else { - lineAdded = - processPair(range, rangeStart.line, parent, previousRange, previousRangeStartLine, previousParent, contextNode, dynamicIndentation); - } - } - previousRange = range; - previousParent = parent; - previousRangeStartLine = rangeStart.line; - previousRangeHasError = rangeHasError; - return lineAdded; - } - function processPair(currentItem, currentStartLine, currentParent, previousItem, previousStartLine, previousParent, contextNode, dynamicIndentation) { - formattingContext.updateContext(previousItem, previousParent, currentItem, currentParent, contextNode); - var rule = rulesProvider.getRulesMap().GetRule(formattingContext); - var trimTrailingWhitespaces; - var lineAdded; - if (rule) { - applyRuleEdits(rule, previousItem, previousStartLine, currentItem, currentStartLine); - if (rule.Operation.Action & (2 /* Space */ | 8 /* Delete */) && currentStartLine !== previousStartLine) { - lineAdded = false; - // Handle the case where the next line is moved to be the end of this line. - // In this case we don't indent the next line in the next pass. - if (currentParent.getStart(sourceFile) === currentItem.pos) { - dynamicIndentation.recomputeIndentation(false); - } - } - else if (rule.Operation.Action & 4 /* NewLine */ && currentStartLine === previousStartLine) { - lineAdded = true; - // Handle the case where token2 is moved to the new line. - // In this case we indent token2 in the next pass but we set - // sameLineIndent flag to notify the indenter that the indentation is within the line. - if (currentParent.getStart(sourceFile) === currentItem.pos) { - dynamicIndentation.recomputeIndentation(true); - } - } - // We need to trim trailing whitespace between the tokens if they were on different lines, and no rule was applied to put them on the same line - trimTrailingWhitespaces = - (rule.Operation.Action & (4 /* NewLine */ | 2 /* Space */)) && - rule.Flag !== 1 /* CanDeleteNewLines */; - } - else { - trimTrailingWhitespaces = true; - } - if (currentStartLine !== previousStartLine && trimTrailingWhitespaces) { - // We need to trim trailing whitespace between the tokens if they were on different lines, and no rule was applied to put them on the same line - trimTrailingWhitespacesForLines(previousStartLine, currentStartLine, previousItem); - } - return lineAdded; - } - function insertIndentation(pos, indentation, lineAdded) { - var indentationString = getIndentationString(indentation, options); - if (lineAdded) { - // new line is added before the token by the formatting rules - // insert indentation string at the very beginning of the token - recordReplace(pos, 0, indentationString); - } - else { - var tokenStart = sourceFile.getLineAndCharacterOfPosition(pos); - if (indentation !== tokenStart.character) { - var startLinePosition = ts.getStartPositionOfLine(tokenStart.line, sourceFile); - recordReplace(startLinePosition, tokenStart.character, indentationString); - } - } - } - function indentMultilineComment(commentRange, indentation, firstLineIsIndented) { - // split comment in lines - var startLine = sourceFile.getLineAndCharacterOfPosition(commentRange.pos).line; - var endLine = sourceFile.getLineAndCharacterOfPosition(commentRange.end).line; - var parts; - if (startLine === endLine) { - if (!firstLineIsIndented) { - // treat as single line comment - insertIndentation(commentRange.pos, indentation, false); - } - return; - } - else { - parts = []; - var startPos = commentRange.pos; - for (var line = startLine; line < endLine; ++line) { - var endOfLine = ts.getEndLinePosition(line, sourceFile); - parts.push({ pos: startPos, end: endOfLine }); - startPos = ts.getStartPositionOfLine(line + 1, sourceFile); - } - parts.push({ pos: startPos, end: commentRange.end }); - } - var startLinePos = ts.getStartPositionOfLine(startLine, sourceFile); - var nonWhitespaceColumnInFirstPart = formatting.SmartIndenter.findFirstNonWhitespaceCharacterAndColumn(startLinePos, parts[0].pos, sourceFile, options); - if (indentation === nonWhitespaceColumnInFirstPart.column) { - return; - } - var startIndex = 0; - if (firstLineIsIndented) { - startIndex = 1; - startLine++; - } - // shift all parts on the delta size - var delta = indentation - nonWhitespaceColumnInFirstPart.column; - for (var i = startIndex, len = parts.length; i < len; ++i, ++startLine) { - var startLinePos_1 = ts.getStartPositionOfLine(startLine, sourceFile); - var nonWhitespaceCharacterAndColumn = i === 0 - ? nonWhitespaceColumnInFirstPart - : formatting.SmartIndenter.findFirstNonWhitespaceCharacterAndColumn(parts[i].pos, parts[i].end, sourceFile, options); - var newIndentation = nonWhitespaceCharacterAndColumn.column + delta; - if (newIndentation > 0) { - var indentationString = getIndentationString(newIndentation, options); - recordReplace(startLinePos_1, nonWhitespaceCharacterAndColumn.character, indentationString); - } - else { - recordDelete(startLinePos_1, nonWhitespaceCharacterAndColumn.character); - } - } - } - function trimTrailingWhitespacesForLines(line1, line2, range) { - for (var line = line1; line < line2; ++line) { - var lineStartPosition = ts.getStartPositionOfLine(line, sourceFile); - var lineEndPosition = ts.getEndLinePosition(line, sourceFile); - // do not trim whitespaces in comments - if (range && ts.isComment(range.kind) && range.pos <= lineEndPosition && range.end > lineEndPosition) { - continue; - } - var pos = lineEndPosition; - while (pos >= lineStartPosition && ts.isWhiteSpace(sourceFile.text.charCodeAt(pos))) { - pos--; - } - if (pos !== lineEndPosition) { - ts.Debug.assert(pos === lineStartPosition || !ts.isWhiteSpace(sourceFile.text.charCodeAt(pos))); - recordDelete(pos + 1, lineEndPosition - pos); - } - } - } - function newTextChange(start, len, newText) { - return { span: ts.createTextSpan(start, len), newText: newText }; - } - function recordDelete(start, len) { - if (len) { - edits.push(newTextChange(start, len, "")); - } - } - function recordReplace(start, len, newText) { - if (len || newText) { - edits.push(newTextChange(start, len, newText)); - } - } - function applyRuleEdits(rule, previousRange, previousStartLine, currentRange, currentStartLine) { - var between; - switch (rule.Operation.Action) { - case 1 /* Ignore */: - // no action required - return; - case 8 /* Delete */: - if (previousRange.end !== currentRange.pos) { - // delete characters starting from t1.end up to t2.pos exclusive - recordDelete(previousRange.end, currentRange.pos - previousRange.end); - } - break; - case 4 /* NewLine */: - // exit early if we on different lines and rule cannot change number of newlines - // if line1 and line2 are on subsequent lines then no edits are required - ok to exit - // if line1 and line2 are separated with more than one newline - ok to exit since we cannot delete extra new lines - if (rule.Flag !== 1 /* CanDeleteNewLines */ && previousStartLine !== currentStartLine) { - return; - } - // edit should not be applied only if we have one line feed between elements - var lineDelta = currentStartLine - previousStartLine; - if (lineDelta !== 1) { - recordReplace(previousRange.end, currentRange.pos - previousRange.end, options.NewLineCharacter); - } - break; - case 2 /* Space */: - // exit early if we on different lines and rule cannot change number of newlines - if (rule.Flag !== 1 /* CanDeleteNewLines */ && previousStartLine !== currentStartLine) { - return; - } - var posDelta = currentRange.pos - previousRange.end; - if (posDelta !== 1 || sourceFile.text.charCodeAt(previousRange.end) !== 32 /* space */) { - recordReplace(previousRange.end, currentRange.pos - previousRange.end, " "); - } - break; - } - } - } - function isSomeBlock(kind) { - switch (kind) { - case 182 /* Block */: - case 209 /* ModuleBlock */: - return true; - } - return false; - } - function getOpenTokenForList(node, list) { - switch (node.kind) { - case 137 /* Constructor */: - case 203 /* FunctionDeclaration */: - case 165 /* FunctionExpression */: - case 136 /* MethodDeclaration */: - case 135 /* MethodSignature */: - case 166 /* ArrowFunction */: - if (node.typeParameters === list) { - return 24 /* LessThanToken */; - } - else if (node.parameters === list) { - return 16 /* OpenParenToken */; - } - break; - case 160 /* CallExpression */: - case 161 /* NewExpression */: - if (node.typeArguments === list) { - return 24 /* LessThanToken */; - } - else if (node.arguments === list) { - return 16 /* OpenParenToken */; - } - break; - case 144 /* TypeReference */: - if (node.typeArguments === list) { - return 24 /* LessThanToken */; - } - } - return 0 /* Unknown */; - } - function getCloseTokenForOpenToken(kind) { - switch (kind) { - case 16 /* OpenParenToken */: - return 17 /* CloseParenToken */; - case 24 /* LessThanToken */: - return 25 /* GreaterThanToken */; - } - return 0 /* Unknown */; - } - var internedSizes; - var internedTabsIndentation; - var internedSpacesIndentation; - function getIndentationString(indentation, options) { - // reset interned strings if FormatCodeOptions were changed - var resetInternedStrings = !internedSizes || (internedSizes.tabSize !== options.TabSize || internedSizes.indentSize !== options.IndentSize); - if (resetInternedStrings) { - internedSizes = { tabSize: options.TabSize, indentSize: options.IndentSize }; - internedTabsIndentation = internedSpacesIndentation = undefined; - } - if (!options.ConvertTabsToSpaces) { - var tabs = Math.floor(indentation / options.TabSize); - var spaces = indentation - tabs * options.TabSize; - var tabString; - if (!internedTabsIndentation) { - internedTabsIndentation = []; - } - if (internedTabsIndentation[tabs] === undefined) { - internedTabsIndentation[tabs] = tabString = repeat('\t', tabs); - } - else { - tabString = internedTabsIndentation[tabs]; - } - return spaces ? tabString + repeat(" ", spaces) : tabString; - } - else { - var spacesString; - var quotient = Math.floor(indentation / options.IndentSize); - var remainder = indentation % options.IndentSize; - if (!internedSpacesIndentation) { - internedSpacesIndentation = []; - } - if (internedSpacesIndentation[quotient] === undefined) { - spacesString = repeat(" ", options.IndentSize * quotient); - internedSpacesIndentation[quotient] = spacesString; - } - else { - spacesString = internedSpacesIndentation[quotient]; - } - return remainder ? spacesString + repeat(" ", remainder) : spacesString; - } - function repeat(value, count) { - var s = ""; - for (var i = 0; i < count; ++i) { - s += value; - } - return s; - } - } - formatting.getIndentationString = getIndentationString; - })(formatting = ts.formatting || (ts.formatting = {})); -})(ts || (ts = {})); -/// -/* @internal */ -var ts; -(function (ts) { - var formatting; - (function (formatting) { - var SmartIndenter; - (function (SmartIndenter) { - var Value; - (function (Value) { - Value[Value["Unknown"] = -1] = "Unknown"; - })(Value || (Value = {})); - function getIndentation(position, sourceFile, options) { - if (position > sourceFile.text.length) { - return 0; // past EOF - } - var precedingToken = ts.findPrecedingToken(position, sourceFile); - if (!precedingToken) { - return 0; - } - // no indentation in string \regex\template literals - var precedingTokenIsLiteral = precedingToken.kind === 8 /* StringLiteral */ || - precedingToken.kind === 9 /* RegularExpressionLiteral */ || - precedingToken.kind === 10 /* NoSubstitutionTemplateLiteral */ || - precedingToken.kind === 11 /* TemplateHead */ || - precedingToken.kind === 12 /* TemplateMiddle */ || - precedingToken.kind === 13 /* TemplateTail */; - if (precedingTokenIsLiteral && precedingToken.getStart(sourceFile) <= position && precedingToken.end > position) { - return 0; - } - var lineAtPosition = sourceFile.getLineAndCharacterOfPosition(position).line; - if (precedingToken.kind === 23 /* CommaToken */ && precedingToken.parent.kind !== 172 /* BinaryExpression */) { - // previous token is comma that separates items in list - find the previous item and try to derive indentation from it - var actualIndentation = getActualIndentationForListItemBeforeComma(precedingToken, sourceFile, options); - if (actualIndentation !== -1 /* Unknown */) { - return actualIndentation; - } - } - // try to find node that can contribute to indentation and includes 'position' starting from 'precedingToken' - // if such node is found - compute initial indentation for 'position' inside this node - var previous; - var current = precedingToken; - var currentStart; - var indentationDelta; - while (current) { - if (ts.positionBelongsToNode(current, position, sourceFile) && shouldIndentChildNode(current.kind, previous ? previous.kind : 0 /* Unknown */)) { - currentStart = getStartLineAndCharacterForNode(current, sourceFile); - if (nextTokenIsCurlyBraceOnSameLineAsCursor(precedingToken, current, lineAtPosition, sourceFile)) { - indentationDelta = 0; - } - else { - indentationDelta = lineAtPosition !== currentStart.line ? options.IndentSize : 0; - } - break; - } - // check if current node is a list item - if yes, take indentation from it - var actualIndentation = getActualIndentationForListItem(current, sourceFile, options); - if (actualIndentation !== -1 /* Unknown */) { - return actualIndentation; - } - previous = current; - current = current.parent; - } - if (!current) { - // no parent was found - return 0 to be indented on the level of SourceFile - return 0; - } - return getIndentationForNodeWorker(current, currentStart, undefined, indentationDelta, sourceFile, options); - } - SmartIndenter.getIndentation = getIndentation; - function getIndentationForNode(n, ignoreActualIndentationRange, sourceFile, options) { - var start = sourceFile.getLineAndCharacterOfPosition(n.getStart(sourceFile)); - return getIndentationForNodeWorker(n, start, ignoreActualIndentationRange, 0, sourceFile, options); - } - SmartIndenter.getIndentationForNode = getIndentationForNode; - function getIndentationForNodeWorker(current, currentStart, ignoreActualIndentationRange, indentationDelta, sourceFile, options) { - var parent = current.parent; - var parentStart; - // walk upwards and collect indentations for pairs of parent-child nodes - // indentation is not added if parent and child nodes start on the same line or if parent is IfStatement and child starts on the same line with 'else clause' - while (parent) { - var useActualIndentation = true; - if (ignoreActualIndentationRange) { - var start = current.getStart(sourceFile); - useActualIndentation = start < ignoreActualIndentationRange.pos || start > ignoreActualIndentationRange.end; - } - if (useActualIndentation) { - // check if current node is a list item - if yes, take indentation from it - var actualIndentation = getActualIndentationForListItem(current, sourceFile, options); - if (actualIndentation !== -1 /* Unknown */) { - return actualIndentation + indentationDelta; - } - } - parentStart = getParentStart(parent, current, sourceFile); - var parentAndChildShareLine = parentStart.line === currentStart.line || - childStartsOnTheSameLineWithElseInIfStatement(parent, current, currentStart.line, sourceFile); - if (useActualIndentation) { - // try to fetch actual indentation for current node from source text - var actualIndentation = getActualIndentationForNode(current, parent, currentStart, parentAndChildShareLine, sourceFile, options); - if (actualIndentation !== -1 /* Unknown */) { - return actualIndentation + indentationDelta; - } - } - // increase indentation if parent node wants its content to be indented and parent and child nodes don't start on the same line - if (shouldIndentChildNode(parent.kind, current.kind) && !parentAndChildShareLine) { - indentationDelta += options.IndentSize; - } - current = parent; - currentStart = parentStart; - parent = current.parent; - } - return indentationDelta; - } - function getParentStart(parent, child, sourceFile) { - var containingList = getContainingList(child, sourceFile); - if (containingList) { - return sourceFile.getLineAndCharacterOfPosition(containingList.pos); - } - return sourceFile.getLineAndCharacterOfPosition(parent.getStart(sourceFile)); - } - /* - * Function returns Value.Unknown if indentation cannot be determined - */ - function getActualIndentationForListItemBeforeComma(commaToken, sourceFile, options) { - // previous token is comma that separates items in list - find the previous item and try to derive indentation from it - var commaItemInfo = ts.findListItemInfo(commaToken); - if (commaItemInfo && commaItemInfo.listItemIndex > 0) { - return deriveActualIndentationFromList(commaItemInfo.list.getChildren(), commaItemInfo.listItemIndex - 1, sourceFile, options); - } - else { - // handle broken code gracefully - return -1 /* Unknown */; - } - } - /* - * Function returns Value.Unknown if actual indentation for node should not be used (i.e because node is nested expression) - */ - function getActualIndentationForNode(current, parent, currentLineAndChar, parentAndChildShareLine, sourceFile, options) { - // actual indentation is used for statements\declarations if one of cases below is true: - // - parent is SourceFile - by default immediate children of SourceFile are not indented except when user indents them manually - // - parent and child are not on the same line - var useActualIndentation = (ts.isDeclaration(current) || ts.isStatement(current)) && - (parent.kind === 230 /* SourceFile */ || !parentAndChildShareLine); - if (!useActualIndentation) { - return -1 /* Unknown */; - } - return findColumnForFirstNonWhitespaceCharacterInLine(currentLineAndChar, sourceFile, options); - } - function nextTokenIsCurlyBraceOnSameLineAsCursor(precedingToken, current, lineAtPosition, sourceFile) { - var nextToken = ts.findNextToken(precedingToken, current); - if (!nextToken) { - return false; - } - if (nextToken.kind === 14 /* OpenBraceToken */) { - // open braces are always indented at the parent level - return true; - } - else if (nextToken.kind === 15 /* CloseBraceToken */) { - // close braces are indented at the parent level if they are located on the same line with cursor - // this means that if new line will be added at $ position, this case will be indented - // class A { - // $ - // } - /// and this one - not - // class A { - // $} - var nextTokenStartLine = getStartLineAndCharacterForNode(nextToken, sourceFile).line; - return lineAtPosition === nextTokenStartLine; - } - return false; - } - function getStartLineAndCharacterForNode(n, sourceFile) { - return sourceFile.getLineAndCharacterOfPosition(n.getStart(sourceFile)); - } - function childStartsOnTheSameLineWithElseInIfStatement(parent, child, childStartLine, sourceFile) { - if (parent.kind === 186 /* IfStatement */ && parent.elseStatement === child) { - var elseKeyword = ts.findChildOfKind(parent, 76 /* ElseKeyword */, sourceFile); - ts.Debug.assert(elseKeyword !== undefined); - var elseKeywordStartLine = getStartLineAndCharacterForNode(elseKeyword, sourceFile).line; - return elseKeywordStartLine === childStartLine; - } - return false; - } - SmartIndenter.childStartsOnTheSameLineWithElseInIfStatement = childStartsOnTheSameLineWithElseInIfStatement; - function getContainingList(node, sourceFile) { - if (node.parent) { - switch (node.parent.kind) { - case 144 /* TypeReference */: - if (node.parent.typeArguments && - ts.rangeContainsStartEnd(node.parent.typeArguments, node.getStart(sourceFile), node.getEnd())) { - return node.parent.typeArguments; - } - break; - case 157 /* ObjectLiteralExpression */: - return node.parent.properties; - case 156 /* ArrayLiteralExpression */: - return node.parent.elements; - case 203 /* FunctionDeclaration */: - case 165 /* FunctionExpression */: - case 166 /* ArrowFunction */: - case 136 /* MethodDeclaration */: - case 135 /* MethodSignature */: - case 140 /* CallSignature */: - case 141 /* ConstructSignature */: { - var start = node.getStart(sourceFile); - if (node.parent.typeParameters && - ts.rangeContainsStartEnd(node.parent.typeParameters, start, node.getEnd())) { - return node.parent.typeParameters; - } - if (ts.rangeContainsStartEnd(node.parent.parameters, start, node.getEnd())) { - return node.parent.parameters; - } - break; - } - case 161 /* NewExpression */: - case 160 /* CallExpression */: { - var start = node.getStart(sourceFile); - if (node.parent.typeArguments && - ts.rangeContainsStartEnd(node.parent.typeArguments, start, node.getEnd())) { - return node.parent.typeArguments; - } - if (node.parent.arguments && - ts.rangeContainsStartEnd(node.parent.arguments, start, node.getEnd())) { - return node.parent.arguments; - } - break; - } - } - } - return undefined; - } - function getActualIndentationForListItem(node, sourceFile, options) { - var containingList = getContainingList(node, sourceFile); - return containingList ? getActualIndentationFromList(containingList) : -1 /* Unknown */; - function getActualIndentationFromList(list) { - var index = ts.indexOf(list, node); - return index !== -1 ? deriveActualIndentationFromList(list, index, sourceFile, options) : -1 /* Unknown */; - } - } - function deriveActualIndentationFromList(list, index, sourceFile, options) { - ts.Debug.assert(index >= 0 && index < list.length); - var node = list[index]; - // walk toward the start of the list starting from current node and check if the line is the same for all items. - // if end line for item [i - 1] differs from the start line for item [i] - find column of the first non-whitespace character on the line of item [i] - var lineAndCharacter = getStartLineAndCharacterForNode(node, sourceFile); - for (var i = index - 1; i >= 0; --i) { - if (list[i].kind === 23 /* CommaToken */) { - continue; - } - // skip list items that ends on the same line with the current list element - var prevEndLine = sourceFile.getLineAndCharacterOfPosition(list[i].end).line; - if (prevEndLine !== lineAndCharacter.line) { - return findColumnForFirstNonWhitespaceCharacterInLine(lineAndCharacter, sourceFile, options); - } - lineAndCharacter = getStartLineAndCharacterForNode(list[i], sourceFile); - } - return -1 /* Unknown */; - } - function findColumnForFirstNonWhitespaceCharacterInLine(lineAndCharacter, sourceFile, options) { - var lineStart = sourceFile.getPositionOfLineAndCharacter(lineAndCharacter.line, 0); - return findFirstNonWhitespaceColumn(lineStart, lineStart + lineAndCharacter.character, sourceFile, options); - } - /* - Character is the actual index of the character since the beginning of the line. - Column - position of the character after expanding tabs to spaces - "0\t2$" - value of 'character' for '$' is 3 - value of 'column' for '$' is 6 (assuming that tab size is 4) - */ - function findFirstNonWhitespaceCharacterAndColumn(startPos, endPos, sourceFile, options) { - var character = 0; - var column = 0; - for (var pos = startPos; pos < endPos; ++pos) { - var ch = sourceFile.text.charCodeAt(pos); - if (!ts.isWhiteSpace(ch)) { - break; - } - if (ch === 9 /* tab */) { - column += options.TabSize + (column % options.TabSize); - } - else { - column++; - } - character++; - } - return { column: column, character: character }; - } - SmartIndenter.findFirstNonWhitespaceCharacterAndColumn = findFirstNonWhitespaceCharacterAndColumn; - function findFirstNonWhitespaceColumn(startPos, endPos, sourceFile, options) { - return findFirstNonWhitespaceCharacterAndColumn(startPos, endPos, sourceFile, options).column; - } - SmartIndenter.findFirstNonWhitespaceColumn = findFirstNonWhitespaceColumn; - function nodeContentIsAlwaysIndented(kind) { - switch (kind) { - case 204 /* ClassDeclaration */: - case 205 /* InterfaceDeclaration */: - case 207 /* EnumDeclaration */: - case 156 /* ArrayLiteralExpression */: - case 182 /* Block */: - case 209 /* ModuleBlock */: - case 157 /* ObjectLiteralExpression */: - case 148 /* TypeLiteral */: - case 150 /* TupleType */: - case 210 /* CaseBlock */: - case 224 /* DefaultClause */: - case 223 /* CaseClause */: - case 164 /* ParenthesizedExpression */: - case 160 /* CallExpression */: - case 161 /* NewExpression */: - case 183 /* VariableStatement */: - case 201 /* VariableDeclaration */: - case 217 /* ExportAssignment */: - case 194 /* ReturnStatement */: - case 173 /* ConditionalExpression */: - case 154 /* ArrayBindingPattern */: - case 153 /* ObjectBindingPattern */: - return true; - } - return false; - } - function shouldIndentChildNode(parent, child) { - if (nodeContentIsAlwaysIndented(parent)) { - return true; - } - switch (parent) { - case 187 /* DoStatement */: - case 188 /* WhileStatement */: - case 190 /* ForInStatement */: - case 191 /* ForOfStatement */: - case 189 /* ForStatement */: - case 186 /* IfStatement */: - case 203 /* FunctionDeclaration */: - case 165 /* FunctionExpression */: - case 136 /* MethodDeclaration */: - case 135 /* MethodSignature */: - case 140 /* CallSignature */: - case 166 /* ArrowFunction */: - case 137 /* Constructor */: - case 138 /* GetAccessor */: - case 139 /* SetAccessor */: - return child !== 182 /* Block */; - default: - return false; - } - } - SmartIndenter.shouldIndentChildNode = shouldIndentChildNode; - })(SmartIndenter = formatting.SmartIndenter || (formatting.SmartIndenter = {})); - })(formatting = ts.formatting || (ts.formatting = {})); -})(ts || (ts = {})); -/// -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - __.prototype = b.prototype; - d.prototype = new __(); -}; -/// -/// -/// -/// -/// -/// -/// -/// -/// -var ts; -(function (ts) { - /** The version of the language service API */ - ts.servicesVersion = "0.4"; - var ScriptSnapshot; - (function (ScriptSnapshot) { - var StringScriptSnapshot = (function () { - function StringScriptSnapshot(text) { - this.text = text; - this._lineStartPositions = undefined; - } - StringScriptSnapshot.prototype.getText = function (start, end) { - return this.text.substring(start, end); - }; - StringScriptSnapshot.prototype.getLength = function () { - return this.text.length; - }; - StringScriptSnapshot.prototype.getChangeRange = function (oldSnapshot) { - // Text-based snapshots do not support incremental parsing. Return undefined - // to signal that to the caller. - return undefined; - }; - return StringScriptSnapshot; - })(); - function fromString(text) { - return new StringScriptSnapshot(text); - } - ScriptSnapshot.fromString = fromString; - })(ScriptSnapshot = ts.ScriptSnapshot || (ts.ScriptSnapshot = {})); - var scanner = ts.createScanner(2 /* Latest */, true); - var emptyArray = []; - function createNode(kind, pos, end, flags, parent) { - var node = new (ts.getNodeConstructor(kind))(); - node.pos = pos; - node.end = end; - node.flags = flags; - node.parent = parent; - return node; - } - var NodeObject = (function () { - function NodeObject() { - } - NodeObject.prototype.getSourceFile = function () { - return ts.getSourceFileOfNode(this); - }; - NodeObject.prototype.getStart = function (sourceFile) { - return ts.getTokenPosOfNode(this, sourceFile); - }; - NodeObject.prototype.getFullStart = function () { - return this.pos; - }; - NodeObject.prototype.getEnd = function () { - return this.end; - }; - NodeObject.prototype.getWidth = function (sourceFile) { - return this.getEnd() - this.getStart(sourceFile); - }; - NodeObject.prototype.getFullWidth = function () { - return this.end - this.getFullStart(); - }; - NodeObject.prototype.getLeadingTriviaWidth = function (sourceFile) { - return this.getStart(sourceFile) - this.pos; - }; - NodeObject.prototype.getFullText = function (sourceFile) { - return (sourceFile || this.getSourceFile()).text.substring(this.pos, this.end); - }; - NodeObject.prototype.getText = function (sourceFile) { - return (sourceFile || this.getSourceFile()).text.substring(this.getStart(), this.getEnd()); - }; - NodeObject.prototype.addSyntheticNodes = function (nodes, pos, end) { - scanner.setTextPos(pos); - while (pos < end) { - var token = scanner.scan(); - var textPos = scanner.getTextPos(); - nodes.push(createNode(token, pos, textPos, 1024 /* Synthetic */, this)); - pos = textPos; - } - return pos; - }; - NodeObject.prototype.createSyntaxList = function (nodes) { - var list = createNode(253 /* SyntaxList */, nodes.pos, nodes.end, 1024 /* Synthetic */, this); - list._children = []; - var pos = nodes.pos; - for (var _i = 0; _i < nodes.length; _i++) { - var node = nodes[_i]; - if (pos < node.pos) { - pos = this.addSyntheticNodes(list._children, pos, node.pos); - } - list._children.push(node); - pos = node.end; - } - if (pos < nodes.end) { - this.addSyntheticNodes(list._children, pos, nodes.end); - } - return list; - }; - NodeObject.prototype.createChildren = function (sourceFile) { - var _this = this; - var children; - if (this.kind >= 128 /* FirstNode */) { - scanner.setText((sourceFile || this.getSourceFile()).text); - children = []; - var pos = this.pos; - var processNode = function (node) { - if (pos < node.pos) { - pos = _this.addSyntheticNodes(children, pos, node.pos); - } - children.push(node); - pos = node.end; - }; - var processNodes = function (nodes) { - if (pos < nodes.pos) { - pos = _this.addSyntheticNodes(children, pos, nodes.pos); - } - children.push(_this.createSyntaxList(nodes)); - pos = nodes.end; - }; - ts.forEachChild(this, processNode, processNodes); - if (pos < this.end) { - this.addSyntheticNodes(children, pos, this.end); - } - scanner.setText(undefined); - } - this._children = children || emptyArray; - }; - NodeObject.prototype.getChildCount = function (sourceFile) { - if (!this._children) - this.createChildren(sourceFile); - return this._children.length; - }; - NodeObject.prototype.getChildAt = function (index, sourceFile) { - if (!this._children) - this.createChildren(sourceFile); - return this._children[index]; - }; - NodeObject.prototype.getChildren = function (sourceFile) { - if (!this._children) - this.createChildren(sourceFile); - return this._children; - }; - NodeObject.prototype.getFirstToken = function (sourceFile) { - var children = this.getChildren(); - for (var _i = 0; _i < children.length; _i++) { - var child = children[_i]; - if (child.kind < 128 /* FirstNode */) { - return child; - } - return child.getFirstToken(sourceFile); - } - }; - NodeObject.prototype.getLastToken = function (sourceFile) { - var children = this.getChildren(sourceFile); - for (var i = children.length - 1; i >= 0; i--) { - var child = children[i]; - if (child.kind < 128 /* FirstNode */) { - return child; - } - return child.getLastToken(sourceFile); - } - }; - return NodeObject; - })(); - var SymbolObject = (function () { - function SymbolObject(flags, name) { - this.flags = flags; - this.name = name; - } - SymbolObject.prototype.getFlags = function () { - return this.flags; - }; - SymbolObject.prototype.getName = function () { - return this.name; - }; - SymbolObject.prototype.getDeclarations = function () { - return this.declarations; - }; - SymbolObject.prototype.getDocumentationComment = function () { - if (this.documentationComment === undefined) { - this.documentationComment = getJsDocCommentsFromDeclarations(this.declarations, this.name, !(this.flags & 4 /* Property */)); - } - return this.documentationComment; - }; - return SymbolObject; - })(); - function getJsDocCommentsFromDeclarations(declarations, name, canUseParsedParamTagComments) { - var documentationComment = []; - var docComments = getJsDocCommentsSeparatedByNewLines(); - ts.forEach(docComments, function (docComment) { - if (documentationComment.length) { - documentationComment.push(ts.lineBreakPart()); - } - documentationComment.push(docComment); - }); - return documentationComment; - function getJsDocCommentsSeparatedByNewLines() { - var paramTag = "@param"; - var jsDocCommentParts = []; - ts.forEach(declarations, function (declaration, indexOfDeclaration) { - // Make sure we are collecting doc comment from declaration once, - // In case of union property there might be same declaration multiple times - // which only varies in type parameter - // Eg. let a: Array | Array; a.length - // The property length will have two declarations of property length coming - // from Array - Array and Array - if (ts.indexOf(declarations, declaration) === indexOfDeclaration) { - var sourceFileOfDeclaration = ts.getSourceFileOfNode(declaration); - // If it is parameter - try and get the jsDoc comment with @param tag from function declaration's jsDoc comments - if (canUseParsedParamTagComments && declaration.kind === 131 /* Parameter */) { - ts.forEach(getJsDocCommentTextRange(declaration.parent, sourceFileOfDeclaration), function (jsDocCommentTextRange) { - var cleanedParamJsDocComment = getCleanedParamJsDocComment(jsDocCommentTextRange.pos, jsDocCommentTextRange.end, sourceFileOfDeclaration); - if (cleanedParamJsDocComment) { - jsDocCommentParts.push.apply(jsDocCommentParts, cleanedParamJsDocComment); - } - }); - } - // If this is left side of dotted module declaration, there is no doc comments associated with this node - if (declaration.kind === 208 /* ModuleDeclaration */ && declaration.body.kind === 208 /* ModuleDeclaration */) { - return; - } - // If this is dotted module name, get the doc comments from the parent - while (declaration.kind === 208 /* ModuleDeclaration */ && declaration.parent.kind === 208 /* ModuleDeclaration */) { - declaration = declaration.parent; - } - // Get the cleaned js doc comment text from the declaration - ts.forEach(getJsDocCommentTextRange(declaration.kind === 201 /* VariableDeclaration */ ? declaration.parent.parent : declaration, sourceFileOfDeclaration), function (jsDocCommentTextRange) { - var cleanedJsDocComment = getCleanedJsDocComment(jsDocCommentTextRange.pos, jsDocCommentTextRange.end, sourceFileOfDeclaration); - if (cleanedJsDocComment) { - jsDocCommentParts.push.apply(jsDocCommentParts, cleanedJsDocComment); - } - }); - } - }); - return jsDocCommentParts; - function getJsDocCommentTextRange(node, sourceFile) { - return ts.map(ts.getJsDocComments(node, sourceFile), function (jsDocComment) { - return { - pos: jsDocComment.pos + "/*".length, - end: jsDocComment.end - "*/".length // Trim off comment end indicator - }; - }); - } - function consumeWhiteSpacesOnTheLine(pos, end, sourceFile, maxSpacesToRemove) { - if (maxSpacesToRemove !== undefined) { - end = Math.min(end, pos + maxSpacesToRemove); - } - for (; pos < end; pos++) { - var ch = sourceFile.text.charCodeAt(pos); - if (!ts.isWhiteSpace(ch) || ts.isLineBreak(ch)) { - // Either found lineBreak or non whiteSpace - return pos; - } - } - return end; - } - function consumeLineBreaks(pos, end, sourceFile) { - while (pos < end && ts.isLineBreak(sourceFile.text.charCodeAt(pos))) { - pos++; - } - return pos; - } - function isName(pos, end, sourceFile, name) { - return pos + name.length < end && - sourceFile.text.substr(pos, name.length) === name && - (ts.isWhiteSpace(sourceFile.text.charCodeAt(pos + name.length)) || - ts.isLineBreak(sourceFile.text.charCodeAt(pos + name.length))); - } - function isParamTag(pos, end, sourceFile) { - // If it is @param tag - return isName(pos, end, sourceFile, paramTag); - } - function pushDocCommentLineText(docComments, text, blankLineCount) { - // Add the empty lines in between texts - while (blankLineCount--) { - docComments.push(ts.textPart("")); - } - docComments.push(ts.textPart(text)); - } - function getCleanedJsDocComment(pos, end, sourceFile) { - var spacesToRemoveAfterAsterisk; - var docComments = []; - var blankLineCount = 0; - var isInParamTag = false; - while (pos < end) { - var docCommentTextOfLine = ""; - // First consume leading white space - pos = consumeWhiteSpacesOnTheLine(pos, end, sourceFile); - // If the comment starts with '*' consume the spaces on this line - if (pos < end && sourceFile.text.charCodeAt(pos) === 42 /* asterisk */) { - var lineStartPos = pos + 1; - pos = consumeWhiteSpacesOnTheLine(pos + 1, end, sourceFile, spacesToRemoveAfterAsterisk); - // Set the spaces to remove after asterisk as margin if not already set - if (spacesToRemoveAfterAsterisk === undefined && pos < end && !ts.isLineBreak(sourceFile.text.charCodeAt(pos))) { - spacesToRemoveAfterAsterisk = pos - lineStartPos; - } - } - else if (spacesToRemoveAfterAsterisk === undefined) { - spacesToRemoveAfterAsterisk = 0; - } - // Analyse text on this line - while (pos < end && !ts.isLineBreak(sourceFile.text.charCodeAt(pos))) { - var ch = sourceFile.text.charAt(pos); - if (ch === "@") { - // If it is @param tag - if (isParamTag(pos, end, sourceFile)) { - isInParamTag = true; - pos += paramTag.length; - continue; - } - else { - isInParamTag = false; - } - } - // Add the ch to doc text if we arent in param tag - if (!isInParamTag) { - docCommentTextOfLine += ch; - } - // Scan next character - pos++; - } - // Continue with next line - pos = consumeLineBreaks(pos, end, sourceFile); - if (docCommentTextOfLine) { - pushDocCommentLineText(docComments, docCommentTextOfLine, blankLineCount); - blankLineCount = 0; - } - else if (!isInParamTag && docComments.length) { - // This is blank line when there is text already parsed - blankLineCount++; - } - } - return docComments; - } - function getCleanedParamJsDocComment(pos, end, sourceFile) { - var paramHelpStringMargin; - var paramDocComments = []; - while (pos < end) { - if (isParamTag(pos, end, sourceFile)) { - var blankLineCount = 0; - var recordedParamTag = false; - // Consume leading spaces - pos = consumeWhiteSpaces(pos + paramTag.length); - if (pos >= end) { - break; - } - // Ignore type expression - if (sourceFile.text.charCodeAt(pos) === 123 /* openBrace */) { - pos++; - for (var curlies = 1; pos < end; pos++) { - var charCode = sourceFile.text.charCodeAt(pos); - // { character means we need to find another } to match the found one - if (charCode === 123 /* openBrace */) { - curlies++; - continue; - } - // } char - if (charCode === 125 /* closeBrace */) { - curlies--; - if (curlies === 0) { - // We do not have any more } to match the type expression is ignored completely - pos++; - break; - } - else { - // there are more { to be matched with } - continue; - } - } - // Found start of another tag - if (charCode === 64 /* at */) { - break; - } - } - // Consume white spaces - pos = consumeWhiteSpaces(pos); - if (pos >= end) { - break; - } - } - // Parameter name - if (isName(pos, end, sourceFile, name)) { - // Found the parameter we are looking for consume white spaces - pos = consumeWhiteSpaces(pos + name.length); - if (pos >= end) { - break; - } - var paramHelpString = ""; - var firstLineParamHelpStringPos = pos; - while (pos < end) { - var ch = sourceFile.text.charCodeAt(pos); - // at line break, set this comment line text and go to next line - if (ts.isLineBreak(ch)) { - if (paramHelpString) { - pushDocCommentLineText(paramDocComments, paramHelpString, blankLineCount); - paramHelpString = ""; - blankLineCount = 0; - recordedParamTag = true; - } - else if (recordedParamTag) { - blankLineCount++; - } - // Get the pos after cleaning start of the line - setPosForParamHelpStringOnNextLine(firstLineParamHelpStringPos); - continue; - } - // Done scanning param help string - next tag found - if (ch === 64 /* at */) { - break; - } - paramHelpString += sourceFile.text.charAt(pos); - // Go to next character - pos++; - } - // If there is param help text, add it top the doc comments - if (paramHelpString) { - pushDocCommentLineText(paramDocComments, paramHelpString, blankLineCount); - } - paramHelpStringMargin = undefined; - } - // If this is the start of another tag, continue with the loop in seach of param tag with symbol name - if (sourceFile.text.charCodeAt(pos) === 64 /* at */) { - continue; - } - } - // Next character - pos++; - } - return paramDocComments; - function consumeWhiteSpaces(pos) { - while (pos < end && ts.isWhiteSpace(sourceFile.text.charCodeAt(pos))) { - pos++; - } - return pos; - } - function setPosForParamHelpStringOnNextLine(firstLineParamHelpStringPos) { - // Get the pos after consuming line breaks - pos = consumeLineBreaks(pos, end, sourceFile); - if (pos >= end) { - return; - } - if (paramHelpStringMargin === undefined) { - paramHelpStringMargin = sourceFile.getLineAndCharacterOfPosition(firstLineParamHelpStringPos).character; - } - // Now consume white spaces max - var startOfLinePos = pos; - pos = consumeWhiteSpacesOnTheLine(pos, end, sourceFile, paramHelpStringMargin); - if (pos >= end) { - return; - } - var consumedSpaces = pos - startOfLinePos; - if (consumedSpaces < paramHelpStringMargin) { - var ch = sourceFile.text.charCodeAt(pos); - if (ch === 42 /* asterisk */) { - // Consume more spaces after asterisk - pos = consumeWhiteSpacesOnTheLine(pos + 1, end, sourceFile, paramHelpStringMargin - consumedSpaces - 1); - } - } - } - } - } - } - var TypeObject = (function () { - function TypeObject(checker, flags) { - this.checker = checker; - this.flags = flags; - } - TypeObject.prototype.getFlags = function () { - return this.flags; - }; - TypeObject.prototype.getSymbol = function () { - return this.symbol; - }; - TypeObject.prototype.getProperties = function () { - return this.checker.getPropertiesOfType(this); - }; - TypeObject.prototype.getProperty = function (propertyName) { - return this.checker.getPropertyOfType(this, propertyName); - }; - TypeObject.prototype.getApparentProperties = function () { - return this.checker.getAugmentedPropertiesOfType(this); - }; - TypeObject.prototype.getCallSignatures = function () { - return this.checker.getSignaturesOfType(this, 0 /* Call */); - }; - TypeObject.prototype.getConstructSignatures = function () { - return this.checker.getSignaturesOfType(this, 1 /* Construct */); - }; - TypeObject.prototype.getStringIndexType = function () { - return this.checker.getIndexTypeOfType(this, 0 /* String */); - }; - TypeObject.prototype.getNumberIndexType = function () { - return this.checker.getIndexTypeOfType(this, 1 /* Number */); - }; - return TypeObject; - })(); - var SignatureObject = (function () { - function SignatureObject(checker) { - this.checker = checker; - } - SignatureObject.prototype.getDeclaration = function () { - return this.declaration; - }; - SignatureObject.prototype.getTypeParameters = function () { - return this.typeParameters; - }; - SignatureObject.prototype.getParameters = function () { - return this.parameters; - }; - SignatureObject.prototype.getReturnType = function () { - return this.checker.getReturnTypeOfSignature(this); - }; - SignatureObject.prototype.getDocumentationComment = function () { - if (this.documentationComment === undefined) { - this.documentationComment = this.declaration ? getJsDocCommentsFromDeclarations([this.declaration], - /*name*/ undefined, - /*canUseParsedParamTagComments*/ false) : []; - } - return this.documentationComment; - }; - return SignatureObject; - })(); - var SourceFileObject = (function (_super) { - __extends(SourceFileObject, _super); - function SourceFileObject() { - _super.apply(this, arguments); - } - SourceFileObject.prototype.update = function (newText, textChangeRange) { - return ts.updateSourceFile(this, newText, textChangeRange); - }; - SourceFileObject.prototype.getLineAndCharacterOfPosition = function (position) { - return ts.getLineAndCharacterOfPosition(this, position); - }; - SourceFileObject.prototype.getLineStarts = function () { - return ts.getLineStarts(this); - }; - SourceFileObject.prototype.getPositionOfLineAndCharacter = function (line, character) { - return ts.getPositionOfLineAndCharacter(this, line, character); - }; - SourceFileObject.prototype.getNamedDeclarations = function () { - if (!this.namedDeclarations) { - this.namedDeclarations = this.computeNamedDeclarations(); - } - return this.namedDeclarations; - }; - SourceFileObject.prototype.computeNamedDeclarations = function () { - var result = {}; - ts.forEachChild(this, visit); - return result; - function addDeclaration(declaration) { - var name = getDeclarationName(declaration); - if (name) { - var declarations = getDeclarations(name); - declarations.push(declaration); - } - } - function getDeclarations(name) { - return ts.getProperty(result, name) || (result[name] = []); - } - function getDeclarationName(declaration) { - if (declaration.name) { - var result_2 = getTextOfIdentifierOrLiteral(declaration.name); - if (result_2 !== undefined) { - return result_2; - } - if (declaration.name.kind === 129 /* ComputedPropertyName */) { - var expr = declaration.name.expression; - if (expr.kind === 158 /* PropertyAccessExpression */) { - return expr.name.text; - } - return getTextOfIdentifierOrLiteral(expr); - } - } - return undefined; - } - function getTextOfIdentifierOrLiteral(node) { - if (node) { - if (node.kind === 65 /* Identifier */ || - node.kind === 8 /* StringLiteral */ || - node.kind === 7 /* NumericLiteral */) { - return node.text; - } - } - return undefined; - } - function visit(node) { - switch (node.kind) { - case 203 /* FunctionDeclaration */: - case 136 /* MethodDeclaration */: - case 135 /* MethodSignature */: - var functionDeclaration = node; - var declarationName = getDeclarationName(functionDeclaration); - if (declarationName) { - var declarations = getDeclarations(declarationName); - var lastDeclaration = ts.lastOrUndefined(declarations); - // Check whether this declaration belongs to an "overload group". - if (lastDeclaration && functionDeclaration.parent === lastDeclaration.parent && functionDeclaration.symbol === lastDeclaration.symbol) { - // Overwrite the last declaration if it was an overload - // and this one is an implementation. - if (functionDeclaration.body && !lastDeclaration.body) { - declarations[declarations.length - 1] = functionDeclaration; - } - } - else { - declarations.push(functionDeclaration); - } - ts.forEachChild(node, visit); - } - break; - case 204 /* ClassDeclaration */: - case 205 /* InterfaceDeclaration */: - case 206 /* TypeAliasDeclaration */: - case 207 /* EnumDeclaration */: - case 208 /* ModuleDeclaration */: - case 211 /* ImportEqualsDeclaration */: - case 220 /* ExportSpecifier */: - case 216 /* ImportSpecifier */: - case 211 /* ImportEqualsDeclaration */: - case 213 /* ImportClause */: - case 214 /* NamespaceImport */: - case 138 /* GetAccessor */: - case 139 /* SetAccessor */: - case 148 /* TypeLiteral */: - addDeclaration(node); - // fall through - case 137 /* Constructor */: - case 183 /* VariableStatement */: - case 202 /* VariableDeclarationList */: - case 153 /* ObjectBindingPattern */: - case 154 /* ArrayBindingPattern */: - case 209 /* ModuleBlock */: - ts.forEachChild(node, visit); - break; - case 182 /* Block */: - if (ts.isFunctionBlock(node)) { - ts.forEachChild(node, visit); - } - break; - case 131 /* Parameter */: - // Only consider properties defined as constructor parameters - if (!(node.flags & 112 /* AccessibilityModifier */)) { - break; - } - // fall through - case 201 /* VariableDeclaration */: - case 155 /* BindingElement */: - if (ts.isBindingPattern(node.name)) { - ts.forEachChild(node.name, visit); - break; - } - case 229 /* EnumMember */: - case 134 /* PropertyDeclaration */: - case 133 /* PropertySignature */: - addDeclaration(node); - break; - case 218 /* ExportDeclaration */: - // Handle named exports case e.g.: - // export {a, b as B} from "mod"; - if (node.exportClause) { - ts.forEach(node.exportClause.elements, visit); - } - break; - case 212 /* ImportDeclaration */: - var importClause = node.importClause; - if (importClause) { - // Handle default import case e.g.: - // import d from "mod"; - if (importClause.name) { - addDeclaration(importClause); - } - // Handle named bindings in imports e.g.: - // import * as NS from "mod"; - // import {a, b as B} from "mod"; - if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 214 /* NamespaceImport */) { - addDeclaration(importClause.namedBindings); - } - else { - ts.forEach(importClause.namedBindings.elements, visit); - } - } - } - break; - } - } - }; - return SourceFileObject; - })(NodeObject); - var TextChange = (function () { - function TextChange() { - } - return TextChange; - })(); - ts.TextChange = TextChange; - var HighlightSpanKind; - (function (HighlightSpanKind) { - HighlightSpanKind.none = "none"; - HighlightSpanKind.definition = "definition"; - HighlightSpanKind.reference = "reference"; - HighlightSpanKind.writtenReference = "writtenReference"; - })(HighlightSpanKind = ts.HighlightSpanKind || (ts.HighlightSpanKind = {})); - (function (SymbolDisplayPartKind) { - SymbolDisplayPartKind[SymbolDisplayPartKind["aliasName"] = 0] = "aliasName"; - SymbolDisplayPartKind[SymbolDisplayPartKind["className"] = 1] = "className"; - SymbolDisplayPartKind[SymbolDisplayPartKind["enumName"] = 2] = "enumName"; - SymbolDisplayPartKind[SymbolDisplayPartKind["fieldName"] = 3] = "fieldName"; - SymbolDisplayPartKind[SymbolDisplayPartKind["interfaceName"] = 4] = "interfaceName"; - SymbolDisplayPartKind[SymbolDisplayPartKind["keyword"] = 5] = "keyword"; - SymbolDisplayPartKind[SymbolDisplayPartKind["lineBreak"] = 6] = "lineBreak"; - SymbolDisplayPartKind[SymbolDisplayPartKind["numericLiteral"] = 7] = "numericLiteral"; - SymbolDisplayPartKind[SymbolDisplayPartKind["stringLiteral"] = 8] = "stringLiteral"; - SymbolDisplayPartKind[SymbolDisplayPartKind["localName"] = 9] = "localName"; - SymbolDisplayPartKind[SymbolDisplayPartKind["methodName"] = 10] = "methodName"; - SymbolDisplayPartKind[SymbolDisplayPartKind["moduleName"] = 11] = "moduleName"; - SymbolDisplayPartKind[SymbolDisplayPartKind["operator"] = 12] = "operator"; - SymbolDisplayPartKind[SymbolDisplayPartKind["parameterName"] = 13] = "parameterName"; - SymbolDisplayPartKind[SymbolDisplayPartKind["propertyName"] = 14] = "propertyName"; - SymbolDisplayPartKind[SymbolDisplayPartKind["punctuation"] = 15] = "punctuation"; - SymbolDisplayPartKind[SymbolDisplayPartKind["space"] = 16] = "space"; - SymbolDisplayPartKind[SymbolDisplayPartKind["text"] = 17] = "text"; - SymbolDisplayPartKind[SymbolDisplayPartKind["typeParameterName"] = 18] = "typeParameterName"; - SymbolDisplayPartKind[SymbolDisplayPartKind["enumMemberName"] = 19] = "enumMemberName"; - SymbolDisplayPartKind[SymbolDisplayPartKind["functionName"] = 20] = "functionName"; - SymbolDisplayPartKind[SymbolDisplayPartKind["regularExpressionLiteral"] = 21] = "regularExpressionLiteral"; - })(ts.SymbolDisplayPartKind || (ts.SymbolDisplayPartKind = {})); - var SymbolDisplayPartKind = ts.SymbolDisplayPartKind; - (function (OutputFileType) { - OutputFileType[OutputFileType["JavaScript"] = 0] = "JavaScript"; - OutputFileType[OutputFileType["SourceMap"] = 1] = "SourceMap"; - OutputFileType[OutputFileType["Declaration"] = 2] = "Declaration"; - })(ts.OutputFileType || (ts.OutputFileType = {})); - var OutputFileType = ts.OutputFileType; - (function (EndOfLineState) { - EndOfLineState[EndOfLineState["None"] = 0] = "None"; - EndOfLineState[EndOfLineState["InMultiLineCommentTrivia"] = 1] = "InMultiLineCommentTrivia"; - EndOfLineState[EndOfLineState["InSingleQuoteStringLiteral"] = 2] = "InSingleQuoteStringLiteral"; - EndOfLineState[EndOfLineState["InDoubleQuoteStringLiteral"] = 3] = "InDoubleQuoteStringLiteral"; - EndOfLineState[EndOfLineState["InTemplateHeadOrNoSubstitutionTemplate"] = 4] = "InTemplateHeadOrNoSubstitutionTemplate"; - EndOfLineState[EndOfLineState["InTemplateMiddleOrTail"] = 5] = "InTemplateMiddleOrTail"; - EndOfLineState[EndOfLineState["InTemplateSubstitutionPosition"] = 6] = "InTemplateSubstitutionPosition"; - })(ts.EndOfLineState || (ts.EndOfLineState = {})); - var EndOfLineState = ts.EndOfLineState; - (function (TokenClass) { - TokenClass[TokenClass["Punctuation"] = 0] = "Punctuation"; - TokenClass[TokenClass["Keyword"] = 1] = "Keyword"; - TokenClass[TokenClass["Operator"] = 2] = "Operator"; - TokenClass[TokenClass["Comment"] = 3] = "Comment"; - TokenClass[TokenClass["Whitespace"] = 4] = "Whitespace"; - TokenClass[TokenClass["Identifier"] = 5] = "Identifier"; - TokenClass[TokenClass["NumberLiteral"] = 6] = "NumberLiteral"; - TokenClass[TokenClass["StringLiteral"] = 7] = "StringLiteral"; - TokenClass[TokenClass["RegExpLiteral"] = 8] = "RegExpLiteral"; - })(ts.TokenClass || (ts.TokenClass = {})); - var TokenClass = ts.TokenClass; - // TODO: move these to enums - var ScriptElementKind; - (function (ScriptElementKind) { - ScriptElementKind.unknown = ""; - ScriptElementKind.warning = "warning"; - // predefined type (void) or keyword (class) - ScriptElementKind.keyword = "keyword"; - // top level script node - ScriptElementKind.scriptElement = "script"; - // module foo {} - ScriptElementKind.moduleElement = "module"; - // class X {} - ScriptElementKind.classElement = "class"; - // interface Y {} - ScriptElementKind.interfaceElement = "interface"; - // type T = ... - ScriptElementKind.typeElement = "type"; - // enum E - ScriptElementKind.enumElement = "enum"; - // Inside module and script only - // let v = .. - ScriptElementKind.variableElement = "var"; - // Inside function - ScriptElementKind.localVariableElement = "local var"; - // Inside module and script only - // function f() { } - ScriptElementKind.functionElement = "function"; - // Inside function - ScriptElementKind.localFunctionElement = "local function"; - // class X { [public|private]* foo() {} } - ScriptElementKind.memberFunctionElement = "method"; - // class X { [public|private]* [get|set] foo:number; } - ScriptElementKind.memberGetAccessorElement = "getter"; - ScriptElementKind.memberSetAccessorElement = "setter"; - // class X { [public|private]* foo:number; } - // interface Y { foo:number; } - ScriptElementKind.memberVariableElement = "property"; - // class X { constructor() { } } - ScriptElementKind.constructorImplementationElement = "constructor"; - // interface Y { ():number; } - ScriptElementKind.callSignatureElement = "call"; - // interface Y { []:number; } - ScriptElementKind.indexSignatureElement = "index"; - // interface Y { new():Y; } - ScriptElementKind.constructSignatureElement = "construct"; - // function foo(*Y*: string) - ScriptElementKind.parameterElement = "parameter"; - ScriptElementKind.typeParameterElement = "type parameter"; - ScriptElementKind.primitiveType = "primitive type"; - ScriptElementKind.label = "label"; - ScriptElementKind.alias = "alias"; - ScriptElementKind.constElement = "const"; - ScriptElementKind.letElement = "let"; - })(ScriptElementKind = ts.ScriptElementKind || (ts.ScriptElementKind = {})); - var ScriptElementKindModifier; - (function (ScriptElementKindModifier) { - ScriptElementKindModifier.none = ""; - ScriptElementKindModifier.publicMemberModifier = "public"; - ScriptElementKindModifier.privateMemberModifier = "private"; - ScriptElementKindModifier.protectedMemberModifier = "protected"; - ScriptElementKindModifier.exportedModifier = "export"; - ScriptElementKindModifier.ambientModifier = "declare"; - ScriptElementKindModifier.staticModifier = "static"; - })(ScriptElementKindModifier = ts.ScriptElementKindModifier || (ts.ScriptElementKindModifier = {})); - var ClassificationTypeNames = (function () { - function ClassificationTypeNames() { - } - ClassificationTypeNames.comment = "comment"; - ClassificationTypeNames.identifier = "identifier"; - ClassificationTypeNames.keyword = "keyword"; - ClassificationTypeNames.numericLiteral = "number"; - ClassificationTypeNames.operator = "operator"; - ClassificationTypeNames.stringLiteral = "string"; - ClassificationTypeNames.whiteSpace = "whitespace"; - ClassificationTypeNames.text = "text"; - ClassificationTypeNames.punctuation = "punctuation"; - ClassificationTypeNames.className = "class name"; - ClassificationTypeNames.enumName = "enum name"; - ClassificationTypeNames.interfaceName = "interface name"; - ClassificationTypeNames.moduleName = "module name"; - ClassificationTypeNames.typeParameterName = "type parameter name"; - ClassificationTypeNames.typeAliasName = "type alias name"; - ClassificationTypeNames.parameterName = "parameter name"; - ClassificationTypeNames.docCommentTagName = "doc comment tag name"; - return ClassificationTypeNames; - })(); - ts.ClassificationTypeNames = ClassificationTypeNames; - (function (ClassificationType) { - ClassificationType[ClassificationType["comment"] = 1] = "comment"; - ClassificationType[ClassificationType["identifier"] = 2] = "identifier"; - ClassificationType[ClassificationType["keyword"] = 3] = "keyword"; - ClassificationType[ClassificationType["numericLiteral"] = 4] = "numericLiteral"; - ClassificationType[ClassificationType["operator"] = 5] = "operator"; - ClassificationType[ClassificationType["stringLiteral"] = 6] = "stringLiteral"; - ClassificationType[ClassificationType["regularExpressionLiteral"] = 7] = "regularExpressionLiteral"; - ClassificationType[ClassificationType["whiteSpace"] = 8] = "whiteSpace"; - ClassificationType[ClassificationType["text"] = 9] = "text"; - ClassificationType[ClassificationType["punctuation"] = 10] = "punctuation"; - ClassificationType[ClassificationType["className"] = 11] = "className"; - ClassificationType[ClassificationType["enumName"] = 12] = "enumName"; - ClassificationType[ClassificationType["interfaceName"] = 13] = "interfaceName"; - ClassificationType[ClassificationType["moduleName"] = 14] = "moduleName"; - ClassificationType[ClassificationType["typeParameterName"] = 15] = "typeParameterName"; - ClassificationType[ClassificationType["typeAliasName"] = 16] = "typeAliasName"; - ClassificationType[ClassificationType["parameterName"] = 17] = "parameterName"; - ClassificationType[ClassificationType["docCommentTagName"] = 18] = "docCommentTagName"; - })(ts.ClassificationType || (ts.ClassificationType = {})); - var ClassificationType = ts.ClassificationType; - function displayPartsToString(displayParts) { - if (displayParts) { - return ts.map(displayParts, function (displayPart) { return displayPart.text; }).join(""); - } - return ""; - } - ts.displayPartsToString = displayPartsToString; - function isLocalVariableOrFunction(symbol) { - if (symbol.parent) { - return false; // This is exported symbol - } - return ts.forEach(symbol.declarations, function (declaration) { - // Function expressions are local - if (declaration.kind === 165 /* FunctionExpression */) { - return true; - } - if (declaration.kind !== 201 /* VariableDeclaration */ && declaration.kind !== 203 /* FunctionDeclaration */) { - return false; - } - // If the parent is not sourceFile or module block it is local variable - for (var parent_9 = declaration.parent; !ts.isFunctionBlock(parent_9); parent_9 = parent_9.parent) { - // Reached source file or module block - if (parent_9.kind === 230 /* SourceFile */ || parent_9.kind === 209 /* ModuleBlock */) { - return false; - } - } - // parent is in function block - return true; - }); - } - function getDefaultCompilerOptions() { - // Always default to "ScriptTarget.ES5" for the language service - return { - target: 1 /* ES5 */, - module: 0 /* None */ - }; - } - ts.getDefaultCompilerOptions = getDefaultCompilerOptions; - var OperationCanceledException = (function () { - function OperationCanceledException() { - } - return OperationCanceledException; - })(); - ts.OperationCanceledException = OperationCanceledException; - var CancellationTokenObject = (function () { - function CancellationTokenObject(cancellationToken) { - this.cancellationToken = cancellationToken; - } - CancellationTokenObject.prototype.isCancellationRequested = function () { - return this.cancellationToken && this.cancellationToken.isCancellationRequested(); - }; - CancellationTokenObject.prototype.throwIfCancellationRequested = function () { - if (this.isCancellationRequested()) { - throw new OperationCanceledException(); - } - }; - CancellationTokenObject.None = new CancellationTokenObject(null); - return CancellationTokenObject; - })(); - ts.CancellationTokenObject = CancellationTokenObject; - // Cache host information about scrip Should be refreshed - // at each language service public entry point, since we don't know when - // set of scripts handled by the host changes. - var HostCache = (function () { - function HostCache(host, getCanonicalFileName) { - this.host = host; - // script id => script index - this.fileNameToEntry = ts.createFileMap(getCanonicalFileName); - // Initialize the list with the root file names - var rootFileNames = host.getScriptFileNames(); - for (var _i = 0; _i < rootFileNames.length; _i++) { - var fileName = rootFileNames[_i]; - this.createEntry(fileName); - } - // store the compilation settings - this._compilationSettings = host.getCompilationSettings() || getDefaultCompilerOptions(); - } - HostCache.prototype.compilationSettings = function () { - return this._compilationSettings; - }; - HostCache.prototype.createEntry = function (fileName) { - var entry; - var scriptSnapshot = this.host.getScriptSnapshot(fileName); - if (scriptSnapshot) { - entry = { - hostFileName: fileName, - version: this.host.getScriptVersion(fileName), - scriptSnapshot: scriptSnapshot - }; - } - this.fileNameToEntry.set(fileName, entry); - return entry; - }; - HostCache.prototype.getEntry = function (fileName) { - return this.fileNameToEntry.get(fileName); - }; - HostCache.prototype.contains = function (fileName) { - return this.fileNameToEntry.contains(fileName); - }; - HostCache.prototype.getOrCreateEntry = function (fileName) { - if (this.contains(fileName)) { - return this.getEntry(fileName); - } - return this.createEntry(fileName); - }; - HostCache.prototype.getRootFileNames = function () { - var fileNames = []; - this.fileNameToEntry.forEachValue(function (value) { - if (value) { - fileNames.push(value.hostFileName); - } - }); - return fileNames; - }; - HostCache.prototype.getVersion = function (fileName) { - var file = this.getEntry(fileName); - return file && file.version; - }; - HostCache.prototype.getScriptSnapshot = function (fileName) { - var file = this.getEntry(fileName); - return file && file.scriptSnapshot; - }; - return HostCache; - })(); - var SyntaxTreeCache = (function () { - function SyntaxTreeCache(host) { - this.host = host; - } - SyntaxTreeCache.prototype.getCurrentSourceFile = function (fileName) { - var scriptSnapshot = this.host.getScriptSnapshot(fileName); - if (!scriptSnapshot) { - // The host does not know about this file. - throw new Error("Could not find file: '" + fileName + "'."); - } - var version = this.host.getScriptVersion(fileName); - var sourceFile; - if (this.currentFileName !== fileName) { - // This is a new file, just parse it - sourceFile = createLanguageServiceSourceFile(fileName, scriptSnapshot, 2 /* Latest */, version, true); - } - else if (this.currentFileVersion !== version) { - // This is the same file, just a newer version. Incrementally parse the file. - var editRange = scriptSnapshot.getChangeRange(this.currentFileScriptSnapshot); - sourceFile = updateLanguageServiceSourceFile(this.currentSourceFile, scriptSnapshot, version, editRange); - } - if (sourceFile) { - // All done, ensure state is up to date - this.currentFileVersion = version; - this.currentFileName = fileName; - this.currentFileScriptSnapshot = scriptSnapshot; - this.currentSourceFile = sourceFile; - } - return this.currentSourceFile; - }; - return SyntaxTreeCache; - })(); - function setSourceFileFields(sourceFile, scriptSnapshot, version) { - sourceFile.version = version; - sourceFile.scriptSnapshot = scriptSnapshot; - } - /* - * This function will compile source text from 'input' argument using specified compiler options. - * If not options are provided - it will use a set of default compiler options. - * Extra compiler options that will unconditionally be used bu this function are: - * - isolatedModules = true - * - allowNonTsExtensions = true - * - noLib = true - * - noResolve = true - */ - function transpile(input, compilerOptions, fileName, diagnostics, moduleName) { - var options = compilerOptions ? ts.clone(compilerOptions) : getDefaultCompilerOptions(); - options.isolatedModules = true; - // Filename can be non-ts file. - options.allowNonTsExtensions = true; - // We are not returning a sourceFile for lib file when asked by the program, - // so pass --noLib to avoid reporting a file not found error. - options.noLib = true; - // We are not doing a full typecheck, we are not resolving the whole context, - // so pass --noResolve to avoid reporting missing file errors. - options.noResolve = true; - // Parse - var inputFileName = fileName || "module.ts"; - var sourceFile = ts.createSourceFile(inputFileName, input, options.target); - if (moduleName) { - sourceFile.moduleName = moduleName; - } - // Store syntactic diagnostics - if (diagnostics && sourceFile.parseDiagnostics) { - diagnostics.push.apply(diagnostics, sourceFile.parseDiagnostics); - } - var newLine = ts.getNewLineCharacter(options); - // Output - var outputText; - // Create a compilerHost object to allow the compiler to read and write files - var compilerHost = { - getSourceFile: function (fileName, target) { return fileName === inputFileName ? sourceFile : undefined; }, - writeFile: function (name, text, writeByteOrderMark) { - ts.Debug.assert(outputText === undefined, "Unexpected multiple outputs for the file: " + name); - outputText = text; - }, - getDefaultLibFileName: function () { return "lib.d.ts"; }, - useCaseSensitiveFileNames: function () { return false; }, - getCanonicalFileName: function (fileName) { return fileName; }, - getCurrentDirectory: function () { return ""; }, - getNewLine: function () { return newLine; } - }; - var program = ts.createProgram([inputFileName], options, compilerHost); - if (diagnostics) { - diagnostics.push.apply(diagnostics, program.getCompilerOptionsDiagnostics()); - } - // Emit - program.emit(); - ts.Debug.assert(outputText !== undefined, "Output generation failed"); - return outputText; - } - ts.transpile = transpile; - function createLanguageServiceSourceFile(fileName, scriptSnapshot, scriptTarget, version, setNodeParents) { - var text = scriptSnapshot.getText(0, scriptSnapshot.getLength()); - var sourceFile = ts.createSourceFile(fileName, text, scriptTarget, setNodeParents); - setSourceFileFields(sourceFile, scriptSnapshot, version); - // after full parsing we can use table with interned strings as name table - sourceFile.nameTable = sourceFile.identifiers; - return sourceFile; - } - ts.createLanguageServiceSourceFile = createLanguageServiceSourceFile; - ts.disableIncrementalParsing = false; - function updateLanguageServiceSourceFile(sourceFile, scriptSnapshot, version, textChangeRange, aggressiveChecks) { - // If we were given a text change range, and our version or open-ness changed, then - // incrementally parse this file. - if (textChangeRange) { - if (version !== sourceFile.version) { - // Once incremental parsing is ready, then just call into this function. - if (!ts.disableIncrementalParsing) { - var newText; - // grab the fragment from the beginning of the original text to the beginning of the span - var prefix = textChangeRange.span.start !== 0 - ? sourceFile.text.substr(0, textChangeRange.span.start) - : ""; - // grab the fragment from the end of the span till the end of the original text - var suffix = ts.textSpanEnd(textChangeRange.span) !== sourceFile.text.length - ? sourceFile.text.substr(ts.textSpanEnd(textChangeRange.span)) - : ""; - if (textChangeRange.newLength === 0) { - // edit was a deletion - just combine prefix and suffix - newText = prefix && suffix ? prefix + suffix : prefix || suffix; - } - else { - // it was actual edit, fetch the fragment of new text that correspond to new span - var changedText = scriptSnapshot.getText(textChangeRange.span.start, textChangeRange.span.start + textChangeRange.newLength); - // combine prefix, changed text and suffix - newText = prefix && suffix - ? prefix + changedText + suffix - : prefix - ? (prefix + changedText) - : (changedText + suffix); - } - var newSourceFile = ts.updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks); - setSourceFileFields(newSourceFile, scriptSnapshot, version); - // after incremental parsing nameTable might not be up-to-date - // drop it so it can be lazily recreated later - newSourceFile.nameTable = undefined; - return newSourceFile; - } - } - } - // Otherwise, just create a new source file. - return createLanguageServiceSourceFile(sourceFile.fileName, scriptSnapshot, sourceFile.languageVersion, version, true); - } - ts.updateLanguageServiceSourceFile = updateLanguageServiceSourceFile; - function createGetCanonicalFileName(useCaseSensitivefileNames) { - return useCaseSensitivefileNames - ? (function (fileName) { return fileName; }) - : (function (fileName) { return fileName.toLowerCase(); }); - } - function createDocumentRegistry(useCaseSensitiveFileNames) { - // Maps from compiler setting target (ES3, ES5, etc.) to all the cached documents we have - // for those settings. - var buckets = {}; - var getCanonicalFileName = createGetCanonicalFileName(!!useCaseSensitiveFileNames); - function getKeyFromCompilationSettings(settings) { - return "_" + settings.target; // + "|" + settings.propagateEnumConstantoString() - } - function getBucketForCompilationSettings(settings, createIfMissing) { - var key = getKeyFromCompilationSettings(settings); - var bucket = ts.lookUp(buckets, key); - if (!bucket && createIfMissing) { - buckets[key] = bucket = ts.createFileMap(getCanonicalFileName); - } - return bucket; - } - function reportStats() { - var bucketInfoArray = Object.keys(buckets).filter(function (name) { return name && name.charAt(0) === '_'; }).map(function (name) { - var entries = ts.lookUp(buckets, name); - var sourceFiles = []; - for (var i in entries) { - var entry = entries.get(i); - sourceFiles.push({ - name: i, - refCount: entry.languageServiceRefCount, - references: entry.owners.slice(0) - }); - } - sourceFiles.sort(function (x, y) { return y.refCount - x.refCount; }); - return { - bucket: name, - sourceFiles: sourceFiles - }; - }); - return JSON.stringify(bucketInfoArray, null, 2); - } - function acquireDocument(fileName, compilationSettings, scriptSnapshot, version) { - return acquireOrUpdateDocument(fileName, compilationSettings, scriptSnapshot, version, true); - } - function updateDocument(fileName, compilationSettings, scriptSnapshot, version) { - return acquireOrUpdateDocument(fileName, compilationSettings, scriptSnapshot, version, false); - } - function acquireOrUpdateDocument(fileName, compilationSettings, scriptSnapshot, version, acquiring) { - var bucket = getBucketForCompilationSettings(compilationSettings, true); - var entry = bucket.get(fileName); - if (!entry) { - ts.Debug.assert(acquiring, "How could we be trying to update a document that the registry doesn't have?"); - // Have never seen this file with these settings. Create a new source file for it. - var sourceFile = createLanguageServiceSourceFile(fileName, scriptSnapshot, compilationSettings.target, version, false); - entry = { - sourceFile: sourceFile, - languageServiceRefCount: 0, - owners: [] - }; - bucket.set(fileName, entry); - } - else { - // We have an entry for this file. However, it may be for a different version of - // the script snapshot. If so, update it appropriately. Otherwise, we can just - // return it as is. - if (entry.sourceFile.version !== version) { - entry.sourceFile = updateLanguageServiceSourceFile(entry.sourceFile, scriptSnapshot, version, scriptSnapshot.getChangeRange(entry.sourceFile.scriptSnapshot)); - } - } - // If we're acquiring, then this is the first time this LS is asking for this document. - // Increase our ref count so we know there's another LS using the document. If we're - // not acquiring, then that means the LS is 'updating' the file instead, and that means - // it has already acquired the document previously. As such, we do not need to increase - // the ref count. - if (acquiring) { - entry.languageServiceRefCount++; - } - return entry.sourceFile; - } - function releaseDocument(fileName, compilationSettings) { - var bucket = getBucketForCompilationSettings(compilationSettings, false); - ts.Debug.assert(bucket !== undefined); - var entry = bucket.get(fileName); - entry.languageServiceRefCount--; - ts.Debug.assert(entry.languageServiceRefCount >= 0); - if (entry.languageServiceRefCount === 0) { - bucket.remove(fileName); - } - } - return { - acquireDocument: acquireDocument, - updateDocument: updateDocument, - releaseDocument: releaseDocument, - reportStats: reportStats - }; - } - ts.createDocumentRegistry = createDocumentRegistry; - function preProcessFile(sourceText, readImportFiles) { - if (readImportFiles === void 0) { readImportFiles = true; } - var referencedFiles = []; - var importedFiles = []; - var isNoDefaultLib = false; - function processTripleSlashDirectives() { - var commentRanges = ts.getLeadingCommentRanges(sourceText, 0); - ts.forEach(commentRanges, function (commentRange) { - var comment = sourceText.substring(commentRange.pos, commentRange.end); - var referencePathMatchResult = ts.getFileReferenceFromReferencePath(comment, commentRange); - if (referencePathMatchResult) { - isNoDefaultLib = referencePathMatchResult.isNoDefaultLib; - var fileReference = referencePathMatchResult.fileReference; - if (fileReference) { - referencedFiles.push(fileReference); - } - } - }); - } - function recordModuleName() { - var importPath = scanner.getTokenValue(); - var pos = scanner.getTokenPos(); - importedFiles.push({ - fileName: importPath, - pos: pos, - end: pos + importPath.length - }); - } - function processImport() { - scanner.setText(sourceText); - var token = scanner.scan(); - // Look for: - // import "mod"; - // import d from "mod" - // import {a as A } from "mod"; - // import * as NS from "mod" - // import d, {a, b as B} from "mod" - // import i = require("mod"); - // - // export * from "mod" - // export {a as b} from "mod" - while (token !== 1 /* EndOfFileToken */) { - if (token === 85 /* ImportKeyword */) { - token = scanner.scan(); - if (token === 8 /* StringLiteral */) { - // import "mod"; - recordModuleName(); - continue; - } - else { - if (token === 65 /* Identifier */) { - token = scanner.scan(); - if (token === 126 /* FromKeyword */) { - token = scanner.scan(); - if (token === 8 /* StringLiteral */) { - // import d from "mod"; - recordModuleName(); - continue; - } - } - else if (token === 53 /* EqualsToken */) { - token = scanner.scan(); - if (token === 120 /* RequireKeyword */) { - token = scanner.scan(); - if (token === 16 /* OpenParenToken */) { - token = scanner.scan(); - if (token === 8 /* StringLiteral */) { - // import i = require("mod"); - recordModuleName(); - continue; - } - } - } - } - else if (token === 23 /* CommaToken */) { - // consume comma and keep going - token = scanner.scan(); - } - else { - // unknown syntax - continue; - } - } - if (token === 14 /* OpenBraceToken */) { - token = scanner.scan(); - // consume "{ a as B, c, d as D}" clauses - while (token !== 15 /* CloseBraceToken */) { - token = scanner.scan(); - } - if (token === 15 /* CloseBraceToken */) { - token = scanner.scan(); - if (token === 126 /* FromKeyword */) { - token = scanner.scan(); - if (token === 8 /* StringLiteral */) { - // import {a as A} from "mod"; - // import d, {a, b as B} from "mod" - recordModuleName(); - } - } - } - } - else if (token === 35 /* AsteriskToken */) { - token = scanner.scan(); - if (token === 111 /* AsKeyword */) { - token = scanner.scan(); - if (token === 65 /* Identifier */) { - token = scanner.scan(); - if (token === 126 /* FromKeyword */) { - token = scanner.scan(); - if (token === 8 /* StringLiteral */) { - // import * as NS from "mod" - // import d, * as NS from "mod" - recordModuleName(); - } - } - } - } - } - } - } - else if (token === 78 /* ExportKeyword */) { - token = scanner.scan(); - if (token === 14 /* OpenBraceToken */) { - token = scanner.scan(); - // consume "{ a as B, c, d as D}" clauses - while (token !== 15 /* CloseBraceToken */) { - token = scanner.scan(); - } - if (token === 15 /* CloseBraceToken */) { - token = scanner.scan(); - if (token === 126 /* FromKeyword */) { - token = scanner.scan(); - if (token === 8 /* StringLiteral */) { - // export {a as A} from "mod"; - // export {a, b as B} from "mod" - recordModuleName(); - } - } - } - } - else if (token === 35 /* AsteriskToken */) { - token = scanner.scan(); - if (token === 126 /* FromKeyword */) { - token = scanner.scan(); - if (token === 8 /* StringLiteral */) { - // export * from "mod" - recordModuleName(); - } - } - } - } - token = scanner.scan(); - } - scanner.setText(undefined); - } - if (readImportFiles) { - processImport(); - } - processTripleSlashDirectives(); - return { referencedFiles: referencedFiles, importedFiles: importedFiles, isLibFile: isNoDefaultLib }; - } - ts.preProcessFile = preProcessFile; - /// Helpers - function getTargetLabel(referenceNode, labelName) { - while (referenceNode) { - if (referenceNode.kind === 197 /* LabeledStatement */ && referenceNode.label.text === labelName) { - return referenceNode.label; - } - referenceNode = referenceNode.parent; - } - return undefined; - } - function isJumpStatementTarget(node) { - return node.kind === 65 /* Identifier */ && - (node.parent.kind === 193 /* BreakStatement */ || node.parent.kind === 192 /* ContinueStatement */) && - node.parent.label === node; - } - function isLabelOfLabeledStatement(node) { - return node.kind === 65 /* Identifier */ && - node.parent.kind === 197 /* LabeledStatement */ && - node.parent.label === node; - } - /** - * Whether or not a 'node' is preceded by a label of the given string. - * Note: 'node' cannot be a SourceFile. - */ - function isLabeledBy(node, labelName) { - for (var owner = node.parent; owner.kind === 197 /* LabeledStatement */; owner = owner.parent) { - if (owner.label.text === labelName) { - return true; - } - } - return false; - } - function isLabelName(node) { - return isLabelOfLabeledStatement(node) || isJumpStatementTarget(node); - } - function isRightSideOfQualifiedName(node) { - return node.parent.kind === 128 /* QualifiedName */ && node.parent.right === node; - } - function isRightSideOfPropertyAccess(node) { - return node && node.parent && node.parent.kind === 158 /* PropertyAccessExpression */ && node.parent.name === node; - } - function isCallExpressionTarget(node) { - if (isRightSideOfPropertyAccess(node)) { - node = node.parent; - } - return node && node.parent && node.parent.kind === 160 /* CallExpression */ && node.parent.expression === node; - } - function isNewExpressionTarget(node) { - if (isRightSideOfPropertyAccess(node)) { - node = node.parent; - } - return node && node.parent && node.parent.kind === 161 /* NewExpression */ && node.parent.expression === node; - } - function isNameOfModuleDeclaration(node) { - return node.parent.kind === 208 /* ModuleDeclaration */ && node.parent.name === node; - } - function isNameOfFunctionDeclaration(node) { - return node.kind === 65 /* Identifier */ && - ts.isFunctionLike(node.parent) && node.parent.name === node; - } - /** Returns true if node is a name of an object literal property, e.g. "a" in x = { "a": 1 } */ - function isNameOfPropertyAssignment(node) { - return (node.kind === 65 /* Identifier */ || node.kind === 8 /* StringLiteral */ || node.kind === 7 /* NumericLiteral */) && - (node.parent.kind === 227 /* PropertyAssignment */ || node.parent.kind === 228 /* ShorthandPropertyAssignment */) && node.parent.name === node; - } - function isLiteralNameOfPropertyDeclarationOrIndexAccess(node) { - if (node.kind === 8 /* StringLiteral */ || node.kind === 7 /* NumericLiteral */) { - switch (node.parent.kind) { - case 134 /* PropertyDeclaration */: - case 133 /* PropertySignature */: - case 227 /* PropertyAssignment */: - case 229 /* EnumMember */: - case 136 /* MethodDeclaration */: - case 135 /* MethodSignature */: - case 138 /* GetAccessor */: - case 139 /* SetAccessor */: - case 208 /* ModuleDeclaration */: - return node.parent.name === node; - case 159 /* ElementAccessExpression */: - return node.parent.argumentExpression === node; - } - } - return false; - } - function isNameOfExternalModuleImportOrDeclaration(node) { - if (node.kind === 8 /* StringLiteral */) { - return isNameOfModuleDeclaration(node) || - (ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node); - } - return false; - } - /** Returns true if the position is within a comment */ - function isInsideComment(sourceFile, token, position) { - // The position has to be: 1. in the leading trivia (before token.getStart()), and 2. within a comment - return position <= token.getStart(sourceFile) && - (isInsideCommentRange(ts.getTrailingCommentRanges(sourceFile.text, token.getFullStart())) || - isInsideCommentRange(ts.getLeadingCommentRanges(sourceFile.text, token.getFullStart()))); - function isInsideCommentRange(comments) { - return ts.forEach(comments, function (comment) { - // either we are 1. completely inside the comment, or 2. at the end of the comment - if (comment.pos < position && position < comment.end) { - return true; - } - else if (position === comment.end) { - var text = sourceFile.text; - var width = comment.end - comment.pos; - // is single line comment or just /* - if (width <= 2 || text.charCodeAt(comment.pos + 1) === 47 /* slash */) { - return true; - } - else { - // is unterminated multi-line comment - return !(text.charCodeAt(comment.end - 1) === 47 /* slash */ && - text.charCodeAt(comment.end - 2) === 42 /* asterisk */); - } - } - return false; - }); - } - } - var SemanticMeaning; - (function (SemanticMeaning) { - SemanticMeaning[SemanticMeaning["None"] = 0] = "None"; - SemanticMeaning[SemanticMeaning["Value"] = 1] = "Value"; - SemanticMeaning[SemanticMeaning["Type"] = 2] = "Type"; - SemanticMeaning[SemanticMeaning["Namespace"] = 4] = "Namespace"; - SemanticMeaning[SemanticMeaning["All"] = 7] = "All"; - })(SemanticMeaning || (SemanticMeaning = {})); - var BreakContinueSearchType; - (function (BreakContinueSearchType) { - BreakContinueSearchType[BreakContinueSearchType["None"] = 0] = "None"; - BreakContinueSearchType[BreakContinueSearchType["Unlabeled"] = 1] = "Unlabeled"; - BreakContinueSearchType[BreakContinueSearchType["Labeled"] = 2] = "Labeled"; - BreakContinueSearchType[BreakContinueSearchType["All"] = 3] = "All"; - })(BreakContinueSearchType || (BreakContinueSearchType = {})); - // A cache of completion entries for keywords, these do not change between sessions - var keywordCompletions = []; - for (var i = 66 /* FirstKeyword */; i <= 127 /* LastKeyword */; i++) { - keywordCompletions.push({ - name: ts.tokenToString(i), - kind: ScriptElementKind.keyword, - kindModifiers: ScriptElementKindModifier.none, - sortText: "0" - }); - } - /* @internal */ function getContainerNode(node) { - while (true) { - node = node.parent; - if (!node) { - return undefined; - } - switch (node.kind) { - case 230 /* SourceFile */: - case 136 /* MethodDeclaration */: - case 135 /* MethodSignature */: - case 203 /* FunctionDeclaration */: - case 165 /* FunctionExpression */: - case 138 /* GetAccessor */: - case 139 /* SetAccessor */: - case 204 /* ClassDeclaration */: - case 205 /* InterfaceDeclaration */: - case 207 /* EnumDeclaration */: - case 208 /* ModuleDeclaration */: - return node; - } - } - } - ts.getContainerNode = getContainerNode; - /* @internal */ function getNodeKind(node) { - switch (node.kind) { - case 208 /* ModuleDeclaration */: return ScriptElementKind.moduleElement; - case 204 /* ClassDeclaration */: return ScriptElementKind.classElement; - case 205 /* InterfaceDeclaration */: return ScriptElementKind.interfaceElement; - case 206 /* TypeAliasDeclaration */: return ScriptElementKind.typeElement; - case 207 /* EnumDeclaration */: return ScriptElementKind.enumElement; - case 201 /* VariableDeclaration */: - return ts.isConst(node) - ? ScriptElementKind.constElement - : ts.isLet(node) - ? ScriptElementKind.letElement - : ScriptElementKind.variableElement; - case 203 /* FunctionDeclaration */: return ScriptElementKind.functionElement; - case 138 /* GetAccessor */: return ScriptElementKind.memberGetAccessorElement; - case 139 /* SetAccessor */: return ScriptElementKind.memberSetAccessorElement; - case 136 /* MethodDeclaration */: - case 135 /* MethodSignature */: - return ScriptElementKind.memberFunctionElement; - case 134 /* PropertyDeclaration */: - case 133 /* PropertySignature */: - return ScriptElementKind.memberVariableElement; - case 142 /* IndexSignature */: return ScriptElementKind.indexSignatureElement; - case 141 /* ConstructSignature */: return ScriptElementKind.constructSignatureElement; - case 140 /* CallSignature */: return ScriptElementKind.callSignatureElement; - case 137 /* Constructor */: return ScriptElementKind.constructorImplementationElement; - case 130 /* TypeParameter */: return ScriptElementKind.typeParameterElement; - case 229 /* EnumMember */: return ScriptElementKind.variableElement; - case 131 /* Parameter */: return (node.flags & 112 /* AccessibilityModifier */) ? ScriptElementKind.memberVariableElement : ScriptElementKind.parameterElement; - case 211 /* ImportEqualsDeclaration */: - case 216 /* ImportSpecifier */: - case 213 /* ImportClause */: - case 220 /* ExportSpecifier */: - case 214 /* NamespaceImport */: - return ScriptElementKind.alias; - } - return ScriptElementKind.unknown; - } - ts.getNodeKind = getNodeKind; - function createLanguageService(host, documentRegistry) { - if (documentRegistry === void 0) { documentRegistry = createDocumentRegistry(); } - var syntaxTreeCache = new SyntaxTreeCache(host); - var ruleProvider; - var program; - var lastProjectVersion; - var useCaseSensitivefileNames = false; - var cancellationToken = new CancellationTokenObject(host.getCancellationToken && host.getCancellationToken()); - // Check if the localized messages json is set, otherwise query the host for it - if (!ts.localizedDiagnosticMessages && host.getLocalizedDiagnosticMessages) { - ts.localizedDiagnosticMessages = host.getLocalizedDiagnosticMessages(); - } - function log(message) { - if (host.log) { - host.log(message); - } - } - var getCanonicalFileName = createGetCanonicalFileName(useCaseSensitivefileNames); - function getValidSourceFile(fileName) { - fileName = ts.normalizeSlashes(fileName); - var sourceFile = program.getSourceFile(getCanonicalFileName(fileName)); - if (!sourceFile) { - throw new Error("Could not find file: '" + fileName + "'."); - } - return sourceFile; - } - function getRuleProvider(options) { - // Ensure rules are initialized and up to date wrt to formatting options - if (!ruleProvider) { - ruleProvider = new ts.formatting.RulesProvider(); - } - ruleProvider.ensureUpToDate(options); - return ruleProvider; - } - function synchronizeHostData() { - // perform fast check if host supports it - if (host.getProjectVersion) { - var hostProjectVersion = host.getProjectVersion(); - if (hostProjectVersion) { - if (lastProjectVersion === hostProjectVersion) { - return; - } - lastProjectVersion = hostProjectVersion; - } - } - // Get a fresh cache of the host information - var hostCache = new HostCache(host, getCanonicalFileName); - // If the program is already up-to-date, we can reuse it - if (programUpToDate()) { - return; - } - // IMPORTANT - It is critical from this moment onward that we do not check - // cancellation tokens. We are about to mutate source files from a previous program - // instance. If we cancel midway through, we may end up in an inconsistent state where - // the program points to old source files that have been invalidated because of - // incremental parsing. - var oldSettings = program && program.getCompilerOptions(); - var newSettings = hostCache.compilationSettings(); - var changesInCompilationSettingsAffectSyntax = oldSettings && oldSettings.target !== newSettings.target; - // Now create a new compiler - var newProgram = ts.createProgram(hostCache.getRootFileNames(), newSettings, { - getSourceFile: getOrCreateSourceFile, - getCancellationToken: function () { return cancellationToken; }, - getCanonicalFileName: getCanonicalFileName, - useCaseSensitiveFileNames: function () { return useCaseSensitivefileNames; }, - getNewLine: function () { return host.getNewLine ? host.getNewLine() : "\r\n"; }, - getDefaultLibFileName: function (options) { return host.getDefaultLibFileName(options); }, - writeFile: function (fileName, data, writeByteOrderMark) { }, - getCurrentDirectory: function () { return host.getCurrentDirectory(); } - }); - // Release any files we have acquired in the old program but are - // not part of the new program. - if (program) { - var oldSourceFiles = program.getSourceFiles(); - for (var _i = 0; _i < oldSourceFiles.length; _i++) { - var oldSourceFile = oldSourceFiles[_i]; - var fileName = oldSourceFile.fileName; - if (!newProgram.getSourceFile(fileName) || changesInCompilationSettingsAffectSyntax) { - documentRegistry.releaseDocument(fileName, oldSettings); - } - } - } - // hostCache is captured in the closure for 'getOrCreateSourceFile' but it should not be used past this point. - // It needs to be cleared to allow all collected snapshots to be released - hostCache = undefined; - program = newProgram; - // Make sure all the nodes in the program are both bound, and have their parent - // pointers set property. - program.getTypeChecker(); - return; - function getOrCreateSourceFile(fileName) { - ts.Debug.assert(hostCache !== undefined); - // The program is asking for this file, check first if the host can locate it. - // If the host can not locate the file, then it does not exist. return undefined - // to the program to allow reporting of errors for missing files. - var hostFileInformation = hostCache.getOrCreateEntry(fileName); - if (!hostFileInformation) { - return undefined; - } - // Check if the language version has changed since we last created a program; if they are the same, - // it is safe to reuse the souceFiles; if not, then the shape of the AST can change, and the oldSourceFile - // can not be reused. we have to dump all syntax trees and create new ones. - if (!changesInCompilationSettingsAffectSyntax) { - // Check if the old program had this file already - var oldSourceFile = program && program.getSourceFile(fileName); - if (oldSourceFile) { - // We already had a source file for this file name. Go to the registry to - // ensure that we get the right up to date version of it. We need this to - // address the following 'race'. Specifically, say we have the following: - // - // LS1 - // \ - // DocumentRegistry - // / - // LS2 - // - // Each LS has a reference to file 'foo.ts' at version 1. LS2 then updates - // it's version of 'foo.ts' to version 2. This will cause LS2 and the - // DocumentRegistry to have version 2 of the document. HOwever, LS1 will - // have version 1. And *importantly* this source file will be *corrupt*. - // The act of creating version 2 of the file irrevocably damages the version - // 1 file. - // - // So, later when we call into LS1, we need to make sure that it doesn't use - // it's source file any more, and instead defers to DocumentRegistry to get - // either version 1, version 2 (or some other version) depending on what the - // host says should be used. - return documentRegistry.updateDocument(fileName, newSettings, hostFileInformation.scriptSnapshot, hostFileInformation.version); - } - } - // Could not find this file in the old program, create a new SourceFile for it. - return documentRegistry.acquireDocument(fileName, newSettings, hostFileInformation.scriptSnapshot, hostFileInformation.version); - } - function sourceFileUpToDate(sourceFile) { - return sourceFile && sourceFile.version === hostCache.getVersion(sourceFile.fileName); - } - function programUpToDate() { - // If we haven't create a program yet, then it is not up-to-date - if (!program) { - return false; - } - // If number of files in the program do not match, it is not up-to-date - var rootFileNames = hostCache.getRootFileNames(); - if (program.getSourceFiles().length !== rootFileNames.length) { - return false; - } - // If any file is not up-to-date, then the whole program is not up-to-date - for (var _i = 0; _i < rootFileNames.length; _i++) { - var fileName = rootFileNames[_i]; - if (!sourceFileUpToDate(program.getSourceFile(fileName))) { - return false; - } - } - // If the compilation settings do no match, then the program is not up-to-date - return ts.compareDataObjects(program.getCompilerOptions(), hostCache.compilationSettings()); - } - } - function getProgram() { - synchronizeHostData(); - return program; - } - function cleanupSemanticCache() { - // TODO: Should we jettison the program (or it's type checker) here? - } - function dispose() { - if (program) { - ts.forEach(program.getSourceFiles(), function (f) { - return documentRegistry.releaseDocument(f.fileName, program.getCompilerOptions()); - }); - } - } - /// Diagnostics - function getSyntacticDiagnostics(fileName) { - synchronizeHostData(); - return program.getSyntacticDiagnostics(getValidSourceFile(fileName)); - } - /** - * getSemanticDiagnostiscs return array of Diagnostics. If '-d' is not enabled, only report semantic errors - * If '-d' enabled, report both semantic and emitter errors - */ - function getSemanticDiagnostics(fileName) { - synchronizeHostData(); - var targetSourceFile = getValidSourceFile(fileName); - // For JavaScript files, we don't want to report the normal typescript semantic errors. - // Instead, we just report errors for using TypeScript-only constructs from within a - // JavaScript file. - if (ts.isJavaScript(fileName)) { - return getJavaScriptSemanticDiagnostics(targetSourceFile); - } - // Only perform the action per file regardless of '-out' flag as LanguageServiceHost is expected to call this function per file. - // Therefore only get diagnostics for given file. - var semanticDiagnostics = program.getSemanticDiagnostics(targetSourceFile); - if (!program.getCompilerOptions().declaration) { - return semanticDiagnostics; - } - // If '-d' is enabled, check for emitter error. One example of emitter error is export class implements non-export interface - var declarationDiagnostics = program.getDeclarationDiagnostics(targetSourceFile); - return ts.concatenate(semanticDiagnostics, declarationDiagnostics); - } - function getJavaScriptSemanticDiagnostics(sourceFile) { - var diagnostics = []; - walk(sourceFile); - return diagnostics; - function walk(node) { - if (!node) { - return false; - } - switch (node.kind) { - case 211 /* ImportEqualsDeclaration */: - diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.import_can_only_be_used_in_a_ts_file)); - return true; - case 217 /* ExportAssignment */: - diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.export_can_only_be_used_in_a_ts_file)); - return true; - case 204 /* ClassDeclaration */: - var classDeclaration = node; - if (checkModifiers(classDeclaration.modifiers) || - checkTypeParameters(classDeclaration.typeParameters)) { - return true; - } - break; - case 225 /* HeritageClause */: - var heritageClause = node; - if (heritageClause.token === 102 /* ImplementsKeyword */) { - diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.implements_clauses_can_only_be_used_in_a_ts_file)); - return true; - } - break; - case 205 /* InterfaceDeclaration */: - diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.interface_declarations_can_only_be_used_in_a_ts_file)); - return true; - case 208 /* ModuleDeclaration */: - diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.module_declarations_can_only_be_used_in_a_ts_file)); - return true; - case 206 /* TypeAliasDeclaration */: - diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.type_aliases_can_only_be_used_in_a_ts_file)); - return true; - case 136 /* MethodDeclaration */: - case 135 /* MethodSignature */: - case 137 /* Constructor */: - case 138 /* GetAccessor */: - case 139 /* SetAccessor */: - case 165 /* FunctionExpression */: - case 203 /* FunctionDeclaration */: - case 166 /* ArrowFunction */: - case 203 /* FunctionDeclaration */: - var functionDeclaration = node; - if (checkModifiers(functionDeclaration.modifiers) || - checkTypeParameters(functionDeclaration.typeParameters) || - checkTypeAnnotation(functionDeclaration.type)) { - return true; - } - break; - case 183 /* VariableStatement */: - var variableStatement = node; - if (checkModifiers(variableStatement.modifiers)) { - return true; - } - break; - case 201 /* VariableDeclaration */: - var variableDeclaration = node; - if (checkTypeAnnotation(variableDeclaration.type)) { - return true; - } - break; - case 160 /* CallExpression */: - case 161 /* NewExpression */: - var expression = node; - if (expression.typeArguments && expression.typeArguments.length > 0) { - var start = expression.typeArguments.pos; - diagnostics.push(ts.createFileDiagnostic(sourceFile, start, expression.typeArguments.end - start, ts.Diagnostics.type_arguments_can_only_be_used_in_a_ts_file)); - return true; - } - break; - case 131 /* Parameter */: - var parameter = node; - if (parameter.modifiers) { - var start = parameter.modifiers.pos; - diagnostics.push(ts.createFileDiagnostic(sourceFile, start, parameter.modifiers.end - start, ts.Diagnostics.parameter_modifiers_can_only_be_used_in_a_ts_file)); - return true; - } - if (parameter.questionToken) { - diagnostics.push(ts.createDiagnosticForNode(parameter.questionToken, ts.Diagnostics._0_can_only_be_used_in_a_ts_file, '?')); - return true; - } - if (parameter.type) { - diagnostics.push(ts.createDiagnosticForNode(parameter.type, ts.Diagnostics.types_can_only_be_used_in_a_ts_file)); - return true; - } - break; - case 134 /* PropertyDeclaration */: - diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.property_declarations_can_only_be_used_in_a_ts_file)); - return true; - case 207 /* EnumDeclaration */: - diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.enum_declarations_can_only_be_used_in_a_ts_file)); - return true; - case 163 /* TypeAssertionExpression */: - var typeAssertionExpression = node; - diagnostics.push(ts.createDiagnosticForNode(typeAssertionExpression.type, ts.Diagnostics.type_assertion_expressions_can_only_be_used_in_a_ts_file)); - return true; - case 132 /* Decorator */: - diagnostics.push(ts.createDiagnosticForNode(node, ts.Diagnostics.decorators_can_only_be_used_in_a_ts_file)); - return true; - } - return ts.forEachChild(node, walk); - } - function checkTypeParameters(typeParameters) { - if (typeParameters) { - var start = typeParameters.pos; - diagnostics.push(ts.createFileDiagnostic(sourceFile, start, typeParameters.end - start, ts.Diagnostics.type_parameter_declarations_can_only_be_used_in_a_ts_file)); - return true; - } - return false; - } - function checkTypeAnnotation(type) { - if (type) { - diagnostics.push(ts.createDiagnosticForNode(type, ts.Diagnostics.types_can_only_be_used_in_a_ts_file)); - return true; - } - return false; - } - function checkModifiers(modifiers) { - if (modifiers) { - for (var _i = 0; _i < modifiers.length; _i++) { - var modifier = modifiers[_i]; - switch (modifier.kind) { - case 108 /* PublicKeyword */: - case 106 /* PrivateKeyword */: - case 107 /* ProtectedKeyword */: - case 115 /* DeclareKeyword */: - diagnostics.push(ts.createDiagnosticForNode(modifier, ts.Diagnostics._0_can_only_be_used_in_a_ts_file, ts.tokenToString(modifier.kind))); - return true; - // These are all legal modifiers. - case 109 /* StaticKeyword */: - case 78 /* ExportKeyword */: - case 70 /* ConstKeyword */: - case 73 /* DefaultKeyword */: - } - } - } - return false; - } - } - function getCompilerOptionsDiagnostics() { - synchronizeHostData(); - return program.getGlobalDiagnostics(); - } - /// Completion - function getCompletionEntryDisplayNameForSymbol(symbol, target, performCharacterChecks) { - var displayName = symbol.getName(); - if (displayName) { - // If this is the default export, get the name of the declaration if it exists - if (displayName === "default") { - var localSymbol = ts.getLocalSymbolForExportDefault(symbol); - if (localSymbol && localSymbol.name) { - displayName = symbol.valueDeclaration.localSymbol.name; - } - } - var firstCharCode = displayName.charCodeAt(0); - // First check of the displayName is not external module; if it is an external module, it is not valid entry - if ((symbol.flags & 1536 /* Namespace */) && (firstCharCode === 39 /* singleQuote */ || firstCharCode === 34 /* doubleQuote */)) { - // If the symbol is external module, don't show it in the completion list - // (i.e declare module "http" { let x; } | // <= request completion here, "http" should not be there) - return undefined; - } - } - return getCompletionEntryDisplayName(displayName, target, performCharacterChecks); - } - function getCompletionEntryDisplayName(displayName, target, performCharacterChecks) { - if (!displayName) { - return undefined; - } - var firstCharCode = displayName.charCodeAt(0); - if (displayName.length >= 2 && - firstCharCode === displayName.charCodeAt(displayName.length - 1) && - (firstCharCode === 39 /* singleQuote */ || firstCharCode === 34 /* doubleQuote */)) { - // If the user entered name for the symbol was quoted, removing the quotes is not enough, as the name could be an - // invalid identifier name. We need to check if whatever was inside the quotes is actually a valid identifier name. - displayName = displayName.substring(1, displayName.length - 1); - } - if (!displayName) { - return undefined; - } - if (performCharacterChecks) { - if (!ts.isIdentifierStart(displayName.charCodeAt(0), target)) { - return undefined; - } - for (var i = 1, n = displayName.length; i < n; i++) { - if (!ts.isIdentifierPart(displayName.charCodeAt(i), target)) { - return undefined; - } - } - } - return ts.unescapeIdentifier(displayName); - } - function getCompletionData(fileName, position) { - var typeChecker = program.getTypeChecker(); - var syntacticStart = new Date().getTime(); - var sourceFile = getValidSourceFile(fileName); - var isJavaScriptFile = ts.isJavaScript(fileName); - var start = new Date().getTime(); - var currentToken = ts.getTokenAtPosition(sourceFile, position); - log("getCompletionData: Get current token: " + (new Date().getTime() - start)); - start = new Date().getTime(); - // Completion not allowed inside comments, bail out if this is the case - var insideComment = isInsideComment(sourceFile, currentToken, position); - log("getCompletionData: Is inside comment: " + (new Date().getTime() - start)); - if (insideComment) { - log("Returning an empty list because completion was inside a comment."); - return undefined; - } - start = new Date().getTime(); - var previousToken = ts.findPrecedingToken(position, sourceFile); - log("getCompletionData: Get previous token 1: " + (new Date().getTime() - start)); - // The decision to provide completion depends on the contextToken, which is determined through the previousToken. - // Note: 'previousToken' (and thus 'contextToken') can be undefined if we are the beginning of the file - var contextToken = previousToken; - // Check if the caret is at the end of an identifier; this is a partial identifier that we want to complete: e.g. a.toS| - // Skip this partial identifier and adjust the contextToken to the token that precedes it. - if (contextToken && position <= contextToken.end && ts.isWord(contextToken.kind)) { - var start_2 = new Date().getTime(); - contextToken = ts.findPrecedingToken(contextToken.getFullStart(), sourceFile); - log("getCompletionData: Get previous token 2: " + (new Date().getTime() - start_2)); - } - // Check if this is a valid completion location - if (contextToken && isCompletionListBlocker(contextToken)) { - log("Returning an empty list because completion was requested in an invalid position."); - return undefined; - } - // Find the node where completion is requested on, in the case of a completion after - // a dot, it is the member access expression other wise, it is a request for all - // visible symbols in the scope, and the node is the current location. - var node = currentToken; - var isRightOfDot = false; - if (contextToken && contextToken.kind === 20 /* DotToken */ && contextToken.parent.kind === 158 /* PropertyAccessExpression */) { - node = contextToken.parent.expression; - isRightOfDot = true; - } - else if (contextToken && contextToken.kind === 20 /* DotToken */ && contextToken.parent.kind === 128 /* QualifiedName */) { - node = contextToken.parent.left; - isRightOfDot = true; - } - var location = ts.getTouchingPropertyName(sourceFile, position); - var target = program.getCompilerOptions().target; - var semanticStart = new Date().getTime(); - var isMemberCompletion; - var isNewIdentifierLocation; - var symbols = []; - if (isRightOfDot) { - getTypeScriptMemberSymbols(); - } - else { - // For JavaScript or TypeScript, if we're not after a dot, then just try to get the - // global symbols in scope. These results should be valid for either language as - // the set of symbols that can be referenced from this location. - if (!tryGetGlobalSymbols()) { - return undefined; - } - } - log("getCompletionData: Semantic work: " + (new Date().getTime() - semanticStart)); - return { symbols: symbols, isMemberCompletion: isMemberCompletion, isNewIdentifierLocation: isNewIdentifierLocation, location: location, isRightOfDot: isRightOfDot }; - function getTypeScriptMemberSymbols() { - // Right of dot member completion list - isMemberCompletion = true; - isNewIdentifierLocation = false; - if (node.kind === 65 /* Identifier */ || node.kind === 128 /* QualifiedName */ || node.kind === 158 /* PropertyAccessExpression */) { - var symbol = typeChecker.getSymbolAtLocation(node); - // This is an alias, follow what it aliases - if (symbol && symbol.flags & 8388608 /* Alias */) { - symbol = typeChecker.getAliasedSymbol(symbol); - } - if (symbol && symbol.flags & 1952 /* HasExports */) { - // Extract module or enum members - var exportedSymbols = typeChecker.getExportsOfModule(symbol); - ts.forEach(exportedSymbols, function (symbol) { - if (typeChecker.isValidPropertyAccess((node.parent), symbol.name)) { - symbols.push(symbol); - } - }); - } - } - var type = typeChecker.getTypeAtLocation(node); - addTypeProperties(type); - } - function addTypeProperties(type) { - if (type) { - // Filter private properties - for (var _i = 0, _a = type.getApparentProperties(); _i < _a.length; _i++) { - var symbol = _a[_i]; - if (typeChecker.isValidPropertyAccess((node.parent), symbol.name)) { - symbols.push(symbol); - } - } - if (isJavaScriptFile && type.flags & 16384 /* Union */) { - // In javascript files, for union types, we don't just get the members that - // the individual types have in common, we also include all the members that - // each individual type has. This is because we're going to add all identifiers - // anyways. So we might as well elevate the members that were at least part - // of the individual types to a higher status since we know what they are. - var unionType = type; - for (var _b = 0, _c = unionType.types; _b < _c.length; _b++) { - var elementType = _c[_b]; - addTypeProperties(elementType); - } - } - } - } - function tryGetGlobalSymbols() { - var containingObjectLiteral = getContainingObjectLiteralApplicableForCompletion(contextToken); - if (containingObjectLiteral) { - // Object literal expression, look up possible property names from contextual type - isMemberCompletion = true; - isNewIdentifierLocation = true; - var contextualType = typeChecker.getContextualType(containingObjectLiteral); - if (!contextualType) { - return false; - } - var contextualTypeMembers = typeChecker.getPropertiesOfType(contextualType); - if (contextualTypeMembers && contextualTypeMembers.length > 0) { - // Add filtered items to the completion list - symbols = filterContextualMembersList(contextualTypeMembers, containingObjectLiteral.properties); - } - } - else if (ts.getAncestor(contextToken, 213 /* ImportClause */)) { - // cursor is in import clause - // try to show exported member for imported module - isMemberCompletion = true; - isNewIdentifierLocation = true; - if (showCompletionsInImportsClause(contextToken)) { - var importDeclaration = ts.getAncestor(contextToken, 212 /* ImportDeclaration */); - ts.Debug.assert(importDeclaration !== undefined); - var exports; - if (importDeclaration.moduleSpecifier) { - var moduleSpecifierSymbol = typeChecker.getSymbolAtLocation(importDeclaration.moduleSpecifier); - if (moduleSpecifierSymbol) { - exports = typeChecker.getExportsOfModule(moduleSpecifierSymbol); - } - } - //let exports = typeInfoResolver.getExportsOfImportDeclaration(importDeclaration); - symbols = exports ? filterModuleExports(exports, importDeclaration) : emptyArray; - } - } - else { - // Get all entities in the current scope. - isMemberCompletion = false; - isNewIdentifierLocation = isNewIdentifierDefinitionLocation(contextToken); - if (previousToken !== contextToken) { - ts.Debug.assert(!!previousToken, "Expected 'contextToken' to be defined when different from 'previousToken'."); - } - // We need to find the node that will give us an appropriate scope to begin - // aggregating completion candidates. This is achieved in 'getScopeNode' - // by finding the first node that encompasses a position, accounting for whether a node - // is "complete" to decide whether a position belongs to the node. - // - // However, at the end of an identifier, we are interested in the scope of the identifier - // itself, but fall outside of the identifier. For instance: - // - // xyz => x$ - // - // the cursor is outside of both the 'x' and the arrow function 'xyz => x', - // so 'xyz' is not returned in our results. - // - // We define 'adjustedPosition' so that we may appropriately account for - // being at the end of an identifier. The intention is that if requesting completion - // at the end of an identifier, it should be effectively equivalent to requesting completion - // anywhere inside/at the beginning of the identifier. So in the previous case, the - // 'adjustedPosition' will work as if requesting completion in the following: - // - // xyz => $x - // - // If previousToken !== contextToken, then - // - 'contextToken' was adjusted to the token prior to 'previousToken' - // because we were at the end of an identifier. - // - 'previousToken' is defined. - var adjustedPosition = previousToken !== contextToken ? - previousToken.getStart() : - position; - var scopeNode = getScopeNode(contextToken, adjustedPosition, sourceFile) || sourceFile; - /// TODO filter meaning based on the current context - var symbolMeanings = 793056 /* Type */ | 107455 /* Value */ | 1536 /* Namespace */ | 8388608 /* Alias */; - symbols = typeChecker.getSymbolsInScope(scopeNode, symbolMeanings); - } - return true; - } - /** - * Finds the first node that "embraces" the position, so that one may - * accurately aggregate locals from the closest containing scope. - */ - function getScopeNode(initialToken, position, sourceFile) { - var scope = initialToken; - while (scope && !ts.positionBelongsToNode(scope, position, sourceFile)) { - scope = scope.parent; - } - return scope; - } - function isCompletionListBlocker(previousToken) { - var start = new Date().getTime(); - var result = isInStringOrRegularExpressionOrTemplateLiteral(previousToken) || - isIdentifierDefinitionLocation(previousToken) || - isRightOfIllegalDot(previousToken); - log("getCompletionsAtPosition: isCompletionListBlocker: " + (new Date().getTime() - start)); - return result; - } - function showCompletionsInImportsClause(node) { - if (node) { - // import {| - // import {a,| - if (node.kind === 14 /* OpenBraceToken */ || node.kind === 23 /* CommaToken */) { - return node.parent.kind === 215 /* NamedImports */; - } - } - return false; - } - function isNewIdentifierDefinitionLocation(previousToken) { - if (previousToken) { - var containingNodeKind = previousToken.parent.kind; - switch (previousToken.kind) { - case 23 /* CommaToken */: - return containingNodeKind === 160 /* CallExpression */ // func( a, | - || containingNodeKind === 137 /* Constructor */ // constructor( a, | public, protected, private keywords are allowed here, so show completion - || containingNodeKind === 161 /* NewExpression */ // new C(a, | - || containingNodeKind === 156 /* ArrayLiteralExpression */ // [a, | - || containingNodeKind === 172 /* BinaryExpression */ // let x = (a, | - || containingNodeKind === 145 /* FunctionType */; // var x: (s: string, list| - case 16 /* OpenParenToken */: - return containingNodeKind === 160 /* CallExpression */ // func( | - || containingNodeKind === 137 /* Constructor */ // constructor( | - || containingNodeKind === 161 /* NewExpression */ // new C(a| - || containingNodeKind === 164 /* ParenthesizedExpression */ // let x = (a| - || containingNodeKind === 152 /* ParenthesizedType */; // function F(pred: (a| this can become an arrow function, where 'a' is the argument - case 18 /* OpenBracketToken */: - return containingNodeKind === 156 /* ArrayLiteralExpression */; // [ | - case 118 /* ModuleKeyword */: // module | - case 119 /* NamespaceKeyword */: - return true; - case 20 /* DotToken */: - return containingNodeKind === 208 /* ModuleDeclaration */; // module A.| - case 14 /* OpenBraceToken */: - return containingNodeKind === 204 /* ClassDeclaration */; // class A{ | - case 53 /* EqualsToken */: - return containingNodeKind === 201 /* VariableDeclaration */ // let x = a| - || containingNodeKind === 172 /* BinaryExpression */; // x = a| - case 11 /* TemplateHead */: - return containingNodeKind === 174 /* TemplateExpression */; // `aa ${| - case 12 /* TemplateMiddle */: - return containingNodeKind === 180 /* TemplateSpan */; // `aa ${10} dd ${| - case 108 /* PublicKeyword */: - case 106 /* PrivateKeyword */: - case 107 /* ProtectedKeyword */: - return containingNodeKind === 134 /* PropertyDeclaration */; // class A{ public | - } - // Previous token may have been a keyword that was converted to an identifier. - switch (previousToken.getText()) { - case "public": - case "protected": - case "private": - return true; - } - } - return false; - } - function isInStringOrRegularExpressionOrTemplateLiteral(previousToken) { - if (previousToken.kind === 8 /* StringLiteral */ - || previousToken.kind === 9 /* RegularExpressionLiteral */ - || ts.isTemplateLiteralKind(previousToken.kind)) { - var start_3 = previousToken.getStart(); - var end = previousToken.getEnd(); - // To be "in" one of these literals, the position has to be: - // 1. entirely within the token text. - // 2. at the end position of an unterminated token. - // 3. at the end of a regular expression (due to trailing flags like '/foo/g'). - if (start_3 < position && position < end) { - return true; - } - if (position === end) { - return !!previousToken.isUnterminated || - previousToken.kind === 9 /* RegularExpressionLiteral */; - } - } - return false; - } - function getContainingObjectLiteralApplicableForCompletion(previousToken) { - // The locations in an object literal expression that are applicable for completion are property name definition locations. - if (previousToken) { - var parent_10 = previousToken.parent; - switch (previousToken.kind) { - case 14 /* OpenBraceToken */: // let x = { | - case 23 /* CommaToken */: - if (parent_10 && parent_10.kind === 157 /* ObjectLiteralExpression */) { - return parent_10; - } - break; - } - } - return undefined; - } - function isFunction(kind) { - switch (kind) { - case 165 /* FunctionExpression */: - case 166 /* ArrowFunction */: - case 203 /* FunctionDeclaration */: - case 136 /* MethodDeclaration */: - case 135 /* MethodSignature */: - case 138 /* GetAccessor */: - case 139 /* SetAccessor */: - case 140 /* CallSignature */: - case 141 /* ConstructSignature */: - case 142 /* IndexSignature */: - return true; - } - return false; - } - function isIdentifierDefinitionLocation(previousToken) { - if (previousToken) { - var containingNodeKind = previousToken.parent.kind; - switch (previousToken.kind) { - case 23 /* CommaToken */: - return containingNodeKind === 201 /* VariableDeclaration */ || - containingNodeKind === 202 /* VariableDeclarationList */ || - containingNodeKind === 183 /* VariableStatement */ || - containingNodeKind === 207 /* EnumDeclaration */ || - isFunction(containingNodeKind) || - containingNodeKind === 204 /* ClassDeclaration */ || - containingNodeKind === 203 /* FunctionDeclaration */ || - containingNodeKind === 205 /* InterfaceDeclaration */ || - containingNodeKind === 154 /* ArrayBindingPattern */ || - containingNodeKind === 153 /* ObjectBindingPattern */; // function func({ x, y| - case 20 /* DotToken */: - return containingNodeKind === 154 /* ArrayBindingPattern */; // var [.| - case 51 /* ColonToken */: - return containingNodeKind === 155 /* BindingElement */; // var {x :html| - case 18 /* OpenBracketToken */: - return containingNodeKind === 154 /* ArrayBindingPattern */; // var [x| - case 16 /* OpenParenToken */: - return containingNodeKind === 226 /* CatchClause */ || - isFunction(containingNodeKind); - case 14 /* OpenBraceToken */: - return containingNodeKind === 207 /* EnumDeclaration */ || - containingNodeKind === 205 /* InterfaceDeclaration */ || - containingNodeKind === 148 /* TypeLiteral */ || - containingNodeKind === 153 /* ObjectBindingPattern */; // function func({ x| - case 22 /* SemicolonToken */: - return containingNodeKind === 133 /* PropertySignature */ && - previousToken.parent && previousToken.parent.parent && - (previousToken.parent.parent.kind === 205 /* InterfaceDeclaration */ || - previousToken.parent.parent.kind === 148 /* TypeLiteral */); // let x : { a; | - case 24 /* LessThanToken */: - return containingNodeKind === 204 /* ClassDeclaration */ || - containingNodeKind === 203 /* FunctionDeclaration */ || - containingNodeKind === 205 /* InterfaceDeclaration */ || - isFunction(containingNodeKind); - case 109 /* StaticKeyword */: - return containingNodeKind === 134 /* PropertyDeclaration */; - case 21 /* DotDotDotToken */: - return containingNodeKind === 131 /* Parameter */ || - containingNodeKind === 137 /* Constructor */ || - (previousToken.parent && previousToken.parent.parent && - previousToken.parent.parent.kind === 154 /* ArrayBindingPattern */); // var [...z| - case 108 /* PublicKeyword */: - case 106 /* PrivateKeyword */: - case 107 /* ProtectedKeyword */: - return containingNodeKind === 131 /* Parameter */; - case 69 /* ClassKeyword */: - case 77 /* EnumKeyword */: - case 103 /* InterfaceKeyword */: - case 83 /* FunctionKeyword */: - case 98 /* VarKeyword */: - case 116 /* GetKeyword */: - case 122 /* SetKeyword */: - case 85 /* ImportKeyword */: - case 104 /* LetKeyword */: - case 70 /* ConstKeyword */: - case 110 /* YieldKeyword */: - case 125 /* TypeKeyword */: - return true; - } - // Previous token may have been a keyword that was converted to an identifier. - switch (previousToken.getText()) { - case "class": - case "interface": - case "enum": - case "function": - case "var": - case "static": - case "let": - case "const": - case "yield": - return true; - } - } - return false; - } - function isRightOfIllegalDot(previousToken) { - if (previousToken && previousToken.kind === 7 /* NumericLiteral */) { - var text = previousToken.getFullText(); - return text.charAt(text.length - 1) === "."; - } - return false; - } - function filterModuleExports(exports, importDeclaration) { - var exisingImports = {}; - if (!importDeclaration.importClause) { - return exports; - } - if (importDeclaration.importClause.namedBindings && - importDeclaration.importClause.namedBindings.kind === 215 /* NamedImports */) { - ts.forEach(importDeclaration.importClause.namedBindings.elements, function (el) { - var name = el.propertyName || el.name; - exisingImports[name.text] = true; - }); - } - if (ts.isEmpty(exisingImports)) { - return exports; - } - return ts.filter(exports, function (e) { return !ts.lookUp(exisingImports, e.name); }); - } - function filterContextualMembersList(contextualMemberSymbols, existingMembers) { - if (!existingMembers || existingMembers.length === 0) { - return contextualMemberSymbols; - } - var existingMemberNames = {}; - ts.forEach(existingMembers, function (m) { - if (m.kind !== 227 /* PropertyAssignment */ && m.kind !== 228 /* ShorthandPropertyAssignment */) { - // Ignore omitted expressions for missing members in the object literal - return; - } - if (m.getStart() <= position && position <= m.getEnd()) { - // If this is the current item we are editing right now, do not filter it out - return; - } - // TODO(jfreeman): Account for computed property name - existingMemberNames[m.name.text] = true; - }); - var filteredMembers = []; - ts.forEach(contextualMemberSymbols, function (s) { - if (!existingMemberNames[s.name]) { - filteredMembers.push(s); - } - }); - return filteredMembers; - } - } - function getCompletionsAtPosition(fileName, position) { - synchronizeHostData(); - var completionData = getCompletionData(fileName, position); - if (!completionData) { - return undefined; - } - var symbols = completionData.symbols, isMemberCompletion = completionData.isMemberCompletion, isNewIdentifierLocation = completionData.isNewIdentifierLocation, location = completionData.location, isRightOfDot = completionData.isRightOfDot; - var entries; - if (isRightOfDot && ts.isJavaScript(fileName)) { - entries = getCompletionEntriesFromSymbols(symbols); - ts.addRange(entries, getJavaScriptCompletionEntries()); - } - else { - if (!symbols || symbols.length === 0) { - return undefined; - } - entries = getCompletionEntriesFromSymbols(symbols); - } - // Add keywords if this is not a member completion list - if (!isMemberCompletion) { - ts.addRange(entries, keywordCompletions); - } - return { isMemberCompletion: isMemberCompletion, isNewIdentifierLocation: isNewIdentifierLocation, entries: entries }; - function getJavaScriptCompletionEntries() { - var entries = []; - var allNames = {}; - var target = program.getCompilerOptions().target; - for (var _i = 0, _a = program.getSourceFiles(); _i < _a.length; _i++) { - var sourceFile = _a[_i]; - var nameTable = getNameTable(sourceFile); - for (var name_30 in nameTable) { - if (!allNames[name_30]) { - allNames[name_30] = name_30; - var displayName = getCompletionEntryDisplayName(name_30, target, true); - if (displayName) { - var entry = { - name: displayName, - kind: ScriptElementKind.warning, - kindModifiers: "", - sortText: "1" - }; - entries.push(entry); - } - } - } - } - return entries; - } - function createCompletionEntry(symbol, location) { - // Try to get a valid display name for this symbol, if we could not find one, then ignore it. - // We would like to only show things that can be added after a dot, so for instance numeric properties can - // not be accessed with a dot (a.1 <- invalid) - var displayName = getCompletionEntryDisplayNameForSymbol(symbol, program.getCompilerOptions().target, true); - if (!displayName) { - return undefined; - } - // TODO(drosen): Right now we just permit *all* semantic meanings when calling - // 'getSymbolKind' which is permissible given that it is backwards compatible; but - // really we should consider passing the meaning for the node so that we don't report - // that a suggestion for a value is an interface. We COULD also just do what - // 'getSymbolModifiers' does, which is to use the first declaration. - // Use a 'sortText' of 0' so that all symbol completion entries come before any other - // entries (like JavaScript identifier entries). - return { - name: displayName, - kind: getSymbolKind(symbol, location), - kindModifiers: getSymbolModifiers(symbol), - sortText: "0" - }; - } - function getCompletionEntriesFromSymbols(symbols) { - var start = new Date().getTime(); - var entries = []; - if (symbols) { - var nameToSymbol = {}; - for (var _i = 0; _i < symbols.length; _i++) { - var symbol = symbols[_i]; - var entry = createCompletionEntry(symbol, location); - if (entry) { - var id = ts.escapeIdentifier(entry.name); - if (!ts.lookUp(nameToSymbol, id)) { - entries.push(entry); - nameToSymbol[id] = symbol; - } - } - } - } - log("getCompletionsAtPosition: getCompletionEntriesFromSymbols: " + (new Date().getTime() - start)); - return entries; - } - } - function getCompletionEntryDetails(fileName, position, entryName) { - synchronizeHostData(); - // Compute all the completion symbols again. - var completionData = getCompletionData(fileName, position); - if (completionData) { - var symbols = completionData.symbols, location_2 = completionData.location; - // Find the symbol with the matching entry name. - var target = program.getCompilerOptions().target; - // We don't need to perform character checks here because we're only comparing the - // name against 'entryName' (which is known to be good), not building a new - // completion entry. - var symbol = ts.forEach(symbols, function (s) { return getCompletionEntryDisplayNameForSymbol(s, target, false) === entryName ? s : undefined; }); - if (symbol) { - var displayPartsDocumentationsAndSymbolKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, getValidSourceFile(fileName), location_2, location_2, 7 /* All */); - return { - name: entryName, - kind: displayPartsDocumentationsAndSymbolKind.symbolKind, - kindModifiers: getSymbolModifiers(symbol), - displayParts: displayPartsDocumentationsAndSymbolKind.displayParts, - documentation: displayPartsDocumentationsAndSymbolKind.documentation - }; - } - } - // Didn't find a symbol with this name. See if we can find a keyword instead. - var keywordCompletion = ts.forEach(keywordCompletions, function (c) { return c.name === entryName; }); - if (keywordCompletion) { - return { - name: entryName, - kind: ScriptElementKind.keyword, - kindModifiers: ScriptElementKindModifier.none, - displayParts: [ts.displayPart(entryName, SymbolDisplayPartKind.keyword)], - documentation: undefined - }; - } - return undefined; - } - // TODO(drosen): use contextual SemanticMeaning. - function getSymbolKind(symbol, location) { - var flags = symbol.getFlags(); - if (flags & 32 /* Class */) - return ScriptElementKind.classElement; - if (flags & 384 /* Enum */) - return ScriptElementKind.enumElement; - if (flags & 524288 /* TypeAlias */) - return ScriptElementKind.typeElement; - if (flags & 64 /* Interface */) - return ScriptElementKind.interfaceElement; - if (flags & 262144 /* TypeParameter */) - return ScriptElementKind.typeParameterElement; - var result = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, flags, location); - if (result === ScriptElementKind.unknown) { - if (flags & 262144 /* TypeParameter */) - return ScriptElementKind.typeParameterElement; - if (flags & 8 /* EnumMember */) - return ScriptElementKind.variableElement; - if (flags & 8388608 /* Alias */) - return ScriptElementKind.alias; - if (flags & 1536 /* Module */) - return ScriptElementKind.moduleElement; - } - return result; - } - function getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, flags, location) { - var typeChecker = program.getTypeChecker(); - if (typeChecker.isUndefinedSymbol(symbol)) { - return ScriptElementKind.variableElement; - } - if (typeChecker.isArgumentsSymbol(symbol)) { - return ScriptElementKind.localVariableElement; - } - if (flags & 3 /* Variable */) { - if (ts.isFirstDeclarationOfSymbolParameter(symbol)) { - return ScriptElementKind.parameterElement; - } - else if (symbol.valueDeclaration && ts.isConst(symbol.valueDeclaration)) { - return ScriptElementKind.constElement; - } - else if (ts.forEach(symbol.declarations, ts.isLet)) { - return ScriptElementKind.letElement; - } - return isLocalVariableOrFunction(symbol) ? ScriptElementKind.localVariableElement : ScriptElementKind.variableElement; - } - if (flags & 16 /* Function */) - return isLocalVariableOrFunction(symbol) ? ScriptElementKind.localFunctionElement : ScriptElementKind.functionElement; - if (flags & 32768 /* GetAccessor */) - return ScriptElementKind.memberGetAccessorElement; - if (flags & 65536 /* SetAccessor */) - return ScriptElementKind.memberSetAccessorElement; - if (flags & 8192 /* Method */) - return ScriptElementKind.memberFunctionElement; - if (flags & 16384 /* Constructor */) - return ScriptElementKind.constructorImplementationElement; - if (flags & 4 /* Property */) { - if (flags & 268435456 /* UnionProperty */) { - // If union property is result of union of non method (property/accessors/variables), it is labeled as property - var unionPropertyKind = ts.forEach(typeChecker.getRootSymbols(symbol), function (rootSymbol) { - var rootSymbolFlags = rootSymbol.getFlags(); - if (rootSymbolFlags & (98308 /* PropertyOrAccessor */ | 3 /* Variable */)) { - return ScriptElementKind.memberVariableElement; - } - ts.Debug.assert(!!(rootSymbolFlags & 8192 /* Method */)); - }); - if (!unionPropertyKind) { - // If this was union of all methods, - //make sure it has call signatures before we can label it as method - var typeOfUnionProperty = typeChecker.getTypeOfSymbolAtLocation(symbol, location); - if (typeOfUnionProperty.getCallSignatures().length) { - return ScriptElementKind.memberFunctionElement; - } - return ScriptElementKind.memberVariableElement; - } - return unionPropertyKind; - } - return ScriptElementKind.memberVariableElement; - } - return ScriptElementKind.unknown; - } - function getSymbolModifiers(symbol) { - return symbol && symbol.declarations && symbol.declarations.length > 0 - ? ts.getNodeModifiers(symbol.declarations[0]) - : ScriptElementKindModifier.none; - } - // TODO(drosen): Currently completion entry details passes the SemanticMeaning.All instead of using semanticMeaning of location - function getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, sourceFile, enclosingDeclaration, location, semanticMeaning) { - if (semanticMeaning === void 0) { semanticMeaning = getMeaningFromLocation(location); } - var typeChecker = program.getTypeChecker(); - var displayParts = []; - var documentation; - var symbolFlags = symbol.flags; - var symbolKind = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(symbol, symbolFlags, location); - var hasAddedSymbolInfo; - var type; - // Class at constructor site need to be shown as constructor apart from property,method, vars - if (symbolKind !== ScriptElementKind.unknown || symbolFlags & 32 /* Class */ || symbolFlags & 8388608 /* Alias */) { - // If it is accessor they are allowed only if location is at name of the accessor - if (symbolKind === ScriptElementKind.memberGetAccessorElement || symbolKind === ScriptElementKind.memberSetAccessorElement) { - symbolKind = ScriptElementKind.memberVariableElement; - } - var signature; - type = typeChecker.getTypeOfSymbolAtLocation(symbol, location); - if (type) { - if (location.parent && location.parent.kind === 158 /* PropertyAccessExpression */) { - var right = location.parent.name; - // Either the location is on the right of a property access, or on the left and the right is missing - if (right === location || (right && right.getFullWidth() === 0)) { - location = location.parent; - } - } - // try get the call/construct signature from the type if it matches - var callExpression; - if (location.kind === 160 /* CallExpression */ || location.kind === 161 /* NewExpression */) { - callExpression = location; - } - else if (isCallExpressionTarget(location) || isNewExpressionTarget(location)) { - callExpression = location.parent; - } - if (callExpression) { - var candidateSignatures = []; - signature = typeChecker.getResolvedSignature(callExpression, candidateSignatures); - if (!signature && candidateSignatures.length) { - // Use the first candidate: - signature = candidateSignatures[0]; - } - var useConstructSignatures = callExpression.kind === 161 /* NewExpression */ || callExpression.expression.kind === 91 /* SuperKeyword */; - var allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures(); - if (!ts.contains(allSignatures, signature.target || signature)) { - // Get the first signature if there - signature = allSignatures.length ? allSignatures[0] : undefined; - } - if (signature) { - if (useConstructSignatures && (symbolFlags & 32 /* Class */)) { - // Constructor - symbolKind = ScriptElementKind.constructorImplementationElement; - addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); - } - else if (symbolFlags & 8388608 /* Alias */) { - symbolKind = ScriptElementKind.alias; - pushTypePart(symbolKind); - displayParts.push(ts.spacePart()); - if (useConstructSignatures) { - displayParts.push(ts.keywordPart(88 /* NewKeyword */)); - displayParts.push(ts.spacePart()); - } - addFullSymbolName(symbol); - } - else { - addPrefixForAnyFunctionOrVar(symbol, symbolKind); - } - switch (symbolKind) { - case ScriptElementKind.memberVariableElement: - case ScriptElementKind.variableElement: - case ScriptElementKind.constElement: - case ScriptElementKind.letElement: - case ScriptElementKind.parameterElement: - case ScriptElementKind.localVariableElement: - // If it is call or construct signature of lambda's write type name - displayParts.push(ts.punctuationPart(51 /* ColonToken */)); - displayParts.push(ts.spacePart()); - if (useConstructSignatures) { - displayParts.push(ts.keywordPart(88 /* NewKeyword */)); - displayParts.push(ts.spacePart()); - } - if (!(type.flags & 32768 /* Anonymous */)) { - displayParts.push.apply(displayParts, ts.symbolToDisplayParts(typeChecker, type.symbol, enclosingDeclaration, undefined, 1 /* WriteTypeParametersOrArguments */)); - } - addSignatureDisplayParts(signature, allSignatures, 8 /* WriteArrowStyleSignature */); - break; - default: - // Just signature - addSignatureDisplayParts(signature, allSignatures); - } - hasAddedSymbolInfo = true; - } - } - else if ((isNameOfFunctionDeclaration(location) && !(symbol.flags & 98304 /* Accessor */)) || - (location.kind === 114 /* ConstructorKeyword */ && location.parent.kind === 137 /* Constructor */)) { - // get the signature from the declaration and write it - var functionDeclaration = location.parent; - var allSignatures = functionDeclaration.kind === 137 /* Constructor */ ? type.getConstructSignatures() : type.getCallSignatures(); - if (!typeChecker.isImplementationOfOverload(functionDeclaration)) { - signature = typeChecker.getSignatureFromDeclaration(functionDeclaration); - } - else { - signature = allSignatures[0]; - } - if (functionDeclaration.kind === 137 /* Constructor */) { - // show (constructor) Type(...) signature - symbolKind = ScriptElementKind.constructorImplementationElement; - addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); - } - else { - // (function/method) symbol(..signature) - addPrefixForAnyFunctionOrVar(functionDeclaration.kind === 140 /* CallSignature */ && - !(type.symbol.flags & 2048 /* TypeLiteral */ || type.symbol.flags & 4096 /* ObjectLiteral */) ? type.symbol : symbol, symbolKind); - } - addSignatureDisplayParts(signature, allSignatures); - hasAddedSymbolInfo = true; - } - } - } - if (symbolFlags & 32 /* Class */ && !hasAddedSymbolInfo) { - displayParts.push(ts.keywordPart(69 /* ClassKeyword */)); - displayParts.push(ts.spacePart()); - addFullSymbolName(symbol); - writeTypeParametersOfSymbol(symbol, sourceFile); - } - if ((symbolFlags & 64 /* Interface */) && (semanticMeaning & 2 /* Type */)) { - addNewLineIfDisplayPartsExist(); - displayParts.push(ts.keywordPart(103 /* InterfaceKeyword */)); - displayParts.push(ts.spacePart()); - addFullSymbolName(symbol); - writeTypeParametersOfSymbol(symbol, sourceFile); - } - if (symbolFlags & 524288 /* TypeAlias */) { - addNewLineIfDisplayPartsExist(); - displayParts.push(ts.keywordPart(125 /* TypeKeyword */)); - displayParts.push(ts.spacePart()); - addFullSymbolName(symbol); - displayParts.push(ts.spacePart()); - displayParts.push(ts.operatorPart(53 /* EqualsToken */)); - displayParts.push(ts.spacePart()); - displayParts.push.apply(displayParts, ts.typeToDisplayParts(typeChecker, typeChecker.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration)); - } - if (symbolFlags & 384 /* Enum */) { - addNewLineIfDisplayPartsExist(); - if (ts.forEach(symbol.declarations, ts.isConstEnumDeclaration)) { - displayParts.push(ts.keywordPart(70 /* ConstKeyword */)); - displayParts.push(ts.spacePart()); - } - displayParts.push(ts.keywordPart(77 /* EnumKeyword */)); - displayParts.push(ts.spacePart()); - addFullSymbolName(symbol); - } - if (symbolFlags & 1536 /* Module */) { - addNewLineIfDisplayPartsExist(); - var declaration = ts.getDeclarationOfKind(symbol, 208 /* ModuleDeclaration */); - var isNamespace = declaration && declaration.name && declaration.name.kind === 65 /* Identifier */; - displayParts.push(ts.keywordPart(isNamespace ? 119 /* NamespaceKeyword */ : 118 /* ModuleKeyword */)); - displayParts.push(ts.spacePart()); - addFullSymbolName(symbol); - } - if ((symbolFlags & 262144 /* TypeParameter */) && (semanticMeaning & 2 /* Type */)) { - addNewLineIfDisplayPartsExist(); - displayParts.push(ts.punctuationPart(16 /* OpenParenToken */)); - displayParts.push(ts.textPart("type parameter")); - displayParts.push(ts.punctuationPart(17 /* CloseParenToken */)); - displayParts.push(ts.spacePart()); - addFullSymbolName(symbol); - displayParts.push(ts.spacePart()); - displayParts.push(ts.keywordPart(86 /* InKeyword */)); - displayParts.push(ts.spacePart()); - if (symbol.parent) { - // Class/Interface type parameter - addFullSymbolName(symbol.parent, enclosingDeclaration); - writeTypeParametersOfSymbol(symbol.parent, enclosingDeclaration); - } - else { - // Method/function type parameter - var signatureDeclaration = ts.getDeclarationOfKind(symbol, 130 /* TypeParameter */).parent; - var signature = typeChecker.getSignatureFromDeclaration(signatureDeclaration); - if (signatureDeclaration.kind === 141 /* ConstructSignature */) { - displayParts.push(ts.keywordPart(88 /* NewKeyword */)); - displayParts.push(ts.spacePart()); - } - else if (signatureDeclaration.kind !== 140 /* CallSignature */ && signatureDeclaration.name) { - addFullSymbolName(signatureDeclaration.symbol); - } - displayParts.push.apply(displayParts, ts.signatureToDisplayParts(typeChecker, signature, sourceFile, 32 /* WriteTypeArgumentsOfSignature */)); - } - } - if (symbolFlags & 8 /* EnumMember */) { - addPrefixForAnyFunctionOrVar(symbol, "enum member"); - var declaration = symbol.declarations[0]; - if (declaration.kind === 229 /* EnumMember */) { - var constantValue = typeChecker.getConstantValue(declaration); - if (constantValue !== undefined) { - displayParts.push(ts.spacePart()); - displayParts.push(ts.operatorPart(53 /* EqualsToken */)); - displayParts.push(ts.spacePart()); - displayParts.push(ts.displayPart(constantValue.toString(), SymbolDisplayPartKind.numericLiteral)); - } - } - } - if (symbolFlags & 8388608 /* Alias */) { - addNewLineIfDisplayPartsExist(); - displayParts.push(ts.keywordPart(85 /* ImportKeyword */)); - displayParts.push(ts.spacePart()); - addFullSymbolName(symbol); - ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 211 /* ImportEqualsDeclaration */) { - var importEqualsDeclaration = declaration; - if (ts.isExternalModuleImportEqualsDeclaration(importEqualsDeclaration)) { - displayParts.push(ts.spacePart()); - displayParts.push(ts.operatorPart(53 /* EqualsToken */)); - displayParts.push(ts.spacePart()); - displayParts.push(ts.keywordPart(120 /* RequireKeyword */)); - displayParts.push(ts.punctuationPart(16 /* OpenParenToken */)); - displayParts.push(ts.displayPart(ts.getTextOfNode(ts.getExternalModuleImportEqualsDeclarationExpression(importEqualsDeclaration)), SymbolDisplayPartKind.stringLiteral)); - displayParts.push(ts.punctuationPart(17 /* CloseParenToken */)); - } - else { - var internalAliasSymbol = typeChecker.getSymbolAtLocation(importEqualsDeclaration.moduleReference); - if (internalAliasSymbol) { - displayParts.push(ts.spacePart()); - displayParts.push(ts.operatorPart(53 /* EqualsToken */)); - displayParts.push(ts.spacePart()); - addFullSymbolName(internalAliasSymbol, enclosingDeclaration); - } - } - return true; - } - }); - } - if (!hasAddedSymbolInfo) { - if (symbolKind !== ScriptElementKind.unknown) { - if (type) { - addPrefixForAnyFunctionOrVar(symbol, symbolKind); - // For properties, variables and local vars: show the type - if (symbolKind === ScriptElementKind.memberVariableElement || - symbolFlags & 3 /* Variable */ || - symbolKind === ScriptElementKind.localVariableElement) { - displayParts.push(ts.punctuationPart(51 /* ColonToken */)); - displayParts.push(ts.spacePart()); - // If the type is type parameter, format it specially - if (type.symbol && type.symbol.flags & 262144 /* TypeParameter */) { - var typeParameterParts = ts.mapToDisplayParts(function (writer) { - typeChecker.getSymbolDisplayBuilder().buildTypeParameterDisplay(type, writer, enclosingDeclaration); - }); - displayParts.push.apply(displayParts, typeParameterParts); - } - else { - displayParts.push.apply(displayParts, ts.typeToDisplayParts(typeChecker, type, enclosingDeclaration)); - } - } - else if (symbolFlags & 16 /* Function */ || - symbolFlags & 8192 /* Method */ || - symbolFlags & 16384 /* Constructor */ || - symbolFlags & 131072 /* Signature */ || - symbolFlags & 98304 /* Accessor */ || - symbolKind === ScriptElementKind.memberFunctionElement) { - var allSignatures = type.getCallSignatures(); - addSignatureDisplayParts(allSignatures[0], allSignatures); - } - } - } - else { - symbolKind = getSymbolKind(symbol, location); - } - } - if (!documentation) { - documentation = symbol.getDocumentationComment(); - } - return { displayParts: displayParts, documentation: documentation, symbolKind: symbolKind }; - function addNewLineIfDisplayPartsExist() { - if (displayParts.length) { - displayParts.push(ts.lineBreakPart()); - } - } - function addFullSymbolName(symbol, enclosingDeclaration) { - var fullSymbolDisplayParts = ts.symbolToDisplayParts(typeChecker, symbol, enclosingDeclaration || sourceFile, undefined, 1 /* WriteTypeParametersOrArguments */ | 2 /* UseOnlyExternalAliasing */); - displayParts.push.apply(displayParts, fullSymbolDisplayParts); - } - function addPrefixForAnyFunctionOrVar(symbol, symbolKind) { - addNewLineIfDisplayPartsExist(); - if (symbolKind) { - pushTypePart(symbolKind); - displayParts.push(ts.spacePart()); - addFullSymbolName(symbol); - } - } - function pushTypePart(symbolKind) { - switch (symbolKind) { - case ScriptElementKind.variableElement: - case ScriptElementKind.functionElement: - case ScriptElementKind.letElement: - case ScriptElementKind.constElement: - case ScriptElementKind.constructorImplementationElement: - displayParts.push(ts.textOrKeywordPart(symbolKind)); - return; - default: - displayParts.push(ts.punctuationPart(16 /* OpenParenToken */)); - displayParts.push(ts.textOrKeywordPart(symbolKind)); - displayParts.push(ts.punctuationPart(17 /* CloseParenToken */)); - return; - } - } - function addSignatureDisplayParts(signature, allSignatures, flags) { - displayParts.push.apply(displayParts, ts.signatureToDisplayParts(typeChecker, signature, enclosingDeclaration, flags | 32 /* WriteTypeArgumentsOfSignature */)); - if (allSignatures.length > 1) { - displayParts.push(ts.spacePart()); - displayParts.push(ts.punctuationPart(16 /* OpenParenToken */)); - displayParts.push(ts.operatorPart(33 /* PlusToken */)); - displayParts.push(ts.displayPart((allSignatures.length - 1).toString(), SymbolDisplayPartKind.numericLiteral)); - displayParts.push(ts.spacePart()); - displayParts.push(ts.textPart(allSignatures.length === 2 ? "overload" : "overloads")); - displayParts.push(ts.punctuationPart(17 /* CloseParenToken */)); - } - documentation = signature.getDocumentationComment(); - } - function writeTypeParametersOfSymbol(symbol, enclosingDeclaration) { - var typeParameterParts = ts.mapToDisplayParts(function (writer) { - typeChecker.getSymbolDisplayBuilder().buildTypeParameterDisplayFromSymbol(symbol, writer, enclosingDeclaration); - }); - displayParts.push.apply(displayParts, typeParameterParts); - } - } - function getQuickInfoAtPosition(fileName, position) { - synchronizeHostData(); - var sourceFile = getValidSourceFile(fileName); - var node = ts.getTouchingPropertyName(sourceFile, position); - if (!node) { - return undefined; - } - if (isLabelName(node)) { - return undefined; - } - var typeChecker = program.getTypeChecker(); - var symbol = typeChecker.getSymbolAtLocation(node); - if (!symbol) { - // Try getting just type at this position and show - switch (node.kind) { - case 65 /* Identifier */: - case 158 /* PropertyAccessExpression */: - case 128 /* QualifiedName */: - case 93 /* ThisKeyword */: - case 91 /* SuperKeyword */: - // For the identifiers/this/super etc get the type at position - var type = typeChecker.getTypeAtLocation(node); - if (type) { - return { - kind: ScriptElementKind.unknown, - kindModifiers: ScriptElementKindModifier.none, - textSpan: ts.createTextSpan(node.getStart(), node.getWidth()), - displayParts: ts.typeToDisplayParts(typeChecker, type, getContainerNode(node)), - documentation: type.symbol ? type.symbol.getDocumentationComment() : undefined - }; - } - } - return undefined; - } - var displayPartsDocumentationsAndKind = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, sourceFile, getContainerNode(node), node); - return { - kind: displayPartsDocumentationsAndKind.symbolKind, - kindModifiers: getSymbolModifiers(symbol), - textSpan: ts.createTextSpan(node.getStart(), node.getWidth()), - displayParts: displayPartsDocumentationsAndKind.displayParts, - documentation: displayPartsDocumentationsAndKind.documentation - }; - } - function createDefinitionInfo(node, symbolKind, symbolName, containerName) { - return { - fileName: node.getSourceFile().fileName, - textSpan: ts.createTextSpanFromBounds(node.getStart(), node.getEnd()), - kind: symbolKind, - name: symbolName, - containerKind: undefined, - containerName: containerName - }; - } - function getDefinitionFromSymbol(symbol, node) { - var typeChecker = program.getTypeChecker(); - var result = []; - var declarations = symbol.getDeclarations(); - var symbolName = typeChecker.symbolToString(symbol); // Do not get scoped name, just the name of the symbol - var symbolKind = getSymbolKind(symbol, node); - var containerSymbol = symbol.parent; - var containerName = containerSymbol ? typeChecker.symbolToString(containerSymbol, node) : ""; - if (!tryAddConstructSignature(symbol, node, symbolKind, symbolName, containerName, result) && - !tryAddCallSignature(symbol, node, symbolKind, symbolName, containerName, result)) { - // Just add all the declarations. - ts.forEach(declarations, function (declaration) { - result.push(createDefinitionInfo(declaration, symbolKind, symbolName, containerName)); - }); - } - return result; - function tryAddConstructSignature(symbol, location, symbolKind, symbolName, containerName, result) { - // Applicable only if we are in a new expression, or we are on a constructor declaration - // and in either case the symbol has a construct signature definition, i.e. class - if (isNewExpressionTarget(location) || location.kind === 114 /* ConstructorKeyword */) { - if (symbol.flags & 32 /* Class */) { - var classDeclaration = symbol.getDeclarations()[0]; - ts.Debug.assert(classDeclaration && classDeclaration.kind === 204 /* ClassDeclaration */); - return tryAddSignature(classDeclaration.members, true, symbolKind, symbolName, containerName, result); - } - } - return false; - } - function tryAddCallSignature(symbol, location, symbolKind, symbolName, containerName, result) { - if (isCallExpressionTarget(location) || isNewExpressionTarget(location) || isNameOfFunctionDeclaration(location)) { - return tryAddSignature(symbol.declarations, false, symbolKind, symbolName, containerName, result); - } - return false; - } - function tryAddSignature(signatureDeclarations, selectConstructors, symbolKind, symbolName, containerName, result) { - var declarations = []; - var definition; - ts.forEach(signatureDeclarations, function (d) { - if ((selectConstructors && d.kind === 137 /* Constructor */) || - (!selectConstructors && (d.kind === 203 /* FunctionDeclaration */ || d.kind === 136 /* MethodDeclaration */ || d.kind === 135 /* MethodSignature */))) { - declarations.push(d); - if (d.body) - definition = d; - } - }); - if (definition) { - result.push(createDefinitionInfo(definition, symbolKind, symbolName, containerName)); - return true; - } - else if (declarations.length) { - result.push(createDefinitionInfo(ts.lastOrUndefined(declarations), symbolKind, symbolName, containerName)); - return true; - } - return false; - } - } - /// Goto definition - function getDefinitionAtPosition(fileName, position) { - synchronizeHostData(); - var sourceFile = getValidSourceFile(fileName); - var node = ts.getTouchingPropertyName(sourceFile, position); - if (!node) { - return undefined; - } - // Labels - if (isJumpStatementTarget(node)) { - var labelName = node.text; - var label = getTargetLabel(node.parent, node.text); - return label ? [createDefinitionInfo(label, ScriptElementKind.label, labelName, undefined)] : undefined; - } - /// Triple slash reference comments - var comment = ts.forEach(sourceFile.referencedFiles, function (r) { return (r.pos <= position && position < r.end) ? r : undefined; }); - if (comment) { - var referenceFile = ts.tryResolveScriptReference(program, sourceFile, comment); - if (referenceFile) { - return [{ - fileName: referenceFile.fileName, - textSpan: ts.createTextSpanFromBounds(0, 0), - kind: ScriptElementKind.scriptElement, - name: comment.fileName, - containerName: undefined, - containerKind: undefined - }]; - } - return undefined; - } - var typeChecker = program.getTypeChecker(); - var symbol = typeChecker.getSymbolAtLocation(node); - // Could not find a symbol e.g. node is string or number keyword, - // or the symbol was an internal symbol and does not have a declaration e.g. undefined symbol - if (!symbol) { - return undefined; - } - // If this is an alias, and the request came at the declaration location - // get the aliased symbol instead. This allows for goto def on an import e.g. - // import {A, B} from "mod"; - // to jump to the implementation directly. - if (symbol.flags & 8388608 /* Alias */) { - var declaration = symbol.declarations[0]; - if (node.kind === 65 /* Identifier */ && node.parent === declaration) { - symbol = typeChecker.getAliasedSymbol(symbol); - } - } - // Because name in short-hand property assignment has two different meanings: property name and property value, - // using go-to-definition at such position should go to the variable declaration of the property value rather than - // go to the declaration of the property name (in this case stay at the same position). However, if go-to-definition - // is performed at the location of property access, we would like to go to definition of the property in the short-hand - // assignment. This case and others are handled by the following code. - if (node.parent.kind === 228 /* ShorthandPropertyAssignment */) { - var shorthandSymbol = typeChecker.getShorthandAssignmentValueSymbol(symbol.valueDeclaration); - if (!shorthandSymbol) { - return []; - } - var shorthandDeclarations = shorthandSymbol.getDeclarations(); - var shorthandSymbolKind = getSymbolKind(shorthandSymbol, node); - var shorthandSymbolName = typeChecker.symbolToString(shorthandSymbol); - var shorthandContainerName = typeChecker.symbolToString(symbol.parent, node); - return ts.map(shorthandDeclarations, function (declaration) { return createDefinitionInfo(declaration, shorthandSymbolKind, shorthandSymbolName, shorthandContainerName); }); - } - return getDefinitionFromSymbol(symbol, node); - } - /// Goto type - function getTypeDefinitionAtPosition(fileName, position) { - synchronizeHostData(); - var sourceFile = getValidSourceFile(fileName); - var node = ts.getTouchingPropertyName(sourceFile, position); - if (!node) { - return undefined; - } - var typeChecker = program.getTypeChecker(); - var symbol = typeChecker.getSymbolAtLocation(node); - if (!symbol) { - return undefined; - } - var type = typeChecker.getTypeOfSymbolAtLocation(symbol, node); - if (!type) { - return undefined; - } - if (type.flags & 16384 /* Union */) { - var result = []; - ts.forEach(type.types, function (t) { - if (t.symbol) { - result.push.apply(result, getDefinitionFromSymbol(t.symbol, node)); - } - }); - return result; - } - if (!type.symbol) { - return undefined; - } - return getDefinitionFromSymbol(type.symbol, node); - } - function getOccurrencesAtPosition(fileName, position) { - var results = getOccurrencesAtPositionCore(fileName, position); - if (results) { - var sourceFile = getCanonicalFileName(ts.normalizeSlashes(fileName)); - // Get occurrences only supports reporting occurrences for the file queried. So - // filter down to that list. - results = ts.filter(results, function (r) { return getCanonicalFileName(ts.normalizeSlashes(r.fileName)) === sourceFile; }); - } - return results; - } - function getDocumentHighlights(fileName, position, filesToSearch) { - synchronizeHostData(); - filesToSearch = ts.map(filesToSearch, ts.normalizeSlashes); - var sourceFilesToSearch = ts.filter(program.getSourceFiles(), function (f) { return ts.contains(filesToSearch, f.fileName); }); - var sourceFile = getValidSourceFile(fileName); - var node = ts.getTouchingWord(sourceFile, position); - if (!node) { - return undefined; - } - return getSemanticDocumentHighlights(node) || getSyntacticDocumentHighlights(node); - function getHighlightSpanForNode(node) { - var start = node.getStart(); - var end = node.getEnd(); - return { - fileName: sourceFile.fileName, - textSpan: ts.createTextSpanFromBounds(start, end), - kind: HighlightSpanKind.none - }; - } - function getSemanticDocumentHighlights(node) { - if (node.kind === 65 /* Identifier */ || - node.kind === 93 /* ThisKeyword */ || - node.kind === 91 /* SuperKeyword */ || - isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || - isNameOfExternalModuleImportOrDeclaration(node)) { - var referencedSymbols = getReferencedSymbolsForNodes(node, sourceFilesToSearch, false, false); - return convertReferencedSymbols(referencedSymbols); - } - return undefined; - function convertReferencedSymbols(referencedSymbols) { - if (!referencedSymbols) { - return undefined; - } - var fileNameToDocumentHighlights = {}; - var result = []; - for (var _i = 0; _i < referencedSymbols.length; _i++) { - var referencedSymbol = referencedSymbols[_i]; - for (var _a = 0, _b = referencedSymbol.references; _a < _b.length; _a++) { - var referenceEntry = _b[_a]; - var fileName_1 = referenceEntry.fileName; - var documentHighlights = ts.getProperty(fileNameToDocumentHighlights, fileName_1); - if (!documentHighlights) { - documentHighlights = { fileName: fileName_1, highlightSpans: [] }; - fileNameToDocumentHighlights[fileName_1] = documentHighlights; - result.push(documentHighlights); - } - documentHighlights.highlightSpans.push({ - textSpan: referenceEntry.textSpan, - kind: referenceEntry.isWriteAccess ? HighlightSpanKind.writtenReference : HighlightSpanKind.reference - }); - } - } - return result; - } - } - function getSyntacticDocumentHighlights(node) { - var fileName = sourceFile.fileName; - var highlightSpans = getHighlightSpans(node); - if (!highlightSpans || highlightSpans.length === 0) { - return undefined; - } - return [{ fileName: fileName, highlightSpans: highlightSpans }]; - // returns true if 'node' is defined and has a matching 'kind'. - function hasKind(node, kind) { - return node !== undefined && node.kind === kind; - } - // Null-propagating 'parent' function. - function parent(node) { - return node && node.parent; - } - function getHighlightSpans(node) { - if (node) { - switch (node.kind) { - case 84 /* IfKeyword */: - case 76 /* ElseKeyword */: - if (hasKind(node.parent, 186 /* IfStatement */)) { - return getIfElseOccurrences(node.parent); - } - break; - case 90 /* ReturnKeyword */: - if (hasKind(node.parent, 194 /* ReturnStatement */)) { - return getReturnOccurrences(node.parent); - } - break; - case 94 /* ThrowKeyword */: - if (hasKind(node.parent, 198 /* ThrowStatement */)) { - return getThrowOccurrences(node.parent); - } - break; - case 68 /* CatchKeyword */: - if (hasKind(parent(parent(node)), 199 /* TryStatement */)) { - return getTryCatchFinallyOccurrences(node.parent.parent); - } - break; - case 96 /* TryKeyword */: - case 81 /* FinallyKeyword */: - if (hasKind(parent(node), 199 /* TryStatement */)) { - return getTryCatchFinallyOccurrences(node.parent); - } - break; - case 92 /* SwitchKeyword */: - if (hasKind(node.parent, 196 /* SwitchStatement */)) { - return getSwitchCaseDefaultOccurrences(node.parent); - } - break; - case 67 /* CaseKeyword */: - case 73 /* DefaultKeyword */: - if (hasKind(parent(parent(parent(node))), 196 /* SwitchStatement */)) { - return getSwitchCaseDefaultOccurrences(node.parent.parent.parent); - } - break; - case 66 /* BreakKeyword */: - case 71 /* ContinueKeyword */: - if (hasKind(node.parent, 193 /* BreakStatement */) || hasKind(node.parent, 192 /* ContinueStatement */)) { - return getBreakOrContinueStatementOccurences(node.parent); - } - break; - case 82 /* ForKeyword */: - if (hasKind(node.parent, 189 /* ForStatement */) || - hasKind(node.parent, 190 /* ForInStatement */) || - hasKind(node.parent, 191 /* ForOfStatement */)) { - return getLoopBreakContinueOccurrences(node.parent); - } - break; - case 100 /* WhileKeyword */: - case 75 /* DoKeyword */: - if (hasKind(node.parent, 188 /* WhileStatement */) || hasKind(node.parent, 187 /* DoStatement */)) { - return getLoopBreakContinueOccurrences(node.parent); - } - break; - case 114 /* ConstructorKeyword */: - if (hasKind(node.parent, 137 /* Constructor */)) { - return getConstructorOccurrences(node.parent); - } - break; - case 116 /* GetKeyword */: - case 122 /* SetKeyword */: - if (hasKind(node.parent, 138 /* GetAccessor */) || hasKind(node.parent, 139 /* SetAccessor */)) { - return getGetAndSetOccurrences(node.parent); - } - default: - if (ts.isModifier(node.kind) && node.parent && - (ts.isDeclaration(node.parent) || node.parent.kind === 183 /* VariableStatement */)) { - return getModifierOccurrences(node.kind, node.parent); - } - } - } - return undefined; - } - /** - * Aggregates all throw-statements within this node *without* crossing - * into function boundaries and try-blocks with catch-clauses. - */ - function aggregateOwnedThrowStatements(node) { - var statementAccumulator = []; - aggregate(node); - return statementAccumulator; - function aggregate(node) { - if (node.kind === 198 /* ThrowStatement */) { - statementAccumulator.push(node); - } - else if (node.kind === 199 /* TryStatement */) { - var tryStatement = node; - if (tryStatement.catchClause) { - aggregate(tryStatement.catchClause); - } - else { - // Exceptions thrown within a try block lacking a catch clause - // are "owned" in the current context. - aggregate(tryStatement.tryBlock); - } - if (tryStatement.finallyBlock) { - aggregate(tryStatement.finallyBlock); - } - } - else if (!ts.isFunctionLike(node)) { - ts.forEachChild(node, aggregate); - } - } - ; - } - /** - * For lack of a better name, this function takes a throw statement and returns the - * nearest ancestor that is a try-block (whose try statement has a catch clause), - * function-block, or source file. - */ - function getThrowStatementOwner(throwStatement) { - var child = throwStatement; - while (child.parent) { - var parent_11 = child.parent; - if (ts.isFunctionBlock(parent_11) || parent_11.kind === 230 /* SourceFile */) { - return parent_11; - } - // A throw-statement is only owned by a try-statement if the try-statement has - // a catch clause, and if the throw-statement occurs within the try block. - if (parent_11.kind === 199 /* TryStatement */) { - var tryStatement = parent_11; - if (tryStatement.tryBlock === child && tryStatement.catchClause) { - return child; - } - } - child = parent_11; - } - return undefined; - } - function aggregateAllBreakAndContinueStatements(node) { - var statementAccumulator = []; - aggregate(node); - return statementAccumulator; - function aggregate(node) { - if (node.kind === 193 /* BreakStatement */ || node.kind === 192 /* ContinueStatement */) { - statementAccumulator.push(node); - } - else if (!ts.isFunctionLike(node)) { - ts.forEachChild(node, aggregate); - } - } - ; - } - function ownsBreakOrContinueStatement(owner, statement) { - var actualOwner = getBreakOrContinueOwner(statement); - return actualOwner && actualOwner === owner; - } - function getBreakOrContinueOwner(statement) { - for (var node_2 = statement.parent; node_2; node_2 = node_2.parent) { - switch (node_2.kind) { - case 196 /* SwitchStatement */: - if (statement.kind === 192 /* ContinueStatement */) { - continue; - } - // Fall through. - case 189 /* ForStatement */: - case 190 /* ForInStatement */: - case 191 /* ForOfStatement */: - case 188 /* WhileStatement */: - case 187 /* DoStatement */: - if (!statement.label || isLabeledBy(node_2, statement.label.text)) { - return node_2; - } - break; - default: - // Don't cross function boundaries. - if (ts.isFunctionLike(node_2)) { - return undefined; - } - break; - } - } - return undefined; - } - function getModifierOccurrences(modifier, declaration) { - var container = declaration.parent; - // Make sure we only highlight the keyword when it makes sense to do so. - if (ts.isAccessibilityModifier(modifier)) { - if (!(container.kind === 204 /* ClassDeclaration */ || - (declaration.kind === 131 /* Parameter */ && hasKind(container, 137 /* Constructor */)))) { - return undefined; - } - } - else if (modifier === 109 /* StaticKeyword */) { - if (container.kind !== 204 /* ClassDeclaration */) { - return undefined; - } - } - else if (modifier === 78 /* ExportKeyword */ || modifier === 115 /* DeclareKeyword */) { - if (!(container.kind === 209 /* ModuleBlock */ || container.kind === 230 /* SourceFile */)) { - return undefined; - } - } - else { - // unsupported modifier - return undefined; - } - var keywords = []; - var modifierFlag = getFlagFromModifier(modifier); - var nodes; - switch (container.kind) { - case 209 /* ModuleBlock */: - case 230 /* SourceFile */: - nodes = container.statements; - break; - case 137 /* Constructor */: - nodes = container.parameters.concat(container.parent.members); - break; - case 204 /* ClassDeclaration */: - nodes = container.members; - // If we're an accessibility modifier, we're in an instance member and should search - // the constructor's parameter list for instance members as well. - if (modifierFlag & 112 /* AccessibilityModifier */) { - var constructor = ts.forEach(container.members, function (member) { - return member.kind === 137 /* Constructor */ && member; - }); - if (constructor) { - nodes = nodes.concat(constructor.parameters); - } - } - break; - default: - ts.Debug.fail("Invalid container kind."); - } - ts.forEach(nodes, function (node) { - if (node.modifiers && node.flags & modifierFlag) { - ts.forEach(node.modifiers, function (child) { return pushKeywordIf(keywords, child, modifier); }); - } - }); - return ts.map(keywords, getHighlightSpanForNode); - function getFlagFromModifier(modifier) { - switch (modifier) { - case 108 /* PublicKeyword */: - return 16 /* Public */; - case 106 /* PrivateKeyword */: - return 32 /* Private */; - case 107 /* ProtectedKeyword */: - return 64 /* Protected */; - case 109 /* StaticKeyword */: - return 128 /* Static */; - case 78 /* ExportKeyword */: - return 1 /* Export */; - case 115 /* DeclareKeyword */: - return 2 /* Ambient */; - default: - ts.Debug.fail(); - } - } - } - function pushKeywordIf(keywordList, token) { - var expected = []; - for (var _i = 2; _i < arguments.length; _i++) { - expected[_i - 2] = arguments[_i]; - } - if (token && ts.contains(expected, token.kind)) { - keywordList.push(token); - return true; - } - return false; - } - function getGetAndSetOccurrences(accessorDeclaration) { - var keywords = []; - tryPushAccessorKeyword(accessorDeclaration.symbol, 138 /* GetAccessor */); - tryPushAccessorKeyword(accessorDeclaration.symbol, 139 /* SetAccessor */); - return ts.map(keywords, getHighlightSpanForNode); - function tryPushAccessorKeyword(accessorSymbol, accessorKind) { - var accessor = ts.getDeclarationOfKind(accessorSymbol, accessorKind); - if (accessor) { - ts.forEach(accessor.getChildren(), function (child) { return pushKeywordIf(keywords, child, 116 /* GetKeyword */, 122 /* SetKeyword */); }); - } - } - } - function getConstructorOccurrences(constructorDeclaration) { - var declarations = constructorDeclaration.symbol.getDeclarations(); - var keywords = []; - ts.forEach(declarations, function (declaration) { - ts.forEach(declaration.getChildren(), function (token) { - return pushKeywordIf(keywords, token, 114 /* ConstructorKeyword */); - }); - }); - return ts.map(keywords, getHighlightSpanForNode); - } - function getLoopBreakContinueOccurrences(loopNode) { - var keywords = []; - if (pushKeywordIf(keywords, loopNode.getFirstToken(), 82 /* ForKeyword */, 100 /* WhileKeyword */, 75 /* DoKeyword */)) { - // If we succeeded and got a do-while loop, then start looking for a 'while' keyword. - if (loopNode.kind === 187 /* DoStatement */) { - var loopTokens = loopNode.getChildren(); - for (var i = loopTokens.length - 1; i >= 0; i--) { - if (pushKeywordIf(keywords, loopTokens[i], 100 /* WhileKeyword */)) { - break; - } - } - } - } - var breaksAndContinues = aggregateAllBreakAndContinueStatements(loopNode.statement); - ts.forEach(breaksAndContinues, function (statement) { - if (ownsBreakOrContinueStatement(loopNode, statement)) { - pushKeywordIf(keywords, statement.getFirstToken(), 66 /* BreakKeyword */, 71 /* ContinueKeyword */); - } - }); - return ts.map(keywords, getHighlightSpanForNode); - } - function getBreakOrContinueStatementOccurences(breakOrContinueStatement) { - var owner = getBreakOrContinueOwner(breakOrContinueStatement); - if (owner) { - switch (owner.kind) { - case 189 /* ForStatement */: - case 190 /* ForInStatement */: - case 191 /* ForOfStatement */: - case 187 /* DoStatement */: - case 188 /* WhileStatement */: - return getLoopBreakContinueOccurrences(owner); - case 196 /* SwitchStatement */: - return getSwitchCaseDefaultOccurrences(owner); - } - } - return undefined; - } - function getSwitchCaseDefaultOccurrences(switchStatement) { - var keywords = []; - pushKeywordIf(keywords, switchStatement.getFirstToken(), 92 /* SwitchKeyword */); - // Go through each clause in the switch statement, collecting the 'case'/'default' keywords. - ts.forEach(switchStatement.caseBlock.clauses, function (clause) { - pushKeywordIf(keywords, clause.getFirstToken(), 67 /* CaseKeyword */, 73 /* DefaultKeyword */); - var breaksAndContinues = aggregateAllBreakAndContinueStatements(clause); - ts.forEach(breaksAndContinues, function (statement) { - if (ownsBreakOrContinueStatement(switchStatement, statement)) { - pushKeywordIf(keywords, statement.getFirstToken(), 66 /* BreakKeyword */); - } - }); - }); - return ts.map(keywords, getHighlightSpanForNode); - } - function getTryCatchFinallyOccurrences(tryStatement) { - var keywords = []; - pushKeywordIf(keywords, tryStatement.getFirstToken(), 96 /* TryKeyword */); - if (tryStatement.catchClause) { - pushKeywordIf(keywords, tryStatement.catchClause.getFirstToken(), 68 /* CatchKeyword */); - } - if (tryStatement.finallyBlock) { - var finallyKeyword = ts.findChildOfKind(tryStatement, 81 /* FinallyKeyword */, sourceFile); - pushKeywordIf(keywords, finallyKeyword, 81 /* FinallyKeyword */); - } - return ts.map(keywords, getHighlightSpanForNode); - } - function getThrowOccurrences(throwStatement) { - var owner = getThrowStatementOwner(throwStatement); - if (!owner) { - return undefined; - } - var keywords = []; - ts.forEach(aggregateOwnedThrowStatements(owner), function (throwStatement) { - pushKeywordIf(keywords, throwStatement.getFirstToken(), 94 /* ThrowKeyword */); - }); - // If the "owner" is a function, then we equate 'return' and 'throw' statements in their - // ability to "jump out" of the function, and include occurrences for both. - if (ts.isFunctionBlock(owner)) { - ts.forEachReturnStatement(owner, function (returnStatement) { - pushKeywordIf(keywords, returnStatement.getFirstToken(), 90 /* ReturnKeyword */); - }); - } - return ts.map(keywords, getHighlightSpanForNode); - } - function getReturnOccurrences(returnStatement) { - var func = ts.getContainingFunction(returnStatement); - // If we didn't find a containing function with a block body, bail out. - if (!(func && hasKind(func.body, 182 /* Block */))) { - return undefined; - } - var keywords = []; - ts.forEachReturnStatement(func.body, function (returnStatement) { - pushKeywordIf(keywords, returnStatement.getFirstToken(), 90 /* ReturnKeyword */); - }); - // Include 'throw' statements that do not occur within a try block. - ts.forEach(aggregateOwnedThrowStatements(func.body), function (throwStatement) { - pushKeywordIf(keywords, throwStatement.getFirstToken(), 94 /* ThrowKeyword */); - }); - return ts.map(keywords, getHighlightSpanForNode); - } - function getIfElseOccurrences(ifStatement) { - var keywords = []; - // Traverse upwards through all parent if-statements linked by their else-branches. - while (hasKind(ifStatement.parent, 186 /* IfStatement */) && ifStatement.parent.elseStatement === ifStatement) { - ifStatement = ifStatement.parent; - } - // Now traverse back down through the else branches, aggregating if/else keywords of if-statements. - while (ifStatement) { - var children = ifStatement.getChildren(); - pushKeywordIf(keywords, children[0], 84 /* IfKeyword */); - // Generally the 'else' keyword is second-to-last, so we traverse backwards. - for (var i = children.length - 1; i >= 0; i--) { - if (pushKeywordIf(keywords, children[i], 76 /* ElseKeyword */)) { - break; - } - } - if (!hasKind(ifStatement.elseStatement, 186 /* IfStatement */)) { - break; - } - ifStatement = ifStatement.elseStatement; - } - var result = []; - // We'd like to highlight else/ifs together if they are only separated by whitespace - // (i.e. the keywords are separated by no comments, no newlines). - for (var i = 0; i < keywords.length; i++) { - if (keywords[i].kind === 76 /* ElseKeyword */ && i < keywords.length - 1) { - var elseKeyword = keywords[i]; - var ifKeyword = keywords[i + 1]; // this *should* always be an 'if' keyword. - var shouldCombindElseAndIf = true; - // Avoid recalculating getStart() by iterating backwards. - for (var j = ifKeyword.getStart() - 1; j >= elseKeyword.end; j--) { - if (!ts.isWhiteSpace(sourceFile.text.charCodeAt(j))) { - shouldCombindElseAndIf = false; - break; - } - } - if (shouldCombindElseAndIf) { - result.push({ - fileName: fileName, - textSpan: ts.createTextSpanFromBounds(elseKeyword.getStart(), ifKeyword.end), - kind: HighlightSpanKind.reference - }); - i++; // skip the next keyword - continue; - } - } - // Ordinary case: just highlight the keyword. - result.push(getHighlightSpanForNode(keywords[i])); - } - return result; - } - } - } - /// References and Occurrences - function getOccurrencesAtPositionCore(fileName, position) { - synchronizeHostData(); - return convertDocumentHighlights(getDocumentHighlights(fileName, position, [fileName])); - function convertDocumentHighlights(documentHighlights) { - if (!documentHighlights) { - return undefined; - } - var result = []; - for (var _i = 0; _i < documentHighlights.length; _i++) { - var entry = documentHighlights[_i]; - for (var _a = 0, _b = entry.highlightSpans; _a < _b.length; _a++) { - var highlightSpan = _b[_a]; - result.push({ - fileName: entry.fileName, - textSpan: highlightSpan.textSpan, - isWriteAccess: highlightSpan.kind === HighlightSpanKind.writtenReference - }); - } - } - return result; - } - } - function convertReferences(referenceSymbols) { - if (!referenceSymbols) { - return undefined; - } - var referenceEntries = []; - for (var _i = 0; _i < referenceSymbols.length; _i++) { - var referenceSymbol = referenceSymbols[_i]; - ts.addRange(referenceEntries, referenceSymbol.references); - } - return referenceEntries; - } - function findRenameLocations(fileName, position, findInStrings, findInComments) { - var referencedSymbols = findReferencedSymbols(fileName, position, findInStrings, findInComments); - return convertReferences(referencedSymbols); - } - function getReferencesAtPosition(fileName, position) { - var referencedSymbols = findReferencedSymbols(fileName, position, false, false); - return convertReferences(referencedSymbols); - } - function findReferences(fileName, position) { - var referencedSymbols = findReferencedSymbols(fileName, position, false, false); - // Only include referenced symbols that have a valid definition. - return ts.filter(referencedSymbols, function (rs) { return !!rs.definition; }); - } - function findReferencedSymbols(fileName, position, findInStrings, findInComments) { - synchronizeHostData(); - var sourceFile = getValidSourceFile(fileName); - var node = ts.getTouchingPropertyName(sourceFile, position); - if (!node) { - return undefined; - } - if (node.kind !== 65 /* Identifier */ && - // TODO (drosen): This should be enabled in a later release - currently breaks rename. - //node.kind !== SyntaxKind.ThisKeyword && - //node.kind !== SyntaxKind.SuperKeyword && - !isLiteralNameOfPropertyDeclarationOrIndexAccess(node) && - !isNameOfExternalModuleImportOrDeclaration(node)) { - return undefined; - } - ts.Debug.assert(node.kind === 65 /* Identifier */ || node.kind === 7 /* NumericLiteral */ || node.kind === 8 /* StringLiteral */); - return getReferencedSymbolsForNodes(node, program.getSourceFiles(), findInStrings, findInComments); - } - function getReferencedSymbolsForNodes(node, sourceFiles, findInStrings, findInComments) { - var typeChecker = program.getTypeChecker(); - // Labels - if (isLabelName(node)) { - if (isJumpStatementTarget(node)) { - var labelDefinition = getTargetLabel(node.parent, node.text); - // if we have a label definition, look within its statement for references, if not, then - // the label is undefined and we have no results.. - return labelDefinition ? getLabelReferencesInNode(labelDefinition.parent, labelDefinition) : undefined; - } - else { - // it is a label definition and not a target, search within the parent labeledStatement - return getLabelReferencesInNode(node.parent, node); - } - } - if (node.kind === 93 /* ThisKeyword */) { - return getReferencesForThisKeyword(node, sourceFiles); - } - if (node.kind === 91 /* SuperKeyword */) { - return getReferencesForSuperKeyword(node); - } - var symbol = typeChecker.getSymbolAtLocation(node); - // Could not find a symbol e.g. unknown identifier - if (!symbol) { - // Can't have references to something that we have no symbol for. - return undefined; - } - var declarations = symbol.declarations; - // The symbol was an internal symbol and does not have a declaration e.g.undefined symbol - if (!declarations || !declarations.length) { - return undefined; - } - var result; - // Compute the meaning from the location and the symbol it references - var searchMeaning = getIntersectingMeaningFromDeclarations(getMeaningFromLocation(node), declarations); - // Get the text to search for, we need to normalize it as external module names will have quote - var declaredName = getDeclaredName(symbol, node); - // Try to get the smallest valid scope that we can limit our search to; - // otherwise we'll need to search globally (i.e. include each file). - var scope = getSymbolScope(symbol); - // Maps from a symbol ID to the ReferencedSymbol entry in 'result'. - var symbolToIndex = []; - if (scope) { - result = []; - getReferencesInNode(scope, symbol, declaredName, node, searchMeaning, findInStrings, findInComments, result, symbolToIndex); - } - else { - var internedName = getInternedName(symbol, node, declarations); - for (var _i = 0; _i < sourceFiles.length; _i++) { - var sourceFile = sourceFiles[_i]; - cancellationToken.throwIfCancellationRequested(); - var nameTable = getNameTable(sourceFile); - if (ts.lookUp(nameTable, internedName)) { - result = result || []; - getReferencesInNode(sourceFile, symbol, declaredName, node, searchMeaning, findInStrings, findInComments, result, symbolToIndex); - } - } - } - return result; - function getDefinition(symbol) { - var info = getSymbolDisplayPartsDocumentationAndSymbolKind(symbol, node.getSourceFile(), getContainerNode(node), node); - var name = ts.map(info.displayParts, function (p) { return p.text; }).join(""); - var declarations = symbol.declarations; - if (!declarations || declarations.length === 0) { - return undefined; - } - return { - containerKind: "", - containerName: "", - name: name, - kind: info.symbolKind, - fileName: declarations[0].getSourceFile().fileName, - textSpan: ts.createTextSpan(declarations[0].getStart(), 0) - }; - } - function isImportOrExportSpecifierName(location) { - return location.parent && - (location.parent.kind === 216 /* ImportSpecifier */ || location.parent.kind === 220 /* ExportSpecifier */) && - location.parent.propertyName === location; - } - function isImportOrExportSpecifierImportSymbol(symbol) { - return (symbol.flags & 8388608 /* Alias */) && ts.forEach(symbol.declarations, function (declaration) { - return declaration.kind === 216 /* ImportSpecifier */ || declaration.kind === 220 /* ExportSpecifier */; - }); - } - function getDeclaredName(symbol, location) { - // Special case for function expressions, whose names are solely local to their bodies. - var functionExpression = ts.forEach(symbol.declarations, function (d) { return d.kind === 165 /* FunctionExpression */ ? d : undefined; }); - // When a name gets interned into a SourceFile's 'identifiers' Map, - // its name is escaped and stored in the same way its symbol name/identifier - // name should be stored. Function expressions, however, are a special case, - // because despite sometimes having a name, the binder unconditionally binds them - // to a symbol with the name "__function". - var name; - if (functionExpression && functionExpression.name) { - name = functionExpression.name.text; - } - // If this is an export or import specifier it could have been renamed using the as syntax. - // if so we want to search for whatever under the cursor, the symbol is pointing to the alias (name) - // so check for the propertyName. - if (isImportOrExportSpecifierName(location)) { - return location.getText(); - } - name = typeChecker.symbolToString(symbol); - return stripQuotes(name); - } - function getInternedName(symbol, location, declarations) { - // If this is an export or import specifier it could have been renamed using the as syntax. - // if so we want to search for whatever under the cursor, the symbol is pointing to the alias (name) - // so check for the propertyName. - if (isImportOrExportSpecifierName(location)) { - return location.getText(); - } - // Special case for function expressions, whose names are solely local to their bodies. - var functionExpression = ts.forEach(declarations, function (d) { return d.kind === 165 /* FunctionExpression */ ? d : undefined; }); - // When a name gets interned into a SourceFile's 'identifiers' Map, - // its name is escaped and stored in the same way its symbol name/identifier - // name should be stored. Function expressions, however, are a special case, - // because despite sometimes having a name, the binder unconditionally binds them - // to a symbol with the name "__function". - var name = functionExpression && functionExpression.name - ? functionExpression.name.text - : symbol.name; - return stripQuotes(name); - } - function stripQuotes(name) { - var length = name.length; - if (length >= 2 && name.charCodeAt(0) === 34 /* doubleQuote */ && name.charCodeAt(length - 1) === 34 /* doubleQuote */) { - return name.substring(1, length - 1); - } - ; - return name; - } - function getSymbolScope(symbol) { - // If this is private property or method, the scope is the containing class - if (symbol.flags & (4 /* Property */ | 8192 /* Method */)) { - var privateDeclaration = ts.forEach(symbol.getDeclarations(), function (d) { return (d.flags & 32 /* Private */) ? d : undefined; }); - if (privateDeclaration) { - return ts.getAncestor(privateDeclaration, 204 /* ClassDeclaration */); - } - } - // If the symbol is an import we would like to find it if we are looking for what it imports. - // So consider it visibile outside its declaration scope. - if (symbol.flags & 8388608 /* Alias */) { - return undefined; - } - // if this symbol is visible from its parent container, e.g. exported, then bail out - // if symbol correspond to the union property - bail out - if (symbol.parent || (symbol.flags & 268435456 /* UnionProperty */)) { - return undefined; - } - var scope = undefined; - var declarations = symbol.getDeclarations(); - if (declarations) { - for (var _i = 0; _i < declarations.length; _i++) { - var declaration = declarations[_i]; - var container = getContainerNode(declaration); - if (!container) { - return undefined; - } - if (scope && scope !== container) { - // Different declarations have different containers, bail out - return undefined; - } - if (container.kind === 230 /* SourceFile */ && !ts.isExternalModule(container)) { - // This is a global variable and not an external module, any declaration defined - // within this scope is visible outside the file - return undefined; - } - // The search scope is the container node - scope = container; - } - } - return scope; - } - function getPossibleSymbolReferencePositions(sourceFile, symbolName, start, end) { - var positions = []; - /// TODO: Cache symbol existence for files to save text search - // Also, need to make this work for unicode escapes. - // Be resilient in the face of a symbol with no name or zero length name - if (!symbolName || !symbolName.length) { - return positions; - } - var text = sourceFile.text; - var sourceLength = text.length; - var symbolNameLength = symbolName.length; - var position = text.indexOf(symbolName, start); - while (position >= 0) { - cancellationToken.throwIfCancellationRequested(); - // If we are past the end, stop looking - if (position > end) - break; - // We found a match. Make sure it's not part of a larger word (i.e. the char - // before and after it have to be a non-identifier char). - var endPosition = position + symbolNameLength; - if ((position === 0 || !ts.isIdentifierPart(text.charCodeAt(position - 1), 2 /* Latest */)) && - (endPosition === sourceLength || !ts.isIdentifierPart(text.charCodeAt(endPosition), 2 /* Latest */))) { - // Found a real match. Keep searching. - positions.push(position); - } - position = text.indexOf(symbolName, position + symbolNameLength + 1); - } - return positions; - } - function getLabelReferencesInNode(container, targetLabel) { - var references = []; - var sourceFile = container.getSourceFile(); - var labelName = targetLabel.text; - var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, labelName, container.getStart(), container.getEnd()); - ts.forEach(possiblePositions, function (position) { - cancellationToken.throwIfCancellationRequested(); - var node = ts.getTouchingWord(sourceFile, position); - if (!node || node.getWidth() !== labelName.length) { - return; - } - // Only pick labels that are either the target label, or have a target that is the target label - if (node === targetLabel || - (isJumpStatementTarget(node) && getTargetLabel(node, labelName) === targetLabel)) { - references.push(getReferenceEntryFromNode(node)); - } - }); - var definition = { - containerKind: "", - containerName: "", - fileName: targetLabel.getSourceFile().fileName, - kind: ScriptElementKind.label, - name: labelName, - textSpan: ts.createTextSpanFromBounds(targetLabel.getStart(), targetLabel.getEnd()) - }; - return [{ definition: definition, references: references }]; - } - function isValidReferencePosition(node, searchSymbolName) { - if (node) { - // Compare the length so we filter out strict superstrings of the symbol we are looking for - switch (node.kind) { - case 65 /* Identifier */: - return node.getWidth() === searchSymbolName.length; - case 8 /* StringLiteral */: - if (isLiteralNameOfPropertyDeclarationOrIndexAccess(node) || - isNameOfExternalModuleImportOrDeclaration(node)) { - // For string literals we have two additional chars for the quotes - return node.getWidth() === searchSymbolName.length + 2; - } - break; - case 7 /* NumericLiteral */: - if (isLiteralNameOfPropertyDeclarationOrIndexAccess(node)) { - return node.getWidth() === searchSymbolName.length; - } - break; - } - } - return false; - } - /** Search within node "container" for references for a search value, where the search value is defined as a - * tuple of(searchSymbol, searchText, searchLocation, and searchMeaning). - * searchLocation: a node where the search value - */ - function getReferencesInNode(container, searchSymbol, searchText, searchLocation, searchMeaning, findInStrings, findInComments, result, symbolToIndex) { - var sourceFile = container.getSourceFile(); - var tripleSlashDirectivePrefixRegex = /^\/\/\/\s*= 0) { - var referencedSymbol = getReferencedSymbol(shorthandValueSymbol); - referencedSymbol.references.push(getReferenceEntryFromNode(referenceSymbolDeclaration.name)); - } - } - }); - } - return; - function getReferencedSymbol(symbol) { - var symbolId = ts.getSymbolId(symbol); - var index = symbolToIndex[symbolId]; - if (index === undefined) { - index = result.length; - symbolToIndex[symbolId] = index; - result.push({ - definition: getDefinition(symbol), - references: [] - }); - } - return result[index]; - } - function isInString(position) { - var token = ts.getTokenAtPosition(sourceFile, position); - return token && token.kind === 8 /* StringLiteral */ && position > token.getStart(); - } - function isInComment(position) { - var token = ts.getTokenAtPosition(sourceFile, position); - if (token && position < token.getStart()) { - // First, we have to see if this position actually landed in a comment. - var commentRanges = ts.getLeadingCommentRanges(sourceFile.text, token.pos); - // Then we want to make sure that it wasn't in a "///<" directive comment - // We don't want to unintentionally update a file name. - return ts.forEach(commentRanges, function (c) { - if (c.pos < position && position < c.end) { - var commentText = sourceFile.text.substring(c.pos, c.end); - if (!tripleSlashDirectivePrefixRegex.test(commentText)) { - return true; - } - } - }); - } - return false; - } - } - function getReferencesForSuperKeyword(superKeyword) { - var searchSpaceNode = ts.getSuperContainer(superKeyword, false); - if (!searchSpaceNode) { - return undefined; - } - // Whether 'super' occurs in a static context within a class. - var staticFlag = 128 /* Static */; - switch (searchSpaceNode.kind) { - case 134 /* PropertyDeclaration */: - case 133 /* PropertySignature */: - case 136 /* MethodDeclaration */: - case 135 /* MethodSignature */: - case 137 /* Constructor */: - case 138 /* GetAccessor */: - case 139 /* SetAccessor */: - staticFlag &= searchSpaceNode.flags; - searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class - break; - default: - return undefined; - } - var references = []; - var sourceFile = searchSpaceNode.getSourceFile(); - var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "super", searchSpaceNode.getStart(), searchSpaceNode.getEnd()); - ts.forEach(possiblePositions, function (position) { - cancellationToken.throwIfCancellationRequested(); - var node = ts.getTouchingWord(sourceFile, position); - if (!node || node.kind !== 91 /* SuperKeyword */) { - return; - } - var container = ts.getSuperContainer(node, false); - // If we have a 'super' container, we must have an enclosing class. - // Now make sure the owning class is the same as the search-space - // and has the same static qualifier as the original 'super's owner. - if (container && (128 /* Static */ & container.flags) === staticFlag && container.parent.symbol === searchSpaceNode.symbol) { - references.push(getReferenceEntryFromNode(node)); - } - }); - var definition = getDefinition(searchSpaceNode.symbol); - return [{ definition: definition, references: references }]; - } - function getReferencesForThisKeyword(thisOrSuperKeyword, sourceFiles) { - var searchSpaceNode = ts.getThisContainer(thisOrSuperKeyword, false); - // Whether 'this' occurs in a static context within a class. - var staticFlag = 128 /* Static */; - switch (searchSpaceNode.kind) { - case 136 /* MethodDeclaration */: - case 135 /* MethodSignature */: - if (ts.isObjectLiteralMethod(searchSpaceNode)) { - break; - } - // fall through - case 134 /* PropertyDeclaration */: - case 133 /* PropertySignature */: - case 137 /* Constructor */: - case 138 /* GetAccessor */: - case 139 /* SetAccessor */: - staticFlag &= searchSpaceNode.flags; - searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class - break; - case 230 /* SourceFile */: - if (ts.isExternalModule(searchSpaceNode)) { - return undefined; - } - // Fall through - case 203 /* FunctionDeclaration */: - case 165 /* FunctionExpression */: - break; - // Computed properties in classes are not handled here because references to this are illegal, - // so there is no point finding references to them. - default: - return undefined; - } - var references = []; - var possiblePositions; - if (searchSpaceNode.kind === 230 /* SourceFile */) { - ts.forEach(sourceFiles, function (sourceFile) { - possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", sourceFile.getStart(), sourceFile.getEnd()); - getThisReferencesInFile(sourceFile, sourceFile, possiblePositions, references); - }); - } - else { - var sourceFile = searchSpaceNode.getSourceFile(); - possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", searchSpaceNode.getStart(), searchSpaceNode.getEnd()); - getThisReferencesInFile(sourceFile, searchSpaceNode, possiblePositions, references); - } - return [{ - definition: { - containerKind: "", - containerName: "", - fileName: node.getSourceFile().fileName, - kind: ScriptElementKind.variableElement, - name: "this", - textSpan: ts.createTextSpanFromBounds(node.getStart(), node.getEnd()) - }, - references: references - }]; - function getThisReferencesInFile(sourceFile, searchSpaceNode, possiblePositions, result) { - ts.forEach(possiblePositions, function (position) { - cancellationToken.throwIfCancellationRequested(); - var node = ts.getTouchingWord(sourceFile, position); - if (!node || node.kind !== 93 /* ThisKeyword */) { - return; - } - var container = ts.getThisContainer(node, false); - switch (searchSpaceNode.kind) { - case 165 /* FunctionExpression */: - case 203 /* FunctionDeclaration */: - if (searchSpaceNode.symbol === container.symbol) { - result.push(getReferenceEntryFromNode(node)); - } - break; - case 136 /* MethodDeclaration */: - case 135 /* MethodSignature */: - if (ts.isObjectLiteralMethod(searchSpaceNode) && searchSpaceNode.symbol === container.symbol) { - result.push(getReferenceEntryFromNode(node)); - } - break; - case 204 /* ClassDeclaration */: - // Make sure the container belongs to the same class - // and has the appropriate static modifier from the original container. - if (container.parent && searchSpaceNode.symbol === container.parent.symbol && (container.flags & 128 /* Static */) === staticFlag) { - result.push(getReferenceEntryFromNode(node)); - } - break; - case 230 /* SourceFile */: - if (container.kind === 230 /* SourceFile */ && !ts.isExternalModule(container)) { - result.push(getReferenceEntryFromNode(node)); - } - break; - } - }); - } - } - function populateSearchSymbolSet(symbol, location) { - // The search set contains at least the current symbol - var result = [symbol]; - // If the symbol is an alias, add what it alaises to the list - if (isImportOrExportSpecifierImportSymbol(symbol)) { - result.push(typeChecker.getAliasedSymbol(symbol)); - } - // If the location is in a context sensitive location (i.e. in an object literal) try - // to get a contextual type for it, and add the property symbol from the contextual - // type to the search set - if (isNameOfPropertyAssignment(location)) { - ts.forEach(getPropertySymbolsFromContextualType(location), function (contextualSymbol) { - result.push.apply(result, typeChecker.getRootSymbols(contextualSymbol)); - }); - /* Because in short-hand property assignment, location has two meaning : property name and as value of the property - * When we do findAllReference at the position of the short-hand property assignment, we would want to have references to position of - * property name and variable declaration of the identifier. - * Like in below example, when querying for all references for an identifier 'name', of the property assignment, the language service - * should show both 'name' in 'obj' and 'name' in variable declaration - * let name = "Foo"; - * let obj = { name }; - * In order to do that, we will populate the search set with the value symbol of the identifier as a value of the property assignment - * so that when matching with potential reference symbol, both symbols from property declaration and variable declaration - * will be included correctly. - */ - var shorthandValueSymbol = typeChecker.getShorthandAssignmentValueSymbol(location.parent); - if (shorthandValueSymbol) { - result.push(shorthandValueSymbol); - } - } - // If this is a union property, add all the symbols from all its source symbols in all unioned types. - // If the symbol is an instantiation from a another symbol (e.g. widened symbol) , add the root the list - ts.forEach(typeChecker.getRootSymbols(symbol), function (rootSymbol) { - if (rootSymbol !== symbol) { - result.push(rootSymbol); - } - // Add symbol of properties/methods of the same name in base classes and implemented interfaces definitions - if (rootSymbol.parent && rootSymbol.parent.flags & (32 /* Class */ | 64 /* Interface */)) { - getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result); - } - }); - return result; - } - function getPropertySymbolsFromBaseTypes(symbol, propertyName, result) { - if (symbol && symbol.flags & (32 /* Class */ | 64 /* Interface */)) { - ts.forEach(symbol.getDeclarations(), function (declaration) { - if (declaration.kind === 204 /* ClassDeclaration */) { - getPropertySymbolFromTypeReference(ts.getClassExtendsHeritageClauseElement(declaration)); - ts.forEach(ts.getClassImplementsHeritageClauseElements(declaration), getPropertySymbolFromTypeReference); - } - else if (declaration.kind === 205 /* InterfaceDeclaration */) { - ts.forEach(ts.getInterfaceBaseTypeNodes(declaration), getPropertySymbolFromTypeReference); - } - }); - } - return; - function getPropertySymbolFromTypeReference(typeReference) { - if (typeReference) { - var type = typeChecker.getTypeAtLocation(typeReference); - if (type) { - var propertySymbol = typeChecker.getPropertyOfType(type, propertyName); - if (propertySymbol) { - result.push(propertySymbol); - } - // Visit the typeReference as well to see if it directly or indirectly use that property - getPropertySymbolsFromBaseTypes(type.symbol, propertyName, result); - } - } - } - } - function getRelatedSymbol(searchSymbols, referenceSymbol, referenceLocation) { - if (searchSymbols.indexOf(referenceSymbol) >= 0) { - return referenceSymbol; - } - // If the reference symbol is an alias, check if what it is aliasing is one of the search - // symbols. - if (isImportOrExportSpecifierImportSymbol(referenceSymbol)) { - var aliasedSymbol = typeChecker.getAliasedSymbol(referenceSymbol); - if (searchSymbols.indexOf(aliasedSymbol) >= 0) { - return aliasedSymbol; - } - } - // If the reference location is in an object literal, try to get the contextual type for the - // object literal, lookup the property symbol in the contextual type, and use this symbol to - // compare to our searchSymbol - if (isNameOfPropertyAssignment(referenceLocation)) { - return ts.forEach(getPropertySymbolsFromContextualType(referenceLocation), function (contextualSymbol) { - return ts.forEach(typeChecker.getRootSymbols(contextualSymbol), function (s) { return searchSymbols.indexOf(s) >= 0 ? s : undefined; }); - }); - } - // Unwrap symbols to get to the root (e.g. transient symbols as a result of widening) - // Or a union property, use its underlying unioned symbols - return ts.forEach(typeChecker.getRootSymbols(referenceSymbol), function (rootSymbol) { - // if it is in the list, then we are done - if (searchSymbols.indexOf(rootSymbol) >= 0) { - return rootSymbol; - } - // Finally, try all properties with the same name in any type the containing type extended or implemented, and - // see if any is in the list - if (rootSymbol.parent && rootSymbol.parent.flags & (32 /* Class */ | 64 /* Interface */)) { - var result_3 = []; - getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.getName(), result_3); - return ts.forEach(result_3, function (s) { return searchSymbols.indexOf(s) >= 0 ? s : undefined; }); - } - return undefined; - }); - } - function getPropertySymbolsFromContextualType(node) { - if (isNameOfPropertyAssignment(node)) { - var objectLiteral = node.parent.parent; - var contextualType = typeChecker.getContextualType(objectLiteral); - var name_31 = node.text; - if (contextualType) { - if (contextualType.flags & 16384 /* Union */) { - // This is a union type, first see if the property we are looking for is a union property (i.e. exists in all types) - // if not, search the constituent types for the property - var unionProperty = contextualType.getProperty(name_31); - if (unionProperty) { - return [unionProperty]; - } - else { - var result_4 = []; - ts.forEach(contextualType.types, function (t) { - var symbol = t.getProperty(name_31); - if (symbol) { - result_4.push(symbol); - } - }); - return result_4; - } - } - else { - var symbol_1 = contextualType.getProperty(name_31); - if (symbol_1) { - return [symbol_1]; - } - } - } - } - return undefined; - } - /** Given an initial searchMeaning, extracted from a location, widen the search scope based on the declarations - * of the corresponding symbol. e.g. if we are searching for "Foo" in value position, but "Foo" references a class - * then we need to widen the search to include type positions as well. - * On the contrary, if we are searching for "Bar" in type position and we trace bar to an interface, and an uninstantiated - * module, we want to keep the search limited to only types, as the two declarations (interface and uninstantiated module) - * do not intersect in any of the three spaces. - */ - function getIntersectingMeaningFromDeclarations(meaning, declarations) { - if (declarations) { - var lastIterationMeaning; - do { - // The result is order-sensitive, for instance if initialMeaning === Namespace, and declarations = [class, instantiated module] - // we need to consider both as they initialMeaning intersects with the module in the namespace space, and the module - // intersects with the class in the value space. - // To achieve that we will keep iterating until the result stabilizes. - // Remember the last meaning - lastIterationMeaning = meaning; - for (var _i = 0; _i < declarations.length; _i++) { - var declaration = declarations[_i]; - var declarationMeaning = getMeaningFromDeclaration(declaration); - if (declarationMeaning & meaning) { - meaning |= declarationMeaning; - } - } - } while (meaning !== lastIterationMeaning); - } - return meaning; - } - } - function getReferenceEntryFromNode(node) { - var start = node.getStart(); - var end = node.getEnd(); - if (node.kind === 8 /* StringLiteral */) { - start += 1; - end -= 1; - } - return { - fileName: node.getSourceFile().fileName, - textSpan: ts.createTextSpanFromBounds(start, end), - isWriteAccess: isWriteAccess(node) - }; - } - /** A node is considered a writeAccess iff it is a name of a declaration or a target of an assignment */ - function isWriteAccess(node) { - if (node.kind === 65 /* Identifier */ && ts.isDeclarationName(node)) { - return true; - } - var parent = node.parent; - if (parent) { - if (parent.kind === 171 /* PostfixUnaryExpression */ || parent.kind === 170 /* PrefixUnaryExpression */) { - return true; - } - else if (parent.kind === 172 /* BinaryExpression */ && parent.left === node) { - var operator = parent.operatorToken.kind; - return 53 /* FirstAssignment */ <= operator && operator <= 64 /* LastAssignment */; - } - } - return false; - } - /// NavigateTo - function getNavigateToItems(searchValue, maxResultCount) { - synchronizeHostData(); - return ts.NavigateTo.getNavigateToItems(program, cancellationToken, searchValue, maxResultCount); - } - function containErrors(diagnostics) { - return ts.forEach(diagnostics, function (diagnostic) { return diagnostic.category === ts.DiagnosticCategory.Error; }); - } - function getEmitOutput(fileName) { - synchronizeHostData(); - var sourceFile = getValidSourceFile(fileName); - var outputFiles = []; - function writeFile(fileName, data, writeByteOrderMark) { - outputFiles.push({ - name: fileName, - writeByteOrderMark: writeByteOrderMark, - text: data - }); - } - var emitOutput = program.emit(sourceFile, writeFile); - return { - outputFiles: outputFiles, - emitSkipped: emitOutput.emitSkipped - }; - } - function getMeaningFromDeclaration(node) { - switch (node.kind) { - case 131 /* Parameter */: - case 201 /* VariableDeclaration */: - case 155 /* BindingElement */: - case 134 /* PropertyDeclaration */: - case 133 /* PropertySignature */: - case 227 /* PropertyAssignment */: - case 228 /* ShorthandPropertyAssignment */: - case 229 /* EnumMember */: - case 136 /* MethodDeclaration */: - case 135 /* MethodSignature */: - case 137 /* Constructor */: - case 138 /* GetAccessor */: - case 139 /* SetAccessor */: - case 203 /* FunctionDeclaration */: - case 165 /* FunctionExpression */: - case 166 /* ArrowFunction */: - case 226 /* CatchClause */: - return 1 /* Value */; - case 130 /* TypeParameter */: - case 205 /* InterfaceDeclaration */: - case 206 /* TypeAliasDeclaration */: - case 148 /* TypeLiteral */: - return 2 /* Type */; - case 204 /* ClassDeclaration */: - case 207 /* EnumDeclaration */: - return 1 /* Value */ | 2 /* Type */; - case 208 /* ModuleDeclaration */: - if (node.name.kind === 8 /* StringLiteral */) { - return 4 /* Namespace */ | 1 /* Value */; - } - else if (ts.getModuleInstanceState(node) === 1 /* Instantiated */) { - return 4 /* Namespace */ | 1 /* Value */; - } - else { - return 4 /* Namespace */; - } - case 215 /* NamedImports */: - case 216 /* ImportSpecifier */: - case 211 /* ImportEqualsDeclaration */: - case 212 /* ImportDeclaration */: - case 217 /* ExportAssignment */: - case 218 /* ExportDeclaration */: - return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; - // An external module can be a Value - case 230 /* SourceFile */: - return 4 /* Namespace */ | 1 /* Value */; - } - return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; - ts.Debug.fail("Unknown declaration type"); - } - function isTypeReference(node) { - if (ts.isRightSideOfQualifiedNameOrPropertyAccess(node)) { - node = node.parent; - } - return node.parent.kind === 144 /* TypeReference */ || node.parent.kind === 179 /* ExpressionWithTypeArguments */; - } - function isNamespaceReference(node) { - return isQualifiedNameNamespaceReference(node) || isPropertyAccessNamespaceReference(node); - } - function isPropertyAccessNamespaceReference(node) { - var root = node; - var isLastClause = true; - if (root.parent.kind === 158 /* PropertyAccessExpression */) { - while (root.parent && root.parent.kind === 158 /* PropertyAccessExpression */) { - root = root.parent; - } - isLastClause = root.name === node; - } - if (!isLastClause && root.parent.kind === 179 /* ExpressionWithTypeArguments */ && root.parent.parent.kind === 225 /* HeritageClause */) { - var decl = root.parent.parent.parent; - return (decl.kind === 204 /* ClassDeclaration */ && root.parent.parent.token === 102 /* ImplementsKeyword */) || - (decl.kind === 205 /* InterfaceDeclaration */ && root.parent.parent.token === 79 /* ExtendsKeyword */); - } - return false; - } - function isQualifiedNameNamespaceReference(node) { - var root = node; - var isLastClause = true; - if (root.parent.kind === 128 /* QualifiedName */) { - while (root.parent && root.parent.kind === 128 /* QualifiedName */) { - root = root.parent; - } - isLastClause = root.right === node; - } - return root.parent.kind === 144 /* TypeReference */ && !isLastClause; - } - function isInRightSideOfImport(node) { - while (node.parent.kind === 128 /* QualifiedName */) { - node = node.parent; - } - return ts.isInternalModuleImportEqualsDeclaration(node.parent) && node.parent.moduleReference === node; - } - function getMeaningFromRightHandSideOfImportEquals(node) { - ts.Debug.assert(node.kind === 65 /* Identifier */); - // import a = |b|; // Namespace - // import a = |b.c|; // Value, type, namespace - // import a = |b.c|.d; // Namespace - if (node.parent.kind === 128 /* QualifiedName */ && - node.parent.right === node && - node.parent.parent.kind === 211 /* ImportEqualsDeclaration */) { - return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; - } - return 4 /* Namespace */; - } - function getMeaningFromLocation(node) { - if (node.parent.kind === 217 /* ExportAssignment */) { - return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; - } - else if (isInRightSideOfImport(node)) { - return getMeaningFromRightHandSideOfImportEquals(node); - } - else if (ts.isDeclarationName(node)) { - return getMeaningFromDeclaration(node.parent); - } - else if (isTypeReference(node)) { - return 2 /* Type */; - } - else if (isNamespaceReference(node)) { - return 4 /* Namespace */; - } - else { - return 1 /* Value */; - } - } - // Signature help - /** - * This is a semantic operation. - */ - function getSignatureHelpItems(fileName, position) { - synchronizeHostData(); - var sourceFile = getValidSourceFile(fileName); - return ts.SignatureHelp.getSignatureHelpItems(program, sourceFile, position, cancellationToken); - } - /// Syntactic features - function getSourceFile(fileName) { - return syntaxTreeCache.getCurrentSourceFile(fileName); - } - function getNameOrDottedNameSpan(fileName, startPos, endPos) { - var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); - // Get node at the location - var node = ts.getTouchingPropertyName(sourceFile, startPos); - if (!node) { - return; - } - switch (node.kind) { - case 158 /* PropertyAccessExpression */: - case 128 /* QualifiedName */: - case 8 /* StringLiteral */: - case 80 /* FalseKeyword */: - case 95 /* TrueKeyword */: - case 89 /* NullKeyword */: - case 91 /* SuperKeyword */: - case 93 /* ThisKeyword */: - case 65 /* Identifier */: - break; - // Cant create the text span - default: - return; - } - var nodeForStartPos = node; - while (true) { - if (isRightSideOfPropertyAccess(nodeForStartPos) || isRightSideOfQualifiedName(nodeForStartPos)) { - // If on the span is in right side of the the property or qualified name, return the span from the qualified name pos to end of this node - nodeForStartPos = nodeForStartPos.parent; - } - else if (isNameOfModuleDeclaration(nodeForStartPos)) { - // If this is name of a module declarations, check if this is right side of dotted module name - // If parent of the module declaration which is parent of this node is module declaration and its body is the module declaration that this node is name of - // Then this name is name from dotted module - if (nodeForStartPos.parent.parent.kind === 208 /* ModuleDeclaration */ && - nodeForStartPos.parent.parent.body === nodeForStartPos.parent) { - // Use parent module declarations name for start pos - nodeForStartPos = nodeForStartPos.parent.parent.name; - } - else { - // We have to use this name for start pos - break; - } - } - else { - // Is not a member expression so we have found the node for start pos - break; - } - } - return ts.createTextSpanFromBounds(nodeForStartPos.getStart(), node.getEnd()); - } - function getBreakpointStatementAtPosition(fileName, position) { - // doesn't use compiler - no need to synchronize with host - var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); - return ts.BreakpointResolver.spanInSourceFileAtLocation(sourceFile, position); - } - function getNavigationBarItems(fileName) { - var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); - return ts.NavigationBar.getNavigationBarItems(sourceFile); - } - function getSemanticClassifications(fileName, span) { - return convertClassifications(getEncodedSemanticClassifications(fileName, span)); - } - function getEncodedSemanticClassifications(fileName, span) { - synchronizeHostData(); - var sourceFile = getValidSourceFile(fileName); - var typeChecker = program.getTypeChecker(); - var result = []; - var classifiableNames = program.getClassifiableNames(); - processNode(sourceFile); - return { spans: result, endOfLineState: 0 /* None */ }; - function pushClassification(start, length, type) { - result.push(start); - result.push(length); - result.push(type); - } - function classifySymbol(symbol, meaningAtPosition) { - var flags = symbol.getFlags(); - if ((flags & 788448 /* Classifiable */) === 0 /* None */) { - return; - } - if (flags & 32 /* Class */) { - return 11 /* className */; - } - else if (flags & 384 /* Enum */) { - return 12 /* enumName */; - } - else if (flags & 524288 /* TypeAlias */) { - return 16 /* typeAliasName */; - } - else if (meaningAtPosition & 2 /* Type */) { - if (flags & 64 /* Interface */) { - return 13 /* interfaceName */; - } - else if (flags & 262144 /* TypeParameter */) { - return 15 /* typeParameterName */; - } - } - else if (flags & 1536 /* Module */) { - // Only classify a module as such if - // - It appears in a namespace context. - // - There exists a module declaration which actually impacts the value side. - if (meaningAtPosition & 4 /* Namespace */ || - (meaningAtPosition & 1 /* Value */ && hasValueSideModule(symbol))) { - return 14 /* moduleName */; - } - } - return undefined; - /** - * Returns true if there exists a module that introduces entities on the value side. - */ - function hasValueSideModule(symbol) { - return ts.forEach(symbol.declarations, function (declaration) { - return declaration.kind === 208 /* ModuleDeclaration */ && ts.getModuleInstanceState(declaration) == 1 /* Instantiated */; - }); - } - } - function processNode(node) { - // Only walk into nodes that intersect the requested span. - if (node && ts.textSpanIntersectsWith(span, node.getFullStart(), node.getFullWidth())) { - if (node.kind === 65 /* Identifier */ && !ts.nodeIsMissing(node)) { - var identifier = node; - // Only bother calling into the typechecker if this is an identifier that - // could possibly resolve to a type name. This makes classification run - // in a third of the time it would normally take. - if (classifiableNames[identifier.text]) { - var symbol = typeChecker.getSymbolAtLocation(node); - if (symbol) { - var type = classifySymbol(symbol, getMeaningFromLocation(node)); - if (type) { - pushClassification(node.getStart(), node.getWidth(), type); - } - } - } - } - ts.forEachChild(node, processNode); - } - } - } - function getClassificationTypeName(type) { - switch (type) { - case 1 /* comment */: return ClassificationTypeNames.comment; - case 2 /* identifier */: return ClassificationTypeNames.identifier; - case 3 /* keyword */: return ClassificationTypeNames.keyword; - case 4 /* numericLiteral */: return ClassificationTypeNames.numericLiteral; - case 5 /* operator */: return ClassificationTypeNames.operator; - case 6 /* stringLiteral */: return ClassificationTypeNames.stringLiteral; - case 8 /* whiteSpace */: return ClassificationTypeNames.whiteSpace; - case 9 /* text */: return ClassificationTypeNames.text; - case 10 /* punctuation */: return ClassificationTypeNames.punctuation; - case 11 /* className */: return ClassificationTypeNames.className; - case 12 /* enumName */: return ClassificationTypeNames.enumName; - case 13 /* interfaceName */: return ClassificationTypeNames.interfaceName; - case 14 /* moduleName */: return ClassificationTypeNames.moduleName; - case 15 /* typeParameterName */: return ClassificationTypeNames.typeParameterName; - case 16 /* typeAliasName */: return ClassificationTypeNames.typeAliasName; - case 17 /* parameterName */: return ClassificationTypeNames.parameterName; - case 18 /* docCommentTagName */: return ClassificationTypeNames.docCommentTagName; - } - } - function convertClassifications(classifications) { - ts.Debug.assert(classifications.spans.length % 3 === 0); - var dense = classifications.spans; - var result = []; - for (var i = 0, n = dense.length; i < n; i += 3) { - result.push({ - textSpan: ts.createTextSpan(dense[i], dense[i + 1]), - classificationType: getClassificationTypeName(dense[i + 2]) - }); - } - return result; - } - function getSyntacticClassifications(fileName, span) { - return convertClassifications(getEncodedSyntacticClassifications(fileName, span)); - } - function getEncodedSyntacticClassifications(fileName, span) { - // doesn't use compiler - no need to synchronize with host - var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); - // Make a scanner we can get trivia from. - var triviaScanner = ts.createScanner(2 /* Latest */, false, sourceFile.text); - var mergeConflictScanner = ts.createScanner(2 /* Latest */, false, sourceFile.text); - var result = []; - processElement(sourceFile); - return { spans: result, endOfLineState: 0 /* None */ }; - function pushClassification(start, length, type) { - result.push(start); - result.push(length); - result.push(type); - } - function classifyLeadingTrivia(token) { - var tokenStart = ts.skipTrivia(sourceFile.text, token.pos, false); - if (tokenStart === token.pos) { - return; - } - // token has trivia. Classify them appropriately. - triviaScanner.setTextPos(token.pos); - while (true) { - var start = triviaScanner.getTextPos(); - var kind = triviaScanner.scan(); - var end = triviaScanner.getTextPos(); - var width = end - start; - // The moment we get something that isn't trivia, then stop processing. - if (!ts.isTrivia(kind)) { - return; - } - // Only bother with the trivia if it at least intersects the span of interest. - if (ts.textSpanIntersectsWith(span, start, width)) { - if (ts.isComment(kind)) { - classifyComment(token, kind, start, width); - continue; - } - if (kind === 6 /* ConflictMarkerTrivia */) { - var text = sourceFile.text; - var ch = text.charCodeAt(start); - // for the <<<<<<< and >>>>>>> markers, we just add them in as comments - // in the classification stream. - if (ch === 60 /* lessThan */ || ch === 62 /* greaterThan */) { - pushClassification(start, width, 1 /* comment */); - continue; - } - // for the ======== add a comment for the first line, and then lex all - // subsequent lines up until the end of the conflict marker. - ts.Debug.assert(ch === 61 /* equals */); - classifyDisabledMergeCode(text, start, end); - } - } - } - } - function classifyComment(token, kind, start, width) { - if (kind === 3 /* MultiLineCommentTrivia */) { - // See if this is a doc comment. If so, we'll classify certain portions of it - // specially. - var docCommentAndDiagnostics = ts.parseIsolatedJSDocComment(sourceFile.text, start, width); - if (docCommentAndDiagnostics && docCommentAndDiagnostics.jsDocComment) { - docCommentAndDiagnostics.jsDocComment.parent = token; - classifyJSDocComment(docCommentAndDiagnostics.jsDocComment); - return; - } - } - // Simple comment. Just add as is. - pushCommentRange(start, width); - } - function pushCommentRange(start, width) { - pushClassification(start, width, 1 /* comment */); - } - function classifyJSDocComment(docComment) { - var pos = docComment.pos; - for (var _i = 0, _a = docComment.tags; _i < _a.length; _i++) { - var tag = _a[_i]; - // As we walk through each tag, classify the portion of text from the end of - // the last tag (or the start of the entire doc comment) as 'comment'. - if (tag.pos !== pos) { - pushCommentRange(pos, tag.pos - pos); - } - pushClassification(tag.atToken.pos, tag.atToken.end - tag.atToken.pos, 10 /* punctuation */); - pushClassification(tag.tagName.pos, tag.tagName.end - tag.tagName.pos, 18 /* docCommentTagName */); - pos = tag.tagName.end; - switch (tag.kind) { - case 249 /* JSDocParameterTag */: - processJSDocParameterTag(tag); - break; - case 252 /* JSDocTemplateTag */: - processJSDocTemplateTag(tag); - break; - case 251 /* JSDocTypeTag */: - processElement(tag.typeExpression); - break; - case 250 /* JSDocReturnTag */: - processElement(tag.typeExpression); - break; - } - pos = tag.end; - } - if (pos !== docComment.end) { - pushCommentRange(pos, docComment.end - pos); - } - return; - function processJSDocParameterTag(tag) { - if (tag.preParameterName) { - pushCommentRange(pos, tag.preParameterName.pos - pos); - pushClassification(tag.preParameterName.pos, tag.preParameterName.end - tag.preParameterName.pos, 17 /* parameterName */); - pos = tag.preParameterName.end; - } - if (tag.typeExpression) { - pushCommentRange(pos, tag.typeExpression.pos - pos); - processElement(tag.typeExpression); - pos = tag.typeExpression.end; - } - if (tag.postParameterName) { - pushCommentRange(pos, tag.postParameterName.pos - pos); - pushClassification(tag.postParameterName.pos, tag.postParameterName.end - tag.postParameterName.pos, 17 /* parameterName */); - pos = tag.postParameterName.end; - } - } - } - function processJSDocTemplateTag(tag) { - for (var _i = 0, _a = tag.getChildren(); _i < _a.length; _i++) { - var child = _a[_i]; - processElement(child); - } - } - function classifyDisabledMergeCode(text, start, end) { - // Classify the line that the ======= marker is on as a comment. Then just lex - // all further tokens and add them to the result. - for (var i = start; i < end; i++) { - if (ts.isLineBreak(text.charCodeAt(i))) { - break; - } - } - pushClassification(start, i - start, 1 /* comment */); - mergeConflictScanner.setTextPos(i); - while (mergeConflictScanner.getTextPos() < end) { - classifyDisabledCodeToken(); - } - } - function classifyDisabledCodeToken() { - var start = mergeConflictScanner.getTextPos(); - var tokenKind = mergeConflictScanner.scan(); - var end = mergeConflictScanner.getTextPos(); - var type = classifyTokenType(tokenKind); - if (type) { - pushClassification(start, end - start, type); - } - } - function classifyToken(token) { - classifyLeadingTrivia(token); - if (token.getWidth() > 0) { - var type = classifyTokenType(token.kind, token); - if (type) { - pushClassification(token.getStart(), token.getWidth(), type); - } - } - } - // for accurate classification, the actual token should be passed in. however, for - // cases like 'disabled merge code' classification, we just get the token kind and - // classify based on that instead. - function classifyTokenType(tokenKind, token) { - if (ts.isKeyword(tokenKind)) { - return 3 /* keyword */; - } - // Special case < and > If they appear in a generic context they are punctuation, - // not operators. - if (tokenKind === 24 /* LessThanToken */ || tokenKind === 25 /* GreaterThanToken */) { - // If the node owning the token has a type argument list or type parameter list, then - // we can effectively assume that a '<' and '>' belong to those lists. - if (token && ts.getTypeArgumentOrTypeParameterList(token.parent)) { - return 10 /* punctuation */; - } - } - if (ts.isPunctuation(tokenKind)) { - if (token) { - if (tokenKind === 53 /* EqualsToken */) { - // the '=' in a variable declaration is special cased here. - if (token.parent.kind === 201 /* VariableDeclaration */ || - token.parent.kind === 134 /* PropertyDeclaration */ || - token.parent.kind === 131 /* Parameter */) { - return 5 /* operator */; - } - } - if (token.parent.kind === 172 /* BinaryExpression */ || - token.parent.kind === 170 /* PrefixUnaryExpression */ || - token.parent.kind === 171 /* PostfixUnaryExpression */ || - token.parent.kind === 173 /* ConditionalExpression */) { - return 5 /* operator */; - } - } - return 10 /* punctuation */; - } - else if (tokenKind === 7 /* NumericLiteral */) { - return 4 /* numericLiteral */; - } - else if (tokenKind === 8 /* StringLiteral */) { - return 6 /* stringLiteral */; - } - else if (tokenKind === 9 /* RegularExpressionLiteral */) { - // TODO: we should get another classification type for these literals. - return 6 /* stringLiteral */; - } - else if (ts.isTemplateLiteralKind(tokenKind)) { - // TODO (drosen): we should *also* get another classification type for these literals. - return 6 /* stringLiteral */; - } - else if (tokenKind === 65 /* Identifier */) { - if (token) { - switch (token.parent.kind) { - case 204 /* ClassDeclaration */: - if (token.parent.name === token) { - return 11 /* className */; - } - return; - case 130 /* TypeParameter */: - if (token.parent.name === token) { - return 15 /* typeParameterName */; - } - return; - case 205 /* InterfaceDeclaration */: - if (token.parent.name === token) { - return 13 /* interfaceName */; - } - return; - case 207 /* EnumDeclaration */: - if (token.parent.name === token) { - return 12 /* enumName */; - } - return; - case 208 /* ModuleDeclaration */: - if (token.parent.name === token) { - return 14 /* moduleName */; - } - return; - case 131 /* Parameter */: - if (token.parent.name === token) { - return 17 /* parameterName */; - } - return; - } - } - return 9 /* text */; - } - } - function processElement(element) { - if (!element) { - return; - } - // Ignore nodes that don't intersect the original span to classify. - if (ts.textSpanIntersectsWith(span, element.getFullStart(), element.getFullWidth())) { - var children = element.getChildren(sourceFile); - for (var _i = 0; _i < children.length; _i++) { - var child = children[_i]; - if (ts.isToken(child)) { - classifyToken(child); - } - else { - // Recurse into our child nodes. - processElement(child); - } - } - } - } - } - function getOutliningSpans(fileName) { - // doesn't use compiler - no need to synchronize with host - var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); - return ts.OutliningElementsCollector.collectElements(sourceFile); - } - function getBraceMatchingAtPosition(fileName, position) { - var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); - var result = []; - var token = ts.getTouchingToken(sourceFile, position); - if (token.getStart(sourceFile) === position) { - var matchKind = getMatchingTokenKind(token); - // Ensure that there is a corresponding token to match ours. - if (matchKind) { - var parentElement = token.parent; - var childNodes = parentElement.getChildren(sourceFile); - for (var _i = 0; _i < childNodes.length; _i++) { - var current = childNodes[_i]; - if (current.kind === matchKind) { - var range1 = ts.createTextSpan(token.getStart(sourceFile), token.getWidth(sourceFile)); - var range2 = ts.createTextSpan(current.getStart(sourceFile), current.getWidth(sourceFile)); - // We want to order the braces when we return the result. - if (range1.start < range2.start) { - result.push(range1, range2); - } - else { - result.push(range2, range1); - } - break; - } - } - } - } - return result; - function getMatchingTokenKind(token) { - switch (token.kind) { - case 14 /* OpenBraceToken */: return 15 /* CloseBraceToken */; - case 16 /* OpenParenToken */: return 17 /* CloseParenToken */; - case 18 /* OpenBracketToken */: return 19 /* CloseBracketToken */; - case 24 /* LessThanToken */: return 25 /* GreaterThanToken */; - case 15 /* CloseBraceToken */: return 14 /* OpenBraceToken */; - case 17 /* CloseParenToken */: return 16 /* OpenParenToken */; - case 19 /* CloseBracketToken */: return 18 /* OpenBracketToken */; - case 25 /* GreaterThanToken */: return 24 /* LessThanToken */; - } - return undefined; - } - } - function getIndentationAtPosition(fileName, position, editorOptions) { - var start = new Date().getTime(); - var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); - log("getIndentationAtPosition: getCurrentSourceFile: " + (new Date().getTime() - start)); - start = new Date().getTime(); - var result = ts.formatting.SmartIndenter.getIndentation(position, sourceFile, editorOptions); - log("getIndentationAtPosition: computeIndentation : " + (new Date().getTime() - start)); - return result; - } - function getFormattingEditsForRange(fileName, start, end, options) { - var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); - return ts.formatting.formatSelection(start, end, sourceFile, getRuleProvider(options), options); - } - function getFormattingEditsForDocument(fileName, options) { - var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); - return ts.formatting.formatDocument(sourceFile, getRuleProvider(options), options); - } - function getFormattingEditsAfterKeystroke(fileName, position, key, options) { - var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); - if (key === "}") { - return ts.formatting.formatOnClosingCurly(position, sourceFile, getRuleProvider(options), options); - } - else if (key === ";") { - return ts.formatting.formatOnSemicolon(position, sourceFile, getRuleProvider(options), options); - } - else if (key === "\n") { - return ts.formatting.formatOnEnter(position, sourceFile, getRuleProvider(options), options); - } - return []; - } - function getTodoComments(fileName, descriptors) { - // Note: while getting todo comments seems like a syntactic operation, we actually - // treat it as a semantic operation here. This is because we expect our host to call - // this on every single file. If we treat this syntactically, then that will cause - // us to populate and throw away the tree in our syntax tree cache for each file. By - // treating this as a semantic operation, we can access any tree without throwing - // anything away. - synchronizeHostData(); - var sourceFile = getValidSourceFile(fileName); - cancellationToken.throwIfCancellationRequested(); - var fileContents = sourceFile.text; - var result = []; - if (descriptors.length > 0) { - var regExp = getTodoCommentsRegExp(); - var matchArray; - while (matchArray = regExp.exec(fileContents)) { - cancellationToken.throwIfCancellationRequested(); - // If we got a match, here is what the match array will look like. Say the source text is: - // - // " // hack 1" - // - // The result array with the regexp: will be: - // - // ["// hack 1", "// ", "hack 1", undefined, "hack"] - // - // Here are the relevant capture groups: - // 0) The full match for the entire regexp. - // 1) The preamble to the message portion. - // 2) The message portion. - // 3...N) The descriptor that was matched - by index. 'undefined' for each - // descriptor that didn't match. an actual value if it did match. - // - // i.e. 'undefined' in position 3 above means TODO(jason) didn't match. - // "hack" in position 4 means HACK did match. - var firstDescriptorCaptureIndex = 3; - ts.Debug.assert(matchArray.length === descriptors.length + firstDescriptorCaptureIndex); - var preamble = matchArray[1]; - var matchPosition = matchArray.index + preamble.length; - // OK, we have found a match in the file. This is only an acceptable match if - // it is contained within a comment. - var token = ts.getTokenAtPosition(sourceFile, matchPosition); - if (!isInsideComment(sourceFile, token, matchPosition)) { - continue; - } - var descriptor = undefined; - for (var i = 0, n = descriptors.length; i < n; i++) { - if (matchArray[i + firstDescriptorCaptureIndex]) { - descriptor = descriptors[i]; - } - } - ts.Debug.assert(descriptor !== undefined); - // We don't want to match something like 'TODOBY', so we make sure a non - // letter/digit follows the match. - if (isLetterOrDigit(fileContents.charCodeAt(matchPosition + descriptor.text.length))) { - continue; - } - var message = matchArray[2]; - result.push({ - descriptor: descriptor, - message: message, - position: matchPosition - }); - } - } - return result; - function escapeRegExp(str) { - return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); - } - function getTodoCommentsRegExp() { - // NOTE: ?: means 'non-capture group'. It allows us to have groups without having to - // filter them out later in the final result array. - // TODO comments can appear in one of the following forms: - // - // 1) // TODO or /////////// TODO - // - // 2) /* TODO or /********** TODO - // - // 3) /* - // * TODO - // */ - // - // The following three regexps are used to match the start of the text up to the TODO - // comment portion. - var singleLineCommentStart = /(?:\/\/+\s*)/.source; - var multiLineCommentStart = /(?:\/\*+\s*)/.source; - var anyNumberOfSpacesAndAsterixesAtStartOfLine = /(?:^(?:\s|\*)*)/.source; - // Match any of the above three TODO comment start regexps. - // Note that the outermost group *is* a capture group. We want to capture the preamble - // so that we can determine the starting position of the TODO comment match. - var preamble = "(" + anyNumberOfSpacesAndAsterixesAtStartOfLine + "|" + singleLineCommentStart + "|" + multiLineCommentStart + ")"; - // Takes the descriptors and forms a regexp that matches them as if they were literals. - // For example, if the descriptors are "TODO(jason)" and "HACK", then this will be: - // - // (?:(TODO\(jason\))|(HACK)) - // - // Note that the outermost group is *not* a capture group, but the innermost groups - // *are* capture groups. By capturing the inner literals we can determine after - // matching which descriptor we are dealing with. - var literals = "(?:" + ts.map(descriptors, function (d) { return "(" + escapeRegExp(d.text) + ")"; }).join("|") + ")"; - // After matching a descriptor literal, the following regexp matches the rest of the - // text up to the end of the line (or */). - var endOfLineOrEndOfComment = /(?:$|\*\/)/.source; - var messageRemainder = /(?:.*?)/.source; - // This is the portion of the match we'll return as part of the TODO comment result. We - // match the literal portion up to the end of the line or end of comment. - var messagePortion = "(" + literals + messageRemainder + ")"; - var regExpString = preamble + messagePortion + endOfLineOrEndOfComment; - // The final regexp will look like this: - // /((?:\/\/+\s*)|(?:\/\*+\s*)|(?:^(?:\s|\*)*))((?:(TODO\(jason\))|(HACK))(?:.*?))(?:$|\*\/)/gim - // The flags of the regexp are important here. - // 'g' is so that we are doing a global search and can find matches several times - // in the input. - // - // 'i' is for case insensitivity (We do this to match C# TODO comment code). - // - // 'm' is so we can find matches in a multi-line input. - return new RegExp(regExpString, "gim"); - } - function isLetterOrDigit(char) { - return (char >= 97 /* a */ && char <= 122 /* z */) || - (char >= 65 /* A */ && char <= 90 /* Z */) || - (char >= 48 /* _0 */ && char <= 57 /* _9 */); - } - } - function getRenameInfo(fileName, position) { - synchronizeHostData(); - var sourceFile = getValidSourceFile(fileName); - var typeChecker = program.getTypeChecker(); - var node = ts.getTouchingWord(sourceFile, position); - // Can only rename an identifier. - if (node && node.kind === 65 /* Identifier */) { - var symbol = typeChecker.getSymbolAtLocation(node); - // Only allow a symbol to be renamed if it actually has at least one declaration. - if (symbol) { - var declarations = symbol.getDeclarations(); - if (declarations && declarations.length > 0) { - // Disallow rename for elements that are defined in the standard TypeScript library. - var defaultLibFileName = host.getDefaultLibFileName(host.getCompilationSettings()); - if (defaultLibFileName) { - for (var _i = 0; _i < declarations.length; _i++) { - var current = declarations[_i]; - var sourceFile_2 = current.getSourceFile(); - if (sourceFile_2 && getCanonicalFileName(ts.normalizePath(sourceFile_2.fileName)) === getCanonicalFileName(ts.normalizePath(defaultLibFileName))) { - return getRenameInfoError(ts.getLocaleSpecificMessage(ts.Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library.key)); - } - } - } - var kind = getSymbolKind(symbol, node); - if (kind) { - return { - canRename: true, - localizedErrorMessage: undefined, - displayName: symbol.name, - fullDisplayName: typeChecker.getFullyQualifiedName(symbol), - kind: kind, - kindModifiers: getSymbolModifiers(symbol), - triggerSpan: ts.createTextSpan(node.getStart(), node.getWidth()) - }; - } - } - } - } - return getRenameInfoError(ts.getLocaleSpecificMessage(ts.Diagnostics.You_cannot_rename_this_element.key)); - function getRenameInfoError(localizedErrorMessage) { - return { - canRename: false, - localizedErrorMessage: localizedErrorMessage, - displayName: undefined, - fullDisplayName: undefined, - kind: undefined, - kindModifiers: undefined, - triggerSpan: undefined - }; - } - } - return { - dispose: dispose, - cleanupSemanticCache: cleanupSemanticCache, - getSyntacticDiagnostics: getSyntacticDiagnostics, - getSemanticDiagnostics: getSemanticDiagnostics, - getCompilerOptionsDiagnostics: getCompilerOptionsDiagnostics, - getSyntacticClassifications: getSyntacticClassifications, - getSemanticClassifications: getSemanticClassifications, - getEncodedSyntacticClassifications: getEncodedSyntacticClassifications, - getEncodedSemanticClassifications: getEncodedSemanticClassifications, - getCompletionsAtPosition: getCompletionsAtPosition, - getCompletionEntryDetails: getCompletionEntryDetails, - getSignatureHelpItems: getSignatureHelpItems, - getQuickInfoAtPosition: getQuickInfoAtPosition, - getDefinitionAtPosition: getDefinitionAtPosition, - getTypeDefinitionAtPosition: getTypeDefinitionAtPosition, - getReferencesAtPosition: getReferencesAtPosition, - findReferences: findReferences, - getOccurrencesAtPosition: getOccurrencesAtPosition, - getDocumentHighlights: getDocumentHighlights, - getNameOrDottedNameSpan: getNameOrDottedNameSpan, - getBreakpointStatementAtPosition: getBreakpointStatementAtPosition, - getNavigateToItems: getNavigateToItems, - getRenameInfo: getRenameInfo, - findRenameLocations: findRenameLocations, - getNavigationBarItems: getNavigationBarItems, - getOutliningSpans: getOutliningSpans, - getTodoComments: getTodoComments, - getBraceMatchingAtPosition: getBraceMatchingAtPosition, - getIndentationAtPosition: getIndentationAtPosition, - getFormattingEditsForRange: getFormattingEditsForRange, - getFormattingEditsForDocument: getFormattingEditsForDocument, - getFormattingEditsAfterKeystroke: getFormattingEditsAfterKeystroke, - getEmitOutput: getEmitOutput, - getSourceFile: getSourceFile, - getProgram: getProgram - }; - } - ts.createLanguageService = createLanguageService; - /* @internal */ - function getNameTable(sourceFile) { - if (!sourceFile.nameTable) { - initializeNameTable(sourceFile); - } - return sourceFile.nameTable; - } - ts.getNameTable = getNameTable; - function initializeNameTable(sourceFile) { - var nameTable = {}; - walk(sourceFile); - sourceFile.nameTable = nameTable; - function walk(node) { - switch (node.kind) { - case 65 /* Identifier */: - nameTable[node.text] = node.text; - break; - case 8 /* StringLiteral */: - case 7 /* NumericLiteral */: - // We want to store any numbers/strings if they were a name that could be - // related to a declaration. So, if we have 'import x = require("something")' - // then we want 'something' to be in the name table. Similarly, if we have - // "a['propname']" then we want to store "propname" in the name table. - if (ts.isDeclarationName(node) || - node.parent.kind === 222 /* ExternalModuleReference */ || - isArgumentOfElementAccessExpression(node)) { - nameTable[node.text] = node.text; - } - break; - default: - ts.forEachChild(node, walk); - } - } - } - function isArgumentOfElementAccessExpression(node) { - return node && - node.parent && - node.parent.kind === 159 /* ElementAccessExpression */ && - node.parent.argumentExpression === node; - } - /// Classifier - function createClassifier() { - var scanner = ts.createScanner(2 /* Latest */, false); - /// We do not have a full parser support to know when we should parse a regex or not - /// If we consider every slash token to be a regex, we could be missing cases like "1/2/3", where - /// we have a series of divide operator. this list allows us to be more accurate by ruling out - /// locations where a regexp cannot exist. - var noRegexTable = []; - noRegexTable[65 /* Identifier */] = true; - noRegexTable[8 /* StringLiteral */] = true; - noRegexTable[7 /* NumericLiteral */] = true; - noRegexTable[9 /* RegularExpressionLiteral */] = true; - noRegexTable[93 /* ThisKeyword */] = true; - noRegexTable[38 /* PlusPlusToken */] = true; - noRegexTable[39 /* MinusMinusToken */] = true; - noRegexTable[17 /* CloseParenToken */] = true; - noRegexTable[19 /* CloseBracketToken */] = true; - noRegexTable[15 /* CloseBraceToken */] = true; - noRegexTable[95 /* TrueKeyword */] = true; - noRegexTable[80 /* FalseKeyword */] = true; - // Just a stack of TemplateHeads and OpenCurlyBraces, used to perform rudimentary (inexact) - // classification on template strings. Because of the context free nature of templates, - // the only precise way to classify a template portion would be by propagating the stack across - // lines, just as we do with the end-of-line state. However, this is a burden for implementers, - // and the behavior is entirely subsumed by the syntactic classifier anyway, so we instead - // flatten any nesting when the template stack is non-empty and encode it in the end-of-line state. - // Situations in which this fails are - // 1) When template strings are nested across different lines: - // `hello ${ `world - // ` }` - // - // Where on the second line, you will get the closing of a template, - // a closing curly, and a new template. - // - // 2) When substitution expressions have curly braces and the curly brace falls on the next line: - // `hello ${ () => { - // return "world" } } ` - // - // Where on the second line, you will get the 'return' keyword, - // a string literal, and a template end consisting of '} } `'. - var templateStack = []; - /** Returns true if 'keyword2' can legally follow 'keyword1' in any language construct. */ - function canFollow(keyword1, keyword2) { - if (ts.isAccessibilityModifier(keyword1)) { - if (keyword2 === 116 /* GetKeyword */ || - keyword2 === 122 /* SetKeyword */ || - keyword2 === 114 /* ConstructorKeyword */ || - keyword2 === 109 /* StaticKeyword */) { - // Allow things like "public get", "public constructor" and "public static". - // These are all legal. - return true; - } - // Any other keyword following "public" is actually an identifier an not a real - // keyword. - return false; - } - // Assume any other keyword combination is legal. This can be refined in the future - // if there are more cases we want the classifier to be better at. - return true; - } - function convertClassifications(classifications, text) { - var entries = []; - var dense = classifications.spans; - var lastEnd = 0; - for (var i = 0, n = dense.length; i < n; i += 3) { - var start = dense[i]; - var length_2 = dense[i + 1]; - var type = dense[i + 2]; - // Make a whitespace entry between the last item and this one. - if (lastEnd >= 0) { - var whitespaceLength_1 = start - lastEnd; - if (whitespaceLength_1 > 0) { - entries.push({ length: whitespaceLength_1, classification: TokenClass.Whitespace }); - } - } - entries.push({ length: length_2, classification: convertClassification(type) }); - lastEnd = start + length_2; - } - var whitespaceLength = text.length - lastEnd; - if (whitespaceLength > 0) { - entries.push({ length: whitespaceLength, classification: TokenClass.Whitespace }); - } - return { entries: entries, finalLexState: classifications.endOfLineState }; - } - function convertClassification(type) { - switch (type) { - case 1 /* comment */: return TokenClass.Comment; - case 3 /* keyword */: return TokenClass.Keyword; - case 4 /* numericLiteral */: return TokenClass.NumberLiteral; - case 5 /* operator */: return TokenClass.Operator; - case 6 /* stringLiteral */: return TokenClass.StringLiteral; - case 8 /* whiteSpace */: return TokenClass.Whitespace; - case 10 /* punctuation */: return TokenClass.Punctuation; - case 2 /* identifier */: - case 11 /* className */: - case 12 /* enumName */: - case 13 /* interfaceName */: - case 14 /* moduleName */: - case 15 /* typeParameterName */: - case 16 /* typeAliasName */: - case 9 /* text */: - case 17 /* parameterName */: - default: - return TokenClass.Identifier; - } - } - function getClassificationsForLine(text, lexState, syntacticClassifierAbsent) { - return convertClassifications(getEncodedLexicalClassifications(text, lexState, syntacticClassifierAbsent), text); - } - // If there is a syntactic classifier ('syntacticClassifierAbsent' is false), - // we will be more conservative in order to avoid conflicting with the syntactic classifier. - function getEncodedLexicalClassifications(text, lexState, syntacticClassifierAbsent) { - var offset = 0; - var token = 0 /* Unknown */; - var lastNonTriviaToken = 0 /* Unknown */; - // Empty out the template stack for reuse. - while (templateStack.length > 0) { - templateStack.pop(); - } - // If we're in a string literal, then prepend: "\ - // (and a newline). That way when we lex we'll think we're still in a string literal. - // - // If we're in a multiline comment, then prepend: /* - // (and a newline). That way when we lex we'll think we're still in a multiline comment. - switch (lexState) { - case 3 /* InDoubleQuoteStringLiteral */: - text = '"\\\n' + text; - offset = 3; - break; - case 2 /* InSingleQuoteStringLiteral */: - text = "'\\\n" + text; - offset = 3; - break; - case 1 /* InMultiLineCommentTrivia */: - text = "/*\n" + text; - offset = 3; - break; - case 4 /* InTemplateHeadOrNoSubstitutionTemplate */: - text = "`\n" + text; - offset = 2; - break; - case 5 /* InTemplateMiddleOrTail */: - text = "}\n" + text; - offset = 2; - // fallthrough - case 6 /* InTemplateSubstitutionPosition */: - templateStack.push(11 /* TemplateHead */); - break; - } - scanner.setText(text); - var result = { - endOfLineState: 0 /* None */, - spans: [] - }; - // We can run into an unfortunate interaction between the lexical and syntactic classifier - // when the user is typing something generic. Consider the case where the user types: - // - // Foo tokens. It's a weak heuristic, but should - // work well enough in practice. - var angleBracketStack = 0; - do { - token = scanner.scan(); - if (!ts.isTrivia(token)) { - if ((token === 36 /* SlashToken */ || token === 57 /* SlashEqualsToken */) && !noRegexTable[lastNonTriviaToken]) { - if (scanner.reScanSlashToken() === 9 /* RegularExpressionLiteral */) { - token = 9 /* RegularExpressionLiteral */; - } - } - else if (lastNonTriviaToken === 20 /* DotToken */ && isKeyword(token)) { - token = 65 /* Identifier */; - } - else if (isKeyword(lastNonTriviaToken) && isKeyword(token) && !canFollow(lastNonTriviaToken, token)) { - // We have two keywords in a row. Only treat the second as a keyword if - // it's a sequence that could legally occur in the language. Otherwise - // treat it as an identifier. This way, if someone writes "private var" - // we recognize that 'var' is actually an identifier here. - token = 65 /* Identifier */; - } - else if (lastNonTriviaToken === 65 /* Identifier */ && - token === 24 /* LessThanToken */) { - // Could be the start of something generic. Keep track of that by bumping - // up the current count of generic contexts we may be in. - angleBracketStack++; - } - else if (token === 25 /* GreaterThanToken */ && angleBracketStack > 0) { - // If we think we're currently in something generic, then mark that that - // generic entity is complete. - angleBracketStack--; - } - else if (token === 112 /* AnyKeyword */ || - token === 123 /* StringKeyword */ || - token === 121 /* NumberKeyword */ || - token === 113 /* BooleanKeyword */ || - token === 124 /* SymbolKeyword */) { - if (angleBracketStack > 0 && !syntacticClassifierAbsent) { - // If it looks like we're could be in something generic, don't classify this - // as a keyword. We may just get overwritten by the syntactic classifier, - // causing a noisy experience for the user. - token = 65 /* Identifier */; - } - } - else if (token === 11 /* TemplateHead */) { - templateStack.push(token); - } - else if (token === 14 /* OpenBraceToken */) { - // If we don't have anything on the template stack, - // then we aren't trying to keep track of a previously scanned template head. - if (templateStack.length > 0) { - templateStack.push(token); - } - } - else if (token === 15 /* CloseBraceToken */) { - // If we don't have anything on the template stack, - // then we aren't trying to keep track of a previously scanned template head. - if (templateStack.length > 0) { - var lastTemplateStackToken = ts.lastOrUndefined(templateStack); - if (lastTemplateStackToken === 11 /* TemplateHead */) { - token = scanner.reScanTemplateToken(); - // Only pop on a TemplateTail; a TemplateMiddle indicates there is more for us. - if (token === 13 /* TemplateTail */) { - templateStack.pop(); - } - else { - ts.Debug.assert(token === 12 /* TemplateMiddle */, "Should have been a template middle. Was " + token); - } - } - else { - ts.Debug.assert(lastTemplateStackToken === 14 /* OpenBraceToken */, "Should have been an open brace. Was: " + token); - templateStack.pop(); - } - } - } - lastNonTriviaToken = token; - } - processToken(); - } while (token !== 1 /* EndOfFileToken */); - return result; - function processToken() { - var start = scanner.getTokenPos(); - var end = scanner.getTextPos(); - addResult(start, end, classFromKind(token)); - if (end >= text.length) { - if (token === 8 /* StringLiteral */) { - // Check to see if we finished up on a multiline string literal. - var tokenText = scanner.getTokenText(); - if (scanner.isUnterminated()) { - var lastCharIndex = tokenText.length - 1; - var numBackslashes = 0; - while (tokenText.charCodeAt(lastCharIndex - numBackslashes) === 92 /* backslash */) { - numBackslashes++; - } - // If we have an odd number of backslashes, then the multiline string is unclosed - if (numBackslashes & 1) { - var quoteChar = tokenText.charCodeAt(0); - result.endOfLineState = quoteChar === 34 /* doubleQuote */ - ? 3 /* InDoubleQuoteStringLiteral */ - : 2 /* InSingleQuoteStringLiteral */; - } - } - } - else if (token === 3 /* MultiLineCommentTrivia */) { - // Check to see if the multiline comment was unclosed. - if (scanner.isUnterminated()) { - result.endOfLineState = 1 /* InMultiLineCommentTrivia */; - } - } - else if (ts.isTemplateLiteralKind(token)) { - if (scanner.isUnterminated()) { - if (token === 13 /* TemplateTail */) { - result.endOfLineState = 5 /* InTemplateMiddleOrTail */; - } - else if (token === 10 /* NoSubstitutionTemplateLiteral */) { - result.endOfLineState = 4 /* InTemplateHeadOrNoSubstitutionTemplate */; - } - else { - ts.Debug.fail("Only 'NoSubstitutionTemplateLiteral's and 'TemplateTail's can be unterminated; got SyntaxKind #" + token); - } - } - } - else if (templateStack.length > 0 && ts.lastOrUndefined(templateStack) === 11 /* TemplateHead */) { - result.endOfLineState = 6 /* InTemplateSubstitutionPosition */; - } - } - } - function addResult(start, end, classification) { - if (classification === 8 /* whiteSpace */) { - // Don't bother with whitespace classifications. They're not needed. - return; - } - if (start === 0 && offset > 0) { - // We're classifying the first token, and this was a case where we prepended - // text. We should consider the start of this token to be at the start of - // the original text. - start += offset; - } - // All our tokens are in relation to the augmented text. Move them back to be - // relative to the original text. - start -= offset; - end -= offset; - var length = end - start; - if (length > 0) { - result.spans.push(start); - result.spans.push(length); - result.spans.push(classification); - } - } - } - function isBinaryExpressionOperatorToken(token) { - switch (token) { - case 35 /* AsteriskToken */: - case 36 /* SlashToken */: - case 37 /* PercentToken */: - case 33 /* PlusToken */: - case 34 /* MinusToken */: - case 40 /* LessThanLessThanToken */: - case 41 /* GreaterThanGreaterThanToken */: - case 42 /* GreaterThanGreaterThanGreaterThanToken */: - case 24 /* LessThanToken */: - case 25 /* GreaterThanToken */: - case 26 /* LessThanEqualsToken */: - case 27 /* GreaterThanEqualsToken */: - case 87 /* InstanceOfKeyword */: - case 86 /* InKeyword */: - case 28 /* EqualsEqualsToken */: - case 29 /* ExclamationEqualsToken */: - case 30 /* EqualsEqualsEqualsToken */: - case 31 /* ExclamationEqualsEqualsToken */: - case 43 /* AmpersandToken */: - case 45 /* CaretToken */: - case 44 /* BarToken */: - case 48 /* AmpersandAmpersandToken */: - case 49 /* BarBarToken */: - case 63 /* BarEqualsToken */: - case 62 /* AmpersandEqualsToken */: - case 64 /* CaretEqualsToken */: - case 59 /* LessThanLessThanEqualsToken */: - case 60 /* GreaterThanGreaterThanEqualsToken */: - case 61 /* GreaterThanGreaterThanGreaterThanEqualsToken */: - case 54 /* PlusEqualsToken */: - case 55 /* MinusEqualsToken */: - case 56 /* AsteriskEqualsToken */: - case 57 /* SlashEqualsToken */: - case 58 /* PercentEqualsToken */: - case 53 /* EqualsToken */: - case 23 /* CommaToken */: - return true; - default: - return false; - } - } - function isPrefixUnaryExpressionOperatorToken(token) { - switch (token) { - case 33 /* PlusToken */: - case 34 /* MinusToken */: - case 47 /* TildeToken */: - case 46 /* ExclamationToken */: - case 38 /* PlusPlusToken */: - case 39 /* MinusMinusToken */: - return true; - default: - return false; - } - } - function isKeyword(token) { - return token >= 66 /* FirstKeyword */ && token <= 127 /* LastKeyword */; - } - function classFromKind(token) { - if (isKeyword(token)) { - return 3 /* keyword */; - } - else if (isBinaryExpressionOperatorToken(token) || isPrefixUnaryExpressionOperatorToken(token)) { - return 5 /* operator */; - } - else if (token >= 14 /* FirstPunctuation */ && token <= 64 /* LastPunctuation */) { - return 10 /* punctuation */; - } - switch (token) { - case 7 /* NumericLiteral */: - return 4 /* numericLiteral */; - case 8 /* StringLiteral */: - return 6 /* stringLiteral */; - case 9 /* RegularExpressionLiteral */: - return 7 /* regularExpressionLiteral */; - case 6 /* ConflictMarkerTrivia */: - case 3 /* MultiLineCommentTrivia */: - case 2 /* SingleLineCommentTrivia */: - return 1 /* comment */; - case 5 /* WhitespaceTrivia */: - case 4 /* NewLineTrivia */: - return 8 /* whiteSpace */; - case 65 /* Identifier */: - default: - if (ts.isTemplateLiteralKind(token)) { - return 6 /* stringLiteral */; - } - return 2 /* identifier */; - } - } - return { - getClassificationsForLine: getClassificationsForLine, - getEncodedLexicalClassifications: getEncodedLexicalClassifications - }; - } - ts.createClassifier = createClassifier; - /** - * Get the path of the default library file (lib.d.ts) as distributed with the typescript - * node package. - * The functionality is not supported if the ts module is consumed outside of a node module. - */ - function getDefaultLibFilePath(options) { - // Check __dirname is defined and that we are on a node.js system. - if (typeof __dirname !== "undefined") { - return __dirname + ts.directorySeparator + ts.getDefaultLibFileName(options); - } - throw new Error("getDefaultLibFilePath is only supported when consumed as a node module. "); - } - ts.getDefaultLibFilePath = getDefaultLibFilePath; - function initializeServices() { - ts.objectAllocator = { - getNodeConstructor: function (kind) { - function Node() { - } - var proto = kind === 230 /* SourceFile */ ? new SourceFileObject() : new NodeObject(); - proto.kind = kind; - proto.pos = 0; - proto.end = 0; - proto.flags = 0; - proto.parent = undefined; - Node.prototype = proto; - return Node; - }, - getSymbolConstructor: function () { return SymbolObject; }, - getTypeConstructor: function () { return TypeObject; }, - getSignatureConstructor: function () { return SignatureObject; } - }; - } - initializeServices(); -})(ts || (ts = {})); -// Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. -// See LICENSE.txt in the project root for complete license information. -/// -/* @internal */ -var ts; -(function (ts) { - var BreakpointResolver; - (function (BreakpointResolver) { - /** - * Get the breakpoint span in given sourceFile - */ - function spanInSourceFileAtLocation(sourceFile, position) { - // Cannot set breakpoint in dts file - if (sourceFile.flags & 2048 /* DeclarationFile */) { - return undefined; - } - var tokenAtLocation = ts.getTokenAtPosition(sourceFile, position); - var lineOfPosition = sourceFile.getLineAndCharacterOfPosition(position).line; - if (sourceFile.getLineAndCharacterOfPosition(tokenAtLocation.getStart()).line > lineOfPosition) { - // Get previous token if the token is returned starts on new line - // eg: let x =10; |--- cursor is here - // let y = 10; - // token at position will return let keyword on second line as the token but we would like to use - // token on same line if trailing trivia (comments or white spaces on same line) part of the last token on that line - tokenAtLocation = ts.findPrecedingToken(tokenAtLocation.pos, sourceFile); - // Its a blank line - if (!tokenAtLocation || sourceFile.getLineAndCharacterOfPosition(tokenAtLocation.getEnd()).line !== lineOfPosition) { - return undefined; - } - } - // Cannot set breakpoint in ambient declarations - if (ts.isInAmbientContext(tokenAtLocation)) { - return undefined; - } - // Get the span in the node based on its syntax - return spanInNode(tokenAtLocation); - function textSpan(startNode, endNode) { - return ts.createTextSpanFromBounds(startNode.getStart(), (endNode || startNode).getEnd()); - } - function spanInNodeIfStartsOnSameLine(node, otherwiseOnNode) { - if (node && lineOfPosition === sourceFile.getLineAndCharacterOfPosition(node.getStart()).line) { - return spanInNode(node); - } - return spanInNode(otherwiseOnNode); - } - function spanInPreviousNode(node) { - return spanInNode(ts.findPrecedingToken(node.pos, sourceFile)); - } - function spanInNextNode(node) { - return spanInNode(ts.findNextToken(node, node.parent)); - } - function spanInNode(node) { - if (node) { - if (ts.isExpression(node)) { - if (node.parent.kind === 187 /* DoStatement */) { - // Set span as if on while keyword - return spanInPreviousNode(node); - } - if (node.parent.kind === 189 /* ForStatement */) { - // For now lets set the span on this expression, fix it later - return textSpan(node); - } - if (node.parent.kind === 172 /* BinaryExpression */ && node.parent.operatorToken.kind === 23 /* CommaToken */) { - // if this is comma expression, the breakpoint is possible in this expression - return textSpan(node); - } - if (node.parent.kind == 166 /* ArrowFunction */ && node.parent.body == node) { - // If this is body of arrow function, it is allowed to have the breakpoint - return textSpan(node); - } - } - switch (node.kind) { - case 183 /* VariableStatement */: - // Span on first variable declaration - return spanInVariableDeclaration(node.declarationList.declarations[0]); - case 201 /* VariableDeclaration */: - case 134 /* PropertyDeclaration */: - case 133 /* PropertySignature */: - return spanInVariableDeclaration(node); - case 131 /* Parameter */: - return spanInParameterDeclaration(node); - case 203 /* FunctionDeclaration */: - case 136 /* MethodDeclaration */: - case 135 /* MethodSignature */: - case 138 /* GetAccessor */: - case 139 /* SetAccessor */: - case 137 /* Constructor */: - case 165 /* FunctionExpression */: - case 166 /* ArrowFunction */: - return spanInFunctionDeclaration(node); - case 182 /* Block */: - if (ts.isFunctionBlock(node)) { - return spanInFunctionBlock(node); - } - // Fall through - case 209 /* ModuleBlock */: - return spanInBlock(node); - case 226 /* CatchClause */: - return spanInBlock(node.block); - case 185 /* ExpressionStatement */: - // span on the expression - return textSpan(node.expression); - case 194 /* ReturnStatement */: - // span on return keyword and expression if present - return textSpan(node.getChildAt(0), node.expression); - case 188 /* WhileStatement */: - // Span on while(...) - return textSpan(node, ts.findNextToken(node.expression, node)); - case 187 /* DoStatement */: - // span in statement of the do statement - return spanInNode(node.statement); - case 200 /* DebuggerStatement */: - // span on debugger keyword - return textSpan(node.getChildAt(0)); - case 186 /* IfStatement */: - // set on if(..) span - return textSpan(node, ts.findNextToken(node.expression, node)); - case 197 /* LabeledStatement */: - // span in statement - return spanInNode(node.statement); - case 193 /* BreakStatement */: - case 192 /* ContinueStatement */: - // On break or continue keyword and label if present - return textSpan(node.getChildAt(0), node.label); - case 189 /* ForStatement */: - return spanInForStatement(node); - case 190 /* ForInStatement */: - case 191 /* ForOfStatement */: - // span on for (a in ...) - return textSpan(node, ts.findNextToken(node.expression, node)); - case 196 /* SwitchStatement */: - // span on switch(...) - return textSpan(node, ts.findNextToken(node.expression, node)); - case 223 /* CaseClause */: - case 224 /* DefaultClause */: - // span in first statement of the clause - return spanInNode(node.statements[0]); - case 199 /* TryStatement */: - // span in try block - return spanInBlock(node.tryBlock); - case 198 /* ThrowStatement */: - // span in throw ... - return textSpan(node, node.expression); - case 217 /* ExportAssignment */: - // span on export = id - return textSpan(node, node.expression); - case 211 /* ImportEqualsDeclaration */: - // import statement without including semicolon - return textSpan(node, node.moduleReference); - case 212 /* ImportDeclaration */: - // import statement without including semicolon - return textSpan(node, node.moduleSpecifier); - case 218 /* ExportDeclaration */: - // import statement without including semicolon - return textSpan(node, node.moduleSpecifier); - case 208 /* ModuleDeclaration */: - // span on complete module if it is instantiated - if (ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { - return undefined; - } - case 204 /* ClassDeclaration */: - case 207 /* EnumDeclaration */: - case 229 /* EnumMember */: - case 160 /* CallExpression */: - case 161 /* NewExpression */: - // span on complete node - return textSpan(node); - case 195 /* WithStatement */: - // span in statement - return spanInNode(node.statement); - // No breakpoint in interface, type alias - case 205 /* InterfaceDeclaration */: - case 206 /* TypeAliasDeclaration */: - return undefined; - // Tokens: - case 22 /* SemicolonToken */: - case 1 /* EndOfFileToken */: - return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile)); - case 23 /* CommaToken */: - return spanInPreviousNode(node); - case 14 /* OpenBraceToken */: - return spanInOpenBraceToken(node); - case 15 /* CloseBraceToken */: - return spanInCloseBraceToken(node); - case 16 /* OpenParenToken */: - return spanInOpenParenToken(node); - case 17 /* CloseParenToken */: - return spanInCloseParenToken(node); - case 51 /* ColonToken */: - return spanInColonToken(node); - case 25 /* GreaterThanToken */: - case 24 /* LessThanToken */: - return spanInGreaterThanOrLessThanToken(node); - // Keywords: - case 100 /* WhileKeyword */: - return spanInWhileKeyword(node); - case 76 /* ElseKeyword */: - case 68 /* CatchKeyword */: - case 81 /* FinallyKeyword */: - return spanInNextNode(node); - default: - // If this is name of property assignment, set breakpoint in the initializer - if (node.parent.kind === 227 /* PropertyAssignment */ && node.parent.name === node) { - return spanInNode(node.parent.initializer); - } - // Breakpoint in type assertion goes to its operand - if (node.parent.kind === 163 /* TypeAssertionExpression */ && node.parent.type === node) { - return spanInNode(node.parent.expression); - } - // return type of function go to previous token - if (ts.isFunctionLike(node.parent) && node.parent.type === node) { - return spanInPreviousNode(node); - } - // Default go to parent to set the breakpoint - return spanInNode(node.parent); - } - } - function spanInVariableDeclaration(variableDeclaration) { - // If declaration of for in statement, just set the span in parent - if (variableDeclaration.parent.parent.kind === 190 /* ForInStatement */ || - variableDeclaration.parent.parent.kind === 191 /* ForOfStatement */) { - return spanInNode(variableDeclaration.parent.parent); - } - var isParentVariableStatement = variableDeclaration.parent.parent.kind === 183 /* VariableStatement */; - var isDeclarationOfForStatement = variableDeclaration.parent.parent.kind === 189 /* ForStatement */ && ts.contains(variableDeclaration.parent.parent.initializer.declarations, variableDeclaration); - var declarations = isParentVariableStatement - ? variableDeclaration.parent.parent.declarationList.declarations - : isDeclarationOfForStatement - ? variableDeclaration.parent.parent.initializer.declarations - : undefined; - // Breakpoint is possible in variableDeclaration only if there is initialization - if (variableDeclaration.initializer || (variableDeclaration.flags & 1 /* Export */)) { - if (declarations && declarations[0] === variableDeclaration) { - if (isParentVariableStatement) { - // First declaration - include let keyword - return textSpan(variableDeclaration.parent, variableDeclaration); - } - else { - ts.Debug.assert(isDeclarationOfForStatement); - // Include let keyword from for statement declarations in the span - return textSpan(ts.findPrecedingToken(variableDeclaration.pos, sourceFile, variableDeclaration.parent), variableDeclaration); - } - } - else { - // Span only on this declaration - return textSpan(variableDeclaration); - } - } - else if (declarations && declarations[0] !== variableDeclaration) { - // If we cant set breakpoint on this declaration, set it on previous one - var indexOfCurrentDeclaration = ts.indexOf(declarations, variableDeclaration); - return spanInVariableDeclaration(declarations[indexOfCurrentDeclaration - 1]); - } - } - function canHaveSpanInParameterDeclaration(parameter) { - // Breakpoint is possible on parameter only if it has initializer, is a rest parameter, or has public or private modifier - return !!parameter.initializer || parameter.dotDotDotToken !== undefined || - !!(parameter.flags & 16 /* Public */) || !!(parameter.flags & 32 /* Private */); - } - function spanInParameterDeclaration(parameter) { - if (canHaveSpanInParameterDeclaration(parameter)) { - return textSpan(parameter); - } - else { - var functionDeclaration = parameter.parent; - var indexOfParameter = ts.indexOf(functionDeclaration.parameters, parameter); - if (indexOfParameter) { - // Not a first parameter, go to previous parameter - return spanInParameterDeclaration(functionDeclaration.parameters[indexOfParameter - 1]); - } - else { - // Set breakpoint in the function declaration body - return spanInNode(functionDeclaration.body); - } - } - } - function canFunctionHaveSpanInWholeDeclaration(functionDeclaration) { - return !!(functionDeclaration.flags & 1 /* Export */) || - (functionDeclaration.parent.kind === 204 /* ClassDeclaration */ && functionDeclaration.kind !== 137 /* Constructor */); - } - function spanInFunctionDeclaration(functionDeclaration) { - // No breakpoints in the function signature - if (!functionDeclaration.body) { - return undefined; - } - if (canFunctionHaveSpanInWholeDeclaration(functionDeclaration)) { - // Set the span on whole function declaration - return textSpan(functionDeclaration); - } - // Set span in function body - return spanInNode(functionDeclaration.body); - } - function spanInFunctionBlock(block) { - var nodeForSpanInBlock = block.statements.length ? block.statements[0] : block.getLastToken(); - if (canFunctionHaveSpanInWholeDeclaration(block.parent)) { - return spanInNodeIfStartsOnSameLine(block.parent, nodeForSpanInBlock); - } - return spanInNode(nodeForSpanInBlock); - } - function spanInBlock(block) { - switch (block.parent.kind) { - case 208 /* ModuleDeclaration */: - if (ts.getModuleInstanceState(block.parent) !== 1 /* Instantiated */) { - return undefined; - } - // Set on parent if on same line otherwise on first statement - case 188 /* WhileStatement */: - case 186 /* IfStatement */: - case 190 /* ForInStatement */: - case 191 /* ForOfStatement */: - return spanInNodeIfStartsOnSameLine(block.parent, block.statements[0]); - // Set span on previous token if it starts on same line otherwise on the first statement of the block - case 189 /* ForStatement */: - return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(block.pos, sourceFile, block.parent), block.statements[0]); - } - // Default action is to set on first statement - return spanInNode(block.statements[0]); - } - function spanInForStatement(forStatement) { - if (forStatement.initializer) { - if (forStatement.initializer.kind === 202 /* VariableDeclarationList */) { - var variableDeclarationList = forStatement.initializer; - if (variableDeclarationList.declarations.length > 0) { - return spanInNode(variableDeclarationList.declarations[0]); - } - } - else { - return spanInNode(forStatement.initializer); - } - } - if (forStatement.condition) { - return textSpan(forStatement.condition); - } - if (forStatement.incrementor) { - return textSpan(forStatement.incrementor); - } - } - // Tokens: - function spanInOpenBraceToken(node) { - switch (node.parent.kind) { - case 207 /* EnumDeclaration */: - var enumDeclaration = node.parent; - return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), enumDeclaration.members.length ? enumDeclaration.members[0] : enumDeclaration.getLastToken(sourceFile)); - case 204 /* ClassDeclaration */: - var classDeclaration = node.parent; - return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), classDeclaration.members.length ? classDeclaration.members[0] : classDeclaration.getLastToken(sourceFile)); - case 210 /* CaseBlock */: - return spanInNodeIfStartsOnSameLine(node.parent.parent, node.parent.clauses[0]); - } - // Default to parent node - return spanInNode(node.parent); - } - function spanInCloseBraceToken(node) { - switch (node.parent.kind) { - case 209 /* ModuleBlock */: - // If this is not instantiated module block no bp span - if (ts.getModuleInstanceState(node.parent.parent) !== 1 /* Instantiated */) { - return undefined; - } - case 207 /* EnumDeclaration */: - case 204 /* ClassDeclaration */: - // Span on close brace token - return textSpan(node); - case 182 /* Block */: - if (ts.isFunctionBlock(node.parent)) { - // Span on close brace token - return textSpan(node); - } - // fall through. - case 226 /* CatchClause */: - return spanInNode(ts.lastOrUndefined(node.parent.statements)); - ; - case 210 /* CaseBlock */: - // breakpoint in last statement of the last clause - var caseBlock = node.parent; - var lastClause = ts.lastOrUndefined(caseBlock.clauses); - if (lastClause) { - return spanInNode(ts.lastOrUndefined(lastClause.statements)); - } - return undefined; - // Default to parent node - default: - return spanInNode(node.parent); - } - } - function spanInOpenParenToken(node) { - if (node.parent.kind === 187 /* DoStatement */) { - // Go to while keyword and do action instead - return spanInPreviousNode(node); - } - // Default to parent node - return spanInNode(node.parent); - } - function spanInCloseParenToken(node) { - // Is this close paren token of parameter list, set span in previous token - switch (node.parent.kind) { - case 165 /* FunctionExpression */: - case 203 /* FunctionDeclaration */: - case 166 /* ArrowFunction */: - case 136 /* MethodDeclaration */: - case 135 /* MethodSignature */: - case 138 /* GetAccessor */: - case 139 /* SetAccessor */: - case 137 /* Constructor */: - case 188 /* WhileStatement */: - case 187 /* DoStatement */: - case 189 /* ForStatement */: - return spanInPreviousNode(node); - // Default to parent node - default: - return spanInNode(node.parent); - } - // Default to parent node - return spanInNode(node.parent); - } - function spanInColonToken(node) { - // Is this : specifying return annotation of the function declaration - if (ts.isFunctionLike(node.parent) || node.parent.kind === 227 /* PropertyAssignment */) { - return spanInPreviousNode(node); - } - return spanInNode(node.parent); - } - function spanInGreaterThanOrLessThanToken(node) { - if (node.parent.kind === 163 /* TypeAssertionExpression */) { - return spanInNode(node.parent.expression); - } - return spanInNode(node.parent); - } - function spanInWhileKeyword(node) { - if (node.parent.kind === 187 /* DoStatement */) { - // Set span on while expression - return textSpan(node, ts.findNextToken(node.parent.expression, node.parent)); - } - // Default to parent node - return spanInNode(node.parent); - } - } - } - BreakpointResolver.spanInSourceFileAtLocation = spanInSourceFileAtLocation; - })(BreakpointResolver = ts.BreakpointResolver || (ts.BreakpointResolver = {})); -})(ts || (ts = {})); -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -/// -/* @internal */ -var debugObjectHost = this; -/* @internal */ -var ts; -(function (ts) { - function logInternalError(logger, err) { - if (logger) { - logger.log("*INTERNAL ERROR* - Exception in typescript services: " + err.message); - } - } - var ScriptSnapshotShimAdapter = (function () { - function ScriptSnapshotShimAdapter(scriptSnapshotShim) { - this.scriptSnapshotShim = scriptSnapshotShim; - this.lineStartPositions = null; - } - ScriptSnapshotShimAdapter.prototype.getText = function (start, end) { - return this.scriptSnapshotShim.getText(start, end); - }; - ScriptSnapshotShimAdapter.prototype.getLength = function () { - return this.scriptSnapshotShim.getLength(); - }; - ScriptSnapshotShimAdapter.prototype.getChangeRange = function (oldSnapshot) { - var oldSnapshotShim = oldSnapshot; - var encoded = this.scriptSnapshotShim.getChangeRange(oldSnapshotShim.scriptSnapshotShim); - if (encoded == null) { - return null; - } - var decoded = JSON.parse(encoded); - return ts.createTextChangeRange(ts.createTextSpan(decoded.span.start, decoded.span.length), decoded.newLength); - }; - return ScriptSnapshotShimAdapter; - })(); - var LanguageServiceShimHostAdapter = (function () { - function LanguageServiceShimHostAdapter(shimHost) { - this.shimHost = shimHost; - this.loggingEnabled = false; - this.tracingEnabled = false; - } - LanguageServiceShimHostAdapter.prototype.log = function (s) { - if (this.loggingEnabled) { - this.shimHost.log(s); - } - }; - LanguageServiceShimHostAdapter.prototype.trace = function (s) { - if (this.tracingEnabled) { - this.shimHost.trace(s); - } - }; - LanguageServiceShimHostAdapter.prototype.error = function (s) { - this.shimHost.error(s); - }; - LanguageServiceShimHostAdapter.prototype.getProjectVersion = function () { - if (!this.shimHost.getProjectVersion) { - // shimmed host does not support getProjectVersion - return undefined; - } - return this.shimHost.getProjectVersion(); - }; - LanguageServiceShimHostAdapter.prototype.useCaseSensitiveFileNames = function () { - return this.shimHost.useCaseSensitiveFileNames ? this.shimHost.useCaseSensitiveFileNames() : false; - }; - LanguageServiceShimHostAdapter.prototype.getCompilationSettings = function () { - var settingsJson = this.shimHost.getCompilationSettings(); - if (settingsJson == null || settingsJson == "") { - throw Error("LanguageServiceShimHostAdapter.getCompilationSettings: empty compilationSettings"); - return null; - } - return JSON.parse(settingsJson); - }; - LanguageServiceShimHostAdapter.prototype.getScriptFileNames = function () { - var encoded = this.shimHost.getScriptFileNames(); - return this.files = JSON.parse(encoded); - }; - LanguageServiceShimHostAdapter.prototype.getScriptSnapshot = function (fileName) { - // Shim the API changes for 1.5 release. This should be removed once - // TypeScript 1.5 has shipped. - if (this.files && this.files.indexOf(fileName) < 0) { - return undefined; - } - var scriptSnapshot = this.shimHost.getScriptSnapshot(fileName); - return scriptSnapshot && new ScriptSnapshotShimAdapter(scriptSnapshot); - }; - LanguageServiceShimHostAdapter.prototype.getScriptVersion = function (fileName) { - return this.shimHost.getScriptVersion(fileName); - }; - LanguageServiceShimHostAdapter.prototype.getLocalizedDiagnosticMessages = function () { - var diagnosticMessagesJson = this.shimHost.getLocalizedDiagnosticMessages(); - if (diagnosticMessagesJson == null || diagnosticMessagesJson == "") { - return null; - } - try { - return JSON.parse(diagnosticMessagesJson); - } - catch (e) { - this.log(e.description || "diagnosticMessages.generated.json has invalid JSON format"); - return null; - } - }; - LanguageServiceShimHostAdapter.prototype.getCancellationToken = function () { - return this.shimHost.getCancellationToken(); - }; - LanguageServiceShimHostAdapter.prototype.getCurrentDirectory = function () { - return this.shimHost.getCurrentDirectory(); - }; - LanguageServiceShimHostAdapter.prototype.getDefaultLibFileName = function (options) { - // Wrap the API changes for 1.5 release. This try/catch - // should be removed once TypeScript 1.5 has shipped. - try { - return this.shimHost.getDefaultLibFileName(JSON.stringify(options)); - } - catch (e) { - return ""; - } - }; - return LanguageServiceShimHostAdapter; - })(); - ts.LanguageServiceShimHostAdapter = LanguageServiceShimHostAdapter; - var CoreServicesShimHostAdapter = (function () { - function CoreServicesShimHostAdapter(shimHost) { - this.shimHost = shimHost; - } - CoreServicesShimHostAdapter.prototype.readDirectory = function (rootDir, extension) { - var encoded = this.shimHost.readDirectory(rootDir, extension); - return JSON.parse(encoded); - }; - return CoreServicesShimHostAdapter; - })(); - ts.CoreServicesShimHostAdapter = CoreServicesShimHostAdapter; - function simpleForwardCall(logger, actionDescription, action, logPerformance) { - if (logPerformance) { - logger.log(actionDescription); - var start = Date.now(); - } - var result = action(); - if (logPerformance) { - var end = Date.now(); - logger.log(actionDescription + " completed in " + (end - start) + " msec"); - if (typeof (result) === "string") { - var str = result; - if (str.length > 128) { - str = str.substring(0, 128) + "..."; - } - logger.log(" result.length=" + str.length + ", result='" + JSON.stringify(str) + "'"); - } - } - return result; - } - function forwardJSONCall(logger, actionDescription, action, logPerformance) { - try { - var result = simpleForwardCall(logger, actionDescription, action, logPerformance); - return JSON.stringify({ result: result }); - } - catch (err) { - if (err instanceof ts.OperationCanceledException) { - return JSON.stringify({ canceled: true }); - } - logInternalError(logger, err); - err.description = actionDescription; - return JSON.stringify({ error: err }); - } - } - var ShimBase = (function () { - function ShimBase(factory) { - this.factory = factory; - factory.registerShim(this); - } - ShimBase.prototype.dispose = function (dummy) { - this.factory.unregisterShim(this); - }; - return ShimBase; - })(); - function realizeDiagnostics(diagnostics, newLine) { - return diagnostics.map(function (d) { return realizeDiagnostic(d, newLine); }); - } - ts.realizeDiagnostics = realizeDiagnostics; - function realizeDiagnostic(diagnostic, newLine) { - return { - message: ts.flattenDiagnosticMessageText(diagnostic.messageText, newLine), - start: diagnostic.start, - length: diagnostic.length, - /// TODO: no need for the tolowerCase call - category: ts.DiagnosticCategory[diagnostic.category].toLowerCase(), - code: diagnostic.code - }; - } - var LanguageServiceShimObject = (function (_super) { - __extends(LanguageServiceShimObject, _super); - function LanguageServiceShimObject(factory, host, languageService) { - _super.call(this, factory); - this.host = host; - this.languageService = languageService; - this.logPerformance = false; - this.logger = this.host; - } - LanguageServiceShimObject.prototype.forwardJSONCall = function (actionDescription, action) { - return forwardJSONCall(this.logger, actionDescription, action, this.logPerformance); - }; - /// DISPOSE - /** - * Ensure (almost) deterministic release of internal Javascript resources when - * some external native objects holds onto us (e.g. Com/Interop). - */ - LanguageServiceShimObject.prototype.dispose = function (dummy) { - this.logger.log("dispose()"); - this.languageService.dispose(); - this.languageService = null; - // force a GC - if (debugObjectHost && debugObjectHost.CollectGarbage) { - debugObjectHost.CollectGarbage(); - this.logger.log("CollectGarbage()"); - } - this.logger = null; - _super.prototype.dispose.call(this, dummy); - }; - /// REFRESH - /** - * Update the list of scripts known to the compiler - */ - LanguageServiceShimObject.prototype.refresh = function (throwOnError) { - this.forwardJSONCall("refresh(" + throwOnError + ")", function () { - return null; - }); - }; - LanguageServiceShimObject.prototype.cleanupSemanticCache = function () { - var _this = this; - this.forwardJSONCall("cleanupSemanticCache()", function () { - _this.languageService.cleanupSemanticCache(); - return null; - }); - }; - LanguageServiceShimObject.prototype.realizeDiagnostics = function (diagnostics) { - var newLine = this.getNewLine(); - return ts.realizeDiagnostics(diagnostics, newLine); - }; - LanguageServiceShimObject.prototype.getSyntacticClassifications = function (fileName, start, length) { - var _this = this; - return this.forwardJSONCall("getSyntacticClassifications('" + fileName + "', " + start + ", " + length + ")", function () { - var classifications = _this.languageService.getSyntacticClassifications(fileName, ts.createTextSpan(start, length)); - return classifications; - }); - }; - LanguageServiceShimObject.prototype.getSemanticClassifications = function (fileName, start, length) { - var _this = this; - return this.forwardJSONCall("getSemanticClassifications('" + fileName + "', " + start + ", " + length + ")", function () { - var classifications = _this.languageService.getSemanticClassifications(fileName, ts.createTextSpan(start, length)); - return classifications; - }); - }; - LanguageServiceShimObject.prototype.getEncodedSyntacticClassifications = function (fileName, start, length) { - var _this = this; - return this.forwardJSONCall("getEncodedSyntacticClassifications('" + fileName + "', " + start + ", " + length + ")", function () { - // directly serialize the spans out to a string. This is much faster to decode - // on the managed side versus a full JSON array. - return convertClassifications(_this.languageService.getEncodedSyntacticClassifications(fileName, ts.createTextSpan(start, length))); - }); - }; - LanguageServiceShimObject.prototype.getEncodedSemanticClassifications = function (fileName, start, length) { - var _this = this; - return this.forwardJSONCall("getEncodedSemanticClassifications('" + fileName + "', " + start + ", " + length + ")", function () { - // directly serialize the spans out to a string. This is much faster to decode - // on the managed side versus a full JSON array. - return convertClassifications(_this.languageService.getEncodedSemanticClassifications(fileName, ts.createTextSpan(start, length))); - }); - }; - LanguageServiceShimObject.prototype.getNewLine = function () { - return this.host.getNewLine ? this.host.getNewLine() : "\r\n"; - }; - LanguageServiceShimObject.prototype.getSyntacticDiagnostics = function (fileName) { - var _this = this; - return this.forwardJSONCall("getSyntacticDiagnostics('" + fileName + "')", function () { - var diagnostics = _this.languageService.getSyntacticDiagnostics(fileName); - return _this.realizeDiagnostics(diagnostics); - }); - }; - LanguageServiceShimObject.prototype.getSemanticDiagnostics = function (fileName) { - var _this = this; - return this.forwardJSONCall("getSemanticDiagnostics('" + fileName + "')", function () { - var diagnostics = _this.languageService.getSemanticDiagnostics(fileName); - return _this.realizeDiagnostics(diagnostics); - }); - }; - LanguageServiceShimObject.prototype.getCompilerOptionsDiagnostics = function () { - var _this = this; - return this.forwardJSONCall("getCompilerOptionsDiagnostics()", function () { - var diagnostics = _this.languageService.getCompilerOptionsDiagnostics(); - return _this.realizeDiagnostics(diagnostics); - }); - }; - /// QUICKINFO - /** - * Computes a string representation of the type at the requested position - * in the active file. - */ - LanguageServiceShimObject.prototype.getQuickInfoAtPosition = function (fileName, position) { - var _this = this; - return this.forwardJSONCall("getQuickInfoAtPosition('" + fileName + "', " + position + ")", function () { - var quickInfo = _this.languageService.getQuickInfoAtPosition(fileName, position); - return quickInfo; - }); - }; - /// NAMEORDOTTEDNAMESPAN - /** - * Computes span information of the name or dotted name at the requested position - * in the active file. - */ - LanguageServiceShimObject.prototype.getNameOrDottedNameSpan = function (fileName, startPos, endPos) { - var _this = this; - return this.forwardJSONCall("getNameOrDottedNameSpan('" + fileName + "', " + startPos + ", " + endPos + ")", function () { - var spanInfo = _this.languageService.getNameOrDottedNameSpan(fileName, startPos, endPos); - return spanInfo; - }); - }; - /** - * STATEMENTSPAN - * Computes span information of statement at the requested position in the active file. - */ - LanguageServiceShimObject.prototype.getBreakpointStatementAtPosition = function (fileName, position) { - var _this = this; - return this.forwardJSONCall("getBreakpointStatementAtPosition('" + fileName + "', " + position + ")", function () { - var spanInfo = _this.languageService.getBreakpointStatementAtPosition(fileName, position); - return spanInfo; - }); - }; - /// SIGNATUREHELP - LanguageServiceShimObject.prototype.getSignatureHelpItems = function (fileName, position) { - var _this = this; - return this.forwardJSONCall("getSignatureHelpItems('" + fileName + "', " + position + ")", function () { - var signatureInfo = _this.languageService.getSignatureHelpItems(fileName, position); - return signatureInfo; - }); - }; - /// GOTO DEFINITION - /** - * Computes the definition location and file for the symbol - * at the requested position. - */ - LanguageServiceShimObject.prototype.getDefinitionAtPosition = function (fileName, position) { - var _this = this; - return this.forwardJSONCall("getDefinitionAtPosition('" + fileName + "', " + position + ")", function () { - return _this.languageService.getDefinitionAtPosition(fileName, position); - }); - }; - /// GOTO Type - /** - * Computes the definition location of the type of the symbol - * at the requested position. - */ - LanguageServiceShimObject.prototype.getTypeDefinitionAtPosition = function (fileName, position) { - var _this = this; - return this.forwardJSONCall("getTypeDefinitionAtPosition('" + fileName + "', " + position + ")", function () { - return _this.languageService.getTypeDefinitionAtPosition(fileName, position); - }); - }; - LanguageServiceShimObject.prototype.getRenameInfo = function (fileName, position) { - var _this = this; - return this.forwardJSONCall("getRenameInfo('" + fileName + "', " + position + ")", function () { - return _this.languageService.getRenameInfo(fileName, position); - }); - }; - LanguageServiceShimObject.prototype.findRenameLocations = function (fileName, position, findInStrings, findInComments) { - var _this = this; - return this.forwardJSONCall("findRenameLocations('" + fileName + "', " + position + ", " + findInStrings + ", " + findInComments + ")", function () { - return _this.languageService.findRenameLocations(fileName, position, findInStrings, findInComments); - }); - }; - /// GET BRACE MATCHING - LanguageServiceShimObject.prototype.getBraceMatchingAtPosition = function (fileName, position) { - var _this = this; - return this.forwardJSONCall("getBraceMatchingAtPosition('" + fileName + "', " + position + ")", function () { - var textRanges = _this.languageService.getBraceMatchingAtPosition(fileName, position); - return textRanges; - }); - }; - /// GET SMART INDENT - LanguageServiceShimObject.prototype.getIndentationAtPosition = function (fileName, position, options /*Services.EditorOptions*/) { - var _this = this; - return this.forwardJSONCall("getIndentationAtPosition('" + fileName + "', " + position + ")", function () { - var localOptions = JSON.parse(options); - return _this.languageService.getIndentationAtPosition(fileName, position, localOptions); - }); - }; - /// GET REFERENCES - LanguageServiceShimObject.prototype.getReferencesAtPosition = function (fileName, position) { - var _this = this; - return this.forwardJSONCall("getReferencesAtPosition('" + fileName + "', " + position + ")", function () { - return _this.languageService.getReferencesAtPosition(fileName, position); - }); - }; - LanguageServiceShimObject.prototype.findReferences = function (fileName, position) { - var _this = this; - return this.forwardJSONCall("findReferences('" + fileName + "', " + position + ")", function () { - return _this.languageService.findReferences(fileName, position); - }); - }; - LanguageServiceShimObject.prototype.getOccurrencesAtPosition = function (fileName, position) { - var _this = this; - return this.forwardJSONCall("getOccurrencesAtPosition('" + fileName + "', " + position + ")", function () { - return _this.languageService.getOccurrencesAtPosition(fileName, position); - }); - }; - LanguageServiceShimObject.prototype.getDocumentHighlights = function (fileName, position, filesToSearch) { - var _this = this; - return this.forwardJSONCall("getDocumentHighlights('" + fileName + "', " + position + ")", function () { - return _this.languageService.getDocumentHighlights(fileName, position, JSON.parse(filesToSearch)); - }); - }; - /// COMPLETION LISTS - /** - * Get a string based representation of the completions - * to provide at the given source position and providing a member completion - * list if requested. - */ - LanguageServiceShimObject.prototype.getCompletionsAtPosition = function (fileName, position) { - var _this = this; - return this.forwardJSONCall("getCompletionsAtPosition('" + fileName + "', " + position + ")", function () { - var completion = _this.languageService.getCompletionsAtPosition(fileName, position); - return completion; - }); - }; - /** Get a string based representation of a completion list entry details */ - LanguageServiceShimObject.prototype.getCompletionEntryDetails = function (fileName, position, entryName) { - var _this = this; - return this.forwardJSONCall("getCompletionEntryDetails('" + fileName + "', " + position + ", " + entryName + ")", function () { - var details = _this.languageService.getCompletionEntryDetails(fileName, position, entryName); - return details; - }); - }; - LanguageServiceShimObject.prototype.getFormattingEditsForRange = function (fileName, start, end, options /*Services.FormatCodeOptions*/) { - var _this = this; - return this.forwardJSONCall("getFormattingEditsForRange('" + fileName + "', " + start + ", " + end + ")", function () { - var localOptions = JSON.parse(options); - var edits = _this.languageService.getFormattingEditsForRange(fileName, start, end, localOptions); - return edits; - }); - }; - LanguageServiceShimObject.prototype.getFormattingEditsForDocument = function (fileName, options /*Services.FormatCodeOptions*/) { - var _this = this; - return this.forwardJSONCall("getFormattingEditsForDocument('" + fileName + "')", function () { - var localOptions = JSON.parse(options); - var edits = _this.languageService.getFormattingEditsForDocument(fileName, localOptions); - return edits; - }); - }; - LanguageServiceShimObject.prototype.getFormattingEditsAfterKeystroke = function (fileName, position, key, options /*Services.FormatCodeOptions*/) { - var _this = this; - return this.forwardJSONCall("getFormattingEditsAfterKeystroke('" + fileName + "', " + position + ", '" + key + "')", function () { - var localOptions = JSON.parse(options); - var edits = _this.languageService.getFormattingEditsAfterKeystroke(fileName, position, key, localOptions); - return edits; - }); - }; - /// NAVIGATE TO - /** Return a list of symbols that are interesting to navigate to */ - LanguageServiceShimObject.prototype.getNavigateToItems = function (searchValue, maxResultCount) { - var _this = this; - return this.forwardJSONCall("getNavigateToItems('" + searchValue + "', " + maxResultCount + ")", function () { - var items = _this.languageService.getNavigateToItems(searchValue, maxResultCount); - return items; - }); - }; - LanguageServiceShimObject.prototype.getNavigationBarItems = function (fileName) { - var _this = this; - return this.forwardJSONCall("getNavigationBarItems('" + fileName + "')", function () { - var items = _this.languageService.getNavigationBarItems(fileName); - return items; - }); - }; - LanguageServiceShimObject.prototype.getOutliningSpans = function (fileName) { - var _this = this; - return this.forwardJSONCall("getOutliningSpans('" + fileName + "')", function () { - var items = _this.languageService.getOutliningSpans(fileName); - return items; - }); - }; - LanguageServiceShimObject.prototype.getTodoComments = function (fileName, descriptors) { - var _this = this; - return this.forwardJSONCall("getTodoComments('" + fileName + "')", function () { - var items = _this.languageService.getTodoComments(fileName, JSON.parse(descriptors)); - return items; - }); - }; - /// Emit - LanguageServiceShimObject.prototype.getEmitOutput = function (fileName) { - var _this = this; - return this.forwardJSONCall("getEmitOutput('" + fileName + "')", function () { - var output = _this.languageService.getEmitOutput(fileName); - // Shim the API changes for 1.5 release. This should be removed once - // TypeScript 1.5 has shipped. - output.emitOutputStatus = output.emitSkipped ? 1 : 0; - return output; - }); - }; - return LanguageServiceShimObject; - })(ShimBase); - function convertClassifications(classifications) { - return { spans: classifications.spans.join(","), endOfLineState: classifications.endOfLineState }; - } - var ClassifierShimObject = (function (_super) { - __extends(ClassifierShimObject, _super); - function ClassifierShimObject(factory, logger) { - _super.call(this, factory); - this.logger = logger; - this.logPerformance = false; - this.classifier = ts.createClassifier(); - } - ClassifierShimObject.prototype.getEncodedLexicalClassifications = function (text, lexState, syntacticClassifierAbsent) { - var _this = this; - return forwardJSONCall(this.logger, "getEncodedLexicalClassifications", function () { return convertClassifications(_this.classifier.getEncodedLexicalClassifications(text, lexState, syntacticClassifierAbsent)); }, this.logPerformance); - }; - /// COLORIZATION - ClassifierShimObject.prototype.getClassificationsForLine = function (text, lexState, classifyKeywordsInGenerics) { - var classification = this.classifier.getClassificationsForLine(text, lexState, classifyKeywordsInGenerics); - var items = classification.entries; - var result = ""; - for (var i = 0; i < items.length; i++) { - result += items[i].length + "\n"; - result += items[i].classification + "\n"; - } - result += classification.finalLexState; - return result; - }; - return ClassifierShimObject; - })(ShimBase); - var CoreServicesShimObject = (function (_super) { - __extends(CoreServicesShimObject, _super); - function CoreServicesShimObject(factory, logger, host) { - _super.call(this, factory); - this.logger = logger; - this.host = host; - this.logPerformance = false; - } - CoreServicesShimObject.prototype.forwardJSONCall = function (actionDescription, action) { - return forwardJSONCall(this.logger, actionDescription, action, this.logPerformance); - }; - CoreServicesShimObject.prototype.getPreProcessedFileInfo = function (fileName, sourceTextSnapshot) { - return this.forwardJSONCall("getPreProcessedFileInfo('" + fileName + "')", function () { - var result = ts.preProcessFile(sourceTextSnapshot.getText(0, sourceTextSnapshot.getLength())); - var convertResult = { - referencedFiles: [], - importedFiles: [], - isLibFile: result.isLibFile - }; - ts.forEach(result.referencedFiles, function (refFile) { - convertResult.referencedFiles.push({ - path: ts.normalizePath(refFile.fileName), - position: refFile.pos, - length: refFile.end - refFile.pos - }); - }); - ts.forEach(result.importedFiles, function (importedFile) { - convertResult.importedFiles.push({ - path: ts.normalizeSlashes(importedFile.fileName), - position: importedFile.pos, - length: importedFile.end - importedFile.pos - }); - }); - return convertResult; - }); - }; - CoreServicesShimObject.prototype.getTSConfigFileInfo = function (fileName, sourceTextSnapshot) { - var _this = this; - return this.forwardJSONCall("getTSConfigFileInfo('" + fileName + "')", function () { - var text = sourceTextSnapshot.getText(0, sourceTextSnapshot.getLength()); - var result = ts.parseConfigFileText(fileName, text); - if (result.error) { - return { - options: {}, - files: [], - errors: [realizeDiagnostic(result.error, '\r\n')] - }; - } - var configFile = ts.parseConfigFile(result.config, _this.host, ts.getDirectoryPath(ts.normalizeSlashes(fileName))); - return { - options: configFile.options, - files: configFile.fileNames, - errors: realizeDiagnostics(configFile.errors, '\r\n') - }; - }); - }; - CoreServicesShimObject.prototype.getDefaultCompilationSettings = function () { - return this.forwardJSONCall("getDefaultCompilationSettings()", function () { - return ts.getDefaultCompilerOptions(); - }); - }; - return CoreServicesShimObject; - })(ShimBase); - var TypeScriptServicesFactory = (function () { - function TypeScriptServicesFactory() { - this._shims = []; - } - /* - * Returns script API version. - */ - TypeScriptServicesFactory.prototype.getServicesVersion = function () { - return ts.servicesVersion; - }; - TypeScriptServicesFactory.prototype.createLanguageServiceShim = function (host) { - try { - if (this.documentRegistry === undefined) { - this.documentRegistry = ts.createDocumentRegistry(host.useCaseSensitiveFileNames && host.useCaseSensitiveFileNames()); - } - var hostAdapter = new LanguageServiceShimHostAdapter(host); - var languageService = ts.createLanguageService(hostAdapter, this.documentRegistry); - return new LanguageServiceShimObject(this, host, languageService); - } - catch (err) { - logInternalError(host, err); - throw err; - } - }; - TypeScriptServicesFactory.prototype.createClassifierShim = function (logger) { - try { - return new ClassifierShimObject(this, logger); - } - catch (err) { - logInternalError(logger, err); - throw err; - } - }; - TypeScriptServicesFactory.prototype.createCoreServicesShim = function (host) { - try { - var adapter = new CoreServicesShimHostAdapter(host); - return new CoreServicesShimObject(this, host, adapter); - } - catch (err) { - logInternalError(host, err); - throw err; - } - }; - TypeScriptServicesFactory.prototype.close = function () { - // Forget all the registered shims - this._shims = []; - this.documentRegistry = ts.createDocumentRegistry(); - }; - TypeScriptServicesFactory.prototype.registerShim = function (shim) { - this._shims.push(shim); - }; - TypeScriptServicesFactory.prototype.unregisterShim = function (shim) { - for (var i = 0, n = this._shims.length; i < n; i++) { - if (this._shims[i] === shim) { - delete this._shims[i]; - return; - } - } - throw new Error("Invalid operation"); - }; - return TypeScriptServicesFactory; - })(); - ts.TypeScriptServicesFactory = TypeScriptServicesFactory; - if (typeof module !== "undefined" && module.exports) { - module.exports = ts; - } -})(ts || (ts = {})); -/// TODO: this is used by VS, clean this up on both sides of the interface -/* @internal */ -var TypeScript; -(function (TypeScript) { - var Services; - (function (Services) { - Services.TypeScriptServicesFactory = ts.TypeScriptServicesFactory; - })(Services = TypeScript.Services || (TypeScript.Services = {})); -})(TypeScript || (TypeScript = {})); -/* @internal */ -var toolsVersion = "1.5"; -module.exports = ts; \ No newline at end of file diff --git a/build/lib/typings/gulp-uglify.d.ts b/build/lib/typings/gulp-uglify.d.ts deleted file mode 100644 index 2e5f41e80be6851b209e31542c0352d2baa9281d..0000000000000000000000000000000000000000 --- a/build/lib/typings/gulp-uglify.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -// Type definitions for gulp-uglify -// Project: https://github.com/terinjokes/gulp-uglify -// Definitions by: Christopher Haws -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare module "gulp-uglify" { - import * as UglifyJS from 'uglify-js'; - - namespace GulpUglify { - interface Options { - /** - * Pass false to skip mangling names. - */ - mangle?: boolean; - - /** - * Pass if you wish to specify additional output options. The defaults are optimized for best compression. - */ - output?: UglifyJS.BeautifierOptions; - - /** - * Pass an object to specify custom compressor options. Pass false to skip compression completely. - */ - compress?: UglifyJS.CompressorOptions | boolean; - - /** - * A convenience option for options.output.comments. Defaults to preserving no comments. - * all - Preserve all comments in code blocks - * some - Preserve comments that start with a bang (!) or include a Closure Compiler directive (@preserve, @license, @cc_on) - * function - Specify your own comment preservation function. You will be passed the current node and the current comment and are expected to return either true or false. - */ - preserveComments?: string | ((node: any, comment: UglifyJS.Tokenizer) => boolean); - - warnings?: boolean; - } - - class GulpUglifyError { - cause: { - filename: string; - }; - } - } - - function GulpUglify(options?: GulpUglify.Options): NodeJS.ReadWriteStream; - - export = GulpUglify; -} \ No newline at end of file diff --git a/build/lib/typings/uglify-js.d.ts b/build/lib/typings/uglify-js.d.ts deleted file mode 100644 index 9ee5da6a4fdcdb840e8958e12f3c60f897ada925..0000000000000000000000000000000000000000 --- a/build/lib/typings/uglify-js.d.ts +++ /dev/null @@ -1,428 +0,0 @@ -// Type definitions for UglifyJS 2 v2.6.1 -// Project: https://github.com/mishoo/UglifyJS2 -// Definitions by: Tanguy Krotoff -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare module 'uglify-js' { - import * as MOZ_SourceMap from 'source-map'; - - namespace UglifyJS { - interface Tokenizer { - /** - * The type of this token. - * Can be "num", "string", "regexp", "operator", "punc", "atom", "name", "keyword", "comment1" or "comment2". - * "comment1" and "comment2" are for single-line, respectively multi-line comments. - */ - type: string; - - /** - * The name of the file where this token originated from. Useful when compressing multiple files at once to generate the proper source map. - */ - file: string; - - /** - * The "value" of the token. - * That's additional information and depends on the token type: "num", "string" and "regexp" tokens you get their literal value. - * - For "operator" you get the operator. - * - For "punc" it's the punctuation sign (parens, comma, semicolon etc). - * - For "atom", "name" and "keyword" it's the name of the identifier - * - For comments it's the body of the comment (excluding the initial "//" and "/*". - */ - value: string; - - /** - * The line number of this token in the original code. - * 1-based index. - */ - line: number; - - /** - * The column number of this token in the original code. - * 0-based index. - */ - col: number; - - /** - * Short for "newline before", it's a boolean that tells us whether there was a newline before this node in the original source. It helps for automatic semicolon insertion. - * For multi-line comments in particular this will be set to true if there either was a newline before this comment, or * * if this comment contains a newline. - */ - nlb: boolean; - - /** - * This doesn't apply for comment tokens, but for all other token types it will be an array of comment tokens that were found before. - */ - comments_before: string[]; - } - - interface AST_Node { - // The first token of this node - start: AST_Node; - - // The last token of this node - end: AST_Node; - - transform(tt: TreeTransformer): AST_Toplevel; - } - - interface AST_Toplevel extends AST_Node { - // UglifyJS contains a scope analyzer which figures out variable/function definitions, references etc. - // You need to call it manually before compression or mangling. - // The figure_out_scope method is defined only on the AST_Toplevel node. - figure_out_scope(): void; - - // Get names that are optimized for GZip compression (names will be generated using the most frequent characters first) - compute_char_frequency(): void; - - mangle_names(): void; - - print(stream: OutputStream): void; - - print_to_string(options?: BeautifierOptions): string; - } - - interface MinifyOptions { - spidermonkey?: boolean; - outSourceMap?: string; - sourceRoot?: string; - inSourceMap?: string; - fromString?: boolean; - warnings?: boolean; - mangle?: Object; - output?: MinifyOutput, - compress?: Object; - } - - interface MinifyOutput { - code: string; - map: string; - } - - function minify(files: string | Array, options?: MinifyOptions): MinifyOutput; - - - interface ParseOptions { - // Default is false - strict?: boolean; - - // Input file name, default is null - filename?: string; - - // Default is null - toplevel?: AST_Toplevel; - } - - /** - * The parser creates a custom abstract syntax tree given a piece of JavaScript code. - * Perhaps you should read about the AST first. - */ - function parse(code: string, options?: ParseOptions): AST_Toplevel; - - - interface BeautifierOptions { - /** - * Start indentation on every line (only when `beautify`) - */ - indent_start?: number; - - /** - * Indentation level (only when `beautify`) - */ - indent_level?: number; - - /** - * Quote all keys in object literals? - */ - quote_keys?: boolean; - - /** - * Add a space after colon signs? - */ - space_colon?: boolean; - - /** - * Output ASCII-safe? (encodes Unicode characters as ASCII) - */ - ascii_only?: boolean; - - /** - * Escape " boolean; - - /** - * UglifyJS provides a TreeWalker object and every node has a walk method that given a walker will apply your visitor to each node in the tree. - * Your visitor can return a non-falsy value in order to prevent descending the current node. - */ - function TreeWalker(visitor: visitor): TreeWalker; - - - // TODO - interface TreeTransformer extends TreeWalker { - } - - /** - * The tree transformer is a special case of a tree walker. - * In fact it even inherits from TreeWalker and you can use the same methods, but initialization and visitor protocol are a bit different. - */ - function TreeTransformer(before: visitor, after: visitor): TreeTransformer; - } - - export = UglifyJS; -} \ No newline at end of file diff --git a/build/lib/watch/package-lock.json b/build/lib/watch/package-lock.json new file mode 100644 index 0000000000000000000000000000000000000000..95d9999ea510785ca814f68840ceebf3451ff117 --- /dev/null +++ b/build/lib/watch/package-lock.json @@ -0,0 +1,1431 @@ +{ + "name": "watch", + "version": "1.0.0", + "lockfileVersion": 1, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "anymatch": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.0.tgz", + "integrity": "sha1-o+Uvo5FoyCX/V7AkgSbOWo/5VQc=", + "dev": true + }, + "arr-diff": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", + "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", + "dev": true + }, + "arr-flatten": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.0.3.tgz", + "integrity": "sha1-onTthawIhJtr14R8RYB0XcUa37E=", + "dev": true + }, + "array-differ": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-1.0.0.tgz", + "integrity": "sha1-7/UuN1gknTO+QCuLuOVkuytdQDE=", + "dev": true + }, + "array-uniq": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", + "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", + "dev": true + }, + "array-unique": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", + "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", + "dev": true + }, + "arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "dev": true + }, + "async-each": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz", + "integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=", + "dev": true + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "beeper": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/beeper/-/beeper-1.1.1.tgz", + "integrity": "sha1-5tXqjF2tABMEpwsiY4RH9pyy+Ak=", + "dev": true + }, + "binary-extensions": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.8.0.tgz", + "integrity": "sha1-SOyNFt9Dd+rl+liEaCSAr02Vx3Q=", + "dev": true + }, + "brace-expansion": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz", + "integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=", + "dev": true + }, + "braces": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", + "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true + }, + "chokidar": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.7.0.tgz", + "integrity": "sha1-eY5ol3gVHIB2tLNg5e3SjNortGg=", + "dev": true, + "dependencies": { + "glob-parent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", + "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", + "dev": true + } + } + }, + "clone": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.2.tgz", + "integrity": "sha1-Jgt6meux7f4kdTgXX3gyQ8sZ0Uk=", + "dev": true + }, + "clone-stats": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-0.0.1.tgz", + "integrity": "sha1-uI+UqCzzi4eR1YBG6kAprYjKmdE=", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "dateformat": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-2.0.0.tgz", + "integrity": "sha1-J0Pjq7XD/CRi5SfcpEXgTp9N7hc=", + "dev": true + }, + "duplexer2": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.0.2.tgz", + "integrity": "sha1-xhTc9n4vsUmVqRcR5aYX6KYKMds=", + "dev": true, + "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, + "readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "dev": true + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true + } + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "expand-brackets": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", + "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", + "dev": true + }, + "expand-range": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", + "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", + "dev": true + }, + "extglob": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", + "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", + "dev": true + }, + "fancy-log": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/fancy-log/-/fancy-log-1.3.0.tgz", + "integrity": "sha1-Rb4X0Cu5kX1gzP/UmVyZnmyMmUg=", + "dev": true + }, + "filename-regex": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", + "integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=", + "dev": true + }, + "fill-range": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.3.tgz", + "integrity": "sha1-ULd9/X5Gm8dJJHCWNpn+eoSFpyM=", + "dev": true + }, + "first-chunk-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/first-chunk-stream/-/first-chunk-stream-2.0.0.tgz", + "integrity": "sha1-G97NuOCDwGZLkZRVgVd6Q6nzHXA=", + "dev": true + }, + "for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "dev": true + }, + "for-own": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", + "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", + "dev": true + }, + "fsevents": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.1.2.tgz", + "integrity": "sha512-Sn44E5wQW4bTHXvQmvSHwqbuiXtduD6Rrjm2ZtUEGbyrig+nUH3t/QD4M4/ZXViY556TBpRgZkHLDx3JxPwxiw==", + "dev": true, + "optional": true, + "dependencies": { + "abbrev": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "optional": true + }, + "ajv": { + "version": "4.11.8", + "bundled": true, + "dev": true, + "optional": true + }, + "ansi-regex": { + "version": "2.1.1", + "bundled": true, + "dev": true + }, + "aproba": { + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "are-we-there-yet": { + "version": "1.1.4", + "bundled": true, + "dev": true, + "optional": true + }, + "asn1": { + "version": "0.2.3", + "bundled": true, + "dev": true, + "optional": true + }, + "assert-plus": { + "version": "0.2.0", + "bundled": true, + "dev": true, + "optional": true + }, + "asynckit": { + "version": "0.4.0", + "bundled": true, + "dev": true, + "optional": true + }, + "aws-sign2": { + "version": "0.6.0", + "bundled": true, + "dev": true, + "optional": true + }, + "aws4": { + "version": "1.6.0", + "bundled": true, + "dev": true, + "optional": true + }, + "balanced-match": { + "version": "0.4.2", + "bundled": true, + "dev": true + }, + "bcrypt-pbkdf": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "block-stream": { + "version": "0.0.9", + "bundled": true, + "dev": true + }, + "boom": { + "version": "2.10.1", + "bundled": true, + "dev": true + }, + "brace-expansion": { + "version": "1.1.7", + "bundled": true, + "dev": true + }, + "buffer-shims": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "caseless": { + "version": "0.12.0", + "bundled": true, + "dev": true, + "optional": true + }, + "co": { + "version": "4.6.0", + "bundled": true, + "dev": true, + "optional": true + }, + "code-point-at": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, + "combined-stream": { + "version": "1.0.5", + "bundled": true, + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "bundled": true, + "dev": true + }, + "console-control-strings": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, + "core-util-is": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "cryptiles": { + "version": "2.0.5", + "bundled": true, + "dev": true, + "optional": true + }, + "dashdash": { + "version": "1.14.1", + "bundled": true, + "dev": true, + "optional": true, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "debug": { + "version": "2.6.8", + "bundled": true, + "dev": true, + "optional": true + }, + "deep-extend": { + "version": "0.4.2", + "bundled": true, + "dev": true, + "optional": true + }, + "delayed-stream": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "delegates": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "ecc-jsbn": { + "version": "0.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "extend": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "extsprintf": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "forever-agent": { + "version": "0.6.1", + "bundled": true, + "dev": true, + "optional": true + }, + "form-data": { + "version": "2.1.4", + "bundled": true, + "dev": true, + "optional": true + }, + "fs.realpath": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "fstream": { + "version": "1.0.11", + "bundled": true, + "dev": true + }, + "fstream-ignore": { + "version": "1.0.5", + "bundled": true, + "dev": true, + "optional": true + }, + "gauge": { + "version": "2.7.4", + "bundled": true, + "dev": true, + "optional": true + }, + "getpass": { + "version": "0.1.7", + "bundled": true, + "dev": true, + "optional": true, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "glob": { + "version": "7.1.2", + "bundled": true, + "dev": true + }, + "graceful-fs": { + "version": "4.1.11", + "bundled": true, + "dev": true + }, + "har-schema": { + "version": "1.0.5", + "bundled": true, + "dev": true, + "optional": true + }, + "har-validator": { + "version": "4.2.1", + "bundled": true, + "dev": true, + "optional": true + }, + "has-unicode": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "hawk": { + "version": "3.1.3", + "bundled": true, + "dev": true, + "optional": true + }, + "hoek": { + "version": "2.16.3", + "bundled": true, + "dev": true + }, + "http-signature": { + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "inflight": { + "version": "1.0.6", + "bundled": true, + "dev": true + }, + "inherits": { + "version": "2.0.3", + "bundled": true, + "dev": true + }, + "ini": { + "version": "1.3.4", + "bundled": true, + "dev": true, + "optional": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "is-typedarray": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "isarray": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "isstream": { + "version": "0.1.2", + "bundled": true, + "dev": true, + "optional": true + }, + "jodid25519": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "jsbn": { + "version": "0.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "json-schema": { + "version": "0.2.3", + "bundled": true, + "dev": true, + "optional": true + }, + "json-stable-stringify": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "json-stringify-safe": { + "version": "5.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "jsonify": { + "version": "0.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "jsprim": { + "version": "1.4.0", + "bundled": true, + "dev": true, + "optional": true, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "mime-db": { + "version": "1.27.0", + "bundled": true, + "dev": true + }, + "mime-types": { + "version": "2.1.15", + "bundled": true, + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "bundled": true, + "dev": true + }, + "minimist": { + "version": "0.0.8", + "bundled": true, + "dev": true + }, + "mkdirp": { + "version": "0.5.1", + "bundled": true, + "dev": true + }, + "ms": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "node-pre-gyp": { + "version": "0.6.36", + "bundled": true, + "dev": true, + "optional": true + }, + "nopt": { + "version": "4.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "npmlog": { + "version": "4.1.0", + "bundled": true, + "dev": true, + "optional": true + }, + "number-is-nan": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "oauth-sign": { + "version": "0.8.2", + "bundled": true, + "dev": true, + "optional": true + }, + "object-assign": { + "version": "4.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "once": { + "version": "1.4.0", + "bundled": true, + "dev": true + }, + "os-homedir": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "os-tmpdir": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "osenv": { + "version": "0.1.4", + "bundled": true, + "dev": true, + "optional": true + }, + "path-is-absolute": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "performance-now": { + "version": "0.2.0", + "bundled": true, + "dev": true, + "optional": true + }, + "process-nextick-args": { + "version": "1.0.7", + "bundled": true, + "dev": true + }, + "punycode": { + "version": "1.4.1", + "bundled": true, + "dev": true, + "optional": true + }, + "qs": { + "version": "6.4.0", + "bundled": true, + "dev": true, + "optional": true + }, + "rc": { + "version": "1.2.1", + "bundled": true, + "dev": true, + "optional": true, + "dependencies": { + "minimist": { + "version": "1.2.0", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "readable-stream": { + "version": "2.2.9", + "bundled": true, + "dev": true + }, + "request": { + "version": "2.81.0", + "bundled": true, + "dev": true, + "optional": true + }, + "rimraf": { + "version": "2.6.1", + "bundled": true, + "dev": true + }, + "safe-buffer": { + "version": "5.0.1", + "bundled": true, + "dev": true + }, + "semver": { + "version": "5.3.0", + "bundled": true, + "dev": true, + "optional": true + }, + "set-blocking": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "signal-exit": { + "version": "3.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "sntp": { + "version": "1.0.9", + "bundled": true, + "dev": true, + "optional": true + }, + "sshpk": { + "version": "1.13.0", + "bundled": true, + "dev": true, + "optional": true, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "string_decoder": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "string-width": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "stringstream": { + "version": "0.0.5", + "bundled": true, + "dev": true, + "optional": true + }, + "strip-ansi": { + "version": "3.0.1", + "bundled": true, + "dev": true + }, + "strip-json-comments": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "tar": { + "version": "2.2.1", + "bundled": true, + "dev": true + }, + "tar-pack": { + "version": "3.4.0", + "bundled": true, + "dev": true, + "optional": true + }, + "tough-cookie": { + "version": "2.3.2", + "bundled": true, + "dev": true, + "optional": true + }, + "tunnel-agent": { + "version": "0.6.0", + "bundled": true, + "dev": true, + "optional": true + }, + "tweetnacl": { + "version": "0.14.5", + "bundled": true, + "dev": true, + "optional": true + }, + "uid-number": { + "version": "0.0.6", + "bundled": true, + "dev": true, + "optional": true + }, + "util-deprecate": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "uuid": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "verror": { + "version": "1.3.6", + "bundled": true, + "dev": true, + "optional": true + }, + "wide-align": { + "version": "1.1.2", + "bundled": true, + "dev": true, + "optional": true + }, + "wrappy": { + "version": "1.0.2", + "bundled": true, + "dev": true + } + } + }, + "glob-base": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", + "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", + "dev": true, + "dependencies": { + "glob-parent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", + "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", + "dev": true + } + } + }, + "glob-parent": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", + "dev": true, + "dependencies": { + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "dev": true + } + } + }, + "glogg": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/glogg/-/glogg-1.0.0.tgz", + "integrity": "sha1-f+DxmfV6yQbPUS/urY+Q7kooT8U=", + "dev": true + }, + "graceful-fs": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", + "dev": true + }, + "gulp-util": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/gulp-util/-/gulp-util-3.0.8.tgz", + "integrity": "sha1-AFTh50RQLifATBh8PsxQXdVLu08=", + "dev": true, + "dependencies": { + "object-assign": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-3.0.0.tgz", + "integrity": "sha1-m+3VygiXlJvKR+f/QIBi1Un1h/I=", + "dev": true + }, + "vinyl": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-0.5.3.tgz", + "integrity": "sha1-sEVbOPxeDPMNQyUTLkYZcMIJHN4=", + "dev": true + } + } + }, + "gulp-watch": { + "version": "4.3.11", + "resolved": "https://registry.npmjs.org/gulp-watch/-/gulp-watch-4.3.11.tgz", + "integrity": "sha1-Fi/FY96fx3DpH5p845VVE6mhGMA=", + "dev": true + }, + "gulplog": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/gulplog/-/gulplog-1.0.0.tgz", + "integrity": "sha1-4oxNRdBey77YGDY86PnFkmIp/+U=", + "dev": true + }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "dev": true + }, + "has-gulplog": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/has-gulplog/-/has-gulplog-0.1.0.tgz", + "integrity": "sha1-ZBTIKRNpfaUVkDl9r7EvIpZ4Ec4=", + "dev": true + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, + "is-binary-path": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", + "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", + "dev": true + }, + "is-buffer": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.5.tgz", + "integrity": "sha1-Hzsm72E7IUuIy8ojzGwB2Hlh7sw=", + "dev": true + }, + "is-dotfile": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", + "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=", + "dev": true + }, + "is-equal-shallow": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", + "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", + "dev": true + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true + }, + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "dev": true + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "dev": true + }, + "is-number": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", + "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", + "dev": true + }, + "is-posix-bracket": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", + "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=", + "dev": true + }, + "is-primitive": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", + "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=", + "dev": true + }, + "is-utf8": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", + "dev": true + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true + }, + "lodash._basecopy": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz", + "integrity": "sha1-jaDmqHbPNEwK2KVIghEd08XHyjY=", + "dev": true + }, + "lodash._basetostring": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/lodash._basetostring/-/lodash._basetostring-3.0.1.tgz", + "integrity": "sha1-0YYdh3+CSlL2aYMtyvPuFVZqB9U=", + "dev": true + }, + "lodash._basevalues": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lodash._basevalues/-/lodash._basevalues-3.0.0.tgz", + "integrity": "sha1-W3dXYoAr3j0yl1A+JjAIIP32Ybc=", + "dev": true + }, + "lodash._getnative": { + "version": "3.9.1", + "resolved": "https://registry.npmjs.org/lodash._getnative/-/lodash._getnative-3.9.1.tgz", + "integrity": "sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U=", + "dev": true + }, + "lodash._isiterateecall": { + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz", + "integrity": "sha1-UgOte6Ql+uhCRg5pbbnPPmqsBXw=", + "dev": true + }, + "lodash._reescape": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lodash._reescape/-/lodash._reescape-3.0.0.tgz", + "integrity": "sha1-Kx1vXf4HyKNVdT5fJ/rH8c3hYWo=", + "dev": true + }, + "lodash._reevaluate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lodash._reevaluate/-/lodash._reevaluate-3.0.0.tgz", + "integrity": "sha1-WLx0xAZklTrgsSTYBpltrKQx4u0=", + "dev": true + }, + "lodash._reinterpolate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz", + "integrity": "sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0=", + "dev": true + }, + "lodash._root": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/lodash._root/-/lodash._root-3.0.1.tgz", + "integrity": "sha1-+6HEUkwZ7ppfgTa0YJ8BfPTe1pI=", + "dev": true + }, + "lodash.escape": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/lodash.escape/-/lodash.escape-3.2.0.tgz", + "integrity": "sha1-mV7g3BjBtIzJLv+ucaEKq1tIdpg=", + "dev": true + }, + "lodash.isarguments": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", + "integrity": "sha1-L1c9hcaiQon/AGY7SRwdM4/zRYo=", + "dev": true + }, + "lodash.isarray": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/lodash.isarray/-/lodash.isarray-3.0.4.tgz", + "integrity": "sha1-eeTriMNqgSKvhvhEqpvNhRtfu1U=", + "dev": true + }, + "lodash.keys": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-3.1.2.tgz", + "integrity": "sha1-TbwEcrFWvlCgsoaFXRvQsMZWCYo=", + "dev": true + }, + "lodash.restparam": { + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/lodash.restparam/-/lodash.restparam-3.6.1.tgz", + "integrity": "sha1-k2pOMJ7zMKdkXtQUWYbIWuWyCAU=", + "dev": true + }, + "lodash.template": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-3.6.2.tgz", + "integrity": "sha1-+M3sxhaaJVvpCYrosMU9N4kx0U8=", + "dev": true + }, + "lodash.templatesettings": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-3.1.1.tgz", + "integrity": "sha1-+zB4RHU7Zrnxr6VOJix0UwfbqOU=", + "dev": true + }, + "micromatch": { + "version": "2.3.11", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", + "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true + }, + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + }, + "multipipe": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/multipipe/-/multipipe-0.1.2.tgz", + "integrity": "sha1-Ko8t33Du1WTf8tV/HhoTfZ8FB4s=", + "dev": true + }, + "nan": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.6.2.tgz", + "integrity": "sha1-5P805slf37WuzAjeZZb0NgWn20U=", + "dev": true, + "optional": true + }, + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + }, + "object.omit": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", + "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", + "dev": true + }, + "parse-glob": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", + "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", + "dev": true + }, + "path-dirname": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", + "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", + "dev": true + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "dev": true + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "dev": true + }, + "preserve": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", + "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=", + "dev": true + }, + "process-nextick-args": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", + "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=", + "dev": true + }, + "randomatic": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.7.tgz", + "integrity": "sha512-D5JUjPyJbaJDkuAazpVnSfVkLlpeO3wDlPROTMLGKG1zMFNFRgrciKo1ltz/AzNTkqE0HzDx655QOL51N06how==", + "dev": true, + "dependencies": { + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true + } + } + }, + "kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "dev": true + } + } + }, + "readable-stream": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.0.tgz", + "integrity": "sha512-c7KMXGd4b48nN3OJ1U9qOsn6pXNzf6kLd3kdZCkg2sxAcoiufInqF0XckwEnlrcwuaYwonlNK8GQUIOC/WC7sg==", + "dev": true + }, + "readdirp": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.1.0.tgz", + "integrity": "sha1-TtCtBg3zBzMAxIRANz9y0cxkLXg=", + "dev": true + }, + "regex-cache": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.3.tgz", + "integrity": "sha1-mxpsNdTQ3871cRrmUejp09cRQUU=", + "dev": true + }, + "remove-trailing-separator": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.0.2.tgz", + "integrity": "sha1-abBi2XhyetFNxrVrpKt3L9jXBRE=", + "dev": true + }, + "repeat-element": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz", + "integrity": "sha1-7wiaF40Ug7quTZPrmLT55OEdmQo=", + "dev": true + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true + }, + "replace-ext": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-0.0.1.tgz", + "integrity": "sha1-KbvZIHinOfC8zitO5B6DeVNSKSQ=", + "dev": true + }, + "safe-buffer": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.0.tgz", + "integrity": "sha512-aSLEDudu6OoRr/2rU609gRmnYboRLxgDG1z9o2Q0os7236FwvcqIOO8r8U5JUEwivZOhDaKlFO4SbPTJYyBEyQ==", + "dev": true + }, + "set-immediate-shim": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz", + "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=", + "dev": true + }, + "slash": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", + "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=", + "dev": true + }, + "sparkles": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/sparkles/-/sparkles-1.0.0.tgz", + "integrity": "sha1-Gsu/tZJDbRC76PeFt8xvgoFQEsM=", + "dev": true + }, + "string_decoder": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.2.tgz", + "integrity": "sha1-sp4fThEl+pehA4K4pTNze3SR4Xk=", + "dev": true, + "dependencies": { + "safe-buffer": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.0.1.tgz", + "integrity": "sha1-0mPKVGls2KMGtcplUekt5XkY++c=", + "dev": true + } + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true + }, + "strip-bom": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "dev": true + }, + "strip-bom-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom-stream/-/strip-bom-stream-2.0.0.tgz", + "integrity": "sha1-+H217yYT9paKpUWr/h7HKLaoKco=", + "dev": true + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + }, + "through2": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", + "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", + "dev": true + }, + "time-stamp": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/time-stamp/-/time-stamp-1.1.0.tgz", + "integrity": "sha1-dkpaEa9QVhkhsTPztE5hhofg9cM=", + "dev": true + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "vinyl": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-1.2.0.tgz", + "integrity": "sha1-XIgDbPVl5d8FVYv8kR+GVt8hiIQ=", + "dev": true + }, + "vinyl-file": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/vinyl-file/-/vinyl-file-2.0.0.tgz", + "integrity": "sha1-p+v1/779obfRjRQPyweyI++2dRo=", + "dev": true + }, + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", + "dev": true + } + } +} diff --git a/build/monaco/monaco.d.ts.recipe b/build/monaco/monaco.d.ts.recipe index 35051652e25d47e6f69dd2f52bf0c27dc55e4ba7..1a3f3c6143124a60b77079941cc18ceb11a6c1d0 100644 --- a/build/monaco/monaco.d.ts.recipe +++ b/build/monaco/monaco.d.ts.recipe @@ -57,19 +57,20 @@ declare module monaco { declare module monaco.editor { -#includeAll(vs/editor/browser/standalone/standaloneEditor;modes.=>languages.;editorCommon.=>): -#include(vs/editor/common/services/standaloneThemeService): BuiltinTheme, IStandaloneThemeData, IColors +#includeAll(vs/editor/standalone/browser/standaloneEditor;modes.=>languages.;editorCommon.=>): +#include(vs/editor/standalone/common/standaloneThemeService): BuiltinTheme, IStandaloneThemeData, IColors #include(vs/editor/common/modes/supports/tokenization): ITokenThemeRule #include(vs/editor/common/services/webWorker): MonacoWebWorker, IWebWorkerOptions -#include(vs/editor/browser/standalone/standaloneCodeEditor): IEditorConstructionOptions, IDiffEditorConstructionOptions, IStandaloneCodeEditor, IStandaloneDiffEditor +#include(vs/editor/standalone/browser/standaloneCodeEditor): IEditorConstructionOptions, IDiffEditorConstructionOptions, IStandaloneCodeEditor, IStandaloneDiffEditor export interface ICommandHandler { (...args:any[]): void; } #include(vs/platform/contextkey/common/contextkey): IContextKey -#include(vs/editor/browser/standalone/standaloneServices): IEditorOverrideServices +#include(vs/editor/standalone/browser/standaloneServices): IEditorOverrideServices #include(vs/platform/markers/common/markers): IMarkerData -#include(vs/editor/browser/standalone/colorizer): IColorizerOptions, IColorizerElementOptions +#include(vs/editor/standalone/browser/colorizer): IColorizerOptions, IColorizerElementOptions #include(vs/base/common/scrollable): ScrollbarVisibility +#include(vs/platform/theme/common/themeService): ThemeColor #includeAll(vs/editor/common/editorCommon;IMode=>languages.IMode;LanguageIdentifier=>languages.LanguageIdentifier;editorOptions.=>): ISelection, IScrollEvent #includeAll(vs/editor/common/model/textModelEvents): #includeAll(vs/editor/common/controller/cursorEvents): @@ -80,11 +81,11 @@ export interface ICommandHandler { declare module monaco.languages { -#includeAll(vs/editor/browser/standalone/standaloneLanguages;modes.=>;editorCommon.=>editor.;IMarkerData=>editor.IMarkerData): +#includeAll(vs/editor/standalone/browser/standaloneLanguages;modes.=>;editorCommon.=>editor.;IMarkerData=>editor.IMarkerData): #includeAll(vs/editor/common/modes/languageConfiguration): #includeAll(vs/editor/common/modes;editorCommon.IRange=>IRange;editorCommon.IPosition=>IPosition;editorCommon.=>editor.): #include(vs/editor/common/services/modeService): ILanguageExtensionPoint -#includeAll(vs/editor/common/modes/monarch/monarchTypes): +#includeAll(vs/editor/standalone/common/monarch/monarchTypes): } diff --git a/build/npm/update-all-grammars.js b/build/npm/update-all-grammars.js new file mode 100644 index 0000000000000000000000000000000000000000..88b890af730c1e9c561eebbe6e67992d536a3b8f --- /dev/null +++ b/build/npm/update-all-grammars.js @@ -0,0 +1,73 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +const cp = require('child_process'); +const npm = process.platform === 'win32' ? 'npm.cmd' : 'npm'; + +function updateGrammar(location) { + const result = cp.spawnSync(npm, ['run', 'update-grammar'], { + cwd: location, + stdio: 'inherit' + }); + + if (result.error || result.status !== 0) { + process.exit(1); + } +} + +const extensions = [ + // 'bat' Grammar no longer available + 'clojure', + 'coffeescript', + 'cpp', + 'csharp', + 'css', + 'diff', + 'docker', + 'fsharp', + 'gitsyntax', + 'go', + 'groovy', + 'handlebars', + 'hlsl', + 'html', + 'ini', + 'java', + // 'javascript', updated through JavaScript + // 'json', customized + 'less', + 'lua', + 'make', + 'markdown', + 'objective-c', + 'perl', + 'php', + // 'powershell', grammar not ready yet, @daviwil will ping when ready + 'pug', + 'python', + 'r', + 'razor', + 'ruby', + 'rust', + 'scss', + 'shaderlab', + 'shellscript', + // 'sql', customized, PRs pending + 'swift', + 'typescript', + 'vb', + 'xml', + 'yaml' +]; + +extensions.forEach(extension => updateGrammar(`extensions/${extension}`)); + +// run integration tests + +if (process.platform === 'win32') { + cp.spawn('.\scripts\test-integration.bat', [], { env: process.env, stdio: 'inherit' }); +} else { + cp.spawn('/bin/bash', ['./scripts/test-integration.sh'], { env: process.env, stdio: 'inherit' }); +} \ No newline at end of file diff --git a/build/npm/update-grammar.js b/build/npm/update-grammar.js index 4b0408b89b29d7aabca4a373842127d55a529d0f..fca60d83242dc202830c503d708c31d5aa060387 100644 --- a/build/npm/update-grammar.js +++ b/build/npm/update-grammar.js @@ -25,19 +25,28 @@ function getOptions(urlString) { } } -function download(url) { -return new Promise((c, e) => { - var content = ''; - var request = https.get(getOptions(url), function (response) { +function download(url, redirectCount) { + return new Promise((c, e) => { + var content = ''; + https.get(getOptions(url), function (response) { response.on('data', function (data) { content += data.toString(); }).on('end', function () { + let count = redirectCount || 0; + if (count < 5 && response.statusCode >= 300 && response.statusCode <= 303 || response.statusCode === 307) { + let location = response.headers['location']; + if (location) { + console.log("Redirected " + url + " to " + location); + download(location, count+1).then(c, e); + return; + } + } c(content); }); }).on('error', function (err) { e(err.message); }); -}); + }); } function getCommitSha(repoId, repoPath) { @@ -46,14 +55,15 @@ function getCommitSha(repoId, repoPath) { try { let lastCommit = JSON.parse(content)[0]; return Promise.resolve({ - commitSha : lastCommit.sha, - commitDate : lastCommit.commit.author.date + commitSha: lastCommit.sha, + commitDate: lastCommit.commit.author.date }); } catch (e) { + console.error("Failed extracting the SHA: " + content); return Promise.resolve(null); } }, function () { - console.err('Failed loading ' + commitInfo); + console.error('Failed loading ' + commitInfo); return Promise.resolve(null); }); } @@ -78,11 +88,23 @@ exports.update = function (repoId, repoPath, dest, modifyGrammar) { modifyGrammar(grammar); } return getCommitSha(repoId, repoPath).then(function (info) { + let result = { + information_for_contributors: [ + 'This file has been converted from https://github.com/' + repoId + '/blob/master/' + repoPath, + '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.' + ] + }; + if (info) { - grammar.version = 'https://github.com/' + repoId + '/commit/' + info.commitSha; + result.version = 'https://github.com/' + repoId + '/commit/' + info.commitSha; } + for (let key in grammar) { + result[key] = grammar[key]; + } + try { - fs.writeFileSync(dest, JSON.stringify(grammar, null, '\t')); + fs.writeFileSync(dest, JSON.stringify(result, null, '\t')); if (info) { console.log('Updated ' + path.basename(dest) + ' to ' + repoId + '@' + info.commitSha.substr(0, 7) + ' (' + info.commitDate.substr(0, 10) + ')'); } else { @@ -97,7 +119,7 @@ exports.update = function (repoId, repoPath, dest, modifyGrammar) { } if (path.basename(process.argv[1]) === 'update-grammar.js') { - for (var i = 3; i < process.argv.length; i+=2) { - exports.update(process.argv[2], process.argv[i], process.argv[i+1]); + for (var i = 3; i < process.argv.length; i += 2) { + exports.update(process.argv[2], process.argv[i], process.argv[i + 1]); } } diff --git a/build/tfs/darwin/build.sh b/build/tfs/darwin/build.sh index 1f569cf74f25bd5bc7e6a314d200d3a8a543863f..6397b310dca980c002629bd4629022d4865764df 100755 --- a/build/tfs/darwin/build.sh +++ b/build/tfs/darwin/build.sh @@ -30,24 +30,5 @@ step "Run unit tests" \ step "Run integration tests" \ ./scripts/test-integration.sh -(cd $BUILD_SOURCESDIRECTORY/build/tfs/common && \ - step "Install build dependencies" \ - npm i) - -REPO=`pwd` -ZIP=$REPO/../VSCode-darwin-selfsigned.zip -UNSIGNEDZIP=$REPO/../VSCode-darwin-unsigned.zip -BUILD=$REPO/../VSCode-darwin -PACKAGEJSON=`ls $BUILD/*.app/Contents/Resources/app/package.json` -VERSION=`node -p "require(\"$PACKAGEJSON\").version"` - -rm -rf $UNSIGNEDZIP -(cd $BUILD && \ - step "Create unsigned archive" \ - zip -r -X -y $UNSIGNEDZIP *) - -step "Upload unsigned archive" \ - node build/tfs/common/publish.js --upload-only $VSCODE_QUALITY darwin archive-unsigned VSCode-darwin-$VSCODE_QUALITY-unsigned.zip $VERSION false $UNSIGNEDZIP - -step "Sign build" \ - node build/tfs/common/enqueue.js $VSCODE_QUALITY \ No newline at end of file +step "Publish release" \ + ./build/tfs/darwin/release.sh \ No newline at end of file diff --git a/build/tfs/darwin/release.sh b/build/tfs/darwin/release.sh new file mode 100755 index 0000000000000000000000000000000000000000..24ed4c30a78b5e84d773fbf2b6b3fa0e9bf3cee0 --- /dev/null +++ b/build/tfs/darwin/release.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +. ./scripts/env.sh +. ./build/tfs/common/common.sh + +(cd $BUILD_SOURCESDIRECTORY/build/tfs/common && \ + step "Install build dependencies" \ + npm i) + +REPO=`pwd` +ZIP=$REPO/../VSCode-darwin-selfsigned.zip +UNSIGNEDZIP=$REPO/../VSCode-darwin-unsigned.zip +BUILD=$REPO/../VSCode-darwin +PACKAGEJSON=`ls $BUILD/*.app/Contents/Resources/app/package.json` +VERSION=`node -p "require(\"$PACKAGEJSON\").version"` + +rm -rf $UNSIGNEDZIP +(cd $BUILD && \ + step "Create unsigned archive" \ + zip -r -X -y $UNSIGNEDZIP *) + +step "Upload unsigned archive" \ + node build/tfs/common/publish.js --upload-only $VSCODE_QUALITY darwin archive-unsigned VSCode-darwin-$VSCODE_QUALITY-unsigned.zip $VERSION false $UNSIGNEDZIP + +step "Sign build" \ + node build/tfs/common/enqueue.js $VSCODE_QUALITY \ No newline at end of file diff --git a/build/tfs/darwin/smoketest.sh b/build/tfs/darwin/smoketest.sh new file mode 100755 index 0000000000000000000000000000000000000000..60e1863f08d17be1245e8f19b4bb207f92aa408d --- /dev/null +++ b/build/tfs/darwin/smoketest.sh @@ -0,0 +1,28 @@ +#!/bin/sh + +. ./scripts/env.sh +. ./build/tfs/common/common.sh + +export VSCODE_MIXIN_PASSWORD="$1" +VSO_PAT="$2" + +echo "machine monacotools.visualstudio.com password $VSO_PAT" > ~/.netrc + +step "Install dependencies" \ + npm install + +step "Mix in repository from vscode-distro" \ + npm run gulp -- mixin + +step "Install distro dependencies" \ + node build/tfs/common/installDistro.js + +step "Build minified & upload source maps" \ + npm run gulp -- --max_old_space_size=4096 vscode-darwin-min + +step "Run smoke test" \ + pushd test/smoke + npm install + npm run compile + node src/main.js --latest "$AGENT_BUILDDIRECTORY/VSCode-darwin/Visual Studio Code - Insiders.app/Contents/MacOS/Electron" + popd \ No newline at end of file diff --git a/build/tfs/linux/build.sh b/build/tfs/linux/build.sh index 7e50e47c05d84559f52707c71c8b0214eb2bc2b3..e6ba3dd80426e83422a3d8fb81b26f9b671c4ea4 100755 --- a/build/tfs/linux/build.sh +++ b/build/tfs/linux/build.sh @@ -32,84 +32,5 @@ step "Build minified" \ step "Run unit tests" \ ./scripts/test.sh --xvfb --build --reporter dot -step "Build Debian package" \ - npm run gulp -- --max_old_space_size=4096 "vscode-linux-$ARCH-build-deb" - -step "Build RPM package" \ - npm run gulp -- --max_old_space_size=4096 "vscode-linux-$ARCH-build-rpm" - -(cd $BUILD_SOURCESDIRECTORY/build/tfs/common && \ - step "Install build dependencies" \ - npm install --unsafe-perm) - -# Variables -PLATFORM_LINUX="linux-$ARCH" -PLATFORM_DEB="linux-deb-$ARCH" -PLATFORM_RPM="linux-rpm-$ARCH" -[[ "$ARCH" == "ia32" ]] && DEB_ARCH="i386" || DEB_ARCH="amd64" -[[ "$ARCH" == "ia32" ]] && RPM_ARCH="i386" || RPM_ARCH="x86_64" -REPO="`pwd`" -ROOT="$REPO/.." -BUILDNAME="VSCode-$PLATFORM_LINUX" -BUILD="$ROOT/$BUILDNAME" -BUILD_VERSION="$(ls $REPO/.build/linux/deb/$DEB_ARCH/deb/ | sed -e 's/code-[a-z]*_//g' -e 's/\.deb$//g')" -[ -z "$VSCODE_QUALITY" ] && TARBALL_FILENAME="code-$BUILD_VERSION.tar.gz" || TARBALL_FILENAME="code-$VSCODE_QUALITY-$BUILD_VERSION.tar.gz" -TARBALL_PATH="$ROOT/$TARBALL_FILENAME" -PACKAGEJSON="$BUILD/resources/app/package.json" -VERSION=$(node -p "require(\"$PACKAGEJSON\").version") - -rm -rf $ROOT/code-*.tar.* -(cd $ROOT && \ - step "Create tar.gz archive" \ - tar -czvf $TARBALL_PATH $BUILDNAME) - -step "Publish tar.gz archive" \ - node build/tfs/common/publish.js $VSCODE_QUALITY $PLATFORM_LINUX archive-unsigned $TARBALL_FILENAME $VERSION true $TARBALL_PATH - -DEB_FILENAME="$(ls $REPO/.build/linux/deb/$DEB_ARCH/deb/)" -DEB_PATH="$REPO/.build/linux/deb/$DEB_ARCH/deb/$DEB_FILENAME" - -step "Publish Debian package" \ - node build/tfs/common/publish.js $VSCODE_QUALITY $PLATFORM_DEB package $DEB_FILENAME $VERSION true $DEB_PATH - -RPM_FILENAME="$(ls $REPO/.build/linux/rpm/$RPM_ARCH/ | grep .rpm)" -RPM_PATH="$REPO/.build/linux/rpm/$RPM_ARCH/$RPM_FILENAME" - -step "Publish RPM package" \ - node build/tfs/common/publish.js $VSCODE_QUALITY $PLATFORM_RPM package $RPM_FILENAME $VERSION true $RPM_PATH - -if [ -z "$VSCODE_QUALITY" ]; then - echo "VSCODE_QUALITY is not set, skipping repo package publish" -else - if [ "$BUILD_SOURCEBRANCH" = "master" ] || [ "$BUILD_SOURCEBRANCH" = "refs/heads/master" ]; then - if [[ $BUILD_QUEUEDBY = *"Project Collection Service Accounts"* || $BUILD_QUEUEDBY = *"Microsoft.VisualStudio.Services.TFS"* ]]; then - # Get necessary information - pushd $REPO && COMMIT_HASH=$(git rev-parse HEAD) && popd - PACKAGE_NAME="$(ls $REPO/.build/linux/deb/$DEB_ARCH/deb/ | sed -e 's/_.*//g')" - DEB_URL="https://az764295.vo.msecnd.net/$VSCODE_QUALITY/$COMMIT_HASH/$DEB_FILENAME" - RPM_URL="https://az764295.vo.msecnd.net/$VSCODE_QUALITY/$COMMIT_HASH/$RPM_FILENAME" - PACKAGE_VERSION="$(ls $REPO/.build/linux/deb/$DEB_ARCH/deb/ | sed -e 's/code-[a-z]*_//g' -e 's/\_.*$//g')" - # Write config files needed by API, use eval to force environment variable expansion - DIRNAME=$(dirname $(readlink -f $0)) - pushd $DIRNAME - # Submit to apt repo - if [ "$DEB_ARCH" = "amd64" ]; then - eval echo '{ \"server\": \"azure-apt-cat.cloudapp.net\", \"protocol\": \"https\", \"port\": \"443\", \"repositoryId\": \"58a4adf642421134a1a48d1a\", \"username\": \"$LINUX_REPO_USERNAME\", \"password\": \"$LINUX_REPO_PASSWORD\" }' > apt-config.json - eval echo '{ \"name\": \"$PACKAGE_NAME\", \"version\": \"$PACKAGE_VERSION\", \"repositoryId\": \"58a4adf642421134a1a48d1a\", \"sourceUrl\": \"$DEB_URL\" }' > apt-addpkg.json - echo "Submitting apt-addpkg.json:" - cat apt-addpkg.json - - step "Publish to repositories" \ - ./repoapi_client.sh -config apt-config.json -addpkg apt-addpkg.json - fi - # Submit to yum repo (disabled as it's manual until signing is automated) - # eval echo '{ \"server\": \"azure-apt-cat.cloudapp.net\", \"protocol\": \"https\", \"port\": \"443\", \"repositoryId\": \"58a4ae3542421134a1a48d1b\", \"username\": \"$LINUX_REPO_USERNAME\", \"password\": \"$LINUX_REPO_PASSWORD\" }' > yum-config.json - # eval echo '{ \"name\": \"$PACKAGE_NAME\", \"version\": \"$PACKAGE_VERSION\", \"repositoryId\": \"58a4ae3542421134a1a48d1b\", \"sourceUrl\": \"$RPM_URL\" }' > yum-addpkg.json - # echo "Submitting yum-addpkg.json:" - # cat yum-addpkg.json - # ./repoapi_client.sh -config yum-config.json -addpkg yum-addpkg.json - popd - echo "To check repo publish status run ./repoapi_client.sh -config config.json -check " - fi - fi -fi +step "Publish release" \ + ./build/tfs/linux/release.sh \ No newline at end of file diff --git a/build/tfs/linux/release.sh b/build/tfs/linux/release.sh new file mode 100755 index 0000000000000000000000000000000000000000..40d68aee73fc1ec5cc88f05e6c8e03978c188def --- /dev/null +++ b/build/tfs/linux/release.sh @@ -0,0 +1,86 @@ +#!/bin/bash + +. ./scripts/env.sh +. ./build/tfs/common/common.sh + +step "Build Debian package" \ + npm run gulp -- --max_old_space_size=4096 "vscode-linux-$ARCH-build-deb" + +step "Build RPM package" \ + npm run gulp -- --max_old_space_size=4096 "vscode-linux-$ARCH-build-rpm" + +(cd $BUILD_SOURCESDIRECTORY/build/tfs/common && \ + step "Install build dependencies" \ + npm install --unsafe-perm) + +# Variables +PLATFORM_LINUX="linux-$ARCH" +PLATFORM_DEB="linux-deb-$ARCH" +PLATFORM_RPM="linux-rpm-$ARCH" +[[ "$ARCH" == "ia32" ]] && DEB_ARCH="i386" || DEB_ARCH="amd64" +[[ "$ARCH" == "ia32" ]] && RPM_ARCH="i386" || RPM_ARCH="x86_64" +REPO="`pwd`" +ROOT="$REPO/.." +BUILDNAME="VSCode-$PLATFORM_LINUX" +BUILD="$ROOT/$BUILDNAME" +BUILD_VERSION="$(ls $REPO/.build/linux/deb/$DEB_ARCH/deb/ | sed -e 's/code-[a-z]*_//g' -e 's/\.deb$//g')" +[ -z "$VSCODE_QUALITY" ] && TARBALL_FILENAME="code-$BUILD_VERSION.tar.gz" || TARBALL_FILENAME="code-$VSCODE_QUALITY-$BUILD_VERSION.tar.gz" +TARBALL_PATH="$ROOT/$TARBALL_FILENAME" +PACKAGEJSON="$BUILD/resources/app/package.json" +VERSION=$(node -p "require(\"$PACKAGEJSON\").version") + +rm -rf $ROOT/code-*.tar.* +(cd $ROOT && \ + step "Create tar.gz archive" \ + tar -czf $TARBALL_PATH $BUILDNAME) + +step "Publish tar.gz archive" \ + node build/tfs/common/publish.js $VSCODE_QUALITY $PLATFORM_LINUX archive-unsigned $TARBALL_FILENAME $VERSION true $TARBALL_PATH + +DEB_FILENAME="$(ls $REPO/.build/linux/deb/$DEB_ARCH/deb/)" +DEB_PATH="$REPO/.build/linux/deb/$DEB_ARCH/deb/$DEB_FILENAME" + +step "Publish Debian package" \ + node build/tfs/common/publish.js $VSCODE_QUALITY $PLATFORM_DEB package $DEB_FILENAME $VERSION true $DEB_PATH + +RPM_FILENAME="$(ls $REPO/.build/linux/rpm/$RPM_ARCH/ | grep .rpm)" +RPM_PATH="$REPO/.build/linux/rpm/$RPM_ARCH/$RPM_FILENAME" + +step "Publish RPM package" \ + node build/tfs/common/publish.js $VSCODE_QUALITY $PLATFORM_RPM package $RPM_FILENAME $VERSION true $RPM_PATH + +if [ -z "$VSCODE_QUALITY" ]; then + echo "VSCODE_QUALITY is not set, skipping repo package publish" +else + if [ "$BUILD_SOURCEBRANCH" = "master" ] || [ "$BUILD_SOURCEBRANCH" = "refs/heads/master" ]; then + if [[ $BUILD_QUEUEDBY = *"Project Collection Service Accounts"* || $BUILD_QUEUEDBY = *"Microsoft.VisualStudio.Services.TFS"* ]]; then + # Get necessary information + pushd $REPO && COMMIT_HASH=$(git rev-parse HEAD) && popd + PACKAGE_NAME="$(ls $REPO/.build/linux/deb/$DEB_ARCH/deb/ | sed -e 's/_.*//g')" + DEB_URL="https://az764295.vo.msecnd.net/$VSCODE_QUALITY/$COMMIT_HASH/$DEB_FILENAME" + RPM_URL="https://az764295.vo.msecnd.net/$VSCODE_QUALITY/$COMMIT_HASH/$RPM_FILENAME" + PACKAGE_VERSION="$(ls $REPO/.build/linux/deb/$DEB_ARCH/deb/ | sed -e 's/code-[a-z]*_//g' -e 's/\_.*$//g')" + # Write config files needed by API, use eval to force environment variable expansion + DIRNAME=$(dirname $(readlink -f $0)) + pushd $DIRNAME + # Submit to apt repo + if [ "$DEB_ARCH" = "amd64" ]; then + eval echo '{ \"server\": \"azure-apt-cat.cloudapp.net\", \"protocol\": \"https\", \"port\": \"443\", \"repositoryId\": \"58a4adf642421134a1a48d1a\", \"username\": \"$LINUX_REPO_USERNAME\", \"password\": \"$LINUX_REPO_PASSWORD\" }' > apt-config.json + eval echo '{ \"name\": \"$PACKAGE_NAME\", \"version\": \"$PACKAGE_VERSION\", \"repositoryId\": \"58a4adf642421134a1a48d1a\", \"sourceUrl\": \"$DEB_URL\" }' > apt-addpkg.json + echo "Submitting apt-addpkg.json:" + cat apt-addpkg.json + + step "Publish to repositories" \ + ./repoapi_client.sh -config apt-config.json -addpkg apt-addpkg.json + fi + # Submit to yum repo (disabled as it's manual until signing is automated) + # eval echo '{ \"server\": \"azure-apt-cat.cloudapp.net\", \"protocol\": \"https\", \"port\": \"443\", \"repositoryId\": \"58a4ae3542421134a1a48d1b\", \"username\": \"$LINUX_REPO_USERNAME\", \"password\": \"$LINUX_REPO_PASSWORD\" }' > yum-config.json + # eval echo '{ \"name\": \"$PACKAGE_NAME\", \"version\": \"$PACKAGE_VERSION\", \"repositoryId\": \"58a4ae3542421134a1a48d1b\", \"sourceUrl\": \"$RPM_URL\" }' > yum-addpkg.json + # echo "Submitting yum-addpkg.json:" + # cat yum-addpkg.json + # ./repoapi_client.sh -config yum-config.json -addpkg yum-addpkg.json + popd + echo "To check repo publish status run ./repoapi_client.sh -config config.json -check " + fi + fi +fi diff --git a/build/tfs/linux/smoketest.sh b/build/tfs/linux/smoketest.sh new file mode 100644 index 0000000000000000000000000000000000000000..a8cc950eba5375b1afffb038d07ebefa9919f68d --- /dev/null +++ b/build/tfs/linux/smoketest.sh @@ -0,0 +1,46 @@ +#!/bin/bash +set -e + +. ./scripts/env.sh +. ./build/tfs/common/common.sh + +export ARCH="$1" +export VSCODE_MIXIN_PASSWORD="$2" +VSO_PAT="$3" + +echo "machine monacotools.visualstudio.com password $VSO_PAT" > ~/.netrc + +step "Install dependencies" \ + npm install --arch=$ARCH --unsafe-perm + +step "Mix in repository from vscode-distro" \ + npm run gulp -- mixin + +step "Get Electron" \ + npm run gulp -- "electron-$ARCH" + +step "Install distro dependencies" \ + node build/tfs/common/installDistro.js --arch=$ARCH + +step "Build minified" \ + npm run gulp -- --max_old_space_size=4096 "vscode-linux-$ARCH-min" + +function configureEnvironment { + id -u testuser &>/dev/null || (useradd -m testuser; chpasswd <<< testuser:testpassword) + git config --global user.name "VS Code Agent" + git config --global user.email "monacotools@microsoft.com" + chown -R testuser $AGENT_BUILDDIRECTORY +} + +function runTest { + pushd test/smoke + npm install + npm run compile + sudo -u testuser -H xvfb-run -a -s "-screen 0 1024x768x8" node src/main.js --latest "$AGENT_BUILDDIRECTORY/VSCode-linux-ia32/code-insiders" + popd +} + +step "Configure environment" configureEnvironment + +step "Run smoke test" runTest + diff --git a/build/tfs/win32/1_build.ps1 b/build/tfs/win32/1_build.ps1 index 0f473ddeff5a0cf1960f7342ee959d4b21845431..34b44826fc09fe920ec2caed64b0b5346d77976c 100644 --- a/build/tfs/win32/1_build.ps1 +++ b/build/tfs/win32/1_build.ps1 @@ -9,8 +9,7 @@ Param( # Create a _netrc file to download distro dependencies # In order to get _netrc to work, we need a HOME variable setup -$env:HOME=$env:USERPROFILE -"machine monacotools.visualstudio.com password ${vsoPAT}" | Out-File "$env:USERPROFILE\_netrc" -Encoding ASCII +"machine monacotools.visualstudio.com password ${vsoPAT}" | Out-File "$env:HOME\_netrc" -Encoding ASCII # Set the right architecture $env:npm_config_arch="$arch" diff --git a/build/tfs/win32/3_upload.ps1 b/build/tfs/win32/3_upload.ps1 index f430e0d8c9406e8e0ad2d613e3b28973ed8438b7..3f23b6d1831bdecb03dcb66ae6f03967ad99d5c6 100644 --- a/build/tfs/win32/3_upload.ps1 +++ b/build/tfs/win32/3_upload.ps1 @@ -27,10 +27,8 @@ step "Publish archive" { exec { & node build/tfs/common/publish.js $Quality "$global:assetPlatform-archive" archive "VSCode-win32-$global:arch-$Version.zip" $Version true $Zip } } -if ($arch -eq "ia32") { - step "Publish setup package" { - exec { & node build/tfs/common/publish.js $Quality "$global:assetPlatform" setup "VSCodeSetup-$global:arch-$Version.exe" $Version true $Exe } - } +step "Publish setup package" { + exec { & node build/tfs/common/publish.js $Quality "$global:assetPlatform" setup "VSCodeSetup-$global:arch-$Version.exe" $Version true $Exe } } done \ No newline at end of file diff --git a/build/tfs/win32/lib.ps1 b/build/tfs/win32/lib.ps1 index 610b4d7fcdfedd97fbabb1d8a71747fa7618bc61..39a3bade9dade5e1cd2498a17bf69e61a70981fd 100644 --- a/build/tfs/win32/lib.ps1 +++ b/build/tfs/win32/lib.ps1 @@ -1,9 +1,14 @@ # stop when there's an error $ErrorActionPreference = 'Stop' -# set agent specific npm cache +$env:HOME=$env:USERPROFILE + if (Test-Path env:AGENT_WORKFOLDER) { - $env:npm_config_cache = "${env:AGENT_WORKFOLDER}\npm-cache" + $env:HOME="${env:AGENT_WORKFOLDER}\home" + $env:npm_config_cache="${env:HOME}\npm-cache" + $env:npm_config_devdir="${env:HOME}\npm-devdir" + New-Item -Path "$env:HOME" -Type directory -Force | out-null + New-Item -Path "$env:npm_config_cache" -Type directory -Force | out-null } # throw when a process exits with something other than 0 diff --git a/build/tfs/win32/smoketest.ps1 b/build/tfs/win32/smoketest.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..e7737a9f8955acddca87e88f1e774e091c8a467c --- /dev/null +++ b/build/tfs/win32/smoketest.ps1 @@ -0,0 +1,46 @@ +Param( + [string]$arch, + [string]$mixinPassword, + [string]$vsoPAT +) + +. .\scripts\env.ps1 +. .\build\tfs\win32\lib.ps1 + +# Create a _netrc file to download distro dependencies +# In order to get _netrc to work, we need a HOME variable setup +$env:HOME=$env:USERPROFILE +"machine monacotools.visualstudio.com password ${vsoPAT}" | Out-File "$env:USERPROFILE\_netrc" -Encoding ASCII + +# Set the right architecture +$env:npm_config_arch="$arch" + +step "Install dependencies" { + exec { & npm install } +} + +$env:VSCODE_MIXIN_PASSWORD = $mixinPassword +step "Mix in repository from vscode-distro" { + exec { & npm run gulp -- mixin } +} + +step "Get Electron" { + exec { & npm run gulp -- "electron-$global:arch" } +} + +step "Install distro dependencies" { + exec { & node build\tfs\common\installDistro.js } +} + +step "Build minified" { + exec { & npm run gulp -- --max_old_space_size=4096 "vscode-win32-$global:arch-min" } +} + +step "Run smoke test" { + exec { & Push-Location test\smoke } + exec { & npm install; npm run compile } + exec { & node src/main.js --latest "$env:AGENT_BUILDDIRECTORY\VSCode-win32-$global:arch\Code - Insiders.exe" } + exec { & Pop-Location } +} + +done \ No newline at end of file diff --git a/build/win32/code.iss b/build/win32/code.iss index b7988b383cc2824ac81530b8ea4f82c58537fa13..7095e2893aad20b357af9ef40d52c83f057b7ce6 100644 --- a/build/win32/code.iss +++ b/build/win32/code.iss @@ -30,6 +30,8 @@ SourceDir={#SourceDir} AppVersion={#Version} VersionInfoVersion={#RawVersion} ShowLanguageDialog=auto +ArchitecturesAllowed={#ArchitecturesAllowed} +ArchitecturesInstallIn64BitMode={#ArchitecturesInstallIn64BitMode} [Languages] Name: "english"; MessagesFile: "compiler:Default.isl,{#RepoDir}\build\win32\i18n\messages.en.isl" {#LocalizedLanguageFile} @@ -51,7 +53,7 @@ Type: filesandordirs; Name: {app}\resources\app\node_modules Type: files; Name: {app}\resources\app\Credits_45.0.2454.85.html [Tasks] -Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}" +Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 0,6.1 Name: "addcontextmenufiles"; Description: "{cm:AddContextMenuFiles,{#NameShort}}"; GroupDescription: "{cm:Other}"; Flags: unchecked Name: "addcontextmenufolders"; Description: "{cm:AddContextMenuFolders,{#NameShort}}"; GroupDescription: "{cm:Other}"; Flags: unchecked @@ -790,6 +792,28 @@ Root: HKCU; Subkey: "SOFTWARE\Classes\Drive\shell\{#RegValueName}"; ValueType: e Root: HKCU; Subkey: "SOFTWARE\Classes\Drive\shell\{#RegValueName}\command"; ValueType: expandsz; ValueName: ""; ValueData: """{app}\{#ExeBasename}.exe"" ""%V"""; Tasks: addcontextmenufolders [Code] +// Don't allow installing conflicting architectures +function InitializeSetup(): Boolean; +var + RegKey: String; + AltArch: String; +begin + Result := True; + RegKey := 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\' + copy('{#IncompatibleAppId}', 2, 38) + '_is1'; + + if '{#Arch}' = 'ia32' then begin + Result := not RegKeyExists(HKLM64, RegKey); + AltArch := 'x64'; + end else begin + Result := not RegKeyExists(HKLM32, RegKey); + AltArch := 'ia32'; + end; + + if not Result then begin + MsgBox('Please uninstall "{#NameShort}" ' + AltArch + ' before installing this package.', mbInformation, MB_OK); + end; +end; + function WizardNotSilent(): Boolean; begin Result := not WizardSilent(); diff --git a/build/win32/i18n/messages.hu.isl b/build/win32/i18n/messages.hu.isl new file mode 100644 index 0000000000000000000000000000000000000000..120bf8fc27b8ee3488b92b748eb63e3aece38d8d --- /dev/null +++ b/build/win32/i18n/messages.hu.isl @@ -0,0 +1,8 @@ +[CustomMessages] +AddContextMenuFiles="Megnyits a kvetkezvel: %1" parancs hozzadsa a fjlok helyi menjhez a Windows Intzben +AddContextMenuFolders="Megnyits a kvetkezvel: %1" parancs hozzadsa a mappk helyi menjhez a Windows Intzben +AssociateWithFiles=%1 regisztrlsa szerkesztknt a tmogatott fjltpusokhoz +AddToPath=Hozzads a PATH-hoz (jraindts utn lesz elrhet) +RunAfter=%1 indtsa a telepts utn +Other=Egyb: +SourceFile=%1 forrsfjl \ No newline at end of file diff --git a/build/win32/i18n/messages.pt-br.isl b/build/win32/i18n/messages.pt-br.isl new file mode 100644 index 0000000000000000000000000000000000000000..7021e814e8f61c1dc702494f427d98014323df43 --- /dev/null +++ b/build/win32/i18n/messages.pt-br.isl @@ -0,0 +1,8 @@ +[CustomMessages] +AddContextMenuFiles=Adicione a ao "Abrir com %1" ao menu de contexto de arquivo do Windows Explorer +AddContextMenuFolders=Adicione a ao "Abrir com %1" ao menu de contexto de diretrio do Windows Explorer +AssociateWithFiles=Registre %1 como um editor para tipos de arquivos suportados +AddToPath=Adicione em PATH (disponvel aps reiniciar) +RunAfter=Executar %1 aps a instalao +Other=Outros: +SourceFile=Arquivo Fonte %1 \ No newline at end of file diff --git a/build/win32/i18n/messages.tr.isl b/build/win32/i18n/messages.tr.isl new file mode 100644 index 0000000000000000000000000000000000000000..4e8e7bbd19b449f997102869af70e4e9f6b1042a --- /dev/null +++ b/build/win32/i18n/messages.tr.isl @@ -0,0 +1,8 @@ +[CustomMessages] +AddContextMenuFiles=Windows Gezgini balam mensne "%1 le A" eylemini ekle +AddContextMenuFolders=Windows Gezgini dizin balam mensne "%1 le A" eylemini ekle +AssociateWithFiles=%1 uygulamasn desteklenen dosya trleri iin bir dzenleyici olarak kayt et +AddToPath=PATH'e ekle (yeniden balattktan sonra kullanlabilir) +RunAfter=Kurulumdan sonra %1 uygulamasn altr. +Other=Dier: +SourceFile=%1 Kaynak Dosyas \ No newline at end of file diff --git a/extensions/bat/.vscodeignore b/extensions/bat/.vscodeignore new file mode 100644 index 0000000000000000000000000000000000000000..77ab386fc7df4fa2461a8f1ac8457a1e6c9e808a --- /dev/null +++ b/extensions/bat/.vscodeignore @@ -0,0 +1 @@ +test/** \ No newline at end of file diff --git a/extensions/bat/syntaxes/Batch File.tmLanguage b/extensions/bat/syntaxes/Batch File.tmLanguage index 499096364044b17cbb681480084154569c2daa2e..7f0a1061423e0558b6aeeddcc6a60d0352c3150e 100644 --- a/extensions/bat/syntaxes/Batch File.tmLanguage +++ b/extensions/bat/syntaxes/Batch File.tmLanguage @@ -74,13 +74,18 @@ 1 name - variable.parameter.loop.begin.shell + variable.other.parsetime.begin.shell + + 2 + + name + variable.other.parsetime.end.shell name - variable.parameter.loop.dosbatch + variable.other.parsetime.dosbatch match - (?i)(%%)(~(?:f|d|p|n|x|s|a|t|z|\$[^:]*:)*)?[a-z] + (%)[^%]+(%)|(%%)[^%]+(%%) captures @@ -88,18 +93,13 @@ 1 name - variable.other.parsetime.begin.shell - - 2 - - name - variable.other.parsetime.end.shell + variable.parameter.loop.begin.shell name - variable.other.parsetime.dosbatch + variable.parameter.loop.dosbatch match - (%)[^%]+(%) + (?i)(%%)(~(?:f|d|p|n|x|s|a|t|z|\$[^:]*:)*)?[a-z] captures diff --git a/extensions/bat/test/colorize-fixtures/test.bat b/extensions/bat/test/colorize-fixtures/test.bat index f5ae5d25119c83e59bb5ec8cf88ee0d2bab71de9..3e215fc5efc2db3a50b134f123cb8940f78413a4 100644 --- a/extensions/bat/test/colorize-fixtures/test.bat +++ b/extensions/bat/test/colorize-fixtures/test.bat @@ -16,13 +16,9 @@ if not exist out node .\node_modules\gulp\bin\gulp.js compile :: Configuration set NODE_ENV=development -set VSCODE_DEV=1 -set ELECTRON_DEFAULT_ERROR_MODE=1 -set ELECTRON_ENABLE_LOGGING=1 -set ELECTRON_ENABLE_STACK_DUMPING=1 -:: Launch Code -.\.build\electron\electron.exe . %* +call echo %%LINE:rem +=%% + popd endlocal \ No newline at end of file diff --git a/extensions/bat/test/colorize-results/test_bat.json b/extensions/bat/test/colorize-results/test_bat.json index d909fe69bef5569300f30791800f665a40266633..d0f381fc7f3f2e3c67047d91b66769c4ef4e49cd 100644 --- a/extensions/bat/test/colorize-results/test_bat.json +++ b/extensions/bat/test/colorize-results/test_bat.json @@ -264,62 +264,18 @@ } }, { - "c": "set", - "t": "source.dosbatch keyword.command.dosbatch", - "r": { - "dark_plus": "keyword: #569CD6", - "light_plus": "keyword: #0000FF", - "dark_vs": "keyword: #569CD6", - "light_vs": "keyword: #0000FF", - "hc_black": "keyword: #569CD6" - } - }, - { - "c": " VSCODE_DEV=1", - "t": "source.dosbatch", - "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" - } - }, - { - "c": "set", - "t": "source.dosbatch keyword.command.dosbatch", - "r": { - "dark_plus": "keyword: #569CD6", - "light_plus": "keyword: #0000FF", - "dark_vs": "keyword: #569CD6", - "light_vs": "keyword: #0000FF", - "hc_black": "keyword: #569CD6" - } - }, - { - "c": " ELECTRON_DEFAULT_ERROR_MODE=1", - "t": "source.dosbatch", - "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", - "dark_vs": "default: #D4D4D4", - "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" - } - }, - { - "c": "set", - "t": "source.dosbatch keyword.command.dosbatch", + "c": "call", + "t": "source.dosbatch keyword.control.statement.dosbatch", "r": { - "dark_plus": "keyword: #569CD6", - "light_plus": "keyword: #0000FF", - "dark_vs": "keyword: #569CD6", - "light_vs": "keyword: #0000FF", - "hc_black": "keyword: #569CD6" + "dark_plus": "keyword.control: #C586C0", + "light_plus": "keyword.control: #AF00DB", + "dark_vs": "keyword.control: #569CD6", + "light_vs": "keyword.control: #0000FF", + "hc_black": "keyword.control: #C586C0" } }, { - "c": " ELECTRON_ENABLE_LOGGING=1", + "c": " ", "t": "source.dosbatch", "r": { "dark_plus": "default: #D4D4D4", @@ -330,7 +286,7 @@ } }, { - "c": "set", + "c": "echo", "t": "source.dosbatch keyword.command.dosbatch", "r": { "dark_plus": "keyword: #569CD6", @@ -341,7 +297,7 @@ } }, { - "c": " ELECTRON_ENABLE_STACK_DUMPING=1", + "c": " ", "t": "source.dosbatch", "r": { "dark_plus": "default: #D4D4D4", @@ -352,25 +308,14 @@ } }, { - "c": ":: Launch Code", - "t": "source.dosbatch comment.line.colons.dosbatch", + "c": "%%LINE:rem +=%%", + "t": "source.dosbatch variable.other.parsetime.dosbatch", "r": { - "dark_plus": "comment: #608B4E", - "light_plus": "comment: #008000", - "dark_vs": "comment: #608B4E", - "light_vs": "comment: #008000", - "hc_black": "comment: #7CA668" - } - }, - { - "c": ".\\.build\\electron\\electron.exe . %*", - "t": "source.dosbatch", - "r": { - "dark_plus": "default: #D4D4D4", - "light_plus": "default: #000000", + "dark_plus": "variable: #9CDCFE", + "light_plus": "variable: #001080", "dark_vs": "default: #D4D4D4", "light_vs": "default: #000000", - "hc_black": "default: #FFFFFF" + "hc_black": "variable: #9CDCFE" } }, { diff --git a/extensions/clojure/.vscodeignore b/extensions/clojure/.vscodeignore new file mode 100644 index 0000000000000000000000000000000000000000..77ab386fc7df4fa2461a8f1ac8457a1e6c9e808a --- /dev/null +++ b/extensions/clojure/.vscodeignore @@ -0,0 +1 @@ +test/** \ No newline at end of file diff --git a/extensions/clojure/package.json b/extensions/clojure/package.json index 23a065a7fbeb6501222e698d5bc0940fc80e1c0f..b404ef5fb8ae4ac086c85205faf17cd094657c42 100644 --- a/extensions/clojure/package.json +++ b/extensions/clojure/package.json @@ -10,7 +10,7 @@ "languages": [{ "id": "clojure", "aliases": ["Clojure", "clojure"], - "extensions": [".clj", ".cljs", ".cljx", ".clojure", ".edn"], + "extensions": [".clj", ".cljs", ".cljc", ".cljx", ".clojure", ".edn"], "configuration": "./language-configuration.json" }], "grammars": [{ diff --git a/extensions/clojure/syntaxes/clojure.tmLanguage.json b/extensions/clojure/syntaxes/clojure.tmLanguage.json index 6e2d50b5ea544211c8540860835ef2754f85f5eb..437a0c5b5e1985085d9132a3541316f2447b4174 100644 --- a/extensions/clojure/syntaxes/clojure.tmLanguage.json +++ b/extensions/clojure/syntaxes/clojure.tmLanguage.json @@ -1,4 +1,9 @@ { + "information_for_contributors": [ + "This file has been converted from https://github.com/atom/language-clojure/blob/master/grammars/clojure.cson", + "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." + ], "scopeName": "source.clojure", "fileTypes": [ "boot", @@ -64,14 +69,11 @@ }, { "include": "#symbol" - }, - { - "include": "#whitespace" } ], "repository": { "comment": { - "begin": ";", + "begin": "(? -1 )) - .map(e => newSimpleCompletionItem(e.id, range, undefined, '"' + e.id + '"')); + .map(e => { + const item = new vscode.CompletionItem(e.id); + const insertText = `"${e.id}"`; + item.kind = vscode.CompletionItemKind.Value; + item.insertText = insertText; + item.range = range; + item.filterText = insertText; + return item; + }); } } return []; @@ -87,11 +95,11 @@ function registerExtensionsCompletions(): vscode.Disposable { }); } -function newSimpleCompletionItem(text: string, range: vscode.Range, description?: string, insertText?: string): vscode.CompletionItem { - const item = new vscode.CompletionItem(text); +function newSimpleCompletionItem(label: string, range: vscode.Range, description?: string, insertText?: string): vscode.CompletionItem { + const item = new vscode.CompletionItem(label); item.kind = vscode.CompletionItemKind.Value; item.detail = description; - item.insertText = insertText || text; + item.insertText = insertText || label; item.range = range; return item; diff --git a/extensions/configuration-editing/src/settingsDocumentHelper.ts b/extensions/configuration-editing/src/settingsDocumentHelper.ts index b8f9c16fca6b3b90ddbb5381e4337f3257751118..dc4c47ac129cc906e47b3c928ee8b556f9db5073 100644 --- a/extensions/configuration-editing/src/settingsDocumentHelper.ts +++ b/extensions/configuration-editing/src/settingsDocumentHelper.ts @@ -46,8 +46,10 @@ export class SettingsDocument { completions.push(this.newSimpleCompletionItem('${activeEditorShort}', range, localize('activeEditorShort', "e.g. myFile.txt"))); completions.push(this.newSimpleCompletionItem('${activeEditorMedium}', range, localize('activeEditorMedium', "e.g. myFolder/myFile.txt"))); completions.push(this.newSimpleCompletionItem('${activeEditorLong}', range, localize('activeEditorLong', "e.g. /Users/Development/myProject/myFolder/myFile.txt"))); - completions.push(this.newSimpleCompletionItem('${rootName}', range, localize('rootName', "e.g. myProject"))); + completions.push(this.newSimpleCompletionItem('${rootName}', range, localize('rootName', "e.g. myFolder1, myFolder2, myFolder3"))); completions.push(this.newSimpleCompletionItem('${rootPath}', range, localize('rootPath', "e.g. /Users/Development/myProject"))); + completions.push(this.newSimpleCompletionItem('${folderName}', range, localize('folderName', "e.g. myFolder"))); + completions.push(this.newSimpleCompletionItem('${folderPath}', range, localize('folderPath', "e.g. /Users/Development/myFolder"))); completions.push(this.newSimpleCompletionItem('${appName}', range, localize('appName', "e.g. VS Code"))); completions.push(this.newSimpleCompletionItem('${dirty}', range, localize('dirty', "a dirty indicator if the active editor is dirty"))); completions.push(this.newSimpleCompletionItem('${separator}', range, localize('separator', "a conditional separator (' - ') that only shows when surrounded by variables with values"))); diff --git a/extensions/cpp/.vscodeignore b/extensions/cpp/.vscodeignore new file mode 100644 index 0000000000000000000000000000000000000000..77ab386fc7df4fa2461a8f1ac8457a1e6c9e808a --- /dev/null +++ b/extensions/cpp/.vscodeignore @@ -0,0 +1 @@ +test/** \ No newline at end of file diff --git a/extensions/cpp/OSSREADME.json b/extensions/cpp/OSSREADME.json index 58859a1b7764056a935f131a62ddfb3495c3cf7b..5137487d2ed0342a200982f93a1d47f54ad2f62a 100644 --- a/extensions/cpp/OSSREADME.json +++ b/extensions/cpp/OSSREADME.json @@ -2,7 +2,7 @@ [ { "name": "atom/language-c", - "version": "0.51.3", + "version": "0.0.0", "license": "MIT", "repositoryURL": "https://github.com/atom/language-c", "description": "The files syntaxes/c.json and syntaxes/c++.json were derived from the Atom package https://atom.io/packages/language-c which was originally converted from the C TextMate bundle https://github.com/textmate/c.tmbundle." diff --git a/extensions/cpp/syntaxes/c++.json b/extensions/cpp/syntaxes/c++.json index 0d20c95fb60efdae946e378fa3a7b4b853b258b3..bc627e3a036f31a1e82bae35ac0412b30c029ce5 100644 --- a/extensions/cpp/syntaxes/c++.json +++ b/extensions/cpp/syntaxes/c++.json @@ -1,4 +1,9 @@ { + "information_for_contributors": [ + "This file has been converted from https://github.com/atom/language-c/blob/master/grammars/c%2B%2B.cson", + "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." + ], "scopeName": "source.cpp", "fileTypes": [ "cc", @@ -425,6 +430,9 @@ { "match": "\\\\x\\h+", "name": "constant.character.escape.cpp" + }, + { + "include": "source.c#string_placeholder" } ] }, @@ -454,6 +462,5 @@ } ] } - }, - "version": "https://github.com/atom/language-c/commit/a74c2f967d73e802a67fa6e971a8e8dedf076597" + } } \ No newline at end of file diff --git a/extensions/cpp/syntaxes/c.json b/extensions/cpp/syntaxes/c.json index 6cc84cff24df349e5b98687b6da3453409a4f6e1..b83b31ad22e41201d23444310b82b910627b5180 100644 --- a/extensions/cpp/syntaxes/c.json +++ b/extensions/cpp/syntaxes/c.json @@ -1,4 +1,9 @@ { + "information_for_contributors": [ + "This file has been converted from https://github.com/atom/language-c/blob/master/grammars/c.cson", + "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." + ], "scopeName": "source.c", "fileTypes": [ "c", @@ -773,7 +778,7 @@ }, "patterns": [ { - "begin": "\\G", + "begin": "\\G(?=.)", "end": "(?=//)|(?=/\\*(?!.*\\\\\\s*\\n))|(?\n (?:\n (?:(?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* # Are there any more names being dotted into?\n (?:\\s*\\*\\s*)* # pointer suffix?\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )|\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n)\\s+\n(\\g)\\s*\n(<([^<>]+)>)?\\s*\n(?=\\()", + "begin": "(?x)\n(?:\\b(delegate)\\b)\\s+\n(?\n (?:\n (?:ref\\s+)? # ref return\n (?:\n (?:(?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\*\\s*)* # pointer suffix?\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n)\\s+\n(\\g)\\s*\n(<([^<>]+)>)?\\s*\n(?=\\()", "beginCaptures": { "1": { "name": "keyword.other.delegate.cs" @@ -959,7 +968,7 @@ ] }, "field-declaration": { - "begin": "(?x)\n(?\n (?:\n (?:(?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* # Are there any more names being dotted into?\n (?:\\s*\\*\\s*)* # pointer suffix?\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )|\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n)\\s+\n(\\g)\\s* # first field name\n(?!=>|==)(?=,|;|=|$)", + "begin": "(?x)\n(?\n (?:\n (?:\n (?:(?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\*\\s*)* # pointer suffix?\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n)\\s+\n(\\g)\\s* # first field name\n(?!=>|==)(?=,|;|=|$)", "beginCaptures": { "1": { "patterns": [ @@ -993,7 +1002,7 @@ ] }, "property-declaration": { - "begin": "(?x)\n(?!.*\\b(?:class|interface|struct|enum|event)\\b)\\s*\n(?\n (?\n (?:\n (?:(?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* # Are there any more names being dotted into?\n (?:\\s*\\*\\s*)* # pointer suffix?\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )|\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\\s+\n)\n(?\\g\\s*\\.\\s*)?\n(?\\g)\\s*\n(?=\\{|=>|$)", + "begin": "(?x)\n(?!.*\\b(?:class|interface|struct|enum|event)\\b)\\s*\n(?\n (?\n (?:\n (?:ref\\s+)? # ref return\n (?:\n (?:(?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\*\\s*)* # pointer suffix?\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n )\\s+\n)\n(?\\g\\s*\\.\\s*)?\n(?\\g)\\s*\n(?=\\{|=>|$)", "beginCaptures": { "1": { "patterns": [ @@ -1036,7 +1045,7 @@ ] }, "indexer-declaration": { - "begin": "(?x)\n(?\n (?\n (?:\n (?:(?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* # Are there any more names being dotted into?\n (?:\\s*\\*\\s*)* # pointer suffix?\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )|\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\\s+\n)\n(?\\g\\s*\\.\\s*)?\n(?this)\\s*\n(?=\\[)", + "begin": "(?x)\n(?\n (?\n (?:\n (?:ref\\s+)? # ref return\n (?:\n (?:(?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\*\\s*)* # pointer suffix?\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n )\\s+\n)\n(?\\g\\s*\\.\\s*)?\n(?this)\\s*\n(?=\\[)", "beginCaptures": { "1": { "patterns": [ @@ -1079,7 +1088,7 @@ ] }, "event-declaration": { - "begin": "(?x)\n\\b(event)\\b\\s*\n(?\n (?\n (?:\n (?:(?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* # Are there any more names being dotted into?\n (?:\\s*\\*\\s*)* # pointer suffix?\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )|\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\\s+\n)\n(?\\g\\s*\\.\\s*)?\n(?\\g(?:\\s*,\\s*\\g)*)\\s*\n(?=\\{|;|$)", + "begin": "(?x)\n\\b(event)\\b\\s*\n(?\n (?\n (?:\n (?:\n (?:(?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\*\\s*)* # pointer suffix?\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n )\\s+\n)\n(?\\g\\s*\\.\\s*)?\n(?\\g(?:\\s*,\\s*\\g)*)\\s*\n(?=\\{|;|$)", "beginCaptures": { "1": { "name": "keyword.other.event.cs" @@ -1209,7 +1218,7 @@ ] }, "method-declaration": { - "begin": "(?x)\n(?\n (?\n (?:\n (?:(?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* # Are there any more names being dotted into?\n (?:\\s*\\*\\s*)* # pointer suffix?\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )|\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\\s+\n)\n(?\\g\\s*\\.\\s*)?\n(\\g)\\s*\n(<([^<>]+)>)?\\s*\n(?=\\()", + "begin": "(?x)\n(?\n (?\n (?:\n (?:ref\\s+)? # ref return\n (?:\n (?:(?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\*\\s*)* # pointer suffix?\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n )\\s+\n)\n(?\\g\\s*\\.\\s*)?\n(\\g)\\s*\n(<([^<>]+)>)?\\s*\n(?=\\()", "beginCaptures": { "1": { "patterns": [ @@ -1345,7 +1354,7 @@ ] }, "operator-declaration": { - "begin": "(?x)\n(?\n (?:\n (?:(?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* # Are there any more names being dotted into?\n (?:\\s*\\*\\s*)* # pointer suffix?\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )|\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n)\\s*\n(?(?:\\b(?:operator)))\\s*\n(?(?:\\+|-|\\*|/|%|&|\\||\\^|\\<\\<|\\>\\>|==|!=|\\>|\\<|\\>=|\\<=|!|~|\\+\\+|--|true|false))\\s*\n(?=\\()", + "begin": "(?x)\n(?\n (?:\n (?:ref\\s+)? # ref return\n (?:\n (?:(?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\*\\s*)* # pointer suffix?\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n)\\s*\n(?(?:\\b(?:operator)))\\s*\n(?(?:\\+|-|\\*|/|%|&|\\||\\^|\\<\\<|\\>\\>|==|!=|\\>|\\<|\\>=|\\<=|!|~|\\+\\+|--|true|false))\\s*\n(?=\\()", "beginCaptures": { "1": { "patterns": [ @@ -1378,7 +1387,7 @@ ] }, "conversion-operator-declaration": { - "begin": "(?x)\n(?(?:\\b(?:explicit|implicit)))\\s*\n(?(?:\\b(?:operator)))\\s*\n(?\n (?:\n (?:(?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* # Are there any more names being dotted into?\n (?:\\s*\\*\\s*)* # pointer suffix?\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )|\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n)\\s*\n(?=\\()", + "begin": "(?x)\n(?(?:\\b(?:explicit|implicit)))\\s*\n(?(?:\\b(?:operator)))\\s*\n(?\n (?:\n (?:ref\\s+)? # ref return\n (?:\n (?:(?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\*\\s*)* # pointer suffix?\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n)\\s*\n(?=\\()", "beginCaptures": { "1": { "patterns": [ @@ -1455,6 +1464,9 @@ }, "end": "(?=[,\\)\\];}])", "patterns": [ + { + "include": "#ref-modifier" + }, { "include": "#expression" } @@ -1469,6 +1481,9 @@ }, "end": "(?=[,\\);}])", "patterns": [ + { + "include": "#ref-modifier" + }, { "include": "#expression" } @@ -1520,6 +1535,9 @@ }, "end": "(?=;)", "patterns": [ + { + "include": "#ref-modifier" + }, { "include": "#expression" } @@ -1834,7 +1852,7 @@ }, "patterns": [ { - "match": "(?x)\n(?:\n (\\bvar\\b)|\n (?\n (?:\n (?:(?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* # Are there any more names being dotted into?\n (?:\\s*\\*\\s*)* # pointer suffix?\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )|\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n)\\s+\n(\\g)\\s+\n\\b(in)\\b", + "match": "(?x)\n(?:\n (\\bvar\\b)|\n (?\n (?:\n (?:\n (?:(?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\*\\s*)* # pointer suffix?\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n )\n)\\s+\n(\\g)\\s+\n\\b(in)\\b", "captures": { "1": { "name": "keyword.other.var.cs" @@ -1904,6 +1922,9 @@ }, "end": "(?<=\\})", "patterns": [ + { + "include": "#comment" + }, { "include": "#block" } @@ -1918,6 +1939,9 @@ }, "end": "(?<=\\})", "patterns": [ + { + "include": "#comment" + }, { "include": "#block" } @@ -1947,7 +1971,7 @@ }, "patterns": [ { - "match": "(?x)\n(?\n (?:\n (?:(?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* # Are there any more names being dotted into?\n (?:\\s*\\*\\s*)* # pointer suffix?\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )|\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n)\\s*\n(?:\\b(\\g)\\b)?", + "match": "(?x)\n(?\n (?:\n (?:\n (?:(?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\*\\s*)* # pointer suffix?\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n)\\s*\n(?:\\b(\\g)\\b)?", "captures": { "1": { "patterns": [ @@ -1966,6 +1990,9 @@ { "include": "#when-clause" }, + { + "include": "#comment" + }, { "include": "#block" } @@ -1990,6 +2017,9 @@ "patterns": [ { "include": "#expression" + }, + { + "include": "#comment" } ] }, @@ -2104,19 +2134,22 @@ ] }, "local-variable-declaration": { - "begin": "(?x)\n(?:\n (\\bvar\\b)|\n (?\n (?:\n (?:(?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* # Are there any more names being dotted into?\n (?:\\s*\\*\\s*)* # pointer suffix?\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )|\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n)\\s+\n(\\g)\\s*\n(?=,|;|=|\\))", + "begin": "(?x)\n(?:\n (?:(\\bref)\\s+)?(\\bvar\\b)| # ref local\n (?\n (?:\n (?:ref\\s+)? # ref local\n (?:\n (?:(?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\*\\s*)* # pointer suffix?\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n )\n)\\s+\n(\\g)\\s*\n(?=,|;|=|\\))", "beginCaptures": { "1": { - "name": "keyword.other.var.cs" + "name": "storage.modifier.cs" }, "2": { + "name": "keyword.other.var.cs" + }, + "3": { "patterns": [ { "include": "#type" } ] }, - "7": { + "8": { "name": "entity.name.variable.local.cs" } }, @@ -2138,7 +2171,7 @@ ] }, "local-constant-declaration": { - "begin": "(?x)\n(?\\b(?:const)\\b)\\s*\n(?\n (?:\n (?:(?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* # Are there any more names being dotted into?\n (?:\\s*\\*\\s*)* # pointer suffix?\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )|\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n)\\s+\n(\\g)\\s*\n(?=,|;|=)", + "begin": "(?x)\n(?\\b(?:const)\\b)\\s*\n(?\n (?:\n (?:\n (?:(?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\*\\s*)* # pointer suffix?\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n)\\s+\n(\\g)\\s*\n(?=,|;|=)", "beginCaptures": { "1": { "name": "storage.modifier.cs" @@ -2228,7 +2261,7 @@ "include": "#tuple-declaration-deconstruction-element-list" }, { - "include": "#declaration-expression" + "include": "#declaration-expression-tuple" }, { "include": "#punctuation-comma" @@ -2264,7 +2297,7 @@ "include": "#tuple-deconstruction-element-list" }, { - "include": "#declaration-expression" + "include": "#declaration-expression-tuple" }, { "include": "#punctuation-comma" @@ -2279,8 +2312,26 @@ } ] }, - "declaration-expression": { - "match": "(?x) # e.g. int x OR var x\n(?:\n \\b(var)\\b|\n (?\n (?:\n (?:(?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* # Are there any more names being dotted into?\n (?:\\s*\\*\\s*)* # pointer suffix?\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )|\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n)\\s+\n\\b(\\g)\\b\\s*\n(?=[,)])", + "declaration-expression-local": { + "match": "(?x) # e.g. int x OR var x\n(?:\n \\b(var)\\b|\n (?\n (?:\n (?:\n (?:(?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\*\\s*)* # pointer suffix?\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n )\n)\\s+\n\\b(\\g)\\b\\s*\n(?=[,)\\]])", + "captures": { + "1": { + "name": "keyword.other.var.cs" + }, + "2": { + "patterns": [ + { + "include": "#type" + } + ] + }, + "7": { + "name": "entity.name.variable.local.cs" + } + } + }, + "declaration-expression-tuple": { + "match": "(?x) # e.g. int x OR var x\n(?:\n \\b(var)\\b|\n (?\n (?:\n (?:\n (?:(?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\*\\s*)* # pointer suffix?\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n )\n)\\s+\n\\b(\\g)\\b\\s*\n(?=[,)])", "captures": { "1": { "name": "keyword.other.var.cs" @@ -2369,6 +2420,20 @@ } ] }, + "throw-expression": { + "begin": "(?\n (?:\n (?:(?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* # Are there any more names being dotted into?\n (?:\\s*\\*\\s*)* # pointer suffix?\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )|\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n)\\s*\n(\\))(?=\\s*[_[:alnum:]\\(])", + "match": "(?x)\n(\\()\\s*\n(?\n (?:\n (?:\n (?:(?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\*\\s*)* # pointer suffix?\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n)\\s*\n(\\))(?=\\s*[_[:alnum:]\\(])", "captures": { "1": { "name": "punctuation.parenthesis.open.cs" @@ -2765,7 +2830,7 @@ } }, "as-expression": { - "match": "(?x)\n(?\n (?:\n (?:(?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* # Are there any more names being dotted into?\n (?:\\s*\\*\\s*)* # pointer suffix?\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )|\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n)?", + "match": "(?x)\n(?\n (?:\n (?:\n (?:(?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\*\\s*)* # pointer suffix?\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n)?", "captures": { "1": { "name": "keyword.other.as.cs" @@ -2780,7 +2845,7 @@ } }, "is-expression": { - "match": "(?x)\n(?\n (?:\n (?:(?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* # Are there any more names being dotted into?\n (?:\\s*\\*\\s*)* # pointer suffix?\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )|\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n)?", + "match": "(?x)\n(?\n (?:\n (?:\n (?:(?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\*\\s*)* # pointer suffix?\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n)?", "captures": { "1": { "name": "keyword.other.is.cs" @@ -2910,7 +2975,7 @@ ] }, "object-creation-expression-with-parameters": { - "begin": "(?x)\n(new)\\s+\n(?\n (?:\n (?:(?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* # Are there any more names being dotted into?\n (?:\\s*\\*\\s*)* # pointer suffix?\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )|\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n)\\s*\n(?=\\()", + "begin": "(?x)\n(new)\\s+\n(?\n (?:\n (?:\n (?:(?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\*\\s*)* # pointer suffix?\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n)\\s*\n(?=\\()", "beginCaptures": { "1": { "name": "keyword.other.new.cs" @@ -2931,7 +2996,7 @@ ] }, "object-creation-expression-with-no-parameters": { - "match": "(?x)\n(new)\\s+\n(?\n (?:\n (?:(?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* # Are there any more names being dotted into?\n (?:\\s*\\*\\s*)* # pointer suffix?\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )|\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n)\\s*\n(?=\\{|$)", + "match": "(?x)\n(new)\\s+\n(?\n (?:\n (?:\n (?:(?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\*\\s*)* # pointer suffix?\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n)\\s*\n(?=\\{|$)", "captures": { "1": { "name": "keyword.other.new.cs" @@ -2946,7 +3011,7 @@ } }, "array-creation-expression": { - "begin": "(?x)\n\\b(new)\\b\\s*\n(?\n (?:\n (?:(?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* # Are there any more names being dotted into?\n (?:\\s*\\*\\s*)* # pointer suffix?\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )|\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n)?\\s*\n(?=\\[)", + "begin": "(?x)\n\\b(new)\\b\\s*\n(?\n (?:\n (?:\n (?:(?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\*\\s*)* # pointer suffix?\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n)?\\s*\n(?=\\[)", "beginCaptures": { "1": { "name": "keyword.other.new.cs" @@ -3145,13 +3210,16 @@ "name": "storage.modifier.cs", "match": "\\b(ref|out)\\b" }, + { + "include": "#declaration-expression-local" + }, { "include": "#expression" } ] }, "query-expression": { - "begin": "(?x)\n\\b(from)\\b\\s*\n(?\n (?:\n (?:(?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* # Are there any more names being dotted into?\n (?:\\s*\\*\\s*)* # pointer suffix?\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )|\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n)?\n\\b(\\g)\\b\\s*\n\\b(in)\\b\\s*", + "begin": "(?x)\n\\b(from)\\b\\s*\n(?\n (?:\n (?:\n (?:(?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\*\\s*)* # pointer suffix?\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n)?\n\\b(\\g)\\b\\s*\n\\b(in)\\b\\s*", "beginCaptures": { "1": { "name": "keyword.query.from.cs" @@ -3243,7 +3311,7 @@ ] }, "join-clause": { - "begin": "(?x)\n\\b(join)\\b\\s*\n(?\n (?:\n (?:(?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* # Are there any more names being dotted into?\n (?:\\s*\\*\\s*)* # pointer suffix?\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )|\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n)?\n\\b(\\g)\\b\\s*\n\\b(in)\\b\\s*", + "begin": "(?x)\n\\b(join)\\b\\s*\n(?\n (?:\n (?:\n (?:(?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\*\\s*)* # pointer suffix?\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n)?\n\\b(\\g)\\b\\s*\n\\b(in)\\b\\s*", "beginCaptures": { "1": { "name": "keyword.query.join.cs" @@ -3421,6 +3489,9 @@ { "include": "#block" }, + { + "include": "#ref-modifier" + }, { "include": "#expression" } @@ -3448,6 +3519,9 @@ { "include": "#block" }, + { + "include": "#ref-modifier" + }, { "include": "#expression" } @@ -3507,7 +3581,7 @@ ] }, "lambda-parameter": { - "match": "(?x)\n(ref|out)?\\s*\n(?\n (?:\n (?:(?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* # Are there any more names being dotted into?\n (?:\\s*\\*\\s*)* # pointer suffix?\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )|\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n)?\n\\b(\\g)\\b\\s*\n(?=[,)])", + "match": "(?x)\n(ref|out)?\\s*\n(?\n (?:\n (?:\n (?:(?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\*\\s*)* # pointer suffix?\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n)?\n\\b(\\g)\\b\\s*\n(?=[,)])", "captures": { "1": { "name": "storage.modifier.cs" @@ -3530,6 +3604,9 @@ { "include": "#comment" }, + { + "include": "#ref-modifier" + }, { "include": "#tuple-type" }, @@ -3550,6 +3627,10 @@ } ] }, + "ref-modifier": { + "name": "storage.modifier.cs", + "match": "ref" + }, "tuple-type": { "begin": "\\(", "beginCaptures": { @@ -3573,7 +3654,7 @@ ] }, "tuple-element": { - "match": "(?x)\n(?\n (?:\n (?:(?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* # Are there any more names being dotted into?\n (?:\\s*\\*\\s*)* # pointer suffix?\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )|\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n)\n(?:\\b(?\\g)\\b)?", + "match": "(?x)\n(?\n (?:\n (?:\n (?:(?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\*\\s*)* # pointer suffix?\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n)\n(?:\\b(?\\g)\\b)?", "captures": { "1": { "patterns": [ @@ -4186,6 +4267,5 @@ } } } - }, - "version": "https://github.com/dotnet/csharp-tmLanguage/commit/4d0e50c51f336645c98689737db1be321d212d3d" + } } \ No newline at end of file diff --git a/extensions/css/.vscodeignore b/extensions/css/.vscodeignore new file mode 100644 index 0000000000000000000000000000000000000000..7b2f560d103be4b9de1bcfca5e2a1f0aa7310178 --- /dev/null +++ b/extensions/css/.vscodeignore @@ -0,0 +1,6 @@ +test/** +client/src/** +client/tsconfig.json +server/src/** +server/tsconfig.json +server/node_modules/@types/** \ No newline at end of file diff --git a/extensions/css/server/npm-shrinkwrap.json b/extensions/css/server/npm-shrinkwrap.json index aebf5bf5121e402563d2c42d4649f42e17f9fca8..13f55cd6b2827b7585118aa82447dd32697b7c61 100644 --- a/extensions/css/server/npm-shrinkwrap.json +++ b/extensions/css/server/npm-shrinkwrap.json @@ -3,9 +3,9 @@ "version": "1.0.0", "dependencies": { "vscode-css-languageservice": { - "version": "2.0.3", + "version": "2.1.0", "from": "vscode-css-languageservice@next", - "resolved": "https://registry.npmjs.org/vscode-css-languageservice/-/vscode-css-languageservice-2.0.3.tgz" + "resolved": "https://registry.npmjs.org/vscode-css-languageservice/-/vscode-css-languageservice-2.1.0.tgz" }, "vscode-jsonrpc": { "version": "3.2.0", diff --git a/extensions/css/server/package.json b/extensions/css/server/package.json index 9e4322d03fe8860932ae389a3d9389804644efca..ba141abd6cd290b4cf7fbc6e50fa136780025025 100644 --- a/extensions/css/server/package.json +++ b/extensions/css/server/package.json @@ -8,7 +8,7 @@ "node": "*" }, "dependencies": { - "vscode-css-languageservice": "^2.0.3", + "vscode-css-languageservice": "^2.1.0", "vscode-languageserver": "^3.2.0" }, "devDependencies": { diff --git a/extensions/css/syntaxes/css.tmLanguage.json b/extensions/css/syntaxes/css.tmLanguage.json index 072b9cd30515e74673021b604ad797523d6f388e..dae4475161aeac90b8d027cb3badcc820e4c0537 100644 --- a/extensions/css/syntaxes/css.tmLanguage.json +++ b/extensions/css/syntaxes/css.tmLanguage.json @@ -1,4 +1,9 @@ { + "information_for_contributors": [ + "This file has been converted from https://github.com/atom/language-css/blob/master/grammars/css.cson", + "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." + ], "scopeName": "source.css", "name": "CSS", "fileTypes": [ @@ -1328,7 +1333,7 @@ "name": "keyword.other.unit.${2:/downcase}.css" } }, - "match": "(?xi) (?=0.6.1 <0.7.0", + "resolved": "https://registry.npmjs.org/@emmetio/abbreviation/-/abbreviation-0.6.1.tgz" + }, + "@emmetio/css-abbreviation": { + "version": "0.3.1", + "from": "@emmetio/css-abbreviation@>=0.3.1 <0.4.0", + "resolved": "https://registry.npmjs.org/@emmetio/css-abbreviation/-/css-abbreviation-0.3.1.tgz" + }, + "@emmetio/css-parser": { + "version": "0.3.0", + "from": "@emmetio/css-parser@>=0.3.0 <0.4.0", + "resolved": "https://registry.npmjs.org/@emmetio/css-parser/-/css-parser-0.3.0.tgz" + }, + "@emmetio/css-snippets-resolver": { + "version": "0.2.5", + "from": "@emmetio/css-snippets-resolver@>=0.2.5 <0.3.0", + "resolved": "https://registry.npmjs.org/@emmetio/css-snippets-resolver/-/css-snippets-resolver-0.2.5.tgz" + }, + "@emmetio/expand-abbreviation": { + "version": "0.5.8", + "from": "@emmetio/expand-abbreviation@>=0.5.8 <0.6.0", + "resolved": "https://registry.npmjs.org/@emmetio/expand-abbreviation/-/expand-abbreviation-0.5.8.tgz" + }, + "@emmetio/extract-abbreviation": { + "version": "0.1.2", + "from": "@emmetio/extract-abbreviation@>=0.1.1 <0.2.0", + "resolved": "https://registry.npmjs.org/@emmetio/extract-abbreviation/-/extract-abbreviation-0.1.2.tgz" + }, + "@emmetio/field-parser": { + "version": "0.3.0", + "from": "@emmetio/field-parser@>=0.3.0 <0.4.0", + "resolved": "https://registry.npmjs.org/@emmetio/field-parser/-/field-parser-0.3.0.tgz" + }, + "@emmetio/html-matcher": { + "version": "0.3.2", + "from": "@emmetio/html-matcher@>=0.3.1 <0.4.0", + "resolved": "https://registry.npmjs.org/@emmetio/html-matcher/-/html-matcher-0.3.2.tgz" + }, + "@emmetio/html-snippets-resolver": { + "version": "0.1.4", + "from": "@emmetio/html-snippets-resolver@>=0.1.4 <0.2.0", + "resolved": "https://registry.npmjs.org/@emmetio/html-snippets-resolver/-/html-snippets-resolver-0.1.4.tgz" + }, + "@emmetio/html-transform": { + "version": "0.3.2", + "from": "@emmetio/html-transform@>=0.3.2 <0.4.0", + "resolved": "https://registry.npmjs.org/@emmetio/html-transform/-/html-transform-0.3.2.tgz" + }, + "@emmetio/implicit-tag": { + "version": "1.0.0", + "from": "@emmetio/implicit-tag@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/@emmetio/implicit-tag/-/implicit-tag-1.0.0.tgz" + }, + "@emmetio/lorem": { + "version": "1.0.1", + "from": "@emmetio/lorem@>=1.0.1 <2.0.0", + "resolved": "https://registry.npmjs.org/@emmetio/lorem/-/lorem-1.0.1.tgz" + }, + "@emmetio/markup-formatters": { + "version": "0.3.3", + "from": "@emmetio/markup-formatters@>=0.3.3 <0.4.0", + "resolved": "https://registry.npmjs.org/@emmetio/markup-formatters/-/markup-formatters-0.3.3.tgz" + }, + "@emmetio/math-expression": { + "version": "0.1.1", + "from": "@emmetio/math-expression@>=0.1.1 <0.2.0", + "resolved": "https://registry.npmjs.org/@emmetio/math-expression/-/math-expression-0.1.1.tgz" + }, + "@emmetio/node": { + "version": "0.1.2", + "from": "@emmetio/node@>=0.1.2 <0.2.0", + "resolved": "https://registry.npmjs.org/@emmetio/node/-/node-0.1.2.tgz" + }, + "@emmetio/output-profile": { + "version": "0.1.5", + "from": "@emmetio/output-profile@>=0.1.5 <0.2.0", + "resolved": "https://registry.npmjs.org/@emmetio/output-profile/-/output-profile-0.1.5.tgz" + }, + "@emmetio/output-renderer": { + "version": "0.1.1", + "from": "@emmetio/output-renderer@>=0.1.0 <0.2.0", + "resolved": "https://registry.npmjs.org/@emmetio/output-renderer/-/output-renderer-0.1.1.tgz" + }, + "@emmetio/snippets": { + "version": "0.2.3", + "from": "@emmetio/snippets@>=0.2.3 <0.3.0", + "resolved": "https://registry.npmjs.org/@emmetio/snippets/-/snippets-0.2.3.tgz" + }, + "@emmetio/snippets-registry": { + "version": "0.3.1", + "from": "@emmetio/snippets-registry@>=0.3.1 <0.4.0", + "resolved": "https://registry.npmjs.org/@emmetio/snippets-registry/-/snippets-registry-0.3.1.tgz" + }, + "@emmetio/stream-reader": { + "version": "2.2.0", + "from": "@emmetio/stream-reader@>=2.2.0 <3.0.0", + "resolved": "https://registry.npmjs.org/@emmetio/stream-reader/-/stream-reader-2.2.0.tgz" + }, + "@emmetio/stream-reader-utils": { + "version": "0.1.0", + "from": "@emmetio/stream-reader-utils@>=0.1.0 <0.2.0", + "resolved": "https://registry.npmjs.org/@emmetio/stream-reader-utils/-/stream-reader-utils-0.1.0.tgz" + }, + "@emmetio/stylesheet-formatters": { + "version": "0.1.2", + "from": "@emmetio/stylesheet-formatters@>=0.1.2 <0.2.0", + "resolved": "https://registry.npmjs.org/@emmetio/stylesheet-formatters/-/stylesheet-formatters-0.1.2.tgz" + }, + "@emmetio/variable-resolver": { + "version": "0.2.1", + "from": "@emmetio/variable-resolver@>=0.2.1 <0.3.0", + "resolved": "https://registry.npmjs.org/@emmetio/variable-resolver/-/variable-resolver-0.2.1.tgz" + }, + "vscode-emmet-helper": { + "version": "0.0.8", + "from": "vscode-emmet-helper@0.0.8", + "resolved": "https://registry.npmjs.org/vscode-emmet-helper/-/vscode-emmet-helper-0.0.8.tgz" + } + } +} diff --git a/extensions/emmet/package.json b/extensions/emmet/package.json index 177d7be2cecad17c89cd502ad4f6ff2ecde23048..f9e664ab91fd421772a5a7f4cc74c9faf35eb3ba 100644 --- a/extensions/emmet/package.json +++ b/extensions/emmet/package.json @@ -5,7 +5,7 @@ "version": "0.0.1", "publisher": "vscode", "engines": { - "vscode": "^1.10.0" + "vscode": "^1.13.0" }, "categories": [ "Other" @@ -15,56 +15,66 @@ "url": "https://github.com/Microsoft/vscode-emmet" }, "activationEvents": [ - "onLanguage:html", - "onLanguage:jade", - "onLanguage:slim", - "onLanguage:haml", - "onLanguage:xml", - "onLanguage:xsl", - "onLanguage:css", - "onLanguage:scss", - "onLanguage:sass", - "onLanguage:less", - "onLanguage:stylus", - "onLanguage:javascriptreact", - "onLanguage:typescriptreact" + "*" ], "main": "./out/extension", "contributes": { "configuration": { "type": "object", - "title": "Emmet configuration", + "title": "Emmet", "properties": { - "emmet.suggestExpandedAbbreviation": { + "emmet.showExpandedAbbreviation": { "type": "boolean", "default": true, "description": "Shows expanded emmet abbreviations as suggestions" }, - "emmet.suggestAbbreviations": { + "emmet.showAbbreviationSuggestions": { "type": "boolean", "default": true, "description": "Shows possible emmet abbreviations as suggestions" + }, + "emmet.variables":{ + "type": "object", + "properties": { + "lang": { + "type": "string", + "default": "en" + }, + "locale": { + "type": "string", + "default": "en-US" + }, + "charset": { + "type": "string", + "default": "UTF-8" + }, + "indentation": { + "type": "string", + "default": "\t" + }, + "newline": { + "type": "string", + "default": "\n" + } + }, + "default":{}, + "description": "Variables to be used in emmet snippets" } } } }, "scripts": { - "vscode:prepublish": "tsc -p ./", - "compile": "tsc -watch -p ./", - "postinstall": "node ./node_modules/vscode/bin/install", - "test": "node ./node_modules/vscode/bin/test" + "compile": "gulp compile-extension:emmet" }, "devDependencies": { - "typescript": "^2.0.3", - "vscode": "^1.0.0", - "mocha": "^2.3.3", - "@types/node": "^6.0.40", - "@types/mocha": "^2.2.32" + "@types/node": "^7.0.4" }, "dependencies": { - "@emmetio/expand-abbreviation": "^0.5.4", + "@emmetio/expand-abbreviation": "^0.5.8", "@emmetio/extract-abbreviation": "^0.1.1", "@emmetio/html-matcher": "^0.3.1", - "@emmetio/css-parser": "^0.3.0" + "@emmetio/css-parser": "^0.3.0", + "@emmetio/math-expression": "^0.1.1", + "vscode-emmet-helper":"0.0.8" } } \ No newline at end of file diff --git a/extensions/emmet/src/abbreviationActions.ts b/extensions/emmet/src/abbreviationActions.ts index c95bfed321156d20aa3e7b42e48695306847468e..a79e4b6e3afbe9baa6c44319c8515c3aafed88cf 100644 --- a/extensions/emmet/src/abbreviationActions.ts +++ b/extensions/emmet/src/abbreviationActions.ts @@ -5,9 +5,18 @@ import * as vscode from 'vscode'; import { expand } from '@emmetio/expand-abbreviation'; -import { getSyntax, getProfile, extractAbbreviation } from './util'; +import parseStylesheet from '@emmetio/css-parser'; +import parse from '@emmetio/html-matcher'; +import Node from '@emmetio/node'; +import { getSyntax, getNode, getInnerRange } from './util'; +import { getExpandOptions, extractAbbreviation, isStyleSheet } from 'vscode-emmet-helper'; +import { DocumentStreamReader } from './bufferStream'; -const field = (index, placeholder) => `\${${index}${placeholder ? ':' + placeholder : ''}}`; +interface ExpandAbbreviationInput { + abbreviation: string; + rangeToReplace: vscode.Range; + textToWrap?: string; +} export function wrapWithAbbreviation() { let editor = vscode.window.activeTextEditor; @@ -15,43 +24,131 @@ export function wrapWithAbbreviation() { vscode.window.showInformationMessage('No editor is active'); return; } - let rangeToReplace: vscode.Range = editor.selection; - if (rangeToReplace.isEmpty) { - rangeToReplace = new vscode.Range(rangeToReplace.start.line, 0, rangeToReplace.start.line, editor.document.lineAt(rangeToReplace.start.line).text.length); - } - let textToReplace = editor.document.getText(rangeToReplace); - let options = { - field: field, - syntax: getSyntax(editor.document), - profile: getProfile(getSyntax(editor.document)), - text: textToReplace - }; - - vscode.window.showInputBox({ prompt: 'Enter Abbreviation' }).then(abbr => { - if (!abbr || !abbr.trim()) { return; } - let expandedText = expand(abbr, options); - editor.insertSnippet(new vscode.SnippetString(expandedText), rangeToReplace); + const newLine = editor.document.eol === vscode.EndOfLine.LF ? '\n' : '\r\n'; + let syntax = getSyntax(editor.document); + + vscode.window.showInputBox({ prompt: 'Enter Abbreviation' }).then(abbreviation => { + if (!abbreviation || !abbreviation.trim()) { return; } + + let expandAbbrList: ExpandAbbreviationInput[] = []; + let firstTextToReplace: string; + let allTextToReplaceSame: boolean = true; + + editor.selections.forEach(selection => { + let rangeToReplace: vscode.Range = selection; + if (rangeToReplace.isEmpty) { + rangeToReplace = new vscode.Range(rangeToReplace.start.line, 0, rangeToReplace.start.line, editor.document.lineAt(rangeToReplace.start.line).text.length); + } + let textToWrap = newLine + editor.document.getText(rangeToReplace) + newLine; + + if (!firstTextToReplace) { + firstTextToReplace = textToWrap; + } else if (allTextToReplaceSame && firstTextToReplace !== textToWrap) { + allTextToReplaceSame = false; + } + + expandAbbrList.push({ abbreviation, rangeToReplace, textToWrap }); + }); + + expandAbbr(editor, expandAbbrList, syntax, allTextToReplaceSame); }); } -export function expandAbbreviation() { +export function expandAbbreviation(args) { + let editor = vscode.window.activeTextEditor; if (!editor) { vscode.window.showInformationMessage('No editor is active'); return; } - let rangeToReplace: vscode.Range = editor.selection; - let abbr = editor.document.getText(rangeToReplace); - if (rangeToReplace.isEmpty) { - [rangeToReplace, abbr] = extractAbbreviation(rangeToReplace.start); + if (typeof args !== 'object' || !args['syntax']) { + return; } + let syntax = args['syntax']; + let parseContent = isStyleSheet(syntax) ? parseStylesheet : parse; + let rootNode: Node = parseContent(new DocumentStreamReader(editor.document)); + + let abbreviationList: ExpandAbbreviationInput[] = []; + let firstAbbreviation: string; + let allAbbreviationsSame: boolean = true; + + editor.selections.forEach(selection => { + let rangeToReplace: vscode.Range = selection; + let position = selection.isReversed ? selection.anchor : selection.active; + let abbreviation = editor.document.getText(rangeToReplace); + if (rangeToReplace.isEmpty) { + [rangeToReplace, abbreviation] = extractAbbreviation(editor.document, position); + } + + let currentNode = getNode(rootNode, position); + if (!isValidLocationForEmmetAbbreviation(currentNode, syntax, position)) { + return; + } + + if (!firstAbbreviation) { + firstAbbreviation = abbreviation; + } else if (allAbbreviationsSame && firstAbbreviation !== abbreviation) { + allAbbreviationsSame = false; + } + + abbreviationList.push({ abbreviation, rangeToReplace }); + }); + + expandAbbr(editor, abbreviationList, syntax, allAbbreviationsSame); +} - let options = { - field: field, - syntax: getSyntax(editor.document), - profile: getProfile(getSyntax(editor.document)) - }; - let expandedText = expand(abbr, options); - editor.insertSnippet(new vscode.SnippetString(expandedText), rangeToReplace); +/** + * Checks if given position is a valid location to expand emmet abbreviation. + * Works only on html and css/less/scss syntax + * @param currentNode parsed node at given position + * @param syntax syntax of the abbreviation + * @param position position to validate + */ +export function isValidLocationForEmmetAbbreviation(currentNode: Node, syntax: string, position: vscode.Position): boolean { + if (!currentNode) { + return true; + } + + if (isStyleSheet(syntax)) { + return currentNode.type !== 'rule' + || (currentNode.selectorToken && position.isAfter(currentNode.selectorToken.end)); + } + + if (currentNode.close) { + return getInnerRange(currentNode).contains(position); + } + + return false; +} + +function expandAbbr(editor: vscode.TextEditor, expandAbbrList: ExpandAbbreviationInput[], syntax: string, insertSameSnippet: boolean) { + if (!expandAbbrList || expandAbbrList.length === 0) { + return; + } + + // Snippet to replace at multiple cursors are not the same + // `editor.insertSnippet` will have to be called for each instance separately + // We will not be able to maintain multiple cursors after snippet insertion + if (!insertSameSnippet) { + expandAbbrList.forEach((expandAbbrInput: ExpandAbbreviationInput) => { + let expandedText = expand(expandAbbrInput.abbreviation, getExpandOptions(syntax, expandAbbrInput.textToWrap)); + if (expandedText) { + editor.insertSnippet(new vscode.SnippetString(expandedText), expandAbbrInput.rangeToReplace); + } + }); + return; + } + + // Snippet to replace at all cursors are the same + // We can pass all ranges to `editor.insertSnippet` in a single call so that + // all cursors are maintained after snippet insertion + const anyExpandAbbrInput = expandAbbrList[0]; + let expandedText = expand(anyExpandAbbrInput.abbreviation, getExpandOptions(syntax, anyExpandAbbrInput.textToWrap)); + let allRanges = expandAbbrList.map(value => { + return value.rangeToReplace; + }); + if (expandedText) { + editor.insertSnippet(new vscode.SnippetString(expandedText), allRanges); + } } \ No newline at end of file diff --git a/extensions/emmet/src/balance.ts b/extensions/emmet/src/balance.ts index 02dd4c902d155779f18de2719dd4a4cf3b96c6f7..f48568ea7012e3bcb6c5c850bf0487bf58137a28 100644 --- a/extensions/emmet/src/balance.ts +++ b/extensions/emmet/src/balance.ts @@ -4,9 +4,11 @@ *--------------------------------------------------------------------------------------------*/ import * as vscode from 'vscode'; -import { getNode, getNodeOuterSelection, getNodeInnerSelection, isStyleSheet } from './util'; import parse from '@emmetio/html-matcher'; import Node from '@emmetio/node'; +import { DocumentStreamReader } from './bufferStream'; +import { isStyleSheet } from 'vscode-emmet-helper'; +import { getNode } from './util'; export function balanceOut() { balance(true); @@ -27,14 +29,12 @@ function balance(out: boolean) { } let getRangeFunction = out ? getRangeToBalanceOut : getRangeToBalanceIn; - let rootNode: Node = parse(editor.document.getText()); + let rootNode: Node = parse(new DocumentStreamReader(editor.document)); let newSelections: vscode.Selection[] = []; editor.selections.forEach(selection => { let range = getRangeFunction(editor.document, selection, rootNode); - if (range) { - newSelections.push(range); - } + newSelections.push(range ? range : selection); }); editor.selection = newSelections[0]; @@ -42,11 +42,16 @@ function balance(out: boolean) { } function getRangeToBalanceOut(document: vscode.TextDocument, selection: vscode.Selection, rootNode: Node): vscode.Selection { - let offset = document.offsetAt(selection.start); - let nodeToBalance = getNode(rootNode, offset); + let nodeToBalance = getNode(rootNode, selection.start); + if (!nodeToBalance) { + return; + } + if (!nodeToBalance.close) { + return new vscode.Selection(nodeToBalance.start, nodeToBalance.end); + } - let innerSelection = getNodeInnerSelection(document, nodeToBalance); - let outerSelection = getNodeOuterSelection(document, nodeToBalance); + let innerSelection = new vscode.Selection(nodeToBalance.open.end, nodeToBalance.close.start); + let outerSelection = new vscode.Selection(nodeToBalance.start, nodeToBalance.end); if (innerSelection.contains(selection) && !innerSelection.isEqual(selection)) { return innerSelection; @@ -58,18 +63,26 @@ function getRangeToBalanceOut(document: vscode.TextDocument, selection: vscode.S } function getRangeToBalanceIn(document: vscode.TextDocument, selection: vscode.Selection, rootNode: Node): vscode.Selection { - let offset = document.offsetAt(selection.start); - let nodeToBalance: Node = getNode(rootNode, offset); + let nodeToBalance: Node = getNode(rootNode, selection.start, true); + + if (!nodeToBalance) { + return; + } if (!nodeToBalance.firstChild) { - return selection; + if (nodeToBalance.close) { + return new vscode.Selection(nodeToBalance.open.end, nodeToBalance.close.start); + } + return; } - if (nodeToBalance.firstChild.start === offset && nodeToBalance.firstChild.end === document.offsetAt(selection.end)) { - return getNodeInnerSelection(document, nodeToBalance.firstChild); + if (selection.start.isEqual(nodeToBalance.firstChild.start) + && selection.end.isEqual(nodeToBalance.firstChild.end) + && nodeToBalance.firstChild.close) { + return new vscode.Selection(nodeToBalance.firstChild.open.end, nodeToBalance.firstChild.close.start); } - return new vscode.Selection(document.positionAt(nodeToBalance.firstChild.start), document.positionAt(nodeToBalance.firstChild.end)); + return new vscode.Selection(nodeToBalance.firstChild.start, nodeToBalance.firstChild.end); } diff --git a/extensions/emmet/src/bufferStream.ts b/extensions/emmet/src/bufferStream.ts new file mode 100644 index 0000000000000000000000000000000000000000..a7a6cd5a0d25dad2d4df3f40987fc531e0da693b --- /dev/null +++ b/extensions/emmet/src/bufferStream.ts @@ -0,0 +1,189 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +/* Based on @sergeche's work in his emmet plugin */ + +'use strict'; + +import { TextDocument, Position, Range, EndOfLine } from 'vscode'; + +/** + * A stream reader for VSCode's `TextDocument` + * Based on @emmetio/stream-reader and @emmetio/atom-plugin + */ +export class DocumentStreamReader { + private document: TextDocument; + private start: Position; + private _eof: Position; + public pos: Position; + private _eol: string; + + /** + * @param {TextDocument} buffer + * @param {Position} pos + * @param {Range} limit + */ + constructor(document: TextDocument, pos?: Position, limit?: Range) { + + this.document = document; + this.start = this.pos = pos ? pos : new Position(0, 0); + this._eof = limit ? limit.end : new Position(this.document.lineCount - 1, this._lineLength(this.document.lineCount - 1)); + this._eol = this.document.eol === EndOfLine.LF ? '\n' : '\r\n'; + } + + /** + * Returns true only if the stream is at the end of the file. + * @returns {Boolean} + */ + eof() { + return this.pos.isAfterOrEqual(this._eof); + } + + /** + * Creates a new stream instance which is limited to given range for given document + * @param {Position} start + * @param {Position} end + * @return {DocumentStreamReader} + */ + limit(start, end) { + return new DocumentStreamReader(this.document, start, new Range(start, end)); + } + + /** + * Returns the next character code in the stream without advancing it. + * Will return NaN at the end of the file. + * @returns {Number} + */ + peek() { + if (this.eof()) { + return NaN; + } + const line = this.document.lineAt(this.pos.line).text; + return this.pos.character < line.length ? line.charCodeAt(this.pos.character) : this._eol.charCodeAt(this.pos.character - line.length); + } + + /** + * Returns the next character in the stream and advances it. + * Also returns NaN when no more characters are available. + * @returns {Number} + */ + next() { + if (this.eof()) { + return NaN; + } + + const line = this.document.lineAt(this.pos.line).text; + let code: number; + if (this.pos.character < line.length) { + code = line.charCodeAt(this.pos.character); + this.pos = this.pos.translate(0, 1); + } else { + code = this._eol.charCodeAt(this.pos.character - line.length); + this.pos = new Position(this.pos.line + 1, 0); + } + + if (this.eof()) { + // restrict pos to eof, if in case it got moved beyond eof + this.pos = new Position(this._eof.line, this._eof.character); + } + + return code; + } + + /** + * Backs up the stream n characters. Backing it up further than the + * start of the current token will cause things to break, so be careful. + * @param {Number} n + */ + backUp(n) { + let row = this.pos.line; + let column = this.pos.character; + column -= (n || 1); + + while (row >= 0 && column < 0) { + row--; + column += this._lineLength(row); + } + + this.pos = row < 0 || column < 0 + ? new Position(0, 0) + : new Position(row, column); + + return this.peek(); + } + + /** + * Get the string between the start of the current token and the + * current stream position. + * @returns {String} + */ + current() { + return this.substring(this.start, this.pos); + } + + /** + * Returns contents for given range + * @param {Position} from + * @param {Position} to + * @return {String} + */ + substring(from, to) { + return this.document.getText(new Range(from, to)); + } + + /** + * Creates error object with current stream state + * @param {String} message + * @return {Error} + */ + error(message) { + const err = new Error(`${message} at row ${this.pos.line}, column ${this.pos.character}`); + + return err; + } + + /** + * Returns line length of given row, including line ending + * @param {Number} row + * @return {Number} + */ + _lineLength(row) { + if (row === this.document.lineCount - 1) { + return this.document.lineAt(row).text.length; + } + return this.document.lineAt(row).text.length + this._eol.length; + } + + /** + * `match` can be a character code or a function that takes a character code + * and returns a boolean. If the next character in the stream 'matches' + * the given argument, it is consumed and returned. + * Otherwise, `false` is returned. + * @param {Number|Function} match + * @returns {Boolean} + */ + eat(match) { + const ch = this.peek(); + const ok = typeof match === 'function' ? match(ch) : ch === match; + + if (ok) { + this.next(); + } + + return ok; + } + + /** + * Repeatedly calls eat with the given argument, until it + * fails. Returns true if any characters were eaten. + * @param {Object} match + * @returns {Boolean} + */ + eatWhile(match) { + const start = this.pos; + while (!this.eof() && this.eat(match)) { } + return !this.pos.isEqual(start); + } +} diff --git a/extensions/emmet/src/defaultCompletionProvider.ts b/extensions/emmet/src/defaultCompletionProvider.ts new file mode 100644 index 0000000000000000000000000000000000000000..7febe4d1ac1d0d1aa70a2feeba1c247677274e85 --- /dev/null +++ b/extensions/emmet/src/defaultCompletionProvider.ts @@ -0,0 +1,57 @@ +/*--------------------------------------------------------------------------------------------- + * 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 parseStylesheet from '@emmetio/css-parser'; +import parse from '@emmetio/html-matcher'; +import Node from '@emmetio/node'; +import { DocumentStreamReader } from './bufferStream'; +import { EmmetCompletionItemProvider, isStyleSheet } from 'vscode-emmet-helper'; +import { isValidLocationForEmmetAbbreviation } from './abbreviationActions'; +import { getSyntax, getNode, getInnerRange } from './util'; + +export class DefaultCompletionItemProvider implements vscode.CompletionItemProvider { + + public provideCompletionItems(document: vscode.TextDocument, position: vscode.Position, token: vscode.CancellationToken): Thenable { + let syntax = getSyntax(document); + syntax = this.syntaxHelper(syntax, document, position); + + if (!syntax) { + return; + } + + const emmetCompletionProvider = new EmmetCompletionItemProvider(syntax); + return emmetCompletionProvider.provideCompletionItems(document, position, token); + } + + /** + * Checks whether given position is valid for emmet abbreviation and returns appropriate syntax + * @param syntax string language mode of current document + * @param document vscode.Textdocument + * @param position vscode.Position position of the abbreviation that needs to be expanded + */ + private syntaxHelper(syntax: string, document: vscode.TextDocument, position: vscode.Position): string { + let parseContent = isStyleSheet(syntax) ? parseStylesheet : parse; + let rootNode: Node = parseContent(new DocumentStreamReader(document)); + let currentNode = getNode(rootNode, position); + + if (!isStyleSheet(syntax) + && currentNode + && currentNode.close + && currentNode.name === 'style' + && getInnerRange(currentNode).contains(position)) { + return 'css'; + } + + if (!isValidLocationForEmmetAbbreviation(currentNode, syntax, position)) { + return; + } + return syntax; + } + + + + +} \ No newline at end of file diff --git a/extensions/emmet/src/editPoint.ts b/extensions/emmet/src/editPoint.ts index 757dad1b16a7e1afea5790356bb88d8ffffe7531..2028d3295b3c6b61ece84fbb92e01e2613652c75 100644 --- a/extensions/emmet/src/editPoint.ts +++ b/extensions/emmet/src/editPoint.ts @@ -15,9 +15,10 @@ export function fetchEditPoint(direction: string): void { let newSelections: vscode.Selection[] = []; editor.selections.forEach(selection => { let updatedSelection = direction === 'next' ? nextEditPoint(selection.anchor, editor) : prevEditPoint(selection.anchor, editor); - newSelections.push(updatedSelection); + newSelections.push(updatedSelection ? updatedSelection : selection); }); editor.selections = newSelections; + editor.revealRange(editor.selections[editor.selections.length - 1]); } function nextEditPoint(position: vscode.Position, editor: vscode.TextEditor): vscode.Selection { @@ -41,13 +42,12 @@ function prevEditPoint(position: vscode.Position, editor: vscode.TextEditor): vs function findEditPoint(lineNum: number, editor: vscode.TextEditor, position: vscode.Position, direction: string): vscode.Selection { let line = editor.document.lineAt(lineNum); + let lineContent = line.text; if (lineNum !== position.line && line.isEmptyOrWhitespace) { - editor.selection = new vscode.Selection(lineNum, 0, lineNum, 0); - return; + return new vscode.Selection(lineNum, lineContent.length, lineNum, lineContent.length); } - let lineContent = line.text; if (lineNum === position.line && direction === 'prev') { lineContent = lineContent.substr(0, position.character); } diff --git a/extensions/emmet/src/emmetCompletionProvider.ts b/extensions/emmet/src/emmetCompletionProvider.ts deleted file mode 100644 index 9fb7bf46af5bdc49dc73cbce4db717dddfa2443a..0000000000000000000000000000000000000000 --- a/extensions/emmet/src/emmetCompletionProvider.ts +++ /dev/null @@ -1,105 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -import * as vscode from 'vscode'; -import { expand, createSnippetsRegistry } from '@emmetio/expand-abbreviation'; -import { getSyntax, isStyleSheet, getProfile, extractAbbreviation } from './util'; - -const field = (index, placeholder) => `\${${index}${placeholder ? ':' + placeholder : ''}}`; -const snippetCompletionsCache = new Map(); - -export class EmmetCompletionItemProvider implements vscode.CompletionItemProvider { - - public provideCompletionItems(document: vscode.TextDocument, position: vscode.Position, token: vscode.CancellationToken): Thenable { - - if (!vscode.workspace.getConfiguration('emmet')['useModules']) { - return Promise.resolve(null); - } - - let currentWord = getCurrentWord(document, position); - let expandedAbbr = getExpandedAbbreviation(document, position); - let abbreviationSuggestions = getAbbreviationSuggestions(getSyntax(document), currentWord, (expandedAbbr && currentWord === expandedAbbr.label)); - let completionItems = expandedAbbr ? [expandedAbbr, ...abbreviationSuggestions] : abbreviationSuggestions; - - return Promise.resolve(new vscode.CompletionList(completionItems, true)); - } -} - -function getExpandedAbbreviation(document: vscode.TextDocument, position: vscode.Position): vscode.CompletionItem { - if (!vscode.workspace.getConfiguration('emmet')['suggestExpandedAbbreviation']) { - return; - } - let [rangeToReplace, wordToExpand] = extractAbbreviation(position); - if (!rangeToReplace || !wordToExpand) { - return; - } - let syntax = getSyntax(document); - let expandedWord = expand(wordToExpand, { - field: field, - syntax: syntax, - profile: getProfile(syntax) - }); - - let completionitem = new vscode.CompletionItem(wordToExpand); - completionitem.insertText = new vscode.SnippetString(expandedWord); - completionitem.documentation = removeTabStops(expandedWord); - completionitem.range = rangeToReplace; - completionitem.detail = 'Expand Emmet Abbreviation'; - - // In non stylesheet like syntax, this extension returns expanded abbr plus posssible abbr completions - // To differentiate between the 2, the former is given CompletionItemKind.Value so that it gets a different icon - if (!isStyleSheet(syntax)) { - completionitem.kind = vscode.CompletionItemKind.Value; - } - return completionitem; -} - -function getCurrentWord(document: vscode.TextDocument, position: vscode.Position): string { - let wordAtPosition = document.getWordRangeAtPosition(position); - let currentWord = ''; - if (wordAtPosition && wordAtPosition.start.character < position.character) { - let word = document.getText(wordAtPosition); - currentWord = word.substr(0, position.character - wordAtPosition.start.character); - } - - return currentWord; -} - -function removeTabStops(expandedWord: string): string { - return expandedWord.replace(/\$\{\d+\}/g, '').replace(/\$\{\d+:([^\}]+)\}/g, '$1'); -} -function getAbbreviationSuggestions(syntax: string, prefix: string, skipExactMatch: boolean) { - if (!vscode.workspace.getConfiguration('emmet')['suggestAbbreviations'] || !prefix || isStyleSheet(syntax)) { - return []; - } - - if (!snippetCompletionsCache.has(syntax)) { - let registry = createSnippetsRegistry(syntax); - let completions: vscode.CompletionItem[] = registry.all({ type: 'string' }).map(snippet => { - let expandedWord = expand(snippet.value, { - field: field, - syntax: syntax - }); - - let item = new vscode.CompletionItem(snippet.key); - item.documentation = removeTabStops(expandedWord); - item.detail = 'Complete Emmet Abbreviation'; - item.insertText = snippet.key; - return item; - }); - snippetCompletionsCache.set(syntax, completions); - } - - let snippetCompletions = snippetCompletionsCache.get(syntax); - - snippetCompletions = snippetCompletions.filter(x => x.label.startsWith(prefix) && (!skipExactMatch || x.label !== prefix)); - - return snippetCompletions; - -} - - - diff --git a/extensions/emmet/src/evaluateMathExpression.ts b/extensions/emmet/src/evaluateMathExpression.ts new file mode 100644 index 0000000000000000000000000000000000000000..46c5a197bb845e4464f14b6ea00c34f27bc39e93 --- /dev/null +++ b/extensions/emmet/src/evaluateMathExpression.ts @@ -0,0 +1,34 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +/* Based on @sergeche's work in his emmet plugin */ + +import * as vscode from 'vscode'; +import evaluate from '@emmetio/math-expression'; +import { DocumentStreamReader } from './bufferStream'; + +export function evaluateMathExpression() { + let editor = vscode.window.activeTextEditor; + if (!editor) { + vscode.window.showInformationMessage('No editor is active'); + return; + } + const stream = new DocumentStreamReader(editor.document); + editor.edit(editBuilder => { + editor.selections.forEach(selection => { + const pos = selection.isReversed ? selection.anchor : selection.active; + stream.pos = pos; + + try { + const result = String(evaluate(stream, true)); + editBuilder.replace(new vscode.Range(stream.pos, pos), result); + } catch (err) { + // Ignore error since most likely it’s because of non-math expression + console.warn('Math evaluation error', err); + } + }); + }); + +} diff --git a/extensions/emmet/src/extension.ts b/extensions/emmet/src/extension.ts index 15a1bfa4a0336107337573e777e733bdb7f05244..d360663bd21761dd780c7b8bf3ff99b89077e8a9 100644 --- a/extensions/emmet/src/extension.ts +++ b/extensions/emmet/src/extension.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import * as vscode from 'vscode'; -import { EmmetCompletionItemProvider } from './emmetCompletionProvider'; +import { DefaultCompletionItemProvider } from './defaultCompletionProvider'; import { expandAbbreviation, wrapWithAbbreviation } from './abbreviationActions'; import { removeTag } from './removeTag'; import { updateTag } from './updateTag'; @@ -15,46 +15,28 @@ import { mergeLines } from './mergeLines'; import { toggleComment } from './toggleComment'; import { fetchEditPoint } from './editPoint'; import { fetchSelectItem } from './selectItem'; - -interface ISupportedLanguageMode { - id: string; - triggerCharacters: string[]; -} - -const SUPPORTED_LANGUAGE_MODES: ISupportedLanguageMode[] = [ - { id: 'html', triggerCharacters: ['!', '.'] }, - { id: 'jade', triggerCharacters: ['!', '.'] }, - { id: 'slim', triggerCharacters: ['!', '.'] }, - { id: 'haml', triggerCharacters: ['!', '.'] }, - { id: 'xml', triggerCharacters: ['.'] }, - { id: 'xsl', triggerCharacters: ['.'] }, - - { id: 'css', triggerCharacters: [':'] }, - { id: 'scss', triggerCharacters: [':'] }, - { id: 'sass', triggerCharacters: [':'] }, - { id: 'less', triggerCharacters: [':'] }, - { id: 'stylus', triggerCharacters: [':'] }, - - { id: 'javascriptreact', triggerCharacters: ['.'] }, - { id: 'typescriptreact', triggerCharacters: ['.'] } -]; +import { evaluateMathExpression } from './evaluateMathExpression'; +import { incrementDecrement } from './incrementDecrement'; +import { LANGUAGE_MODES, getExcludedModes } from './util'; +import { updateExtensionsPath } from 'vscode-emmet-helper'; export function activate(context: vscode.ExtensionContext) { - let completionProvider = new EmmetCompletionItemProvider(); - - for (let language of SUPPORTED_LANGUAGE_MODES) { - const selector: vscode.DocumentFilter = { language: language.id, scheme: 'file' }; - const provider = vscode.languages.registerCompletionItemProvider(selector, completionProvider, ...language.triggerCharacters); - + let completionProvider = new DefaultCompletionItemProvider(); + let exlcludedLanguages = getExcludedModes(); + Object.keys(LANGUAGE_MODES).forEach(language => { + if (exlcludedLanguages.indexOf(language) > -1) { + return; + } + const provider = vscode.languages.registerCompletionItemProvider(language, completionProvider, ...LANGUAGE_MODES[language]); context.subscriptions.push(provider); - } + }); context.subscriptions.push(vscode.commands.registerCommand('emmet.wrapWithAbbreviation', () => { wrapWithAbbreviation(); })); - context.subscriptions.push(vscode.commands.registerCommand('emmet.expandAbbreviation', () => { - expandAbbreviation(); + context.subscriptions.push(vscode.commands.registerCommand('emmet.expandAbbreviation', (args) => { + expandAbbreviation(args); })); context.subscriptions.push(vscode.commands.registerCommand('emmet.removeTag', () => { @@ -107,6 +89,40 @@ export function activate(context: vscode.ExtensionContext) { fetchSelectItem('prev'); })); + context.subscriptions.push(vscode.commands.registerCommand('emmet.evaluateMathExpression', () => { + evaluateMathExpression(); + })); + + context.subscriptions.push(vscode.commands.registerCommand('emmet.incrementNumberByOneTenth', () => { + incrementDecrement(.1); + })); + + context.subscriptions.push(vscode.commands.registerCommand('emmet.incrementNumberByOne', () => { + incrementDecrement(1); + })); + + context.subscriptions.push(vscode.commands.registerCommand('emmet.incrementNumberByTen', () => { + incrementDecrement(10); + })); + + context.subscriptions.push(vscode.commands.registerCommand('emmet.decrementNumberByOneTenth', () => { + incrementDecrement(-0.1); + })); + + context.subscriptions.push(vscode.commands.registerCommand('emmet.decrementNumberByOne', () => { + incrementDecrement(-1); + })); + + context.subscriptions.push(vscode.commands.registerCommand('emmet.decrementNumberByTen', () => { + incrementDecrement(-10); + })); + + + + updateExtensionsPath(); + context.subscriptions.push(vscode.workspace.onDidChangeConfiguration(() => { + updateExtensionsPath(); + })); } export function deactivate() { diff --git a/extensions/emmet/src/incrementDecrement.ts b/extensions/emmet/src/incrementDecrement.ts new file mode 100644 index 0000000000000000000000000000000000000000..9f772b133eea2913b4d7e38ca0f7808895d8c13c --- /dev/null +++ b/extensions/emmet/src/incrementDecrement.ts @@ -0,0 +1,119 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +/* Based on @sergeche's work in his emmet plugin */ + +import * as vscode from 'vscode'; + +const reNumber = /[0-9]/; + +/** + * Incerement number under caret of given editor + * @param {Number} delta + */ +export function incrementDecrement(delta: number) { + let editor = vscode.window.activeTextEditor; + if (!editor) { + vscode.window.showInformationMessage('No editor is active'); + return; + } + + editor.edit(editBuilder => { + editor.selections.forEach(selection => { + let rangeToReplace: vscode.Range = selection; + if (selection.isEmpty) { + rangeToReplace = locate(editor.document, selection.isReversed ? selection.anchor : selection.active); + } + + const text = editor.document.getText(rangeToReplace); + if (isValidNumber(text)) { + editBuilder.replace(rangeToReplace, update(text, delta)); + } + }); + }); +} + +/** + * Updates given number with `delta` and returns string formatted according + * to original string format + * @param {String} numString + * @param {Number} delta + * @return {String} + */ +export function update(numString, delta): string { + let m; + let decimals = (m = numString.match(/\.(\d+)$/)) ? m[1].length : 1; + let output = String((parseFloat(numString) + delta).toFixed(decimals)).replace(/\.0+$/, ''); + + if (m = numString.match(/^\-?(0\d+)/)) { + // padded number: preserve padding + output = output.replace(/^(\-?)(\d+)/, (str, minus, prefix) => + minus + '0'.repeat(Math.max(0, m[1].length - prefix.length)) + prefix); + } + + if (/^\-?\./.test(numString)) { + // omit integer part + output = output.replace(/^(\-?)0+/, '$1'); + } + + return output; +} + +/** + * Locates number from given position in the document + * @param {document} Textdocument + * @param {Point} pos + * @return {Range} Range of number or `undefined` if not found + */ +export function locate(document: vscode.TextDocument, pos: vscode.Position) { + + const line = document.lineAt(pos.line).text; + let start = pos.character; + let end = pos.character; + let hadDot = false, hadMinus = false; + let ch; + + while (start > 0) { + ch = line[--start]; + if (ch === '-') { + hadMinus = true; + break; + } else if (ch === '.' && !hadDot) { + hadDot = true; + } else if (!reNumber.test(ch)) { + start++; + break; + } + } + + if (line[end] === '-' && !hadMinus) { + end++; + } + + while (end < line.length) { + ch = line[end++]; + if (ch === '.' && !hadDot && reNumber.test(line[end])) { + // A dot must be followed by a number. Otherwise stop parsing + hadDot = true; + } else if (!reNumber.test(ch)) { + end--; + break; + } + } + + // ensure that found range contains valid number + if (start !== end && isValidNumber(line.slice(start, end))) { + return new vscode.Range(pos.line, start, pos.line, end); + } +} + +/** + * Check if given string contains valid number + * @param {String} str + * @return {Boolean} + */ +function isValidNumber(str): boolean { + return str && !isNaN(parseFloat(str)); +} diff --git a/extensions/emmet/src/matchTag.ts b/extensions/emmet/src/matchTag.ts index e5efc2d8e32b31742bf715573e91be13f7417880..564ca161d0fcf317b066e336bd774daab1fc14ba 100644 --- a/extensions/emmet/src/matchTag.ts +++ b/extensions/emmet/src/matchTag.ts @@ -4,9 +4,10 @@ *--------------------------------------------------------------------------------------------*/ import * as vscode from 'vscode'; -import { getNode } from './util'; import parse from '@emmetio/html-matcher'; import Node from '@emmetio/node'; +import { DocumentStreamReader } from './bufferStream'; +import { getNode } from './util'; export function matchTag() { let editor = vscode.window.activeTextEditor; @@ -15,35 +16,30 @@ export function matchTag() { return; } - let rootNode: Node = parse(editor.document.getText()); + let rootNode: Node = parse(new DocumentStreamReader(editor.document)); let updatedSelections = []; editor.selections.forEach(selection => { - let updatedSelection = getUpdatedSelections(editor, editor.document.offsetAt(selection.start), rootNode); + let updatedSelection = getUpdatedSelections(editor, selection.start, rootNode); if (updatedSelection) { updatedSelections.push(updatedSelection); } }); if (updatedSelections.length > 0) { editor.selections = updatedSelections; + editor.revealRange(editor.selections[updatedSelections.length - 1]); } } -function getUpdatedSelections(editor: vscode.TextEditor, offset: number, rootNode: Node): vscode.Selection { - let currentNode = getNode(rootNode, offset); +function getUpdatedSelections(editor: vscode.TextEditor, position: vscode.Position, rootNode: Node): vscode.Selection { + let currentNode = getNode(rootNode, position, true); // If no closing tag or cursor is between open and close tag, then no-op - if (!currentNode.close || (currentNode.open.end < offset && currentNode.close.start > offset)) { + if (!currentNode.close || (position.isAfter(currentNode.open.end) && position.isBefore(currentNode.close.start))) { return; } - if (offset <= currentNode.open.end) { - let matchingPosition = editor.document.positionAt(currentNode.close.start); - return new vscode.Selection(matchingPosition, matchingPosition); - } else { - let matchingPosition = editor.document.positionAt(currentNode.open.start); - return new vscode.Selection(matchingPosition, matchingPosition); - } - + let finalPosition = position.isBeforeOrEqual(currentNode.open.end) ? currentNode.close.start : currentNode.open.start; + return new vscode.Selection(finalPosition, finalPosition); } diff --git a/extensions/emmet/src/mergeLines.ts b/extensions/emmet/src/mergeLines.ts index fd63a2d36d44a66dabe306bcb13aa7a24df86717..ba26595e829172beb14e805edd342324286f9371 100644 --- a/extensions/emmet/src/mergeLines.ts +++ b/extensions/emmet/src/mergeLines.ts @@ -4,9 +4,11 @@ *--------------------------------------------------------------------------------------------*/ import * as vscode from 'vscode'; -import { isStyleSheet, getNode } from './util'; import parse from '@emmetio/html-matcher'; import Node from '@emmetio/node'; +import { DocumentStreamReader } from './bufferStream'; +import { isStyleSheet } from 'vscode-emmet-helper'; +import { getNode } from './util'; export function mergeLines() { let editor = vscode.window.activeTextEditor; @@ -18,7 +20,7 @@ export function mergeLines() { return; } - let rootNode: Node = parse(editor.document.getText()); + let rootNode: Node = parse(new DocumentStreamReader(editor.document)); editor.edit(editBuilder => { editor.selections.reverse().forEach(selection => { @@ -33,13 +35,13 @@ function getRangesToReplace(document: vscode.TextDocument, selection: vscode.Sel let endNodeToUpdate: Node; if (selection.isEmpty) { - startNodeToUpdate = endNodeToUpdate = getNode(rootNode, document.offsetAt(selection.start)); + startNodeToUpdate = endNodeToUpdate = getNode(rootNode, selection.start); } else { - startNodeToUpdate = getNode(rootNode, document.offsetAt(selection.start), true); - endNodeToUpdate = getNode(rootNode, document.offsetAt(selection.end), true); + startNodeToUpdate = getNode(rootNode, selection.start, true); + endNodeToUpdate = getNode(rootNode, selection.end, true); } - let rangeToReplace = new vscode.Range(document.positionAt(startNodeToUpdate.start), document.positionAt(endNodeToUpdate.end)); + let rangeToReplace = new vscode.Range(startNodeToUpdate.start, endNodeToUpdate.end); let textToReplaceWith = document.getText(rangeToReplace).replace(/\r\n|\n/g, '').replace(/>\s*<'); return [rangeToReplace, textToReplaceWith]; diff --git a/extensions/emmet/src/removeTag.ts b/extensions/emmet/src/removeTag.ts index 600557fd7a1184538740ef9790988dc2fdd9bcff..1987fba5066f482aec7e7bcd02393dda85e97574 100644 --- a/extensions/emmet/src/removeTag.ts +++ b/extensions/emmet/src/removeTag.ts @@ -31,8 +31,7 @@ export function removeTag() { } function getRangeToRemove(editor: vscode.TextEditor, selection: vscode.Selection, indentInSpaces: string): vscode.Range[] { - let offset = editor.document.offsetAt(selection.start); - let [openRange, closeRange] = getOpenCloseRange(editor.document, offset); + let [openRange, closeRange] = getOpenCloseRange(editor.document, selection.start); if (!openRange.contains(selection.start) && !closeRange.contains(selection.start)) { return []; } diff --git a/extensions/emmet/src/selectItem.ts b/extensions/emmet/src/selectItem.ts index b479c0ca74c19cedc027c150a313f7c478ea2096..c242f8e67c3a39e07892d67004d4624adafd86cc 100644 --- a/extensions/emmet/src/selectItem.ts +++ b/extensions/emmet/src/selectItem.ts @@ -4,12 +4,15 @@ *--------------------------------------------------------------------------------------------*/ import * as vscode from 'vscode'; -import { validate, isStyleSheet } from './util'; +import { validate } from './util'; import { nextItemHTML, prevItemHTML } from './selectItemHTML'; import { nextItemStylesheet, prevItemStylesheet } from './selectItemStylesheet'; import parseStylesheet from '@emmetio/css-parser'; import parse from '@emmetio/html-matcher'; import Node from '@emmetio/node'; +import { DocumentStreamReader } from './bufferStream'; +import { isStyleSheet } from 'vscode-emmet-helper'; + export function fetchSelectItem(direction: string): void { let editor = vscode.window.activeTextEditor; @@ -31,11 +34,15 @@ export function fetchSelectItem(direction: string): void { parseContent = parse; } - let rootNode: Node = parseContent(editor.document.getText()); + let rootNode: Node = parseContent(new DocumentStreamReader(editor.document)); let newSelections: vscode.Selection[] = []; editor.selections.forEach(selection => { - let updatedSelection = direction === 'next' ? nextItem(selection, editor, rootNode) : prevItem(selection, editor, rootNode); + const selectionStart = selection.isReversed ? selection.active : selection.anchor; + const selectionEnd = selection.isReversed ? selection.anchor : selection.active; + + let updatedSelection = direction === 'next' ? nextItem(selectionStart, selectionEnd, editor, rootNode) : prevItem(selectionStart, selectionEnd, editor, rootNode); newSelections.push(updatedSelection ? updatedSelection : selection); }); editor.selections = newSelections; + editor.revealRange(editor.selections[editor.selections.length - 1]); } \ No newline at end of file diff --git a/extensions/emmet/src/selectItemHTML.ts b/extensions/emmet/src/selectItemHTML.ts index 79d0a585e0ae084ad0a4bc89335fba6d721eeddc..bd80da87988577961eca25f329b95d8c903a9a4d 100644 --- a/extensions/emmet/src/selectItemHTML.ts +++ b/extensions/emmet/src/selectItemHTML.ts @@ -4,127 +4,189 @@ *--------------------------------------------------------------------------------------------*/ import * as vscode from 'vscode'; -import { getNode, getDeepestNode } from './util'; +import { getDeepestNode, findNextWord, findPrevWord, getNode } from './util'; import Node from '@emmetio/node'; -export function nextItemHTML(selection: vscode.Selection, editor: vscode.TextEditor, rootNode: Node): vscode.Selection { - let offset = editor.document.offsetAt(selection.active); - let currentNode = getNode(rootNode, offset); +export function nextItemHTML(selectionStart: vscode.Position, selectionEnd: vscode.Position, editor: vscode.TextEditor, rootNode: Node): vscode.Selection { + let currentNode = getNode(rootNode, selectionEnd); + let nextNode: Node; - // Cursor is in the open tag, look for attributes - if (offset < currentNode.open.end) { - let attrSelection = getNextAttribute(selection, editor.document, currentNode); - if (attrSelection) { - return attrSelection; + if (currentNode.type !== 'comment') { + // If cursor is in the tag name, select tag + if (selectionEnd.translate(0, -currentNode.name.length).isBefore(currentNode.open.start)) { + return getSelectionFromNode(currentNode, editor.document); + } + + // If cursor is in the open tag, look for attributes + if (selectionEnd.isBefore(currentNode.open.end)) { + let attrSelection = getNextAttribute(selectionStart, selectionEnd, editor.document, currentNode); + if (attrSelection) { + return attrSelection; + } } - } - // Get the first child of current node which is right after the cursor - let nextNode = currentNode.firstChild; - while (nextNode && nextNode.start < offset) { - nextNode = nextNode.nextSibling; + // Get the first child of current node which is right after the cursor and is not a comment + nextNode = currentNode.firstChild; + while (nextNode && (selectionEnd.isAfterOrEqual(nextNode.start) || nextNode.type === 'comment')) { + nextNode = nextNode.nextSibling; + } } - // Get next sibling of current node or the parent + + // Get next sibling of current node which is not a comment. If none is found try the same on the parent while (!nextNode && currentNode) { - nextNode = currentNode.nextSibling; - currentNode = currentNode.parent; + if (currentNode.nextSibling) { + if (currentNode.nextSibling.type !== 'comment') { + nextNode = currentNode.nextSibling; + } else { + currentNode = currentNode.nextSibling; + } + } else { + currentNode = currentNode.parent; + } } return getSelectionFromNode(nextNode, editor.document); } -export function prevItemHTML(selection: vscode.Selection, editor: vscode.TextEditor, rootNode: Node): vscode.Selection { - let offset = editor.document.offsetAt(selection.active); - let currentNode = getNode(rootNode, offset); +export function prevItemHTML(selectionStart: vscode.Position, selectionEnd: vscode.Position, editor: vscode.TextEditor, rootNode: Node): vscode.Selection { + let currentNode = getNode(rootNode, selectionStart); let prevNode: Node; - // Cursor is in the open tag after the tag name - if (offset > currentNode.open.start + currentNode.name.length + 1 && offset <= currentNode.open.end) { - prevNode = currentNode; - } + if (currentNode.type !== 'comment' && selectionStart.translate(0, -1).isAfter(currentNode.open.start)) { - // Cursor is inside the tag - if (!prevNode && offset > currentNode.open.end) { - if (!currentNode.firstChild) { - // No children, so current node should be selected + if (selectionStart.isBefore(currentNode.open.end) || !currentNode.firstChild) { prevNode = currentNode; } else { - // Select the child that appears just before the cursor + // Select the child that appears just before the cursor and is not a comment prevNode = currentNode.firstChild; - while (prevNode.nextSibling && prevNode.nextSibling.end < offset) { + let oldOption: Node; + while (prevNode.nextSibling && selectionStart.isAfterOrEqual(prevNode.nextSibling.end)) { + if (prevNode && prevNode.type !== 'comment') { + oldOption = prevNode; + } prevNode = prevNode.nextSibling; } - if (prevNode) { - prevNode = getDeepestNode(prevNode); - } + + prevNode = getDeepestNode((prevNode && prevNode.type !== 'comment') ? prevNode : oldOption); } } - if (!prevNode && currentNode.previousSibling) { - prevNode = getDeepestNode(currentNode.previousSibling); - } + // Select previous sibling which is not a comment. If none found, then select parent + while (!prevNode && currentNode) { + if (currentNode.previousSibling) { + if (currentNode.previousSibling.type !== 'comment') { + prevNode = getDeepestNode(currentNode.previousSibling); + } else { + currentNode = currentNode.previousSibling; + } + } else { + prevNode = currentNode.parent; + } - if (!prevNode && currentNode.parent) { - prevNode = currentNode.parent; } - let attrSelection = getPrevAttribute(selection, editor.document, prevNode); + let attrSelection = getPrevAttribute(selectionStart, selectionEnd, editor.document, prevNode); return attrSelection ? attrSelection : getSelectionFromNode(prevNode, editor.document); } function getSelectionFromNode(node: Node, document: vscode.TextDocument): vscode.Selection { if (node && node.open) { - let selectionStart = document.positionAt(node.open.start + 1); - let selectionEnd = node.type === 'comment' ? document.positionAt(node.open.end - 1) : selectionStart.translate(0, node.name.length); + let selectionStart = (node.open.start).translate(0, 1); + let selectionEnd = selectionStart.translate(0, node.name.length); return new vscode.Selection(selectionStart, selectionEnd); } } -function getNextAttribute(selection: vscode.Selection, document: vscode.TextDocument, node: Node): vscode.Selection { +function getNextAttribute(selectionStart: vscode.Position, selectionEnd: vscode.Position, document: vscode.TextDocument, node: Node): vscode.Selection { if (!node.attributes || node.attributes.length === 0 || node.type === 'comment') { return; } - let selectionStart = document.offsetAt(selection.anchor); - let selectionEnd = document.offsetAt(selection.active); - for (let i = 0; i < node.attributes.length; i++) { let attr = node.attributes[i]; - if (selectionEnd < attr.start) { + if (selectionEnd.isBefore(attr.start)) { // select full attr - return new vscode.Selection(document.positionAt(attr.start), document.positionAt(attr.end)); + return new vscode.Selection(attr.start, attr.end); } - if ((attr.value.start !== attr.value.end) && ((selectionStart === attr.start && selectionEnd === attr.end) || selectionEnd < attr.end - 1)) { - // select attr value - return new vscode.Selection(document.positionAt(attr.value.start), document.positionAt(attr.value.end)); + if ((attr.value.start).isEqual(attr.value.end)) { + // No attr value to select + continue; } + + if ((selectionStart.isEqual(attr.start) && selectionEnd.isEqual(attr.end)) || selectionEnd.isBefore(attr.value.start)) { + // cursor is in attr name, so select full attr value + return new vscode.Selection(attr.value.start, attr.value.end); + } + + // Fetch the next word in the attr value + + if (attr.value.toString().indexOf(' ') === -1) { + // attr value does not have space, so no next word to find + continue; + } + + let pos = undefined; + if (selectionStart.isEqual(attr.value.start) && selectionEnd.isEqual(attr.value.end)) { + pos = -1; + } + if (pos === undefined && selectionEnd.isBefore(attr.end)) { + pos = selectionEnd.character - attr.value.start.character - 1; + } + + if (pos !== undefined) { + let [newSelectionStartOffset, newSelectionEndOffset] = findNextWord(attr.value.toString(), pos); + if (newSelectionStartOffset >= 0 && newSelectionEndOffset >= 0) { + const newSelectionStart = (attr.value.start).translate(0, newSelectionStartOffset); + const newSelectionEnd = (attr.value.start).translate(0, newSelectionEndOffset); + return new vscode.Selection(newSelectionStart, newSelectionEnd); + } + } + } } -function getPrevAttribute(selection: vscode.Selection, document: vscode.TextDocument, node: Node): vscode.Selection { +function getPrevAttribute(selectionStart: vscode.Position, selectionEnd: vscode.Position, document: vscode.TextDocument, node: Node): vscode.Selection { if (!node.attributes || node.attributes.length === 0 || node.type === 'comment') { return; } - let selectionStart = document.offsetAt(selection.anchor); - for (let i = node.attributes.length - 1; i >= 0; i--) { let attr = node.attributes[i]; - if (selectionStart > attr.value.start) { - // select attr value - return new vscode.Selection(document.positionAt(attr.value.start), document.positionAt(attr.value.end)); + if (selectionStart.isBeforeOrEqual(attr.start)) { + continue; } - if (selectionStart > attr.start) { + if ((attr.value.start).isEqual(attr.value.end) || selectionStart.isBefore(attr.value.start)) { // select full attr - return new vscode.Selection(document.positionAt(attr.start), document.positionAt(attr.end)); + return new vscode.Selection(attr.start, attr.end); + } + + if (selectionStart.isEqual(attr.value.start)) { + if (selectionEnd.isAfterOrEqual(attr.value.end)) { + // select full attr + return new vscode.Selection(attr.start, attr.end); + } + // select attr value + return new vscode.Selection(attr.value.start, attr.value.end); } + + // Fetch the prev word in the attr value + + let pos = selectionStart.isAfter(attr.value.end) ? attr.value.toString().length : selectionStart.character - attr.value.start.character; + let [newSelectionStartOffset, newSelectionEndOffset] = findPrevWord(attr.value.toString(), pos); + if (newSelectionStartOffset >= 0 && newSelectionEndOffset >= 0) { + const newSelectionStart = (attr.value.start).translate(0, newSelectionStartOffset); + const newSelectionEnd = (attr.value.start).translate(0, newSelectionEndOffset); + return new vscode.Selection(newSelectionStart, newSelectionEnd); + } + + } } \ No newline at end of file diff --git a/extensions/emmet/src/selectItemStylesheet.ts b/extensions/emmet/src/selectItemStylesheet.ts index d0167a2d8b93d3fab3532fecf920dfa3f4db47a4..7275c3313144e43ee14c321497b29cb6189f3a32 100644 --- a/extensions/emmet/src/selectItemStylesheet.ts +++ b/extensions/emmet/src/selectItemStylesheet.ts @@ -4,28 +4,37 @@ *--------------------------------------------------------------------------------------------*/ import * as vscode from 'vscode'; -import { getNode, getDeepestNode } from './util'; +import { getDeepestNode, findNextWord, findPrevWord, getNode } from './util'; import Node from '@emmetio/node'; -export function nextItemStylesheet(selection: vscode.Selection, editor: vscode.TextEditor, rootNode: Node): vscode.Selection { - let startOffset = editor.document.offsetAt(selection.anchor); - let endOffset = editor.document.offsetAt(selection.active); +export function nextItemStylesheet(startOffset: vscode.Position, endOffset: vscode.Position, editor: vscode.TextEditor, rootNode: Node): vscode.Selection { let currentNode = getNode(rootNode, endOffset, true); + if (!currentNode) { + currentNode = rootNode; + } - // Full property is selected, so select property value next - if (currentNode.type === 'property' && startOffset === currentNode.start && endOffset === currentNode.end) { - return getSelectionFromNode(currentNode, editor.document, true); + // Full property is selected, so select full property value next + if (currentNode.type === 'property' && startOffset.isEqual(currentNode.start) && endOffset.isEqual(currentNode.end)) { + return getSelectionFromProperty(currentNode, editor.document, startOffset, endOffset, true, 'next'); + } + + // Part or whole of propertyValue is selected, so select the next word in the propertyValue + if (currentNode.type === 'property' && startOffset.isAfterOrEqual(currentNode.valueToken.start) && endOffset.isBeforeOrEqual(currentNode.valueToken.end)) { + let singlePropertyValue = getSelectionFromProperty(currentNode, editor.document, startOffset, endOffset, false, 'next'); + if (singlePropertyValue) { + return singlePropertyValue; + } } // Cursor is in the selector or in a property - if ((currentNode.type === 'rule' && endOffset < currentNode.selectorToken.end) - || (currentNode.type === 'property' && endOffset < currentNode.valueToken.end)) { + if ((currentNode.type === 'rule' && endOffset.isBefore(currentNode.selectorToken.end)) + || (currentNode.type === 'property' && endOffset.isBefore(currentNode.valueToken.end))) { return getSelectionFromNode(currentNode, editor.document); } // Get the first child of current node which is right after the cursor let nextNode = currentNode.firstChild; - while (nextNode && endOffset >= nextNode.end) { + while (nextNode && endOffset.isAfterOrEqual(nextNode.end)) { nextNode = nextNode.nextSibling; } @@ -39,41 +48,88 @@ export function nextItemStylesheet(selection: vscode.Selection, editor: vscode.T } -export function prevItemStylesheet(selection: vscode.Selection, editor: vscode.TextEditor, rootNode: Node): vscode.Selection { - let startOffset = editor.document.offsetAt(selection.anchor); +export function prevItemStylesheet(startOffset: vscode.Position, endOffset: vscode.Position, editor: vscode.TextEditor, rootNode: Node): vscode.Selection { let currentNode = getNode(rootNode, startOffset); if (!currentNode) { currentNode = rootNode; } - if (currentNode.type === 'property' || !currentNode.firstChild || (currentNode.type === 'rule' && startOffset <= currentNode.firstChild.start)) { - return getSelectionFromNode(currentNode, editor.document);; + // Full property value is selected, so select the whole property next + if (currentNode.type === 'property' && startOffset.isEqual(currentNode.valueToken.start) && endOffset.isEqual(currentNode.valueToken.end)) { + return getSelectionFromNode(currentNode, editor.document); + } + + // Part of propertyValue is selected, so select the prev word in the propertyValue + if (currentNode.type === 'property' && startOffset.isAfterOrEqual(currentNode.valueToken.start) && endOffset.isBeforeOrEqual(currentNode.valueToken.end)) { + let singlePropertyValue = getSelectionFromProperty(currentNode, editor.document, startOffset, endOffset, false, 'prev'); + if (singlePropertyValue) { + return singlePropertyValue; + } + } + + if (currentNode.type === 'property' || !currentNode.firstChild || (currentNode.type === 'rule' && startOffset.isBeforeOrEqual(currentNode.firstChild.start))) { + return getSelectionFromNode(currentNode, editor.document); } // Select the child that appears just before the cursor let prevNode = currentNode.firstChild; - while (prevNode.nextSibling && prevNode.nextSibling.end <= startOffset) { + while (prevNode.nextSibling && startOffset.isAfterOrEqual(prevNode.nextSibling.end)) { prevNode = prevNode.nextSibling; } prevNode = getDeepestNode(prevNode); - return getSelectionFromNode(prevNode, editor.document, true); + return getSelectionFromProperty(prevNode, editor.document, startOffset, endOffset, false, 'prev'); } -function getSelectionFromNode(node: Node, document: vscode.TextDocument, selectPropertyValue: boolean = false): vscode.Selection { +function getSelectionFromNode(node: Node, document: vscode.TextDocument): vscode.Selection { if (!node) { return; } let nodeToSelect = node.type === 'rule' ? node.selectorToken : node; + return new vscode.Selection(nodeToSelect.start, nodeToSelect.end); +} + - let selectionStart = (node.type === 'property' && selectPropertyValue) ? node.valueToken.start : nodeToSelect.start; - let selectionEnd = (node.type === 'property' && selectPropertyValue) ? node.valueToken.end : nodeToSelect.end; +function getSelectionFromProperty(node: Node, document: vscode.TextDocument, selectionStart: vscode.Position, selectionEnd: vscode.Position, selectFullValue: boolean, direction: string): vscode.Selection { + if (!node || node.type !== 'property') { + return; + } + + let propertyValue = node.valueToken.stream.substring(node.valueToken.start, node.valueToken.end); + selectFullValue = selectFullValue || (direction === 'prev' && selectionStart.isEqual(node.valueToken.start) && selectionEnd.isBefore(node.valueToken.end)); + + if (selectFullValue) { + return new vscode.Selection(node.valueToken.start, node.valueToken.end); + } + + let pos; + if (direction === 'prev') { + if (selectionStart.isEqual(node.valueToken.start)) { + return; + } + pos = selectionStart.isAfter(node.valueToken.end) ? propertyValue.length : selectionStart.character - node.valueToken.start.character; + } + + if (direction === 'next') { + if (selectionEnd.isEqual(node.valueToken.end) && (selectionStart.isAfter(node.valueToken.start) || propertyValue.indexOf(' ') === -1)) { + return; + } + pos = selectionEnd.isEqual(node.valueToken.end) ? -1 : selectionEnd.character - node.valueToken.start.character - 1; + } + + + let [newSelectionStartOffset, newSelectionEndOffset] = direction === 'prev' ? findPrevWord(propertyValue, pos) : findNextWord(propertyValue, pos); + if (!newSelectionStartOffset && !newSelectionEndOffset) { + return; + } - return new vscode.Selection(document.positionAt(selectionStart), document.positionAt(selectionEnd)); + const newSelectionStart = (node.valueToken.start).translate(0, newSelectionStartOffset); + const newSelectionEnd = (node.valueToken.start).translate(0, newSelectionEndOffset); + return new vscode.Selection(newSelectionStart, newSelectionEnd); } diff --git a/extensions/emmet/src/splitJoinTag.ts b/extensions/emmet/src/splitJoinTag.ts index 1886ca2472c18d11acc8c2c7876d911fec64d824..49c1b676f0b39b9143249b02f23a2150878081fc 100644 --- a/extensions/emmet/src/splitJoinTag.ts +++ b/extensions/emmet/src/splitJoinTag.ts @@ -4,9 +4,11 @@ *--------------------------------------------------------------------------------------------*/ import * as vscode from 'vscode'; -import { isStyleSheet, getNode } from './util'; import parse from '@emmetio/html-matcher'; import Node from '@emmetio/node'; +import { DocumentStreamReader } from './bufferStream'; +import { isStyleSheet } from 'vscode-emmet-helper'; +import { getNode } from './util'; export function splitJoinTag() { let editor = vscode.window.activeTextEditor; @@ -18,7 +20,7 @@ export function splitJoinTag() { return; } - let rootNode: Node = parse(editor.document.getText()); + let rootNode: Node = parse(new DocumentStreamReader(editor.document)); editor.edit(editBuilder => { editor.selections.reverse().forEach(selection => { @@ -29,23 +31,24 @@ export function splitJoinTag() { } function getRangesToReplace(document: vscode.TextDocument, selection: vscode.Selection, rootNode: Node): [vscode.Range, string] { - let offset = document.offsetAt(selection.start); - let nodeToUpdate: Node = getNode(rootNode, offset); + let nodeToUpdate: Node = getNode(rootNode, selection.start); let rangeToReplace: vscode.Range; let textToReplaceWith: string; if (!nodeToUpdate.close) { // Split Tag - let nodeText = document.getText(new vscode.Range(document.positionAt(nodeToUpdate.start), document.positionAt(nodeToUpdate.end))); + let nodeText = document.getText(new vscode.Range(nodeToUpdate.start, nodeToUpdate.end)); let m = nodeText.match(/(\s*\/)?>$/); - let end = nodeToUpdate.open.end; - let start = m ? end - m[0].length : end; + let end = nodeToUpdate.end; + let start = m ? end.translate(0, -m[0].length) : end; - rangeToReplace = new vscode.Range(document.positionAt(start), document.positionAt(end)); + rangeToReplace = new vscode.Range(start, end); textToReplaceWith = `>`; } else { // Join Tag - rangeToReplace = new vscode.Range(document.positionAt(nodeToUpdate.open.end - 1), document.positionAt(nodeToUpdate.close.end)); + let start = (nodeToUpdate.open.end).translate(0, -1); + let end = nodeToUpdate.end; + rangeToReplace = new vscode.Range(start, end); textToReplaceWith = '/>'; } diff --git a/extensions/emmet/src/toggleComment.ts b/extensions/emmet/src/toggleComment.ts index f87bd831209bd1d8309f0c2076c595390123bd8a..4c2c79f866b39169d0e2469147b1d11b6490ded7 100644 --- a/extensions/emmet/src/toggleComment.ts +++ b/extensions/emmet/src/toggleComment.ts @@ -4,11 +4,12 @@ *--------------------------------------------------------------------------------------------*/ import * as vscode from 'vscode'; -import { getNode, isStyleSheet } from './util'; +import { getNodesInBetween, getNode } from './util'; import parse from '@emmetio/html-matcher'; import parseStylesheet from '@emmetio/css-parser'; import Node from '@emmetio/node'; - +import { DocumentStreamReader } from './bufferStream'; +import { isStyleSheet } from 'vscode-emmet-helper'; const startCommentStylesheet = '/*'; const endCommentStylesheet = '*/'; @@ -39,36 +40,48 @@ export function toggleComment() { endComment = endCommentHTML; } - let rootNode = parseContent(editor.document.getText()); + let rootNode = parseContent(new DocumentStreamReader(editor.document)); editor.edit(editBuilder => { editor.selections.reverse().forEach(selection => { - let [rangesToUnComment, positionForCommentStart, positionForCommentEnd] = toggleCommentInternal(editor.document, selection, rootNode); - rangesToUnComment.forEach(rangeToDelete => { - editBuilder.delete(rangeToDelete); + let [rangesToUnComment, rangeToComment] = toggleCommentInternal(editor.document, selection, rootNode); + rangesToUnComment.forEach((rangeToUnComment: vscode.Range) => { + editBuilder.delete(new vscode.Range(rangeToUnComment.start, rangeToUnComment.start.translate(0, startComment.length))); + editBuilder.delete(new vscode.Range(rangeToUnComment.end.translate(0, -endComment.length), rangeToUnComment.end)); }); - if (positionForCommentStart) { - editBuilder.insert(positionForCommentStart, startComment); - } - if (positionForCommentEnd) { - editBuilder.insert(positionForCommentEnd, endComment); + if (rangeToComment) { + editBuilder.insert(rangeToComment.start, startComment); + editBuilder.insert(rangeToComment.end, endComment); } + }); }); } -function toggleCommentHTML(document: vscode.TextDocument, selection: vscode.Selection, rootNode: Node): [vscode.Range[], vscode.Position, vscode.Position] { - let offset = document.offsetAt(selection.start); - let nodeToUpdate = getNode(rootNode, offset); +function toggleCommentHTML(document: vscode.TextDocument, selection: vscode.Selection, rootNode: Node): [vscode.Range[], vscode.Range] { + const selectionStart = selection.isReversed ? selection.active : selection.anchor; + const selectionEnd = selection.isReversed ? selection.anchor : selection.active; + + let startNode = getNode(rootNode, selectionStart, true); + let endNode = getNode(rootNode, selectionEnd, true); + + if (!startNode || !endNode) { + return [[], null]; + } + + let allNodes: Node[] = getNodesInBetween(startNode, endNode); + let rangesToUnComment: vscode.Range[] = []; - let rangesToUnComment = getRangesToUnCommentHTML(nodeToUpdate, document); - if (nodeToUpdate.type === 'comment') { - return [rangesToUnComment, null, null]; + allNodes.forEach(node => { + rangesToUnComment = rangesToUnComment.concat(getRangesToUnCommentHTML(node, document)); + }); + + if (startNode.type === 'comment') { + return [rangesToUnComment, null]; } - let positionForCommentStart = document.positionAt(nodeToUpdate.start); - let positionForCommentEnd = document.positionAt(nodeToUpdate.end); - return [rangesToUnComment, positionForCommentStart, positionForCommentEnd]; + let rangeToComment = new vscode.Range(allNodes[0].start, allNodes[allNodes.length - 1].end); + return [rangesToUnComment, rangeToComment]; } function getRangesToUnCommentHTML(node: Node, document: vscode.TextDocument): vscode.Range[] { @@ -76,8 +89,7 @@ function getRangesToUnCommentHTML(node: Node, document: vscode.TextDocument): vs // If current node is commented, then uncomment and return if (node.type === 'comment') { - rangesToUnComment.push(new vscode.Range(document.positionAt(node.start), document.positionAt(node.start + startCommentHTML.length))); - rangesToUnComment.push(new vscode.Range(document.positionAt(node.end), document.positionAt(node.end - endCommentHTML.length))); + rangesToUnComment.push(new vscode.Range(node.start, node.end)); return rangesToUnComment; } @@ -90,45 +102,32 @@ function getRangesToUnCommentHTML(node: Node, document: vscode.TextDocument): vs return rangesToUnComment; } -function toggleCommentStylesheet(document: vscode.TextDocument, selection: vscode.Selection, rootNode: Node): [vscode.Range[], vscode.Position, vscode.Position] { - - let selectionStart = document.offsetAt(selection.anchor); - let selectionEnd = document.offsetAt(selection.active); +function toggleCommentStylesheet(document: vscode.TextDocument, selection: vscode.Selection, rootNode: Node): [vscode.Range[], vscode.Range] { - // If current node is commented, then uncomment and return - let rangesToUnComment = getRangesToUnCommentStylesheet(rootNode, selectionStart, selectionEnd, document, true); - if (rangesToUnComment.length > 0) { - return [rangesToUnComment, null, null]; - } + const selectionStart = selection.isReversed ? selection.active : selection.anchor; + const selectionEnd = selection.isReversed ? selection.anchor : selection.active; - // Uncomment children of current node and then comment the node - let nodeToComment = getNode(rootNode, selectionStart); - rangesToUnComment = getRangesToUnCommentStylesheet(rootNode, nodeToComment.start, nodeToComment.end, document, false); - let positionForCommentStart = document.positionAt(nodeToComment.start); - let positionForCommentEnd = document.positionAt(nodeToComment.end); + let startNode = getNode(rootNode, selectionStart, true); + let endNode = getNode(rootNode, selectionEnd, true); + let rangesToUnComment: vscode.Range[] = []; - return [rangesToUnComment, positionForCommentStart, positionForCommentEnd]; -} - -function getRangesToUnCommentStylesheet(rootNode: Node, selectionStart: number, selectionEnd: number, document: vscode.TextDocument, selectionInsideComment: boolean): vscode.Range[] { - if (!rootNode.comments || rootNode.comments.length === 0) { - return []; - } + let isFirstNodeCommented = false; - let rangesToUnComment = []; + // Uncomment the comments that intersect with the selection. rootNode.comments.forEach(comment => { - let foundComment = false; - if (selectionInsideComment) { - foundComment = comment.start <= selectionStart && comment.end >= selectionEnd; - } else { - foundComment = selectionStart <= comment.start && selectionEnd >= comment.end; + if (!isFirstNodeCommented) { + isFirstNodeCommented = (selectionStart.isAfterOrEqual(comment.start) && selectionEnd.isBefore(comment.end)); } - if (foundComment) { - rangesToUnComment.push(new vscode.Range(document.positionAt(comment.start), document.positionAt(comment.start + startCommentStylesheet.length))); - rangesToUnComment.push(new vscode.Range(document.positionAt(comment.end), document.positionAt(comment.end - endCommentStylesheet.length))); + if (selection.contains(comment.start) + || selection.contains(comment.end) + || (selectionStart.isAfterOrEqual(comment.start) && selectionEnd.isBefore(comment.end))) { + rangesToUnComment.push(new vscode.Range(comment.start, comment.end)); } }); - return rangesToUnComment; -} \ No newline at end of file + let rangeToComment = isFirstNodeCommented ? null : new vscode.Range(startNode ? startNode.start : selectionStart, endNode ? endNode.end : selectionEnd); + return [rangesToUnComment, rangeToComment]; + + +} diff --git a/src/vs/base/browser/ui/leftRightWidget/leftRightWidget.css b/extensions/emmet/src/typings/refs.d.ts similarity index 66% rename from src/vs/base/browser/ui/leftRightWidget/leftRightWidget.css rename to extensions/emmet/src/typings/refs.d.ts index 346b3ec60a173484b4a104e8e9b71e6499268624..0188b6f9ffced4f36e532cf19454274f1b34b917 100644 --- a/src/vs/base/browser/ui/leftRightWidget/leftRightWidget.css +++ b/extensions/emmet/src/typings/refs.d.ts @@ -3,13 +3,6 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -.monaco-left-right-widget > .left { - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - display: block; -} - -.monaco-left-right-widget > .right { - float: right; -} +/// +/// +/// diff --git a/extensions/emmet/src/updateTag.ts b/extensions/emmet/src/updateTag.ts index 43efb2cc28597ff88be4e033c22e702112446c46..ca47d4d24015e05b287865ca6b8903f1956a1f6f 100644 --- a/extensions/emmet/src/updateTag.ts +++ b/extensions/emmet/src/updateTag.ts @@ -4,9 +4,10 @@ *--------------------------------------------------------------------------------------------*/ import * as vscode from 'vscode'; -import { getNode } from './util'; import parse from '@emmetio/html-matcher'; import Node from '@emmetio/node'; +import { DocumentStreamReader } from './bufferStream'; +import { getNode } from './util'; export function updateTag(tagName: string) { let editor = vscode.window.activeTextEditor; @@ -15,7 +16,7 @@ export function updateTag(tagName: string) { return; } - let rootNode: Node = parse(editor.document.getText()); + let rootNode: Node = parse(new DocumentStreamReader(editor.document)); let rangesToUpdate = []; editor.selections.reverse().forEach(selection => { rangesToUpdate = rangesToUpdate.concat(getRangesToUpdate(editor, selection, rootNode)); @@ -29,16 +30,15 @@ export function updateTag(tagName: string) { } function getRangesToUpdate(editor: vscode.TextEditor, selection: vscode.Selection, rootNode: Node): vscode.Range[] { - let offset = editor.document.offsetAt(selection.start); - let nodeToUpdate = getNode(rootNode, offset); + let nodeToUpdate = getNode(rootNode, selection.start); - let openStart = editor.document.positionAt(nodeToUpdate.open.start + 1); + let openStart = (nodeToUpdate.open.start).translate(0, 1); let openEnd = openStart.translate(0, nodeToUpdate.name.length); let ranges = [new vscode.Range(openStart, openEnd)]; if (nodeToUpdate.close) { - let closeStart = editor.document.positionAt(nodeToUpdate.close.start + 2); - let closeEnd = editor.document.positionAt(nodeToUpdate.close.end - 1); + let closeStart = (nodeToUpdate.close.start).translate(0, 2); + let closeEnd = (nodeToUpdate.close.end).translate(0, -1); ranges.push(new vscode.Range(closeStart, closeEnd)); } return ranges; diff --git a/extensions/emmet/src/util.ts b/extensions/emmet/src/util.ts index 3b495069d1e53df9ec6485c5c58349e58ba86496..4686f729da6caac869e03e9472e0f6a4c81d1f60 100644 --- a/extensions/emmet/src/util.ts +++ b/extensions/emmet/src/util.ts @@ -6,9 +6,27 @@ import * as vscode from 'vscode'; import parse from '@emmetio/html-matcher'; import Node from '@emmetio/node'; -import * as extract from '@emmetio/extract-abbreviation'; - - +import { DocumentStreamReader } from './bufferStream'; +import { isStyleSheet } from 'vscode-emmet-helper'; + +export const LANGUAGE_MODES: Object = { + 'html': ['!', '.', '}'], + 'jade': ['!', '.', '}'], + 'slim': ['!', '.', '}'], + 'haml': ['!', '.', '}'], + 'xml': ['.', '}'], + 'xsl': ['.', '}'], + 'css': [':'], + 'scss': [':'], + 'sass': [':'], + 'less': [':'], + 'stylus': [':'] +}; + +// Explicitly map languages to their parent language to get emmet completion support +export const MAPPED_MODES: Object = { + 'handlebars': 'html' +}; export function validate(allowStylesheet: boolean = true): boolean { let editor = vscode.window.activeTextEditor; if (!editor) { @@ -25,79 +43,40 @@ export function getSyntax(document: vscode.TextDocument): string { if (document.languageId === 'jade') { return 'pug'; } - if (document.languageId === 'javascriptreact' || document.languageId === 'typescriptreact') { - return 'jsx'; - } return document.languageId; } -export function isStyleSheet(syntax): boolean { - let stylesheetSyntaxes = ['css', 'scss', 'sass', 'less', 'stylus']; - return (stylesheetSyntaxes.indexOf(syntax) > -1); -} - -export function getProfile(syntax: string): any { - let config = vscode.workspace.getConfiguration('emmet')['syntaxProfiles'] || {}; - let options = config[syntax]; - if (!options || typeof options === 'string') { - return {}; - } - let newOptions = {}; - for (let key in options) { - switch (key) { - case 'tag_case': - newOptions['tagCase'] = (options[key] === 'lower' || options[key] === 'upper') ? options[key] : ''; - break; - case 'attr_case': - newOptions['attributeCase'] = (options[key] === 'lower' || options[key] === 'upper') ? options[key] : ''; - break; - case 'attr_quotes': - newOptions['attributeQuotes'] = options[key]; - break; - case 'tag_nl': - newOptions['format'] = (options[key] === 'true' || options[key] === 'false') ? options[key] : 'true'; - break; - case 'indent': - newOptions['attrCase'] = (options[key] === 'true' || options[key] === 'false') ? '\t' : options[key]; - break; - case 'inline_break': - newOptions['inlineBreak'] = options[key]; - break; - case 'self_closing_tag': - if (options[key] === true) { - newOptions['selfClosingStyle'] = 'xml'; break; - } - if (options[key] === false) { - newOptions['selfClosingStyle'] = 'html'; break; - } - newOptions['selfClosingStyle'] = options[key]; - break; - default: - newOptions[key] = options[key]; - break; +export function getMappedModes(): any { + let finalMappedModes = {}; + let syntaxProfileConfig = vscode.workspace.getConfiguration('emmet')['syntaxProfiles']; + let syntaxProfiles = Object.assign({}, MAPPED_MODES, syntaxProfileConfig ? syntaxProfileConfig : {}); + Object.keys(syntaxProfiles).forEach(syntax => { + if (typeof syntaxProfiles[syntax] === 'string' && LANGUAGE_MODES[syntaxProfiles[syntax]]) { + finalMappedModes[syntax] = syntaxProfiles[syntax]; } - } - return newOptions; + }); + return finalMappedModes; } -export function getOpenCloseRange(document: vscode.TextDocument, offset: number): [vscode.Range, vscode.Range] { - let rootNode: Node = parse(document.getText()); - let nodeToUpdate = getNode(rootNode, offset); - let openRange = new vscode.Range(document.positionAt(nodeToUpdate.open.start), document.positionAt(nodeToUpdate.open.end)); - let closeRange = null; - if (nodeToUpdate.close) { - closeRange = new vscode.Range(document.positionAt(nodeToUpdate.close.start), document.positionAt(nodeToUpdate.close.end)); - } - return [openRange, closeRange]; +export function getExcludedModes(): string[] { + let excludedConfig = vscode.workspace.getConfiguration('emmet')['excludeLanguages']; + return Array.isArray(excludedConfig) ? excludedConfig : []; } - -export function getNode(root: Node, offset: number, includeNodeBoundary: boolean = false) { +/** + * Returns node corresponding to given position in the given root node + * @param root + * @param position + * @param includeNodeBoundary + */ +export function getNode(root: Node, position: vscode.Position, includeNodeBoundary: boolean = false) { let currentNode: Node = root.firstChild; let foundNode: Node = null; while (currentNode) { - if ((currentNode.start < offset && currentNode.end > offset) - || (includeNodeBoundary && (currentNode.start <= offset && currentNode.end >= offset))) { + const nodeStart: vscode.Position = currentNode.start; + const nodeEnd: vscode.Position = currentNode.end; + if ((nodeStart.isBefore(position) && nodeEnd.isAfter(position)) + || (includeNodeBoundary && (nodeStart.isBeforeOrEqual(position) && nodeEnd.isAfterOrEqual(position)))) { foundNode = currentNode; // Dig deeper @@ -110,30 +89,164 @@ export function getNode(root: Node, offset: number, includeNodeBoundary: boolean return foundNode; } -export function getNodeOuterSelection(document: vscode.TextDocument, node: Node): vscode.Selection { - return new vscode.Selection(document.positionAt(node.start), document.positionAt(node.end)); -} - -export function getNodeInnerSelection(document: vscode.TextDocument, node: Node): vscode.Selection { - return new vscode.Selection(document.positionAt(node.open.end), document.positionAt(node.close.start)); +/** + * Returns inner range of an html node. + * @param currentNode + */ +export function getInnerRange(currentNode: Node): vscode.Range { + if (!currentNode.close) { + return; + } + return new vscode.Range(currentNode.open.end, currentNode.close.start); } -export function extractAbbreviation(position: vscode.Position): [vscode.Range, string] { - let editor = vscode.window.activeTextEditor; - let currentLine = editor.document.lineAt(position.line).text; - let result = extract(currentLine, position.character, true); - if (!result) { - return [null, '']; +export function getOpenCloseRange(document: vscode.TextDocument, position: vscode.Position): [vscode.Range, vscode.Range] { + let rootNode: Node = parse(new DocumentStreamReader(document)); + let nodeToUpdate = getNode(rootNode, position); + let openRange = new vscode.Range(nodeToUpdate.open.start, nodeToUpdate.open.end); + let closeRange = null; + if (nodeToUpdate.close) { + closeRange = new vscode.Range(nodeToUpdate.close.start, nodeToUpdate.close.end); } - - let rangeToReplace = new vscode.Range(position.line, result.location, position.line, result.location + result.abbreviation.length); - return [rangeToReplace, result.abbreviation]; + return [openRange, closeRange]; } export function getDeepestNode(node: Node): Node { if (!node || !node.children || node.children.length === 0) { return node; } + for (let i = node.children.length - 1; i >= 0; i--) { + if (node.children[i].type !== 'comment') { + return getDeepestNode(node.children[i]); + } + } +} + +export function findNextWord(propertyValue: string, pos: number): [number, number] { + + let foundSpace = pos === -1; + let foundStart = false; + let foundEnd = false; + + let newSelectionStart; + let newSelectionEnd; + while (pos < propertyValue.length - 1) { + pos++; + if (!foundSpace) { + if (propertyValue[pos] === ' ') { + foundSpace = true; + } + continue; + } + if (foundSpace && !foundStart && propertyValue[pos] === ' ') { + continue; + } + if (!foundStart) { + newSelectionStart = pos; + foundStart = true; + continue; + } + if (propertyValue[pos] === ' ') { + newSelectionEnd = pos; + foundEnd = true; + break; + } + } + + if (foundStart && !foundEnd) { + newSelectionEnd = propertyValue.length; + } + + return [newSelectionStart, newSelectionEnd]; +} + +export function findPrevWord(propertyValue: string, pos: number): [number, number] { + + let foundSpace = pos === propertyValue.length; + let foundStart = false; + let foundEnd = false; + + let newSelectionStart; + let newSelectionEnd; + while (pos > -1) { + pos--; + if (!foundSpace) { + if (propertyValue[pos] === ' ') { + foundSpace = true; + } + continue; + } + if (foundSpace && !foundEnd && propertyValue[pos] === ' ') { + continue; + } + if (!foundEnd) { + newSelectionEnd = pos + 1; + foundEnd = true; + continue; + } + if (propertyValue[pos] === ' ') { + newSelectionStart = pos + 1; + foundStart = true; + break; + } + } + + if (foundEnd && !foundStart) { + newSelectionStart = 0; + } + + return [newSelectionStart, newSelectionEnd]; +} + +export function getNodesInBetween(node1: Node, node2: Node): Node[] { + // Same node + if (sameNodes(node1, node2)) { + return [node1]; + } + + // Same parent + if (sameNodes(node1.parent, node2.parent)) { + return getNextSiblingsTillPosition(node1, node2.end); + } + + // node2 is ancestor of node1 + if (node2.start.isBefore(node1.start)) { + return [node2]; + } + + // node1 is ancestor of node2 + if (node2.start.isBefore(node1.end)) { + return [node1]; + } + + // Get the highest ancestor of node1 that should be commented + while (node1.parent && node1.parent.end.isBefore(node2.start)) { + node1 = node1.parent; + } + + // Get the highest ancestor of node2 that should be commented + while (node2.parent && node2.parent.start.isAfter(node1.start)) { + node2 = node2.parent; + } + + return getNextSiblingsTillPosition(node1, node2.end); +} + +function getNextSiblingsTillPosition(node: Node, position: vscode.Position): Node[] { + let siblings: Node[] = []; + let currentNode = node; + while (currentNode && position.isAfter(currentNode.start)) { + siblings.push(currentNode); + currentNode = currentNode.nextSibling; + } + return siblings; +} + +export function sameNodes(node1: Node, node2: Node): boolean { + if (!node1 || !node2) { + return false; + } + return (node1.start).isEqual(node2.start) && (node1.end).isEqual(node2.end); +} + - return getDeepestNode(node.children[node.children.length - 1]); -} \ No newline at end of file diff --git a/extensions/extension-editing/.vscodeignore b/extensions/extension-editing/.vscodeignore new file mode 100644 index 0000000000000000000000000000000000000000..24428a6f7582dfcae62d76da8786c132c9373e68 --- /dev/null +++ b/extensions/extension-editing/.vscodeignore @@ -0,0 +1,4 @@ +test/** +src/** +tsconfig.json +npm-shrinkwrap.json \ No newline at end of file diff --git a/extensions/fsharp/.vscodeignore b/extensions/fsharp/.vscodeignore new file mode 100644 index 0000000000000000000000000000000000000000..77ab386fc7df4fa2461a8f1ac8457a1e6c9e808a --- /dev/null +++ b/extensions/fsharp/.vscodeignore @@ -0,0 +1 @@ +test/** \ No newline at end of file diff --git a/extensions/fsharp/syntaxes/fsharp.json b/extensions/fsharp/syntaxes/fsharp.json index 7ef61094dd103f7a11b2114b4294a3150dbb12f2..f7abe7e8a525149c8b8649c4efc3ef3b84f2600c 100644 --- a/extensions/fsharp/syntaxes/fsharp.json +++ b/extensions/fsharp/syntaxes/fsharp.json @@ -1,4 +1,9 @@ { + "information_for_contributors": [ + "This file has been converted from https://github.com/ionide/ionide-fsgrammar/blob/master/grammar/fsharp.json", + "If you want to provide a fix or improvement, please create a pull request against the original repository.", + "Once accepted there, we are happy to receive an update request." + ], "name": "fsharp", "scopeName": "source.fsharp", "fileTypes": [ @@ -456,6 +461,5 @@ } ] } - }, - "version": "https://github.com/ionide/ionide-fsgrammar/commit/f2e3c30f0ebfcc89fb78ad908701159f20516812" + } } \ No newline at end of file diff --git a/extensions/git/.vscodeignore b/extensions/git/.vscodeignore new file mode 100644 index 0000000000000000000000000000000000000000..7ba0880ef8c0b32f1b8b7d561a99fa46ef4e655b --- /dev/null +++ b/extensions/git/.vscodeignore @@ -0,0 +1,5 @@ +src/** +test/** +out/test/** +tsconfig.json +npm-shrinkwrap.json \ No newline at end of file diff --git a/extensions/git/npm-shrinkwrap.json b/extensions/git/npm-shrinkwrap.json index d047fc02b9d9fa5767a6b7313de08f5d16cb9a9f..a0c40b07870f091f483fef842b065dc44f019b26 100644 --- a/extensions/git/npm-shrinkwrap.json +++ b/extensions/git/npm-shrinkwrap.json @@ -13,9 +13,9 @@ "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.15.tgz" }, "vscode-extension-telemetry": { - "version": "0.0.6", - "from": "vscode-extension-telemetry@>=0.0.6 <0.0.7", - "resolved": "https://registry.npmjs.org/vscode-extension-telemetry/-/vscode-extension-telemetry-0.0.6.tgz" + "version": "0.0.7", + "from": "vscode-extension-telemetry@>=0.0.7 <0.0.8", + "resolved": "https://registry.npmjs.org/vscode-extension-telemetry/-/vscode-extension-telemetry-0.0.7.tgz" }, "vscode-nls": { "version": "2.0.2", diff --git a/extensions/git/package.json b/extensions/git/package.json index 0ea489cc8129249e889072b5ad69e4920945298a..41fd4ba0de3ea86dde92e25218de49cee653ea67 100644 --- a/extensions/git/package.json +++ b/extensions/git/package.json @@ -531,7 +531,7 @@ { "command": "git.openFile", "group": "navigation", - "when": "config.git.enabled && scmProvider == git && isInDiffEditor && resourceScheme != extension" + "when": "config.git.enabled && scmProvider == git && isInDiffEditor && resourceScheme != extension && resourceScheme != merge-conflict.conflict-diff" }, { "command": "git.openChange", @@ -541,17 +541,17 @@ { "command": "git.stageSelectedRanges", "group": "2_git@1", - "when": "config.git.enabled && scmProvider == git && isInDiffEditor" + "when": "config.git.enabled && scmProvider == git && isInDiffEditor && resourceScheme != merge-conflict.conflict-diff" }, { "command": "git.unstageSelectedRanges", "group": "2_git@2", - "when": "config.git.enabled && scmProvider == git && isInDiffEditor" + "when": "config.git.enabled && scmProvider == git && isInDiffEditor && resourceScheme != merge-conflict.conflict-diff" }, { "command": "git.revertSelectedRanges", "group": "2_git@3", - "when": "config.git.enabled && scmProvider == git && isInDiffEditor" + "when": "config.git.enabled && scmProvider == git && isInDiffEditor && resourceScheme != merge-conflict.conflict-diff" } ] }, @@ -633,8 +633,8 @@ }, "dependencies": { "iconv-lite": "0.4.15", - "vscode-extension-telemetry": "^0.0.7", - "vscode-nls": "^2.0.1" + "vscode-extension-telemetry": "0.0.7", + "vscode-nls": "2.0.2" }, "devDependencies": { "@types/mocha": "^2.2.41", diff --git a/extensions/git/package.nls.json b/extensions/git/package.nls.json index e02a5ed2310fad67948a515deba45dc9dda0c078..655074654b2d8a53a29a667334b722658f27c98e 100644 --- a/extensions/git/package.nls.json +++ b/extensions/git/package.nls.json @@ -27,7 +27,7 @@ "command.push": "Push", "command.pushTo": "Push to...", "command.sync": "Sync", - "command.publish": "Publish", + "command.publish": "Publish Branch", "command.showOutput": "Show Git Output", "config.enabled": "Whether git is enabled", "config.path": "Path to the git executable", @@ -40,5 +40,5 @@ "config.ignoreLegacyWarning": "Ignores the legacy Git warning", "config.ignoreLimitWarning": "Ignores the warning when there are too many changes in a repository", "config.defaultCloneDirectory": "The default location where to clone a git repository", - "config.enableSmartCommit": "Commit all changes when there are not staged changes." -} \ No newline at end of file + "config.enableSmartCommit": "Commit all changes when there are no staged changes." +} diff --git a/extensions/git/src/commands.ts b/extensions/git/src/commands.ts index eed354dd8a4f1ce18aede020ea2e9c112e1e4024..05a93640ca1addfcac3ddb483703ebfaf33f1beb 100644 --- a/extensions/git/src/commands.ts +++ b/extensions/git/src/commands.ts @@ -5,7 +5,7 @@ 'use strict'; -import { Uri, commands, scm, Disposable, window, workspace, QuickPickItem, OutputChannel, Range, WorkspaceEdit, Position, LineChange, SourceControlResourceState } from 'vscode'; +import { Uri, commands, scm, Disposable, window, workspace, QuickPickItem, OutputChannel, Range, WorkspaceEdit, Position, LineChange, SourceControlResourceState, TextDocumentShowOptions, ViewColumn } from 'vscode'; import { Ref, RefType, Git, GitErrorCodes } from './git'; import { Model, Resource, Status, CommitOptions, WorkingTreeGroup, IndexGroup, MergeGroup } from './model'; import { toGitUri, fromGitUri } from './uri'; @@ -145,11 +145,18 @@ export class CommandCenter { return; } + const viewColumn = window.activeTextEditor && window.activeTextEditor.viewColumn || ViewColumn.One; + if (!left) { - return await commands.executeCommand('vscode.open', right); + return await commands.executeCommand('vscode.open', right, viewColumn); } - return await commands.executeCommand('vscode.diff', left, right, title, { preview: true }); + const opts: TextDocumentShowOptions = { + preview: true, + viewColumn + }; + + return await commands.executeCommand('vscode.diff', left, right, title, opts); } private getLeftResource(resource: Resource): Uri | undefined { @@ -289,7 +296,9 @@ export class CommandCenter { return; } - return await commands.executeCommand('vscode.open', uri); + const viewColumn = window.activeTextEditor && window.activeTextEditor.viewColumn || ViewColumn.One; + + return await commands.executeCommand('vscode.open', uri, viewColumn); } @command('git.openChange') @@ -329,7 +338,9 @@ export class CommandCenter { return; } - return await commands.executeCommand('vscode.open', uriToOpen); + const viewColumn = window.activeTextEditor && window.activeTextEditor.viewColumn || ViewColumn.One; + + return await commands.executeCommand('vscode.open', uriToOpen, viewColumn); } @command('git.stage') @@ -774,7 +785,7 @@ export class CommandCenter { return; } - await this.model.pull(true); + await this.model.pullWithRebase(); } @command('git.push') @@ -812,7 +823,7 @@ export class CommandCenter { return; } - this.model.push(pick.label, branchName); + this.model.pushTo(pick.label, branchName); } @command('git.sync') @@ -860,7 +871,7 @@ export class CommandCenter { return; } - await this.model.push(choice, branchName, { setUpstream: true }); + await this.model.pushTo(choice, branchName, true); } @command('git.showOutput') diff --git a/extensions/git/src/git.ts b/extensions/git/src/git.ts index 9ef482def9318be80e4e4401b43412f47cc6710a..ad023efdf6ea76006f28df514c4061b3c2184b90 100644 --- a/extensions/git/src/git.ts +++ b/extensions/git/src/git.ts @@ -21,10 +21,6 @@ export interface IGit { version: string; } -export interface PushOptions { - setUpstream?: boolean; -} - export interface IFileStatus { x: string; y: string; @@ -762,10 +758,10 @@ export class Repository { } } - async push(remote?: string, name?: string, options?: PushOptions): Promise { + async push(remote?: string, name?: string, setUpstream: boolean = false): Promise { const args = ['push']; - if (options && options.setUpstream) { + if (setUpstream) { args.push('-u'); } diff --git a/extensions/git/src/model.ts b/extensions/git/src/model.ts index aba4a4251d621804186de53fedc92145cc561d0e..4b2cf90035049ede8ced9114a71bb7ad4744d622 100644 --- a/extensions/git/src/model.ts +++ b/extensions/git/src/model.ts @@ -6,7 +6,7 @@ 'use strict'; import { Uri, Command, EventEmitter, Event, SourceControlResourceState, SourceControlResourceDecorations, Disposable, ProgressLocation, window, workspace } from 'vscode'; -import { Git, Repository, Ref, Branch, Remote, PushOptions, Commit, GitErrorCodes } from './git'; +import { Git, Repository, Ref, Branch, Remote, Commit, GitErrorCodes } from './git'; import { anyEvent, eventToPromise, filterEvent, EmptyDisposable, combinedDisposable, dispose } from './util'; import { memoize, throttle, debounce } from './decorators'; import * as path from 'path'; @@ -479,12 +479,23 @@ export class Model implements Disposable { } } - async pull(rebase?: boolean): Promise { - await this.run(Operation.Pull, () => this.repository.pull(rebase)); + @throttle + async pull(): Promise { + await this.run(Operation.Pull, () => this.repository.pull()); + } + + @throttle + async pullWithRebase(): Promise { + await this.run(Operation.Pull, () => this.repository.pull(true)); } - async push(remote?: string, name?: string, options?: PushOptions): Promise { - await this.run(Operation.Push, () => this.repository.push(remote, name, options)); + @throttle + async push(): Promise { + await this.run(Operation.Push, () => this.repository.push()); + } + + async pushTo(remote?: string, name?: string, setUpstream: boolean = false): Promise { + await this.run(Operation.Push, () => this.repository.push(remote, name, setUpstream)); } @throttle @@ -586,12 +597,13 @@ export class Model implements Disposable { const repositoryRoot = await this._git.getRepositoryRoot(this.workspaceRoot.fsPath); this.repository = this._git.open(repositoryRoot); - const onGitChange = filterEvent(this.onWorkspaceChange, uri => /\/\.git\//.test(uri.fsPath)); - const onRelevantGitChange = filterEvent(onGitChange, uri => !/\/\.git\/index\.lock$/.test(uri.fsPath)); + const onGitChange = filterEvent(this.onWorkspaceChange, uri => /\/\.git\//.test(uri.path)); + const onRelevantGitChange = filterEvent(onGitChange, uri => !/\/\.git\/index\.lock$/.test(uri.path)); + onRelevantGitChange(this.onFSChange, this, disposables); onRelevantGitChange(this._onDidChangeRepository.fire, this._onDidChangeRepository, disposables); - const onNonGitChange = filterEvent(this.onWorkspaceChange, uri => !/\/\.git\//.test(uri.fsPath)); + const onNonGitChange = filterEvent(this.onWorkspaceChange, uri => !/\/\.git\//.test(uri.path)); onNonGitChange(this.onFSChange, this, disposables); this.repositoryDisposable = combinedDisposable(disposables); diff --git a/extensions/git/src/statusbar.ts b/extensions/git/src/statusbar.ts index c609d570b9d431239fd05e2f8c4815bfaeefa220..9fe437ccec562df716280301df407891957e0b8b 100644 --- a/extensions/git/src/statusbar.ts +++ b/extensions/git/src/statusbar.ts @@ -114,11 +114,11 @@ class SyncStatusBar { text += `${HEAD.behind}↓ ${HEAD.ahead}↑`; } command = 'git.sync'; - tooltip = localize('sync changes', "Synchronize changes"); + tooltip = localize('sync changes', "Synchronize Changes"); } else { icon = '$(cloud-upload)'; command = 'git.publish'; - tooltip = localize('publish changes', "Publish changes"); + tooltip = localize('publish changes', "Publish Changes"); } } else { command = ''; @@ -128,7 +128,7 @@ class SyncStatusBar { if (this.state.isSyncRunning) { icon = '$(sync~spin)'; command = ''; - tooltip = localize('syncing changes', "Synchronizing changes..."); + tooltip = localize('syncing changes', "Synchronizing Changes..."); } return { diff --git a/extensions/git/vsc-extension-quickstart.md b/extensions/git/vsc-extension-quickstart.md deleted file mode 100644 index 6cdea2b5dad9c0e1d84d4e7a88419c640bcdb6d0..0000000000000000000000000000000000000000 --- a/extensions/git/vsc-extension-quickstart.md +++ /dev/null @@ -1,33 +0,0 @@ -# Welcome to your first VS Code Extension - -## What's in the folder -* This folder contains all of the files necessary for your extension -* `package.json` - this is the manifest file in which you declare your extension and command. -The sample plugin registers a command and defines its title and command name. With this information -VS Code can show the command in the command palette. It doesn’t yet need to load the plugin. -* `src/extension.ts` - this is the main file where you will provide the implementation of your command. -The file exports one function, `activate`, which is called the very first time your extension is -activated (in this case by executing the command). Inside the `activate` function we call `registerCommand`. -We pass the function containing the implementation of the command as the second parameter to -`registerCommand`. - -## Get up and running straight away -* press `F5` to open a new window with your extension loaded -* run your command from the command palette by pressing (`Ctrl+Shift+P` or `Cmd+Shift+P` on Mac) and typing `Hello World` -* set breakpoints in your code inside `src/extension.ts` to debug your extension -* find output from your extension in the debug console - -## Make changes -* you can relaunch the extension from the debug toolbar after changing code in `src/extension.ts` -* you can also reload (`Ctrl+R` or `Cmd+R` on Mac) the VS Code window with your extension to load your changes - -## Explore the API -* you can open the full set of our API when you open the file `node_modules/vscode/vscode.d.ts` - -## Run tests -* open the debug viewlet (`Ctrl+Shift+D` or `Cmd+Shift+D` on Mac) and from the launch configuration dropdown pick `Launch Tests` -* press `F5` to run the tests in a new window with your extension loaded -* see the output of the test result in the debug console -* make changes to `test/extension.test.ts` or create new test files inside the `test` folder - * by convention, the test runner will only consider files matching the name pattern `**.test.ts` - * you can create folders inside the `test` folder to structure your tests any way you want \ No newline at end of file diff --git a/extensions/gitsyntax/.vscodeignore b/extensions/gitsyntax/.vscodeignore new file mode 100644 index 0000000000000000000000000000000000000000..77ab386fc7df4fa2461a8f1ac8457a1e6c9e808a --- /dev/null +++ b/extensions/gitsyntax/.vscodeignore @@ -0,0 +1 @@ +test/** \ No newline at end of file diff --git a/extensions/gitsyntax/syntaxes/git-commit.tmLanguage.json b/extensions/gitsyntax/syntaxes/git-commit.tmLanguage.json index 5f5db8762fa29829e6b4355cac5d076e161569e5..ffe1561f7271b72362908802d0bb17bfd0ac789b 100644 --- a/extensions/gitsyntax/syntaxes/git-commit.tmLanguage.json +++ b/extensions/gitsyntax/syntaxes/git-commit.tmLanguage.json @@ -1,4 +1,9 @@ { + "information_for_contributors": [ + "This file has been converted from https://github.com/textmate/git.tmbundle/blob/master/Syntaxes/Git%20Commit%20Message.tmLanguage", + "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." + ], "fileTypes": [ "COMMIT_EDITMSG", "MERGE_MSG" @@ -138,6 +143,5 @@ } }, "scopeName": "text.git-commit", - "uuid": "BFE83C06-8508-44BE-A975-95A57BF619A7", - "version": "https://github.com/textmate/git.tmbundle/commit/93897a78c6e52bef13dadc0d4091d203c5facb40" + "uuid": "BFE83C06-8508-44BE-A975-95A57BF619A7" } \ No newline at end of file diff --git a/extensions/gitsyntax/syntaxes/git-rebase.tmLanguage.json b/extensions/gitsyntax/syntaxes/git-rebase.tmLanguage.json index c8bf731d9cb2a24ec0f2f1d460f3556cc82d8e5d..15bac0d8d0932ea26bb6de604556c59496c4916e 100644 --- a/extensions/gitsyntax/syntaxes/git-rebase.tmLanguage.json +++ b/extensions/gitsyntax/syntaxes/git-rebase.tmLanguage.json @@ -1,4 +1,9 @@ { + "information_for_contributors": [ + "This file has been converted from https://github.com/textmate/git.tmbundle/blob/master/Syntaxes/Git%20Rebase%20Message.tmLanguage", + "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." + ], "fileTypes": [ "git-rebase-todo" ], @@ -30,6 +35,5 @@ } ], "scopeName": "text.git-rebase", - "uuid": "7F1CC209-5F6D-486A-8180-09FA282381A1", - "version": "https://github.com/textmate/git.tmbundle/commit/d1db42c2d71948662098183a6df519fb53a7a15b" + "uuid": "7F1CC209-5F6D-486A-8180-09FA282381A1" } \ No newline at end of file diff --git a/extensions/go/.vscodeignore b/extensions/go/.vscodeignore new file mode 100644 index 0000000000000000000000000000000000000000..77ab386fc7df4fa2461a8f1ac8457a1e6c9e808a --- /dev/null +++ b/extensions/go/.vscodeignore @@ -0,0 +1 @@ +test/** \ No newline at end of file diff --git a/extensions/go/syntaxes/go.json b/extensions/go/syntaxes/go.json index 53908a80bac8640f6422b803933a4fe537e686f0..098c8710482c72a6ac0ff2743f2dad7b66bbb9da 100644 --- a/extensions/go/syntaxes/go.json +++ b/extensions/go/syntaxes/go.json @@ -1,4 +1,9 @@ { + "information_for_contributors": [ + "This file has been converted from https://github.com/atom/language-go/blob/master/grammars/go.cson", + "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." + ], "scopeName": "source.go", "name": "Go", "comment": "Go language", @@ -624,6 +629,5 @@ } ] } - }, - "version": "https://github.com/atom/language-go/commit/c1fe618ccf2dcd17118c5600c49b1c539f26d5c5" + } } \ No newline at end of file diff --git a/extensions/groovy/.vscodeignore b/extensions/groovy/.vscodeignore new file mode 100644 index 0000000000000000000000000000000000000000..77ab386fc7df4fa2461a8f1ac8457a1e6c9e808a --- /dev/null +++ b/extensions/groovy/.vscodeignore @@ -0,0 +1 @@ +test/** \ No newline at end of file diff --git a/extensions/groovy/syntaxes/groovy.tmLanguage.json b/extensions/groovy/syntaxes/groovy.tmLanguage.json index 8850454840eb428d35fd15d9502d7827d49b65cd..3dc8af7d0a168475daacf29f22aff216f8997cb4 100644 --- a/extensions/groovy/syntaxes/groovy.tmLanguage.json +++ b/extensions/groovy/syntaxes/groovy.tmLanguage.json @@ -1,4 +1,9 @@ { + "information_for_contributors": [ + "This file has been converted from https://github.com/textmate/groovy.tmbundle/blob/master/Syntaxes/Groovy.tmLanguage", + "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." + ], "fileTypes": [ "groovy", "gvy" @@ -1381,6 +1386,5 @@ } }, "scopeName": "source.groovy", - "uuid": "B3A64888-EBBB-4436-8D9E-F1169C5D7613", - "version": "https://github.com/textmate/groovy.tmbundle/commit/85d8f7c97ae473ccb9473f6c8d27e4ec957f4be1" + "uuid": "B3A64888-EBBB-4436-8D9E-F1169C5D7613" } \ No newline at end of file diff --git a/extensions/grunt/.vscodeignore b/extensions/grunt/.vscodeignore new file mode 100644 index 0000000000000000000000000000000000000000..ebab1d50b9ba0d8ac1a07d188a7fc624af042f6c --- /dev/null +++ b/extensions/grunt/.vscodeignore @@ -0,0 +1,3 @@ +test/** +src/** +tsconfig.json \ No newline at end of file diff --git a/extensions/grunt/package.json b/extensions/grunt/package.json index e3338dd8d346da238d1d7d3d8451f810c3668327..d8aabcc4133151571fa070eed7417609ce7cea77 100644 --- a/extensions/grunt/package.json +++ b/extensions/grunt/package.json @@ -7,6 +7,7 @@ "engines": { "vscode": "*" }, + "enableProposedApi": true, "categories": [ "Other" ], @@ -22,9 +23,7 @@ }, "main": "./out/main", "activationEvents": [ - "onCommand:workbench.action.tasks.runTask", - "onCommand:workbench.action.tasks.build", - "onCommand:workbench.action.tasks.test" + "onCommand:workbench.action.tasks.runTask" ], "contributes": { "configuration": { @@ -42,6 +41,22 @@ "description": "%config.grunt.autoDetect%" } } - } + }, + "taskTypes": [ + { + "type": "grunt", + "required": ["task"], + "properties": { + "task": { + "type": "string", + "description": "The Grunt task to customize" + }, + "file": { + "type": "string", + "description": "The Grunt file that provides the task. Can be omitted." + } + } + } + ] } } \ No newline at end of file diff --git a/extensions/grunt/src/main.ts b/extensions/grunt/src/main.ts index ff551f904ecc99d9c87a26368486765cc62f265e..8576b199e6328666653dd71cf85ca5e8c43b361a 100644 --- a/extensions/grunt/src/main.ts +++ b/extensions/grunt/src/main.ts @@ -34,12 +34,15 @@ export function activate(_context: vscode.ExtensionContext): void { taskProvider.dispose(); taskProvider = undefined; } else if (!taskProvider && autoDetect === 'on') { - taskProvider = vscode.workspace.registerTaskProvider({ + taskProvider = vscode.workspace.registerTaskProvider('grunt', { provideTasks: () => { if (!detectorPromise) { detectorPromise = getGruntTasks(); } return detectorPromise; + }, + resolveTask(_task: vscode.Task): vscode.Task | undefined { + return undefined; } }); } @@ -73,6 +76,39 @@ function exec(command: string, options: cp.ExecOptions): Promise<{ stdout: strin }); } +let _channel: vscode.OutputChannel; +function getOutputChannel(): vscode.OutputChannel { + if (!_channel) { + _channel = vscode.window.createOutputChannel('Grunt Auto Detection'); + } + return _channel; +} + +interface GruntTaskKind extends vscode.TaskKind { + task: string; + file?: string; +} + +const buildNames: string[] = ['build', 'compile', 'watch']; +function isBuildTask(name: string): boolean { + for (let buildName of buildNames) { + if (name.indexOf(buildName) !== -1) { + return true; + } + } + return false; +} + +const testNames: string[] = ['test']; +function isTestTask(name: string): boolean { + for (let testName of testNames) { + if (name.indexOf(testName) !== -1) { + return true; + } + } + return false; +} + async function getGruntTasks(): Promise { let workspaceRoot = vscode.workspace.rootPath; let emptyTasks: vscode.Task[] = []; @@ -95,18 +131,14 @@ async function getGruntTasks(): Promise { } let commandLine = `${command} --help --no-color`; - let channel = vscode.window.createOutputChannel('tasks'); try { let { stdout, stderr } = await exec(commandLine, { cwd: workspaceRoot }); if (stderr) { - channel.appendLine(stderr); - channel.show(true); + getOutputChannel().appendLine(stderr); + getOutputChannel().show(true); } let result: vscode.Task[] = []; if (stdout) { - let buildTask: { task: vscode.Task | undefined, rank: number } = { task: undefined, rank: 0 }; - let testTask: { task: vscode.Task | undefined, rank: number } = { task: undefined, rank: 0 }; - // grunt lists tasks as follows (description is wrapped into a new line if too long): // ... // Available tasks @@ -138,39 +170,36 @@ async function getGruntTasks(): Promise { let matches = regExp.exec(line); if (matches && matches.length === 2) { let taskName = matches[1]; + let kind: GruntTaskKind = { + type: 'grunt', + task: taskName + }; let task = taskName.indexOf(' ') === -1 - ? new vscode.ShellTask(`grunt: ${taskName}`, `${command} ${taskName}`) - : new vscode.ShellTask(`grunt: ${taskName}`, `${command} "${taskName}"`); - task.identifier = `grunt.${taskName}`; + ? new vscode.Task(kind, taskName, new vscode.ShellExecution(`${command} ${taskName}`)) + : new vscode.Task(kind, taskName, new vscode.ShellExecution(`${command} "${taskName}"`)); result.push(task); let lowerCaseTaskName = taskName.toLowerCase(); - if (lowerCaseTaskName === 'build') { - buildTask = { task, rank: 2 }; - } else if (lowerCaseTaskName.indexOf('build') !== -1 && buildTask.rank < 1) { - buildTask = { task, rank: 1 }; - } else if (lowerCaseTaskName === 'test') { - testTask = { task, rank: 2 }; - } else if (lowerCaseTaskName.indexOf('test') !== -1 && testTask.rank < 1) { - testTask = { task, rank: 1 }; + if (isBuildTask(lowerCaseTaskName)) { + task.group = vscode.TaskGroup.Build; + } else if (isTestTask(lowerCaseTaskName)) { + task.group = vscode.TaskGroup.Test; } } } } } - if (buildTask.task) { - buildTask.task.group = vscode.TaskGroup.Build; - } - if (testTask.task) { - testTask.task.group = vscode.TaskGroup.Test; - } } return result; } catch (err) { + let channel = getOutputChannel(); if (err.stderr) { channel.appendLine(err.stderr); - channel.show(true); + } + if (err.stdout) { + channel.appendLine(err.stdout); } channel.appendLine(localize('execFailed', 'Auto detecting Grunt failed with error: {0}', err.error ? err.error.toString() : 'unknown')); + channel.show(true); return emptyTasks; } } \ No newline at end of file diff --git a/extensions/gulp/.vscodeignore b/extensions/gulp/.vscodeignore new file mode 100644 index 0000000000000000000000000000000000000000..d43a539fddf5b4f3cc2950970f42a6d5238219b6 --- /dev/null +++ b/extensions/gulp/.vscodeignore @@ -0,0 +1,2 @@ +src/** +tsconfig.json \ No newline at end of file diff --git a/extensions/gulp/package.json b/extensions/gulp/package.json index 0d1d70f9e1ef68f3198635030fd29b96dd55caad..c999dec8645e357c32028365ba7efae4aa2e8bfc 100644 --- a/extensions/gulp/package.json +++ b/extensions/gulp/package.json @@ -7,6 +7,7 @@ "engines": { "vscode": "*" }, + "enableProposedApi": true, "categories": [ "Other" ], @@ -22,9 +23,7 @@ }, "main": "./out/main", "activationEvents": [ - "onCommand:workbench.action.tasks.runTask", - "onCommand:workbench.action.tasks.build", - "onCommand:workbench.action.tasks.test" + "onCommand:workbench.action.tasks.runTask" ], "contributes": { "configuration": { @@ -42,6 +41,22 @@ "description": "%config.gulp.autoDetect%" } } - } + }, + "taskTypes": [ + { + "type": "gulp", + "required": ["task"], + "properties": { + "task": { + "type": "string", + "description": "The Gulp task to customize" + }, + "file": { + "type": "string", + "description": "The Gulp file that provides the task. Can be omitted." + } + } + } + ] } } \ No newline at end of file diff --git a/extensions/gulp/src/main.ts b/extensions/gulp/src/main.ts index 666b66bf120c1dcb9a456912c0ec21932171cd5e..c850de3912c1229f0bea593842559593f2cc5043 100644 --- a/extensions/gulp/src/main.ts +++ b/extensions/gulp/src/main.ts @@ -34,12 +34,15 @@ export function activate(_context: vscode.ExtensionContext): void { taskProvider.dispose(); taskProvider = undefined; } else if (!taskProvider && autoDetect === 'on') { - taskProvider = vscode.workspace.registerTaskProvider({ + taskProvider = vscode.workspace.registerTaskProvider('gulp', { provideTasks: () => { if (!gulpPromise) { gulpPromise = getGulpTasks(); } return gulpPromise; + }, + resolveTask(_task: vscode.Task): vscode.Task | undefined { + return undefined; } }); } @@ -73,6 +76,39 @@ function exec(command: string, options: cp.ExecOptions): Promise<{ stdout: strin }); } +let _channel: vscode.OutputChannel; +function getOutputChannel(): vscode.OutputChannel { + if (!_channel) { + _channel = vscode.window.createOutputChannel('Gulp Auto Detection'); + } + return _channel; +} + +interface GulpTaskKind extends vscode.TaskKind { + task: string; + file?: string; +} + +const buildNames: string[] = ['build', 'compile', 'watch']; +function isBuildTask(name: string): boolean { + for (let buildName of buildNames) { + if (name.indexOf(buildName) !== -1) { + return true; + } + } + return false; +} + +const testNames: string[] = ['test']; +function isTestTask(name: string): boolean { + for (let testName of testNames) { + if (name.indexOf(testName) !== -1) { + return true; + } + } + return false; +} + async function getGulpTasks(): Promise { let workspaceRoot = vscode.workspace.rootPath; let emptyTasks: vscode.Task[] = []; @@ -98,49 +134,44 @@ async function getGulpTasks(): Promise { } let commandLine = `${gulpCommand} --tasks-simple --no-color`; - let channel = vscode.window.createOutputChannel('tasks'); try { let { stdout, stderr } = await exec(commandLine, { cwd: workspaceRoot }); - if (stderr) { - channel.appendLine(stderr); - channel.show(true); + if (stderr && stderr.length > 0) { + getOutputChannel().appendLine(stderr); + getOutputChannel().show(true); } let result: vscode.Task[] = []; if (stdout) { - let buildTask: { task: vscode.Task | undefined, rank: number } = { task: undefined, rank: 0 }; - let testTask: { task: vscode.Task | undefined, rank: number } = { task: undefined, rank: 0 }; let lines = stdout.split(/\r{0,1}\n/); for (let line of lines) { if (line.length === 0) { continue; } - let task = new vscode.ShellTask(`gulp: ${line}`, `${gulpCommand} ${line}`); - task.identifier = `gulp.${line}`; + let kind: GulpTaskKind = { + type: 'gulp', + task: line + }; + let task = new vscode.Task(kind, line, new vscode.ShellExecution(`${gulpCommand} ${line}`)); result.push(task); let lowerCaseLine = line.toLowerCase(); - if (lowerCaseLine === 'build') { - buildTask = { task, rank: 2 }; - } else if (lowerCaseLine.indexOf('build') !== -1 && buildTask.rank < 1) { - buildTask = { task, rank: 1 }; - } else if (lowerCaseLine === 'test') { - testTask = { task, rank: 2 }; - } else if (lowerCaseLine.indexOf('test') !== -1 && testTask.rank < 1) { - testTask = { task, rank: 1 }; + if (isBuildTask(lowerCaseLine)) { + task.group = vscode.TaskGroup.Build; + } else if (isTestTask(lowerCaseLine)) { + task.group = vscode.TaskGroup.Test; } } - if (buildTask.task) { - buildTask.task.group = vscode.TaskGroup.Build; - } - if (testTask.task) { - testTask.task.group = vscode.TaskGroup.Test; - } } return result; } catch (err) { + let channel = getOutputChannel(); if (err.stderr) { channel.appendLine(err.stderr); } + if (err.stdout) { + channel.appendLine(err.stdout); + } channel.appendLine(localize('execFailed', 'Auto detecting gulp failed with error: {0}', err.error ? err.error.toString() : 'unknown')); + channel.show(true); return emptyTasks; } } \ No newline at end of file diff --git a/extensions/handlebars/.vscodeignore b/extensions/handlebars/.vscodeignore new file mode 100644 index 0000000000000000000000000000000000000000..77ab386fc7df4fa2461a8f1ac8457a1e6c9e808a --- /dev/null +++ b/extensions/handlebars/.vscodeignore @@ -0,0 +1 @@ +test/** \ No newline at end of file diff --git a/extensions/handlebars/syntaxes/Handlebars.tmLanguage.json b/extensions/handlebars/syntaxes/Handlebars.tmLanguage.json index 9e3579d90c283ca45b7e623fb1dbff760902d717..e915b691d7faabef66944367f3bd7a839bd87a1b 100644 --- a/extensions/handlebars/syntaxes/Handlebars.tmLanguage.json +++ b/extensions/handlebars/syntaxes/Handlebars.tmLanguage.json @@ -1,4 +1,9 @@ { + "information_for_contributors": [ + "This file has been converted from https://github.com/daaain/Handlebars/blob/master/grammars/Handlebars.json", + "If you want to provide a fix or improvement, please create a pull request against the original repository.", + "Once accepted there, we are happy to receive an update request." + ], "name": "Handlebars", "repository": { "html_tags": { @@ -849,6 +854,5 @@ "template", "tmpl" ], - "uuid": "70E91676-DE0A-4266-A2B9-3AD2E535E484", - "version": "https://github.com/daaain/Handlebars/commit/4e8244410815da73f93375532939d48bd5a9bb93" + "uuid": "70E91676-DE0A-4266-A2B9-3AD2E535E484" } \ No newline at end of file diff --git a/extensions/hlsl/.vscodeignore b/extensions/hlsl/.vscodeignore new file mode 100644 index 0000000000000000000000000000000000000000..77ab386fc7df4fa2461a8f1ac8457a1e6c9e808a --- /dev/null +++ b/extensions/hlsl/.vscodeignore @@ -0,0 +1 @@ +test/** \ No newline at end of file diff --git a/extensions/hlsl/syntaxes/hlsl.json b/extensions/hlsl/syntaxes/hlsl.json index 91dcf2b2520269431ccdc7d87b38800d1b2bc104..20565922c5383db1a778038e45dd062c135a67d2 100644 --- a/extensions/hlsl/syntaxes/hlsl.json +++ b/extensions/hlsl/syntaxes/hlsl.json @@ -1,4 +1,9 @@ { + "information_for_contributors": [ + "This file has been converted from https://github.com/tgjones/shaders-tmLanguage/blob/master/grammars/hlsl.json", + "If you want to provide a fix or improvement, please create a pull request against the original repository.", + "Once accepted there, we are happy to receive an update request." + ], "scopeName": "source.hlsl", "name": "HLSL", "fileTypes": [ @@ -213,6 +218,5 @@ } ] } - ], - "version": "https://github.com/tgjones/shaders-tmLanguage/commit/cd1ef40f549f9ce2b9e6b73498688de114a85382" + ] } \ No newline at end of file diff --git a/extensions/html/.vscodeignore b/extensions/html/.vscodeignore new file mode 100644 index 0000000000000000000000000000000000000000..4fddc6954ced2f13675bc51651c7342d47636f19 --- /dev/null +++ b/extensions/html/.vscodeignore @@ -0,0 +1,9 @@ +test/** +server/tsconfig.json +server/node_modules/@types/** +server/src/** +server/test/** +server/out/test/** +client/tsconfig.json +client/src/** +npm-shrinkwrap.json \ No newline at end of file diff --git a/extensions/html/OSSREADME.json b/extensions/html/OSSREADME.json index 238e37e068fcd44e606386cfd963b6fb6fc26cd6..473df53afb391b3a1c968f524a8cd54b52e57baa 100644 --- a/extensions/html/OSSREADME.json +++ b/extensions/html/OSSREADME.json @@ -50,7 +50,7 @@ "name": "Ionic documentation", "version": "1.2.4", "license": "Apache2", - "repositoryURL": "https://github.com/driftyco/ionic-site", + "repositoryURL": "https://github.com/ionic-team/ionic-site", "licenseDetail": [ "Copyright Drifty Co. http://drifty.com/.", "", diff --git a/extensions/html/client/src/htmlMain.ts b/extensions/html/client/src/htmlMain.ts index cd12405a71f245644c111acdd38427d4512c5a0c..7f4c9fe3440604506fc53b9c4f9c88b34ccf6ab0 100644 --- a/extensions/html/client/src/htmlMain.ts +++ b/extensions/html/client/src/htmlMain.ts @@ -78,6 +78,10 @@ export function activate(context: ExtensionContext) { }); languages.setLanguageConfiguration('html', { + indentationRules: { + increaseIndentPattern: /<(?!\?|(?:area|base|br|col|frame|hr|html|img|input|link|meta|param)\b|[^>]*\/>)([-_\.A-Za-z0-9]+)(?=\s|>)\b[^>]*>(?!.*<\/\1>)|)|\{[^}"']*$/, + decreaseIndentPattern: /^\s*(<\/(?!html)[-_\.A-Za-z0-9]+\b[^>]*>|-->|\})/ + }, wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g, onEnterRules: [ { diff --git a/extensions/html/npm-shrinkwrap.json b/extensions/html/npm-shrinkwrap.json index fe73237002a1ef011cada280e397f6ac2cedd2d9..71b52086cdf93f34bf760e889bbf76ca1f582b14 100644 --- a/extensions/html/npm-shrinkwrap.json +++ b/extensions/html/npm-shrinkwrap.json @@ -8,9 +8,9 @@ "resolved": "https://registry.npmjs.org/applicationinsights/-/applicationinsights-0.18.0.tgz" }, "vscode-extension-telemetry": { - "version": "0.0.6", - "from": "vscode-extension-telemetry@>=0.0.6 <0.0.7", - "resolved": "https://registry.npmjs.org/vscode-extension-telemetry/-/vscode-extension-telemetry-0.0.6.tgz" + "version": "0.0.7", + "from": "vscode-extension-telemetry@>=0.0.7 <0.0.8", + "resolved": "https://registry.npmjs.org/vscode-extension-telemetry/-/vscode-extension-telemetry-0.0.7.tgz" }, "vscode-jsonrpc": { "version": "3.1.0-alpha.1", @@ -38,4 +38,4 @@ "resolved": "https://registry.npmjs.org/winreg/-/winreg-1.2.3.tgz" } } -} +} \ No newline at end of file diff --git a/extensions/html/package.json b/extensions/html/package.json index 7c6e97305a1642525a0a74cb43c0726cb92a49e9..be55a49c0e137478f281a57cd38c8cdaa333e04a 100644 --- a/extensions/html/package.json +++ b/extensions/html/package.json @@ -24,6 +24,7 @@ { "id": "html", "extensions": [ + ".rhtml", ".html", ".htm", ".shtml", @@ -190,13 +191,13 @@ } }, "dependencies": { - "vscode-extension-telemetry": "^0.0.7", - "vscode-languageclient": "^3.1.0-alpha.1", - "vscode-languageserver-types": "^3.0.3", - "vscode-nls": "^2.0.2" + "vscode-extension-telemetry": "0.0.7", + "vscode-languageclient": "3.1.0-alpha.1", + "vscode-languageserver-types": "3.0.3", + "vscode-nls": "2.0.2" }, "devDependencies": { "@types/node": "^6.0.51", "@types/mocha": "^2.2.33" } -} +} \ No newline at end of file diff --git a/extensions/html/server/npm-shrinkwrap.json b/extensions/html/server/npm-shrinkwrap.json index 82254c66b11dfada547e3f27a3b94d3246fda297..ee83f51e71e65797998cec7cab7388f59a8ce8c8 100644 --- a/extensions/html/server/npm-shrinkwrap.json +++ b/extensions/html/server/npm-shrinkwrap.json @@ -3,14 +3,21 @@ "version": "1.0.0", "dependencies": { "vscode-css-languageservice": { - "version": "2.0.2", + "version": "2.1.0", "from": "vscode-css-languageservice@next", - "resolved": "https://registry.npmjs.org/vscode-css-languageservice/-/vscode-css-languageservice-2.0.2.tgz" + "resolved": "https://registry.npmjs.org/vscode-css-languageservice/-/vscode-css-languageservice-2.1.0.tgz", + "dependencies": { + "vscode-languageserver-types": { + "version": "3.2.0", + "from": "vscode-languageserver-types@>=3.2.0 <4.0.0", + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.2.0.tgz" + } + } }, "vscode-html-languageservice": { - "version": "2.0.4", + "version": "2.0.5", "from": "vscode-html-languageservice@next", - "resolved": "https://registry.npmjs.org/vscode-html-languageservice/-/vscode-html-languageservice-2.0.4.tgz" + "resolved": "https://registry.npmjs.org/vscode-html-languageservice/-/vscode-html-languageservice-2.0.5.tgz" }, "vscode-jsonrpc": { "version": "3.1.0-alpha.1", diff --git a/extensions/html/server/package.json b/extensions/html/server/package.json index a80e9b214bafac25cfdba7bab2f726fcb59286b9..5284d547143e50a9e5ad9256b269b255b79474e1 100644 --- a/extensions/html/server/package.json +++ b/extensions/html/server/package.json @@ -8,8 +8,8 @@ "node": "*" }, "dependencies": { - "vscode-css-languageservice": "^2.0.2", - "vscode-html-languageservice": "^2.0.4", + "vscode-css-languageservice": "^2.1.0", + "vscode-html-languageservice": "^2.0.5", "vscode-languageserver": "^3.1.0-alpha.1", "vscode-nls": "^2.0.2", "vscode-uri": "^1.0.0" diff --git a/extensions/html/server/src/modes/languageModes.ts b/extensions/html/server/src/modes/languageModes.ts index 54349b429d886e19585fbf4c80f94877a889ffbf..59851b10851e74e1113724e5ec7603d6470b73d8 100644 --- a/extensions/html/server/src/modes/languageModes.ts +++ b/extensions/html/server/src/modes/languageModes.ts @@ -68,7 +68,7 @@ export function getLanguageModes(supportedLanguages: { [languageId: string]: boo } return { getModeAtPosition(document: TextDocument, position: Position): LanguageMode { - let languageId = documentRegions.get(document).getLanguageAtPosition(position);; + let languageId = documentRegions.get(document).getLanguageAtPosition(position); if (languageId) { return modes[languageId]; } diff --git a/extensions/html/syntaxes/html.json b/extensions/html/syntaxes/html.json index cc2d9fd17ea60557901dc15d14c710b28a69683e..4192c82470395fd1a6d115277b663a17c97da333 100644 --- a/extensions/html/syntaxes/html.json +++ b/extensions/html/syntaxes/html.json @@ -1,4 +1,9 @@ { + "information_for_contributors": [ + "This file has been converted from https://github.com/textmate/html.tmbundle/blob/master/Syntaxes/HTML.plist", + "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." + ], "fileTypes": [ "html", "htm", @@ -742,6 +747,5 @@ } }, "scopeName": "text.html.basic", - "uuid": "17994EC8-6B1D-11D9-AC3A-000D93589AF6", - "version": "https://github.com/textmate/html.tmbundle/commit/a723f08ebd49c67c22aca08dd8f17d0bf836ec93" + "uuid": "17994EC8-6B1D-11D9-AC3A-000D93589AF6" } \ No newline at end of file diff --git a/extensions/ini/.vscodeignore b/extensions/ini/.vscodeignore new file mode 100644 index 0000000000000000000000000000000000000000..77ab386fc7df4fa2461a8f1ac8457a1e6c9e808a --- /dev/null +++ b/extensions/ini/.vscodeignore @@ -0,0 +1 @@ +test/** \ No newline at end of file diff --git a/extensions/ini/package.json b/extensions/ini/package.json index b6a9b6c37d0152dc0a59180ed3884d7279c68327..bfb7bb522157e1d00c6506883e2ebeeed045b159 100644 --- a/extensions/ini/package.json +++ b/extensions/ini/package.json @@ -3,6 +3,9 @@ "version": "0.1.0", "publisher": "vscode", "engines": { "vscode": "*" }, + "scripts": { + "update-grammar": "node ../../build/npm/update-grammar.js textmate/ini.tmbundle Syntaxes/Ini.plist ./syntaxes/ini.tmLanguage.json" + }, "contributes": { "languages": [{ "id": "ini", @@ -19,12 +22,12 @@ }], "grammars": [{ "language": "ini", - "scopeName": "source.properties", - "path": "./syntaxes/properties.plist" + "scopeName": "source.ini", + "path": "./syntaxes/ini.tmLanguage.json" },{ "language": "properties", - "scopeName": "source.properties", - "path": "./syntaxes/properties.plist" + "scopeName": "source.ini", + "path": "./syntaxes/ini.tmLanguage.json" }] } } diff --git a/extensions/ini/syntaxes/ini.tmLanguage.json b/extensions/ini/syntaxes/ini.tmLanguage.json new file mode 100644 index 0000000000000000000000000000000000000000..34679c1bee09cd965bd4c0a33734f863e156143b --- /dev/null +++ b/extensions/ini/syntaxes/ini.tmLanguage.json @@ -0,0 +1,118 @@ +{ + "information_for_contributors": [ + "This file has been converted from https://github.com/textmate/ini.tmbundle/blob/master/Syntaxes/Ini.plist", + "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." + ], + "fileTypes": [ + "ini", + "conf" + ], + "keyEquivalent": "^~I", + "name": "Ini", + "patterns": [ + { + "begin": "(^[ \\t]+)?(?=#)", + "beginCaptures": { + "1": { + "name": "punctuation.whitespace.comment.leading.ini" + } + }, + "end": "(?!\\G)", + "patterns": [ + { + "begin": "#", + "beginCaptures": { + "0": { + "name": "punctuation.definition.comment.ini" + } + }, + "end": "\\n", + "name": "comment.line.number-sign.ini" + } + ] + }, + { + "begin": "(^[ \\t]+)?(?=;)", + "beginCaptures": { + "1": { + "name": "punctuation.whitespace.comment.leading.ini" + } + }, + "end": "(?!\\G)", + "patterns": [ + { + "begin": ";", + "beginCaptures": { + "0": { + "name": "punctuation.definition.comment.ini" + } + }, + "end": "\\n", + "name": "comment.line.semicolon.ini" + } + ] + }, + { + "captures": { + "1": { + "name": "keyword.other.definition.ini" + }, + "2": { + "name": "punctuation.separator.key-value.ini" + } + }, + "match": "\\b([a-zA-Z0-9_.-]+)\\b\\s*(=)" + }, + { + "captures": { + "1": { + "name": "punctuation.definition.entity.ini" + }, + "3": { + "name": "punctuation.definition.entity.ini" + } + }, + "match": "^(\\[)(.*?)(\\])", + "name": "entity.name.section.group-title.ini" + }, + { + "begin": "'", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.ini" + } + }, + "end": "'", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.ini" + } + }, + "name": "string.quoted.single.ini", + "patterns": [ + { + "match": "\\\\.", + "name": "constant.character.escape.ini" + } + ] + }, + { + "begin": "\"", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.ini" + } + }, + "end": "\"", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.ini" + } + }, + "name": "string.quoted.double.ini" + } + ], + "scopeName": "source.ini", + "uuid": "77DC23B6-8A90-11D9-BAA4-000A9584EC8C" +} \ No newline at end of file diff --git a/extensions/ini/syntaxes/properties.plist b/extensions/ini/syntaxes/properties.plist deleted file mode 100644 index 11436566bd5a5463ec8d8f71ab0738efc15f1728..0000000000000000000000000000000000000000 --- a/extensions/ini/syntaxes/properties.plist +++ /dev/null @@ -1,181 +0,0 @@ - - - - - fileTypes - - ini - conf - - keyEquivalent - ^~I - name - Ini - patterns - - - begin - (^[ \t]+)?(?=#) - beginCaptures - - 1 - - name - punctuation.whitespace.comment.leading.ini - - - end - (?!\G) - patterns - - - begin - # - beginCaptures - - 0 - - name - punctuation.definition.comment.ini - - - end - \n - name - comment.line.number-sign.ini - - - - - begin - (^[ \t]+)?(?=;) - beginCaptures - - 1 - - name - punctuation.whitespace.comment.leading.ini - - - end - (?!\G) - patterns - - - begin - ; - beginCaptures - - 0 - - name - punctuation.definition.comment.ini - - - end - \n - name - comment.line.semicolon.ini - - - - - captures - - 1 - - name - keyword.other.definition.ini - - 2 - - name - punctuation.separator.key-value.ini - - - match - \b([a-zA-Z0-9_.-]+)\b\s*(=) - - - captures - - 1 - - name - punctuation.definition.entity.ini - - 3 - - name - punctuation.definition.entity.ini - - - match - ^(\[)(.*?)(\]) - name - entity.name.section.group-title.ini - - - begin - ' - beginCaptures - - 0 - - name - punctuation.definition.string.begin.ini - - - end - ' - endCaptures - - 0 - - name - punctuation.definition.string.end.ini - - - name - string.quoted.single.ini - patterns - - - match - \\. - name - constant.character.escape.ini - - - - - begin - " - beginCaptures - - 0 - - name - punctuation.definition.string.begin.ini - - - end - " - endCaptures - - 0 - - name - punctuation.definition.string.end.ini - - - name - string.quoted.double.ini - - - scopeName - source.properties - uuid - 77DC23B6-8A90-11D9-BAA4-000A9584EC8C - - \ No newline at end of file diff --git a/extensions/ini/test/colorize-results/test_ini.json b/extensions/ini/test/colorize-results/test_ini.json index f30cdc5389207bbb4edc6ef71eb9c6870c48e066..5b001c68246edc77235e3cef502df5de1a12a777 100644 --- a/extensions/ini/test/colorize-results/test_ini.json +++ b/extensions/ini/test/colorize-results/test_ini.json @@ -1,7 +1,7 @@ [ { "c": ";", - "t": "source.properties comment.line.semicolon.ini punctuation.definition.comment.ini", + "t": "source.ini comment.line.semicolon.ini punctuation.definition.comment.ini", "r": { "dark_plus": "comment: #608B4E", "light_plus": "comment: #008000", @@ -12,7 +12,7 @@ }, { "c": " last modified 1 April 2001 by John Doe", - "t": "source.properties comment.line.semicolon.ini", + "t": "source.ini comment.line.semicolon.ini", "r": { "dark_plus": "comment: #608B4E", "light_plus": "comment: #008000", @@ -23,7 +23,7 @@ }, { "c": "[", - "t": "source.properties entity.name.section.group-title.ini punctuation.definition.entity.ini", + "t": "source.ini entity.name.section.group-title.ini punctuation.definition.entity.ini", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -34,7 +34,7 @@ }, { "c": "owner", - "t": "source.properties entity.name.section.group-title.ini", + "t": "source.ini entity.name.section.group-title.ini", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -45,7 +45,7 @@ }, { "c": "]", - "t": "source.properties entity.name.section.group-title.ini punctuation.definition.entity.ini", + "t": "source.ini entity.name.section.group-title.ini punctuation.definition.entity.ini", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -56,7 +56,7 @@ }, { "c": "name", - "t": "source.properties keyword.other.definition.ini", + "t": "source.ini keyword.other.definition.ini", "r": { "dark_plus": "keyword: #569CD6", "light_plus": "keyword: #0000FF", @@ -67,7 +67,7 @@ }, { "c": "=", - "t": "source.properties punctuation.separator.key-value.ini", + "t": "source.ini punctuation.separator.key-value.ini", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -78,7 +78,7 @@ }, { "c": "John Doe", - "t": "source.properties", + "t": "source.ini", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -89,7 +89,7 @@ }, { "c": "organization", - "t": "source.properties keyword.other.definition.ini", + "t": "source.ini keyword.other.definition.ini", "r": { "dark_plus": "keyword: #569CD6", "light_plus": "keyword: #0000FF", @@ -100,7 +100,7 @@ }, { "c": "=", - "t": "source.properties punctuation.separator.key-value.ini", + "t": "source.ini punctuation.separator.key-value.ini", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -111,7 +111,7 @@ }, { "c": "Acme Widgets Inc.", - "t": "source.properties", + "t": "source.ini", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -122,7 +122,7 @@ }, { "c": "[", - "t": "source.properties entity.name.section.group-title.ini punctuation.definition.entity.ini", + "t": "source.ini entity.name.section.group-title.ini punctuation.definition.entity.ini", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -133,7 +133,7 @@ }, { "c": "database", - "t": "source.properties entity.name.section.group-title.ini", + "t": "source.ini entity.name.section.group-title.ini", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -144,7 +144,7 @@ }, { "c": "]", - "t": "source.properties entity.name.section.group-title.ini punctuation.definition.entity.ini", + "t": "source.ini entity.name.section.group-title.ini punctuation.definition.entity.ini", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -155,7 +155,7 @@ }, { "c": ";", - "t": "source.properties comment.line.semicolon.ini punctuation.definition.comment.ini", + "t": "source.ini comment.line.semicolon.ini punctuation.definition.comment.ini", "r": { "dark_plus": "comment: #608B4E", "light_plus": "comment: #008000", @@ -166,7 +166,7 @@ }, { "c": " use IP address in case network name resolution is not working", - "t": "source.properties comment.line.semicolon.ini", + "t": "source.ini comment.line.semicolon.ini", "r": { "dark_plus": "comment: #608B4E", "light_plus": "comment: #008000", @@ -177,7 +177,7 @@ }, { "c": "server", - "t": "source.properties keyword.other.definition.ini", + "t": "source.ini keyword.other.definition.ini", "r": { "dark_plus": "keyword: #569CD6", "light_plus": "keyword: #0000FF", @@ -188,7 +188,7 @@ }, { "c": "=", - "t": "source.properties punctuation.separator.key-value.ini", + "t": "source.ini punctuation.separator.key-value.ini", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -199,7 +199,7 @@ }, { "c": "192.0.2.62", - "t": "source.properties", + "t": "source.ini", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -210,7 +210,7 @@ }, { "c": "port", - "t": "source.properties keyword.other.definition.ini", + "t": "source.ini keyword.other.definition.ini", "r": { "dark_plus": "keyword: #569CD6", "light_plus": "keyword: #0000FF", @@ -221,7 +221,7 @@ }, { "c": "=", - "t": "source.properties punctuation.separator.key-value.ini", + "t": "source.ini punctuation.separator.key-value.ini", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -232,7 +232,7 @@ }, { "c": "143", - "t": "source.properties", + "t": "source.ini", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -243,7 +243,7 @@ }, { "c": "file", - "t": "source.properties keyword.other.definition.ini", + "t": "source.ini keyword.other.definition.ini", "r": { "dark_plus": "keyword: #569CD6", "light_plus": "keyword: #0000FF", @@ -254,7 +254,7 @@ }, { "c": "=", - "t": "source.properties punctuation.separator.key-value.ini", + "t": "source.ini punctuation.separator.key-value.ini", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -265,7 +265,7 @@ }, { "c": "\"", - "t": "source.properties string.quoted.double.ini punctuation.definition.string.begin.ini", + "t": "source.ini string.quoted.double.ini punctuation.definition.string.begin.ini", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -276,7 +276,7 @@ }, { "c": "payroll.dat", - "t": "source.properties string.quoted.double.ini", + "t": "source.ini string.quoted.double.ini", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -287,7 +287,7 @@ }, { "c": "\"", - "t": "source.properties string.quoted.double.ini punctuation.definition.string.end.ini", + "t": "source.ini string.quoted.double.ini punctuation.definition.string.end.ini", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", diff --git a/extensions/jake/.vscodeignore b/extensions/jake/.vscodeignore new file mode 100644 index 0000000000000000000000000000000000000000..d43a539fddf5b4f3cc2950970f42a6d5238219b6 --- /dev/null +++ b/extensions/jake/.vscodeignore @@ -0,0 +1,2 @@ +src/** +tsconfig.json \ No newline at end of file diff --git a/extensions/jake/package.json b/extensions/jake/package.json index dd34c9b2235c2274deff26f3150e6af84f259b86..3745ed144c0a41560bd36e48ab2152a8ea0a60a0 100644 --- a/extensions/jake/package.json +++ b/extensions/jake/package.json @@ -7,6 +7,7 @@ "engines": { "vscode": "*" }, + "enableProposedApi": true, "categories": [ "Other" ], @@ -22,9 +23,7 @@ }, "main": "./out/main", "activationEvents": [ - "onCommand:workbench.action.tasks.runTask", - "onCommand:workbench.action.tasks.build", - "onCommand:workbench.action.tasks.test" + "onCommand:workbench.action.tasks.runTask" ], "contributes": { "configuration": { @@ -42,6 +41,22 @@ "description": "%config.jake.autoDetect%" } } - } + }, + "taskTypes": [ + { + "type": "jake", + "required": ["task"], + "properties": { + "task": { + "type": "string", + "description": "The Jake task to customize" + }, + "file": { + "type": "string", + "description": "The Jake file that provides the task. Can be omitted." + } + } + } + ] } } \ No newline at end of file diff --git a/extensions/jake/src/main.ts b/extensions/jake/src/main.ts index 93b55873eabca45c343563cda4be9559bfd89cb0..75faf14d46103d71a66d3869d9539399c2f7750b 100644 --- a/extensions/jake/src/main.ts +++ b/extensions/jake/src/main.ts @@ -34,12 +34,15 @@ export function activate(_context: vscode.ExtensionContext): void { taskProvider.dispose(); taskProvider = undefined; } else if (!taskProvider && autoDetect === 'on') { - taskProvider = vscode.workspace.registerTaskProvider({ + taskProvider = vscode.workspace.registerTaskProvider('jake', { provideTasks: () => { if (!jakePromise) { jakePromise = getJakeTasks(); } return jakePromise; + }, + resolveTask(_task: vscode.Task): vscode.Task | undefined { + return undefined; } }); } @@ -73,6 +76,39 @@ function exec(command: string, options: cp.ExecOptions): Promise<{ stdout: strin }); } +let _channel: vscode.OutputChannel; +function getOutputChannel(): vscode.OutputChannel { + if (!_channel) { + _channel = vscode.window.createOutputChannel('Jake Auto Detection'); + } + return _channel; +} + +interface JakeTaskKind extends vscode.TaskKind { + task: string; + file?: string; +} + +const buildNames: string[] = ['build', 'compile', 'watch']; +function isBuildTask(name: string): boolean { + for (let buildName of buildNames) { + if (name.indexOf(buildName) !== -1) { + return true; + } + } + return false; +} + +const testNames: string[] = ['test']; +function isTestTask(name: string): boolean { + for (let testName of testNames) { + if (name.indexOf(testName) !== -1) { + return true; + } + } + return false; +} + async function getJakeTasks(): Promise { let workspaceRoot = vscode.workspace.rootPath; let emptyTasks: vscode.Task[] = []; @@ -98,17 +134,14 @@ async function getJakeTasks(): Promise { } let commandLine = `${jakeCommand} --tasks`; - let channel = vscode.window.createOutputChannel('tasks'); try { let { stdout, stderr } = await exec(commandLine, { cwd: workspaceRoot }); if (stderr) { - channel.appendLine(stderr); - channel.show(true); + getOutputChannel().appendLine(stderr); + getOutputChannel().show(true); } let result: vscode.Task[] = []; if (stdout) { - let buildTask: { task: vscode.Task | undefined, rank: number } = { task: undefined, rank: 0 }; - let testTask: { task: vscode.Task | undefined, rank: number } = { task: undefined, rank: 0 }; let lines = stdout.split(/\r{0,1}\n/); for (let line of lines) { if (line.length === 0) { @@ -118,34 +151,32 @@ async function getJakeTasks(): Promise { let matches = regExp.exec(line); if (matches && matches.length === 2) { let taskName = matches[1]; - let task = new vscode.ShellTask(`jake: ${taskName}`, `${jakeCommand} ${taskName}`); - task.identifier = `jake.${taskName}`; + let kind: JakeTaskKind = { + type: 'jake', + task: taskName + }; + let task = new vscode.Task(kind, taskName, new vscode.ShellExecution(`${jakeCommand} ${taskName}`)); result.push(task); let lowerCaseLine = line.toLowerCase(); - if (lowerCaseLine === 'build') { - buildTask = { task, rank: 2 }; - } else if (lowerCaseLine.indexOf('build') !== -1 && buildTask.rank < 1) { - buildTask = { task, rank: 1 }; - } else if (lowerCaseLine === 'test') { - testTask = { task, rank: 2 }; - } else if (lowerCaseLine.indexOf('test') !== -1 && testTask.rank < 1) { - testTask = { task, rank: 1 }; + if (isBuildTask(lowerCaseLine)) { + task.group = vscode.TaskGroup.Build; + } else if (isTestTask(lowerCaseLine)) { + task.group = vscode.TaskGroup.Test; } } } - if (buildTask.task) { - buildTask.task.group = vscode.TaskGroup.Build; - } - if (testTask.task) { - testTask.task.group = vscode.TaskGroup.Test; - } } return result; } catch (err) { + let channel = getOutputChannel(); if (err.stderr) { channel.appendLine(err.stderr); } + if (err.stdout) { + channel.appendLine(err.stdout); + } channel.appendLine(localize('execFailed', 'Auto detecting Jake failed with error: {0}', err.error ? err.error.toString() : 'unknown')); + channel.show(true); return emptyTasks; } } \ No newline at end of file diff --git a/extensions/java/.vscodeignore b/extensions/java/.vscodeignore new file mode 100644 index 0000000000000000000000000000000000000000..77ab386fc7df4fa2461a8f1ac8457a1e6c9e808a --- /dev/null +++ b/extensions/java/.vscodeignore @@ -0,0 +1 @@ +test/** \ No newline at end of file diff --git a/extensions/java/syntaxes/java.tmLanguage.json b/extensions/java/syntaxes/java.tmLanguage.json index 5d0513d49b0f1b95ebcc285df6d909529bc3d87a..654bf8e2ba8fc1c653735486722030ca8d03115a 100644 --- a/extensions/java/syntaxes/java.tmLanguage.json +++ b/extensions/java/syntaxes/java.tmLanguage.json @@ -1,4 +1,9 @@ { + "information_for_contributors": [ + "This file has been converted from https://github.com/atom/language-java/blob/master/grammars/java.cson", + "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." + ], "scopeName": "source.java", "name": "Java", "fileTypes": [ @@ -1360,6 +1365,5 @@ } ] } - }, - "version": "https://github.com/atom/language-java/commit/0e0ec7966059e3e363868311b3d855014bca95dd" + } } \ No newline at end of file diff --git a/extensions/javascript/.vscodeignore b/extensions/javascript/.vscodeignore new file mode 100644 index 0000000000000000000000000000000000000000..e403ee99494043cf490c35491222002fa11aae4d --- /dev/null +++ b/extensions/javascript/.vscodeignore @@ -0,0 +1,4 @@ +test/** +src/**/*.ts +tsconfig.json +npm-shrinkwrap.json \ No newline at end of file diff --git a/extensions/javascript/syntaxes/JavaScript.tmLanguage.json b/extensions/javascript/syntaxes/JavaScript.tmLanguage.json index ec077b65656fe7ee79a95d528c099560a6e75565..7610157bb85ab8542582f8924c5f00fad67ec726 100644 --- a/extensions/javascript/syntaxes/JavaScript.tmLanguage.json +++ b/extensions/javascript/syntaxes/JavaScript.tmLanguage.json @@ -1,4 +1,10 @@ { + "information_for_contributors": [ + "This file has been converted from https://github.com/Microsoft/TypeScript-TmLanguage/blob/master/TypeScriptReact.tmLanguage", + "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/9be58bc51f179fd4119dbd5caaa7693a381a13b5", "name": "JavaScript (with React support)", "scopeName": "source.js", "fileTypes": [ @@ -74,7 +80,7 @@ "name": "storage.type.js" } }, - "end": "(?=$|;|}|(\\s+(of|in)\\s+))", + "end": "(?=$|^|;|}|(\\s+(of|in)\\s+))", "patterns": [ { "include": "#destructuring-variable" @@ -103,7 +109,7 @@ "name": "meta.definition.variable.js entity.name.function.js" } }, - "end": "(?=$|[;,=}]|(\\s+(of|in)\\s+))", + "end": "(?=$|^|[;,=}]|(\\s+(of|in)\\s+))", "patterns": [ { "include": "#var-single-variable-type-annotation" @@ -118,7 +124,7 @@ "name": "meta.definition.variable.js variable.other.constant.js" } }, - "end": "(?=$|[;,=}]|(\\s+(of|in)\\s+))", + "end": "(?=$|^|[;,=}]|(\\s+(of|in)\\s+))", "patterns": [ { "include": "#var-single-variable-type-annotation" @@ -133,7 +139,7 @@ "name": "meta.definition.variable.js variable.other.readwrite.js" } }, - "end": "(?=$|[;,=}]|(\\s+(of|in)\\s+))", + "end": "(?=$|^|[;,=}]|(\\s+(of|in)\\s+))", "patterns": [ { "include": "#var-single-variable-type-annotation" @@ -160,7 +166,7 @@ { "name": "meta.object-binding-pattern-variable.js", "begin": "(?)\n )) |\n ((async\\s*)?(\n ([(]\\s*(([)]\\s*:)|([_$[:alpha:]][_$[:alnum:]]*\\s*:)|(\\.\\.\\.) )) |\n ([<]\\s*[_$[:alpha:]][_$[:alnum:]]*((\\s+extends\\s*[^=>])|(\\s*[,]))) |\n ((<([^<>=]|=[^<]|\\<([^=<>]|=[^<])+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)\n ))\n )) |\n (:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n ))\n)", + "match": "(?x)(?:\\s*\\b(public|private|protected|readonly)\\s+)?(\\.\\.\\.)?\\s*(?)\n )) |\n ((async\\s*)?(\n ([(]\\s*(([)]\\s*:)|([_$[:alpha:]][_$[:alnum:]]*\\s*:)|(\\.\\.\\.) )) |\n ([<]\\s*[_$[:alpha:]][_$[:alnum:]]*((\\s+extends\\s*[^=>])|(\\s*[,]))) |\n ((<([^<>=]|=[^<]|\\<([^=<>]|=[^<])+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)\n ))\n )) |\n (:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n ))\n)", "captures": { "1": { "name": "storage.modifier.js" @@ -1521,15 +1570,18 @@ "name": "keyword.operator.rest.js" }, "3": { - "name": "entity.name.function.js" + "name": "entity.name.function.js variable.language.this.js" }, "4": { + "name": "entity.name.function.js" + }, + "5": { "name": "keyword.operator.optional.js" } } }, { - "match": "(?:\\s*\\b(public|private|protected|readonly)\\s+)?(\\.\\.\\.)?\\s*(?])|(?<=[\\}>\\]\\)]|[_$[:alpha:]])\\s*(?=\\{)", "patterns": [ { - "include": "#comment" + "name": "meta.type.annotation.js", + "begin": "(:)(?=\\s*\\S)", + "beginCaptures": { + "1": { + "name": "keyword.operator.type.annotation.js" + } + }, + "end": "(?])|((?<=[\\}>\\]\\)]|[_$[:alpha:]])\\s*(?=\\{)))", + "patterns": [ + { + "include": "#type" + } + ] }, { - "include": "#type" + "name": "meta.type.annotation.js", + "begin": "(:)", + "beginCaptures": { + "1": { + "name": "keyword.operator.type.annotation.js" + } + }, + "end": "(?])|(?=^\\s*$)|((?<=\\S)(?=\\s*$))|((?<=[\\}>\\]\\)]|[_$[:alpha:]])\\s*(?=\\{)))", + "patterns": [ + { + "include": "#type" + } + ] } ] }, @@ -1940,14 +2037,40 @@ ] }, "type-function-return-type": { - "name": "meta.type.function.return.js", - "begin": "=>", - "beginCaptures": { - "0": { - "name": "storage.type.function.arrow.js" + "patterns": [ + { + "name": "meta.type.function.return.js", + "begin": "(=>)(?=\\s*\\S)", + "beginCaptures": { + "1": { + "name": "storage.type.function.arrow.js" + } + }, + "end": "(?)(?]|//|$)", + "patterns": [ + { + "include": "#type-function-return-type-core" + } + ] + }, + { + "name": "meta.type.function.return.js", + "begin": "=>", + "beginCaptures": { + "0": { + "name": "storage.type.function.arrow.js" + } + }, + "end": "(?)(?]|//|^\\s*$)|((?<=\\S)(?=\\s*$)))", + "patterns": [ + { + "include": "#type-function-return-type-core" + } + ] } - }, - "end": "(?)(?]|//|$)", + ] + }, + "type-function-return-type-core": { "patterns": [ { "include": "#comment" @@ -2019,7 +2142,7 @@ "name": "punctuation.definition.typeparameters.begin.js" } }, - "end": "(?=$)|(>)", + "end": "(>)", "endCaptures": { "1": { "name": "punctuation.definition.typeparameters.end.js" @@ -2054,7 +2177,7 @@ "name": "keyword.operator.assignment.js" } }, - "end": "(?=$|[,);}\\]])", + "end": "(?=$|^|[,);}\\]])", "patterns": [ { "include": "#expression" @@ -2068,7 +2191,7 @@ "name": "keyword.operator.assignment.js" } }, - "end": "(?=[,);}\\]])|(?=^\\s*$)", + "end": "(?=[,);}\\]])|(?=^\\s*$)|(?<=\\S)(? is on new line\n (\n [(]\\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*)? # typeparameters\n \\(([^()]|\\([^()]*\\))*\\) # parameteres\n (\\s*:\\s*(.)*)? # return type\n \\s*=> # arrow operator\n )\n )\n)", + "begin": "(?x) (?:\n (? is on new line\n (\n [(]\\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*)? # typeparameters\n \\(([^()]|\\([^()]*\\))*\\) # parameteres\n (\\s*:\\s*(.)*)? # return type\n \\s*=> # arrow operator\n )\n )\n)", "beginCaptures": { "1": { "name": "storage.modifier.async.js" @@ -2808,7 +2935,7 @@ "name": "storage.type.function.arrow.js" } }, - "end": "(?<=\\})|((?!\\{)(?=\\S))", + "end": "(?<=\\}|\\S)(?)|((?!\\{)(?=\\S))", "patterns": [ { "include": "#decl-block" @@ -3358,37 +3485,29 @@ } }, { - "begin": "(^[ \\t]+)?(?=//)", + "begin": "(^[ \\t]+)?(//)", "beginCaptures": { "1": { "name": "punctuation.whitespace.comment.leading.js" + }, + "2": { + "name": "comment.line.double-slash.js punctuation.definition.comment.js" } }, - "end": "(?=$)", - "patterns": [ - { - "name": "comment.line.double-slash.js", - "begin": "//", - "beginCaptures": { - "0": { - "name": "punctuation.definition.comment.js" - } - }, - "end": "(?=$)" - } - ] + "end": "(?=^)", + "contentName": "comment.line.double-slash.tsx" } ] }, "directives": { "name": "comment.line.triple-slash.directive.js", - "begin": "^(///)\\s*(?=<(reference|amd-dependency|amd-module)(\\s+(path|types|no-default-lib|name)\\s*=\\s*((\\'[^']*\\')|(\\\"[^\"]*\\\")))+\\s*/>\\s*$)", + "begin": "^(///)\\s*(?=<(reference|amd-dependency|amd-module)(\\s+(path|types|no-default-lib|name)\\s*=\\s*((\\'.*\\')|(\\\".*\\\")))+\\s*/>\\s*$)", "beginCaptures": { "1": { "name": "punctuation.definition.comment.js" } }, - "end": "(?=$)", + "end": "(?=^)", "patterns": [ { "name": "meta.tag.js", @@ -4187,6 +4306,5 @@ } ] } - }, - "version": "https://github.com/Microsoft/TypeScript-TmLanguage/commit/cb1af7953db224204607cbe22d3a45aa0f77a4c1" + } } \ No newline at end of file diff --git a/extensions/javascript/test/colorize-results/test_jsx.json b/extensions/javascript/test/colorize-results/test_jsx.json index 7a9eb1f5ca04433bfa4555214aa4bf307f98ad4a..55e2c440d3bee8e9b1031f3c720d845851f24c92 100644 --- a/extensions/javascript/test/colorize-results/test_jsx.json +++ b/extensions/javascript/test/colorize-results/test_jsx.json @@ -529,7 +529,7 @@ }, { "c": " Prevent following the link.", - "t": "source.js meta.var.expr.js meta.objectliteral.js meta.object.member.js meta.function.expression.js meta.block.js comment.line.double-slash.js", + "t": "source.js meta.var.expr.js meta.objectliteral.js meta.object.member.js meta.function.expression.js meta.block.js comment.line.double-slash.tsx", "r": { "dark_plus": "comment: #608B4E", "light_plus": "comment: #008000", @@ -628,7 +628,7 @@ }, { "c": " Invert the chosen default.", - "t": "source.js meta.var.expr.js meta.objectliteral.js meta.object.member.js meta.function.expression.js meta.block.js comment.line.double-slash.js", + "t": "source.js meta.var.expr.js meta.objectliteral.js meta.object.member.js meta.function.expression.js meta.block.js comment.line.double-slash.tsx", "r": { "dark_plus": "comment: #608B4E", "light_plus": "comment: #008000", @@ -661,7 +661,7 @@ }, { "c": " This will trigger an intelligent re-render of the component.", - "t": "source.js meta.var.expr.js meta.objectliteral.js meta.object.member.js meta.function.expression.js meta.block.js comment.line.double-slash.js", + "t": "source.js meta.var.expr.js meta.objectliteral.js meta.object.member.js meta.function.expression.js meta.block.js comment.line.double-slash.tsx", "r": { "dark_plus": "comment: #608B4E", "light_plus": "comment: #008000", @@ -1046,7 +1046,7 @@ }, { "c": " Default to the default message.", - "t": "source.js meta.var.expr.js meta.objectliteral.js meta.object.member.js meta.function.expression.js meta.block.js comment.line.double-slash.js", + "t": "source.js meta.var.expr.js meta.objectliteral.js meta.object.member.js meta.function.expression.js meta.block.js comment.line.double-slash.tsx", "r": { "dark_plus": "comment: #608B4E", "light_plus": "comment: #008000", @@ -1222,7 +1222,7 @@ }, { "c": " If toggled, show the alternate message.", - "t": "source.js meta.var.expr.js meta.objectliteral.js meta.object.member.js meta.function.expression.js meta.block.js comment.line.double-slash.js", + "t": "source.js meta.var.expr.js meta.objectliteral.js meta.object.member.js meta.function.expression.js meta.block.js comment.line.double-slash.tsx", "r": { "dark_plus": "comment: #608B4E", "light_plus": "comment: #008000", diff --git a/extensions/json/.vscodeignore b/extensions/json/.vscodeignore new file mode 100644 index 0000000000000000000000000000000000000000..7785bab61c18e35536d89e2855d45d736d4dba2e --- /dev/null +++ b/extensions/json/.vscodeignore @@ -0,0 +1,7 @@ +test/** +client/tsconfig.json +client/src/** +server/tsconfig.json +server/src/** +server/node_modules/@types/** +npm-shrinkwrap.json \ No newline at end of file diff --git a/extensions/json/npm-shrinkwrap.json b/extensions/json/npm-shrinkwrap.json index e9b9bf0a7475478e0c4f9410162ca02d1dd43499..09ff6f237d4ccb605bdce97527e5ef21061bbe64 100644 --- a/extensions/json/npm-shrinkwrap.json +++ b/extensions/json/npm-shrinkwrap.json @@ -8,9 +8,9 @@ "resolved": "https://registry.npmjs.org/applicationinsights/-/applicationinsights-0.18.0.tgz" }, "vscode-extension-telemetry": { - "version": "0.0.6", - "from": "vscode-extension-telemetry@>=0.0.6 <0.0.7", - "resolved": "https://registry.npmjs.org/vscode-extension-telemetry/-/vscode-extension-telemetry-0.0.6.tgz" + "version": "0.0.7", + "from": "vscode-extension-telemetry@>=0.0.7 <0.0.8", + "resolved": "https://registry.npmjs.org/vscode-extension-telemetry/-/vscode-extension-telemetry-0.0.7.tgz" }, "vscode-jsonrpc": { "version": "3.1.0-alpha.1", @@ -38,4 +38,4 @@ "resolved": "https://registry.npmjs.org/winreg/-/winreg-1.2.3.tgz" } } -} +} \ No newline at end of file diff --git a/extensions/json/package.json b/extensions/json/package.json index 2e7f9984172375adb1ee88c5e41cef339b97baea..1b0b063501a1bd0b8bd2ce34ba40cf8ee77c056f 100644 --- a/extensions/json/package.json +++ b/extensions/json/package.json @@ -117,16 +117,18 @@ }, "configurationDefaults": { "[json]": { - "editor.quickSuggestions": { "strings": true } + "editor.quickSuggestions": { + "strings": true + } } } }, "dependencies": { - "vscode-extension-telemetry": "^0.0.7", - "vscode-languageclient": "^3.1.0-alpha.1", - "vscode-nls": "^2.0.2" + "vscode-extension-telemetry": "0.0.7", + "vscode-languageclient": "3.1.0-alpha.1", + "vscode-nls": "2.0.2" }, "devDependencies": { "@types/node": "^6.0.51" } -} +} \ No newline at end of file diff --git a/extensions/json/server/npm-shrinkwrap.json b/extensions/json/server/npm-shrinkwrap.json index d199f7b2a0fb2370d9173e72fb8a27f4c4f80aa2..ae1d50bd6892605a989637c465ddc9debd717124 100644 --- a/extensions/json/server/npm-shrinkwrap.json +++ b/extensions/json/server/npm-shrinkwrap.json @@ -43,9 +43,9 @@ "resolved": "https://registry.npmjs.org/request-light/-/request-light-0.2.1.tgz" }, "vscode-json-languageservice": { - "version": "2.0.9", + "version": "2.0.10", "from": "vscode-json-languageservice@next", - "resolved": "https://registry.npmjs.org/vscode-json-languageservice/-/vscode-json-languageservice-2.0.9.tgz" + "resolved": "https://registry.npmjs.org/vscode-json-languageservice/-/vscode-json-languageservice-2.0.10.tgz" }, "vscode-jsonrpc": { "version": "3.1.0-alpha.1", diff --git a/extensions/json/server/package.json b/extensions/json/server/package.json index 6c643c0f542db8472d53c28e28de764f91ddebfb..2897fd255dbef08a2e062b8cb36aa5e7fea6d1a9 100644 --- a/extensions/json/server/package.json +++ b/extensions/json/server/package.json @@ -10,7 +10,7 @@ "dependencies": { "jsonc-parser": "^0.4.2", "request-light": "^0.2.1", - "vscode-json-languageservice": "^2.0.9", + "vscode-json-languageservice": "^2.0.10", "vscode-languageserver": "^3.1.0-alpha.1", "vscode-nls": "^2.0.2" }, diff --git a/extensions/json/syntaxes/JSON.tmLanguage b/extensions/json/syntaxes/JSON.tmLanguage index 9d6a24cc16a59de7603f7e1b631d9b825adb82d0..507eb03ec93f2983815d237fe526ef25f6c4b9ce 100644 --- a/extensions/json/syntaxes/JSON.tmLanguage +++ b/extensions/json/syntaxes/JSON.tmLanguage @@ -98,7 +98,7 @@ begin - /\*\* + /\*\*(?!/) captures 0 diff --git a/extensions/less/.vscodeignore b/extensions/less/.vscodeignore new file mode 100644 index 0000000000000000000000000000000000000000..77ab386fc7df4fa2461a8f1ac8457a1e6c9e808a --- /dev/null +++ b/extensions/less/.vscodeignore @@ -0,0 +1 @@ +test/** \ No newline at end of file diff --git a/extensions/less/syntaxes/less.tmLanguage.json b/extensions/less/syntaxes/less.tmLanguage.json index 902eb4e8d01dcbbb3fd07f18cf375f0f2375a092..cd1543fd7d3ebe69af29b0f2a2860c4445d60c15 100644 --- a/extensions/less/syntaxes/less.tmLanguage.json +++ b/extensions/less/syntaxes/less.tmLanguage.json @@ -1,4 +1,9 @@ { + "information_for_contributors": [ + "This file has been converted from https://github.com/atom/language-less/blob/master/grammars/less.cson", + "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." + ], "name": "Less", "scopeName": "source.css.less", "fileTypes": [ @@ -146,12 +151,7 @@ "name": "comment.block.css" }, { - "match": "[+-]?\\d*\\.?\\d+", - "name": "constant.numeric.css" - }, - { - "match": "(?<=[\\d])(ch|cm|deg|dpi|dpcm|dppx|em|ex|grad|in|mm|ms|pc|pt|px|rad|rem|turn|s|vh|vmin|vw)\\b|%", - "name": "keyword.other.unit.css" + "include": "source.css#numeric-values" }, { "captures": { @@ -281,13 +281,13 @@ ] }, { + "match": "(@|\\-\\-)[\\w-]+(?=\\s*)", + "name": "variable.other.less", "captures": { "1": { "name": "punctuation.definition.variable.less" } - }, - "match": "(?:@|\\-\\-)[a-zA-Z0-9_-][\\w-]*(?=\\s*)", - "name": "variable.other.less" + } }, { "include": "#variable_interpolation" @@ -516,7 +516,7 @@ "include": "#strings" }, { - "match": "(\\b|\\.{0,2}/).*\\b", + "match": "(\\b|\\.{0,2}/)[^)]*\\b", "name": "string.url.css" } ] @@ -545,6 +545,5 @@ "match": "\\b(abs|acos|alpha|argb|asin|atan|average|blue|calc|ceil|color|contrast|convert|convert|cos|darken|data-uri|desaturate|difference|e|escape|exclusion|extract|fade|fadein|fadeout|floor|format|green|greyscale|hardlight|hsl|hsla|hsv|hsva|hsvhue|hsvsaturation|hsvvalue|hue|length|lighten|lightness|luma|max|min|mix|mod|multiply|negation|overlay|percentage|pi|pow|red|replace|round|saturate|saturation|screen|sin|softlight|spin|sqrt|tan|unit)\\b", "name": "support.function.any-method.builtin.less" } - }, - "version": "https://github.com/atom/language-less/commit/7d70b66aa9c853d59e27cce25b5bc25cb067e75a" + } } \ No newline at end of file diff --git a/extensions/less/test/colorize-results/14119_less.json b/extensions/less/test/colorize-results/14119_less.json index 6e89b6a45872efa0c639362a8290290b6b4d9c6b..0c83af453319aad6185b5724a462a448e109eae0 100644 --- a/extensions/less/test/colorize-results/14119_less.json +++ b/extensions/less/test/colorize-results/14119_less.json @@ -33,7 +33,18 @@ } }, { - "c": "@hm", + "c": "@", + "t": "source.css.less variable.other.less punctuation.definition.variable.less", + "r": { + "dark_plus": "variable.other.less: #9CDCFE", + "light_plus": "variable.other.less: #FF0000", + "dark_vs": "variable.other.less: #9CDCFE", + "light_vs": "variable.other.less: #FF0000", + "hc_black": "variable.other.less: #D4D4D4" + } + }, + { + "c": "hm", "t": "source.css.less variable.other.less", "r": { "dark_plus": "variable.other.less: #9CDCFE", diff --git a/extensions/less/test/colorize-results/test-cssvariables_less.json b/extensions/less/test/colorize-results/test-cssvariables_less.json index bca9cd3c3a90c062d3786c6a1003e23ccdca71d9..1c9b8658a0adf08766980b68546bd1e644f5b635 100644 --- a/extensions/less/test/colorize-results/test-cssvariables_less.json +++ b/extensions/less/test/colorize-results/test-cssvariables_less.json @@ -55,7 +55,18 @@ } }, { - "c": "--spacing-unit", + "c": "--", + "t": "source.css.less meta.property-list.css variable.other.less punctuation.definition.variable.less", + "r": { + "dark_plus": "variable.other.less: #9CDCFE", + "light_plus": "variable.other.less: #FF0000", + "dark_vs": "variable.other.less: #9CDCFE", + "light_vs": "variable.other.less: #FF0000", + "hc_black": "variable.other.less: #D4D4D4" + } + }, + { + "c": "spacing-unit", "t": "source.css.less meta.property-list.css variable.other.less", "r": { "dark_plus": "variable.other.less: #9CDCFE", @@ -100,7 +111,7 @@ }, { "c": "px", - "t": "source.css.less meta.property-list.css meta.property-value.css keyword.other.unit.css", + "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", @@ -132,7 +143,18 @@ } }, { - "c": "--cell-padding", + "c": "--", + "t": "source.css.less meta.property-list.css variable.other.less punctuation.definition.variable.less", + "r": { + "dark_plus": "variable.other.less: #9CDCFE", + "light_plus": "variable.other.less: #FF0000", + "dark_vs": "variable.other.less: #9CDCFE", + "light_vs": "variable.other.less: #FF0000", + "hc_black": "variable.other.less: #D4D4D4" + } + }, + { + "c": "cell-padding", "t": "source.css.less meta.property-list.css variable.other.less", "r": { "dark_plus": "variable.other.less: #9CDCFE", diff --git a/extensions/less/test/colorize-results/test_less.json b/extensions/less/test/colorize-results/test_less.json index 4cc4722023879f41d5f5acdd4cdd463f77c797f1..d6b39257feb6bd3f382603ff093a1325ea5f50e4 100644 --- a/extensions/less/test/colorize-results/test_less.json +++ b/extensions/less/test/colorize-results/test_less.json @@ -308,7 +308,18 @@ } }, { - "c": "@base", + "c": "@", + "t": "source.css.less variable.other.less punctuation.definition.variable.less", + "r": { + "dark_plus": "variable.other.less: #9CDCFE", + "light_plus": "variable.other.less: #FF0000", + "dark_vs": "variable.other.less: #9CDCFE", + "light_vs": "variable.other.less: #FF0000", + "hc_black": "variable.other.less: #D4D4D4" + } + }, + { + "c": "base", "t": "source.css.less variable.other.less", "r": { "dark_plus": "variable.other.less: #9CDCFE", @@ -385,7 +396,18 @@ } }, { - "c": "@style", + "c": "@", + "t": "source.css.less variable.other.less punctuation.definition.variable.less", + "r": { + "dark_plus": "variable.other.less: #9CDCFE", + "light_plus": "variable.other.less: #FF0000", + "dark_vs": "variable.other.less: #9CDCFE", + "light_vs": "variable.other.less: #FF0000", + "hc_black": "variable.other.less: #D4D4D4" + } + }, + { + "c": "style", "t": "source.css.less variable.other.less", "r": { "dark_plus": "variable.other.less: #9CDCFE", @@ -418,7 +440,18 @@ } }, { - "c": "@c", + "c": "@", + "t": "source.css.less variable.other.less punctuation.definition.variable.less", + "r": { + "dark_plus": "variable.other.less: #9CDCFE", + "light_plus": "variable.other.less: #FF0000", + "dark_vs": "variable.other.less: #9CDCFE", + "light_vs": "variable.other.less: #FF0000", + "hc_black": "variable.other.less: #D4D4D4" + } + }, + { + "c": "c", "t": "source.css.less variable.other.less", "r": { "dark_plus": "variable.other.less: #9CDCFE", @@ -506,7 +539,18 @@ } }, { - "c": "@c", + "c": "@", + "t": "source.css.less variable.other.less punctuation.definition.variable.less", + "r": { + "dark_plus": "variable.other.less: #9CDCFE", + "light_plus": "variable.other.less: #FF0000", + "dark_vs": "variable.other.less: #9CDCFE", + "light_vs": "variable.other.less: #FF0000", + "hc_black": "variable.other.less: #D4D4D4" + } + }, + { + "c": "c", "t": "source.css.less variable.other.less", "r": { "dark_plus": "variable.other.less: #9CDCFE", @@ -594,7 +638,18 @@ } }, { - "c": "@style", + "c": "@", + "t": "source.css.less meta.property-list.css meta.property-value.css variable.other.less punctuation.definition.variable.less", + "r": { + "dark_plus": "variable.other.less: #9CDCFE", + "light_plus": "variable.other.less: #FF0000", + "dark_vs": "variable.other.less: #9CDCFE", + "light_vs": "variable.other.less: #FF0000", + "hc_black": "variable.other.less: #D4D4D4" + } + }, + { + "c": "style", "t": "source.css.less meta.property-list.css meta.property-value.css variable.other.less", "r": { "dark_plus": "variable.other.less: #9CDCFE", @@ -616,7 +671,18 @@ } }, { - "c": "@c", + "c": "@", + "t": "source.css.less meta.property-list.css meta.property-value.css variable.other.less punctuation.definition.variable.less", + "r": { + "dark_plus": "variable.other.less: #9CDCFE", + "light_plus": "variable.other.less: #FF0000", + "dark_vs": "variable.other.less: #9CDCFE", + "light_vs": "variable.other.less: #FF0000", + "hc_black": "variable.other.less: #D4D4D4" + } + }, + { + "c": "c", "t": "source.css.less meta.property-list.css meta.property-value.css variable.other.less", "r": { "dark_plus": "variable.other.less: #9CDCFE", @@ -671,7 +737,18 @@ } }, { - "c": "@style", + "c": "@", + "t": "source.css.less variable.other.less punctuation.definition.variable.less", + "r": { + "dark_plus": "variable.other.less: #9CDCFE", + "light_plus": "variable.other.less: #FF0000", + "dark_vs": "variable.other.less: #9CDCFE", + "light_vs": "variable.other.less: #FF0000", + "hc_black": "variable.other.less: #D4D4D4" + } + }, + { + "c": "style", "t": "source.css.less variable.other.less", "r": { "dark_plus": "variable.other.less: #9CDCFE", @@ -704,7 +781,18 @@ } }, { - "c": "@alpha", + "c": "@", + "t": "source.css.less variable.other.less punctuation.definition.variable.less", + "r": { + "dark_plus": "variable.other.less: #9CDCFE", + "light_plus": "variable.other.less: #FF0000", + "dark_vs": "variable.other.less: #9CDCFE", + "light_vs": "variable.other.less: #FF0000", + "hc_black": "variable.other.less: #D4D4D4" + } + }, + { + "c": "alpha", "t": "source.css.less variable.other.less", "r": { "dark_plus": "variable.other.less: #9CDCFE", @@ -749,7 +837,7 @@ }, { "c": "%", - "t": "source.css.less keyword.other.unit.css", + "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", @@ -836,7 +924,18 @@ } }, { - "c": "@alpha", + "c": "@", + "t": "source.css.less variable.other.less punctuation.definition.variable.less", + "r": { + "dark_plus": "variable.other.less: #9CDCFE", + "light_plus": "variable.other.less: #FF0000", + "dark_vs": "variable.other.less: #9CDCFE", + "light_vs": "variable.other.less: #FF0000", + "hc_black": "variable.other.less: #D4D4D4" + } + }, + { + "c": "alpha", "t": "source.css.less variable.other.less", "r": { "dark_plus": "variable.other.less: #9CDCFE", @@ -913,7 +1012,18 @@ } }, { - "c": "@style", + "c": "@", + "t": "source.css.less meta.property-list.css variable.other.less punctuation.definition.variable.less", + "r": { + "dark_plus": "variable.other.less: #9CDCFE", + "light_plus": "variable.other.less: #FF0000", + "dark_vs": "variable.other.less: #9CDCFE", + "light_vs": "variable.other.less: #FF0000", + "hc_black": "variable.other.less: #D4D4D4" + } + }, + { + "c": "style", "t": "source.css.less meta.property-list.css variable.other.less", "r": { "dark_plus": "variable.other.less: #9CDCFE", @@ -1232,7 +1342,18 @@ } }, { - "c": "@base", + "c": "@", + "t": "source.css.less meta.property-list.css meta.property-value.css variable.other.less punctuation.definition.variable.less", + "r": { + "dark_plus": "variable.other.less: #9CDCFE", + "light_plus": "variable.other.less: #FF0000", + "dark_vs": "variable.other.less: #9CDCFE", + "light_vs": "variable.other.less: #FF0000", + "hc_black": "variable.other.less: #D4D4D4" + } + }, + { + "c": "base", "t": "source.css.less meta.property-list.css meta.property-value.css variable.other.less", "r": { "dark_plus": "variable.other.less: #9CDCFE", @@ -1277,7 +1398,7 @@ }, { "c": "%", - "t": "source.css.less meta.property-list.css meta.property-value.css keyword.other.unit.css", + "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", @@ -1375,7 +1496,18 @@ } }, { - "c": "@base", + "c": "@", + "t": "source.css.less meta.property-list.css meta.property-value.css variable.other.less punctuation.definition.variable.less", + "r": { + "dark_plus": "variable.other.less: #9CDCFE", + "light_plus": "variable.other.less: #FF0000", + "dark_vs": "variable.other.less: #9CDCFE", + "light_vs": "variable.other.less: #FF0000", + "hc_black": "variable.other.less: #D4D4D4" + } + }, + { + "c": "base", "t": "source.css.less meta.property-list.css meta.property-value.css variable.other.less", "r": { "dark_plus": "variable.other.less: #9CDCFE", @@ -1420,7 +1552,7 @@ }, { "c": "%", - "t": "source.css.less meta.property-list.css meta.property-value.css keyword.other.unit.css", + "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", @@ -1585,7 +1717,7 @@ }, { "c": "px", - "t": "source.css.less meta.property-list.css meta.property-list.css keyword.other.unit.css", + "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", @@ -1640,7 +1772,7 @@ }, { "c": "%", - "t": "source.css.less meta.property-list.css meta.property-list.css keyword.other.unit.css", + "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", @@ -1849,7 +1981,7 @@ }, { "c": "px", - "t": "source.css.less meta.property-list.css meta.property-list.css meta.property-value.css keyword.other.unit.css", + "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", @@ -2058,7 +2190,7 @@ }, { "c": "px", - "t": "source.css.less meta.property-list.css meta.property-list.css meta.property-value.css keyword.other.unit.css", + "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", @@ -2311,7 +2443,7 @@ }, { "c": "px", - "t": "source.css.less meta.property-list.css meta.property-list.css meta.property-list.css meta.property-list.css meta.property-value.css keyword.other.unit.css", + "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", @@ -2398,7 +2530,18 @@ } }, { - "c": "@the-border", + "c": "@", + "t": "source.css.less variable.other.less punctuation.definition.variable.less", + "r": { + "dark_plus": "variable.other.less: #9CDCFE", + "light_plus": "variable.other.less: #FF0000", + "dark_vs": "variable.other.less: #9CDCFE", + "light_vs": "variable.other.less: #FF0000", + "hc_black": "variable.other.less: #D4D4D4" + } + }, + { + "c": "the-border", "t": "source.css.less variable.other.less", "r": { "dark_plus": "variable.other.less: #9CDCFE", @@ -2443,7 +2586,7 @@ }, { "c": "px", - "t": "source.css.less keyword.other.unit.css", + "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", @@ -2464,7 +2607,18 @@ } }, { - "c": "@base-color", + "c": "@", + "t": "source.css.less variable.other.less punctuation.definition.variable.less", + "r": { + "dark_plus": "variable.other.less: #9CDCFE", + "light_plus": "variable.other.less: #FF0000", + "dark_vs": "variable.other.less: #9CDCFE", + "light_vs": "variable.other.less: #FF0000", + "hc_black": "variable.other.less: #D4D4D4" + } + }, + { + "c": "base-color", "t": "source.css.less variable.other.less", "r": { "dark_plus": "variable.other.less: #9CDCFE", @@ -2519,7 +2673,18 @@ } }, { - "c": "@red", + "c": "@", + "t": "source.css.less variable.other.less punctuation.definition.variable.less", + "r": { + "dark_plus": "variable.other.less: #9CDCFE", + "light_plus": "variable.other.less: #FF0000", + "dark_vs": "variable.other.less: #9CDCFE", + "light_vs": "variable.other.less: #FF0000", + "hc_black": "variable.other.less: #D4D4D4" + } + }, + { + "c": "red", "t": "source.css.less variable.other.less", "r": { "dark_plus": "variable.other.less: #9CDCFE", @@ -2673,7 +2838,18 @@ } }, { - "c": "@base-color", + "c": "@", + "t": "source.css.less meta.property-list.css meta.property-value.css variable.other.less punctuation.definition.variable.less", + "r": { + "dark_plus": "variable.other.less: #9CDCFE", + "light_plus": "variable.other.less: #FF0000", + "dark_vs": "variable.other.less: #9CDCFE", + "light_vs": "variable.other.less: #FF0000", + "hc_black": "variable.other.less: #D4D4D4" + } + }, + { + "c": "base-color", "t": "source.css.less meta.property-list.css meta.property-value.css variable.other.less", "r": { "dark_plus": "variable.other.less: #9CDCFE", @@ -2794,7 +2970,18 @@ } }, { - "c": "@the-border", + "c": "@", + "t": "source.css.less meta.property-list.css meta.property-value.css variable.other.less punctuation.definition.variable.less", + "r": { + "dark_plus": "variable.other.less: #9CDCFE", + "light_plus": "variable.other.less: #FF0000", + "dark_vs": "variable.other.less: #9CDCFE", + "light_vs": "variable.other.less: #FF0000", + "hc_black": "variable.other.less: #D4D4D4" + } + }, + { + "c": "the-border", "t": "source.css.less meta.property-list.css meta.property-value.css variable.other.less", "r": { "dark_plus": "variable.other.less: #9CDCFE", @@ -2871,7 +3058,18 @@ } }, { - "c": "@the-border", + "c": "@", + "t": "source.css.less meta.property-list.css meta.property-value.css variable.other.less punctuation.definition.variable.less", + "r": { + "dark_plus": "variable.other.less: #9CDCFE", + "light_plus": "variable.other.less: #FF0000", + "dark_vs": "variable.other.less: #9CDCFE", + "light_vs": "variable.other.less: #FF0000", + "hc_black": "variable.other.less: #D4D4D4" + } + }, + { + "c": "the-border", "t": "source.css.less meta.property-list.css meta.property-value.css variable.other.less", "r": { "dark_plus": "variable.other.less: #9CDCFE", @@ -3058,7 +3256,18 @@ } }, { - "c": "@base-color", + "c": "@", + "t": "source.css.less meta.property-list.css meta.property-value.css variable.other.less punctuation.definition.variable.less", + "r": { + "dark_plus": "variable.other.less: #9CDCFE", + "light_plus": "variable.other.less: #FF0000", + "dark_vs": "variable.other.less: #9CDCFE", + "light_vs": "variable.other.less: #FF0000", + "hc_black": "variable.other.less: #D4D4D4" + } + }, + { + "c": "base-color", "t": "source.css.less meta.property-list.css meta.property-value.css variable.other.less", "r": { "dark_plus": "variable.other.less: #9CDCFE", @@ -3201,7 +3410,18 @@ } }, { - "c": "@red", + "c": "@", + "t": "source.css.less meta.property-list.css meta.property-value.css variable.other.less punctuation.definition.variable.less", + "r": { + "dark_plus": "variable.other.less: #9CDCFE", + "light_plus": "variable.other.less: #FF0000", + "dark_vs": "variable.other.less: #9CDCFE", + "light_vs": "variable.other.less: #FF0000", + "hc_black": "variable.other.less: #D4D4D4" + } + }, + { + "c": "red", "t": "source.css.less meta.property-list.css meta.property-value.css variable.other.less", "r": { "dark_plus": "variable.other.less: #9CDCFE", @@ -3246,7 +3466,7 @@ }, { "c": "%", - "t": "source.css.less meta.property-list.css meta.property-value.css keyword.other.unit.css", + "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", diff --git a/extensions/lua/.vscodeignore b/extensions/lua/.vscodeignore new file mode 100644 index 0000000000000000000000000000000000000000..77ab386fc7df4fa2461a8f1ac8457a1e6c9e808a --- /dev/null +++ b/extensions/lua/.vscodeignore @@ -0,0 +1 @@ +test/** \ No newline at end of file diff --git a/extensions/lua/syntaxes/lua.json b/extensions/lua/syntaxes/lua.json index 0bde9524ea490e1e71082e2f85a22272c3ed3fb5..efea9819bdee4eaf94e86af61c360cc16480957e 100644 --- a/extensions/lua/syntaxes/lua.json +++ b/extensions/lua/syntaxes/lua.json @@ -1,39 +1,66 @@ { + "information_for_contributors": [ + "This file has been converted from https://github.com/textmate/lua.tmbundle/blob/master/Syntaxes/Lua.plist", + "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." + ], "comment": "Lua Syntax: version 0.8", "fileTypes": [ - "lua" + "lua", + "p8", + "rockspec", + "luacheckrc", + "lakefile" ], - "firstLineMatch": "\\A#!.*?\\blua\\b", + "firstLineMatch": "\\A#!.*?\\blua(\\d+(\\.\\d+)?)?\\b|\\A--\\s+-\\*-\\s*lua\\s*-\\*-", "keyEquivalent": "^~L", "name": "Lua", "patterns": [ { - "captures": { + "begin": "\\b((local\\b)\\s+)?(function)\\s*(\\s+[a-zA-Z_][a-zA-Z0-9_]*(\\.[a-zA-Z_][a-zA-Z0-9_]*)*(:[a-zA-Z_][a-zA-Z0-9_]*)?\\s*)?(\\()", + "beginCaptures": { "1": { - "name": "keyword.control.lua" - }, - "2": { - "name": "entity.name.function.scope.lua" + "name": "storage.modifier.local.lua" }, "3": { - "name": "entity.name.function.lua" + "name": "keyword.control.lua" }, "4": { - "name": "punctuation.definition.parameters.begin.lua" + "name": "entity.name.function.lua" }, "5": { - "name": "variable.parameter.function.lua" - }, - "6": { + "name": "punctuation.definition.parameters.begin.lua" + } + }, + "end": "\\)", + "endCaptures": { + "0": { "name": "punctuation.definition.parameters.end.lua" } }, - "match": "\\b(function)(?:\\s+([a-zA-Z_.:]+[.:])?([a-zA-Z_]\\w*)\\s*)?(\\()([^)]*)(\\))", - "name": "meta.function.lua" + "name": "meta.function.lua", + "patterns": [ + { + "match": "[a-zA-Z_][a-zA-Z0-9_]*", + "name": "variable.parameter.function.lua" + } + ] + }, + { + "match": "(?", + "notIn": [ + "string" + ] + } + ], + "surroundingPairs": [ + ["(", ")"], + ["[", "]"], + ["`", "`"] ] -} +} \ No newline at end of file diff --git a/extensions/markdown/npm-shrinkwrap.json b/extensions/markdown/npm-shrinkwrap.json index de14b48e12d8439a92359f75d224151b933a12b4..22a401707cf3136eef590c9b8ad50195240ceb5e 100644 --- a/extensions/markdown/npm-shrinkwrap.json +++ b/extensions/markdown/npm-shrinkwrap.json @@ -58,13 +58,13 @@ "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.3.tgz" }, "vscode-extension-telemetry": { - "version": "0.0.6", - "from": "vscode-extension-telemetry@>=0.0.6 <0.0.7", - "resolved": "https://registry.npmjs.org/vscode-extension-telemetry/-/vscode-extension-telemetry-0.0.6.tgz" + "version": "0.0.7", + "from": "vscode-extension-telemetry@>=0.0.7 <0.0.8", + "resolved": "https://registry.npmjs.org/vscode-extension-telemetry/-/vscode-extension-telemetry-0.0.7.tgz" }, "vscode-nls": { "version": "2.0.2", - "from": "vscode-nls@latest", + "from": "vscode-nls@>=2.0.1 <3.0.0", "resolved": "https://registry.npmjs.org/vscode-nls/-/vscode-nls-2.0.2.tgz" }, "winreg": { @@ -73,4 +73,4 @@ "resolved": "https://registry.npmjs.org/winreg/-/winreg-1.2.3.tgz" } } -} +} \ No newline at end of file diff --git a/extensions/markdown/package.json b/extensions/markdown/package.json index 4ffa3bd6b39f6c5daacc7c756e041c543071c155..f6e2d8d2bc4c15ab16ca2ad3f42af17c6ef27a9f 100644 --- a/extensions/markdown/package.json +++ b/extensions/markdown/package.json @@ -16,7 +16,8 @@ "onLanguage:markdown", "onCommand:markdown.showPreview", "onCommand:markdown.showPreviewToSide", - "onCommand:markdown.showSource" + "onCommand:markdown.showSource", + "onCommand:markdown.showPreviewSecuritySelector" ], "contributes": { "languages": [ @@ -79,25 +80,42 @@ "menus": { "editor/title": [ { - "when": "editorLangId == markdown", "command": "markdown.showPreviewToSide", + "when": "editorLangId == markdown", "alt": "markdown.showPreview", "group": "navigation" }, { - "when": "resourceScheme == markdown", "command": "markdown.showSource", + "when": "resourceScheme == markdown", "group": "navigation" }, { - "when": "resourceScheme == markdown", - "command": "markdown.showPreviewSecuritySelector" + "command": "markdown.showPreviewSecuritySelector", + "when": "resourceScheme == markdown" } ], "explorer/context": [ { + "command": "markdown.showPreview", "when": "resourceLangId == markdown", + "group": "navigation" + } + ], + "commandPalette": [ + { "command": "markdown.showPreview", + "when": "editorLangId == markdown", + "group": "navigation" + }, + { + "command": "markdown.showPreviewToSide", + "when": "editorLangId == markdown", + "group": "navigation" + }, + { + "command": "markdown.showSource", + "when": "resourceScheme == markdown", "group": "navigation" } ] @@ -107,13 +125,13 @@ "command": "markdown.showPreview", "key": "shift+ctrl+v", "mac": "shift+cmd+v", - "when": "editorFocus" + "when": "editorLangId == markdown" }, { "command": "markdown.showPreviewToSide", "key": "ctrl+k v", "mac": "cmd+k v", - "when": "editorFocus" + "when": "editorLangId == markdown" } ], "snippets": [ @@ -141,9 +159,14 @@ "default": "hide", "description": "%markdown.previewFrontMatter.dec%" }, + "markdown.preview.breaks": { + "type": "boolean", + "default": false, + "description": "%markdown.preview.breaks.desc%" + }, "markdown.preview.fontFamily": { "type": "string", - "default": "system-ui, 'Segoe WPC', 'Segoe UI', 'HelveticaNeue-Light', 'Ubuntu', 'Droid Sans', sans-serif", + "default": "-apple-system, BlinkMacSystemFont, 'Segoe WPC', 'Segoe UI', 'HelveticaNeue-Light', 'Ubuntu', 'Droid Sans', sans-serif", "description": "%markdown.preview.fontFamily.desc%" }, "markdown.preview.fontSize": { @@ -204,11 +227,11 @@ "update-grammar": "node ../../node_modules/gulp/bin/gulp.js --gulpfile ./syntaxes/gulpfile.js" }, "dependencies": { - "highlight.js": "^9.11.0", - "markdown-it": "^8.3.1", + "highlight.js": "9.5.0", + "markdown-it": "8.2.2", "markdown-it-named-headers": "0.0.4", - "vscode-extension-telemetry": "^0.0.7", - "vscode-nls": "^2.0.2" + "vscode-extension-telemetry": "0.0.7", + "vscode-nls": "2.0.2" }, "devDependencies": { "@types/node": "^7.0.4", diff --git a/extensions/markdown/package.nls.json b/extensions/markdown/package.nls.json index b58fe4c5e401ab9bd1da1fb2b5d3852407f6ac1b..11e191a773206c24df6f0caa232d19a76e186066 100644 --- a/extensions/markdown/package.nls.json +++ b/extensions/markdown/package.nls.json @@ -1,4 +1,5 @@ { + "markdown.preview.breaks.desc": "Sets how line-breaks are rendered in the markdown preview. Setting it to 'true' creates a
for every newline.", "markdown.preview.doubleClickToSwitchToEditor.desc": "Double click in the markdown preview to switch to the editor.", "markdown.preview.fontFamily.desc": "Controls the font family used in the markdown preview.", "markdown.preview.fontSize.desc": "Controls the font size in pixels used in the markdown preview.", diff --git a/extensions/markdown/src/extension.ts b/extensions/markdown/src/extension.ts index 8e459df89a28dbe5dcd6f34d9a539e0fa36e4674..4deb344b9f27bdbc8579b45974dd497f46675e47 100644 --- a/extensions/markdown/src/extension.ts +++ b/extensions/markdown/src/extension.ts @@ -61,7 +61,7 @@ export function activate(context: vscode.ExtensionContext) { continue; } - let styles = contributes['markdown.preview'] && contributes['markdown.preview'].styles; + let styles = contributes['markdown.previewStyles']; if (styles) { if (!Array.isArray(styles)) { styles = [styles]; @@ -75,7 +75,7 @@ export function activate(context: vscode.ExtensionContext) { } } - let scripts = contributes['markdown.preview'] && contributes['markdown.preview'].scripts; + let scripts = contributes['markdown.previewScripts']; if (scripts) { if (!Array.isArray(scripts)) { scripts = [scripts]; diff --git a/extensions/markdown/src/markdownEngine.ts b/extensions/markdown/src/markdownEngine.ts index aad5d484645b7bf46223d9384fd8af9475151a67..c13130b98b911b3d9f25860cdc7288a07781e903 100644 --- a/extensions/markdown/src/markdownEngine.ts +++ b/extensions/markdown/src/markdownEngine.ts @@ -20,6 +20,8 @@ interface MarkdownIt { parse(text: string, env: any): IToken[]; utils: any; + + set(options: any): MarkdownIt; } const FrontMatterRegex = /^---\s*[^]*?(-{3}|\.{3})\s*/; @@ -79,6 +81,7 @@ export class MarkdownEngine { this.addLinkNormalizer(this.md); this.addLinkValidator(this.md); } + this.md.set({ breaks: vscode.workspace.getConfiguration('markdown').get('preview.breaks', false) }); return this.md; } diff --git a/extensions/markdown/src/previewContentProvider.ts b/extensions/markdown/src/previewContentProvider.ts index caacead613e189d909452bd9183aa03b77b75bbb..346232bbc5187b41a869085aedfa8ff66a45186e 100644 --- a/extensions/markdown/src/previewContentProvider.ts +++ b/extensions/markdown/src/previewContentProvider.ts @@ -52,6 +52,7 @@ class MarkdownPreviewConfig { public readonly scrollBeyondLastLine: boolean; public readonly wordWrap: boolean; public readonly previewFrontMatter: string; + public readonly lineBreaks: boolean; public readonly doubleClickToSwitchToEditor: boolean; public readonly scrollEditorWithPreview: boolean; public readonly scrollPreviewWithEditorSelection: boolean; @@ -65,19 +66,25 @@ class MarkdownPreviewConfig { private constructor() { const editorConfig = vscode.workspace.getConfiguration('editor'); const markdownConfig = vscode.workspace.getConfiguration('markdown'); + const markdownEditorConfig = vscode.workspace.getConfiguration('[markdown]'); this.scrollBeyondLastLine = editorConfig.get('scrollBeyondLastLine', false); + this.wordWrap = editorConfig.get('wordWrap', 'off') !== 'off'; + if (markdownEditorConfig && markdownEditorConfig['editor.wordWrap']) { + this.wordWrap = markdownEditorConfig['editor.wordWrap'] !== 'off'; + } this.previewFrontMatter = markdownConfig.get('previewFrontMatter', 'hide'); this.scrollPreviewWithEditorSelection = !!markdownConfig.get('preview.scrollPreviewWithEditorSelection', true); this.scrollEditorWithPreview = !!markdownConfig.get('preview.scrollEditorWithPreview', true); + this.lineBreaks = !!markdownConfig.get('preview.breaks', false); this.doubleClickToSwitchToEditor = !!markdownConfig.get('preview.doubleClickToSwitchToEditor', true); this.markEditorSelection = !!markdownConfig.get('preview.markEditorSelection', true); this.fontFamily = markdownConfig.get('preview.fontFamily', undefined); - this.fontSize = +markdownConfig.get('preview.fontSize', NaN); - this.lineHeight = +markdownConfig.get('preview.lineHeight', NaN); + this.fontSize = Math.max(8, +markdownConfig.get('preview.fontSize', NaN)); + this.lineHeight = Math.max(0.6, +markdownConfig.get('preview.lineHeight', NaN)); this.styles = markdownConfig.get('styles', []); } @@ -176,8 +183,8 @@ export class MDDocumentContentProvider implements vscode.TextDocumentContentProv return ``; } diff --git a/extensions/markdown/syntaxes/gulpfile.js b/extensions/markdown/syntaxes/gulpfile.js index a01ff06499cb9f2ef5aad12d04113c0fcc00c84d..15545e82502a08e00b46867f8652bb3cec04e140 100644 --- a/extensions/markdown/syntaxes/gulpfile.js +++ b/extensions/markdown/syntaxes/gulpfile.js @@ -32,13 +32,15 @@ const languages = [ { name: 'git_rebase', identifiers: ['git-rebase-todo'], source: 'text.git-rebase' }, { name: 'go', identifiers: ['go', 'golang'], source: 'source.go' }, { name: 'groovy', identifiers: ['groovy', 'gvy'], source: 'source.groovy' }, - { name: 'jade', identifiers: ['jade'], source: 'text.jade' }, + { name: 'jade', identifiers: ['jade', 'pug'], source: 'text.jade' }, { name: 'js', identifiers: ['js', 'jsx', 'javascript', 'es6', 'mjs'], source: 'source.js' }, { name: 'js_regexp', identifiers: ['regexp'], source: 'source.js.regexp' }, { name: 'json', identifiers: ['json', 'sublime-settings', 'sublime-menu', 'sublime-keymap', 'sublime-mousemap', 'sublime-theme', 'sublime-build', 'sublime-project', 'sublime-completions'], source: 'source.json' }, { name: 'less', identifiers: ['less'], source: 'source.css.less' }, { name: 'objc', identifiers: ['objectivec', 'objective-c', 'mm', 'objc', 'obj-c', 'm', 'h'], source: 'source.objc' }, + { name: 'scss', identifiers: ['scss'], source: 'source.css.scss' }, + { name: 'perl6', identifiers: ['perl6', 'p6', 'pl6', 'pm6', 'nqp'], source: 'source.perl.6' }, { name: 'powershell', identifiers: ['powershell', 'ps1', 'psm1', 'psd1'], source: 'source.powershell' }, { name: 'python', identifiers: ['python', 'py', 'py3', 'rpy', 'pyw', 'cpy', 'SConstruct', 'Sconstruct', 'sconstruct', 'SConscript', 'gyp', 'gypi'], source: 'source.python' }, diff --git a/extensions/markdown/syntaxes/markdown.tmLanguage b/extensions/markdown/syntaxes/markdown.tmLanguage index 38d1292f7e4c1450b9d179bf0c76dcd91b2e2387..d9ac2a0ba6c44bf2542ef0ac25e1277ab4f81d08 100644 --- a/extensions/markdown/syntaxes/markdown.tmLanguage +++ b/extensions/markdown/syntaxes/markdown.tmLanguage @@ -174,6 +174,10 @@ include #fenced_code_block_objc
+ + include + #fenced_code_block_scss + include #fenced_code_block_perl6 @@ -1914,7 +1918,7 @@ fenced_code_block_jade begin - (^|\G)(\s*)([`~]{3,})\s*((jade)(\s+[^`~]*)?$) + (^|\G)(\s*)([`~]{3,})\s*((jade|pug)(\s+[^`~]*)?$) name markup.fenced_code.block.markdown end @@ -2217,6 +2221,57 @@
+ fenced_code_block_scss + + begin + (^|\G)(\s*)([`~]{3,})\s*((scss)(\s+[^`~]*)?$) + name + markup.fenced_code.block.markdown + end + (^|\G)(\2|\s{0,3})(\3)\s*$ + beginCaptures + + 3 + + name + punctuation.definition.markdown + + 5 + + name + fenced_code.block.language + + 6 + + name + fenced_code.block.language.attributes + + + endCaptures + + 3 + + name + punctuation.definition.markdown + + + patterns + + + begin + (^|\G)(\s*)(.*) + while + (^|\G)(?!\s*([`~]{3,})\s*$) + patterns + + + include + source.css.scss + + + + + fenced_code_block_perl6 begin diff --git a/extensions/markdown/syntaxes/markdown.tmLanguage.base b/extensions/markdown/syntaxes/markdown.tmLanguage.base index 6a8868a260bfbe11f75b7422d59cb590ec1e5dac..7c5a5558a18c014ae0e1960f9e269d639248a57a 100644 --- a/extensions/markdown/syntaxes/markdown.tmLanguage.base +++ b/extensions/markdown/syntaxes/markdown.tmLanguage.base @@ -416,7 +416,7 @@ name markup.fenced_code.block.markdown begin - (^|\G)(\s*)([`~]{3,})\s*(?=[^`~]*)?$ + (^|\G)(\s*)([`~]{3,})\s*(?=([^`~]*)?$) end (^|\G)(\2|\s{0,3})(\3)\s*$ beginCaptures @@ -1118,7 +1118,7 @@ match - (\[)((?<square>[^\[\]\\]|\\.|\[\g<square>*+\])*+)(\])[ ]?(\[)([^\]]*+)(\]) + (\[)((?<square>[^\[\]\\]|\\.|\[\g<square>*+\])*+)(\])(\[)([^\]]*+)(\]) name meta.link.reference.markdown diff --git a/extensions/merge-conflict/.vscodeignore b/extensions/merge-conflict/.vscodeignore new file mode 100644 index 0000000000000000000000000000000000000000..d43a539fddf5b4f3cc2950970f42a6d5238219b6 --- /dev/null +++ b/extensions/merge-conflict/.vscodeignore @@ -0,0 +1,2 @@ +src/** +tsconfig.json \ No newline at end of file diff --git a/extensions/merge-conflict/package.json b/extensions/merge-conflict/package.json index 1d099d83c230cb0375fcb70c18dbc42a81c2bbc4..ae017ff0aa2ad00493055ab1ace5dd6c78948fbb 100644 --- a/extensions/merge-conflict/package.json +++ b/extensions/merge-conflict/package.json @@ -120,8 +120,6 @@ "vscode-nls": "^2.0.2" }, "devDependencies": { - "@types/mocha": "^2.2.41", - "@types/node": "^7.0.4", - "mocha": "^3.2.0" + "@types/node": "^7.0.4" } } \ No newline at end of file diff --git a/extensions/merge-conflict/package.nls.json b/extensions/merge-conflict/package.nls.json index d991f872b44f3b8a28f8cfed63889468f785314b..b2927ca3431c9bd208a93b00a99afa333effb404 100644 --- a/extensions/merge-conflict/package.nls.json +++ b/extensions/merge-conflict/package.nls.json @@ -1,14 +1,14 @@ { "command.category": "Merge Conflict", - "command.accept.all-incoming": "Accept all incoming", - "command.accept.all-both": "Accept all both", - "command.accept.current": "Accept current", - "command.accept.incoming": "Accept incoming", - "command.accept.selection": "Accept selection", + "command.accept.all-incoming": "Accept All Incoming", + "command.accept.all-both": "Accept All Both", + "command.accept.current": "Accept Current", + "command.accept.incoming": "Accept Incoming", + "command.accept.selection": "Accept Selection", "command.accept.both": "Accept Both", - "command.next": "Next conflict", - "command.previous": "Previous conflict", - "command.compare": "Compare current conflict", + "command.next": "Next Conflict", + "command.previous": "Previous Conflict", + "command.compare": "Compare Current Conflict", "config.title": "Merge Conflict", "config.codeLensEnabled": "Enable/disable merge conflict block CodeLens within editor", "config.decoratorsEnabled": "Enable/disable merge conflict decorators within editor" diff --git a/extensions/merge-conflict/src/codelensProvider.ts b/extensions/merge-conflict/src/codelensProvider.ts index 7213594505476886de7160fe12ce341b7d2e1ae6..aa7bc6e30e0d8d0eb7b7565b2659910576c54228 100644 --- a/extensions/merge-conflict/src/codelensProvider.ts +++ b/extensions/merge-conflict/src/codelensProvider.ts @@ -63,25 +63,25 @@ export default class MergeConflictCodeLensProvider implements vscode.CodeLensPro conflicts.forEach(conflict => { let acceptCurrentCommand: vscode.Command = { command: 'merge-conflict.accept.current', - title: localize('acceptCurrentChange', 'Accept current change'), + title: localize('acceptCurrentChange', 'Accept Current Change'), arguments: ['known-conflict', conflict] }; let acceptIncomingCommand: vscode.Command = { command: 'merge-conflict.accept.incoming', - title: localize('acceptIncomingChange', 'Accept incoming change'), + title: localize('acceptIncomingChange', 'Accept Incoming Change'), arguments: ['known-conflict', conflict] }; let acceptBothCommand: vscode.Command = { command: 'merge-conflict.accept.both', - title: localize('acceptBothChanges', 'Accept both changes'), + title: localize('acceptBothChanges', 'Accept Both Changes'), arguments: ['known-conflict', conflict] }; let diffCommand: vscode.Command = { command: 'merge-conflict.compare', - title: localize('compareChanges', 'Compare changes'), + title: localize('compareChanges', 'Compare Changes'), arguments: [conflict] }; diff --git a/extensions/merge-conflict/src/commandHandler.ts b/extensions/merge-conflict/src/commandHandler.ts index e35f6f3cf08adc307284fd17656ba4b24626d0b8..3de959c04bf2fddf012a9ad8bc25b69066419598 100644 --- a/extensions/merge-conflict/src/commandHandler.ts +++ b/extensions/merge-conflict/src/commandHandler.ts @@ -30,44 +30,51 @@ export default class CommandHandler implements vscode.Disposable { begin() { this.disposables.push( - vscode.commands.registerTextEditorCommand('merge-conflict.accept.current', this.acceptCurrent, this), - vscode.commands.registerTextEditorCommand('merge-conflict.accept.incoming', this.acceptIncoming, this), - vscode.commands.registerTextEditorCommand('merge-conflict.accept.selection', this.acceptSelection, this), - vscode.commands.registerTextEditorCommand('merge-conflict.accept.both', this.acceptBoth, this), - vscode.commands.registerTextEditorCommand('merge-conflict.accept.all-current', this.acceptAllCurrent, this), - vscode.commands.registerTextEditorCommand('merge-conflict.accept.all-incoming', this.acceptAllIncoming, this), - vscode.commands.registerTextEditorCommand('merge-conflict.accept.all-both', this.acceptAllBoth, this), - vscode.commands.registerTextEditorCommand('merge-conflict.next', this.navigateNext, this), - vscode.commands.registerTextEditorCommand('merge-conflict.previous', this.navigatePrevious, this), - vscode.commands.registerTextEditorCommand('merge-conflict.compare', this.compare, this) + this.registerTextEditorCommand('merge-conflict.accept.current', this.acceptCurrent), + this.registerTextEditorCommand('merge-conflict.accept.incoming', this.acceptIncoming), + this.registerTextEditorCommand('merge-conflict.accept.selection', this.acceptSelection), + this.registerTextEditorCommand('merge-conflict.accept.both', this.acceptBoth), + this.registerTextEditorCommand('merge-conflict.accept.all-current', this.acceptAllCurrent), + this.registerTextEditorCommand('merge-conflict.accept.all-incoming', this.acceptAllIncoming), + this.registerTextEditorCommand('merge-conflict.accept.all-both', this.acceptAllBoth), + this.registerTextEditorCommand('merge-conflict.next', this.navigateNext), + this.registerTextEditorCommand('merge-conflict.previous', this.navigatePrevious), + this.registerTextEditorCommand('merge-conflict.compare', this.compare) ); } - acceptCurrent(editor: vscode.TextEditor, edit: vscode.TextEditorEdit, ...args): Promise { + private registerTextEditorCommand(command: string, cb: (editor: vscode.TextEditor, ...args) => Promise) { + return vscode.commands.registerCommand(command, (...args) => { + const editor = vscode.window.activeTextEditor; + return editor && cb.call(this, editor, ...args); + }); + } + + acceptCurrent(editor: vscode.TextEditor, ...args): Promise { return this.accept(interfaces.CommitType.Current, editor, ...args); } - acceptIncoming(editor: vscode.TextEditor, edit: vscode.TextEditorEdit, ...args): Promise { + acceptIncoming(editor: vscode.TextEditor, ...args): Promise { return this.accept(interfaces.CommitType.Incoming, editor, ...args); } - acceptBoth(editor: vscode.TextEditor, edit: vscode.TextEditorEdit, ...args): Promise { + acceptBoth(editor: vscode.TextEditor, ...args): Promise { return this.accept(interfaces.CommitType.Both, editor, ...args); } - acceptAllCurrent(editor: vscode.TextEditor, edit: vscode.TextEditorEdit, ...args): Promise { + acceptAllCurrent(editor: vscode.TextEditor, ...args): Promise { return this.acceptAll(interfaces.CommitType.Current, editor); } - acceptAllIncoming(editor: vscode.TextEditor, edit: vscode.TextEditorEdit, ...args): Promise { + acceptAllIncoming(editor: vscode.TextEditor, ...args): Promise { return this.acceptAll(interfaces.CommitType.Incoming, editor); } - acceptAllBoth(editor: vscode.TextEditor, edit: vscode.TextEditorEdit, ...args): Promise { + acceptAllBoth(editor: vscode.TextEditor, ...args): Promise { return this.acceptAll(interfaces.CommitType.Both, editor); } - async compare(editor: vscode.TextEditor, edit: vscode.TextEditorEdit, conflict: interfaces.IDocumentMergeConflict | null, ...args) { + async compare(editor: vscode.TextEditor, conflict: interfaces.IDocumentMergeConflict | null, ...args) { const fileName = path.basename(editor.document.uri.fsPath); // No conflict, command executed from command palette @@ -90,19 +97,19 @@ export default class CommandHandler implements vscode.Disposable { range = conflict.incoming.content; const rightUri = leftUri.with({ query: JSON.stringify(range) }); - const title = localize('compareChangesTitle', '{0}: Current changes \u2194 Incoming changes', fileName); + const title = localize('compareChangesTitle', '{0}: Current Changes ⟷ Incoming Changes', fileName); vscode.commands.executeCommand('vscode.diff', leftUri, rightUri, title); } - navigateNext(editor: vscode.TextEditor, edit: vscode.TextEditorEdit, ...args): Promise { + navigateNext(editor: vscode.TextEditor, ...args): Promise { return this.navigate(editor, NavigationDirection.Forwards); } - navigatePrevious(editor: vscode.TextEditor, edit: vscode.TextEditorEdit, ...args): Promise { + navigatePrevious(editor: vscode.TextEditor, ...args): Promise { return this.navigate(editor, NavigationDirection.Backwards); } - async acceptSelection(editor: vscode.TextEditor, edit: vscode.TextEditorEdit, ...args): Promise { + async acceptSelection(editor: vscode.TextEditor, ...args): Promise { let conflict = await this.findConflictContainingSelection(editor); if (!conflict) { @@ -111,18 +118,27 @@ export default class CommandHandler implements vscode.Disposable { } let typeToAccept: interfaces.CommitType; + let tokenAfterCurrentBlock: vscode.Range = conflict.splitter; + + if (conflict.commonAncestors.length > 0) { + tokenAfterCurrentBlock = conflict.commonAncestors[0].header; + } // Figure out if the cursor is in current or incoming, we do this by seeing if - // the active position is before or after the range of the splitter. We can - // use this trick as the previous check in findConflictByActiveSelection will - // ensure it's within the conflict range, so we don't falsely identify "current" - // or "incoming" if outside of a conflict range. - if (editor.selection.active.isBefore(conflict.splitter.start)) { + // the active position is before or after the range of the splitter or common + // ancesors marker. We can use this trick as the previous check in + // findConflictByActiveSelection will ensure it's within the conflict range, so + // we don't falsely identify "current" or "incoming" if outside of a conflict range. + if (editor.selection.active.isBefore(tokenAfterCurrentBlock.start)) { typeToAccept = interfaces.CommitType.Current; } else if (editor.selection.active.isAfter(conflict.splitter.end)) { typeToAccept = interfaces.CommitType.Incoming; } + else if (editor.selection.active.isBefore(conflict.splitter.start)) { + vscode.window.showWarningMessage(localize('cursorOnCommonAncestorsRange', 'Editor cursor is within the common ancestors block, please move it to either the "current" or "incoming" block')); + return; + } else { vscode.window.showWarningMessage(localize('cursorOnSplitterRange', 'Editor cursor is within the merge conflict splitter, please move it to either the "current" or "incoming" block')); return; diff --git a/extensions/merge-conflict/src/documentMergeConflict.ts b/extensions/merge-conflict/src/documentMergeConflict.ts index 221ee8f36bcb1050f69ff2eb272041792f08f1ee..f1714c981632bb10be0264b717ae98713811e614 100644 --- a/extensions/merge-conflict/src/documentMergeConflict.ts +++ b/extensions/merge-conflict/src/documentMergeConflict.ts @@ -10,12 +10,14 @@ export class DocumentMergeConflict implements interfaces.IDocumentMergeConflict public range: vscode.Range; public current: interfaces.IMergeRegion; public incoming: interfaces.IMergeRegion; + public commonAncestors: interfaces.IMergeRegion[]; public splitter: vscode.Range; constructor(document: vscode.TextDocument, descriptor: interfaces.IDocumentMergeConflictDescriptor) { this.range = descriptor.range; this.current = descriptor.current; this.incoming = descriptor.incoming; + this.commonAncestors = descriptor.commonAncestors; this.splitter = descriptor.splitter; } diff --git a/extensions/merge-conflict/src/interfaces.ts b/extensions/merge-conflict/src/interfaces.ts index 9d411befaba441278f921f66358f1eb55ec22bf5..70519b72b1f11719f15095c4501785d8148e1a5a 100644 --- a/extensions/merge-conflict/src/interfaces.ts +++ b/extensions/merge-conflict/src/interfaces.ts @@ -32,6 +32,7 @@ export interface IDocumentMergeConflictDescriptor { range: vscode.Range; current: IMergeRegion; incoming: IMergeRegion; + commonAncestors: IMergeRegion[]; splitter: vscode.Range; } diff --git a/extensions/merge-conflict/src/mergeConflictParser.ts b/extensions/merge-conflict/src/mergeConflictParser.ts index fa316a0701c1a5e0d6a3fffe52829bfe00dce07d..24c37ae88de1a3099908663ce0ed22b42a141c0d 100644 --- a/extensions/merge-conflict/src/mergeConflictParser.ts +++ b/extensions/merge-conflict/src/mergeConflictParser.ts @@ -7,11 +7,13 @@ import * as interfaces from './interfaces'; import { DocumentMergeConflict } from './documentMergeConflict'; const startHeaderMarker = '<<<<<<< '; +const commonAncestorsMarker = '||||||| '; const splitterMarker = '======='; const endFooterMarker = '>>>>>>> '; interface IScanMergedConflict { startHeader: vscode.TextLine; + commonAncestors: vscode.TextLine[]; splitter?: vscode.TextLine; endFooter?: vscode.TextLine; } @@ -49,10 +51,14 @@ export class MergeConflictParser { } // Create a new conflict starting at this line - currentConflict = { startHeader: line }; + currentConflict = { startHeader: line, commonAncestors: [] }; + } + // Are we within a conflict block and is this a common ancestors marker? ||||||| + else if (currentConflict && !currentConflict.splitter && line.text.startsWith(commonAncestorsMarker)) { + currentConflict.commonAncestors.push(line); } // Are we within a conflict block and is this a splitter? ======= - else if (currentConflict && line.text.startsWith(splitterMarker)) { + else if (currentConflict && !currentConflict.splitter && line.text.startsWith(splitterMarker)) { currentConflict.splitter = line; } // Are we withon a conflict block and is this a footer? >>>>>>> @@ -84,6 +90,8 @@ export class MergeConflictParser { return null; } + let tokenAfterCurrentBlock: vscode.TextLine = scanned.commonAncestors[0] || scanned.splitter; + // Assume that descriptor.current.header, descriptor.incoming.header and descriptor.spliiter // have valid ranges, fill in content and total ranges from these parts. // NOTE: We need to shift the decortator range back one character so the splitter does not end up with @@ -94,13 +102,28 @@ export class MergeConflictParser { header: scanned.startHeader.range, decoratorContent: new vscode.Range( scanned.startHeader.rangeIncludingLineBreak.end, - MergeConflictParser.shiftBackOneCharacter(document, scanned.splitter.range.start)), - // Current content is range between header (shifted for linebreak) and splitter start + MergeConflictParser.shiftBackOneCharacter(document, tokenAfterCurrentBlock.range.start)), + // Current content is range between header (shifted for linebreak) and splitter or common ancestors mark start content: new vscode.Range( scanned.startHeader.rangeIncludingLineBreak.end, - scanned.splitter.range.start), + tokenAfterCurrentBlock.range.start), name: scanned.startHeader.text.substring(startHeaderMarker.length) }, + commonAncestors: scanned.commonAncestors.map((currentTokenLine, index, commonAncestors) => { + let nextTokenLine = commonAncestors[index + 1] || scanned.splitter; + return { + header: currentTokenLine.range, + decoratorContent: new vscode.Range( + currentTokenLine.rangeIncludingLineBreak.end, + MergeConflictParser.shiftBackOneCharacter(document, nextTokenLine.range.start)), + // Each common ancestors block is range between one common ancestors token + // (shifted for linebreak) and start of next common ancestors token or splitter + content: new vscode.Range( + currentTokenLine.rangeIncludingLineBreak.end, + nextTokenLine.range.start), + name: currentTokenLine.text.substring(commonAncestorsMarker.length) + }; + }), splitter: scanned.splitter.range, incoming: { header: scanned.endFooter.range, diff --git a/extensions/merge-conflict/src/mergeDecorator.ts b/extensions/merge-conflict/src/mergeDecorator.ts index f6d0135aad9a45f417a1a3f882ed45eb91f68e59..c3fa2e08e08674491b1c9804eb54e847aded5b1f 100644 --- a/extensions/merge-conflict/src/mergeDecorator.ts +++ b/extensions/merge-conflict/src/mergeDecorator.ts @@ -13,11 +13,9 @@ export default class MergeDectorator implements vscode.Disposable { private decorationUsesWholeLine: boolean = true; // Useful for debugging, set to false to see exact match ranges - // TODO: Move to config? - private currentColorRgb = `32,200,94`; - private incomingColorRgb = `24,134,255`; private config: interfaces.IExtensionConfiguration; private tracker: interfaces.IDocumentMergeConflictTracker; + private updating = new Map(); constructor(private context: vscode.ExtensionContext, trackerService: interfaces.IDocumentMergeConflictTrackerService) { this.tracker = trackerService.createTracker('decorator'); @@ -38,9 +36,9 @@ export default class MergeDectorator implements vscode.Disposable { this.applyDecorationsFromEvent(event.document); }, null, this.context.subscriptions); - vscode.window.onDidChangeActiveTextEditor((e) => { - // New editor attempt to apply - this.applyDecorations(e); + vscode.window.onDidChangeVisibleTextEditors((e) => { + // Any of which could be new (not just the active one). + e.forEach(e => this.applyDecorations(e)); }, null, this.context.subscriptions); } @@ -69,40 +67,59 @@ export default class MergeDectorator implements vscode.Disposable { // Create decorators if (config.enableDecorations || config.enableEditorOverview) { this.decorations['current.content'] = vscode.window.createTextEditorDecorationType( - this.generateBlockRenderOptions(this.currentColorRgb, config) + this.generateBlockRenderOptions('merge.currentContentBackground', 'editorOverviewRuler.currentContentForeground', config) ); this.decorations['incoming.content'] = vscode.window.createTextEditorDecorationType( - this.generateBlockRenderOptions(this.incomingColorRgb, config) + this.generateBlockRenderOptions('merge.incomingContentBackground', 'editorOverviewRuler.incomingContentForeground', config) + ); + + this.decorations['commonAncestors.content'] = vscode.window.createTextEditorDecorationType( + this.generateBlockRenderOptions('merge.commonContentBackground', 'editorOverviewRuler.commonContentForeground', config) ); } if (config.enableDecorations) { this.decorations['current.header'] = vscode.window.createTextEditorDecorationType({ - // backgroundColor: 'rgba(255, 0, 0, 0.01)', - // border: '2px solid red', isWholeLine: this.decorationUsesWholeLine, - backgroundColor: `rgba(${this.currentColorRgb}, 1.0)`, - color: 'white', + backgroundColor: new vscode.ThemeColor('merge.currentHeaderBackground'), + color: new vscode.ThemeColor('editor.foreground'), + outlineStyle: 'solid', + outlineWidth: '1pt', + outlineColor: new vscode.ThemeColor('merge.border'), after: { - contentText: ' ' + localize('currentChange', '(Current change)'), - color: 'rgba(0, 0, 0, 0.7)' + contentText: ' ' + localize('currentChange', '(Current Change)'), + color: new vscode.ThemeColor('descriptionForeground') } }); + this.decorations['commonAncestors.header'] = vscode.window.createTextEditorDecorationType({ + isWholeLine: this.decorationUsesWholeLine, + backgroundColor: new vscode.ThemeColor('merge.commonHeaderBackground'), + color: new vscode.ThemeColor('editor.foreground'), + outlineStyle: 'solid', + outlineWidth: '1pt', + outlineColor: new vscode.ThemeColor('merge.border') + }); + this.decorations['splitter'] = vscode.window.createTextEditorDecorationType({ - backgroundColor: 'rgba(0, 0, 0, 0.25)', - color: 'white', + color: new vscode.ThemeColor('editor.foreground'), + outlineStyle: 'solid', + outlineWidth: '1pt', + outlineColor: new vscode.ThemeColor('merge.border'), isWholeLine: this.decorationUsesWholeLine, }); this.decorations['incoming.header'] = vscode.window.createTextEditorDecorationType({ - backgroundColor: `rgba(${this.incomingColorRgb}, 1.0)`, - color: 'white', + backgroundColor: new vscode.ThemeColor('merge.incomingHeaderBackground'), + color: new vscode.ThemeColor('editor.foreground'), + outlineStyle: 'solid', + outlineWidth: '1pt', + outlineColor: new vscode.ThemeColor('merge.border'), isWholeLine: this.decorationUsesWholeLine, after: { - contentText: ' ' + localize('incomingChange', '(Incoming change)'), - color: 'rgba(0, 0, 0, 0.7)' + contentText: ' ' + localize('incomingChange', '(Incoming Change)'), + color: new vscode.ThemeColor('descriptionForeground') } }); } @@ -118,17 +135,17 @@ export default class MergeDectorator implements vscode.Disposable { this.decorations = {}; } - private generateBlockRenderOptions(color: string, config: interfaces.IExtensionConfiguration): vscode.DecorationRenderOptions { + private generateBlockRenderOptions(backgroundColor: string, overviewRulerColor: string, config: interfaces.IExtensionConfiguration): vscode.DecorationRenderOptions { - let renderOptions: any = {}; + let renderOptions: vscode.DecorationRenderOptions = {}; if (config.enableDecorations) { - renderOptions.backgroundColor = `rgba(${color}, 0.2)`; + renderOptions.backgroundColor = new vscode.ThemeColor(backgroundColor); renderOptions.isWholeLine = this.decorationUsesWholeLine; } if (config.enableEditorOverview) { - renderOptions.overviewRulerColor = `rgba(${color}, 0.5)`; + renderOptions.overviewRulerColor = new vscode.ThemeColor(overviewRulerColor); renderOptions.overviewRulerLane = vscode.OverviewRulerLane.Full; } @@ -151,48 +168,66 @@ export default class MergeDectorator implements vscode.Disposable { return; } - // If we have a pending scan from the same origin, exit early. - if (this.tracker.isPending(editor.document)) { + // If we have a pending scan from the same origin, exit early. (Cannot use this.tracker.isPending() because decorations are per editor.) + if (this.updating.get(editor)) { return; } - let conflicts = await this.tracker.getConflicts(editor.document); + try { + this.updating.set(editor, true); - if (conflicts.length === 0) { - this.removeDecorations(editor); - return; - } + let conflicts = await this.tracker.getConflicts(editor.document); + if (vscode.window.visibleTextEditors.indexOf(editor) === -1) { + return; + } - // Store decorations keyed by the type of decoration, set decoration wants a "style" - // to go with it, which will match this key (see constructor); - let matchDecorations: { [key: string]: vscode.DecorationOptions[] } = {}; + if (conflicts.length === 0) { + this.removeDecorations(editor); + return; + } - let pushDecoration = (key: string, d: vscode.DecorationOptions) => { - matchDecorations[key] = matchDecorations[key] || []; - matchDecorations[key].push(d); - }; + // Store decorations keyed by the type of decoration, set decoration wants a "style" + // to go with it, which will match this key (see constructor); + let matchDecorations: { [key: string]: vscode.DecorationOptions[] } = {}; - conflicts.forEach(conflict => { - // TODO, this could be more effective, just call getMatchPositions once with a map of decoration to position - pushDecoration('current.content', { range: conflict.current.decoratorContent }); - pushDecoration('incoming.content', { range: conflict.incoming.decoratorContent }); + let pushDecoration = (key: string, d: vscode.DecorationOptions) => { + matchDecorations[key] = matchDecorations[key] || []; + matchDecorations[key].push(d); + }; - if (this.config.enableDecorations) { - pushDecoration('current.header', { range: conflict.current.header }); - pushDecoration('splitter', { range: conflict.splitter }); - pushDecoration('incoming.header', { range: conflict.incoming.header }); - } - }); + conflicts.forEach(conflict => { + // TODO, this could be more effective, just call getMatchPositions once with a map of decoration to position + pushDecoration('current.content', { range: conflict.current.decoratorContent }); + pushDecoration('incoming.content', { range: conflict.incoming.decoratorContent }); - // For each match we've generated, apply the generated decoration with the matching decoration type to the - // editor instance. Keys in both matches and decorations should match. - Object.keys(matchDecorations).forEach(decorationKey => { - let decorationType = this.decorations[decorationKey]; + conflict.commonAncestors.forEach(commonAncestorsRegion => { + pushDecoration('commonAncestors.content', { range: commonAncestorsRegion.decoratorContent }); + }); - if (decorationType) { - editor.setDecorations(decorationType, matchDecorations[decorationKey]); - } - }); + if (this.config.enableDecorations) { + pushDecoration('current.header', { range: conflict.current.header }); + pushDecoration('splitter', { range: conflict.splitter }); + pushDecoration('incoming.header', { range: conflict.incoming.header }); + + conflict.commonAncestors.forEach(commonAncestorsRegion => { + pushDecoration('commonAncestors.header', { range: commonAncestorsRegion.header }); + }); + } + }); + + // For each match we've generated, apply the generated decoration with the matching decoration type to the + // editor instance. Keys in both matches and decorations should match. + Object.keys(matchDecorations).forEach(decorationKey => { + let decorationType = this.decorations[decorationKey]; + + if (decorationType) { + editor.setDecorations(decorationType, matchDecorations[decorationKey]); + } + }); + + } finally { + this.updating.delete(editor); + } } private removeDecorations(editor: vscode.TextEditor) { diff --git a/extensions/merge-conflict/src/package.json b/extensions/merge-conflict/src/package.json deleted file mode 100644 index 2f79e20bf7ffc036189f7d2d92324ce54b639330..0000000000000000000000000000000000000000 --- a/extensions/merge-conflict/src/package.json +++ /dev/null @@ -1,722 +0,0 @@ -{ - "name": "git", - "publisher": "vscode", - "displayName": "git", - "description": "Git", - "version": "0.0.1", - "engines": { - "vscode": "^1.5.0" - }, - "aiKey": "AIF-d9b70cd4-b9f9-4d70-929b-a071c400b217", - "enableProposedApi": true, - "categories": [ - "Other" - ], - "activationEvents": [ - "*" - ], - "main": "./out/main", - "scripts": { - "compile": "gulp compile-extension:git", - "watch": "gulp watch-extension:git" - }, - "contributes": { - "commands": [ - { - "command": "git.clone", - "title": "%command.clone%", - "category": "Git" - }, - { - "command": "git.init", - "title": "%command.init%", - "category": "Git" - }, - { - "command": "git.refresh", - "title": "%command.refresh%", - "category": "Git", - "icon": { - "light": "resources/icons/light/refresh.svg", - "dark": "resources/icons/dark/refresh.svg" - } - }, - { - "command": "git.openChange", - "title": "%command.openChange%", - "category": "Git", - "icon": { - "light": "resources/icons/light/open-change.svg", - "dark": "resources/icons/dark/open-change.svg" - } - }, - { - "command": "git.openFile", - "title": "%command.openFile%", - "category": "Git", - "icon": { - "light": "resources/icons/light/open-file.svg", - "dark": "resources/icons/dark/open-file.svg" - } - }, - { - "command": "git.stage", - "title": "%command.stage%", - "category": "Git", - "icon": { - "light": "resources/icons/light/stage.svg", - "dark": "resources/icons/dark/stage.svg" - } - }, - { - "command": "git.stageAll", - "title": "%command.stageAll%", - "category": "Git", - "icon": { - "light": "resources/icons/light/stage.svg", - "dark": "resources/icons/dark/stage.svg" - } - }, - { - "command": "git.stageSelectedRanges", - "title": "%command.stageSelectedRanges%", - "category": "Git" - }, - { - "command": "git.revertSelectedRanges", - "title": "%command.revertSelectedRanges%", - "category": "Git" - }, - { - "command": "git.unstage", - "title": "%command.unstage%", - "category": "Git", - "icon": { - "light": "resources/icons/light/unstage.svg", - "dark": "resources/icons/dark/unstage.svg" - } - }, - { - "command": "git.unstageAll", - "title": "%command.unstageAll%", - "category": "Git", - "icon": { - "light": "resources/icons/light/unstage.svg", - "dark": "resources/icons/dark/unstage.svg" - } - }, - { - "command": "git.unstageSelectedRanges", - "title": "%command.unstageSelectedRanges%", - "category": "Git" - }, - { - "command": "git.clean", - "title": "%command.clean%", - "category": "Git", - "icon": { - "light": "resources/icons/light/clean.svg", - "dark": "resources/icons/dark/clean.svg" - } - }, - { - "command": "git.cleanAll", - "title": "%command.cleanAll%", - "category": "Git", - "icon": { - "light": "resources/icons/light/clean.svg", - "dark": "resources/icons/dark/clean.svg" - } - }, - { - "command": "git.commit", - "title": "%command.commit%", - "category": "Git", - "icon": { - "light": "resources/icons/light/check.svg", - "dark": "resources/icons/dark/check.svg" - } - }, - { - "command": "git.commitStaged", - "title": "%command.commitStaged%", - "category": "Git" - }, - { - "command": "git.commitStagedSigned", - "title": "%command.commitStagedSigned%", - "category": "Git" - }, - { - "command": "git.commitAll", - "title": "%command.commitAll%", - "category": "Git" - }, - { - "command": "git.commitAllSigned", - "title": "%command.commitAllSigned%", - "category": "Git" - }, - { - "command": "git.undoCommit", - "title": "%command.undoCommit%", - "category": "Git" - }, - { - "command": "git.checkout", - "title": "%command.checkout%", - "category": "Git" - }, - { - "command": "git.branch", - "title": "%command.branch%", - "category": "Git" - }, - { - "command": "git.pull", - "title": "%command.pull%", - "category": "Git" - }, - { - "command": "git.pullRebase", - "title": "%command.pullRebase%", - "category": "Git" - }, - { - "command": "git.push", - "title": "%command.push%", - "category": "Git" - }, - { - "command": "git.pushTo", - "title": "%command.pushTo%", - "category": "Git" - }, - { - "command": "git.sync", - "title": "%command.sync%", - "category": "Git" - }, - { - "command": "git.publish", - "title": "%command.publish%", - "category": "Git" - }, - { - "command": "git.showOutput", - "title": "%command.showOutput%", - "category": "Git" - }, - { - "command": "git.merge.accept.all-current", - "title": "Accept all current", - "category": "Git Merge" - }, - { - "category": "Git Merge", - "title": "Accept all incoming", - "command": "git.merge.accept.all-incoming" - }, - { - "category": "Git Merge", - "title": "Accept all both", - "command": "git.merge.accept.all-both" - }, - { - "category": "Git Merge", - "title": "Accept current", - "command": "git.merge.accept.current" - }, - { - "category": "Git Merge", - "title": "Accept incoming", - "command": "git.merge.accept.incoming" - }, - { - "category": "Git Merge", - "title": "Accept selection", - "command": "git.merge.accept.selection" - }, - { - "category": "Git Merge", - "title": "Accept both", - "command": "git.merge.accept.both" - }, - { - "category": "Git Merge", - "title": "Next conflict", - "command": "git.merge.next" - }, - { - "category": "Git Merge", - "title": "Previous conflict", - "command": "git.merge.previous" - }, - { - "category": "Git Merge", - "title": "Compare current conflict", - "command": "git.merge.compare" - } - ], - "keybindings": [ - { - "command": "git.merge.next", - "when": "editorTextFocus", - "key": "alt+m down" - }, - { - "command": "git.merge.previous", - "when": "editorTextFocus", - "key": "alt+m up" - }, - { - "command": "git.merge.accept.selection", - "when": "editorTextFocus", - "key": "alt+m enter" - }, - { - "command": "git.merge.accept.current", - "when": "editorTextFocus", - "key": "alt+m 1" - }, - { - "command": "git.merge.accept.incoming", - "when": "editorTextFocus", - "key": "alt+m 2" - }, - { - "command": "git.merge.accept.both", - "when": "editorTextFocus", - "key": "alt+m 3" - } - ], - "menus": { - "commandPalette": [ - { - "command": "git.clone", - "when": "config.git.enabled" - }, - { - "command": "git.init", - "when": "config.git.enabled && scmProvider == git && gitState == norepo" - }, - { - "command": "git.refresh", - "when": "config.git.enabled && scmProvider == git && gitState == idle" - }, - { - "command": "git.openFile", - "when": "config.git.enabled && scmProvider == git && gitState == idle" - }, - { - "command": "git.openChange", - "when": "config.git.enabled && scmProvider == git && gitState == idle" - }, - { - "command": "git.stage", - "when": "config.git.enabled && scmProvider == git && gitState == idle" - }, - { - "command": "git.stageAll", - "when": "config.git.enabled && scmProvider == git && gitState == idle" - }, - { - "command": "git.stageSelectedRanges", - "when": "config.git.enabled && scmProvider == git && gitState == idle" - }, - { - "command": "git.revertSelectedRanges", - "when": "config.git.enabled && scmProvider == git && gitState == idle" - }, - { - "command": "git.unstage", - "when": "config.git.enabled && scmProvider == git && gitState == idle" - }, - { - "command": "git.unstageAll", - "when": "config.git.enabled && scmProvider == git && gitState == idle" - }, - { - "command": "git.unstageSelectedRanges", - "when": "config.git.enabled && scmProvider == git && gitState == idle" - }, - { - "command": "git.clean", - "when": "config.git.enabled && scmProvider == git && gitState == idle" - }, - { - "command": "git.cleanAll", - "when": "config.git.enabled && scmProvider == git && gitState == idle" - }, - { - "command": "git.commit", - "when": "config.git.enabled && scmProvider == git && gitState == idle" - }, - { - "command": "git.commitStaged", - "when": "config.git.enabled && scmProvider == git && gitState == idle" - }, - { - "command": "git.commitStagedSigned", - "when": "config.git.enabled && scmProvider == git && gitState == idle" - }, - { - "command": "git.commitAll", - "when": "config.git.enabled && scmProvider == git && gitState == idle" - }, - { - "command": "git.commitAllSigned", - "when": "config.git.enabled && scmProvider == git && gitState == idle" - }, - { - "command": "git.undoCommit", - "when": "config.git.enabled && scmProvider == git && gitState == idle" - }, - { - "command": "git.checkout", - "when": "config.git.enabled && scmProvider == git && gitState == idle" - }, - { - "command": "git.branch", - "when": "config.git.enabled && scmProvider == git && gitState == idle" - }, - { - "command": "git.pull", - "when": "config.git.enabled && scmProvider == git && gitState == idle" - }, - { - "command": "git.pullRebase", - "when": "config.git.enabled && scmProvider == git && gitState == idle" - }, - { - "command": "git.push", - "when": "config.git.enabled && scmProvider == git && gitState == idle" - }, - { - "command": "git.pushTo", - "when": "config.git.enabled && scmProvider == git && gitState == idle" - }, - { - "command": "git.sync", - "when": "config.git.enabled && scmProvider == git && gitState == idle" - }, - { - "command": "git.publish", - "when": "config.git.enabled && scmProvider == git && gitState == idle" - }, - { - "command": "git.showOutput", - "when": "config.git.enabled && scmProvider == git && gitState == idle" - } - ], - "scm/title": [ - { - "command": "git.init", - "group": "navigation", - "when": "config.git.enabled && scmProvider == git && gitState == norepo" - }, - { - "command": "git.commit", - "group": "navigation", - "when": "config.git.enabled && scmProvider == git && gitState == idle" - }, - { - "command": "git.refresh", - "group": "navigation", - "when": "config.git.enabled && scmProvider == git && gitState == idle" - }, - { - "command": "git.sync", - "group": "1_sync", - "when": "config.git.enabled && scmProvider == git && gitState == idle" - }, - { - "command": "git.pull", - "group": "1_sync", - "when": "config.git.enabled && scmProvider == git && gitState == idle" - }, - { - "command": "git.pullRebase", - "group": "1_sync", - "when": "config.git.enabled && scmProvider == git && gitState == idle" - }, - { - "command": "git.push", - "group": "1_sync", - "when": "config.git.enabled && scmProvider == git && gitState == idle" - }, - { - "command": "git.pushTo", - "group": "1_sync", - "when": "config.git.enabled && scmProvider == git && gitState == idle" - }, - { - "command": "git.publish", - "group": "2_publish", - "when": "config.git.enabled && scmProvider == git && gitState == idle" - }, - { - "command": "git.commitStaged", - "group": "3_commit", - "when": "config.git.enabled && scmProvider == git && gitState == idle" - }, - { - "command": "git.commitStagedSigned", - "group": "3_commit", - "when": "config.git.enabled && scmProvider == git && gitState == idle" - }, - { - "command": "git.commitAll", - "group": "3_commit", - "when": "config.git.enabled && scmProvider == git && gitState == idle" - }, - { - "command": "git.commitAllSigned", - "group": "3_commit", - "when": "config.git.enabled && scmProvider == git && gitState == idle" - }, - { - "command": "git.undoCommit", - "group": "3_commit", - "when": "config.git.enabled && scmProvider == git && gitState == idle" - }, - { - "command": "git.unstageAll", - "group": "4_stage", - "when": "config.git.enabled && scmProvider == git && gitState == idle" - }, - { - "command": "git.cleanAll", - "group": "4_stage", - "when": "config.git.enabled && scmProvider == git && gitState == idle" - }, - { - "command": "git.showOutput", - "group": "5_output", - "when": "config.git.enabled && scmProvider == git && gitState == idle" - } - ], - "scm/resourceGroup/context": [ - { - "command": "git.stageAll", - "when": "config.git.enabled && scmProvider == git && gitState == idle && scmResourceGroup == merge", - "group": "1_modification" - }, - { - "command": "git.stageAll", - "when": "config.git.enabled && scmProvider == git && gitState == idle && scmResourceGroup == merge", - "group": "inline" - }, - { - "command": "git.unstageAll", - "when": "config.git.enabled && scmProvider == git && gitState == idle && scmResourceGroup == index", - "group": "1_modification" - }, - { - "command": "git.unstageAll", - "when": "config.git.enabled && scmProvider == git && gitState == idle && scmResourceGroup == index", - "group": "inline" - }, - { - "command": "git.cleanAll", - "when": "config.git.enabled && scmProvider == git && gitState == idle && scmResourceGroup == workingTree", - "group": "1_modification" - }, - { - "command": "git.stageAll", - "when": "config.git.enabled && scmProvider == git && gitState == idle && scmResourceGroup == workingTree", - "group": "1_modification" - }, - { - "command": "git.cleanAll", - "when": "config.git.enabled && scmProvider == git && gitState == idle && scmResourceGroup == workingTree", - "group": "inline" - }, - { - "command": "git.stageAll", - "when": "config.git.enabled && scmProvider == git && gitState == idle && scmResourceGroup == workingTree", - "group": "inline" - } - ], - "scm/resourceState/context": [ - { - "command": "git.stage", - "when": "config.git.enabled && scmProvider == git && gitState == idle && scmResourceGroup == merge", - "group": "1_modification" - }, - { - "command": "git.stage", - "when": "config.git.enabled && scmProvider == git && gitState == idle && scmResourceGroup == merge", - "group": "inline" - }, - { - "command": "git.openChange", - "when": "config.git.enabled && scmProvider == git && gitState == idle && scmResourceGroup == index", - "group": "navigation" - }, - { - "command": "git.openFile", - "when": "config.git.enabled && scmProvider == git && gitState == idle && scmResourceGroup == index", - "group": "navigation" - }, - { - "command": "git.unstage", - "when": "config.git.enabled && scmProvider == git && gitState == idle && scmResourceGroup == index", - "group": "1_modification" - }, - { - "command": "git.unstage", - "when": "config.git.enabled && scmProvider == git && gitState == idle && scmResourceGroup == index", - "group": "inline" - }, - { - "command": "git.openChange", - "when": "config.git.enabled && scmProvider == git && gitState == idle && scmResourceGroup == workingTree", - "group": "navigation" - }, - { - "command": "git.openFile", - "when": "config.git.enabled && scmProvider == git && gitState == idle && scmResourceGroup == workingTree", - "group": "navigation" - }, - { - "command": "git.stage", - "when": "config.git.enabled && scmProvider == git && gitState == idle && scmResourceGroup == workingTree", - "group": "1_modification" - }, - { - "command": "git.clean", - "when": "config.git.enabled && scmProvider == git && gitState == idle && scmResourceGroup == workingTree", - "group": "1_modification" - }, - { - "command": "git.clean", - "when": "config.git.enabled && scmProvider == git && gitState == idle && scmResourceGroup == workingTree", - "group": "inline" - }, - { - "command": "git.stage", - "when": "config.git.enabled && scmProvider == git && gitState == idle && scmResourceGroup == workingTree", - "group": "inline" - } - ], - "editor/title": [ - { - "command": "git.openFile", - "group": "navigation", - "when": "config.git.enabled && scmProvider == git && isInDiffEditor && resourceScheme != extension" - }, - { - "command": "git.openChange", - "group": "navigation", - "when": "config.git.enabled && scmProvider == git && !isInDiffEditor && resourceScheme != extension" - }, - { - "command": "git.stageSelectedRanges", - "group": "2_git@1", - "when": "config.git.enabled && scmProvider == git && isInDiffEditor" - }, - { - "command": "git.unstageSelectedRanges", - "group": "2_git@2", - "when": "config.git.enabled && scmProvider == git && isInDiffEditor" - }, - { - "command": "git.revertSelectedRanges", - "group": "2_git@3", - "when": "config.git.enabled && scmProvider == git && isInDiffEditor" - } - ] - }, - "configuration": { - "title": "Git", - "properties": { - "git.enabled": { - "type": "boolean", - "description": "%config.enabled%", - "default": true - }, - "git.path": { - "type": [ - "string", - "null" - ], - "description": "%config.path%", - "default": null, - "isExecutable": true - }, - "git.autorefresh": { - "type": "boolean", - "description": "%config.autorefresh%", - "default": true - }, - "git.autofetch": { - "type": "boolean", - "description": "%config.autofetch%", - "default": true - }, - "git.confirmSync": { - "type": "boolean", - "description": "%config.confirmSync%", - "default": true - }, - "git.countBadge": { - "type": "string", - "enum": [ - "all", - "tracked", - "off" - ], - "description": "%config.countBadge%", - "default": "all" - }, - "git.checkoutType": { - "type": "string", - "enum": [ - "all", - "local", - "tags", - "remote" - ], - "description": "%config.checkoutType%", - "default": "all" - }, - "git.ignoreLegacyWarning": { - "type": "boolean", - "description": "%config.ignoreLegacyWarning%", - "default": false - }, - "git.ignoreLimitWarning": { - "type": "boolean", - "description": "%config.ignoreLimitWarning%", - "default": false - }, - "git.defaultCloneDirectory": { - "type": "string", - "default": null, - "description": "%config.defaultCloneDirectory%" - }, - "git.enableSmartCommit": { - "type": "boolean", - "description": "%config.enableSmartCommit%", - "default": false - }, - "git.enableEditorMerge": { - "type": "boolean", - "description": "%config.enableEditorMerge%", - "default": true - } - } - } - }, - "dependencies": { - "iconv-lite": "0.4.15", - "vscode-extension-telemetry": "^0.0.7", - "vscode-nls": "^2.0.1" - }, - "devDependencies": { - "@types/mocha": "^2.2.41", - "@types/node": "^7.0.4", - "mocha": "^3.2.0" - } -} \ No newline at end of file diff --git a/extensions/merge-conflict/src/typings/refs.d.ts b/extensions/merge-conflict/src/typings/refs.d.ts index 0188b6f9ffced4f36e532cf19454274f1b34b917..bc057c55878395a9f4efb944714cf5c187c5e140 100644 --- a/extensions/merge-conflict/src/typings/refs.d.ts +++ b/extensions/merge-conflict/src/typings/refs.d.ts @@ -5,4 +5,3 @@ /// /// -/// diff --git a/extensions/npm-shrinkwrap.json b/extensions/npm-shrinkwrap.json index 42a40f5d35f37e6a2b8b8adbe745cb6162dbe8dd..25febab5619900f068a662b788cd6339600aa9d0 100644 --- a/extensions/npm-shrinkwrap.json +++ b/extensions/npm-shrinkwrap.json @@ -3,9 +3,9 @@ "version": "0.0.1", "dependencies": { "typescript": { - "version": "2.3.3,", - "from": "typescript@typescript@2.3.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.3.3.tgz" + "version": "2.4.1-insiders.20170615", + "from": "typescript@2.4.1-insiders.20170615", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.4.1-insiders.20170615.tgz" } } } diff --git a/extensions/npm/.vscodeignore b/extensions/npm/.vscodeignore new file mode 100644 index 0000000000000000000000000000000000000000..d43a539fddf5b4f3cc2950970f42a6d5238219b6 --- /dev/null +++ b/extensions/npm/.vscodeignore @@ -0,0 +1,2 @@ +src/** +tsconfig.json \ No newline at end of file diff --git a/extensions/npm/package.json b/extensions/npm/package.json index e6a6a3ec4fa88240f6da5002eaea6c56d1b2106c..882e751c9abce74bb6fbdcd377844727221b68bc 100644 --- a/extensions/npm/package.json +++ b/extensions/npm/package.json @@ -23,9 +23,7 @@ }, "main": "./out/main", "activationEvents": [ - "onCommand:workbench.action.tasks.runTask", - "onCommand:workbench.action.tasks.build", - "onCommand:workbench.action.tasks.test" + "onCommand:workbench.action.tasks.runTask" ], "contributes": { "configuration": { @@ -43,6 +41,22 @@ "description": "%config.npm.autoDetect%" } } - } + }, + "taskTypes": [ + { + "type": "npm", + "required": ["script"], + "properties": { + "script": { + "type": "string", + "description": "The npm script to customize" + }, + "file": { + "type": "string", + "description": "The package.json file that provides the task. Can be omitted." + } + } + } + ] } } \ No newline at end of file diff --git a/extensions/npm/src/main.ts b/extensions/npm/src/main.ts index 9308210ede8f7d24c8ae9dbf21a709634b507ff8..d0416ba9951f92e33d7d11352065d392e6c22d15 100644 --- a/extensions/npm/src/main.ts +++ b/extensions/npm/src/main.ts @@ -23,9 +23,12 @@ export function activate(_context: vscode.ExtensionContext): void { taskProvider.dispose(); taskProvider = undefined; } else if (!taskProvider && autoDetect === 'on') { - taskProvider = vscode.workspace.registerTaskProvider({ + taskProvider = vscode.workspace.registerTaskProvider('npm', { provideTasks: () => { return getNpmScriptsAsTasks(); + }, + resolveTask(_task: vscode.Task): vscode.Task | undefined { + return undefined; } }); } @@ -59,6 +62,31 @@ async function readFile(file: string): Promise { }); } +interface NpmTaskKind extends vscode.TaskKind { + script: string; + file?: string; +} + +const buildNames: string[] = ['build', 'compile', 'watch']; +function isBuildTask(name: string): boolean { + for (let buildName of buildNames) { + if (name.indexOf(buildName) !== -1) { + return true; + } + } + return false; +} + +const testNames: string[] = ['test']; +function isTestTask(name: string): boolean { + for (let testName of testNames) { + if (name === testName) { + return true; + } + } + return false; +} + async function getNpmScriptsAsTasks(): Promise { let workspaceRoot = vscode.workspace.rootPath; let emptyTasks: vscode.Task[] = []; @@ -81,15 +109,21 @@ async function getNpmScriptsAsTasks(): Promise { const result: vscode.Task[] = []; Object.keys(json.scripts).forEach(each => { - const task = new vscode.ShellTask(`npm: run ${each}`, `npm run ${each}`); + const kind: NpmTaskKind = { + type: 'npm', + script: each + }; + const task = new vscode.Task(kind, `run ${each}`, new vscode.ShellExecution(`npm run ${each}`)); const lowerCaseTaskName = each.toLowerCase(); - if (lowerCaseTaskName === 'build') { + if (isBuildTask(lowerCaseTaskName)) { task.group = vscode.TaskGroup.Build; - } else if (lowerCaseTaskName === 'test') { + } else if (isTestTask(lowerCaseTaskName)) { task.group = vscode.TaskGroup.Test; } result.push(task); }); + // add some 'well known' npm tasks + result.push(new vscode.Task({ type: 'npm', script: 'install' } as NpmTaskKind, `install`, new vscode.ShellExecution(`npm install`))); return Promise.resolve(result); } catch (e) { return Promise.resolve(emptyTasks); diff --git a/extensions/objective-c/.vscodeignore b/extensions/objective-c/.vscodeignore new file mode 100644 index 0000000000000000000000000000000000000000..77ab386fc7df4fa2461a8f1ac8457a1e6c9e808a --- /dev/null +++ b/extensions/objective-c/.vscodeignore @@ -0,0 +1 @@ +test/** \ No newline at end of file diff --git a/extensions/objective-c/syntaxes/objective-c++.tmLanguage.json b/extensions/objective-c/syntaxes/objective-c++.tmLanguage.json index 26550c61e1b187570b13a5e0b86d09a4207de3de..2b46507a2fba2b06410174d039fc305a35f52b42 100644 --- a/extensions/objective-c/syntaxes/objective-c++.tmLanguage.json +++ b/extensions/objective-c/syntaxes/objective-c++.tmLanguage.json @@ -1,4 +1,9 @@ { + "information_for_contributors": [ + "This file has been converted from https://github.com/atom/language-objective-c/blob/master/grammars/objective-c++.cson", + "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." + ], "scopeName": "source.objcpp", "fileTypes": [ "mm", diff --git a/extensions/objective-c/syntaxes/objective-c.tmLanguage.json b/extensions/objective-c/syntaxes/objective-c.tmLanguage.json index 2037028b0c34c21a81bdb653a5f93c6165227d28..a07e0ba7f437a3820b0bdfe31e18b9641ddf7f46 100644 --- a/extensions/objective-c/syntaxes/objective-c.tmLanguage.json +++ b/extensions/objective-c/syntaxes/objective-c.tmLanguage.json @@ -1,4 +1,9 @@ { + "information_for_contributors": [ + "This file has been converted from https://github.com/atom/language-objective-c/blob/master/grammars/objective-c.cson", + "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." + ], "scopeName": "source.objc", "fileTypes": [ "m", @@ -993,6 +998,5 @@ } ] } - }, - "version": "https://github.com/atom/language-objective-c/commit/0727e04544f3414c1c339cf15a39a05ea3938cb4" + } } \ No newline at end of file diff --git a/extensions/package.json b/extensions/package.json index ea392e28559a65a9ce9da5b83265e2bb10ca5616..29c909ce5cc247e993a8658dad9bfc744f14c9e2 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": "typescript@2.3.3" + "typescript": "2.4.1-insiders.20170615" }, "scripts": { "postinstall": "node ./postinstall" diff --git a/extensions/perl/.vscodeignore b/extensions/perl/.vscodeignore new file mode 100644 index 0000000000000000000000000000000000000000..77ab386fc7df4fa2461a8f1ac8457a1e6c9e808a --- /dev/null +++ b/extensions/perl/.vscodeignore @@ -0,0 +1 @@ +test/** \ No newline at end of file diff --git a/extensions/perl/syntaxes/perl.tmLanguage.json b/extensions/perl/syntaxes/perl.tmLanguage.json index 612c4796cbe7cc79ccd5b1c34dbdffc61139f955..4c4209c317b0a4d8803edcd3b141d1a17be69008 100644 --- a/extensions/perl/syntaxes/perl.tmLanguage.json +++ b/extensions/perl/syntaxes/perl.tmLanguage.json @@ -1,4 +1,9 @@ { + "information_for_contributors": [ + "This file has been converted from https://github.com/textmate/perl.tmbundle/blob/master/Syntaxes/Perl.plist", + "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." + ], "comment": "\n\tTODO:\tInclude RegExp syntax\n", "fileTypes": [ "pl", @@ -2541,6 +2546,5 @@ } }, "scopeName": "source.perl", - "uuid": "EDBFE125-6B1C-11D9-9189-000D93589AF6", - "version": "https://github.com/textmate/perl.tmbundle/commit/c0b7a4bd65882380522d82a60b536479a62b07c3" + "uuid": "EDBFE125-6B1C-11D9-9189-000D93589AF6" } \ No newline at end of file diff --git a/extensions/perl/syntaxes/perl6.tmLanguage.json b/extensions/perl/syntaxes/perl6.tmLanguage.json index a3024a11ae78ed0aaec6bb6da978ea0a2d37ebff..9ddfdf425090107a88296ee1797f5a8f6185ef10 100644 --- a/extensions/perl/syntaxes/perl6.tmLanguage.json +++ b/extensions/perl/syntaxes/perl6.tmLanguage.json @@ -1,4 +1,9 @@ { + "information_for_contributors": [ + "This file has been converted from https://github.com/textmate/perl.tmbundle/blob/master/Syntaxes/Perl%206.tmLanguage", + "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." + ], "fileTypes": [ "p6", "pl6", @@ -314,6 +319,5 @@ } }, "scopeName": "source.perl.6", - "uuid": "E685440C-0E20-4424-9693-864D5240A269", - "version": "https://github.com/textmate/perl.tmbundle/commit/d9841a0878239fa43f88c640f8d458590f97e8f5" + "uuid": "E685440C-0E20-4424-9693-864D5240A269" } \ No newline at end of file diff --git a/extensions/php/.vscodeignore b/extensions/php/.vscodeignore index 47cf365a0785e36c20eb55314ee0c06016fea193..b29072a6403ca2829b6f6e81764d8e6ce364540f 100644 --- a/extensions/php/.vscodeignore +++ b/extensions/php/.vscodeignore @@ -1 +1,6 @@ test/** +build/** +out/test/** +src/** +tsconfig.json +npm-shrinkwrap.json \ No newline at end of file diff --git a/extensions/php/build/update-grammar.js b/extensions/php/build/update-grammar.js new file mode 100644 index 0000000000000000000000000000000000000000..110fa3ac212f707f330321ac58eb72047db9e17c --- /dev/null +++ b/extensions/php/build/update-grammar.js @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +'use strict'; + +var updateGrammar = require('../../../build/npm/update-grammar'); + +function adaptInjectionScope(grammar) { + // we're using the HTML grammar from https://github.com/textmate/html.tmbundle which has moved away from source.js.embedded.html + let oldInjectionKey = "text.html.php - (meta.embedded | meta.tag), L:text.html.php meta.tag, L:source.js.embedded.html"; + let newInjectionKey = "text.html.php - (meta.embedded | meta.tag), L:text.html.php meta.tag, L:text.html.php source.js"; + + var injections = grammar.injections; + var injection = injections[oldInjectionKey]; + if (!injections) { + throw "Can not find PHP injection"; + } + delete injections[oldInjectionKey]; + injections[newInjectionKey] = injection; +} + +updateGrammar.update('atom/language-php', 'grammars/php.cson', './syntaxes/php.tmLanguage.json', adaptInjectionScope); + diff --git a/extensions/php/package.json b/extensions/php/package.json index a72bd56f64d0d5c51049aa1923ec127d1f30ba3b..e3b313bb3210f6122bea8482a6f0f357904153d9 100644 --- a/extensions/php/package.json +++ b/extensions/php/package.json @@ -115,7 +115,7 @@ "scripts": { "compile": "gulp compile-extension:php", "watch": "gulp watch-extension:php", - "update-grammar": "node ../../build/npm/update-grammar.js atom/language-php grammars/php.cson ./syntaxes/php.tmLanguage.json" + "update-grammar": "node ./build/update-grammar.js" }, "devDependencies": { "@types/node": "^7.0.4" diff --git a/extensions/php/package.nls.json b/extensions/php/package.nls.json index 85edb25a9bb95da8cc931007c88f905f160c4ab2..febdb3fb0ad470dc9732614fc85e7623cfce3fb3 100644 --- a/extensions/php/package.nls.json +++ b/extensions/php/package.nls.json @@ -1,4 +1,4 @@ -{ +{ "configuration.suggest.basic": "Configures if the built-in PHP language suggestions are enabled. The support suggests PHP globals and variables.", "configuration.validate.enable": "Enable/disable built-in PHP validation.", "configuration.validate.executablePath": "Points to the PHP executable.", diff --git a/extensions/php/src/features/validationProvider.ts b/extensions/php/src/features/validationProvider.ts index 41bae2878dc9d6e14a706d6d8ad11b005bd87d21..d02352898d29489084c7337a798c9b99bf7c2341 100644 --- a/extensions/php/src/features/validationProvider.ts +++ b/extensions/php/src/features/validationProvider.ts @@ -129,10 +129,10 @@ export default class PHPValidationProvider { if (section) { this.validationEnabled = section.get('validate.enable', true); let inspect = section.inspect('validate.executablePath'); - if (inspect.workspaceValue) { + if (inspect && inspect.workspaceValue) { this.executable = inspect.workspaceValue; this.executableIsUserDefined = false; - } else if (inspect.globalValue) { + } else if (inspect && inspect.globalValue) { this.executable = inspect.globalValue; this.executableIsUserDefined = true; } else { diff --git a/extensions/php/syntaxes/php.tmLanguage.json b/extensions/php/syntaxes/php.tmLanguage.json index d7e3a548ade642312fe3838fc74eb7abe1c695c9..8b457cf3c6f9c3ad216c03ac7cce8b2e12e96336 100644 --- a/extensions/php/syntaxes/php.tmLanguage.json +++ b/extensions/php/syntaxes/php.tmLanguage.json @@ -1,4 +1,10 @@ { + "information_for_contributors": [ + "This file has been converted from https://github.com/atom/language-php/blob/master/grammars/php.cson", + "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/atom/language-php/commit/e1290265f3d68316347e0ab2665686016b4b24b7", "scopeName": "text.html.php", "name": "PHP", "fileTypes": [ @@ -20,7 +26,7 @@ "foldingStartMarker": "(/\\*|\\{\\s*$|<<))", @@ -145,16 +151,137 @@ } ], "repository": { + "class-body": { + "patterns": [ + { + "match": "(?xi)\n\\b(use)\\s+\n([a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)\n((?:\\s*,\\s*[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)*)\n(?=\\s*;)", + "name": "meta.use.php", + "captures": { + "1": { + "name": "keyword.other.use.php" + }, + "2": { + "name": "support.class.php" + }, + "3": { + "patterns": [ + { + "match": "(?i)[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*", + "name": "support.class.php" + }, + { + "match": ",", + "name": "punctuation.separator.delimiter.php" + } + ] + } + } + }, + { + "begin": "(?i)\\buse\\b", + "beginCaptures": { + "0": { + "name": "keyword.other.use.php" + } + }, + "end": "}", + "endCaptures": { + "0": { + "name": "punctuation.definition.use.end.bracket.curly.php" + } + }, + "name": "meta.use.php", + "patterns": [ + { + "match": "(?xi)\n([a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)\n((?:\\s*,\\s*[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)*)", + "captures": { + "1": { + "name": "support.class.php" + }, + "2": { + "patterns": [ + { + "match": "(?i)[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*", + "name": "support.class.php" + }, + { + "match": ",", + "name": "punctuation.separator.delimiter.php" + } + ] + } + } + }, + { + "begin": "{", + "beginCaptures": { + "0": { + "name": "punctuation.definition.use.begin.bracket.curly.php" + } + }, + "end": "(?=})", + "contentName": "meta.use.body.php", + "patterns": [ + { + "include": "#scope-resolution" + }, + { + "match": "(?xi)\n\\b(as)\\s+\n([a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)\\b # Visibility modifier OR alias\n(?:\\s+([a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*))? # alias", + "captures": { + "1": { + "name": "keyword.other.use-as.php" + }, + "2": { + "patterns": [ + { + "match": "\\b(final|abstract|public|private|protected|static)\\b", + "name": "storage.modifier.php" + }, + { + "match": "[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*", + "name": "entity.other.alias.php" + } + ] + }, + "3": { + "name": "entity.other.alias.php" + } + } + }, + { + "match": "(?i)\\b(insteadof)\\s+([a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)", + "captures": { + "1": { + "name": "keyword.other.use-insteadof.php" + }, + "2": { + "name": "support.class.php" + } + } + }, + { + "match": ";", + "name": "punctuation.terminator.expression.php" + } + ] + } + ] + }, + { + "include": "#language" + } + ] + }, "class-builtin": { "patterns": [ { + "match": "(?xi)\n(\\\\)?\\b\n((APC|Append)Iterator|Array(Access|Iterator|Object)\n|Bad(Function|Method)CallException\n|(Caching|CallbackFilter)Iterator|Collator|Collectable|Cond|Countable|CURLFile\n|Date(Interval|Period|Time(Interface|Immutable|Zone)?)?|Directory(Iterator)?|DomainException\n|DOM(Attr|CdataSection|CharacterData|Comment|Document(Fragment)?|Element|EntityReference\n |Implementation|NamedNodeMap|Node(list)?|ProcessingInstruction|Text|XPath)\n|(Error)?Exception|EmptyIterator\n|finfo\n|Ev(Check|Child|Embed|Fork|Idle|Io|Loop|Periodic|Prepare|Signal|Stat|Timer|Watcher)?\n|Event(Base|Buffer(Event)?|SslContext|Http(Request|Connection)?|Config|DnsBase|Util|Listener)?\n|FANNConnection|(Filter|Filesystem)Iterator\n|Gender\\\\Gender|GlobIterator|Gmagick(Draw|Pixel)?\n|Haru(Annotation|Destination|Doc|Encoder|Font|Image|Outline|Page)\n|Http((Inflate|Deflate)?Stream|Message|Request(Pool)?|Response|QueryString)\n|HRTime\\\\(PerformanceCounter|StopWatch)\n|Intl(Calendar|((CodePoint|RuleBased)?Break|Parts)?Iterator|DateFormatter|TimeZone)\n|Imagick(Draw|Pixel(Iterator)?)?\n|InfiniteIterator|InvalidArgumentException|Iterator(Aggregate|Iterator)?\n|JsonSerializable\n|KTaglib_(MPEG_(File|AudioProperties)|Tag|ID3v2_(Tag|(AttachedPicture)?Frame))\n|Lapack|(Length|Locale|Logic)Exception|LimitIterator|Lua(Closure)?\n|Mongo(BinData|Client|Code|Collection|CommandCursor|Cursor(Exception)?|Date|DB(Ref)?|DeleteBatch\n |Grid(FS(Cursor|File)?)|Id|InsertBatch|Int(32|64)|Log|Pool|Regex|ResultException|Timestamp\n |UpdateBatch|Write(Batch|ConcernException))?\n|Memcache(d)?|MessageFormatter|MultipleIterator|Mutex\n|mysqli(_(driver|stmt|warning|result))?\n|MysqlndUh(Connection|PreparedStatement)\n|NoRewindIterator|Normalizer|NumberFormatter\n|OCI-(Collection|Lob)|OuterIterator|(OutOf(Bounds|Range)|Overflow)Exception\n|ParentIterator|PDO(Statement)?|Phar(Data|FileInfo)?|php_user_filter|Pool\n|QuickHash(Int(Set|StringHash)|StringIntHash)\n|Recursive(Array|Caching|Directory|Fallback|Filter|Iterator|Regex|Tree)?Iterator\n|Reflection(Class|Function(Abstract)?|Method|Object|Parameter|Property|(Zend)?Extension)?\n|RangeException|Reflector|RegexIterator|ResourceBundle|RuntimeException|RRD(Creator|Graph|Updater)\n|SAM(Connection|Message)|SCA(_(SoapProxy|LocalProxy))?\n|SDO_(DAS_(ChangeSummary|Data(Factory|Object)|Relational|Setting|XML(_Document)?)\n |Data(Factory|Object)|Exception|List|Model_(Property|ReflectionDataObject|Type)|Sequence)\n|SeekableIterator|Serializable|SessionHandler(Interface)?|SimpleXML(Iterator|Element)|SNMP\n|Soap(Client|Fault|Header|Param|Server|Var)\n|SphinxClient|Spoofchecker\n|Spl(DoublyLinkedList|Enum|File(Info|Object)|FixedArray|(Max|Min)?Heap|Observer|ObjectStorage\n |(Priority)?Queue|Stack|Subject|Type|TempFileObject)\n|SQLite(3(Result|Stmt)?|Database|Result|Unbuffered)\n|stdClass|streamWrapper|SVM(Model)?|Swish(Result(s)?|Search)?|Sync(Event|Mutex|ReaderWriter|Semaphore)\n|Thread(ed)?|tidy(Node)?|TokyoTyrant(Table|Iterator|Query)?|Transliterator|Traversable\n|UConverter|(Underflow|UnexpectedValue)Exception\n|V8Js(Exception)?|Varnish(Admin|Log|Stat)\n|Worker|Weak(Map|Ref)\n|XML(Diff\\\\(Base|DOM|File|Memory)|Reader|Writer)|XsltProcessor\n|Yaf_(Route_(Interface|Map|Regex|Rewrite|Simple|Supervar)\n |Action_Abstract|Application|Config_(Simple|Ini|Abstract)|Controller_Abstract\n |Dispatcher|Exception|Loader|Plugin_Abstract|Registry|Request_(Abstract|Simple|Http)\n |Response_Abstract|Router|Session|View_(Simple|Interface))\n|Yar_(Client(_Exception)?|Concurrent_Client|Server(_Exception)?)\n|ZipArchive|ZMQ(Context|Device|Poll|Socket)?)\n\\b", + "name": "support.class.builtin.php", "captures": { "1": { "name": "punctuation.separator.inheritance.php" } - }, - "match": "(?i)(\\\\)?\\b(st(dClass|reamWrapper)|R(RD(Graph|Creator|Updater)|untimeException|e(sourceBundle|cursive(RegexIterator|Ca(chingIterator|llbackFilterIterator)|TreeIterator|Iterator(Iterator)?|DirectoryIterator|FilterIterator|ArrayIterator)|flect(ion(Method|Class|ZendExtension|Object|P(arameter|roperty)|Extension|Function(Abstract)?)?|or)|gexIterator)|angeException)|G(ender\\Gender|lobIterator|magick(Draw|Pixel)?)|X(sltProcessor|ML(Reader|Diff\\\\(Memory|Base|DOM|File)|Writer)|SLTProcessor)|M(ysqlndUh(Connection|PreparedStatement)|ongo(Re(sultException|gex)|Grid(fsFile|FS(Cursor|File)?)|BinData|C(o(de|llection|mmandCursor)|ursor(Exception)?|lient)|Timestamp|I(n(sertBatch|t(32|64))|d)|D(B(Ref)?|eleteBatch|ate)|UpdateBatch|Pool|Write(Batch|ConcernException)|Log)?|u(tex|ltipleIterator)|e(ssageFormatter|mcache(d)?))|Bad(MethodCallException|FunctionCallException)|tidy(Node)?|S(ync(ReaderWriter|Mutex|Semaphore|Event)|impleXML(Iterator|Element)|oap(Server|Header|Client|Param|Var|Fault)|NMP|CA(_(SoapProxy|LocalProxy))?|p(hinxClient|oofchecker|l(M(inHeap|axHeap)|S(tack|ubject)|Heap|T(ype|empFileObject)|Ob(server|jectStorage)|DoublyLinkedList|PriorityQueue|Enum|Queue|Fi(le(Info|Object)|xedArray)))|e(ssionHandler(Interface)?|ekableIterator|rializable)|DO_(Model_(ReflectionDataObject|Type|Property)|Sequence|D(ata(Object|Factory)|AS_(Relational|XML(_Document)?|Setting|ChangeSummary|Data(Object|Factory)))|Exception|List)|wish(Result(s)?|Search)?|VM(Model)?|QLite(Result|3(Result|Stmt)?|Database|Unbuffered)|AM(Message|Connection))|H(RTime\\\\(StopWatch|PerformanceCounter)|ttp(Re(sponse|quest(Pool)?)|Message|InflateStream|DeflateStream|QueryString)|aru(Image|Outline|D(oc|estination)|Page|Encoder|Font|Annotation))|Ya(f_(R(oute(_(Re(write|gex)|Map|S(tatic|imple|upervar)|Interface)|r)|e(sponse_Abstract|quest_(Simple|Http|Abstract)|gistry))|Session|Con(troller_Abstract|fig_(Simple|Ini|Abstract))|Dispatcher|Plugin_Abstract|Exception|View_(Simple|Interface)|Loader|A(ction_Abstract|pplication))|r_(Server(_Exception)?|C(oncurrent_Client|lient(_Exception)?)))|N(o(RewindIterator|rmalizer)|umberFormatter)|C(o(nd|untable|ll(ectable|ator))|URLFile|a(chingIterator|llbackFilterIterator))|T(hread(ed)?|okyoTyrant(Table|Iterator|Query)?|ra(nsliterator|versable))|I(n(tl(RuleBasedBreakIterator|BreakIterator|C(odePointBreakIterator|alendar)|TimeZone|Iterator|DateFormatter|PartsIterator)|validArgumentException|finiteIterator)|terator(Iterator|Aggregate)?|magick(Draw|Pixel(Iterator)?)?)|php_user_filter|Z(MQ(Socket|Context|Device|Poll)?|ipArchive)|O(CI-(Collection|Lob)|ut(erIterator|Of(RangeException|BoundsException))|verflowException)|D(irectory(Iterator)?|omainException|OM(XPath|N(ode(list)?|amedNodeMap)|C(haracterData|omment|dataSection)|Text|Implementation|Document(Fragment)?|ProcessingInstruction|E(ntityReference|lement)|Attr)|ate(Time(I(nterface|mmutable)|Zone)?|Interval|Period))|U(n(derflowException|expectedValueException)|Converter)|JsonSerializable|finfo|P(har(Data|FileInfo)?|ool|DO(Statement)?|arentIterator)|E(v(S(tat|ignal)|Ch(ild|eck)|Timer|I(o|dle)|ent(B(uffer(Event)?|ase)|SslContext|Http(Request|Connection)?|Config|DnsBase|Util|Listener)?|P(eriodic|repare)|Embed|Fork|Watcher|Loop)?|rrorException|xception|mptyIterator)|V(8Js(Exception)?|arnish(Stat|Log|Admin))|KTaglib_(MPEG_(File|AudioProperties)|Tag|ID3v2_(Tag|Frame|AttachedPictureFrame))|QuickHash(StringIntHash|Int(S(tringHash|et)|Hash))|F(il(terIterator|esystemIterator)|ANNConnection)|mysqli(_(stmt|driver|warning|result))?|W(orker|eak(Map|ref))|L(imitIterator|o(cale|gicException)|ua(Closure)?|engthException|apack)|A(ppendIterator|PCIterator|rray(Iterator|Object|Access)))\\b", - "name": "support.class.builtin.php" + } } ] }, @@ -272,88 +399,67 @@ "constants": { "patterns": [ { - "begin": "(?xi)(?=\n\t\t\t (\n\t\t\t (\\\\[a-z_][a-z_0-9]*\\\\[a-z_][a-z_0-9\\\\]*)|\n\t\t\t ([a-z_][a-z_0-9]*\\\\[a-z_][a-z_0-9\\\\]*)\n\t\t\t )\n\t\t\t [^a-z_0-9\\\\])", - "end": "(?i)([a-z_][a-z_0-9]*)?(?=[^a-z0-9_\\\\])", - "endCaptures": { + "match": "(?i)\\b(TRUE|FALSE|NULL|__(FILE|DIR|FUNCTION|CLASS|METHOD|LINE|NAMESPACE)__|ON|OFF|YES|NO|NL|BR|TAB)\\b", + "name": "constant.language.php" + }, + { + "match": "(?x)\n(\\\\)?\\b\n(DEFAULT_INCLUDE_PATH\n|EAR_(INSTALL|EXTENSION)_DIR\n|E_(ALL|COMPILE_(ERROR|WARNING)|CORE_(ERROR|WARNING)|DEPRECATED|ERROR|NOTICE\n |PARSE|RECOVERABLE_ERROR|STRICT|USER_(DEPRECATED|ERROR|NOTICE|WARNING)|WARNING)\n|PHP_(ROUND_HALF_(DOWN|EVEN|ODD|UP)|(MAJOR|MINOR|RELEASE)_VERSION|MAXPATHLEN\n |BINDIR|SHLIB_SUFFIX|SYSCONFDIR|SAPI|CONFIG_FILE_(PATH|SCAN_DIR)\n |INT_(MAX|SIZE)|ZTS|OS|OUTPUT_HANDLER_(START|CONT|END)|DEBUG|DATADIR\n |URL_(SCHEME|HOST|USER|PORT|PASS|PATH|QUERY|FRAGMENT)|PREFIX\n |EXTRA_VERSION|EXTENSION_DIR|EOL|VERSION(_ID)?\n |WINDOWS_(NT_(SERVER|DOMAIN_CONTROLLER|WORKSTATION)\n |VERSION_(MAJOR|MINOR)|BUILD|SUITEMASK|SP_(MAJOR|MINOR)\n |PRODUCTTYPE|PLATFORM)\n |LIBDIR|LOCALSTATEDIR)\n|STD(ERR|IN|OUT)|ZEND_(DEBUG_BUILD|THREAD_SAFE))\n\\b", + "name": "support.constant.core.php", + "captures": { "1": { - "name": "constant.other.php" + "name": "punctuation.separator.inheritance.php" } - }, - "patterns": [ - { - "include": "#namespace" + } + }, + { + "match": "(?x)\n(\\\\)?\\b\n(__COMPILER_HALT_OFFSET__|AB(MON_(1|2|3|4|5|6|7|8|9|10|11|12)|DAY[1-7])\n|AM_STR|ASSERT_(ACTIVE|BAIL|CALLBACK_QUIET_EVAL|WARNING)|ALT_DIGITS\n|CASE_(UPPER|LOWER)|CHAR_MAX|CONNECTION_(ABORTED|NORMAL|TIMEOUT)|CODESET|COUNT_(NORMAL|RECURSIVE)\n|CREDITS_(ALL|DOCS|FULLPAGE|GENERAL|GROUP|MODULES|QA|SAPI)\n|CRYPT_(BLOWFISH|EXT_DES|MD5|SHA(256|512)|SALT_LENGTH|STD_DES)|CURRENCY_SYMBOL\n|D_(T_)?FMT|DATE_(ATOM|COOKIE|ISO8601|RFC(822|850|1036|1123|2822|3339)|RSS|W3C)\n|DAY_[1-7]|DECIMAL_POINT|DIRECTORY_SEPARATOR\n|ENT_(COMPAT|IGNORE|(NO)?QUOTES)|EXTR_(IF_EXISTS|OVERWRITE|PREFIX_(ALL|IF_EXISTS|INVALID|SAME)|REFS|SKIP)\n|ERA(_(D_(T_)?FMT)|T_FMT|YEAR)?|FRAC_DIGITS|GROUPING|HASH_HMAC|HTML_(ENTITIES|SPECIALCHARS)\n|INF|INFO_(ALL|CREDITS|CONFIGURATION|ENVIRONMENT|GENERAL|LICENSEMODULES|VARIABLES)\n|INI_(ALL|CANNER_(NORMAL|RAW)|PERDIR|SYSTEM|USER)|INT_(CURR_SYMBOL|FRAC_DIGITS)\n|LC_(ALL|COLLATE|CTYPE|MESSAGES|MONETARY|NUMERIC|TIME)|LOCK_(EX|NB|SH|UN)\n|LOG_(ALERT|AUTH(PRIV)?|CRIT|CRON|CONS|DAEMON|DEBUG|EMERG|ERR|INFO|LOCAL[1-7]|LPR|KERN|MAIL\n |NEWS|NODELAY|NOTICE|NOWAIT|ODELAY|PID|PERROR|WARNING|SYSLOG|UCP|USER)\n|M_(1_PI|SQRT(1_2|2|3|PI)|2_(SQRT)?PI|PI(_(2|4))?|E(ULER)?|LN(10|2|PI)|LOG(10|2)E)\n|MON_(1|2|3|4|5|6|7|8|9|10|11|12|DECIMAL_POINT|GROUPING|THOUSANDS_SEP)\n|N_(CS_PRECEDES|SEP_BY_SPACE|SIGN_POSN)|NAN|NEGATIVE_SIGN|NO(EXPR|STR)\n|P_(CS_PRECEDES|SEP_BY_SPACE|SIGN_POSN)|PM_STR|POSITIVE_SIGN\n|PATH(_SEPARATOR|INFO_(EXTENSION|(BASE|DIR|FILE)NAME))|RADIXCHAR\n|SEEK_(CUR|END|SET)|SORT_(ASC|DESC|LOCALE_STRING|REGULAR|STRING)|STR_PAD_(BOTH|LEFT|RIGHT)\n|T_FMT(_AMPM)?|THOUSEP|THOUSANDS_SEP\n|UPLOAD_ERR_(CANT_WRITE|EXTENSION|(FORM|INI)_SIZE|NO_(FILE|TMP_DIR)|OK|PARTIAL)\n|YES(EXPR|STR))\n\\b", + "name": "support.constant.std.php", + "captures": { + "1": { + "name": "punctuation.separator.inheritance.php" } - ] + } }, { - "begin": "(?=\\\\?[a-zA-Z_\\x{7f}-\\x{ff}])", - "end": "(?=[^\\\\a-zA-Z_\\x{7f}-\\x{ff}])", - "patterns": [ - { - "match": "(?i)\\b(TRUE|FALSE|NULL|__(FILE|DIR|FUNCTION|CLASS|METHOD|LINE|NAMESPACE)__|ON|OFF|YES|NO|NL|BR|TAB)\\b", - "name": "constant.language.php" - }, - { - "captures": { - "1": { - "name": "punctuation.separator.inheritance.php" - } - }, - "match": "(\\\\)?\\b(STD(IN|OUT|ERR)|ZEND_(THREAD_SAFE|DEBUG_BUILD)|DEFAULT_INCLUDE_PATH|P(HP_(R(OUND_HALF_(ODD|DOWN|UP|EVEN)|ELEASE_VERSION)|M(INOR_VERSION|A(XPATHLEN|JOR_VERSION))|BINDIR|S(HLIB_SUFFIX|YSCONFDIR|API)|CONFIG_FILE_(SCAN_DIR|PATH)|INT_(MAX|SIZE)|ZTS|O(S|UTPUT_HANDLER_(START|CONT|END))|D(EBUG|ATADIR)|URL_(SCHEME|HOST|USER|P(ORT|A(SS|TH))|QUERY|FRAGMENT)|PREFIX|E(XT(RA_VERSION|ENSION_DIR)|OL)|VERSION(_ID)?|WINDOWS_(NT_(SERVER|DOMAIN_CONTROLLER|WORKSTATION)|VERSION_(M(INOR|AJOR)|BUILD|S(UITEMASK|P_M(INOR|AJOR))|P(RODUCTTYPE|LATFORM)))|L(IBDIR|OCALSTATEDIR))|EAR_(INSTALL_DIR|EXTENSION_DIR))|E_(RECOVERABLE_ERROR|STRICT|NOTICE|CO(RE_(ERROR|WARNING)|MPILE_(ERROR|WARNING))|DEPRECATED|USER_(NOTICE|DEPRECATED|ERROR|WARNING)|PARSE|ERROR|WARNING|ALL))\\b", - "name": "support.constant.core.php" - }, - { - "captures": { - "1": { - "name": "punctuation.separator.inheritance.php" - } - }, - "match": "(\\\\)?\\b(RADIXCHAR|GROUPING|M(_(1_PI|SQRT(1_2|2|3|PI)|2_(SQRTPI|PI)|PI(_(2|4))?|E(ULER)?|L(N(10|2|PI)|OG(10E|2E)))|ON_(GROUPING|1(1|2|0)?|7|2|8|THOUSANDS_SEP|3|DECIMAL_POINT|9|4|5|6))|S(TR_PAD_(RIGHT|BOTH|LEFT)|ORT_(REGULAR|STRING|NUMERIC|DESC|LOCALE_STRING|ASC)|EEK_(SET|CUR|END))|H(TML_(SPECIALCHARS|ENTITIES)|ASH_HMAC)|YES(STR|EXPR)|N(_(S(IGN_POSN|EP_BY_SPACE)|CS_PRECEDES)|O(STR|EXPR)|EGATIVE_SIGN|AN)|C(R(YPT_(MD5|BLOWFISH|S(HA(256|512)|TD_DES|ALT_LENGTH)|EXT_DES)|NCYSTR|EDITS_(G(ROUP|ENERAL)|MODULES|SAPI|DOCS|QA|FULLPAGE|ALL))|HAR_MAX|O(NNECTION_(NORMAL|TIMEOUT|ABORTED)|DESET|UNT_(RECURSIVE|NORMAL))|URRENCY_SYMBOL|ASE_(UPPER|LOWER))|__COMPILER_HALT_OFFSET__|T(HOUS(EP|ANDS_SEP)|_FMT(_AMPM)?)|IN(T_(CURR_SYMBOL|FRAC_DIGITS)|I_(S(YSTEM|CANNER_(RAW|NORMAL))|USER|PERDIR|ALL)|F(O_(GENERAL|MODULES|C(REDITS|ONFIGURATION)|ENVIRONMENT|VARIABLES|LICENSE|ALL))?)|D(_(T_FMT|FMT)|IRECTORY_SEPARATOR|ECIMAL_POINT|A(Y_(1|7|2|3|4|5|6)|TE_(R(SS|FC(1(123|036)|2822|8(22|50)|3339))|COOKIE|ISO8601|W3C|ATOM)))|UPLOAD_ERR_(NO_(TMP_DIR|FILE)|CANT_WRITE|INI_SIZE|OK|PARTIAL|EXTENSION|FORM_SIZE)|P(M_STR|_(S(IGN_POSN|EP_BY_SPACE)|CS_PRECEDES)|OSITIVE_SIGN|ATH(_SEPARATOR|INFO_(BASENAME|DIRNAME|EXTENSION|FILENAME)))|E(RA(_(YEAR|T_FMT|D_(T_FMT|FMT)))?|XTR_(REFS|SKIP|IF_EXISTS|OVERWRITE|PREFIX_(SAME|I(NVALID|F_EXISTS)|ALL))|NT_(NOQUOTES|COMPAT|IGNORE|QUOTES))|FRAC_DIGITS|L(C_(M(ONETARY|ESSAGES)|NUMERIC|C(TYPE|OLLATE)|TIME|ALL)|O(G_(MAIL|SYSLOG|N(O(TICE|WAIT)|DELAY|EWS)|C(R(IT|ON)|ONS)|INFO|ODELAY|D(EBUG|AEMON)|U(SER|UCP)|P(ID|ERROR)|E(RR|MERG)|KERN|WARNING|L(OCAL(1|7|2|3|4|5|0|6)|PR)|A(UTH(PRIV)?|LERT))|CK_(SH|NB|UN|EX)))|A(M_STR|B(MON_(1(1|2|0)?|7|2|8|3|9|4|5|6)|DAY_(1|7|2|3|4|5|6))|SSERT_(BAIL|CALLBACK|QUIET_EVAL|WARNING|ACTIVE)|LT_DIGITS))\\b", - "name": "support.constant.std.php" - }, - { - "captures": { - "1": { - "name": "punctuation.separator.inheritance.php" - } - }, - "match": "(\\\\)?\\b(GLOB_(MARK|BRACE|NO(SORT|CHECK|ESCAPE)|ONLYDIR|ERR|AVAILABLE_FLAGS)|XML_(SAX_IMPL|HTML_DOCUMENT_NODE|N(OTATION_NODE|AMESPACE_DECL_NODE)|C(OMMENT_NODE|DATA_SECTION_NODE)|TEXT_NODE|OPTION_(SKIP_(TAGSTART|WHITE)|CASE_FOLDING|TARGET_ENCODING)|D(TD_NODE|OCUMENT_(NODE|TYPE_NODE|FRAG_NODE))|PI_NODE|E(RROR_(RECURSIVE_ENTITY_REF|MISPLACED_XML_PI|B(INARY_ENTITY_REF|AD_CHAR_REF)|SYNTAX|NO(NE|_(MEMORY|ELEMENTS))|TAG_MISMATCH|IN(CORRECT_ENCODING|VALID_TOKEN)|DUPLICATE_ATTRIBUTE|UN(CLOSED_(CDATA_SECTION|TOKEN)|DEFINED_ENTITY|KNOWN_ENCODING)|JUNK_AFTER_DOC_ELEMENT|PAR(TIAL_CHAR|AM_ENTITY_REF)|EXTERNAL_ENTITY_HANDLING|A(SYNC_ENTITY|TTRIBUTE_EXTERNAL_ENTITY_REF))|NTITY_(REF_NODE|NODE|DECL_NODE)|LEMENT_(NODE|DECL_NODE))|LOCAL_NAMESPACE|ATTRIBUTE_(N(MTOKEN(S)?|O(TATION|DE))|CDATA|ID(REF(S)?)?|DECL_NODE|EN(TITY|UMERATION)))|M(HASH_(RIPEMD(1(28|60)|256|320)|GOST|MD(2|4|5)|S(HA(1|2(24|56)|384|512)|NEFRU256)|HAVAL(1(28|92|60)|2(24|56))|CRC32(B)?|TIGER(1(28|60))?|WHIRLPOOL|ADLER32)|YSQL(_(BOTH|NUM|CLIENT_(SSL|COMPRESS|I(GNORE_SPACE|NTERACTIVE))|ASSOC)|I_(RE(PORT_(STRICT|INDEX|OFF|ERROR|ALL)|FRESH_(GRANT|MASTER|BACKUP_LOG|S(TATUS|LAVE)|HOSTS|T(HREADS|ABLES)|LOG)|AD_DEFAULT_(GROUP|FILE))|GROUP_FLAG|MULTIPLE_KEY_FLAG|B(INARY_FLAG|OTH|LOB_FLAG)|S(T(MT_ATTR_(CURSOR_TYPE|UPDATE_MAX_LENGTH|PREFETCH_ROWS)|ORE_RESULT)|E(RVER_QUERY_(NO_(GOOD_INDEX_USED|INDEX_USED)|WAS_SLOW)|T_(CHARSET_NAME|FLAG)))|N(O(_D(EFAULT_VALUE_FLAG|ATA)|T_NULL_FLAG)|UM(_FLAG)?)|C(URSOR_TYPE_(READ_ONLY|SCROLLABLE|NO_CURSOR|FOR_UPDATE)|LIENT_(SSL|NO_SCHEMA|COMPRESS|I(GNORE_SPACE|NTERACTIVE)|FOUND_ROWS))|T(YPE_(GEOMETRY|MEDIUM_BLOB|B(IT|LOB)|S(HORT|TRING|ET)|YEAR|N(ULL|EWD(ECIMAL|ATE))|CHAR|TI(ME(STAMP)?|NY(_BLOB)?)|INT(24|ERVAL)|D(OUBLE|ECIMAL|ATE(TIME)?)|ENUM|VAR_STRING|FLOAT|LONG(_BLOB|LONG)?)|IMESTAMP_FLAG)|INIT_COMMAND|ZEROFILL_FLAG|O(N_UPDATE_NOW_FLAG|PT_(NET_(READ_BUFFER_SIZE|CMD_BUFFER_SIZE)|CONNECT_TIMEOUT|INT_AND_FLOAT_NATIVE|LOCAL_INFILE))|D(EBUG_TRACE_ENABLED|ATA_TRUNCATED)|U(SE_RESULT|N(SIGNED_FLAG|IQUE_KEY_FLAG))|P(RI_KEY_FLAG|ART_KEY_FLAG)|ENUM_FLAG|A(S(SOC|YNC)|UTO_INCREMENT_FLAG)))|CRYPT_(R(C(2|6)|IJNDAEL_(1(28|92)|256)|AND)|GOST|XTEA|M(ODE_(STREAM|NOFB|C(BC|FB)|OFB|ECB)|ARS)|BLOWFISH(_COMPAT)?|S(ERPENT|KIPJACK|AFER(128|PLUS|64))|C(RYPT|AST_(128|256))|T(RIPLEDES|HREEWAY|WOFISH)|IDEA|3DES|DE(S|CRYPT|V_(RANDOM|URANDOM))|PANAMA|EN(CRYPT|IGNA)|WAKE|LOKI97|ARCFOUR(_IV)?))|S(TREAM_(REPORT_ERRORS|M(UST_SEEK|KDIR_RECURSIVE)|BUFFER_(NONE|FULL|LINE)|S(HUT_(RD(WR)?|WR)|OCK_(R(DM|AW)|S(TREAM|EQPACKET)|DGRAM)|ERVER_(BIND|LISTEN))|NOTIFY_(RE(SOLVE|DIRECTED)|MIME_TYPE_IS|SEVERITY_(INFO|ERR|WARN)|CO(MPLETED|NNECT)|PROGRESS|F(ILE_SIZE_IS|AILURE)|AUTH_RE(SULT|QUIRED))|C(RYPTO_METHOD_(SSLv(2(_(SERVER|CLIENT)|3_(SERVER|CLIENT))|3_(SERVER|CLIENT))|TLS_(SERVER|CLIENT))|LIENT_(CONNECT|PERSISTENT|ASYNC_CONNECT)|AST_(FOR_SELECT|AS_STREAM))|I(GNORE_URL|S_URL|PPROTO_(RAW|TCP|I(CMP|P)|UDP))|O(OB|PTION_(READ_(BUFFER|TIMEOUT)|BLOCKING|WRITE_BUFFER))|U(RL_STAT_(QUIET|LINK)|SE_PATH)|P(EEK|F_(INET(6)?|UNIX))|ENFORCE_SAFE_MODE|FILTER_(READ|WRITE|ALL))|UNFUNCS_RET_(STRING|TIMESTAMP|DOUBLE)|QLITE(_(R(OW|EADONLY)|MIS(MATCH|USE)|B(OTH|USY)|SCHEMA|N(O(MEM|T(FOUND|ADB)|LFS)|UM)|C(O(RRUPT|NSTRAINT)|ANTOPEN)|TOOBIG|I(NTER(RUPT|NAL)|OERR)|OK|DONE|P(ROTOCOL|ERM)|E(RROR|MPTY)|F(ORMAT|ULL)|LOCKED|A(BORT|SSOC|UTH))|3_(B(OTH|LOB)|NU(M|LL)|TEXT|INTEGER|OPEN_(READ(ONLY|WRITE)|CREATE)|FLOAT|ASSOC)))|CURL(M(SG_DONE|_(BAD_(HANDLE|EASY_HANDLE)|CALL_MULTI_PERFORM|INTERNAL_ERROR|O(UT_OF_MEMORY|K)))|SSH_AUTH_(HOST|NONE|DEFAULT|P(UBLICKEY|ASSWORD)|KEYBOARD)|CLOSEPOLICY_(SLOWEST|CALLBACK|OLDEST|LEAST_(RECENTLY_USED|TRAFFIC))|_(HTTP_VERSION_(1_(1|0)|NONE)|NETRC_(REQUIRED|IGNORED|OPTIONAL)|TIMECOND_(IF(MODSINCE|UNMODSINCE)|LASTMOD)|IPRESOLVE_(V(4|6)|WHATEVER)|VERSION_(SSL|IPV6|KERBEROS4|LIBZ))|INFO_(RE(DIRECT_(COUNT|TIME)|QUEST_SIZE)|S(SL_VERIFYRESULT|TARTTRANSFER_TIME|IZE_(DOWNLOAD|UPLOAD)|PEED_(DOWNLOAD|UPLOAD))|H(TTP_CODE|EADER_(SIZE|OUT))|NAMELOOKUP_TIME|C(ON(NECT_TIME|TENT_(TYPE|LENGTH_(DOWNLOAD|UPLOAD)))|ERTINFO)|TOTAL_TIME|PR(IVATE|ETRANSFER_TIME)|EFFECTIVE_URL|FILETIME)|OPT_(R(E(SUME_FROM|TURNTRANSFER|DIR_PROTOCOLS|FERER|AD(DATA|FUNCTION))|AN(GE|DOM_FILE))|MAX(REDIRS|CONNECTS)|B(INARYTRANSFER|UFFERSIZE)|S(S(H_(HOST_PUBLIC_KEY_MD5|P(RIVATE_KEYFILE|UBLIC_KEYFILE)|AUTH_TYPES)|L(CERT(TYPE|PASSWD)?|_(CIPHER_LIST|VERIFY(HOST|PEER))|ENGINE(_DEFAULT)?|VERSION|KEY(TYPE|PASSWD)?))|TDERR)|H(TTP(GET|HEADER|200ALIASES|_VERSION|PROXYTUNNEL|AUTH)|EADER(FUNCTION)?)|N(O(BODY|SIGNAL|PROGRESS)|ETRC)|C(RLF|O(NNECTTIMEOUT(_MS)?|OKIE(SESSION|JAR|FILE)?)|USTOMREQUEST|ERTINFO|LOSEPOLICY|A(INFO|PATH))|T(RANSFERTEXT|CP_NODELAY|IME(CONDITION|OUT(_MS)?|VALUE))|I(N(TERFACE|FILE(SIZE)?)|PRESOLVE)|DNS_(CACHE_TIMEOUT|USE_GLOBAL_CACHE)|U(RL|SER(PWD|AGENT)|NRESTRICTED_AUTH|PLOAD)|P(R(IVATE|O(GRESSFUNCTION|XY(TYPE|USERPWD|PORT|AUTH)?|TOCOLS))|O(RT|ST(REDIR|QUOTE|FIELDS)?)|UT)|E(GDSOCKET|NCODING)|VERBOSE|K(RB4LEVEL|EYPASSWD)|QUOTE|F(RESH_CONNECT|TP(SSLAUTH|_(S(SL|KIP_PASV_IP)|CREATE_MISSING_DIRS|USE_EP(RT|SV)|FILEMETHOD)|PORT|LISTONLY|APPEND)|ILE(TIME)?|O(RBID_REUSE|LLOWLOCATION)|AILONERROR)|WRITE(HEADER|FUNCTION)|LOW_SPEED_(TIME|LIMIT)|AUTOREFERER)|PRO(XY_(SOCKS(4|5)|HTTP)|TO_(S(CP|FTP)|HTTP(S)?|T(ELNET|FTP)|DICT|F(TP(S)?|ILE)|LDAP(S)?|ALL))|E_(RE(CV_ERROR|AD_ERROR)|GOT_NOTHING|MALFORMAT_USER|BAD_(C(ONTENT_ENCODING|ALLING_ORDER)|PASSWORD_ENTERED|FUNCTION_ARGUMENT)|S(S(H|L_(C(IPHER|ONNECT_ERROR|ERTPROBLEM|ACERT)|PEER_CERTIFICATE|ENGINE_(SETFAILED|NOTFOUND)))|HARE_IN_USE|END_ERROR)|HTTP_(RANGE_ERROR|NOT_FOUND|PO(RT_FAILED|ST_ERROR))|COULDNT_(RESOLVE_(HOST|PROXY)|CONNECT)|T(OO_MANY_REDIRECTS|ELNET_OPTION_SYNTAX)|O(BSOLETE|UT_OF_MEMORY|PERATION_TIMEOUTED|K)|U(RL_MALFORMAT(_USER)?|N(SUPPORTED_PROTOCOL|KNOWN_TELNET_OPTION))|PARTIAL_FILE|F(TP_(BAD_DOWNLOAD_RESUME|SSL_FAILED|C(OULDNT_(RETR_FILE|GET_SIZE|S(TOR_FILE|ET_(BINARY|ASCII))|USE_REST)|ANT_(RECONNECT|GET_HOST))|USER_PASSWORD_INCORRECT|PORT_FAILED|QUOTE_ERROR|W(RITE_ERROR|EIRD_(SERVER_REPLY|227_FORMAT|USER_REPLY|PAS(S_REPLY|V_REPLY)))|ACCESS_DENIED)|ILE(SIZE_EXCEEDED|_COULDNT_READ_FILE)|UNCTION_NOT_FOUND|AILED_INIT)|WRITE_ERROR|L(IBRARY_NOT_FOUND|DAP_(SEARCH_FAILED|CANNOT_BIND|INVALID_URL))|ABORTED_BY_CALLBACK)|VERSION_NOW|FTP(METHOD_(MULTICWD|SINGLECWD|NOCWD)|SSL_(NONE|CONTROL|TRY|ALL)|AUTH_(SSL|TLS|DEFAULT))|AUTH_(GSSNEGOTIATE|BASIC|NTLM|DIGEST|ANY(SAFE)?))|I(MAGETYPE_(GIF|XBM|BMP|SWF|COUNT|TIFF_(MM|II)|I(CO|FF)|UNKNOWN|J(B2|P(X|2|C|EG(2000)?))|P(SD|NG)|WBMP)|NPUT_(REQUEST|GET|SE(RVER|SSION)|COOKIE|POST|ENV)|CONV_(MIME_DECODE_(STRICT|CONTINUE_ON_ERROR)|IMPL|VERSION))|D(NS_(MX|S(RV|OA)|HINFO|N(S|APTR)|CNAME|TXT|PTR|A(NY|LL|AAA|6)?)|OM(STRING_SIZE_ERR|_(SYNTAX_ERR|HIERARCHY_REQUEST_ERR|N(O(_(MODIFICATION_ALLOWED_ERR|DATA_ALLOWED_ERR)|T_(SUPPORTED_ERR|FOUND_ERR))|AMESPACE_ERR)|IN(DEX_SIZE_ERR|USE_ATTRIBUTE_ERR|VALID_(MODIFICATION_ERR|STATE_ERR|CHARACTER_ERR|ACCESS_ERR))|PHP_ERR|VALIDATION_ERR|WRONG_DOCUMENT_ERR)))|JSON_(HEX_(TAG|QUOT|A(MP|POS))|NUMERIC_CHECK|ERROR_(S(YNTAX|TATE_MISMATCH)|NONE|CTRL_CHAR|DEPTH|UTF8)|FORCE_OBJECT)|P(REG_(RECURSION_LIMIT_ERROR|GREP_INVERT|BA(CKTRACK_LIMIT_ERROR|D_UTF8_(OFFSET_ERROR|ERROR))|S(PLIT_(NO_EMPTY|OFFSET_CAPTURE|DELIM_CAPTURE)|ET_ORDER)|NO_ERROR|INTERNAL_ERROR|OFFSET_CAPTURE|PATTERN_ORDER)|SFS_(PASS_ON|ERR_FATAL|F(EED_ME|LAG_(NORMAL|FLUSH_(CLOSE|INC))))|CRE_VERSION|OSIX_(R_OK|X_OK|S_IF(REG|BLK|SOCK|CHR|IFO)|F_OK|W_OK))|F(NM_(NOESCAPE|CASEFOLD|P(ERIOD|ATHNAME))|IL(TER_(REQUIRE_(SCALAR|ARRAY)|SANITIZE_(MAGIC_QUOTES|S(TRI(NG|PPED)|PECIAL_CHARS)|NUMBER_(INT|FLOAT)|URL|E(MAIL|NCODED)|FULL_SPECIAL_CHARS)|NULL_ON_FAILURE|CALLBACK|DEFAULT|UNSAFE_RAW|VALIDATE_(REGEXP|BOOLEAN|I(NT|P)|URL|EMAIL|FLOAT)|F(ORCE_ARRAY|LAG_(S(CHEME_REQUIRED|TRIP_(BACKTICK|HIGH|LOW))|HOST_REQUIRED|NO(NE|_(RES_RANGE|PRIV_RANGE|ENCODE_QUOTES))|IPV(4|6)|PATH_REQUIRED|E(MPTY_STRING_NULL|NCODE_(HIGH|LOW|AMP))|QUERY_REQUIRED|ALLOW_(SCIENTIFIC|HEX|THOUSAND|OCTAL|FRACTION))))|E(_(BINARY|SKIP_EMPTY_LINES|NO_DEFAULT_CONTEXT|TEXT|IGNORE_NEW_LINES|USE_INCLUDE_PATH|APPEND)|INFO_(RAW|MIME(_(TYPE|ENCODING))?|SYMLINK|NONE|CONTINUE|DEVICES|PRESERVE_ATIME)))|ORCE_(GZIP|DEFLATE))|LIBXML_(XINCLUDE|N(SCLEAN|O(XMLDECL|BLANKS|NET|CDATA|E(RROR|MPTYTAG|NT)|WARNING))|COMPACT|D(TD(VALID|LOAD|ATTR)|OTTED_VERSION)|PARSEHUGE|ERR_(NONE|ERROR|FATAL|WARNING)|VERSION|LOADED_VERSION))\\b", - "name": "support.constant.ext.php" - }, - { - "captures": { - "1": { - "name": "punctuation.separator.inheritance.php" - } - }, - "match": "(\\\\)?\\bT_(RE(TURN|QUIRE(_ONCE)?)|G(OTO|LOBAL)|XOR_EQUAL|M(INUS_EQUAL|OD_EQUAL|UL_EQUAL|ETHOD_C|L_COMMENT)|B(REAK|OOL(_CAST|EAN_(OR|AND))|AD_CHARACTER)|S(R(_EQUAL)?|T(RING(_(CAST|VARNAME))?|A(RT_HEREDOC|TIC))|WITCH|L(_EQUAL)?)|HALT_COMPILER|N(S_(SEPARATOR|C)|UM_STRING|EW|AMESPACE)|C(HARACTER|O(MMENT|N(ST(ANT_ENCAPSED_STRING)?|CAT_EQUAL|TINUE))|URLY_OPEN|L(O(SE_TAG|NE)|ASS(_C)?)|A(SE|TCH))|T(RY|HROW)|I(MPLEMENTS|S(SET|_(GREATER_OR_EQUAL|SMALLER_OR_EQUAL|NOT_(IDENTICAL|EQUAL)|IDENTICAL|EQUAL))|N(STANCEOF|C(LUDE(_ONCE)?)?|T(_CAST|ERFACE)|LINE_HTML)|F)|O(R_EQUAL|BJECT_(CAST|OPERATOR)|PEN_TAG(_WITH_ECHO)?|LD_FUNCTION)|D(NUMBER|I(R|V_EQUAL)|O(C_COMMENT|UBLE_(C(OLON|AST)|ARROW)|LLAR_OPEN_CURLY_BRACES)?|E(C(LARE)?|FAULT))|U(SE|NSET(_CAST)?)|P(R(I(NT|VATE)|OTECTED)|UBLIC|LUS_EQUAL|AAMAYIM_NEKUDOTAYIM)|E(X(TENDS|IT)|MPTY|N(CAPSED_AND_WHITESPACE|D(SWITCH|_HEREDOC|IF|DECLARE|FOR(EACH)?|WHILE))|CHO|VAL|LSE(IF)?)|VAR(IABLE)?|F(I(NAL|LE)|OR(EACH)?|UNC(_C|TION))|WHI(TESPACE|LE)|L(NUMBER|I(ST|NE)|OGICAL_(XOR|OR|AND))|A(RRAY(_CAST)?|BSTRACT|S|ND_EQUAL))\\b", - "name": "support.constant.parser-token.php" - }, - { - "comment": "In PHP, any identifier which is not a variable is taken to be a constant.\n \t\t\t\tHowever, if there is no constant defined with the given name then a notice\n \t\t\t\tis generated and the constant is assumed to have the value of its name.", - "match": "[a-zA-Z_\\x{7f}-\\x{ff}][a-zA-Z0-9_\\x{7f}-\\x{ff}]*", - "name": "constant.other.php" + "match": "(?x)\n(\\\\)?\\b\n(GLOB_(MARK|BRACE|NO(SORT|CHECK|ESCAPE)|ONLYDIR|ERR|AVAILABLE_FLAGS)\n|XML_(SAX_IMPL|(DTD|DOCUMENT(_(FRAG|TYPE))?|HTML_DOCUMENT|NOTATION|NAMESPACE_DECL|PI|COMMENT|DATA_SECTION|TEXT)_NODE\n |OPTION_(SKIP_(TAGSTART|WHITE)|CASE_FOLDING|TARGET_ENCODING)\n |ERROR_((BAD_CHAR|(ATTRIBUTE_EXTERNAL|BINARY|PARAM|RECURSIVE)_ENTITY)_REF|MISPLACED_XML_PI|SYNTAX|NONE\n |NO_(MEMORY|ELEMENTS)|TAG_MISMATCH|INCORRECT_ENCODING|INVALID_TOKEN|DUPLICATE_ATTRIBUTE\n |UNCLOSED_(CDATA_SECTION|TOKEN)|UNDEFINED_ENTITY|UNKNOWN_ENCODING|JUNK_AFTER_DOC_ELEMENT\n |PARTIAL_CHAR|EXTERNAL_ENTITY_HANDLING|ASYNC_ENTITY)\n |ENTITY_(((REF|DECL)_)?NODE)|ELEMENT(_DECL)?_NODE|LOCAL_NAMESPACE|ATTRIBUTE_(NMTOKEN(S)?|NOTATION|NODE)\n |CDATA|ID(REF(S)?)?|DECL_NODE|ENTITY|ENUMERATION)\n|MHASH_(RIPEMD(128|160|256|320)|GOST|MD(2|4|5)|SHA(1|224|256|384|512)|SNEFRU256|HAVAL(128|160|192|224|256)\n |CRC23(B)?|TIGER(128|160)?|WHIRLPOOL|ADLER32)\n|MYSQL_(BOTH|NUM|CLIENT_(SSL|COMPRESS|IGNORE_SPACE|INTERACTIVE|ASSOC))\n|MYSQLI_(REPORT_(STRICT|INDEX|OFF|ERROR|ALL)|REFRESH_(GRANT|MASTER|BACKUP_LOG|STATUS|SLAVE|HOSTS|THREADS|TABLES|LOG)\n |READ_DEFAULT_(FILE|GROUP)|(GROUP|MULTIPLE_KEY|BINARY|BLOB)_FLAG|BOTH\n |STMT_ATTR_(CURSOR_TYPE|UPDATE_MAX_LENGTH|PREFETCH_ROWS)|STORE_RESULT\n |SERVER_QUERY_(NO_((GOOD_)?INDEX_USED)|WAS_SLOW)|SET_(CHARSET_NAME|FLAG)\n |NO_(DEFAULT_VALUE_FLAG|DATA)|NOT_NULL_FLAG|NUM(_FLAG)?\n |CURSOR_TYPE_(READ_ONLY|SCROLLABLE|NO_CURSOR|FOR_UPDATE)\n |CLIENT_(SSL|NO_SCHEMA|COMPRESS|IGNORE_SPACE|INTERACTIVE|FOUND_ROWS)\n |TYPE_(GEOMETRY|((MEDIUM|LONG|TINY)_)?BLOB|BIT|SHORT|STRING|SET|YEAR|NULL|NEWDECIMAL|NEWDATE|CHAR\n |TIME(STAMP)?|TINY|INT24|INTERVAL|DOUBLE|DECIMAL|DATE(TIME)?|ENUM|VAR_STRING|FLOAT|LONG(LONG)?)\n |TIME_STAMP_FLAG|INIT_COMMAND|ZEROFILL_FLAG|ON_UPDATE_NOW_FLAG\n |OPT_(NET_((CMD|READ)_BUFFER_SIZE)|CONNECT_TIMEOUT|INT_AND_FLOAT_NATIVE|LOCAL_INFILE)\n |DEBUG_TRACE_ENABLED|DATA_TRUNCATED|USE_RESULT|(ENUM|(PART|PRI|UNIQUE)_KEY|UNSIGNED)_FLAG\n |ASSOC|ASYNC|AUTO_INCREMENT_FLAG)\n|MCRYPT_(RC(2|6)|RIJNDAEL_(128|192|256)|RAND|GOST|XTEA|MODE_(STREAM|NOFB|CBC|CFB|OFB|ECB)|MARS\n |BLOWFISH(_COMPAT)?|SERPENT|SKIPJACK|SAFER(64|128|PLUS)|CRYPT|CAST_(128|256)|TRIPLEDES|THREEWAY\n |TWOFISH|IDEA|(3)?DES|DECRYPT|DEV_(U)?RANDOM|PANAMA|ENCRYPT|ENIGNA|WAKE|LOKI97|ARCFOUR(_IV)?)\n|STREAM_(REPORT_ERRORS|MUST_SEEK|MKDIR_RECURSIVE|BUFFER_(NONE|FULL|LINE)|SHUT_(RD)?WR\n |SOCK_(RDM|RAW|STREAM|SEQPACKET|DGRAM)|SERVER_(BIND|LISTEN)\n |NOTIFY_(REDIRECTED|RESOLVE|MIME_TYPE_IS|SEVERITY_(INFO|ERR|WARN)|COMPLETED|CONNECT|PROGRESS\n |FILE_SIZE_IS|FAILURE|AUTH_(REQUIRED|RESULT))\n |CRYPTO_METHOD_((SSLv2(3)?|SSLv3|TLS)_(CLIENT|SERVER))|CLIENT_((ASYNC_)?CONNECT|PERSISTENT)\n |CAST_(AS_STREAM|FOR_SELECT)|(IGNORE|IS)_URL|IPPROTO_(RAW|TCP|ICMP|IP|UDP)|OOB\n |OPTION_(READ_(BUFFER|TIMEOUT)|BLOCKING|WRITE_BUFFER)|URL_STAT_(LINK|QUIET)|USE_PATH\n |PEEK|PF_(INET(6)?|UNIX)|ENFORCE_SAFE_MODE|FILTER_(ALL|READ|WRITE))\n|SUNFUNCS_RET_(DOUBLE|STRING|TIMESTAMP)\n|SQLITE_(READONLY|ROW|MISMATCH|MISUSE|BOTH|BUSY|SCHEMA|NOMEM|NOTFOUND|NOTADB|NOLFS|NUM|CORRUPT\n |CONSTRAINT|CANTOPEN|TOOBIG|INTERRUPT|INTERNAL|IOERR|OK|DONE|PROTOCOL|PERM|ERROR|EMPTY\n |FORMAT|FULL|LOCKED|ABORT|ASSOC|AUTH)\n|SQLITE3_(BOTH|BLOB|NUM|NULL|TEXT|INTEGER|OPEN_(READ(ONLY|WRITE)|CREATE)|FLOAT_ASSOC)\n|CURL(M_(BAD_((EASY)?HANDLE)|CALL_MULTI_PERFORM|INTERNAL_ERROR|OUT_OF_MEMORY|OK)\n |MSG_DONE|SSH_AUTH_(HOST|NONE|DEFAULT|PUBLICKEY|PASSWORD|KEYBOARD)\n |CLOSEPOLICY_(SLOWEST|CALLBACK|OLDEST|LEAST_(RECENTLY_USED|TRAFFIC)\n |INFO_(REDIRECT_(COUNT|TIME)|REQUEST_SIZE|SSL_VERIFYRESULT|STARTTRANSFER_TIME\n |(SIZE|SPEED)_(DOWNLOAD|UPLOAD)|HTTP_CODE|HEADER_(OUT|SIZE)|NAMELOOKUP_TIME\n |CONNECT_TIME|CONTENT_(TYPE|LENGTH_(DOWNLOAD|UPLOAD))|CERTINFO|TOTAL_TIME\n |PRIVATE|PRETRANSFER_TIME|EFFECTIVE_URL|FILETIME)\n |OPT_(RESUME_FROM|RETURNTRANSFER|REDIR_PROTOCOLS|REFERER|READ(DATA|FUNCTION)|RANGE|RANDOM_FILE\n |MAX(CONNECTS|REDIRS)|BINARYTRANSFER|BUFFERSIZE\n |SSH_(HOST_PUBLIC_KEY_MD5|(PRIVATE|PUBLIC)_KEYFILE)|AUTH_TYPES)\n |SSL(CERT(TYPE|PASSWD)?|ENGINE(_DEFAULT)?|VERSION|KEY(TYPE|PASSWD)?)\n |SSL_(CIPHER_LIST|VERIFY(HOST|PEER))\n |STDERR|HTTP(GET|HEADER|200ALIASES|_VERSION|PROXYTUNNEL|AUTH)\n |HEADER(FUNCTION)?|NO(BODY|SIGNAL|PROGRESS)|NETRC|CRLF|CONNECTTIMEOUT(_MS)?\n |COOKIE(SESSION|JAR|FILE)?|CUSTOMREQUEST|CERTINFO|CLOSEPOLICY|CA(INFO|PATH)|TRANSFERTEXT\n |TCP_NODELAY|TIME(CONDITION|OUT(_MS)?|VALUE)|INTERFACE|INFILE(SIZE)?|IPRESOLVE\n |DNS_(CACHE_TIMEOUT|USE_GLOBAL_CACHE)|URL|USER(AGENT|PWD)|UNRESTRICTED_AUTH|UPLOAD\n |PRIVATE|PROGRESSFUNCTION|PROXY(TYPE|USERPWD|PORT|AUTH)?|PROTOCOLS|PORT\n |POST(REDIR|QUOTE|FIELDS)?|PUT|EGDSOCKET|ENCODING|VERBOSE|KRB4LEVEL|KEYPASSWD|QUOTE|FRESH_CONNECT\n |FTP(APPEND|LISTONLY|PORT|SSLAUTH)\n |FTP_(SSL|SKIP_PASV_IP|CREATE_MISSING_DIRS|USE_EP(RT|SV)|FILEMETHOD)\n |FILE(TIME)?|FORBID_REUSE|FOLLOWLOCATION|FAILONERROR|WRITE(FUNCTION|HEADER)|LOW_SPEED_(LIMIT|TIME)\n |AUTOREFERER)\n |PROXY_(HTTP|SOCKS(4|5))|PROTO_(SCP|SFTP|HTTP(S)?|TELNET|TFTP|DICT|FTP(S)?|FILE|LDAP(S)?|ALL)\n |E_((RECV|READ)_ERROR|GOT_NOTHING|MALFORMAT_USER\n |BAD_(CONTENT_ENCODING|CALLING_ORDER|PASSWORD_ENTERED|FUNCTION_ARGUMENT)\n |SSH|SSL_(CIPHER|CONNECT_ERROR|CERTPROBLEM|CACERT|PEER_CERTIFICATE|ENGINE_(NOTFOUND|SETFAILED))\n |SHARE_IN_USE|SEND_ERROR|HTTP_(RANGE_ERROR|NOT_FOUND|PORT_FAILED|POST_ERROR)\n |COULDNT_(RESOLVE_(HOST|PROXY)|CONNECT)|TOO_MANY_REDIRECTS|TELNET_OPTION_SYNTAX|OBSOLETE\n |OUT_OF_MEMORY|OPERATION|TIMEOUTED|OK|URL_MALFORMAT(_USER)?|UNSUPPORTED_PROTOCOL\n |UNKNOWN_TELNET_OPTION|PARTIAL_FILE\n |FTP_(BAD_DOWNLOAD_RESUME|SSL_FAILED|COULDNT_(RETR_FILE|GET_SIZE|STOR_FILE|SET_(BINARY|ASCII)|USE_REST)\n |CANT_(GET_HOST|RECONNECT)|USER_PASSWORD_INCORRECT|PORT_FAILED|QUOTE_ERROR|WRITE_ERROR\n |WEIRD_((PASS|PASV|SERVER|USER)_REPLY|227_FORMAT)|ACCESS_DENIED)\n |FILESIZE_EXCEEDED|FILE_COULDNT_READ_FILE|FUNCTION_NOT_FOUND|FAILED_INIT|WRITE_ERROR|LIBRARY_NOT_FOUND\n |LDAP_(SEARCH_FAILED|CANNOT_BIND|INVALID_URL)|ABORTED_BY_CALLBACK)\n |VERSION_NOW\n |FTP(METHOD_(MULTI|SINGLE|NO)CWD|SSL_(ALL|NONE|CONTROL|TRY)|AUTH_(DEFAULT|SSL|TLS))\n |AUTH_(ANY(SAFE)?|BASIC|DIGEST|GSSNEGOTIATE|NTLM))\n|CURL_(HTTP_VERSION_(1_(0|1)|NONE)|NETRC_(REQUIRED|IGNORED|OPTIONAL)|TIMECOND_(IF(UN)?MODSINCE|LASTMOD)\n |IPRESOLVE_(V(4|6)|WHATEVER)|VERSION_(SSL|IPV6|KERBEROS4|LIBZ))\n|IMAGETYPE_(GIF|XBM|BMP|SWF|COUNT|TIFF_(MM|II)|ICO|IFF|UNKNOWN|JB2|JPX|JP2|JPC|JPEG(2000)?|PSD|PNG|WBMP)\n|INPUT_(REQUEST|GET|SERVER|SESSION|COOKIE|POST|ENV)|ICONV_(MIME_DECODE_(STRICT|CONTINUE_ON_ERROR)|IMPL|VERSION)\n|DNS_(MX|SRV|SOA|HINFO|NS|NAPTR|CNAME|TXT|PTR|ANY|ALL|AAAA|A(6)?)\n|DOM(STRING_SIZE_ERR)\n|DOM_((SYNTAX|HIERARCHY_REQUEST|NO_(MODIFICATION_ALLOWED|DATA_ALLOWED)|NOT_(FOUND|SUPPORTED)|NAMESPACE\n |INDEX_SIZE|USE_ATTRIBUTE|VALID_(MODIFICATION|STATE|CHARACTER|ACCESS)|PHP|VALIDATION|WRONG_DOCUMENT)_ERR)\n|JSON_(HEX_(TAG|QUOT|AMP|APOS)|NUMERIC_CHECK|ERROR_(SYNTAX|STATE_MISMATCH|NONE|CTRL_CHAR|DEPTH|UTF8)|FORCE_OBJECT)\n|PREG_((D_UTF8(_OFFSET)?|NO|INTERNAL|(BACKTRACK|RECURSION)_LIMIT)_ERROR|GREP_INVERT\n |SPLIT_(NO_EMPTY|(DELIM|OFFSET)_CAPTURE)|SET_ORDER|OFFSET_CAPTURE|PATTERN_ORDER)\n|PSFS_(PASS_ON|ERR_FATAL|FEED_ME|FLAG_(NORMAL|FLUSH_(CLOSE|INC)))\n|PCRE_VERSION|POSIX_((F|R|W|X)_OK|S_IF(REG|BLK|SOCK|CHR|IFO))\n|FNM_(NOESCAPE|CASEFOLD|PERIOD|PATHNAME)\n|FILTER_(REQUIRE_(SCALAR|ARRAY)|NULL_ON_FAILURE|CALLBACK|DEFAULT|UNSAFE_RAW\n |SANITIZE_(MAGIC_QUOTES|STRING|STRIPPED|SPECIAL_CHARS|NUMBER_(INT|FLOAT)|URL\n |EMAIL|ENCODED|FULL_SPCIAL_CHARS)\n |VALIDATE_(REGEXP|BOOLEAN|INT|IP|URL|EMAIL|FLOAT)\n |FORCE_ARRAY\n |FLAG_(SCHEME_REQUIRED|STRIP_(BACKTICK|HIGH|LOW)|HOST_REQUIRED|NONE|NO_(RES|PRIV)_RANGE|ENCODE_QUOTES\n |IPV(4|6)|PATH_REQUIRED|EMPTY_STRING_NULL|ENCODE_(HIGH|LOW|AMP)|QUERY_REQUIRED\n |ALLOW_(SCIENTIFIC|HEX|THOUSAND|OCTAL|FRACTION)))\n|FILE_(BINARY|SKIP_EMPTY_LINES|NO_DEFAULT_CONTEXT|TEXT|IGNORE_NEW_LINES|USE_INCLUDE_PATH|APPEND)\n|FILEINFO_(RAW|MIME(_(ENCODING|TYPE))?|SYMLINK|NONE|CONTINUE|DEVICES|PRESERVE_ATIME)\n|FORCE_(DEFLATE|GZIP)\n|LIBXML_(XINCLUDE|NSCLEAN|NO(XMLDECL|BLANKS|NET|CDATA|ERROR|EMPTYTAG|ENT|WARNING)\n |COMPACT|DTD(VALID|LOAD|ATTR)|((DOTTED|LOADED)_)?VERSION|PARSEHUGE|ERR_(NONE|ERROR|FATAL|WARNING)))\n\\b", + "name": "support.constant.ext.php", + "captures": { + "1": { + "name": "punctuation.separator.inheritance.php" } - ] + } + }, + { + "match": "(?x)\n(\\\\)?\\b\n(T_(RETURN|REQUIRE(_ONCE)?|GOTO|GLOBAL|(MINUS|MOD|MUL|XOR)_EQUAL|METHOD_C|ML_COMMENT|BREAK\n |BOOL_CAST|BOOLEAN_(AND|OR)|BAD_CHARACTER|SR(_EQUAL)?|STRING(_CAST|VARNAME)?|START_HEREDOC|STATIC\n |SWITCH|SL(_EQUAL)?|HALT_COMPILER|NS_(C|SEPARATOR)|NUM_STRING|NEW|NAMESPACE|CHARACTER|COMMENT\n |CONSTANT(_ENCAPSED_STRING)?|CONCAT_EQUAL|CONTINUE|CURLY_OPEN|CLOSE_TAG|CLONE|CLASS(_C)?\n |CASE|CATCH|TRY|THROW|IMPLEMENTS|ISSET|IS_((GREATER|SMALLER)_OR_EQUAL|(NOT_)?(IDENTICAL|EQUAL))\n |INSTANCEOF|INCLUDE(_ONCE)?|INC|INT_CAST|INTERFACE|INLINE_HTML|IF|OR_EQUAL|OBJECT_(CAST|OPERATOR)\n |OPEN_TAG(_WITH_ECHO)?|OLD_FUNCTION|DNUMBER|DIR|DIV_EQUAL|DOC_COMMENT|DOUBLE_(ARROW|CAST|COLON)\n |DOLLAR_OPEN_CURLY_BRACES|DO|DEC|DECLARE|DEFAULT|USE|UNSET(_CAST)?|PRINT|PRIVATE|PROTECTED|PUBLIC\n |PLUS_EQUAL|PAAMAYIM_NEKUDOTAYIM|EXTENDS|EXIT|EMPTY|ENCAPSED_AND_WHITESPACE\n |END(SWITCH|IF|DECLARE|FOR(EACH)?|WHILE)|END_HEREDOC|ECHO|EVAL|ELSE(IF)?|VAR(IABLE)?|FINAL|FILE\n |FOR(EACH)?|FUNC_C|FUNCTION|WHITESPACE|WHILE|LNUMBER|LIST|LINE|LOGICAL_(AND|OR|XOR)\n |ARRAY_(CAST)?|ABSTRACT|AS|AND_EQUAL))\n\\b", + "name": "support.constant.parser-token.php", + "captures": { + "1": { + "name": "punctuation.separator.inheritance.php" + } + } + }, + { + "match": "(?i)[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*", + "name": "constant.other.php" } ] }, - "function-arguments": { + "function-parameters": { "patterns": [ { "include": "#comments" }, { - "begin": "(?xi)\n\t\t\t\t\t\t\t\\s*(array) # Typehint\n\t\t\t\t\t\t\t\\s*(&)? \t\t\t\t\t# Reference\n\t\t\t\t\t\t\t\\s*((\\$+)[a-zA-Z_\\x{7f}-\\x{ff}][a-zA-Z0-9_\\x{7f}-\\x{ff}]*) # The variable name\n\t\t\t\t\t\t\t\\s*(=)\t# A default value\n\t\t\t\t\t\t\t\\s*(array)\\s*(\\()\n\t\t\t\t\t\t\t", + "begin": "(?xi)\n(array) # Typehint\n\\s+((&)?\\s*(\\$+)[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*) # Variable name with possible reference\n\\s*(=)\\s*(array)\\s*(\\() # Default value", "beginCaptures": { "1": { "name": "storage.type.php" }, "2": { - "name": "storage.modifier.reference.php" + "name": "variable.other.php" }, "3": { - "name": "variable.other.php" + "name": "storage.modifier.reference.php" }, "4": { "name": "punctuation.definition.variable.php" @@ -365,17 +471,17 @@ "name": "support.function.construct.php" }, "7": { - "name": "punctuation.definition.array.begin.php" + "name": "punctuation.definition.array.begin.bracket.round.php" } }, "contentName": "meta.array.php", "end": "\\)", "endCaptures": { "0": { - "name": "punctuation.definition.array.end.php" + "name": "punctuation.definition.array.end.bracket.round.php" } }, - "name": "meta.function.argument.array.php", + "name": "meta.function.parameter.array.php", "patterns": [ { "include": "#comments" @@ -389,15 +495,17 @@ ] }, { + "match": "(?xi)\n(array|callable) # Typehint\n\\s+((&)?\\s*(\\$+)[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*) # Variable name with possible reference\n(?: # Optional default value\n \\s*(=)\\s*\n (?:\n (null)\n |\n (\\[)((?>[^\\[\\]]+|\\[\\g<8>\\])*)(\\])\n |((?:\\S*?\\(\\))|(?:\\S*?))\n )\n)?\n\\s*(?=,|\\)|/[/*]|\\#|$) # A closing parentheses (end of argument list) or a comma or a comment", + "name": "meta.function.parameter.array.php", "captures": { "1": { "name": "storage.type.php" }, "2": { - "name": "storage.modifier.reference.php" + "name": "variable.other.php" }, "3": { - "name": "variable.other.php" + "name": "storage.modifier.reference.php" }, "4": { "name": "punctuation.definition.variable.php" @@ -424,92 +532,98 @@ "10": { "name": "invalid.illegal.non-null-typehinted.php" } - }, - "match": "(?xi)\n\t\t\t\t\t\t\t\\s*(array|callable) # Typehint\n\t\t\t\t\t\t\t\\s*(&)? \t\t\t\t\t# Reference\n\t\t\t\t\t\t\t\\s*((\\$+)[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*) # The variable name\n\t\t\t\t\t\t\t(?:\n\t\t\t\t\t\t\t\t\\s*(?:(=)\\s*(?:(null)|(\\[)((?>[^\\[\\]]+|\\[\\g<8>\\])*)(\\])|((?:\\S*?\\(\\))|(?:\\S*?))))\t# A default value\n\t\t\t\t\t\t\t)?\n\t\t\t\t\t\t\t\\s*(?=,|\\)|/[/*]|\\#|$) # A closing parentheses (end of argument list) or a comma or a comment\n\t\t\t\t\t\t\t", - "name": "meta.function.argument.array.php" + } }, { - "begin": "(?i)(?=[a-z_0-9\\\\]*[a-z_][a-z_0-9]*\\s*&?\\s*(?:\\.\\.\\.)?\\$)", - "end": "(?=,|\\)|/[/*]|\\#|$)", - "name": "meta.function.argument.typehinted.php", - "patterns": [ - { - "include": "#class-name" + "begin": "(?xi)\n([a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*) # Typehinted class name\n\\s*((&)?\\s*(\\.\\.\\.)?(\\$+)[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*) # Variable name with possible reference", + "beginCaptures": { + "1": { + "name": "storage.type.php" + }, + "2": { + "name": "variable.other.php" }, + "3": { + "name": "storage.modifier.reference.php" + }, + "4": { + "name": "keyword.operator.variadic.php" + }, + "5": { + "name": "punctuation.definition.variable.php" + } + }, + "end": "(?=,|\\)|/[/*]|\\#)", + "name": "meta.function.parameter.typehinted.php", + "patterns": [ { - "captures": { - "1": { - "name": "support.class.php" - }, - "2": { - "name": "storage.modifier.reference.php" - }, - "3": { - "name": "variable.other.php" - }, - "4": { - "name": "punctuation.definition.variable.php" - }, - "5": { + "begin": "=", + "beginCaptures": { + "0": { "name": "keyword.operator.assignment.php" - }, - "6": { - "name": "constant.language.php" - }, - "7": { - "name": "invalid.illegal.non-null-typehinted.php" } }, - "match": "(?xi)\n \t\t\t\t\t\t\t\\s*([a-z_][a-z_0-9]*)? # Typehinted class name\n \t\t\t\t\t\t\t\\s*(&)? \t\t\t\t\t# Reference\n \t\t\t\t\t\t\t\\s*(((?:\\.\\.\\.)?\\$+)[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*) # The variable name\n \t\t\t\t\t\t\t(?:\n \t\t\t\t\t\t\t\t\\s*(?:(=)\\s*(?:(null)|((?:\\S*?\\(\\))|(?:\\S*?))))\t# A default value\n \t\t\t\t\t\t\t)?\n \t\t\t\t\t\t\t\\s*(?=,|\\)|/[/*]|\\#|$) # A closing parentheses (end of argument list) or a comma\n\t\t\t\t\t " + "end": "(?=,|\\)|/[/*]|\\#)", + "patterns": [ + { + "include": "#language" + } + ] } ] }, { "captures": { "1": { - "name": "storage.modifier.reference.php" + "name": "variable.other.php" }, "2": { - "name": "variable.other.php" + "name": "storage.modifier.reference.php" }, "3": { + "name": "keyword.operator.variadic.php" + }, + "4": { "name": "punctuation.definition.variable.php" } }, - "match": "(?:\\s*(&))?\\s*(((?:\\.\\.\\.)?\\$+)[a-zA-Z_\\x{7f}-\\x{ff}][a-zA-Z0-9_\\x{7f}-\\x{ff}]*)\\s*(?=,|\\)|/[/*]|\\#)", - "name": "meta.function.argument.no-default.php" + "match": "(?xi)\n((&)?\\s*(\\.\\.\\.)?(\\$+)[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*) # Variable name with possible reference\n\\s*(?=,|\\)|/[/*]|\\#|$) # A closing parentheses (end of argument list) or a comma or a comment", + "name": "meta.function.parameter.no-default.php" }, { - "begin": "(?:\\s*(&))?\\s*((\\$+)[a-zA-Z_\\x{7f}-\\x{ff}][a-zA-Z0-9_\\x{7f}-\\x{ff}]*)(?:\\s*(=)\\s*)\\s*(?:(\\[)((?>[^\\[\\]]+|\\[\\g<6>\\])*)(\\]))?", - "captures": { + "begin": "(?xi)\n((&)?\\s*(\\.\\.\\.)?(\\$+)[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*) # Variable name with possible reference\n\\s*(=)\\s*\n(?:(\\[)((?>[^\\[\\]]+|\\[\\g<6>\\])*)(\\]))? # Optional default type", + "beginCaptures": { "1": { - "name": "storage.modifier.reference.php" + "name": "variable.other.php" }, "2": { - "name": "variable.other.php" + "name": "storage.modifier.reference.php" }, "3": { - "name": "punctuation.definition.variable.php" + "name": "keyword.operator.variadic.php" }, "4": { - "name": "keyword.operator.assignment.php" + "name": "punctuation.definition.variable.php" }, "5": { - "name": "punctuation.section.array.begin.php" + "name": "keyword.operator.assignment.php" }, "6": { + "name": "punctuation.section.array.begin.php" + }, + "7": { "patterns": [ { "include": "#parameter-default-types" } ] }, - "7": { + "8": { "name": "punctuation.section.array.end.php" } }, "end": "(?=,|\\)|/[/*]|\\#)", - "name": "meta.function.argument.default.php", + "name": "meta.function.parameter.default.php", "patterns": [ { "include": "#parameter-default-types" @@ -521,47 +635,80 @@ "function-call": { "patterns": [ { - "begin": "(?i)(?=\\\\?[a-z_0-9\\\\]+\\\\[a-z_][a-z0-9_]*\\s*\\()", - "comment": "Functions in a user-defined namespace (overrides any built-ins)", - "end": "(?=\\s*\\()", + "begin": "(?i)(\\\\?[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*\\\\[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)\\s*(\\()", + "beginCaptures": { + "1": { + "patterns": [ + { + "include": "#namespace" + }, + { + "match": "(?i)[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*", + "name": "entity.name.function.php" + } + ] + }, + "2": { + "name": "punctuation.definition.arguments.begin.bracket.round.php" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.arguments.end.bracket.round.php" + } + }, + "name": "meta.function-call.php", "patterns": [ { - "include": "#user-function-call" + "include": "#language" } ] }, { - "match": "(?i)\\b(print|echo)\\b", - "name": "support.function.construct.output.php" - }, - { - "begin": "(?i)(\\\\)?(?=\\b[a-z_][a-z_0-9]*\\s*\\()", + "begin": "(?i)(\\\\)?\\b([a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)\\s*(\\()", "beginCaptures": { "1": { "name": "punctuation.separator.inheritance.php" + }, + "2": { + "patterns": [ + { + "include": "#support" + }, + { + "match": "(?i)[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*", + "name": "entity.name.function.php" + } + ] + }, + "3": { + "name": "punctuation.definition.arguments.begin.bracket.round.php" } }, - "comment": "Root namespace function calls (built-in or user)", - "end": "(?=\\s*\\()", + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.arguments.end.bracket.round.php" + } + }, + "name": "meta.function-call.php", "patterns": [ { - "match": "(?i)\\b(isset|unset|e(val|mpty)|list)(?=\\s*\\()", - "name": "support.function.construct.php" - }, - { - "include": "#support" - }, - { - "include": "#user-function-call" + "include": "#language" } ] + }, + { + "match": "(?i)\\b(print|echo)\\b", + "name": "support.function.construct.output.php" } ] }, "heredoc": { "patterns": [ { - "begin": "(?=<<<\\s*(\"?)([a-zA-Z_]+[a-zA-Z0-9_]*)(\\1)\\s*$)", + "begin": "(?i)(?=<<<\\s*(\"?)([a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)(\\1)\\s*$)", "end": "(?!\\G)", "name": "string.unquoted.heredoc.php", "patterns": [ @@ -831,7 +978,6 @@ "include": "#interpolation" }, { - "comment": "Escaped from the regexp – there can also be 2 backslashes (since 1 will escape the first)", "match": "(\\\\){1,2}[.$^\\[\\]{}]", "name": "constant.character.escape.regex.php" }, @@ -844,7 +990,7 @@ "name": "punctuation.definition.arbitrary-repitition.php" } }, - "match": "(\\{)\\d+(,\\d+)?(\\})", + "match": "({)\\d+(,\\d+)?(})", "name": "string.regexp.arbitrary-repitition.php" }, { @@ -868,14 +1014,13 @@ "name": "keyword.operator.regexp.php" }, { - "begin": "(?<=^|\\s)(#)\\s(?=[[a-zA-Z0-9,. \\t?!-][^\\x{00}-\\x{7F}]]*$)", + "begin": "(?i)(?<=^|\\s)(#)\\s(?=[[a-z0-9_\\x{7f}-\\x{ff},. \\t?!-][^\\x{00}-\\x{7f}]]*$)", "beginCaptures": { "1": { "name": "punctuation.definition.comment.php" } }, - "comment": "We are restrictive in what we allow to go after the comment character to avoid false positives, since the availability of comments depend on regexp flags.", - "end": "$\\n?", + "end": "$", "endCaptures": { "0": { "name": "punctuation.definition.comment.php" @@ -886,7 +1031,7 @@ ] }, { - "begin": "(<<<)\\s*(\"?)([a-zA-Z_]+[a-zA-Z0-9_]*)(\\2)(\\s*)", + "begin": "(?i)(<<<)\\s*(\"?)([a-z_\\x{7f}-\\x{ff}]+[a-z0-9_\\x{7f}-\\x{ff}]*)(\\2)(\\s*)", "beginCaptures": { "1": { "name": "punctuation.definition.string.php" @@ -1140,7 +1285,6 @@ }, "patterns": [ { - "comment": "Escaped from the regexp – there can also be 2 backslashes (since 1 will escape the first)", "match": "(\\\\){1,2}[.$^\\[\\]{}]", "name": "constant.character.escape.regex.php" }, @@ -1153,7 +1297,7 @@ "name": "punctuation.definition.arbitrary-repitition.php" } }, - "match": "(\\{)\\d+(,\\d+)?(\\})", + "match": "({)\\d+(,\\d+)?(})", "name": "string.regexp.arbitrary-repitition.php" }, { @@ -1177,14 +1321,13 @@ "name": "keyword.operator.regexp.php" }, { - "begin": "(?<=^|\\s)(#)\\s(?=[[a-zA-Z0-9,. \\t?!-][^\\x{00}-\\x{7F}]]*$)", + "begin": "(?i)(?<=^|\\s)(#)\\s(?=[[a-z0-9_\\x{7f}-\\x{ff},. \\t?!-][^\\x{00}-\\x{7f}]]*$)", "beginCaptures": { "1": { "name": "punctuation.definition.comment.php" } }, - "comment": "We are restrictive in what we allow to go after the comment character to avoid false positives, since the availability of comments depend on regexp flags.", - "end": "$\\n?", + "end": "$", "endCaptures": { "0": { "name": "punctuation.definition.comment.php" @@ -1195,7 +1338,7 @@ ] }, { - "begin": "(<<<)\\s*'([a-zA-Z_]+[a-zA-Z0-9_]*)'(\\s*)", + "begin": "(?i)(<<<)\\s*'([a-z_\\x{7f}-\\x{ff}]+[a-z0-9_\\x{7f}-\\x{ff}]*)'(\\s*)", "beginCaptures": { "1": { "name": "punctuation.definition.string.php" @@ -1223,10 +1366,10 @@ "name": "keyword.other.new.php" } }, - "end": "(?i)(?=[^$a-z0-9_\\\\])", + "end": "(?i)(?=[^a-z0-9_\\x{7f}-\\x{ff}\\\\])", "patterns": [ { - "match": "(parent|static|self)(?=[^a-z0-9_])", + "match": "(?i)(parent|static|self)(?![a-z0-9_\\x{7f}-\\x{ff}])", "name": "storage.type.php" }, { @@ -1238,7 +1381,6 @@ ] }, "interpolation": { - "comment": "http://www.php.net/manual/en/language.types.string.php#language.types.string.parsing", "patterns": [ { "match": "\\\\[0-7]{1,3}", @@ -1253,15 +1395,15 @@ "name": "constant.character.escape.php" }, { - "begin": "(\\{)(?=\\$.*?\\})", + "begin": "{(?=\\$.*?})", "beginCaptures": { - "1": { + "0": { "name": "punctuation.definition.variable.php" } }, - "end": "(\\})", + "end": "}", "endCaptures": { - "1": { + "0": { "name": "punctuation.definition.variable.php" } }, @@ -1285,7 +1427,7 @@ "name": "variable.other.php" } }, - "match": "(?i)(\\$+)([a-z_][a-z_0-9]*)(?=\\s*\\()", + "match": "(?i)(\\$+)([a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)(?=\\s*\\()", "name": "meta.function-call.invoke.php" }, "language": { @@ -1294,15 +1436,15 @@ "include": "#comments" }, { - "match": "\\{", + "match": "{", "name": "punctuation.section.scope.begin.php" }, { - "match": "\\}", + "match": "}", "name": "punctuation.section.scope.end.php" }, { - "begin": "(?i)^\\s*(interface)\\s+([a-z0-9_]+)\\s*(extends)?\\s*", + "begin": "(?i)^\\s*(interface)\\s+([a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)\\s*(extends)?\\s*", "beginCaptures": { "1": { "name": "storage.type.interface.php" @@ -1314,12 +1456,12 @@ "name": "storage.modifier.extends.php" } }, - "end": "((?:[a-zA-Z0-9_]+\\s*,\\s*)*)([a-zA-Z0-9_]+)?\\s*(?:(?=\\{)|$)", + "end": "(?i)((?:[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*\\s*,\\s*)*)([a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)?\\s*(?:(?={)|$)", "endCaptures": { "1": { "patterns": [ { - "match": "[a-zA-Z0-9_]+", + "match": "(?i)[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*", "name": "entity.other.inherited-class.php" }, { @@ -1340,7 +1482,7 @@ ] }, { - "begin": "(?i)^\\s*(trait)\\s+([a-z0-9_]+)", + "begin": "(?i)^\\s*(trait)\\s+([a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)", "beginCaptures": { "1": { "name": "storage.type.trait.php" @@ -1349,7 +1491,7 @@ "name": "entity.name.type.trait.php" } }, - "end": "(?=[{])", + "end": "(?={)", "name": "meta.trait.php", "patterns": [ { @@ -1358,14 +1500,14 @@ ] }, { - "begin": "(?i)(?:^|(?<=<\\?php))\\s*(namespace)\\b\\s+(?=([a-z0-9_\\\\]+\\s*($|[;{]|(\\/[\\/*])))|$)", + "begin": "(?i)(?:^|(?<=<\\?php))\\s*(namespace)\\b\\s+(?=([a-z0-9_\\x{7f}-\\x{ff}\\\\]+\\s*($|[;{]|(/[/*])))|$)", "beginCaptures": { "1": { "name": "keyword.other.namespace.php" } }, "contentName": "entity.name.type.namespace.php", - "end": "(?i)(?=\\s*$|[^a-z0-9_\\\\])", + "end": "(?i)(?=\\s*$|[^a-z0-9_\\x{7f}-\\x{ff}\\\\])", "name": "meta.namespace.php", "patterns": [ { @@ -1375,16 +1517,13 @@ ] }, { - "begin": "(?i)\\s*\\b(use)\\s+(?:((const)|(function))\\s+)?", + "begin": "(?i)\\b(use)\\s+(?:(const|function)\\s+)?", "beginCaptures": { "1": { "name": "keyword.other.use.php" }, - "3": { - "name": "storage.type.const.php" - }, - "4": { - "name": "storage.type.function.php" + "2": { + "name": "storage.type.${2:/downcase}.php" } }, "end": "(?=;|(?:^\\s*$))", @@ -1394,8 +1533,8 @@ "include": "#comments" }, { - "begin": "(?i)\\s*(?=[a-z_0-9\\\\])", - "end": "(?xi)(?:\n \t\t\t (?:\\s*(as)\\b\\s*([a-z_0-9]*)\\s*(?=,|;|$))\n \t\t\t |(?=,|;|$)\n \t\t\t )", + "begin": "(?i)\\s*(?=[a-z0-9_\\x{7f}-\\x{ff}\\\\])", + "end": "(?i)(?:\\s*(as)\\s+([a-z0-9_\\x{7f}-\\x{ff}]*))?\\s*(?=,|;|$)", "endCaptures": { "1": { "name": "keyword.other.use-as.php" @@ -1409,7 +1548,7 @@ "include": "#class-builtin" }, { - "begin": "(?i)\\s*(?=[\\\\a-z_0-9])", + "begin": "(?i)\\s*(?=[a-z0-9_\\x{7f}-\\x{ff}\\\\])", "end": "$|(?=[\\s,;])", "name": "support.other.namespace.use.php", "patterns": [ @@ -1427,10 +1566,10 @@ ] }, { - "begin": "(?i)^\\s*(abstract|final)?\\s*(class)\\s+([a-z0-9_]+)\\s*", + "begin": "(?i)^\\s*(?:(abstract|final)\\s+)?(class)\\s+([a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)", "beginCaptures": { "1": { - "name": "storage.modifier.abstract.php" + "name": "storage.modifier.${1:/downcase}.php" }, "2": { "name": "storage.type.class.php" @@ -1439,7 +1578,12 @@ "name": "entity.name.type.class.php" } }, - "end": "(?=[;{])", + "end": "}", + "endCaptures": { + "0": { + "name": "punctuation.definition.class.end.bracket.curly.php" + } + }, "name": "meta.class.php", "patterns": [ { @@ -1453,11 +1597,11 @@ } }, "contentName": "meta.other.inherited-class.php", - "end": "(?i)(?=[^a-z_0-9\\\\])", + "end": "(?i)(?=[^a-z0-9_\\x{7f}-\\x{ff}\\\\])", "patterns": [ { - "begin": "(?i)(?=\\\\?[a-z_0-9]+\\\\)", - "end": "(?i)([a-z_][a-z_0-9]*)?(?=[^a-z0-9_\\\\])", + "begin": "(?i)(?=\\\\?[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*\\\\)", + "end": "(?i)([a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)?(?=[^a-z0-9_\\x{7f}-\\x{ff}\\\\])", "endCaptures": { "1": { "name": "entity.other.inherited-class.php" @@ -1476,7 +1620,7 @@ "include": "#namespace" }, { - "match": "(?i)[a-z_][a-z_0-9]*", + "match": "(?i)[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*", "name": "entity.other.inherited-class.php" } ] @@ -1494,13 +1638,13 @@ "include": "#comments" }, { - "begin": "(?i)(?=[a-z0-9_\\\\]+)", + "begin": "(?i)(?=[a-z0-9_\\x{7f}-\\x{ff}\\\\]+)", "contentName": "meta.other.inherited-class.php", - "end": "(?i)(?:\\s*(?:,|(?=[^a-z0-9_\\\\\\s]))\\s*)", + "end": "(?i)(?:\\s*(?:,|(?=[^a-z0-9_\\x{7f}-\\x{ff}\\\\\\s]))\\s*)", "patterns": [ { - "begin": "(?i)(?=\\\\?[a-z_0-9]+\\\\)", - "end": "(?i)([a-z_][a-z_0-9]*)?(?=[^a-z0-9_\\\\])", + "begin": "(?i)(?=\\\\?[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*\\\\)", + "end": "(?i)([a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)?(?=[^a-z0-9_\\x{7f}-\\x{ff}\\\\])", "endCaptures": { "1": { "name": "entity.other.inherited-class.php" @@ -1519,31 +1663,42 @@ "include": "#namespace" }, { - "match": "(?i)[a-z_][a-z_0-9]*", + "match": "(?i)[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*", "name": "entity.other.inherited-class.php" } ] } ] + }, + { + "begin": "{", + "beginCaptures": { + "0": { + "name": "punctuation.definition.class.begin.bracket.curly.php" + } + }, + "end": "(?=})", + "contentName": "meta.class.body.php", + "patterns": [ + { + "include": "#class-body" + } + ] } ] }, { - "captures": { - "1": { - "name": "keyword.control.php" - } - }, - "match": "\\s*\\b((break|c(ase|ontinue)|d(e(clare|fault)|ie|o)|e(lse(if)?|nd(declare|for(each)?|if|switch|while)|xit)|for(each)?|if|return|switch|use|while|yield))\\b" + "match": "(?x)\n\\b(\n break|case|continue|declare|default|die|do|\n else(if)?|end(declare|for(each)?|if|switch|while)|exit|\n for(each)?|if|return|switch|use|while|yield\n)\\b", + "name": "keyword.control.php" }, { - "begin": "(?i)\\b((?:require|include)(?:_once)?)\\b\\s*", + "begin": "(?i)\\b((?:require|include)(?:_once)?)\\s+", "beginCaptures": { "1": { "name": "keyword.control.import.include.php" } }, - "end": "(?=\\s|;|$)", + "end": "(?=\\s|;|$|\\?>)", "name": "meta.include.php", "patterns": [ { @@ -1552,28 +1707,51 @@ ] }, { - "begin": "\\b(catch)\\b\\s*\\(\\s*", + "begin": "\\b(catch)\\s*(\\()", "beginCaptures": { "1": { "name": "keyword.control.exception.catch.php" + }, + "2": { + "name": "punctuation.definition.parameters.begin.bracket.round.php" } }, - "end": "([A-Za-z_][A-Za-z_0-9]*)\\s*((\\$+)[a-zA-Z_\\x{7f}-\\x{ff}][a-zA-Z0-9_\\x{7f}-\\x{ff}]*)\\s*\\)", + "end": "\\)", "endCaptures": { - "1": { - "name": "support.class.exception.php" - }, - "2": { - "name": "variable.other.php" - }, - "3": { - "name": "punctuation.definition.variable.php" + "0": { + "name": "punctuation.definition.parameters.end.bracket.round.php" } }, "name": "meta.catch.php", "patterns": [ { "include": "#namespace" + }, + { + "match": "(?xi)\n([a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*) # Exception class\n((?:\\s*\\|\\s*[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)*) # Optional additional exception classes\n\\s*\n((\\$+)[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*) # Variable", + "captures": { + "1": { + "name": "support.class.exception.php" + }, + "2": { + "patterns": [ + { + "match": "(?i)[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*", + "name": "support.class.exception.php" + }, + { + "match": "\\|", + "name": "punctuation.separator.delimiter.php" + } + ] + }, + "3": { + "name": "variable.other.php" + }, + "4": { + "name": "punctuation.definition.variable.php" + } + } } ] }, @@ -1582,7 +1760,7 @@ "name": "keyword.control.exception.php" }, { - "begin": "(?i)\\b(function)\\s*(&\\s*)?(?=\\()", + "begin": "(?i)\\b(function)\\s*(&)?\\s*(?=\\()", "beginCaptures": { "1": { "name": "storage.type.function.php" @@ -1591,26 +1769,26 @@ "name": "storage.modifier.reference.php" } }, - "end": "(?=\\{)", + "end": "(?={)", "name": "meta.function.closure.php", "patterns": [ { - "begin": "(\\()", + "begin": "\\(", "beginCaptures": { - "1": { - "name": "punctuation.definition.parameters.begin.php" + "0": { + "name": "punctuation.definition.parameters.begin.bracket.round.php" } }, - "contentName": "meta.function.arguments.php", - "end": "(\\))", + "contentName": "meta.function.parameters.php", + "end": "\\)", "endCaptures": { - "1": { - "name": "punctuation.definition.parameters.end.php" + "0": { + "name": "punctuation.definition.parameters.end.bracket.round.php" } }, "patterns": [ { - "include": "#function-arguments" + "include": "#function-parameters" } ] }, @@ -1621,29 +1799,29 @@ "name": "keyword.other.function.use.php" }, "2": { - "name": "punctuation.definition.parameters.begin.php" + "name": "punctuation.definition.parameters.begin.bracket.round.php" } }, - "end": "(\\))", + "end": "\\)", "endCaptures": { - "1": { - "name": "punctuation.definition.parameters.end.php" + "0": { + "name": "punctuation.definition.parameters.end.bracket.round.php" } }, "patterns": [ { "captures": { "1": { - "name": "storage.modifier.reference.php" + "name": "variable.other.php" }, "2": { - "name": "variable.other.php" + "name": "storage.modifier.reference.php" }, "3": { "name": "punctuation.definition.variable.php" } }, - "match": "(?:\\s*(&))?\\s*((\\$+)[a-zA-Z_\\x{7f}-\\x{ff}][a-zA-Z0-9_\\x{7f}-\\x{ff}]*)\\s*(?=,|\\))", + "match": "(?i)((&)?\\s*(\\$+)[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)\\s*(?=,|\\))", "name": "meta.function.closure.use.php" } ] @@ -1651,7 +1829,7 @@ ] }, { - "begin": "(?x)\\s*\n\t\t\t\t\t ((?:(?:final|abstract|public|private|protected|static)\\s+)*)\n\t\t\t\t (function)\n\t\t\t\t (?:\\s+|(\\s*&\\s*))\n\t\t\t\t (?:\n\t\t\t\t (__(?:call|construct|debugInfo|destruct|get|set|isset|unset|tostring|clone|set_state|sleep|wakeup|autoload|invoke|callStatic))\n\t\t\t\t |([a-zA-Z_\\x{7f}-\\x{ff}][a-zA-Z0-9_\\x{7f}-\\x{ff}]*)\n\t\t\t\t )\n\t\t\t\t \\s*\n\t\t\t\t (\\()", + "begin": "(?x)\n((?:(?:final|abstract|public|private|protected|static)\\s+)*)\n(function)\n\\s*(&)?\\s*\n(?i:\n (__(?:call|construct|debugInfo|destruct|get|set|isset|unset|tostring|\n clone|set_state|sleep|wakeup|autoload|invoke|callStatic))\n |([a-zA-Z_\\x{7f}-\\x{ff}][a-zA-Z0-9_\\x{7f}-\\x{ff}]*)\n)\n\\s*(\\()", "beginCaptures": { "1": { "patterns": [ @@ -1674,20 +1852,26 @@ "name": "entity.name.function.php" }, "6": { - "name": "punctuation.definition.parameters.begin.php" + "name": "punctuation.definition.parameters.begin.bracket.round.php" } }, - "contentName": "meta.function.arguments.php", - "end": "(\\))", + "contentName": "meta.function.parameters.php", + "end": "(\\))(?:\\s*(:)\\s*([a-zA-Z_\\x{7f}-\\x{ff}][a-zA-Z0-9_\\x{7f}-\\x{ff}]*))?", "endCaptures": { "1": { - "name": "punctuation.definition.parameters.end.php" + "name": "punctuation.definition.parameters.end.bracket.round.php" + }, + "2": { + "name": "keyword.operator.return-value.php" + }, + "3": { + "name": "storage.type.php" } }, "name": "meta.function.php", "patterns": [ { - "include": "#function-arguments" + "include": "#function-parameters" } ] }, @@ -1695,37 +1879,7 @@ "include": "#invoke-call" }, { - "begin": "(?xi)\\s*(?=\n\t\t\t\t [a-z_0-9$\\\\]+(::)\n (?:\n \t\t\t\t ([a-z_][a-z_0-9]*)\\s*\\(\n \t\t\t\t |\n \t\t\t\t ((\\$+)[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)\n \t\t\t\t |\n \t\t\t\t ([a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)\n \t\t\t\t)?\n\t\t\t\t )", - "end": "(?x)(::)\n (?:\n \t\t\t\t ([A-Za-z_][A-Za-z_0-9]*)\\s*\\(\n \t\t\t\t |\n \t\t\t\t ((\\$+)[a-zA-Z_\\x{7f}-\\x{ff}][a-zA-Z0-9_\\x{7f}-\\x{ff}]*)\n \t\t\t\t |\n \t\t\t\t ([a-zA-Z_\\x{7f}-\\x{ff}][a-zA-Z0-9_\\x{7f}-\\x{ff}]*)\n \t\t\t\t)?", - "endCaptures": { - "1": { - "name": "keyword.operator.class.php" - }, - "2": { - "name": "meta.function-call.static.php" - }, - "3": { - "name": "variable.other.class.php" - }, - "4": { - "name": "punctuation.definition.variable.php" - }, - "5": { - "name": "constant.other.class.php" - } - }, - "patterns": [ - { - "match": "(self|static|parent)\\b", - "name": "storage.type.php" - }, - { - "include": "#class-name" - }, - { - "include": "#variable-name" - } - ] + "include": "#scope-resolution" }, { "include": "#variables" @@ -1739,10 +1893,10 @@ "name": "support.function.construct.php" }, "2": { - "name": "punctuation.definition.array.begin.php" + "name": "punctuation.definition.array.begin.bracket.round.php" }, "3": { - "name": "punctuation.definition.array.end.php" + "name": "punctuation.definition.array.end.bracket.round.php" } }, "match": "(array)(\\()(\\))", @@ -1755,13 +1909,13 @@ "name": "support.function.construct.php" }, "2": { - "name": "punctuation.definition.array.begin.php" + "name": "punctuation.definition.array.begin.bracket.round.php" } }, "end": "\\)", "endCaptures": { "0": { - "name": "punctuation.definition.array.end.php" + "name": "punctuation.definition.array.end.bracket.round.php" } }, "name": "meta.array.php", @@ -1772,19 +1926,25 @@ ] }, { + "match": "(?i)(\\()\\s*(array|real|double|float|int(?:eger)?|bool(?:ean)?|string|object|binary|unset)\\s*(\\))", "captures": { "1": { + "name": "punctuation.definition.storage-type.begin.bracket.round.php" + }, + "2": { "name": "storage.type.php" + }, + "3": { + "name": "punctuation.definition.storage-type.end.bracket.round.php" } - }, - "match": "(?i)\\s*\\(\\s*(array|real|double|float|int(eger)?|bool(ean)?|string|object|binary|unset)\\s*\\)" + } }, { "match": "(?i)\\b(array|real|double|float|int(eger)?|bool(ean)?|string|class|clone|var|function|interface|trait|parent|self|object)\\b", "name": "storage.type.php" }, { - "match": "(?i)\\b(global|abstract|const|extends|implements|final|p(r(ivate|otected)|ublic)|static)\\b", + "match": "(?i)\\b(global|abstract|const|extends|implements|final|private|protected|public|static)\\b", "name": "storage.modifier.php" }, { @@ -1817,14 +1977,14 @@ "name": "storage.modifier.reference.php" } }, - "match": "(?:(\\=)(&))|(&(?=[$A-Za-z_]))" + "match": "(?i)(\\=)(&)|(&)(?=[$a-z_])" }, { - "match": "(@)", + "match": "@", "name": "keyword.operator.error-control.php" }, { - "match": "(===|==|!==|!=|<>)", + "match": "===|==|!==|!=|<>", "name": "keyword.operator.comparison.php" }, { @@ -1832,15 +1992,15 @@ "name": "keyword.operator.assignment.php" }, { - "match": "(<=>|<=|>=|<|>)", + "match": "<=>|<=|>=|<|>", "name": "keyword.operator.comparison.php" }, { - "match": "(\\-\\-|\\+\\+)", + "match": "\\-\\-|\\+\\+", "name": "keyword.operator.increment-decrement.php" }, { - "match": "(\\-|\\+|\\*|/|%)", + "match": "\\-|\\+|\\*|/|%", "name": "keyword.operator.arithmetic.php" }, { @@ -1855,13 +2015,13 @@ "name": "keyword.operator.bitwise.php" }, { - "begin": "(?i)\\b(instanceof)\\b\\s+(?=[\\\\$a-z_])", + "begin": "(?i)\\b(instanceof)\\s+(?=[\\\\$a-z_])", "beginCaptures": { "1": { "name": "keyword.operator.type.php" } }, - "end": "(?=[^\\\\$A-Za-z_0-9])", + "end": "(?=[^\\\\$a-z0-9_\\x{7f}-\\x{ff}])", "patterns": [ { "include": "#class-name" @@ -1886,7 +2046,7 @@ "name": "support.other.php" } }, - "match": "(?i)(goto)\\s+([a-z_][a-z_0-9]*)" + "match": "(?i)(goto)\\s+([a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)" }, { "captures": { @@ -1894,7 +2054,7 @@ "name": "entity.name.goto-label.php" } }, - "match": "(?i)^\\s*([a-z_][a-z_0-9]*)\\s*:" + "match": "(?i)^\\s*([a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)\\s*:(?!:)" }, { "include": "#string-backtick" @@ -1918,13 +2078,32 @@ } ] }, + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.begin.bracket.round.php" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.end.bracket.round.php" + } + }, + "patterns": [ + { + "include": "#language" + } + ] + }, { "include": "#constants" } ] }, "namespace": { - "begin": "(?i)(?:(namespace)|[a-z0-9_]+)?(\\\\)(?=.*?[^a-z_0-9\\\\])", + "begin": "(?i)(?:(namespace)|[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)?(\\\\)(?=.*?[^a-z0-9_\\x{7f}-\\x{ff}\\\\])", "beginCaptures": { "1": { "name": "variable.language.namespace.php" @@ -1933,27 +2112,23 @@ "name": "punctuation.separator.inheritance.php" } }, - "end": "(?i)(?=[a-z0-9_]*[^a-z0-9_\\\\])", + "end": "(?i)(?=[a-z0-9_\\x{7f}-\\x{ff}]*[^a-z0-9_\\x{7f}-\\x{ff}\\\\])", "name": "support.other.namespace.php", "patterns": [ { - "captures": { - "1": { - "name": "punctuation.separator.inheritance.php" - } - }, - "match": "(?i)(\\\\)" + "match": "\\\\", + "name": "punctuation.separator.inheritance.php" } ] }, "numbers": { - "match": "\\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\\.?[0-9]*)|(\\.[0-9]+))((e|E)(\\+|-)?[0-9]+)?)\\b", + "match": "(?i)\\b((0x[0-9a-f]*)|(([0-9]+\\.?[0-9]*)|(\\.[0-9]+))(e(\\+|-)?[0-9]+)?)\\b", "name": "constant.numeric.php" }, "object": { "patterns": [ { - "begin": "(->)(\\$?\\{)", + "begin": "(->)(\\$?{)", "beginCaptures": { "1": { "name": "keyword.operator.class.php" @@ -1962,9 +2137,9 @@ "name": "punctuation.definition.variable.php" } }, - "end": "(\\})", + "end": "}", "endCaptures": { - "1": { + "0": { "name": "punctuation.definition.variable.php" } }, @@ -1975,21 +2150,44 @@ ] }, { - "captures": { + "begin": "(?i)(->)([a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)\\s*(\\()", + "beginCaptures": { "1": { "name": "keyword.operator.class.php" }, "2": { - "name": "meta.function-call.object.php" + "name": "entity.name.function.php" }, "3": { + "name": "punctuation.definition.arguments.begin.bracket.round.php" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.arguments.end.bracket.round.php" + } + }, + "name": "meta.method-call.php", + "patterns": [ + { + "include": "#language" + } + ] + }, + { + "captures": { + "1": { + "name": "keyword.operator.class.php" + }, + "2": { "name": "variable.other.property.php" }, - "4": { + "3": { "name": "punctuation.definition.variable.php" } }, - "match": "(?x)(->)\n \t\t\t\t(?:\n \t\t\t\t ([A-Za-z_][A-Za-z_0-9]*)\\s*\\(\n \t\t\t\t |\n \t\t\t\t ((\\$+)?[a-zA-Z_\\x{7f}-\\x{ff}][a-zA-Z0-9_\\x{7f}-\\x{ff}]*)\n \t\t\t\t)?" + "match": "(?i)(->)((\\$+)?[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)?" } ] }, @@ -2026,13 +2224,13 @@ "name": "support.function.construct.php" }, "2": { - "name": "punctuation.definition.array.begin.php" + "name": "punctuation.definition.array.begin.bracket.round.php" } }, "end": "\\)", "endCaptures": { "0": { - "name": "punctuation.definition.array.end.php" + "name": "punctuation.definition.array.end.bracket.round.php" } }, "name": "meta.array.php", @@ -2046,7 +2244,7 @@ "include": "#instantiation" }, { - "begin": "(?xi)\\s*(?=\n\t\t\t\t [a-z_0-9\\\\]+(::)\n \t\t\t\t ([a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)?\n\t\t\t\t )", + "begin": "(?xi)\n(?=[a-z0-9_\\x{7f}-\\x{ff}\\\\]+(::)\n ([a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)?\n)", "end": "(?i)(::)([a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)?", "endCaptures": { "1": { @@ -2070,8 +2268,7 @@ "php_doc": { "patterns": [ { - "comment": "PHPDocumentor only recognises lines with an asterisk as the first non-whitespaces character", - "match": "^(?!\\s*\\*).*$\\n?", + "match": "^(?!\\s*\\*).*?(?:(?=\\*\\/)|$\\n?)", "name": "invalid.illegal.missing-asterisk.phpdoc.php" }, { @@ -2100,7 +2297,7 @@ "match": "(@xlink)\\s+(.+)\\s*$" }, { - "match": "\\@(a(pi|bstract|uthor)|c(ategory|opyright)|example|global|in(herit[Dd]oc|ternal)|li(cense|nk)|method|p(roperty(\\-read|\\-write|)|ackage|aram)|return|s(ee|ince|ource|tatic|ubpackage)|t(hrows|odo)|v(ar|ersion)|uses|deprecated|final|ignore)\\b", + "match": "(?x)\n@\n(\n api|abstract|author|category|copyright|example|global|inherit[Dd]oc|internal|\n license|link|method|property(-(read|write))?|package|param|return|see|since|source|\n static|subpackage|throws|todo|var|version|uses|deprecated|final|ignore\n)\\b", "name": "keyword.other.phpdoc.php" }, { @@ -2109,13 +2306,13 @@ "name": "keyword.other.phpdoc.php" } }, - "match": "\\{(@(link|inherit[Dd]oc)).+?\\}", + "match": "{(@(link|inherit[Dd]oc)).+?}", "name": "meta.tag.inline.phpdoc.php" } ] }, "regex-double-quoted": { - "begin": "(?x)\"/ (?= (\\\\.|[^\"/])++/[imsxeADSUXu]*\" )", + "begin": "\"/(?=(\\\\.|[^\"/])++/[imsxeADSUXu]*\")", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.php" @@ -2130,7 +2327,6 @@ "name": "string.regexp.double-quoted.php", "patterns": [ { - "comment": "Escaped from the regexp – there can also be 2 backslashes (since 1 will escape the first)", "match": "(\\\\){1,2}[.$^\\[\\]{}]", "name": "constant.character.escape.regex.php" }, @@ -2146,7 +2342,7 @@ "name": "punctuation.definition.arbitrary-repetition.php" } }, - "match": "(\\{)\\d+(,\\d+)?(\\})", + "match": "({)\\d+(,\\d+)?(})", "name": "string.regexp.arbitrary-repetition.php" }, { @@ -2171,7 +2367,7 @@ ] }, "regex-single-quoted": { - "begin": "(?x)'/ (?= ( \\\\ (?: \\\\ (?: \\\\ [\\\\']? | [^'] ) | . ) | [^'/] )++/[imsxeADSUXu]*' )", + "begin": "'/(?=(\\\\(?:\\\\(?:\\\\[\\\\']?|[^'])|.)|[^'/])++/[imsxeADSUXu]*')", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.php" @@ -2197,7 +2393,7 @@ "name": "punctuation.definition.arbitrary-repetition.php" } }, - "match": "(\\{)\\d+(,\\d+)?(\\})", + "match": "({)\\d+(,\\d+)?(})", "name": "string.regexp.arbitrary-repetition.php" }, { @@ -2216,13 +2412,89 @@ } ] }, + "scope-resolution": { + "patterns": [ + { + "match": "(?i)\\b([a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)(?=\\s*::)", + "captures": { + "1": { + "patterns": [ + { + "match": "\\b(self|static|parent)\\b", + "name": "storage.type.php" + }, + { + "include": "#class-name" + }, + { + "include": "#variable-name" + } + ] + } + } + }, + { + "begin": "(?i)(::)\\s*([a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)\\s*(\\()", + "beginCaptures": { + "1": { + "name": "keyword.operator.class.php" + }, + "2": { + "name": "entity.name.function.php" + }, + "3": { + "name": "punctuation.definition.arguments.begin.bracket.round.php" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.arguments.end.bracket.round.php" + } + }, + "name": "meta.method-call.static.php", + "patterns": [ + { + "include": "#language" + } + ] + }, + { + "match": "(?i)(::)\\s*(class)\\b", + "captures": { + "1": { + "name": "keyword.operator.class.php" + }, + "2": { + "name": "keyword.other.class.php" + } + } + }, + { + "match": "(?xi)\n(::)\\s*\n(?:\n ((\\$+)[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*) # Variable\n |\n ([a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*) # Constant\n)?", + "captures": { + "1": { + "name": "keyword.operator.class.php" + }, + "2": { + "name": "variable.other.class.php" + }, + "3": { + "name": "punctuation.definition.variable.php" + }, + "4": { + "name": "constant.other.class.php" + } + } + } + ] + }, "single_quote_regex_escape": { - "comment": "Support both PHP string and regex escaping", - "match": "(?x) \\\\ (?: \\\\ (?: \\\\ [\\\\']? | [^'] ) | . )", + "match": "\\\\(?:\\\\(?:\\\\[\\\\']?|[^'])|.)", "name": "constant.character.escape.php" }, "sql-string-double-quoted": { - "begin": "\"\\s*(?=(SELECT|INSERT|UPDATE|DELETE|CREATE|REPLACE|ALTER)\\b)", + "begin": "\"\\s*(?=(SELECT|INSERT|UPDATE|DELETE|CREATE|REPLACE|ALTER|AND)\\b)", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.php" @@ -2238,24 +2510,32 @@ "name": "string.quoted.double.sql.php", "patterns": [ { - "match": "#(\\\\\"|[^\"])*(?=\"|$\\n?)", - "name": "comment.line.number-sign.sql" + "match": "(#)(\\\\\"|[^\"])*(?=\"|$)", + "name": "comment.line.number-sign.sql", + "captures": { + "1": { + "name": "punctuation.definition.comment.sql" + } + } }, { - "match": "--(\\\\\"|[^\"])*(?=\"|$\\n?)", - "name": "comment.line.double-dash.sql" + "match": "(--)(\\\\\"|[^\"])*(?=\"|$)", + "name": "comment.line.double-dash.sql", + "captures": { + "1": { + "name": "punctuation.definition.comment.sql" + } + } }, { "match": "\\\\[\\\\\"`']", "name": "constant.character.escape.php" }, { - "comment": "Unclosed strings must be captured to avoid them eating the remainder of the PHP script\n\t\t\t\t\tSample case: $sql = \"SELECT * FROM bar WHERE foo = '\" . $variable . \"'\"", "match": "'(?=((\\\\')|[^'\"])*(\"|$))", "name": "string.quoted.single.unclosed.sql" }, { - "comment": "Unclosed strings must be captured to avoid them eating the remainder of the PHP script\n\t\t\t\t\tSample case: $sql = \"SELECT * FROM bar WHERE foo = '\" . $variable . \"'\"", "match": "`(?=((\\\\`)|[^`\"])*(\"|$))", "name": "string.quoted.other.backtick.unclosed.sql" }, @@ -2288,7 +2568,7 @@ ] }, "sql-string-single-quoted": { - "begin": "'\\s*(?=(SELECT|INSERT|UPDATE|DELETE|CREATE|REPLACE|ALTER)\\b)", + "begin": "'\\s*(?=(SELECT|INSERT|UPDATE|DELETE|CREATE|REPLACE|ALTER|AND)\\b)", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.php" @@ -2304,24 +2584,32 @@ "name": "string.quoted.single.sql.php", "patterns": [ { - "match": "#(\\\\'|[^'])*(?='|$\\n?)", - "name": "comment.line.number-sign.sql" + "match": "(#)(\\\\'|[^'])*(?='|$)", + "name": "comment.line.number-sign.sql", + "captures": { + "1": { + "name": "punctuation.definition.comment.sql" + } + } }, { - "match": "--(\\\\'|[^'])*(?='|$\\n?)", - "name": "comment.line.double-dash.sql" + "match": "(--)(\\\\'|[^'])*(?='|$)", + "name": "comment.line.double-dash.sql", + "captures": { + "1": { + "name": "punctuation.definition.comment.sql" + } + } }, { "match": "\\\\[\\\\'`\"]", "name": "constant.character.escape.php" }, { - "comment": "Unclosed strings must be captured to avoid them eating the remainder of the PHP script\n\t\t\t\t\tSample case: $sql = \"SELECT * FROM bar WHERE foo = '\" . $variable . \"'\"", "match": "`(?=((\\\\`)|[^`'])*('|$))", "name": "string.quoted.other.backtick.unclosed.sql" }, { - "comment": "Unclosed strings must be captured to avoid them eating the remainder of the PHP script\n\t\t\t\t\tSample case: $sql = \"SELECT * FROM bar WHERE foo = '\" . $variable . \"'\"", "match": "\"(?=((\\\\\")|[^\"'])*('|$))", "name": "string.quoted.double.unclosed.sql" }, @@ -2361,8 +2649,6 @@ "name": "punctuation.definition.string.begin.php" } }, - "comment": "This contentName is just to allow the usage of “select scope” to select the string contents first, then the string with quotes", - "contentName": "meta.string-contents.quoted.double.php", "end": "\"", "endCaptures": { "0": { @@ -2383,7 +2669,6 @@ "name": "punctuation.definition.string.begin.php" } }, - "contentName": "meta.string-contents.quoted.single.php", "end": "'", "endCaptures": { "0": { @@ -2423,19 +2708,19 @@ "support": { "patterns": [ { - "match": "(?i)\\bapc_(s(tore|ma_info)|c(ompile_file|lear_cache|a(s|che_info))|inc|de(c|fine_constants|lete(_file)?)|exists|fetch|load_constants|add|bin_(dump(file)?|load(file)?))\\b", + "match": "(?xi)\n\\b\napc_(\n store|sma_info|compile_file|clear_cache|cas|cache_info|inc|dec|define_constants|delete(_file)?|\n exists|fetch|load_constants|add|bin_(dump|load)(file)?\n)\\b", "name": "support.function.apc.php" }, { - "match": "(?i)\\b(s(huffle|izeof|ort)|n(ext|at(sort|casesort))|c(o(unt|mpact)|urrent)|in_array|u(sort|ksort|asort)|p(os|rev)|e(nd|ach|xtract)|k(sort|ey(_exists)?|rsort)|list|a(sort|r(sort|ray(_(s(hift|um|plice|earch|lice)|c(h(unk|ange_key_case)|o(unt_values|lumn|mbine))|intersect(_(u(key|assoc)|key|assoc))?|diff(_(u(key|assoc)|key|assoc))?|u(n(shift|ique)|intersect(_(uassoc|assoc))?|diff(_(uassoc|assoc))?)|p(op|ush|ad|roduct)|values|key(s|_exists)|f(il(ter|l(_keys)?)|lip)|walk(_recursive)?|r(e(duce|place(_recursive)?|verse)|and)|m(ultisort|erge(_recursive)?|ap)))?))|r(sort|eset|ange))\\b", + "match": "(?xi)\\b\n(\n shuffle|sizeof|sort|next|nat(case)?sort|count|compact|current|in_array|usort|uksort|uasort|\n pos|prev|end|each|extract|ksort|key(_exists)?|krsort|list|asort|arsort|rsort|reset|range|\n array(_(shift|sum|splice|search|slice|chunk|change_key_case|count_values|column|combine|\n (diff|intersect)(_(u)?(key|assoc))?|u(diff|intersect)(_(u)?assoc)?|unshift|unique|\n pop|push|pad|product|values|keys|key_exists|filter|fill(_keys)?|flip|walk(_recursive)?|\n reduce|replace(_recursive)?|reverse|rand|multisort|merge(_recursive)?|map)?)\n)\\b", "name": "support.function.array.php" }, { - "match": "(?i)\\b(s(how_source|ys_getloadavg|leep)|highlight_(string|file)|con(stant|nection_(status|aborted))|time_(sleep_until|nanosleep)|ignore_user_abort|d(ie|efine(d)?)|u(sleep|n(iqid|pack))|__halt_compiler|p(hp_(strip_whitespace|check_syntax)|ack)|e(val|xit)|get_browser)\\b", + "match": "(?xi)\\b\n(\n show_source|sys_getloadavg|sleep|highlight_(file|string)|constant|connection_(aborted|status)|\n time_(nanosleep|sleep_until)|ignore_user_abort|die|define(d)?|usleep|uniqid|unpack|__halt_compiler|\n php_(check_syntax|strip_whitespace)|pack|eval|exit|get_browser\n)\\b", "name": "support.function.basic_functions.php" }, { - "match": "(?i)\\bbc(s(cale|ub|qrt)|comp|div|pow(mod)?|add|m(od|ul))\\b", + "match": "(?i)\\bbc(scale|sub|sqrt|comp|div|pow(mod)?|add|mod|mul)\\b", "name": "support.function.bcmath.php" }, { @@ -2443,75 +2728,83 @@ "name": "support.function.blenc.php" }, { - "match": "(?i)\\bbz(c(ompress|lose)|open|decompress|err(str|no|or)|flush|write|read)\\b", + "match": "(?i)\\bbz(compress|close|open|decompress|errstr|errno|error|flush|write|read)\\b", "name": "support.function.bz2.php" }, { - "match": "(?i)\\b(GregorianToJD|cal_(to_jd|info|days_in_month|from_jd)|unixtojd|jdto(unix|jewish)|easter_da(ys|te)|J(ulianToJD|ewishToJD|D(MonthName|To(Gregorian|Julian|French)|DayOfWeek))|FrenchToJD)\\b", + "match": "(?xi)\\b\n(\n (French|Gregorian|Jewish|Julian)ToJD|cal_(to_jd|info|days_in_month|from_jd)|unixtojd|\n jdto(unix|jewish)|easter_(date|days)|JD(MonthName|To(Gregorian|Julian|French)|DayOfWeek)\n)\\b", "name": "support.function.calendar.php" }, { - "match": "(?i)\\b(c(lass_(exists|alias)|all_user_method(_array)?)|trait_exists|i(s_(subclass_of|a)|nterface_exists)|__autoload|property_exists|get_(c(lass(_(vars|methods))?|alled_class)|object_vars|declared_(classes|traits|interfaces)|parent_class)|method_exists)\\b", + "match": "(?xi)\\b\n(\n class_alias|all_user_method(_array)?|is_(a|subclass_of)|__autoload|(class|interface|method|property|trait)_exists|\n get_(class(_(vars|methods))?|(called|parent)_class|object_vars|declared_(classes|interfaces|traits))\n)\\b", "name": "support.function.classobj.php" }, { - "match": "(?i)\\b(com_(create_guid|print_typeinfo|event_sink|load_typelib|get_active_object|message_pump)|variant_(s(ub|et(_type)?)|n(ot|eg)|c(a(st|t)|mp)|i(nt|div|mp)|or|d(iv|ate_(to_timestamp|from_timestamp))|pow|eqv|fix|a(nd|dd|bs)|round|get_type|xor|m(od|ul)))\\b", + "match": "(?xi)\\b\n(\n com_(create_guid|print_typeinfo|event_sink|load_typelib|get_active_object|message_pump)|\n variant_(sub|set(_type)?|not|neg|cast|cat|cmp|int|idiv|imp|or|div|date_(from|to)_timestamp|\n pow|eqv|fix|and|add|abs|round|get_type|xor|mod|mul)\n)\\b", "name": "support.function.com.php" }, { - "match": "(?i)\\bctype_(space|cntrl|digit|upper|p(unct|rint)|lower|al(num|pha)|graph|xdigit)\\b", + "begin": "(?i)\\b(isset|unset|eval|empty|list)\\b", + "name": "support.function.construct.php" + }, + { + "match": "(?i)\\b(print|echo)\\b", + "name": "support.function.construct.output.php" + }, + { + "match": "(?i)\\bctype_(space|cntrl|digit|upper|punct|print|lower|alnum|alpha|graph|xdigit)\\b", "name": "support.function.ctype.php" }, { - "match": "(?i)\\bcurl_(s(hare_(setopt|close|init)|trerror|etopt(_array)?)|c(opy_handle|lose)|init|unescape|pause|e(scape|rr(no|or)|xec)|version|file_create|reset|getinfo|multi_(s(trerror|e(topt|lect))|close|in(it|fo_read)|exec|add_handle|remove_handle|getcontent))\\b", + "match": "(?xi)\\b\ncurl_(\n share_(close|init|setopt)|strerror|setopt(_array)?|copy_handle|close|init|unescape|pause|escape|\n errno|error|exec|version|file_create|reset|getinfo|\n multi_(strerror|setopt|select|close|init|info_read|(add|remove)_handle|getcontent|exec)\n)\\b", "name": "support.function.curl.php" }, { - "match": "(?i)\\b(str(totime|ptime|ftime)|checkdate|time(zone_(name_(from_abbr|get)|transitions_get|identifiers_list|o(pen|ffset_get)|version_get|location_get|abbreviations_list))?|idate|date(_(su(n(set|_info|rise)|b)|create(_(immutable(_from_format)?|from_format))?|time(stamp_(set|get)|zone_(set|get)|_set)|i(sodate_set|nterval_(create_from_date_string|format))|offset_get|d(iff|efault_timezone_(set|get)|ate_set)|parse(_from_format)?|format|add|get_last_errors|modify))?|localtime|g(et(timeofday|date)|m(strftime|date|mktime))|m(icrotime|ktime))\\b", + "match": "(?xi)\\b\n(\n strtotime|str[fp]time|checkdate|time|timezone_name_(from_abbr|get)|idate|\n timezone_((location|offset|transitions|version)_get|(abbreviations|identifiers)_list|open)|\n date(_(sun(rise|set)|sun_info|sub|create(_(immutable_)?from_format)?|timestamp_(get|set)|timezone_(get|set)|time_set|\n isodate_set|interval_(create_from_date_string|format)|offset_get|diff|default_timezone_(get|set)|date_set|\n parse(_from_format)?|format|add|get_last_errors|modify))?|\n localtime|get(date|timeofday)|gm(strftime|date|mktime)|microtime|mktime\n)\\b", "name": "support.function.datetime.php" }, { - "match": "(?i)\\bdba_(sync|handlers|nextkey|close|insert|op(timize|en)|delete|popen|exists|key_split|f(irstkey|etch)|list|replace)\\b", + "match": "(?i)\\bdba_(sync|handlers|nextkey|close|insert|optimize|open|delete|popen|exists|key_split|firstkey|fetch|list|replace)\\b", "name": "support.function.dba.php" }, { - "match": "(?i)\\bdbx_(sort|c(o(nnect|mpare)|lose)|e(scape_string|rror)|query|fetch_row)\\b", + "match": "(?i)\\bdbx_(sort|connect|compare|close|escape_string|error|query|fetch_row)\\b", "name": "support.function.dbx.php" }, { - "match": "(?i)\\b(scandir|c(h(dir|root)|losedir)|opendir|dir|re(winddir|addir)|getcwd)\\b", + "match": "(?i)\\b(scandir|chdir|chroot|closedir|opendir|dir|rewinddir|readdir|getcwd)\\b", "name": "support.function.dir.php" }, { - "match": "(?i)\\beio_(s(y(nc(_file_range|fs)?|mlink)|tat(vfs)?|e(ndfile|t_m(in_parallel|ax_(idle|p(oll_(time|reqs)|arallel)))|ek))|n(threads|op|pending|re(qs|ady))|c(h(own|mod)|ustom|lose|ancel)|truncate|init|open|dup2|u(nlink|time)|poll|event_loop|f(s(ync|tat(vfs)?)|ch(own|mod)|truncate|datasync|utime|allocate)|write|l(stat|ink)|r(e(name|a(d(dir|link|ahead)?|lpath))|mdir)|g(et_(event_stream|last_error)|rp(_(cancel|limit|add))?)|mk(nod|dir)|busy)\\b", + "match": "(?xi)\\b\neio_(\n sync(fs)?|sync_file_range|symlink|stat(vfs)?|sendfile|set_min_parallel|set_max_(idle|poll_(reqs|time)|parallel)|\n seek|n(threads|op|pending|reqs|ready)|chown|chmod|custom|close|cancel|truncate|init|open|dup2|unlink|utime|poll|\n event_loop|f(sync|stat(vfs)?|chown|chmod|truncate|datasync|utime|allocate)|write|lstat|link|rename|realpath|\n read(ahead|dir|link)?|rmdir|get_(event_stream|last_error)|grp(_(add|cancel|limit))?|mknod|mkdir|busy\n)\\b", "name": "support.function.eio.php" }, { - "match": "(?i)\\benchant_(dict_(s(tore_replacement|uggest)|check|is_in_session|describe|quick_check|add_to_(session|personal)|get_error)|broker_(set_ordering|init|d(ict_exists|escribe)|free(_dict)?|list_dicts|request_(dict|pwl_dict)|get_error))\\b", + "match": "(?xi)\\b\nenchant_(\n dict_(store_replacement|suggest|check|is_in_session|describe|quick_check|add_to_(personal|session)|get_error)|\n broker_(set_ordering|init|dict_exists|describe|free(_dict)?|list_dicts|request_(pwl_)?dict|get_error)\n)\\b", "name": "support.function.enchant.php" }, { - "match": "(?i)\\b(s(plit(i)?|ql_regcase)|ereg(i(_replace)?|_replace)?)\\b", + "match": "(?i)\\bsplit(i)?|sql_regcase|ereg(i)?(_replace)?\\b", "name": "support.function.ereg.php" }, { - "match": "(?i)\\b(set_e(rror_handler|xception_handler)|trigger_error|debug_(print_backtrace|backtrace)|user_error|error_(log|reporting|get_last)|restore_e(rror_handler|xception_handler))\\b", + "match": "(?i)\\b((restore|set)_(error_handler|exception_handler)|trigger_error|debug_(print_)?backtrace|user_error|error_(log|reporting|get_last))\\b", "name": "support.function.errorfunc.php" }, { - "match": "(?i)\\b(s(hell_exec|ystem)|p(assthru|roc_(nice|close|terminate|open|get_status))|e(scapeshell(cmd|arg)|xec))\\b", + "match": "(?i)\\bshell_exec|system|passthru|proc_(nice|close|terminate|open|get_status)|escapeshell(arg|cmd)|exec\\b", "name": "support.function.exec.php" }, { - "match": "(?i)\\b(exif_(t(humbnail|agname)|imagetype|read_data)|read_exif_data)\\b", + "match": "(?i)\\b(exif_(thumbnail|tagname|imagetype|read_data)|read_exif_data)\\b", "name": "support.function.exif.php" }, { - "match": "(?i)\\bfann_(s(huffle_train_data|cale_(train(_data)?|input(_train_data)?|output(_train_data)?)|ubset_train_data|et_(s(caling_params|arprop_(step_error_(shift|threshold_factor)|temperature|weight_decay_shift))|ca(scade_(num_candidate_groups|candidate_(stagnation_epochs|change_fraction|limit)|output_(stagnation_epochs|change_fraction)|weight_multiplier|activation_(steepnesses|functions)|m(in_(cand_epochs|out_epochs)|ax_(cand_epochs|out_epochs)))|llback)|train(ing_algorithm|_(stop_function|error_function))|input_scaling_params|output_scaling_params|error_log|quickprop_(decay|mu)|weight(_array)?|learning_(rate|momentum)|activation_(steepness(_(hidden|output|layer))?|function(_(hidden|output|layer))?)|rprop_(increase_factor|de(crease_factor|lta_(zero|m(in|ax))))|bit_fail_limit)|ave(_train)?)|num_(input_train_data|output_train_data)|c(opy|lear_scaling_params|ascadetrain_on_(data|file)|reate_(s(hortcut(_array)?|tandard(_array)?|parse(_array)?)|train(_from_callback)?|from_file))|t(est(_data)?|rain(_(on_(data|file)|epoch))?)|init_weights|d(uplicate_train_data|es(cale_(train|input|output)|troy(_train)?))|print_error|length_train_data|r(un|e(set_(MSE|err(str|no))|ad_train_from_file)|andomize_weights)|get_(sarprop_(step_error_(shift|threshold_factor)|temperature|weight_decay_shift)|n(um_(input|output|layers)|etwork_type)|MSE|c(onnection_(array|rate)|ascade_(num_candidate(s|_groups)|candidate_(stagnation_epochs|change_fraction|limit)|output_(stagnation_epochs|change_fraction)|weight_multiplier|activation_(steepnesses(_count)?|functions(_count)?)|m(in_(cand_epochs|out_epochs)|ax_(cand_epochs|out_epochs))))|t(otal_(neurons|connections)|rain(ing_algorithm|_(stop_function|error_function)))|err(str|no)|quickprop_(decay|mu)|l(earning_(rate|momentum)|ayer_array)|activation_(steepness|function)|rprop_(increase_factor|de(crease_factor|lta_(zero|m(in|ax))))|bi(t_fail(_limit)?|as_array))|merge_train_data)\\b", + "match": "(?xi)\\b\nfann_(\n (duplicate|length|merge|shuffle|subset)_train_data|scale_(train(_data)?|(input|output)(_train_data)?)|\n set_(scaling_params|sarprop_(step_error_(shift|threshold_factor)|temperature|weight_decay_shift)|\n cascade_(num_candidate_groups|candidate_(change_fraction|limit|stagnation_epochs)|\n output_(change_fraction|stagnation_epochs)|weight_multiplier|activation_(functions|steepnesses)|\n (max|min)_(cand|out)_epochs)|\n callback|training_algorithm|train_(error|stop)_function|(input|output)_scaling_params|error_log|\n quickprop_(decay|mu)|weight(_array)?|learning_(momentum|rate)|bit_fail_limit|\n activation_(function|steepness)(_(hidden|layer|output))?|\n rprop_((decrease|increase)_factor|delta_(max|min|zero)))|\n save(_train)?|num_(input|output)_train_data|copy|clear_scaling_params|cascadetrain_on_(file|data)|\n create_((sparse|shortcut|standard)(_array)?|train(_from_callback)?|from_file)|\n test(_data)?|train(_(on_(file|data)|epoch))?|init_weights|descale_(input|output|train)|destroy(_train)?|\n print_error|run|reset_(MSE|err(no|str))|read_train_from_file|randomize_weights|\n get_(sarprop_(step_error_(shift|threshold_factor)|temperature|weight_decay_shift)|num_(input|output|layers)|\n network_type|MSE|connection_(array|rate)|bias_array|bit_fail(_limit)?|\n cascade_(num_(candidates|candidate_groups)|(candidate|output)_(change_fraction|limit|stagnation_epochs)|\n weight_multiplier|activation_(functions|steepnesses)(_count)?|(max|min)_(cand|out)_epochs)|\n total_(connections|neurons)|training_algorithm|train_(error|stop)_function|err(no|str)|\n quickprop_(decay|mu)|learning_(momentum|rate)|layer_array|activation_(function|steepness)|\n rprop_((decrease|increase)_factor|delta_(max|min|zero)))\n)\\b", "name": "support.function.fann.php" }, { - "match": "(?i)\\b(s(ymlink|tat|et_file_buffer)|c(h(own|grp|mod)|opy|learstatcache)|t(ouch|empnam|mpfile)|is_(dir|uploaded_file|executable|file|writ(eable|able)|link|readable)|d(i(sk(_(total_space|free_space)|freespace)|rname)|elete)|u(nlink|mask)|p(close|open|a(thinfo|rse_ini_(string|file)))|f(s(canf|tat|eek)|nmatch|close|t(ell|runcate)|ile(size|ctime|type|inode|owner|_(put_contents|exists|get_contents)|perms|atime|group|mtime)?|open|p(ut(s|csv)|assthru)|eof|flush|write|lock|read|get(s(s)?|c(sv)?))|l(stat|ch(own|grp)|ink(info)?)|r(e(name|wind|a(d(file|link)|lpath(_cache_(size|get))?))|mdir)|glob|m(ove_uploaded_file|kdir)|basename)\\b", + "match": "(?xi)\\b\n(\n symlink|stat|set_file_buffer|chown|chgrp|chmod|copy|clearstatcache|touch|tempnam|tmpfile|\n is_(dir|(uploaded_)?file|executable|link|readable|writ(e)?able)|disk_(free|total)_space|diskfreespace|\n dirname|delete|unlink|umask|pclose|popen|pathinfo|parse_ini_(file|string)|fscanf|fstat|fseek|fnmatch|\n fclose|ftell|ftruncate|file(size|[acm]time|type|inode|owner|perms|group)?|file_(exists|(get|put)_contents)|\n f(open|puts|putcsv|passthru|eof|flush|write|lock|read|gets(s)?|getc(sv)?)|lstat|lchown|lchgrp|link(info)?|\n rename|rewind|read(file|link)|realpath(_cache_(get|size))?|rmdir|glob|move_uploaded_file|mkdir|basename\n)\\b", "name": "support.function.file.php" }, { @@ -2519,7 +2812,7 @@ "name": "support.function.fileinfo.php" }, { - "match": "(?i)\\bfilter_(has_var|i(nput(_array)?|d)|var(_array)?|list)\\b", + "match": "(?i)\\bfilter_(has_var|input(_array)?|id|var(_array)?|list)\\b", "name": "support.function.filter.php" }, { @@ -2527,47 +2820,47 @@ "name": "support.function.fpm.php" }, { - "match": "(?i)\\b(c(all_user_func(_array)?|reate_function)|unregister_tick_function|f(orward_static_call(_array)?|unc(tion_exists|_(num_args|get_arg(s)?)))|register_(shutdown_function|tick_function)|get_defined_functions)\\b", + "match": "(?i)\\b(call_user_(func|method)(_array)?|create_function|unregister_tick_function|forward_static_call(_array)?|function_exists|func_(num_args|get_arg(s)?)|register_(shutdown|tick)_function|get_defined_functions)\\b", "name": "support.function.funchand.php" }, { - "match": "(?i)\\b(ngettext|textdomain|d(ngettext|c(ngettext|gettext)|gettext)|gettext|bind(textdomain|_textdomain_codeset))\\b", + "match": "(?i)\\b((n)?gettext|textdomain|d((n)?gettext|c(n)?gettext)|bind(textdomain|_textdomain_codeset))\\b", "name": "support.function.gettext.php" }, { - "match": "(?i)\\bgmp_(s(can(1|0)|trval|ign|ub|etbit|qrt(rem)?)|hamdist|ne(g|xtprime)|c(om|lrbit|mp)|testbit|i(n(tval|it|vert)|mport)|or|div(_(q(r)?|r)|exact)?|jacobi|p(o(pcount|w(m)?)|erfect_square|rob_prime)|export|fact|legendre|a(nd|dd|bs)|r(oot(rem)?|andom(_(range|bits))?)|gcd(ext)?|xor|m(od|ul))\\b", + "match": "(?xi)\\b\ngmp_(\n scan[01]|strval|sign|sub|setbit|sqrt(rem)?|hamdist|neg|nextprime|com|clrbit|cmp|testbit|\n intval|init|invert|import|or|div(exact)?|div_(q|qr|r)|jacobi|popcount|pow(m)?|perfect_square|\n prob_prime|export|fact|legendre|and|add|abs|root(rem)?|random(_(bits|range))?|gcd(ext)?|xor|mod|mul\n)\\b", "name": "support.function.gmp.php" }, { - "match": "(?i)\\bhash(_(hmac(_file)?|copy|init|update(_(stream|file))?|pbkdf2|equals|fi(nal|le)|algos))?\\b", + "match": "(?i)\\bhash(_(hmac(_file)?|copy|init|update(_(file|stream))?|pbkdf2|equals|file|final|algos))?\\b", "name": "support.function.hash.php" }, { - "match": "(?i)\\b(http_(s(upport|end_(st(atus|ream)|content_(type|disposition)|data|file|last_modified))|head|negotiate_(c(harset|ontent_type)|language)|c(hunked_decode|ache_(etag|last_modified))|throttle|inflate|d(eflate|ate)|p(ost_(data|fields)|ut_(stream|data|file)|ersistent_handles_(c(ount|lean)|ident)|arse_(headers|cookie|params|message))|re(direct|quest(_(method_(name|unregister|exists|register)|body_encode))?)|get(_request_(headers|body(_stream)?))?|match_(etag|request_header|modified)|build_(str|cookie|url))|ob_(inflatehandler|deflatehandler|etaghandler))\\b", + "match": "(?xi)\\b\n(\n http_(support|send_(status|stream|content_(disposition|type)|data|file|last_modified)|head|\n negotiate_(charset|content_type|language)|chunked_decode|cache_(etag|last_modified)|throttle|\n inflate|deflate|date|post_(data|fields)|put_(data|file|stream)|persistent_handles_(count|clean|ident)|\n parse_(cookie|headers|message|params)|redirect|request(_(method_(exists|name|(un)?register)|body_encode))?|\n get(_request_(headers|body(_stream)?))?|match_(etag|modified|request_header)|build_(cookie|str|url))|\n ob_(etag|deflate|inflate)handler\n)\\b", "name": "support.function.http.php" }, { - "match": "(?i)\\b(iconv(_(s(tr(pos|len|rpos)|ubstr|et_encoding)|get_encoding|mime_(decode(_headers)?|encode)))?|ob_iconv_handler)\\b", + "match": "(?i)\\b(iconv(_(str(pos|len|rpos)|substr|(get|set)_encoding|mime_(decode(_headers)?|encode)))?|ob_iconv_handler)\\b", "name": "support.function.iconv.php" }, { - "match": "(?i)\\biis_(s(t(op_serv(ice|er)|art_serv(ice|er))|et_(s(cript_map|erver_rights)|dir_security|app_settings))|add_server|remove_server|get_(s(cript_map|erv(ice_state|er_(rights|by_(comment|path))))|dir_security))\\b", + "match": "(?i)\\biis_((start|stop)_(service|server)|set_(script_map|server_rights|dir_security|app_settings)|(add|remove)_server|get_(script_map|service_state|server_(rights|by_(comment|path))|dir_security))\\b", "name": "support.function.iisfunc.php" }, { - "match": "(?i)\\b(i(ptc(parse|embed)|mage(s(y|cale|tring(up)?|et(style|t(hickness|ile)|interpolation|pixel|brush)|avealpha|x)|c(har(up)?|o(nvolution|py(res(ized|ampled)|merge(gray)?)?|lor(s(total|et|forindex)|closest(hwb|alpha)?|transparent|deallocate|exact(alpha)?|a(t|llocate(alpha)?)|resolve(alpha)?|match))|r(op(auto)?|eate(truecolor|from(string|jpeg|png|w(ebp|bmp)|g(if|d(2(part)?)?)|x(pm|bm)))?))|t(ypes|tf(text|bbox)|ruecolortopalette)|i(struecolor|nterlace)|2wbmp|d(estroy|ashedline)|jpeg|_type_to_(extension|mime_type)|p(s(slantfont|text|e(ncodefont|xtendfont)|freefont|loadfont|bbox)|ng|olygon|alette(copy|totruecolor))|ellipse|f(t(text|bbox)|il(ter|l(toborder|ed(polygon|ellipse|arc|rectangle))?)|ont(height|width)|lip)|w(ebp|bmp)|l(ine|oadfont|ayereffect)|a(ntialias|ffine(matrix(concat|get))?|lphablending|rc)|r(otate|ectangle)|g(if|d(2)?|ammacorrect|rab(screen|window))|xbm))|jpeg2wbmp|png2wbmp|g(d_info|etimagesize(fromstring)?))\\b", + "match": "(?xi)\\b\n(\n iptc(embed|parse)|(jpeg|png)2wbmp|gd_info|getimagesize(fromstring)?|\n image(s[xy]|scale|(char|string)(up)?|set(style|thickness|tile|interpolation|pixel|brush)|savealpha|\n convolution|copy(resampled|resized|merge(gray)?)?|colors(forindex|total)|\n color(set|closest(alpha|hwb)?|transparent|deallocate|(allocate|exact|resolve)(alpha)?|at|match)|\n crop(auto)?|create(truecolor|from(string|jpeg|png|wbmp|webp|gif|gd(2(part)?)?|xpm|xbm))?|\n types|ttf(bbox|text)|truecolortopalette|istruecolor|interlace|2wbmp|destroy|dashedline|jpeg|\n _type_to_(extension|mime_type)|ps(slantfont|text|(encode|extend|free|load)font|bbox)|png|polygon|\n palette(copy|totruecolor)|ellipse|ft(text|bbox)|filter|fill|filltoborder|\n filled(arc|ellipse|polygon|rectangle)|font(height|width)|flip|webp|wbmp|line|loadfont|layereffect|\n antialias|affine(matrix(concat|get))?|alphablending|arc|rotate|rectangle|gif|gd(2)?|gammacorrect|\n grab(screen|window)|xbm)\n)\\b", "name": "support.function.image.php" }, { - "match": "(?i)\\b(s(ys_get_temp_dir|et_(time_limit|include_path|magic_quotes_runtime))|cli_(set_process_title|get_process_title)|ini_(set|alter|restore|get(_all)?)|zend_(thread_id|version|logo_guid)|dl|p(hp(credits|info|_(sapi_name|ini_(scanned_files|loaded_file)|uname|logo_guid)|version)|utenv)|extension_loaded|version_compare|assert(_options)?|restore_include_path|g(c_(collect_cycles|disable|enable(d)?)|et(opt|_(c(urrent_user|fg_var)|include(d_files|_path)|defined_constants|extension_funcs|loaded_extensions|required_files|magic_quotes_(runtime|gpc))|env|lastmod|rusage|my(inode|uid|pid|gid)))|m(emory_get_(usage|peak_usage)|a(in|gic_quotes_runtime)))\\b", + "match": "(?xi)\\b\n(\n sys_get_temp_dir|set_(time_limit|include_path|magic_quotes_runtime)|cli_(get|set)_process_title|\n ini_(alter|get(_all)?|restore|set)|zend_(thread_id|version|logo_guid)|dl|php(credits|info|version)|\n php_(sapi_name|ini_(scanned_files|loaded_file)|uname|logo_guid)|putenv|extension_loaded|version_compare|\n assert(_options)?|restore_include_path|gc_(collect_cycles|disable|enable(d)?)|getopt|\n get_(cfg_var|current_user|defined_constants|extension_funcs|include_path|included_files|loaded_extensions|\n magic_quotes_(gpc|runtime)|required_files|resources)|\n get(env|lastmod|rusage|my(inode|[gup]id))|\n memory_get_(peak_)?usage|main|magic_quotes_runtime\n)\\b", "name": "support.function.info.php" }, { - "match": "(?i)\\bibase_(se(t_event_handler|rv(ice_(detach|attach)|er_info))|n(um_(params|fields)|ame_result)|c(o(nnect|mmit(_ret)?)|lose)|trans|d(elete_user|rop_db|b_info)|p(connect|aram_info|repare)|e(rr(code|msg)|xecute)|query|f(ield_info|etch_(object|assoc|row)|ree_(event_handler|query|result))|wait_event|a(dd_user|ffected_rows)|r(ollback(_ret)?|estore)|gen_id|m(odify_user|aintain_db)|b(lob_(c(lose|ancel|reate)|i(nfo|mport)|open|echo|add|get)|ackup))\\b", + "match": "(?xi)\\b\nibase_(\n set_event_handler|service_(attach|detach)|server_info|num_(fields|params)|name_result|connect|\n commit(_ret)?|close|trans|delete_user|drop_db|db_info|pconnect|param_info|prepare|err(code|msg)|\n execute|query|field_info|fetch_(assoc|object|row)|free_(event_handler|query|result)|wait_event|\n add_user|affected_rows|rollback(_ret)?|restore|gen_id|modify_user|maintain_db|backup|\n blob_(cancel|close|create|import|info|open|echo|add|get)\n)\\b", "name": "support.function.interbase.php" }, { - "match": "(?i)\\b(n(ormalizer_(normalize|is_normalized)|umfmt_(set_(symbol|text_attribute|pattern|attribute)|create|parse(_currency)?|format(_currency)?|get_(symbol|text_attribute|pattern|error_(code|message)|locale|attribute)))|collator_(s(ort(_with_sort_keys)?|et_(strength|attribute))|c(ompare|reate)|asort|get_(s(trength|ort_key)|error_(code|message)|locale|attribute))|transliterator_(create(_(inverse|from_rules))?|transliterate|list_ids|get_error_(code|message))|i(ntl(cal_get_error_(code|message)|tz_get_error_(code|message)|_(is_failure|error_name|get_error_(code|message)))|dn_to_(u(nicode|tf8)|ascii))|datefmt_(set_(calendar|timezone(_id)?|pattern|lenient)|create|is_lenient|parse|format(_object)?|localtime|get_(calendar(_object)?|time(type|zone(_id)?)|datetype|pattern|error_(code|message)|locale))|locale_(set_default|c(ompose|anonicalize)|parse|filter_matches|lookup|accept_from_http|get_(script|d(isplay_(script|name|variant|language|region)|efault)|primary_language|keywords|all_variants|region))|resourcebundle_(c(ount|reate)|locales|get(_error_(code|message))?)|grapheme_(s(tr(str|i(str|pos)|pos|len|r(ipos|pos))|ubstr)|extract)|msgfmt_(set_pattern|create|parse(_message)?|format(_message)?|get_(pattern|error_(code|message)|locale)))\\b", + "match": "(?xi)\\b\n(\n normalizer_(normalize|is_normalized)|idn_to_(unicode|utf8|ascii)|\n numfmt_(set_(symbol|(text_)?attribute|pattern)|create|(parse|format)(_currency)?|\n get_(symbol|(text_)?attribute|pattern|error_(code|message)|locale))|\n collator_(sort(_with_sort_keys)?|set_(attribute|strength)|compare|create|asort|\n get_(strength|sort_key|error_(code|message)|locale|attribute))|\n transliterator_(create(_(inverse|from_rules))?|transliterate|list_ids|get_error_(code|message))|\n intl(cal|tz)_get_error_(code|message)|intl_(is_failure|error_name|get_error_(code|message))|\n datefmt_(set_(calendar|lenient|pattern|timezone(_id)?)|create|is_lenient|parse|format(_object)?|localtime|\n get_(calendar(_object)?|time(type|zone(_id)?)|datetype|pattern|error_(code|message)|locale))|\n locale_(set_default|compose|canonicalize|parse|filter_matches|lookup|accept_from_http|\n get_(script|display_(script|name|variant|language|region)|default|primary_language|keywords|all_variants|region))|\n resourcebundle_(create|count|locales|get(_(error_(code|message)))?)|\n grapheme_(str(i?str|r?i?pos|len)|substr|extract)|\n msgfmt_(set_pattern|create|(format|parse)(_message)?|get_(pattern|error_(code|message)|locale))\n)\\b", "name": "support.function.intl.php" }, { @@ -2575,7 +2868,7 @@ "name": "support.function.json.php" }, { - "match": "(?i)\\bldap_(s(tart_tls|ort|e(t_(option|rebind_proc)|arch)|asl_bind)|next_(entry|attribute|reference)|c(o(n(nect|trol_paged_result(_response)?)|unt_entries|mpare)|lose)|t61_to_8859|d(n2ufn|elete)|8859_to_t61|unbind|parse_re(sult|ference)|e(scape|rr(no|2str|or)|xplode_dn)|f(irst_(entry|attribute|reference)|ree_result)|list|add|re(name|ad)|get_(option|dn|entries|values(_len)?|attributes)|mod(ify(_batch)?|_(del|add|replace))|bind)\\b", + "match": "(?xi)\\b\nldap_(\n start|tls|sort|search|sasl_bind|set_(option|rebind_proc)|(first|next)_(attribute|entry|reference)|\n connect|control_paged_result(_response)?|count_entries|compare|close|t61_to_8859|8859_to_t61|\n dn2ufn|delete|unbind|parse_(reference|result)|escape|errno|err2str|error|explode_dn|bind|\n free_result|list|add|rename|read|get_(option|dn|entries|values(_len)?|attributes)|modify(_batch)?|\n mod_(add|del|replace)\n)\\b", "name": "support.function.ldap.php" }, { @@ -2587,15 +2880,15 @@ "name": "support.function.mail.php" }, { - "match": "(?i)\\b(s(in(h)?|qrt|rand)|h(ypot|exdec)|c(os(h)?|eil)|tan(h)?|is_(nan|infinite|finite)|octdec|de(c(hex|oct|bin)|g2rad)|p(i|ow)|exp(m1)?|f(loor|mod)|l(cg_value|og(1(p|0))?)|a(sin(h)?|cos(h)?|tan(h|2)?|bs)|r(ound|a(nd|d2deg))|getrandmax|m(t_(srand|rand|getrandmax)|in|ax)|b(indec|ase_convert))\\b", + "match": "(?xi)\\b\n(\n (a)?(cos|sin|tan)(h)?|sqrt|srand|hypot|hexdec|ceil|is_(nan|(in)?finite)|octdec|dec(hex|oct|bin)|deg2rad|\n pi|pow|exp(m1)?|floor|fmod|lcg_value|log(1(p|0))?|atan2|abs|round|rand|rad2deg|getrandmax|\n mt_(srand|rand|getrandmax)|max|min|bindec|base_convert\n)\\b", "name": "support.function.math.php" }, { - "match": "(?i)\\bmb_(s(tr(str|cut|to(upper|lower)|i(str|pos|mwidth)|pos|width|len|r(chr|i(chr|pos)|pos))|ubst(itute_character|r(_count)?)|plit|end_mail)|http_(input|output)|c(heck_encoding|onvert_(case|encoding|variables|kana))|internal_encoding|output_handler|de(code_(numericentity|mimeheader)|tect_(order|encoding))|p(arse_str|referred_mime_name)|e(ncod(ing_aliases|e_(numericentity|mimeheader))|reg(i(_replace)?|_(search(_(setpos|init|pos|regs|get(pos|regs)))?|replace(_callback)?|match))?)|l(ist_encodings|anguage)|regex_(set_options|encoding)|get_info)\\b", + "match": "(?xi)\\b\nmb_(\n str(cut|str|to(lower|upper)|istr|ipos|imwidth|pos|width|len|rchr|richr|ripos|rpos)|\n substitute_character|substr(_count)?|split|send_mail|http_(input|output)|check_encoding|\n convert_(case|encoding|kana|variables)|internal_encoding|output_handler|decode_(numericentity|mimeheader)|\n detect_(encoding|order)|parse_str|preferred_mime_name|encoding_aliases|encode_(numericentity|mimeheader)|\n ereg(i(_replace)?)?|ereg_(search(_(get(pos|regs)|init|regs|(set)?pos))?|replace(_callback)?|match)|\n list_encodings|language|regex_(set_options|encoding)|get_info\n)\\b", "name": "support.function.mbstring.php" }, { - "match": "(?i)\\bm(crypt_(c(fb|reate_iv|bc)|ofb|decrypt|e(nc(_(self_test|is_block_(algorithm(_mode)?|mode)|get_(supported_key_sizes|iv_size|key_size|algorithms_name|modes_name|block_size))|rypt)|cb)|list_(algorithms|modes)|ge(neric(_(init|deinit|end))?|t_(cipher_name|iv_size|key_size|block_size))|module_(self_test|close|is_block_(algorithm(_mode)?|mode)|open|get_(supported_key_sizes|algo_(key_size|block_size))))|decrypt_generic)\\b", + "match": "(?xi)\\b\n(\n mcrypt_(\n cfb|create_iv|cbc|ofb|decrypt|encrypt|ecb|list_(algorithms|modes)|generic(_((de)?init|end))?|\n enc_(self_test|is_block_(algorithm|algorithm_mode|mode)|\n get_(supported_key_sizes|(block|iv|key)_size|(algorithms|modes)_name))|\n get_(cipher_name|(block|iv|key)_size)|\n module_(close|self_test|is_block_(algorithm|algorithm_mode|mode)|open|\n get_(supported_key_sizes|algo_(block|key)_size)))|\n mdecrypt_generic\n)\\b", "name": "support.function.mcrypt.php" }, { @@ -2611,11 +2904,11 @@ "name": "support.function.mongo.php" }, { - "match": "(?i)\\bmysql_(s(tat|e(t_charset|lect_db))|num_(fields|rows)|c(onnect|l(ient_encoding|ose)|reate_db)|t(hread_id|ablename)|in(sert_id|fo)|d(ata_seek|rop_db|b_(name|query))|unbuffered_query|p(connect|ing)|e(scape_string|rr(no|or))|query|f(ield_(seek|name|t(ype|able)|flags|len)|etch_(object|field|lengths|a(ssoc|rray)|row)|ree_result)|list_(tables|dbs|processes|fields)|affected_rows|re(sult|al_escape_string)|get_(server_info|host_info|client_info|proto_info))\\b", + "match": "(?xi)\\b\nmysql_(\n stat|set_charset|select_db|num_(fields|rows)|connect|client_encoding|close|create_db|escape_string|\n thread_id|tablename|insert_id|info|data_seek|drop_db|db_(name|query)|unbuffered_query|pconnect|ping|\n errno|error|query|field_(seek|name|type|table|flags|len)|fetch_(object|field|lengths|assoc|array|row)|\n free_result|list_(tables|dbs|processes|fields)|affected_rows|result|real_escape_string|\n get_(client|host|proto|server)_info\n)\\b", "name": "support.function.mysql.php" }, { - "match": "(?i)\\bmysqli_(s(sl_set|t(ore_result|at|mt_(s(tore_result|end_long_data)|next_result|close|init|data_seek|prepare|execute|f(etch|ree_result)|attr_(set|get)|res(ult_metadata|et)|get_(warnings|result)|more_results|bind_(param|result)))|e(nd_(query|long_data)|t_(charset|opt|local_infile_(handler|default))|lect_db)|lave_query|avepoint)|next_result|c(ha(nge_user|racter_set_name)|o(nnect|mmit)|l(ient_encoding|ose))|thread_safe|init|options|d(isable_r(pl_parse|eads_from_master)|ump_debug_info|ebug|ata_seek)|use_result|p(ing|oll|aram_count|repare)|e(scape_string|nable_r(pl_parse|eads_from_master)|xecute|mbedded_server_(start|end))|kill|query|f(ield_seek|etch(_(object|field(s|_direct)?|a(ssoc|ll|rray)|row))?|ree_result)|autocommit|r(ollback|pl_(p(arse_enabled|robe)|query_type)|e(port|fresh|lease_savepoint|a(p_async_query|l_(connect|escape_string|query))))|get_(c(harset|onnection_stats|lient_(stats|info|version)|ache_stats)|warnings|links_stats|metadata)|m(ore_results|ulti_query|aster_query)|b(ind_(param|result)|egin_transaction))\\b", + "match": "(?xi)\\b\nmysqli_(\n ssl_set|store_result|stat|send_(query|long_data)|set_(charset|opt|local_infile_(default|handler))|\n stmt_(store_result|send_long_data|next_result|close|init|data_seek|prepare|execute|fetch|free_result|\n attr_(get|set)|result_metadata|reset|get_(result|warnings)|more_results|bind_(param|result))|\n select_db|slave_query|savepoint|next_result|change_user|character_set_name|connect|commit|\n client_encoding|close|thread_safe|init|options|(enable|disable)_(reads_from_master|rpl_parse)|\n dump_debug_info|debug|data_seek|use_result|ping|poll|param_count|prepare|escape_string|execute|\n embedded_server_(start|end)|kill|query|field_seek|free_result|autocommit|rollback|report|refresh|\n fetch(_(object|fields|field(_direct)?|assoc|all|array|row))?|rpl_(parse_enabled|probe|query_type)|\n release_savepoint|reap_async_query|real_(connect|escape_string|query)|more_results|multi_query|\n get_(charset|connection_stats|client_(stats|info|version)|cache_stats|warnings|links_stats|metadata)|\n master_query|bind_(param|result)|begin_transaction\n)\\b", "name": "support.function.mysqli.php" }, { @@ -2627,23 +2920,23 @@ "name": "support.function.mysqlnd-ms.php" }, { - "match": "(?i)\\bmysqlnd_qc_(set_(storage_handler|cache_condition|is_select|user_handlers)|clear_cache|get_(normalized_query_trace_log|c(ore_stats|ache_info)|query_trace_log|available_handlers))\\b", + "match": "(?i)\\bmysqlnd_qc_(set_(storage_handler|cache_condition|is_select|user_handlers)|clear_cache|get_(normalized_query_trace_log|core_stats|cache_info|query_trace_log|available_handlers))\\b", "name": "support.function.mysqlnd-qc.php" }, { - "match": "(?i)\\bmysqlnd_uh_(set_(statement_proxy|connection_proxy)|convert_to_mysqlnd)\\b", + "match": "(?i)\\bmysqlnd_uh_(set_(statement|connection)_proxy|convert_to_mysqlnd)\\b", "name": "support.function.mysqlnd-uh.php" }, { - "match": "(?i)\\b(s(yslog|ocket_(set_(timeout|blocking)|get_status)|et(cookie|rawcookie))|h(ttp_response_code|eader(s_(sent|list)|_re(gister_callback|move))?)|c(heckdnsrr|loselog)|i(net_(ntop|pton)|p2long)|openlog|d(ns_(check_record|get_(record|mx))|efine_syslog_variables)|pfsockopen|fsockopen|long2ip|get(servby(name|port)|host(name|by(name(l)?|addr))|protobyn(umber|ame)|mxrr))\\b", + "match": "(?xi)\\b\n(\n syslog|socket_(set_(blocking|timeout)|get_status)|set(raw)?cookie|http_response_code|openlog|\n headers_(list|sent)|header(_(register_callback|remove))?|checkdnsrr|closelog|inet_(ntop|pton)|ip2long|\n openlog|dns_(check_record|get_(record|mx))|define_syslog_variables|(p)?fsockopen|long2ip|\n get(servby(name|port)|host(name|by(name(l)?|addr))|protoby(name|number)|mxrr)\n)\\b", "name": "support.function.network.php" }, { - "match": "(?i)\\bnsapi_(virtual|re(sponse_headers|quest_headers))\\b", + "match": "(?i)\\bnsapi_(virtual|response_headers|request_headers)\\b", "name": "support.function.nsapi.php" }, { - "match": "(?i)\\boci(s(tatementtype|e(tprefetch|rverversion)|avelob(file)?)|n(umcols|ew(c(ollection|ursor)|descriptor)|logon)|c(o(l(umn(s(cale|ize)|name|type(raw)?|isnull|precision)|l(size|trim|a(ssign(elem)?|ppend)|getelem|max))|mmit)|loselob|ancel)|internaldebug|definebyname|_(s(tatement_type|e(t_(client_i(nfo|dentifier)|prefetch|edition|action|module_name)|rver_version))|n(um_(fields|rows)|ew_(c(o(nnect|llection)|ursor)|descriptor))|c(o(nnect|mmit)|l(ient_version|ose)|ancel)|internal_debug|define_by_name|p(connect|a(ssword_change|rse))|e(rror|xecute)|f(ield_(s(cale|ize)|name|type(_raw)?|is_null|precision)|etch(_(object|a(ssoc|ll|rray)|row))?|ree_(statement|descriptor))|lob_(copy|is_equal)|r(ollback|esult)|get_implicit_resultset|bind_(array_by_name|by_name))|p(logon|arse)|e(rror|xecute)|f(etch(statement|into)?|ree(statement|c(ollection|ursor)|desc))|write(temporarylob|lobtofile)|lo(adlob|go(n|ff))|r(o(wcount|llback)|esult)|bindbyname)\\b", + "match": "(?xi)\\b\n(\n oci(statementtype|setprefetch|serverversion|savelob(file)?|numcols|new(collection|cursor|descriptor)|nlogon|\n column(scale|size|name|type(raw)?|isnull|precision)|coll(size|trim|assign(elem)?|append|getelem|max)|commit|\n closelob|cancel|internaldebug|definebyname|plogon|parse|error|execute|fetch(statement|into)?|\n free(statement|collection|cursor|desc)|write(temporarylob|lobtofile)|loadlob|log(on|off)|rowcount|rollback|\n result|bindbyname)|\n oci_(statement_type|set_(client_(info|identifier)|prefetch|edition|action|module_name)|server_version|\n num_(fields|rows)|new_(connect|collection|cursor|descriptor)|connect|commit|client_version|close|cancel|\n internal_debug|define_by_name|pconnect|password_change|parse|error|execute|bind_(array_)?by_name|\n field_(scale|size|name|type(_raw)?|is_null|precision)|fetch(_(object|assoc|all|array|row))?|\n free_(statement|descriptor)|lob_(copy|is_equal)|rollback|result|get_implicit_resultset)\n)\\b", "name": "support.function.oci8.php" }, { @@ -2651,11 +2944,11 @@ "name": "support.function.opcache.php" }, { - "match": "(?i)\\bopenssl_(s(ign|pki_(new|export(_challenge)?|verify)|eal)|c(sr_(sign|new|export(_to_file)?|get_(subject|public_key))|ipher_iv_length)|open|d(h_compute_key|igest|ecrypt)|p(ublic_(decrypt|encrypt)|k(cs(12_(export(_to_file)?|read)|7_(sign|decrypt|encrypt|verify))|ey_(new|export(_to_file)?|free|get_(details|p(ublic|rivate))))|rivate_(decrypt|encrypt)|bkdf2)|e(ncrypt|rror_string)|verify|free_key|random_pseudo_bytes|get_(c(ipher_methods|ert_locations)|p(ublickey|rivatekey)|md_methods)|x509_(check(_private_key|purpose)|parse|export(_to_file)?|f(ingerprint|ree)|read))\\b", + "match": "(?xi)\\b\nopenssl_(\n sign|spki_(new|export(_challenge)?|verify)|seal|csr_(sign|new|export(_to_file)?|get_(subject|public_key))|\n cipher_iv_length|open|dh_compute_key|digest|decrypt|public_(decrypt|encrypt)|encrypt|error_string|\n pkcs12_(export(_to_file)?|read)|pkcs7_(sign|decrypt|encrypt|verify)|verify|free_key|random_pseudo_bytes|\n pkey_(new|export(_to_file)?|free|get_(details|public|private))|private_(decrypt|encrypt)|pbkdf2|\n get_((cipher|md)_methods|cert_locations|(public|private)key)|\n x509_(check_private_key|checkpurpose|parse|export(_to_file)?|fingerprint|free|read)\n)\\b", "name": "support.function.openssl.php" }, { - "match": "(?i)\\b(o(utput_(add_rewrite_var|reset_rewrite_vars)|b_(start|clean|implicit_flush|end_(clean|flush)|flush|list_handlers|g(zhandler|et_(status|c(ontents|lean)|flush|le(ngth|vel)))))|flush)\\b", + "match": "(?xi)\\b\n(\n output_(add_rewrite_var|reset_rewrite_vars)|flush|\n ob_(start|clean|implicit_flush|end_(clean|flush)|flush|list_handlers|gzhandler|\n get_(status|contents|clean|flush|length|level))\n)\\b", "name": "support.function.output.php" }, { @@ -2663,15 +2956,15 @@ "name": "support.function.password.php" }, { - "match": "(?i)\\bpcntl_(s(trerror|ig(nal(_dispatch)?|timedwait|procmask|waitinfo)|etpriority)|e(rrno|xec)|fork|w(stopsig|termsig|if(s(topped|ignaled)|exited)|exitstatus|ait(pid)?)|alarm|get(_last_error|priority))\\b", + "match": "(?xi)\\b\npcntl_(\n strerror|signal(_dispatch)?|sig(timedwait|procmask|waitinfo)|setpriority|errno|exec|fork|\n w(stopsig|termsig|if(stopped|signaled|exited))|wait(pid)?|alarm|getpriority|get_last_error\n)\\b", "name": "support.function.pcntl.php" }, { - "match": "(?i)\\bpg_(s(ocket|e(nd_(prepare|execute|query(_params)?)|t_(client_encoding|error_verbosity)|lect))|host|num_(fields|rows)|c(o(n(sume_input|nect(ion_(status|reset|busy)|_poll)?|vert)|py_(to|from))|l(ient_encoding|ose)|ancel_query)|t(ty|ra(nsaction_status|ce))|insert|options|d(elete|bname)|u(n(trace|escape_bytea)|pdate)|p(connect|ing|ort|ut_line|arameter_status|repare)|e(scape_(string|identifier|literal|bytea)|nd_copy|xecute)|version|query(_params)?|f(ield_(size|n(um|ame)|t(ype(_oid)?|able)|is_null|prtlen)|etch_(object|a(ssoc|ll(_columns)?|rray)|r(ow|esult))|lush|ree_result)|l(o_(seek|c(lose|reate)|t(ell|runcate)|import|open|unlink|export|write|read(_all)?)|ast_(notice|oid|error))|affected_rows|result_(s(tatus|eek)|error(_field)?)|get_(notify|pid|result)|meta_data)\\b", + "match": "(?xi)\\b\npg_(\n socket|send_(prepare|execute|query(_params)?)|set_(client_encoding|error_verbosity)|select|host|\n num_(fields|rows)|consume_input|connection_(status|reset|busy)|connect(_poll)?|convert|copy_(from|to)|\n client_encoding|close|cancel_query|tty|transaction_status|trace|insert|options|delete|dbname|untrace|\n unescape_bytea|update|pconnect|ping|port|put_line|parameter_status|prepare|version|query(_params)?|\n escape_(string|identifier|literal|bytea)|end_copy|execute|flush|free_result|last_(notice|error|oid)|\n field_(size|num|name|type(_oid)?|table|is_null|prtlen)|affected_rows|result_(status|seek|error(_field)?)|\n fetch_(object|assoc|all(_columns)?|array|row|result)|get_(notify|pid|result)|meta_data|\n lo_(seek|close|create|tell|truncate|import|open|unlink|export|write|read(_all)?)|\n)\\b", "name": "support.function.pgsql.php" }, { - "match": "(?i)\\b(virtual|apache_(setenv|note|child_terminate|lookup_uri|re(s(ponse_headers|et_timeout)|quest_headers)|get(_(version|modules)|env))|getallheaders)\\b", + "match": "(?i)\\b(virtual|getallheaders|apache_((get|set)env|note|child_terminate|lookup_uri|response_headers|reset_timeout|request_headers|get_(version|modules)))\\b", "name": "support.function.php_apache.php" }, { @@ -2679,19 +2972,19 @@ "name": "support.function.php_dom.php" }, { - "match": "(?i)\\bftp_(s(sl_connect|ystype|i(te|ze)|et_option)|n(list|b_(continue|put|f(put|get)|get))|c(h(dir|mod)|onnect|dup|lose)|delete|p(ut|wd|asv)|exec|quit|f(put|get)|login|alloc|r(ename|aw(list)?|mdir)|get(_option)?|m(dtm|kdir))\\b", + "match": "(?xi)\\b\nftp_(\n ssl_connect|systype|site|size|set_option|nlist|nb_(continue|f?(put|get))|ch(dir|mod)|connect|cdup|close|\n delete|put|pwd|pasv|exec|quit|f(put|get)|login|alloc|rename|raw(list)?|rmdir|get(_option)?|mdtm|mkdir\n)\\b", "name": "support.function.php_ftp.php" }, { - "match": "(?i)\\bimap_(s(can(mailbox)?|tatus|ort|ubscribe|e(t(_quota|flag_full|acl)|arch)|avebody)|header(s|info)?|num_(recent|msg)|c(heck|l(ose|earflag_full)|reate(mailbox)?)|t(hread|imeout)|open|delete(mailbox)?|8bit|u(n(subscribe|delete)|tf(7_(decode|encode)|8)|id)|ping|e(rrors|xpunge)|qprint|fetch(structure|header|text|_overview|mime|body)|l(sub|ist(s(can|ubscribed)|mailbox)?|ast_error)|a(ppend|lerts)|r(e(name(mailbox)?|open)|fc822_(parse_(headers|adrlist)|write_address))|g(c|et(subscribed|_quota(root)?|acl|mailboxes))|m(sgno|ime_header_decode|ail(_(co(py|mpose)|move)|boxmsginfo)?)|b(inary|ody(struct)?|ase64))\\b", + "match": "(?xi)\\b\nimap_(\n (create|delete|list|rename|scan)(mailbox)?|status|sort|subscribe|set_quota|set(flag_full|acl)|search|savebody|\n num_(recent|msg)|check|close|clearflag_full|thread|timeout|open|header(info)?|headers|append|alerts|reopen|\n 8bit|unsubscribe|undelete|utf7_(decode|encode)|utf8|uid|ping|errors|expunge|qprint|gc|\n fetch(structure|header|text|mime|body)|fetch_overview|lsub|list(scan|subscribed)|last_error|\n rfc822_(parse_(headers|adrlist)|write_address)|get(subscribed|acl|mailboxes)|get_quota(root)?|\n msgno|mime_header_decode|mail_(copy|compose|move)|mail|mailboxmsginfo|binary|body(struct)?|base64\n)\\b", "name": "support.function.php_imap.php" }, { - "match": "(?i)\\bmssql_(select_db|n(um_(fields|rows)|ext_result)|c(onnect|lose)|init|data_seek|pconnect|execute|query|f(ield_(seek|name|type|length)|etch_(object|field|a(ssoc|rray)|row|batch)|ree_(statement|result))|r(ows_affected|esult)|g(uid_string|et_last_message)|min_(error_severity|message_severity)|bind)\\b", + "match": "(?xi)\\b\nmssql_(\n select_db|num_(fields|rows)|next_result|connect|close|init|data_seek|pconnect|execute|query|\n field_(seek|name|type|length)|fetch_(object|field|assoc|array|row|batch)|free_(statement|result)|\n rows_affected|result|guid_string|get_last_message|min_(error|message)_severity|bind\n)\\b", "name": "support.function.php_mssql.php" }, { - "match": "(?i)\\bodbc_(s(tatistics|pecialcolumns|etoption)|n(um_(fields|rows)|ext_result)|c(o(nnect|lumn(s|privileges)|mmit)|ursor|lose(_all)?)|table(s|privileges)|d(o|ata_source)|p(connect|r(imarykeys|ocedure(s|columns)|epare))|e(rror(msg)?|xec(ute)?)|f(ield_(scale|n(um|ame)|type|precision|len)|oreignkeys|etch_(into|object|array|row)|ree_result)|longreadlen|autocommit|r(ollback|esult(_all)?)|gettypeinfo|binmode)\\b", + "match": "(?xi)\\b\nodbc_(\n statistics|specialcolumns|setoption|num_(fields|rows)|next_result|connect|columns|columnprivileges|commit|\n cursor|close(_all)?|tables|tableprivileges|do|data_source|pconnect|primarykeys|procedures|procedurecolumns|\n prepare|error(msg)?|exec(ute)?|field_(scale|num|name|type|precision|len)|foreignkeys|free_result|\n fetch_(into|object|array|row)|longreadlen|autocommit|rollback|result(_all)?|gettypeinfo|binmode\n)\\b", "name": "support.function.php_odbc.php" }, { @@ -2703,23 +2996,23 @@ "name": "support.function.php_spl.php" }, { - "match": "(?i)\\bzip_(close|open|entry_(name|c(ompress(ionmethod|edsize)|lose)|open|filesize|read)|read)\\b", + "match": "(?i)\\bzip_(close|open|entry_(name|compressionmethod|compressedsize|close|open|filesize|read)|read)\\b", "name": "support.function.php_zip.php" }, { - "match": "(?i)\\bposix_(s(trerror|et(sid|uid|pgid|e(uid|gid)|gid))|ctermid|t(tyname|imes)|i(satty|nitgroups)|uname|errno|kill|access|get(sid|cwd|uid|_last_error|p(id|pid|w(nam|uid)|g(id|rp))|e(uid|gid)|login|rlimit|g(id|r(nam|oups|gid)))|mk(nod|fifo))\\b", + "match": "(?xi)\\b\nposix_(\n strerror|set(s|e?u|[ep]?g)id|ctermid|ttyname|times|isatty|initgroups|uname|errno|kill|access|\n get(sid|cwd|uid|pid|ppid|pwnam|pwuid|pgid|pgrp|euid|egid|login|rlimit|gid|grnam|groups|grgid)|\n get_last_error|mknod|mkfifo\n)\\b", "name": "support.function.posix.php" }, { - "match": "(?i)\\bset(threadtitle|proctitle)\\b", + "match": "(?i)\\bset(thread|proc)title\\b", "name": "support.function.proctitle.php" }, { - "match": "(?i)\\bpspell_(s(tore_replacement|uggest|ave_wordlist)|new(_(config|personal))?|c(heck|onfig_(save_repl|create|ignore|d(ict_dir|ata_dir)|personal|r(untogether|epl)|mode)|lear_session)|add_to_(session|personal))\\b", + "match": "(?xi)\\b\npspell_(\n store_replacement|suggest|save_wordlist|new(_(config|personal))?|check|clear_session|\n config_(save_repl|create|ignore|(data|dict)_dir|personal|runtogether|repl|mode)|add_to_(session|personal)\n)\\b", "name": "support.function.pspell.php" }, { - "match": "(?i)\\breadline(_(c(ompletion_function|lear_history|allback_(handler_(install|remove)|read_char))|info|on_new_line|write_history|list_history|add_history|re(display|ad_history)))?\\b", + "match": "(?i)\\breadline(_(completion_function|clear_history|callback_(handler_(install|remove)|read_char)|info|on_new_line|write_history|list_history|add_history|redisplay|read_history))?\\b", "name": "support.function.readline.php" }, { @@ -2727,15 +3020,15 @@ "name": "support.function.recode.php" }, { - "match": "(?i)\\brrd(c_disconnect|_(create|tune|info|update|error|version|f(irst|etch)|last(update)?|restore|graph|xport))\\b", + "match": "(?i)\\brrd(c_disconnect|_(create|tune|info|update|error|version|first|fetch|last(update)?|restore|graph|xport))\\b", "name": "support.function.rrd.php" }, { - "match": "(?i)\\b(s(hm_(has_var|detach|put_var|attach|remove(_var)?|get_var)|em_(acquire|re(lease|move)|get))|ftok|msg_(s(tat_queue|e(nd|t_queue))|queue_exists|re(ceive|move_queue)|get_queue))\\b", + "match": "(?xi)\\b\n(\n shm_((get|has|remove|put)_var|detach|attach|remove)|sem_(acquire|release|remove|get)|ftok|\n msg_((get|remove|set|stat)_queue|send|queue_exists|receive)\n)\\b", "name": "support.function.sem.php" }, { - "match": "(?i)\\bsession_(s(ta(tus|rt)|et_(save_handler|cookie_params)|ave_path)|name|c(ommit|ache_(expire|limiter))|i(s_registered|d)|de(stroy|code)|un(set|register)|encode|write_close|abort|re(set|g(ister(_shutdown)?|enerate_id))|get_cookie_params|module_name)\\b", + "match": "(?xi)\\b\nsession_(\n status|start|set_(save_handler|cookie_params)|save_path|name|commit|cache_(expire|limiter)|\n is_registered|id|destroy|decode|unset|unregister|encode|write_close|abort|reset|register(_shutdown)?|\n regenerate_id|get_cookie_params|module_name\n)\\b", "name": "support.function.session.php" }, { @@ -2747,7 +3040,7 @@ "name": "support.function.simplexml.php" }, { - "match": "(?i)\\bsnmp(set|2_(set|walk|real_walk|get(next)?)|_(set_(oid_(numeric_print|output_format)|enum_print|valueretrieval|quick_print)|read_mib|get_(valueretrieval|quick_print))|3_(set|walk|real_walk|get(next)?)|walk(oid)?|realwalk|get(next)?)\\b", + "match": "(?xi)\\b\n(\n snmp(walk(oid)?|realwalk|get(next)?|set)|\n snmp_(set_(valueretrieval|quick_print|enum_print|oid_(numeric_print|output_format))|read_mib|\n get_(valueretrieval|quick_print))|\n snmp[23]_(set|walk|real_walk|get(next)?)\n)\\b", "name": "support.function.snmp.php" }, { @@ -2755,31 +3048,31 @@ "name": "support.function.soap.php" }, { - "match": "(?i)\\bsocket_(s(hutdown|trerror|e(nd(to|msg)?|t_(nonblock|option|block)|lect))|c(onnect|l(ose|ear_error)|reate(_(pair|listen))?|msg_space)|import_stream|write|l(isten|ast_error)|accept|re(cv(from|msg)?|ad)|get(sockname|_option|peername)|bind)\\b", + "match": "(?xi)\\b\nsocket_(\n shutdown|strerror|send(to|msg)?|set_((non)?block|option)|select|connect|close|clear_error|bind|\n create(_(pair|listen))?|cmsg_space|import_stream|write|listen|last_error|accept|recv(from|msg)?|\n read|get(peer|sock)name|get_option\n)\\b", "name": "support.function.sockets.php" }, { - "match": "(?i)\\bsqlite_(s(ingle_query|eek)|has_(prev|more)|n(um_(fields|rows)|ext)|c(hanges|olumn|urrent|lose|reate_(function|aggregate))|open|u(nbuffered_query|df_(decode_binary|encode_binary))|p(open|rev)|e(scape_string|rror_string|xec)|valid|key|query|f(ield_name|etch_(s(tring|ingle)|column_types|object|a(ll|rray))|actory)|l(ib(encoding|version)|ast_(insert_rowid|error))|array_query|rewind|busy_timeout)\\b", + "match": "(?xi)\\b\nsqlite_(\n single_query|seek|has_(more|prev)|num_(fields|rows)|next|changes|column|current|close|\n create_(aggregate|function)|open|unbuffered_query|udf_(decode|encode)_binary|popen|prev|\n escape_string|error_string|exec|valid|key|query|field_name|factory|\n fetch_(string|single|column_types|object|all|array)|lib(encoding|version)|\n last_(insert_rowid|error)|array_query|rewind|busy_timeout\n)\\b", "name": "support.function.sqlite.php" }, { - "match": "(?i)\\bsqlsrv_(se(nd_stream_data|rver_info)|has_rows|n(um_(fields|rows)|ext_result)|c(o(n(nect|figure)|mmit)|l(ient_info|ose)|ancel)|prepare|e(rrors|xecute)|query|f(ield_metadata|etch(_(object|array))?|ree_stmt)|ro(ws_affected|llback)|get_(config|field)|begin_transaction)\\b", + "match": "(?xi)\\b\nsqlsrv_(\n send_stream_data|server_info|has_rows|num_(fields|rows)|next_result|connect|configure|commit|\n client_info|close|cancel|prepare|errors|execute|query|field_metadata|fetch(_(array|object))?|\n free_stmt|rows_affected|rollback|get_(config|field)|begin_transaction\n)\\b", "name": "support.function.sqlsrv.php" }, { - "match": "(?i)\\bstats_(s(ta(ndard_deviation|t_(noncentral_t|correlation|in(nerproduct|dependent_t)|p(owersum|ercentile|aired_t)|gennch|binomial_coef))|kew)|harmonic_mean|c(ovariance|df_(n(oncentral_(chisquare|f)|egative_binomial)|c(hisquare|auchy)|t|uniform|poisson|exponential|f|weibull|l(ogistic|aplace)|gamma|b(inomial|eta)))|den(s_(n(ormal|egative_binomial)|c(hisquare|auchy)|t|pmf_(hypergeometric|poisson|binomial)|exponential|f|weibull|l(ogistic|aplace)|gamma|beta)|_uniform)|variance|kurtosis|absolute_deviation|rand_(setall|phrase_to_seeds|ranf|ge(n_(no(ncen(tral_(t|f)|ral_chisquare)|rmal)|chisquare|t|i(nt|uniform|poisson|binomial(_negative)?)|exponential|f(uniform)?|gamma|beta)|t_seeds)))\\b", + "match": "(?xi)\\b\nstats_(\n harmonic_mean|covariance|standard_deviation|skew|\n cdf_(noncentral_(chisquare|f)|negative_binomial|chisquare|cauchy|t|uniform|poisson|exponential|f|weibull|\n logistic|laplace|gamma|binomial|beta)|\n stat_(noncentral_t|correlation|innerproduct|independent_t|powersum|percentile|paired_t|gennch|binomial_coef)|\n dens_(normal|negative_binomial|chisquare|cauchy|t|pmf_(hypergeometric|poisson|binomial)|exponential|f|\n weibull|logistic|laplace|gamma|beta)|\n den_uniform|variance|kurtosis|absolute_deviation|\n rand_(setall|phrase_to_seeds|ranf|get_seeds|\n gen_(noncentral_[ft]|noncenral_chisquare|normal|chisquare|t|int|\n i(uniform|poisson|binomial(_negative)?)|exponential|f(uniform)?|gamma|beta))\n)\\b", "name": "support.function.stats.php" }, { - "match": "(?i)\\bs(tream_(s(ocket_(s(hutdown|e(ndto|rver))|client|pair|enable_crypto|accept|recvfrom|get_name)|upports_lock|e(t_(chunk_size|timeout|write_buffer|read_buffer|blocking)|lect))|notification_callback|co(ntext_(set_(option|default|params)|create|get_(options|default|params))|py_to_stream)|is_local|encoding|filter_(prepend|append|re(gister|move))|wrapper_(unregister|re(store|gister))|re(solve_include_path|gister_wrapper)|get_(contents|transports|filters|wrappers|line|meta_data)|bucket_(new|prepend|append|make_writeable))|et_socket_blocking)\\b", + "match": "(?xi)\\b\n(\n set_socket_blocking|\n stream_(socket_(shutdown|sendto|server|client|pair|enable_crypto|accept|recvfrom|get_name)|\n set_(chunk_size|timeout|(read|write)_buffer|blocking)|select|notification_callback|supports_lock|\n context_(set_(option|default|params)|create|get_(options|default|params))|copy_to_stream|is_local|\n encoding|filter_(append|prepend|register|remove)|wrapper_((un)?register|restore)|\n resolve_include_path|register_wrapper|get_(contents|transports|filters|wrappers|line|meta_data)|\n bucket_(new|prepend|append|make_writeable)\n )\n)\\b", "name": "support.function.streamsfuncs.php" }, { - "match": "(?i)\\b(s(scanf|ha1(_file)?|tr(s(tr|pn)|n(c(asecmp|mp)|atc(asecmp|mp))|c(spn|hr|oll|asecmp|mp)|t(o(upper|k|lower)|r)|i(str|p(slashes|cslashes|os|_tags))|_(s(huffle|plit)|ireplace|pad|word_count|r(ot13|ep(eat|lace))|getcsv)|p(os|brk)|len|r(chr|ipos|pos|ev))|imilar_text|oundex|ubstr(_(co(unt|mpare)|replace))?|printf|etlocale)|h(tml(specialchars(_decode)?|_entity_decode|entities)|e(x2bin|brev(c)?))|n(umber_format|l(2br|_langinfo))|c(h(op|unk_split|r)|o(nvert_(cyr_string|uu(decode|encode))|unt_chars)|r(ypt|c32))|trim|implode|ord|uc(first|words)|join|p(arse_str|rint(f)?)|e(cho|xplode)|v(sprintf|printf|fprintf)|quote(d_printable_(decode|encode)|meta)|fprintf|wordwrap|l(cfirst|trim|ocaleconv|evenshtein)|add(slashes|cslashes)|rtrim|get_html_translation_table|m(oney_format|d5(_file)?|etaphone)|bin2hex)\\b", + "match": "(?xi)\\b\n(\n money_format|md5(_file)?|metaphone|bin2hex|sscanf|sha1(_file)?|\n str(str|c?spn|n(at)?(case)?cmp|chr|coll|(case)?cmp|to(upper|lower)|tok|tr|istr|pos|pbrk|len|rchr|ri?pos|rev)|\n str_(getcsv|ireplace|pad|repeat|replace|rot13|shuffle|split|word_count)|\n strip(c?slashes|os)|strip_tags|similar_text|soundex|substr(_(count|compare|replace))?|setlocale|\n html(specialchars(_decode)?|entities)|html_entity_decode|hex2bin|hebrev(c)?|number_format|nl2br|nl_langinfo|\n chop|chunk_split|chr|convert_(cyr_string|uu(decode|encode))|count_chars|crypt|crc32|trim|implode|ord|\n uc(first|words)|join|parse_str|print(f)?|echo|explode|v?[fs]?printf|quoted_printable_(decode|encode)|\n quotemeta|wordwrap|lcfirst|[lr]trim|localeconv|levenshtein|addc?slashes|get_html_translation_table\n)\\b", "name": "support.function.string.php" }, { - "match": "(?i)\\bsybase_(se(t_message_handler|lect_db)|num_(fields|rows)|c(onnect|lose)|d(eadlock_retry_count|ata_seek)|unbuffered_query|pconnect|query|f(ield_seek|etch_(object|field|a(ssoc|rray)|row)|ree_result)|affected_rows|result|get_last_message|min_(server_severity|client_severity|error_severity|message_severity))\\b", + "match": "(?xi)\\b\nsybase_(\n set_message_handler|select_db|num_(fields|rows)|connect|close|deadlock_retry_count|data_seek|\n unbuffered_query|pconnect|query|field_seek|fetch_(object|field|assoc|array|row)|free_result|\n affected_rows|result|get_last_message|min_(client|error|message|server)_severity\n)\\b", "name": "support.function.sybase.php" }, { @@ -2787,7 +3080,7 @@ "name": "support.function.taint.php" }, { - "match": "(?i)\\b(tidy_(s(et(opt|_encoding)|ave_config)|c(onfig_count|lean_repair)|is_x(html|ml)|diagnose|parse_(string|file)|error_count|warning_count|load_config|access_count|re(set_config|pair_(string|file))|get(opt|_(status|h(tml(_ver)?|ead)|config|o(utput|pt_doc)|r(oot|elease)|body)))|ob_tidyhandler)\\b", + "match": "(?xi)\\b\n(\n tidy_((get|set)opt|set_encoding|save_config|config_count|clean_repair|is_(xhtml|xml)|diagnose|\n (access|error|warning)_count|load_config|reset_config|(parse|repair)_(string|file)|\n get_(status|html(_ver)?|head|config|output|opt_doc|root|release|body))|\n ob_tidyhandler\n)\\b", "name": "support.function.tidy.php" }, { @@ -2795,43 +3088,43 @@ "name": "support.function.tokenizer.php" }, { - "match": "(?i)\\btrader_(s(t(och(f|rsi)?|ddev)|in(h)?|u(m|b)|et_(compat|unstable_period)|qrt|ar(ext)?|ma)|ht_(sine|trend(line|mode)|dcp(hase|eriod)|phasor)|natr|c(ci|o(s(h)?|rrel)|dl(s(ho(otingstar|rtline)|t(icksandwich|alledpattern)|pinningtop|eparatinglines)|h(i(kkake(mod)?|ghwave)|omingpigeon|a(ngingman|rami(cross)?|mmer))|c(o(ncealbabyswall|unterattack)|losingmarubozu)|t(hrusting|a(sukigap|kuri)|ristar)|i(n(neck|vertedhammer)|dentical3crows)|2crows|onneck|d(oji(star)?|arkcloudcover|ragonflydoji)|u(nique3river|psidegap2crows)|3(starsinsouth|inside|outside|whitesoldiers|linestrike|blackcrows)|piercing|e(ngulfing|vening(star|dojistar))|kicking(bylength)?|l(ongl(ine|eggeddoji)|adderbottom)|a(dvanceblock|bandonedbaby)|ri(sefall3methods|ckshawman)|g(apsidesidewhite|ravestonedoji)|xsidegap3methods|m(orning(star|dojistar)|a(t(hold|chinglow)|rubozu))|b(elthold|reakaway))|eil|mo)|t(sf|ypprice|3|ema|an(h)?|r(i(x|ma)|ange))|obv|d(iv|ema|x)|ultosc|p(po|lus_d(i|m))|e(rrno|xp|ma)|var|kama|floor|w(clprice|illr|ma)|l(n|inearreg(_(slope|intercept|angle))?|og10)|a(sin|cos|t(an|r)|d(osc|d|x(r)?)?|po|vgprice|roon(osc)?)|r(si|oc(p|r(100)?)?)|get_(compat|unstable_period)|m(i(n(index|us_d(i|m)|max(index)?)?|dp(oint|rice))|om|ult|edprice|fi|a(cd(ext|fix)?|vp|x(index)?|ma)?)|b(op|eta|bands))\\b", + "match": "(?xi)\\b\ntrader_(\n stoch(f|r|rsi)?|stddev|sin(h)?|sum|sub|set_(compat|unstable_period)|sqrt|sar(ext)?|sma|\n ht_(sine|trend(line|mode)|dc(period|phase)|phasor)|natr|cci|cos(h)?|correl|\n cdl(shootingstar|shortline|sticksandwich|stalledpattern|spinningtop|separatinglines|\n hikkake(mod)?|highwave|homingpigeon|hangingman|harami(cross)?|hammer|concealbabyswall|\n counterattack|closingmarubozu|thrusting|tasukigap|takuri|tristar|inneck|invertedhammer|\n identical3crows|2crows|onneck|doji(star)?|darkcloudcover|dragonflydoji|unique3river|\n upsidegap2crows|3(starsinsouth|inside|outside|whitesoldiers|linestrike|blackcrows)|\n piercing|engulfing|evening(doji)?star|kicking(bylength)?|longline|longleggeddoji|\n ladderbottom|advanceblock|abandonedbaby|risefall3methods|rickshawman|gapsidesidewhite|\n gravestonedoji|xsidegap3methods|morning(doji)?star|mathold|matchinglow|marubozu|\n belthold|breakaway)|\n ceil|cmo|tsf|typprice|t3|tema|tan(h)?|trix|trima|trange|obv|div|dema|dx|ultosc|ppo|\n plus_d[im]|errno|exp|ema|var|kama|floor|wclprice|willr|wma|ln|log10|bop|beta|bbands|\n linearreg(_(slope|intercept|angle))?|asin|acos|atan|atr|adosc|ad|add|adx(r)?|apo|avgprice|\n aroon(osc)?|rsi|roc|rocp|rocr(100)?|get_(compat|unstable_period)|min(index)?|minus_d[im]|\n minmax(index)?|mid(point|price)|mom|mult|medprice|mfi|macd(ext|fix)?|mavp|max(index)?|ma(ma)?\n)\\b", "name": "support.function.trader.php" }, { - "match": "(?i)\\buopz_(co(py|mpose)|implement|overload|delete|undefine|extend|f(unction|lags)|re(store|name|define)|backup)\\b", + "match": "(?i)\\buopz_(copy|compose|implement|overload|delete|undefine|extend|function|flags|restore|rename|redefine|backup)\\b", "name": "support.function.uopz.php" }, { - "match": "(?i)\\b(http_build_query|url(decode|encode)|parse_url|rawurl(decode|encode)|get_(headers|meta_tags)|base64_(decode|encode))\\b", + "match": "(?i)\\b(http_build_query|(raw)?url(decode|encode)|parse_url|get_(headers|meta_tags)|base64_(decode|encode))\\b", "name": "support.function.url.php" }, { - "match": "(?i)\\b(s(trval|e(ttype|rialize))|i(s(set|_(s(calar|tring)|nu(ll|meric)|callable|int(eger)?|object|double|float|long|array|re(source|al)|bool))|ntval|mport_request_variables)|d(oubleval|ebug_zval_dump)|unse(t|rialize)|print_r|empty|var_(dump|export)|floatval|get(type|_(defined_vars|resource_type))|boolval)\\b", + "match": "(?xi)\\b\n(\n strval|settype|serialize|(bool|double|float)val|debug_zval_dump|intval|import_request_variables|isset|\n is_(scalar|string|null|numeric|callable|int(eger)?|object|double|float|long|array|resource|real|bool)|\n unset|unserialize|print_r|empty|var_(dump|export)|gettype|get_(defined_vars|resource_type)\n)\\b", "name": "support.function.var.php" }, { - "match": "(?i)\\bwddx_(serialize_va(lue|rs)|deserialize|packet_(start|end)|add_vars)\\b", + "match": "(?i)\\bwddx_(serialize_(value|vars)|deserialize|packet_(start|end)|add_vars)\\b", "name": "support.function.wddx.php" }, { - "match": "(?i)\\bxhprof_(sample_(disable|enable)|disable|enable)\\b", + "match": "(?i)\\bxhprof_(sample_)?(disable|enable)\\b", "name": "support.function.xhprof.php" }, { - "match": "(?i)\\b(utf8_(decode|encode)|xml_(set_(start_namespace_decl_handler|notation_decl_handler|character_data_handler|object|default_handler|unparsed_entity_decl_handler|processing_instruction_handler|e(nd_namespace_decl_handler|lement_handler|xternal_entity_ref_handler))|parse(_into_struct|r_(set_option|create(_ns)?|free|get_option))?|error_string|get_(current_(column_number|line_number|byte_index)|error_code)))\\b", + "match": "(?xi)\n\\b\n(\n utf8_(decode|encode)|\n xml_(set_((notation|(end|start)_namespace|unparsed_entity)_decl_handler|\n (character_data|default|element|external_entity_ref|processing_instruction)_handler|object)|\n parse(_into_struct)?|parser_((get|set)_option|create(_ns)?|free)|error_string|\n get_(current_((column|line)_number|byte_index)|error_code))\n)\\b", "name": "support.function.xml.php" }, { - "match": "(?i)\\bxmlrpc_(se(t_type|rver_(c(all_method|reate)|destroy|add_introspection_data|register_(introspection_callback|method)))|is_fault|decode(_request)?|parse_method_descriptions|encode(_request)?|get_type)\\b", + "match": "(?xi)\\b\nxmlrpc_(\n server_(call_method|create|destroy|add_introspection_data|register_(introspection_callback|method))|\n is_fault|decode(_request)?|parse_method_descriptions|encode(_request)?|(get|set)_type\n)\\b", "name": "support.function.xmlrpc.php" }, { - "match": "(?i)\\bxmlwriter_(s(tart_(c(omment|data)|d(td(_(e(ntity|lement)|attlist))?|ocument)|pi|element(_ns)?|attribute(_ns)?)|et_indent(_string)?)|text|o(utput_memory|pen_(uri|memory))|end_(c(omment|data)|d(td(_(e(ntity|lement)|attlist))?|ocument)|pi|element|attribute)|f(ull_end_element|lush)|write_(c(omment|data)|dtd(_(e(ntity|lement)|attlist))?|pi|element(_ns)?|attribute(_ns)?|raw))\\b", + "match": "(?xi)\\b\nxmlwriter_(\n (end|start|write)_(comment|cdata|dtd(_(attlist|entity|element))?|document|pi|attribute|element)|\n (start|write)_(attribute|element)_ns|write_raw|set_indent(_string)?|text|output_memory|open_(memory|uri)|\n full_end_element|flush|\n)\\b", "name": "support.function.xmlwriter.php" }, { - "match": "(?i)\\b(zlib_(decode|encode|get_coding_type)|readgzfile|gz(seek|c(ompress|lose)|tell|inflate|open|de(code|flate)|uncompress|p(uts|assthru)|e(ncode|of)|file|write|re(wind|ad)|get(s(s)?|c)))\\b", + "match": "(?xi)\\b\n(\n zlib_(decode|encode|get_coding_type)|readgzfile|\n gz(seek|compress|close|tell|inflate|open|decode|deflate|uncompress|puts|passthru|encode|eof|file|\n write|rewind|read|getc|getss?)\n)\\b", "name": "support.function.zlib.php" }, { @@ -2840,16 +3133,6 @@ } ] }, - "user-function-call": { - "begin": "(?i)(?=[a-z_0-9\\\\]*[a-z_][a-z0-9_]*\\s*\\()", - "end": "(?i)[a-z_][a-z_0-9]*(?=\\s*\\()", - "name": "meta.function-call.php", - "patterns": [ - { - "include": "#namespace" - } - ] - }, "var_basic": { "patterns": [ { @@ -2858,7 +3141,7 @@ "name": "punctuation.definition.variable.php" } }, - "match": "(?x)\n \t\t\t (\\$+)[a-zA-Z_\\x{7f}-\\x{ff}]\n \t\t\t [a-zA-Z0-9_\\x{7f}-\\x{ff}]*?\\b", + "match": "(?i)(\\$+)[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*\\b", "name": "variable.other.php" } ] @@ -2881,6 +3164,15 @@ "match": "(\\$)((GLOBALS|_(ENV|SERVER|SESSION)))", "name": "variable.other.global.safer.php" }, + "var_language": { + "match": "(\\$)this\\b", + "name": "variable.language.this.php", + "captures": { + "1": { + "name": "punctuation.definition.variable.php" + } + } + }, "variable-name": { "patterns": [ { @@ -2922,8 +3214,7 @@ "name": "punctuation.section.array.end.php" } }, - "comment": "Simple syntax: $foo, $foo[0], $foo[$bar], $foo->bar", - "match": "(?x)\n\t\t\t\t\t\t((\\$)(?[a-zA-Z_\\x{7f}-\\x{ff}][a-zA-Z0-9_\\x{7f}-\\x{ff}]*))\n\t\t\t\t\t\t(?:\n\t\t\t\t\t\t\t(->)(\\g)\n\t\t\t\t\t\t\t|\n\t\t\t\t\t\t\t(\\[)\n\t\t\t\t\t\t\t\t(?:(\\d+)|((\\$)\\g)|(\\w+))\n\t\t\t\t\t\t\t(\\])\n\t\t\t\t\t\t)?\n\t\t\t\t\t\t" + "match": "(?xi)\n((\\$)(?[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*))\n(?:\n (->)(\\g)\n |\n (\\[)(?:(\\d+)|((\\$)\\g)|([a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*))(\\])\n)?" }, { "captures": { @@ -2937,13 +3228,15 @@ "name": "punctuation.definition.variable.php" } }, - "comment": "Simple syntax with braces: \"foo${bar}baz\"", - "match": "(?x)\n\t\t\t\t\t\t((\\$\\{)(?[a-zA-Z_\\x{7f}-\\x{ff}][a-zA-Z0-9_\\x{7f}-\\x{ff}]*)(\\}))\n\t\t\t\t\t\t" + "match": "(?i)((\\${)(?[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)(}))" } ] }, "variables": { "patterns": [ + { + "include": "#var_language" + }, { "include": "#var_global" }, @@ -2954,15 +3247,15 @@ "include": "#var_basic" }, { - "begin": "(\\$\\{)(?=.*?\\})", + "begin": "\\${(?=.*?})", "beginCaptures": { - "1": { + "0": { "name": "punctuation.definition.variable.php" } }, - "end": "(\\})", + "end": "}", "endCaptures": { - "1": { + "0": { "name": "punctuation.definition.variable.php" } }, @@ -2974,6 +3267,5 @@ } ] } - }, - "version": "https://github.com/atom/language-php/commit/22047c19f52f686de471d0deccae0cb1332997b6" + } } \ No newline at end of file diff --git a/extensions/php/test/colorize-fixtures/issue-28354.php b/extensions/php/test/colorize-fixtures/issue-28354.php new file mode 100644 index 0000000000000000000000000000000000000000..a6fce36cda8248aca649d260664ad56623713abb --- /dev/null +++ b/extensions/php/test/colorize-fixtures/issue-28354.php @@ -0,0 +1,9 @@ + \ No newline at end of file diff --git a/extensions/php/test/colorize-results/issue-28354_php.json b/extensions/php/test/colorize-results/issue-28354_php.json new file mode 100644 index 0000000000000000000000000000000000000000..a78acbee7a0d3e6ccf5c396dffee9f6ea13cc2a3 --- /dev/null +++ b/extensions/php/test/colorize-results/issue-28354_php.json @@ -0,0 +1,541 @@ +[ + { + "c": "<", + "t": "text.html.php meta.embedded.block.html meta.tag.metadata.script.html punctuation.definition.tag.begin.html", + "r": { + "dark_plus": "punctuation.definition.tag: #808080", + "light_plus": "punctuation.definition.tag: #800000", + "dark_vs": "punctuation.definition.tag: #808080", + "light_vs": "punctuation.definition.tag: #800000", + "hc_black": "punctuation.definition.tag: #808080" + } + }, + { + "c": "script", + "t": "text.html.php meta.embedded.block.html meta.tag.metadata.script.html entity.name.tag.html", + "r": { + "dark_plus": "entity.name.tag: #569CD6", + "light_plus": "entity.name.tag: #800000", + "dark_vs": "entity.name.tag: #569CD6", + "light_vs": "entity.name.tag: #800000", + "hc_black": "entity.name.tag: #569CD6" + } + }, + { + "c": ">", + "t": "text.html.php meta.embedded.block.html meta.tag.metadata.script.html punctuation.definition.tag.end.html", + "r": { + "dark_plus": "punctuation.definition.tag: #808080", + "light_plus": "punctuation.definition.tag: #800000", + "dark_vs": "punctuation.definition.tag: #808080", + "light_vs": "punctuation.definition.tag: #800000", + "hc_black": "punctuation.definition.tag: #808080" + } + }, + { + "c": " ", + "t": "text.html.php meta.embedded.block.html source.js", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": "...", + "t": "text.html.php meta.embedded.block.html source.js keyword.operator.spread.js", + "r": { + "dark_plus": "keyword.operator: #D4D4D4", + "light_plus": "keyword.operator: #000000", + "dark_vs": "keyword.operator: #D4D4D4", + "light_vs": "keyword.operator: #000000", + "hc_black": "keyword.operator: #D4D4D4" + } + }, + { + "c": " ", + "t": "text.html.php meta.embedded.block.html source.js punctuation.whitespace.embedded.leading.php", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": "", + "t": "text.html.php meta.embedded.block.html source.js meta.embedded.block.php punctuation.section.embedded.end.php", + "r": { + "dark_plus": "punctuation.section.embedded.end.php: #569CD6", + "light_plus": "punctuation.section.embedded.end.php: #800000", + "dark_vs": "punctuation.section.embedded.end.php: #569CD6", + "light_vs": "punctuation.section.embedded.end.php: #800000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": " ", + "t": "text.html.php meta.embedded.block.html source.js", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": "...", + "t": "text.html.php meta.embedded.block.html source.js keyword.operator.spread.js", + "r": { + "dark_plus": "keyword.operator: #D4D4D4", + "light_plus": "keyword.operator: #000000", + "dark_vs": "keyword.operator: #D4D4D4", + "light_vs": "keyword.operator: #000000", + "hc_black": "keyword.operator: #D4D4D4" + } + }, + { + "c": "<", + "t": "text.html.php meta.embedded.block.html meta.tag.metadata.script.html punctuation.definition.tag.begin.html source.js", + "r": { + "dark_plus": "punctuation.definition.tag: #808080", + "light_plus": "punctuation.definition.tag: #800000", + "dark_vs": "punctuation.definition.tag: #808080", + "light_vs": "punctuation.definition.tag: #800000", + "hc_black": "punctuation.definition.tag: #808080" + } + }, + { + "c": "/", + "t": "text.html.php meta.embedded.block.html meta.tag.metadata.script.html punctuation.definition.tag.begin.html", + "r": { + "dark_plus": "punctuation.definition.tag: #808080", + "light_plus": "punctuation.definition.tag: #800000", + "dark_vs": "punctuation.definition.tag: #808080", + "light_vs": "punctuation.definition.tag: #800000", + "hc_black": "punctuation.definition.tag: #808080" + } + }, + { + "c": "script", + "t": "text.html.php meta.embedded.block.html meta.tag.metadata.script.html entity.name.tag.html", + "r": { + "dark_plus": "entity.name.tag: #569CD6", + "light_plus": "entity.name.tag: #800000", + "dark_vs": "entity.name.tag: #569CD6", + "light_vs": "entity.name.tag: #800000", + "hc_black": "entity.name.tag: #569CD6" + } + }, + { + "c": ">", + "t": "text.html.php meta.embedded.block.html meta.tag.metadata.script.html punctuation.definition.tag.end.html", + "r": { + "dark_plus": "punctuation.definition.tag: #808080", + "light_plus": "punctuation.definition.tag: #800000", + "dark_vs": "punctuation.definition.tag: #808080", + "light_vs": "punctuation.definition.tag: #800000", + "hc_black": "punctuation.definition.tag: #808080" + } + } +] \ No newline at end of file diff --git a/extensions/php/test/colorize-results/test_php.json b/extensions/php/test/colorize-results/test_php.json index 8285f8dee9b9a7781d81b7f9794fc379ed928deb..997b0b2fbadc07327bfe15d6c052217c6e96790b 100644 --- a/extensions/php/test/colorize-results/test_php.json +++ b/extensions/php/test/colorize-results/test_php.json @@ -232,7 +232,7 @@ }, { "c": "\t", - "t": "text.html.php meta.embedded.block.php source.php meta.function.php", + "t": "text.html.php meta.embedded.block.php source.php", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -276,7 +276,7 @@ }, { "c": "(", - "t": "text.html.php meta.embedded.block.php source.php meta.function.php punctuation.definition.parameters.begin.php", + "t": "text.html.php meta.embedded.block.php source.php meta.function.php punctuation.definition.parameters.begin.bracket.round.php", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -287,7 +287,7 @@ }, { "c": ")", - "t": "text.html.php meta.embedded.block.php source.php meta.function.php punctuation.definition.parameters.end.php", + "t": "text.html.php meta.embedded.block.php source.php meta.function.php punctuation.definition.parameters.end.bracket.round.php", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -507,7 +507,7 @@ }, { "c": "(", - "t": "text.html.php meta.embedded.block.php source.php meta.array.php punctuation.definition.array.begin.php", + "t": "text.html.php meta.embedded.block.php source.php meta.array.php punctuation.definition.array.begin.bracket.round.php", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -529,7 +529,7 @@ }, { "c": "ah", - "t": "text.html.php meta.embedded.block.php source.php meta.array.php string.quoted.double.php meta.string-contents.quoted.double.php", + "t": "text.html.php meta.embedded.block.php source.php meta.array.php string.quoted.double.php", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -573,7 +573,7 @@ }, { "c": "ac", - "t": "text.html.php meta.embedded.block.php source.php meta.array.php string.quoted.double.php meta.string-contents.quoted.double.php", + "t": "text.html.php meta.embedded.block.php source.php meta.array.php string.quoted.double.php", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -617,7 +617,7 @@ }, { "c": "ad", - "t": "text.html.php meta.embedded.block.php source.php meta.array.php string.quoted.double.php meta.string-contents.quoted.double.php", + "t": "text.html.php meta.embedded.block.php source.php meta.array.php string.quoted.double.php", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -661,7 +661,7 @@ }, { "c": "as", - "t": "text.html.php meta.embedded.block.php source.php meta.array.php string.quoted.double.php meta.string-contents.quoted.double.php", + "t": "text.html.php meta.embedded.block.php source.php meta.array.php string.quoted.double.php", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -716,7 +716,7 @@ }, { "c": "2h", - "t": "text.html.php meta.embedded.block.php source.php meta.array.php string.quoted.double.php meta.string-contents.quoted.double.php", + "t": "text.html.php meta.embedded.block.php source.php meta.array.php string.quoted.double.php", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -760,7 +760,7 @@ }, { "c": "2c", - "t": "text.html.php meta.embedded.block.php source.php meta.array.php string.quoted.double.php meta.string-contents.quoted.double.php", + "t": "text.html.php meta.embedded.block.php source.php meta.array.php string.quoted.double.php", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -804,7 +804,7 @@ }, { "c": "2d", - "t": "text.html.php meta.embedded.block.php source.php meta.array.php string.quoted.double.php meta.string-contents.quoted.double.php", + "t": "text.html.php meta.embedded.block.php source.php meta.array.php string.quoted.double.php", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -848,7 +848,7 @@ }, { "c": "2s", - "t": "text.html.php meta.embedded.block.php source.php meta.array.php string.quoted.double.php meta.string-contents.quoted.double.php", + "t": "text.html.php meta.embedded.block.php source.php meta.array.php string.quoted.double.php", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -870,7 +870,7 @@ }, { "c": ")", - "t": "text.html.php meta.embedded.block.php source.php meta.array.php punctuation.definition.array.end.php", + "t": "text.html.php meta.embedded.block.php source.php meta.array.php punctuation.definition.array.end.bracket.round.php", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -903,7 +903,7 @@ }, { "c": "srand", - "t": "text.html.php meta.embedded.block.php source.php support.function.math.php", + "t": "text.html.php meta.embedded.block.php source.php meta.function-call.php support.function.math.php", "r": { "dark_plus": "support.function: #DCDCAA", "light_plus": "support.function: #795E26", @@ -914,7 +914,7 @@ }, { "c": "(", - "t": "text.html.php meta.embedded.block.php source.php", + "t": "text.html.php meta.embedded.block.php source.php meta.function-call.php punctuation.definition.arguments.begin.bracket.round.php", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -925,7 +925,7 @@ }, { "c": "time", - "t": "text.html.php meta.embedded.block.php source.php support.function.datetime.php", + "t": "text.html.php meta.embedded.block.php source.php meta.function-call.php meta.function-call.php support.function.datetime.php", "r": { "dark_plus": "support.function: #DCDCAA", "light_plus": "support.function: #795E26", @@ -935,8 +935,30 @@ } }, { - "c": "())", - "t": "text.html.php meta.embedded.block.php source.php", + "c": "(", + "t": "text.html.php meta.embedded.block.php source.php meta.function-call.php meta.function-call.php punctuation.definition.arguments.begin.bracket.round.php", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": ")", + "t": "text.html.php meta.embedded.block.php source.php meta.function-call.php meta.function-call.php punctuation.definition.arguments.end.bracket.round.php", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": ")", + "t": "text.html.php meta.embedded.block.php source.php meta.function-call.php punctuation.definition.arguments.end.bracket.round.php", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -980,7 +1002,7 @@ }, { "c": "(", - "t": "text.html.php meta.embedded.block.php source.php", + "t": "text.html.php meta.embedded.block.php source.php punctuation.definition.begin.bracket.round.php", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1199,7 +1221,18 @@ } }, { - "c": ") ", + "c": ")", + "t": "text.html.php meta.embedded.block.php source.php punctuation.definition.end.bracket.round.php", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": " ", "t": "text.html.php meta.embedded.block.php source.php", "r": { "dark_plus": "default: #D4D4D4", @@ -1288,7 +1321,7 @@ }, { "c": "count", - "t": "text.html.php meta.embedded.block.php source.php support.function.array.php", + "t": "text.html.php meta.embedded.block.php source.php meta.function-call.php support.function.array.php", "r": { "dark_plus": "support.function: #DCDCAA", "light_plus": "support.function: #795E26", @@ -1299,7 +1332,7 @@ }, { "c": "(", - "t": "text.html.php meta.embedded.block.php source.php", + "t": "text.html.php meta.embedded.block.php source.php meta.function-call.php punctuation.definition.arguments.begin.bracket.round.php", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1310,7 +1343,7 @@ }, { "c": "$", - "t": "text.html.php meta.embedded.block.php source.php variable.other.php punctuation.definition.variable.php", + "t": "text.html.php meta.embedded.block.php source.php meta.function-call.php variable.other.php punctuation.definition.variable.php", "r": { "dark_plus": "variable: #9CDCFE", "light_plus": "variable: #001080", @@ -1321,7 +1354,7 @@ }, { "c": "cards", - "t": "text.html.php meta.embedded.block.php source.php variable.other.php", + "t": "text.html.php meta.embedded.block.php source.php meta.function-call.php variable.other.php", "r": { "dark_plus": "variable: #9CDCFE", "light_plus": "variable: #001080", @@ -1332,7 +1365,7 @@ }, { "c": ")", - "t": "text.html.php meta.embedded.block.php source.php", + "t": "text.html.php meta.embedded.block.php source.php meta.function-call.php punctuation.definition.arguments.end.bracket.round.php", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1408,7 +1441,7 @@ } }, { - "c": " (", + "c": " ", "t": "text.html.php meta.embedded.block.php source.php", "r": { "dark_plus": "default: #D4D4D4", @@ -1418,9 +1451,20 @@ "hc_black": "default: #FFFFFF" } }, + { + "c": "(", + "t": "text.html.php meta.embedded.block.php source.php punctuation.definition.begin.bracket.round.php", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, { "c": "rand", - "t": "text.html.php meta.embedded.block.php source.php support.function.math.php", + "t": "text.html.php meta.embedded.block.php source.php meta.function-call.php support.function.math.php", "r": { "dark_plus": "support.function: #DCDCAA", "light_plus": "support.function: #795E26", @@ -1430,8 +1474,19 @@ } }, { - "c": "()", - "t": "text.html.php meta.embedded.block.php source.php", + "c": "(", + "t": "text.html.php meta.embedded.block.php source.php meta.function-call.php punctuation.definition.arguments.begin.bracket.round.php", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": ")", + "t": "text.html.php meta.embedded.block.php source.php meta.function-call.php punctuation.definition.arguments.end.bracket.round.php", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1475,7 +1530,7 @@ }, { "c": ")", - "t": "text.html.php meta.embedded.block.php source.php", + "t": "text.html.php meta.embedded.block.php source.php punctuation.definition.end.bracket.round.php", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1519,7 +1574,7 @@ }, { "c": "(", - "t": "text.html.php meta.embedded.block.php source.php", + "t": "text.html.php meta.embedded.block.php source.php punctuation.definition.begin.bracket.round.php", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1650,7 +1705,18 @@ } }, { - "c": ") ", + "c": ")", + "t": "text.html.php meta.embedded.block.php source.php punctuation.definition.end.bracket.round.php", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": " ", "t": "text.html.php meta.embedded.block.php source.php", "r": { "dark_plus": "default: #D4D4D4", @@ -2157,7 +2223,7 @@ }, { "c": "srand", - "t": "text.html.php meta.embedded.block.php source.php support.function.math.php", + "t": "text.html.php meta.embedded.block.php source.php meta.function-call.php support.function.math.php", "r": { "dark_plus": "support.function: #DCDCAA", "light_plus": "support.function: #795E26", @@ -2168,7 +2234,7 @@ }, { "c": "(", - "t": "text.html.php meta.embedded.block.php source.php", + "t": "text.html.php meta.embedded.block.php source.php meta.function-call.php punctuation.definition.arguments.begin.bracket.round.php", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2179,7 +2245,7 @@ }, { "c": "time", - "t": "text.html.php meta.embedded.block.php source.php support.function.datetime.php", + "t": "text.html.php meta.embedded.block.php source.php meta.function-call.php meta.function-call.php support.function.datetime.php", "r": { "dark_plus": "support.function: #DCDCAA", "light_plus": "support.function: #795E26", @@ -2189,8 +2255,30 @@ } }, { - "c": "())", - "t": "text.html.php meta.embedded.block.php source.php", + "c": "(", + "t": "text.html.php meta.embedded.block.php source.php meta.function-call.php meta.function-call.php punctuation.definition.arguments.begin.bracket.round.php", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": ")", + "t": "text.html.php meta.embedded.block.php source.php meta.function-call.php meta.function-call.php punctuation.definition.arguments.end.bracket.round.php", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": ")", + "t": "text.html.php meta.embedded.block.php source.php meta.function-call.php punctuation.definition.arguments.end.bracket.round.php", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2266,7 +2354,7 @@ } }, { - "c": " (", + "c": " ", "t": "text.html.php meta.embedded.block.php source.php", "r": { "dark_plus": "default: #D4D4D4", @@ -2276,9 +2364,20 @@ "hc_black": "default: #FFFFFF" } }, + { + "c": "(", + "t": "text.html.php meta.embedded.block.php source.php punctuation.definition.begin.bracket.round.php", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, { "c": "rand", - "t": "text.html.php meta.embedded.block.php source.php support.function.math.php", + "t": "text.html.php meta.embedded.block.php source.php meta.function-call.php support.function.math.php", "r": { "dark_plus": "support.function: #DCDCAA", "light_plus": "support.function: #795E26", @@ -2288,8 +2387,19 @@ } }, { - "c": "()", - "t": "text.html.php meta.embedded.block.php source.php", + "c": "(", + "t": "text.html.php meta.embedded.block.php source.php meta.function-call.php punctuation.definition.arguments.begin.bracket.round.php", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": ")", + "t": "text.html.php meta.embedded.block.php source.php meta.function-call.php punctuation.definition.arguments.end.bracket.round.php", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2322,7 +2432,7 @@ }, { "c": ")", - "t": "text.html.php meta.embedded.block.php source.php", + "t": "text.html.php meta.embedded.block.php source.php punctuation.definition.end.bracket.round.php", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2355,7 +2465,7 @@ }, { "c": "print", - "t": "text.html.php meta.embedded.block.php source.php support.function.construct.output.php", + "t": "text.html.php meta.embedded.block.php source.php meta.function-call.php support.function.construct.output.php", "r": { "dark_plus": "support.function: #DCDCAA", "light_plus": "support.function: #795E26", @@ -2366,7 +2476,7 @@ }, { "c": "(", - "t": "text.html.php meta.embedded.block.php source.php", + "t": "text.html.php meta.embedded.block.php source.php meta.function-call.php punctuation.definition.arguments.begin.bracket.round.php", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2377,7 +2487,7 @@ }, { "c": "\"", - "t": "text.html.php meta.embedded.block.php source.php string.quoted.double.php punctuation.definition.string.begin.php", + "t": "text.html.php meta.embedded.block.php source.php meta.function-call.php string.quoted.double.php punctuation.definition.string.begin.php", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -2388,7 +2498,7 @@ }, { "c": "Starting point for cut cards is: ", - "t": "text.html.php meta.embedded.block.php source.php string.quoted.double.php meta.string-contents.quoted.double.php", + "t": "text.html.php meta.embedded.block.php source.php meta.function-call.php string.quoted.double.php", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -2399,7 +2509,7 @@ }, { "c": "$", - "t": "text.html.php meta.embedded.block.php source.php string.quoted.double.php meta.string-contents.quoted.double.php variable.other.php punctuation.definition.variable.php", + "t": "text.html.php meta.embedded.block.php source.php meta.function-call.php string.quoted.double.php variable.other.php punctuation.definition.variable.php", "r": { "dark_plus": "variable: #9CDCFE", "light_plus": "variable: #001080", @@ -2410,7 +2520,7 @@ }, { "c": "starting_point", - "t": "text.html.php meta.embedded.block.php source.php string.quoted.double.php meta.string-contents.quoted.double.php variable.other.php", + "t": "text.html.php meta.embedded.block.php source.php meta.function-call.php string.quoted.double.php variable.other.php", "r": { "dark_plus": "variable: #9CDCFE", "light_plus": "variable: #001080", @@ -2421,7 +2531,7 @@ }, { "c": "

${text}

`; - }; + } + let attributes: string[] = []; + if (href) { + attributes.push(`src="${href}"`); + } + if (text) { + attributes.push(`alt="${text}"`); + } + if (title) { + attributes.push(`title="${title}"`); + } + if (dimensions.length) { + attributes = attributes.concat(dimensions); + } + return ''; + }; + renderer.link = (href, title, text): string => { + // Remove markdown escapes. Workaround for https://github.com/chjj/marked/issues/829 + if (href === text) { // raw link case + text = removeMarkdownEscapes(text); + } + title = removeMarkdownEscapes(title); + href = removeMarkdownEscapes(href); + if (href && !href.match(/^http:|https:|file:|mailto:/i)) { + return text; + } + return `${text}`; + }; + renderer.paragraph = (text): string => { + return `

${text}

`; + }; - if (options.codeBlockRenderer) { - renderer.code = (code, lang) => { - let value = options.codeBlockRenderer(lang, code); - if (typeof value === 'string') { - return value; - } + if (options.codeBlockRenderer) { + renderer.code = (code, lang) => { + let value = options.codeBlockRenderer(lang, code); + if (typeof value === 'string') { + return value; + } - if (TPromise.is(value)) { - // when code-block rendering is async we return sync - // but update the node with the real result later. - const id = defaultGenerator.nextId(); - TPromise.join([value, withInnerHTML]).done(values => { - let strValue = values[0] as string; - let span = element.querySelector(`span[data-code="${id}"]`); - if (span) { - span.innerHTML = strValue; - } - }, err => { - // ignore - }); - return `${escape(code)}`; - } + if (TPromise.is(value)) { + // when code-block rendering is async we return sync + // but update the node with the real result later. + const id = defaultGenerator.nextId(); + TPromise.join([value, withInnerHTML]).done(values => { + let strValue = values[0] as string; + let span = element.querySelector(`span[data-code="${id}"]`); + if (span) { + span.innerHTML = strValue; + } + }, err => { + // ignore + }); + return `${escape(code)}`; + } - return code; - }; - } + return code; + }; + } - if (options.actionCallback) { - DOM.addStandardDisposableListener(element, 'click', event => { - if (event.target.tagName === 'A') { - const href = event.target.dataset['href']; - if (href) { - options.actionCallback(href, event); - } + if (options.actionCallback) { + DOM.addStandardDisposableListener(element, 'click', event => { + if (event.target.tagName === 'A') { + const href = event.target.dataset['href']; + if (href) { + options.actionCallback(href, event); } - }); - } - - element.innerHTML = marked(content.markdown, { - sanitize: true, - renderer + } }); - signalInnerHTML(); } - return element; -} + element.innerHTML = marked(markdown, { + sanitize: true, + renderer + }); + signalInnerHTML(); -var SAFE_TAG_NAMES = { - a: true, - b: true, - blockquote: true, - code: true, - del: true, - dd: true, - div: true, - dl: true, - dt: true, - em: true, - h1h2h3i: true, - img: true, - kbd: true, - li: true, - ol: true, - p: true, - pre: true, - s: true, - span: true, - sup: true, - sub: true, - strong: true, - strike: true, - ul: true, - br: true, - hr: true, -}; - -function getSafeTagName(tagName: string): string { - if (!tagName) { - return null; - } - if (SAFE_TAG_NAMES.hasOwnProperty(tagName)) { - return tagName; - } - return null; + return element; } // --- formatted string parsing @@ -275,7 +219,7 @@ interface IFormatParseTree { children?: IFormatParseTree[]; } -function renderFormattedText(element: Node, treeNode: IFormatParseTree, actionCallback?: (content: string, event?: IMouseEvent) => void) { +function _renderFormattedText(element: Node, treeNode: IFormatParseTree, actionCallback?: (content: string, event?: IMouseEvent) => void) { var child: Node; if (treeNode.type === FormatType.Text) { @@ -309,7 +253,7 @@ function renderFormattedText(element: Node, treeNode: IFormatParseTree, actionCa if (Array.isArray(treeNode.children)) { treeNode.children.forEach((nodeChild) => { - renderFormattedText(child, nodeChild, actionCallback); + _renderFormattedText(child, nodeChild, actionCallback); }); } } diff --git a/src/vs/base/browser/ui/actionbar/actionbar.ts b/src/vs/base/browser/ui/actionbar/actionbar.ts index 452b2ece1e53065c72ac33b699139d6b0afe7c51..5ec92db83be9b221e6a12ad88cb1eaeb186795be 100644 --- a/src/vs/base/browser/ui/actionbar/actionbar.ts +++ b/src/vs/base/browser/ui/actionbar/actionbar.ts @@ -218,6 +218,7 @@ export interface IActionItemOptions extends IBaseActionItemOptions { icon?: boolean; label?: boolean; keybinding?: string; + isMenu?: boolean; } export class ActionItem extends BaseActionItem { @@ -239,7 +240,11 @@ export class ActionItem extends BaseActionItem { super.render(container); this.$e = $('a.action-label').appendTo(this.builder); - this.$e.attr({ role: 'button' }); + if (this.options.isMenu) { + this.$e.attr({ role: 'menuitem' }); + } else { + this.$e.attr({ role: 'button' }); + } if (this.options.label && this.options.keybinding) { $('span.keybinding').text(this.options.keybinding).appendTo(this.builder); @@ -343,6 +348,7 @@ export interface IActionBarOptions { actionRunner?: IActionRunner; ariaLabel?: string; animated?: boolean; + isMenu?: boolean; } let defaultOptions: IActionBarOptions = { @@ -458,7 +464,11 @@ export class ActionBar extends EventEmitter implements IActionRunner { this.actionsList = document.createElement('ul'); this.actionsList.className = 'actions-container'; - this.actionsList.setAttribute('role', 'toolbar'); + if (this.options.isMenu) { + this.actionsList.setAttribute('role', 'menubar'); + } else { + this.actionsList.setAttribute('role', 'toolbar'); + } if (this.options.ariaLabel) { this.actionsList.setAttribute('aria-label', this.options.ariaLabel); } diff --git a/src/vs/base/browser/ui/aria/aria.css b/src/vs/base/browser/ui/aria/aria.css index fd795b9af1b0fbfda0f422b06a8ee878ee9b0802..75ae8780fe1040e10558e945f231bb2c011f61e1 100644 --- a/src/vs/base/browser/ui/aria/aria.css +++ b/src/vs/base/browser/ui/aria/aria.css @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -.aria-container { +.monaco-aria-container { position: absolute; /* try to hide from workbench but not from screen readers */ left:-999em; } \ No newline at end of file diff --git a/src/vs/base/browser/ui/aria/aria.ts b/src/vs/base/browser/ui/aria/aria.ts index dd5776ab9f894af49c2ca9660ece523a7a838cd5..ff89cc491727af756f90cbc47108d30e8b58e660 100644 --- a/src/vs/base/browser/ui/aria/aria.ts +++ b/src/vs/base/browser/ui/aria/aria.ts @@ -14,10 +14,10 @@ let ariaContainer: Builder; let alertContainer: Builder; let statusContainer: Builder; export function setARIAContainer(parent: HTMLElement) { - ariaContainer = $('.aria-container').appendTo(parent); + ariaContainer = $('.monaco-aria-container').appendTo(parent); - alertContainer = $('.alert').appendTo(ariaContainer).attr({ 'role': 'alert', 'aria-atomic': 'true' }); - statusContainer = $('.status').appendTo(ariaContainer).attr({ 'role': 'status', 'aria-atomic': 'true' }); + alertContainer = $('.monaco-alert').appendTo(ariaContainer).attr({ 'role': 'alert', 'aria-atomic': 'true' }); + statusContainer = $('.monaco-status').appendTo(ariaContainer).attr({ 'role': 'status', 'aria-atomic': 'true' }); } /** diff --git a/src/vs/base/browser/ui/countBadge/countBadge.ts b/src/vs/base/browser/ui/countBadge/countBadge.ts index a7fa56efce8513d8267ea20d2fafa07473e08a3b..8ff58693925e51d5de8de5029e52a8ebf8620b98 100644 --- a/src/vs/base/browser/ui/countBadge/countBadge.ts +++ b/src/vs/base/browser/ui/countBadge/countBadge.ts @@ -8,8 +8,8 @@ import 'vs/css!./countBadge'; import { $, append } from 'vs/base/browser/dom'; import { format } from 'vs/base/common/strings'; -import { Color } from "vs/base/common/color"; -import { mixin } from "vs/base/common/objects"; +import { Color } from 'vs/base/common/color'; +import { mixin } from 'vs/base/common/objects'; export interface ICountBadgeOptions extends ICountBadgetyles { count?: number; diff --git a/src/vs/base/browser/ui/dropdown/dropdown.ts b/src/vs/base/browser/ui/dropdown/dropdown.ts index f670bf899e4564bf8bff6b55fee53a8e58038731..b01ac4b60f6fb59a8b731b681c070da5a5b00d0e 100644 --- a/src/vs/base/browser/ui/dropdown/dropdown.ts +++ b/src/vs/base/browser/ui/dropdown/dropdown.ts @@ -8,7 +8,7 @@ import 'vs/css!./dropdown'; import { Builder, $ } from 'vs/base/browser/builder'; import { TPromise } from 'vs/base/common/winjs.base'; -import { Gesture, EventType } from 'vs/base/browser/touch'; +import { Gesture, EventType as GestureEventType } from 'vs/base/browser/touch'; import { ActionRunner, IAction } from 'vs/base/common/actions'; import { IActionItem } from 'vs/base/browser/ui/actionbar/actionbar'; import { EventEmitter } from 'vs/base/common/eventEmitter'; @@ -16,6 +16,7 @@ import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { IContextViewProvider } from 'vs/base/browser/ui/contextview/contextview'; import { IMenuOptions } from 'vs/base/browser/ui/menu/menu'; import { ResolvedKeybinding } from 'vs/base/common/keyCodes'; +import { EventHelper, EventType } from 'vs/base/browser/dom'; export interface ILabelRenderer { (container: HTMLElement): IDisposable; @@ -50,11 +51,15 @@ export class BaseDropdown extends ActionRunner { }; } - this.$label.on(['mousedown', EventType.Tap], (e: Event) => { - e.preventDefault(); - e.stopPropagation(); - - this.show(); + this.$label.on([EventType.CLICK, EventType.MOUSE_DOWN, GestureEventType.Tap], (e: Event) => { + EventHelper.stop(e, true); // prevent default click behaviour to trigger + }).on([EventType.MOUSE_DOWN, GestureEventType.Tap], (e: Event) => { + // We want to show the context menu on dropdown so that as a user you can press and hold the + // mouse button, make a choice of action in the menu and release the mouse to trigger that + // action. + // Due to some weird bugs though, we delay showing the menu to unwind event stack + // (see https://github.com/Microsoft/vscode/issues/27648) + setTimeout(() => this.show(), 100); }).appendTo(this.$el); let cleanupFn = labelRenderer(this.$label.getHTMLElement()); diff --git a/src/vs/base/browser/ui/iconLabel/iconLabel.ts b/src/vs/base/browser/ui/iconLabel/iconLabel.ts index e4461fc0ca63e4991c15333fc36ff3aedb3662d2..2e75d8666720c1b20c951fc39e1fbd3eb613f0bd 100644 --- a/src/vs/base/browser/ui/iconLabel/iconLabel.ts +++ b/src/vs/base/browser/ui/iconLabel/iconLabel.ts @@ -11,8 +11,7 @@ import { HighlightedLabel } from 'vs/base/browser/ui/highlightedlabel/highlighte import { IMatch } from 'vs/base/common/filters'; import uri from 'vs/base/common/uri'; import paths = require('vs/base/common/paths'); -import types = require('vs/base/common/types'); -import { IWorkspaceProvider, getPathLabel, IUserHomeProvider } from 'vs/base/common/labels'; +import { IRootProvider, getPathLabel, IUserHomeProvider } from 'vs/base/common/labels'; export interface IIconLabelCreationOptions { supportHighlights?: boolean; @@ -99,30 +98,15 @@ export class IconLabel { export class FileLabel extends IconLabel { - constructor(container: HTMLElement, file: uri, provider: IWorkspaceProvider, userHome?: IUserHomeProvider) { + constructor(container: HTMLElement, file: uri, provider: IRootProvider, userHome?: IUserHomeProvider) { super(container); this.setFile(file, provider, userHome); } - public setFile(file: uri, provider: IWorkspaceProvider, userHome: IUserHomeProvider): void { - const path = getPath(file); - const parent = paths.dirname(path); + public setFile(file: uri, provider: IRootProvider, userHome: IUserHomeProvider): void { + const parent = paths.dirname(file.fsPath); - this.setValue(paths.basename(path), parent && parent !== '.' ? getPathLabel(parent, provider, userHome) : '', { title: path }); + this.setValue(paths.basename(file.fsPath), parent && parent !== '.' ? getPathLabel(parent, provider, userHome) : '', { title: file.fsPath }); } -} - -function getPath(arg1: uri | IWorkspaceProvider): string { - if (!arg1) { - return null; - } - - if (types.isFunction((arg1).getWorkspace)) { - const ws = (arg1).getWorkspace(); - - return ws ? ws.resource.fsPath : void 0; - } - - return (arg1).fsPath; } \ No newline at end of file diff --git a/src/vs/base/browser/ui/inputbox/inputBox.ts b/src/vs/base/browser/ui/inputbox/inputBox.ts index 87f6428e526d6105fea9953b91eb888740801cdf..18b09e697e87723c4a1efc71799e42e9070eeddb 100644 --- a/src/vs/base/browser/ui/inputbox/inputBox.ts +++ b/src/vs/base/browser/ui/inputbox/inputBox.ts @@ -9,8 +9,7 @@ import 'vs/css!./inputBox'; import nls = require('vs/nls'); import * as Bal from 'vs/base/browser/browser'; import * as dom from 'vs/base/browser/dom'; -import { IHTMLContentElement } from 'vs/base/common/htmlContent'; -import { renderHtml } from 'vs/base/browser/htmlContentRenderer'; +import { RenderOptions, renderFormattedText, renderText } from 'vs/base/browser/htmlContentRenderer'; import aria = require('vs/base/browser/ui/aria/aria'); import { IAction } from 'vs/base/common/actions'; import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar'; @@ -381,18 +380,14 @@ export class InputBox extends Widget { div = dom.append(container, $('.monaco-inputbox-container')); layout(); - let renderOptions: IHTMLContentElement = { - tagName: 'span', - className: 'monaco-inputbox-message', + const renderOptions: RenderOptions = { + inline: true, + className: 'monaco-inputbox-message' }; - if (this.message.formatContent) { - renderOptions.formattedText = this.message.content; - } else { - renderOptions.text = this.message.content; - } - - let spanElement: HTMLElement = renderHtml(renderOptions); + let spanElement: HTMLElement = (this.message.formatContent + ? renderFormattedText(this.message.content, renderOptions) + : renderText(this.message.content, renderOptions)) as any; dom.addClass(spanElement, this.classForType(this.message.type)); const styles = this.stylesForType(this.message.type); diff --git a/src/vs/base/browser/ui/keybindingLabel/keybindingLabel.ts b/src/vs/base/browser/ui/keybindingLabel/keybindingLabel.ts index cee68a0de3a7afeb124f610a3d958b6d61943ea1..f59b03858115b079ba5bb4936366c232a18e88bd 100644 --- a/src/vs/base/browser/ui/keybindingLabel/keybindingLabel.ts +++ b/src/vs/base/browser/ui/keybindingLabel/keybindingLabel.ts @@ -9,7 +9,7 @@ import { IDisposable } from 'vs/base/common/lifecycle'; import { equals } from 'vs/base/common/objects'; import { OperatingSystem } from 'vs/base/common/platform'; import { ResolvedKeybinding, ResolvedKeybindingPart } from 'vs/base/common/keyCodes'; -import { UILabelProvider } from 'vs/platform/keybinding/common/keybindingLabels'; +import { UILabelProvider } from 'vs/base/common/keybindingLabels'; import * as dom from 'vs/base/browser/dom'; const $ = dom.$; diff --git a/src/vs/base/browser/ui/leftRightWidget/leftRightWidget.ts b/src/vs/base/browser/ui/leftRightWidget/leftRightWidget.ts deleted file mode 100644 index 85e960a9ce34cf270a352f7b0e08b96b4bd11361..0000000000000000000000000000000000000000 --- a/src/vs/base/browser/ui/leftRightWidget/leftRightWidget.ts +++ /dev/null @@ -1,38 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -'use strict'; - -import 'vs/css!./leftRightWidget'; -import { Builder, $ } from 'vs/base/browser/builder'; -import { IDisposable } from 'vs/base/common/lifecycle'; - -export interface IRenderer { - (container: HTMLElement): IDisposable; -} - -export class LeftRightWidget { - - private $el: Builder; - private toDispose: IDisposable[]; - - constructor(container: Builder, renderLeftFn: IRenderer, renderRightFn: IRenderer); - constructor(container: HTMLElement, renderLeftFn: IRenderer, renderRightFn: IRenderer); - constructor(container: any, renderLeftFn: IRenderer, renderRightFn: IRenderer) { - this.$el = $('.monaco-left-right-widget').appendTo(container); - - this.toDispose = [ - renderRightFn($('.right').appendTo(this.$el).getHTMLElement()), - renderLeftFn($('span.left').appendTo(this.$el).getHTMLElement()) - ].filter(x => !!x); - } - - public dispose() { - if (this.$el) { - this.$el.destroy(); - this.$el = null; - } - } -} diff --git a/src/vs/base/browser/ui/list/listPaging.ts b/src/vs/base/browser/ui/list/listPaging.ts index 70170ab730b83c09718045899968144a4e8ec5c9..c11ff0e6f8d1a06b8dc728236a43c7981daa522b 100644 --- a/src/vs/base/browser/ui/list/listPaging.ts +++ b/src/vs/base/browser/ui/list/listPaging.ts @@ -85,6 +85,10 @@ export class PagedList { return mapEvent(this.list.onSelectionChange, ({ elements, indexes }) => ({ elements: elements.map(e => this._model.get(e)), indexes })); } + get onPin(): Event> { + return mapEvent(this.list.onPin, ({ elements, indexes }) => ({ elements: elements.map(e => this._model.get(e)), indexes })); + } + get model(): IPagedModel { return this._model; } diff --git a/src/vs/base/browser/ui/list/listView.ts b/src/vs/base/browser/ui/list/listView.ts index 91d89a81e55e01b3d9ab69f07547d416fbc18374..497bf624a0c2630a1f4da3607c8b53f531486551 100644 --- a/src/vs/base/browser/ui/list/listView.ts +++ b/src/vs/base/browser/ui/list/listView.ts @@ -81,7 +81,6 @@ export class ListView implements IDisposable { this.gesture = new Gesture(this.rowsContainer); this.scrollableElement = new ScrollableElement(this.rowsContainer, { - canUseTranslate3d: false, alwaysConsumeMouseWheel: true, horizontal: ScrollbarVisibility.Hidden, vertical: ScrollbarVisibility.Auto, diff --git a/src/vs/base/browser/ui/list/listWidget.ts b/src/vs/base/browser/ui/list/listWidget.ts index d8f833da54009c3376ba7604eb7060c8429b26f8..c915c842c0e7705f2fdc9dc70894f98fd9d89f4d 100644 --- a/src/vs/base/browser/ui/list/listWidget.ts +++ b/src/vs/base/browser/ui/list/listWidget.ts @@ -183,6 +183,32 @@ class FocusTrait extends Trait { } } +class Aria implements IRenderer, ISpliceable { + + private length = 0; + + get templateId(): string { + return 'aria'; + } + + splice(start: number, deleteCount: number, elements: T[]): void { + this.length += elements.length - deleteCount; + } + + renderTemplate(container: HTMLElement): HTMLElement { + return container; + } + + renderElement(element: T, index: number, container: HTMLElement): void { + container.setAttribute('aria-setsize', `${this.length}`); + container.setAttribute('aria-posinset', `${index + 1}`); + } + + disposeTemplate(container: HTMLElement): void { + // noop + } +} + /** * The TraitSpliceable is used as a util class to be able * to preserve traits across splice calls, given an identity @@ -608,12 +634,14 @@ export class List implements ISpliceable, IDisposable { renderers: IRenderer[], options: IListOptions = DefaultOptions ) { + const aria = new Aria(); this.focus = new FocusTrait(i => this.getElementDomId(i)); this.selection = new Trait('selected'); + this.eventBufferer = new EventBufferer(); mixin(options, defaultStyles, false); - renderers = renderers.map(r => new PipelineRenderer(r.templateId, [this.focus.renderer, this.selection.renderer, r])); + renderers = renderers.map(r => new PipelineRenderer(r.templateId, [aria, this.focus.renderer, this.selection.renderer, r])); this.view = new ListView(container, delegate, renderers, options); this.view.domNode.setAttribute('role', 'tree'); @@ -623,6 +651,7 @@ export class List implements ISpliceable, IDisposable { this.styleElement = DOM.createStyleSheet(this.view.domNode); this.spliceable = new CombinedSpliceable([ + aria, new TraitSpliceable(this.focus, this.view, options.identityProvider), new TraitSpliceable(this.selection, this.view, options.identityProvider), this.view @@ -887,7 +916,7 @@ export class List implements ISpliceable, IDisposable { } if (styles.listSelectionOutline) { - content.push(`.monaco-list.${this.idPrefix} .monaco-list-row.selected { outline: 1px dotted ${styles.listSelectionOutline}; }`); + content.push(`.monaco-list.${this.idPrefix} .monaco-list-row.selected { outline: 1px dotted ${styles.listSelectionOutline}; outline-offset: -1px; }`); } if (styles.listFocusOutline) { diff --git a/src/vs/base/browser/ui/menu/menu.css b/src/vs/base/browser/ui/menu/menu.css index 291f08b6ade64a693c9a71213919c45e0890001f..a7ea384d8882f4a37e21c175e4ed9e60dc65223c 100644 --- a/src/vs/base/browser/ui/menu/menu.css +++ b/src/vs/base/browser/ui/menu/menu.css @@ -51,7 +51,6 @@ display: inline-block; -ms-flex: 2 1 auto; flex: 2 1 auto; - opacity: 0.7; padding: 0.8em 1em; line-height: 1.1em; font-size: 12px; diff --git a/src/vs/base/browser/ui/menu/menu.ts b/src/vs/base/browser/ui/menu/menu.ts index 15a214855361dbf9dd81baecd0857df2b1867f4d..2130e8803b76d7e15a2790fcbed08bb5d0445ad5 100644 --- a/src/vs/base/browser/ui/menu/menu.ts +++ b/src/vs/base/browser/ui/menu/menu.ts @@ -36,7 +36,8 @@ export class Menu extends EventEmitter { orientation: ActionsOrientation.VERTICAL, actionItemProvider: options.actionItemProvider, context: options.context, - actionRunner: options.actionRunner + actionRunner: options.actionRunner, + isMenu: true }); this.listener = this.addEmitter(this.actionBar); diff --git a/src/vs/base/browser/ui/progressbar/progressbar.ts b/src/vs/base/browser/ui/progressbar/progressbar.ts index 1287112824b2e07ccfe138105a77c405d0259200..ea34e06e1cbb94506a82d837e8a1946441911e49 100644 --- a/src/vs/base/browser/ui/progressbar/progressbar.ts +++ b/src/vs/base/browser/ui/progressbar/progressbar.ts @@ -11,8 +11,8 @@ import assert = require('vs/base/common/assert'); import { Builder, $ } from 'vs/base/browser/builder'; import DOM = require('vs/base/browser/dom'); import { IDisposable, dispose } from 'vs/base/common/lifecycle'; -import { Color } from "vs/base/common/color"; -import { mixin } from "vs/base/common/objects"; +import { Color } from 'vs/base/common/color'; +import { mixin } from 'vs/base/common/objects'; const css_done = 'done'; const css_active = 'active'; diff --git a/src/vs/base/browser/ui/resourceviewer/resourceViewer.ts b/src/vs/base/browser/ui/resourceviewer/resourceViewer.ts index ea437ffc78b6fdb02de61498f4bc6409d454e7cb..4244dc01a59b428c4ae18f5e81d804aaf40c9a99 100644 --- a/src/vs/base/browser/ui/resourceviewer/resourceViewer.ts +++ b/src/vs/base/browser/ui/resourceviewer/resourceViewer.ts @@ -13,7 +13,7 @@ import paths = require('vs/base/common/paths'); import { Builder, $ } from 'vs/base/browser/builder'; import DOM = require('vs/base/browser/dom'); import { DomScrollableElement } from 'vs/base/browser/ui/scrollbar/scrollableElement'; -import { BoundedLinkedMap } from 'vs/base/common/map'; +import { BoundedMap } from 'vs/base/common/map'; interface MapExtToMediaMimes { @@ -80,7 +80,7 @@ export interface IResourceDescriptor { // we need to bypass the cache or not. We could always bypass the cache everytime we show the image // however that has very bad impact on memory consumption because each time the image gets shown, // memory grows (see also https://github.com/electron/electron/issues/6275) -const IMAGE_RESOURCE_ETAG_CACHE = new BoundedLinkedMap<{ etag: string, src: string }>(100); +const IMAGE_RESOURCE_ETAG_CACHE = new BoundedMap<{ etag: string, src: string }>(100); function imageSrc(descriptor: IResourceDescriptor): string { const src = descriptor.resource.toString(); diff --git a/src/vs/base/browser/ui/scrollbar/abstractScrollbar.ts b/src/vs/base/browser/ui/scrollbar/abstractScrollbar.ts index 243d62b86f5d81b933c7501f9d2ca3430b0068b8..5d326d59eb4ce445834b122dfbfe136e080be2ca 100644 --- a/src/vs/base/browser/ui/scrollbar/abstractScrollbar.ts +++ b/src/vs/base/browser/ui/scrollbar/abstractScrollbar.ts @@ -6,7 +6,7 @@ import * as Platform from 'vs/base/common/platform'; import * as DomUtils from 'vs/base/browser/dom'; -import { IMouseEvent, StandardMouseEvent, StandardMouseWheelEvent } from 'vs/base/browser/mouseEvent'; +import { IMouseEvent, StandardMouseWheelEvent } from 'vs/base/browser/mouseEvent'; import { GlobalMouseMoveMonitor, IStandardMouseMoveEventData, standardMouseMoveMerger } from 'vs/base/browser/globalMouseMoveMonitor'; import { Widget } from 'vs/base/browser/ui/widget'; import { FastDomNode, createFastDomNode } from 'vs/base/browser/fastDomNode'; @@ -20,8 +20,7 @@ import { Scrollable, ScrollbarVisibility } from 'vs/base/common/scrollable'; */ const MOUSE_DRAG_RESET_DISTANCE = 140; -export interface IMouseMoveEventData { - leftButton: boolean; +export interface ISimplifiedMouseEvent { posx: number; posy: number; } @@ -33,7 +32,6 @@ export interface ScrollbarHost { } export interface AbstractScrollbarOptions { - canUseTranslate3d: boolean; lazyRender: boolean; host: ScrollbarHost; scrollbarState: ScrollbarState; @@ -44,7 +42,6 @@ export interface AbstractScrollbarOptions { export abstract class AbstractScrollbar extends Widget { - protected _canUseTranslate3d: boolean; protected _host: ScrollbarHost; protected _scrollable: Scrollable; private _lazyRender: boolean; @@ -59,7 +56,6 @@ export abstract class AbstractScrollbar extends Widget { constructor(opts: AbstractScrollbarOptions) { super(); - this._canUseTranslate3d = opts.canUseTranslate3d; this._lazyRender = opts.lazyRender; this._host = opts.host; this._scrollable = opts.scrollable; @@ -99,19 +95,20 @@ export abstract class AbstractScrollbar extends Widget { this.slider.setLeft(left); this.slider.setWidth(width); this.slider.setHeight(height); + this.slider.setLayerHinting(true); this.domNode.domNode.appendChild(this.slider.domNode); - this.onmousedown(this.slider.domNode, (e) => this._sliderMouseDown(e)); + this.onmousedown(this.slider.domNode, (e) => { + if (e.leftButton) { + e.preventDefault(); + this._sliderMouseDown(e, () => { /*nothing to do*/ }); + } + }); } // ----------------- Update state - public setCanUseTranslate3d(canUseTranslate3d: boolean): boolean { - this._canUseTranslate3d = canUseTranslate3d; - return true; - } - protected _onElementSize(visibleSize: number): boolean { if (this._scrollbarState.setVisibleSize(visibleSize)) { this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()); @@ -161,13 +158,6 @@ export abstract class AbstractScrollbar extends Widget { } this._shouldRender = false; - if (this._canUseTranslate3d) { - // Put the scrollbar in its own layer - this.domNode.setTransform('translate3d(0px, 0px, 0px)'); - } else { - this.domNode.setTransform(''); - } - this._renderDomNode(this._scrollbarState.getRectangleLargeSize(), this._scrollbarState.getRectangleSmallSize()); this._updateSlider(this._scrollbarState.getSliderSize(), this._scrollbarState.getArrowSize() + this._scrollbarState.getSliderPosition()); } @@ -180,62 +170,66 @@ export abstract class AbstractScrollbar extends Widget { this._onMouseDown(e); } - public delegateMouseDown(browserEvent: MouseEvent): void { - let e = new StandardMouseEvent(browserEvent); + public delegateMouseDown(e: IMouseEvent): void { let domTop = this.domNode.domNode.getClientRects()[0].top; let sliderStart = domTop + this._scrollbarState.getSliderPosition(); let sliderStop = domTop + this._scrollbarState.getSliderPosition() + this._scrollbarState.getSliderSize(); let mousePos = this._sliderMousePosition(e); if (sliderStart <= mousePos && mousePos <= sliderStop) { // Act as if it was a mouse down on the slider - this._sliderMouseDown(e); + if (e.leftButton) { + e.preventDefault(); + this._sliderMouseDown(e, () => { /*nothing to do*/ }); + } } else { // Act as if it was a mouse down on the scrollbar this._onMouseDown(e); } } - private _onMouseDown(e: IMouseEvent): void { - let domNodePosition = DomUtils.getDomNodePagePosition(this.domNode.domNode); - let desiredSliderPosition = this._mouseDownRelativePosition(e, domNodePosition) - this._scrollbarState.getArrowSize() - this._scrollbarState.getSliderSize() / 2; - this.setDesiredScrollPosition(this._scrollbarState.convertSliderPositionToScrollPosition(desiredSliderPosition)); - this._sliderMouseDown(e); + public delegateSliderMouseDown(e: ISimplifiedMouseEvent, onDragFinished: () => void): void { + this._sliderMouseDown(e, onDragFinished); } - private _sliderMouseDown(e: IMouseEvent): void { + private _onMouseDown(e: IMouseEvent): void { + let domNodePosition = DomUtils.getDomNodePagePosition(this.domNode.domNode); + this.setDesiredScrollPosition(this._scrollbarState.getDesiredScrollPositionFromOffset(this._mouseDownRelativePosition(e, domNodePosition))); if (e.leftButton) { - let initialMouseOrthogonalPosition = this._sliderOrthogonalMousePosition(e); - let initialScrollPosition = this._getScrollPosition(); - let draggingDelta = this._sliderMousePosition(e) - this._scrollbarState.getSliderPosition(); - this.slider.toggleClassName('active', true); - - this._mouseMoveMonitor.startMonitoring( - standardMouseMoveMerger, - (mouseMoveData: IStandardMouseMoveEventData) => { - let mouseOrthogonalPosition = this._sliderOrthogonalMousePosition(mouseMoveData); - let mouseOrthogonalDelta = Math.abs(mouseOrthogonalPosition - initialMouseOrthogonalPosition); - // console.log(initialMouseOrthogonalPosition + ' -> ' + mouseOrthogonalPosition + ': ' + mouseOrthogonalDelta); - if (Platform.isWindows && mouseOrthogonalDelta > MOUSE_DRAG_RESET_DISTANCE) { - // The mouse has wondered away from the scrollbar => reset dragging - this.setDesiredScrollPosition(initialScrollPosition); - } else { - let desiredSliderPosition = this._sliderMousePosition(mouseMoveData) - draggingDelta; - this.setDesiredScrollPosition(this._scrollbarState.convertSliderPositionToScrollPosition(desiredSliderPosition)); - } - }, - () => { - this.slider.toggleClassName('active', false); - this._host.onDragEnd(); - } - ); - e.preventDefault(); - this._host.onDragStart(); + this._sliderMouseDown(e, () => { /*nothing to do*/ }); } } - public validateScrollPosition(desiredScrollPosition: number): number { - return this._scrollbarState.validateScrollPosition(desiredScrollPosition); + private _sliderMouseDown(e: ISimplifiedMouseEvent, 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( + standardMouseMoveMerger, + (mouseMoveData: IStandardMouseMoveEventData) => { + const mouseOrthogonalPosition = this._sliderOrthogonalMousePosition(mouseMoveData); + const mouseOrthogonalDelta = Math.abs(mouseOrthogonalPosition - initialMouseOrthogonalPosition); + + if (Platform.isWindows && mouseOrthogonalDelta > MOUSE_DRAG_RESET_DISTANCE) { + // The mouse has wondered away from the scrollbar => reset dragging + this.setDesiredScrollPosition(initialScrollbarState.getScrollPosition()); + return; + } + + const mousePosition = this._sliderMousePosition(mouseMoveData); + const mouseDelta = mousePosition - initialMousePosition; + this.setDesiredScrollPosition(initialScrollbarState.getDesiredScrollPositionFromDelta(mouseDelta)); + }, + () => { + this.slider.toggleClassName('active', false); + this._host.onDragEnd(); + onDragFinished(); + } + ); + + this._host.onDragStart(); } public setDesiredScrollPosition(desiredScrollPosition: number): boolean { @@ -256,9 +250,12 @@ export abstract class AbstractScrollbar extends Widget { protected abstract _renderDomNode(largeSize: number, smallSize: number): void; protected abstract _updateSlider(sliderSize: number, sliderPosition: number): void; - protected abstract _mouseDownRelativePosition(e: IMouseEvent, domNodePosition: DomUtils.IDomNodePagePosition): number; - protected abstract _sliderMousePosition(e: IMouseMoveEventData): number; - protected abstract _sliderOrthogonalMousePosition(e: IMouseMoveEventData): number; + + protected abstract _mouseDownRelativePosition(e: ISimplifiedMouseEvent, domNodePosition: DomUtils.IDomNodePagePosition): number; + protected abstract _sliderMousePosition(e: ISimplifiedMouseEvent): number; + protected abstract _sliderOrthogonalMousePosition(e: ISimplifiedMouseEvent): number; + protected abstract _getScrollPosition(): number; protected abstract _setScrollPosition(elementScrollPosition: number): void; + public abstract validateScrollPosition(desiredScrollPosition: number): number; } diff --git a/src/vs/base/browser/ui/scrollbar/horizontalScrollbar.ts b/src/vs/base/browser/ui/scrollbar/horizontalScrollbar.ts index bb0d255d2dee082d941faa4adef108b0b4ca3fd6..f6da6af6bc36cb8747a32e41b2bd97df1672b164 100644 --- a/src/vs/base/browser/ui/scrollbar/horizontalScrollbar.ts +++ b/src/vs/base/browser/ui/scrollbar/horizontalScrollbar.ts @@ -4,8 +4,8 @@ *--------------------------------------------------------------------------------------------*/ 'use strict'; -import { AbstractScrollbar, ScrollbarHost, IMouseMoveEventData } from 'vs/base/browser/ui/scrollbar/abstractScrollbar'; -import { IMouseEvent, StandardMouseWheelEvent } from 'vs/base/browser/mouseEvent'; +import { AbstractScrollbar, ScrollbarHost, ISimplifiedMouseEvent } from 'vs/base/browser/ui/scrollbar/abstractScrollbar'; +import { StandardMouseWheelEvent } from 'vs/base/browser/mouseEvent'; import { IDomNodePagePosition } from 'vs/base/browser/dom'; import { ScrollableElementResolvedOptions } from 'vs/base/browser/ui/scrollbar/scrollableElementOptions'; import { Scrollable, ScrollEvent, ScrollbarVisibility } from 'vs/base/common/scrollable'; @@ -16,7 +16,6 @@ export class HorizontalScrollbar extends AbstractScrollbar { constructor(scrollable: Scrollable, options: ScrollableElementResolvedOptions, host: ScrollbarHost) { super({ - canUseTranslate3d: options.canUseTranslate3d, lazyRender: options.lazyRender, host: host, scrollbarState: new ScrollbarState( @@ -61,13 +60,7 @@ export class HorizontalScrollbar extends AbstractScrollbar { protected _updateSlider(sliderSize: number, sliderPosition: number): void { this.slider.setWidth(sliderSize); - if (this._canUseTranslate3d) { - this.slider.setTransform('translate3d(' + sliderPosition + 'px, 0px, 0px)'); - this.slider.setLeft(0); - } else { - this.slider.setTransform(''); - this.slider.setLeft(sliderPosition); - } + this.slider.setLeft(sliderPosition); } protected _renderDomNode(largeSize: number, smallSize: number): void { @@ -84,15 +77,15 @@ export class HorizontalScrollbar extends AbstractScrollbar { return this._shouldRender; } - protected _mouseDownRelativePosition(e: IMouseEvent, domNodePosition: IDomNodePagePosition): number { + protected _mouseDownRelativePosition(e: ISimplifiedMouseEvent, domNodePosition: IDomNodePagePosition): number { return e.posx - domNodePosition.left; } - protected _sliderMousePosition(e: IMouseMoveEventData): number { + protected _sliderMousePosition(e: ISimplifiedMouseEvent): number { return e.posx; } - protected _sliderOrthogonalMousePosition(e: IMouseMoveEventData): number { + protected _sliderOrthogonalMousePosition(e: ISimplifiedMouseEvent): number { return e.posy; } @@ -106,4 +99,8 @@ export class HorizontalScrollbar extends AbstractScrollbar { scrollLeft: scrollPosition }); } + + public validateScrollPosition(desiredScrollPosition: number): number { + return this._scrollable.validateScrollLeft(desiredScrollPosition); + } } diff --git a/src/vs/base/browser/ui/scrollbar/scrollableElement.ts b/src/vs/base/browser/ui/scrollbar/scrollableElement.ts index 8e69aa38ffabd699d8d21fb96e0259dfb7431214..993b7e385df8d92d1ac49987ec6bb7f6a33c3d3e 100644 --- a/src/vs/base/browser/ui/scrollbar/scrollableElement.ts +++ b/src/vs/base/browser/ui/scrollbar/scrollableElement.ts @@ -6,7 +6,6 @@ import 'vs/css!./media/scrollbars'; -import * as Browser from 'vs/base/browser/browser'; import * as DomUtils from 'vs/base/browser/dom'; import * as Platform from 'vs/base/common/platform'; import { StandardMouseWheelEvent, IMouseEvent } from 'vs/base/browser/mouseEvent'; @@ -18,7 +17,7 @@ import { Scrollable, ScrollState, ScrollEvent, INewScrollState, ScrollbarVisibil import { Widget } from 'vs/base/browser/ui/widget'; import { TimeoutTimer } from 'vs/base/common/async'; import { FastDomNode, createFastDomNode } from 'vs/base/browser/fastDomNode'; -import { ScrollbarHost } from 'vs/base/browser/ui/scrollbar/abstractScrollbar'; +import { ScrollbarHost, ISimplifiedMouseEvent } from 'vs/base/browser/ui/scrollbar/abstractScrollbar'; import Event, { Emitter } from 'vs/base/common/event'; const HIDE_TIMEOUT = 500; @@ -141,12 +140,16 @@ export class ScrollableElement extends Widget { * Delegate a mouse down event to the vertical scrollbar. * This is to help with clicking somewhere else and having the scrollbar react. */ - public delegateVerticalScrollbarMouseDown(browserEvent: MouseEvent): void { + public delegateVerticalScrollbarMouseDown(browserEvent: IMouseEvent): void { this._verticalScrollbar.delegateMouseDown(browserEvent); } - public getVerticalSliderVerticalCenter(): number { - return this._verticalScrollbar.getVerticalSliderVerticalCenter(); + /** + * Delegate a mouse down event to the vertical scrollbar (directly to the slider!). + * This is to help with clicking somewhere else and having the scrollbar react. + */ + public delegateSliderMouseDown(e: ISimplifiedMouseEvent, onDragFinished: () => void): void { + this._verticalScrollbar.delegateSliderMouseDown(e, onDragFinished); } public updateState(newState: INewScrollState): void { @@ -180,9 +183,6 @@ export class ScrollableElement extends Widget { this._options.mouseWheelScrollSensitivity = massagedOptions.mouseWheelScrollSensitivity; this._setListeningToMouseWheel(this._options.handleMouseWheel); - this._shouldRender = this._horizontalScrollbar.setCanUseTranslate3d(massagedOptions.canUseTranslate3d) || this._shouldRender; - this._shouldRender = this._verticalScrollbar.setCanUseTranslate3d(massagedOptions.canUseTranslate3d) || this._shouldRender; - if (!this._options.lazyRender) { this._render(); } @@ -401,7 +401,6 @@ export class DomScrollableElement extends ScrollableElement { function resolveOptions(opts: ScrollableElementCreationOptions): ScrollableElementResolvedOptions { let result: ScrollableElementResolvedOptions = { - canUseTranslate3d: opts.canUseTranslate3d && Browser.supportsTranslate3d, lazyRender: (typeof opts.lazyRender !== 'undefined' ? opts.lazyRender : false), className: (typeof opts.className !== 'undefined' ? opts.className : ''), useShadows: (typeof opts.useShadows !== 'undefined' ? opts.useShadows : true), diff --git a/src/vs/base/browser/ui/scrollbar/scrollableElementOptions.ts b/src/vs/base/browser/ui/scrollbar/scrollableElementOptions.ts index 032e637d5b51e12558a31a1fe9fdc5b48bd25579..5485e4eb84b5a567bce35266202209404b293493 100644 --- a/src/vs/base/browser/ui/scrollbar/scrollableElementOptions.ts +++ b/src/vs/base/browser/ui/scrollbar/scrollableElementOptions.ts @@ -7,10 +7,6 @@ import { ScrollbarVisibility } from 'vs/base/common/scrollable'; export interface ScrollableElementCreationOptions { - /** - * Allow scrollbar rendering to use translate3d. - */ - canUseTranslate3d: boolean; /** * The scrollable element should not do any DOM mutations until renderNow() is called. * Defaults to false. @@ -105,13 +101,11 @@ export interface ScrollableElementCreationOptions { } export interface ScrollableElementChangeOptions { - canUseTranslate3d: boolean; handleMouseWheel?: boolean; mouseWheelScrollSensitivity?: number; } export interface ScrollableElementResolvedOptions { - canUseTranslate3d: boolean; lazyRender: boolean; className: string; useShadows: boolean; diff --git a/src/vs/base/browser/ui/scrollbar/scrollbarState.ts b/src/vs/base/browser/ui/scrollbar/scrollbarState.ts index b9b8a99849dcbfb5c64a2e5a12dcd1806dfa0be8..ee2041c3af24eb779b55cb7289915118b18a8927 100644 --- a/src/vs/base/browser/ui/scrollbar/scrollbarState.ts +++ b/src/vs/base/browser/ui/scrollbar/scrollbarState.ts @@ -11,39 +11,56 @@ const MINIMUM_SLIDER_SIZE = 20; export class ScrollbarState { - // --- immutable - private _scrollbarSize: number; - private _oppositeScrollbarSize: number; - private _arrowSize: number; + /** + * For the vertical scrollbar: the width. + * For the horizontal scrollbar: the height. + */ + private readonly _scrollbarSize: number; - // --- variables - private _visibleSize: number; - private _scrollSize: number; - private _scrollPosition: number; + /** + * For the vertical scrollbar: the height of the pair horizontal scrollbar. + * For the horizontal scrollbar: the width of the pair vertical scrollbar. + */ + private readonly _oppositeScrollbarSize: number; - // --- computed variables + /** + * For the vertical scrollbar: the height of the scrollbar's arrows. + * For the horizontal scrollbar: the width of the scrollbar's arrows. + */ + private readonly _arrowSize: number; + // --- variables /** - * `visibleSize` - `oppositeScrollbarSize` + * For the vertical scrollbar: the viewport height. + * For the horizontal scrollbar: the viewport width. */ - private _computedAvailableSize: number; + private _visibleSize: number; /** - * `computedAvailableSize` - 2 * `arrowSize` + * For the vertical scrollbar: the scroll height. + * For the horizontal scrollbar: the scroll width. */ - private _computedRepresentableSize: number; + private _scrollSize: number; /** - * `computedRepresentableSize` / `scrollSize` + * For the vertical scrollbar: the scroll top. + * For the horizontal scrollbar: the scroll left. */ - private _computedRatio: number; + private _scrollPosition: number; + + // --- computed variables /** - * (`scrollSize` > `visibleSize`) + * `visibleSize` - `oppositeScrollbarSize` + */ + private _computedAvailableSize: number; + /** + * (`scrollSize` > 0 && `scrollSize` > `visibleSize`) */ private _computedIsNeeded: boolean; private _computedSliderSize: number; + private _computedSliderRatio: number; private _computedSliderPosition: number; constructor(arrowSize: number, scrollbarSize: number, oppositeScrollbarSize: number) { @@ -56,15 +73,22 @@ export class ScrollbarState { this._scrollPosition = 0; this._computedAvailableSize = 0; - this._computedRepresentableSize = 0; - this._computedRatio = 0.1; this._computedIsNeeded = false; this._computedSliderSize = 0; + this._computedSliderRatio = 0; this._computedSliderPosition = 0; this._refreshComputedValues(); } + 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; + } + public setVisibleSize(visibleSize: number): boolean { let iVisibleSize = Math.round(visibleSize); if (this._visibleSize !== iVisibleSize) { @@ -95,62 +119,56 @@ export class ScrollbarState { return false; } - private _refreshComputedValues(): void { - const oppositeScrollbarSize = this._oppositeScrollbarSize; - const arrowSize = this._arrowSize; - const visibleSize = this._visibleSize; - const scrollSize = this._scrollSize; - const scrollPosition = this._scrollPosition; - - let computedAvailableSize = Math.max(0, visibleSize - oppositeScrollbarSize); - let computedRepresentableSize = Math.max(0, computedAvailableSize - 2 * arrowSize); - let computedRatio = scrollSize > 0 ? (computedRepresentableSize / scrollSize) : 0; - let computedIsNeeded = (scrollSize > visibleSize); - - let computedSliderSize: number; - let computedSliderPosition: number; + private static _computeValues(oppositeScrollbarSize: number, arrowSize: number, visibleSize: number, scrollSize: number, scrollPosition: number) { + const computedAvailableSize = Math.max(0, visibleSize - oppositeScrollbarSize); + const computedRepresentableSize = Math.max(0, computedAvailableSize - 2 * arrowSize); + const computedIsNeeded = (scrollSize > 0 && scrollSize > visibleSize); if (!computedIsNeeded) { - computedSliderSize = computedRepresentableSize; - computedSliderPosition = 0; - } else { - computedSliderSize = Math.floor(visibleSize * computedRatio); - computedSliderPosition = Math.floor(scrollPosition * computedRatio); - - if (computedSliderSize < MINIMUM_SLIDER_SIZE) { - // We must artificially increase the size of the slider, since the slider would be too small otherwise - // The effort is to keep the slider centered around the original position, but we must take into - // account the cases when the slider is too close to the top or too close to the bottom - - let sliderArtificialOffset = (MINIMUM_SLIDER_SIZE - computedSliderSize) / 2; - computedSliderSize = MINIMUM_SLIDER_SIZE; - - computedSliderPosition -= sliderArtificialOffset; - - if (computedSliderPosition + computedSliderSize > computedRepresentableSize) { - // Slider is too close to the bottom, so we glue it to the bottom - computedSliderPosition = computedRepresentableSize - computedSliderSize; - } - - if (computedSliderPosition < 0) { - // Slider is too close to the top, so we glue it to the top - computedSliderPosition = 0; - } - } + // There is no need for a slider + return { + computedAvailableSize: Math.round(computedAvailableSize), + computedIsNeeded: computedIsNeeded, + computedSliderSize: Math.round(computedRepresentableSize), + computedSliderRatio: 0, + computedSliderPosition: 0, + }; } - this._computedAvailableSize = Math.round(computedAvailableSize); - this._computedRepresentableSize = Math.round(computedRepresentableSize); - this._computedRatio = computedRatio; - this._computedIsNeeded = computedIsNeeded; - this._computedSliderSize = Math.round(computedSliderSize); - this._computedSliderPosition = Math.round(computedSliderPosition); + // We must artificially increase the size of the slider if needed, since the slider would be too small to grab with the mouse otherwise + const computedSliderSize = Math.round(Math.max(MINIMUM_SLIDER_SIZE, Math.floor(visibleSize * computedRepresentableSize / scrollSize))); + + // The slider can move from 0 to `computedRepresentableSize` - `computedSliderSize` + // in the same way `scrollPosition` can move from 0 to `scrollSize` - `visibleSize`. + const computedSliderRatio = (computedRepresentableSize - computedSliderSize) / (scrollSize - visibleSize); + const computedSliderPosition = (scrollPosition * computedSliderRatio); + + return { + computedAvailableSize: Math.round(computedAvailableSize), + computedIsNeeded: computedIsNeeded, + computedSliderSize: Math.round(computedSliderSize), + computedSliderRatio: computedSliderRatio, + computedSliderPosition: Math.round(computedSliderPosition), + }; + } + + private _refreshComputedValues(): void { + const r = ScrollbarState._computeValues(this._oppositeScrollbarSize, this._arrowSize, this._visibleSize, this._scrollSize, this._scrollPosition); + this._computedAvailableSize = r.computedAvailableSize; + this._computedIsNeeded = r.computedIsNeeded; + this._computedSliderSize = r.computedSliderSize; + this._computedSliderRatio = r.computedSliderRatio; + this._computedSliderPosition = r.computedSliderPosition; } public getArrowSize(): number { return this._arrowSize; } + public getScrollPosition(): number { + return this._scrollPosition; + } + public getRectangleLargeSize(): number { return this._computedAvailableSize; } @@ -175,14 +193,30 @@ export class ScrollbarState { return (this._computedSliderPosition + this._computedSliderSize / 2); } - public convertSliderPositionToScrollPosition(desiredSliderPosition: number): number { - return desiredSliderPosition / this._computedRatio; + /** + * Compute a desired `scrollPosition` such that `offset` ends up in the center of the slider. + * `offset` is based on the same coordinate system as the `sliderPosition`. + */ + public getDesiredScrollPositionFromOffset(offset: number): number { + if (!this._computedIsNeeded) { + // no need for a slider + return 0; + } + + let desiredSliderPosition = offset - this._arrowSize - this._computedSliderSize / 2; + return Math.round(desiredSliderPosition / this._computedSliderRatio); } - public validateScrollPosition(desiredScrollPosition: number): number { - desiredScrollPosition = Math.round(desiredScrollPosition); - desiredScrollPosition = Math.max(desiredScrollPosition, 0); - desiredScrollPosition = Math.min(desiredScrollPosition, this._scrollSize - this._visibleSize); - return desiredScrollPosition; + /** + * Compute a desired `scrollPosition` such that the slider moves by `delta`. + */ + public getDesiredScrollPositionFromDelta(delta: number): number { + if (!this._computedIsNeeded) { + // no need for a slider + return 0; + } + + let desiredSliderPosition = this._computedSliderPosition + delta; + return Math.round(desiredSliderPosition / this._computedSliderRatio); } } diff --git a/src/vs/base/browser/ui/scrollbar/verticalScrollbar.ts b/src/vs/base/browser/ui/scrollbar/verticalScrollbar.ts index e7b363ef16e9af50ed2b24ee1c12ac6b7e40a1f7..373940f95b635cd861ec62aacad78b7ae0b470b6 100644 --- a/src/vs/base/browser/ui/scrollbar/verticalScrollbar.ts +++ b/src/vs/base/browser/ui/scrollbar/verticalScrollbar.ts @@ -4,8 +4,8 @@ *--------------------------------------------------------------------------------------------*/ 'use strict'; -import { AbstractScrollbar, ScrollbarHost, IMouseMoveEventData } from 'vs/base/browser/ui/scrollbar/abstractScrollbar'; -import { IMouseEvent, StandardMouseWheelEvent } from 'vs/base/browser/mouseEvent'; +import { AbstractScrollbar, ScrollbarHost, ISimplifiedMouseEvent } from 'vs/base/browser/ui/scrollbar/abstractScrollbar'; +import { StandardMouseWheelEvent } from 'vs/base/browser/mouseEvent'; import { IDomNodePagePosition } from 'vs/base/browser/dom'; import { ScrollableElementResolvedOptions } from 'vs/base/browser/ui/scrollbar/scrollableElementOptions'; import { Scrollable, ScrollEvent, ScrollbarVisibility } from 'vs/base/common/scrollable'; @@ -16,7 +16,6 @@ export class VerticalScrollbar extends AbstractScrollbar { constructor(scrollable: Scrollable, options: ScrollableElementResolvedOptions, host: ScrollbarHost) { super({ - canUseTranslate3d: options.canUseTranslate3d, lazyRender: options.lazyRender, host: host, scrollbarState: new ScrollbarState( @@ -60,19 +59,9 @@ export class VerticalScrollbar extends AbstractScrollbar { this._createSlider(0, Math.floor((options.verticalScrollbarSize - options.verticalSliderSize) / 2), options.verticalSliderSize, null); } - public getVerticalSliderVerticalCenter(): number { - return this._scrollbarState.getSliderCenter(); - } - protected _updateSlider(sliderSize: number, sliderPosition: number): void { this.slider.setHeight(sliderSize); - if (this._canUseTranslate3d) { - this.slider.setTransform('translate3d(0px, ' + sliderPosition + 'px, 0px)'); - this.slider.setTop(0); - } else { - this.slider.setTransform(''); - this.slider.setTop(sliderPosition); - } + this.slider.setTop(sliderPosition); } protected _renderDomNode(largeSize: number, smallSize: number): void { @@ -89,15 +78,15 @@ export class VerticalScrollbar extends AbstractScrollbar { return this._shouldRender; } - protected _mouseDownRelativePosition(e: IMouseEvent, domNodePosition: IDomNodePagePosition): number { + protected _mouseDownRelativePosition(e: ISimplifiedMouseEvent, domNodePosition: IDomNodePagePosition): number { return e.posy - domNodePosition.top; } - protected _sliderMousePosition(e: IMouseMoveEventData): number { + protected _sliderMousePosition(e: ISimplifiedMouseEvent): number { return e.posy; } - protected _sliderOrthogonalMousePosition(e: IMouseMoveEventData): number { + protected _sliderOrthogonalMousePosition(e: ISimplifiedMouseEvent): number { return e.posx; } @@ -111,4 +100,8 @@ export class VerticalScrollbar extends AbstractScrollbar { scrollTop: scrollPosition }); } + + public validateScrollPosition(desiredScrollPosition: number): number { + return this._scrollable.validateScrollTop(desiredScrollPosition); + } } diff --git a/src/vs/base/browser/ui/splitview/splitview.ts b/src/vs/base/browser/ui/splitview/splitview.ts index 47ae7bc96ebac603842c82dee7c7ce9087ed8248..7be647dd58b24c7139db43cd5213ae19591802bd 100644 --- a/src/vs/base/browser/ui/splitview/splitview.ts +++ b/src/vs/base/browser/ui/splitview/splitview.ts @@ -9,7 +9,6 @@ import 'vs/css!./splitview'; import lifecycle = require('vs/base/common/lifecycle'); import ee = require('vs/base/common/eventEmitter'); import types = require('vs/base/common/types'); -import objects = require('vs/base/common/objects'); import dom = require('vs/base/browser/dom'); import numbers = require('vs/base/common/numbers'); import sash = require('vs/base/browser/ui/sash/sash'); @@ -102,7 +101,7 @@ export abstract class View extends ee.EventEmitter implements IView { abstract layout(size: number, orientation: Orientation): void; } -export interface IHeaderViewOptions extends IHeaderViewStyles { +export interface IHeaderViewOptions extends IHeaderViewStyles, IViewOptions { headerSize?: number; } @@ -240,10 +239,9 @@ export abstract class HeaderView extends View { } export interface ICollapsibleViewOptions { - ariaHeaderLabel?: string; - fixedSize?: number; - minimumSize?: number; - headerSize?: number; + sizing: ViewSizing; + ariaHeaderLabel: string; + bodySize?: number; initialState?: CollapsibleState; } @@ -260,14 +258,43 @@ export abstract class AbstractCollapsibleView extends HeaderView { private headerClickListener: lifecycle.IDisposable; private headerKeyListener: lifecycle.IDisposable; private focusTracker: dom.IFocusTracker; + private _bodySize: number; + private _previousSize: number = null; + private readonly viewSizing: ViewSizing; constructor(opts: ICollapsibleViewOptions) { super(opts); + this.viewSizing = opts.sizing; + this.ariaHeaderLabel = opts.ariaHeaderLabel; - this.ariaHeaderLabel = opts && opts.ariaHeaderLabel; + this.setBodySize(types.isUndefined(opts.bodySize) ? 22 : opts.bodySize); this.changeState(types.isUndefined(opts.initialState) ? CollapsibleState.EXPANDED : opts.initialState); } + get previousSize(): number { + return this._previousSize; + } + + setBodySize(bodySize: number) { + this._bodySize = bodySize; + this.updateSize(); + } + + private updateSize() { + if (this.viewSizing === ViewSizing.Fixed) { + this.setFixed(this.state === CollapsibleState.EXPANDED ? this._bodySize + this.headerSize : this.headerSize); + } else { + this._minimumSize = this._bodySize + this.headerSize; + this._previousSize = !this.previousSize || this._previousSize < this._minimumSize ? this._minimumSize : this._previousSize; + if (this.state === CollapsibleState.EXPANDED) { + this.setFlexible(this._previousSize || this._minimumSize); + } else { + this._previousSize = this.size || this._minimumSize; + this.setFixed(this.headerSize); + } + } + } + render(container: HTMLElement, orientation: Orientation): void { super.render(container, orientation); @@ -377,6 +404,23 @@ export abstract class AbstractCollapsibleView extends HeaderView { } this.layoutHeader(); + this.updateSize(); + } + + showHeader(): boolean { + const result = super.showHeader(); + if (result) { + this.updateSize(); + } + return result; + } + + hideHeader(): boolean { + const result = super.hideHeader(); + if (result) { + this.updateSize(); + } + return result; } dispose(): void { @@ -399,55 +443,6 @@ export abstract class AbstractCollapsibleView extends HeaderView { } } -export abstract class CollapsibleView extends AbstractCollapsibleView { - - private previousSize: number; - - constructor(opts: ICollapsibleViewOptions) { - super(opts); - this.previousSize = null; - } - - protected changeState(state: CollapsibleState): void { - super.changeState(state); - - if (state === CollapsibleState.EXPANDED) { - this.setFlexible(this.previousSize || this._minimumSize); - } else { - this.previousSize = this.size; - this.setFixed(); - } - } -} - -export interface IFixedCollapsibleViewOptions extends ICollapsibleViewOptions { - expandedBodySize?: number; -} - -export abstract class FixedCollapsibleView extends AbstractCollapsibleView { - - private _expandedBodySize: number; - - constructor(opts: IFixedCollapsibleViewOptions) { - super(objects.mixin({ sizing: ViewSizing.Fixed }, opts)); - this._expandedBodySize = types.isUndefined(opts.expandedBodySize) ? 22 : opts.expandedBodySize; - } - - get fixedSize(): number { return this.state === CollapsibleState.EXPANDED ? this.expandedSize : this.headerSize; } - private get expandedSize(): number { return this.expandedBodySize + this.headerSize; } - - get expandedBodySize(): number { return this._expandedBodySize; } - set expandedBodySize(size: number) { - this._expandedBodySize = size; - this.setFixed(this.fixedSize); - } - - protected changeState(state: CollapsibleState): void { - super.changeState(state); - this.setFixed(this.fixedSize); - } -} - class PlainView extends View { render() { } focus() { } @@ -555,7 +550,7 @@ export class SplitView implements } /** - * Reset size to null. This will layout newly added viees to initial weights. + * Reset size to null. This will layout newly added views to initial weights. */ this.size = null; @@ -599,6 +594,14 @@ export class SplitView implements this.viewFocusNextListeners.splice(index, 0, view.addListener('focusNext', () => index < this.views.length && this.views[index + 1].focus())); } + updateWeight(view: IView, weight: number) { + let index = this.views.indexOf(view); + if (index < 0) { + return; + } + this.initialWeights[index] = weight; + } + removeView(view: IView): void { let index = this.views.indexOf(view); @@ -606,13 +609,16 @@ export class SplitView implements return; } + this.size = null; let deadView = new DeadView(view); this.views[index] = deadView; this.onViewChange(deadView, 0); let sashIndex = Math.max(index - 1, 0); - this.sashes[sashIndex].dispose(); - this.sashes.splice(sashIndex, 1); + if (sashIndex < this.sashes.length) { + this.sashes[sashIndex].dispose(); + this.sashes.splice(sashIndex, 1); + } this.viewChangeListeners[index].dispose(); this.viewChangeListeners.splice(index, 1); @@ -627,6 +633,7 @@ export class SplitView implements this.viewFocusNextListeners.splice(index, 1); this.views.splice(index, 1); + this.initialWeights.splice(index, 1); this.el.removeChild(this.viewElements[index]); this.viewElements.splice(index, 1); diff --git a/src/vs/base/common/actions.ts b/src/vs/base/common/actions.ts index b51eac17ddb40f121f1bcb8e39f84be7c14c2a7a..1a5e7e1acd19f781799637c9a907eabd589b2f4f 100644 --- a/src/vs/base/common/actions.ts +++ b/src/vs/base/common/actions.ts @@ -9,7 +9,12 @@ import { IEventEmitter, EventEmitter } from 'vs/base/common/eventEmitter'; import { IDisposable } from 'vs/base/common/lifecycle'; import * as Events from 'vs/base/common/events'; import Event, { Emitter } from 'vs/base/common/event'; -import { ITelemetryData } from 'vs/platform/telemetry/common/telemetry'; + +export interface ITelemetryData { + from?: string; + target?: string; + [key: string]: any; +} export interface IAction extends IDisposable { id: string; diff --git a/src/vs/base/common/arrays.ts b/src/vs/base/common/arrays.ts index ce2d4100429ebc0b8fd52409eb263f4735005890..e014f37cc158cf91cb2b06e6631f02e16140696f 100644 --- a/src/vs/base/common/arrays.ts +++ b/src/vs/base/common/arrays.ts @@ -67,30 +67,45 @@ export function findFirst(array: T[], p: (x: T) => boolean): number { } /** - * Like `Array#sort` but always stable. Comes at a cost: iterates 2n-times, - * creates n-objects in addition to sorting (log(n)) + * Like `Array#sort` but always stable. Usually runs a little slower `than Array#sort` + * so only use this when actually needing stable sort. */ -export function stableSort(data: T[], compare: (a: T, b: T) => number): T[] { - - let data2: { idx: number; e: T }[] = data; +export function mergeSort(data: T[], compare: (a: T, b: T) => number): T[] { + _divideAndMerge(data, compare); + return data; +} - for (let idx = 0; idx < data2.length; idx++) { - data2[idx] = { idx, e: data[idx] }; +function _divideAndMerge(data: T[], compare: (a: T, b: T) => number): void { + if (data.length <= 1) { + // sorted + return; } - - data2.sort((a, b) => { - let ret = compare(a.e, b.e); - if (ret === 0) { - ret = a.idx - b.idx; + const p = (data.length / 2) | 0; + const left = data.slice(0, p); + const right = data.slice(p); + + _divideAndMerge(left, compare); + _divideAndMerge(right, compare); + + let leftIdx = 0; + let rightIdx = 0; + let i = 0; + while (leftIdx < left.length && rightIdx < right.length) { + let ret = compare(left[leftIdx], right[rightIdx]); + if (ret <= 0) { + // smaller_equal -> take left to preserve order + data[i++] = left[leftIdx++]; + } else { + // greater -> take right + data[i++] = right[rightIdx++]; } - return ret; - }); - - for (let idx = 0; idx < data2.length; idx++) { - data[idx] = data2[idx].e; } - - return data; + while (leftIdx < left.length) { + data[i++] = left[leftIdx++]; + } + while (rightIdx < right.length) { + data[i++] = right[rightIdx++]; + } } export function groupBy(data: T[], compare: (a: T, b: T) => number): T[][] { @@ -317,3 +332,13 @@ export function insert(array: T[], element: T): () => void { } }; } + +/** + * Insert `insertArr` inside `taget` at `insertIndex`. + * Please don't touch unless you understand https://jsperf.com/inserting-an-array-within-an-array + */ +export function arrayInsert(target: T[], insertIndex: number, insertArr: T[]): T[] { + const before = target.slice(0, insertIndex); + const after = target.slice(insertIndex); + return before.concat(insertArr, after); +} diff --git a/src/vs/base/common/errorMessage.ts b/src/vs/base/common/errorMessage.ts index 9f5ed7fda90d0b5e308b3bdedddd09ef1d7a71bb..1f587120c5e1c5225e9e59577ade56dcf0a715f6 100644 --- a/src/vs/base/common/errorMessage.ts +++ b/src/vs/base/common/errorMessage.ts @@ -9,7 +9,14 @@ import objects = require('vs/base/common/objects'); import types = require('vs/base/common/types'); import arrays = require('vs/base/common/arrays'); import strings = require('vs/base/common/strings'); -import { IXHRResponse } from 'vs/base/common/http'; + +export interface IXHRResponse { + responseText: string; + status: number; + + readyState: number; + getResponseHeader: (header: string) => string; +} export interface IConnectionErrorData { status: number; @@ -165,7 +172,7 @@ function detectSystemErrorMessage(exception: any): string { // See https://nodejs.org/api/errors.html#errors_class_system_error if (typeof exception.code === 'string' && typeof exception.errno === 'number' && typeof exception.syscall === 'string') { - return nls.localize('nodeExceptionMessage', "A system error occured ({0})", exception.message); + return nls.localize('nodeExceptionMessage', "A system error occurred ({0})", exception.message); } return exception.message; diff --git a/src/vs/base/common/errors.ts b/src/vs/base/common/errors.ts index 7367358de17e955974b10f4cfa620fda5b8f9045..26d3df040c9121bbdfec14357247861f56eb6aa1 100644 --- a/src/vs/base/common/errors.ts +++ b/src/vs/base/common/errors.ts @@ -8,7 +8,58 @@ import platform = require('vs/base/common/platform'); import types = require('vs/base/common/types'); import { IAction } from 'vs/base/common/actions'; import Severity from 'vs/base/common/severity'; -import { TPromise } from 'vs/base/common/winjs.base'; +import { TPromise, IPromiseError, IPromiseErrorDetail } from 'vs/base/common/winjs.base'; + +// ------ BEGIN Hook up error listeners to winjs promises + +let outstandingPromiseErrors: { [id: string]: IPromiseErrorDetail; } = {}; +function promiseErrorHandler(e: IPromiseError): void { + + // + // e.detail looks like: { exception, error, promise, handler, id, parent } + // + var details = e.detail; + var id = details.id; + + // If the error has a parent promise then this is not the origination of the + // error so we check if it has a handler, and if so we mark that the error + // was handled by removing it from outstandingPromiseErrors + // + if (details.parent) { + if (details.handler && outstandingPromiseErrors) { + delete outstandingPromiseErrors[id]; + } + return; + } + + // Indicate that this error was originated and needs to be handled + outstandingPromiseErrors[id] = details; + + // The first time the queue fills up this iteration, schedule a timeout to + // check if any errors are still unhandled. + if (Object.keys(outstandingPromiseErrors).length === 1) { + setTimeout(function () { + var errors = outstandingPromiseErrors; + outstandingPromiseErrors = {}; + Object.keys(errors).forEach(function (errorId) { + var error = errors[errorId]; + if (error.exception) { + onUnexpectedError(error.exception); + } else if (error.error) { + onUnexpectedError(error.error); + } + console.log('WARNING: Promise with no error callback:' + error.id); + console.log(error); + if (error.exception) { + console.log(error.exception.stack); + } + }); + }, 0); + } +} +TPromise.addEventListener('error', promiseErrorHandler); + +// ------ END Hook up error listeners to winjs promises export interface ErrorListenerCallback { (error: any): void; diff --git a/src/vs/base/common/event.ts b/src/vs/base/common/event.ts index a8d793e83ea4749ce6d3a74e9d6e2485a016556e..adbac3e577601a26ab0f05d8c1bce4ab390ffdca 100644 --- a/src/vs/base/common/event.ts +++ b/src/vs/base/common/event.ts @@ -257,6 +257,15 @@ export function fromPromise(promise: TPromise): Event { return emitter.event; } +export function toPromise(event: Event): TPromise { + return new TPromise(complete => { + const sub = event(e => { + sub.dispose(); + complete(e); + }); + }); +} + export function delayed(promise: TPromise>): Event { let toCancel: TPromise = null; let listener: IDisposable = null; @@ -400,11 +409,11 @@ class ChainableEvent implements IChainableEvent { constructor(private _event: Event) { } - map(fn) { + map(fn: (i: T) => O): IChainableEvent { return new ChainableEvent(mapEvent(this._event, fn)); } - filter(fn) { + filter(fn: (e: T) => boolean): IChainableEvent { return new ChainableEvent(filterEvent(this._event, fn)); } @@ -511,4 +520,4 @@ export function echo(event: Event, nextTick = false, buffer: T[] = []): Ev }); return emitter.event; -} \ No newline at end of file +} diff --git a/src/vs/base/common/filters.ts b/src/vs/base/common/filters.ts index d4b186650ccd21f698c2a5f01c18443008d07e5b..eafc2d5f6b1f74b1be86b2976e0f0ac3258e0c71 100644 --- a/src/vs/base/common/filters.ts +++ b/src/vs/base/common/filters.ts @@ -5,7 +5,7 @@ 'use strict'; import strings = require('vs/base/common/strings'); -import { BoundedLinkedMap } from 'vs/base/common/map'; +import { BoundedMap } from 'vs/base/common/map'; import { CharCode } from 'vs/base/common/charCode'; export interface IFilter { @@ -334,7 +334,7 @@ export enum SubstringMatching { export const fuzzyContiguousFilter = or(matchesPrefix, matchesCamelCase, matchesContiguousSubString); const fuzzySeparateFilter = or(matchesPrefix, matchesCamelCase, matchesSubString); -const fuzzyRegExpCache = new BoundedLinkedMap(10000); // bounded to 10000 elements +const fuzzyRegExpCache = new BoundedMap(10000); // bounded to 10000 elements export function matchesFuzzy(word: string, wordToMatchAgainst: string, enableSeparateSubstringMatching = false): IMatch[] { if (typeof word !== 'string' || typeof wordToMatchAgainst !== 'string') { @@ -358,29 +358,6 @@ export function matchesFuzzy(word: string, wordToMatchAgainst: string, enableSep return enableSeparateSubstringMatching ? fuzzySeparateFilter(word, wordToMatchAgainst) : fuzzyContiguousFilter(word, wordToMatchAgainst); } -export function matchesFuzzy2(pattern: string, word: string): number[] { - - pattern = pattern.toLowerCase(); - word = word.toLowerCase(); - - let matches: number[] = []; - let patternPos = 0; - let wordPos = 0; - while (patternPos < pattern.length && wordPos < word.length) { - if (pattern[patternPos] === word[wordPos]) { - patternPos += 1; - matches.push(wordPos); - } - wordPos += 1; - } - - if (patternPos !== pattern.length) { - return undefined; - } - - return matches; -} - export function createMatches(position: number[]): IMatch[] { let ret: IMatch[] = []; if (!position) { @@ -486,6 +463,9 @@ export function fuzzyScore(pattern: string, word: string): [number, number[]] { let patternPos = patternStartPos; let wordPos = 0; + // Run a simple check if the characters of pattern occur + // (in order) at all in word. If that isn't the case we + // stop because no match will be possible while (patternPos < patternLen && wordPos < wordLen) { if (lowPattern[patternPos] === lowWord[wordPos]) { patternPos += 1; @@ -493,13 +473,10 @@ export function fuzzyScore(pattern: string, word: string): [number, number[]] { wordPos += 1; } if (patternPos !== patternLen) { - // no simple matches found -> return early return undefined; } - // keep track of the maximum score - let maxScore = -1; - + // There will be a mach, fill in tables for (patternPos = patternStartPos + 1; patternPos <= patternLen; patternPos++) { let lastLowWordChar = ''; @@ -509,20 +486,22 @@ export function fuzzyScore(pattern: string, word: string): [number, number[]] { let score = -1; let lowWordChar = lowWord[wordPos - 1]; if (lowPattern[patternPos - 1] === lowWordChar) { - - if (wordPos === 1) { + if (wordPos === (patternPos - patternStartPos)) { + // common prefix: `foobar <-> foobaz` if (pattern[patternPos - 1] === word[wordPos - 1]) { score = 7; } else { score = 5; } } else if (lowWordChar !== word[wordPos - 1]) { + // hitting upper-case: `foo <-> forOthers` if (pattern[patternPos - 1] === word[wordPos - 1]) { score = 7; } else { score = 5; } } else if (_seps[lastLowWordChar]) { + // post separator: `foo <-> bar_foo` score = 5; } else { @@ -531,9 +510,6 @@ export function fuzzyScore(pattern: string, word: string): [number, number[]] { } _scores[patternPos][wordPos] = score; - if (score > maxScore) { - maxScore = score; - } let diag = _table[patternPos - 1][wordPos - 1] + (score > 1 ? 1 : score); let top = _table[patternPos - 1][wordPos] + -1; @@ -569,44 +545,42 @@ export function fuzzyScore(pattern: string, word: string): [number, number[]] { } } - if (maxScore <= 1) { - return undefined; - } - if (_debug) { console.log(printTable(_table, pattern, patternLen, word, wordLen)); console.log(printTable(_arrows, pattern, patternLen, word, wordLen)); console.log(printTable(_scores, pattern, patternLen, word, wordLen)); } - let bucket: [number, number[]][] = []; - findAllMatches(patternLen, patternLen, patternStartPos, wordLen, 0, [], bucket, false); + // _bucket is an array of [PrefixArray] we use to keep + // track of scores and matches. After calling `_findAllMatches` + // the best match (if available) is the first item in the array + _bucket.length = 0; + _topScore = -100; + _patternStartPos = patternStartPos; + _findAllMatches(patternLen, wordLen, 0, new LazyArray(), false); - if (bucket.length === 0) { + if (_bucket.length === 0) { return undefined; } - let topMatch = bucket.shift(); - for (const match of bucket) { - if (!topMatch || topMatch[0] < match[0]) { - topMatch = match; - } - } - if (_debug) { - console.log(`${pattern} & ${word} => ${topMatch[0]} points for ${topMatch[1]}`); - } - return topMatch; + return [_topScore, _bucket[0].toArray()]; } -function findAllMatches(patternLen: number, patternPos: number, patternStartPos: number, wordPos: number, total: number, matches: number[], bucket: [number, number[]][], lastMatched: boolean): void { +let _bucket: LazyArray[] = []; +let _topScore: number = 0; +let _patternStartPos: number = 0; + +function _findAllMatches(patternPos: number, wordPos: number, total: number, matches: LazyArray, lastMatched: boolean): void { - if (bucket.length >= 10) { + if (_bucket.length >= 10 || total < -25) { + // stop when having already 10 results, or + // when a potential alignment as already 5 gaps return; } let simpleMatchCount = 0; - while (patternPos > patternStartPos && wordPos > 0) { + while (patternPos > _patternStartPos && wordPos > 0) { let score = _scores[patternPos][wordPos]; let arrow = _arrows[patternPos][wordPos]; @@ -616,7 +590,7 @@ function findAllMatches(patternLen: number, patternPos: number, patternStartPos: wordPos -= 1; if (lastMatched) { total -= 5; // new gap penalty - } else if (matches.length !== 0) { + } else if (!matches.isEmpty()) { total -= 1; // gap penalty after first match } lastMatched = false; @@ -626,11 +600,12 @@ function findAllMatches(patternLen: number, patternPos: number, patternStartPos: if (arrow & Arrow.Left) { // left - findAllMatches( - patternLen, patternPos, patternStartPos, + _findAllMatches( + patternPos, wordPos - 1, - matches.length !== 0 ? total - 1 : total, - matches.slice(0), bucket, lastMatched + !matches.isEmpty() ? total - 1 : total, // gap penalty after first match + matches.slice(), + lastMatched ); } @@ -641,9 +616,20 @@ function findAllMatches(patternLen: number, patternPos: number, patternStartPos: matches.unshift(wordPos); lastMatched = true; + // count simple matches and boost a row of + // simple matches when they yield in a + // strong match. if (score === 1) { simpleMatchCount += 1; + + if (patternPos === _patternStartPos) { + // when the first match is a weak + // match we discard it + return undefined; + } + } else { + // boost total += 1 + (simpleMatchCount * (score - 1)); simpleMatchCount = 0; } @@ -653,21 +639,58 @@ function findAllMatches(patternLen: number, patternPos: number, patternStartPos: } } - if (matches.length !== patternLen - patternStartPos) { - // doesn't cover whole pattern - return undefined; + total -= wordPos >= 3 ? 9 : wordPos * 3; // late start penalty + + // dynamically keep track of the current top score + // and insert the current best score at head, the rest at tail + if (total > _topScore) { + _topScore = total; + _bucket.unshift(matches); + } else { + _bucket.push(matches); } +} - if (_scores[1][matches[0] + 1] === 1) { - // first match is weak - return undefined; +class LazyArray { + + private _parent: LazyArray; + private _parentLen: number; + private _data: number[]; + + isEmpty(): boolean { + return !this._data && (!this._parent || this._parent.isEmpty()); } - total -= wordPos >= 3 ? 9 : wordPos * 3; // late start penalty + unshift(n: number) { + if (!this._data) { + this._data = [n]; + } else { + this._data.unshift(n); + } + } - bucket.push([total, matches]); -} + slice(): LazyArray { + const ret = new LazyArray(); + ret._parent = this; + ret._parentLen = this._data ? this._data.length : 0; + return ret; + } + toArray(): number[] { + if (!this._data) { + return this._parent.toArray(); + } + const bucket: number[][] = []; + let element = this; + while (element) { + if (element._parent && element._parent._data) { + bucket.push(element._parent._data.slice(element._parent._data.length - element._parentLen)); + } + element = element._parent; + } + return Array.prototype.concat.apply(this._data, bucket); + } +} export function nextTypoPermutation(pattern: string, patternPos: number) { diff --git a/src/vs/base/common/glob.ts b/src/vs/base/common/glob.ts index 7197d9ed8013cebf60bf6d18df753752b0a3b8b5..fd6a973da8d47e54f7dd5205dc9b36e518c1cf2e 100644 --- a/src/vs/base/common/glob.ts +++ b/src/vs/base/common/glob.ts @@ -7,7 +7,7 @@ import arrays = require('vs/base/common/arrays'); import strings = require('vs/base/common/strings'); import paths = require('vs/base/common/paths'); -import { BoundedLinkedMap } from 'vs/base/common/map'; +import { BoundedMap } from 'vs/base/common/map'; import { CharCode } from 'vs/base/common/charCode'; import { TPromise } from 'vs/base/common/winjs.base'; @@ -242,7 +242,7 @@ interface ParsedExpressionPattern { allPaths?: string[]; } -const CACHE = new BoundedLinkedMap(10000); // bounded to 10000 elements +const CACHE = new BoundedMap(10000); // bounded to 10000 elements const FALSE = function () { return false; @@ -436,7 +436,8 @@ export function parse(arg1: string | IExpression, options: IGlobOptions = {}): a export function parseToAsync(expression: IExpression, options?: IGlobOptions): ParsedExpression { const parsedExpression = parse(expression, options); return (path: string, basename?: string, siblingsFn?: () => TPromise): TPromise => { - return TPromise.as(parsedExpression(path, basename, siblingsFn)); + const result = parsedExpression(path, basename, siblingsFn); + return result instanceof TPromise ? result : TPromise.as(result); }; } diff --git a/src/vs/base/common/history.ts b/src/vs/base/common/history.ts index 22e921b8d77929993240906710f447e988a899d7..82099d63c30904607f1d7d854f09f84e33b5c101 100644 --- a/src/vs/base/common/history.ts +++ b/src/vs/base/common/history.ts @@ -3,28 +3,27 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ArraySet } from 'vs/base/common/set'; import { INavigator, ArrayNavigator } from 'vs/base/common/iterator'; export class HistoryNavigator implements INavigator { - private _history: ArraySet; + private _history: Set; private _limit: number; private _navigator: ArrayNavigator; constructor(history: T[] = [], limit: number = 10) { - this._history = new ArraySet(history); + this._initialize(history); this._limit = limit; this._onChange(); } public add(t: T) { - this._history.set(t); + this._history.add(t); this._onChange(); } public addIfNotPresent(t: T) { - if (!this._history.contains(t)) { + if (!this._history.has(t)) { this.add(t); } } @@ -63,15 +62,27 @@ export class HistoryNavigator implements INavigator { private _onChange() { this._reduceToLimit(); - this._navigator = new ArrayNavigator(this._history.elements); + this._navigator = new ArrayNavigator(this._elements); this._navigator.last(); } private _reduceToLimit() { - let data = this._history.elements; + let data = this._elements; if (data.length > this._limit) { - this._history = new ArraySet(data.slice(data.length - this._limit)); + this._initialize(data.slice(data.length - this._limit)); } } + private _initialize(history: T[]): void { + this._history = new Set(); + for (const entry of history) { + this._history.add(entry); + } + } + + private get _elements(): T[] { + const elements: T[] = []; + this._history.forEach(e => elements.push(e)); + return elements; + } } \ No newline at end of file diff --git a/src/vs/base/common/htmlContent.ts b/src/vs/base/common/htmlContent.ts index 8dcc73fc332de9dc3247dd2d6244504f9e55af2e..4744495a169a37c11e091b8200649393f295c785 100644 --- a/src/vs/base/common/htmlContent.ts +++ b/src/vs/base/common/htmlContent.ts @@ -12,11 +12,6 @@ */ export type MarkedString = string | { readonly language: string; readonly value: string }; -export interface IHTMLContentElementCode { - language: string; - value: string; -} - export function markedStringsEquals(a: MarkedString | MarkedString[], b: MarkedString | MarkedString[]): boolean { if (!a && !b) { return true; @@ -29,9 +24,9 @@ export function markedStringsEquals(a: MarkedString | MarkedString[], b: MarkedS if (!Array.isArray(b)) { return false; } - return markedStringArrEquals(a, b); + return markedStringArrEquals(a, b); } - return markedStringEqual(a, b); + return markedStringEqual(a, b as MarkedString); } @@ -77,73 +72,3 @@ export function removeMarkdownEscapes(text: string): string { } return text.replace(/\\([\\`*_{}[\]()#+\-.!])/g, '$1'); } - -export interface IHTMLContentElement { - /** - * supports **bold**, __italics__, and [[actions]] - */ - formattedText?: string; - text?: string; - className?: string; - style?: string; - customStyle?: any; - tagName?: string; - children?: IHTMLContentElement[]; - isText?: boolean; - role?: string; - markdown?: string; - code?: IHTMLContentElementCode; -} - -function htmlContentElementCodeEqual(a: IHTMLContentElementCode, b: IHTMLContentElementCode): boolean { - if (!a && !b) { - return true; - } - if (!a || !b) { - return false; - } - return ( - a.language === b.language - && a.value === b.value - ); -} - -function htmlContentElementEqual(a: IHTMLContentElement, b: IHTMLContentElement): boolean { - return ( - a.formattedText === b.formattedText - && a.text === b.text - && a.className === b.className - && a.style === b.style - && a.customStyle === b.customStyle - && a.tagName === b.tagName - && a.isText === b.isText - && a.role === b.role - && a.markdown === b.markdown - && htmlContentElementCodeEqual(a.code, b.code) - && htmlContentElementArrEquals(a.children, b.children) - ); -} - -export function htmlContentElementArrEquals(a: IHTMLContentElement[], b: IHTMLContentElement[]): boolean { - if (!a && !b) { - return true; - } - if (!a || !b) { - return false; - } - - let aLen = a.length, - bLen = b.length; - - if (aLen !== bLen) { - return false; - } - - for (let i = 0; i < aLen; i++) { - if (!htmlContentElementEqual(a[i], b[i])) { - return false; - } - } - - return true; -} diff --git a/src/vs/base/common/http.ts b/src/vs/base/common/http.ts deleted file mode 100644 index 59feccf6e04bfd4eb101f5fc504b7b43754efa10..0000000000000000000000000000000000000000 --- a/src/vs/base/common/http.ts +++ /dev/null @@ -1,54 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -'use strict'; - -import * as nls from 'vs/nls'; - -export interface IXHROptions { - type?: string; - url?: string; - user?: string; - password?: string; - responseType?: string; - headers?: any; - timeout?: number; - followRedirects?: number; - data?: any; -} - -export interface IXHRResponse { - responseText: string; - status: number; - - readyState: number; - getResponseHeader: (header: string) => string; -} - -export function getErrorStatusDescription(status: number): string { - if (status < 400) { - return void 0; - } - switch (status) { - case 400: return nls.localize('status.400', 'Bad request. The request cannot be fulfilled due to bad syntax.'); - case 401: return nls.localize('status.401', 'Unauthorized. The server is refusing to respond.'); - case 403: return nls.localize('status.403', 'Forbidden. The server is refusing to respond.'); - case 404: return nls.localize('status.404', 'Not Found. The requested location could not be found.'); - case 405: return nls.localize('status.405', 'Method not allowed. A request was made using a request method not supported by that location.'); - case 406: return nls.localize('status.406', 'Not Acceptable. The server can only generate a response that is not accepted by the client.'); - case 407: return nls.localize('status.407', 'Proxy Authentication Required. The client must first authenticate itself with the proxy.'); - case 408: return nls.localize('status.408', 'Request Timeout. The server timed out waiting for the request.'); - case 409: return nls.localize('status.409', 'Conflict. The request could not be completed because of a conflict in the request.'); - case 410: return nls.localize('status.410', 'Gone. The requested page is no longer available.'); - case 411: return nls.localize('status.411', 'Length Required. The "Content-Length" is not defined.'); - case 412: return nls.localize('status.412', 'Precondition Failed. The precondition given in the request evaluated to false by the server.'); - case 413: return nls.localize('status.413', 'Request Entity Too Large. The server will not accept the request, because the request entity is too large.'); - case 414: return nls.localize('status.414', 'Request-URI Too Long. The server will not accept the request, because the URL is too long.'); - case 415: return nls.localize('status.415', 'Unsupported Media Type. The server will not accept the request, because the media type is not supported.'); - case 500: return nls.localize('status.500', 'Internal Server Error.'); - case 501: return nls.localize('status.501', 'Not Implemented. The server either does not recognize the request method, or it lacks the ability to fulfill the request.'); - case 503: return nls.localize('status.503', 'Service Unavailable. The server is currently unavailable (overloaded or down).'); - default: return nls.localize('status.416', 'HTTP status code {0}', status); - } -} diff --git a/src/vs/platform/keybinding/common/keybindingLabels.ts b/src/vs/base/common/keybindingLabels.ts similarity index 100% rename from src/vs/platform/keybinding/common/keybindingLabels.ts rename to src/vs/base/common/keybindingLabels.ts diff --git a/src/vs/base/common/labels.ts b/src/vs/base/common/labels.ts index f2aeccb2109433bc598fa213e7208e1d22852dbc..172700a0811e1c329314a15b056520991aec2421 100644 --- a/src/vs/base/common/labels.ts +++ b/src/vs/base/common/labels.ts @@ -6,10 +6,8 @@ import URI from 'vs/base/common/uri'; import platform = require('vs/base/common/platform'); -import types = require('vs/base/common/types'); -import { nativeSep, normalize } from 'vs/base/common/paths'; +import { nativeSep, normalize, isEqualOrParent, isEqual, basename, join } from 'vs/base/common/paths'; import { endsWith, ltrim } from 'vs/base/common/strings'; -import { isEqualOrParent, isEqual } from 'vs/platform/files/common/files'; export interface ILabelProvider { @@ -19,9 +17,10 @@ export interface ILabelProvider { getLabel(element: any): string; } -export interface IWorkspaceProvider { - getWorkspace(): { - resource: URI; +export interface IRootProvider { + getRoot(resource: URI): URI; + getWorkspace2(): { + roots: URI[]; }; } @@ -29,39 +28,42 @@ export interface IUserHomeProvider { userHome: string; } -export class PathLabelProvider implements ILabelProvider { - private root: string; - - constructor(arg1?: URI | string | IWorkspaceProvider) { - this.root = arg1 && getPath(arg1); +export function getPathLabel(resource: URI | string, rootProvider?: IRootProvider, userHomeProvider?: IUserHomeProvider): string { + if (!resource) { + return null; } - public getLabel(arg1: URI | string | IWorkspaceProvider): string { - return getPathLabel(getPath(arg1), this.root); + if (typeof resource === 'string') { + resource = URI.file(resource); } -} -export function getPathLabel(resource: URI | string, basePathProvider?: URI | string | IWorkspaceProvider, userHomeProvider?: IUserHomeProvider): string { - const absolutePath = getPath(resource); - if (!absolutePath) { - return null; - } + // return early if we can resolve a relative path label from the root + const baseResource = rootProvider ? rootProvider.getRoot(resource) : null; + if (baseResource) { + const hasMultipleRoots = rootProvider.getWorkspace2().roots.length > 1; - const basepath = basePathProvider && getPath(basePathProvider); + let pathLabel: string; + if (isEqual(baseResource.fsPath, resource.fsPath, !platform.isLinux /* ignorecase */)) { + pathLabel = ''; // no label if pathes are identical + } else { + pathLabel = normalize(ltrim(resource.fsPath.substr(baseResource.fsPath.length), nativeSep), true); + } - if (basepath && isEqualOrParent(absolutePath, basepath, !platform.isLinux /* ignorecase */)) { - if (isEqual(basepath, absolutePath, !platform.isLinux /* ignorecase */)) { - return ''; // no label if pathes are identical + if (hasMultipleRoots) { + const rootName = basename(baseResource.fsPath); + pathLabel = pathLabel ? join(rootName, pathLabel) : rootName; // always show root basename if there are multiple } - return normalize(ltrim(absolutePath.substr(basepath.length), nativeSep), true); + return pathLabel; } - if (platform.isWindows && absolutePath && absolutePath[1] === ':') { - return normalize(absolutePath.charAt(0).toUpperCase() + absolutePath.slice(1), true); // convert c:\something => C:\something + // convert c:\something => C:\something + if (platform.isWindows && resource.fsPath && resource.fsPath[1] === ':') { + return normalize(resource.fsPath.charAt(0).toUpperCase() + resource.fsPath.slice(1), true); } - let res = normalize(absolutePath, true); + // normalize and tildify (macOS, Linux only) + let res = normalize(resource.fsPath, true); if (!platform.isWindows && userHomeProvider) { res = tildify(res, userHomeProvider.userHome); } @@ -69,23 +71,6 @@ export function getPathLabel(resource: URI | string, basePathProvider?: URI | st return res; } -function getPath(arg1: URI | string | IWorkspaceProvider): string { - if (!arg1) { - return null; - } - - if (typeof arg1 === 'string') { - return arg1; - } - - if (types.isFunction((arg1).getWorkspace)) { - const ws = (arg1).getWorkspace(); - return ws ? ws.resource.fsPath : void 0; - } - - return (arg1).fsPath; -} - export function tildify(path: string, userHome: string): string { if (path && (platform.isMacintosh || platform.isLinux) && isEqualOrParent(path, userHome, !platform.isLinux /* ignorecase */)) { path = `~${path.substr(userHome.length)}`; @@ -134,7 +119,7 @@ export function shorten(paths: string[]): string[] { let path = paths[pathIndex]; if (path === '') { - shortenedPaths[pathIndex] = '.'; + shortenedPaths[pathIndex] = `.${nativeSep}`; continue; } diff --git a/src/vs/base/common/lifecycle.ts b/src/vs/base/common/lifecycle.ts index 1a17d2a524f5689b6b5f8203ba33f728ace71c9f..2600d72e9ef360cd748bd935953eac57e5257a17 100644 --- a/src/vs/base/common/lifecycle.ts +++ b/src/vs/base/common/lifecycle.ts @@ -41,7 +41,13 @@ export function combinedDisposable(disposables: IDisposable[]): IDisposable { } export function toDisposable(...fns: (() => void)[]): IDisposable { - return combinedDisposable(fns.map(fn => ({ dispose: fn }))); + return { + dispose() { + for (const fn of fns) { + fn(); + } + } + }; } export abstract class Disposable implements IDisposable { @@ -62,22 +68,6 @@ export abstract class Disposable implements IDisposable { } } -export class Disposables extends Disposable { - - public add(e: T): T; - public add(...elements: IDisposable[]): void; - public add(arg: T | T[]): T { - if (!Array.isArray(arg)) { - return this._register(arg); - } else { - for (let element of arg) { - return this._register(element); - } - return undefined; - } - } -} - export class OneDisposable implements IDisposable { private _value: IDisposable; diff --git a/src/vs/base/common/map.ts b/src/vs/base/common/map.ts index 09c03b971b0996d34e8317059c3f5d79d7ffed3c..45b81888e0aa8169279cfe212f04c9efe2679acf 100644 --- a/src/vs/base/common/map.ts +++ b/src/vs/base/common/map.ts @@ -12,147 +12,100 @@ export interface Key { } export interface Entry { - next?: Entry; - prev?: Entry; key: K; value: T; } -/** - * A simple map to store value by a key object. Key can be any object that has toString() function to get - * string value of the key. - */ -export class LinkedMap { - - protected map: { [key: string]: Entry }; - protected _size: number; - - constructor() { - this.map = Object.create(null); - this._size = 0; - } +export function values(map: Map): V[] { + const result: V[] = []; + map.forEach(value => result.push(value)); - public get size(): number { - return this._size; - } - - public get(k: K): T { - const value = this.peek(k); - - return value ? value : null; - } + return result; +} - public getOrSet(k: K, t: T): T { - const res = this.get(k); - if (res) { - return res; - } +export function keys(map: Map): K[] { + const result: K[] = []; + map.forEach((value, key) => result.push(key)); - this.set(k, t); + return result; +} - return t; +export function getOrSet(map: Map, key: K, value: V): V { + let result = map.get(key); + if (result === void 0) { + result = value; + map.set(key, result); } - public keys(): K[] { - const keys: K[] = []; - for (let key in this.map) { - keys.push(this.map[key].key); - } - return keys; - } + return result; +} - public values(): T[] { - const values: T[] = []; - for (let key in this.map) { - values.push(this.map[key].value); - } - return values; - } +export interface ISerializedBoundedLinkedMap { + entries: { key: string; value: T }[]; +} - public entries(): Entry[] { - const entries: Entry[] = []; - for (let key in this.map) { - entries.push(this.map[key]); - } - return entries; - } +interface LinkedEntry extends Entry { + next?: LinkedEntry; + prev?: LinkedEntry; +} - public set(k: K, t: T): boolean { - if (this.get(k)) { - return false; // already present! - } +/** + * A simple Map that optionally allows to set a limit of entries to store. Once the limit is hit, + * the cache will remove the entry that was last recently added. Or, if a ratio is provided below 1, + * all elements will be removed until the ratio is full filled (e.g. 0.75 to remove 25% of old elements). + */ +export class BoundedMap { + private map: Map>; - this.push(k, t); + private head: LinkedEntry; + private tail: LinkedEntry; + private ratio: number; - return true; - } + constructor(private limit = Number.MAX_VALUE, ratio = 1, value?: ISerializedBoundedLinkedMap) { + this.map = new Map>(); + this.ratio = limit * ratio; - public delete(k: K): T { - let value: T = this.get(k); if (value) { - this.pop(k); - return value; + value.entries.forEach(entry => { + this.set(entry.key, entry.value); + }); } - return null; - } - - public has(k: K): boolean { - return !!this.get(k); - } - - public clear(): void { - this.map = Object.create(null); - this._size = 0; } - protected push(key: K, value: T): void { - const entry: Entry = { key, value }; - this.map[key.toString()] = entry; - this._size++; - } + public setLimit(limit: number): void { + if (limit < 0) { + return; // invalid limit + } - protected pop(k: K): void { - delete this.map[k.toString()]; - this._size--; + this.limit = limit; + while (this.map.size > this.limit) { + this.trim(); + } } - protected peek(k: K): T { - const entry = this.map[k.toString()]; - return entry ? entry.value : null; - } -} + public serialize(): ISerializedBoundedLinkedMap { + const serialized: ISerializedBoundedLinkedMap = { entries: [] }; -/** - * A simple Map that optionally allows to set a limit of entries to store. Once the limit is hit, - * the cache will remove the entry that was last recently added. Or, if a ratio is provided below 1, - * all elements will be removed until the ratio is full filled (e.g. 0.75 to remove 25% of old elements). - */ -export class BoundedLinkedMap { - protected map: { [key: string]: Entry }; - private head: Entry; - private tail: Entry; - private _size: number; - private ratio: number; + this.map.forEach(entry => { + serialized.entries.push({ key: entry.key, value: entry.value }); + }); - constructor(private limit = Number.MAX_VALUE, ratio = 1) { - this.map = Object.create(null); - this._size = 0; - this.ratio = limit * ratio; + return serialized; } public get size(): number { - return this._size; + return this.map.size; } public set(key: string, value: T): boolean { - if (this.map[key]) { + if (this.map.has(key)) { return false; // already present! } - const entry: Entry = { key, value }; + const entry: LinkedEntry = { key, value }; this.push(entry); - if (this._size > this.limit) { + if (this.size > this.limit) { this.trim(); } @@ -160,7 +113,7 @@ export class BoundedLinkedMap { } public get(key: string): T { - const entry = this.map[key]; + const entry = this.map.get(key); return entry ? entry.value : null; } @@ -177,11 +130,10 @@ export class BoundedLinkedMap { } public delete(key: string): T { - const entry = this.map[key]; + const entry = this.map.get(key); if (entry) { - this.map[key] = void 0; - this._size--; + this.map.delete(key); if (entry.next) { entry.next.prev = entry.prev; // [A]<-[x]<-[C] = [A]<-[C] @@ -202,17 +154,16 @@ export class BoundedLinkedMap { } public has(key: string): boolean { - return !!this.map[key]; + return this.map.has(key); } public clear(): void { - this.map = Object.create(null); - this._size = 0; + this.map.clear(); this.head = null; this.tail = null; } - protected push(entry: Entry): void { + private push(entry: LinkedEntry): void { if (this.head) { // [A]-[B] = [A]-[B]->[X] entry.prev = this.head; @@ -225,8 +176,7 @@ export class BoundedLinkedMap { this.head = entry; - this.map[entry.key] = entry; - this._size++; + this.map.set(entry.key, entry); } private trim(): void { @@ -239,8 +189,7 @@ export class BoundedLinkedMap { while (current.next) { // Remove the entry - this.map[current.key] = void 0; - this._size--; + this.map.delete(current.key); // if we reached the element that overflows our ratio condition // make its next element the new tail of the Map and adjust the size @@ -259,46 +208,18 @@ export class BoundedLinkedMap { // Just remove the tail element else { - this.map[this.tail.key] = void 0; - this._size--; + this.map.delete(this.tail.key); // [x]-[B] = [B] this.tail = this.tail.next; - this.tail.prev = null; + if (this.tail) { + this.tail.prev = null; + } } } } } -/** - * A subclass of Map that makes an entry the MRU entry as soon - * as it is being accessed. In combination with the limit for the - * maximum number of elements in the cache, it helps to remove those - * entries from the cache that are LRU. - */ -export class LRUCache extends BoundedLinkedMap { - - constructor(limit: number) { - super(limit); - } - - public get(key: string): T { - - // Upon access of an entry, make it the head of - // the linked map so that it is the MRU element - const entry = this.map[key]; - if (entry) { - this.delete(key); - this.push(entry); - - return entry.value; - } - - - return null; - } -} - // --- trie'ish datastructure class Node { @@ -407,7 +328,8 @@ export class TrieMap { } export class ResourceMap { - private map: Map; + + protected map: Map; constructor(private ignoreCase?: boolean) { this.map = new Map(); @@ -442,10 +364,7 @@ export class ResourceMap { } public values(): T[] { - const values: T[] = []; - this.map.forEach(value => values.push(value)); - - return values; + return values(this.map); } private toKey(resource: URI): string { @@ -456,4 +375,324 @@ export class ResourceMap { return key; } +} + +export class StrictResourceMap extends ResourceMap { + + constructor() { + super(); + } + + public keys(): URI[] { + return keys(this.map).map(key => URI.parse(key)); + } + +} + +// We should fold BoundedMap and LinkedMap. See https://github.com/Microsoft/vscode/issues/28496 + +interface Item { + previous: Item | undefined; + next: Item | undefined; + key: K; + value: V; +} + +export namespace Touch { + export const None: 0 = 0; + export const First: 1 = 1; + export const Last: 2 = 2; +} + +export type Touch = 0 | 1 | 2; + +export class LinkedMap { + + private _map: Map>; + private _head: Item | undefined; + private _tail: Item | undefined; + private _size: number; + + constructor() { + this._map = new Map>(); + this._head = undefined; + this._tail = undefined; + this._size = 0; + } + + public clear(): void { + this._map.clear(); + this._head = undefined; + this._tail = undefined; + this._size = 0; + } + + public isEmpty(): boolean { + return !this._head && !this._tail; + } + + public get size(): number { + return this._size; + } + + public has(key: K): boolean { + return this._map.has(key); + } + + public get(key: K): V | undefined { + const item = this._map.get(key); + if (!item) { + return undefined; + } + return item.value; + } + + public set(key: K, value: V, touch: Touch = Touch.None): void { + let item = this._map.get(key); + if (item) { + item.value = value; + if (touch !== Touch.None) { + this.touch(item, touch); + } + } else { + item = { key, value, next: undefined, previous: undefined }; + switch (touch) { + case Touch.None: + this.addItemLast(item); + break; + case Touch.First: + this.addItemFirst(item); + break; + case Touch.Last: + this.addItemLast(item); + break; + default: + this.addItemLast(item); + break; + } + this._map.set(key, item); + this._size++; + } + } + + public delete(key: K): boolean { + return !!this.remove(key); + } + + public remove(key: K): V | undefined { + const item = this._map.get(key); + if (!item) { + return undefined; + } + this._map.delete(key); + this.removeItem(item); + this._size--; + return item.value; + } + + public shift(): V | undefined { + if (!this._head && !this._tail) { + return undefined; + } + if (!this._head || !this._tail) { + throw new Error('Invalid list'); + } + const item = this._head; + this._map.delete(item.key); + this.removeItem(item); + this._size--; + return item.value; + } + + public forEach(callbackfn: (value: V, key: K, map: LinkedMap) => void, thisArg?: any): void { + let current = this._head; + while (current) { + if (thisArg) { + callbackfn.bind(thisArg)(current.value, current.key, this); + } else { + callbackfn(current.value, current.key, this); + } + current = current.next; + } + } + + public forEachReverse(callbackfn: (value: V, key: K, map: LinkedMap) => void, thisArg?: any): void { + let current = this._tail; + while (current) { + if (thisArg) { + callbackfn.bind(thisArg)(current.value, current.key, this); + } else { + callbackfn(current.value, current.key, this); + } + current = current.previous; + } + } + + public values(): V[] { + let result: V[] = []; + let current = this._head; + while (current) { + result.push(current.value); + current = current.next; + } + return result; + } + + public keys(): K[] { + let result: K[] = []; + let current = this._head; + while (current) { + result.push(current.key); + current = current.next; + } + return result; + } + + /* VS Code / Monaco editor runs on es5 which has no Symbol.iterator + public keys(): IterableIterator { + let current = this._head; + let iterator: IterableIterator = { + [Symbol.iterator]() { + return iterator; + }, + next():IteratorResult { + if (current) { + let result = { value: current.key, done: false }; + current = current.next; + return result; + } else { + return { value: undefined, done: true }; + } + } + }; + return iterator; + } + + public values(): IterableIterator { + let current = this._head; + let iterator: IterableIterator = { + [Symbol.iterator]() { + return iterator; + }, + next():IteratorResult { + if (current) { + let result = { value: current.value, done: false }; + current = current.next; + return result; + } else { + return { value: undefined, done: true }; + } + } + }; + return iterator; + } + */ + + private addItemFirst(item: Item): void { + // First time Insert + if (!this._head && !this._tail) { + this._tail = item; + } else if (!this._head) { + throw new Error('Invalid list'); + } else { + item.next = this._head; + this._head.previous = item; + } + this._head = item; + } + + private addItemLast(item: Item): void { + // First time Insert + if (!this._head && !this._tail) { + this._head = item; + } else if (!this._tail) { + throw new Error('Invalid list'); + } else { + item.previous = this._tail; + this._tail.next = item; + } + this._tail = item; + } + + private removeItem(item: Item): void { + if (item === this._head && item === this._tail) { + this._head = undefined; + this._tail = undefined; + } + else if (item === this._head) { + this._head = item.next; + } + else if (item === this._tail) { + this._tail = item.previous; + } + else { + const next = item.next; + const previous = item.previous; + if (!next || !previous) { + throw new Error('Invalid list'); + } + next.previous = previous; + previous.next = next; + } + } + + private touch(item: Item, touch: Touch): void { + if (!this._head || !this._tail) { + throw new Error('Invalid list'); + } + if ((touch !== Touch.First && touch !== Touch.Last)) { + return; + } + + if (touch === Touch.First) { + if (item === this._head) { + return; + } + + const next = item.next; + const previous = item.previous; + + // Unlink the item + if (item === this._tail) { + // previous must be defined since item was not head but is tail + // So there are more than on item in the map + previous!.next = undefined; + this._tail = previous; + } + else { + // Both next and previous are not undefined since item was neither head nor tail. + next!.previous = previous; + previous!.next = next; + } + + // Insert the node at head + item.previous = undefined; + item.next = this._head; + this._head.previous = item; + this._head = item; + } else if (touch === Touch.Last) { + if (item === this._tail) { + return; + } + + const next = item.next; + const previous = item.previous; + + // Unlink the item. + if (item === this._head) { + // next must be defined since item was not tail but is head + // So there are more than on item in the map + next!.previous = undefined; + this._head = next; + } else { + // Both next and previous are not undefined since item was neither head nor tail. + next!.previous = previous; + previous!.next = next; + } + item.next = undefined; + item.previous = this._tail; + this._tail.next = item; + this._tail = item; + } + } } \ No newline at end of file diff --git a/src/vs/base/common/marked/OSSREADME.json b/src/vs/base/common/marked/OSSREADME.json index 5fc985980a4769b042e3a0cb40c7c5aef749e903..5bfc34a583baaf707351823379fd4e1e7b2368f4 100644 --- a/src/vs/base/common/marked/OSSREADME.json +++ b/src/vs/base/common/marked/OSSREADME.json @@ -3,6 +3,6 @@ [{ "name": "chjj-marked", "repositoryURL": "https://github.com/npmcomponent/chjj-marked", - "version": "0.3.2", + "version": "0.3.6", "license": "MIT" }] diff --git a/src/vs/base/common/marked/raw.marked.js b/src/vs/base/common/marked/raw.marked.js index ce02369727acb2338a274d6af17fcca5688bb6b5..0ee6a3b1e6a607600d81fc00cb152dc489a3fa69 100644 --- a/src/vs/base/common/marked/raw.marked.js +++ b/src/vs/base/common/marked/raw.marked.js @@ -1,4 +1,3 @@ - /** * marked - a markdown parser * Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed) @@ -78,8 +77,9 @@ block.normal = merge({}, block); */ block.gfm = merge({}, block.normal, { - fences: /^ *(`{3,}|~{3,}) *(\S+)? *\n([\s\S]+?)\s*\1 *(?:\n+|$)/, - paragraph: /^/ + fences: /^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/, + paragraph: /^/, + heading: /^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/ }); block.gfm.paragraph = replace(block.paragraph) @@ -191,7 +191,7 @@ Lexer.prototype.token = function(src, top, bq) { this.tokens.push({ type: 'code', lang: cap[2], - text: cap[3] + text: cap[3] || '' }); continue; } @@ -362,7 +362,8 @@ Lexer.prototype.token = function(src, top, bq) { type: this.options.sanitize ? 'paragraph' : 'html', - pre: cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style', + pre: !this.options.sanitizer + && (cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style'), text: cap[0] }); continue; @@ -457,7 +458,7 @@ var inline = { reflink: /^!?\[(inside)\]\s*\[([^\]]*)\]/, nolink: /^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/, strong: /^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/, - em: /^\b_((?:__|[\s\S])+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/, + em: /^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/, code: /^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/, br: /^ {2,}\n(?!\s*$)/, del: noop, @@ -609,8 +610,10 @@ InlineLexer.prototype.output = function(src) { } src = src.substring(cap[0].length); out += this.options.sanitize - ? escape(cap[0]) - : cap[0]; + ? this.options.sanitizer + ? this.options.sanitizer(cap[0]) + : escape(cap[0]) + : cap[0] continue; } @@ -681,7 +684,7 @@ InlineLexer.prototype.output = function(src) { // text if (cap = this.rules.text.exec(src)) { src = src.substring(cap[0].length); - out += escape(this.smartypants(cap[0])); + out += this.renderer.text(escape(this.smartypants(cap[0]))); continue; } @@ -710,24 +713,24 @@ InlineLexer.prototype.outputLink = function(cap, link) { /** * Smartypants Transformations */ -// TODO MonacoChange: Our build fails over the following lines if they are not commented out + InlineLexer.prototype.smartypants = function(text) { - return text; -// if (!this.options.smartypants) return text; -// return text -// // em-dashes -// .replace(/--/g, '\u2014') -// // opening singles -// .replace(/(^|[-\u2014/(\[{"\s])'/g, '$1\u2018') -// // closing singles & apostrophes -// .replace(/'/g, '\u2019') -// // opening doubles -// .replace(/(^|[-\u2014/(\[{\u2018\s])"/g, '$1\u201c') -// // closing doubles -// .replace(/"/g, '\u201d') -// // ellipses -// .replace(/\.{3}/g, '\u2026'); -// END MonacoChange + if (!this.options.smartypants) return text; + return text + // em-dashes + .replace(/---/g, '\u2014') + // en-dashes + .replace(/--/g, '\u2013') + // opening singles + .replace(/(^|[-\u2014/(\[{"\s])'/g, '$1\u2018') + // closing singles & apostrophes + .replace(/'/g, '\u2019') + // opening doubles + .replace(/(^|[-\u2014/(\[{\u2018\s])"/g, '$1\u201c') + // closing doubles + .replace(/"/g, '\u201d') + // ellipses + .replace(/\.{3}/g, '\u2026'); }; /** @@ -735,6 +738,7 @@ InlineLexer.prototype.smartypants = function(text) { */ InlineLexer.prototype.mangle = function(text) { + if (!this.options.mangle) return text; var out = '' , l = text.length , i = 0 @@ -873,7 +877,7 @@ Renderer.prototype.link = function(href, title, text) { } catch (e) { return ''; } - if (prot.indexOf('javascript:') === 0) { + if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0 || prot.indexOf('data:') === 0) { return ''; } } @@ -894,6 +898,10 @@ Renderer.prototype.image = function(href, title, text) { return out; }; +Renderer.prototype.text = function(text) { + return text; +}; + /** * Parsing & Compiling */ @@ -1088,7 +1096,8 @@ function escape(html, encode) { } function unescape(html) { - return html.replace(/&([#\w]+);/g, function(_, n) { + // explicitly match decimal, hex, and named HTML entities + return html.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/g, function(_, n) { n = n.toLowerCase(); if (n === 'colon') return ':'; if (n.charAt(0) === '#') { @@ -1213,7 +1222,7 @@ function marked(src, opt, callback) { } catch (e) { e.message += '\nPlease report this to https://github.com/chjj/marked.'; if ((opt || marked.defaults).silent) { - return '

An error occured:

'
+      return '

An error occurred:

'
         + escape(e.message + '', true)
         + '
'; } @@ -1237,6 +1246,8 @@ marked.defaults = { breaks: false, pedantic: false, sanitize: false, + sanitizer: null, + mangle: true, smartLists: false, silent: false, highlight: null, diff --git a/src/vs/base/common/objects.ts b/src/vs/base/common/objects.ts index 9a814afa30cd8f95fc1ad3ede2db55780aadc55f..d834bfe2ddd13259da78b9d3bf0a1a733a789d9f 100644 --- a/src/vs/base/common/objects.ts +++ b/src/vs/base/common/objects.ts @@ -82,40 +82,6 @@ function _cloneAndChange(obj: any, changer: (orig: any) => any, encounteredObjec return obj; } -// DON'T USE THESE FUNCTION UNLESS YOU KNOW HOW CHROME -// WORKS... WE HAVE SEEN VERY WEIRD BEHAVIOUR WITH CHROME >= 37 - -///** -// * Recursively call Object.freeze on object and any properties that are objects. -// */ -//export function deepFreeze(obj:any):void { -// Object.freeze(obj); -// Object.keys(obj).forEach((key) => { -// if(!(typeof obj[key] === 'object') || Object.isFrozen(obj[key])) { -// return; -// } -// -// deepFreeze(obj[key]); -// }); -// if(!Object.isFrozen(obj)) { -// console.log('too warm'); -// } -//} -// -//export function deepSeal(obj:any):void { -// Object.seal(obj); -// Object.keys(obj).forEach((key) => { -// if(!(typeof obj[key] === 'object') || Object.isSealed(obj[key])) { -// return; -// } -// -// deepSeal(obj[key]); -// }); -// if(!Object.isSealed(obj)) { -// console.log('NOT sealed'); -// } -//} - /** * Copies all properties of source into destination. The optional parameter "overwrite" allows to control * if existing properties on the destination should be overwritten or not. Defaults to true (overwrite). diff --git a/src/vs/base/common/paths.ts b/src/vs/base/common/paths.ts index 3ad625b365305bd1978ef91e5462c131bbfa3b5d..be13cd187efef667cdd000c6d37517fd7400e5c2 100644 --- a/src/vs/base/common/paths.ts +++ b/src/vs/base/common/paths.ts @@ -6,7 +6,7 @@ import { isLinux, isWindows } from 'vs/base/common/platform'; import { fill } from 'vs/base/common/arrays'; -import { rtrim } from 'vs/base/common/strings'; +import { rtrim, beginsWithIgnoreCase, equalsIgnoreCase } from 'vs/base/common/strings'; import { CharCode } from 'vs/base/common/charCode'; /** @@ -341,4 +341,55 @@ export function isValidBasename(name: string): boolean { } return true; -} \ No newline at end of file +} + +export function isEqual(pathA: string, pathB: string, ignoreCase?: boolean): boolean { + const identityEquals = (pathA === pathB); + if (!ignoreCase || identityEquals) { + return identityEquals; + } + + if (!pathA || !pathB) { + return false; + } + + return equalsIgnoreCase(pathA, pathB); +} + +export function isEqualOrParent(path: string, candidate: string, ignoreCase?: boolean): boolean { + if (path === candidate) { + return true; + } + + if (!path || !candidate) { + return false; + } + + if (candidate.length > path.length) { + return false; + } + + if (ignoreCase) { + const beginsWith = beginsWithIgnoreCase(path, candidate); + if (!beginsWith) { + return false; + } + + if (candidate.length === path.length) { + return true; // same path, different casing + } + + let sepOffset = candidate.length; + if (candidate.charAt(candidate.length - 1) === nativeSep) { + sepOffset--; // adjust the expected sep offset in case our candidate already ends in separator character + } + + return path.charAt(sepOffset) === nativeSep; + } + + if (candidate.charAt(candidate.length - 1) !== nativeSep) { + candidate += nativeSep; + } + + return path.indexOf(candidate) === 0; +} diff --git a/src/vs/base/common/scrollable.ts b/src/vs/base/common/scrollable.ts index f7d327627f087a2da4b7c84a48a5fd6b5a85a795..31d821d4ed8fff9479074fd397ad00a279a0a4a6 100644 --- a/src/vs/base/common/scrollable.ts +++ b/src/vs/base/common/scrollable.ts @@ -154,6 +154,20 @@ export class Scrollable extends Disposable { return this._state; } + public validateScrollTop(desiredScrollTop: number): number { + desiredScrollTop = Math.round(desiredScrollTop); + desiredScrollTop = Math.max(desiredScrollTop, 0); + desiredScrollTop = Math.min(desiredScrollTop, this._state.scrollHeight - this._state.height); + return desiredScrollTop; + } + + public validateScrollLeft(desiredScrollLeft: number): number { + desiredScrollLeft = Math.round(desiredScrollLeft); + desiredScrollLeft = Math.max(desiredScrollLeft, 0); + desiredScrollLeft = Math.min(desiredScrollLeft, this._state.scrollWidth - this._state.width); + return desiredScrollLeft; + } + public updateState(update: INewScrollState): void { const oldState = this._state; const newState = new ScrollState( diff --git a/src/vs/base/common/set.ts b/src/vs/base/common/set.ts deleted file mode 100644 index 245bf7480f89d9a10db351ac171841944296c6bf..0000000000000000000000000000000000000000 --- a/src/vs/base/common/set.ts +++ /dev/null @@ -1,38 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -export class ArraySet { - - private _elements: T[]; - - constructor(elements: T[] = []) { - this._elements = elements.slice(); - } - - get size(): number { - return this._elements.length; - } - - set(element: T): void { - this.unset(element); - this._elements.push(element); - } - - contains(element: T): boolean { - return this._elements.indexOf(element) > -1; - } - - unset(element: T): void { - const index = this._elements.indexOf(element); - - if (index > -1) { - this._elements.splice(index, 1); - } - } - - get elements(): T[] { - return this._elements.slice(); - } -} \ No newline at end of file diff --git a/src/vs/base/common/strings.ts b/src/vs/base/common/strings.ts index 83bbdaf61b055a0ba038b6a1d1b531106b5148c1..6eeaba510820ce1f1a0b19be54ab50d51a92db42 100644 --- a/src/vs/base/common/strings.ts +++ b/src/vs/base/common/strings.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ 'use strict'; -import { BoundedLinkedMap } from 'vs/base/common/map'; +import { BoundedMap } from 'vs/base/common/map'; import { CharCode } from 'vs/base/common/charCode'; /** @@ -251,7 +251,7 @@ export function regExpLeadsToEndlessLoop(regexp: RegExp): boolean { */ export let canNormalize = typeof (('').normalize) === 'function'; const nonAsciiCharactersPattern = /[^\u0000-\u0080]/; -const normalizedCache = new BoundedLinkedMap(10000); // bounded to 10000 elements +const normalizedCache = new BoundedMap(10000); // bounded to 10000 elements export function normalizeNFC(str: string): string { if (!canNormalize || !str) { return str; @@ -383,9 +383,8 @@ function isAsciiLetter(code: number): boolean { } export function equalsIgnoreCase(a: string, b: string): boolean { - - let len1 = a.length, - len2 = b.length; + const len1 = a ? a.length : 0; + const len2 = b ? b.length : 0; if (len1 !== len2) { return false; @@ -394,7 +393,11 @@ export function equalsIgnoreCase(a: string, b: string): boolean { return doEqualsIgnoreCase(a, b); } -export function doEqualsIgnoreCase(a: string, b: string, stopAt = a.length): boolean { +function doEqualsIgnoreCase(a: string, b: string, stopAt = a.length): boolean { + if (typeof a !== 'string' || typeof b !== 'string') { + return false; + } + for (let i = 0; i < stopAt; i++) { const codeA = a.charCodeAt(i); const codeB = b.charCodeAt(i); @@ -468,6 +471,43 @@ export function commonSuffixLength(a: string, b: string): number { return len; } +function substrEquals(a: string, aStart: number, aEnd: number, b: string, bStart: number, bEnd: number): boolean { + while (aStart < aEnd && bStart < bEnd) { + if (a[aStart] !== b[bStart]) { + return false; + } + aStart += 1; + bStart += 1; + } + return true; +} + +/** + * Return the overlap between the suffix of `a` and the prefix of `b`. + * For instance `overlap("foobar", "arr, I'm a pirate") === 2`. + */ +export function overlap(a: string, b: string): number { + let aEnd = a.length; + let bEnd = b.length; + let aStart = aEnd - bEnd; + + if (aStart === 0) { + return a === b ? aEnd : 0; + } else if (aStart < 0) { + bEnd += aStart; + aStart = 0; + } + + while (aStart < aEnd && bEnd > 0) { + if (substrEquals(a, aStart, aEnd, b, 0, bEnd)) { + return bEnd; + } + bEnd -= 1; + aStart += 1; + } + return 0; +} + // --- unicode // http://en.wikipedia.org/wiki/Surrogate_pair // Returns the code point starting at a specified index in a string diff --git a/src/vs/base/common/winjs.base.d.ts b/src/vs/base/common/winjs.base.d.ts index ea35630cf374e6634c99c22041955031dfe7c661..8e7a1afe3a9f6550439ec4cfe8bf37e64e2f6550 100644 --- a/src/vs/base/common/winjs.base.d.ts +++ b/src/vs/base/common/winjs.base.d.ts @@ -55,6 +55,18 @@ export interface TProgressCallback { (progress: T): void; } +interface IPromiseErrorDetail { + parent: TPromise; + error: any; + id: number; + handler: Function; + exception: Error; +} + +interface IPromiseError { + detail: IPromiseErrorDetail; +} + /** * A Promise implementation that supports progress and cancelation. */ @@ -95,6 +107,11 @@ export declare class TPromise { public static wrap(value: ValueType): TPromise; public static wrapError(error: any): TPromise; + + /** + * @internal + */ + public static addEventListener(event: 'error', promiseErrorHandler: (e: IPromiseError) => void); } // --- Generic promise with generic progress value diff --git a/src/vs/base/common/winjs.base.js b/src/vs/base/common/winjs.base.js index d8e7516a0d9382fdfcb2441d3d0a17a797e9adab..aea7370ed16e701f73c1ba05d5fb20acf90728fb 100644 --- a/src/vs/base/common/winjs.base.js +++ b/src/vs/base/common/winjs.base.js @@ -3,60 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -define(['./winjs.base.raw', 'vs/base/common/errors'], function (winjs, __Errors__) { +define(['./winjs.base.raw'], function (winjs) { 'use strict'; - - var outstandingPromiseErrors = {}; - function promiseErrorHandler(e) { - - // - // e.detail looks like: { exception, error, promise, handler, id, parent } - // - var details = e.detail; - var id = details.id; - - // If the error has a parent promise then this is not the origination of the - // error so we check if it has a handler, and if so we mark that the error - // was handled by removing it from outstandingPromiseErrors - // - if (details.parent) { - if (details.handler && outstandingPromiseErrors) { - delete outstandingPromiseErrors[id]; - } - return; - } - - // Indicate that this error was originated and needs to be handled - outstandingPromiseErrors[id] = details; - - // The first time the queue fills up this iteration, schedule a timeout to - // check if any errors are still unhandled. - if (Object.keys(outstandingPromiseErrors).length === 1) { - setTimeout(function () { - var errors = outstandingPromiseErrors; - outstandingPromiseErrors = {}; - Object.keys(errors).forEach(function (errorId) { - var error = errors[errorId]; - if(error.exception) { - __Errors__.onUnexpectedError(error.exception); - } else if(error.error) { - __Errors__.onUnexpectedError(error.error); - } - console.log("WARNING: Promise with no error callback:" + error.id); - console.log(error); - if(error.exception) { - console.log(error.exception.stack); - } - }); - }, 0); - } - } - - winjs.Promise.addEventListener("error", promiseErrorHandler); - return { Promise: winjs.Promise, TPromise: winjs.Promise, PPromise: winjs.Promise }; -}); \ No newline at end of file +}); diff --git a/src/vs/base/node/extfs.ts b/src/vs/base/node/extfs.ts index ef8680f062a446466a9b5df1465ebdbc09b20156..6b99256462b6a1a65239a1e247d43b8aa53d00aa 100644 --- a/src/vs/base/node/extfs.ts +++ b/src/vs/base/node/extfs.ts @@ -374,13 +374,13 @@ export function writeFileAndFlush(path: string, data: string | NodeBuffer, optio /** * Copied from: https://github.com/Microsoft/vscode-node-debug/blob/master/src/node/pathUtilities.ts#L83 * - * Given an absolute, normalized, and existing file path 'realpath' returns the exact path that the file has on disk. + * Given an absolute, normalized, and existing file path 'realcase' returns the exact path that the file has on disk. * On a case insensitive file system, the returned path might differ from the original path by character casing. * On a case sensitive file system, the returned path will always be identical to the original path. * In case of errors, null is returned. But you cannot use this function to verify that a path exists. - * realpathSync does not handle '..' or '.' path segments and it does not take the locale into account. + * realcaseSync does not handle '..' or '.' path segments and it does not take the locale into account. */ -export function realpathSync(path: string): string { +export function realcaseSync(path: string): string { const dir = paths.dirname(path); if (path === dir) { // end recursion return path; @@ -392,7 +392,7 @@ export function realpathSync(path: string): string { const found = entries.filter(e => e.toLowerCase() === name); // use a case insensitive search if (found.length === 1) { // on a case sensitive filesystem we cannot determine here, whether the file exists or not, hence we need the 'file exists' precondition - const prefix = realpathSync(dir); // recurse + const prefix = realcaseSync(dir); // recurse if (prefix) { return paths.join(prefix, found[0]); } @@ -400,7 +400,7 @@ export function realpathSync(path: string): string { // must be a case sensitive $filesystem const ix = found.indexOf(name); if (ix >= 0) { // case sensitive - const prefix = realpathSync(dir); // recurse + const prefix = realcaseSync(dir); // recurse if (prefix) { return paths.join(prefix, found[ix]); } @@ -411,4 +411,44 @@ export function realpathSync(path: string): string { } return null; -} \ No newline at end of file +} + +export function realpathSync(path: string): string { + try { + return fs.realpathSync(path); + } catch (error) { + + // We hit an error calling fs.realpathSync(). Since fs.realpathSync() is doing some path normalization + // we now do a similar normalization and then try again if we can access the path with read + // permissions at least. If that succeeds, we return that path. + // fs.realpath() is resolving symlinks and that can fail in certain cases. The workaround is + // to not resolve links but to simply see if the path is read accessible or not. + const normalizedPath = normalizePath(path); + fs.accessSync(normalizedPath, fs.constants.R_OK); // throws in case of an error + + return normalizedPath; + } +} + +export function realpath(path: string, callback: (error: Error, realpath: string) => void): void { + return fs.realpath(path, (error, realpath) => { + if (!error) { + return callback(null, realpath); + } + + // We hit an error calling fs.realpath(). Since fs.realpath() is doing some path normalization + // we now do a similar normalization and then try again if we can access the path with read + // permissions at least. If that succeeds, we return that path. + // fs.realpath() is resolving symlinks and that can fail in certain cases. The workaround is + // to not resolve links but to simply see if the path is read accessible or not. + const normalizedPath = normalizePath(path); + + return fs.access(normalizedPath, fs.constants.R_OK, error => { + return callback(error, normalizedPath); + }); + }); +} + +function normalizePath(path: string): string { + return strings.rtrim(paths.normalize(path), paths.sep); +} diff --git a/src/vs/base/node/id.ts b/src/vs/base/node/id.ts index 082983bea72206091660761fb745ebb2d5dda800..f8b65bfcbc99729d78dd1daec69fd0cc11dab112 100644 --- a/src/vs/base/node/id.ts +++ b/src/vs/base/node/id.ts @@ -35,6 +35,9 @@ export const virtualMachineHint: { value(): number } = new class { this._virtualMachineOUIs.insert('00-05-69', true); this._virtualMachineOUIs.insert('00-03-FF', true); this._virtualMachineOUIs.insert('00-1C-42', true); + this._virtualMachineOUIs.insert('00-16-3E', true); + this._virtualMachineOUIs.insert('08-00-27', true); + } return this._virtualMachineOUIs.findSubstr(mac); } diff --git a/src/vs/base/node/pfs.ts b/src/vs/base/node/pfs.ts index 9ff23afdfa17b0587c703d6c9ed19f24ed071b2d..3d8e1808439753006a0961f776f8531ceff3035d 100644 --- a/src/vs/base/node/pfs.ts +++ b/src/vs/base/node/pfs.ts @@ -72,7 +72,7 @@ export function rimraf(path: string): TPromise { } export function realpath(path: string): TPromise { - return nfcall(fs.realpath, path, null); + return nfcall(extfs.realpath, path); } export function stat(path: string): TPromise { diff --git a/src/vs/base/node/startupTimers.d.ts b/src/vs/base/node/startupTimers.d.ts index 5a04270f4b603ac5ad16b5b5707eb456b815558c..2fae1f8eab1ad1342b25a424791691409351dc22 100644 --- a/src/vs/base/node/startupTimers.d.ts +++ b/src/vs/base/node/startupTimers.d.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Profile } from './profiler' +import { Profile } from './profiler'; declare interface TickStart { name: string; diff --git a/src/vs/base/node/stdForkStart.js b/src/vs/base/node/stdForkStart.js index 92024acf6b851e761ad1dc4704e87b172086b495..ffd56771bb63269ca75e0f2d16352bbcf8bd6a38 100644 --- a/src/vs/base/node/stdForkStart.js +++ b/src/vs/base/node/stdForkStart.js @@ -3,16 +3,16 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -var net = require('net'), - fs = require('fs'), - stream = require('stream'), - util = require('util'); +const net = require('net'); +const fs = require('fs'); +// const stream = require('stream'); +// const util = require('util'); var ENABLE_LOGGING = false; -var log = (function() { +var log = (function () { if (!ENABLE_LOGGING) { - return function() {}; + return function () { }; } var isFirst = true; var LOG_LOCATION = 'C:\\stdFork.log'; @@ -23,7 +23,7 @@ var log = (function() { return; } fs.appendFileSync(LOG_LOCATION, str + '\n'); - } + }; })(); var stdInPipeName = process.env['STDIN_PIPE_NAME']; @@ -36,7 +36,7 @@ log('STDERR_PIPE_NAME: ' + stdErrPipeName); log('ELECTRON_RUN_AS_NODE: ' + process.env['ELECTRON_RUN_AS_NODE']); // stdout redirection to named pipe -(function() { +(function () { log('Beginning stdout redirection...'); // Create a writing stream to the stdout pipe @@ -46,7 +46,7 @@ log('ELECTRON_RUN_AS_NODE: ' + process.env['ELECTRON_RUN_AS_NODE']); stdOutStream.unref(); // handle process.stdout - process.__defineGetter__('stdout', function() { return stdOutStream; }); + process.__defineGetter__('stdout', function () { return stdOutStream; }); // Create a writing stream to the stderr pipe var stdErrStream = net.connect(stdErrPipeName); @@ -55,15 +55,15 @@ log('ELECTRON_RUN_AS_NODE: ' + process.env['ELECTRON_RUN_AS_NODE']); stdErrStream.unref(); // handle process.stderr - process.__defineGetter__('stderr', function() { return stdErrStream; }); + process.__defineGetter__('stderr', function () { return stdErrStream; }); - var fsWriteSyncString = function(fd, str, position, encoding) { + var fsWriteSyncString = function (fd, str, position, encoding) { // fs.writeSync(fd, string[, position[, encoding]]); var buf = new Buffer(str, encoding || 'utf8'); return fsWriteSyncBuffer(fd, buf, 0, buf.length); }; - var fsWriteSyncBuffer = function(fd, buffer, off, len, position) { + var fsWriteSyncBuffer = function (fd, buffer, off, len/* , position */) { off = Math.abs(off | 0); len = Math.abs(len | 0); @@ -99,7 +99,7 @@ log('ELECTRON_RUN_AS_NODE: ' + process.env['ELECTRON_RUN_AS_NODE']); // handle fs.writeSync(1, ...) and fs.writeSync(2, ...) var originalWriteSync = fs.writeSync; - fs.writeSync = function(fd, data, position, encoding) { + fs.writeSync = function (fd, data/* , position, encoding */) { if (fd !== 1 && fd !== 2) { return originalWriteSync.apply(fs, arguments); } @@ -124,17 +124,17 @@ log('ELECTRON_RUN_AS_NODE: ' + process.env['ELECTRON_RUN_AS_NODE']); })(); // stdin redirection to named pipe -(function() { +(function () { // Begin listening to stdin pipe - var server = net.createServer(function(stream) { + var server = net.createServer(function (stream) { // Stop accepting new connections, keep the existing one alive server.close(); log('Parent process has connected to my stdin. All should be good now.'); // handle process.stdin - process.__defineGetter__('stdin', function() { + process.__defineGetter__('stdin', function () { return stream; }); @@ -156,7 +156,7 @@ log('ELECTRON_RUN_AS_NODE: ' + process.env['ELECTRON_RUN_AS_NODE']); log('Finished loading program.'); var stdinIsReferenced = true; - var timer = setInterval(function() { + var timer = setInterval(function () { var listenerCount = ( stream.listeners('data').length + stream.listeners('end').length + @@ -189,7 +189,7 @@ log('ELECTRON_RUN_AS_NODE: ' + process.env['ELECTRON_RUN_AS_NODE']); }); - server.listen(stdInPipeName, function() { + server.listen(stdInPipeName, function () { // signal via stdout that the parent process can now begin writing to stdin pipe process.stdout.write('ready'); }); diff --git a/src/vs/base/parts/ipc/node/ipc.cp.ts b/src/vs/base/parts/ipc/node/ipc.cp.ts index 940c18638fba3f63cbf3cdcc6ec6be93bb63ac41..21b1b3f5531270d963cb3f7aeab825d65d201eec 100644 --- a/src/vs/base/parts/ipc/node/ipc.cp.ts +++ b/src/vs/base/parts/ipc/node/ipc.cp.ts @@ -56,6 +56,14 @@ export interface IIPCOptions { */ debugBrk?: number; + /** + * See https://github.com/Microsoft/vscode/issues/27665 + * Allows to pass in fresh execArgv to the forked process such that it doesn't inherit them from `process.execArgv`. + * e.g. Launching the extension host process with `--debug-brk=xxx` and then forking a process from the extension host + * results in the forked process inheriting `--debug-brk=xxx`. + */ + freshExecArgv?: boolean; + /** * Enables our createQueuedSender helper for this Client. Uses a queue when the internal Node.js queue is * full of messages - see notes on that method. @@ -125,6 +133,10 @@ export class Client implements IChannelClient, IDisposable { forkOpts.env = assign(forkOpts.env, this.options.env); } + if (this.options && this.options.freshExecArgv) { + forkOpts.execArgv = []; + } + if (this.options && typeof this.options.debug === 'number') { forkOpts.execArgv = ['--nolazy', '--debug=' + this.options.debug]; } diff --git a/src/vs/base/parts/quickopen/browser/quickOpenModel.ts b/src/vs/base/parts/quickopen/browser/quickOpenModel.ts index 06629740fd7cd2c2964f1dae4b9f0a6299d6ccc6..7023eed367219b6ddc61016e757f03d85b7f1121 100644 --- a/src/vs/base/parts/quickopen/browser/quickOpenModel.ts +++ b/src/vs/base/parts/quickopen/browser/quickOpenModel.ts @@ -21,6 +21,9 @@ import { ActionBar, IActionItem } from 'vs/base/browser/ui/actionbar/actionbar'; import { HighlightedLabel } from 'vs/base/browser/ui/highlightedlabel/highlightedLabel'; import DOM = require('vs/base/browser/dom'); import { IQuickOpenStyles } from 'vs/base/parts/quickopen/browser/quickOpenWidget'; +import { KeybindingLabel } from "vs/base/browser/ui/keybindingLabel/keybindingLabel"; +import { OS } from "vs/base/common/platform"; +import { ResolvedKeybinding } from "vs/base/common/keyCodes"; export interface IContext { event: any; @@ -108,6 +111,13 @@ export class QuickOpenEntry { return null; } + /** + * An optional keybinding to show for an entry. + */ + public getKeybinding(): ResolvedKeybinding { + return null; + } + /** * A resource for this entry. Resource URIs can be used to compare different kinds of entries and group * them together. @@ -389,6 +399,7 @@ export interface IQuickOpenEntryTemplateData { label: IconLabel; detail: HighlightedLabel; description: HighlightedLabel; + keybinding: KeybindingLabel; actionBar: ActionBar; } @@ -449,6 +460,12 @@ class Renderer implements IRenderer { DOM.addClass(descriptionContainer, 'quick-open-entry-description'); const description = new HighlightedLabel(descriptionContainer); + // Keybinding + const keybindingContainer = document.createElement('span'); + row1.appendChild(keybindingContainer); + DOM.addClass(keybindingContainer, 'quick-open-entry-keybinding'); + const keybinding = new KeybindingLabel(keybindingContainer, OS); + // Detail const detailContainer = document.createElement('div'); row2.appendChild(detailContainer); @@ -481,6 +498,7 @@ class Renderer implements IRenderer { label, detail, description, + keybinding, group, actionBar }; @@ -508,6 +526,13 @@ class Renderer implements IRenderer { } }); + // Entry group class + if (entry instanceof QuickOpenEntryGroup && entry.getGroupLabel()) { + DOM.addClass(data.container, 'has-group-label'); + } else { + DOM.removeClass(data.container, 'has-group-label'); + } + // Entry group if (entry instanceof QuickOpenEntryGroup) { const group = entry; @@ -547,6 +572,9 @@ class Renderer implements IRenderer { // Description data.description.set(entry.getDescription(), descriptionHighlights || []); data.description.element.title = entry.getDescription(); + + // Keybinding + data.keybinding.set(entry.getKeybinding(), null); } } @@ -558,6 +586,8 @@ class Renderer implements IRenderer { data.entry = null; data.description.dispose(); data.description = null; + data.keybinding.dispose(); + data.keybinding = null; data.detail.dispose(); data.detail = null; data.group = null; diff --git a/src/vs/base/parts/quickopen/browser/quickOpenViewer.ts b/src/vs/base/parts/quickopen/browser/quickOpenViewer.ts index 9d0d465b63b1de9dcfa8710d18551f5ea0a95eb9..07817947cbb0d6bc9b0ca3f9c14c0a4a1d4face6 100644 --- a/src/vs/base/parts/quickopen/browser/quickOpenViewer.ts +++ b/src/vs/base/parts/quickopen/browser/quickOpenViewer.ts @@ -55,6 +55,16 @@ export class AccessibilityProvider implements IAccessibilityProvider { return model.accessibilityProvider && model.accessibilityProvider.getAriaLabel(element); } + + public getPosInSet(tree: ITree, element: any): string { + const model = this.modelProvider.getModel(); + return String(model.entries.indexOf(element) + 1); + } + + public getSetSize(): string { + const model = this.modelProvider.getModel(); + return String(model.entries.length); + } } export class Filter implements IFilter { diff --git a/src/vs/base/parts/quickopen/browser/quickOpenWidget.ts b/src/vs/base/parts/quickopen/browser/quickOpenWidget.ts index 5ac4eba897286ef0a6b91703ee963974387b8c82..7a4cbcf5a2d2fd2d3d1367b4efa358d0ff65b874 100644 --- a/src/vs/base/parts/quickopen/browser/quickOpenWidget.ts +++ b/src/vs/base/parts/quickopen/browser/quickOpenWidget.ts @@ -15,7 +15,7 @@ import { IQuickNavigateConfiguration, IAutoFocus, IEntryRunContext, IModel, Mode import { Filter, Renderer, DataSource, IModelProvider, AccessibilityProvider } from 'vs/base/parts/quickopen/browser/quickOpenViewer'; import { Dimension, Builder, $ } from 'vs/base/browser/builder'; import { ISelectionEvent, IFocusEvent, ITree, ContextMenuEvent, IActionProvider, ITreeStyles } from 'vs/base/parts/tree/browser/tree'; -import { InputBox, MessageType, IInputBoxStyles } from 'vs/base/browser/ui/inputbox/inputBox'; +import { InputBox, MessageType, IInputBoxStyles, IRange } from 'vs/base/browser/ui/inputbox/inputBox'; import Severity from 'vs/base/common/severity'; import { Tree } from 'vs/base/parts/tree/browser/treeImpl'; import { ProgressBar } from 'vs/base/browser/ui/progressbar/progressbar'; @@ -59,6 +59,7 @@ export interface IQuickOpenStyles extends IInputBoxStyles, ITreeStyles { export interface IShowOptions { quickNavigateConfiguration?: IQuickNavigateConfiguration; autoFocus?: IAutoFocus; + inputSelection?: IRange; } export interface IQuickOpenUsageLogger { @@ -98,6 +99,7 @@ export class QuickOpenWidget implements IModelProvider { private static MAX_WIDTH = 600; // Max total width of quick open widget private static MAX_ITEMS_HEIGHT = 20 * 22; // Max height of item list below input field + private isDisposed: boolean; private options: IQuickOpenOptions; private builder: Builder; private tree: ITree; @@ -122,6 +124,7 @@ export class QuickOpenWidget implements IModelProvider { private renderer: Renderer; constructor(container: HTMLElement, callbacks: IQuickOpenCallbacks, options: IQuickOpenOptions, usageLogger?: IQuickOpenUsageLogger) { + this.isDisposed = false; this.toUnbind = []; this.container = container; this.callbacks = callbacks; @@ -202,8 +205,11 @@ export class QuickOpenWidget implements IModelProvider { this.navigateInTree(keyboardEvent.keyCode, keyboardEvent.shiftKey); - // Position cursor at the end of input to allow right arrow (open in background) to function immediately - this.inputBox.inputElement.selectionStart = this.inputBox.value.length; + // Position cursor at the end of input to allow right arrow (open in background) + // to function immediately unless the user has made a selection + if (this.inputBox.inputElement.selectionStart === this.inputBox.inputElement.selectionEnd) { + this.inputBox.inputElement.selectionStart = this.inputBox.value.length; + } } // Select element on Enter or on Arrow-Right if we are at the end of the input @@ -392,7 +398,9 @@ export class QuickOpenWidget implements IModelProvider { return false; // no modifiers allowed } - return this.inputBox.inputElement.selectionStart === this.inputBox.value.length; // only when cursor is at the end of the input field value + // validate the cursor is at the end of the input, and if not prevent + // opening in the background such as the selection can be changed + return this.inputBox.inputElement.selectionEnd === this.inputBox.value.length; } private onType(): void { @@ -412,7 +420,7 @@ export class QuickOpenWidget implements IModelProvider { } public navigate(next: boolean, quickNavigate?: IQuickNavigateConfiguration): void { - if (this.isVisible) { + if (this.isVisible()) { // Transition into quick navigate mode if not yet done if (!this.quickNavigateConfiguration && quickNavigate) { @@ -561,6 +569,11 @@ export class QuickOpenWidget implements IModelProvider { this.doShowWithInput(param, options && options.autoFocus ? options.autoFocus : {}); } + // Respect selectAll option + if (options && options.inputSelection && !this.quickNavigateConfiguration) { + this.inputBox.select(options.inputSelection); + } + if (this.callbacks.onShow) { this.callbacks.onShow(); } @@ -933,6 +946,9 @@ export class QuickOpenWidget implements IModelProvider { if (!this.isLoosingFocus) { return; } + if (this.isDisposed) { + return; + } const veto = this.callbacks.onFocusLost && this.callbacks.onFocusLost(); if (!veto) { @@ -942,6 +958,7 @@ export class QuickOpenWidget implements IModelProvider { } public dispose(): void { + this.isDisposed = true; this.toUnbind = dispose(this.toUnbind); this.progressBar.dispose(); diff --git a/src/vs/base/parts/quickopen/browser/quickopen.css b/src/vs/base/parts/quickopen/browser/quickopen.css index 84eb7d781fbc22e4d1cf96aac531657fffebadaf..dfe35cceb0bdfd2c01a77ed8babb63478831229b 100644 --- a/src/vs/base/parts/quickopen/browser/quickopen.css +++ b/src/vs/base/parts/quickopen/browser/quickopen.css @@ -36,7 +36,7 @@ } .quick-open-widget .quick-open-tree { - line-height: 1.8em; + line-height: 22px; } .quick-open-widget .quick-open-tree .monaco-tree-row > .content > .sub-content { @@ -87,6 +87,14 @@ text-overflow: ellipsis; } +.quick-open-widget .quick-open-tree .content.has-group-label .quick-open-entry-keybinding { + margin-right: 8px; +} + +.quick-open-widget .quick-open-tree .quick-open-entry-keybinding .monaco-kbkey { + vertical-align: text-bottom; +} + .quick-open-widget .quick-open-tree .results-group { margin-right: 18px; } @@ -121,7 +129,7 @@ } .monaco-tree .monaco-tree-row > .content.actions > .primary-action-bar { - line-height: 1em; + line-height: 22px; } .monaco-tree .monaco-tree-row > .content.actions > .primary-action-bar { diff --git a/src/vs/base/test/browser/quickopen.test.ts b/src/vs/base/parts/quickopen/test/browser/quickopen.test.ts similarity index 100% rename from src/vs/base/test/browser/quickopen.test.ts rename to src/vs/base/parts/quickopen/test/browser/quickopen.test.ts diff --git a/src/vs/base/parts/tree/browser/tree.ts b/src/vs/base/parts/tree/browser/tree.ts index 2b03b5f138b7697bb34bd8ee538d356fe1f048c5..ab01546278c3decd63a123d4a335a70c01f3c428 100644 --- a/src/vs/base/parts/tree/browser/tree.ts +++ b/src/vs/base/parts/tree/browser/tree.ts @@ -76,11 +76,6 @@ export interface ITree extends Events.IEventEmitter { */ refresh(element?: any, recursive?: boolean): WinJS.Promise; - /** - * Refreshes all given elements. - */ - refreshAll(elements: any[], recursive?: boolean): WinJS.Promise; - /** * Expands an element. * The returned promise returns a boolean for whether the element was expanded or not. @@ -433,6 +428,18 @@ export interface IAccessibilityProvider { * See also: https://www.w3.org/TR/wai-aria/states_and_properties#aria-label */ getAriaLabel(tree: ITree, element: any): string; + + /** + * Given an element in the tree return its aria-posinset. Should be between 1 and aria-setsize + * https://www.w3.org/TR/wai-aria/states_and_properties#aria-posinset + */ + getPosInSet?(tree: ITree, element: any): string; + + /** + * Return the aria-setsize of the tree. + * https://www.w3.org/TR/wai-aria/states_and_properties#aria-setsize + */ + getSetSize?(): string; } export /* abstract */ class ContextMenuEvent { diff --git a/src/vs/base/parts/tree/browser/treeDefaults.ts b/src/vs/base/parts/tree/browser/treeDefaults.ts index 4b0949c9618abeba9247c2357ecb5daef06f6d7c..bc4ccdc1b73f83f8408b9046ddb45181c29bcec2 100644 --- a/src/vs/base/parts/tree/browser/treeDefaults.ts +++ b/src/vs/base/parts/tree/browser/treeDefaults.ts @@ -16,59 +16,6 @@ import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent'; import _ = require('vs/base/parts/tree/browser/tree'); import { KeyCode, KeyMod, Keybinding, createKeybinding, SimpleKeybinding } from 'vs/base/common/keyCodes'; -export interface ILegacyTemplateData { - root: HTMLElement; - element: any; - previousCleanupFn: _.IElementCallback; -} - -export class LegacyRenderer implements _.IRenderer { - - public getHeight(tree: _.ITree, element: any): number { - return 20; - } - - public getTemplateId(tree: _.ITree, element: any): string { - return 'legacy'; - } - - public renderTemplate(tree: _.ITree, templateId: string, container: HTMLElement): any { - return { - root: container, - element: null, - previousCleanupFn: null - }; - } - - public renderElement(tree: _.ITree, element: any, templateId: string, templateData: ILegacyTemplateData): void { - if (templateData.previousCleanupFn) { - templateData.previousCleanupFn(tree, templateData.element); - } - - while (templateData.root && templateData.root.firstChild) { - templateData.root.removeChild(templateData.root.firstChild); - } - - templateData.element = element; - templateData.previousCleanupFn = this.render(tree, element, templateData.root); - } - - public disposeTemplate(tree: _.ITree, templateId: string, templateData: any): void { - if (templateData.previousCleanupFn) { - templateData.previousCleanupFn(tree, templateData.element); - } - - templateData.root = null; - templateData.element = null; - templateData.previousCleanupFn = null; - } - - protected render(tree: _.ITree, element: any, container: HTMLElement, previousCleanupFn?: _.IElementCallback): _.IElementCallback { - container.textContent = '' + element; - return null; - } -} - export interface IKeyBindingCallback { (tree: _.ITree, event: IKeyboardEvent): void; } diff --git a/src/vs/base/parts/tree/browser/treeImpl.ts b/src/vs/base/parts/tree/browser/treeImpl.ts index ba27e6888479582210a95b1fc7628b2f97692e7b..8bd111975601f8623b01d259c34f27f9e90f22f7 100644 --- a/src/vs/base/parts/tree/browser/treeImpl.ts +++ b/src/vs/base/parts/tree/browser/treeImpl.ts @@ -41,7 +41,7 @@ export class TreeContext implements _.ITreeContext { } this.dataSource = configuration.dataSource; - this.renderer = configuration.renderer || new TreeDefaults.LegacyRenderer(); + this.renderer = configuration.renderer; this.controller = configuration.controller || new TreeDefaults.DefaultController({ clickBehavior: TreeDefaults.ClickBehavior.ON_MOUSE_UP, keyboardSupport: typeof options.keyboardSupport !== 'boolean' || options.keyboardSupport }); this.dnd = configuration.dnd || new TreeDefaults.DefaultDragAndDrop(); this.filter = configuration.filter || new TreeDefaults.DefaultFilter(); @@ -170,10 +170,6 @@ export class Tree extends Events.EventEmitter implements _.ITree { return this.model.refresh(element, recursive); } - public refreshAll(elements: any[], recursive = true): WinJS.Promise { - return this.model.refreshAll(elements, recursive); - } - public expand(element: any): WinJS.Promise { return this.model.expand(element); } diff --git a/src/vs/base/parts/tree/browser/treeModel.ts b/src/vs/base/parts/tree/browser/treeModel.ts index a3fbdfa04d571d7e9dc654b7e3c99c92d0828da7..9ca9f059c727909a80cc9f760f6c99569637581e 100644 --- a/src/vs/base/parts/tree/browser/treeModel.ts +++ b/src/vs/base/parts/tree/browser/treeModel.ts @@ -839,23 +839,6 @@ export class TreeModel extends Events.EventEmitter { }); } - public refreshAll(elements: any[], recursive: boolean = true): WinJS.Promise { - try { - this.beginDeferredEmit(); - return this._refreshAll(elements, recursive); - } finally { - this.endDeferredEmit(); - } - } - - private _refreshAll(elements: any[], recursive: boolean): WinJS.Promise { - var promises = []; - for (var i = 0, len = elements.length; i < len; i++) { - promises.push(this.refresh(elements[i], recursive)); - } - return WinJS.Promise.join(promises); - } - public expand(element: any): WinJS.Promise { var item = this.getItem(element); diff --git a/src/vs/base/parts/tree/browser/treeView.ts b/src/vs/base/parts/tree/browser/treeView.ts index 117e60db01d9171e136e26a5411665c350c6c1d7..02a5ce62343793bae67bbc228ab3914bc1bcb076 100644 --- a/src/vs/base/parts/tree/browser/treeView.ts +++ b/src/vs/base/parts/tree/browser/treeView.ts @@ -197,22 +197,23 @@ export class ViewItem implements IViewItem { // ARIA this.element.setAttribute('role', 'treeitem'); + const accessibility = this.context.accessibilityProvider; + const ariaLabel = accessibility.getAriaLabel(this.context.tree, this.model.getElement()); + if (ariaLabel) { + this.element.setAttribute('aria-label', ariaLabel); + } + if (accessibility.getPosInSet && accessibility.getSetSize) { + this.element.setAttribute('aria-setsize', accessibility.getSetSize()); + this.element.setAttribute('aria-posinset', accessibility.getPosInSet(this.context.tree, this.model.getElement())); + } if (this.model.hasTrait('focused')) { const base64Id = strings.safeBtoa(this.model.id); - const ariaLabel = this.context.accessibilityProvider.getAriaLabel(this.context.tree, this.model.getElement()); this.element.setAttribute('aria-selected', 'true'); this.element.setAttribute('id', base64Id); - if (ariaLabel) { - this.element.setAttribute('aria-label', ariaLabel); - } else { - this.element.setAttribute('aria-labelledby', base64Id); // force screen reader to compute label from children (helps NVDA at least) - } } else { this.element.setAttribute('aria-selected', 'false'); this.element.removeAttribute('id'); - this.element.removeAttribute('aria-label'); - this.element.removeAttribute('aria-labelledby'); } if (this.model.hasChildren()) { this.element.setAttribute('aria-expanded', String(!!this.model.isExpanded())); @@ -464,7 +465,6 @@ export class TreeView extends HeightMap { this.wrapper = document.createElement('div'); this.wrapper.className = 'monaco-tree-wrapper'; this.scrollableElement = new ScrollableElement(this.wrapper, { - canUseTranslate3d: false, alwaysConsumeMouseWheel: true, horizontal: ScrollbarVisibility.Hidden, vertical: (typeof context.options.verticalScrollMode !== 'undefined' ? context.options.verticalScrollMode : ScrollbarVisibility.Auto), @@ -606,7 +606,7 @@ export class TreeView extends HeightMap { if (styles.listDropBackground) { content.push(` .monaco-tree.monaco-tree-instance-${this.instance} .monaco-tree-wrapper.drop-target, - .monaco-tree.monaco-tree-instance-${this.instance} .monaco-tree-rows > .monaco-tree-row.drop-target { background-color: ${styles.listDropBackground} !important; } + .monaco-tree.monaco-tree-instance-${this.instance} .monaco-tree-rows > .monaco-tree-row.drop-target { background-color: ${styles.listDropBackground} !important; color: inherit !important; } `); } @@ -1631,6 +1631,10 @@ export class TreeView extends HeightMap { } private removeItemFromDOM(item: ViewItem): void { + if (!item) { + return; + } + item.removeFromDOM(); } diff --git a/src/vs/base/parts/tree/test/browser/treeModel.test.ts b/src/vs/base/parts/tree/test/browser/treeModel.test.ts index efb3c25a5b8fb82253c15f77291517a5c02f4308..c9c890127e2cb20ec9a812d9c424d62377266444 100644 --- a/src/vs/base/parts/tree/test/browser/treeModel.test.ts +++ b/src/vs/base/parts/tree/test/browser/treeModel.test.ts @@ -293,42 +293,6 @@ suite('TreeModel', () => { }); }); - test('refreshAll(...) refreshes the elements and descendants', (done) => { - model.setInput(SAMPLE.AB).then(() => { - model.expand(SAMPLE.AB.children[0]); - model.expand(SAMPLE.AB.children[2]); - - counter.listen(model, 'refreshing'); // 3 - counter.listen(model, 'refreshed'); // 3 - counter.listen(model, 'item:refresh'); // 7 - counter.listen(model, 'item:childrenRefreshing'); // 2 - counter.listen(model, 'item:childrenRefreshed'); // 2 - - return model.refreshAll([SAMPLE.AB.children[0], SAMPLE.AB.children[1], SAMPLE.AB.children[2]]); - }).done(() => { - assert.equal(counter.count, 17); - done(); - }); - }); - - test('refreshAll(..., false) refreshes the elements', (done) => { - model.setInput(SAMPLE.AB).then(() => { - model.expand(SAMPLE.AB.children[0]); - model.expand(SAMPLE.AB.children[2]); - - counter.listen(model, 'refreshing'); // 3 - counter.listen(model, 'refreshed'); // 3 - counter.listen(model, 'item:refresh'); // 3 - counter.listen(model, 'item:childrenRefreshing'); // 2 - counter.listen(model, 'item:childrenRefreshed'); // 2 - - return model.refreshAll([SAMPLE.AB.children[0], SAMPLE.AB.children[1], SAMPLE.AB.children[2]], false); - }).done(() => { - assert.equal(counter.count, 13); - done(); - }); - }); - test('depths', (done) => { model.setInput(SAMPLE.AB).then(() => { model.expandAll(['a', 'c']); diff --git a/src/vs/base/test/browser/htmlContent.test.ts b/src/vs/base/test/browser/htmlContent.test.ts index eaa12a6ba26a41b90d51156ea506b3f52bf0f322..537777365e4e4b336a917e4553328fed48ce8ea9 100644 --- a/src/vs/base/test/browser/htmlContent.test.ts +++ b/src/vs/base/test/browser/htmlContent.test.ts @@ -6,123 +6,57 @@ import * as assert from 'assert'; import { marked } from 'vs/base/common/marked/marked'; -import { renderHtml } from 'vs/base/browser/htmlContentRenderer'; +import { renderMarkdown, renderText, renderFormattedText } from 'vs/base/browser/htmlContentRenderer'; suite('HtmlContent', () => { - test('render text', () => { - var result = renderHtml({ - text: 'testing', - isText: true - }); - assert.strictEqual(result.nodeType, document.TEXT_NODE); - }); - - test('cannot render script tag', function () { - var host = document.createElement('div'); - document.body.appendChild(host); - host.appendChild(renderHtml({ - tagName: 'script', - text: 'alert(\'owned -- injected script tag via htmlContent!\')' - })); - assert(true); - document.body.removeChild(host); - }); - - test('render simple element', () => { - var result: HTMLElement = renderHtml({ - text: 'testing' - }); + var result: HTMLElement = renderText('testing'); + assert.strictEqual(result.nodeType, document.ELEMENT_NODE); assert.strictEqual(result.textContent, 'testing'); assert.strictEqual(result.tagName, 'DIV'); }); test('render element with class', () => { - var result: HTMLElement = renderHtml({ - text: 'testing', + var result: HTMLElement = renderText('testing', { className: 'testClass' }); assert.strictEqual(result.nodeType, document.ELEMENT_NODE); assert.strictEqual(result.className, 'testClass'); }); - test('render element with style', () => { - var result: HTMLElement = renderHtml({ - text: 'testing', - style: 'width: 100px;' - }); - assert.strictEqual(result.getAttribute('style'), 'width: 100px;'); - }); - - test('render element with custom style', () => { - var result: HTMLElement = renderHtml({ - text: 'testing', - customStyle: { - 'width': '100px' - } - }); - assert.strictEqual(result.style.width, '100px'); - }); - - test('render element with children', () => { - var result: HTMLElement = renderHtml({ - className: 'parent', - children: [{ - text: 'child' - }] - }); - assert.strictEqual(result.children.length, 1); - assert.strictEqual(result.className, 'parent'); - assert.strictEqual(result.firstChild.textContent, 'child'); - }); - test('simple formatting', () => { - var result: HTMLElement = renderHtml({ - formattedText: '**bold**' - }); + var result: HTMLElement = renderFormattedText('**bold**'); assert.strictEqual(result.children.length, 1); assert.strictEqual(result.firstChild.textContent, 'bold'); assert.strictEqual((result.firstChild).tagName, 'B'); assert.strictEqual(result.innerHTML, 'bold'); - result = renderHtml({ - formattedText: '__italics__' - }); - + result = renderFormattedText('__italics__'); assert.strictEqual(result.innerHTML, 'italics'); - result = renderHtml({ - formattedText: 'this string has **bold** and __italics__' - }); - + result = renderFormattedText('this string has **bold** and __italics__'); assert.strictEqual(result.innerHTML, 'this string has bold and italics'); }); test('no formatting', () => { - var result: HTMLElement = renderHtml({ - formattedText: 'this is just a string' - }); + var result: HTMLElement = renderFormattedText('this is just a string'); assert.strictEqual(result.innerHTML, 'this is just a string'); }); test('preserve newlines', () => { - var result: HTMLElement = renderHtml({ - formattedText: 'line one\nline two' - }); + var result: HTMLElement = renderFormattedText('line one\nline two'); assert.strictEqual(result.innerHTML, 'line one
line two'); }); test('action', () => { var callbackCalled = false; - var result: HTMLElement = renderHtml({ - formattedText: '[[action]]' - }, { - actionCallback(content) { - assert.strictEqual(content, '0'); - callbackCalled = true; - } - }); + var result: HTMLElement = renderFormattedText('[[action]]', { + actionCallback(content) { + assert.strictEqual(content, '0'); + callbackCalled = true; + } + }); assert.strictEqual(result.innerHTML, 'action'); var event: MouseEvent = document.createEvent('MouseEvent'); @@ -133,14 +67,12 @@ suite('HtmlContent', () => { test('fancy action', () => { var callbackCalled = false; - var result: HTMLElement = renderHtml({ - formattedText: '__**[[action]]**__' - }, { - actionCallback(content) { - assert.strictEqual(content, '0'); - callbackCalled = true; - } - }); + var result: HTMLElement = renderFormattedText('__**[[action]]**__', { + actionCallback(content) { + assert.strictEqual(content, '0'); + callbackCalled = true; + } + }); assert.strictEqual(result.innerHTML, 'action'); var event: MouseEvent = document.createEvent('MouseEvent'); @@ -150,52 +82,40 @@ suite('HtmlContent', () => { }); test('escaped formatting', () => { - var result: HTMLElement = renderHtml({ - formattedText: '\\*\\*bold\\*\\*' - }); + var result: HTMLElement = renderFormattedText('\\*\\*bold\\*\\*'); assert.strictEqual(result.children.length, 0); assert.strictEqual(result.innerHTML, '**bold**'); }); test('image rendering conforms to default', () => { - const renderableContent = { - markdown: `![image](someimageurl 'caption')` - }; - const result: HTMLElement = renderHtml(renderableContent); + const markdown = `![image](someimageurl 'caption')`; + const result: HTMLElement = renderMarkdown(markdown); const renderer = new marked.Renderer(); - const imageFromMarked = marked(renderableContent.markdown, { + const imageFromMarked = marked(markdown, { sanitize: true, renderer }).trim(); assert.strictEqual(result.innerHTML, imageFromMarked); }); test('image rendering conforms to default without title', () => { - const renderableContent = { - markdown: `![image](someimageurl)` - }; - const result: HTMLElement = renderHtml(renderableContent); + const markdown = `![image](someimageurl)`; + const result: HTMLElement = renderMarkdown(markdown); const renderer = new marked.Renderer(); - const imageFromMarked = marked(renderableContent.markdown, { + const imageFromMarked = marked(markdown, { sanitize: true, renderer }).trim(); assert.strictEqual(result.innerHTML, imageFromMarked); }); test('image width from title params', () => { - var result: HTMLElement = renderHtml({ - markdown: `![image](someimageurl|width=100 'caption')` - }); + var result: HTMLElement = renderMarkdown(`![image](someimageurl|width=100 'caption')`); assert.strictEqual(result.innerHTML, `

image

`); }); test('image height from title params', () => { - var result: HTMLElement = renderHtml({ - markdown: `![image](someimageurl|height=100 'caption')` - }); + var result: HTMLElement = renderMarkdown(`![image](someimageurl|height=100 'caption')`); assert.strictEqual(result.innerHTML, `

image

`); }); test('image width and height from title params', () => { - var result: HTMLElement = renderHtml({ - markdown: `![image](someimageurl|height=200,width=100 'caption')` - }); + var result: HTMLElement = renderMarkdown(`![image](someimageurl|height=200,width=100 'caption')`); assert.strictEqual(result.innerHTML, `

image

`); }); }); \ No newline at end of file diff --git a/src/vs/base/browser/ui/list/test/rangeMap.test.ts b/src/vs/base/test/browser/ui/list/rangeMap.test.ts similarity index 99% rename from src/vs/base/browser/ui/list/test/rangeMap.test.ts rename to src/vs/base/test/browser/ui/list/rangeMap.test.ts index 0ad8b350bef515792e6156ce36be4f6fae68153a..e5121fd51066c90dfbd0190dee154f01c2480abb 100644 --- a/src/vs/base/browser/ui/list/test/rangeMap.test.ts +++ b/src/vs/base/test/browser/ui/list/rangeMap.test.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import assert = require('assert'); -import { RangeMap, intersect, groupIntersect, consolidate } from '../rangeMap'; +import { RangeMap, intersect, groupIntersect, consolidate } from 'vs/base/browser/ui/list/rangeMap'; suite('RangeMap', () => { var rangeMap: RangeMap; diff --git a/src/vs/base/test/browser/ui/scrollbar/scrollbarState.test.ts b/src/vs/base/test/browser/ui/scrollbar/scrollbarState.test.ts new file mode 100644 index 0000000000000000000000000000000000000000..9d10e81ba5f2af91f2f7a59658e2d1a7b70812dd --- /dev/null +++ b/src/vs/base/test/browser/ui/scrollbar/scrollbarState.test.ts @@ -0,0 +1,66 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +'use strict'; + +import * as assert from 'assert'; +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); + + assert.equal(actual.getArrowSize(), 0); + assert.equal(actual.getScrollPosition(), 32787); + assert.equal(actual.getRectangleLargeSize(), 339); + assert.equal(actual.getRectangleSmallSize(), 14); + assert.equal(actual.isNeeded(), true); + assert.equal(actual.getSliderSize(), 20); + assert.equal(actual.getSliderPosition(), 249); + assert.equal(actual.getSliderCenter(), 259); + + + assert.equal(actual.getDesiredScrollPositionFromOffset(259), 32849); + actual.setScrollPosition(32849); + assert.equal(actual.getArrowSize(), 0); + assert.equal(actual.getScrollPosition(), 32849); + assert.equal(actual.getRectangleLargeSize(), 339); + assert.equal(actual.getRectangleSmallSize(), 14); + assert.equal(actual.isNeeded(), true); + assert.equal(actual.getSliderSize(), 20); + assert.equal(actual.getSliderPosition(), 249); + assert.equal(actual.getSliderCenter(), 259); + }); + + test('inflates slider size with arrows', () => { + let actual = new ScrollbarState(12, 14, 0); + actual.setVisibleSize(339); + actual.setScrollSize(42423); + actual.setScrollPosition(32787); + + assert.equal(actual.getArrowSize(), 12); + assert.equal(actual.getScrollPosition(), 32787); + assert.equal(actual.getRectangleLargeSize(), 339); + assert.equal(actual.getRectangleSmallSize(), 14); + assert.equal(actual.isNeeded(), true); + assert.equal(actual.getSliderSize(), 20); + assert.equal(actual.getSliderPosition(), 230); + assert.equal(actual.getSliderCenter(), 240); + + + assert.equal(actual.getDesiredScrollPositionFromOffset(240 + 12), 32811); + actual.setScrollPosition(32811); + assert.equal(actual.getArrowSize(), 12); + assert.equal(actual.getScrollPosition(), 32811); + assert.equal(actual.getRectangleLargeSize(), 339); + assert.equal(actual.getRectangleSmallSize(), 14); + assert.equal(actual.isNeeded(), true); + assert.equal(actual.getSliderSize(), 20); + assert.equal(actual.getSliderPosition(), 230); + assert.equal(actual.getSliderCenter(), 240); + }); +}); diff --git a/src/vs/base/test/common/arrays.test.ts b/src/vs/base/test/common/arrays.test.ts index 5037261bc73b337f6a6267139bd6853decef5347..4d1e67c20fc5fda18182c6d70c3656f06591233e 100644 --- a/src/vs/base/test/common/arrays.test.ts +++ b/src/vs/base/test/common/arrays.test.ts @@ -37,7 +37,7 @@ suite('Arrays', () => { let counter = 0; let data = arrays.fill(10000, () => ({ n: 1, m: counter++ })); - arrays.stableSort(data, (a, b) => a.n - b.n); + arrays.mergeSort(data, (a, b) => a.n - b.n); let lastM = -1; for (const element of data) { @@ -46,6 +46,54 @@ suite('Arrays', () => { } }); + test('mergeSort', function () { + let data = arrays.mergeSort([6, 5, 3, 1, 8, 7, 2, 4], (a, b) => a - b); + assert.deepEqual(data, [1, 2, 3, 4, 5, 6, 7, 8]); + }); + + test('mergeSort, is stable', function () { + + let numbers = arrays.mergeSort([33, 22, 11, 4, 99, 1], (a, b) => 0); + assert.deepEqual(numbers, [33, 22, 11, 4, 99, 1]); + }); + + test('mergeSort, many random numbers', function () { + + function compare(a: number, b: number) { + if (a < b) { + return -1; + } else if (a > b) { + return 1; + } else { + return 0; + } + } + + function assertSorted(array: number[]) { + let last = array[0]; + for (let i = 1; i < array.length; i++) { + let n = array[i]; + if (last > n) { + assert.fail(array.slice(i - 10, i + 10)); + } + } + } + const MAX = 101; + const data: number[][] = []; + for (let i = 1; i < MAX; i++) { + let array: number[] = []; + for (let j = 0; j < 10 + i; j++) { + array.push(Math.random() * 10e8 | 0); + } + data.push(array); + } + + for (const array of data) { + arrays.mergeSort(array, compare); + assertSorted(array); + } + }); + test('delta', function () { function compare(a: number, b: number): number { return a - b; diff --git a/src/vs/base/test/common/filters.perf.test.ts b/src/vs/base/test/common/filters.perf.test.ts index 790e1d3fd678f23cff75f7cbea7e37aa09b216c7..079c048239c06f57447ae3b03a1864023d373afe 100644 --- a/src/vs/base/test/common/filters.perf.test.ts +++ b/src/vs/base/test/common/filters.perf.test.ts @@ -39,7 +39,6 @@ perfSuite('Performance - fuzzyMatch', function () { perfTest('matchesFuzzy', filters.matchesFuzzy); perfTest('fuzzyContiguousFilter', filters.fuzzyContiguousFilter); - perfTest('matchesFuzzy2', filters.matchesFuzzy2); perfTest('fuzzyScore', filters.fuzzyScore); perfTest('fuzzyScoreGraceful', filters.fuzzyScoreGraceful); diff --git a/src/vs/base/test/common/filters.test.ts b/src/vs/base/test/common/filters.test.ts index 4753059f57c390a0c038852d9726bf9cc9976996..663c7cccf3d8467636e64b24053ac6182744cffe 100644 --- a/src/vs/base/test/common/filters.test.ts +++ b/src/vs/base/test/common/filters.test.ts @@ -248,6 +248,7 @@ suite('Filters', () => { assertMatches('ccm', 'cacmelCase', '^ca^c^melCase', fuzzyScore); assertMatches('bti', 'the_black_knight', undefined, fuzzyScore); assertMatches('ccm', 'camelCase', undefined, fuzzyScore); + assertMatches('cmcm', 'camelCase', undefined, fuzzyScore); assertMatches('BK', 'the_black_knight', 'the_^black_^knight', fuzzyScore); assertMatches('KeyboardLayout=', 'KeyboardLayout', undefined, fuzzyScore); assertMatches('LLL', 'SVisualLoggerLogsList', 'SVisual^Logger^Logs^List', fuzzyScore); @@ -306,6 +307,9 @@ suite('Filters', () => { }); test('fuzzyScore, issue #26423', function () { + + assertMatches('baba', 'abababab', undefined, fuzzyScore); + assertMatches( 'fsfsfs', 'dsafdsafdsafdsafdsafdsafdsafasdfdsa', @@ -393,6 +397,12 @@ suite('Filters', () => { assertTopScore(fuzzyScore, 'title', 1, 'files.trimTrailingWhitespace', 'window.title'); }); + test('Unexpected suggestion scoring, #28791', function () { + assertTopScore(fuzzyScore, '_lines', 1, '_lineStarts', '_lines'); + assertTopScore(fuzzyScore, '_lines', 1, '_lineS', '_lines'); + assertTopScore(fuzzyScore, '_lineS', 0, '_lineS', '_lines'); + }); + test('nextTypoPermutation', function () { function assertTypos(pattern: string, ...variants: string[]) { diff --git a/src/vs/base/test/common/json.test.ts b/src/vs/base/test/common/json.test.ts index 42a0804c113aee1a8ceef1b26406f2b2764c8428..fe129f08808eb6f81078ef440481e9cf5475c25b 100644 --- a/src/vs/base/test/common/json.test.ts +++ b/src/vs/base/test/common/json.test.ts @@ -8,7 +8,7 @@ import * as assert from 'assert'; import { SyntaxKind, createScanner, parse, getLocation, Node, ParseError, parseTree, ParseErrorCode, ParseOptions, Segment, findNodeAtLocation, getNodeValue, ScanError } from 'vs/base/common/json'; -import { getParseErrorMessage } from "vs/base/common/jsonErrorMessages"; +import { getParseErrorMessage } from 'vs/base/common/jsonErrorMessages'; function assertKinds(text: string, ...kinds: SyntaxKind[]): void { var scanner = createScanner(text); diff --git a/src/vs/base/test/common/labels.test.ts b/src/vs/base/test/common/labels.test.ts index 4476a121f250a47a0b0d409d2abeb50a4020e013..650b4ee86a6f484154b6deef9436c511938e972b 100644 --- a/src/vs/base/test/common/labels.test.ts +++ b/src/vs/base/test/common/labels.test.ts @@ -57,11 +57,11 @@ suite('Labels', () => { assert.deepEqual(labels.shorten(['a\\b\\c', 'd\\b\\C']), ['…\\c', '…\\C']); // empty or null - assert.deepEqual(labels.shorten(['', null]), ['.', null]); + assert.deepEqual(labels.shorten(['', null]), ['.\\', null]); assert.deepEqual(labels.shorten(['a', 'a\\b', 'a\\b\\c', 'd\\b\\c', 'd\\b']), ['a', 'a\\b', 'a\\b\\c', 'd\\b\\c', 'd\\b']); assert.deepEqual(labels.shorten(['a', 'a\\b', 'b']), ['a', 'a\\b', 'b']); - assert.deepEqual(labels.shorten(['', 'a', 'b', 'b\\c', 'a\\c']), ['.', 'a', 'b', 'b\\c', 'a\\c']); + assert.deepEqual(labels.shorten(['', 'a', 'b', 'b\\c', 'a\\c']), ['.\\', 'a', 'b', 'b\\c', 'a\\c']); assert.deepEqual(labels.shorten(['src\\vs\\workbench\\parts\\execution\\electron-browser', 'src\\vs\\workbench\\parts\\execution\\electron-browser\\something', 'src\\vs\\workbench\\parts\\terminal\\electron-browser']), ['…\\execution\\electron-browser', '…\\something', '…\\terminal\\…']); }); @@ -105,11 +105,11 @@ suite('Labels', () => { assert.deepEqual(labels.shorten(['a/b/c', 'd/b/C']), ['…/c', '…/C']); // empty or null - assert.deepEqual(labels.shorten(['', null]), ['.', null]); + assert.deepEqual(labels.shorten(['', null]), ['./', null]); assert.deepEqual(labels.shorten(['a', 'a/b', 'a/b/c', 'd/b/c', 'd/b']), ['a', 'a/b', 'a/b/c', 'd/b/c', 'd/b']); assert.deepEqual(labels.shorten(['a', 'a/b', 'b']), ['a', 'a/b', 'b']); - assert.deepEqual(labels.shorten(['', 'a', 'b', 'b/c', 'a/c']), ['.', 'a', 'b', 'b/c', 'a/c']); + assert.deepEqual(labels.shorten(['', 'a', 'b', 'b/c', 'a/c']), ['./', 'a', 'b', 'b/c', 'a/c']); }); test('template', function () { diff --git a/src/vs/base/test/common/map.test.ts b/src/vs/base/test/common/map.test.ts index 43cbc7b44b9449404bee8f888a8a9f2742cccf2f..58c8413ba8406a4168992e4f643a16912981ea32 100644 --- a/src/vs/base/test/common/map.test.ts +++ b/src/vs/base/test/common/map.test.ts @@ -5,14 +5,14 @@ 'use strict'; -import { BoundedLinkedMap, LRUCache, LinkedMap, TrieMap, ResourceMap } from 'vs/base/common/map'; +import { BoundedMap, TrieMap, ResourceMap } from 'vs/base/common/map'; import * as assert from 'assert'; import URI from 'vs/base/common/uri'; suite('Map', () => { - test('LinkedMap - basics', function () { - const map = new LinkedMap(); + test('BoundedMap - basics', function () { + const map = new BoundedMap(); assert.equal(map.size, 0); @@ -72,10 +72,38 @@ suite('Map', () => { assert.equal(res, 'bar'); }); - test('BoundedLinkedMap - basics', function () { - const map = new BoundedLinkedMap(); + test('BoundedMap - serialization', function () { + const map = new BoundedMap(5); - assert.equal(map.size, 0); + map.set('1', 1); + map.set('2', '2'); + map.set('3', true); + + const obj = Object.create(null); + map.set('4', obj); + + const date = Date.now(); + map.set('5', date); + + const mapClone = new BoundedMap(5, 1, map.serialize()); + + assert.deepEqual(map.serialize(), mapClone.serialize()); + + assert.equal(mapClone.size, 5); + assert.equal(mapClone.get('1'), 1); + assert.equal(mapClone.get('2'), '2'); + assert.equal(mapClone.get('3'), true); + assert.equal(mapClone.get('4'), obj); + assert.equal(mapClone.get('5'), date); + assert.ok(!mapClone.get('6')); + + mapClone.set('6', '6'); + assert.equal(mapClone.size, 5); + assert.ok(!mapClone.get('1')); + }); + + test('BoundedMap - setLimit', function () { + const map = new BoundedMap(5); map.set('1', 1); map.set('2', '2'); @@ -95,46 +123,45 @@ suite('Map', () => { assert.equal(map.get('5'), date); assert.ok(!map.get('6')); - map.delete('6'); - assert.equal(map.size, 5); - assert.equal(map.delete('1'), 1); - assert.equal(map.delete('2'), '2'); - assert.equal(map.delete('3'), true); - assert.equal(map.delete('4'), obj); - assert.equal(map.delete('5'), date); + map.setLimit(3); + + assert.equal(map.size, 3); + assert.ok(!map.get('1')); + assert.ok(!map.get('2')); + assert.equal(map.get('3'), true); + assert.equal(map.get('4'), obj); + assert.equal(map.get('5'), date); + + map.setLimit(0); assert.equal(map.size, 0); - assert.ok(!map.get('5')); - assert.ok(!map.get('4')); assert.ok(!map.get('3')); - assert.ok(!map.get('2')); - assert.ok(!map.get('1')); + assert.ok(!map.get('4')); + assert.ok(!map.get('5')); + + map.set('6', 6); + + assert.equal(map.size, 0); + assert.ok(!map.get('6')); + + map.setLimit(100); map.set('1', 1); map.set('2', '2'); - assert.ok(map.set('3', true)); // adding an element returns true - assert.ok(!map.set('3', true)); // adding it again returns false + map.set('3', true); + map.set('4', obj); + map.set('5', date); - assert.ok(map.has('1')); + assert.equal(map.size, 5); assert.equal(map.get('1'), 1); assert.equal(map.get('2'), '2'); assert.equal(map.get('3'), true); - - map.clear(); - - assert.equal(map.size, 0); - assert.ok(!map.get('1')); - assert.ok(!map.get('2')); - assert.ok(!map.get('3')); - assert.ok(!map.has('1')); - - const res = map.getOrSet('foo', 'bar'); - assert.equal(map.get('foo'), res); - assert.equal(res, 'bar'); + assert.equal(map.get('4'), obj); + assert.equal(map.get('5'), date); }); - test('BoundedLinkedMap - bounded', function () { - const map = new BoundedLinkedMap(5); + test('BoundedMap - bounded', function () { + const map = new BoundedMap(5); assert.equal(0, map.size); @@ -202,8 +229,8 @@ suite('Map', () => { assert.equal(map.get('14'), 14); }); - test('BoundedLinkedMap - bounded with ratio', function () { - const map = new BoundedLinkedMap(6, 0.5); + test('BoundedMap - bounded with ratio', function () { + const map = new BoundedMap(6, 0.5); assert.equal(0, map.size); @@ -240,37 +267,47 @@ suite('Map', () => { assert.equal(map.get('10'), 10); }); - test('LRUCache', function () { - const cache = new LRUCache(3); + test('BoundedMap - MRU order', function () { + const map = new BoundedMap(3); + + function peek(key) { + const res = map.get(key); + if (res) { + map.delete(key); + map.set(key, res); + } + + return res; + } - assert.equal(0, cache.size); + assert.equal(0, map.size); - cache.set('1', 1); - cache.set('2', 2); - cache.set('3', 3); + map.set('1', 1); + map.set('2', 2); + map.set('3', 3); - assert.equal(3, cache.size); + assert.equal(3, map.size); - assert.equal(cache.get('1'), 1); - assert.equal(cache.get('2'), 2); - assert.equal(cache.get('3'), 3); + assert.equal(map.get('1'), 1); + assert.equal(map.get('2'), 2); + assert.equal(map.get('3'), 3); - cache.set('4', 4); + map.set('4', 4); - assert.equal(3, cache.size); - assert.equal(cache.get('4'), 4); // this changes MRU order - assert.equal(cache.get('3'), 3); - assert.equal(cache.get('2'), 2); + assert.equal(3, map.size); + assert.equal(peek('4'), 4); // this changes MRU order + assert.equal(peek('3'), 3); + assert.equal(peek('2'), 2); - cache.set('5', 5); - cache.set('6', 6); + map.set('5', 5); + map.set('6', 6); - assert.equal(3, cache.size); - assert.equal(cache.get('2'), 2); - assert.equal(cache.get('5'), 5); - assert.equal(cache.get('6'), 6); - assert.ok(!cache.has('3')); - assert.ok(!cache.has('4')); + assert.equal(3, map.size); + assert.equal(peek('2'), 2); + assert.equal(peek('5'), 5); + assert.equal(peek('6'), 6); + assert.ok(!map.has('3')); + assert.ok(!map.has('4')); }); diff --git a/src/vs/base/test/common/strings.test.ts b/src/vs/base/test/common/strings.test.ts index 07d750b0ecda7a042e5f563f1a1ccc376f43db85..813b94abafe068ea4129d478e944be49ab8d4237 100644 --- a/src/vs/base/test/common/strings.test.ts +++ b/src/vs/base/test/common/strings.test.ts @@ -93,6 +93,16 @@ suite('Strings', () => { assert.strictEqual(strings.format('Foo {0} Bar. {1}', '(foo)', '.test'), 'Foo (foo) Bar. .test'); }); + test('overlap', function () { + assert.equal(strings.overlap('foobar', 'arr, I am a priate'), 2); + assert.equal(strings.overlap('no', 'overlap'), 1); + assert.equal(strings.overlap('no', '0verlap'), 0); + assert.equal(strings.overlap('nothing', ''), 0); + assert.equal(strings.overlap('', 'nothing'), 0); + assert.equal(strings.overlap('full', 'full'), 4); + assert.equal(strings.overlap('full', 'fulloverlap'), 4); + }); + test('computeLineStarts', function () { function assertLineStart(text: string, ...offsets: number[]): void { const actual = strings.computeLineStarts(text); diff --git a/src/vs/base/test/node/config.test.ts b/src/vs/base/test/node/config.test.ts index 01bf5ebdc057d8f3122bbde361cae37b7bb17078..ad3d09dbd4058eab1ee0a3c463a958216612e973 100644 --- a/src/vs/base/test/node/config.test.ts +++ b/src/vs/base/test/node/config.test.ts @@ -98,6 +98,8 @@ suite('Config', () => { }); test('watching', function (done: () => void) { + this.timeout(10000); // watching is timing intense + testFile((error, testFile, cleanUp) => { if (error) { return onError(error, done); @@ -124,6 +126,8 @@ suite('Config', () => { }); test('watching also works when file created later', function (done: () => void) { + this.timeout(10000); // watching is timing intense + testFile((error, testFile, cleanUp) => { if (error) { return onError(error, done); @@ -148,6 +152,8 @@ suite('Config', () => { }); test('watching detects the config file getting deleted', function (done: () => void) { + this.timeout(10000); // watching is timing intense + testFile((error, testFile, cleanUp) => { if (error) { return onError(error, done); diff --git a/src/vs/base/test/node/extfs/extfs.test.ts b/src/vs/base/test/node/extfs/extfs.test.ts index 1eda91cea9d4fc4b5ca13032aab5343bdce11dba..ca184afd097f5469ee0a542e364b258c70f6f112 100644 --- a/src/vs/base/test/node/extfs/extfs.test.ts +++ b/src/vs/base/test/node/extfs/extfs.test.ts @@ -203,7 +203,7 @@ suite('Extfs', () => { }); }); - test('realpath', (done) => { + test('realcase', (done) => { const id = uuid.generateUuid(); const parentDir = path.join(os.tmpdir(), 'vsctests', id); const newDir = path.join(parentDir, 'extfs', id); @@ -213,7 +213,7 @@ suite('Extfs', () => { // assume case insensitive file system if (process.platform === 'win32' || process.platform === 'darwin') { const upper = newDir.toUpperCase(); - const real = extfs.realpathSync(upper); + const real = extfs.realcaseSync(upper); if (real) { // can be null in case of permission errors assert.notEqual(real, upper); @@ -224,11 +224,45 @@ suite('Extfs', () => { // linux, unix, etc. -> assume case sensitive file system else { - const real = extfs.realpathSync(newDir); + const real = extfs.realcaseSync(newDir); assert.equal(real, newDir); } extfs.del(parentDir, os.tmpdir(), () => { }, done); }); }); + + test('realpath', (done) => { + const id = uuid.generateUuid(); + const parentDir = path.join(os.tmpdir(), 'vsctests', id); + const newDir = path.join(parentDir, 'extfs', id); + + extfs.mkdirp(newDir, 493, (error) => { + + extfs.realpath(newDir, (error, realpath) => { + assert.ok(realpath); + assert.ok(!error); + + extfs.del(parentDir, os.tmpdir(), () => { }, done); + }); + }); + }); + + test('realpathSync', (done) => { + const id = uuid.generateUuid(); + const parentDir = path.join(os.tmpdir(), 'vsctests', id); + const newDir = path.join(parentDir, 'extfs', id); + + extfs.mkdirp(newDir, 493, (error) => { + let realpath: string; + try { + realpath = extfs.realpathSync(newDir); + } catch (error) { + assert.ok(!error); + } + assert.ok(realpath); + + extfs.del(parentDir, os.tmpdir(), () => { }, done); + }); + }); }); \ No newline at end of file diff --git a/src/vs/code/common/windows.ts b/src/vs/code/common/windows.ts deleted file mode 100644 index 96ca219e07fb38daae462c983ef7a198f81a4c49..0000000000000000000000000000000000000000 --- a/src/vs/code/common/windows.ts +++ /dev/null @@ -1,59 +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 Event from 'vs/base/common/event'; -import { IDisposable, dispose } from 'vs/base/common/lifecycle'; -import { IWindowsService } from 'vs/platform/windows/common/windows'; - -export enum OpenContext { - - // opening when running from the command line - CLI, - - // macOS only: opening from the dock (also when opening files to a running instance from desktop) - DOCK, - - // opening from the main application window - MENU, - - // opening from a file or folder dialog - DIALOG, - - // opening from the OS's UI - DESKTOP, - - // opening through the API - API -} - -export interface IWindowEventService { - _serviceBrand: any; - - onNewWindowOpen: Event; - onWindowFocus: Event; -} - -export class ActiveWindowManager implements IDisposable { - - private disposables: IDisposable[] = []; - private _activeWindowId: number; - - constructor( @IWindowsService windowsService: IWindowsService) { - windowsService.onWindowOpen(this.setActiveWindow, this, this.disposables); - windowsService.onWindowFocus(this.setActiveWindow, this, this.disposables); - } - - private setActiveWindow(windowId: number) { - this._activeWindowId = windowId; - } - - get activeClientId(): string { - return `window:${this._activeWindowId}`; - } - - dispose() { - this.disposables = dispose(this.disposables); - } -} \ No newline at end of file diff --git a/src/vs/code/electron-browser/sharedProcess.html b/src/vs/code/electron-browser/sharedProcess.html index 1c3da8dcb917af85170d1b9c4356cdc57e19af94..be70dede202b932f6b38833dce183b37708bcc10 100644 --- a/src/vs/code/electron-browser/sharedProcess.html +++ b/src/vs/code/electron-browser/sharedProcess.html @@ -4,6 +4,7 @@ + diff --git a/src/vs/code/electron-browser/sharedProcess.js b/src/vs/code/electron-browser/sharedProcess.js index 992872ba260ffc6746b15b04b710b1a0c849f6d4..9b216f8962210816295b444d45f9d2059039319a 100644 --- a/src/vs/code/electron-browser/sharedProcess.js +++ b/src/vs/code/electron-browser/sharedProcess.js @@ -3,16 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -// Warning: Do not use the `let` declarator in this file, it breaks our minification - 'use strict'; -/*global window,document,define*/ - const path = require('path'); -const electron = require('electron'); -const remote = electron.remote; -const ipc = electron.ipcRenderer; function assign(destination, source) { return Object.keys(source) diff --git a/src/vs/code/electron-browser/sharedProcessMain.ts b/src/vs/code/electron-browser/sharedProcessMain.ts index 0d2d3221490ef860ca3bca07d9f88110ce9f4452..5388d58ef3419e52f45e948f226a6ceea9111586 100644 --- a/src/vs/code/electron-browser/sharedProcessMain.ts +++ b/src/vs/code/electron-browser/sharedProcessMain.ts @@ -32,14 +32,36 @@ import { IChoiceService } from 'vs/platform/message/common/message'; import { ChoiceChannelClient } from 'vs/platform/message/common/messageIpc'; import { IWindowsService } from 'vs/platform/windows/common/windows'; import { WindowsChannelClient } from 'vs/platform/windows/common/windowsIpc'; -import { ActiveWindowManager } from 'vs/code/common/windows'; import { ipcRenderer } from 'electron'; +import { IDisposable, dispose } from 'vs/base/common/lifecycle'; interface ISharedProcessInitData { sharedIPCHandle: string; args: ParsedArgs; } +class ActiveWindowManager implements IDisposable { + private disposables: IDisposable[] = []; + private _activeWindowId: number; + + constructor( @IWindowsService windowsService: IWindowsService) { + windowsService.onWindowOpen(this.setActiveWindow, this, this.disposables); + windowsService.onWindowFocus(this.setActiveWindow, this, this.disposables); + } + + private setActiveWindow(windowId: number) { + this._activeWindowId = windowId; + } + + public get activeClientId(): string { + return `window:${this._activeWindowId}`; + } + + public dispose() { + this.disposables = dispose(this.disposables); + } +} + const eventPrefix = 'monacoworkbench'; function main(server: Server, initData: ISharedProcessInitData): void { diff --git a/src/vs/code/electron-main/app.ts b/src/vs/code/electron-main/app.ts index f15971a75de7981353726bb56b31788f5b980752..42207077c4643ddbd858c532b87568fb5280b3b7 100644 --- a/src/vs/code/electron-main/app.ts +++ b/src/vs/code/electron-main/app.ts @@ -7,14 +7,13 @@ import { app, ipcMain as ipc, BrowserWindow } from 'electron'; import * as platform from 'vs/base/common/platform'; -import { OpenContext } from 'vs/code/common/windows'; -import { IWindowsMainService, WindowsManager } from 'vs/code/electron-main/windows'; -import { IWindowsService } from 'vs/platform/windows/common/windows'; +import { WindowsManager } from 'vs/code/electron-main/windows'; +import { IWindowsService, OpenContext } from 'vs/platform/windows/common/windows'; import { WindowsChannel } from 'vs/platform/windows/common/windowsIpc'; import { WindowsService } from 'vs/platform/windows/electron-main/windowsService'; -import { ILifecycleService } from 'vs/code/electron-main/lifecycle'; -import { VSCodeMenu } from 'vs/code/electron-main/menus'; -import { getShellEnvironment } from 'vs/code/electron-main/shellEnv'; +import { ILifecycleService } from 'vs/platform/lifecycle/electron-main/lifecycleMain'; +import { CodeMenu } from 'vs/code/electron-main/menus'; +import { getShellEnvironment } from 'vs/code/node/shellEnv'; import { IUpdateService } from 'vs/platform/update/common/update'; import { UpdateChannel } from 'vs/platform/update/common/updateIpc'; import { UpdateService } from 'vs/platform/update/electron-main/updateService'; @@ -26,10 +25,8 @@ import { LaunchService, LaunchChannel, ILaunchService } from './launch'; import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; -import { ILogService } from 'vs/code/electron-main/log'; -import { IStorageService } from 'vs/code/electron-main/storage'; -import { IBackupMainService } from 'vs/platform/backup/common/backup'; -import { BackupChannel } from 'vs/platform/backup/common/backupIpc'; +import { ILogService } from 'vs/platform/log/common/log'; +import { IStorageService } from 'vs/platform/storage/node/storage'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IURLService } from 'vs/platform/url/common/url'; @@ -45,8 +42,16 @@ import pkg from 'vs/platform/node/package'; import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { ConfigurationService } from 'vs/platform/configuration/node/configurationService'; import { TPromise } from "vs/base/common/winjs.base"; - -export class VSCodeApplication { +import { IWindowsMainService } from "vs/platform/windows/electron-main/windows"; +import { IHistoryMainService } from "vs/platform/history/electron-main/historyMainService"; +import { isUndefinedOrNull } from "vs/base/common/types"; +import { CodeWindow } from "vs/code/electron-main/window"; +import { isParent } from "vs/platform/files/common/files"; +import { isEqual } from "vs/base/common/paths"; +import { KeyboardLayoutMonitor } from "vs/code/electron-main/keyboard"; +import URI from 'vs/base/common/uri'; + +export class CodeApplication { private toDispose: IDisposable[]; private windowsMainService: IWindowsMainService; @@ -63,7 +68,8 @@ export class VSCodeApplication { @IEnvironmentService private environmentService: IEnvironmentService, @ILifecycleService private lifecycleService: ILifecycleService, @IConfigurationService private configurationService: ConfigurationService, - @IStorageService private storageService: IStorageService + @IStorageService private storageService: IStorageService, + @IHistoryMainService private historyService: IHistoryMainService ) { this.toDispose = [mainIpcServer, configurationService]; @@ -100,6 +106,75 @@ export class VSCodeApplication { this.dispose(); }); + app.on('accessibility-support-changed', (event: Event, accessibilitySupportEnabled: boolean) => { + if (this.windowsMainService) { + this.windowsMainService.sendToAll('vscode:accessibilitySupportChanged', accessibilitySupportEnabled); + } + }); + + app.on('activate', (event: Event, hasVisibleWindows: boolean) => { + this.logService.log('App#activate'); + + // Mac only event: open new window when we get activated + if (!hasVisibleWindows && this.windowsMainService) { + this.windowsMainService.openNewWindow(OpenContext.DOCK); + } + }); + + const isValidWebviewSource = (source: string) => + !source || (URI.parse(source.toLowerCase()).toString() as any).startsWith(URI.file(this.environmentService.appRoot.toLowerCase()).toString()); + + app.on('web-contents-created', (event, contents) => { + contents.on('will-attach-webview', (event, webPreferences, params) => { + delete webPreferences.preload; + webPreferences.nodeIntegration = false; + + // Verify URLs being loaded + if (isValidWebviewSource(params.src) && isValidWebviewSource(webPreferences.preloadURL)) { + return; + } + // Otherwise prevent loading + + console.error('Prevented webview attach'); + event.preventDefault(); + }); + + contents.on('will-navigate', event => { + console.error('Prevented webcontent navigation'); + event.preventDefault(); + }); + }); + + let macOpenFiles: string[] = []; + let runningTimeout: number = null; + app.on('open-file', (event: Event, path: string) => { + this.logService.log('App#open-file: ', path); + event.preventDefault(); + + // Keep in array because more might come! + macOpenFiles.push(path); + + // Clear previous handler if any + if (runningTimeout !== null) { + clearTimeout(runningTimeout); + runningTimeout = null; + } + + // Handle paths delayed in case more are coming! + runningTimeout = setTimeout(() => { + if (this.windowsMainService) { + this.windowsMainService.open({ + context: OpenContext.DOCK /* can also be opening from finder while app is running */, + cli: this.environmentService.args, + pathsToOpen: macOpenFiles, + preferNewWindow: true /* dropping on the dock or opening from finder prefers to open in a new window */ + }); + macOpenFiles = []; + runningTimeout = null; + } + }, 100); + }); + ipc.on('vscode:exit', (event, code: number) => { this.logService.log('IPC#vscode:exit', code); @@ -125,6 +200,47 @@ export class VSCodeApplication { console.error('Error fetching shell env', err); }); }); + + ipc.on('vscode:broadcast', (event, windowId: number, target: string, broadcast: { channel: string; payload: any; }) => { + if (this.windowsMainService && broadcast.channel && !isUndefinedOrNull(broadcast.payload)) { + this.logService.log('IPC#vscode:broadcast', target, broadcast.channel, broadcast.payload); + + // Handle specific events on main side + this.onBroadcast(broadcast.channel, broadcast.payload); + + // Send to windows + if (target) { + const otherWindowsWithTarget = this.windowsMainService.getWindows().filter(w => w.id !== windowId && typeof w.openedWorkspacePath === 'string'); + const directTargetMatch = otherWindowsWithTarget.filter(w => isEqual(target, w.openedWorkspacePath, !platform.isLinux /* ignorecase */)); + const parentTargetMatch = otherWindowsWithTarget.filter(w => isParent(target, w.openedWorkspacePath, !platform.isLinux /* ignorecase */)); + + const targetWindow = directTargetMatch.length ? directTargetMatch[0] : parentTargetMatch[0]; // prefer direct match over parent match + if (targetWindow) { + targetWindow.send('vscode:broadcast', broadcast); + } + } else { + this.windowsMainService.sendToAll('vscode:broadcast', broadcast, [windowId]); + } + } + }); + + // Keyboard layout changes + KeyboardLayoutMonitor.INSTANCE.onDidChangeKeyboardLayout(isISOKeyboard => { + if (this.windowsMainService) { + this.windowsMainService.sendToAll('vscode:keyboardLayoutChanged', isISOKeyboard); + } + }); + } + + private onBroadcast(event: string, payload: any): void { + + // Theme changes + if (event === 'vscode:changeColorTheme' && typeof payload === 'string') { + let data = JSON.parse(payload); + + this.storageService.setItem(CodeWindow.themeStorageKey, data.id); + this.storageService.setItem(CodeWindow.themeBackgroundStorageKey, data.background); + } } public startup(): void { @@ -146,8 +262,7 @@ export class VSCodeApplication { // Spawn shared process this.sharedProcess = new SharedProcess(this.environmentService, this.userEnv); this.toDispose.push(this.sharedProcess); - this.sharedProcessClient = this.sharedProcess.whenReady() - .then(() => connect(this.environmentService.sharedIPCHandle, 'main')); + this.sharedProcessClient = this.sharedProcess.whenReady().then(() => connect(this.environmentService.sharedIPCHandle, 'main')); // Services const appInstantiationService = this.initServices(); @@ -213,10 +328,6 @@ export class VSCodeApplication { const urlChannel = appInstantiationService.createInstance(URLChannel, urlService); this.electronIpcServer.registerChannel('url', urlChannel); - const backupService = accessor.get(IBackupMainService); - const backupChannel = appInstantiationService.createInstance(BackupChannel, backupService); - this.electronIpcServer.registerChannel('backup', backupChannel); - const windowsService = accessor.get(IWindowsService); const windowsChannel = new WindowsChannel(windowsService); this.electronIpcServer.registerChannel('windows', windowsChannel); @@ -256,11 +367,11 @@ export class VSCodeApplication { } // Install Menu - appInstantiationService.createInstance(VSCodeMenu); + appInstantiationService.createInstance(CodeMenu); // Jump List - this.windowsMainService.updateWindowsJumpList(); - this.windowsMainService.onRecentPathsChange(() => this.windowsMainService.updateWindowsJumpList()); + this.historyService.updateWindowsJumpList(); + this.historyService.onRecentPathsChange(() => this.historyService.updateWindowsJumpList()); // Start shared process here this.sharedProcess.spawn(); diff --git a/src/vs/code/electron-main/keyboard.ts b/src/vs/code/electron-main/keyboard.ts new file mode 100644 index 0000000000000000000000000000000000000000..34b6a905e9c6b0bca8bc9c11cd0db4655fbae2b2 --- /dev/null +++ b/src/vs/code/electron-main/keyboard.ts @@ -0,0 +1,175 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +'use strict'; + +import * as nativeKeymap from 'native-keymap'; +import { IDisposable } from 'vs/base/common/lifecycle'; +import { isMacintosh } from 'vs/base/common/platform'; +import { IStorageService } from 'vs/platform/storage/node/storage'; +import Event, { Emitter, once } from 'vs/base/common/event'; +import { ConfigWatcher } from 'vs/base/node/config'; +import { IUserFriendlyKeybinding } from 'vs/platform/keybinding/common/keybinding'; +import { IEnvironmentService } from 'vs/platform/environment/common/environment'; +import { ipcMain as ipc } from 'electron'; +import { IWindowsMainService } from "vs/platform/windows/electron-main/windows"; + +export class KeyboardLayoutMonitor { + + public static readonly INSTANCE = new KeyboardLayoutMonitor(); + + private _emitter: Emitter; + private _registered: boolean; + private _isISOKeyboard: boolean; + + private constructor() { + this._emitter = new Emitter(); + this._registered = false; + this._isISOKeyboard = this._readIsISOKeyboard(); + } + + public onDidChangeKeyboardLayout(callback: (isISOKeyboard: boolean) => void): IDisposable { + if (!this._registered) { + this._registered = true; + + nativeKeymap.onDidChangeKeyboardLayout(() => { + this._emitter.fire(this._isISOKeyboard); + }); + + if (isMacintosh) { + // See https://github.com/Microsoft/vscode/issues/24153 + // On OSX, on ISO keyboards, Chromium swaps the scan codes + // of IntlBackslash and Backquote. + // + // The C++ methods can give the current keyboard type (ISO or not) + // only after a NSEvent was handled. + // + // We therefore poll. + setInterval(() => { + let newValue = this._readIsISOKeyboard(); + if (this._isISOKeyboard === newValue) { + // no change + return; + } + + this._isISOKeyboard = newValue; + this._emitter.fire(this._isISOKeyboard); + + }, 3000); + } + } + return this._emitter.event(callback); + } + + private _readIsISOKeyboard(): boolean { + if (isMacintosh) { + return nativeKeymap.isISOKeyboard(); + } + return false; + } + + public isISOKeyboard(): boolean { + return this._isISOKeyboard; + } +} + +export interface IKeybinding { + id: string; + label: string; + isNative: boolean; +} + +export class KeybindingsResolver { + + private static lastKnownKeybindingsMapStorageKey = 'lastKnownKeybindings'; + + private commandIds: Set; + private keybindings: { [commandId: string]: IKeybinding }; + private keybindingsWatcher: ConfigWatcher; + + private _onKeybindingsChanged = new Emitter(); + onKeybindingsChanged: Event = this._onKeybindingsChanged.event; + + constructor( + @IStorageService private storageService: IStorageService, + @IEnvironmentService environmentService: IEnvironmentService, + @IWindowsMainService private windowsService: IWindowsMainService + ) { + this.commandIds = new Set(); + this.keybindings = this.storageService.getItem<{ [id: string]: string; }>(KeybindingsResolver.lastKnownKeybindingsMapStorageKey) || Object.create(null); + this.keybindingsWatcher = new ConfigWatcher(environmentService.appKeybindingsPath, { changeBufferDelay: 100 }); + + this.registerListeners(); + } + + private registerListeners(): void { + + // Resolve keybindings when any first window is loaded + const onceOnWindowReady = once(this.windowsService.onWindowReady); + onceOnWindowReady(win => this.resolveKeybindings(win)); + + // Listen to resolved keybindings from window + ipc.on('vscode:keybindingsResolved', (event, rawKeybindings: string) => { + let keybindings: IKeybinding[] = []; + try { + keybindings = JSON.parse(rawKeybindings); + } catch (error) { + // Should not happen + } + + // Fill hash map of resolved keybindings and check for changes + let keybindingsChanged = false; + let keybindingsCount = 0; + const resolvedKeybindings: { [commandId: string]: IKeybinding } = Object.create(null); + keybindings.forEach(keybinding => { + keybindingsCount++; + + resolvedKeybindings[keybinding.id] = keybinding; + + if (!this.keybindings[keybinding.id] || keybinding.label !== this.keybindings[keybinding.id].label) { + keybindingsChanged = true; + } + }); + + // A keybinding might have been unassigned, so we have to account for that too + if (Object.keys(this.keybindings).length !== keybindingsCount) { + keybindingsChanged = true; + } + + if (keybindingsChanged) { + this.keybindings = resolvedKeybindings; + this.storageService.setItem(KeybindingsResolver.lastKnownKeybindingsMapStorageKey, this.keybindings); // keep to restore instantly after restart + + this._onKeybindingsChanged.fire(); + } + }); + + // Resolve keybindings again when keybindings.json changes + this.keybindingsWatcher.onDidUpdateConfiguration(() => this.resolveKeybindings()); + + // Resolve keybindings when window reloads because an installed extension could have an impact + this.windowsService.onWindowReload(() => this.resolveKeybindings()); + } + + private resolveKeybindings(win = this.windowsService.getLastActiveWindow()): void { + if (this.commandIds.size && win) { + const commandIds = []; + this.commandIds.forEach(id => commandIds.push(id)); + win.sendWhenReady('vscode:resolveKeybindings', JSON.stringify(commandIds)); + } + } + + public getKeybinding(commandId: string): IKeybinding { + if (!commandId) { + return void 0; + } + + if (!this.commandIds.has(commandId)) { + this.commandIds.add(commandId); + } + + return this.keybindings[commandId]; + } +} \ No newline at end of file diff --git a/src/vs/code/electron-main/launch.ts b/src/vs/code/electron-main/launch.ts index e69f31b936381751866c6f76a67d64ecd0ed5a03..14128133e0626737266cf359ef70903a7e9d31f6 100644 --- a/src/vs/code/electron-main/launch.ts +++ b/src/vs/code/electron-main/launch.ts @@ -5,17 +5,16 @@ 'use strict'; -import { OpenContext } from 'vs/code/common/windows'; -import { IWindowsMainService } from 'vs/code/electron-main/windows'; -import { VSCodeWindow } from 'vs/code/electron-main/window'; import { TPromise } from 'vs/base/common/winjs.base'; import { IChannel } from 'vs/base/parts/ipc/common/ipc'; -import { ILogService } from 'vs/code/electron-main/log'; +import { ILogService } from 'vs/platform/log/common/log'; import { IURLService } from 'vs/platform/url/common/url'; import { IProcessEnvironment } from 'vs/base/common/platform'; import { ParsedArgs } from 'vs/platform/environment/common/environment'; import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; import { once } from 'vs/base/common/event'; +import { OpenContext } from 'vs/platform/windows/common/windows'; +import { IWindowsMainService, ICodeWindow } from "vs/platform/windows/electron-main/windows"; export const ID = 'launchService'; export const ILaunchService = createDecorator(ID); @@ -41,7 +40,7 @@ export class LaunchChannel implements ILaunchChannel { constructor(private service: ILaunchService) { } - call(command: string, arg: any): TPromise { + public call(command: string, arg: any): TPromise { switch (command) { case 'start': const { args, userEnv } = arg as IStartArguments; @@ -50,6 +49,7 @@ export class LaunchChannel implements ILaunchChannel { case 'get-main-process-id': return this.service.getMainProcessId(); } + return undefined; } } @@ -60,11 +60,11 @@ export class LaunchChannelClient implements ILaunchService { constructor(private channel: ILaunchChannel) { } - start(args: ParsedArgs, userEnv: IProcessEnvironment): TPromise { + public start(args: ParsedArgs, userEnv: IProcessEnvironment): TPromise { return this.channel.call('start', { args, userEnv }); } - getMainProcessId(): TPromise { + public getMainProcessId(): TPromise { return this.channel.call('get-main-process-id', null); } } @@ -79,20 +79,21 @@ export class LaunchService implements ILaunchService { @IURLService private urlService: IURLService ) { } - start(args: ParsedArgs, userEnv: IProcessEnvironment): TPromise { + public start(args: ParsedArgs, userEnv: IProcessEnvironment): TPromise { this.logService.log('Received data from other instance: ', args, userEnv); + // Check early for open-url which is handled in URL service const openUrlArg = args['open-url'] || []; const openUrl = typeof openUrlArg === 'string' ? [openUrlArg] : openUrlArg; - const context = !!userEnv['VSCODE_CLI'] ? OpenContext.CLI : OpenContext.DESKTOP; - if (openUrl.length > 0) { openUrl.forEach(url => this.urlService.open(url)); + return TPromise.as(null); } // Otherwise handle in windows service - let usedWindows: VSCodeWindow[]; + const context = !!userEnv['VSCODE_CLI'] ? OpenContext.CLI : OpenContext.DESKTOP; + let usedWindows: ICodeWindow[]; if (!!args.extensionDevelopmentPath) { this.windowsService.openExtensionDevelopmentHostWindow({ context, cli: args, userEnv }); } else if (args._.length === 0 && (args['new-window'] || args['unity-launch'])) { @@ -113,7 +114,7 @@ export class LaunchService implements ILaunchService { // If the other instance is waiting to be killed, we hook up a window listener if one window // is being used and only then resolve the startup promise which will kill this second instance - if (args.wait && usedWindows && usedWindows.length === 1 && usedWindows[0]) { + if (args.wait && usedWindows.length === 1 && usedWindows[0]) { const windowId = usedWindows[0].id; return new TPromise((c, e) => { @@ -129,8 +130,9 @@ export class LaunchService implements ILaunchService { return TPromise.as(null); } - getMainProcessId(): TPromise { + public getMainProcessId(): TPromise { this.logService.log('Received request for process ID from other instance.'); + return TPromise.as(process.pid); } } \ No newline at end of file diff --git a/src/vs/code/electron-main/main.ts b/src/vs/code/electron-main/main.ts index 8294cc1f22bdb558f8f34e526533a642d09dc231..8af2717ffec1fd6f6943cb3a2a9fc1948af30ca6 100644 --- a/src/vs/code/electron-main/main.ts +++ b/src/vs/code/electron-main/main.ts @@ -10,8 +10,8 @@ import { assign } from 'vs/base/common/objects'; import * as platform from 'vs/base/common/platform'; import { parseMainProcessArgv } from 'vs/platform/environment/node/argv'; import { mkdirp } from 'vs/base/node/pfs'; -import { validatePaths } from 'vs/code/electron-main/paths'; -import { LifecycleService, ILifecycleService } from 'vs/code/electron-main/lifecycle'; +import { validatePaths } from 'vs/code/node/paths'; +import { LifecycleService, ILifecycleService } from 'vs/platform/lifecycle/electron-main/lifecycleMain'; import { Server, serve, connect } from 'vs/base/parts/ipc/node/ipc.net'; import { TPromise } from 'vs/base/common/winjs.base'; import { ILaunchChannel, LaunchChannelClient } from './launch'; @@ -19,8 +19,8 @@ import { ServicesAccessor, IInstantiationService } from 'vs/platform/instantiati import { InstantiationService } from 'vs/platform/instantiation/common/instantiationService'; import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; -import { ILogService, MainLogService } from 'vs/code/electron-main/log'; -import { IStorageService, StorageService } from 'vs/code/electron-main/storage'; +import { ILogService, LogMainService } from 'vs/platform/log/common/log'; +import { IStorageService, StorageService } from 'vs/platform/storage/node/storage'; import { IBackupMainService } from 'vs/platform/backup/common/backup'; import { BackupMainService } from 'vs/platform/backup/electron-main/backupMainService'; import { IEnvironmentService, ParsedArgs } from 'vs/platform/environment/common/environment'; @@ -32,13 +32,15 @@ import { RequestService } from 'vs/platform/request/electron-main/requestService import { IURLService } from 'vs/platform/url/common/url'; import { URLService } from 'vs/platform/url/electron-main/urlService'; import * as fs from 'original-fs'; -import { VSCodeApplication } from "vs/code/electron-main/app"; +import { CodeApplication } from "vs/code/electron-main/app"; +import { HistoryMainService, IHistoryMainService } from "vs/platform/history/electron-main/historyMainService"; function createServices(args: ParsedArgs): IInstantiationService { const services = new ServiceCollection(); services.set(IEnvironmentService, new SyncDescriptor(EnvironmentService, args, process.execPath)); - services.set(ILogService, new SyncDescriptor(MainLogService)); + services.set(ILogService, new SyncDescriptor(LogMainService)); + services.set(IHistoryMainService, new SyncDescriptor(HistoryMainService)); services.set(ILifecycleService, new SyncDescriptor(LifecycleService)); services.set(IStorageService, new SyncDescriptor(StorageService)); services.set(IConfigurationService, new SyncDescriptor(ConfigurationService)); @@ -193,22 +195,10 @@ function main() { return instantiationService.invokeFunction(a => createPaths(a.get(IEnvironmentService))) .then(() => instantiationService.invokeFunction(setupIPC)) .then(mainIpcServer => { - const app = instantiationService.createInstance(VSCodeApplication, mainIpcServer, instanceEnv); + const app = instantiationService.createInstance(CodeApplication, mainIpcServer, instanceEnv); app.startup(); }); }).done(null, err => instantiationService.invokeFunction(quit, err)); } -// Get going once we are ready -// TODO@Joh,Joao there more more potential here -// we should check for other instances etc while -// waiting for getting ready -if (app.isReady()) { - global.perfAppReady = Date.now(); - main(); -} else { - app.once('ready', () => { - global.perfAppReady = Date.now(); - main(); - }); -} +main(); \ No newline at end of file diff --git a/src/vs/code/electron-main/menus.ts b/src/vs/code/electron-main/menus.ts index 91ccab243c9fca4695fff25986033df41bca6797..d106e19a39f48a7309329e3ab6c0b0ebaba3740f 100644 --- a/src/vs/code/electron-main/menus.ts +++ b/src/vs/code/electron-main/menus.ts @@ -9,27 +9,19 @@ import * as nls from 'vs/nls'; import { isMacintosh, isLinux, isWindows, language } from 'vs/base/common/platform'; import * as arrays from 'vs/base/common/arrays'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { ipcMain as ipc, app, shell, dialog, Menu, MenuItem } from 'electron'; -import { OpenContext } from 'vs/code/common/windows'; -import { IWindowsMainService } from 'vs/code/electron-main/windows'; -import { VSCodeWindow } from 'vs/code/electron-main/window'; +import { ipcMain as ipc, app, shell, dialog, Menu, MenuItem, BrowserWindow } from 'electron'; +import { OpenContext } from 'vs/platform/windows/common/windows'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IStorageService } from 'vs/code/electron-main/storage'; import { IFilesConfiguration, AutoSaveConfiguration } from 'vs/platform/files/common/files'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IUpdateService, State as UpdateState } from 'vs/platform/update/common/update'; import product from 'vs/platform/node/product'; import { RunOnceScheduler } from 'vs/base/common/async'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import Event, { Emitter, once } from 'vs/base/common/event'; -import { ConfigWatcher } from 'vs/base/node/config'; -import { IUserFriendlyKeybinding } from 'vs/platform/keybinding/common/keybinding'; - -interface IKeybinding { - id: string; - label: string; - isNative: boolean; -} +import { tildify } from 'vs/base/common/labels'; +import { KeybindingsResolver } from "vs/code/electron-main/keyboard"; +import { IWindowsMainService } from "vs/platform/windows/electron-main/windows"; +import { IHistoryMainService } from "vs/platform/history/electron-main/historyMainService"; interface IExtensionViewlet { id: string; @@ -51,108 +43,19 @@ interface IConfiguration extends IFilesConfiguration { visible: boolean; } }; -} - -class KeybindingsResolver { - - private static lastKnownKeybindingsMapStorageKey = 'lastKnownKeybindings'; - - private commandIds: Set; - private keybindings: { [commandId: string]: IKeybinding }; - private keybindingsWatcher: ConfigWatcher; - - private _onKeybindingsChanged = new Emitter(); - onKeybindingsChanged: Event = this._onKeybindingsChanged.event; - - constructor( - @IStorageService private storageService: IStorageService, - @IEnvironmentService environmentService: IEnvironmentService, - @IWindowsMainService private windowsService: IWindowsMainService - ) { - this.commandIds = new Set(); - this.keybindings = this.storageService.getItem<{ [id: string]: string; }>(KeybindingsResolver.lastKnownKeybindingsMapStorageKey) || Object.create(null); - this.keybindingsWatcher = new ConfigWatcher(environmentService.appKeybindingsPath, { changeBufferDelay: 100 }); - - this.registerListeners(); - } - - private registerListeners(): void { - - // Resolve keybindings when any first window is loaded - const onceOnWindowReady = once(this.windowsService.onWindowReady); - onceOnWindowReady(win => this.resolveKeybindings(win)); - - // Listen to resolved keybindings from window - ipc.on('vscode:keybindingsResolved', (event, rawKeybindings: string) => { - let keybindings: IKeybinding[] = []; - try { - keybindings = JSON.parse(rawKeybindings); - } catch (error) { - // Should not happen - } - - // Fill hash map of resolved keybindings and check for changes - let keybindingsChanged = false; - let keybindingsCount = 0; - const resolvedKeybindings: { [commandId: string]: IKeybinding } = Object.create(null); - keybindings.forEach(keybinding => { - keybindingsCount++; - - resolvedKeybindings[keybinding.id] = keybinding; - - if (!this.keybindings[keybinding.id] || keybinding.label !== this.keybindings[keybinding.id].label) { - keybindingsChanged = true; - } - }); - - // A keybinding might have been unassigned, so we have to account for that too - if (Object.keys(this.keybindings).length !== keybindingsCount) { - keybindingsChanged = true; - } - - if (keybindingsChanged) { - this.keybindings = resolvedKeybindings; - this.storageService.setItem(KeybindingsResolver.lastKnownKeybindingsMapStorageKey, this.keybindings); // keep to restore instantly after restart - - this._onKeybindingsChanged.fire(); - } - }); - - // Resolve keybindings again when keybindings.json changes - this.keybindingsWatcher.onDidUpdateConfiguration(() => this.resolveKeybindings()); - - // Resolve keybindings when window reloads because an installed extension could have an impact - this.windowsService.onWindowReload(() => this.resolveKeybindings()); - } - - private resolveKeybindings(win: VSCodeWindow = this.windowsService.getLastActiveWindow()): void { - if (this.commandIds.size && win) { - const commandIds = []; - this.commandIds.forEach(id => commandIds.push(id)); - win.sendWhenReady('vscode:resolveKeybindings', JSON.stringify(commandIds)); - } - } - - public getKeybinding(commandId: string): IKeybinding { - if (!commandId) { - return void 0; - } - - if (!this.commandIds.has(commandId)) { - this.commandIds.add(commandId); - } - - return this.keybindings[commandId]; - } + editor: { + multiCursorModifier: 'ctrlCmd' | 'alt' + }; } const telemetryFrom = 'menu'; -export class VSCodeMenu { +export class CodeMenu { private static MAX_MENU_RECENT_ENTRIES = 10; private currentAutoSaveSetting: string; + private currentMultiCursorModifierSetting: string; private currentSidebarLocation: 'left' | 'right'; private currentStatusbarVisible: boolean; private currentActivityBarVisible: boolean; @@ -173,7 +76,8 @@ export class VSCodeMenu { @IConfigurationService private configurationService: IConfigurationService, @IWindowsMainService private windowsService: IWindowsMainService, @IEnvironmentService private environmentService: IEnvironmentService, - @ITelemetryService private telemetryService: ITelemetryService + @ITelemetryService private telemetryService: ITelemetryService, + @IHistoryMainService private historyService: IHistoryMainService ) { this.extensionViewlets = []; @@ -196,7 +100,7 @@ export class VSCodeMenu { // Listen to some events from window service this.windowsService.onPathsOpen(paths => this.updateMenu()); - this.windowsService.onRecentPathsChange(paths => this.updateMenu()); + this.historyService.onRecentPathsChange(paths => this.updateMenu()); this.windowsService.onWindowClose(_ => this.onClose(this.windowsService.getWindowCount())); // Listen to extension viewlets @@ -215,7 +119,7 @@ export class VSCodeMenu { }); // Update when auto save config changes - this.configurationService.onDidUpdateConfiguration(e => this.onConfigurationUpdated(e.config, true /* update menu if changed */)); + this.configurationService.onDidUpdateConfiguration(e => this.onConfigurationUpdated(this.configurationService.getConfiguration(), true /* update menu if changed */)); // Listen to update service this.updateService.onStateChange(() => this.updateMenu()); @@ -232,6 +136,12 @@ export class VSCodeMenu { updateMenu = true; } + const newMultiCursorModifierSetting = config && config.editor && config.editor.multiCursorModifier; + if (newMultiCursorModifierSetting !== this.currentMultiCursorModifierSetting) { + this.currentMultiCursorModifierSetting = newMultiCursorModifierSetting; + updateMenu = true; + } + const newSidebarLocation = config && config.workbench && config.workbench.sideBar && config.workbench.sideBar.location || 'left'; if (newSidebarLocation !== this.currentSidebarLocation) { this.currentSidebarLocation = newSidebarLocation; @@ -353,6 +263,11 @@ export class VSCodeMenu { const helpMenuItem = new MenuItem({ label: this.mnemonicLabel(nls.localize({ key: 'mHelp', comment: ['&& denotes a mnemonic'] }, "&&Help")), submenu: helpMenu, role: 'help' }); this.setHelpMenu(helpMenu); + // Tasks + const taskMenu = new Menu(); + const taskMenuItem = new MenuItem({ label: this.mnemonicLabel(nls.localize({ key: 'mTask', comment: ['&& denotes a mnemonic'] }, "&&Task")), submenu: taskMenu }); + this.setTaskMenu(taskMenu); + // Menu Structure if (macApplicationMenuItem) { menubar.append(macApplicationMenuItem); @@ -364,6 +279,7 @@ export class VSCodeMenu { menubar.append(viewMenuItem); menubar.append(gotoMenuItem); menubar.append(debugMenuItem); + menubar.append(taskMenuItem); if (macWindowMenuItem) { menubar.append(macWindowMenuItem); @@ -423,12 +339,12 @@ export class VSCodeMenu { newFile = this.createMenuItem(nls.localize({ key: 'miNewFile', comment: ['&& denotes a mnemonic'] }, "&&New File"), 'workbench.action.files.newUntitledFile'); } - const open = new MenuItem(this.likeAction('workbench.action.files.openFileFolder', { label: this.mnemonicLabel(nls.localize({ key: 'miOpen', comment: ['&& denotes a mnemonic'] }, "&&Open...")), click: (menuItem, win, event) => this.windowsService.openFileFolderPicker(this.isOptionClick(event), { from: telemetryFrom }) })); - const openFolder = new MenuItem(this.likeAction('workbench.action.files.openFolder', { label: this.mnemonicLabel(nls.localize({ key: 'miOpenFolder', comment: ['&& denotes a mnemonic'] }, "Open &&Folder...")), click: (menuItem, win, event) => this.windowsService.openFolderPicker(this.isOptionClick(event), undefined, { from: telemetryFrom }) })); + const open = new MenuItem(this.likeAction('workbench.action.files.openFileFolder', { label: this.mnemonicLabel(nls.localize({ key: 'miOpen', comment: ['&& denotes a mnemonic'] }, "&&Open...")), click: (menuItem, win, event) => this.windowsService.pickFileFolderAndOpen(this.isOptionClick(event), { from: telemetryFrom }) })); + const openFolder = new MenuItem(this.likeAction('workbench.action.files.openFolder', { label: this.mnemonicLabel(nls.localize({ key: 'miOpenFolder', comment: ['&& denotes a mnemonic'] }, "Open &&Folder...")), click: (menuItem, win, event) => this.windowsService.pickFolderAndOpen(this.isOptionClick(event), undefined, { from: telemetryFrom }) })); let openFile: Electron.MenuItem; if (hasNoWindows) { - openFile = new MenuItem(this.likeAction('workbench.action.files.openFile', { label: this.mnemonicLabel(nls.localize({ key: 'miOpenFile', comment: ['&& denotes a mnemonic'] }, "&&Open File...")), click: (menuItem, win, event) => this.windowsService.openFilePicker(this.isOptionClick(event), undefined, undefined, { from: telemetryFrom }) })); + openFile = new MenuItem(this.likeAction('workbench.action.files.openFile', { label: this.mnemonicLabel(nls.localize({ key: 'miOpenFile', comment: ['&& denotes a mnemonic'] }, "&&Open File...")), click: (menuItem, win, event) => this.windowsService.pickFileAndOpen(this.isOptionClick(event), undefined, undefined, { from: telemetryFrom }) })); } else { openFile = this.createMenuItem(nls.localize({ key: 'miOpenFile', comment: ['&& denotes a mnemonic'] }, "&&Open File..."), ['workbench.action.files.openFile', 'workbench.action.files.openFileInNewWindow']); } @@ -437,6 +353,9 @@ export class VSCodeMenu { this.setOpenRecentMenu(openRecentMenu); const openRecent = new MenuItem({ label: this.mnemonicLabel(nls.localize({ key: 'miOpenRecent', comment: ['&& denotes a mnemonic'] }, "Open &&Recent")), submenu: openRecentMenu, enabled: openRecentMenu.items.length > 0 }); + const isMultiRootEnabled = (product.quality !== 'stable'); // TODO@Ben multi root + const addFolder = this.createMenuItem(nls.localize({ key: 'miAddRootFolder', comment: ['&& denotes a mnemonic'] }, "&&Add Root Folder"), 'workbench.action.addRootFolder', this.windowsService.getWindowCount() > 0); + const saveFile = this.createMenuItem(nls.localize({ key: 'miSave', comment: ['&& denotes a mnemonic'] }, "&&Save"), 'workbench.action.files.save', this.windowsService.getWindowCount() > 0); const saveFileAs = this.createMenuItem(nls.localize({ key: 'miSaveAs', comment: ['&& denotes a mnemonic'] }, "Save &&As..."), 'workbench.action.files.saveAs', this.windowsService.getWindowCount() > 0); const saveAllFiles = this.createMenuItem(nls.localize({ key: 'miSaveAll', comment: ['&& denotes a mnemonic'] }, "Save A&&ll"), 'workbench.action.files.saveAll', this.windowsService.getWindowCount() > 0); @@ -463,6 +382,8 @@ export class VSCodeMenu { !isMacintosh ? openFile : null, !isMacintosh ? openFolder : null, openRecent, + isMultiRootEnabled ? __separator__() : null, + isMultiRootEnabled ? addFolder : null, __separator__(), saveFile, saveFileAs, @@ -475,7 +396,7 @@ export class VSCodeMenu { revertFile, closeEditor, closeFolder, - !isMacintosh ? closeWindow : null, + closeWindow, !isMacintosh ? __separator__() : null, !isMacintosh ? exit : null ]).forEach(item => fileMenu.append(item)); @@ -506,13 +427,13 @@ export class VSCodeMenu { private setOpenRecentMenu(openRecentMenu: Electron.Menu): void { openRecentMenu.append(this.createMenuItem(nls.localize({ key: 'miReopenClosedEditor', comment: ['&& denotes a mnemonic'] }, "&&Reopen Closed Editor"), 'workbench.action.reopenClosedEditor')); - const { folders, files } = this.windowsService.getRecentPathsList(); + const { folders, files } = this.historyService.getRecentPathsList(); // Folders if (folders.length > 0) { openRecentMenu.append(__separator__()); - for (let i = 0; i < VSCodeMenu.MAX_MENU_RECENT_ENTRIES && i < folders.length; i++) { + for (let i = 0; i < CodeMenu.MAX_MENU_RECENT_ENTRIES && i < folders.length; i++) { openRecentMenu.append(this.createOpenRecentMenuItem(folders[i], 'openRecentFolder')); } } @@ -521,29 +442,26 @@ export class VSCodeMenu { if (files.length > 0) { openRecentMenu.append(__separator__()); - for (let i = 0; i < VSCodeMenu.MAX_MENU_RECENT_ENTRIES && i < files.length; i++) { + for (let i = 0; i < CodeMenu.MAX_MENU_RECENT_ENTRIES && i < files.length; i++) { openRecentMenu.append(this.createOpenRecentMenuItem(files[i], 'openRecentFile')); } } if (folders.length || files.length) { + openRecentMenu.append(__separator__()); + openRecentMenu.append(this.createMenuItem(nls.localize({ key: 'miMore', comment: ['&& denotes a mnemonic'] }, "&&More..."), 'workbench.action.openRecent')); openRecentMenu.append(__separator__()); openRecentMenu.append(this.createMenuItem(nls.localize({ key: 'miClearRecentOpen', comment: ['&& denotes a mnemonic'] }, "&&Clear Recent Files"), 'workbench.action.clearRecentFiles')); } } private createOpenRecentMenuItem(path: string, commandId: string): Electron.MenuItem { - let label = path; - if ((isMacintosh || isLinux) && path.indexOf(this.environmentService.userHome) === 0) { - label = `~${path.substr(this.environmentService.userHome.length)}`; - } - return new MenuItem(this.likeAction(commandId, { - label: this.unmnemonicLabel(label), click: (menuItem, win, event) => { + label: this.unmnemonicLabel(tildify(path, this.environmentService.userHome)), click: (menuItem, win, event) => { const openInNewWindow = this.isOptionClick(event); - const success = !!this.windowsService.open({ context: OpenContext.MENU, cli: this.environmentService.args, pathsToOpen: [path], forceNewWindow: openInNewWindow }); + const success = this.windowsService.open({ context: OpenContext.MENU, cli: this.environmentService.args, pathsToOpen: [path], forceNewWindow: openInNewWindow }).length > 0; if (!success) { - this.windowsService.removeFromRecentPathsList(path); + this.historyService.removeFromRecentPathsList(path); } } }, false)); @@ -616,6 +534,19 @@ export class VSCodeMenu { } private setSelectionMenu(winLinuxEditMenu: Electron.Menu): void { + let multiCursorModifierLabel: string; + if (this.currentMultiCursorModifierSetting === 'ctrlCmd') { + // The default has been overwritten + multiCursorModifierLabel = nls.localize('miMultiCursorAlt', "Use Alt+Click for Multi-Cursor"); + } else { + multiCursorModifierLabel = ( + isMacintosh + ? nls.localize('miMultiCursorCmd', "Use Cmd+Click for Multi-Cursor") + : nls.localize('miMultiCursorCtrl', "Use Ctrl+Click for Multi-Cursor") + ); + } + + const multicursorModifier = this.createMenuItem(multiCursorModifierLabel, 'workbench.action.toggleMultiCursorModifier'); const insertCursorAbove = this.createMenuItem(nls.localize({ key: 'miInsertCursorAbove', comment: ['&& denotes a mnemonic'] }, "&&Add Cursor Above"), 'editor.action.insertCursorAbove'); const insertCursorBelow = this.createMenuItem(nls.localize({ key: 'miInsertCursorBelow', comment: ['&& denotes a mnemonic'] }, "A&&dd Cursor Below"), 'editor.action.insertCursorBelow'); const insertCursorAtEndOfEachLineSelected = this.createMenuItem(nls.localize({ key: 'miInsertCursorAtEndOfEachLineSelected', comment: ['&& denotes a mnemonic'] }, "Add C&&ursors to Line Ends"), 'editor.action.insertCursorAtEndOfEachLineSelected'); @@ -647,6 +578,7 @@ export class VSCodeMenu { moveLinesUp, moveLinesDown, __separator__(), + multicursorModifier, insertCursorAbove, insertCursorBelow, insertCursorAtEndOfEachLineSelected, @@ -844,6 +776,7 @@ export class VSCodeMenu { breakpointsMenu.append(this.createMenuItem(nls.localize({ key: 'miColumnBreakpoint', comment: ['&& denotes a mnemonic'] }, "C&&olumn Breakpoint"), 'editor.debug.action.toggleColumnBreakpoint')); breakpointsMenu.append(this.createMenuItem(nls.localize({ key: 'miFunctionBreakpoint', comment: ['&& denotes a mnemonic'] }, "&&Function Breakpoint..."), 'workbench.debug.viewlet.action.addFunctionBreakpointAction')); const newBreakpoints = new MenuItem({ label: this.mnemonicLabel(nls.localize({ key: 'miNewBreakpoint', comment: ['&& denotes a mnemonic'] }, "&&New Breakpoint")), submenu: breakpointsMenu }); + const enableAllBreakpoints = this.createMenuItem(nls.localize({ key: 'miEnableAllBreakpoints', comment: ['&& denotes a mnemonic'] }, "Enable All Breakpoints"), 'workbench.debug.viewlet.action.enableAllBreakpoints'); const disableAllBreakpoints = this.createMenuItem(nls.localize({ key: 'miDisableAllBreakpoints', comment: ['&& denotes a mnemonic'] }, "Disable A&&ll Breakpoints"), 'workbench.debug.viewlet.action.disableAllBreakpoints'); const removeAllBreakpoints = this.createMenuItem(nls.localize({ key: 'miRemoveAllBreakpoints', comment: ['&& denotes a mnemonic'] }, "Remove &&All Breakpoints"), 'workbench.debug.viewlet.action.removeAllBreakpoints'); @@ -864,6 +797,7 @@ export class VSCodeMenu { __separator__(), toggleBreakpoint, newBreakpoints, + enableAllBreakpoints, disableAllBreakpoints, removeAllBreakpoints, __separator__(), @@ -874,12 +808,14 @@ export class VSCodeMenu { private setMacWindowMenu(macWindowMenu: Electron.Menu): void { const minimize = new MenuItem({ label: nls.localize('mMinimize', "Minimize"), role: 'minimize', accelerator: 'Command+M', enabled: this.windowsService.getWindowCount() > 0 }); - const close = new MenuItem({ label: nls.localize('mClose', "Close"), role: 'close', accelerator: 'Command+W', enabled: this.windowsService.getWindowCount() > 0 }); + const zoom = new MenuItem({ label: nls.localize('mZoom', "Zoom"), role: 'zoom', enabled: this.windowsService.getWindowCount() > 0 }); const bringAllToFront = new MenuItem({ label: nls.localize('mBringToFront', "Bring All to Front"), role: 'front', enabled: this.windowsService.getWindowCount() > 0 }); + const switchWindow = this.createMenuItem(nls.localize({ key: 'miSwitchWindow', comment: ['&& denotes a mnemonic'] }, "Switch &&Window..."), 'workbench.action.switchWindow', this.windowsService.getWindowCount() > 0); [ minimize, - close, + zoom, + switchWindow, __separator__(), bringAllToFront ].forEach(item => macWindowMenu.append(item)); @@ -908,7 +844,7 @@ export class VSCodeMenu { label: this.mnemonicLabel(nls.localize({ key: 'miAccessibilityOptions', comment: ['&& denotes a mnemonic'] }, "Accessibility &&Options")), accelerator: null, click: () => { - this.windowsService.openAccessibilityOptions(); + this.openAccessibilityOptions(); } }, false)); @@ -932,6 +868,7 @@ export class VSCodeMenu { __separator__(), keyboardShortcutsUrl ? new MenuItem({ label: this.mnemonicLabel(nls.localize({ key: 'miKeyboardShortcuts', comment: ['&& denotes a mnemonic'] }, "&&Keyboard Shortcuts Reference")), click: () => this.windowsService.sendToFocused('vscode:runAction', 'workbench.action.keybindingsReference') }) : null, product.introductoryVideosUrl ? new MenuItem({ label: this.mnemonicLabel(nls.localize({ key: 'miIntroductoryVideos', comment: ['&& denotes a mnemonic'] }, "Introductory &&Videos")), click: () => this.windowsService.sendToFocused('vscode:runAction', 'workbench.action.openIntroductoryVideosUrl') }) : null, + product.tipsAndTricksUrl ? new MenuItem({ label: this.mnemonicLabel(nls.localize({ key: 'miTipsAndTricks', comment: ['&& denotes a mnemonic'] }, "&&Tips and Tricks")), click: () => this.windowsService.sendToFocused('vscode:runAction', 'workbench.action.openTipsAndTricksUrl') }) : null, (product.introductoryVideosUrl || keyboardShortcutsUrl) ? __separator__() : null, product.twitterUrl ? new MenuItem({ label: this.mnemonicLabel(nls.localize({ key: 'miTwitter', comment: ['&& denotes a mnemonic'] }, "&&Join us on Twitter")), click: () => this.openUrl(product.twitterUrl, 'openTwitterUrl') }) : null, product.requestFeatureUrl ? new MenuItem({ label: this.mnemonicLabel(nls.localize({ key: 'miUserVoice', comment: ['&& denotes a mnemonic'] }, "&&Search Feature Requests")), click: () => this.openUrl(product.requestFeatureUrl, 'openUserVoiceUrl') }) : null, @@ -974,6 +911,45 @@ export class VSCodeMenu { } } + private setTaskMenu(taskMenu: Electron.Menu): void { + const runTask = this.createMenuItem(nls.localize({ key: 'miRunTask', comment: ['&& denotes a mnemonic'] }, "&&Run Task..."), 'workbench.action.tasks.runTask'); + const restartTask = this.createMenuItem(nls.localize({ key: 'miRestartTask', comment: ['&& denotes a mnemonic'] }, "R&&estart Task..."), 'workbench.action.tasks.restartTask'); + const terminateTask = this.createMenuItem(nls.localize({ key: 'miTerminateTask', comment: ['&& denotes a mnemonic'] }, "&&Terminate Task..."), 'workbench.action.tasks.terminate'); + const buildTask = this.createMenuItem(nls.localize({ key: 'miBuildTask', comment: ['&& denotes a mnemonic'] }, "Run &&Build Task..."), 'workbench.action.tasks.build'); + const testTask = this.createMenuItem(nls.localize({ key: 'miTestTask', comment: ['&& denotes a mnemonic'] }, "Run Test T&&ask..."), 'workbench.action.tasks.test'); + const showTaskLog = this.createMenuItem(nls.localize({ key: 'miShowTaskLog', comment: ['&& denotes a mnemonic'] }, "&&Show Task Log"), 'workbench.action.tasks.showLog'); + const configureTask = this.createMenuItem(nls.localize({ key: 'miConfigureTask', comment: ['&& denotes a mnemonic'] }, "&&Configure Tasks"), 'workbench.action.tasks.configureTaskRunner'); + + [ + runTask, + __separator__(), + buildTask, + testTask, + __separator__(), + terminateTask, + restartTask, + __separator__(), + showTaskLog, + configureTask, + ].forEach(item => taskMenu.append(item)); + } + + private openAccessibilityOptions(): void { + let win = new BrowserWindow({ + alwaysOnTop: true, + skipTaskbar: true, + resizable: false, + width: 450, + height: 300, + show: true, + title: nls.localize('accessibilityOptionsWindowTitle', "Accessibility Options") + }); + + win.setMenuBarVisibility(false); + + win.loadURL('chrome://accessibility'); + } + private getUpdateMenuItems(): Electron.MenuItem[] { switch (this.updateService.state) { case UpdateState.Uninitialized: @@ -1007,7 +983,7 @@ export class VSCodeMenu { default: const result = [new MenuItem({ - label: nls.localize('miCheckForUpdates', "Check For Updates..."), click: () => setTimeout(() => { + label: nls.localize('miCheckForUpdates', "Check for Updates..."), click: () => setTimeout(() => { this.reportMenuActionTelemetry('CheckForUpdate'); this.updateService.checkForUpdates(true); }, 0) diff --git a/src/vs/code/electron-main/sharedProcess.ts b/src/vs/code/electron-main/sharedProcess.ts index c70ce1239f688786aa4da05417b655440187a780..2422ab62c9a4ed9a0c33a2b6cb38702d23857307 100644 --- a/src/vs/code/electron-main/sharedProcess.ts +++ b/src/vs/code/electron-main/sharedProcess.ts @@ -11,15 +11,25 @@ import { TPromise } from 'vs/base/common/winjs.base'; import { IProcessEnvironment } from 'vs/base/common/platform'; import { BrowserWindow, ipcMain } from 'electron'; import { PromiseSource } from 'vs/base/common/async'; +import { ISharedProcess } from "vs/platform/windows/electron-main/windows"; -export class SharedProcess { +export class SharedProcess implements ISharedProcess { + + private spawnPromiseSource: PromiseSource; private window: Electron.BrowserWindow; private disposables: IDisposable[] = []; @memoize private get _whenReady(): TPromise { - this.window = new BrowserWindow({ show: false }); + this.window = new BrowserWindow({ + show: false, + webPreferences: { + images: false, + webaudio: false, + webgl: false + } + }); const config = assign({ appRoot: this.environmentService.appRoot, nodeCachedDataDir: this.environmentService.nodeCachedDataDir, @@ -41,6 +51,7 @@ export class SharedProcess { this.disposables.push(toDisposable(() => this.window.removeListener('close', onClose))); this.disposables.push(toDisposable(() => { + // Electron seems to crash on Windows without this setTimeout :| setTimeout(() => { try { @@ -65,8 +76,6 @@ export class SharedProcess { }); } - private spawnPromiseSource: PromiseSource; - constructor( private environmentService: IEnvironmentService, private userEnv: IProcessEnvironment @@ -74,15 +83,15 @@ export class SharedProcess { this.spawnPromiseSource = new PromiseSource(); } - spawn(): void { + public spawn(): void { this.spawnPromiseSource.complete(); } - whenReady(): TPromise { + public whenReady(): TPromise { return this.spawnPromiseSource.value.then(() => this._whenReady); } - toggle(): void { + public toggle(): void { if (this.window.isVisible()) { this.hide(); } else { @@ -90,17 +99,17 @@ export class SharedProcess { } } - show(): void { + public show(): void { this.window.show(); this.window.webContents.openDevTools(); } - hide(): void { + public hide(): void { this.window.webContents.closeDevTools(); this.window.hide(); } - dispose(): void { + public dispose(): void { this.disposables = dispose(this.disposables); } } diff --git a/src/vs/code/electron-main/window.ts b/src/vs/code/electron-main/window.ts index 7cd1f6470833fd99591d04bd40c017858cca4cb2..7b2796150c0598f6848f92ea8339fe52d2bff663 100644 --- a/src/vs/code/electron-main/window.ts +++ b/src/vs/code/electron-main/window.ts @@ -6,23 +6,23 @@ 'use strict'; import * as path from 'path'; -import * as platform from 'vs/base/common/platform'; import * as objects from 'vs/base/common/objects'; import { stopProfiling } from 'vs/base/node/profiler'; import nls = require('vs/nls'); -import { IStorageService } from 'vs/code/electron-main/storage'; +import { IStorageService } from 'vs/platform/storage/node/storage'; import { shell, screen, BrowserWindow, systemPreferences, app } from 'electron'; import { TPromise, TValueCallback } from 'vs/base/common/winjs.base'; import { IEnvironmentService, ParsedArgs } from 'vs/platform/environment/common/environment'; -import { ILogService } from 'vs/code/electron-main/log'; +import { ILogService } from 'vs/platform/log/common/log'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IWorkbenchEditorConfiguration } from 'vs/workbench/common/editor'; import { parseArgs } from 'vs/platform/environment/node/argv'; import product from 'vs/platform/node/product'; import { getCommonHTTPHeaders } from 'vs/platform/environment/node/http'; -import { IWindowSettings, MenuBarVisibility } from 'vs/platform/windows/common/windows'; +import { IWindowSettings, MenuBarVisibility, IWindowConfiguration, ReadyState } from 'vs/platform/windows/common/windows'; import { IDisposable, dispose } from 'vs/base/common/lifecycle'; - +import { KeyboardLayoutMonitor } from 'vs/code/electron-main/keyboard'; +import { isLinux, isMacintosh, isWindows } from 'vs/base/common/platform'; +import { ICodeWindow } from "vs/platform/windows/electron-main/windows"; export interface IWindowState { width?: number; @@ -54,90 +54,15 @@ export const defaultWindowState = function (mode = WindowMode.Normal): IWindowSt }; }; -export interface IPath { - - // the workspace spath for a VSCode instance which can be null - workspacePath?: string; - - // the file path to open within a VSCode instance - filePath?: string; - - // the line number in the file path to open - lineNumber?: number; - - // the column number in the file path to open - columnNumber?: number; - - // indicator to create the file path in the VSCode instance - createFilePath?: boolean; -} - -export interface IWindowConfiguration extends ParsedArgs { - appRoot: string; - execPath: string; - - userEnv: platform.IProcessEnvironment; - - /** - * The physical keyboard is of ISO type (on OSX). - */ - isISOKeyboard?: boolean; - /** - * Accessibility support is enabled. - */ - accessibilitySupportEnabled?: boolean; - zoomLevel?: number; - fullscreen?: boolean; - highContrast?: boolean; - baseTheme?: string; - backgroundColor?: string; - accessibilitySupport?: boolean; - - isInitialStartup?: boolean; - - perfStartTime?: number; - perfAppReady?: number; - perfWindowLoadTime?: number; - - workspacePath?: string; - - filesToOpen?: IPath[]; - filesToCreate?: IPath[]; - filesToDiff?: IPath[]; - - nodeCachedDataDir: string; -} - -export enum ReadyState { - - /** - * This window has not loaded any HTML yet - */ - NONE, - - /** - * This window is loading HTML - */ - LOADING, - - /** - * This window is navigating to another HTML - */ - NAVIGATING, - - /** - * This window is done loading HTML - */ - READY -} - -interface IConfiguration { - window: { - menuBarVisibility: MenuBarVisibility; +interface IWorkbenchEditorConfiguration { + workbench: { + editor: { + swipeToNavigate: boolean + } }; } -export class VSCodeWindow { +export class CodeWindow implements ICodeWindow { public static themeStorageKey = 'theme'; public static themeBackgroundStorageKey = 'themeBackground'; @@ -156,10 +81,10 @@ export class VSCodeWindow { private _isExtensionTestHost: boolean; private windowState: IWindowState; private currentMenuBarVisibility: MenuBarVisibility; - private currentWindowMode: WindowMode; private toDispose: IDisposable[]; + private representedFilename: string; - private whenReadyCallbacks: TValueCallback[]; + private whenReadyCallbacks: TValueCallback[]; private currentConfig: IWindowConfiguration; private pendingLoadConfig: IWindowConfiguration; @@ -179,11 +104,27 @@ export class VSCodeWindow { this.whenReadyCallbacks = []; this.toDispose = []; + // create browser window + this.createBrowserWindow(config); + + // respect configured menu bar visibility + this.onConfigurationUpdated(); + + // TODO@joao: hook this up to some initialization routine this causes a race between setting the headers and doing + // a request that needs them. chances are low + this.setCommonHTTPHeaders(); + + // Eventing + this.registerListeners(); + } + + private createBrowserWindow(config: IWindowCreationOptions): void { + // Load window state - this.restoreWindowState(config.state); + this.windowState = this.restoreWindowState(config.state); // in case we are maximized or fullscreen, only show later after the call to maximize/fullscreen (see below) - const isFullscreenOrMaximized = (this.currentWindowMode === WindowMode.Maximized || this.currentWindowMode === WindowMode.Fullscreen); + const isFullscreenOrMaximized = (this.windowState.mode === WindowMode.Maximized || this.windowState.mode === WindowMode.Fullscreen); const options: Electron.BrowserWindowOptions = { width: this.windowState.width, @@ -191,8 +132,8 @@ export class VSCodeWindow { x: this.windowState.x, y: this.windowState.y, backgroundColor: this.getBackgroundColor(), - minWidth: VSCodeWindow.MIN_WIDTH, - minHeight: VSCodeWindow.MIN_HEIGHT, + minWidth: CodeWindow.MIN_WIDTH, + minHeight: CodeWindow.MIN_HEIGHT, show: !isFullscreenOrMaximized, title: product.nameLong, webPreferences: { @@ -201,7 +142,7 @@ export class VSCodeWindow { } }; - if (platform.isLinux) { + if (isLinux) { options.icon = path.join(this.environmentService.appRoot, 'resources/linux/code.png'); // Windows and Mac are better off using the embedded icon(s) } @@ -214,7 +155,7 @@ export class VSCodeWindow { } let useCustomTitleStyle = false; - if (platform.isMacintosh && (!windowConfig || !windowConfig.titleBarStyle || windowConfig.titleBarStyle === 'custom')) { + if (isMacintosh && (!windowConfig || !windowConfig.titleBarStyle || windowConfig.titleBarStyle === 'custom')) { const isDev = !this.environmentService.isBuilt || !!config.extensionDevelopmentPath; if (!isDev) { useCustomTitleStyle = true; // not enabled when developing due to https://github.com/electron/electron/issues/3647 @@ -239,7 +180,7 @@ export class VSCodeWindow { } // Set relaunch command - if (platform.isWindows && product.win32AppUserModelId && typeof this._win.setAppDetails === 'function') { + if (isWindows && product.win32AppUserModelId && typeof this._win.setAppDetails === 'function') { this._win.setAppDetails({ appId: product.win32AppUserModelId, relaunchCommand: `"${process.execPath}" -n`, @@ -250,7 +191,7 @@ export class VSCodeWindow { if (isFullscreenOrMaximized) { this._win.maximize(); - if (this.currentWindowMode === WindowMode.Fullscreen) { + if (this.windowState.mode === WindowMode.Fullscreen) { this._win.setFullScreen(true); } @@ -260,16 +201,6 @@ export class VSCodeWindow { } this._lastFocusTime = Date.now(); // since we show directly, we need to set the last focus time too - - // respect configured menu bar visibility - this.onConfigurationUpdated(); - - // TODO@joao: hook this up to some initialization routine this causes a race between setting the headers and doing - // a request that needs them. chances are low - this.setCommonHTTPHeaders(); - - // Eventing - this.registerListeners(); } private setCommonHTTPHeaders(): void { @@ -314,6 +245,22 @@ export class VSCodeWindow { return this._win; } + public setRepresentedFilename(filename: string): void { + if (isMacintosh) { + this.win.setRepresentedFilename(filename); + } else { + this.representedFilename = filename; + } + } + + public getRepresentedFilename(): string { + if (isMacintosh) { + return this.win.getRepresentedFilename(); + } + + return this.representedFilename; + } + public focus(): void { if (!this._win) { return; @@ -331,11 +278,15 @@ export class VSCodeWindow { } public get openedWorkspacePath(): string { - return this.currentConfig.workspacePath; + return this.currentConfig ? this.currentConfig.workspacePath : void 0; + } + + public get backupPath(): string { + return this.currentConfig ? this.currentConfig.backupPath : void 0; } public get openedFilePath(): string { - return this.currentConfig.filesToOpen && this.currentConfig.filesToOpen[0] && this.currentConfig.filesToOpen[0].filePath; + return this.currentConfig && this.currentConfig.filesToOpen && this.currentConfig.filesToOpen[0] && this.currentConfig.filesToOpen[0].filePath; } public setReady(): void { @@ -347,8 +298,8 @@ export class VSCodeWindow { } } - public ready(): TPromise { - return new TPromise((c) => { + public ready(): TPromise { + return new TPromise((c) => { if (this._readyState === ReadyState.READY) { return c(this); } @@ -362,20 +313,6 @@ export class VSCodeWindow { return this._readyState; } - private registerNavigationListenerOn(command: 'swipe' | 'app-command', back: 'left' | 'browser-backward', forward: 'right' | 'browser-forward', acrossEditors: boolean) { - this._win.on(command, (e, cmd) => { - if (this.readyState !== ReadyState.READY) { - return; // window must be ready - } - - if (cmd === back) { - this.send('vscode:runAction', acrossEditors ? 'workbench.action.openPreviousRecentlyUsedEditor' : 'workbench.action.navigateBack'); - } else if (cmd === forward) { - this.send('vscode:runAction', acrossEditors ? 'workbench.action.openNextRecentlyUsedEditor' : 'workbench.action.navigateForward'); - } - }); - } - private registerListeners(): void { // Remember that we loaded @@ -389,9 +326,9 @@ export class VSCodeWindow { this.pendingLoadConfig = null; } - // To prevent flashing, we set the window visible after the page has finished to load but before VSCode is loaded + // To prevent flashing, we set the window visible after the page has finished to load but before Code is loaded if (!this._win.isVisible()) { - if (this.currentWindowMode === WindowMode.Maximized) { + if (this.windowState.mode === WindowMode.Maximized) { this._win.maximize(); } @@ -425,17 +362,6 @@ export class VSCodeWindow { this.sendWhenReady('vscode:leaveFullScreen'); }); - // React to HC color scheme changes (Windows) - if (platform.isWindows) { - systemPreferences.on('inverted-color-scheme-changed', () => { - if (systemPreferences.isInvertedColorScheme()) { - this.sendWhenReady('vscode:enterHighContrast'); - } else { - this.sendWhenReady('vscode:leaveHighContrast'); - } - }); - } - // Window Failed to load this._win.webContents.on('did-fail-load', (event: Event, errorCode: string, errorDescription: string) => { console.warn('[electron event]: fail to load, ', errorDescription); @@ -463,7 +389,7 @@ export class VSCodeWindow { } // Swipe command support (macOS) - if (platform.isMacintosh) { + if (isMacintosh) { const config = this.configurationService.getConfiguration(); if (config && config.workbench && config.workbench.editor && config.workbench.editor.swipeToNavigate) { this.registerNavigationListenerOn('swipe', 'left', 'right', true); @@ -473,6 +399,20 @@ export class VSCodeWindow { } }; + private registerNavigationListenerOn(command: 'swipe' | 'app-command', back: 'left' | 'browser-backward', forward: 'right' | 'browser-forward', acrossEditors: boolean) { + this._win.on(command, (e, cmd) => { + if (this.readyState !== ReadyState.READY) { + return; // window must be ready + } + + if (cmd === back) { + this.send('vscode:runAction', acrossEditors ? 'workbench.action.openPreviousRecentlyUsedEditor' : 'workbench.action.navigateBack'); + } else if (cmd === forward) { + this.send('vscode:runAction', acrossEditors ? 'workbench.action.openNextRecentlyUsedEditor' : 'workbench.action.navigateForward'); + } + }); + } + public load(config: IWindowConfiguration): void { // If this is the first time the window is loaded, we associate the paths @@ -491,7 +431,7 @@ export class VSCodeWindow { } // Make sure to clear any previous edited state - if (platform.isMacintosh && this._win.isDocumentEdited()) { + if (isMacintosh && this._win.isDocumentEdited()) { this._win.setDocumentEdited(false); } @@ -513,8 +453,7 @@ export class VSCodeWindow { // (--prof-startup) save profile to disk const { profileStartup } = this.environmentService; if (profileStartup) { - stopProfiling(profileStartup.dir, profileStartup.prefix) - .done(undefined, err => console.error(err)); + stopProfiling(profileStartup.dir, profileStartup.prefix).done(undefined, err => console.error(err)); } } @@ -542,7 +481,6 @@ export class VSCodeWindow { } private getUrl(windowConfiguration: IWindowConfiguration): string { - let url = require.toUrl('vs/workbench/electron-browser/bootstrap/index.html'); // Set zoomlevel const windowConfig = this.configurationService.getConfiguration('window'); @@ -555,9 +493,12 @@ export class VSCodeWindow { windowConfiguration.fullscreen = this._win.isFullScreen(); // Set Accessibility Config - windowConfiguration.highContrast = platform.isWindows && systemPreferences.isInvertedColorScheme() && (!windowConfig || windowConfig.autoDetectHighContrast); + windowConfiguration.highContrast = isWindows && systemPreferences.isInvertedColorScheme() && (!windowConfig || windowConfig.autoDetectHighContrast); windowConfiguration.accessibilitySupport = app.isAccessibilitySupportEnabled(); + // Set Keyboard Config + windowConfiguration.isISOKeyboard = KeyboardLayoutMonitor.INSTANCE.isISOKeyboard(); + // Theme windowConfiguration.baseTheme = this.getBaseTheme(); windowConfiguration.backgroundColor = this.getBackgroundColor(); @@ -576,28 +517,29 @@ export class VSCodeWindow { } } - url += '?config=' + encodeURIComponent(JSON.stringify(config)); - - return url; + return `${require.toUrl('vs/workbench/electron-browser/bootstrap/index.html')}?config=${encodeURIComponent(JSON.stringify(config))}`; } private getBaseTheme(): string { - if (platform.isWindows && systemPreferences.isInvertedColorScheme()) { + if (isWindows && systemPreferences.isInvertedColorScheme()) { return 'hc-black'; } - const theme = this.storageService.getItem(VSCodeWindow.themeStorageKey, 'vs-dark'); + + const theme = this.storageService.getItem(CodeWindow.themeStorageKey, 'vs-dark'); + return theme.split(' ')[0]; } private getBackgroundColor(): string { - if (platform.isWindows && systemPreferences.isInvertedColorScheme()) { + if (isWindows && systemPreferences.isInvertedColorScheme()) { return '#000000'; } - let background = this.storageService.getItem(VSCodeWindow.themeBackgroundStorageKey, null); + const background = this.storageService.getItem(CodeWindow.themeBackgroundStorageKey, null); if (!background) { - let baseTheme = this.getBaseTheme(); - return baseTheme === 'hc-black' ? '#000000' : (baseTheme === 'vs' ? '#FFFFFF' : (platform.isMacintosh ? '#171717' : '#1E1E1E')); // https://github.com/electron/electron/issues/5150 + const baseTheme = this.getBaseTheme(); + + return baseTheme === 'hc-black' ? '#000000' : (baseTheme === 'vs' ? '#FFFFFF' : (isMacintosh ? '#171717' : '#1E1E1E')); // https://github.com/electron/electron/issues/5150 } return background; @@ -625,7 +567,7 @@ export class VSCodeWindow { let mode: WindowMode; // get window mode - if (!platform.isMacintosh && this._win.isMaximized()) { + if (!isMacintosh && this._win.isMaximized()) { mode = WindowMode.Maximized; } else { mode = WindowMode.Normal; @@ -651,7 +593,7 @@ export class VSCodeWindow { return state; } - private restoreWindowState(state?: IWindowState): void { + private restoreWindowState(state?: IWindowState): IWindowState { if (state) { try { state = this.validateWindowState(state); @@ -664,8 +606,7 @@ export class VSCodeWindow { state = defaultWindowState(); } - this.windowState = state; - this.currentWindowMode = this.windowState.mode; + return state; } private validateWindowState(state: IWindowState): IWindowState { @@ -783,7 +724,7 @@ export class VSCodeWindow { } public setMenuBarVisibility(visibility: MenuBarVisibility, notify: boolean = true): void { - if (platform.isMacintosh) { + if (isMacintosh) { return; // ignore for macOS platform } @@ -823,6 +764,39 @@ export class VSCodeWindow { }; } + public onWindowTitleDoubleClick(): void { + + // Respect system settings on mac with regards to title click on windows title + if (isMacintosh) { + const action = systemPreferences.getUserDefault('AppleActionOnDoubleClick', 'string'); + switch (action) { + case 'Minimize': + this.win.minimize(); + break; + case 'None': + break; + case 'Maximize': + default: + this.win.maximize(); + } + } + + // Linux/Windows: just toggle maximize/minimized state + else { + if (this.win.isMaximized()) { + this.win.unmaximize(); + } else { + this.win.maximize(); + } + } + } + + public close(): void { + if (this._win) { + this._win.close(); + } + } + public sendWhenReady(channel: string, ...args: any[]): void { this.ready().then(() => { this.send(channel, ...args); diff --git a/src/vs/code/electron-main/windows.ts b/src/vs/code/electron-main/windows.ts index 72d1091e19642f84e8a15f5eb9d0b0ddeffe380c..3394b987b2fb1616c91bc60f38ac59ed890bb4c6 100644 --- a/src/vs/code/electron-main/windows.ts +++ b/src/vs/code/electron-main/windows.ts @@ -7,148 +7,99 @@ import * as path from 'path'; import * as fs from 'original-fs'; -import * as platform from 'vs/base/common/platform'; import * as nls from 'vs/nls'; -import * as types from 'vs/base/common/types'; import * as arrays from 'vs/base/common/arrays'; import { assign, mixin } from 'vs/base/common/objects'; import { IBackupMainService } from 'vs/platform/backup/common/backup'; -import { trim } from 'vs/base/common/strings'; import { IEnvironmentService, ParsedArgs } from 'vs/platform/environment/common/environment'; -import { IStorageService } from 'vs/code/electron-main/storage'; -import { IPath, VSCodeWindow, IWindowConfiguration, IWindowState as ISingleWindowState, defaultWindowState, WindowMode } from 'vs/code/electron-main/window'; -import { ipcMain as ipc, app, screen, BrowserWindow, dialog } from 'electron'; -import { IPathWithLineAndColumn, parseLineAndColumnAware } from 'vs/code/electron-main/paths'; -import { ILifecycleService, UnloadReason } from 'vs/code/electron-main/lifecycle'; +import { IStorageService } from 'vs/platform/storage/node/storage'; +import { CodeWindow, IWindowState as ISingleWindowState, defaultWindowState, WindowMode } from 'vs/code/electron-main/window'; +import { ipcMain as ipc, screen, BrowserWindow, dialog, systemPreferences } from 'electron'; +import { IPathWithLineAndColumn, parseLineAndColumnAware } from 'vs/code/node/paths'; +import { ILifecycleService, UnloadReason } from 'vs/platform/lifecycle/electron-main/lifecycleMain'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { ILogService } from 'vs/code/electron-main/log'; -import { getPathLabel } from 'vs/base/common/labels'; -import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { IWindowSettings } from 'vs/platform/windows/common/windows'; +import { ILogService } from 'vs/platform/log/common/log'; +import { IWindowSettings, OpenContext, IPath, IWindowConfiguration } from 'vs/platform/windows/common/windows'; import { getLastActiveWindow, findBestWindowOrFolder } from 'vs/code/node/windowsUtils'; import CommonEvent, { Emitter } from 'vs/base/common/event'; import product from 'vs/platform/node/product'; -import { OpenContext } from 'vs/code/common/windows'; import { ITelemetryService, ITelemetryData } from 'vs/platform/telemetry/common/telemetry'; -import { isParent, isEqual, isEqualOrParent } from 'vs/platform/files/common/files'; -import * as nativeKeymap from 'native-keymap'; -import { IDisposable } from 'vs/base/common/lifecycle'; +import { isEqual, isEqualOrParent } from 'vs/base/common/paths'; +import { IWindowsMainService, IOpenConfiguration } from "vs/platform/windows/electron-main/windows"; +import { IHistoryMainService } from "vs/platform/history/electron-main/historyMainService"; +import { IProcessEnvironment, isLinux, isMacintosh, isWindows } from "vs/base/common/platform"; +import { TPromise } from "vs/base/common/winjs.base"; enum WindowError { UNRESPONSIVE, CRASHED } -export interface IOpenConfiguration { - context: OpenContext; - cli: ParsedArgs; - userEnv?: platform.IProcessEnvironment; - pathsToOpen?: string[]; - preferNewWindow?: boolean; - forceNewWindow?: boolean; - forceReuseWindow?: boolean; - forceEmpty?: boolean; - windowToUse?: VSCodeWindow; - diffMode?: boolean; - initialStartup?: boolean; -} - interface INewWindowState extends ISingleWindowState { hasDefaultState?: boolean; } interface IWindowState { workspacePath?: string; + backupPath: string; uiState: ISingleWindowState; } interface IWindowsState { lastActiveWindow?: IWindowState; lastPluginDevelopmentHostWindow?: IWindowState; - openedFolders: IWindowState[]; + openedWindows: IWindowState[]; + openedFolders?: IWindowState[]; // TODO@Ben deprecated } -export interface IRecentPathsList { - folders: string[]; - files: string[]; -} +type RestoreWindowsSetting = 'all' | 'folders' | 'one' | 'none'; + +interface IOpenBrowserWindowOptions { + userEnv?: IProcessEnvironment; + cli?: ParsedArgs; + workspacePath?: string; + + initialStartup?: boolean; + + filesToOpen?: IPath[]; + filesToCreate?: IPath[]; + filesToDiff?: IPath[]; -interface INativeOpenDialogOptions { - pickFolders?: boolean; - pickFiles?: boolean; - path?: string; forceNewWindow?: boolean; - window?: VSCodeWindow; + windowToUse?: CodeWindow; + + emptyWorkspaceBackupFolder?: string; } -const ReopenFoldersSetting = { - ALL: 'all', - ONE: 'one', - NONE: 'none' -}; +interface IWindowToOpen extends IPath { -export const IWindowsMainService = createDecorator('windowsMainService'); + // the workspace spath for a Code instance to open + workspacePath?: string; -export interface IWindowsMainService { - _serviceBrand: any; + // the backup spath for a Code instance to use + backupPath?: string; - // events - onWindowReady: CommonEvent; - onWindowClose: CommonEvent; - onWindowReload: CommonEvent; - onPathsOpen: CommonEvent; - onRecentPathsChange: CommonEvent; - - // methods - ready(initialUserEnv: platform.IProcessEnvironment): void; - reload(win: VSCodeWindow, cli?: ParsedArgs): void; - open(openConfig: IOpenConfiguration): VSCodeWindow[]; - openExtensionDevelopmentHostWindow(openConfig: IOpenConfiguration): void; - openFileFolderPicker(forceNewWindow?: boolean, data?: ITelemetryData): void; - openFilePicker(forceNewWindow?: boolean, path?: string, window?: VSCodeWindow, data?: ITelemetryData): void; - openFolderPicker(forceNewWindow?: boolean, window?: VSCodeWindow, data?: ITelemetryData): void; - openAccessibilityOptions(): void; - focusLastActive(cli: ParsedArgs, context: OpenContext): VSCodeWindow; - getLastActiveWindow(): VSCodeWindow; - findWindow(workspacePath: string, filePath?: string, extensionDevelopmentPath?: string): VSCodeWindow; - openNewWindow(context: OpenContext): void; - sendToFocused(channel: string, ...args: any[]): void; - sendToAll(channel: string, payload: any, windowIdsToIgnore?: number[]): void; - getFocusedWindow(): VSCodeWindow; - getWindowById(windowId: number): VSCodeWindow; - getWindows(): VSCodeWindow[]; - getWindowCount(): number; - addToRecentPathsList(paths: { path: string; isFile?: boolean; }[]): void; - getRecentPathsList(workspacePath?: string, filesToOpen?: IPath[]): IRecentPathsList; - removeFromRecentPathsList(path: string): void; - removeFromRecentPathsList(paths: string[]): void; - clearRecentPathsList(): void; - updateWindowsJumpList(): void; - quit(): void; + // indicator to create the file path in the Code instance + createFilePath?: boolean; } export class WindowsManager implements IWindowsMainService { _serviceBrand: any; - private static MAX_TOTAL_RECENT_ENTRIES = 100; - - private static recentPathsListStorageKey = 'openedPathsList'; - private static workingDirPickerStorageKey = 'pickerWorkingDir'; private static windowsStateStorageKey = 'windowsState'; - private static WINDOWS: VSCodeWindow[] = []; + private static WINDOWS: CodeWindow[] = []; - private initialUserEnv: platform.IProcessEnvironment; + private initialUserEnv: IProcessEnvironment; private windowsState: IWindowsState; private lastClosedWindowState: IWindowState; - private _onRecentPathsChange = new Emitter(); - onRecentPathsChange: CommonEvent = this._onRecentPathsChange.event; + private fileDialog: FileDialog; - private _onWindowReady = new Emitter(); - onWindowReady: CommonEvent = this._onWindowReady.event; + private _onWindowReady = new Emitter(); + onWindowReady: CommonEvent = this._onWindowReady.event; private _onWindowClose = new Emitter(); onWindowClose: CommonEvent = this._onWindowClose.event; @@ -166,59 +117,31 @@ export class WindowsManager implements IWindowsMainService { @ILifecycleService private lifecycleService: ILifecycleService, @IBackupMainService private backupService: IBackupMainService, @ITelemetryService private telemetryService: ITelemetryService, - @IConfigurationService private configurationService: IConfigurationService - ) { } + @IConfigurationService private configurationService: IConfigurationService, + @IHistoryMainService private historyService: IHistoryMainService + ) { + this.windowsState = this.storageService.getItem(WindowsManager.windowsStateStorageKey) || { openedWindows: [] }; + + // TODO@Ben migration from previous openedFolders to new openedWindows property + if (Array.isArray(this.windowsState.openedFolders) && this.windowsState.openedFolders.length > 0) { + this.windowsState.openedWindows = this.windowsState.openedFolders; + this.windowsState.openedFolders = void 0; + } else if (!this.windowsState.openedWindows) { + this.windowsState.openedWindows = []; + } - public ready(initialUserEnv: platform.IProcessEnvironment): void { - this.registerListeners(); + this.fileDialog = new FileDialog(environmentService, telemetryService, storageService, this); + } + public ready(initialUserEnv: IProcessEnvironment): void { this.initialUserEnv = initialUserEnv; - this.windowsState = this.storageService.getItem(WindowsManager.windowsStateStorageKey) || { openedFolders: [] }; + + this.registerListeners(); } private registerListeners(): void { - app.on('accessibility-support-changed', (event: Event, accessibilitySupportEnabled: boolean) => { - this.sendToAll('vscode:accessibilitySupportChanged', accessibilitySupportEnabled); - }); - - app.on('activate', (event: Event, hasVisibleWindows: boolean) => { - this.logService.log('App#activate'); - - // Mac only event: open new window when we get activated - if (!hasVisibleWindows) { - this.openNewWindow(OpenContext.DOCK); - } - }); - - let macOpenFiles: string[] = []; - let runningTimeout: number = null; - app.on('open-file', (event: Event, path: string) => { - this.logService.log('App#open-file: ', path); - event.preventDefault(); - - // Keep in array because more might come! - macOpenFiles.push(path); - - // Clear previous handler if any - if (runningTimeout !== null) { - clearTimeout(runningTimeout); - runningTimeout = null; - } - - // Handle paths delayed in case more are coming! - runningTimeout = setTimeout(() => { - this.open({ - context: OpenContext.DOCK /* can also be opening from finder while app is running */, - cli: this.environmentService.args, - pathsToOpen: macOpenFiles, - preferNewWindow: true /* dropping on the dock or opening from finder prefers to open in a new window */ - }); - macOpenFiles = []; - runningTimeout = null; - }, 100); - }); - + // React to workbench loaded events from windows ipc.on('vscode:workbenchLoaded', (event, windowId: number) => { this.logService.log('IPC#vscode-workbenchLoaded'); @@ -231,35 +154,20 @@ export class WindowsManager implements IWindowsMainService { } }); - ipc.on('vscode:broadcast', (event, windowId: number, target: string, broadcast: { channel: string; payload: any; }) => { - if (broadcast.channel && !types.isUndefinedOrNull(broadcast.payload)) { - this.logService.log('IPC#vscode:broadcast', target, broadcast.channel, broadcast.payload); - - // Handle specific events on main side - this.onBroadcast(broadcast.channel, broadcast.payload); - - // Send to windows - if (target) { - const otherWindowsWithTarget = WindowsManager.WINDOWS.filter(w => w.id !== windowId && typeof w.openedWorkspacePath === 'string'); - const directTargetMatch = otherWindowsWithTarget.filter(w => isEqual(target, w.openedWorkspacePath, !platform.isLinux /* ignorecase */)); - const parentTargetMatch = otherWindowsWithTarget.filter(w => isParent(target, w.openedWorkspacePath, !platform.isLinux /* ignorecase */)); - - const targetWindow = directTargetMatch.length ? directTargetMatch[0] : parentTargetMatch[0]; // prefer direct match over parent match - if (targetWindow) { - targetWindow.send('vscode:broadcast', broadcast); - } + // React to HC color scheme changes (Windows) + if (isWindows) { + systemPreferences.on('inverted-color-scheme-changed', () => { + if (systemPreferences.isInvertedColorScheme()) { + this.sendToAll('vscode:enterHighContrast'); } else { - this.sendToAll('vscode:broadcast', broadcast, [windowId]); + this.sendToAll('vscode:leaveHighContrast'); } - } - }); + }); + } // Update our windows state before quitting and before closing windows - this.lifecycleService.onBeforeWindowClose(win => this.onBeforeWindowClose(win)); + this.lifecycleService.onBeforeWindowClose(win => this.onBeforeWindowClose(win as CodeWindow)); this.lifecycleService.onBeforeQuit(() => this.onBeforeQuit()); - - // Keyboard layout changes - KeyboardLayoutMonitor.INSTANCE.onDidChangeKeyboardLayout(isISOKeyboard => this.sendToAll('vscode:keyboardLayoutChanged', isISOKeyboard)); } // Note that onBeforeQuit() and onBeforeWindowClose() are fired in different order depending on the OS: @@ -271,7 +179,8 @@ export class WindowsManager implements IWindowsMainService { // and then onBeforeWindowClose(). private onBeforeQuit(): void { const currentWindowsState: IWindowsState = { - openedFolders: [], + openedWindows: [], + openedFolders: [], // TODO@Ben migration so that old clients do not fail over data (prevents NPEs) lastPluginDevelopmentHostWindow: this.windowsState.lastPluginDevelopmentHostWindow, lastActiveWindow: this.lastClosedWindowState }; @@ -284,26 +193,27 @@ export class WindowsManager implements IWindowsMainService { } if (activeWindow) { - currentWindowsState.lastActiveWindow = { workspacePath: activeWindow.openedWorkspacePath, uiState: activeWindow.serializeWindowState() }; + currentWindowsState.lastActiveWindow = { workspacePath: activeWindow.openedWorkspacePath, uiState: activeWindow.serializeWindowState(), backupPath: activeWindow.backupPath }; } } // 2.) Find extension host window const extensionHostWindow = WindowsManager.WINDOWS.filter(w => w.isExtensionDevelopmentHost && !w.isExtensionTestHost)[0]; if (extensionHostWindow) { - currentWindowsState.lastPluginDevelopmentHostWindow = { workspacePath: extensionHostWindow.openedWorkspacePath, uiState: extensionHostWindow.serializeWindowState() }; + currentWindowsState.lastPluginDevelopmentHostWindow = { workspacePath: extensionHostWindow.openedWorkspacePath, uiState: extensionHostWindow.serializeWindowState(), backupPath: extensionHostWindow.backupPath }; } - // 3.) All windows with opened folders for N >= 2 to support reopenFolders: all or for auto update + // 3.) All windows (except extension host) for N >= 2 to support restoreWindows: all or for auto update // // Carefull here: asking a window for its window state after it has been closed returns bogus values (width: 0, height: 0) // so if we ever want to persist the UI state of the last closed window (window count === 1), it has // to come from the stored lastClosedWindowState on Win/Linux at least if (this.getWindowCount() > 1) { - currentWindowsState.openedFolders = WindowsManager.WINDOWS.filter(w => !!w.openedWorkspacePath && !w.isExtensionDevelopmentHost).map(w => { + currentWindowsState.openedWindows = WindowsManager.WINDOWS.filter(w => !w.isExtensionDevelopmentHost).map(w => { return { workspacePath: w.openedWorkspacePath, - uiState: w.serializeWindowState() + uiState: w.serializeWindowState(), + backupPath: w.backupPath }; }); } @@ -313,21 +223,21 @@ export class WindowsManager implements IWindowsMainService { } // See note on #onBeforeQuit() for details how these events are flowing - private onBeforeWindowClose(win: VSCodeWindow): void { + private onBeforeWindowClose(win: CodeWindow): void { if (this.lifecycleService.isQuitRequested()) { return; // during quit, many windows close in parallel so let it be handled in the before-quit handler } // On Window close, update our stored UI state of this window - const state: IWindowState = { workspacePath: win.openedWorkspacePath, uiState: win.serializeWindowState() }; + const state: IWindowState = { workspacePath: win.openedWorkspacePath, uiState: win.serializeWindowState(), backupPath: win.backupPath }; if (win.isExtensionDevelopmentHost && !win.isExtensionTestHost) { this.windowsState.lastPluginDevelopmentHostWindow = state; // do not let test run window state overwrite our extension development state } // Any non extension host window with same workspace else if (!win.isExtensionDevelopmentHost && !!win.openedWorkspacePath) { - this.windowsState.openedFolders.forEach(o => { - if (isEqual(o.workspacePath, win.openedWorkspacePath, !platform.isLinux /* ignorecase */)) { + this.windowsState.openedWindows.forEach(o => { + if (isEqual(o.workspacePath, win.openedWorkspacePath, !isLinux /* ignorecase */)) { o.uiState = state.uiState; } }); @@ -342,127 +252,88 @@ export class WindowsManager implements IWindowsMainService { } } - private onBroadcast(event: string, payload: any): void { - // Theme changes - if (event === 'vscode:changeColorTheme' && typeof payload === 'string') { + public open(openConfig: IOpenConfiguration): CodeWindow[] { + const windowsToOpen = this.getWindowsToOpen(openConfig); - let data = JSON.parse(payload); - this.storageService.setItem(VSCodeWindow.themeStorageKey, data.id); - this.storageService.setItem(VSCodeWindow.themeBackgroundStorageKey, data.background); + // + // These are windows to open to show either folders or files (including diffing files or creating them) + // + const foldersToOpen = arrays.distinct(windowsToOpen.filter(win => win.workspacePath && !win.filePath).map(win => win.workspacePath), folder => isLinux ? folder : folder.toLowerCase()); // prevent duplicates + const emptyToOpen = windowsToOpen.filter(win => !win.workspacePath && !win.filePath && !win.backupPath).length; + + let filesToOpen = windowsToOpen.filter(path => !!path.filePath && !path.createFilePath); + let filesToCreate = windowsToOpen.filter(path => !!path.filePath && path.createFilePath); + let filesToDiff: IPath[]; + if (openConfig.diffMode && filesToOpen.length === 2) { + filesToDiff = filesToOpen; + filesToOpen = []; + filesToCreate = []; // diff ignores other files that do not exist + } else { + filesToDiff = []; } - } - public reload(win: VSCodeWindow, cli?: ParsedArgs): void { - - // Only reload when the window has not vetoed this - this.lifecycleService.unload(win, UnloadReason.RELOAD).done(veto => { - if (!veto) { - win.reload(cli); - // Emit - this._onWindowReload.fire(win.id); + // + // These are windows to restore because of hot-exit + // + const hotExitRestore = (openConfig.initialStartup && !openConfig.cli.extensionDevelopmentPath); + const foldersToRestore = hotExitRestore ? this.backupService.getWorkspaceBackupPaths() : []; + let emptyToRestore = hotExitRestore ? this.backupService.getEmptyWorkspaceBackupPaths() : []; + emptyToRestore.push(...windowsToOpen.filter(w => !w.workspacePath && w.backupPath).map(w => path.basename(w.backupPath))); // add empty windows with backupPath + emptyToRestore = arrays.distinct(emptyToRestore); // prevent duplicates + + // Open based on config + const usedWindows = this.doOpen(openConfig, foldersToOpen, foldersToRestore, emptyToRestore, emptyToOpen, filesToOpen, filesToCreate, filesToDiff); + + // Make sure the last active window gets focus if we opened multiple + if (usedWindows.length > 1 && this.windowsState.lastActiveWindow) { + let lastActiveWindw = usedWindows.filter(w => w.backupPath === this.windowsState.lastActiveWindow.backupPath); + if (lastActiveWindw.length) { + lastActiveWindw[0].focus(); } - }); - } - - public open(openConfig: IOpenConfiguration): VSCodeWindow[] { - const windowConfig = this.configurationService.getConfiguration('window'); + } - let iPathsToOpen: IPath[]; - const usedWindows: VSCodeWindow[] = []; + // Remember in recent document list (unless this opens for extension development) + // Also do not add paths when files are opened for diffing, only if opened individually + if (!usedWindows.some(w => w.isExtensionDevelopmentHost) && !openConfig.cli.diff) { + const recentPaths: { path: string; isFile?: boolean; }[] = []; - // Find paths from provided paths if any - if (openConfig.pathsToOpen && openConfig.pathsToOpen.length > 0) { - iPathsToOpen = openConfig.pathsToOpen.map(pathToOpen => { - const iPath = this.toIPath(pathToOpen, false, openConfig.cli && openConfig.cli.goto); - - // Warn if the requested path to open does not exist - if (!iPath) { - const options: Electron.ShowMessageBoxOptions = { - title: product.nameLong, - type: 'info', - buttons: [nls.localize('ok', "OK")], - message: nls.localize('pathNotExistTitle', "Path does not exist"), - detail: nls.localize('pathNotExistDetail', "The path '{0}' does not seem to exist anymore on disk.", pathToOpen), - noLink: true - }; - - const activeWindow = BrowserWindow.getFocusedWindow(); - if (activeWindow) { - dialog.showMessageBox(activeWindow, options); - } else { - dialog.showMessageBox(options); - } + windowsToOpen.forEach(win => { + if (win.filePath || win.workspacePath) { + recentPaths.push({ path: win.filePath || win.workspacePath, isFile: !!win.filePath }); } - - return iPath; }); - // get rid of nulls - iPathsToOpen = arrays.coalesce(iPathsToOpen); - - if (iPathsToOpen.length === 0) { - return null; // indicate to outside that open failed + if (recentPaths.length) { + this.historyService.addToRecentPathsList(recentPaths); } } - // Check for force empty - else if (openConfig.forceEmpty) { - iPathsToOpen = [Object.create(null)]; + // Emit events + if (windowsToOpen.length) { + this._onPathsOpen.fire(windowsToOpen); } - // Otherwise infer from command line arguments - else { - const ignoreFileNotFound = openConfig.cli._.length > 0; // we assume the user wants to create this file from command line - iPathsToOpen = this.cliToPaths(openConfig.cli, ignoreFileNotFound); - } + return usedWindows; + } - let foldersToOpen = arrays.distinct(iPathsToOpen.filter(iPath => iPath.workspacePath && !iPath.filePath).map(iPath => iPath.workspacePath), folder => platform.isLinux ? folder : folder.toLowerCase()); // prevent duplicates - let foldersToRestore = (openConfig.initialStartup && !openConfig.cli.extensionDevelopmentPath) ? this.backupService.getWorkspaceBackupPaths() : []; - let filesToOpen: IPath[] = []; - let filesToDiff: IPath[] = []; - let emptyToOpen = iPathsToOpen.filter(iPath => !iPath.workspacePath && !iPath.filePath); - let emptyToRestore = (openConfig.initialStartup && !openConfig.cli.extensionDevelopmentPath) ? this.backupService.getEmptyWorkspaceBackupPaths() : []; - let filesToCreate = iPathsToOpen.filter(iPath => !!iPath.filePath && iPath.createFilePath); - - // Diff mode needs special care - const candidates = iPathsToOpen.filter(iPath => !!iPath.filePath && !iPath.createFilePath); - if (openConfig.diffMode) { - if (candidates.length === 2) { - filesToDiff = candidates; - } else { - emptyToOpen = [Object.create(null)]; // improper use of diffMode, open empty - } + private doOpen( + openConfig: IOpenConfiguration, + foldersToOpen: string[], + foldersToRestore: string[], + emptyToRestore: string[], + emptyToOpen: number, + filesToOpen: IPath[], + filesToCreate: IPath[], + filesToDiff: IPath[] + ) { - foldersToOpen = []; // diff is always in empty workspace - foldersToRestore = []; // diff is always in empty workspace - filesToCreate = []; // diff ignores other files that do not exist - } else { - filesToOpen = candidates; - } - - // let the user settings override how folders are open in a new window or same window unless we are forced - let openFolderInNewWindow = (openConfig.preferNewWindow || openConfig.forceNewWindow) && !openConfig.forceReuseWindow; - if (!openConfig.forceNewWindow && !openConfig.forceReuseWindow && windowConfig && (windowConfig.openFoldersInNewWindow === 'on' || windowConfig.openFoldersInNewWindow === 'off')) { - openFolderInNewWindow = (windowConfig.openFoldersInNewWindow === 'on'); - } + // Settings can decide if files/folders open in new window or not + let { openFolderInNewWindow, openFilesInNewWindow } = this.shouldOpenNewWindow(openConfig); // Handle files to open/diff or to create when we dont open a folder and we do not restore any folder/untitled from hot-exit + const usedWindows: CodeWindow[] = []; if (!foldersToOpen.length && !foldersToRestore.length && !emptyToRestore.length && (filesToOpen.length > 0 || filesToCreate.length > 0 || filesToDiff.length > 0)) { - // let the user settings override how files are open in a new window or same window unless we are forced (not for extension development though) - let openFilesInNewWindow: boolean; - if (openConfig.forceNewWindow || openConfig.forceReuseWindow) { - openFilesInNewWindow = openConfig.forceNewWindow && !openConfig.forceReuseWindow; - } else { - if (openConfig.context === OpenContext.DOCK) { - openFilesInNewWindow = true; // only on macOS do we allow to open files in a new window if this is triggered via DOCK context - } - - if (!openConfig.cli.extensionDevelopmentPath && windowConfig && (windowConfig.openFilesInNewWindow === 'on' || windowConfig.openFilesInNewWindow === 'off')) { - openFilesInNewWindow = (windowConfig.openFilesInNewWindow === 'on'); - } - } - // Open Files in last instance if any and flag tells us so const fileToCheck = filesToOpen[0] || filesToCreate[0] || filesToDiff[0]; const windowOrFolder = findBestWindowOrFolder({ @@ -473,7 +344,8 @@ export class WindowsManager implements IWindowsMainService { filePath: fileToCheck && fileToCheck.filePath, userHome: this.environmentService.userHome }); - if (windowOrFolder instanceof VSCodeWindow) { + + if (windowOrFolder instanceof CodeWindow) { windowOrFolder.focus(); const files = { filesToOpen, filesToCreate, filesToDiff }; // copy to object because they get reset shortly after windowOrFolder.ready().then(readyWindow => { @@ -485,8 +357,16 @@ export class WindowsManager implements IWindowsMainService { // Otherwise open instance with files else { - const configuration = this.toConfiguration(openConfig, windowOrFolder, filesToOpen, filesToCreate, filesToDiff); - const browserWindow = this.openInBrowserWindow(configuration, true /* new window */); + const browserWindow = this.openInBrowserWindow({ + userEnv: openConfig.userEnv, + cli: openConfig.cli, + initialStartup: openConfig.initialStartup, + workspacePath: windowOrFolder, + filesToOpen, + filesToCreate, + filesToDiff, + forceNewWindow: true + }); usedWindows.push(browserWindow); openFolderInNewWindow = true; // any other folders to open must open in new window then @@ -499,7 +379,7 @@ export class WindowsManager implements IWindowsMainService { } // Handle folders to open (instructed and to restore) - let allFoldersToOpen = arrays.distinct([...foldersToOpen, ...foldersToRestore], folder => platform.isLinux ? folder : folder.toLowerCase()); // prevent duplicates + let allFoldersToOpen = arrays.distinct([...foldersToOpen, ...foldersToRestore], folder => isLinux ? folder : folder.toLowerCase()); // prevent duplicates if (allFoldersToOpen.length > 0) { // Check for existing instances @@ -507,6 +387,7 @@ export class WindowsManager implements IWindowsMainService { if (windowsOnWorkspacePath.length > 0) { const browserWindow = windowsOnWorkspacePath[0]; browserWindow.focus(); // just focus one of them + const files = { filesToOpen, filesToCreate, filesToDiff }; // copy to object because they get reset shortly after browserWindow.ready().then(readyWindow => { readyWindow.send('vscode:openFiles', files); @@ -524,12 +405,21 @@ export class WindowsManager implements IWindowsMainService { // Open remaining ones allFoldersToOpen.forEach(folderToOpen => { - if (windowsOnWorkspacePath.some(win => isEqual(win.openedWorkspacePath, folderToOpen, !platform.isLinux /* ignorecase */))) { + if (windowsOnWorkspacePath.some(win => isEqual(win.openedWorkspacePath, folderToOpen, !isLinux /* ignorecase */))) { return; // ignore folders that are already open } - const configuration = this.toConfiguration(openConfig, folderToOpen, filesToOpen, filesToCreate, filesToDiff); - const browserWindow = this.openInBrowserWindow(configuration, openFolderInNewWindow, openFolderInNewWindow ? void 0 : openConfig.windowToUse); + const browserWindow = this.openInBrowserWindow({ + userEnv: openConfig.userEnv, + cli: openConfig.cli, + initialStartup: openConfig.initialStartup, + workspacePath: folderToOpen, + filesToOpen, + filesToCreate, + filesToDiff, + forceNewWindow: openFolderInNewWindow, + windowToUse: openFolderInNewWindow ? void 0 : openConfig.windowToUse as CodeWindow + }); usedWindows.push(browserWindow); // Reset these because we handled them @@ -544,8 +434,16 @@ export class WindowsManager implements IWindowsMainService { // Handle empty if (emptyToRestore.length > 0) { emptyToRestore.forEach(emptyWorkspaceBackupFolder => { - const configuration = this.toConfiguration(openConfig, void 0, filesToOpen, filesToCreate, filesToDiff); - const browserWindow = this.openInBrowserWindow(configuration, true /* new window */, null, emptyWorkspaceBackupFolder); + const browserWindow = this.openInBrowserWindow({ + userEnv: openConfig.userEnv, + cli: openConfig.cli, + initialStartup: openConfig.initialStartup, + filesToOpen, + filesToCreate, + filesToDiff, + forceNewWindow: true, + emptyWorkspaceBackupFolder + }); usedWindows.push(browserWindow); // Reset these because we handled them @@ -558,192 +456,179 @@ export class WindowsManager implements IWindowsMainService { } // Only open empty if no empty workspaces were restored - else if (emptyToOpen.length > 0) { - emptyToOpen.forEach(() => { - const configuration = this.toConfiguration(openConfig); - const browserWindow = this.openInBrowserWindow(configuration, openFolderInNewWindow, openFolderInNewWindow ? void 0 : openConfig.windowToUse); + else if (emptyToOpen > 0) { + for (let i = 0; i < emptyToOpen; i++) { + const browserWindow = this.openInBrowserWindow({ + userEnv: openConfig.userEnv, + cli: openConfig.cli, + initialStartup: openConfig.initialStartup, + forceNewWindow: openFolderInNewWindow, + windowToUse: openFolderInNewWindow ? void 0 : openConfig.windowToUse as CodeWindow + }); usedWindows.push(browserWindow); openFolderInNewWindow = true; // any other folders to open must open in new window then - }); + } } - // Remember in recent document list (unless this opens for extension development) - // Also do not add paths when files are opened for diffing, only if opened individually - if (!usedWindows.some(w => w.isExtensionDevelopmentHost) && !openConfig.cli.diff) { - const recentPaths: { path: string; isFile?: boolean; }[] = []; + return arrays.distinct(usedWindows); + } - iPathsToOpen.forEach(iPath => { - if (iPath.filePath || iPath.workspacePath) { - app.addRecentDocument(iPath.filePath || iPath.workspacePath); - recentPaths.push({ path: iPath.filePath || iPath.workspacePath, isFile: !!iPath.filePath }); - } - }); + private getWindowsToOpen(openConfig: IOpenConfiguration): IWindowToOpen[] { + let windowsToOpen: IWindowToOpen[]; - if (recentPaths.length) { - this.addToRecentPathsList(recentPaths); - } + // Extract paths: from API + if (openConfig.pathsToOpen && openConfig.pathsToOpen.length > 0) { + windowsToOpen = this.doExtractPathsFromAPI(openConfig.pathsToOpen, openConfig.cli && openConfig.cli.goto); } - // Emit events - this._onPathsOpen.fire(iPathsToOpen); + // Check for force empty + else if (openConfig.forceEmpty) { + windowsToOpen = [Object.create(null)]; + } - return arrays.distinct(usedWindows); - } + // Extract paths: from CLI + else if (openConfig.cli._.length > 0) { + windowsToOpen = this.doExtractPathsFromCLI(openConfig.cli); + } - public addToRecentPathsList(paths: { path: string; isFile?: boolean; }[]): void { - if (!paths || !paths.length) { - return; + // Extract windows: from previous session + else { + windowsToOpen = this.doGetWindowsFromLastSession(); } - const mru = this.getRecentPathsList(); - paths.forEach(p => { - const { path, isFile } = p; + return windowsToOpen; + } + + private doExtractPathsFromAPI(paths: string[], gotoLineMode: boolean): IPath[] { + let pathsToOpen = paths.map(pathToOpen => { + const path = this.parsePath(pathToOpen, false, gotoLineMode); + + // Warn if the requested path to open does not exist + if (!path) { + const options: Electron.ShowMessageBoxOptions = { + title: product.nameLong, + type: 'info', + buttons: [nls.localize('ok', "OK")], + message: nls.localize('pathNotExistTitle', "Path does not exist"), + detail: nls.localize('pathNotExistDetail', "The path '{0}' does not seem to exist anymore on disk.", pathToOpen), + noLink: true + }; - if (isFile) { - mru.files.unshift(path); - mru.files = arrays.distinct(mru.files, (f) => platform.isLinux ? f : f.toLowerCase()); - } else { - mru.folders.unshift(path); - mru.folders = arrays.distinct(mru.folders, (f) => platform.isLinux ? f : f.toLowerCase()); + const activeWindow = BrowserWindow.getFocusedWindow(); + if (activeWindow) { + dialog.showMessageBox(activeWindow, options); + } else { + dialog.showMessageBox(options); + } } - // Make sure its bounded - mru.folders = mru.folders.slice(0, WindowsManager.MAX_TOTAL_RECENT_ENTRIES); - mru.files = mru.files.slice(0, WindowsManager.MAX_TOTAL_RECENT_ENTRIES); + return path; }); - this.storageService.setItem(WindowsManager.recentPathsListStorageKey, mru); - this._onRecentPathsChange.fire(); + // get rid of nulls + pathsToOpen = arrays.coalesce(pathsToOpen); + + return pathsToOpen; } - public removeFromRecentPathsList(path: string): void; - public removeFromRecentPathsList(paths: string[]): void; - public removeFromRecentPathsList(arg1: any): void { - let paths: string[]; - if (Array.isArray(arg1)) { - paths = arg1; - } else { - paths = [arg1]; + private doExtractPathsFromCLI(cli: ParsedArgs): IPath[] { + const pathsToOpen = cli._.map(candidate => this.parsePath(candidate, true /* ignoreFileNotFound */, cli.goto)).filter(path => !!path); + if (pathsToOpen.length > 0) { + return pathsToOpen; } - const mru = this.getRecentPathsList(); - let update = false; + // No path provided, return empty to open empty + return [Object.create(null)]; + } - paths.forEach(path => { - let index = mru.files.indexOf(path); - if (index >= 0) { - mru.files.splice(index, 1); - update = true; - } + private doGetWindowsFromLastSession(): IWindowToOpen[] { + const restoreWindows = this.getRestoreWindowsSetting(); + const lastActiveWindow = this.windowsState.lastActiveWindow; - index = mru.folders.indexOf(path); - if (index >= 0) { - mru.folders.splice(index, 1); - update = true; - } - }); + switch (restoreWindows) { - if (update) { - this.storageService.setItem(WindowsManager.recentPathsListStorageKey, mru); - this._onRecentPathsChange.fire(); - } - } + // none: we always open an empty window + case 'none': + return [Object.create(null)]; - public clearRecentPathsList(): void { - this.storageService.setItem(WindowsManager.recentPathsListStorageKey, { folders: [], files: [] }); - app.clearRecentDocuments(); + // one: restore last opened folder or empty window + case 'one': + if (lastActiveWindow) { - // Event - this._onRecentPathsChange.fire(); - } + // return folder path if it is valid + const folder = lastActiveWindow.workspacePath; + if (folder) { + const validatedFolderPath = this.parsePath(folder); + if (validatedFolderPath) { + return [validatedFolderPath]; + } + } - public getRecentPathsList(workspacePath?: string, filesToOpen?: IPath[]): IRecentPathsList { - let files: string[]; - let folders: string[]; + // otherwise use backup path to restore empty windows + else if (lastActiveWindow.backupPath) { + return [{ backupPath: lastActiveWindow.backupPath }]; + } + } + break; - // Get from storage - const storedRecents = this.storageService.getItem(WindowsManager.recentPathsListStorageKey); - if (storedRecents) { - files = storedRecents.files || []; - folders = storedRecents.folders || []; - } else { - files = []; - folders = []; - } + // all: restore all windows + // folders: restore last opened folders only + case 'all': + case 'folders': - // Add currently files to open to the beginning if any - if (filesToOpen) { - files.unshift(...filesToOpen.map(f => f.filePath)); - } + // Windows with Folders + const lastOpenedFolders = this.windowsState.openedWindows.filter(w => !!w.workspacePath).map(o => o.workspacePath); + const lastActiveFolder = lastActiveWindow && lastActiveWindow.workspacePath; + if (lastActiveFolder) { + lastOpenedFolders.push(lastActiveFolder); + } - // Add current workspace path to beginning if set - if (workspacePath) { - folders.unshift(workspacePath); - } + const windowsToOpen = lastOpenedFolders.map(candidate => this.parsePath(candidate)).filter(path => !!path); - // Clear those dupes - files = arrays.distinct(files); - folders = arrays.distinct(folders); + // Windows that were Empty + if (restoreWindows === 'all') { + const lastOpenedEmpty = this.windowsState.openedWindows.filter(w => !w.workspacePath && w.backupPath).map(w => w.backupPath); + const lastActiveEmpty = lastActiveWindow && !lastActiveWindow.workspacePath && lastActiveWindow.backupPath; + if (lastActiveEmpty) { + lastOpenedEmpty.push(lastActiveEmpty); + } - return { files, folders }; - } + windowsToOpen.push(...lastOpenedEmpty.map(backupPath => ({ backupPath }))); + } - private getWindowUserEnv(openConfig: IOpenConfiguration): platform.IProcessEnvironment { - return assign({}, this.initialUserEnv, openConfig.userEnv || {}); - } + if (windowsToOpen.length > 0) { + return windowsToOpen; + } - public openExtensionDevelopmentHostWindow(openConfig: IOpenConfiguration): void { + break; + } - // Reload an existing extension development host window on the same path - // We currently do not allow more than one extension development window - // on the same extension path. - let res = WindowsManager.WINDOWS.filter(w => w.config && isEqual(w.config.extensionDevelopmentPath, openConfig.cli.extensionDevelopmentPath, !platform.isLinux /* ignorecase */)); - if (res && res.length === 1) { - this.reload(res[0], openConfig.cli); - res[0].focus(); // make sure it gets focus and is restored + // Always fallback to empty window + return [Object.create(null)]; + } - return; - } + private getRestoreWindowsSetting(): RestoreWindowsSetting { + let restoreWindows: RestoreWindowsSetting; + if (this.lifecycleService.wasRestarted) { + restoreWindows = 'all'; // always reopen all windows when an update was applied + } else { + const windowConfig = this.configurationService.getConfiguration('window'); + restoreWindows = ((windowConfig && windowConfig.restoreWindows) || 'one') as RestoreWindowsSetting; - // Fill in previously opened workspace unless an explicit path is provided and we are not unit testing - if (openConfig.cli._.length === 0 && !openConfig.cli.extensionTestsPath) { - const workspaceToOpen = this.windowsState.lastPluginDevelopmentHostWindow && this.windowsState.lastPluginDevelopmentHostWindow.workspacePath; - if (workspaceToOpen) { - openConfig.cli._ = [workspaceToOpen]; + if (restoreWindows === 'one' /* default */ && windowConfig && windowConfig.reopenFolders) { + restoreWindows = windowConfig.reopenFolders; // TODO@Ben migration } - } - // Make sure we are not asked to open a path that is already opened - if (openConfig.cli._.length > 0) { - res = WindowsManager.WINDOWS.filter(w => w.openedWorkspacePath && openConfig.cli._.indexOf(w.openedWorkspacePath) >= 0); - if (res.length) { - openConfig.cli._ = []; + if (['all', 'folders', 'one', 'none'].indexOf(restoreWindows) === -1) { + restoreWindows = 'one'; } } - // Open it - this.open({ context: openConfig.context, cli: openConfig.cli, forceNewWindow: true, forceEmpty: openConfig.cli._.length === 0, userEnv: openConfig.userEnv }); - } - - private toConfiguration(config: IOpenConfiguration, workspacePath?: string, filesToOpen?: IPath[], filesToCreate?: IPath[], filesToDiff?: IPath[]): IWindowConfiguration { - const configuration: IWindowConfiguration = mixin({}, config.cli); // inherit all properties from CLI - configuration.appRoot = this.environmentService.appRoot; - configuration.execPath = process.execPath; - configuration.userEnv = this.getWindowUserEnv(config); - configuration.isInitialStartup = config.initialStartup; - configuration.workspacePath = workspacePath; - configuration.filesToOpen = filesToOpen; - configuration.filesToCreate = filesToCreate; - configuration.filesToDiff = filesToDiff; - configuration.nodeCachedDataDir = this.environmentService.nodeCachedDataDir; - configuration.isISOKeyboard = KeyboardLayoutMonitor.INSTANCE.isISOKeyboard(); - configuration.accessibilitySupportEnabled = app.isAccessibilitySupportEnabled(); - - return configuration; + return restoreWindows; } - private toIPath(anyPath: string, ignoreFileNotFound?: boolean, gotoLineMode?: boolean): IPath { + private parsePath(anyPath: string, ignoreFileNotFound?: boolean, gotoLineMode?: boolean): IWindowToOpen { if (!anyPath) { return null; } @@ -767,7 +652,7 @@ export class WindowsManager implements IWindowsMainService { { workspacePath: candidate }; } } catch (error) { - this.removeFromRecentPathsList(candidate); // since file does not seem to exist anymore, remove from recent + this.historyService.removeFromRecentPathsList(candidate); // since file does not seem to exist anymore, remove from recent if (ignoreFileNotFound) { return { filePath: candidate, createFilePath: true }; // assume this is a file that does not yet exist @@ -777,67 +662,102 @@ export class WindowsManager implements IWindowsMainService { return null; } - private cliToPaths(cli: ParsedArgs, ignoreFileNotFound?: boolean): IPath[] { + private shouldOpenNewWindow(openConfig: IOpenConfiguration): { openFolderInNewWindow: boolean; openFilesInNewWindow: boolean; } { - // Check for pass in candidate or last opened path - let candidates: string[] = []; - if (cli._.length > 0) { - candidates = cli._; + // let the user settings override how folders are open in a new window or same window unless we are forced + const windowConfig = this.configurationService.getConfiguration('window'); + const openFolderInNewWindowConfig = (windowConfig && windowConfig.openFoldersInNewWindow) || 'default' /* default */; + const openFilesInNewWindowConfig = (windowConfig && windowConfig.openFilesInNewWindow) || 'off' /* default */; + + let openFolderInNewWindow = (openConfig.preferNewWindow || openConfig.forceNewWindow) && !openConfig.forceReuseWindow; + if (!openConfig.forceNewWindow && !openConfig.forceReuseWindow && (openFolderInNewWindowConfig === 'on' || openFolderInNewWindowConfig === 'off')) { + openFolderInNewWindow = (openFolderInNewWindowConfig === 'on'); } - // No path argument, check settings for what to do now - else { - let reopenFolders: string; - if (this.lifecycleService.wasRestarted) { - reopenFolders = ReopenFoldersSetting.ALL; // always reopen all folders when an update was applied - } else { - const windowConfig = this.configurationService.getConfiguration('window'); - reopenFolders = (windowConfig && windowConfig.reopenFolders) || ReopenFoldersSetting.ONE; + // let the user settings override how files are open in a new window or same window unless we are forced (not for extension development though) + let openFilesInNewWindow: boolean; + if (openConfig.forceNewWindow || openConfig.forceReuseWindow) { + openFilesInNewWindow = openConfig.forceNewWindow && !openConfig.forceReuseWindow; + } else { + if (openConfig.context === OpenContext.DOCK) { + openFilesInNewWindow = true; // only on macOS do we allow to open files in a new window if this is triggered via DOCK context } - const lastActiveFolder = this.windowsState.lastActiveWindow && this.windowsState.lastActiveWindow.workspacePath; + if (!openConfig.cli.extensionDevelopmentPath && (openFilesInNewWindowConfig === 'on' || openFilesInNewWindowConfig === 'off')) { + openFilesInNewWindow = (openFilesInNewWindowConfig === 'on'); + } + } - // Restore all - if (reopenFolders === ReopenFoldersSetting.ALL) { - const lastOpenedFolders = this.windowsState.openedFolders.map(o => o.workspacePath); + return { openFolderInNewWindow, openFilesInNewWindow }; + } - // If we have a last active folder, move it to the end - if (lastActiveFolder) { - lastOpenedFolders.splice(lastOpenedFolders.indexOf(lastActiveFolder), 1); - lastOpenedFolders.push(lastActiveFolder); - } + public openExtensionDevelopmentHostWindow(openConfig: IOpenConfiguration): void { - candidates.push(...lastOpenedFolders); - } + // Reload an existing extension development host window on the same path + // We currently do not allow more than one extension development window + // on the same extension path. + let res = WindowsManager.WINDOWS.filter(w => w.config && isEqual(w.config.extensionDevelopmentPath, openConfig.cli.extensionDevelopmentPath, !isLinux /* ignorecase */)); + if (res && res.length === 1) { + this.reload(res[0], openConfig.cli); + res[0].focus(); // make sure it gets focus and is restored - // Restore last active - else if (lastActiveFolder && (reopenFolders === ReopenFoldersSetting.ONE || reopenFolders !== ReopenFoldersSetting.NONE)) { - candidates.push(lastActiveFolder); + return; + } + + // Fill in previously opened workspace unless an explicit path is provided and we are not unit testing + if (openConfig.cli._.length === 0 && !openConfig.cli.extensionTestsPath) { + const workspaceToOpen = this.windowsState.lastPluginDevelopmentHostWindow && this.windowsState.lastPluginDevelopmentHostWindow.workspacePath; + if (workspaceToOpen) { + openConfig.cli._ = [workspaceToOpen]; } } - const iPaths = candidates.map(candidate => this.toIPath(candidate, ignoreFileNotFound, cli.goto)).filter(path => !!path); - if (iPaths.length > 0) { - return iPaths; + // Make sure we are not asked to open a path that is already opened + if (openConfig.cli._.length > 0) { + res = WindowsManager.WINDOWS.filter(w => w.openedWorkspacePath && openConfig.cli._.indexOf(w.openedWorkspacePath) >= 0); + if (res.length) { + openConfig.cli._ = []; + } } - // No path provided, return empty to open empty - return [Object.create(null)]; + // Open it + this.open({ context: openConfig.context, cli: openConfig.cli, forceNewWindow: true, forceEmpty: openConfig.cli._.length === 0, userEnv: openConfig.userEnv }); } - private openInBrowserWindow(configuration: IWindowConfiguration, forceNewWindow?: boolean, windowToUse?: VSCodeWindow, emptyWorkspaceBackupFolder?: string): VSCodeWindow { - let vscodeWindow: VSCodeWindow; + private openInBrowserWindow(options: IOpenBrowserWindowOptions): CodeWindow { - if (!forceNewWindow) { - vscodeWindow = windowToUse || this.getLastActiveWindow(); + // Build IWindowConfiguration from config and options + const configuration: IWindowConfiguration = mixin({}, options.cli); // inherit all properties from CLI + configuration.appRoot = this.environmentService.appRoot; + configuration.execPath = process.execPath; + configuration.userEnv = assign({}, this.initialUserEnv, options.userEnv || {}); + configuration.isInitialStartup = options.initialStartup; + configuration.workspacePath = options.workspacePath; + configuration.filesToOpen = options.filesToOpen; + configuration.filesToCreate = options.filesToCreate; + configuration.filesToDiff = options.filesToDiff; + configuration.nodeCachedDataDir = this.environmentService.nodeCachedDataDir; - if (vscodeWindow) { - vscodeWindow.focus(); + // if we know the backup folder upfront (for empty workspaces to restore), we can set it + // directly here which helps for restoring UI state associated with that window. + // For all other cases we first call into registerWindowForBackupsSync() to set it before + // loading the window. + if (options.emptyWorkspaceBackupFolder) { + configuration.backupPath = path.join(this.environmentService.backupHome, options.emptyWorkspaceBackupFolder); + } + + let codeWindow: CodeWindow; + + if (!options.forceNewWindow) { + codeWindow = options.windowToUse || this.getLastActiveWindow(); + + if (codeWindow) { + codeWindow.focus(); } } // New window - if (!vscodeWindow) { + if (!codeWindow) { const windowConfig = this.configurationService.getConfiguration('window'); const state = this.getNewWindowState(configuration); @@ -856,7 +776,7 @@ export class WindowsManager implements IWindowsMainService { state.mode = WindowMode.Normal; } - vscodeWindow = new VSCodeWindow({ + codeWindow = new CodeWindow({ state, extensionDevelopmentPath: configuration.extensionDevelopmentPath, isExtensionTestHost: !!configuration.extensionTestsPath @@ -867,17 +787,17 @@ export class WindowsManager implements IWindowsMainService { this.storageService ); - WindowsManager.WINDOWS.push(vscodeWindow); + WindowsManager.WINDOWS.push(codeWindow); // Window Events - vscodeWindow.win.webContents.removeAllListeners('devtools-reload-page'); // remove built in listener so we can handle this on our own - vscodeWindow.win.webContents.on('devtools-reload-page', () => this.reload(vscodeWindow)); - vscodeWindow.win.webContents.on('crashed', () => this.onWindowError(vscodeWindow, WindowError.CRASHED)); - vscodeWindow.win.on('unresponsive', () => this.onWindowError(vscodeWindow, WindowError.UNRESPONSIVE)); - vscodeWindow.win.on('closed', () => this.onWindowClosed(vscodeWindow)); + codeWindow.win.webContents.removeAllListeners('devtools-reload-page'); // remove built in listener so we can handle this on our own + codeWindow.win.webContents.on('devtools-reload-page', () => this.reload(codeWindow)); + codeWindow.win.webContents.on('crashed', () => this.onWindowError(codeWindow, WindowError.CRASHED)); + codeWindow.win.on('unresponsive', () => this.onWindowError(codeWindow, WindowError.UNRESPONSIVE)); + codeWindow.win.on('closed', () => this.onWindowClosed(codeWindow)); // Lifecycle - this.lifecycleService.registerWindow(vscodeWindow); + this.lifecycleService.registerWindow(codeWindow); } // Existing window @@ -885,7 +805,7 @@ export class WindowsManager implements IWindowsMainService { // Some configuration things get inherited if the window is being reused and we are // in extension development host mode. These options are all development related. - const currentWindowConfig = vscodeWindow.config; + const currentWindowConfig = codeWindow.config; if (!configuration.extensionDevelopmentPath && currentWindowConfig && !!currentWindowConfig.extensionDevelopmentPath) { configuration.extensionDevelopmentPath = currentWindowConfig.extensionDevelopmentPath; configuration.verbose = currentWindowConfig.verbose; @@ -896,20 +816,21 @@ export class WindowsManager implements IWindowsMainService { } // Only load when the window has not vetoed this - this.lifecycleService.unload(vscodeWindow, UnloadReason.LOAD).done(veto => { + this.lifecycleService.unload(codeWindow, UnloadReason.LOAD).done(veto => { if (!veto) { // Register window for backups if (!configuration.extensionDevelopmentPath) { - this.backupService.registerWindowForBackupsSync(vscodeWindow.id, !configuration.workspacePath, emptyWorkspaceBackupFolder, configuration.workspacePath); + const backupPath = this.backupService.registerWindowForBackupsSync(codeWindow.id, !configuration.workspacePath, options.emptyWorkspaceBackupFolder, configuration.workspacePath); + configuration.backupPath = backupPath; } // Load it - vscodeWindow.load(configuration); + codeWindow.load(configuration); } }); - return vscodeWindow; + return codeWindow; } private getNewWindowState(configuration: IWindowConfiguration): INewWindowState { @@ -921,7 +842,15 @@ export class WindowsManager implements IWindowsMainService { // Known Folder - load from stored settings if any if (configuration.workspacePath) { - const stateForWorkspace = this.windowsState.openedFolders.filter(o => isEqual(o.workspacePath, configuration.workspacePath, !platform.isLinux /* ignorecase */)).map(o => o.uiState); + const stateForWorkspace = this.windowsState.openedWindows.filter(o => isEqual(o.workspacePath, configuration.workspacePath, !isLinux /* ignorecase */)).map(o => o.uiState); + if (stateForWorkspace.length) { + return stateForWorkspace[0]; + } + } + + // Empty workspace with backups + else if (configuration.backupPath) { + const stateForWorkspace = this.windowsState.openedWindows.filter(o => o.backupPath === configuration.backupPath).map(o => o.uiState); if (stateForWorkspace.length) { return stateForWorkspace[0]; } @@ -951,7 +880,7 @@ export class WindowsManager implements IWindowsMainService { else { // on mac there is 1 menu per window so we need to use the monitor where the cursor currently is - if (platform.isMacintosh) { + if (isMacintosh) { const cursorPoint = screen.getCursorScreenPoint(); displayToUse = screen.getDisplayNearestPoint(cursorPoint); } @@ -1016,77 +945,20 @@ export class WindowsManager implements IWindowsMainService { return state; } - public openFileFolderPicker(forceNewWindow?: boolean, data?: ITelemetryData): void { - this.doPickAndOpen({ pickFolders: true, pickFiles: true, forceNewWindow }, 'openFileFolder', data); - } - - public openFilePicker(forceNewWindow?: boolean, path?: string, window?: VSCodeWindow, data?: ITelemetryData): void { - this.doPickAndOpen({ pickFiles: true, forceNewWindow, path, window }, 'openFile', data); - } - - public openFolderPicker(forceNewWindow?: boolean, window?: VSCodeWindow, data?: ITelemetryData): void { - this.doPickAndOpen({ pickFolders: true, forceNewWindow, window }, 'openFolder', data); - } - - public openAccessibilityOptions(): void { - let win = new BrowserWindow({ - alwaysOnTop: true, - skipTaskbar: true, - resizable: false, - width: 450, - height: 300, - show: true, - title: nls.localize('accessibilityOptionsWindowTitle', "Accessibility Options") - }); - - win.setMenuBarVisibility(false); + public reload(win: CodeWindow, cli?: ParsedArgs): void { - win.loadURL('chrome://accessibility'); - } - - private doPickAndOpen(options: INativeOpenDialogOptions, eventName: string, data?: ITelemetryData): void { - this.getFileOrFolderPaths(options, (paths: string[]) => { - const nOfPaths = paths ? paths.length : 0; - if (nOfPaths) { - this.open({ context: OpenContext.DIALOG, cli: this.environmentService.args, pathsToOpen: paths, forceNewWindow: options.forceNewWindow }); - } - this.telemetryService.publicLog(eventName, { - ...data, - outcome: nOfPaths ? 'success' : 'canceled', - nOfPaths - }); - }); - } - - private getFileOrFolderPaths(options: INativeOpenDialogOptions, clb: (paths: string[]) => void): void { - const workingDir = options.path || this.storageService.getItem(WindowsManager.workingDirPickerStorageKey); - const focussedWindow = options.window || this.getFocusedWindow(); - - let pickerProperties: ('openFile' | 'openDirectory' | 'multiSelections' | 'createDirectory')[]; - if (options.pickFiles && options.pickFolders) { - pickerProperties = ['multiSelections', 'openDirectory', 'openFile', 'createDirectory']; - } else { - pickerProperties = ['multiSelections', options.pickFolders ? 'openDirectory' : 'openFile', 'createDirectory']; - } - - dialog.showOpenDialog(focussedWindow && focussedWindow.win, { - defaultPath: workingDir, - properties: pickerProperties - }, paths => { - if (paths && paths.length > 0) { - - // Remember path in storage for next time - this.storageService.setItem(WindowsManager.workingDirPickerStorageKey, path.dirname(paths[0])); + // Only reload when the window has not vetoed this + this.lifecycleService.unload(win, UnloadReason.RELOAD).done(veto => { + if (!veto) { + win.reload(cli); - // Return - clb(paths); - } else { - clb(void (0)); + // Emit + this._onWindowReload.fire(win.id); } }); } - public focusLastActive(cli: ParsedArgs, context: OpenContext): VSCodeWindow { + public focusLastActive(cli: ParsedArgs, context: OpenContext): CodeWindow { const lastActive = this.getLastActiveWindow(); if (lastActive) { lastActive.focus(); @@ -1095,16 +967,14 @@ export class WindowsManager implements IWindowsMainService { } // No window - open new empty one - const res = this.open({ context, cli, forceEmpty: true }); - - return res && res[0]; + return this.open({ context, cli, forceEmpty: true })[0]; } - public getLastActiveWindow(): VSCodeWindow { + public getLastActiveWindow(): CodeWindow { return getLastActiveWindow(WindowsManager.WINDOWS); } - public findWindow(workspacePath: string, filePath?: string, extensionDevelopmentPath?: string): VSCodeWindow { + public findWindow(workspacePath: string, filePath?: string, extensionDevelopmentPath?: string): CodeWindow { if (WindowsManager.WINDOWS.length) { // Sort the last active window to the front of the array of windows to test @@ -1119,22 +989,22 @@ export class WindowsManager implements IWindowsMainService { const res = windowsToTest.filter(w => { // match on workspace - if (typeof w.openedWorkspacePath === 'string' && (isEqual(w.openedWorkspacePath, workspacePath, !platform.isLinux /* ignorecase */))) { + if (typeof w.openedWorkspacePath === 'string' && (isEqual(w.openedWorkspacePath, workspacePath, !isLinux /* ignorecase */))) { return true; } // match on file - if (typeof w.openedFilePath === 'string' && isEqual(w.openedFilePath, filePath, !platform.isLinux /* ignorecase */)) { + if (typeof w.openedFilePath === 'string' && isEqual(w.openedFilePath, filePath, !isLinux /* ignorecase */)) { return true; } // match on file path - if (typeof w.openedWorkspacePath === 'string' && filePath && isEqualOrParent(filePath, w.openedWorkspacePath, !platform.isLinux /* ignorecase */)) { + if (typeof w.openedWorkspacePath === 'string' && filePath && isEqualOrParent(filePath, w.openedWorkspacePath, !isLinux /* ignorecase */)) { return true; } // match on extension development path - if (typeof extensionDevelopmentPath === 'string' && isEqual(w.extensionDevelopmentPath, extensionDevelopmentPath, !platform.isLinux /* ignorecase */)) { + if (typeof extensionDevelopmentPath === 'string' && isEqual(w.extensionDevelopmentPath, extensionDevelopmentPath, !isLinux /* ignorecase */)) { return true; } @@ -1161,7 +1031,7 @@ export class WindowsManager implements IWindowsMainService { } } - public sendToAll(channel: string, payload: any, windowIdsToIgnore?: number[]): void { + public sendToAll(channel: string, payload?: any, windowIdsToIgnore?: number[]): void { WindowsManager.WINDOWS.forEach(w => { if (windowIdsToIgnore && windowIdsToIgnore.indexOf(w.id) >= 0) { return; // do not send if we are instructed to ignore it @@ -1171,7 +1041,7 @@ export class WindowsManager implements IWindowsMainService { }); } - public getFocusedWindow(): VSCodeWindow { + public getFocusedWindow(): CodeWindow { const win = BrowserWindow.getFocusedWindow(); if (win) { return this.getWindowById(win.id); @@ -1180,7 +1050,7 @@ export class WindowsManager implements IWindowsMainService { return null; } - public getWindowById(windowId: number): VSCodeWindow { + public getWindowById(windowId: number): CodeWindow { const res = WindowsManager.WINDOWS.filter(w => w.id === windowId); if (res && res.length === 1) { return res[0]; @@ -1189,7 +1059,7 @@ export class WindowsManager implements IWindowsMainService { return null; } - public getWindows(): VSCodeWindow[] { + public getWindows(): CodeWindow[] { return WindowsManager.WINDOWS; } @@ -1197,12 +1067,12 @@ export class WindowsManager implements IWindowsMainService { return WindowsManager.WINDOWS.length; } - private onWindowError(vscodeWindow: VSCodeWindow, error: WindowError): void { + private onWindowError(codeWindow: CodeWindow, error: WindowError): void { console.error(error === WindowError.CRASHED ? '[VS Code]: render process crashed!' : '[VS Code]: detected unresponsive'); // Unresponsive if (error === WindowError.UNRESPONSIVE) { - dialog.showMessageBox(vscodeWindow.win, { + dialog.showMessageBox(codeWindow.win, { title: product.nameLong, type: 'warning', buttons: [nls.localize('reopen', "Reopen"), nls.localize('wait', "Keep Waiting"), nls.localize('close', "Close")], @@ -1210,22 +1080,22 @@ export class WindowsManager implements IWindowsMainService { detail: nls.localize('appStalledDetail', "You can reopen or close the window or keep waiting."), noLink: true }, result => { - if (!vscodeWindow.win) { + if (!codeWindow.win) { return; // Return early if the window has been going down already } if (result === 0) { - vscodeWindow.reload(); + codeWindow.reload(); } else if (result === 2) { - this.onBeforeWindowClose(vscodeWindow); // 'close' event will not be fired on destroy(), so run it manually - vscodeWindow.win.destroy(); // make sure to destroy the window as it is unresponsive + this.onBeforeWindowClose(codeWindow); // 'close' event will not be fired on destroy(), so run it manually + codeWindow.win.destroy(); // make sure to destroy the window as it is unresponsive } }); } // Crashed else { - dialog.showMessageBox(vscodeWindow.win, { + dialog.showMessageBox(codeWindow.win, { title: product.nameLong, type: 'warning', buttons: [nls.localize('reopen', "Reopen"), nls.localize('close', "Close")], @@ -1233,21 +1103,21 @@ export class WindowsManager implements IWindowsMainService { detail: nls.localize('appCrashedDetail', "We are sorry for the inconvenience! You can reopen the window to continue where you left off."), noLink: true }, result => { - if (!vscodeWindow.win) { + if (!codeWindow.win) { return; // Return early if the window has been going down already } if (result === 0) { - vscodeWindow.reload(); + codeWindow.reload(); } else if (result === 1) { - this.onBeforeWindowClose(vscodeWindow); // 'close' event will not be fired on destroy(), so run it manually - vscodeWindow.win.destroy(); // make sure to destroy the window as it has crashed + this.onBeforeWindowClose(codeWindow); // 'close' event will not be fired on destroy(), so run it manually + codeWindow.win.destroy(); // make sure to destroy the window as it has crashed } }); } } - private onWindowClosed(win: VSCodeWindow): void { + private onWindowClosed(win: CodeWindow): void { // Tell window win.dispose(); @@ -1260,75 +1130,33 @@ export class WindowsManager implements IWindowsMainService { this._onWindowClose.fire(win.id); } - public updateWindowsJumpList(): void { - if (!platform.isWindows) { - return; // only on windows - } + public pickFileFolderAndOpen(forceNewWindow?: boolean, data?: ITelemetryData): void { + this.fileDialog.pickAndOpen({ pickFolders: true, pickFiles: true, forceNewWindow }, 'openFileFolder', data); + } - const jumpList: Electron.JumpListCategory[] = []; - - // Tasks - jumpList.push({ - type: 'tasks', - items: [ - { - type: 'task', - title: nls.localize('newWindow', "New Window"), - description: nls.localize('newWindowDesc', "Opens a new window"), - program: process.execPath, - args: '-n', // force new window - iconPath: process.execPath, - iconIndex: 0 - } - ] - }); + public pickFileAndOpen(forceNewWindow?: boolean, path?: string, window?: CodeWindow, data?: ITelemetryData): void { + this.fileDialog.pickAndOpen({ pickFiles: true, forceNewWindow, path, window, title: nls.localize('openFile', "Open File") }, 'openFile', data); + } - // Recent Folders - if (this.getRecentPathsList().folders.length > 0) { - - // The user might have meanwhile removed items from the jump list and we have to respect that - // so we need to update our list of recent paths with the choice of the user to not add them again - // Also: Windows will not show our custom category at all if there is any entry which was removed - // by the user! See https://github.com/Microsoft/vscode/issues/15052 - this.removeFromRecentPathsList(app.getJumpListSettings().removedItems.map(r => trim(r.args, '"'))); - - // Add entries - jumpList.push({ - type: 'custom', - name: nls.localize('recentFolders', "Recent Folders"), - items: this.getRecentPathsList().folders.slice(0, 7 /* limit number of entries here */).map(folder => { - return { - type: 'task', - title: path.basename(folder) || folder, // use the base name to show shorter entries in the list - description: nls.localize('folderDesc', "{0} {1}", path.basename(folder), getPathLabel(path.dirname(folder))), - program: process.execPath, - args: `"${folder}"`, // open folder (use quotes to support paths with whitespaces) - iconPath: 'explorer.exe', // simulate folder icon - iconIndex: 0 - }; - }).filter(i => !!i) - }); - } + public pickFolderAndOpen(forceNewWindow?: boolean, window?: CodeWindow, data?: ITelemetryData): void { + this.fileDialog.pickAndOpen({ pickFolders: true, forceNewWindow, window, title: nls.localize('openFolder', "Open Folder") }, 'openFolder', data); + } - // Recent - jumpList.push({ - type: 'recent' // this enables to show files in the "recent" category + public pickFolder(options?: { buttonLabel: string; title: string; }): TPromise { + return new TPromise((c, e) => { + this.fileDialog.getFileOrFolderPaths({ pickFolders: true, buttonLabel: options && options.buttonLabel }, folders => { + c(folders || []); + }); }); - - try { - app.setJumpList(jumpList); - } catch (error) { - this.logService.log('#setJumpList', error); // since setJumpList is relatively new API, make sure to guard for errors - } } public quit(): void { // If the user selected to exit from an extension development host window, do not quit, but just // close the window unless this is the last window that is opened. - const vscodeWindow = this.getFocusedWindow(); - if (vscodeWindow && vscodeWindow.isExtensionDevelopmentHost && this.getWindowCount() > 1) { - vscodeWindow.win.close(); + const codeWindow = this.getFocusedWindow(); + if (codeWindow && codeWindow.isExtensionDevelopmentHost && this.getWindowCount() > 1) { + codeWindow.win.close(); } // Otherwise: normal quit @@ -1340,61 +1168,69 @@ export class WindowsManager implements IWindowsMainService { } } -class KeyboardLayoutMonitor { +interface INativeOpenDialogOptions { + title?: string; + pickFolders?: boolean; + pickFiles?: boolean; + path?: string; + forceNewWindow?: boolean; + window?: CodeWindow; + buttonLabel?: string; +} - public static INSTANCE = new KeyboardLayoutMonitor(); +class FileDialog { - private _emitter: Emitter; - private _registered: boolean; - private _isISOKeyboard: boolean; + private static workingDirPickerStorageKey = 'pickerWorkingDir'; - private constructor() { - this._emitter = new Emitter(); - this._registered = false; - this._isISOKeyboard = this._readIsISOKeyboard(); + constructor( + private environmentService: IEnvironmentService, + private telemetryService: ITelemetryService, + private storageService: IStorageService, + private windowsMainService: IWindowsMainService + ) { } - public onDidChangeKeyboardLayout(callback: (isISOKeyboard: boolean) => void): IDisposable { - if (!this._registered) { - this._registered = true; - - nativeKeymap.onDidChangeKeyboardLayout(() => { - this._emitter.fire(this._isISOKeyboard); + public pickAndOpen(options: INativeOpenDialogOptions, eventName: string, data?: ITelemetryData): void { + this.getFileOrFolderPaths(options, (paths: string[]) => { + const nOfPaths = paths ? paths.length : 0; + if (nOfPaths) { + this.windowsMainService.open({ context: OpenContext.DIALOG, cli: this.environmentService.args, pathsToOpen: paths, forceNewWindow: options.forceNewWindow }); + } + this.telemetryService.publicLog(eventName, { + ...data, + outcome: nOfPaths ? 'success' : 'canceled', + nOfPaths }); + }); + } - if (platform.isMacintosh) { - // See https://github.com/Microsoft/vscode/issues/24153 - // On OSX, on ISO keyboards, Chromium swaps the scan codes - // of IntlBackslash and Backquote. - // - // The C++ methods can give the current keyboard type (ISO or not) - // only after a NSEvent was handled. - // - // We therefore poll. - setInterval(() => { - let newValue = this._readIsISOKeyboard(); - if (this._isISOKeyboard === newValue) { - // no change - return; - } - - this._isISOKeyboard = newValue; - this._emitter.fire(this._isISOKeyboard); + public getFileOrFolderPaths(options: INativeOpenDialogOptions, clb: (paths: string[]) => void): void { + const workingDir = options.path || this.storageService.getItem(FileDialog.workingDirPickerStorageKey); + const focussedWindow = options.window || this.windowsMainService.getFocusedWindow(); - }, 3000); - } + let pickerProperties: ('openFile' | 'openDirectory' | 'multiSelections' | 'createDirectory')[]; + if (options.pickFiles && options.pickFolders) { + pickerProperties = ['multiSelections', 'openDirectory', 'openFile', 'createDirectory']; + } else { + pickerProperties = ['multiSelections', options.pickFolders ? 'openDirectory' : 'openFile', 'createDirectory']; } - return this._emitter.event(callback); - } - private _readIsISOKeyboard(): boolean { - if (platform.isMacintosh) { - return nativeKeymap.isISOKeyboard(); - } - return false; - } + dialog.showOpenDialog(focussedWindow && focussedWindow.win, { + title: options && options.title ? options.title : void 0, + defaultPath: workingDir, + properties: pickerProperties, + buttonLabel: options && options.buttonLabel ? options.buttonLabel : void 0 + }, paths => { + if (paths && paths.length > 0) { + + // Remember path in storage for next time + this.storageService.setItem(FileDialog.workingDirPickerStorageKey, path.dirname(paths[0])); - public isISOKeyboard(): boolean { - return this._isISOKeyboard; + // Return + clb(paths); + } else { + clb(void (0)); + } + }); } -} +} \ No newline at end of file diff --git a/src/vs/code/electron-main/paths.ts b/src/vs/code/node/paths.ts similarity index 97% rename from src/vs/code/electron-main/paths.ts rename to src/vs/code/node/paths.ts index 8ad9d195910314fe50da7ef8e25ee567acedd521..1436632f935f989be034be0348e25ff1f1a68060 100644 --- a/src/vs/code/electron-main/paths.ts +++ b/src/vs/code/node/paths.ts @@ -5,7 +5,6 @@ 'use strict'; -import * as fs from 'original-fs'; import * as path from 'path'; import * as arrays from 'vs/base/common/arrays'; import * as strings from 'vs/base/common/strings'; @@ -13,6 +12,7 @@ import * as paths from 'vs/base/common/paths'; import * as platform from 'vs/base/common/platform'; import * as types from 'vs/base/common/types'; import { ParsedArgs } from 'vs/platform/environment/common/environment'; +import { realpathSync } from "vs/base/node/extfs"; export function validatePaths(args: ParsedArgs): ParsedArgs { @@ -43,7 +43,7 @@ function doValidatePaths(args: string[], gotoLineMode?: boolean): string[] { let realPath: string; try { - realPath = fs.realpathSync(pathCandidate); + realPath = realpathSync(pathCandidate); } catch (error) { // in case of an error, assume the user wants to create this file // if the path is relative, we join it to the cwd diff --git a/src/vs/code/electron-main/shellEnv.ts b/src/vs/code/node/shellEnv.ts similarity index 100% rename from src/vs/code/electron-main/shellEnv.ts rename to src/vs/code/node/shellEnv.ts index 2afa773a34138da13f4078aba25541f08a13417d..92c146fefaeef1576a3d4cf465939108862b026e 100644 --- a/src/vs/code/electron-main/shellEnv.ts +++ b/src/vs/code/node/shellEnv.ts @@ -11,7 +11,6 @@ import { generateUuid } from 'vs/base/common/uuid'; import { TPromise } from 'vs/base/common/winjs.base'; import { isWindows } from 'vs/base/common/platform'; - function getUnixShellEnvironment(): TPromise { const promise = new TPromise((c, e) => { const runAsNode = process.env['ELECTRON_RUN_AS_NODE']; @@ -88,5 +87,6 @@ export function getShellEnvironment(): TPromise { _shellEnv = getUnixShellEnvironment(); } } + return _shellEnv; } diff --git a/src/vs/code/node/windowsUtils.ts b/src/vs/code/node/windowsUtils.ts index 31a4f00b3541774c8314822971ced2eaeba73ef0..0727611a543839e2847ae20ffd4b115e2198e480 100644 --- a/src/vs/code/node/windowsUtils.ts +++ b/src/vs/code/node/windowsUtils.ts @@ -9,11 +9,10 @@ import * as path from 'path'; import * as fs from 'fs'; import * as platform from 'vs/base/common/platform'; import * as paths from 'vs/base/common/paths'; -import { OpenContext } from 'vs/code/common/windows'; -import { isEqualOrParent } from 'vs/platform/files/common/files'; +import { OpenContext } from 'vs/platform/windows/common/windows'; /** - * Exported subset of VSCodeWindow for testing. + * Exported subset of CodeWindow for testing. */ export interface ISimpleWindow { openedWorkspacePath: string; @@ -43,14 +42,16 @@ export function findBestWindowOrFolder({ win } else if (bestFolder) { return bestFolder; } + return !newWindow ? getLastActiveWindow(windows) : null; } function findBestWindow(windows: WINDOW[], filePath: string): WINDOW { - const containers = windows.filter(window => typeof window.openedWorkspacePath === 'string' && isEqualOrParent(filePath, window.openedWorkspacePath, !platform.isLinux /* ignorecase */)); + const containers = windows.filter(window => typeof window.openedWorkspacePath === 'string' && paths.isEqualOrParent(filePath, window.openedWorkspacePath, !platform.isLinux /* ignorecase */)); if (containers.length) { return containers.sort((a, b) => -(a.openedWorkspacePath.length - b.openedWorkspacePath.length))[0]; } + return null; } @@ -60,6 +61,7 @@ function findBestFolder(filePath: string, userHome?: string, vscodeFolder?: stri if (!platform.isLinux) { homeFolder = homeFolder && homeFolder.toLowerCase(); } + let previous = null; try { while (folder !== previous) { @@ -72,22 +74,23 @@ function findBestFolder(filePath: string, userHome?: string, vscodeFolder?: stri } catch (err) { // assume impossible to access } + return null; } function isProjectFolder(folder: string, normalizedUserHome?: string, vscodeFolder = '.vscode') { try { if ((platform.isLinux ? folder : folder.toLowerCase()) === normalizedUserHome) { - // ~/.vscode/extensions is used for extensions - return fs.statSync(path.join(folder, vscodeFolder, 'settings.json')).isFile(); - } else { - return fs.statSync(path.join(folder, vscodeFolder)).isDirectory(); + return fs.statSync(path.join(folder, vscodeFolder, 'settings.json')).isFile(); // ~/.vscode/extensions is used for extensions } + + return fs.statSync(path.join(folder, vscodeFolder)).isDirectory(); } catch (err) { if (!(err && err.code === 'ENOENT')) { throw err; } } + return false; } diff --git a/src/vs/code/test/node/windowsUtils.test.ts b/src/vs/code/test/node/windowsUtils.test.ts index 42649abda76c98c862c31a31d342748409a28531..026ce3040d1edf6948e31839cc9f59c319326a2e 100644 --- a/src/vs/code/test/node/windowsUtils.test.ts +++ b/src/vs/code/test/node/windowsUtils.test.ts @@ -7,7 +7,7 @@ import assert = require('assert'); import path = require('path'); import { findBestWindowOrFolder, ISimpleWindow, IBestWindowOrFolderOptions } from 'vs/code/node/windowsUtils'; -import { OpenContext } from 'vs/code/common/windows'; +import { OpenContext } from 'vs/platform/windows/common/windows'; const fixturesFolder = require.toUrl('./fixtures'); diff --git a/src/vs/css.build.js b/src/vs/css.build.js new file mode 100644 index 0000000000000000000000000000000000000000..7f34c9b158a5321c8247a024c14058dd254eac23 --- /dev/null +++ b/src/vs/css.build.js @@ -0,0 +1,362 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +/*--------------------------------------------------------------------------------------------- + *--------------------------------------------------------------------------------------------- + *--------------------------------------------------------------------------------------------- + *--------------------------------------------------------------------------------------------- + *--------------------------------------------------------------------------------------------- + * Please make sure to make edits in the .ts file at https://github.com/Microsoft/vscode-loader/ + *--------------------------------------------------------------------------------------------- + *--------------------------------------------------------------------------------------------- + *--------------------------------------------------------------------------------------------- + *--------------------------------------------------------------------------------------------- + *--------------------------------------------------------------------------------------------*/ +'use strict'; +var _cssPluginGlobal = this; +var CSSBuildLoaderPlugin; +(function (CSSBuildLoaderPlugin) { + var global = _cssPluginGlobal || {}; + /** + * Known issue: + * - In IE there is no way to know if the CSS file loaded successfully or not. + */ + var BrowserCSSLoader = (function () { + function BrowserCSSLoader() { + this._pendingLoads = 0; + } + BrowserCSSLoader.prototype.attachListeners = function (name, linkNode, callback, errorback) { + var unbind = function () { + linkNode.removeEventListener('load', loadEventListener); + linkNode.removeEventListener('error', errorEventListener); + }; + var loadEventListener = function (e) { + unbind(); + callback(); + }; + var errorEventListener = function (e) { + unbind(); + errorback(e); + }; + linkNode.addEventListener('load', loadEventListener); + linkNode.addEventListener('error', errorEventListener); + }; + BrowserCSSLoader.prototype._onLoad = function (name, callback) { + this._pendingLoads--; + callback(); + }; + BrowserCSSLoader.prototype._onLoadError = function (name, errorback, err) { + this._pendingLoads--; + errorback(err); + }; + BrowserCSSLoader.prototype._insertLinkNode = function (linkNode) { + this._pendingLoads++; + var head = document.head || document.getElementsByTagName('head')[0]; + var other = head.getElementsByTagName('link') || document.head.getElementsByTagName('script'); + if (other.length > 0) { + head.insertBefore(linkNode, other[other.length - 1]); + } + else { + head.appendChild(linkNode); + } + }; + BrowserCSSLoader.prototype.createLinkTag = function (name, cssUrl, externalCallback, externalErrorback) { + var _this = this; + var linkNode = document.createElement('link'); + linkNode.setAttribute('rel', 'stylesheet'); + linkNode.setAttribute('type', 'text/css'); + linkNode.setAttribute('data-name', name); + var callback = function () { return _this._onLoad(name, externalCallback); }; + var errorback = function (err) { return _this._onLoadError(name, externalErrorback, err); }; + this.attachListeners(name, linkNode, callback, errorback); + linkNode.setAttribute('href', cssUrl); + return linkNode; + }; + BrowserCSSLoader.prototype._linkTagExists = function (name, cssUrl) { + var i, len, nameAttr, hrefAttr, links = document.getElementsByTagName('link'); + for (i = 0, len = links.length; i < len; i++) { + nameAttr = links[i].getAttribute('data-name'); + hrefAttr = links[i].getAttribute('href'); + if (nameAttr === name || hrefAttr === cssUrl) { + return true; + } + } + return false; + }; + BrowserCSSLoader.prototype.load = function (name, cssUrl, externalCallback, externalErrorback) { + if (this._linkTagExists(name, cssUrl)) { + externalCallback(); + return; + } + var linkNode = this.createLinkTag(name, cssUrl, externalCallback, externalErrorback); + this._insertLinkNode(linkNode); + }; + return BrowserCSSLoader; + }()); + var NodeCSSLoader = (function () { + function NodeCSSLoader() { + this.fs = require.nodeRequire('fs'); + } + NodeCSSLoader.prototype.load = function (name, cssUrl, externalCallback, externalErrorback) { + var contents = this.fs.readFileSync(cssUrl, 'utf8'); + // Remove BOM + if (contents.charCodeAt(0) === NodeCSSLoader.BOM_CHAR_CODE) { + contents = contents.substring(1); + } + externalCallback(contents); + }; + return NodeCSSLoader; + }()); + NodeCSSLoader.BOM_CHAR_CODE = 65279; + // ------------------------------ Finally, the plugin + var CSSPlugin = (function () { + function CSSPlugin(cssLoader) { + this.cssLoader = cssLoader; + } + CSSPlugin.prototype.load = function (name, req, load, config) { + config = config || {}; + var myConfig = config['vs/css'] || {}; + global.inlineResources = myConfig.inlineResources; + global.inlineResourcesLimit = myConfig.inlineResourcesLimit || 5000; + var cssUrl = req.toUrl(name + '.css'); + this.cssLoader.load(name, cssUrl, function (contents) { + // Contents has the CSS file contents if we are in a build + if (config.isBuild) { + CSSPlugin.BUILD_MAP[name] = contents; + CSSPlugin.BUILD_PATH_MAP[name] = cssUrl; + } + load({}); + }, function (err) { + if (typeof load.error === 'function') { + load.error('Could not find ' + cssUrl + ' or it was empty'); + } + }); + }; + CSSPlugin.prototype.write = function (pluginName, moduleName, write) { + // getEntryPoint is a Monaco extension to r.js + var entryPoint = write.getEntryPoint(); + // r.js destroys the context of this plugin between calling 'write' and 'writeFile' + // so the only option at this point is to leak the data to a global + global.cssPluginEntryPoints = global.cssPluginEntryPoints || {}; + global.cssPluginEntryPoints[entryPoint] = global.cssPluginEntryPoints[entryPoint] || []; + global.cssPluginEntryPoints[entryPoint].push({ + moduleName: moduleName, + contents: CSSPlugin.BUILD_MAP[moduleName], + fsPath: CSSPlugin.BUILD_PATH_MAP[moduleName], + }); + write.asModule(pluginName + '!' + moduleName, 'define([\'vs/css!' + entryPoint + '\'], {});'); + }; + CSSPlugin.prototype.writeFile = function (pluginName, moduleName, req, write, config) { + if (global.cssPluginEntryPoints && global.cssPluginEntryPoints.hasOwnProperty(moduleName)) { + var fileName = req.toUrl(moduleName + '.css'); + var contents = [ + '/*---------------------------------------------------------', + ' * Copyright (c) Microsoft Corporation. All rights reserved.', + ' *--------------------------------------------------------*/' + ], entries = global.cssPluginEntryPoints[moduleName]; + for (var i = 0; i < entries.length; i++) { + if (global.inlineResources) { + contents.push(Utilities.rewriteOrInlineUrls(entries[i].fsPath, entries[i].moduleName, moduleName, entries[i].contents, global.inlineResources === 'base64', global.inlineResourcesLimit)); + } + else { + contents.push(Utilities.rewriteUrls(entries[i].moduleName, moduleName, entries[i].contents)); + } + } + write(fileName, contents.join('\r\n')); + } + }; + CSSPlugin.prototype.getInlinedResources = function () { + return global.cssInlinedResources || []; + }; + return CSSPlugin; + }()); + CSSPlugin.BUILD_MAP = {}; + CSSPlugin.BUILD_PATH_MAP = {}; + CSSBuildLoaderPlugin.CSSPlugin = CSSPlugin; + var Utilities = (function () { + function Utilities() { + } + Utilities.startsWith = function (haystack, needle) { + return haystack.length >= needle.length && haystack.substr(0, needle.length) === needle; + }; + /** + * Find the path of a file. + */ + Utilities.pathOf = function (filename) { + var lastSlash = filename.lastIndexOf('/'); + if (lastSlash !== -1) { + return filename.substr(0, lastSlash + 1); + } + else { + return ''; + } + }; + /** + * A conceptual a + b for paths. + * Takes into account if `a` contains a protocol. + * Also normalizes the result: e.g.: a/b/ + ../c => a/c + */ + Utilities.joinPaths = function (a, b) { + function findSlashIndexAfterPrefix(haystack, prefix) { + if (Utilities.startsWith(haystack, prefix)) { + return Math.max(prefix.length, haystack.indexOf('/', prefix.length)); + } + return 0; + } + var aPathStartIndex = 0; + aPathStartIndex = aPathStartIndex || findSlashIndexAfterPrefix(a, '//'); + aPathStartIndex = aPathStartIndex || findSlashIndexAfterPrefix(a, 'http://'); + aPathStartIndex = aPathStartIndex || findSlashIndexAfterPrefix(a, 'https://'); + function pushPiece(pieces, piece) { + if (piece === './') { + // Ignore + return; + } + if (piece === '../') { + var prevPiece = (pieces.length > 0 ? pieces[pieces.length - 1] : null); + if (prevPiece && prevPiece === '/') { + // Ignore + return; + } + if (prevPiece && prevPiece !== '../') { + // Pop + pieces.pop(); + return; + } + } + // Push + pieces.push(piece); + } + function push(pieces, path) { + while (path.length > 0) { + var slashIndex = path.indexOf('/'); + var piece = (slashIndex >= 0 ? path.substring(0, slashIndex + 1) : path); + path = (slashIndex >= 0 ? path.substring(slashIndex + 1) : ''); + pushPiece(pieces, piece); + } + } + var pieces = []; + push(pieces, a.substr(aPathStartIndex)); + if (b.length > 0 && b.charAt(0) === '/') { + pieces = []; + } + push(pieces, b); + return a.substring(0, aPathStartIndex) + pieces.join(''); + }; + Utilities.commonPrefix = function (str1, str2) { + var len = Math.min(str1.length, str2.length); + for (var i = 0; i < len; i++) { + if (str1.charCodeAt(i) !== str2.charCodeAt(i)) { + break; + } + } + return str1.substring(0, i); + }; + Utilities.commonFolderPrefix = function (fromPath, toPath) { + var prefix = Utilities.commonPrefix(fromPath, toPath); + var slashIndex = prefix.lastIndexOf('/'); + if (slashIndex === -1) { + return ''; + } + return prefix.substring(0, slashIndex + 1); + }; + Utilities.relativePath = function (fromPath, toPath) { + if (Utilities.startsWith(toPath, '/') || Utilities.startsWith(toPath, 'http://') || Utilities.startsWith(toPath, 'https://')) { + return toPath; + } + // Ignore common folder prefix + var prefix = Utilities.commonFolderPrefix(fromPath, toPath); + fromPath = fromPath.substr(prefix.length); + toPath = toPath.substr(prefix.length); + var upCount = fromPath.split('/').length; + var result = ''; + for (var i = 1; i < upCount; i++) { + result += '../'; + } + return result + toPath; + }; + Utilities._replaceURL = function (contents, replacer) { + // Use ")" as the terminator as quotes are oftentimes not used at all + return contents.replace(/url\(\s*([^\)]+)\s*\)?/g, function (_) { + var matches = []; + for (var _i = 1; _i < arguments.length; _i++) { + matches[_i - 1] = arguments[_i]; + } + var url = matches[0]; + // Eliminate starting quotes (the initial whitespace is not captured) + if (url.charAt(0) === '"' || url.charAt(0) === '\'') { + url = url.substring(1); + } + // The ending whitespace is captured + while (url.length > 0 && (url.charAt(url.length - 1) === ' ' || url.charAt(url.length - 1) === '\t')) { + url = url.substring(0, url.length - 1); + } + // Eliminate ending quotes + if (url.charAt(url.length - 1) === '"' || url.charAt(url.length - 1) === '\'') { + url = url.substring(0, url.length - 1); + } + if (!Utilities.startsWith(url, 'data:') && !Utilities.startsWith(url, 'http://') && !Utilities.startsWith(url, 'https://')) { + url = replacer(url); + } + return 'url(' + url + ')'; + }); + }; + Utilities.rewriteUrls = function (originalFile, newFile, contents) { + return this._replaceURL(contents, function (url) { + var absoluteUrl = Utilities.joinPaths(Utilities.pathOf(originalFile), url); + return Utilities.relativePath(newFile, absoluteUrl); + }); + }; + Utilities.rewriteOrInlineUrls = function (originalFileFSPath, originalFile, newFile, contents, forceBase64, inlineByteLimit) { + var fs = require.nodeRequire('fs'); + var path = require.nodeRequire('path'); + return this._replaceURL(contents, function (url) { + if (/\.(svg|png)$/.test(url)) { + var fsPath = path.join(path.dirname(originalFileFSPath), url); + var fileContents = fs.readFileSync(fsPath); + if (fileContents.length < inlineByteLimit) { + global.cssInlinedResources = global.cssInlinedResources || []; + var normalizedFSPath = fsPath.replace(/\\/g, '/'); + if (global.cssInlinedResources.indexOf(normalizedFSPath) >= 0) { + console.warn('CSS INLINING IMAGE AT ' + fsPath + ' MORE THAN ONCE. CONSIDER CONSOLIDATING CSS RULES'); + } + global.cssInlinedResources.push(normalizedFSPath); + var MIME = /\.svg$/.test(url) ? 'image/svg+xml' : 'image/png'; + var DATA = ';base64,' + fileContents.toString('base64'); + if (!forceBase64 && /\.svg$/.test(url)) { + // .svg => url encode as explained at https://codepen.io/tigt/post/optimizing-svgs-in-data-uris + var newText = fileContents.toString() + .replace(/"/g, '\'') + .replace(//g, '%3E') + .replace(/&/g, '%26') + .replace(/#/g, '%23') + .replace(/\s+/g, ' '); + var encodedData = ',' + newText; + if (encodedData.length < DATA.length) { + DATA = encodedData; + } + } + return '"data:' + MIME + DATA + '"'; + } + } + var absoluteUrl = Utilities.joinPaths(Utilities.pathOf(originalFile), url); + return Utilities.relativePath(newFile, absoluteUrl); + }); + }; + return Utilities; + }()); + CSSBuildLoaderPlugin.Utilities = Utilities; + (function () { + var cssLoader = null; + var isElectron = (typeof process !== 'undefined' && typeof process.versions !== 'undefined' && typeof process.versions['electron'] !== 'undefined'); + if (typeof process !== 'undefined' && process.versions && !!process.versions.node && !isElectron) { + cssLoader = new NodeCSSLoader(); + } + else { + cssLoader = new BrowserCSSLoader(); + } + define('vs/css', new CSSPlugin(cssLoader)); + })(); +})(CSSBuildLoaderPlugin || (CSSBuildLoaderPlugin = {})); diff --git a/src/vs/css.js b/src/vs/css.js index d99cc032932413760fa29421e8c18d17357ed9f6..ae281dacb7bbf3c47003063331a0e6c9bf5f95ec 100644 --- a/src/vs/css.js +++ b/src/vs/css.js @@ -14,10 +14,8 @@ *--------------------------------------------------------------------------------------------- *--------------------------------------------------------------------------------------------*/ 'use strict'; -var _cssPluginGlobal = this; var CSSLoaderPlugin; (function (CSSLoaderPlugin) { - var global = _cssPluginGlobal || {}; /** * Known issue: * - In IE there is no way to know if the CSS file loaded successfully or not. @@ -94,38 +92,14 @@ var CSSLoaderPlugin; }; return BrowserCSSLoader; }()); - var NodeCSSLoader = (function () { - function NodeCSSLoader() { - this.fs = require.nodeRequire('fs'); - } - NodeCSSLoader.prototype.load = function (name, cssUrl, externalCallback, externalErrorback) { - var contents = this.fs.readFileSync(cssUrl, 'utf8'); - // Remove BOM - if (contents.charCodeAt(0) === NodeCSSLoader.BOM_CHAR_CODE) { - contents = contents.substring(1); - } - externalCallback(contents); - }; - return NodeCSSLoader; - }()); - NodeCSSLoader.BOM_CHAR_CODE = 65279; // ------------------------------ Finally, the plugin var CSSPlugin = (function () { - function CSSPlugin(cssLoader) { - this.cssLoader = cssLoader; + function CSSPlugin() { + this._cssLoader = new BrowserCSSLoader(); } - CSSPlugin.prototype.load = function (name, req, load, config) { - config = config || {}; - var myConfig = config['vs/css'] || {}; - global.inlineResources = myConfig.inlineResources; - global.inlineResourcesLimit = myConfig.inlineResourcesLimit || 5000; + CSSPlugin.prototype.load = function (name, req, load) { var cssUrl = req.toUrl(name + '.css'); - this.cssLoader.load(name, cssUrl, function (contents) { - // Contents has the CSS file contents if we are in a build - if (config.isBuild) { - CSSPlugin.BUILD_MAP[name] = contents; - CSSPlugin.BUILD_PATH_MAP[name] = cssUrl; - } + this._cssLoader.load(name, cssUrl, function (contents) { load({}); }, function (err) { if (typeof load.error === 'function') { @@ -133,230 +107,15 @@ var CSSLoaderPlugin; } }); }; - CSSPlugin.prototype.write = function (pluginName, moduleName, write) { - // getEntryPoint is a Monaco extension to r.js - var entryPoint = write.getEntryPoint(); - // r.js destroys the context of this plugin between calling 'write' and 'writeFile' - // so the only option at this point is to leak the data to a global - global.cssPluginEntryPoints = global.cssPluginEntryPoints || {}; - global.cssPluginEntryPoints[entryPoint] = global.cssPluginEntryPoints[entryPoint] || []; - global.cssPluginEntryPoints[entryPoint].push({ - moduleName: moduleName, - contents: CSSPlugin.BUILD_MAP[moduleName], - fsPath: CSSPlugin.BUILD_PATH_MAP[moduleName], - }); - write.asModule(pluginName + '!' + moduleName, 'define([\'vs/css!' + entryPoint + '\'], {});'); - }; - CSSPlugin.prototype.writeFile = function (pluginName, moduleName, req, write, config) { - if (global.cssPluginEntryPoints && global.cssPluginEntryPoints.hasOwnProperty(moduleName)) { - var fileName = req.toUrl(moduleName + '.css'); - var contents = [ - '/*---------------------------------------------------------', - ' * Copyright (c) Microsoft Corporation. All rights reserved.', - ' *--------------------------------------------------------*/' - ], entries = global.cssPluginEntryPoints[moduleName]; - for (var i = 0; i < entries.length; i++) { - if (global.inlineResources) { - contents.push(Utilities.rewriteOrInlineUrls(entries[i].fsPath, entries[i].moduleName, moduleName, entries[i].contents, global.inlineResources === 'base64', global.inlineResourcesLimit)); - } - else { - contents.push(Utilities.rewriteUrls(entries[i].moduleName, moduleName, entries[i].contents)); - } - } - write(fileName, contents.join('\r\n')); - } - }; - CSSPlugin.prototype.getInlinedResources = function () { - return global.cssInlinedResources || []; - }; return CSSPlugin; }()); - CSSPlugin.BUILD_MAP = {}; - CSSPlugin.BUILD_PATH_MAP = {}; CSSLoaderPlugin.CSSPlugin = CSSPlugin; - var Utilities = (function () { - function Utilities() { - } - Utilities.startsWith = function (haystack, needle) { - return haystack.length >= needle.length && haystack.substr(0, needle.length) === needle; - }; - /** - * Find the path of a file. - */ - Utilities.pathOf = function (filename) { - var lastSlash = filename.lastIndexOf('/'); - if (lastSlash !== -1) { - return filename.substr(0, lastSlash + 1); - } - else { - return ''; - } - }; - /** - * A conceptual a + b for paths. - * Takes into account if `a` contains a protocol. - * Also normalizes the result: e.g.: a/b/ + ../c => a/c - */ - Utilities.joinPaths = function (a, b) { - function findSlashIndexAfterPrefix(haystack, prefix) { - if (Utilities.startsWith(haystack, prefix)) { - return Math.max(prefix.length, haystack.indexOf('/', prefix.length)); - } - return 0; - } - var aPathStartIndex = 0; - aPathStartIndex = aPathStartIndex || findSlashIndexAfterPrefix(a, '//'); - aPathStartIndex = aPathStartIndex || findSlashIndexAfterPrefix(a, 'http://'); - aPathStartIndex = aPathStartIndex || findSlashIndexAfterPrefix(a, 'https://'); - function pushPiece(pieces, piece) { - if (piece === './') { - // Ignore - return; - } - if (piece === '../') { - var prevPiece = (pieces.length > 0 ? pieces[pieces.length - 1] : null); - if (prevPiece && prevPiece === '/') { - // Ignore - return; - } - if (prevPiece && prevPiece !== '../') { - // Pop - pieces.pop(); - return; - } - } - // Push - pieces.push(piece); - } - function push(pieces, path) { - while (path.length > 0) { - var slashIndex = path.indexOf('/'); - var piece = (slashIndex >= 0 ? path.substring(0, slashIndex + 1) : path); - path = (slashIndex >= 0 ? path.substring(slashIndex + 1) : ''); - pushPiece(pieces, piece); - } - } - var pieces = []; - push(pieces, a.substr(aPathStartIndex)); - if (b.length > 0 && b.charAt(0) === '/') { - pieces = []; - } - push(pieces, b); - return a.substring(0, aPathStartIndex) + pieces.join(''); - }; - Utilities.commonPrefix = function (str1, str2) { - var len = Math.min(str1.length, str2.length); - for (var i = 0; i < len; i++) { - if (str1.charCodeAt(i) !== str2.charCodeAt(i)) { - break; - } - } - return str1.substring(0, i); - }; - Utilities.commonFolderPrefix = function (fromPath, toPath) { - var prefix = Utilities.commonPrefix(fromPath, toPath); - var slashIndex = prefix.lastIndexOf('/'); - if (slashIndex === -1) { - return ''; - } - return prefix.substring(0, slashIndex + 1); - }; - Utilities.relativePath = function (fromPath, toPath) { - if (Utilities.startsWith(toPath, '/') || Utilities.startsWith(toPath, 'http://') || Utilities.startsWith(toPath, 'https://')) { - return toPath; - } - // Ignore common folder prefix - var prefix = Utilities.commonFolderPrefix(fromPath, toPath); - fromPath = fromPath.substr(prefix.length); - toPath = toPath.substr(prefix.length); - var upCount = fromPath.split('/').length; - var result = ''; - for (var i = 1; i < upCount; i++) { - result += '../'; - } - return result + toPath; - }; - Utilities._replaceURL = function (contents, replacer) { - // Use ")" as the terminator as quotes are oftentimes not used at all - return contents.replace(/url\(\s*([^\)]+)\s*\)?/g, function (_) { - var matches = []; - for (var _i = 1; _i < arguments.length; _i++) { - matches[_i - 1] = arguments[_i]; - } - var url = matches[0]; - // Eliminate starting quotes (the initial whitespace is not captured) - if (url.charAt(0) === '"' || url.charAt(0) === '\'') { - url = url.substring(1); - } - // The ending whitespace is captured - while (url.length > 0 && (url.charAt(url.length - 1) === ' ' || url.charAt(url.length - 1) === '\t')) { - url = url.substring(0, url.length - 1); - } - // Eliminate ending quotes - if (url.charAt(url.length - 1) === '"' || url.charAt(url.length - 1) === '\'') { - url = url.substring(0, url.length - 1); - } - if (!Utilities.startsWith(url, 'data:') && !Utilities.startsWith(url, 'http://') && !Utilities.startsWith(url, 'https://')) { - url = replacer(url); - } - return 'url(' + url + ')'; - }); - }; - Utilities.rewriteUrls = function (originalFile, newFile, contents) { - return this._replaceURL(contents, function (url) { - var absoluteUrl = Utilities.joinPaths(Utilities.pathOf(originalFile), url); - return Utilities.relativePath(newFile, absoluteUrl); - }); - }; - Utilities.rewriteOrInlineUrls = function (originalFileFSPath, originalFile, newFile, contents, forceBase64, inlineByteLimit) { - var fs = require.nodeRequire('fs'); - var path = require.nodeRequire('path'); - return this._replaceURL(contents, function (url) { - if (/\.(svg|png)$/.test(url)) { - var fsPath = path.join(path.dirname(originalFileFSPath), url); - var fileContents = fs.readFileSync(fsPath); - if (fileContents.length < inlineByteLimit) { - global.cssInlinedResources = global.cssInlinedResources || []; - var normalizedFSPath = fsPath.replace(/\\/g, '/'); - if (global.cssInlinedResources.indexOf(normalizedFSPath) >= 0) { - console.warn('CSS INLINING IMAGE AT ' + fsPath + ' MORE THAN ONCE. CONSIDER CONSOLIDATING CSS RULES'); - } - global.cssInlinedResources.push(normalizedFSPath); - var MIME = /\.svg$/.test(url) ? 'image/svg+xml' : 'image/png'; - var DATA = ';base64,' + fileContents.toString('base64'); - if (!forceBase64 && /\.svg$/.test(url)) { - // .svg => url encode as explained at https://codepen.io/tigt/post/optimizing-svgs-in-data-uris - var newText = fileContents.toString() - .replace(/"/g, '\'') - .replace(//g, '%3E') - .replace(/&/g, '%26') - .replace(/#/g, '%23') - .replace(/\s+/g, ' '); - var encodedData = ',' + newText; - if (encodedData.length < DATA.length) { - DATA = encodedData; - } - } - return '"data:' + MIME + DATA + '"'; - } - } - var absoluteUrl = Utilities.joinPaths(Utilities.pathOf(originalFile), url); - return Utilities.relativePath(newFile, absoluteUrl); - }); - }; - return Utilities; - }()); - CSSLoaderPlugin.Utilities = Utilities; - (function () { - var cssLoader = null; - var isElectron = (typeof process !== 'undefined' && typeof process.versions !== 'undefined' && typeof process.versions['electron'] !== 'undefined'); - if (typeof process !== 'undefined' && process.versions && !!process.versions.node && !isElectron) { - cssLoader = new NodeCSSLoader(); - } - else { - cssLoader = new BrowserCSSLoader(); - } - define('vs/css', new CSSPlugin(cssLoader)); - })(); + function init() { + define('vs/css', new CSSPlugin()); + } + CSSLoaderPlugin.init = init; + ; + if (typeof doNotInitLoader === 'undefined') { + init(); + } })(CSSLoaderPlugin || (CSSLoaderPlugin = {})); diff --git a/src/vs/editor/browser/config/configuration.ts b/src/vs/editor/browser/config/configuration.ts index 960faa7b1e6241576fe0f11c3bad53fd1abc4a37..0a7787b49260ba0449add76f79a4a6e737981cdc 100644 --- a/src/vs/editor/browser/config/configuration.ts +++ b/src/vs/editor/browser/config/configuration.ts @@ -351,7 +351,6 @@ export class Configuration extends CommonEditorConfiguration { extraEditorClassName: this._getExtraEditorClassName(), outerWidth: this._elementSizeObserver.getWidth(), outerHeight: this._elementSizeObserver.getHeight(), - canUseTranslate3d: browser.canUseTranslate3d(), emptySelectionClipboard: browser.isWebKit, pixelRatio: browser.getPixelRatio(), zoomLevel: browser.getZoomLevel(), diff --git a/src/vs/editor/browser/controller/mouseHandler.ts b/src/vs/editor/browser/controller/mouseHandler.ts index cc44acdd62d3f01c0166f5f1f2154bc4246bf01d..60ff6e4d650c52d725b1869356a9a81baec7acc1 100644 --- a/src/vs/editor/browser/controller/mouseHandler.ts +++ b/src/vs/editor/browser/controller/mouseHandler.ts @@ -185,7 +185,7 @@ export class MouseHandler extends ViewEventHandler { } let actualMouseMoveTime = e.timestamp; if (actualMouseMoveTime < this.lastMouseLeaveTime) { - // Due to throttling, this event occured before the mouse left the editor, therefore ignore it. + // Due to throttling, this event occurred before the mouse left the editor, therefore ignore it. return; } diff --git a/src/vs/editor/browser/controller/textAreaHandler.ts b/src/vs/editor/browser/controller/textAreaHandler.ts index f9ae737307ecb3eb46df49d305ebac7cdd147367..23acec9b604164f7bb0caf8ce18420833734f617 100644 --- a/src/vs/editor/browser/controller/textAreaHandler.ts +++ b/src/vs/editor/browser/controller/textAreaHandler.ts @@ -18,12 +18,12 @@ import { HorizontalRange, RenderingContext, RestrictedRenderingContext } from 'v import * as viewEvents from 'vs/editor/common/view/viewEvents'; import { FastDomNode, createFastDomNode } from 'vs/base/browser/fastDomNode'; import { ViewController } from 'vs/editor/browser/view/viewController'; -import { EndOfLinePreference } from "vs/editor/common/editorCommon"; -import { IKeyboardEvent } from "vs/base/browser/keyboardEvent"; -import { PartFingerprints, PartFingerprint, ViewPart } from "vs/editor/browser/view/viewPart"; -import { Margin } from "vs/editor/browser/viewParts/margin/margin"; -import { LineNumbersOverlay } from "vs/editor/browser/viewParts/lineNumbers/lineNumbers"; -import { BareFontInfo } from "vs/editor/common/config/fontInfo"; +import { EndOfLinePreference } from 'vs/editor/common/editorCommon'; +import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent'; +import { PartFingerprints, PartFingerprint, ViewPart } from 'vs/editor/browser/view/viewPart'; +import { Margin } from 'vs/editor/browser/viewParts/margin/margin'; +import { LineNumbersOverlay } from 'vs/editor/browser/viewParts/lineNumbers/lineNumbers'; +import { BareFontInfo } from 'vs/editor/common/config/fontInfo'; export interface ITextAreaHandlerHelper { visibleRangeForPositionRelativeToEditor(lineNumber: number, column: number): HorizontalRange; @@ -108,6 +108,7 @@ export class TextAreaHandler extends ViewPart { this.textArea.setAttribute('wrap', 'off'); this.textArea.setAttribute('autocorrect', 'off'); this.textArea.setAttribute('autocapitalize', 'off'); + this.textArea.setAttribute('autocomplete', 'off'); this.textArea.setAttribute('spellcheck', 'false'); this.textArea.setAttribute('aria-label', conf.viewInfo.ariaLabel); this.textArea.setAttribute('role', 'textbox'); @@ -419,9 +420,7 @@ export class TextAreaHandler extends ViewPart { Configuration.applyFontInfo(ta, this._fontInfo); } else { ta.setFontSize(1); - // Chrome does not generate input events in empty textareas that end - // up having a line height smaller than 1 screen pixel. - ta.setLineHeight(Math.ceil(Math.max(this._pixelRatio, 1 / this._pixelRatio))); + ta.setLineHeight(this._fontInfo.lineHeight); } ta.setTop(top); diff --git a/src/vs/editor/browser/controller/textAreaInput.ts b/src/vs/editor/browser/controller/textAreaInput.ts index 757bbf1dd414913754d8be2a861383e6d19e4ec6..e1f99b036e89eea28fb9f0377175e25cfaf623fe 100644 --- a/src/vs/editor/browser/controller/textAreaInput.ts +++ b/src/vs/editor/browser/controller/textAreaInput.ts @@ -13,8 +13,8 @@ import { ITypeData, TextAreaState, ITextAreaWrapper } from 'vs/editor/browser/co import * as browser from 'vs/base/browser/browser'; import * as platform from 'vs/base/common/platform'; import * as dom from 'vs/base/browser/dom'; -import { IKeyboardEvent } from "vs/base/browser/keyboardEvent"; -import { FastDomNode } from "vs/base/browser/fastDomNode"; +import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent'; +import { FastDomNode } from 'vs/base/browser/fastDomNode'; export interface ICompositionData { data: string; diff --git a/src/vs/editor/browser/editorBrowserExtensions.ts b/src/vs/editor/browser/editorBrowserExtensions.ts index ea76aeaa6445428064838183af82023e0c82a5c7..88a7a7ac175f6fb96eb430a7a3392abe93fc7dc7 100644 --- a/src/vs/editor/browser/editorBrowserExtensions.ts +++ b/src/vs/editor/browser/editorBrowserExtensions.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ 'use strict'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { IEditorContributionCtor } from 'vs/editor/browser/editorBrowser'; export function editorContribution(ctor: IEditorContributionCtor): void { diff --git a/src/vs/editor/browser/services/codeEditorServiceImpl.ts b/src/vs/editor/browser/services/codeEditorServiceImpl.ts index 26bc62e9e6a2dbde0a534b7e97d21affd8daace0..35f14e0b0e4eceafdc3acf7fd2f36babea37d6fb 100644 --- a/src/vs/editor/browser/services/codeEditorServiceImpl.ts +++ b/src/vs/editor/browser/services/codeEditorServiceImpl.ts @@ -9,11 +9,11 @@ import URI from 'vs/base/common/uri'; import * as dom from 'vs/base/browser/dom'; import { IDecorationRenderOptions, IModelDecorationOptions, IModelDecorationOverviewRulerOptions, IThemeDecorationRenderOptions, - IContentDecorationRenderOptions, OverviewRulerLane, TrackedRangeStickiness, ThemeColor, isThemeColor + IContentDecorationRenderOptions, OverviewRulerLane, TrackedRangeStickiness, isThemeColor } from 'vs/editor/common/editorCommon'; import { AbstractCodeEditorService } from 'vs/editor/common/services/abstractCodeEditorService'; import { IDisposable, dispose as disposeAll } from 'vs/base/common/lifecycle'; -import { IThemeService, ITheme } from 'vs/platform/theme/common/themeService'; +import { IThemeService, ITheme, ThemeColor } from 'vs/platform/theme/common/themeService'; export class CodeEditorServiceImpl extends AbstractCodeEditorService { @@ -151,11 +151,12 @@ class DecorationTypeOptionsProvider implements IModelDecorationOptionsProvider { this.className = createCSSRules(ModelDecorationCSSRuleType.ClassName); this.inlineClassName = createCSSRules(ModelDecorationCSSRuleType.InlineClassName); this.beforeContentClassName = createCSSRules(ModelDecorationCSSRuleType.BeforeContentClassName); - this.beforeContentClassName = createCSSRules(ModelDecorationCSSRuleType.AfterContentClassName); + this.afterContentClassName = createCSSRules(ModelDecorationCSSRuleType.AfterContentClassName); this.glyphMarginClassName = createCSSRules(ModelDecorationCSSRuleType.GlyphMarginClassName); let options = providerArgs.options; this.isWholeLine = Boolean(options.isWholeLine); + this.stickiness = options.rangeBehavior; let lightOverviewRulerColor = options.light && options.light.overviewRulerColor || options.overviewRulerColor; let darkOverviewRulerColor = options.dark && options.dark.overviewRulerColor || options.overviewRulerColor; @@ -342,9 +343,9 @@ class DecorationCSSRules { return ''; } let cssTextArr: string[] = []; - this.collectCSSText(opts, ['backgroundColor', 'outline', 'outlineColor', 'outlineStyle', 'outlineWidth'], cssTextArr); + this.collectCSSText(opts, ['backgroundColor'], cssTextArr); + this.collectCSSText(opts, ['outline', 'outlineColor', 'outlineStyle', 'outlineWidth'], cssTextArr); this.collectBorderSettingsCSSText(opts, cssTextArr); - return cssTextArr.join(''); } @@ -414,10 +415,8 @@ class DecorationCSSRules { return cssTextArr.join(''); } - private static border_rules = ['border', 'borderRadius', 'borderColor', 'borderSpacing', 'borderStyle', 'borderWidth']; - private collectBorderSettingsCSSText(opts: any, cssTextArr: string[]): boolean { - if (this.collectCSSText(opts, DecorationCSSRules.border_rules, cssTextArr)) { + if (this.collectCSSText(opts, ['border', 'borderColor', 'borderRadius', 'borderSpacing', 'borderStyle', 'borderWidth'], cssTextArr)) { cssTextArr.push(strings.format('box-sizing: border-box;')); return true; } @@ -442,7 +441,7 @@ class DecorationCSSRules { if (color) { return color.toString(); } - return void 0; + return 'transparent'; } return value; } diff --git a/src/vs/editor/browser/standalone/media/standalone-tokens.css b/src/vs/editor/browser/standalone/media/standalone-tokens.css deleted file mode 100644 index 8c3ae996849a3afa6f6f71d95f1a0964cea24fd9..0000000000000000000000000000000000000000 --- a/src/vs/editor/browser/standalone/media/standalone-tokens.css +++ /dev/null @@ -1,30 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - - -/* Default standalone editor font */ -.monaco-editor { - font-family: system-ui, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", "Ubuntu", "Droid Sans", sans-serif; -} - -.monaco-menu .monaco-action-bar.vertical .action-item [tabindex="0"]:focus { - color: deepskyblue; -} - -.monaco-editor-hover p { - margin: 0; -} - -/*.monaco-editor.vs [tabindex="0"]:focus { - outline: 1px solid rgba(0, 122, 204, 0.4); - outline-offset: -1px; - opacity: 1 !important; -} - -.monaco-editor.vs-dark [tabindex="0"]:focus { - outline: 1px solid rgba(14, 99, 156, 0.6); - outline-offset: -1px; - opacity: 1 !important; -}*/ diff --git a/src/vs/editor/browser/view/viewController.ts b/src/vs/editor/browser/view/viewController.ts index e05ca74ea605c5d7a7dccd5724e0e43d8b5b6cc6..1ace89fcdacbe8c11b74dd0e5d7b57a12f6f3c55 100644 --- a/src/vs/editor/browser/view/viewController.ts +++ b/src/vs/editor/browser/view/viewController.ts @@ -12,7 +12,7 @@ import { ICommandService } from 'vs/platform/commands/common/commands'; import { IViewModel } from 'vs/editor/common/viewModel/viewModel'; import { ViewOutgoingEvents } from 'vs/editor/browser/view/viewOutgoingEvents'; import { CoreNavigationCommands, CoreEditorCommand } from 'vs/editor/common/controller/coreCommands'; -import { Configuration } from "vs/editor/browser/config/configuration"; +import { Configuration } from 'vs/editor/browser/config/configuration'; export interface ExecCoreEditorCommandFunc { (editorCommand: CoreEditorCommand, args: any): void; @@ -102,7 +102,7 @@ export class ViewController { } private _hasMulticursorModifier(data: IMouseDispatchData): boolean { - switch (this.configuration.editor.multicursorModifier) { + switch (this.configuration.editor.multiCursorModifier) { case 'altKey': return data.altKey; case 'ctrlKey': @@ -114,7 +114,7 @@ export class ViewController { } private _hasNonMulticursorModifier(data: IMouseDispatchData): boolean { - switch (this.configuration.editor.multicursorModifier) { + switch (this.configuration.editor.multiCursorModifier) { case 'altKey': return data.ctrlKey || data.metaKey; case 'ctrlKey': diff --git a/src/vs/editor/browser/view/viewImpl.ts b/src/vs/editor/browser/view/viewImpl.ts index 927c1d1948684cf563808e9766e76b987ac76aa3..9af2f0268c28f8e44b111e9de8587d15b3ef9d9d 100644 --- a/src/vs/editor/browser/view/viewImpl.ts +++ b/src/vs/editor/browser/view/viewImpl.ts @@ -48,7 +48,8 @@ import { EditorScrollbar } from 'vs/editor/browser/viewParts/editorScrollbar/edi import { Minimap } from 'vs/editor/browser/viewParts/minimap/minimap'; import * as viewEvents from 'vs/editor/common/view/viewEvents'; import { IThemeService, getThemeTypeSelector } from 'vs/platform/theme/common/themeService'; -import { Cursor } from "vs/editor/common/controller/cursor"; +import { Cursor } from 'vs/editor/common/controller/cursor'; +import { IMouseEvent } from "vs/base/browser/mouseEvent"; export interface IContentWidgetData { widget: editorBrowser.IContentWidget; @@ -66,6 +67,7 @@ export class View extends ViewEventHandler { private _scrollbar: EditorScrollbar; private _context: ViewContext; + private _cursor: Cursor; // The view lines private viewLines: ViewLines; @@ -102,6 +104,7 @@ export class View extends ViewEventHandler { ) { super(); this._isDisposed = false; + this._cursor = cursor; this._renderAnimationFrame = null; this.outgoingEvents = new ViewOutgoingEvents(model); @@ -138,7 +141,7 @@ export class View extends ViewEventHandler { this.eventDispatcher.emitMany(events); })); - this._register(cursor.addEventListener((events: viewEvents.ViewEvent[]) => { + this._register(this._cursor.addEventListener((events: viewEvents.ViewEvent[]) => { this.eventDispatcher.emitMany(events); })); } @@ -208,7 +211,7 @@ export class View extends ViewEventHandler { let rulers = new Rulers(this._context); this.viewParts.push(rulers); - let minimap = new Minimap(this._context, this._scrollbar); + let minimap = new Minimap(this._context); this.viewParts.push(minimap); // -------------- Wire dom nodes up @@ -409,7 +412,12 @@ export class View extends ViewEventHandler { const partialViewportData = this._context.viewLayout.getLinesViewportData(); this._context.model.setViewport(partialViewportData.startLineNumber, partialViewportData.endLineNumber, partialViewportData.centeredLineNumber); - let viewportData = new ViewportData(partialViewportData, this._context.model); + let viewportData = new ViewportData( + this._cursor.getViewSelections(), + partialViewportData, + this._context.viewLayout.getWhitespaceViewportData(), + this._context.model + ); if (this.viewLines.shouldRender()) { this.viewLines.renderText(viewportData); @@ -436,7 +444,7 @@ export class View extends ViewEventHandler { // --- BEGIN CodeEditor helpers - public delegateVerticalScrollbarMouseDown(browserEvent: MouseEvent): void { + public delegateVerticalScrollbarMouseDown(browserEvent: IMouseEvent): void { this._scrollbar.delegateVerticalScrollbarMouseDown(browserEvent); } diff --git a/src/vs/editor/browser/viewParts/editorScrollbar/editorScrollbar.ts b/src/vs/editor/browser/viewParts/editorScrollbar/editorScrollbar.ts index 11d5326512873d38fde184214e6a535c1a04cc09..7b8a8e075d1d286d551ff7501cb46843be4f5fb2 100644 --- a/src/vs/editor/browser/viewParts/editorScrollbar/editorScrollbar.ts +++ b/src/vs/editor/browser/viewParts/editorScrollbar/editorScrollbar.ts @@ -13,7 +13,9 @@ import { ViewContext } from 'vs/editor/common/view/viewContext'; import * as viewEvents from 'vs/editor/common/view/viewEvents'; import { RenderingContext, RestrictedRenderingContext } from 'vs/editor/common/view/renderingContext'; import { FastDomNode, createFastDomNode } from 'vs/base/browser/fastDomNode'; -import { getThemeTypeSelector } from "vs/platform/theme/common/themeService"; +import { getThemeTypeSelector } from 'vs/platform/theme/common/themeService'; +import { IMouseEvent } from "vs/base/browser/mouseEvent"; +import { ISimplifiedMouseEvent } from "vs/base/browser/ui/scrollbar/abstractScrollbar"; export class EditorScrollbar extends ViewPart { @@ -32,7 +34,6 @@ export class EditorScrollbar extends ViewPart { const configScrollbarOpts = editor.viewInfo.scrollbar; let scrollbarOptions: ScrollableElementCreationOptions = { - canUseTranslate3d: editor.canUseTranslate3d, listenOnDomNode: viewDomNode.domNode, className: 'editor-scrollable' + ' ' + getThemeTypeSelector(context.theme.type), useShadows: false, @@ -110,21 +111,20 @@ export class EditorScrollbar extends ViewPart { return this.scrollbarDomNode; } - public delegateVerticalScrollbarMouseDown(browserEvent: MouseEvent): void { + public delegateVerticalScrollbarMouseDown(browserEvent: IMouseEvent): void { this.scrollbar.delegateVerticalScrollbarMouseDown(browserEvent); } - public getVerticalSliderVerticalCenter(): number { - return this.scrollbar.getVerticalSliderVerticalCenter(); + public delegateSliderMouseDown(e: ISimplifiedMouseEvent, onDragFinished: () => void): void { + this.scrollbar.delegateSliderMouseDown(e, onDragFinished); } // --- begin event handlers public onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean { - if (e.viewInfo || e.canUseTranslate3d) { + if (e.viewInfo) { const editor = this._context.configuration.editor; let newOpts: ScrollableElementChangeOptions = { - canUseTranslate3d: editor.canUseTranslate3d, handleMouseWheel: editor.viewInfo.scrollbar.handleMouseWheel, mouseWheelScrollSensitivity: editor.viewInfo.scrollbar.mouseWheelScrollSensitivity }; diff --git a/src/vs/editor/browser/viewParts/indentGuides/indentGuides.css b/src/vs/editor/browser/viewParts/indentGuides/indentGuides.css index 7cd5f89fd9f0c0194274802c993a4dbe03f0cae5..45992137d182058608c31b496abf97c59d5e76c2 100644 --- a/src/vs/editor/browser/viewParts/indentGuides/indentGuides.css +++ b/src/vs/editor/browser/viewParts/indentGuides/indentGuides.css @@ -9,5 +9,4 @@ */ .monaco-editor .lines-content .cigr { position: absolute; - width: 1px; } diff --git a/src/vs/editor/browser/viewParts/indentGuides/indentGuides.ts b/src/vs/editor/browser/viewParts/indentGuides/indentGuides.ts index 5b3a301abc036c63e02f5ed1d37e15118f650406..caa4f1449a8893916a5d2a3b6df48e33c65b2aaf 100644 --- a/src/vs/editor/browser/viewParts/indentGuides/indentGuides.ts +++ b/src/vs/editor/browser/viewParts/indentGuides/indentGuides.ts @@ -12,6 +12,7 @@ import { RenderingContext } from 'vs/editor/common/view/renderingContext'; import * as viewEvents from 'vs/editor/common/view/viewEvents'; import { registerThemingParticipant } from 'vs/platform/theme/common/themeService'; import { editorIndentGuides } from 'vs/editor/common/view/editorColorRegistry'; +import * as dom from 'vs/base/browser/dom'; export class IndentGuidesOverlay extends DynamicViewOverlay { @@ -85,6 +86,7 @@ export class IndentGuidesOverlay extends DynamicViewOverlay { const tabSize = this._context.model.getTabSize(); const tabWidth = tabSize * this._spaceWidth; const lineHeight = this._lineHeight; + const indentGuideWidth = dom.computeScreenAwareSize(1); let output: string[] = []; for (let lineNumber = visibleStartLineNumber; lineNumber <= visibleEndLineNumber; lineNumber++) { @@ -94,7 +96,7 @@ export class IndentGuidesOverlay extends DynamicViewOverlay { let result = ''; let left = 0; for (let i = 0; i < indent; i++) { - result += `
`; + result += `
`; left += tabWidth; } diff --git a/src/vs/editor/browser/viewParts/lines/viewLine.ts b/src/vs/editor/browser/viewParts/lines/viewLine.ts index 9ece4d64b19f025b38218bf93d72cd899e4c63d0..6d1c5d8be5676397d89781790d088fb5f7fc631c 100644 --- a/src/vs/editor/browser/viewParts/lines/viewLine.ts +++ b/src/vs/editor/browser/viewParts/lines/viewLine.ts @@ -15,6 +15,7 @@ import { IVisibleLine } from 'vs/editor/browser/view/viewLayer'; import { RangeUtil } from 'vs/editor/browser/viewParts/lines/rangeUtil'; import { HorizontalRange } from 'vs/editor/common/view/renderingContext'; import { ViewportData } from 'vs/editor/common/viewLayout/viewLinesViewportData'; +import { ThemeType, HIGH_CONTRAST } from "vs/platform/theme/common/themeService"; const canUseFastRenderedViewLine = (function () { if (platform.isNative) { @@ -40,6 +41,8 @@ const canUseFastRenderedViewLine = (function () { return true; })(); +const alwaysRenderInlineSelection = (browser.isEdgeOrIE); + export class DomReadingContext { private readonly _domNode: HTMLElement; @@ -65,6 +68,7 @@ export class DomReadingContext { } export class ViewLineOptions { + public readonly themeType: ThemeType; public readonly renderWhitespace: 'none' | 'boundary' | 'all'; public readonly renderControlCharacters: boolean; public readonly spaceWidth: number; @@ -73,7 +77,8 @@ export class ViewLineOptions { public readonly stopRenderingLineAfter: number; public readonly fontLigatures: boolean; - constructor(config: IConfiguration) { + constructor(config: IConfiguration, themeType: ThemeType) { + this.themeType = themeType; this.renderWhitespace = config.editor.viewInfo.renderWhitespace; this.renderControlCharacters = config.editor.viewInfo.renderControlCharacters; this.spaceWidth = config.editor.fontInfo.spaceWidth; @@ -88,7 +93,8 @@ export class ViewLineOptions { public equals(other: ViewLineOptions): boolean { return ( - this.renderWhitespace === other.renderWhitespace + this.themeType === other.themeType + && this.renderWhitespace === other.renderWhitespace && this.renderControlCharacters === other.renderControlCharacters && this.spaceWidth === other.spaceWidth && this.useMonospaceOptimizations === other.useMonospaceOptimizations @@ -142,6 +148,13 @@ export class ViewLine implements IVisibleLine { this._isMaybeInvalid = true; this._options = newOptions; } + public onSelectionChanged(): boolean { + if (alwaysRenderInlineSelection || this._options.themeType === HIGH_CONTRAST) { + this._isMaybeInvalid = true; + return true; + } + return false; + } public renderLine(lineNumber: number, deltaTop: number, viewportData: ViewportData): string { if (this._isMaybeInvalid === false) { @@ -154,6 +167,26 @@ export class ViewLine implements IVisibleLine { const lineData = viewportData.getViewLineRenderingData(lineNumber); const options = this._options; const actualInlineDecorations = LineDecoration.filter(lineData.inlineDecorations, lineNumber, lineData.minColumn, lineData.maxColumn); + + if (alwaysRenderInlineSelection || options.themeType === HIGH_CONTRAST) { + const selections = viewportData.selections; + for (let i = 0, len = selections.length; i < len; i++) { + const selection = selections[i]; + + if (selection.endLineNumber < lineNumber || selection.startLineNumber > lineNumber) { + // Selection does not intersect line + continue; + } + + let startColumn = (selection.startLineNumber === lineNumber ? selection.startColumn : lineData.minColumn); + let endColumn = (selection.endLineNumber === lineNumber ? selection.endColumn : lineData.maxColumn); + + if (startColumn < endColumn) { + actualInlineDecorations.push(new LineDecoration(startColumn, endColumn, 'inline-selected-text', false)); + } + } + } + let renderLineInput = new RenderLineInput( options.useMonospaceOptimizations, lineData.content, diff --git a/src/vs/editor/browser/viewParts/lines/viewLines.ts b/src/vs/editor/browser/viewParts/lines/viewLines.ts index f6bb857221bb503907096a55079ef0a745e5197d..60a1d51c3ed62c7e44e9ca260ac9fe61b280543c 100644 --- a/src/vs/editor/browser/viewParts/lines/viewLines.ts +++ b/src/vs/editor/browser/viewParts/lines/viewLines.ts @@ -37,10 +37,6 @@ class LastRenderedData { } export class ViewLines extends ViewPart implements IVisibleLinesHost, IViewLines { - /** - * Width to extends a line to render the line feed at the end of the line - */ - private static LINE_FEED_WIDTH = 10; /** * Adds this ammount of pixels to the right of lines (no-one wants to type near the edge of the viewport) */ @@ -53,9 +49,10 @@ export class ViewLines extends ViewPart implements IVisibleLinesHost, // --- config private _lineHeight: number; + private _typicalHalfwidthCharacterWidth: number; private _isViewportWrapping: boolean; private _revealHorizontalRightPadding: number; - private _canUseTranslate3d: boolean; + private _canUseLayerHinting: boolean; private _viewLineOptions: ViewLineOptions; // --- width @@ -72,15 +69,18 @@ export class ViewLines extends ViewPart implements IVisibleLinesHost, this._visibleLines = new VisibleLinesCollection(this); this.domNode = this._visibleLines.domNode; - this._lineHeight = this._context.configuration.editor.lineHeight; - this._isViewportWrapping = this._context.configuration.editor.wrappingInfo.isViewportWrapping; - this._revealHorizontalRightPadding = this._context.configuration.editor.viewInfo.revealHorizontalRightPadding; - this._canUseTranslate3d = this._context.configuration.editor.canUseTranslate3d; - this._viewLineOptions = new ViewLineOptions(this._context.configuration); + const conf = this._context.configuration; + + this._lineHeight = conf.editor.lineHeight; + this._typicalHalfwidthCharacterWidth = conf.editor.fontInfo.typicalHalfwidthCharacterWidth; + this._isViewportWrapping = conf.editor.wrappingInfo.isViewportWrapping; + this._revealHorizontalRightPadding = conf.editor.viewInfo.revealHorizontalRightPadding; + this._canUseLayerHinting = conf.editor.canUseLayerHinting; + this._viewLineOptions = new ViewLineOptions(conf, this._context.theme.type); PartFingerprints.write(this.domNode, PartFingerprint.ViewLines); this.domNode.setClassName('view-lines'); - Configuration.applyFontInfo(this.domNode, this._context.configuration.editor.fontInfo); + Configuration.applyFontInfo(this.domNode, conf.editor.fontInfo); // --- width & height this._maxLineWidth = 0; @@ -118,23 +118,39 @@ export class ViewLines extends ViewPart implements IVisibleLinesHost, this._maxLineWidth = 0; } + const conf = this._context.configuration; + if (e.lineHeight) { - this._lineHeight = this._context.configuration.editor.lineHeight; + this._lineHeight = conf.editor.lineHeight; + } + if (e.fontInfo) { + this._typicalHalfwidthCharacterWidth = conf.editor.fontInfo.typicalHalfwidthCharacterWidth; } if (e.wrappingInfo) { - this._isViewportWrapping = this._context.configuration.editor.wrappingInfo.isViewportWrapping; + this._isViewportWrapping = conf.editor.wrappingInfo.isViewportWrapping; } if (e.viewInfo) { - this._revealHorizontalRightPadding = this._context.configuration.editor.viewInfo.revealHorizontalRightPadding; + this._revealHorizontalRightPadding = conf.editor.viewInfo.revealHorizontalRightPadding; } - if (e.canUseTranslate3d) { - this._canUseTranslate3d = this._context.configuration.editor.canUseTranslate3d; + if (e.canUseLayerHinting) { + this._canUseLayerHinting = conf.editor.canUseLayerHinting; } if (e.fontInfo) { - Configuration.applyFontInfo(this.domNode, this._context.configuration.editor.fontInfo); + Configuration.applyFontInfo(this.domNode, conf.editor.fontInfo); } - let newViewLineOptions = new ViewLineOptions(this._context.configuration); + this._onOptionsMaybeChanged(); + + if (e.layoutInfo) { + this._maxLineWidth = 0; + } + + return true; + } + private _onOptionsMaybeChanged(): boolean { + const conf = this._context.configuration; + + let newViewLineOptions = new ViewLineOptions(conf, this._context.theme.type); if (!this._viewLineOptions.equals(newViewLineOptions)) { this._viewLineOptions = newViewLineOptions; @@ -144,13 +160,19 @@ export class ViewLines extends ViewPart implements IVisibleLinesHost, let line = this._visibleLines.getVisibleLine(lineNumber); line.onOptionsChanged(this._viewLineOptions); } + return true; } - if (e.layoutInfo) { - this._maxLineWidth = 0; + return false; + } + public onCursorStateChanged(e: viewEvents.ViewCursorStateChangedEvent): boolean { + let rendStartLineNumber = this._visibleLines.getStartLineNumber(); + let rendEndLineNumber = this._visibleLines.getEndLineNumber(); + let r = false; + for (let lineNumber = rendStartLineNumber; lineNumber <= rendEndLineNumber; lineNumber++) { + r = this._visibleLines.getVisibleLine(lineNumber).onSelectionChanged() || r; } - - return true; + return r; } public onDecorationsChanged(e: viewEvents.ViewDecorationsChangedEvent): boolean { if (true/*e.inlineDecorationsChanged*/) { @@ -200,6 +222,9 @@ export class ViewLines extends ViewPart implements IVisibleLinesHost, public onZonesChanged(e: viewEvents.ViewZonesChangedEvent): boolean { return this._visibleLines.onZonesChanged(e); } + public onThemeChanged(e: viewEvents.ViewThemeChangedEvent): boolean { + return this._onOptionsMaybeChanged(); + } // ---- end view event handlers @@ -321,7 +346,7 @@ export class ViewLines extends ViewPart implements IVisibleLinesHost, nextLineModelLineNumber = this._context.model.coordinatesConverter.convertViewPositionToModelPosition(new Position(lineNumber + 1, 1)).lineNumber; if (currentLineModelLineNumber !== nextLineModelLineNumber) { - visibleRangesForLine[visibleRangesForLine.length - 1].width += ViewLines.LINE_FEED_WIDTH; + visibleRangesForLine[visibleRangesForLine.length - 1].width += this._typicalHalfwidthCharacterWidth; } } @@ -438,17 +463,10 @@ export class ViewLines extends ViewPart implements IVisibleLinesHost, } // (3) handle scrolling + this._linesContent.setLayerHinting(this._canUseLayerHinting); const adjustedScrollTop = this._context.viewLayout.getScrollTop() - viewportData.bigNumbersDelta; - if (this._canUseTranslate3d) { - let transform = 'translate3d(' + -this._context.viewLayout.getScrollLeft() + 'px, ' + -adjustedScrollTop + 'px, 0px)'; - this._linesContent.setTransform(transform); - this._linesContent.setTop(0); - this._linesContent.setLeft(0); - } else { - this._linesContent.setTransform(''); - this._linesContent.setTop(-adjustedScrollTop); - this._linesContent.setLeft(-this._context.viewLayout.getScrollLeft()); - } + this._linesContent.setTop(-adjustedScrollTop); + this._linesContent.setLeft(-this._context.viewLayout.getScrollLeft()); // Update max line width (not so important, it is just so the horizontal scrollbar doesn't get too small) this._asyncUpdateLineWidths.schedule(); diff --git a/src/vs/editor/browser/viewParts/margin/margin.ts b/src/vs/editor/browser/viewParts/margin/margin.ts index 35fcf1563b937b323d2988ddb387e9fdc102a72f..bd3fc8b97a67e7a1b89799a16b4955d95493ebae 100644 --- a/src/vs/editor/browser/viewParts/margin/margin.ts +++ b/src/vs/editor/browser/viewParts/margin/margin.ts @@ -16,7 +16,7 @@ export class Margin extends ViewPart { public static CLASS_NAME = 'glyph-margin'; private _domNode: FastDomNode; - private _canUseTranslate3d: boolean; + private _canUseLayerHinting: boolean; private _contentLeft: number; private _glyphMarginLeft: number; private _glyphMarginWidth: number; @@ -24,7 +24,7 @@ export class Margin extends ViewPart { constructor(context: ViewContext) { super(context); - this._canUseTranslate3d = this._context.configuration.editor.canUseTranslate3d; + this._canUseLayerHinting = this._context.configuration.editor.canUseLayerHinting; this._contentLeft = this._context.configuration.editor.layoutInfo.contentLeft; this._glyphMarginLeft = this._context.configuration.editor.layoutInfo.glyphMarginLeft; this._glyphMarginWidth = this._context.configuration.editor.layoutInfo.glyphMarginWidth; @@ -57,8 +57,8 @@ export class Margin extends ViewPart { // --- begin event handlers public onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean { - if (e.canUseTranslate3d) { - this._canUseTranslate3d = this._context.configuration.editor.canUseTranslate3d; + if (e.canUseLayerHinting) { + this._canUseLayerHinting = this._context.configuration.editor.canUseLayerHinting; } if (e.layoutInfo) { @@ -80,15 +80,9 @@ export class Margin extends ViewPart { } public render(ctx: RestrictedRenderingContext): void { + this._domNode.setLayerHinting(this._canUseLayerHinting); const adjustedScrollTop = ctx.scrollTop - ctx.bigNumbersDelta; - if (this._canUseTranslate3d) { - let transform = 'translate3d(0px, ' + -adjustedScrollTop + 'px, 0px)'; - this._domNode.setTransform(transform); - this._domNode.setTop(0); - } else { - this._domNode.setTransform(''); - this._domNode.setTop(-adjustedScrollTop); - } + this._domNode.setTop(-adjustedScrollTop); let height = Math.min(ctx.scrollHeight, 1000000); this._domNode.setHeight(height); diff --git a/src/vs/editor/browser/viewParts/minimap/minimap.css b/src/vs/editor/browser/viewParts/minimap/minimap.css index 692577e87bdfb2a78576206729c28d048bc8d4ed..f3692e7e4dcdb78b6d96347db8d36427c6304d8b 100644 --- a/src/vs/editor/browser/viewParts/minimap/minimap.css +++ b/src/vs/editor/browser/viewParts/minimap/minimap.css @@ -3,16 +3,19 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -.monaco-editor .minimap-slider { +/* START cover the case that slider is visible on mouseover */ +.monaco-editor .minimap.slider-mouseover .minimap-slider { opacity: 0; transition: opacity 100ms linear; } -.monaco-editor .minimap:hover .minimap-slider { +.monaco-editor .minimap.slider-mouseover:hover .minimap-slider { opacity: 1; } -.monaco-editor .minimap-slider.active { +.monaco-editor .minimap.slider-mouseover .minimap-slider.active { opacity: 1; } +/* END cover the case that slider is visible on mouseover */ + .monaco-editor .minimap-shadow-hidden { position: absolute; width: 0; diff --git a/src/vs/editor/browser/viewParts/minimap/minimap.ts b/src/vs/editor/browser/viewParts/minimap/minimap.ts index 9c922137edeba758aee0669970a8f3f5b197d0e6..7ec4110204671f90b657e59d647a4d656802f032 100644 --- a/src/vs/editor/browser/viewParts/minimap/minimap.ts +++ b/src/vs/editor/browser/viewParts/minimap/minimap.ts @@ -18,15 +18,14 @@ import { ViewLineData } from 'vs/editor/common/viewModel/viewModel'; import { ColorId } from 'vs/editor/common/modes'; import { FastDomNode, createFastDomNode } from 'vs/base/browser/fastDomNode'; import { IDisposable } from 'vs/base/common/lifecycle'; -import { EditorScrollbar } from 'vs/editor/browser/viewParts/editorScrollbar/editorScrollbar'; import { RenderedLinesCollection, ILine } from 'vs/editor/browser/view/viewLayer'; import { Range } from 'vs/editor/common/core/range'; import { RGBA } from 'vs/base/common/color'; import * as viewEvents from 'vs/editor/common/view/viewEvents'; import { GlobalMouseMoveMonitor, IStandardMouseMoveEventData, standardMouseMoveMerger } from 'vs/base/browser/globalMouseMoveMonitor'; import * as platform from 'vs/base/common/platform'; -import { registerThemingParticipant } from "vs/platform/theme/common/themeService"; -import { scrollbarSliderBackground, scrollbarSliderHoverBackground, scrollbarSliderActiveBackground, scrollbarShadow } from "vs/platform/theme/common/colorRegistry"; +import { registerThemingParticipant } from 'vs/platform/theme/common/themeService'; +import { scrollbarSliderBackground, scrollbarSliderHoverBackground, scrollbarSliderActiveBackground, scrollbarShadow } from 'vs/platform/theme/common/colorRegistry'; const enum RenderMinimap { None = 0, @@ -73,8 +72,14 @@ class MinimapOptions { public readonly renderMinimap: RenderMinimap; + public readonly scrollBeyondLastLine: boolean; + + public readonly showSlider: 'always' | 'mouseover'; + public readonly pixelRatio: number; + public readonly typicalHalfwidthCharacterWidth: number; + public readonly lineHeight: number; /** @@ -107,15 +112,20 @@ class MinimapOptions { constructor(configuration: editorCommon.IConfiguration) { const pixelRatio = configuration.editor.pixelRatio; const layoutInfo = configuration.editor.layoutInfo; + const viewInfo = configuration.editor.viewInfo; + const fontInfo = configuration.editor.fontInfo; this.renderMinimap = layoutInfo.renderMinimap | 0; + this.scrollBeyondLastLine = viewInfo.scrollBeyondLastLine; + this.showSlider = viewInfo.minimap.showSlider; this.pixelRatio = pixelRatio; + this.typicalHalfwidthCharacterWidth = fontInfo.typicalHalfwidthCharacterWidth; this.lineHeight = configuration.editor.lineHeight; this.minimapWidth = layoutInfo.minimapWidth; this.minimapHeight = layoutInfo.height; - this.canvasInnerWidth = Math.floor(pixelRatio * this.minimapWidth); - this.canvasInnerHeight = Math.floor(pixelRatio * this.minimapHeight); + this.canvasInnerWidth = Math.max(1, Math.floor(pixelRatio * this.minimapWidth)); + this.canvasInnerHeight = Math.max(1, Math.floor(pixelRatio * this.minimapHeight)); this.canvasOuterWidth = this.canvasInnerWidth / pixelRatio; this.canvasOuterHeight = this.canvasInnerHeight / pixelRatio; @@ -123,7 +133,10 @@ class MinimapOptions { public equals(other: MinimapOptions): boolean { return (this.renderMinimap === other.renderMinimap + && this.scrollBeyondLastLine === other.scrollBeyondLastLine + && this.showSlider === other.showSlider && this.pixelRatio === other.pixelRatio + && this.typicalHalfwidthCharacterWidth === other.typicalHalfwidthCharacterWidth && this.lineHeight === other.lineHeight && this.minimapWidth === other.minimapWidth && this.minimapHeight === other.minimapHeight @@ -137,6 +150,13 @@ class MinimapOptions { class MinimapLayout { + /** + * The given editor scrollTop (input). + */ + public readonly scrollTop: number; + + private readonly _computedSliderRatio: number; + /** * slider dom node top (in CSS px) */ @@ -156,142 +176,93 @@ class MinimapLayout { public readonly endLineNumber: number; constructor( - lastRenderData: RenderData, + scrollTop: number, + computedSliderRatio: number, + sliderTop: number, + sliderHeight: number, + startLineNumber: number, + endLineNumber: number + ) { + this.scrollTop = scrollTop; + this._computedSliderRatio = computedSliderRatio; + this.sliderTop = sliderTop; + this.sliderHeight = sliderHeight; + this.startLineNumber = startLineNumber; + this.endLineNumber = endLineNumber; + } + + /** + * Compute a desired `scrollPosition` such that the slider moves by `delta`. + */ + public getDesiredScrollTopFromDelta(delta: number): number { + let desiredSliderPosition = this.sliderTop + delta; + return Math.round(desiredSliderPosition / this._computedSliderRatio); + } + + public static create( options: MinimapOptions, viewportStartLineNumber: number, viewportEndLineNumber: number, viewportHeight: number, + viewportContainsWhitespaceGaps: boolean, lineCount: number, - scrollbarSliderCenter: number - ) { + scrollTop: number, + scrollHeight: number + ): MinimapLayout { const pixelRatio = options.pixelRatio; const minimapLineHeight = getMinimapLineHeight(options.renderMinimap); const minimapLinesFitting = Math.floor(options.canvasInnerHeight / minimapLineHeight); const lineHeight = options.lineHeight; - // Sometimes, the number of rendered lines varies for a constant viewport height. - // The reason is that only parts of the viewportStartLineNumber or viewportEndLineNumber are visible. - // This leads to an apparent tremor in the minimap's slider height. - // We try here to compensate, making the slider slightly incorrect in these cases, but more pleasing to the eye. - let viewportLineCount = viewportEndLineNumber - viewportStartLineNumber + 1; - const expectedViewportLineCount = Math.round(viewportHeight / lineHeight); - if (viewportLineCount > expectedViewportLineCount) { - viewportLineCount = expectedViewportLineCount; - } - - if (minimapLinesFitting >= lineCount) { - // All lines fit in the minimap => no minimap scrolling - this.startLineNumber = 1; - this.endLineNumber = lineCount; + // The visible line count in a viewport can change due to a number of reasons: + // a) with the same viewport width, different scroll positions can result in partial lines being visible: + // e.g. for a line height of 20, and a viewport height of 600 + // * scrollTop = 0 => visible lines are [1, 30] + // * scrollTop = 10 => visible lines are [1, 31] (with lines 1 and 31 partially visible) + // * scrollTop = 20 => visible lines are [2, 31] + // b) whitespace gaps might make their way in the viewport (which results in a decrease in the visible line count) + // c) we could be in the scroll beyond last line case (which also results in a decrease in the visible line count, down to possibly only one line being visible) + + // We must first establish a desirable slider height. + let sliderHeight: number; + if (viewportContainsWhitespaceGaps && viewportEndLineNumber !== lineCount) { + // case b) from above: there are whitespace gaps in the viewport. + // In this case, the height of the slider directly reflects the visible line count. + const viewportLineCount = viewportEndLineNumber - viewportStartLineNumber + 1; + sliderHeight = Math.floor(viewportLineCount * minimapLineHeight / pixelRatio); } else { - // The desire is to align (centers) the minimap's slider with the scrollbar's slider - - // For a resolved this.startLineNumber, we can compute the minimap's slider's center with the following formula: - // scrollbarSliderCenter = (viewportStartLineNumber - this.startLineNumber + viewportLineCount/2) * minimapLineHeight / pixelRatio; - // => - // scrollbarSliderCenter = (viewportStartLineNumber - this.startLineNumber + viewportLineCount/2) * minimapLineHeight / pixelRatio; - // scrollbarSliderCenter * pixelRatio / minimapLineHeight = viewportStartLineNumber - this.startLineNumber + viewportLineCount/2 - // this.startLineNumber = viewportStartLineNumber + viewportLineCount/2 - scrollbarSliderCenter * pixelRatio / minimapLineHeight - let desiredStartLineNumber = Math.floor(viewportStartLineNumber + viewportLineCount / 2 - scrollbarSliderCenter * pixelRatio / minimapLineHeight); - let desiredEndLineNumber = desiredStartLineNumber + minimapLinesFitting - 1; - - // Aligning the slider's centers can result (correctly) in tremor. - // i.e. scrolling down might result in the startLineNumber going up. - // Avoid this tremor by being consistent w.r.t. the previous computed result - if (lastRenderData) { - const lastLayoutDecision = lastRenderData.renderedLayout; - if (lastLayoutDecision.viewportStartLineNumber <= viewportStartLineNumber) { - // going down => make sure we don't go above our previous decision - if (desiredStartLineNumber < lastLayoutDecision.startLineNumber) { - desiredStartLineNumber = lastLayoutDecision.startLineNumber; - desiredEndLineNumber = desiredStartLineNumber + minimapLinesFitting - 1; - } - } - if (lastLayoutDecision.viewportStartLineNumber >= viewportStartLineNumber) { - // going up => make sure we don't go below our previous decision - if (desiredEndLineNumber > lastLayoutDecision.endLineNumber) { - desiredEndLineNumber = lastLayoutDecision.endLineNumber; - desiredStartLineNumber = desiredEndLineNumber - minimapLinesFitting + 1; - } - } - } - - // Aligning the slider's centers is a very good thing, but this would make - // the minimap never scroll all the way to the top or to the bottom of the file. - // We therefore check that the viewport lines are in the minimap viewport. - - // (a) validate on start line number - if (desiredStartLineNumber < 1) { - // must start after 1 - desiredStartLineNumber = 1; - desiredEndLineNumber = desiredStartLineNumber + minimapLinesFitting - 1; - } - if (desiredStartLineNumber > viewportStartLineNumber) { - // must contain the viewport's start line number - desiredStartLineNumber = viewportStartLineNumber; - desiredEndLineNumber = desiredStartLineNumber + minimapLinesFitting - 1; - } - - // (b) validate on end line number - if (desiredEndLineNumber > lineCount) { - // must end before line count - desiredEndLineNumber = lineCount; - desiredStartLineNumber = desiredEndLineNumber - minimapLinesFitting + 1; - } - if (desiredEndLineNumber < viewportEndLineNumber) { - // must contain the viewport's end line number - desiredEndLineNumber = viewportEndLineNumber; - desiredStartLineNumber = desiredEndLineNumber - minimapLinesFitting + 1; - } - - this.startLineNumber = desiredStartLineNumber; - this.endLineNumber = desiredEndLineNumber; + // The slider has a stable height + const expectedViewportLineCount = viewportHeight / lineHeight; + sliderHeight = Math.floor(expectedViewportLineCount * minimapLineHeight / pixelRatio); } - this.sliderTop = Math.floor((viewportStartLineNumber - this.startLineNumber) * minimapLineHeight / pixelRatio); - if (viewportEndLineNumber === lineCount) { - // The last line is in the viewport => try to extend slider height below the painted lines - let desiredSliderHeight = Math.floor(expectedViewportLineCount * minimapLineHeight / pixelRatio); - if (this.sliderTop + desiredSliderHeight > options.minimapHeight) { - this.sliderHeight = options.minimapHeight - this.sliderTop; - } else { - this.sliderHeight = desiredSliderHeight; - } + let maxMinimapSliderTop: number; + if (options.scrollBeyondLastLine) { + // The minimap slider, when dragged all the way down, will contain the last line at its top + maxMinimapSliderTop = (lineCount - 1) * minimapLineHeight / pixelRatio; } else { - this.sliderHeight = Math.floor(viewportLineCount * minimapLineHeight / pixelRatio); + // The minimap slider, when dragged all the way down, will contain the last line at its bottom + maxMinimapSliderTop = Math.max(0, lineCount * minimapLineHeight / pixelRatio - sliderHeight); } - } -} + maxMinimapSliderTop = Math.min(options.minimapHeight - sliderHeight, maxMinimapSliderTop); -class RenderedLayout { - /** - * editor viewport start line number. - */ - public readonly viewportStartLineNumber: number; - /** - * editor viewport end line number. - */ - public readonly viewportEndLineNumber: number; + // The slider can move from 0 to `maxMinimapSliderTop` + // in the same way `scrollTop` can move from 0 to `scrollHeight` - `viewportHeight`. + const computedSliderRatio = (maxMinimapSliderTop) / (scrollHeight - viewportHeight); + const sliderTop = (scrollTop * computedSliderRatio); - /** - * minimap rendered start line number. - */ - public readonly startLineNumber: number; - /** - * minimap rendered end line number. - */ - public readonly endLineNumber: number; + if (minimapLinesFitting >= lineCount) { + // All lines fit in the minimap + const startLineNumber = 1; + const endLineNumber = lineCount; - constructor( - viewportStartLineNumber: number, - viewportEndLineNumber: number, - startLineNumber: number, - endLineNumber: number - ) { - this.viewportStartLineNumber = viewportStartLineNumber; - this.viewportEndLineNumber = viewportEndLineNumber; - this.startLineNumber = startLineNumber; - this.endLineNumber = endLineNumber; + return new MinimapLayout(scrollTop, computedSliderRatio, sliderTop, sliderHeight, startLineNumber, endLineNumber); + } else { + const startLineNumber = Math.max(1, Math.floor(viewportStartLineNumber - sliderTop * pixelRatio / minimapLineHeight)); + const endLineNumber = Math.min(lineCount, startLineNumber + minimapLinesFitting - 1); + + return new MinimapLayout(scrollTop, computedSliderRatio, sliderTop, sliderHeight, startLineNumber, endLineNumber); + } } } @@ -318,12 +289,12 @@ class RenderData { /** * last rendered layout. */ - public readonly renderedLayout: RenderedLayout; + public readonly renderedLayout: MinimapLayout; private readonly _imageData: ImageData; private readonly _renderedLines: RenderedLinesCollection; constructor( - renderedLayout: RenderedLayout, + renderedLayout: MinimapLayout, imageData: ImageData, lines: MinimapLine[] ) { @@ -335,6 +306,29 @@ class RenderData { this._renderedLines._set(renderedLayout.startLineNumber, lines); } + /** + * Check if the current RenderData matches accurately the new desired layout and no painting is needed. + */ + public linesEquals(layout: MinimapLayout): boolean { + if (this.renderedLayout.startLineNumber !== layout.startLineNumber) { + return false; + } + if (this.renderedLayout.endLineNumber !== layout.endLineNumber) { + return false; + } + + const tmp = this._renderedLines._get(); + const lines = tmp.lines; + for (let i = 0, len = lines.length; i < len; i++) { + if (lines[i].dy === -1) { + // This line is invalid + return false; + } + } + + return true; + } + _get(): { imageData: ImageData; rendLineNumberStart: number; lines: MinimapLine[]; } { let tmp = this._renderedLines._get(); return { @@ -413,12 +407,11 @@ class MinimapBuffers { export class Minimap extends ViewPart { - private readonly _editorScrollbar: EditorScrollbar; - private readonly _domNode: FastDomNode; private readonly _shadow: FastDomNode; private readonly _canvas: FastDomNode; private readonly _slider: FastDomNode; + private readonly _sliderHorizontal: FastDomNode; private readonly _tokensColorTracker: MinimapTokensColorTracker; private readonly _mouseDownListener: IDisposable; private readonly _sliderMouseMoveMonitor: GlobalMouseMoveMonitor; @@ -430,9 +423,8 @@ export class Minimap extends ViewPart { private _lastRenderData: RenderData; private _buffers: MinimapBuffers; - constructor(context: ViewContext, editorScrollbar: EditorScrollbar) { + constructor(context: ViewContext) { super(context); - this._editorScrollbar = editorScrollbar; this._options = new MinimapOptions(this._context.configuration); this._lastRenderData = null; @@ -440,7 +432,7 @@ export class Minimap extends ViewPart { this._domNode = createFastDomNode(document.createElement('div')); PartFingerprints.write(this._domNode, PartFingerprint.Minimap); - this._domNode.setClassName('minimap'); + this._domNode.setClassName(this._getMinimapDomNodeClassName()); this._domNode.setPosition('absolute'); this._domNode.setAttribute('role', 'presentation'); this._domNode.setAttribute('aria-hidden', 'true'); @@ -458,8 +450,14 @@ export class Minimap extends ViewPart { this._slider = createFastDomNode(document.createElement('div')); this._slider.setPosition('absolute'); this._slider.setClassName('minimap-slider'); + this._slider.setLayerHinting(true); this._domNode.appendChild(this._slider); + this._sliderHorizontal = createFastDomNode(document.createElement('div')); + this._sliderHorizontal.setPosition('absolute'); + this._sliderHorizontal.setClassName('minimap-slider-horizontal'); + this._slider.appendChild(this._sliderHorizontal); + this._tokensColorTracker = MinimapTokensColorTracker.getInstance(); this._minimapCharRenderer = getOrCreateMinimapCharRenderer(); @@ -494,45 +492,30 @@ export class Minimap extends ViewPart { this._sliderMouseDownListener = dom.addStandardDisposableListener(this._slider.domNode, 'mousedown', (e) => { e.preventDefault(); + if (e.leftButton && this._lastRenderData) { - if (e.leftButton) { + const initialMousePosition = e.posy; const initialMouseOrthogonalPosition = e.posx; - const initialScrollTop = this._context.viewLayout.getScrollTop(); - const initialSliderCenter = (this._slider.getTop() + this._slider.getHeight() / 2); - const draggingDeltaCenter = e.posy - initialSliderCenter; + const initialSliderState = this._lastRenderData.renderedLayout; this._slider.toggleClassName('active', true); this._sliderMouseMoveMonitor.startMonitoring( standardMouseMoveMerger, (mouseMoveData: IStandardMouseMoveEventData) => { - const mouseOrthogonalPosition = mouseMoveData.posx; - const mouseOrthogonalDelta = Math.abs(mouseOrthogonalPosition - initialMouseOrthogonalPosition); - if (platform.isWindows && mouseOrthogonalDelta > MOUSE_DRAG_RESET_DISTANCE) { - // The mouse has wondered away from the slider => reset dragging - this._context.viewLayout.setScrollPosition({ - scrollTop: initialScrollTop - }); - } else { - const pixelRatio = this._options.pixelRatio; - const minimapLineHeight = getMinimapLineHeight(this._options.renderMinimap); - const entireCanvasOuterHeight = this._context.model.getLineCount() * minimapLineHeight / pixelRatio; - const representableHeight = Math.min(entireCanvasOuterHeight, this._options.canvasOuterHeight); - - // Account for the fact that the minimap does not render the extra space below the viewport - let discountScrollHeight = 0; - if (this._context.configuration.editor.viewInfo.scrollBeyondLastLine) { - discountScrollHeight = this._canvas.getHeight() - this._context.configuration.editor.lineHeight; - } - const scrollHeight = this._context.viewLayout.getScrollHeight() - discountScrollHeight; - - const desiredSliderCenter = mouseMoveData.posy - draggingDeltaCenter; - const desiredScrollCenter = desiredSliderCenter * (scrollHeight / representableHeight); - const desiredScrollTop = desiredScrollCenter - this._canvas.getHeight() / 2; + const mouseOrthogonalDelta = Math.abs(mouseMoveData.posx - initialMouseOrthogonalPosition); + if (platform.isWindows && mouseOrthogonalDelta > MOUSE_DRAG_RESET_DISTANCE) { + // The mouse has wondered away from the scrollbar => reset dragging this._context.viewLayout.setScrollPosition({ - scrollTop: desiredScrollTop + scrollTop: initialSliderState.scrollTop }); + return; } + + const mouseDelta = mouseMoveData.posy - initialMousePosition; + this._context.viewLayout.setScrollPosition({ + scrollTop: initialSliderState.getDesiredScrollTopFromDelta(mouseDelta) + }); }, () => { this._slider.toggleClassName('active', false); @@ -549,6 +532,13 @@ export class Minimap extends ViewPart { super.dispose(); } + private _getMinimapDomNodeClassName(): string { + if (this._options.showSlider === 'always') { + return 'minimap slider-always'; + } + return 'minimap slider-mouseover'; + } + public getDomNode(): FastDomNode { return this._domNode; } @@ -585,6 +575,7 @@ export class Minimap extends ViewPart { this._lastRenderData = null; this._buffers = null; this._applyLayout(); + this._domNode.setClassName(this._getMinimapDomNodeClassName()); return true; } @@ -652,22 +643,45 @@ export class Minimap extends ViewPart { this._shadow.setClassName('minimap-shadow-visible'); } - const layout = new MinimapLayout( - this._lastRenderData, + const layout = MinimapLayout.create( this._options, renderingCtx.visibleRange.startLineNumber, renderingCtx.visibleRange.endLineNumber, renderingCtx.viewportHeight, + (renderingCtx.viewportData.whitespaceViewportData.length > 0), this._context.model.getLineCount(), - this._editorScrollbar.getVerticalSliderVerticalCenter() + renderingCtx.scrollTop, + renderingCtx.scrollHeight ); this._slider.setTop(layout.sliderTop); this._slider.setHeight(layout.sliderHeight); + // Compute horizontal slider coordinates + const scrollLeftChars = renderingCtx.scrollLeft / this._options.typicalHalfwidthCharacterWidth; + const horizontalSliderLeft = Math.min(this._options.minimapWidth, Math.round(scrollLeftChars * getMinimapCharWidth(this._options.renderMinimap) / this._options.pixelRatio)); + this._sliderHorizontal.setLeft(horizontalSliderLeft); + this._sliderHorizontal.setWidth(this._options.minimapWidth - horizontalSliderLeft); + this._sliderHorizontal.setTop(0); + this._sliderHorizontal.setHeight(layout.sliderHeight); + + this._lastRenderData = this.renderLines(layout); + } + + private renderLines(layout: MinimapLayout): RenderData { + const renderMinimap = this._options.renderMinimap; const startLineNumber = layout.startLineNumber; const endLineNumber = layout.endLineNumber; const minimapLineHeight = getMinimapLineHeight(renderMinimap); + // Check if nothing changed w.r.t. lines from last frame + if (this._lastRenderData && this._lastRenderData.linesEquals(layout)) { + const _lastData = this._lastRenderData._get(); + // Nice!! Nothing changed from last frame + return new RenderData(layout, _lastData.imageData, _lastData.lines); + } + + // Oh well!! We need to repaint some lines... + const imageData = this._getBuffer(); // Render untouched lines by using last rendered data. @@ -706,21 +720,16 @@ export class Minimap extends ViewPart { dy += minimapLineHeight; } + // Finally, paint to the canvas + const ctx = this._canvas.domNode.getContext('2d'); + ctx.putImageData(imageData, 0, 0); + // Save rendered data for reuse on next frame if possible - this._lastRenderData = new RenderData( - new RenderedLayout( - renderingCtx.visibleRange.startLineNumber, - renderingCtx.visibleRange.endLineNumber, - startLineNumber, - endLineNumber - ), + return new RenderData( + layout, imageData, renderedLines ); - - // Finally, paint to the canvas - const ctx = this._canvas.domNode.getContext('2d'); - ctx.putImageData(imageData, 0, 0); } private static _renderUntouchedLines( @@ -856,19 +865,22 @@ export class Minimap extends ViewPart { } registerThemingParticipant((theme, collector) => { - let sliderBackground = theme.getColor(scrollbarSliderBackground); + const sliderBackground = theme.getColor(scrollbarSliderBackground); if (sliderBackground) { - collector.addRule(`.monaco-editor .minimap-slider { background: ${sliderBackground}; }`); + const halfSliderBackground = sliderBackground.transparent(0.5); + collector.addRule(`.monaco-editor .minimap-slider, .monaco-editor .minimap-slider .minimap-slider-horizontal { background: ${halfSliderBackground}; }`); } - let sliderHoverBackground = theme.getColor(scrollbarSliderHoverBackground); + const sliderHoverBackground = theme.getColor(scrollbarSliderHoverBackground); if (sliderHoverBackground) { - collector.addRule(`.monaco-editor .minimap-slider:hover { background: ${sliderHoverBackground}; }`); + const halfSliderHoverBackground = sliderHoverBackground.transparent(0.5); + collector.addRule(`.monaco-editor .minimap-slider:hover, .monaco-editor .minimap-slider:hover .minimap-slider-horizontal { background: ${halfSliderHoverBackground}; }`); } - let sliderActiveBackground = theme.getColor(scrollbarSliderActiveBackground); + const sliderActiveBackground = theme.getColor(scrollbarSliderActiveBackground); if (sliderActiveBackground) { - collector.addRule(`.monaco-editor .minimap-slider.active { background: ${sliderActiveBackground}; }`); + const halfSliderActiveBackground = sliderActiveBackground.transparent(0.5); + collector.addRule(`.monaco-editor .minimap-slider.active, .monaco-editor .minimap-slider.active .minimap-slider-horizontal { background: ${halfSliderActiveBackground}; }`); } - let shadow = theme.getColor(scrollbarShadow); + const shadow = theme.getColor(scrollbarShadow); if (shadow) { collector.addRule(`.monaco-editor .minimap-shadow-visible { box-shadow: ${shadow} -6px 0 6px -6px inset; }`); } diff --git a/src/vs/editor/browser/viewParts/overviewRuler/decorationsOverviewRuler.ts b/src/vs/editor/browser/viewParts/overviewRuler/decorationsOverviewRuler.ts index 46c6d71d94139c9947fedbb5e094af50ddd69a1d..081179d2303749af2d9c730a7806f5ea48256e9a 100644 --- a/src/vs/editor/browser/viewParts/overviewRuler/decorationsOverviewRuler.ts +++ b/src/vs/editor/browser/viewParts/overviewRuler/decorationsOverviewRuler.ts @@ -16,6 +16,7 @@ import * as viewEvents from 'vs/editor/common/view/viewEvents'; import { OverviewRulerZone } from 'vs/editor/common/view/overviewZoneManager'; import { editorOverviewRulerBorder, editorCursor } from 'vs/editor/common/view/editorColorRegistry'; import { Color } from 'vs/base/common/color'; +import { ThemeColor } from "vs/platform/theme/common/themeService"; export class DecorationsOverviewRuler extends ViewPart { @@ -46,7 +47,6 @@ export class DecorationsOverviewRuler extends ViewPart { 'decorationsOverviewRuler', this._context.viewLayout.getScrollHeight(), this._context.configuration.editor.lineHeight, - this._context.configuration.editor.canUseTranslate3d, this._context.configuration.editor.pixelRatio, DecorationsOverviewRuler.MIN_DECORATION_HEIGHT, DecorationsOverviewRuler.MAX_DECORATION_HEIGHT, @@ -101,10 +101,6 @@ export class DecorationsOverviewRuler extends ViewPart { this._overviewRuler.setLineHeight(this._context.configuration.editor.lineHeight, false); } - if (e.canUseTranslate3d) { - this._overviewRuler.setCanUseTranslate3d(this._context.configuration.editor.canUseTranslate3d, false); - } - if (e.pixelRatio) { this._overviewRuler.setPixelRatio(this._context.configuration.editor.pixelRatio, false); } @@ -196,7 +192,7 @@ export class DecorationsOverviewRuler extends ViewPart { return zones; } - private resolveRulerColor(color: string | editorCommon.ThemeColor): string { + private resolveRulerColor(color: string | ThemeColor): string { if (editorCommon.isThemeColor(color)) { let c = this._context.theme.getColor(color.id) || Color.transparent; return c.toString(); diff --git a/src/vs/editor/browser/viewParts/overviewRuler/overviewRuler.ts b/src/vs/editor/browser/viewParts/overviewRuler/overviewRuler.ts index 65c793de87657822fc7b350ad27707b79a87edf6..bb2b4ee58cea82922620c472ab3993b768a17d9d 100644 --- a/src/vs/editor/browser/viewParts/overviewRuler/overviewRuler.ts +++ b/src/vs/editor/browser/viewParts/overviewRuler/overviewRuler.ts @@ -25,7 +25,6 @@ export class OverviewRuler extends ViewEventHandler implements IOverviewRuler { cssClassName, this._context.viewLayout.getScrollHeight(), this._context.configuration.editor.lineHeight, - this._context.configuration.editor.canUseTranslate3d, this._context.configuration.editor.pixelRatio, minimumHeight, maximumHeight, @@ -48,10 +47,6 @@ export class OverviewRuler extends ViewEventHandler implements IOverviewRuler { this._overviewRuler.setLineHeight(this._context.configuration.editor.lineHeight, true); } - if (e.canUseTranslate3d) { - this._overviewRuler.setCanUseTranslate3d(this._context.configuration.editor.canUseTranslate3d, true); - } - if (e.pixelRatio) { this._overviewRuler.setPixelRatio(this._context.configuration.editor.pixelRatio, true); } diff --git a/src/vs/editor/browser/viewParts/overviewRuler/overviewRulerImpl.ts b/src/vs/editor/browser/viewParts/overviewRuler/overviewRulerImpl.ts index 617a850a1d711c128a4e75879dca8f10439a23d7..2e6a03a39d836b7c52bccaa7580377f32f30ac51 100644 --- a/src/vs/editor/browser/viewParts/overviewRuler/overviewRulerImpl.ts +++ b/src/vs/editor/browser/viewParts/overviewRuler/overviewRulerImpl.ts @@ -17,12 +17,11 @@ export class OverviewRulerImpl { private _domNode: FastDomNode; private _lanesCount: number; private _zoneManager: OverviewZoneManager; - private _canUseTranslate3d: boolean; private _background: Color; constructor( canvasLeftOffset: number, cssClassName: string, scrollHeight: number, lineHeight: number, - canUseTranslate3d: boolean, pixelRatio: number, minimumHeight: number, maximumHeight: number, + pixelRatio: number, minimumHeight: number, maximumHeight: number, getVerticalOffsetForLine: (lineNumber: number) => number ) { this._canvasLeftOffset = canvasLeftOffset; @@ -31,10 +30,10 @@ export class OverviewRulerImpl { this._domNode.setClassName(cssClassName); this._domNode.setPosition('absolute'); + this._domNode.setLayerHinting(true); this._lanesCount = 3; - this._canUseTranslate3d = canUseTranslate3d; this._background = null; this._zoneManager = new OverviewZoneManager(getVerticalOffsetForLine); @@ -127,13 +126,6 @@ export class OverviewRulerImpl { } } - public setCanUseTranslate3d(canUseTranslate3d: boolean, render: boolean): void { - this._canUseTranslate3d = canUseTranslate3d; - if (render) { - this.render(true); - } - } - public setPixelRatio(pixelRatio: number, render: boolean): void { this._zoneManager.setPixelRatio(pixelRatio); this._domNode.setWidth(this._zoneManager.getDOMWidth()); @@ -156,11 +148,6 @@ export class OverviewRulerImpl { if (this._zoneManager.getOuterHeight() === 0) { return false; } - if (this._canUseTranslate3d) { - this._domNode.setTransform('translate3d(0px, 0px, 0px)'); - } else { - this._domNode.setTransform(''); - } const width = this._zoneManager.getCanvasWidth(); const height = this._zoneManager.getCanvasHeight(); diff --git a/src/vs/editor/browser/viewParts/rulers/rulers.css b/src/vs/editor/browser/viewParts/rulers/rulers.css index 3012d205f67d2af2ea70d998044b2659e578b2f4..d3d2d26ec95a3f8c6abb5f3ae0753781b38d7eaa 100644 --- a/src/vs/editor/browser/viewParts/rulers/rulers.css +++ b/src/vs/editor/browser/viewParts/rulers/rulers.css @@ -5,6 +5,5 @@ .monaco-editor .view-ruler { position: absolute; - width: 1px; top: 0; } \ No newline at end of file diff --git a/src/vs/editor/browser/viewParts/rulers/rulers.ts b/src/vs/editor/browser/viewParts/rulers/rulers.ts index 852eb07fb2c6a983b071f20f0bf90c52567a10b3..6a5e95b0b8cd02ee7460d007eacf6b03aeede325 100644 --- a/src/vs/editor/browser/viewParts/rulers/rulers.ts +++ b/src/vs/editor/browser/viewParts/rulers/rulers.ts @@ -13,6 +13,7 @@ import { RenderingContext, RestrictedRenderingContext } from 'vs/editor/common/v import * as viewEvents from 'vs/editor/common/view/viewEvents'; import { registerThemingParticipant } from 'vs/platform/theme/common/themeService'; import { editorRuler } from 'vs/editor/common/view/editorColorRegistry'; +import * as dom from 'vs/base/browser/dom'; export class Rulers extends ViewPart { @@ -69,11 +70,12 @@ export class Rulers extends ViewPart { } if (currentCount < desiredCount) { - // Add more rulers + const rulerWidth = dom.computeScreenAwareSize(1); let addCount = desiredCount - currentCount; while (addCount > 0) { let node = createFastDomNode(document.createElement('div')); node.setClassName('view-ruler'); + node.setWidth(rulerWidth); this.domNode.appendChild(node); this._renderedRulers.push(node); addCount--; diff --git a/src/vs/editor/browser/viewParts/scrollDecoration/scrollDecoration.ts b/src/vs/editor/browser/viewParts/scrollDecoration/scrollDecoration.ts index 92134f722a11fea796e9bf52e92ec7a06c024d75..e4086a1e00a59786a95b68825d153c8ad2bba125 100644 --- a/src/vs/editor/browser/viewParts/scrollDecoration/scrollDecoration.ts +++ b/src/vs/editor/browser/viewParts/scrollDecoration/scrollDecoration.ts @@ -11,8 +11,8 @@ import { ViewPart } from 'vs/editor/browser/view/viewPart'; import { ViewContext } from 'vs/editor/common/view/viewContext'; import { RenderingContext, RestrictedRenderingContext } from 'vs/editor/common/view/renderingContext'; import * as viewEvents from 'vs/editor/common/view/viewEvents'; -import { registerThemingParticipant } from "vs/platform/theme/common/themeService"; -import { scrollbarShadow } from "vs/platform/theme/common/colorRegistry"; +import { registerThemingParticipant } from 'vs/platform/theme/common/themeService'; +import { scrollbarShadow } from 'vs/platform/theme/common/colorRegistry'; export class ScrollDecorationViewPart extends ViewPart { diff --git a/src/vs/editor/browser/viewParts/selections/selections.ts b/src/vs/editor/browser/viewParts/selections/selections.ts index 9d8e0168f256b9ebc5aaa6be03d63e3a676f5542..25354eff6c3b0ee504515396c2955c35e7f842ec 100644 --- a/src/vs/editor/browser/viewParts/selections/selections.ts +++ b/src/vs/editor/browser/viewParts/selections/selections.ts @@ -7,7 +7,7 @@ import 'vs/css!./selections'; import { registerThemingParticipant } from 'vs/platform/theme/common/themeService'; -import { editorSelection, editorInactiveSelection, activeContrastBorder } from 'vs/platform/theme/common/colorRegistry'; +import { editorSelectionBackground, editorInactiveSelection, editorSelectionForeground } from 'vs/platform/theme/common/colorRegistry'; import { DynamicViewOverlay } from 'vs/editor/browser/view/dynamicViewOverlay'; import { ViewContext } from 'vs/editor/common/view/viewContext'; import { HorizontalRange, LineVisibleRanges, RenderingContext } from 'vs/editor/common/view/renderingContext'; @@ -394,7 +394,7 @@ export class SelectionsOverlay extends DynamicViewOverlay { } registerThemingParticipant((theme, collector) => { - let editorSelectionColor = theme.getColor(editorSelection); + let editorSelectionColor = theme.getColor(editorSelectionBackground); if (editorSelectionColor) { collector.addRule(`.monaco-editor .focused .selected-text { background-color: ${editorSelectionColor}; }`); } @@ -402,10 +402,8 @@ registerThemingParticipant((theme, collector) => { if (editorInactiveSelectionColor) { collector.addRule(`.monaco-editor .selected-text { background-color: ${editorInactiveSelectionColor}; }`); } - // IE/Edge specific rules - let outline = theme.getColor(activeContrastBorder); - if (outline) { - collector.addRule(`.monaco-editor.ie.hc-black .view-overlays.focused .selected-text { background: none; border: 2px solid ${outline}; }`); - collector.addRule(`.monaco-editor.edge.hc-black .view-overlays.focused .selected-text { background: none; border: 2px solid ${outline}; }`); + let editorSelectionForegroundColor = theme.getColor(editorSelectionForeground); + if (editorSelectionForegroundColor) { + collector.addRule(`.monaco-editor .view-line span.inline-selected-text { color: ${editorSelectionForegroundColor}; }`); } -}); \ No newline at end of file +}); diff --git a/src/vs/editor/browser/viewParts/viewCursors/viewCursor.ts b/src/vs/editor/browser/viewParts/viewCursors/viewCursor.ts index babe35b4178ae73431bb1f2c9869b32458b46e68..5288f92d7ea0c0ddf55c721e83643a92f87da188 100644 --- a/src/vs/editor/browser/viewParts/viewCursors/viewCursor.ts +++ b/src/vs/editor/browser/viewParts/viewCursors/viewCursor.ts @@ -12,6 +12,7 @@ import { Configuration } from 'vs/editor/browser/config/configuration'; import { ViewContext } from 'vs/editor/common/view/viewContext'; import { RenderingContext, RestrictedRenderingContext } from 'vs/editor/common/view/renderingContext'; import * as viewEvents from 'vs/editor/common/view/viewEvents'; +import * as dom from 'vs/base/browser/dom'; export interface IViewCursorRenderData { domNode: HTMLElement; @@ -137,9 +138,9 @@ export class ViewCursor { } let width: number; if (this._cursorStyle === TextEditorCursorStyle.Line) { - width = 2; + width = dom.computeScreenAwareSize(2); } else { - width = 1; + width = dom.computeScreenAwareSize(1); } const top = ctx.getVerticalOffsetForLineNumber(this._position.lineNumber) - ctx.bigNumbersDelta; return new ViewCursorRenderData(top, visibleRange.left, width, ''); diff --git a/src/vs/editor/browser/viewParts/viewZones/viewZones.ts b/src/vs/editor/browser/viewParts/viewZones/viewZones.ts index d91430803b3d717c0f7a11cc3d0c4e41c3885931..a02489ace2cbd68e5b286dd67e7f9d6129ef0a58 100644 --- a/src/vs/editor/browser/viewParts/viewZones/viewZones.ts +++ b/src/vs/editor/browser/viewParts/viewZones/viewZones.ts @@ -300,7 +300,7 @@ export class ViewZones extends ViewPart { } public render(ctx: RestrictedRenderingContext): void { - let visibleWhitespaces = this._context.viewLayout.getWhitespaceViewportData(); + const visibleWhitespaces = ctx.viewportData.whitespaceViewportData; let visibleZones: { [id: string]: IViewWhitespaceViewportData; } = {}; let hasVisibleZone = false; diff --git a/src/vs/editor/browser/widget/codeEditorWidget.ts b/src/vs/editor/browser/widget/codeEditorWidget.ts index 0749b9d91715e211858f580c7c51b7476217511a..6704c2bf751128a2229c943b9cf6a48438f8fed1 100644 --- a/src/vs/editor/browser/widget/codeEditorWidget.ts +++ b/src/vs/editor/browser/widget/codeEditorWidget.ts @@ -20,7 +20,6 @@ import { EditorAction } from 'vs/editor/common/editorCommonExtensions'; import { ICodeEditorService } from 'vs/editor/common/services/codeEditorService'; import { Configuration } from 'vs/editor/browser/config/configuration'; import * as editorBrowser from 'vs/editor/browser/editorBrowser'; -import { Colorizer } from 'vs/editor/browser/standalone/colorizer'; import { View, IOverlayWidgetData, IContentWidgetData } from 'vs/editor/browser/view/viewImpl'; import { Disposable } from 'vs/base/common/lifecycle'; import Event, { Emitter } from 'vs/base/common/event'; @@ -33,6 +32,7 @@ import { CoreEditorCommand } from 'vs/editor/common/controller/coreCommands'; import { IThemeService, registerThemingParticipant } from 'vs/platform/theme/common/themeService'; import { editorErrorForeground, editorErrorBorder, editorWarningForeground, editorWarningBorder } from 'vs/editor/common/view/editorColorRegistry'; import { Color } from 'vs/base/common/color'; +import { IMouseEvent } from "vs/base/browser/mouseEvent"; export abstract class CodeEditorWidget extends CommonCodeEditor implements editorBrowser.ICodeEditor { @@ -98,7 +98,7 @@ export abstract class CodeEditorWidget extends CommonCodeEditor implements edito this._themeService = themeService; this._focusTracker = new CodeEditorWidgetFocusTracker(domElement); - this._focusTracker.onChage(() => { + this._focusTracker.onChange(() => { let hasFocus = this._focusTracker.hasFocus(); if (hasFocus) { @@ -158,18 +158,6 @@ export abstract class CodeEditorWidget extends CommonCodeEditor implements edito super.dispose(); } - public colorizeModelLine(lineNumber: number, model: editorCommon.IModel = this.model): string { - if (!model) { - return ''; - } - let content = model.getLineContent(lineNumber); - model.forceTokenization(lineNumber); - let tokens = model.getLineTokens(lineNumber); - let inflatedTokens = tokens.inflate(); - let tabSize = model.getOptions().tabSize; - return Colorizer.colorizeLine(content, model.mightContainRTL(), inflatedTokens, tabSize); - } - public createOverviewRuler(cssClassName: string, minimumHeight: number, maximumHeight: number): editorBrowser.IOverviewRuler { return this._view.createOverviewRuler(cssClassName, minimumHeight, maximumHeight); } @@ -189,7 +177,7 @@ export abstract class CodeEditorWidget extends CommonCodeEditor implements edito return this.viewModel.coordinatesConverter.convertViewRangeToModelRange(viewRange); } - public delegateVerticalScrollbarMouseDown(browserEvent: MouseEvent): void { + public delegateVerticalScrollbarMouseDown(browserEvent: IMouseEvent): void { if (!this.hasView) { return; } @@ -524,7 +512,7 @@ class CodeEditorWidgetFocusTracker extends Disposable { private _domFocusTracker: dom.IFocusTracker; private _onChange: Emitter = this._register(new Emitter()); - public onChage: Event = this._onChange.event; + public onChange: Event = this._onChange.event; constructor(domElement: HTMLElement) { super(); diff --git a/src/vs/editor/browser/widget/diffEditorWidget.ts b/src/vs/editor/browser/widget/diffEditorWidget.ts index c655b958451ed7acbb3aac309c2b746b0b967b9b..ae109f4a30bc6a37fc2602681912505f28721db5 100644 --- a/src/vs/editor/browser/widget/diffEditorWidget.ts +++ b/src/vs/editor/browser/widget/diffEditorWidget.ts @@ -36,7 +36,7 @@ import { scrollbarShadow, diffInserted, diffRemoved, defaultInsertColor, default import { Color } from 'vs/base/common/color'; import { OverviewRulerZone } from 'vs/editor/common/view/overviewZoneManager'; import { IEditorWhitespace } from 'vs/editor/common/viewLayout/whitespaceComputer'; -import { ModelDecorationOptions } from "vs/editor/common/model/textModelWithDecorations"; +import { ModelDecorationOptions } from 'vs/editor/common/model/textModelWithDecorations'; interface IEditorDiffDecorations { decorations: editorCommon.IModelDeltaDecoration[]; @@ -249,7 +249,7 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE this._overviewDomElement.appendChild(this._overviewViewportDomElement.domNode); - this._register(dom.addDisposableListener(this._overviewDomElement, 'mousedown', (e: MouseEvent) => { + this._register(dom.addStandardDisposableListener(this._overviewDomElement, 'mousedown', (e) => { this.modifiedEditor.delegateVerticalScrollbarMouseDown(e); })); this._containerDomElement.appendChild(this._overviewDomElement); @@ -803,7 +803,9 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE private _beginUpdateDecorations(): void { this._beginUpdateDecorationsTimeout = -1; - if (!this.modifiedEditor.getModel()) { + const currentOriginalModel = this.originalEditor.getModel(); + const currentModifiedModel = this.modifiedEditor.getModel(); + if (!currentOriginalModel || !currentModifiedModel) { return; } @@ -812,8 +814,6 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE // yet supported, so using tokens for now. this._diffComputationToken++; let currentToken = this._diffComputationToken; - let currentOriginalModel = this.originalEditor.getModel(); - let currentModifiedModel = this.modifiedEditor.getModel(); this._editorWorkerService.computeDiff(currentOriginalModel.uri, currentModifiedModel.uri, this._ignoreTrimWhitespace).then((result) => { if (currentToken === this._diffComputationToken diff --git a/src/vs/editor/contrib/diffNavigator/common/diffNavigator.ts b/src/vs/editor/browser/widget/diffNavigator.ts similarity index 100% rename from src/vs/editor/contrib/diffNavigator/common/diffNavigator.ts rename to src/vs/editor/browser/widget/diffNavigator.ts diff --git a/src/vs/editor/browser/widget/media/editor.css b/src/vs/editor/browser/widget/media/editor.css index ca070ab9a21f7f51692ee62e824d444728abbd1a..3266ae96364c4db4c22551dc7956266b9c44dc02 100644 --- a/src/vs/editor/browser/widget/media/editor.css +++ b/src/vs/editor/browser/widget/media/editor.css @@ -21,7 +21,6 @@ position: relative; overflow: visible; -webkit-text-size-adjust: 100%; - -ms-high-contrast-adjust: none; -webkit-font-feature-settings: "liga" off, "calt" off; font-feature-settings: "liga" off, "calt" off; } diff --git a/src/vs/editor/browser/widget/media/tokens.css b/src/vs/editor/browser/widget/media/tokens.css index 5050a5358709ec9aa8280dc38f9145139669d97d..3b0784d077acf6755c433b459147d2e0abec1426 100644 --- a/src/vs/editor/browser/widget/media/tokens.css +++ b/src/vs/editor/browser/widget/media/tokens.css @@ -6,6 +6,4 @@ .monaco-editor .vs-whitespace { display:inline-block; } -.monaco-editor.hc-black .view-line { - mix-blend-mode: difference; -} + diff --git a/src/vs/editor/common/commands/shiftCommand.ts b/src/vs/editor/common/commands/shiftCommand.ts index 77a59b0238533837b1aa8a1259be0e4565ec00a3..209e93d7fcb5ea27768715794a27d1ed519a48c0 100644 --- a/src/vs/editor/common/commands/shiftCommand.ts +++ b/src/vs/editor/common/commands/shiftCommand.ts @@ -7,7 +7,7 @@ import * as strings from 'vs/base/common/strings'; import { CursorColumns } from 'vs/editor/common/controller/cursorCommon'; import { Range } from 'vs/editor/common/core/range'; -import { Selection } from 'vs/editor/common/core/selection'; +import { Selection, SelectionDirection } from 'vs/editor/common/core/selection'; import { ICommand, ICursorStateComputerData, IEditOperationBuilder, ITokenizedModel } from 'vs/editor/common/editorCommon'; import { LanguageConfigurationRegistry } from 'vs/editor/common/modes/languageConfigurationRegistry'; import { CharCode } from 'vs/base/common/charCode'; @@ -45,11 +45,13 @@ export class ShiftCommand implements ICommand { private _selection: Selection; private _selectionId: string; private _useLastEditRangeForCursorEndPosition: boolean; + private _selectionStartColumnStaysPut: boolean; constructor(range: Selection, opts: IShiftCommandOpts) { this._opts = opts; this._selection = range; this._useLastEditRangeForCursorEndPosition = false; + this._selectionStartColumnStaysPut = false; } private _addEditOperation(builder: IEditOperationBuilder, range: Range, text: string) { @@ -156,6 +158,10 @@ export class ShiftCommand implements ICommand { } this._addEditOperation(builder, new Range(lineNumber, 1, lineNumber, indentationEndIndex + 1), indents[desiredIndentCount]); + if (lineNumber === startLine) { + // Force the startColumn to stay put because we're inserting after it + this._selectionStartColumnStaysPut = (this._selection.startColumn <= indentationEndIndex + 1); + } } } else { @@ -197,6 +203,10 @@ export class ShiftCommand implements ICommand { this._addEditOperation(builder, new Range(lineNumber, 1, lineNumber, indentationEndIndex + 1), ''); } else { this._addEditOperation(builder, new Range(lineNumber, 1, lineNumber, 1), oneIndent); + if (lineNumber === startLine) { + // Force the startColumn to stay put because we're inserting after it + this._selectionStartColumnStaysPut = (this._selection.startColumn === 1); + } } } } @@ -209,6 +219,22 @@ export class ShiftCommand implements ICommand { let lastOp = helper.getInverseEditOperations()[0]; return new Selection(lastOp.range.endLineNumber, lastOp.range.endColumn, lastOp.range.endLineNumber, lastOp.range.endColumn); } - return helper.getTrackedSelection(this._selectionId); + const result = helper.getTrackedSelection(this._selectionId); + + if (this._selectionStartColumnStaysPut) { + // The selection start should not move + let initialStartColumn = this._selection.startColumn; + let resultStartColumn = result.startColumn; + if (resultStartColumn <= initialStartColumn) { + return result; + } + + if (result.getDirection() === SelectionDirection.LTR) { + return new Selection(result.startLineNumber, initialStartColumn, result.endLineNumber, result.endColumn); + } + return new Selection(result.endLineNumber, result.endColumn, result.startLineNumber, initialStartColumn); + } + + return result; } } diff --git a/src/vs/editor/common/commonCodeEditor.ts b/src/vs/editor/common/commonCodeEditor.ts index d8b808d3f066144e9091f2bd3fdd2215025f4c0e..c636c9f8f5fc354a70481e44fba9f5a3b7020e2f 100644 --- a/src/vs/editor/common/commonCodeEditor.ts +++ b/src/vs/editor/common/commonCodeEditor.ts @@ -28,8 +28,8 @@ import { import * as editorOptions from 'vs/editor/common/config/editorOptions'; import { ICursorPositionChangedEvent, ICursorSelectionChangedEvent } from 'vs/editor/common/controller/cursorEvents'; import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import { CommonEditorRegistry } from "vs/editor/common/editorCommonExtensions"; -import { VerticalRevealType } from "vs/editor/common/view/viewEvents"; +import { CommonEditorRegistry } from 'vs/editor/common/editorCommonExtensions'; +import { VerticalRevealType } from 'vs/editor/common/view/viewEvents'; let EDITOR_ID = 0; @@ -858,6 +858,7 @@ export abstract class CommonCodeEditor extends Disposable implements editorCommo if (this.model) { this.domElement.setAttribute('data-mode-id', this.model.getLanguageIdentifier().language); this._configuration.setIsDominatedByLongLines(this.model.isDominatedByLongLines()); + this._configuration.setMaxLineNumber(this.model.getLineCount()); this.model.onBeforeAttached(); diff --git a/src/vs/editor/common/config/commonEditorConfig.ts b/src/vs/editor/common/config/commonEditorConfig.ts index bf24f6608befdded78097d81277b6013ed9c8740..763e88b140a5f23b0f34dbd0993d0c8085720677 100644 --- a/src/vs/editor/common/config/commonEditorConfig.ts +++ b/src/vs/editor/common/config/commonEditorConfig.ts @@ -10,7 +10,7 @@ import { Disposable } from 'vs/base/common/lifecycle'; import * as objects from 'vs/base/common/objects'; import * as platform from 'vs/base/common/platform'; import { Extensions, IConfigurationRegistry, IConfigurationNode } from 'vs/platform/configuration/common/configurationRegistry'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import * as editorCommon from 'vs/editor/common/editorCommon'; import { FontInfo, BareFontInfo } from 'vs/editor/common/config/fontInfo'; import { EditorZoom } from 'vs/editor/common/config/editorZoom'; @@ -55,7 +55,6 @@ export interface IEnvConfiguration { extraEditorClassName: string; outerWidth: number; outerHeight: number; - canUseTranslate3d: boolean; emptySelectionClipboard: boolean; pixelRatio: number; zoomLevel: number; @@ -76,7 +75,12 @@ export abstract class CommonEditorConfiguration extends Disposable implements ed constructor(options: editorOptions.IEditorOptions) { super(); + // Do a "deep clone of sorts" on the incoming options this._rawOptions = objects.mixin({}, options || {}); + this._rawOptions.scrollbar = objects.mixin({}, this._rawOptions.scrollbar || {}); + this._rawOptions.minimap = objects.mixin({}, this._rawOptions.minimap || {}); + this._rawOptions.find = objects.mixin({}, this._rawOptions.find || {}); + this._validatedOptions = editorOptions.EditorOptionsValidator.validate(this._rawOptions, EDITOR_DEFAULTS); this.editor = null; this._isDominatedByLongLines = false; @@ -120,7 +124,6 @@ export abstract class CommonEditorConfiguration extends Disposable implements ed extraEditorClassName: partialEnv.extraEditorClassName, isDominatedByLongLines: this._isDominatedByLongLines, lineNumbersDigitCount: this._lineNumbersDigitCount, - canUseTranslate3d: partialEnv.canUseTranslate3d, emptySelectionClipboard: partialEnv.emptySelectionClipboard, pixelRatio: partialEnv.pixelRatio, tabFocusMode: TabFocus.getTabFocusMode(), @@ -249,6 +252,12 @@ const editorConfiguration: IConfigurationNode = { 'default': EDITOR_DEFAULTS.viewInfo.minimap.enabled, 'description': nls.localize('minimap.enabled', "Controls if the minimap is shown") }, + 'editor.minimap.showSlider': { + 'type': 'string', + 'enum': ['always', 'mouseover'], + 'default': EDITOR_DEFAULTS.viewInfo.minimap.showSlider, + 'description': nls.localize('minimap.showSlider', "Controls whether the minimap slider is automatically hidden.") + }, 'editor.minimap.renderCharacters': { 'type': 'boolean', 'default': EDITOR_DEFAULTS.viewInfo.minimap.renderCharacters, @@ -321,11 +330,21 @@ const editorConfiguration: IConfigurationNode = { 'default': EDITOR_DEFAULTS.viewInfo.scrollbar.mouseWheelScrollSensitivity, 'description': nls.localize('mouseWheelScrollSensitivity', "A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events") }, - 'editor.multicursorModifier': { + 'editor.multiCursorModifier': { 'type': 'string', - 'enum': (platform.isMacintosh ? ['cmd', 'alt'] : ['ctrl', 'alt']), + 'enum': ['ctrlCmd', 'alt'], + 'enumDescriptions': [ + nls.localize('multiCursorModifier.ctrlCmd', "Maps to `Control` on Windows and Linux and to `Command` on OSX."), + nls.localize('multiCursorModifier.alt', "Maps to `Alt` on Windows and Linux and to `Option` on OSX.") + ], 'default': 'alt', - 'description': nls.localize('multicursorModifier', "The modifier to be used to add multiple cursors with the mouse.") + 'description': nls.localize({ + key: 'multiCursorModifier', + comment: [ + '- `ctrlCmd` refers to a value the setting can take and should not be localized.', + '- `Control` and `Command` refer to the modifier keys Ctrl or Cmd on the keyboard and can be localized.' + ] + }, "The modifier to be used to add multiple cursors with the mouse. `ctrlCmd` maps to `Control` on Windows and Linux and to `Command` on OSX. The Go To Definition and Open Link mouse gestures will adapt such that they do not conflict with the multicursor modifier.") }, 'editor.quickSuggestions': { 'anyOf': [ @@ -365,7 +384,7 @@ const editorConfiguration: IConfigurationNode = { 'editor.parameterHints': { 'type': 'boolean', 'default': EDITOR_DEFAULTS.contribInfo.parameterHints, - 'description': nls.localize('parameterHints', "Enables parameter hints") + 'description': nls.localize('parameterHints', "Enables pop-up that shows parameter documentation and type information as you type") }, 'editor.autoClosingBrackets': { 'type': 'boolean', @@ -382,6 +401,11 @@ const editorConfiguration: IConfigurationNode = { 'default': EDITOR_DEFAULTS.contribInfo.formatOnPaste, 'description': nls.localize('formatOnPaste', "Controls if the editor should automatically format the pasted content. A formatter must be available and the formatter should be able to format a range in a document.") }, + 'editor.autoIndent': { + 'type': 'boolean', + 'default': EDITOR_DEFAULTS.autoIndent, + 'description': nls.localize('autoIndent', "Controls if the editor should automatically adjust the indenation when users type, paste or move lines. Indentation Rules of the language must be available. ") + }, 'editor.suggestOnTriggerCharacters': { 'type': 'boolean', 'default': EDITOR_DEFAULTS.contribInfo.suggestOnTriggerCharacters, @@ -541,6 +565,22 @@ const editorConfiguration: IConfigurationNode = { 'default': EDITOR_DEFAULTS.dragAndDrop, 'description': nls.localize('dragAndDrop', "Controls if the editor should allow to move selections via drag and drop.") }, + 'editor.accessibilitySupport': { + 'type': 'string', + 'enum': ['auto', 'on', 'off'], + 'enumDescriptions': [ + nls.localize('accessibilitySupport.auto', "The editor will use platform APIs to detect when a Screen Reader is attached."), + nls.localize('accessibilitySupport.on', "The editor will be permanently optimized for usage with a Screen Reader."), + nls.localize('accessibilitySupport.off', "The editor will never be optimized for usage with a Screen Reader."), + ], + 'default': EDITOR_DEFAULTS.accessibilitySupport, + 'description': nls.localize('accessibilitySupport', "Controls whether the editor should run in a mode where it is optimized for screen readers.") + }, + 'editor.links': { + 'type': 'boolean', + 'default': EDITOR_DEFAULTS.contribInfo.links, + 'description': nls.localize('links', "Controls whether the editor should detect links and make them clickable") + }, 'diffEditor.renderSideBySide': { 'type': 'boolean', 'default': true, diff --git a/src/vs/editor/common/config/editorOptions.ts b/src/vs/editor/common/config/editorOptions.ts index 720302d227e308a6b8fc716f7e91869f6a5fb4a2..5c90ebb782f30bb2a073a839e4693821542f2850 100644 --- a/src/vs/editor/common/config/editorOptions.ts +++ b/src/vs/editor/common/config/editorOptions.ts @@ -97,6 +97,11 @@ export interface IEditorMinimapOptions { * Defaults to false. */ enabled?: boolean; + /** + * Control the rendering of the minimap slider. + * Defaults to 'mouseover'. + */ + showSlider?: 'always' | 'mouseover'; /** * Render the actual text on a line (as opposed to color blocks). * Defaults to true. @@ -241,10 +246,11 @@ export interface IEditorOptions { */ fontLigatures?: boolean; /** - * Disable the use of `translate3d`. + * Disable the use of `will-change` for the editor margin and lines layers. + * The usage of `will-change` acts as a hint for browsers to create an extra layer. * Defaults to false. */ - disableTranslate3d?: boolean; + disableLayerHinting?: boolean; /** * Disable the optimizations for monospace fonts. * Defaults to false. @@ -321,6 +327,11 @@ export interface IEditorOptions { * Defaults to true. */ hover?: boolean; + /** + * Enable detecting links and making them clickable. + * Defaults to true. + */ + links?: boolean; /** * Enable custom contextmenu. * Defaults to true. @@ -335,7 +346,12 @@ export interface IEditorOptions { * The modifier to be used to add multiple cursors with the mouse. * Defaults to 'alt' */ - multicursorModifier?: 'cmd' | 'ctrl' | 'alt'; + multiCursorModifier?: 'ctrlCmd' | 'alt'; + /** + * Configure the editor's accessibility support. + * Defaults to 'auto'. It is best to leave this to 'auto'. + */ + accessibilitySupport?: 'auto' | 'off' | 'on'; /** * Enable quick suggestions (shadow suggestions) * Defaults to true. @@ -360,6 +376,11 @@ export interface IEditorOptions { * Defaults to true. */ autoClosingBrackets?: boolean; + /** + * Enable auto indentation adjustment. + * Defaults to false. + */ + autoIndent?: boolean; /** * Enable format on type. * Defaults to false. @@ -686,6 +707,7 @@ export interface InternalEditorScrollbarOptions { export interface InternalEditorMinimapOptions { readonly enabled: boolean; + readonly showSlider: 'always' | 'mouseover'; readonly renderCharacters: boolean; readonly maxColumn: number; } @@ -740,6 +762,7 @@ export interface InternalEditorViewOptions { export interface EditorContribOptions { readonly selectionClipboard: boolean; readonly hover: boolean; + readonly links: boolean; readonly contextmenu: boolean; readonly quickSuggestions: boolean | { other: boolean, comments: boolean, strings: boolean }; readonly quickSuggestionsDelay: number; @@ -775,7 +798,7 @@ export interface IValidatedEditorOptions { readonly lineDecorationsWidth: number | string; readonly readOnly: boolean; readonly mouseStyle: 'text' | 'default' | 'copy'; - readonly disableTranslate3d: boolean; + readonly disableLayerHinting: boolean; readonly automaticLayout: boolean; readonly wordWrap: 'off' | 'on' | 'wordWrapColumn' | 'bounded'; readonly wordWrapColumn: number; @@ -785,10 +808,12 @@ export interface IValidatedEditorOptions { readonly wordWrapBreakAfterCharacters: string; readonly wordWrapBreakObtrusiveCharacters: string; readonly autoClosingBrackets: boolean; + readonly autoIndent: boolean; readonly dragAndDrop: boolean; readonly emptySelectionClipboard: boolean; readonly useTabStops: boolean; - readonly multicursorModifier: 'altKey' | 'ctrlKey' | 'metaKey'; + readonly multiCursorModifier: 'altKey' | 'ctrlKey' | 'metaKey'; + readonly accessibilitySupport: 'auto' | 'off' | 'on'; readonly viewInfo: InternalEditorViewOptions; readonly contribInfo: EditorContribOptions; @@ -800,7 +825,7 @@ export interface IValidatedEditorOptions { export class InternalEditorOptions { readonly _internalEditorOptionsBrand: void; - readonly canUseTranslate3d: boolean; + readonly canUseLayerHinting: boolean; readonly pixelRatio: number; readonly editorClassName: string; readonly lineHeight: number; @@ -809,11 +834,12 @@ export class InternalEditorOptions { * @internal */ readonly accessibilitySupport: platform.AccessibilitySupport; - readonly multicursorModifier: 'altKey' | 'ctrlKey' | 'metaKey'; + readonly multiCursorModifier: 'altKey' | 'ctrlKey' | 'metaKey'; // ---- cursor options readonly wordSeparators: string; readonly autoClosingBrackets: boolean; + readonly autoIndent: boolean; readonly useTabStops: boolean; readonly tabFocusMode: boolean; readonly dragAndDrop: boolean; @@ -830,15 +856,16 @@ export class InternalEditorOptions { * @internal */ constructor(source: { - canUseTranslate3d: boolean; + canUseLayerHinting: boolean; pixelRatio: number; editorClassName: string; lineHeight: number; readOnly: boolean; accessibilitySupport: platform.AccessibilitySupport; - multicursorModifier: 'altKey' | 'ctrlKey' | 'metaKey'; + multiCursorModifier: 'altKey' | 'ctrlKey' | 'metaKey'; wordSeparators: string; autoClosingBrackets: boolean; + autoIndent: boolean; useTabStops: boolean; tabFocusMode: boolean; dragAndDrop: boolean; @@ -849,15 +876,16 @@ export class InternalEditorOptions { wrappingInfo: EditorWrappingInfo; contribInfo: EditorContribOptions; }) { - this.canUseTranslate3d = source.canUseTranslate3d; + this.canUseLayerHinting = source.canUseLayerHinting; this.pixelRatio = source.pixelRatio; this.editorClassName = source.editorClassName; this.lineHeight = source.lineHeight | 0; this.readOnly = source.readOnly; this.accessibilitySupport = source.accessibilitySupport; - this.multicursorModifier = source.multicursorModifier; + this.multiCursorModifier = source.multiCursorModifier; this.wordSeparators = source.wordSeparators; this.autoClosingBrackets = source.autoClosingBrackets; + this.autoIndent = source.autoIndent; this.useTabStops = source.useTabStops; this.tabFocusMode = source.tabFocusMode; this.dragAndDrop = source.dragAndDrop; @@ -874,15 +902,16 @@ export class InternalEditorOptions { */ public equals(other: InternalEditorOptions): boolean { return ( - this.canUseTranslate3d === other.canUseTranslate3d + this.canUseLayerHinting === other.canUseLayerHinting && this.pixelRatio === other.pixelRatio && this.editorClassName === other.editorClassName && this.lineHeight === other.lineHeight && this.readOnly === other.readOnly && this.accessibilitySupport === other.accessibilitySupport - && this.multicursorModifier === other.multicursorModifier + && this.multiCursorModifier === other.multiCursorModifier && this.wordSeparators === other.wordSeparators && this.autoClosingBrackets === other.autoClosingBrackets + && this.autoIndent === other.autoIndent && this.useTabStops === other.useTabStops && this.tabFocusMode === other.tabFocusMode && this.dragAndDrop === other.dragAndDrop @@ -900,15 +929,16 @@ export class InternalEditorOptions { */ public createChangeEvent(newOpts: InternalEditorOptions): IConfigurationChangedEvent { return { - canUseTranslate3d: (this.canUseTranslate3d !== newOpts.canUseTranslate3d), + canUseLayerHinting: (this.canUseLayerHinting !== newOpts.canUseLayerHinting), pixelRatio: (this.pixelRatio !== newOpts.pixelRatio), editorClassName: (this.editorClassName !== newOpts.editorClassName), lineHeight: (this.lineHeight !== newOpts.lineHeight), readOnly: (this.readOnly !== newOpts.readOnly), accessibilitySupport: (this.accessibilitySupport !== newOpts.accessibilitySupport), - multicursorModifier: (this.multicursorModifier !== newOpts.multicursorModifier), + multiCursorModifier: (this.multiCursorModifier !== newOpts.multiCursorModifier), wordSeparators: (this.wordSeparators !== newOpts.wordSeparators), autoClosingBrackets: (this.autoClosingBrackets !== newOpts.autoClosingBrackets), + autoIndent: (this.autoIndent !== newOpts.autoIndent), useTabStops: (this.useTabStops !== newOpts.useTabStops), tabFocusMode: (this.tabFocusMode !== newOpts.tabFocusMode), dragAndDrop: (this.dragAndDrop !== newOpts.dragAndDrop), @@ -917,7 +947,7 @@ export class InternalEditorOptions { fontInfo: (!this.fontInfo.equals(newOpts.fontInfo)), viewInfo: (!InternalEditorOptions._equalsViewOptions(this.viewInfo, newOpts.viewInfo)), wrappingInfo: (!InternalEditorOptions._equalsWrappingInfo(this.wrappingInfo, newOpts.wrappingInfo)), - contribInfo: (!InternalEditorOptions._equalsContribOptions(this.contribInfo, newOpts.contribInfo)), + contribInfo: (!InternalEditorOptions._equalsContribOptions(this.contribInfo, newOpts.contribInfo)) }; } @@ -1022,6 +1052,7 @@ export class InternalEditorOptions { private static _equalsMinimapOptions(a: InternalEditorMinimapOptions, b: InternalEditorMinimapOptions): boolean { return ( a.enabled === b.enabled + && a.showSlider === b.showSlider && a.renderCharacters === b.renderCharacters && a.maxColumn === b.maxColumn ); @@ -1074,6 +1105,7 @@ export class InternalEditorOptions { return ( a.selectionClipboard === b.selectionClipboard && a.hover === b.hover + && a.links === b.links && a.contextmenu === b.contextmenu && InternalEditorOptions._equalsQuickSuggestions(a.quickSuggestions, b.quickSuggestions) && a.quickSuggestionsDelay === b.quickSuggestionsDelay @@ -1238,15 +1270,16 @@ export interface EditorLayoutInfo { * An event describing that the configuration of the editor has changed. */ export interface IConfigurationChangedEvent { - readonly canUseTranslate3d: boolean; + readonly canUseLayerHinting: boolean; readonly pixelRatio: boolean; readonly editorClassName: boolean; readonly lineHeight: boolean; readonly readOnly: boolean; readonly accessibilitySupport: boolean; - readonly multicursorModifier: boolean; + readonly multiCursorModifier: boolean; readonly wordSeparators: boolean; readonly autoClosingBrackets: boolean; + readonly autoIndent: boolean; readonly useTabStops: boolean; readonly tabFocusMode: boolean; readonly dragAndDrop: boolean; @@ -1268,7 +1301,6 @@ export interface IEnvironmentalOptions { readonly extraEditorClassName: string; readonly isDominatedByLongLines: boolean; readonly lineNumbersDigitCount: number; - readonly canUseTranslate3d: boolean; readonly emptySelectionClipboard: boolean; readonly pixelRatio: number; readonly tabFocusMode: boolean; @@ -1399,22 +1431,14 @@ export class EditorOptionsValidator { const contribInfo = this._sanitizeContribInfo(opts, defaults.contribInfo); let configuredMulticursorModifier: 'altKey' | 'metaKey' | 'ctrlKey'; - if (typeof opts.multicursorModifier === 'string') { - if (platform.isMacintosh) { - if (opts.multicursorModifier === 'cmd') { - configuredMulticursorModifier = 'metaKey'; - } else { - configuredMulticursorModifier = 'altKey'; - } + if (typeof opts.multiCursorModifier === 'string') { + if (opts.multiCursorModifier === 'ctrlCmd') { + configuredMulticursorModifier = platform.isMacintosh ? 'metaKey' : 'ctrlKey'; } else { - if (opts.multicursorModifier === 'ctrl') { - configuredMulticursorModifier = 'ctrlKey'; - } else { - configuredMulticursorModifier = 'altKey'; - } + configuredMulticursorModifier = 'altKey'; } } - const multicursorModifier = _stringSet<'altKey' | 'metaKey' | 'ctrlKey'>(configuredMulticursorModifier, defaults.multicursorModifier, ['altKey', 'metaKey', 'ctrlKey']); + const multiCursorModifier = _stringSet<'altKey' | 'metaKey' | 'ctrlKey'>(configuredMulticursorModifier, defaults.multiCursorModifier, ['altKey', 'metaKey', 'ctrlKey']); return { inDiffEditor: _boolean(opts.inDiffEditor, defaults.inDiffEditor), @@ -1423,7 +1447,7 @@ export class EditorOptionsValidator { lineDecorationsWidth: (typeof opts.lineDecorationsWidth === 'undefined' ? defaults.lineDecorationsWidth : opts.lineDecorationsWidth), readOnly: _boolean(opts.readOnly, defaults.readOnly), mouseStyle: _stringSet<'text' | 'default' | 'copy'>(opts.mouseStyle, defaults.mouseStyle, ['text', 'default', 'copy']), - disableTranslate3d: _boolean(opts.disableTranslate3d, defaults.disableTranslate3d), + disableLayerHinting: _boolean(opts.disableLayerHinting, defaults.disableLayerHinting), automaticLayout: _boolean(opts.automaticLayout, defaults.automaticLayout), wordWrap: wordWrap, wordWrapColumn: _clampedInt(opts.wordWrapColumn, defaults.wordWrapColumn, 1, Constants.MAX_SAFE_SMALL_INTEGER), @@ -1433,10 +1457,12 @@ export class EditorOptionsValidator { wordWrapBreakAfterCharacters: _string(opts.wordWrapBreakAfterCharacters, defaults.wordWrapBreakAfterCharacters), wordWrapBreakObtrusiveCharacters: _string(opts.wordWrapBreakObtrusiveCharacters, defaults.wordWrapBreakObtrusiveCharacters), autoClosingBrackets: _boolean(opts.autoClosingBrackets, defaults.autoClosingBrackets), + autoIndent: _boolean(opts.autoIndent, defaults.autoIndent), dragAndDrop: _boolean(opts.dragAndDrop, defaults.dragAndDrop), emptySelectionClipboard: _boolean(opts.emptySelectionClipboard, defaults.emptySelectionClipboard), useTabStops: _boolean(opts.useTabStops, defaults.useTabStops), - multicursorModifier: multicursorModifier, + multiCursorModifier: multiCursorModifier, + accessibilitySupport: _stringSet<'auto' | 'on' | 'off'>(opts.accessibilitySupport, defaults.accessibilitySupport, ['auto', 'on', 'off']), viewInfo: viewInfo, contribInfo: contribInfo, }; @@ -1475,6 +1501,7 @@ export class EditorOptionsValidator { } return { enabled: _boolean(opts.enabled, defaults.enabled), + showSlider: _stringSet<'always' | 'mouseover'>(opts.showSlider, defaults.showSlider, ['always', 'mouseover']), renderCharacters: _boolean(opts.renderCharacters, defaults.renderCharacters), maxColumn: _clampedInt(opts.maxColumn, defaults.maxColumn, 1, 10000), }; @@ -1605,6 +1632,7 @@ export class EditorOptionsValidator { return { selectionClipboard: _boolean(opts.selectionClipboard, defaults.selectionClipboard), hover: _boolean(opts.hover, defaults.hover), + links: _boolean(opts.links, defaults.links), contextmenu: _boolean(opts.contextmenu, defaults.contextmenu), quickSuggestions: quickSuggestions, quickSuggestionsDelay: _clampedInt(opts.quickSuggestionsDelay, defaults.quickSuggestionsDelay, Constants.MIN_SAFE_SMALL_INTEGER, Constants.MAX_SAFE_SMALL_INTEGER), @@ -1635,11 +1663,9 @@ export class EditorOptionsValidator { */ export class InternalEditorOptionsFactory { - private static _handlePerformanceCritical(opts: IValidatedEditorOptions, performanceCritical: boolean): IValidatedEditorOptions { - if (!performanceCritical) { - return opts; - } - + private static _tweakValidatedOptions(opts: IValidatedEditorOptions, accessibilitySupport: platform.AccessibilitySupport): IValidatedEditorOptions { + const accessibilityIsOn = (accessibilitySupport === platform.AccessibilitySupport.Enabled); + const accessibilityIsOff = (accessibilitySupport === platform.AccessibilitySupport.Disabled); return { inDiffEditor: opts.inDiffEditor, wordSeparators: opts.wordSeparators, @@ -1647,7 +1673,7 @@ export class InternalEditorOptionsFactory { lineDecorationsWidth: opts.lineDecorationsWidth, readOnly: opts.readOnly, mouseStyle: opts.mouseStyle, - disableTranslate3d: opts.disableTranslate3d, + disableLayerHinting: opts.disableLayerHinting, automaticLayout: opts.automaticLayout, wordWrap: opts.wordWrap, wordWrapColumn: opts.wordWrapColumn, @@ -1657,23 +1683,25 @@ export class InternalEditorOptionsFactory { wordWrapBreakAfterCharacters: opts.wordWrapBreakAfterCharacters, wordWrapBreakObtrusiveCharacters: opts.wordWrapBreakObtrusiveCharacters, autoClosingBrackets: opts.autoClosingBrackets, + autoIndent: opts.autoIndent, dragAndDrop: opts.dragAndDrop, emptySelectionClipboard: opts.emptySelectionClipboard, useTabStops: opts.useTabStops, - multicursorModifier: opts.multicursorModifier, + multiCursorModifier: opts.multiCursorModifier, + accessibilitySupport: opts.accessibilitySupport, viewInfo: { extraEditorClassName: opts.viewInfo.extraEditorClassName, disableMonospaceOptimizations: opts.viewInfo.disableMonospaceOptimizations, rulers: opts.viewInfo.rulers, - ariaLabel: opts.viewInfo.ariaLabel, + ariaLabel: (accessibilityIsOff ? nls.localize('accessibilityOffAriaLabel', "The editor is not accessible at this time. Press Alt+F1 for options.") : opts.viewInfo.ariaLabel), renderLineNumbers: opts.viewInfo.renderLineNumbers, renderCustomLineNumbers: opts.viewInfo.renderCustomLineNumbers, renderRelativeLineNumbers: opts.viewInfo.renderRelativeLineNumbers, selectOnLineNumbers: opts.viewInfo.selectOnLineNumbers, glyphMargin: opts.viewInfo.glyphMargin, revealHorizontalRightPadding: opts.viewInfo.revealHorizontalRightPadding, - roundedSelection: false, // DISABLED + roundedSelection: (accessibilityIsOn ? false : opts.viewInfo.roundedSelection), // DISABLED WHEN SCREEN READER IS ATTACHED overviewRulerLanes: opts.viewInfo.overviewRulerLanes, overviewRulerBorder: opts.viewInfo.overviewRulerBorder, cursorBlinking: opts.viewInfo.cursorBlinking, @@ -1682,15 +1710,16 @@ export class InternalEditorOptionsFactory { hideCursorInOverviewRuler: opts.viewInfo.hideCursorInOverviewRuler, scrollBeyondLastLine: opts.viewInfo.scrollBeyondLastLine, stopRenderingLineAfter: opts.viewInfo.stopRenderingLineAfter, - renderWhitespace: 'none', // DISABLED - renderControlCharacters: false, // DISABLED - fontLigatures: false, // DISABLED - renderIndentGuides: false, // DISABLED - renderLineHighlight: 'none', // DISABLED + renderWhitespace: (accessibilityIsOn ? 'none' : opts.viewInfo.renderWhitespace), // DISABLED WHEN SCREEN READER IS ATTACHED + renderControlCharacters: (accessibilityIsOn ? false : opts.viewInfo.renderControlCharacters), // DISABLED WHEN SCREEN READER IS ATTACHED + fontLigatures: (accessibilityIsOn ? false : opts.viewInfo.fontLigatures), // DISABLED WHEN SCREEN READER IS ATTACHED + renderIndentGuides: (accessibilityIsOn ? false : opts.viewInfo.renderIndentGuides), // DISABLED WHEN SCREEN READER IS ATTACHED + renderLineHighlight: (accessibilityIsOn ? 'none' : opts.viewInfo.renderLineHighlight), // DISABLED WHEN SCREEN READER IS ATTACHED scrollbar: opts.viewInfo.scrollbar, minimap: { - enabled: false, // DISABLED + enabled: (accessibilityIsOn ? false : opts.viewInfo.minimap.enabled), // DISABLED WHEN SCREEN READER IS ATTACHED renderCharacters: opts.viewInfo.minimap.renderCharacters, + showSlider: opts.viewInfo.minimap.showSlider, maxColumn: opts.viewInfo.minimap.maxColumn }, fixedOverflowWidgets: opts.viewInfo.fixedOverflowWidgets @@ -1699,6 +1728,7 @@ export class InternalEditorOptionsFactory { contribInfo: { selectionClipboard: opts.contribInfo.selectionClipboard, hover: opts.contribInfo.hover, + links: (accessibilityIsOn ? false : opts.contribInfo.links), // DISABLED WHEN SCREEN READER IS ATTACHED contextmenu: opts.contribInfo.contextmenu, quickSuggestions: opts.contribInfo.quickSuggestions, quickSuggestionsDelay: opts.contribInfo.quickSuggestionsDelay, @@ -1713,12 +1743,12 @@ export class InternalEditorOptionsFactory { wordBasedSuggestions: opts.contribInfo.wordBasedSuggestions, suggestFontSize: opts.contribInfo.suggestFontSize, suggestLineHeight: opts.contribInfo.suggestLineHeight, - selectionHighlight: false, // DISABLED - occurrencesHighlight: false, // DISABLED - codeLens: false, // DISABLED - folding: false, // DISABLED + selectionHighlight: (accessibilityIsOn ? false : opts.contribInfo.selectionHighlight), // DISABLED WHEN SCREEN READER IS ATTACHED + occurrencesHighlight: (accessibilityIsOn ? false : opts.contribInfo.occurrencesHighlight), // DISABLED WHEN SCREEN READER IS ATTACHED + codeLens: (accessibilityIsOn ? false : opts.contribInfo.codeLens), // DISABLED WHEN SCREEN READER IS ATTACHED + folding: (accessibilityIsOn ? false : opts.contribInfo.folding), // DISABLED WHEN SCREEN READER IS ATTACHED showFoldingControls: opts.contribInfo.showFoldingControls, - matchBrackets: false, // DISABLED + matchBrackets: (accessibilityIsOn ? false : opts.contribInfo.matchBrackets), // DISABLED WHEN SCREEN READER IS ATTACHED find: opts.contribInfo.find } }; @@ -1726,9 +1756,19 @@ export class InternalEditorOptionsFactory { public static createInternalEditorOptions(env: IEnvironmentalOptions, _opts: IValidatedEditorOptions) { + let accessibilitySupport: platform.AccessibilitySupport; + if (_opts.accessibilitySupport === 'auto') { + // The editor reads the `accessibilitySupport` from the environment + accessibilitySupport = env.accessibilitySupport; + } else if (_opts.accessibilitySupport === 'on') { + accessibilitySupport = platform.AccessibilitySupport.Enabled; + } else { + accessibilitySupport = platform.AccessibilitySupport.Disabled; + } + // Disable some non critical features to get as best performance as possible // See https://github.com/Microsoft/vscode/issues/26730 - const opts = this._handlePerformanceCritical(_opts, (env.accessibilitySupport === platform.AccessibilitySupport.Enabled)); + const opts = this._tweakValidatedOptions(_opts, accessibilitySupport); let lineDecorationsWidth: number; if (typeof opts.lineDecorationsWidth === 'string' && /^\d+(\.\d+)?ch$/.test(opts.lineDecorationsWidth)) { @@ -1768,7 +1808,17 @@ export class InternalEditorOptionsFactory { const wordWrapColumn = opts.wordWrapColumn; const wordWrapMinified = opts.wordWrapMinified; - if (wordWrapMinified && env.isDominatedByLongLines) { + if (accessibilitySupport === platform.AccessibilitySupport.Enabled) { + // See https://github.com/Microsoft/vscode/issues/27766 + // Never enable wrapping when a screen reader is attached + // because arrow down etc. will not move the cursor in the way + // a screen reader expects. + bareWrappingInfo = { + isWordWrapMinified: false, + isViewportWrapping: false, + wrappingColumn: -1 + }; + } else if (wordWrapMinified && env.isDominatedByLongLines) { // Force viewport width wrapping if model is dominated by long lines bareWrappingInfo = { isWordWrapMinified: true, @@ -1831,15 +1881,16 @@ export class InternalEditorOptionsFactory { } return new InternalEditorOptions({ - canUseTranslate3d: opts.disableTranslate3d ? false : env.canUseTranslate3d, + canUseLayerHinting: opts.disableLayerHinting ? false : true, pixelRatio: env.pixelRatio, editorClassName: className, lineHeight: env.fontInfo.lineHeight, readOnly: opts.readOnly, - accessibilitySupport: env.accessibilitySupport, - multicursorModifier: opts.multicursorModifier, + accessibilitySupport: accessibilitySupport, + multiCursorModifier: opts.multiCursorModifier, wordSeparators: opts.wordSeparators, autoClosingBrackets: opts.autoClosingBrackets, + autoIndent: opts.autoIndent, useTabStops: opts.useTabStops, tabFocusMode: opts.readOnly ? true : env.tabFocusMode, dragAndDrop: opts.dragAndDrop, @@ -2043,20 +2094,22 @@ export const EDITOR_DEFAULTS: IValidatedEditorOptions = { lineDecorationsWidth: 10, readOnly: false, mouseStyle: 'text', - disableTranslate3d: false, + disableLayerHinting: false, automaticLayout: false, wordWrap: 'off', wordWrapColumn: 80, wordWrapMinified: true, wrappingIndent: WrappingIndent.Same, wordWrapBreakBeforeCharacters: '([{‘“〈《「『【〔([{「£¥$£¥++', - wordWrapBreakAfterCharacters: ' \t})]?|&,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー’”〉》」』】〕)]}」', + wordWrapBreakAfterCharacters: ' \t})]?|&,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」', wordWrapBreakObtrusiveCharacters: '.', autoClosingBrackets: true, - dragAndDrop: false, + autoIndent: true, + dragAndDrop: true, emptySelectionClipboard: true, useTabStops: true, - multicursorModifier: 'altKey', + multiCursorModifier: 'altKey', + accessibilitySupport: 'auto', viewInfo: { extraEditorClassName: '', @@ -2081,7 +2134,7 @@ export const EDITOR_DEFAULTS: IValidatedEditorOptions = { renderWhitespace: 'none', renderControlCharacters: false, fontLigatures: false, - renderIndentGuides: false, + renderIndentGuides: true, renderLineHighlight: 'line', scrollbar: { vertical: ScrollbarVisibility.Auto, @@ -2098,7 +2151,8 @@ export const EDITOR_DEFAULTS: IValidatedEditorOptions = { mouseWheelScrollSensitivity: 1, }, minimap: { - enabled: false, + enabled: true, + showSlider: 'mouseover', renderCharacters: true, maxColumn: 120 }, @@ -2108,6 +2162,7 @@ export const EDITOR_DEFAULTS: IValidatedEditorOptions = { contribInfo: { selectionClipboard: true, hover: true, + links: true, contextmenu: true, quickSuggestions: { other: true, comments: false, strings: false }, quickSuggestionsDelay: 10, diff --git a/src/vs/editor/common/config/fontInfo.ts b/src/vs/editor/common/config/fontInfo.ts index 7740776bebfb27d3f5ac80796381eecbaeacac86..af6a2d8287372834273dfe9671fedd8b569b5f18 100644 --- a/src/vs/editor/common/config/fontInfo.ts +++ b/src/vs/editor/common/config/fontInfo.ts @@ -6,7 +6,7 @@ import * as platform from 'vs/base/common/platform'; import { EditorZoom } from 'vs/editor/common/config/editorZoom'; -import { EDITOR_FONT_DEFAULTS } from "vs/editor/common/config/editorOptions"; +import { EDITOR_FONT_DEFAULTS } from 'vs/editor/common/config/editorOptions'; /** * Determined from empirical observations. @@ -86,7 +86,7 @@ export class BareFontInfo { lineHeight = 8; } - let letterSpacing = safeParseFloat(opts.letterSpacing, 0);; + let letterSpacing = safeParseFloat(opts.letterSpacing, 0); letterSpacing = clamp(letterSpacing, -20, 20); let editorZoomLevelMultiplier = 1 + (EditorZoom.getZoomLevel() * 0.1); diff --git a/src/vs/editor/common/controller/accGenerator.ts b/src/vs/editor/common/controller/accGenerator.ts deleted file mode 100644 index 6f6bb813e6b2f529b72017a5230aed62dbb3b6a1..0000000000000000000000000000000000000000 --- a/src/vs/editor/common/controller/accGenerator.ts +++ /dev/null @@ -1,194 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -'use strict'; - -import { Position } from 'vs/editor/common/core/position'; -import * as nls from 'vs/nls'; -import { Range } from 'vs/editor/common/core/range'; -import { IModel } from "vs/editor/common/editorCommon"; -import { Selection } from 'vs/editor/common/core/selection'; - -export class ScreenReaderMessageGenerator { - - public static xSelected(x: string): string { - return nls.localize( - { - key: 'x.selected', - comment: ['A piece of text was added to the selection (this should be a message suitable for a Screen Reader).'] - }, - "{0}\nSelected", - x - ); - } - - public static xUnselected(x: string): string { - return nls.localize( - { - key: 'x.unselected', - comment: ['A piece of text was removed from the selection (this should be a message suitable for a Screen Reader).'] - }, - "{0}\nUnselected", - x - ); - } - - public static xCharsSelected(x: number): string { - return nls.localize( - { - key: 'x.chars.selected', - comment: ['A large number of characters were added to the selection (this should be a message suitable for a Screen Reader).'] - }, - "{0}\nCharacters selected", - x - ); - } - - public static xCharsUnselected(x: number): string { - return nls.localize( - { - key: 'x.chars.unselected', - comment: ['A large number of characters were removed from the selection (this should be a message suitable for a Screen Reader).'] - }, - "{0}\nCharacters unselected", - x - ); - } - - public static generateMessage(source: string, model: IModel, oldModelId: number, oldSelection: Selection, newModelId: number, newSelection: Selection): string { - if (oldModelId === newModelId) { - return this._cursorChangeMessage(source, model, oldSelection, newSelection); - } - return 'TODO'; - } - - private static _cursorChangeMessage(source: string, model: IModel, oldSelection: Selection, newSelection: Selection): string { - if (oldSelection.equalsRange(newSelection)) { - return ''; - } - - if (oldSelection.isEmpty()) { - - if (newSelection.isEmpty()) { - // ...[]... => ...[]... - return this._cursorMoveMessage(source, model, oldSelection.getPosition(), newSelection.getPosition()); - } - - // ...[]... => ...[x]...: - return this._cursorSelectedMessage(model, newSelection); - } - - if (newSelection.isEmpty()) { - if (oldSelection.containsPosition(newSelection.getPosition())) { - // ...a[xy]b... => ...a[]xyb... or ...ax[]yb... or ...axy[]b... - return this._cursorUnselectedMessage(model, oldSelection); - } - - // moved away from the old selection and collapsed it - return this._cursorMoveMessage(source, model, oldSelection.getPosition(), newSelection.getPosition()) + '\n' + this._cursorUnselectedMessage(model, oldSelection); - } - - // ...[x]... => ...[y]... - - if (newSelection.getStartPosition().equals(oldSelection.getStartPosition())) { - - // ...a[x]... => ...a[y]... - - if (newSelection.getEndPosition().isBefore(oldSelection.getEndPosition())) { - // ...a[xy]... => ...a[x]y... - return this._cursorUnselectedMessage(model, new Range(newSelection.endLineNumber, newSelection.endColumn, oldSelection.endLineNumber, oldSelection.endColumn)); - - } - - // ...a[x]y... => ...a[xy]... - return this._cursorSelectedMessage(model, new Range(oldSelection.endLineNumber, oldSelection.endColumn, newSelection.endLineNumber, newSelection.endColumn)); - - } - - if (newSelection.getEndPosition().equals(oldSelection.getEndPosition())) { - - // ...[x]a... => ...[y]a... - - if (newSelection.getStartPosition().isBefore(oldSelection.getStartPosition())) { - // ...y[x]a... => ...[yx]a... - return this._cursorSelectedMessage(model, new Range(newSelection.startLineNumber, newSelection.startColumn, oldSelection.startLineNumber, oldSelection.startColumn)); - } - - // ...[yx]a... => ...y[x]a... - return this._cursorUnselectedMessage(model, new Range(oldSelection.startLineNumber, oldSelection.startColumn, newSelection.startLineNumber, newSelection.startColumn)); - - } - - // weird jump - return this._cursorSelectedMessage(model, newSelection) + '\n' + this._cursorUnselectedMessage(model, oldSelection); - - } - - private static _cursorMoveMessage(source: string, model: IModel, oldPosition: Position, newPosition: Position): string { - - if (source === 'moveWordCommand') { - return model.getValueInRange(new Range(oldPosition.lineNumber, oldPosition.column, newPosition.lineNumber, newPosition.column)); - } - - const oldLineNumber = oldPosition.lineNumber; - const oldColumn = oldPosition.column; - const newLineNumber = newPosition.lineNumber; - const newColumn = newPosition.column; - - // check going down via right arrow - if (newLineNumber === oldLineNumber + 1 && newColumn === 1 && oldColumn === model.getLineMaxColumn(oldLineNumber)) { - return this._cursorCharMessage(model, newPosition); - } - - // check going up via up arrow - if (newLineNumber === oldLineNumber - 1 && newColumn === model.getLineMaxColumn(newLineNumber) && oldColumn === 1) { - return this._cursorCharMessage(model, newPosition); - } - - const lineCount = model.getLineCount(); - if (oldLineNumber !== newLineNumber) { - if (newLineNumber === lineCount) { - // Last line does not have an EOL - return model.getLineContent(newLineNumber); - } - return model.getLineContent(newLineNumber) + model.getEOL(); - } - - return this._cursorCharMessage(model, newPosition); - } - - private static _cursorCharMessage(model: IModel, position: Position): string { - const lineNumber = position.lineNumber; - const column = position.column; - - const maxLineColumn = model.getLineMaxColumn(lineNumber); - if (column === maxLineColumn) { - const lineCount = model.getLineCount(); - if (lineNumber === lineCount) { - // At the end of the file - return ''; - } - return model.getEOL(); - } - return model.getLineContent(lineNumber).charAt(column - 1); - } - - private static _cursorSelectedMessage(model: IModel, range: Range): string { - const valueLength = model.getValueLengthInRange(range); - if (valueLength > 512) { - return this.xCharsSelected(valueLength); - } - return this.xSelected(model.getValueInRange(range)); - } - - private static _cursorUnselectedMessage(model: IModel, range: Range): string { - const valueLength = model.getValueLengthInRange(range); - if (valueLength > 512) { - return this.xCharsUnselected(valueLength); - } - return this.xUnselected(model.getValueInRange(range)); - } - -} diff --git a/src/vs/editor/common/controller/coreCommands.ts b/src/vs/editor/common/controller/coreCommands.ts index 639022470cd8efcd6ab32fae54aed33df289fa8f..3794e7ace1361d2383fb50f6e3f10d6b5580f203 100644 --- a/src/vs/editor/common/controller/coreCommands.ts +++ b/src/vs/editor/common/controller/coreCommands.ts @@ -23,9 +23,9 @@ import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; import * as types from 'vs/base/common/types'; import { ICommandHandlerDescription } from 'vs/platform/commands/common/commands'; import { IEditorService } from 'vs/platform/editor/common/editor'; -import { TypeOperations } from "vs/editor/common/controller/cursorTypeOperations"; -import { DeleteOperations } from "vs/editor/common/controller/cursorDeleteOperations"; -import { VerticalRevealType } from "vs/editor/common/view/viewEvents"; +import { TypeOperations } from 'vs/editor/common/controller/cursorTypeOperations'; +import { DeleteOperations } from 'vs/editor/common/controller/cursorDeleteOperations'; +import { VerticalRevealType } from 'vs/editor/common/view/viewEvents'; const CORE_WEIGHT = KeybindingsRegistry.WEIGHT.editorCore(); @@ -815,7 +815,7 @@ export namespace CoreNavigationCommands { weight: CORE_WEIGHT, kbExpr: EditorContextKeys.textFocus, primary: KeyCode.Home, - mac: { primary: KeyCode.Home, secondary: [KeyMod.CtrlCmd | KeyCode.LeftArrow, KeyMod.WinCtrl | KeyCode.KEY_A] } + mac: { primary: KeyCode.Home, secondary: [KeyMod.CtrlCmd | KeyCode.LeftArrow] } } })); @@ -831,6 +831,44 @@ export namespace CoreNavigationCommands { } })); + export const CursorLineStart: CoreEditorCommand = registerEditorCommand(new class extends CoreEditorCommand { + constructor() { + super({ + id: 'cursorLineStart', + precondition: null, + kbOpts: { + weight: CORE_WEIGHT, + kbExpr: EditorContextKeys.textFocus, + primary: 0, + mac: { primary: KeyMod.WinCtrl | KeyCode.KEY_A } + } + }); + } + + public runCoreEditorCommand(cursors: ICursors, args: any): void { + cursors.context.model.pushStackElement(); + cursors.setStates( + args.source, + CursorChangeReason.Explicit, + CursorState.ensureInEditableRange( + cursors.context, + this._exec(cursors.context, cursors.getAll()) + ) + ); + cursors.reveal(true, RevealTarget.Primary); + } + + private _exec(context: CursorContext, cursors: CursorState[]): CursorState[] { + let result: CursorState[] = []; + for (let i = 0, len = cursors.length; i < len; i++) { + const cursor = cursors[i]; + const lineNumber = cursor.modelState.position.lineNumber; + result[i] = CursorState.fromModelState(cursor.modelState.move(false, lineNumber, 1, 0)); + } + return result; + } + }); + class EndCommand extends CoreEditorCommand { private readonly _inSelectionMode: boolean; @@ -862,7 +900,7 @@ export namespace CoreNavigationCommands { weight: CORE_WEIGHT, kbExpr: EditorContextKeys.textFocus, primary: KeyCode.End, - mac: { primary: KeyCode.End, secondary: [KeyMod.CtrlCmd | KeyCode.RightArrow, KeyMod.WinCtrl | KeyCode.KEY_E] } + mac: { primary: KeyCode.End, secondary: [KeyMod.CtrlCmd | KeyCode.RightArrow] } } })); @@ -878,6 +916,45 @@ export namespace CoreNavigationCommands { } })); + export const CursorLineEnd: CoreEditorCommand = registerEditorCommand(new class extends CoreEditorCommand { + constructor() { + super({ + id: 'cursorLineEnd', + precondition: null, + kbOpts: { + weight: CORE_WEIGHT, + kbExpr: EditorContextKeys.textFocus, + primary: 0, + mac: { primary: KeyMod.WinCtrl | KeyCode.KEY_E } + } + }); + } + + public runCoreEditorCommand(cursors: ICursors, args: any): void { + cursors.context.model.pushStackElement(); + cursors.setStates( + args.source, + CursorChangeReason.Explicit, + CursorState.ensureInEditableRange( + cursors.context, + this._exec(cursors.context, cursors.getAll()) + ) + ); + cursors.reveal(true, RevealTarget.Primary); + } + + private _exec(context: CursorContext, cursors: CursorState[]): CursorState[] { + let result: CursorState[] = []; + for (let i = 0, len = cursors.length; i < len; i++) { + const cursor = cursors[i]; + const lineNumber = cursor.modelState.position.lineNumber; + const maxColumn = context.model.getLineMaxColumn(lineNumber); + result[i] = CursorState.fromModelState(cursor.modelState.move(false, lineNumber, maxColumn, 0)); + } + return result; + } + }); + class TopCommand extends CoreEditorCommand { private readonly _inSelectionMode: boolean; diff --git a/src/vs/editor/common/controller/cursor.ts b/src/vs/editor/common/controller/cursor.ts index 305894d79b67a40e2b69012dccbf1e78612c4e16..3084299a2fec8eef81bf14710cc87347ade87720 100644 --- a/src/vs/editor/common/controller/cursor.ts +++ b/src/vs/editor/common/controller/cursor.ts @@ -18,7 +18,7 @@ import { DeleteOperations } from 'vs/editor/common/controller/cursorDeleteOperat import { TypeOperations } from 'vs/editor/common/controller/cursorTypeOperations'; import { TextModelEventType, ModelRawContentChangedEvent, RawContentChangedType } from 'vs/editor/common/model/textModelEvents'; import { CursorChangeReason } from 'vs/editor/common/controller/cursorEvents'; -import { IViewModel } from "vs/editor/common/viewModel/viewModel"; +import { IViewModel } from 'vs/editor/common/viewModel/viewModel'; import * as viewEvents from 'vs/editor/common/view/viewEvents'; import Event, { Emitter } from 'vs/base/common/event'; // import { ScreenReaderMessageGenerator } from "vs/editor/common/controller/accGenerator"; @@ -313,6 +313,10 @@ export class Cursor extends viewEvents.ViewEventEmitter implements ICursors { return this._cursors.getSelections(); } + public getViewSelections(): Selection[] { + return this._cursors.getViewSelections(); + } + public getPosition(): Position { return this._cursors.getPrimaryCursor().modelState.position; } diff --git a/src/vs/editor/common/controller/cursorCommon.ts b/src/vs/editor/common/controller/cursorCommon.ts index e82708d17da1a1bb9cf863828f0ee41c5d8239cf..eb7b37719647c35a9e8fed4c81b91269800d4d3e 100644 --- a/src/vs/editor/common/controller/cursorCommon.ts +++ b/src/vs/editor/common/controller/cursorCommon.ts @@ -18,7 +18,7 @@ import { IAutoClosingPair } from 'vs/editor/common/modes/languageConfiguration'; import { IConfigurationChangedEvent } from 'vs/editor/common/config/editorOptions'; import { IViewModel } from 'vs/editor/common/viewModel/viewModel'; import { CursorChangeReason } from 'vs/editor/common/controller/cursorEvents'; -import { VerticalRevealType } from "vs/editor/common/view/viewEvents"; +import { VerticalRevealType } from 'vs/editor/common/view/viewEvents'; export interface IColumnSelectData { toViewLineNumber: number; @@ -64,6 +64,7 @@ export class CursorConfiguration { public readonly wordSeparators: string; public readonly emptySelectionClipboard: boolean; public readonly autoClosingBrackets: boolean; + public readonly autoIndent: boolean; public readonly autoClosingPairsOpen: CharacterMap; public readonly autoClosingPairsClose: CharacterMap; public readonly surroundingPairs: CharacterMap; @@ -99,6 +100,7 @@ export class CursorConfiguration { this.wordSeparators = c.wordSeparators; this.emptySelectionClipboard = c.emptySelectionClipboard; this.autoClosingBrackets = c.autoClosingBrackets; + this.autoIndent = c.autoIndent; this.autoClosingPairsOpen = {}; this.autoClosingPairsClose = {}; diff --git a/src/vs/editor/common/controller/cursorDeleteOperations.ts b/src/vs/editor/common/controller/cursorDeleteOperations.ts index c968bb49f76c645c729bcbcd398e4b3724782342..7951ab91b83e9afe62d94f507321d5bb9f3e66e3 100644 --- a/src/vs/editor/common/controller/cursorDeleteOperations.ts +++ b/src/vs/editor/common/controller/cursorDeleteOperations.ts @@ -10,7 +10,7 @@ import { Range } from 'vs/editor/common/core/range'; import { Selection } from 'vs/editor/common/core/selection'; import { MoveOperations } from 'vs/editor/common/controller/cursorMoveOperations'; import * as strings from 'vs/base/common/strings'; -import { ICommand } from "vs/editor/common/editorCommon"; +import { ICommand } from 'vs/editor/common/editorCommon'; export class DeleteOperations { diff --git a/src/vs/editor/common/controller/cursorMoveCommands.ts b/src/vs/editor/common/controller/cursorMoveCommands.ts index c4fd36b4b6e714fd40b9d40ac75af130e65735bb..97925d92dcced20b395d570f2a4216d129142961 100644 --- a/src/vs/editor/common/controller/cursorMoveCommands.ts +++ b/src/vs/editor/common/controller/cursorMoveCommands.ts @@ -38,20 +38,78 @@ export class CursorMoveCommands { let result: CursorState[] = []; for (let i = 0, len = cursors.length; i < len; i++) { const cursor = cursors[i]; - result[i] = CursorState.fromViewState(MoveOperations.moveToBeginningOfLine(context.config, context.viewModel, cursor.viewState, inSelectionMode)); + result[i] = this._moveToLineStart(context, cursor, inSelectionMode); } + return result; } + private static _moveToLineStart(context: CursorContext, cursor: CursorState, inSelectionMode: boolean): CursorState { + const currentViewStateColumn = cursor.viewState.position.column; + const currentModelStateColumn = cursor.modelState.position.column; + const isFirstLineOfWrappedLine = currentViewStateColumn === currentModelStateColumn; + + const currentViewStatelineNumber = cursor.viewState.position.lineNumber; + const firstNonBlankColumn = context.viewModel.getLineFirstNonWhitespaceColumn(currentViewStatelineNumber); + const isBeginningOfViewLine = currentViewStateColumn === firstNonBlankColumn; + + if (!isFirstLineOfWrappedLine && !isBeginningOfViewLine) { + return this._moveToLineStartByView(context, cursor, inSelectionMode); + } else { + return this._moveToLineStartByModel(context, cursor, inSelectionMode); + } + } + + private static _moveToLineStartByView(context: CursorContext, cursor: CursorState, inSelectionMode: boolean): CursorState { + return CursorState.fromViewState( + MoveOperations.moveToBeginningOfLine(context.config, context.viewModel, cursor.viewState, inSelectionMode) + ); + } + + private static _moveToLineStartByModel(context: CursorContext, cursor: CursorState, inSelectionMode: boolean): CursorState { + return CursorState.fromModelState( + MoveOperations.moveToBeginningOfLine(context.config, context.model, cursor.modelState, inSelectionMode) + ); + } + public static moveToEndOfLine(context: CursorContext, cursors: CursorState[], inSelectionMode: boolean): CursorState[] { let result: CursorState[] = []; for (let i = 0, len = cursors.length; i < len; i++) { const cursor = cursors[i]; - result[i] = CursorState.fromViewState(MoveOperations.moveToEndOfLine(context.config, context.viewModel, cursor.viewState, inSelectionMode)); + result[i] = this._moveToLineEnd(context, cursor, inSelectionMode); } + return result; } + private static _moveToLineEnd(context: CursorContext, cursor: CursorState, inSelectionMode: boolean): CursorState { + const viewStatePosition = cursor.viewState.position; + const viewModelMaxColumn = context.viewModel.getLineMaxColumn(viewStatePosition.lineNumber); + const isEndOfViewLine = viewStatePosition.column === viewModelMaxColumn; + + const modelStatePosition = cursor.modelState.position; + const modelMaxColumn = context.model.getLineMaxColumn(modelStatePosition.lineNumber); + const isEndLineOfWrappedLine = viewModelMaxColumn - viewStatePosition.column === modelMaxColumn - modelStatePosition.column; + + if (isEndOfViewLine || isEndLineOfWrappedLine) { + return this._moveToLineEndByModel(context, cursor, inSelectionMode); + } else { + return this._moveToLineEndByView(context, cursor, inSelectionMode); + } + } + + private static _moveToLineEndByView(context: CursorContext, cursor: CursorState, inSelectionMode: boolean): CursorState { + return CursorState.fromViewState( + MoveOperations.moveToEndOfLine(context.config, context.viewModel, cursor.viewState, inSelectionMode) + ); + } + + private static _moveToLineEndByModel(context: CursorContext, cursor: CursorState, inSelectionMode: boolean): CursorState { + return CursorState.fromModelState( + MoveOperations.moveToEndOfLine(context.config, context.model, cursor.modelState, inSelectionMode) + ); + } + public static expandLineSelection(context: CursorContext, cursors: CursorState[]): CursorState[] { let result: CursorState[] = []; for (let i = 0, len = cursors.length; i < len; i++) { diff --git a/src/vs/editor/common/controller/cursorTypeOperations.ts b/src/vs/editor/common/controller/cursorTypeOperations.ts index cb2b2184669c9bde6bd0ad60d51d011aaa22a7a8..2c402a32a438a36594a0e7b0586cadcf26cd85d8 100644 --- a/src/vs/editor/common/controller/cursorTypeOperations.ts +++ b/src/vs/editor/common/controller/cursorTypeOperations.ts @@ -16,7 +16,7 @@ import { LanguageConfigurationRegistry } from 'vs/editor/common/modes/languageCo import { IndentAction } from 'vs/editor/common/modes/languageConfiguration'; import { SurroundSelectionCommand } from 'vs/editor/common/commands/surroundSelectionCommand'; import { IElectricAction } from 'vs/editor/common/modes/supports/electricCharacter'; -import { getMapForWordSeparators, WordCharacterClass } from "vs/editor/common/controller/wordCharacterClassifier"; +import { getMapForWordSeparators, WordCharacterClass } from 'vs/editor/common/controller/wordCharacterClassifier'; export class TypeOperations { @@ -144,7 +144,7 @@ export class TypeOperations { } private static _goodIndentForLine(config: CursorConfiguration, model: ITokenizedModel, lineNumber: number): string { - let expectedIndentAction = LanguageConfigurationRegistry.getGoodIndentActionForLine(model, lineNumber); + let expectedIndentAction = LanguageConfigurationRegistry.getInheritIndentForLine(model, lineNumber, false); if (expectedIndentAction) { if (expectedIndentAction.action) { @@ -239,7 +239,7 @@ export class TypeOperations { const selection = selections[i]; if (!selection.isEmpty()) { // looks like https://github.com/Microsoft/vscode/issues/2773 - // where a cursor operation occured before a canceled composition + // where a cursor operation occurred before a canceled composition // => ignore composition commands[i] = null; continue; @@ -265,56 +265,94 @@ export class TypeOperations { private static _enter(config: CursorConfiguration, model: ITokenizedModel, keepPosition: boolean, range: Range): ICommand { let r = LanguageConfigurationRegistry.getEnterAction(model, range); - let enterAction = r.enterAction; - let indentation = r.indentation; + if (r) { + let enterAction = r.enterAction; + let indentation = r.indentation; - let beforeText = ''; + if (enterAction.indentAction === IndentAction.None) { + // Nothing special + return TypeOperations._typeCommand(range, '\n' + config.normalizeIndentation(indentation + enterAction.appendText), keepPosition); - if (!r.ignoreCurrentLine) { - // textBeforeEnter doesn't match unIndentPattern. - let goodIndent = this._goodIndentForLine(config, model, range.startLineNumber); + } else if (enterAction.indentAction === IndentAction.Indent) { + // Indent once + return TypeOperations._typeCommand(range, '\n' + config.normalizeIndentation(indentation + enterAction.appendText), keepPosition); - if (goodIndent !== null && goodIndent === r.indentation) { - if (enterAction.outdentCurrentLine) { - goodIndent = TypeOperations.unshiftIndent(config, goodIndent); - } + } else if (enterAction.indentAction === IndentAction.IndentOutdent) { + // Ultra special + let normalIndent = config.normalizeIndentation(indentation); + let increasedIndent = config.normalizeIndentation(indentation + enterAction.appendText); + + let typeText = '\n' + increasedIndent + '\n' + normalIndent; - let lineText = model.getLineContent(range.startLineNumber); - if (config.normalizeIndentation(goodIndent) !== config.normalizeIndentation(indentation)) { - beforeText = config.normalizeIndentation(goodIndent) + lineText.substring(indentation.length, range.startColumn - 1); - indentation = goodIndent; - range = new Range(range.startLineNumber, 1, range.endLineNumber, range.endColumn); + if (keepPosition) { + return new ReplaceCommandWithoutChangingPosition(range, typeText, true); + } else { + return new ReplaceCommandWithOffsetCursorState(range, typeText, -1, increasedIndent.length - normalIndent.length, true); } + } else if (enterAction.indentAction === IndentAction.Outdent) { + let actualIndentation = TypeOperations.unshiftIndent(config, indentation); + return TypeOperations._typeCommand(range, '\n' + config.normalizeIndentation(actualIndentation + enterAction.appendText), keepPosition); } } - if (enterAction.removeText) { - indentation = indentation.substring(0, indentation.length - enterAction.removeText); - } - - if (enterAction.indentAction === IndentAction.None) { - // Nothing special - return TypeOperations._typeCommand(range, beforeText + '\n' + config.normalizeIndentation(indentation + enterAction.appendText), keepPosition); + // no enter rules applied, we should check indentation rules then. + let ir = LanguageConfigurationRegistry.getIndentForEnter(model, range, { + unshiftIndent: (indent) => { + return TypeOperations.unshiftIndent(config, indent); + }, + shiftIndent: (indent) => { + return TypeOperations.shiftIndent(config, indent); + }, + normalizeIndentation: (indent) => { + return config.normalizeIndentation(indent); + } + }); - } else if (enterAction.indentAction === IndentAction.Indent) { - // Indent once - return TypeOperations._typeCommand(range, beforeText + '\n' + config.normalizeIndentation(indentation + enterAction.appendText), keepPosition); + let lineText = model.getLineContent(range.startLineNumber); + let indentation = strings.getLeadingWhitespace(lineText); + if (ir) { + if (/^\s+$/.test(lineText) || indentation === config.normalizeIndentation(ir.beforeEnter)) { + return TypeOperations._typeCommand(range, '\n' + config.normalizeIndentation(ir.afterEnter), keepPosition); + } + let beforeText = config.normalizeIndentation(ir.beforeEnter) + lineText.substring(indentation.length, range.startColumn - 1); + range = new Range(range.startLineNumber, 1, range.endLineNumber, range.endColumn); + return TypeOperations._typeCommand(range, beforeText + '\n' + config.normalizeIndentation(ir.afterEnter), keepPosition); + } else { + return TypeOperations._typeCommand(range, '\n' + config.normalizeIndentation(indentation), keepPosition); + } + } - } else if (enterAction.indentAction === IndentAction.IndentOutdent) { - // Ultra special - let normalIndent = config.normalizeIndentation(indentation); - let increasedIndent = config.normalizeIndentation(indentation + enterAction.appendText); + private static _runAutoIndentType(config: CursorConfiguration, model: ITokenizedModel, range: Range, ch: string): ICommand { + let currentIndentation = LanguageConfigurationRegistry.getIndentationAtPosition(model, range.startLineNumber, range.startColumn); + let actualIndentation = LanguageConfigurationRegistry.getIndentActionForType(model, range, ch, { + shiftIndent: (indentation) => { + return TypeOperations.shiftIndent(config, indentation); + }, + unshiftIndent: (indentation) => { + return TypeOperations.unshiftIndent(config, indentation); + }, + }); - let typeText = beforeText + '\n' + increasedIndent + '\n' + normalIndent; + if (actualIndentation === null) { + return null; + } - if (keepPosition) { - return new ReplaceCommandWithoutChangingPosition(range, typeText, true); + if (actualIndentation !== config.normalizeIndentation(currentIndentation)) { + let firstNonWhitespace = model.getLineFirstNonWhitespaceColumn(range.startLineNumber); + if (firstNonWhitespace === 0) { + return TypeOperations._typeCommand( + new Range(range.startLineNumber, 0, range.endLineNumber, range.endColumn), + config.normalizeIndentation(actualIndentation) + ch, + false + ); } else { - return new ReplaceCommandWithOffsetCursorState(range, typeText, -1, increasedIndent.length - normalIndent.length, true); + return TypeOperations._typeCommand( + new Range(range.startLineNumber, 0, range.endLineNumber, range.endColumn), + config.normalizeIndentation(actualIndentation) + + model.getLineContent(range.startLineNumber).substring(firstNonWhitespace - 1, range.startColumn - 1) + ch, + false + ); } - } else if (enterAction.indentAction === IndentAction.Outdent) { - let actualIndentation = TypeOperations.unshiftIndent(config, indentation); - return TypeOperations._typeCommand(range, beforeText + '\n' + config.normalizeIndentation(actualIndentation + enterAction.appendText), keepPosition); } return null; @@ -557,6 +595,16 @@ export class TypeOperations { }); } + if (config.autoIndent) { + let indentCommand = this._runAutoIndentType(config, model, selections[0], ch); + if (indentCommand) { + return new EditOperationResult([indentCommand], { + shouldPushStackElementBefore: true, + shouldPushStackElementAfter: false, + }); + } + } + if (this._isAutoClosingCloseCharType(config, model, selections, ch)) { return this._runAutoClosingCloseCharType(config, model, selections, ch); } diff --git a/src/vs/editor/common/controller/cursorWordOperations.ts b/src/vs/editor/common/controller/cursorWordOperations.ts index 305cfe68392b0d0b7a9542ea01f22a25e4dcb791..3666961a2a283807facabffaabf9a63e3daab4b7 100644 --- a/src/vs/editor/common/controller/cursorWordOperations.ts +++ b/src/vs/editor/common/controller/cursorWordOperations.ts @@ -6,7 +6,7 @@ import { SingleCursorState, CursorConfiguration, ICursorSimpleModel } from 'vs/editor/common/controller/cursorCommon'; import { Position } from 'vs/editor/common/core/position'; -import { WordCharacterClassifier, WordCharacterClass, getMapForWordSeparators } from "vs/editor/common/controller/wordCharacterClassifier"; +import { WordCharacterClassifier, WordCharacterClass, getMapForWordSeparators } from 'vs/editor/common/controller/wordCharacterClassifier'; import * as strings from 'vs/base/common/strings'; import { Range } from 'vs/editor/common/core/range'; import { Selection } from 'vs/editor/common/core/selection'; diff --git a/src/vs/editor/common/editorCommon.ts b/src/vs/editor/common/editorCommon.ts index 058ea7e36532c7c7fac4cb2a645f7b2e6b272418..5a70f7580c15e95d469e34bdd7a4ac3f73b46aa1 100644 --- a/src/vs/editor/common/editorCommon.ts +++ b/src/vs/editor/common/editorCommon.ts @@ -24,6 +24,7 @@ import { import * as editorOptions from 'vs/editor/common/config/editorOptions'; import { ICursorPositionChangedEvent, ICursorSelectionChangedEvent } from 'vs/editor/common/controller/cursorEvents'; import { ICursors, CursorConfiguration } from 'vs/editor/common/controller/cursorCommon'; +import { ThemeColor } from "vs/platform/theme/common/themeService"; /** * Vertical Lane in the overview ruler of the editor. @@ -65,7 +66,7 @@ export interface IModelDecorationOverviewRulerOptions { */ export interface IModelDecorationOptions { /** - * Customize the growing behaviour of the decoration when typing at the edges of the decoration. + * Customize the growing behavior of the decoration when typing at the edges of the decoration. * Defaults to TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges */ stickiness?: TrackedRangeStickiness; @@ -925,7 +926,8 @@ export interface ITextModelWithMarkers extends ITextModel { } /** - * Describes the behaviour of decorations when typing/editing near their edges. + * 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, @@ -1621,10 +1623,6 @@ export interface IEditorContribution { restoreViewState?(state: any): void; } -export interface ThemeColor { - id: string; -} - /** * @internal */ @@ -1687,6 +1685,7 @@ export interface IContentDecorationRenderOptions { */ export interface IDecorationRenderOptions extends IThemeDecorationRenderOptions { isWholeLine?: boolean; + rangeBehavior?: TrackedRangeStickiness; overviewRulerLane?: OverviewRulerLane; light?: IThemeDecorationRenderOptions; diff --git a/src/vs/editor/common/editorCommonExtensions.ts b/src/vs/editor/common/editorCommonExtensions.ts index e991a1a208cfe2cddf54b1116543a9c1ea6b80a6..dfc672ab721f40c9c5cec1a738573e24cc08e30e 100644 --- a/src/vs/editor/common/editorCommonExtensions.ts +++ b/src/vs/editor/common/editorCommonExtensions.ts @@ -10,7 +10,7 @@ import { TPromise } from 'vs/base/common/winjs.base'; import { ServicesAccessor, IConstructorSignature1 } from 'vs/platform/instantiation/common/instantiation'; import { CommandsRegistry, ICommandHandlerDescription } from 'vs/platform/commands/common/commands'; import { KeybindingsRegistry, ICommandAndKeybindingRule, IKeybindings } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { Position } from 'vs/editor/common/core/position'; import * as editorCommon from 'vs/editor/common/editorCommon'; diff --git a/src/vs/editor/common/model/editableTextModel.ts b/src/vs/editor/common/model/editableTextModel.ts index 265d8486fa990d50304a0923269a765b59591994..34f1fdfe8043ddd455836ad36fd031ecaea76bf1 100644 --- a/src/vs/editor/common/model/editableTextModel.ts +++ b/src/vs/editor/common/model/editableTextModel.ts @@ -10,6 +10,7 @@ import { EditStack } from 'vs/editor/common/model/editStack'; import { ILineEdit, LineMarker, ModelLine, MarkersTracker } from 'vs/editor/common/model/modelLine'; import { TextModelWithDecorations, ModelDecorationOptions } from 'vs/editor/common/model/textModelWithDecorations'; import * as strings from 'vs/base/common/strings'; +import * as arrays from 'vs/base/common/arrays'; import { Selection } from 'vs/editor/common/core/selection'; import { Position } from 'vs/editor/common/core/position'; import { IDisposable } from 'vs/base/common/lifecycle'; @@ -475,7 +476,7 @@ export class EditableTextModel extends TextModelWithDecorations implements edito let contentChanges: textModelEvents.IModelContentChange[] = []; let lineEditsQueue: IIdentifiedLineEdit[] = []; - let queueLineEdit = (lineEdit: IIdentifiedLineEdit) => { + const queueLineEdit = (lineEdit: IIdentifiedLineEdit) => { if (lineEdit.startColumn === lineEdit.endColumn && lineEdit.text.length === 0) { // empty edit => ignore it return; @@ -483,7 +484,7 @@ export class EditableTextModel extends TextModelWithDecorations implements edito lineEditsQueue.push(lineEdit); }; - let flushLineEdits = () => { + const flushLineEdits = () => { if (lineEditsQueue.length === 0) { return; } @@ -495,7 +496,7 @@ export class EditableTextModel extends TextModelWithDecorations implements edito let currentLineNumberStart = 0; for (let i = 1, len = lineEditsQueue.length; i < len; i++) { - let lineNumber = lineEditsQueue[i].lineNumber; + const lineNumber = lineEditsQueue[i].lineNumber; if (lineNumber === currentLineNumber) { continue; @@ -533,7 +534,7 @@ export class EditableTextModel extends TextModelWithDecorations implements edito let totalLinesCountDelta = 0; for (let i = 0, len = operations.length; i < len; i++) { - let op = operations[i]; + const op = operations[i]; // console.log(); // console.log('-------------------'); @@ -541,26 +542,26 @@ export class EditableTextModel extends TextModelWithDecorations implements edito // console.log('op: ', op); // console.log('<<<\n' + this._lines.map(l => l.text).join('\n') + '\n>>>'); - let startLineNumber = op.range.startLineNumber; - let startColumn = op.range.startColumn; - let endLineNumber = op.range.endLineNumber; - let endColumn = op.range.endColumn; + const startLineNumber = op.range.startLineNumber; + const startColumn = op.range.startColumn; + const endLineNumber = op.range.endLineNumber; + const endColumn = op.range.endColumn; if (startLineNumber === endLineNumber && startColumn === endColumn && (!op.lines || op.lines.length === 0)) { // no-op continue; } - let deletingLinesCnt = endLineNumber - startLineNumber; - let insertingLinesCnt = (op.lines ? op.lines.length - 1 : 0); - let editingLinesCnt = Math.min(deletingLinesCnt, insertingLinesCnt); + const deletingLinesCnt = endLineNumber - startLineNumber; + const insertingLinesCnt = (op.lines ? op.lines.length - 1 : 0); + const editingLinesCnt = Math.min(deletingLinesCnt, insertingLinesCnt); totalLinesCountDelta += (insertingLinesCnt - deletingLinesCnt); // Iterating descending to overlap with previous op // in case there are common lines being edited in both for (let j = editingLinesCnt; j >= 0; j--) { - let editLineNumber = startLineNumber + j; + const editLineNumber = startLineNumber + j; queueLineEdit({ lineNumber: editLineNumber, @@ -577,19 +578,22 @@ export class EditableTextModel extends TextModelWithDecorations implements edito // Flush any pending line edits flushLineEdits(); - let spliceStartLineNumber = startLineNumber + editingLinesCnt; - let spliceStartColumn = this.getLineMaxColumn(spliceStartLineNumber); + const spliceStartLineNumber = startLineNumber + editingLinesCnt; + const spliceStartColumn = this.getLineMaxColumn(spliceStartLineNumber); - let endLineRemains = this._lines[endLineNumber - 1].split(markersTracker, endColumn, false, tabSize); + const endLineRemains = this._lines[endLineNumber - 1].split(markersTracker, endColumn, false, tabSize); this._invalidateLine(spliceStartLineNumber - 1); - let spliceCnt = endLineNumber - spliceStartLineNumber; + const spliceCnt = endLineNumber - spliceStartLineNumber; // Collect all these markers let markersOnDeletedLines: LineMarker[] = []; for (let j = 0; j < spliceCnt; j++) { - let deleteLineIndex = spliceStartLineNumber + j; - markersOnDeletedLines = markersOnDeletedLines.concat(this._lines[deleteLineIndex].deleteLine()); + const deleteLineIndex = spliceStartLineNumber + j; + const deleteLineMarkers = this._lines[deleteLineIndex].getMarkers(); + if (deleteLineMarkers) { + markersOnDeletedLines = markersOnDeletedLines.concat(deleteLineMarkers); + } } this._lines.splice(spliceStartLineNumber, spliceCnt); @@ -606,7 +610,7 @@ export class EditableTextModel extends TextModelWithDecorations implements edito } // Update deleted markers - let deletedMarkersPosition = new Position(spliceStartLineNumber, spliceStartColumn); + const deletedMarkersPosition = new Position(spliceStartLineNumber, spliceStartColumn); for (let j = 0, lenJ = markersOnDeletedLines.length; j < lenJ; j++) { markersOnDeletedLines[j].updatePosition(markersTracker, deletedMarkersPosition); } @@ -627,7 +631,7 @@ export class EditableTextModel extends TextModelWithDecorations implements edito // Flush any pending line edits flushLineEdits(); - let spliceLineNumber = startLineNumber + editingLinesCnt; + const spliceLineNumber = startLineNumber + editingLinesCnt; let spliceColumn = (spliceLineNumber === startLineNumber ? startColumn : 1); if (op.lines) { spliceColumn += op.lines[editingLinesCnt].length; @@ -645,14 +649,16 @@ export class EditableTextModel extends TextModelWithDecorations implements edito this._invalidateLine(spliceLineNumber - 1); // Lines in the middle + let newLines: ModelLine[] = []; let newLinesContent: string[] = []; let newLinesLengths = new Uint32Array(insertingLinesCnt - editingLinesCnt); for (let j = editingLinesCnt + 1; j <= insertingLinesCnt; j++) { let newLineNumber = startLineNumber + j; - this._lines.splice(newLineNumber - 1, 0, new ModelLine(newLineNumber, op.lines[j], tabSize)); + newLines.push(new ModelLine(newLineNumber, op.lines[j], tabSize)); newLinesContent.push(op.lines[j]); newLinesLengths[j - editingLinesCnt - 1] = op.lines[j].length + this._EOL.length; } + this._lines = arrays.arrayInsert(this._lines, startLineNumber + editingLinesCnt, newLines); newLinesContent[newLinesContent.length - 1] += leftoverLine.text; if (this._lineStarts) { // update prefix sum diff --git a/src/vs/editor/common/model/modelLine.ts b/src/vs/editor/common/model/modelLine.ts index 2d64bc4dec51f075a80388160dc5f574395972e0..4a1b012f60d00a91e11778865cc16d65ad99e451 100644 --- a/src/vs/editor/common/model/modelLine.ts +++ b/src/vs/editor/common/model/modelLine.ts @@ -416,11 +416,11 @@ export class ModelLine { // var markers = this._markers; - // var printMarker = (m:ILineMarker) => { + // var printMarker = (m:LineMarker) => { // if (m.stickToPreviousCharacter) { - // return '|' + m.column; + // return '|' + m.position.column; // } - // return m.column + '|'; + // return m.position.column + '|'; // }; // return '[' + markers.map(printMarker).join(', ') + ']'; // } @@ -741,13 +741,6 @@ export class ModelLine { this._lineNumber = newLineNumber; } - public deleteLine(): LineMarker[] { - if (!this._markers) { - return []; - } - return this._markers; - } - private _indexOfMarkerId(markerId: string): number { let markers = this._markers; for (let i = 0, len = markers.length; i < len; i++) { diff --git a/src/vs/editor/common/model/textModel.ts b/src/vs/editor/common/model/textModel.ts index 0d7ec1065b463a44b8432efdb3546ebd38cd5d23..d15842430f3b6b22ee50ae368cc24e1c5fd0f279 100644 --- a/src/vs/editor/common/model/textModel.ts +++ b/src/vs/editor/common/model/textModel.ts @@ -11,7 +11,7 @@ import { Range, IRange } from 'vs/editor/common/core/range'; import * as editorCommon from 'vs/editor/common/editorCommon'; import { ModelLine } from 'vs/editor/common/model/modelLine'; import { guessIndentation } from 'vs/editor/common/model/indentationGuesser'; -import { EDITOR_MODEL_DEFAULTS } from "vs/editor/common/config/editorOptions"; +import { EDITOR_MODEL_DEFAULTS } from 'vs/editor/common/config/editorOptions'; import { PrefixSumComputer } from 'vs/editor/common/viewModel/prefixSumComputer'; import { IndentRange, computeRanges } from 'vs/editor/common/model/indentRanges'; import { TextModelSearch, SearchParams } from 'vs/editor/common/model/textModelSearch'; diff --git a/src/vs/editor/common/model/textModelSearch.ts b/src/vs/editor/common/model/textModelSearch.ts index d19ad9e608ca4dce6dcf8f761b223b3d59585d81..867d52204e5ce8c9ed9d3c803a9f6f7d400ee773 100644 --- a/src/vs/editor/common/model/textModelSearch.ts +++ b/src/vs/editor/common/model/textModelSearch.ts @@ -10,7 +10,7 @@ import { Range } from 'vs/editor/common/core/range'; import { FindMatch, EndOfLinePreference } from 'vs/editor/common/editorCommon'; import { CharCode } from 'vs/base/common/charCode'; import { TextModel } from 'vs/editor/common/model/textModel'; -import { getMapForWordSeparators, WordCharacterClassifier, WordCharacterClass } from "vs/editor/common/controller/wordCharacterClassifier"; +import { getMapForWordSeparators, WordCharacterClassifier, WordCharacterClass } from 'vs/editor/common/controller/wordCharacterClassifier'; const LIMIT_FIND_COUNT = 999; @@ -405,23 +405,57 @@ export class TextModelSearch { } } -function isValidMatch(wordSeparators: WordCharacterClassifier, text: string, textLength: number, matchStartIndex: number, matchLength: number): boolean { +function leftIsWordBounday(wordSeparators: WordCharacterClassifier, text: string, textLength: number, matchStartIndex: number, matchLength: number): boolean { + if (matchStartIndex === 0) { + // Match starts at start of string + return true; + } - if (matchStartIndex - 1 >= 0) { - const charBefore = text.charCodeAt(matchStartIndex - 1); - if (wordSeparators.get(charBefore) === WordCharacterClass.Regular) { - return false; + const charBefore = text.charCodeAt(matchStartIndex - 1); + if (wordSeparators.get(charBefore) !== WordCharacterClass.Regular) { + // The character before the match is a word separator + return true; + } + + if (matchLength > 0) { + const firstCharInMatch = text.charCodeAt(matchStartIndex); + if (wordSeparators.get(firstCharInMatch) !== WordCharacterClass.Regular) { + // The first character inside the match is a word separator + return true; } } - if (matchStartIndex + matchLength < textLength) { - const charAfter = text.charCodeAt(matchStartIndex + matchLength); - if (wordSeparators.get(charAfter) === WordCharacterClass.Regular) { - return false; + return false; +} + +function rightIsWordBounday(wordSeparators: WordCharacterClassifier, text: string, textLength: number, matchStartIndex: number, matchLength: number): boolean { + if (matchStartIndex + matchLength === textLength) { + // Match ends at end of string + return true; + } + + const charAfter = text.charCodeAt(matchStartIndex + matchLength); + if (wordSeparators.get(charAfter) !== WordCharacterClass.Regular) { + // The character after the match is a word separator + return true; + } + + if (matchLength > 0) { + const lastCharInMatch = text.charCodeAt(matchStartIndex + matchLength - 1); + if (wordSeparators.get(lastCharInMatch) !== WordCharacterClass.Regular) { + // The last character in the match is a word separator + return true; } } - return true; + return false; +} + +function isValidMatch(wordSeparators: WordCharacterClassifier, text: string, textLength: number, matchStartIndex: number, matchLength: number): boolean { + return ( + leftIsWordBounday(wordSeparators, text, textLength, matchStartIndex, matchLength) + && rightIsWordBounday(wordSeparators, text, textLength, matchStartIndex, matchLength) + ); } class Searcher { diff --git a/src/vs/editor/common/model/textModelWithDecorations.ts b/src/vs/editor/common/model/textModelWithDecorations.ts index 84380b69ef3b35ed1275fc6358301f4cd47e7359..57e058c623619d977fa76742d48dee3e9c9a39c9 100644 --- a/src/vs/editor/common/model/textModelWithDecorations.ts +++ b/src/vs/editor/common/model/textModelWithDecorations.ts @@ -16,6 +16,7 @@ import { INewMarker, TextModelWithMarkers } from 'vs/editor/common/model/textMod import { LanguageIdentifier } from 'vs/editor/common/modes'; import { ITextSource, IRawTextSource } from 'vs/editor/common/model/textSource'; import * as textModelEvents from 'vs/editor/common/model/textModelEvents'; +import { ThemeColor } from "vs/platform/theme/common/themeService"; export const ClassName = { EditorWarningDecoration: 'greensquiggly', @@ -840,9 +841,9 @@ function cleanClassName(className: string): string { } export class ModelDecorationOverviewRulerOptions implements editorCommon.IModelDecorationOverviewRulerOptions { - readonly color: string | editorCommon.ThemeColor; - readonly darkColor: string | editorCommon.ThemeColor; - readonly hcColor: string | editorCommon.ThemeColor; + readonly color: string | ThemeColor; + readonly darkColor: string | ThemeColor; + readonly hcColor: string | ThemeColor; readonly position: editorCommon.OverviewRulerLane; constructor(options: editorCommon.IModelDecorationOverviewRulerOptions) { diff --git a/src/vs/editor/common/modes.ts b/src/vs/editor/common/modes.ts index dcc2fab9afb6f1da0a5b5891a226a483ae2fe522..4d85cdfa5ac5ab82a2e00081df234722a493765a 100644 --- a/src/vs/editor/common/modes.ts +++ b/src/vs/editor/common/modes.ts @@ -538,7 +538,12 @@ export const symbolKindToCssClass = (function () { }; })(); - +/** + * @internal + */ +export interface IOutline { + entries: SymbolInformation[]; +} /** * Represents information about programming constructs like variables, classes, * interfaces etc. diff --git a/src/vs/editor/common/modes/languageConfigurationRegistry.ts b/src/vs/editor/common/modes/languageConfigurationRegistry.ts index 1563ebc48de7588b5875e13a99a00e935ed712c3..967331c76e18a2f2d41d26f6b6d335dbfddf3900 100644 --- a/src/vs/editor/common/modes/languageConfigurationRegistry.ts +++ b/src/vs/editor/common/modes/languageConfigurationRegistry.ts @@ -7,6 +7,7 @@ import { CharacterPairSupport } from 'vs/editor/common/modes/supports/characterPair'; import { BracketElectricCharacterSupport, IElectricAction } from 'vs/editor/common/modes/supports/electricCharacter'; import { IOnEnterSupportOptions, OnEnterSupport } from 'vs/editor/common/modes/supports/onEnter'; +import { IndentRulesSupport } from 'vs/editor/common/modes/supports/indentRules'; import { RichEditBrackets } from 'vs/editor/common/modes/supports/richEditBrackets'; import Event, { Emitter } from 'vs/base/common/event'; import { ITokenizedModel } from 'vs/editor/common/editorCommon'; @@ -29,6 +30,19 @@ export interface ICommentsConfiguration { blockCommentEndToken?: string; } +export interface IVirtualModel { + getLineTokens(lineNumber: number): LineTokens; + getLanguageIdentifier(): LanguageIdentifier; + getLanguageIdAtPosition(lineNumber: number, column: number): LanguageId; + getLineContent(lineNumber: number): string; +} + +export interface IndentConverter { + shiftIndent?(indentation: string): string; + unshiftIndent?(indentation: string): string; + normalizeIndentation?(indentation: string): string; +} + export class RichEditSupport { private readonly _conf: LanguageConfiguration; @@ -38,6 +52,7 @@ export class RichEditSupport { public readonly characterPair: CharacterPairSupport; public readonly wordDefinition: RegExp; public readonly onEnter: OnEnterSupport; + public readonly indentRulesSupport: IndentRulesSupport; public readonly brackets: RichEditBrackets; public readonly indentationRules: IndentationRule; @@ -64,6 +79,9 @@ export class RichEditSupport { this.wordDefinition = this._conf.wordPattern || DEFAULT_WORD_REGEXP; this.indentationRules = this._conf.indentationRules; + if (this._conf.indentationRules) { + this.indentRulesSupport = new IndentRulesSupport(this._conf.indentationRules); + } } private static _mergeConf(prev: LanguageConfiguration, current: LanguageConfiguration): LanguageConfiguration { @@ -250,6 +268,327 @@ export class LanguageConfigurationRegistryImpl { return ensureValidWordDefinition(value.wordDefinition || null); } + + + // beigin Indent Rules + + private _getIndentRulesSupport(languageId: LanguageId): IndentRulesSupport { + let value = this._getRichEditSupport(languageId); + if (!value) { + return null; + } + return value.indentRulesSupport || null; + } + + /** + * Get nearest preceiding line which doesn't match unIndentPattern or contains all whitespace. + */ + private getPrecedingValidLine(model: IVirtualModel, lineNumber: number, indentRulesSupport: IndentRulesSupport) { + let languageID = model.getLanguageIdAtPosition(lineNumber, 0); + if (lineNumber > 1) { + let lastLineNumber = lineNumber - 1; + let resultLineNumber = -1; + + for (lastLineNumber = lineNumber - 1; lastLineNumber >= 1; lastLineNumber--) { + if (model.getLanguageIdAtPosition(lastLineNumber, 0) !== languageID) { + return resultLineNumber; + } + let text = model.getLineContent(lastLineNumber); + if (indentRulesSupport.shouldIgnore(text) || text === '') { + resultLineNumber = lastLineNumber; + continue; + } + + return lastLineNumber; + } + } + + return -1; + } + + /** + * Get inherited indentation from above lines. + * 1. Find the nearest preceding line which doesn't match unIndentedLinePattern. + * 2. If this line matches indentNextLinePattern or increaseIndentPattern, it means that the indent level of `lineNumber` should be 1 greater than this line. + * 3. If this line doesn't match any indent rules + * a. check whether the line above it matches indentNextLinePattern + * b. If not, the indent level of this line is the result + * c. If so, it means the indent of this line is *temporary*, go upward utill we find a line whose indent is not temporary (the same workflow a -> b -> c). + * 4. Otherwise, we fail to get an inherited indent from aboves. Return null and we should not touch the indent of `lineNumber` + * + * This function only return the inherited indent based on above lines, it doesn't check whether current line should decrease or not. + */ + public getInheritIndentForLine(model: IVirtualModel, lineNumber: number, honorIntentialIndent: boolean = true) { + let indentRulesSupport = this._getIndentRulesSupport(model.getLanguageIdentifier().id); + if (!indentRulesSupport) { + return null; + } + + if (lineNumber <= 1) { + return { + indentation: '', + action: null + }; + } + + let precedingUnIgnoredLine = this.getPrecedingValidLine(model, lineNumber, indentRulesSupport); + if (precedingUnIgnoredLine < 1) { + return { + indentation: '', + action: null + }; + } + + let precedingUnIgnoredLineContent = model.getLineContent(precedingUnIgnoredLine); + + if (indentRulesSupport.shouldIncrease(precedingUnIgnoredLineContent) || indentRulesSupport.shouldIndentNextLine(precedingUnIgnoredLineContent)) { + return { + indentation: strings.getLeadingWhitespace(precedingUnIgnoredLineContent), + action: IndentAction.Indent + }; + } else if (indentRulesSupport.shouldDecrease(precedingUnIgnoredLineContent)) { + return { + indentation: strings.getLeadingWhitespace(precedingUnIgnoredLineContent), + action: null + }; + } else { + // precedingUnIgnoredLine can not be ignored. + // it doesn't increase indent of following lines + // it doesn't increase just next line + // so current line is not affect by precedingUnIgnoredLine + // and then we should get a correct inheritted indentation from above lines + if (precedingUnIgnoredLine === 1) { + return { + indentation: strings.getLeadingWhitespace(model.getLineContent(precedingUnIgnoredLine)), + action: null + }; + } + + let previousLine = precedingUnIgnoredLine - 1; + + let previousLineContent = model.getLineContent(previousLine); + + if (indentRulesSupport.shouldIndentNextLine(previousLineContent)) { + let stopLine = 0; + for (let i = previousLine - 1; i > 0; i--) { + if (indentRulesSupport.shouldIndentNextLine(model.getLineContent(i))) { + continue; + } + stopLine = i; + break; + } + + return { + indentation: strings.getLeadingWhitespace(model.getLineContent(stopLine + 1)), + action: null + }; + } + + if (honorIntentialIndent) { + return { + indentation: strings.getLeadingWhitespace(model.getLineContent(precedingUnIgnoredLine)), + action: null + }; + } else { + // search from precedingUnIgnoredLine until we find one whose indent is not temporary + for (let i = precedingUnIgnoredLine; i > 0; i--) { + let lineContent = model.getLineContent(i); + if (indentRulesSupport.shouldIncrease(lineContent)) { + return { + indentation: strings.getLeadingWhitespace(lineContent), + action: IndentAction.Indent + }; + } else if (indentRulesSupport.shouldIndentNextLine(lineContent)) { + let stopLine = 0; + for (let j = i - 1; j > 0; j--) { + if (indentRulesSupport.shouldIndentNextLine(model.getLineContent(i))) { + continue; + } + stopLine = j; + break; + } + + return { + indentation: strings.getLeadingWhitespace(model.getLineContent(stopLine + 1)), + action: null + }; + } else if (indentRulesSupport.shouldDecrease(lineContent)) { + return { + indentation: strings.getLeadingWhitespace(lineContent), + action: null + }; + } + } + + return { + indentation: strings.getLeadingWhitespace(model.getLineContent(1)), + action: null + }; + } + + } + } + + public getGoodIndentForLine(virtualModel: IVirtualModel, languageId: LanguageId, lineNumber: number, indentConverter: IndentConverter): string { + let indentRulesSupport = this._getIndentRulesSupport(languageId); + if (!indentRulesSupport) { + return null; + } + + let indent = this.getInheritIndentForLine(virtualModel, lineNumber); + let lineContent = virtualModel.getLineContent(lineNumber); + + if (indent) { + if (indentRulesSupport.shouldDecrease(lineContent)) { + if (indent.action === IndentAction.Indent) { + return indent.indentation; + } else { + return indentConverter.unshiftIndent(indent.indentation); + } + } else { + if (indent.action === IndentAction.Indent) { + return indentConverter.shiftIndent(indent.indentation); + } else { + return indent.indentation; + } + } + } + return null; + } + + public getIndentForEnter(model: ITokenizedModel, range: Range, indentConverter: IndentConverter): { beforeEnter: string, afterEnter: string } { + model.forceTokenization(range.startLineNumber); + let lineTokens = model.getLineTokens(range.startLineNumber); + + let beforeEnterText; + let tokenIndexUnderCursor = lineTokens.findTokenIndexAtOffset(range.startColumn); + let tokenIndexAtBeginning = lineTokens.findTokenIndexAtOffset(0); + let scopedLineTokens = createScopedLineTokens(lineTokens, range.startColumn); + let scopedLineText = scopedLineTokens.getLineContent(); + + if (lineTokens.getLanguageId(tokenIndexAtBeginning) === lineTokens.getLanguageId(tokenIndexUnderCursor)) { + beforeEnterText = lineTokens.getLineContent().substring(0, range.startColumn); + } else { + beforeEnterText = scopedLineText.substr(0, range.startColumn - 1 - scopedLineTokens.firstCharOffset); + } + + let afterEnterText; + + if (range.isEmpty()) { + afterEnterText = scopedLineText.substr(range.startColumn - 1 - scopedLineTokens.firstCharOffset); + } else { + const endScopedLineTokens = this.getScopedLineTokens(model, range.endLineNumber, range.endColumn); + afterEnterText = endScopedLineTokens.getLineContent().substr(range.endColumn - 1 - scopedLineTokens.firstCharOffset); + } + + let indentRulesSupport = this._getIndentRulesSupport(scopedLineTokens.languageId); + + if (!indentRulesSupport) { + return null; + } + + let beforeEnterIndentAction = this.getInheritIndentForLine(model, range.startLineNumber); + let beforeEnterIndent = strings.getLeadingWhitespace(beforeEnterText); + + if (indentRulesSupport.shouldDecrease(beforeEnterText)) { + if (beforeEnterIndentAction) { + beforeEnterIndent = beforeEnterIndentAction.indentation; + if (beforeEnterIndentAction.action !== IndentAction.Indent) { + beforeEnterIndent = indentConverter.unshiftIndent(beforeEnterIndent); + } + } + } + + let beforeEnterResult = beforeEnterIndent + strings.ltrim(strings.ltrim(beforeEnterText, ' '), '\t'); + + let virtualModel: IVirtualModel = { + getLineTokens: (lineNumber: number) => { + return model.getLineTokens(lineNumber); + }, + getLanguageIdentifier: () => { + return model.getLanguageIdentifier(); + }, + getLanguageIdAtPosition: (lineNumber: number, column: number) => { + return model.getLanguageIdAtPosition(lineNumber, column); + }, + getLineContent: (lineNumber: number) => { + if (lineNumber === range.startLineNumber) { + return beforeEnterResult; + } else { + return model.getLineContent(lineNumber); + } + } + }; + + let afterEnterAction = this.getInheritIndentForLine(virtualModel, range.startLineNumber + 1); + if (!afterEnterAction) { + return { + beforeEnter: beforeEnterIndent, + afterEnter: beforeEnterIndent + }; + } + + let afterEnterIndent = afterEnterAction.indentation; + + if (afterEnterAction.action === IndentAction.Indent) { + afterEnterIndent = indentConverter.shiftIndent(afterEnterIndent); + } + + if (indentRulesSupport.shouldDecrease(afterEnterText)) { + afterEnterIndent = indentConverter.unshiftIndent(afterEnterIndent); + } + + return { + beforeEnter: beforeEnterIndent, + afterEnter: afterEnterIndent + }; + } + + /** + * We should always allow intentional indentation. It means, if users change the indentation of `lineNumber` and the content of + * this line doesn't match decreaseIndentPattern, we should not adjust the indentation. + */ + public getIndentActionForType(model: ITokenizedModel, range: Range, ch: string, indentConverter: IndentConverter): string { + let scopedLineTokens = this.getScopedLineTokens(model, range.startLineNumber, range.startColumn); + let indentRulesSupport = this._getIndentRulesSupport(scopedLineTokens.languageId); + if (!indentRulesSupport) { + return null; + } + + let scopedLineText = scopedLineTokens.getLineContent(); + let beforeTypeText = scopedLineText.substr(0, range.startColumn - 1 - scopedLineTokens.firstCharOffset); + let afterTypeText; + + // selection support + if (range.isEmpty()) { + afterTypeText = scopedLineText.substr(range.startColumn - 1 - scopedLineTokens.firstCharOffset); + } else { + const endScopedLineTokens = this.getScopedLineTokens(model, range.endLineNumber, range.endColumn); + afterTypeText = endScopedLineTokens.getLineContent().substr(range.endColumn - 1 - scopedLineTokens.firstCharOffset); + } + + if (indentRulesSupport.shouldDecrease(beforeTypeText + ch + afterTypeText)) { + // after typing `ch`, the content matches decreaseIndentPattern, we should adjust the indent to a good manner. + // 1. Get inherited indent action + let r = this.getInheritIndentForLine(model, range.startLineNumber, false); + if (!r) { + return null; + } + + let indentation = r.indentation; + + if (r.action !== IndentAction.Indent) { + indentation = indentConverter.unshiftIndent(indentation); + } + + return indentation; + } + + return null; + } + + // end Indent Rules + // begin onEnter private _getOnEnterSupport(languageId: LanguageId): OnEnterSupport { @@ -266,18 +605,13 @@ export class LanguageConfigurationRegistryImpl { return r ? r.enterAction : null; } - public getEnterAction(model: ITokenizedModel, range: Range): { enterAction: EnterAction; indentation: string; ignoreCurrentLine: boolean } { + public getEnterAction(model: ITokenizedModel, range: Range): { enterAction: EnterAction; indentation: string; } { let indentation = this.getIndentationAtPosition(model, range.startLineNumber, range.startColumn); - let ignoreCurrentLine = false; let scopedLineTokens = this.getScopedLineTokens(model, range.startLineNumber, range.startColumn); let onEnterSupport = this._getOnEnterSupport(scopedLineTokens.languageId); if (!onEnterSupport) { - return { - enterAction: { indentAction: IndentAction.None, appendText: '' }, - indentation: indentation, - ignoreCurrentLine: false - }; + return null; } let scopedLineText = scopedLineTokens.getLineContent(); @@ -293,45 +627,18 @@ export class LanguageConfigurationRegistryImpl { } let lineNumber = range.startLineNumber; - - // if the text before the cursor/range start position is empty or matches `unIndentedLinePattern` - // this line is actually ignored after the enter action - if (onEnterSupport.shouldIgnore(beforeEnterText)) { - ignoreCurrentLine = true; - let lastLineNumber = this.getLastValidLine(model, lineNumber, onEnterSupport); - - if (lastLineNumber <= 0) { - return { - enterAction: { indentAction: IndentAction.None, appendText: '' }, - indentation: '', - ignoreCurrentLine: ignoreCurrentLine - }; - } - - scopedLineTokens = this.getScopedLineTokens(model, lastLineNumber); - beforeEnterText = this.getLineContent(model, lastLineNumber); - lineNumber = lastLineNumber; - indentation = this.getIndentationAtPosition(model, lineNumber, model.getLineMaxColumn(lineNumber)); - } - let oneLineAboveText = ''; if (lineNumber > 1 && scopedLineTokens.firstCharOffset === 0) { // This is not the first line and the entire line belongs to this mode - let lastLineNumber = this.getLastValidLine(model, lineNumber, onEnterSupport); - - if (lastLineNumber >= 1) { - // No previous line with content found - let oneLineAboveScopedLineTokens = this.getScopedLineTokens(model, lastLineNumber); - if (oneLineAboveScopedLineTokens.languageId === scopedLineTokens.languageId) { - // The line above ends with text belonging to the same mode - oneLineAboveText = oneLineAboveScopedLineTokens.getLineContent(); - } + let oneLineAboveScopedLineTokens = this.getScopedLineTokens(model, lineNumber - 1); + if (oneLineAboveScopedLineTokens.languageId === scopedLineTokens.languageId) { + // The line above ends with text belonging to the same mode + oneLineAboveText = oneLineAboveScopedLineTokens.getLineContent(); } } let enterResult: EnterAction = null; - try { enterResult = onEnterSupport.onEnter(oneLineAboveText, beforeEnterText, afterEnterText); } catch (e) { @@ -339,7 +646,7 @@ export class LanguageConfigurationRegistryImpl { } if (!enterResult) { - enterResult = { indentAction: IndentAction.None, appendText: '' }; + return null; } else { // Here we add `\t` to appendText first because enterAction is leveraging appendText and removeText to change indentation. if (!enterResult.appendText) { @@ -354,14 +661,17 @@ export class LanguageConfigurationRegistryImpl { } } + if (enterResult.removeText) { + indentation = indentation.substring(0, indentation.length - enterResult.removeText); + } + return { enterAction: enterResult, indentation: indentation, - ignoreCurrentLine: ignoreCurrentLine }; } - private getIndentationAtPosition(model: ITokenizedModel, lineNumber: number, column: number): string { + public getIndentationAtPosition(model: ITokenizedModel, lineNumber: number, column: number): string { let lineText = model.getLineContent(lineNumber); let indentation = strings.getLeadingWhitespace(lineText); if (indentation.length > column - 1) { @@ -371,33 +681,6 @@ export class LanguageConfigurationRegistryImpl { return indentation; } - private getLastValidLine(model: ITokenizedModel, lineNumber: number, onEnterSupport: OnEnterSupport): number { - if (lineNumber > 1) { - let lastLineNumber = lineNumber - 1; - - for (lastLineNumber = lineNumber - 1; lastLineNumber >= 1; lastLineNumber--) { - let lineText = model.getLineContent(lastLineNumber); - if (!onEnterSupport.shouldIgnore(lineText) && onEnterSupport.containNonWhitespace(lineText)) { - break; - } - } - - if (lastLineNumber >= 1) { - return lastLineNumber; - } - } - - return -1; - } - - private getLineContent(model: ITokenizedModel, lineNumber: number): string { - let scopedLineTokens = this.getScopedLineTokens(model, lineNumber); - let column = model.getLineMaxColumn(lineNumber); - let scopedLineText = scopedLineTokens.getLineContent(); - let lineText = scopedLineText.substr(0, column - 1 - scopedLineTokens.firstCharOffset); - return lineText; - } - private getScopedLineTokens(model: ITokenizedModel, lineNumber: number, columnNumber?: number) { model.forceTokenization(lineNumber); let lineTokens = model.getLineTokens(lineNumber); @@ -406,52 +689,6 @@ export class LanguageConfigurationRegistryImpl { return scopedLineTokens; } - public getGoodIndentActionForLine(model: ITokenizedModel, lineNumber: number) { - let onEnterSupport = this._getOnEnterSupport(model.getLanguageIdentifier().id); - if (!onEnterSupport) { - return null; - } - - /** - * In order to get correct indentation for current line - * we need to loop backwards the content from current line until - * 1. a line contains non whitespace characters, - * 2. and the line doesn't match `unIndentedLinePattern` pattern - */ - let lastLineNumber = this.getLastValidLine(model, lineNumber, onEnterSupport); - - if (lastLineNumber < 1) { - // No previous line with content found - return null; - } - - // it's Okay that lineNumber > model.getLineCount(), a good example is guessing the indentation of next potential line - // when the cursor is at the end of file. - if (lineNumber <= model.getLineCount()) { - let currentLineScopedLineTokens = this.getScopedLineTokens(model, lineNumber); - let lastLineScopedLineTokens = this.getScopedLineTokens(model, lastLineNumber); - - if (currentLineScopedLineTokens.languageId !== lastLineScopedLineTokens.languageId) { - // The language mode of last valid line is not the same as current line. - return null; - } - } - - let lineText = model.getLineContent(lastLineNumber); - let oneLineAboveText: string; - if (lastLineNumber > 1) { - oneLineAboveText = model.getLineContent(lastLineNumber - 1); - } - - let indentation = strings.getLeadingWhitespace(lineText); - let onEnterAction = onEnterSupport.onEnter(oneLineAboveText, lineText, ''); - - return { - indentation: indentation, - action: onEnterAction ? onEnterAction.indentAction : null - }; - } - // end onEnter public getBracketsSupport(languageId: LanguageId): RichEditBrackets { diff --git a/src/vs/editor/common/modes/modesRegistry.ts b/src/vs/editor/common/modes/modesRegistry.ts index 259fdda2dcfe0a3dd2038428b4cbcc7d521d0f40..8995c2dc4e1f4726657d3d3227fdae984bd3c4f2 100644 --- a/src/vs/editor/common/modes/modesRegistry.ts +++ b/src/vs/editor/common/modes/modesRegistry.ts @@ -6,7 +6,7 @@ import * as nls from 'vs/nls'; import Event, { Emitter } from 'vs/base/common/event'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { ILanguageExtensionPoint } from 'vs/editor/common/services/modeService'; import { LanguageConfigurationRegistry } from 'vs/editor/common/modes/languageConfigurationRegistry'; import { LanguageIdentifier, LanguageId } from 'vs/editor/common/modes'; diff --git a/src/vs/editor/common/modes/supports/indentRules.ts b/src/vs/editor/common/modes/supports/indentRules.ts new file mode 100644 index 0000000000000000000000000000000000000000..ab23b19a120565e86813f051629726c91887f77b --- /dev/null +++ b/src/vs/editor/common/modes/supports/indentRules.ts @@ -0,0 +1,78 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +'use strict'; + +import * as strings from 'vs/base/common/strings'; +import { IndentationRule, IndentAction } from 'vs/editor/common/modes/languageConfiguration'; + +export class IndentRulesSupport { + + private readonly _indentationRules: IndentationRule; + + constructor(indentationRules: IndentationRule) { + this._indentationRules = indentationRules; + } + + public onType(text: string): IndentAction { + if (this._indentationRules) { + if (this._indentationRules.unIndentedLinePattern && this._indentationRules.unIndentedLinePattern.test(text)) { + return null; + } + + if (this._indentationRules.decreaseIndentPattern && this._indentationRules.decreaseIndentPattern.test(text)) { + return IndentAction.Outdent; + } + } + return null; + } + + public containNonWhitespace(text: string): boolean { + // the text doesn't contain any non-whitespace character. + let nonWhitespaceIdx = strings.lastNonWhitespaceIndex(text); + + if (nonWhitespaceIdx >= 0) { + return true; + } + + return false; + } + + public shouldIncrease(text: string): boolean { + if (this._indentationRules) { + if (this._indentationRules.increaseIndentPattern && this._indentationRules.increaseIndentPattern.test(text)) { + return true; + } + // if (this._indentationRules.indentNextLinePattern && this._indentationRules.indentNextLinePattern.test(text)) { + // return true; + // } + } + return false; + } + + public shouldDecrease(text: string): boolean { + if (this._indentationRules && this._indentationRules.decreaseIndentPattern && this._indentationRules.decreaseIndentPattern.test(text)) { + return true; + } + return false; + } + + public shouldIndentNextLine(text: string): boolean { + if (this._indentationRules && this._indentationRules.indentNextLinePattern && this._indentationRules.indentNextLinePattern.test(text)) { + return true; + } + + return false; + } + + public shouldIgnore(text: string): boolean { + // the text matches `unIndentedLinePattern` + if (this._indentationRules && this._indentationRules.unIndentedLinePattern && this._indentationRules.unIndentedLinePattern.test(text)) { + return true; + } + + return false; + } +} + diff --git a/src/vs/editor/common/modes/supports/onEnter.ts b/src/vs/editor/common/modes/supports/onEnter.ts index 3bddd1f856647a41884c788d1f6da1637ba87d33..2287829bb1d7bec30c07050e3f5ed35dfc8cd5b0 100644 --- a/src/vs/editor/common/modes/supports/onEnter.ts +++ b/src/vs/editor/common/modes/supports/onEnter.ts @@ -72,45 +72,6 @@ export class OnEnterSupport { } } - // (3): Indentation Support - if (this._indentationRules) { - let indentOffset: null | number = null; - let outdentCurrentLine = false; - - if (this._indentationRules.increaseIndentPattern && this._indentationRules.increaseIndentPattern.test(beforeEnterText)) { - indentOffset = 1; - } - if (this._indentationRules.indentNextLinePattern && this._indentationRules.indentNextLinePattern.test(beforeEnterText)) { - indentOffset = 1; - } - - /** - * Since the indentation of `beforeEnterText` might not be correct, we still provide the correct indent action - * even if there is nothing to outdent from. - */ - if (this._indentationRules.decreaseIndentPattern && this._indentationRules.decreaseIndentPattern.test(afterEnterText)) { - indentOffset = indentOffset ? indentOffset - 1 : -1; - } - if (this._indentationRules.indentNextLinePattern && this._indentationRules.indentNextLinePattern.test(oneLineAboveText)) { - indentOffset = indentOffset ? indentOffset - 1 : -1; - } - if (this._indentationRules.decreaseIndentPattern && this._indentationRules.decreaseIndentPattern.test(beforeEnterText)) { - outdentCurrentLine = true; - } - - if (indentOffset !== null || outdentCurrentLine) { - // this means at least one indentation rule is matched so we should handle it - indentOffset = indentOffset || 0; - switch (indentOffset) { - case -1: - return { indentAction: IndentAction.Outdent, outdentCurrentLine: outdentCurrentLine }; - case 0: - return { indentAction: IndentAction.None, outdentCurrentLine: outdentCurrentLine }; - case 1: - return { indentAction: IndentAction.Indent, outdentCurrentLine: outdentCurrentLine }; - } - } - } // (4): Open bracket based logic if (beforeEnterText.length > 0) { @@ -125,26 +86,6 @@ export class OnEnterSupport { return null; } - public containNonWhitespace(text: string): boolean { - // the text doesn't contain any non-whitespace character. - let nonWhitespaceIdx = strings.lastNonWhitespaceIndex(text); - - if (nonWhitespaceIdx >= 0) { - return true; - } - - return false; - } - - public shouldIgnore(text: string): boolean { - // the text matches `unIndentedLinePattern` - if (this._indentationRules && this._indentationRules.unIndentedLinePattern && this._indentationRules.unIndentedLinePattern.test(text)) { - return true; - } - - return false; - } - private static _createOpenBracketRegExp(bracket: string): RegExp { var str = strings.escapeRegExpCharacters(bracket); if (!/\B/.test(str.charAt(0))) { diff --git a/src/vs/editor/common/services/bulkEdit.ts b/src/vs/editor/common/services/bulkEdit.ts index e847eafc9114757bd88b01aad6028ab8f91d9b23..9916d05ad03b018b4c18ed3a829a8bd3ca14144a 100644 --- a/src/vs/editor/common/services/bulkEdit.ts +++ b/src/vs/editor/common/services/bulkEdit.ts @@ -10,7 +10,7 @@ import { IStringDictionary, forEach, values, groupBy, size } from 'vs/base/commo import { IDisposable, dispose, IReference } from 'vs/base/common/lifecycle'; import URI from 'vs/base/common/uri'; import { TPromise } from 'vs/base/common/winjs.base'; -import { ITextModelResolverService, ITextEditorModel } from 'vs/editor/common/services/resolverService'; +import { ITextModelService, ITextEditorModel } from 'vs/editor/common/services/resolverService'; import { IFileService, IFileChange } from 'vs/platform/files/common/files'; import { EditOperation } from 'vs/editor/common/core/editOperation'; import { Range, IRange } from 'vs/editor/common/core/range'; @@ -183,7 +183,7 @@ class SourceModelEditTask extends EditTask { class BulkEditModel implements IDisposable { - private _textModelResolverService: ITextModelResolverService; + private _textModelResolverService: ITextModelService; private _numberOfResourcesToModify: number = 0; private _numberOfChanges: number = 0; private _edits: IStringDictionary = Object.create(null); @@ -192,7 +192,7 @@ class BulkEditModel implements IDisposable { private _sourceSelections: Selection[]; private _sourceModelTask: SourceModelEditTask; - constructor(textModelResolverService: ITextModelResolverService, sourceModel: URI, sourceSelections: Selection[], edits: IResourceEdit[], private progress: IProgressRunner = null) { + constructor(textModelResolverService: ITextModelService, sourceModel: URI, sourceSelections: Selection[], edits: IResourceEdit[], private progress: IProgressRunner = null) { this._textModelResolverService = textModelResolverService; this._sourceModel = sourceModel; this._sourceSelections = sourceSelections; @@ -293,14 +293,14 @@ export interface BulkEdit { ariaMessage(): string; } -export function bulkEdit(textModelResolverService: ITextModelResolverService, editor: ICommonCodeEditor, edits: IResourceEdit[], fileService?: IFileService, progress: IProgressRunner = null): TPromise { +export function bulkEdit(textModelResolverService: ITextModelService, editor: ICommonCodeEditor, edits: IResourceEdit[], fileService?: IFileService, progress: IProgressRunner = null): TPromise { let bulk = createBulkEdit(textModelResolverService, editor, fileService); bulk.add(edits); bulk.progress(progress); return bulk.finish(); } -export function createBulkEdit(textModelResolverService: ITextModelResolverService, editor?: ICommonCodeEditor, fileService?: IFileService): BulkEdit { +export function createBulkEdit(textModelResolverService: ITextModelService, editor?: ICommonCodeEditor, fileService?: IFileService): BulkEdit { let all: IResourceEdit[] = []; let recording = new ChangeRecorder(fileService).start(); diff --git a/src/vs/editor/common/services/editorWorkerServiceImpl.ts b/src/vs/editor/common/services/editorWorkerServiceImpl.ts index 77afcaec5dee78c20e9759b1c5419ef8e62c1f16..62401d3df919b292bf879fdb4301e9f65dc43380 100644 --- a/src/vs/editor/common/services/editorWorkerServiceImpl.ts +++ b/src/vs/editor/common/services/editorWorkerServiceImpl.ts @@ -17,7 +17,7 @@ import { IEditorWorkerService } from 'vs/editor/common/services/editorWorkerServ import { IModelService } from 'vs/editor/common/services/modelService'; import { EditorSimpleWorkerImpl } from 'vs/editor/common/services/editorSimpleWorker'; import { LanguageConfigurationRegistry } from 'vs/editor/common/modes/languageConfigurationRegistry'; -import { IConfigurationService, IConfigurationOptions } from 'vs/platform/configuration/common/configuration'; +import { ITextResourceConfigurationService } from 'vs/editor/common/services/resourceConfiguration'; import { IEditorOptions } from 'vs/editor/common/config/editorOptions'; import { IRange } from 'vs/editor/common/core/range'; import { IModeService } from 'vs/editor/common/services/modeService'; @@ -39,7 +39,7 @@ export class EditorWorkerServiceImpl extends Disposable implements IEditorWorker constructor( @IModelService modelService: IModelService, - @IConfigurationService configurationService: IConfigurationService, + @ITextResourceConfigurationService configurationService: ITextResourceConfigurationService, @IModeService modeService: IModeService ) { super(); @@ -82,19 +82,17 @@ export class EditorWorkerServiceImpl extends Disposable implements IEditorWorker class WordBasedCompletionItemProvider implements modes.ISuggestSupport { private readonly _workerManager: WorkerManager; - private readonly _configurationService: IConfigurationService; + private readonly _configurationService: ITextResourceConfigurationService; private readonly _modeService: IModeService; - constructor(workerManager: WorkerManager, configurationService: IConfigurationService, modeService: IModeService) { + constructor(workerManager: WorkerManager, configurationService: ITextResourceConfigurationService, modeService: IModeService) { this._workerManager = workerManager; this._configurationService = configurationService; this._modeService = modeService; } provideCompletionItems(model: editorCommon.IModel, position: Position): TPromise { - const { language } = this._modeService.getLanguageIdentifier(model.getLanguageIdAtPosition(position.lineNumber, position.column)); - const options = { section: 'editor', overrideIdentifier: language }; - const { wordBasedSuggestions } = this._configurationService.getConfiguration(options); + const { wordBasedSuggestions } = this._configurationService.getConfiguration(model.uri, position, 'editor'); if (!wordBasedSuggestions) { return undefined; } diff --git a/src/vs/editor/common/services/languagesRegistry.ts b/src/vs/editor/common/services/languagesRegistry.ts index 6c14559a26d8659b18b214f9f737224affd6b35c..0159f694c702680a1b8e6c70dd87eee98af98f50 100644 --- a/src/vs/editor/common/services/languagesRegistry.ts +++ b/src/vs/editor/common/services/languagesRegistry.ts @@ -7,7 +7,7 @@ import { onUnexpectedError } from 'vs/base/common/errors'; import * as mime from 'vs/base/common/mime'; import * as strings from 'vs/base/common/strings'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { ModesRegistry } from 'vs/editor/common/modes/modesRegistry'; import { ILanguageExtensionPoint } from 'vs/editor/common/services/modeService'; import { LanguageId, LanguageIdentifier } from 'vs/editor/common/modes'; diff --git a/src/vs/editor/common/services/modeServiceImpl.ts b/src/vs/editor/common/services/modeServiceImpl.ts index e03585bdb33e7503188c1b90c44e93777b6bc733..d75ed1aafb6270a1afe8e57ed7acad4ccb32dd68 100644 --- a/src/vs/editor/common/services/modeServiceImpl.ts +++ b/src/vs/editor/common/services/modeServiceImpl.ts @@ -4,75 +4,13 @@ *--------------------------------------------------------------------------------------------*/ 'use strict'; -import * as nls from 'vs/nls'; import { onUnexpectedError } from 'vs/base/common/errors'; import Event, { Emitter } from 'vs/base/common/event'; import { TPromise } from 'vs/base/common/winjs.base'; -import { IExtensionPoint, ExtensionsRegistry } from 'vs/platform/extensions/common/extensionsRegistry'; import { IMode, LanguageId, LanguageIdentifier } from 'vs/editor/common/modes'; import { FrankensteinMode } from 'vs/editor/common/modes/abstractMode'; import { LanguagesRegistry } from 'vs/editor/common/services/languagesRegistry'; -import { ILanguageExtensionPoint, IModeLookupResult, IModeService } from 'vs/editor/common/services/modeService'; - -export const languagesExtPoint: IExtensionPoint = ExtensionsRegistry.registerExtensionPoint('languages', [], { - description: nls.localize('vscode.extension.contributes.languages', 'Contributes language declarations.'), - type: 'array', - items: { - type: 'object', - defaultSnippets: [{ body: { id: '${1:languageId}', aliases: ['${2:label}'], extensions: ['${3:extension}'], configuration: './language-configuration.json' } }], - properties: { - id: { - description: nls.localize('vscode.extension.contributes.languages.id', 'ID of the language.'), - type: 'string' - }, - aliases: { - description: nls.localize('vscode.extension.contributes.languages.aliases', 'Name aliases for the language.'), - type: 'array', - items: { - type: 'string' - } - }, - extensions: { - description: nls.localize('vscode.extension.contributes.languages.extensions', 'File extensions associated to the language.'), - default: ['.foo'], - type: 'array', - items: { - type: 'string' - } - }, - filenames: { - description: nls.localize('vscode.extension.contributes.languages.filenames', 'File names associated to the language.'), - type: 'array', - items: { - type: 'string' - } - }, - filenamePatterns: { - description: nls.localize('vscode.extension.contributes.languages.filenamePatterns', 'File name glob patterns associated to the language.'), - type: 'array', - items: { - type: 'string' - } - }, - mimetypes: { - description: nls.localize('vscode.extension.contributes.languages.mimetypes', 'Mime types associated to the language.'), - type: 'array', - items: { - type: 'string' - } - }, - firstLine: { - description: nls.localize('vscode.extension.contributes.languages.firstLine', 'A regular expression matching the first line of a file of the language.'), - type: 'string' - }, - configuration: { - description: nls.localize('vscode.extension.contributes.languages.configuration', 'A relative path to a file containing configuration options for the language.'), - type: 'string', - default: './language-configuration.json' - } - } - } -}); +import { IModeLookupResult, IModeService } from 'vs/editor/common/services/modeService'; export class ModeServiceImpl implements IModeService { public _serviceBrand: any; diff --git a/src/vs/editor/common/services/modelServiceImpl.ts b/src/vs/editor/common/services/modelServiceImpl.ts index 5fee6ded32a335d13e7a0b18e45fabcf7898b2c4..064ac2b0f0abdd69165af04292262d7b342668d4 100644 --- a/src/vs/editor/common/services/modelServiceImpl.ts +++ b/src/vs/editor/common/services/modelServiceImpl.ts @@ -21,7 +21,7 @@ import { IMode, LanguageIdentifier } from 'vs/editor/common/modes'; import { IModelService } from 'vs/editor/common/services/modelService'; import * as platform from 'vs/base/common/platform'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { EDITOR_MODEL_DEFAULTS } from "vs/editor/common/config/editorOptions"; +import { EDITOR_MODEL_DEFAULTS } from 'vs/editor/common/config/editorOptions'; import { PLAINTEXT_LANGUAGE_IDENTIFIER } from 'vs/editor/common/modes/modesRegistry'; import { IRawTextSource, TextSource, RawTextSource } from 'vs/editor/common/model/textSource'; import * as textModelEvents from 'vs/editor/common/model/textModelEvents'; @@ -267,7 +267,7 @@ export class ModelServiceImpl implements IModelService { public getCreationOptions(language: string): editorCommon.ITextModelCreationOptions { let creationOptions = this._modelCreationOptionsByLanguage[language]; if (!creationOptions) { - creationOptions = ModelServiceImpl._readModelOptions(this._configurationService.getConfiguration({ overrideIdentifier: language })); + creationOptions = ModelServiceImpl._readModelOptions(this._configurationService.getConfiguration(null, { overrideIdentifier: language })); this._modelCreationOptionsByLanguage[language] = creationOptions; } return creationOptions; diff --git a/src/vs/editor/common/services/resolverService.ts b/src/vs/editor/common/services/resolverService.ts index aacd94b9622b4408d64120f816c1a828c826a6f4..f476280d339c587effd42896343c09e661eb97ce 100644 --- a/src/vs/editor/common/services/resolverService.ts +++ b/src/vs/editor/common/services/resolverService.ts @@ -11,9 +11,9 @@ import { IModel } from 'vs/editor/common/editorCommon'; import { IEditorModel } from 'vs/platform/editor/common/editor'; import { IDisposable, IReference } from 'vs/base/common/lifecycle'; -export const ITextModelResolverService = createDecorator('textModelResolverService'); +export const ITextModelService = createDecorator('textModelService'); -export interface ITextModelResolverService { +export interface ITextModelService { _serviceBrand: any; /** @@ -42,4 +42,4 @@ export interface ITextEditorModel extends IEditorModel { * Provides access to the underlying IModel. */ textEditorModel: IModel; -} \ No newline at end of file +} diff --git a/src/vs/editor/common/services/resourceConfiguration.ts b/src/vs/editor/common/services/resourceConfiguration.ts new file mode 100644 index 0000000000000000000000000000000000000000..2a959539e9ba4ad149d20c34babe53f116dfc5a0 --- /dev/null +++ b/src/vs/editor/common/services/resourceConfiguration.ts @@ -0,0 +1,34 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import Event from 'vs/base/common/event'; +import URI from 'vs/base/common/uri'; +import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; +import { IPosition } from 'vs/editor/common/core/position'; + +export const ITextResourceConfigurationService = createDecorator('textResourceConfigurationService'); + +export interface ITextResourceConfigurationService { + + _serviceBrand: any; + + /** + * Event that fires when the configuration changes. + */ + onDidUpdateConfiguration: Event; + + /** + * Fetches the appropriate section of the for the given resource with appropriate overrides (e.g. language). + * This will be an object keyed off the section name. + * + * @param resource - Resource for which the configuration has to be fetched. Can be `null` or `undefined`. + * @param postion - Position in the resource for which configuration has to be fetched. Can be `null` or `undefined`. + * @param section - Section of the configuraion. Can be `null` or `undefined`. + * + */ + getConfiguration(resource: URI, section?: string): T; + getConfiguration(resource: URI, position?: IPosition, section?: string): T; + +} \ No newline at end of file diff --git a/src/vs/editor/common/services/resourceConfigurationImpl.ts b/src/vs/editor/common/services/resourceConfigurationImpl.ts new file mode 100644 index 0000000000000000000000000000000000000000..212f86d86f0a4c7291f7c995b15c39a49c3492a1 --- /dev/null +++ b/src/vs/editor/common/services/resourceConfigurationImpl.ts @@ -0,0 +1,47 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import Event, { Emitter } from 'vs/base/common/event'; +import { Disposable } from "vs/base/common/lifecycle"; +import URI from 'vs/base/common/uri'; +import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; +import { ITextResourceConfigurationService } from 'vs/editor/common/services/resourceConfiguration'; +import { IPosition, Position } from 'vs/editor/common/core/position'; +import { IModeService } from 'vs/editor/common/services/modeService'; +import { IModelService } from 'vs/editor/common/services/modelService'; + +export class TextResourceConfigurationService extends Disposable implements ITextResourceConfigurationService { + + public _serviceBrand: any; + + private readonly _onDidUpdateConfiguration: Emitter = this._register(new Emitter()); + public readonly onDidUpdateConfiguration: Event = this._onDidUpdateConfiguration.event; + + constructor( + @IConfigurationService private configurationService: IConfigurationService, + @IModelService private modelService: IModelService, + @IModeService private modeService: IModeService, + ) { + super(); + this._register(this.configurationService.onDidUpdateConfiguration(() => this._onDidUpdateConfiguration.fire())); + } + + getConfiguration(resource: URI, section?: string): T + getConfiguration(resource: URI, at?: IPosition, section?: string): T + getConfiguration(resource: URI, arg2?: any, arg3?: any): T { + const position: IPosition = Position.isIPosition(arg2) ? arg2 : null; + const section: string = position ? (typeof arg3 === 'string' ? arg3 : void 0) : (typeof arg2 === 'string' ? arg2 : void 0); + const language = resource ? this.getLanguage(resource, position) : void 0; + return this.configurationService.getConfiguration(section, { resource, overrideIdentifier: language }); + } + + private getLanguage(resource: URI, position: IPosition): string { + const model = this.modelService.getModel(resource); + if (model) { + return position ? this.modeService.getLanguageIdentifier(model.getLanguageIdAtPosition(position.lineNumber, position.column)).language : model.getLanguageIdentifier().language; + } + return this.modeService.getModeIdByFilenameOrFirstLine(resource.fsPath); + } +} \ No newline at end of file diff --git a/src/vs/editor/common/view/editorColorRegistry.ts b/src/vs/editor/common/view/editorColorRegistry.ts index 9b72bd4af44810fc323ccc3afdb3c97517491e7b..855522bd9fae6002680f7f7732eaa7b315c87550 100644 --- a/src/vs/editor/common/view/editorColorRegistry.ts +++ b/src/vs/editor/common/view/editorColorRegistry.ts @@ -39,7 +39,7 @@ export const editorWarningBorder = registerColor('editorWarning.border', { dark: registerThemingParticipant((theme, collector) => { let background = theme.getColor(editorBackground); if (background) { - collector.addRule(`.monaco-editor, .monaco-editor .monaco-editor-background, .monaco-editor .inputarea.ime-input { background-color: ${background}; }`); + collector.addRule(`.monaco-editor, .monaco-editor-background, .monaco-editor .inputarea.ime-input { background-color: ${background}; }`); } let foreground = theme.getColor(editorForeground); if (foreground) { diff --git a/src/vs/editor/common/view/minimapCharRenderer.ts b/src/vs/editor/common/view/minimapCharRenderer.ts index ac1d59a029ff2fcc7b92cebb9ad7cd8c148830dd..cdf67f31294f104ec8f1ae8ee26c6365174cc391 100644 --- a/src/vs/editor/common/view/minimapCharRenderer.ts +++ b/src/vs/editor/common/view/minimapCharRenderer.ts @@ -253,7 +253,7 @@ export class MinimapCharRenderer { const deltaG = color.g - backgroundG; const deltaB = color.b - backgroundB; - const colorR = backgroundR + deltaR * c;; + const colorR = backgroundR + deltaR * c; const colorG = backgroundG + deltaG * c; const colorB = backgroundB + deltaB * c; @@ -325,7 +325,7 @@ export class MinimapCharRenderer { const deltaG = color.g - backgroundG; const deltaB = color.b - backgroundB; - const colorR = backgroundR + deltaR * c;; + const colorR = backgroundR + deltaR * c; const colorG = backgroundG + deltaG * c; const colorB = backgroundB + deltaB * c; diff --git a/src/vs/editor/common/view/viewEvents.ts b/src/vs/editor/common/view/viewEvents.ts index f6696746fbf1868b56fdd52a436e95879e64565a..b4a6e4bbf28df828fb9aafb0b8ca2c926421198e 100644 --- a/src/vs/editor/common/view/viewEvents.ts +++ b/src/vs/editor/common/view/viewEvents.ts @@ -9,7 +9,7 @@ import { Selection } from 'vs/editor/common/core/selection'; import { ScrollEvent } from 'vs/base/common/scrollable'; import { IConfigurationChangedEvent } from 'vs/editor/common/config/editorOptions'; import * as errors from 'vs/base/common/errors'; -import { IDisposable, Disposable } from "vs/base/common/lifecycle"; +import { IDisposable, Disposable } from 'vs/base/common/lifecycle'; export const enum ViewEventType { ViewConfigurationChanged = 1, @@ -33,7 +33,7 @@ export class ViewConfigurationChangedEvent { public readonly type = ViewEventType.ViewConfigurationChanged; - public readonly canUseTranslate3d: boolean; + public readonly canUseLayerHinting: boolean; public readonly pixelRatio: boolean; public readonly editorClassName: boolean; public readonly lineHeight: boolean; @@ -46,7 +46,7 @@ export class ViewConfigurationChangedEvent { public readonly wrappingInfo: boolean; constructor(source: IConfigurationChangedEvent) { - this.canUseTranslate3d = source.canUseTranslate3d; + this.canUseLayerHinting = source.canUseLayerHinting; this.pixelRatio = source.pixelRatio; this.editorClassName = source.editorClassName; this.lineHeight = source.lineHeight; diff --git a/src/vs/editor/common/viewLayout/viewLayout.ts b/src/vs/editor/common/viewLayout/viewLayout.ts index e6a9d763d29857862a6a64f04c2e2deca54b2158..4af8cbd5235679516ffee11f3e6ab28c24a6a7c4 100644 --- a/src/vs/editor/common/viewLayout/viewLayout.ts +++ b/src/vs/editor/common/viewLayout/viewLayout.ts @@ -12,7 +12,7 @@ import { IViewLayout, IViewWhitespaceViewportData, Viewport } from 'vs/editor/co import { IPartialViewLinesViewportData } from 'vs/editor/common/viewLayout/viewLinesViewportData'; import { IEditorWhitespace } from 'vs/editor/common/viewLayout/whitespaceComputer'; import Event from 'vs/base/common/event'; -import { IConfigurationChangedEvent } from "vs/editor/common/config/editorOptions"; +import { IConfigurationChangedEvent } from 'vs/editor/common/config/editorOptions'; export class ViewLayout extends Disposable implements IViewLayout { diff --git a/src/vs/editor/common/viewLayout/viewLinesViewportData.ts b/src/vs/editor/common/viewLayout/viewLinesViewportData.ts index 6d8a2ec910df67811aadfa7209893ceb7de629bf..9ff9ddfe449628234ecb62646aecbce01e0e3660 100644 --- a/src/vs/editor/common/viewLayout/viewLinesViewportData.ts +++ b/src/vs/editor/common/viewLayout/viewLinesViewportData.ts @@ -4,8 +4,9 @@ *--------------------------------------------------------------------------------------------*/ 'use strict'; -import { ViewLineRenderingData, IViewModel, ViewModelDecoration } from 'vs/editor/common/viewModel/viewModel'; +import { ViewLineRenderingData, IViewModel, ViewModelDecoration, IViewWhitespaceViewportData } from 'vs/editor/common/viewModel/viewModel'; import { Range } from 'vs/editor/common/core/range'; +import { Selection } from 'vs/editor/common/core/selection'; export interface IPartialViewLinesViewportData { /** @@ -21,8 +22,7 @@ export interface IPartialViewLinesViewportData { */ readonly endLineNumber: number; /** - * relativeVerticalOffset[i] is the gap that must be left between line at - * i - 1 + `startLineNumber` and i + `startLineNumber`. + * relativeVerticalOffset[i] is the `top` position for line at `i` + `startLineNumber`. */ readonly relativeVerticalOffset: number[]; /** @@ -44,6 +44,8 @@ export interface IPartialViewLinesViewportData { */ export class ViewportData { + public readonly selections: Selection[]; + /** * The line number at which to start rendering (inclusive). */ @@ -55,8 +57,7 @@ export class ViewportData { public readonly endLineNumber: number; /** - * relativeVerticalOffset[i] is the gap that must be left between line at - * i - 1 + `startLineNumber` and i + `startLineNumber`. + * relativeVerticalOffset[i] is the `top` position for line at `i` + `startLineNumber`. */ public readonly relativeVerticalOffset: number[]; @@ -70,16 +71,25 @@ export class ViewportData { */ public readonly bigNumbersDelta: number; + /** + * Positioning information about gaps whitespace. + */ + public readonly whitespaceViewportData: IViewWhitespaceViewportData[]; + private readonly _model: IViewModel; constructor( + selections: Selection[], partialData: IPartialViewLinesViewportData, + whitespaceViewportData: IViewWhitespaceViewportData[], model: IViewModel ) { + this.selections = selections; this.startLineNumber = partialData.startLineNumber | 0; this.endLineNumber = partialData.endLineNumber | 0; this.relativeVerticalOffset = partialData.relativeVerticalOffset; this.bigNumbersDelta = partialData.bigNumbersDelta | 0; + this.whitespaceViewportData = whitespaceViewportData; this._model = model; diff --git a/src/vs/editor/common/viewModel/splitLinesCollection.ts b/src/vs/editor/common/viewModel/splitLinesCollection.ts index 72caeb160e82297e3c1842751f150774b7839293..7c40b262f096d2c35b36cc720aa8ff09ec63b730 100644 --- a/src/vs/editor/common/viewModel/splitLinesCollection.ts +++ b/src/vs/editor/common/viewModel/splitLinesCollection.ts @@ -12,7 +12,7 @@ import { PrefixSumComputerWithCache } from 'vs/editor/common/viewModel/prefixSum import { ViewLineData } from 'vs/editor/common/viewModel/viewModel'; import * as viewEvents from 'vs/editor/common/view/viewEvents'; import { WrappingIndent } from 'vs/editor/common/config/editorOptions'; -import { ModelDecorationOptions } from "vs/editor/common/model/textModelWithDecorations"; +import { ModelDecorationOptions } from 'vs/editor/common/model/textModelWithDecorations'; export class OutputPosition { _outputPositionBrand: void; diff --git a/src/vs/editor/common/viewModel/viewModel.ts b/src/vs/editor/common/viewModel/viewModel.ts index ffb43fadd6aa2c9a129e383b43e759c90086dec2..6372d3a14158ca04b437970d4dd5d62d7cca22b0 100644 --- a/src/vs/editor/common/viewModel/viewModel.ts +++ b/src/vs/editor/common/viewModel/viewModel.ts @@ -11,9 +11,9 @@ import { Range } from 'vs/editor/common/core/range'; import { Selection } from 'vs/editor/common/core/selection'; import { ViewEvent, IViewEventListener } from 'vs/editor/common/view/viewEvents'; import { IDisposable } from 'vs/base/common/lifecycle'; -import { Scrollable } from "vs/base/common/scrollable"; -import { IPartialViewLinesViewportData } from "vs/editor/common/viewLayout/viewLinesViewportData"; -import { IEditorWhitespace } from "vs/editor/common/viewLayout/whitespaceComputer"; +import { Scrollable } from 'vs/base/common/scrollable'; +import { IPartialViewLinesViewportData } from 'vs/editor/common/viewLayout/viewLinesViewportData'; +import { IEditorWhitespace } from 'vs/editor/common/viewLayout/whitespaceComputer'; export interface IViewWhitespaceViewportData { readonly id: number; diff --git a/src/vs/editor/common/viewModel/viewModelDecorations.ts b/src/vs/editor/common/viewModel/viewModelDecorations.ts index 2a04c160d9410aa387c8871c318f57b9c6c16d87..f4311681f821454137898883f6badcbd39306309 100644 --- a/src/vs/editor/common/viewModel/viewModelDecorations.ts +++ b/src/vs/editor/common/viewModel/viewModelDecorations.ts @@ -71,9 +71,9 @@ export class ViewModelDecorations implements IDisposable { } let removedDecorations = e.removedDecorations; - for (let i = 0, len = removedDecorations.length; i < len; i++) { - let removedDecoration = removedDecorations[i]; - if (removedDecoration !== null && removedDecoration !== undefined) { + if (this._decorationsCache !== null && this._decorationsCache !== undefined) { + for (let i = 0, len = removedDecorations.length; i < len; i++) { + let removedDecoration = removedDecorations[i]; delete this._decorationsCache[removedDecoration]; } } diff --git a/src/vs/editor/common/viewModel/viewModelImpl.ts b/src/vs/editor/common/viewModel/viewModelImpl.ts index be7b24bb8280ac26c2161450cbeb06c825555507..c05068d4a837956635754bc0e67bd79dd468f2c7 100644 --- a/src/vs/editor/common/viewModel/viewModelImpl.ts +++ b/src/vs/editor/common/viewModel/viewModelImpl.ts @@ -19,7 +19,7 @@ import * as viewEvents from 'vs/editor/common/view/viewEvents'; import { MinimapTokensColorTracker } from 'vs/editor/common/view/minimapCharRenderer'; import * as textModelEvents from 'vs/editor/common/model/textModelEvents'; import { IConfigurationChangedEvent } from 'vs/editor/common/config/editorOptions'; -import { CharacterHardWrappingLineMapperFactory } from "vs/editor/common/viewModel/characterHardWrappingLineMapper"; +import { CharacterHardWrappingLineMapperFactory } from 'vs/editor/common/viewModel/characterHardWrappingLineMapper'; import { ViewLayout } from 'vs/editor/common/viewLayout/viewLayout'; export class CoordinatesConverter implements ICoordinatesConverter { @@ -120,8 +120,6 @@ export class ViewModel extends viewEvents.ViewEventEmitter implements IViewModel conf.wrappingInfo.wrappingIndent ); - this.configuration.setMaxLineNumber(this.model.getLineCount()); - this.coordinatesConverter = new CoordinatesConverter(this.lines); this.viewLayout = this._register(new ViewLayout(this.configuration, this.getLineCount())); diff --git a/src/vs/editor/contrib/bracketMatching/common/bracketMatching.ts b/src/vs/editor/contrib/bracketMatching/common/bracketMatching.ts index a3443fa79fd79ac27993e675c1d682265fc95f27..7b79df152e732e79eecea44f234dc1cd676bdda4 100644 --- a/src/vs/editor/contrib/bracketMatching/common/bracketMatching.ts +++ b/src/vs/editor/contrib/bracketMatching/common/bracketMatching.ts @@ -14,9 +14,9 @@ import { RunOnceScheduler } from 'vs/base/common/async'; import * as editorCommon from 'vs/editor/common/editorCommon'; import { editorAction, commonEditorContribution, ServicesAccessor, EditorAction } from 'vs/editor/common/editorCommonExtensions'; import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import { registerThemingParticipant } from "vs/platform/theme/common/themeService"; -import { editorBracketMatchBackground, editorBracketMatchBorder } from "vs/editor/common/view/editorColorRegistry"; -import { ModelDecorationOptions } from "vs/editor/common/model/textModelWithDecorations"; +import { registerThemingParticipant } from 'vs/platform/theme/common/themeService'; +import { editorBracketMatchBackground, editorBracketMatchBorder } from 'vs/editor/common/view/editorColorRegistry'; +import { ModelDecorationOptions } from 'vs/editor/common/model/textModelWithDecorations'; @editorAction class SelectBracketAction extends EditorAction { diff --git a/src/vs/editor/contrib/codelens/browser/codelens.ts b/src/vs/editor/contrib/codelens/browser/codelens.ts index 84fcda05eb1d3e33960205011ad3b4d110ef6b4f..0c7d563cc55e91319c6c029b3a0dbe1dbc5a5795 100644 --- a/src/vs/editor/contrib/codelens/browser/codelens.ts +++ b/src/vs/editor/contrib/codelens/browser/codelens.ts @@ -5,637 +5,68 @@ 'use strict'; -import 'vs/css!./codelens'; -import { RunOnceScheduler, asWinJsPromise } from 'vs/base/common/async'; -import { onUnexpectedError } from 'vs/base/common/errors'; -import { IDisposable, dispose } from 'vs/base/common/lifecycle'; -import Severity from 'vs/base/common/severity'; -import { format, escape } from 'vs/base/common/strings'; +import { illegalArgument, onUnexpectedExternalError } from 'vs/base/common/errors'; +import { mergeSort } from 'vs/base/common/arrays'; +import URI from 'vs/base/common/uri'; import { TPromise } from 'vs/base/common/winjs.base'; -import * as dom from 'vs/base/browser/dom'; -import { ICommandService } from 'vs/platform/commands/common/commands'; -import { IMessageService } from 'vs/platform/message/common/message'; -import { Range } from 'vs/editor/common/core/range'; -import * as editorCommon from 'vs/editor/common/editorCommon'; -import { CodeLensProviderRegistry, ICodeLensSymbol, Command } from 'vs/editor/common/modes'; -import * as editorBrowser from 'vs/editor/browser/editorBrowser'; -import { editorContribution } from 'vs/editor/browser/editorBrowserExtensions'; -import { ICodeLensData, getCodeLensData } from '../common/codelens'; -import { IConfigurationChangedEvent } from 'vs/editor/common/config/editorOptions'; -import { editorCodeLensForeground } from "vs/editor/common/view/editorColorRegistry"; -import { registerThemingParticipant } from "vs/platform/theme/common/themeService"; -import { editorActiveLinkForeground } from "vs/platform/theme/common/colorRegistry"; -import { ModelDecorationOptions } from "vs/editor/common/model/textModelWithDecorations"; - - -class CodeLensViewZone implements editorBrowser.IViewZone { - - public afterLineNumber: number; - public heightInLines: number; - public suppressMouseDown: boolean; - public domNode: HTMLElement; - private _lastHeight: number; - private _onHeight: Function; - - constructor(afterLineNumber: number, onHeight: Function) { - this.afterLineNumber = afterLineNumber; - this._onHeight = onHeight; - - this.heightInLines = 1; - this.suppressMouseDown = true; - this.domNode = document.createElement('div'); - } - - public setAfterLineNumber(afterLineNumber: number): void { - this.afterLineNumber = afterLineNumber; - } - - onComputedHeight(height: number): void { - if (this._lastHeight === undefined) { - this._lastHeight = height; - } else if (this._lastHeight !== height) { - this._lastHeight = height; - this._onHeight(); - } - } - +import { IModel } from 'vs/editor/common/editorCommon'; +import { CommonEditorRegistry } from 'vs/editor/common/editorCommonExtensions'; +import { CodeLensProviderRegistry, CodeLensProvider, ICodeLensSymbol } from 'vs/editor/common/modes'; +import { IModelService } from 'vs/editor/common/services/modelService'; +import { asWinJsPromise } from 'vs/base/common/async'; + +export interface ICodeLensData { + symbol: ICodeLensSymbol; + provider: CodeLensProvider; } -class CodeLensContentWidget implements editorBrowser.IContentWidget { - - private static ID: number = 0; - - // Editor.IContentWidget.allowEditorOverflow - readonly allowEditorOverflow: boolean = false; - readonly suppressMouseDown: boolean = true; - - private _id: string; - - private _domNode: HTMLElement; - private _disposables: IDisposable[] = []; - private _symbolRange: Range; - private _widgetPosition: editorBrowser.IContentWidgetPosition; - private _editor: editorBrowser.ICodeEditor; - private _commands: { [id: string]: Command } = Object.create(null); - - public constructor( - editor: editorBrowser.ICodeEditor, - symbolRange: Range, - commandService: ICommandService, - messageService: IMessageService - ) { - - this._id = 'codeLensWidget' + (++CodeLensContentWidget.ID); - this._editor = editor; - - this.setSymbolRange(symbolRange); - - this._domNode = document.createElement('span'); - this._domNode.innerHTML = ' '; - dom.addClass(this._domNode, 'codelens-decoration'); - dom.addClass(this._domNode, 'invisible-cl'); - this._updateHeight(); - - this._disposables.push(this._editor.onDidChangeConfiguration(e => { - if (e.fontInfo) { - this._updateHeight(); - } - })); - - this._disposables.push(dom.addDisposableListener(this._domNode, 'click', e => { - let element = e.target; - if (element.tagName === 'A' && element.id) { - let command = this._commands[element.id]; - if (command) { - editor.focus(); - commandService.executeCommand(command.id, ...command.arguments).done(undefined, err => { - messageService.show(Severity.Error, err); - }); - } - } - })); - - this.updateVisibility(); - } - - public dispose(): void { - dispose(this._disposables); - this._symbolRange = null; - } - - private _updateHeight(): void { - const { fontInfo, lineHeight } = this._editor.getConfiguration(); - this._domNode.style.height = `${Math.round(lineHeight * 1.1)}px`; - this._domNode.style.lineHeight = `${lineHeight}px`; - this._domNode.style.fontSize = `${Math.round(fontInfo.fontSize * .9)}px`; - this._domNode.innerHTML = ' '; - } - - public updateVisibility(): void { - if (this.isVisible()) { - dom.removeClass(this._domNode, 'invisible-cl'); - dom.addClass(this._domNode, 'fadein'); - } - } +export function getCodeLensData(model: IModel): TPromise { - public withCommands(symbols: ICodeLensSymbol[]): void { - this._commands = Object.create(null); - if (!symbols || !symbols.length) { - this._domNode.innerHTML = 'no commands'; - return; - } + const symbols: ICodeLensData[] = []; + const provider = CodeLensProviderRegistry.ordered(model); - let html: string[] = []; - for (let i = 0; i < symbols.length; i++) { - let command = symbols[i].command; - let title = escape(command.title); - let part: string; - if (command.id) { - part = format('{1}', i, title); - this._commands[i] = command; - } else { - part = format('{0}', title); + const promises = provider.map(provider => asWinJsPromise(token => provider.provideCodeLenses(model, token)).then(result => { + if (Array.isArray(result)) { + for (let symbol of result) { + symbols.push({ symbol, provider }); } - html.push(part); - } - - this._domNode.innerHTML = html.join(' | '); - this._editor.layoutContentWidget(this); - } - - public getId(): string { - return this._id; - } - - public getDomNode(): HTMLElement { - return this._domNode; - } - - public setSymbolRange(range: Range): void { - this._symbolRange = range; - - const lineNumber = range.startLineNumber; - const column = this._editor.getModel().getLineFirstNonWhitespaceColumn(lineNumber); - this._widgetPosition = { - position: { lineNumber: lineNumber, column: column }, - preference: [editorBrowser.ContentWidgetPositionPreference.ABOVE] - }; - } - - public getPosition(): editorBrowser.IContentWidgetPosition { - return this._widgetPosition; - } - - public isVisible(): boolean { - return this._domNode.hasAttribute('monaco-visible-content-widget'); - } -} - -interface IDecorationIdCallback { - (decorationId: string): void; -} - -class CodeLensHelper { - - private _removeDecorations: string[]; - private _addDecorations: editorCommon.IModelDeltaDecoration[]; - private _addDecorationsCallbacks: IDecorationIdCallback[]; - - constructor() { - this._removeDecorations = []; - this._addDecorations = []; - this._addDecorationsCallbacks = []; - } - - public addDecoration(decoration: editorCommon.IModelDeltaDecoration, callback: IDecorationIdCallback): void { - this._addDecorations.push(decoration); - this._addDecorationsCallbacks.push(callback); - } - - public removeDecoration(decorationId: string): void { - this._removeDecorations.push(decorationId); - } - - public commit(changeAccessor: editorCommon.IModelDecorationsChangeAccessor): void { - var resultingDecorations = changeAccessor.deltaDecorations(this._removeDecorations, this._addDecorations); - for (let i = 0, len = resultingDecorations.length; i < len; i++) { - this._addDecorationsCallbacks[i](resultingDecorations[i]); } - } -} - -class CodeLens { - - private _viewZone: CodeLensViewZone; - private _viewZoneId: number; - private _contentWidget: CodeLensContentWidget; - private _decorationIds: string[]; - private _data: ICodeLensData[]; - private _editor: editorBrowser.ICodeEditor; - - public constructor( - data: ICodeLensData[], - editor: editorBrowser.ICodeEditor, - helper: CodeLensHelper, - viewZoneChangeAccessor: editorBrowser.IViewZoneChangeAccessor, - commandService: ICommandService, messageService: IMessageService, - updateCallabck: Function - ) { - - this._editor = editor; - this._data = data; - this._decorationIds = new Array(this._data.length); - - let range: Range; - this._data.forEach((codeLensData, i) => { - - helper.addDecoration({ - range: codeLensData.symbol.range, - options: ModelDecorationOptions.EMPTY - }, id => this._decorationIds[i] = id); - - // the range contains all lenses on this line - if (!range) { - range = Range.lift(codeLensData.symbol.range); + }, onUnexpectedExternalError)); + + return TPromise.join(promises).then(() => { + + return mergeSort(symbols, (a, b) => { + // sort by lineNumber, provider-rank, and column + if (a.symbol.range.startLineNumber < b.symbol.range.startLineNumber) { + return -1; + } else if (a.symbol.range.startLineNumber > b.symbol.range.startLineNumber) { + return 1; + } else if (provider.indexOf(a.provider) < provider.indexOf(b.provider)) { + return -1; + } else if (provider.indexOf(a.provider) > provider.indexOf(b.provider)) { + return 1; + } else if (a.symbol.range.startColumn < b.symbol.range.startColumn) { + return -1; + } else if (a.symbol.range.startColumn > b.symbol.range.startColumn) { + return 1; } else { - range = Range.plusRange(range, codeLensData.symbol.range); + return 0; } }); - - this._contentWidget = new CodeLensContentWidget(editor, range, commandService, messageService); - this._viewZone = new CodeLensViewZone(range.startLineNumber - 1, updateCallabck); - - this._viewZoneId = viewZoneChangeAccessor.addZone(this._viewZone); - this._editor.addContentWidget(this._contentWidget); - } - - public dispose(helper: CodeLensHelper, viewZoneChangeAccessor: editorBrowser.IViewZoneChangeAccessor): void { - while (this._decorationIds.length) { - helper.removeDecoration(this._decorationIds.pop()); - } - if (viewZoneChangeAccessor) { - viewZoneChangeAccessor.removeZone(this._viewZoneId); - } - this._editor.removeContentWidget(this._contentWidget); - - this._contentWidget.dispose(); - } - - public isValid(): boolean { - return this._decorationIds.some((id, i) => { - const range = this._editor.getModel().getDecorationRange(id); - const symbol = this._data[i].symbol; - return range && Range.isEmpty(symbol.range) === range.isEmpty(); - }); - } - - public updateCodeLensSymbols(data: ICodeLensData[], helper: CodeLensHelper): void { - while (this._decorationIds.length) { - helper.removeDecoration(this._decorationIds.pop()); - } - this._data = data; - this._decorationIds = new Array(this._data.length); - this._data.forEach((codeLensData, i) => { - helper.addDecoration({ - range: codeLensData.symbol.range, - options: ModelDecorationOptions.EMPTY - }, id => this._decorationIds[i] = id); - }); - } - - public computeIfNecessary(model: editorCommon.IModel): ICodeLensData[] { - this._contentWidget.updateVisibility(); // trigger the fade in - if (!this._contentWidget.isVisible()) { - return null; - } - - // Read editor current state - for (let i = 0; i < this._decorationIds.length; i++) { - this._data[i].symbol.range = model.getDecorationRange(this._decorationIds[i]); - } - return this._data; - } - - public updateCommands(symbols: ICodeLensSymbol[]): void { - this._contentWidget.withCommands(symbols); - } - - public getLineNumber(): number { - const range = this._editor.getModel().getDecorationRange(this._decorationIds[0]); - if (range) { - return range.startLineNumber; - } - return -1; - } - - public update(viewZoneChangeAccessor: editorBrowser.IViewZoneChangeAccessor): void { - if (this.isValid()) { - const range = this._editor.getModel().getDecorationRange(this._decorationIds[0]); - - this._viewZone.setAfterLineNumber(range.startLineNumber - 1); - viewZoneChangeAccessor.layoutZone(this._viewZoneId); - - this._contentWidget.setSymbolRange(range); - this._editor.layoutContentWidget(this._contentWidget); - } - } + }); } -@editorContribution -export class CodeLensContribution implements editorCommon.IEditorContribution { - - private static ID: string = 'css.editor.codeLens'; - - private _isEnabled: boolean; - - private _globalToDispose: IDisposable[]; - private _localToDispose: IDisposable[]; - private _lenses: CodeLens[]; - private _currentFindCodeLensSymbolsPromise: TPromise; - private _modelChangeCounter: number; - private _currentFindOccPromise: TPromise; - private _detectVisibleLenses: RunOnceScheduler; - - constructor( - private _editor: editorBrowser.ICodeEditor, - @ICommandService private _commandService: ICommandService, - @IMessageService private _messageService: IMessageService - ) { - this._isEnabled = this._editor.getConfiguration().contribInfo.codeLens; - - this._globalToDispose = []; - this._localToDispose = []; - this._lenses = []; - this._currentFindCodeLensSymbolsPromise = null; - this._modelChangeCounter = 0; - - this._globalToDispose.push(this._editor.onDidChangeModel(() => this.onModelChange())); - this._globalToDispose.push(this._editor.onDidChangeModelLanguage(() => this.onModelChange())); - this._globalToDispose.push(this._editor.onDidChangeConfiguration((e: IConfigurationChangedEvent) => { - let prevIsEnabled = this._isEnabled; - this._isEnabled = this._editor.getConfiguration().contribInfo.codeLens; - if (prevIsEnabled !== this._isEnabled) { - this.onModelChange(); - } - })); - this._globalToDispose.push(CodeLensProviderRegistry.onDidChange(this.onModelChange, this)); - this.onModelChange(); - } - - public dispose(): void { - this.localDispose(); - this._globalToDispose = dispose(this._globalToDispose); - } +CommonEditorRegistry.registerLanguageCommand('_executeCodeLensProvider', function (accessor, args) { - private localDispose(): void { - if (this._currentFindCodeLensSymbolsPromise) { - this._currentFindCodeLensSymbolsPromise.cancel(); - this._currentFindCodeLensSymbolsPromise = null; - this._modelChangeCounter++; - } - if (this._currentFindOccPromise) { - this._currentFindOccPromise.cancel(); - this._currentFindOccPromise = null; - } - this._localToDispose = dispose(this._localToDispose); + const { resource } = args; + if (!(resource instanceof URI)) { + throw illegalArgument(); } - public getId(): string { - return CodeLensContribution.ID; + const model = accessor.get(IModelService).getModel(resource); + if (!model) { + throw illegalArgument(); } - private onModelChange(): void { - - this.localDispose(); - - const model = this._editor.getModel(); - if (!model) { - return; - } - - if (!this._isEnabled) { - return; - } - - if (!CodeLensProviderRegistry.has(model)) { - return; - } - - for (const provider of CodeLensProviderRegistry.all(model)) { - if (typeof provider.onDidChange === 'function') { - let registration = provider.onDidChange(() => scheduler.schedule()); - this._localToDispose.push(registration); - } - } - - this._detectVisibleLenses = new RunOnceScheduler(() => { - this._onViewportChanged(model.getLanguageIdentifier().language); - }, 500); - - const scheduler = new RunOnceScheduler(() => { - if (this._currentFindCodeLensSymbolsPromise) { - this._currentFindCodeLensSymbolsPromise.cancel(); - } - - this._currentFindCodeLensSymbolsPromise = getCodeLensData(model); - - const counterValue = ++this._modelChangeCounter; - this._currentFindCodeLensSymbolsPromise.then((result) => { - if (counterValue === this._modelChangeCounter) { // only the last one wins - this.renderCodeLensSymbols(result); - this._detectVisibleLenses.schedule(); - } - }, (error) => { - onUnexpectedError(error); - }); - }, 250); - this._localToDispose.push(scheduler); - this._localToDispose.push(this._detectVisibleLenses); - this._localToDispose.push(this._editor.onDidChangeModelContent((e) => { - this._editor.changeDecorations((changeAccessor) => { - this._editor.changeViewZones((viewAccessor) => { - const toDispose: CodeLens[] = []; - this._lenses.forEach((lens) => { - if (lens.isValid()) { - lens.update(viewAccessor); - } else { - toDispose.push(lens); - } - }); - - let helper = new CodeLensHelper(); - toDispose.forEach((l) => { - l.dispose(helper, viewAccessor); - this._lenses.splice(this._lenses.indexOf(l), 1); - }); - helper.commit(changeAccessor); - }); - }); - - // Compute new `visible` code lenses - this._detectVisibleLenses.schedule(); - // Ask for all references again - scheduler.schedule(); - })); - this._localToDispose.push(this._editor.onDidScrollChange(e => { - if (e.scrollTopChanged) { - this._detectVisibleLenses.schedule(); - } - })); - this._localToDispose.push(this._editor.onDidLayoutChange(e => { - this._detectVisibleLenses.schedule(); - })); - this._localToDispose.push({ - dispose: () => { - if (this._editor.getModel()) { - this._editor.changeDecorations((changeAccessor) => { - this._editor.changeViewZones((accessor) => { - this._disposeAllLenses(changeAccessor, accessor); - }); - }); - } else { - // No accessors available - this._disposeAllLenses(null, null); - } - } - }); - - scheduler.schedule(); - } - - private _disposeAllLenses(decChangeAccessor: editorCommon.IModelDecorationsChangeAccessor, viewZoneChangeAccessor: editorBrowser.IViewZoneChangeAccessor): void { - let helper = new CodeLensHelper(); - this._lenses.forEach((lens) => lens.dispose(helper, viewZoneChangeAccessor)); - if (decChangeAccessor) { - helper.commit(decChangeAccessor); - } - this._lenses = []; - } - - private renderCodeLensSymbols(symbols: ICodeLensData[]): void { - if (!this._editor.getModel()) { - return; - } - - let maxLineNumber = this._editor.getModel().getLineCount(); - let groups: ICodeLensData[][] = []; - let lastGroup: ICodeLensData[]; - - for (let symbol of symbols) { - let line = symbol.symbol.range.startLineNumber; - if (line < 1 || line > maxLineNumber) { - // invalid code lens - continue; - } else if (lastGroup && lastGroup[lastGroup.length - 1].symbol.range.startLineNumber === line) { - // on same line as previous - lastGroup.push(symbol); - } else { - // on later line as previous - lastGroup = [symbol]; - groups.push(lastGroup); - } - } - - const centeredRange = this._editor.getCenteredRangeInViewport(); - const shouldRestoreCenteredRange = centeredRange && (groups.length !== this._lenses.length && this._editor.getScrollTop() !== 0); - this._editor.changeDecorations((changeAccessor) => { - this._editor.changeViewZones((accessor) => { - - let codeLensIndex = 0, groupsIndex = 0, helper = new CodeLensHelper(); - - while (groupsIndex < groups.length && codeLensIndex < this._lenses.length) { - - let symbolsLineNumber = groups[groupsIndex][0].symbol.range.startLineNumber; - let codeLensLineNumber = this._lenses[codeLensIndex].getLineNumber(); - - if (codeLensLineNumber < symbolsLineNumber) { - this._lenses[codeLensIndex].dispose(helper, accessor); - this._lenses.splice(codeLensIndex, 1); - } else if (codeLensLineNumber === symbolsLineNumber) { - this._lenses[codeLensIndex].updateCodeLensSymbols(groups[groupsIndex], helper); - groupsIndex++; - codeLensIndex++; - } else { - this._lenses.splice(codeLensIndex, 0, new CodeLens(groups[groupsIndex], this._editor, helper, accessor, this._commandService, this._messageService, () => this._detectVisibleLenses.schedule())); - codeLensIndex++; - groupsIndex++; - } - } - - // Delete extra code lenses - while (codeLensIndex < this._lenses.length) { - this._lenses[codeLensIndex].dispose(helper, accessor); - this._lenses.splice(codeLensIndex, 1); - } - - // Create extra symbols - while (groupsIndex < groups.length) { - this._lenses.push(new CodeLens(groups[groupsIndex], this._editor, helper, accessor, this._commandService, this._messageService, () => this._detectVisibleLenses.schedule())); - groupsIndex++; - } - - helper.commit(changeAccessor); - }); - }); - if (shouldRestoreCenteredRange) { - this._editor.revealRangeInCenter(centeredRange); - } - } - - private _onViewportChanged(modeId: string): void { - if (this._currentFindOccPromise) { - this._currentFindOccPromise.cancel(); - this._currentFindOccPromise = null; - } - - const model = this._editor.getModel(); - if (!model) { - return; - } - - const toResolve: ICodeLensData[][] = []; - const lenses: CodeLens[] = []; - this._lenses.forEach((lens) => { - const request = lens.computeIfNecessary(model); - if (request) { - toResolve.push(request); - lenses.push(lens); - } - }); - - if (toResolve.length === 0) { - return; - } - - const promises = toResolve.map((request, i) => { - - const resolvedSymbols = new Array(request.length); - const promises = request.map((request, i) => { - return asWinJsPromise((token) => { - return request.provider.resolveCodeLens(model, request.symbol, token); - }).then(symbol => { - resolvedSymbols[i] = symbol; - }); - }); - - return TPromise.join(promises).then(() => { - lenses[i].updateCommands(resolvedSymbols); - }); - }); - - this._currentFindOccPromise = TPromise.join(promises).then(() => { - this._currentFindOccPromise = null; - }); - } -} - -registerThemingParticipant((theme, collector) => { - let codeLensForeground = theme.getColor(editorCodeLensForeground); - if (codeLensForeground) { - collector.addRule(`.monaco-editor .codelens-decoration { color: ${codeLensForeground}; }`); - } - let activeLinkForeground = theme.getColor(editorActiveLinkForeground); - if (activeLinkForeground) { - collector.addRule(`.monaco-editor .codelens-decoration > a:hover { color: ${activeLinkForeground} !important; }`); - } + return getCodeLensData(model).then(value => value.map(item => item.symbol)); }); diff --git a/src/vs/editor/contrib/codelens/browser/codelensController.ts b/src/vs/editor/contrib/codelens/browser/codelensController.ts new file mode 100644 index 0000000000000000000000000000000000000000..948753823013e735e32d667aecc5aeccaf14338e --- /dev/null +++ b/src/vs/editor/contrib/codelens/browser/codelensController.ts @@ -0,0 +1,306 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +'use strict'; + +import { RunOnceScheduler, asWinJsPromise } from 'vs/base/common/async'; +import { onUnexpectedError } from 'vs/base/common/errors'; +import { IDisposable, dispose } from 'vs/base/common/lifecycle'; +import { TPromise } from 'vs/base/common/winjs.base'; +import { ICommandService } from 'vs/platform/commands/common/commands'; +import { IMessageService } from 'vs/platform/message/common/message'; +import * as editorCommon from 'vs/editor/common/editorCommon'; +import { CodeLensProviderRegistry, ICodeLensSymbol } from 'vs/editor/common/modes'; +import * as editorBrowser from 'vs/editor/browser/editorBrowser'; +import { editorContribution } from 'vs/editor/browser/editorBrowserExtensions'; +import { ICodeLensData, getCodeLensData } from './codelens'; +import { IConfigurationChangedEvent } from 'vs/editor/common/config/editorOptions'; +import { CodeLens, CodeLensHelper } from "vs/editor/contrib/codelens/browser/codelensWidget"; + +@editorContribution +export class CodeLensContribution implements editorCommon.IEditorContribution { + + private static ID: string = 'css.editor.codeLens'; + + private _isEnabled: boolean; + + private _globalToDispose: IDisposable[]; + private _localToDispose: IDisposable[]; + private _lenses: CodeLens[]; + private _currentFindCodeLensSymbolsPromise: TPromise; + private _modelChangeCounter: number; + private _currentFindOccPromise: TPromise; + private _detectVisibleLenses: RunOnceScheduler; + + constructor( + private _editor: editorBrowser.ICodeEditor, + @ICommandService private _commandService: ICommandService, + @IMessageService private _messageService: IMessageService + ) { + this._isEnabled = this._editor.getConfiguration().contribInfo.codeLens; + + this._globalToDispose = []; + this._localToDispose = []; + this._lenses = []; + this._currentFindCodeLensSymbolsPromise = null; + this._modelChangeCounter = 0; + + this._globalToDispose.push(this._editor.onDidChangeModel(() => this._onModelChange())); + this._globalToDispose.push(this._editor.onDidChangeModelLanguage(() => this._onModelChange())); + this._globalToDispose.push(this._editor.onDidChangeConfiguration((e: IConfigurationChangedEvent) => { + let prevIsEnabled = this._isEnabled; + this._isEnabled = this._editor.getConfiguration().contribInfo.codeLens; + if (prevIsEnabled !== this._isEnabled) { + this._onModelChange(); + } + })); + this._globalToDispose.push(CodeLensProviderRegistry.onDidChange(this._onModelChange, this)); + this._onModelChange(); + } + + dispose(): void { + this._localDispose(); + this._globalToDispose = dispose(this._globalToDispose); + } + + private _localDispose(): void { + if (this._currentFindCodeLensSymbolsPromise) { + this._currentFindCodeLensSymbolsPromise.cancel(); + this._currentFindCodeLensSymbolsPromise = null; + this._modelChangeCounter++; + } + if (this._currentFindOccPromise) { + this._currentFindOccPromise.cancel(); + this._currentFindOccPromise = null; + } + this._localToDispose = dispose(this._localToDispose); + } + + getId(): string { + return CodeLensContribution.ID; + } + + private _onModelChange(): void { + + this._localDispose(); + + const model = this._editor.getModel(); + if (!model) { + return; + } + + if (!this._isEnabled) { + return; + } + + if (!CodeLensProviderRegistry.has(model)) { + return; + } + + for (const provider of CodeLensProviderRegistry.all(model)) { + if (typeof provider.onDidChange === 'function') { + let registration = provider.onDidChange(() => scheduler.schedule()); + this._localToDispose.push(registration); + } + } + + this._detectVisibleLenses = new RunOnceScheduler(() => { + this._onViewportChanged(model.getLanguageIdentifier().language); + }, 500); + + const scheduler = new RunOnceScheduler(() => { + if (this._currentFindCodeLensSymbolsPromise) { + this._currentFindCodeLensSymbolsPromise.cancel(); + } + + this._currentFindCodeLensSymbolsPromise = getCodeLensData(model); + + const counterValue = ++this._modelChangeCounter; + this._currentFindCodeLensSymbolsPromise.then((result) => { + if (counterValue === this._modelChangeCounter) { // only the last one wins + this._renderCodeLensSymbols(result); + this._detectVisibleLenses.schedule(); + } + }, onUnexpectedError); + }, 250); + this._localToDispose.push(scheduler); + this._localToDispose.push(this._detectVisibleLenses); + this._localToDispose.push(this._editor.onDidChangeModelContent((e) => { + this._editor.changeDecorations((changeAccessor) => { + this._editor.changeViewZones((viewAccessor) => { + const toDispose: CodeLens[] = []; + this._lenses.forEach((lens) => { + if (lens.isValid()) { + lens.update(viewAccessor); + } else { + toDispose.push(lens); + } + }); + + let helper = new CodeLensHelper(); + toDispose.forEach((l) => { + l.dispose(helper, viewAccessor); + this._lenses.splice(this._lenses.indexOf(l), 1); + }); + helper.commit(changeAccessor); + }); + }); + + // Compute new `visible` code lenses + this._detectVisibleLenses.schedule(); + // Ask for all references again + scheduler.schedule(); + })); + this._localToDispose.push(this._editor.onDidScrollChange(e => { + if (e.scrollTopChanged) { + this._detectVisibleLenses.schedule(); + } + })); + this._localToDispose.push(this._editor.onDidLayoutChange(e => { + this._detectVisibleLenses.schedule(); + })); + this._localToDispose.push({ + dispose: () => { + if (this._editor.getModel()) { + this._editor.changeDecorations((changeAccessor) => { + this._editor.changeViewZones((accessor) => { + this._disposeAllLenses(changeAccessor, accessor); + }); + }); + } else { + // No accessors available + this._disposeAllLenses(null, null); + } + } + }); + + scheduler.schedule(); + } + + private _disposeAllLenses(decChangeAccessor: editorCommon.IModelDecorationsChangeAccessor, viewZoneChangeAccessor: editorBrowser.IViewZoneChangeAccessor): void { + let helper = new CodeLensHelper(); + this._lenses.forEach((lens) => lens.dispose(helper, viewZoneChangeAccessor)); + if (decChangeAccessor) { + helper.commit(decChangeAccessor); + } + this._lenses = []; + } + + private _renderCodeLensSymbols(symbols: ICodeLensData[]): void { + if (!this._editor.getModel()) { + return; + } + + let maxLineNumber = this._editor.getModel().getLineCount(); + let groups: ICodeLensData[][] = []; + let lastGroup: ICodeLensData[]; + + for (let symbol of symbols) { + let line = symbol.symbol.range.startLineNumber; + if (line < 1 || line > maxLineNumber) { + // invalid code lens + continue; + } else if (lastGroup && lastGroup[lastGroup.length - 1].symbol.range.startLineNumber === line) { + // on same line as previous + lastGroup.push(symbol); + } else { + // on later line as previous + lastGroup = [symbol]; + groups.push(lastGroup); + } + } + + const centeredRange = this._editor.getCenteredRangeInViewport(); + const shouldRestoreCenteredRange = centeredRange && (groups.length !== this._lenses.length && this._editor.getScrollTop() !== 0); + this._editor.changeDecorations((changeAccessor) => { + this._editor.changeViewZones((accessor) => { + + let codeLensIndex = 0, groupsIndex = 0, helper = new CodeLensHelper(); + + while (groupsIndex < groups.length && codeLensIndex < this._lenses.length) { + + let symbolsLineNumber = groups[groupsIndex][0].symbol.range.startLineNumber; + let codeLensLineNumber = this._lenses[codeLensIndex].getLineNumber(); + + if (codeLensLineNumber < symbolsLineNumber) { + this._lenses[codeLensIndex].dispose(helper, accessor); + this._lenses.splice(codeLensIndex, 1); + } else if (codeLensLineNumber === symbolsLineNumber) { + this._lenses[codeLensIndex].updateCodeLensSymbols(groups[groupsIndex], helper); + groupsIndex++; + codeLensIndex++; + } else { + this._lenses.splice(codeLensIndex, 0, new CodeLens(groups[groupsIndex], this._editor, helper, accessor, this._commandService, this._messageService, () => this._detectVisibleLenses.schedule())); + codeLensIndex++; + groupsIndex++; + } + } + + // Delete extra code lenses + while (codeLensIndex < this._lenses.length) { + this._lenses[codeLensIndex].dispose(helper, accessor); + this._lenses.splice(codeLensIndex, 1); + } + + // Create extra symbols + while (groupsIndex < groups.length) { + this._lenses.push(new CodeLens(groups[groupsIndex], this._editor, helper, accessor, this._commandService, this._messageService, () => this._detectVisibleLenses.schedule())); + groupsIndex++; + } + + helper.commit(changeAccessor); + }); + }); + if (shouldRestoreCenteredRange) { + this._editor.revealRangeInCenter(centeredRange); + } + } + + private _onViewportChanged(modeId: string): void { + if (this._currentFindOccPromise) { + this._currentFindOccPromise.cancel(); + this._currentFindOccPromise = null; + } + + const model = this._editor.getModel(); + if (!model) { + return; + } + + const toResolve: ICodeLensData[][] = []; + const lenses: CodeLens[] = []; + this._lenses.forEach((lens) => { + const request = lens.computeIfNecessary(model); + if (request) { + toResolve.push(request); + lenses.push(lens); + } + }); + + if (toResolve.length === 0) { + return; + } + + const promises = toResolve.map((request, i) => { + + const resolvedSymbols = new Array(request.length); + const promises = request.map((request, i) => { + return asWinJsPromise((token) => { + return request.provider.resolveCodeLens(model, request.symbol, token); + }).then(symbol => { + resolvedSymbols[i] = symbol; + }); + }); + + return TPromise.join(promises).then(() => { + lenses[i].updateCommands(resolvedSymbols); + }); + }); + + this._currentFindOccPromise = TPromise.join(promises).then(() => { + this._currentFindOccPromise = null; + }); + } +} diff --git a/src/vs/editor/contrib/codelens/browser/codelens.css b/src/vs/editor/contrib/codelens/browser/codelensWidget.css similarity index 100% rename from src/vs/editor/contrib/codelens/browser/codelens.css rename to src/vs/editor/contrib/codelens/browser/codelensWidget.css diff --git a/src/vs/editor/contrib/codelens/browser/codelensWidget.ts b/src/vs/editor/contrib/codelens/browser/codelensWidget.ts new file mode 100644 index 0000000000000000000000000000000000000000..ac7b103cd55e9f45eb31229bb5b07bc8bcf59e20 --- /dev/null +++ b/src/vs/editor/contrib/codelens/browser/codelensWidget.ts @@ -0,0 +1,339 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +'use strict'; + +import 'vs/css!./codelensWidget'; +import { IDisposable, dispose } from 'vs/base/common/lifecycle'; +import Severity from 'vs/base/common/severity'; +import { format, escape } from 'vs/base/common/strings'; +import * as dom from 'vs/base/browser/dom'; +import { ICommandService } from 'vs/platform/commands/common/commands'; +import { IMessageService } from 'vs/platform/message/common/message'; +import { Range } from 'vs/editor/common/core/range'; +import * as editorCommon from 'vs/editor/common/editorCommon'; +import { ICodeLensSymbol, Command } from 'vs/editor/common/modes'; +import * as editorBrowser from 'vs/editor/browser/editorBrowser'; +import { ICodeLensData } from './codelens'; +import { ModelDecorationOptions } from 'vs/editor/common/model/textModelWithDecorations'; +import { editorCodeLensForeground } from 'vs/editor/common/view/editorColorRegistry'; +import { registerThemingParticipant } from 'vs/platform/theme/common/themeService'; +import { editorActiveLinkForeground } from 'vs/platform/theme/common/colorRegistry'; + +class CodeLensViewZone implements editorBrowser.IViewZone { + + readonly heightInLines: number; + readonly suppressMouseDown: boolean; + readonly domNode: HTMLElement; + + afterLineNumber: number; + + private _lastHeight: number; + private _onHeight: Function; + + constructor(afterLineNumber: number, onHeight: Function) { + this.afterLineNumber = afterLineNumber; + this._onHeight = onHeight; + + this.heightInLines = 1; + this.suppressMouseDown = true; + this.domNode = document.createElement('div'); + } + + onComputedHeight(height: number): void { + if (this._lastHeight === undefined) { + this._lastHeight = height; + } else if (this._lastHeight !== height) { + this._lastHeight = height; + this._onHeight(); + } + } +} + +class CodeLensContentWidget implements editorBrowser.IContentWidget { + + private static _idPool: number = 0; + + // Editor.IContentWidget.allowEditorOverflow + readonly allowEditorOverflow: boolean = false; + readonly suppressMouseDown: boolean = true; + + private readonly _id: string; + private readonly _domNode: HTMLElement; + private readonly _disposables: IDisposable[] = []; + private readonly _editor: editorBrowser.ICodeEditor; + + private _symbolRange: Range; + private _widgetPosition: editorBrowser.IContentWidgetPosition; + private _commands: { [id: string]: Command } = Object.create(null); + + constructor( + editor: editorBrowser.ICodeEditor, + symbolRange: Range, + commandService: ICommandService, + messageService: IMessageService + ) { + + this._id = 'codeLensWidget' + (++CodeLensContentWidget._idPool); + this._editor = editor; + + this.setSymbolRange(symbolRange); + + this._domNode = document.createElement('span'); + this._domNode.innerHTML = ' '; + dom.addClass(this._domNode, 'codelens-decoration'); + dom.addClass(this._domNode, 'invisible-cl'); + this._updateHeight(); + + this._disposables.push(this._editor.onDidChangeConfiguration(e => e.fontInfo && this._updateHeight())); + + this._disposables.push(dom.addDisposableListener(this._domNode, 'click', e => { + let element = e.target; + if (element.tagName === 'A' && element.id) { + let command = this._commands[element.id]; + if (command) { + editor.focus(); + commandService.executeCommand(command.id, ...command.arguments).done(undefined, err => { + messageService.show(Severity.Error, err); + }); + } + } + })); + + this.updateVisibility(); + } + + dispose(): void { + dispose(this._disposables); + this._symbolRange = null; + } + + private _updateHeight(): void { + const { fontInfo, lineHeight } = this._editor.getConfiguration(); + this._domNode.style.height = `${Math.round(lineHeight * 1.1)}px`; + this._domNode.style.lineHeight = `${lineHeight}px`; + this._domNode.style.fontSize = `${Math.round(fontInfo.fontSize * .9)}px`; + this._domNode.innerHTML = ' '; + } + + updateVisibility(): void { + if (this.isVisible()) { + dom.removeClass(this._domNode, 'invisible-cl'); + dom.addClass(this._domNode, 'fadein'); + } + } + + withCommands(symbols: ICodeLensSymbol[]): void { + this._commands = Object.create(null); + if (!symbols || !symbols.length) { + this._domNode.innerHTML = 'no commands'; + return; + } + + let html: string[] = []; + for (let i = 0; i < symbols.length; i++) { + let command = symbols[i].command; + let title = escape(command.title); + let part: string; + if (command.id) { + part = format('{1}', i, title); + this._commands[i] = command; + } else { + part = format('{0}', title); + } + html.push(part); + } + + this._domNode.innerHTML = html.join(' | '); + this._editor.layoutContentWidget(this); + } + + getId(): string { + return this._id; + } + + getDomNode(): HTMLElement { + return this._domNode; + } + + setSymbolRange(range: Range): void { + this._symbolRange = range; + + const lineNumber = range.startLineNumber; + const column = this._editor.getModel().getLineFirstNonWhitespaceColumn(lineNumber); + this._widgetPosition = { + position: { lineNumber: lineNumber, column: column }, + preference: [editorBrowser.ContentWidgetPositionPreference.ABOVE] + }; + } + + getPosition(): editorBrowser.IContentWidgetPosition { + return this._widgetPosition; + } + + isVisible(): boolean { + return this._domNode.hasAttribute('monaco-visible-content-widget'); + } +} + +export interface IDecorationIdCallback { + (decorationId: string): void; +} + +export class CodeLensHelper { + + private _removeDecorations: string[]; + private _addDecorations: editorCommon.IModelDeltaDecoration[]; + private _addDecorationsCallbacks: IDecorationIdCallback[]; + + constructor() { + this._removeDecorations = []; + this._addDecorations = []; + this._addDecorationsCallbacks = []; + } + + addDecoration(decoration: editorCommon.IModelDeltaDecoration, callback: IDecorationIdCallback): void { + this._addDecorations.push(decoration); + this._addDecorationsCallbacks.push(callback); + } + + removeDecoration(decorationId: string): void { + this._removeDecorations.push(decorationId); + } + + commit(changeAccessor: editorCommon.IModelDecorationsChangeAccessor): void { + var resultingDecorations = changeAccessor.deltaDecorations(this._removeDecorations, this._addDecorations); + for (let i = 0, len = resultingDecorations.length; i < len; i++) { + this._addDecorationsCallbacks[i](resultingDecorations[i]); + } + } +} + +export class CodeLens { + + private readonly _editor: editorBrowser.ICodeEditor; + private readonly _viewZone: CodeLensViewZone; + private readonly _viewZoneId: number; + private readonly _contentWidget: CodeLensContentWidget; + private _decorationIds: string[]; + private _data: ICodeLensData[]; + + constructor( + data: ICodeLensData[], + editor: editorBrowser.ICodeEditor, + helper: CodeLensHelper, + viewZoneChangeAccessor: editorBrowser.IViewZoneChangeAccessor, + commandService: ICommandService, messageService: IMessageService, + updateCallabck: Function + ) { + this._editor = editor; + this._data = data; + this._decorationIds = new Array(this._data.length); + + let range: Range; + this._data.forEach((codeLensData, i) => { + + helper.addDecoration({ + range: codeLensData.symbol.range, + options: ModelDecorationOptions.EMPTY + }, id => this._decorationIds[i] = id); + + // the range contains all lenses on this line + if (!range) { + range = Range.lift(codeLensData.symbol.range); + } else { + range = Range.plusRange(range, codeLensData.symbol.range); + } + }); + + this._contentWidget = new CodeLensContentWidget(editor, range, commandService, messageService); + this._viewZone = new CodeLensViewZone(range.startLineNumber - 1, updateCallabck); + + this._viewZoneId = viewZoneChangeAccessor.addZone(this._viewZone); + this._editor.addContentWidget(this._contentWidget); + } + + dispose(helper: CodeLensHelper, viewZoneChangeAccessor: editorBrowser.IViewZoneChangeAccessor): void { + while (this._decorationIds.length) { + helper.removeDecoration(this._decorationIds.pop()); + } + if (viewZoneChangeAccessor) { + viewZoneChangeAccessor.removeZone(this._viewZoneId); + } + this._editor.removeContentWidget(this._contentWidget); + + this._contentWidget.dispose(); + } + + isValid(): boolean { + return this._decorationIds.some((id, i) => { + const range = this._editor.getModel().getDecorationRange(id); + const symbol = this._data[i].symbol; + return range && Range.isEmpty(symbol.range) === range.isEmpty(); + }); + } + + updateCodeLensSymbols(data: ICodeLensData[], helper: CodeLensHelper): void { + while (this._decorationIds.length) { + helper.removeDecoration(this._decorationIds.pop()); + } + this._data = data; + this._decorationIds = new Array(this._data.length); + this._data.forEach((codeLensData, i) => { + helper.addDecoration({ + range: codeLensData.symbol.range, + options: ModelDecorationOptions.EMPTY + }, id => this._decorationIds[i] = id); + }); + } + + computeIfNecessary(model: editorCommon.IModel): ICodeLensData[] { + this._contentWidget.updateVisibility(); // trigger the fade in + if (!this._contentWidget.isVisible()) { + return null; + } + + // Read editor current state + for (let i = 0; i < this._decorationIds.length; i++) { + this._data[i].symbol.range = model.getDecorationRange(this._decorationIds[i]); + } + return this._data; + } + + updateCommands(symbols: ICodeLensSymbol[]): void { + this._contentWidget.withCommands(symbols); + } + + getLineNumber(): number { + const range = this._editor.getModel().getDecorationRange(this._decorationIds[0]); + if (range) { + return range.startLineNumber; + } + return -1; + } + + update(viewZoneChangeAccessor: editorBrowser.IViewZoneChangeAccessor): void { + if (this.isValid()) { + const range = this._editor.getModel().getDecorationRange(this._decorationIds[0]); + + this._viewZone.afterLineNumber = range.startLineNumber - 1; + viewZoneChangeAccessor.layoutZone(this._viewZoneId); + + this._contentWidget.setSymbolRange(range); + this._editor.layoutContentWidget(this._contentWidget); + } + } +} + +registerThemingParticipant((theme, collector) => { + let codeLensForeground = theme.getColor(editorCodeLensForeground); + if (codeLensForeground) { + collector.addRule(`.monaco-editor .codelens-decoration { color: ${codeLensForeground}; }`); + } + let activeLinkForeground = theme.getColor(editorActiveLinkForeground); + if (activeLinkForeground) { + collector.addRule(`.monaco-editor .codelens-decoration > a:hover { color: ${activeLinkForeground} !important; }`); + } +}); diff --git a/src/vs/editor/contrib/codelens/common/codelens.ts b/src/vs/editor/contrib/codelens/common/codelens.ts deleted file mode 100644 index 28424195ae2b7e03ed4e448cc1c6e4fcf0acfa57..0000000000000000000000000000000000000000 --- a/src/vs/editor/contrib/codelens/common/codelens.ts +++ /dev/null @@ -1,72 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -'use strict'; - -import { illegalArgument, onUnexpectedExternalError } from 'vs/base/common/errors'; -import { stableSort } from 'vs/base/common/arrays'; -import URI from 'vs/base/common/uri'; -import { TPromise } from 'vs/base/common/winjs.base'; -import { IModel } from 'vs/editor/common/editorCommon'; -import { CommonEditorRegistry } from 'vs/editor/common/editorCommonExtensions'; -import { CodeLensProviderRegistry, CodeLensProvider, ICodeLensSymbol } from 'vs/editor/common/modes'; -import { IModelService } from 'vs/editor/common/services/modelService'; -import { asWinJsPromise } from 'vs/base/common/async'; - -export interface ICodeLensData { - symbol: ICodeLensSymbol; - provider: CodeLensProvider; -} - -export function getCodeLensData(model: IModel): TPromise { - - const symbols: ICodeLensData[] = []; - const provider = CodeLensProviderRegistry.ordered(model); - - const promises = provider.map(provider => asWinJsPromise(token => provider.provideCodeLenses(model, token)).then(result => { - if (Array.isArray(result)) { - for (let symbol of result) { - symbols.push({ symbol, provider }); - } - } - }, onUnexpectedExternalError)); - - return TPromise.join(promises).then(() => { - - return stableSort(symbols, (a, b) => { - // sort by lineNumber, provider-rank, and column - if (a.symbol.range.startLineNumber < b.symbol.range.startLineNumber) { - return -1; - } else if (a.symbol.range.startLineNumber > b.symbol.range.startLineNumber) { - return 1; - } else if (provider.indexOf(a.provider) < provider.indexOf(b.provider)) { - return -1; - } else if (provider.indexOf(a.provider) > provider.indexOf(b.provider)) { - return 1; - } else if (a.symbol.range.startColumn < b.symbol.range.startColumn) { - return -1; - } else if (a.symbol.range.startColumn > b.symbol.range.startColumn) { - return 1; - } else { - return 0; - } - }); - }); -} - -CommonEditorRegistry.registerLanguageCommand('_executeCodeLensProvider', function (accessor, args) { - - const { resource } = args; - if (!(resource instanceof URI)) { - throw illegalArgument(); - } - - const model = accessor.get(IModelService).getModel(resource); - if (!model) { - throw illegalArgument(); - } - - return getCodeLensData(model); -}); diff --git a/src/vs/editor/contrib/comment/common/blockCommentCommand.ts b/src/vs/editor/contrib/comment/common/blockCommentCommand.ts index ffceef3758fb43027a7493e34f79235b3b150a58..d123d1f9d580df9a85175b48628d5afc884e23ca 100644 --- a/src/vs/editor/contrib/comment/common/blockCommentCommand.ts +++ b/src/vs/editor/contrib/comment/common/blockCommentCommand.ts @@ -97,16 +97,16 @@ export class BlockCommentCommand implements editorCommon.ICommand { 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 + ' ')); // 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), ' ' + endToken)); } else { // Insert both continuously res.push(EditOperation.replace(new Range( r.startLineNumber, r.startColumn, r.endLineNumber, r.endColumn - ), startToken + endToken)); + ), startToken + ' ' + endToken)); } return res; @@ -145,7 +145,7 @@ export class BlockCommentCommand implements editorCommon.ICommand { ); } else { var srcRange = inverseEditOperations[0].range; - var deltaColumn = this._usedEndToken ? -this._usedEndToken.length : 0; + var deltaColumn = this._usedEndToken ? -this._usedEndToken.length - 1 : 0; // minus 1 space before endToken return new Selection( srcRange.endLineNumber, srcRange.endColumn + deltaColumn, diff --git a/src/vs/editor/contrib/comment/test/common/blockCommentCommand.test.ts b/src/vs/editor/contrib/comment/test/common/blockCommentCommand.test.ts index 8f8f2cae11807633a9fdfff75fbe40ead9e98f32..1bd3597b7ac7d0e26cac9f593cd25c761f4ad100 100644 --- a/src/vs/editor/contrib/comment/test/common/blockCommentCommand.test.ts +++ b/src/vs/editor/contrib/comment/test/common/blockCommentCommand.test.ts @@ -28,13 +28,13 @@ suite('Editor Contrib - Block Comment Command', () => { ], new Selection(1, 3, 1, 3), [ - 'fi<00>rst', + 'fi<0 0>rst', '\tsecond line', 'third line', 'fourth line', 'fifth' ], - new Selection(1, 5, 1, 5) + new Selection(1, 6, 1, 6) ); }); @@ -49,13 +49,13 @@ suite('Editor Contrib - Block Comment Command', () => { ], new Selection(2, 1, 1, 1), [ - '<0first', - '0>\tsecond line', + '<0 first', + ' 0>\tsecond line', 'third line', 'fourth line', 'fifth' ], - new Selection(1, 3, 2, 1) + new Selection(1, 4, 2, 1) ); }); @@ -70,13 +70,13 @@ suite('Editor Contrib - Block Comment Command', () => { ], new Selection(1, 6, 1, 1), [ - '<0first0>', + '<0 first 0>', '\tsecond line', 'third line', 'fourth line', 'fifth' ], - new Selection(1, 3, 1, 8) + new Selection(1, 4, 1, 9) ); testBlockCommentCommand( @@ -110,13 +110,13 @@ suite('Editor Contrib - Block Comment Command', () => { ], new Selection(1, 6, 1, 3), [ - 'fi<0rst0>', + 'fi<0 rst 0>', '\tsecond line', 'third line', 'fourth line', 'fifth' ], - new Selection(1, 5, 1, 8) + new Selection(1, 6, 1, 9) ); }); @@ -131,13 +131,13 @@ suite('Editor Contrib - Block Comment Command', () => { ], new Selection(1, 6, 1, 3), [ - 'fi<0rst0>', + 'fi<0 rst 0>', '\tsecond line', 'third line', 'fourth line', 'fifth' ], - new Selection(1, 5, 1, 8) + new Selection(1, 6, 1, 9) ); testBlockCommentCommand( @@ -171,13 +171,13 @@ suite('Editor Contrib - Block Comment Command', () => { ], new Selection(2, 4, 1, 1), [ - '<0first', - '\tse0>cond line', + '<0 first', + '\tse 0>cond line', 'third line', 'fourth line', 'fifth' ], - new Selection(1, 3, 2, 4) + new Selection(1, 4, 2, 4) ); }); @@ -192,13 +192,13 @@ suite('Editor Contrib - Block Comment Command', () => { ], new Selection(2, 4, 1, 1), [ - '<0first', - '\tse0>cond line', + '<0 first', + '\tse 0>cond line', 'third line', 'fourth line', 'fifth' ], - new Selection(1, 3, 2, 4) + new Selection(1, 4, 2, 4) ); testBlockCommentCommand( diff --git a/src/vs/editor/contrib/comment/test/common/lineCommentCommand.test.ts b/src/vs/editor/contrib/comment/test/common/lineCommentCommand.test.ts index 1326d8bda3392daa754469828b153a9ffea4ef0c..098872864e5abfc20252f0ff8ede1b3d41b276bd 100644 --- a/src/vs/editor/contrib/comment/test/common/lineCommentCommand.test.ts +++ b/src/vs/editor/contrib/comment/test/common/lineCommentCommand.test.ts @@ -12,9 +12,9 @@ import { CommentMode } from 'vs/editor/test/common/commentMode'; import * as modes from 'vs/editor/common/modes'; import { NULL_STATE } from 'vs/editor/common/modes/nullMode'; import { TokenizationResult2 } from 'vs/editor/common/core/token'; -import { MockMode } from "vs/editor/test/common/mocks/mockMode"; -import { CommentRule } from "vs/editor/common/modes/languageConfiguration"; -import { LanguageConfigurationRegistry } from "vs/editor/common/modes/languageConfigurationRegistry"; +import { MockMode } from 'vs/editor/test/common/mocks/mockMode'; +import { CommentRule } from 'vs/editor/common/modes/languageConfiguration'; +import { LanguageConfigurationRegistry } from 'vs/editor/common/modes/languageConfigurationRegistry'; suite('Editor Contrib - Line Comment Command', () => { @@ -544,13 +544,13 @@ suite('Editor Contrib - Line Comment As Block Comment', () => { ], new Selection(1, 1, 1, 1), [ - '(first)', + '( first )', '\tsecond line', 'third line', 'fourth line', 'fifth' ], - new Selection(1, 2, 1, 2) + new Selection(1, 3, 1, 3) ); }); @@ -586,13 +586,13 @@ suite('Editor Contrib - Line Comment As Block Comment', () => { ], new Selection(1, 1, 1, 1), [ - '(first)', + '( first )', '\tsecond line', 'third line', 'fourth line', 'fifth' ], - new Selection(1, 2, 1, 2) + new Selection(1, 3, 1, 3) ); }); @@ -607,13 +607,13 @@ suite('Editor Contrib - Line Comment As Block Comment', () => { ], new Selection(3, 2, 1, 3), [ - '(first', + '( first', '\tsecond line', - 'third line)', + 'third line )', 'fourth line', 'fifth' ], - new Selection(1, 4, 3, 2) + new Selection(1, 5, 3, 2) ); testLineCommentCommand( @@ -655,7 +655,7 @@ suite('Editor Contrib - Line Comment As Block Comment 2', () => { ], new Selection(1, 1, 1, 1), [ - '\t\t', + '\t\t', '\t\tsecond line', '\tthird line', 'fourth line', @@ -809,8 +809,8 @@ suite('Editor Contrib - Line Comment As Block Comment 2', () => { ], new Selection(1, 1, 3, 1), [ - ' ', + ' ', '' ], new Selection(1, 1, 3, 1) @@ -927,13 +927,13 @@ suite('Editor Contrib - Line Comment in mixed modes', () => { [ 'import React from \'react\';', 'const Loader = () => (', - ' {/*
*/}', + ' {/*
*/}', ' Loading...', '
', ');', 'export default Loader;' ], - new Selection(3, 7, 3, 7), + new Selection(3, 8, 3, 8), ); }); diff --git a/src/vs/editor/contrib/contextmenu/browser/contextmenu.ts b/src/vs/editor/contrib/contextmenu/browser/contextmenu.ts index a5dbd5818bc800a7cc9f8b841c1dbf46bfc7bda3..b389061785acc9a5d73106b0d24cc81fc60d4d89 100644 --- a/src/vs/editor/contrib/contextmenu/browser/contextmenu.ts +++ b/src/vs/editor/contrib/contextmenu/browser/contextmenu.ts @@ -175,7 +175,7 @@ export class ContextMenuController implements IEditorContribution { getActionItem: (action) => { var keybinding = this._keybindingFor(action); if (keybinding) { - return new ActionItem(action, action, { label: true, keybinding: keybinding.getLabel() }); + return new ActionItem(action, action, { label: true, keybinding: keybinding.getLabel(), isMenu: true }); } var customActionItem = action; diff --git a/src/vs/editor/contrib/dnd/browser/dnd.ts b/src/vs/editor/contrib/dnd/browser/dnd.ts index e305c8af11a963e6d34d14cf3f26eee2118e20f3..7628350f4e2afc706bfb38204ba508e6fca24da4 100644 --- a/src/vs/editor/contrib/dnd/browser/dnd.ts +++ b/src/vs/editor/contrib/dnd/browser/dnd.ts @@ -17,7 +17,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 { DragAndDropCommand } from '../common/dragAndDropCommand'; -import { ModelDecorationOptions } from "vs/editor/common/model/textModelWithDecorations"; +import { ModelDecorationOptions } from 'vs/editor/common/model/textModelWithDecorations'; @editorContribution export class DragAndDropController implements editorCommon.IEditorContribution { diff --git a/src/vs/editor/contrib/find/browser/findWidget.css b/src/vs/editor/contrib/find/browser/findWidget.css index 0fdd46945497057820e3a73ed544f8692fd9f78b..c8514824375343ea61f8f77026e66c986215608e 100644 --- a/src/vs/editor/contrib/find/browser/findWidget.css +++ b/src/vs/editor/contrib/find/browser/findWidget.css @@ -345,8 +345,6 @@ background-color: rgba(255, 255, 255, 0.1); } -/* High Contrast Theming */ - .monaco-editor.hc-black .find-widget .button:before { position: relative; top: 1px; @@ -355,4 +353,4 @@ .monaco-editor.hc-black .find-widget .monaco-checkbox .checkbox:checked + .label { background-color: rgba(255, 255, 255, 0.1); -} \ No newline at end of file +} diff --git a/src/vs/editor/contrib/find/browser/findWidget.ts b/src/vs/editor/contrib/find/browser/findWidget.ts index 409caf8fb737256cc1a2ecf66d8a359a71913af4..ceecbd9db0caf07b3f1e066025e298ff4d8316eb 100644 --- a/src/vs/editor/contrib/find/browser/findWidget.ts +++ b/src/vs/editor/contrib/find/browser/findWidget.ts @@ -81,7 +81,7 @@ export class FindWidgetViewZone implements IViewZone { } export class FindWidget extends Widget implements IOverlayWidget, IHorizontalSashLayoutProvider { - private static ID = 'editor.contrib.findWidget';; + private static ID = 'editor.contrib.findWidget'; private _codeEditor: ICodeEditor; private _state: FindReplaceState; private _controller: IFindController; @@ -236,10 +236,17 @@ export class FindWidget extends Widget implements IOverlayWidget, IHorizontalSas }); })); + this._register(this._codeEditor.onDidScrollChange((e) => { if (e.scrollTopChanged) { this._layoutViewZone(); + return; } + + // for other scroll changes, layout the viewzone in next tick to avoid ruining current rendering. + setTimeout(() => { + this._layoutViewZone(); + }, 0); })); } @@ -402,6 +409,7 @@ export class FindWidget extends Widget implements IOverlayWidget, IHorizontalSas setTimeout(() => { dom.addClass(this._domNode, 'visible'); + this._domNode.setAttribute('aria-hidden', 'false'); if (!animate) { dom.addClass(this._domNode, 'noanimation'); setTimeout(() => { @@ -410,7 +418,31 @@ export class FindWidget extends Widget implements IOverlayWidget, IHorizontalSas } }, 0); this._codeEditor.layoutOverlayWidget(this); - this._showViewZone(); + + let adjustEditorScrollTop = true; + if (this._codeEditor.getConfiguration().contribInfo.find.seedSearchStringFromSelection && selection) { + let editorCoords = dom.getDomNodePagePosition(this._codeEditor.getDomNode()); + let startCoords = this._codeEditor.getScrolledVisiblePosition(selection.getStartPosition()); + let startLeft = editorCoords.left + startCoords.left; + let startTop = startCoords.top; + + if (startTop < this._viewZone.heightInPx) { + if (selection.endLineNumber > selection.startLineNumber) { + adjustEditorScrollTop = false; + } + + let leftOfFindWidget = dom.getTopLeftOffset(this._domNode).left; + if (startLeft > leftOfFindWidget) { + adjustEditorScrollTop = false; + } + let endCoords = this._codeEditor.getScrolledVisiblePosition(selection.getEndPosition()); + let endLeft = editorCoords.left + endCoords.left; + if (endLeft > leftOfFindWidget) { + adjustEditorScrollTop = false; + } + } + } + this._showViewZone(adjustEditorScrollTop); } } @@ -421,6 +453,7 @@ export class FindWidget extends Widget implements IOverlayWidget, IHorizontalSas this._updateButtons(); dom.removeClass(this._domNode, 'visible'); + this._domNode.setAttribute('aria-hidden', 'true'); if (focusTheEditor) { this._codeEditor.focus(); } @@ -452,11 +485,12 @@ export class FindWidget extends Widget implements IOverlayWidget, IHorizontalSas } this._viewZoneId = accessor.addZone(this._viewZone); + // scroll top adjust to make sure the editor doesn't scroll when adding viewzone at the beginning. this._codeEditor.setScrollTop(this._codeEditor.getScrollTop() + this._viewZone.heightInPx); }); } - private _showViewZone() { + private _showViewZone(adjustScroll: boolean = true) { if (!this._isVisible) { return; } @@ -477,7 +511,10 @@ export class FindWidget extends Widget implements IOverlayWidget, IHorizontalSas this._viewZone.heightInPx = FIND_INPUT_AREA_HEIGHT; } this._viewZoneId = accessor.addZone(this._viewZone); - this._codeEditor.setScrollTop(this._codeEditor.getScrollTop() + scrollAdjustment); + + if (adjustScroll) { + this._codeEditor.setScrollTop(this._codeEditor.getScrollTop() + scrollAdjustment); + } }); } @@ -812,7 +849,7 @@ export class FindWidget extends Widget implements IOverlayWidget, IHorizontalSas // Widget this._domNode = document.createElement('div'); this._domNode.className = 'editor-widget find-widget'; - this._domNode.setAttribute('aria-hidden', 'false'); + this._domNode.setAttribute('aria-hidden', 'true'); this._domNode.appendChild(this._toggleReplaceBtn.domNode); this._domNode.appendChild(findPart); @@ -1034,7 +1071,7 @@ registerThemingParticipant((theme, collector) => { let border = theme.getColor('panel.border'); if (border) { - collector.addRule(`.monaco-editor .find-widget .monaco-sash { background-color: ${border}; width: 2px !important; margin-left: -4px;}`); + collector.addRule(`.monaco-editor .find-widget .monaco-sash { background-color: ${border}; width: 3px !important; margin-left: -4px;}`); } }); diff --git a/src/vs/editor/contrib/find/common/findController.ts b/src/vs/editor/contrib/find/common/findController.ts index e0657d80c734a8247e82953c384093a1ca817ac4..b1195ab30f4076c19f12259f3240d4ecf9b6f4b4 100644 --- a/src/vs/editor/contrib/find/common/findController.ts +++ b/src/vs/editor/contrib/find/common/findController.ts @@ -21,7 +21,7 @@ import { RunOnceScheduler, Delayer } from 'vs/base/common/async'; import { CursorChangeReason, ICursorSelectionChangedEvent } from 'vs/editor/common/controller/cursorEvents'; import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; -import { ModelDecorationOptions } from "vs/editor/common/model/textModelWithDecorations"; +import { ModelDecorationOptions } from 'vs/editor/common/model/textModelWithDecorations'; export const enum FindStartFocusAction { NoFocusChange, @@ -508,13 +508,13 @@ export class StartFindReplaceAction extends EditorAction { let controller = CommonFindController.get(editor); let currentSelection = editor.getSelection(); // we only seed search string from selection when the current selection is single line and not empty. - let seedSearchStringFromSelection = currentSelection.isEmpty() || - currentSelection.startLineNumber !== currentSelection.endLineNumber; + let seedSearchStringFromSelection = !currentSelection.isEmpty() && + currentSelection.startLineNumber === currentSelection.endLineNumber; let oldSearchString = controller.getState().searchString; // if the existing search string in find widget is empty and we don't seed search string from selection, it means the Find Input // is still empty, so we should focus the Find Input instead of Replace Input. - let shouldFocus = !oldSearchString && seedSearchStringFromSelection ? - FindStartFocusAction.FocusFindInput : FindStartFocusAction.FocusReplaceInput; + let shouldFocus = (!!oldSearchString || seedSearchStringFromSelection) ? + FindStartFocusAction.FocusReplaceInput : FindStartFocusAction.FocusFindInput; if (controller) { controller.start({ @@ -862,7 +862,7 @@ export class SelectHighlightsAction extends AbstractSelectHighlightsAction { constructor() { super({ id: 'editor.action.selectHighlights', - label: nls.localize('selectAllOccurencesOfFindMatch', "Select All Occurrences of Find Match"), + label: nls.localize('selectAllOccurrencesOfFindMatch', "Select All Occurrences of Find Match"), alias: 'Select All Occurrences of Find Match', precondition: null, kbOpts: { @@ -1005,10 +1005,10 @@ export class SelectionHighlighter extends Disposable implements editorCommon.IEd return null; } - const hasFindOccurences = DocumentHighlightProviderRegistry.has(model); + const hasFindOccurrences = DocumentHighlightProviderRegistry.has(model); if (r.currentMatch) { // This is an empty selection - if (hasFindOccurences) { + if (hasFindOccurrences) { // Do not interfere with semantic word highlighting in the no selection case return null; } @@ -1070,7 +1070,7 @@ export class SelectionHighlighter extends Disposable implements editorCommon.IEd } const model = this.editor.getModel(); - const hasFindOccurences = DocumentHighlightProviderRegistry.has(model); + const hasFindOccurrences = DocumentHighlightProviderRegistry.has(model); let allMatches = model.findMatches(this.state.searchText, true, false, this.state.matchCase, this.state.wordSeparators, false).map(m => m.range); allMatches.sort(Range.compareRangesUsingStarts); @@ -1108,7 +1108,7 @@ export class SelectionHighlighter extends Disposable implements editorCommon.IEd return { range: r, // Show in overviewRuler only if model has no semantic highlighting - options: (hasFindOccurences ? SelectionHighlighter._SELECTION_HIGHLIGHT : SelectionHighlighter._SELECTION_HIGHLIGHT_OVERVIEW) + options: (hasFindOccurrences ? SelectionHighlighter._SELECTION_HIGHLIGHT : SelectionHighlighter._SELECTION_HIGHLIGHT_OVERVIEW) }; }); diff --git a/src/vs/editor/contrib/find/common/findDecorations.ts b/src/vs/editor/contrib/find/common/findDecorations.ts index 2a80081cf0aa917f785bbbfc0e2d0759c50eb2d3..4cf3d6312842013fe1f97f700ec16aa42cec9397 100644 --- a/src/vs/editor/contrib/find/common/findDecorations.ts +++ b/src/vs/editor/contrib/find/common/findDecorations.ts @@ -8,7 +8,7 @@ import { IDisposable } from 'vs/base/common/lifecycle'; import * as editorCommon from 'vs/editor/common/editorCommon'; import { Position } from 'vs/editor/common/core/position'; import { Range } from 'vs/editor/common/core/range'; -import { ModelDecorationOptions } from "vs/editor/common/model/textModelWithDecorations"; +import { ModelDecorationOptions } from 'vs/editor/common/model/textModelWithDecorations'; export class FindDecorations implements IDisposable { diff --git a/src/vs/editor/contrib/find/test/common/findController.test.ts b/src/vs/editor/contrib/find/test/common/findController.test.ts index aa2fb4de23db832cd7546e9959908e06e7c9754d..20559f5713bb17273a6e2ce8685d6e5cdc1475d6 100644 --- a/src/vs/editor/contrib/find/test/common/findController.test.ts +++ b/src/vs/editor/contrib/find/test/common/findController.test.ts @@ -215,7 +215,7 @@ suite('FindController', () => { }); }); - test('issue #5400: "Select All Occurences of Find Match" does not select all if find uses regex', () => { + test('issue #5400: "Select All Occurrences of Find Match" does not select all if find uses regex', () => { withMockCodeEditor([ 'something', 'someething', diff --git a/src/vs/editor/contrib/folding/browser/folding.ts b/src/vs/editor/contrib/folding/browser/folding.ts index 9f644ccd761bde3e287680e09fad8ae7d1d1d1ab..74df9c51570ff2a7f0d0fe92714058f6165f6b9c 100644 --- a/src/vs/editor/contrib/folding/browser/folding.ts +++ b/src/vs/editor/contrib/folding/browser/folding.ts @@ -287,7 +287,7 @@ export class FoldingController implements IFoldingController { return; } let range = e.target.range; - if (!range || !range.isEmpty) { + if (!range) { return; } if (!e.event.leftButton) { @@ -303,7 +303,7 @@ export class FoldingController implements IFoldingController { break; case MouseTargetType.CONTENT_EMPTY: case MouseTargetType.CONTENT_TEXT: - if (range.isEmpty && range.startColumn === model.getLineMaxColumn(range.startLineNumber)) { + if (range.startColumn === model.getLineMaxColumn(range.startLineNumber)) { break; } return; @@ -322,7 +322,7 @@ export class FoldingController implements IFoldingController { let iconClicked = this.mouseDownInfo.iconClicked; let range = e.target.range; - if (!range || !range.isEmpty || range.startLineNumber !== lineNumber) { + if (!range || range.startLineNumber !== lineNumber) { return; } diff --git a/src/vs/editor/contrib/folding/common/foldingModel.ts b/src/vs/editor/contrib/folding/common/foldingModel.ts index 128f450b0873cb346c867aeeeeeeb4b78d79510c..8ebd2424cc7f232397c23d531d435ce79626085a 100644 --- a/src/vs/editor/contrib/folding/common/foldingModel.ts +++ b/src/vs/editor/contrib/folding/common/foldingModel.ts @@ -5,7 +5,7 @@ import * as editorCommon from 'vs/editor/common/editorCommon'; import { Range } from 'vs/editor/common/core/range'; -import { ModelDecorationOptions } from "vs/editor/common/model/textModelWithDecorations"; +import { ModelDecorationOptions } from 'vs/editor/common/model/textModelWithDecorations'; export interface IFoldingRange { startLineNumber: number; diff --git a/src/vs/editor/contrib/goToDeclaration/browser/clickLinkGesture.ts b/src/vs/editor/contrib/goToDeclaration/browser/clickLinkGesture.ts index 79d1043cf50d29fceb2537b48bdb12f50e69f396..c82f9d3fa7f3a65c15d91a75a2c4116ac93e91a1 100644 --- a/src/vs/editor/contrib/goToDeclaration/browser/clickLinkGesture.ts +++ b/src/vs/editor/contrib/goToDeclaration/browser/clickLinkGesture.ts @@ -82,8 +82,8 @@ export class ClickLinkOptions { } } -function createOptions(multicursorModifier: 'altKey' | 'ctrlKey' | 'metaKey'): ClickLinkOptions { - if (multicursorModifier === 'altKey') { +function createOptions(multiCursorModifier: 'altKey' | 'ctrlKey' | 'metaKey'): ClickLinkOptions { + if (multiCursorModifier === 'altKey') { if (platform.isMacintosh) { return new ClickLinkOptions(KeyCode.Meta, 'metaKey', KeyCode.Alt, 'altKey'); } @@ -117,14 +117,14 @@ export class ClickLinkGesture extends Disposable { super(); this._editor = editor; - this._opts = createOptions(this._editor.getConfiguration().multicursorModifier); + this._opts = createOptions(this._editor.getConfiguration().multiCursorModifier); this.lastMouseMoveEvent = null; this.hasTriggerKeyOnMouseDown = false; this._register(this._editor.onDidChangeConfiguration((e) => { - if (e.multicursorModifier) { - const newOpts = createOptions(this._editor.getConfiguration().multicursorModifier); + if (e.multiCursorModifier) { + const newOpts = createOptions(this._editor.getConfiguration().multiCursorModifier); if (this._opts.equals(newOpts)) { return; } diff --git a/src/vs/editor/contrib/goToDeclaration/browser/goToDeclaration.ts b/src/vs/editor/contrib/goToDeclaration/browser/goToDeclaration.ts index 61afed811363ffa6cbc35df94e39c489b6a02cb6..182404712f76ca77af9b2e9b8b977c9cc77b997e 100644 --- a/src/vs/editor/contrib/goToDeclaration/browser/goToDeclaration.ts +++ b/src/vs/editor/contrib/goToDeclaration/browser/goToDeclaration.ts @@ -15,7 +15,7 @@ import { CancellationToken } from 'vs/base/common/cancellation'; import { asWinJsPromise } from 'vs/base/common/async'; import { Position } from 'vs/editor/common/core/position'; -function outputResults(promises: TPromise[]) { +function outputResults(promises: TPromise[]) { return TPromise.join(promises).then(allReferences => { let result: Location[] = []; for (let references of allReferences) { diff --git a/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.ts b/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.ts index 7db3d8f0c5a3a155b94795c8f134b608c3592e4b..0115099afdc7920381c79eb0e34a1e95b8a99a05 100644 --- a/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.ts +++ b/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.ts @@ -149,7 +149,7 @@ export class DefinitionAction extends EditorAction { revealIfVisible: !sideBySide } }, sideBySide).then(editor => { - return editor && editor.getControl(); + return editor && editor.getControl(); }); } diff --git a/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.ts b/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.ts index a29f1511b44ca27fc50ab8b57098dd6f0c08ddda..6a8718e202b4c08f9aa0c01c3d5f536e382a4e9c 100644 --- a/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.ts +++ b/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.ts @@ -19,12 +19,12 @@ import { ICodeEditor, IMouseTarget, MouseTargetType } from 'vs/editor/browser/ed import { editorContribution } from 'vs/editor/browser/editorBrowserExtensions'; import { getDefinitionsAtPosition } from './goToDeclaration'; import { IDisposable, dispose } from 'vs/base/common/lifecycle'; -import { ITextModelResolverService } from 'vs/editor/common/services/resolverService'; +import { ITextModelService } from 'vs/editor/common/services/resolverService'; import { registerThemingParticipant } from 'vs/platform/theme/common/themeService'; import { editorActiveLinkForeground } from 'vs/platform/theme/common/colorRegistry'; import { EditorState, CodeEditorStateFlag } from 'vs/editor/common/core/editorState'; import { DefinitionAction, DefinitionActionConfig } from './goToDeclarationCommands'; -import { ClickLinkGesture, ClickLinkMouseEvent, ClickLinkKeyboardEvent } from "vs/editor/contrib/goToDeclaration/browser/clickLinkGesture"; +import { ClickLinkGesture, ClickLinkMouseEvent, ClickLinkKeyboardEvent } from 'vs/editor/contrib/goToDeclaration/browser/clickLinkGesture'; @editorContribution class GotoDefinitionWithMouseEditorContribution implements editorCommon.IEditorContribution { @@ -40,7 +40,7 @@ class GotoDefinitionWithMouseEditorContribution implements editorCommon.IEditorC constructor( editor: ICodeEditor, - @ITextModelResolverService private textModelResolverService: ITextModelResolverService, + @ITextModelService private textModelResolverService: ITextModelService, @IModeService private modeService: IModeService ) { this.toUnhook = []; diff --git a/src/vs/editor/contrib/goToDeclaration/browser/messageController.ts b/src/vs/editor/contrib/goToDeclaration/browser/messageController.ts index d54532548279ad585068ac5204f71faee99cd945..4951c14ec8c8f9fe23c2e002d3e2c05897dcf65e 100644 --- a/src/vs/editor/contrib/goToDeclaration/browser/messageController.ts +++ b/src/vs/editor/contrib/goToDeclaration/browser/messageController.ts @@ -6,7 +6,6 @@ 'use strict'; import 'vs/css!./messageController'; -import { any } from 'vs/base/common/event'; import { setDisposableTimeout } from 'vs/base/common/async'; import { KeyCode } from 'vs/base/common/keyCodes'; import { IDisposable, dispose } from 'vs/base/common/lifecycle'; @@ -62,12 +61,10 @@ export class MessageController { this._messageWidget = new MessageWidget(this._editor, position, message); // close on blur, cursor, model change, dispose - this._messageListeners.push(any( - this._editor.onDidBlurEditorText, - this._editor.onDidChangeCursorPosition, - this._editor.onDidDispose, - this._editor.onDidChangeModel - )(this.closeMessage, this)); + this._messageListeners.push(this._editor.onDidBlurEditorText(() => this.closeMessage())); + this._messageListeners.push(this._editor.onDidChangeCursorPosition(() => this.closeMessage())); + this._messageListeners.push(this._editor.onDidDispose(() => this.closeMessage())); + this._messageListeners.push(this._editor.onDidChangeModel(() => this.closeMessage())); // close after 3s this._messageListeners.push(setDisposableTimeout(() => this.closeMessage(), 3000)); @@ -184,4 +181,4 @@ registerThemingParticipant((theme, collector) => { if (background) { collector.addRule(`.monaco-editor .monaco-editor-overlaymessage .message { background-color: ${background}; }`); } -}); \ No newline at end of file +}); diff --git a/src/vs/editor/contrib/gotoError/browser/gotoError.ts b/src/vs/editor/contrib/gotoError/browser/gotoError.ts index cf7c165877725848ebdf40774b69d4bb6f4df751..d0e1a23068b38a02498d598cfa567adfe491f972 100644 --- a/src/vs/editor/contrib/gotoError/browser/gotoError.ts +++ b/src/vs/editor/contrib/gotoError/browser/gotoError.ts @@ -23,12 +23,12 @@ import { editorAction, ServicesAccessor, IActionOptions, EditorAction, EditorCom import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; import { editorContribution } from 'vs/editor/browser/editorBrowserExtensions'; import { ZoneWidget } from 'vs/editor/contrib/zoneWidget/browser/zoneWidget'; -import { registerColor } from 'vs/platform/theme/common/colorRegistry'; +import { registerColor, oneOf } from 'vs/platform/theme/common/colorRegistry'; import { IThemeService, ITheme } from 'vs/platform/theme/common/themeService'; import { Color } from 'vs/base/common/color'; import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import { getAccessibilitySupport } from 'vs/base/browser/browser'; import { AccessibilitySupport } from 'vs/base/common/platform'; +import { editorErrorForeground, editorErrorBorder, editorWarningForeground, editorWarningBorder } from 'vs/editor/common/view/editorColorRegistry'; class MarkerModel { @@ -278,7 +278,7 @@ class MarkerNavigationWidget extends ZoneWidget { public show(where: Position, heightInLines: number): void { super.show(where, heightInLines); - if (getAccessibilitySupport() !== AccessibilitySupport.Disabled) { + if (this.editor.getConfiguration().accessibilitySupport !== AccessibilitySupport.Disabled) { this.focus(); } } @@ -488,6 +488,9 @@ CommonEditorRegistry.registerEditorCommand(new MarkerCommand({ // theming -export const editorMarkerNavigationError = registerColor('editorMarkerNavigationError.background', { dark: '#ff5a5a', light: '#ff5a5a', hc: '#ff5a5a' }, nls.localize('editorMarkerNavigationError', 'Editor marker navigation widget error color.')); -export const editorMarkerNavigationWarning = registerColor('editorMarkerNavigationWarning.background', { dark: '#5aac5a', light: '#5aac5a', hc: '#5aac5a' }, nls.localize('editorMarkerNavigationWarning', 'Editor marker navigation widget warning color.')); +let errorDefault = oneOf(editorErrorForeground, editorErrorBorder); +let warningDefault = oneOf(editorWarningForeground, editorWarningBorder); + +export const editorMarkerNavigationError = registerColor('editorMarkerNavigationError.background', { dark: errorDefault, light: errorDefault, hc: errorDefault }, nls.localize('editorMarkerNavigationError', 'Editor marker navigation widget error color.')); +export const editorMarkerNavigationWarning = registerColor('editorMarkerNavigationWarning.background', { dark: warningDefault, light: warningDefault, hc: warningDefault }, nls.localize('editorMarkerNavigationWarning', 'Editor marker navigation widget warning color.')); export const editorMarkerNavigationBackground = registerColor('editorMarkerNavigation.background', { dark: '#2D2D30', light: Color.white, hc: '#0C141F' }, nls.localize('editorMarkerNavigationBackground', 'Editor marker navigation widget background.')); diff --git a/src/vs/editor/contrib/hover/browser/hoverWidgets.ts b/src/vs/editor/contrib/hover/browser/hoverWidgets.ts index bc42fb4935aa2a92266054cc420c7d20f28fdfc4..eacdbf64f4e91c2640994613532212b4c0f9604b 100644 --- a/src/vs/editor/contrib/hover/browser/hoverWidgets.ts +++ b/src/vs/editor/contrib/hover/browser/hoverWidgets.ts @@ -51,7 +51,7 @@ export class ContentHoverWidget extends Widget implements editorBrowser.IContent this._domNode = document.createElement('div'); this._domNode.className = 'monaco-editor-hover-content'; - this.scrollbar = new DomScrollableElement(this._domNode, { canUseTranslate3d: false }); + this.scrollbar = new DomScrollableElement(this._domNode, {}); this.disposables.push(this.scrollbar); this._containerDomNode.appendChild(this.scrollbar.getDomNode()); diff --git a/src/vs/editor/contrib/hover/browser/modesContentHover.ts b/src/vs/editor/contrib/hover/browser/modesContentHover.ts index 636180c1a66d52c5725b03b050396bf9d2237aaa..ff8f4d98be72f52205d54b7027dcc2451d0eb31f 100644 --- a/src/vs/editor/contrib/hover/browser/modesContentHover.ts +++ b/src/vs/editor/contrib/hover/browser/modesContentHover.ts @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ 'use strict'; -import 'vs/css!vs/base/browser/ui/progressbar/progressbar'; import * as nls from 'vs/nls'; import URI from 'vs/base/common/uri'; import { onUnexpectedError } from 'vs/base/common/errors'; @@ -22,7 +21,7 @@ import { getHover } from '../common/hover'; import { HoverOperation, IHoverComputer } from './hoverOperation'; import { ContentHoverWidget } from './hoverWidgets'; import { textToMarkedString, MarkedString } from 'vs/base/common/htmlContent'; -import { ModelDecorationOptions } from "vs/editor/common/model/textModelWithDecorations"; +import { ModelDecorationOptions } from 'vs/editor/common/model/textModelWithDecorations'; class ModesContentComputer implements IHoverComputer { diff --git a/src/vs/editor/contrib/inPlaceReplace/common/inPlaceReplace.ts b/src/vs/editor/contrib/inPlaceReplace/common/inPlaceReplace.ts index 874af70feda74642a8ce9583bd849d2c281c4097..030eff62c25742deedb786ccf06cbb7abe1bfae2 100644 --- a/src/vs/editor/contrib/inPlaceReplace/common/inPlaceReplace.ts +++ b/src/vs/editor/contrib/inPlaceReplace/common/inPlaceReplace.ts @@ -18,7 +18,7 @@ import { InPlaceReplaceCommand } from './inPlaceReplaceCommand'; import { EditorState, CodeEditorStateFlag } from 'vs/editor/common/core/editorState'; import { registerThemingParticipant } from 'vs/platform/theme/common/themeService'; import { editorBracketMatchBorder } from 'vs/editor/common/view/editorColorRegistry'; -import { ModelDecorationOptions } from "vs/editor/common/model/textModelWithDecorations"; +import { ModelDecorationOptions } from 'vs/editor/common/model/textModelWithDecorations'; @commonEditorContribution class InPlaceReplaceController implements IEditorContribution { diff --git a/src/vs/editor/contrib/indentation/common/indentUtils.ts b/src/vs/editor/contrib/indentation/common/indentUtils.ts new file mode 100644 index 0000000000000000000000000000000000000000..45ee5c36566664a9bb794c51a1b0716805548a66 --- /dev/null +++ b/src/vs/editor/contrib/indentation/common/indentUtils.ts @@ -0,0 +1,37 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +export function getSpaceCnt(str, tabSize) { + let spacesCnt = 0; + + for (let i = 0; i < str.length; i++) { + if (str.charAt(i) === '\t') { + spacesCnt += tabSize; + } else { + spacesCnt++; + } + } + + return spacesCnt; +} + +export function generateIndent(spacesCnt: number, tabSize, insertSpaces) { + spacesCnt = spacesCnt < 0 ? 0 : spacesCnt; + + let result = ''; + if (!insertSpaces) { + let tabsCnt = Math.floor(spacesCnt / tabSize); + spacesCnt = spacesCnt % tabSize; + for (let i = 0; i < tabsCnt; i++) { + result += '\t'; + } + } + + for (let i = 0; i < spacesCnt; i++) { + result += ' '; + } + + return result; +} \ No newline at end of file diff --git a/src/vs/editor/contrib/indentation/common/indentation.ts b/src/vs/editor/contrib/indentation/common/indentation.ts index 7fb494c770d071f34458b388db323ddb2cf0e705..21185bbf92dc57f941d1805140f3ff08c55ad064 100644 --- a/src/vs/editor/contrib/indentation/common/indentation.ts +++ b/src/vs/editor/contrib/indentation/common/indentation.ts @@ -4,11 +4,12 @@ *--------------------------------------------------------------------------------------------*/ import * as nls from 'vs/nls'; +import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { TPromise } from 'vs/base/common/winjs.base'; import * as strings from 'vs/base/common/strings'; -import { ICommonCodeEditor, IIdentifiedSingleEditOperation, ICommand, ICursorStateComputerData, IEditOperationBuilder, ITokenizedModel } from 'vs/editor/common/editorCommon'; +import { ICommonCodeEditor, IEditorContribution, IIdentifiedSingleEditOperation, ICommand, ICursorStateComputerData, IEditOperationBuilder, ITokenizedModel, EndOfLineSequence } from 'vs/editor/common/editorCommon'; import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import { editorAction, ServicesAccessor, IActionOptions, EditorAction } from 'vs/editor/common/editorCommonExtensions'; +import { editorAction, ServicesAccessor, IActionOptions, EditorAction, commonEditorContribution } from 'vs/editor/common/editorCommonExtensions'; import { IQuickOpenService } from 'vs/platform/quickOpen/common/quickOpen'; import { IModelService } from 'vs/editor/common/services/modelService'; import { Range } from 'vs/editor/common/core/range'; @@ -17,6 +18,8 @@ import { EditOperation } from 'vs/editor/common/core/editOperation'; import { TextModel } from 'vs/editor/common/model/textModel'; import { LanguageConfigurationRegistry } from 'vs/editor/common/modes/languageConfigurationRegistry'; import { ShiftCommand } from 'vs/editor/common/commands/shiftCommand'; +import { TextEdit } from 'vs/editor/common/modes'; +import * as IndentUtil from './indentUtils'; export function shiftIndent(tabSize: number, indentation: string, count?: number): string { count = count || 1; @@ -325,6 +328,200 @@ export class ReindentLinesAction extends EditorAction { } } +export class AutoIndentOnPasteCommand implements ICommand { + + private _edits: TextEdit[]; + private _newEol: EndOfLineSequence; + + private _initialSelection: Selection; + private _selectionId: string; + + constructor(edits: TextEdit[], initialSelection: Selection) { + this._initialSelection = initialSelection; + this._edits = []; + this._newEol = undefined; + + for (let edit of edits) { + if (typeof edit.eol === 'number') { + this._newEol = edit.eol; + } + if (edit.range && typeof edit.text === 'string') { + this._edits.push(edit); + } + } + } + + public getEditOperations(model: ITokenizedModel, builder: IEditOperationBuilder): void { + for (let edit of this._edits) { + builder.addEditOperation(Range.lift(edit.range), edit.text); + } + + var selectionIsSet = false; + if (Array.isArray(this._edits) && this._edits.length === 1 && this._initialSelection.isEmpty()) { + if (this._edits[0].range.startColumn === this._initialSelection.endColumn && + this._edits[0].range.startLineNumber === this._initialSelection.endLineNumber) { + selectionIsSet = true; + this._selectionId = builder.trackSelection(this._initialSelection, true); + } else if (this._edits[0].range.endColumn === this._initialSelection.startColumn && + this._edits[0].range.endLineNumber === this._initialSelection.startLineNumber) { + selectionIsSet = true; + this._selectionId = builder.trackSelection(this._initialSelection, false); + } + } + + if (!selectionIsSet) { + this._selectionId = builder.trackSelection(this._initialSelection); + } + } + + public computeCursorState(model: ITokenizedModel, helper: ICursorStateComputerData): Selection { + return helper.getTrackedSelection(this._selectionId); + } +} + +@commonEditorContribution +export class AutoIndentOnPaste implements IEditorContribution { + private static ID = 'editor.contrib.autoIndentOnPaste'; + + private editor: ICommonCodeEditor; + private callOnDispose: IDisposable[]; + private callOnModel: IDisposable[]; + + constructor(editor: ICommonCodeEditor) { + this.editor = editor; + this.callOnDispose = []; + this.callOnModel = []; + + this.callOnDispose.push(editor.onDidChangeConfiguration(() => this.update())); + this.callOnDispose.push(editor.onDidChangeModel(() => this.update())); + this.callOnDispose.push(editor.onDidChangeModelLanguage(() => this.update())); + } + + private update(): void { + + // clean up + this.callOnModel = dispose(this.callOnModel); + + // we are disabled + if (!this.editor.getConfiguration().autoIndent || this.editor.getConfiguration().contribInfo.formatOnPaste) { + return; + } + + // no model + if (!this.editor.getModel()) { + return; + } + + this.callOnModel.push(this.editor.onDidPaste((range: Range) => { + this.trigger(range); + })); + } + + private trigger(range: Range): void { + if (this.editor.getSelections().length > 1) { + return; + } + + const model = this.editor.getModel(); + const { tabSize, insertSpaces } = model.getOptions(); + this.editor.pushUndoStop(); + let textEdits: TextEdit[] = []; + + let indentConverter = { + shiftIndent: (indentation) => { + let desiredIndentCount = ShiftCommand.shiftIndentCount(indentation, indentation.length + 1, tabSize); + let newIndentation = ''; + for (let i = 0; i < desiredIndentCount; i++) { + newIndentation += '\t'; + } + + return newIndentation; + }, + unshiftIndent: (indentation) => { + let desiredIndentCount = ShiftCommand.unshiftIndentCount(indentation, indentation.length + 1, tabSize); + let newIndentation = ''; + for (let i = 0; i < desiredIndentCount; i++) { + newIndentation += '\t'; + } + + return newIndentation; + } + }; + let indentOfFirstLine = LanguageConfigurationRegistry.getGoodIndentForLine(model, model.getLanguageIdentifier().id, range.startLineNumber, indentConverter); + + if (indentOfFirstLine !== null) { + let firstLineText = model.getLineContent(range.startLineNumber); + let oldIndentation = strings.getLeadingWhitespace(firstLineText); + let newSpaceCnt = IndentUtil.getSpaceCnt(indentOfFirstLine, tabSize); + let oldSpaceCnt = IndentUtil.getSpaceCnt(oldIndentation, tabSize); + + if (newSpaceCnt !== oldSpaceCnt) { + let newIndent = IndentUtil.generateIndent(newSpaceCnt, tabSize, insertSpaces); + textEdits.push({ + range: new Range(range.startLineNumber, 1, range.startLineNumber, oldIndentation.length + 1), + text: newIndent + }); + firstLineText = newIndent + firstLineText.substr(oldIndentation.length); + } + + if (range.startLineNumber !== range.endLineNumber) { + let virtualModel = { + getLineTokens: (lineNumber: number) => { + return model.getLineTokens(lineNumber); + }, + getLanguageIdentifier: () => { + return model.getLanguageIdentifier(); + }, + getLanguageIdAtPosition: (lineNumber: number, column: number) => { + return model.getLanguageIdAtPosition(lineNumber, column); + }, + getLineContent: (lineNumber) => { + if (lineNumber === range.startLineNumber) { + return firstLineText; + } else { + return model.getLineContent(lineNumber); + } + } + }; + let indentOfSecondLine = LanguageConfigurationRegistry.getGoodIndentForLine(virtualModel, model.getLanguageIdentifier().id, range.startLineNumber + 1, indentConverter); + let newSpaceCntOfSecondLine = IndentUtil.getSpaceCnt(indentOfSecondLine, tabSize); + let oldSpaceCntOfSecondLine = IndentUtil.getSpaceCnt(strings.getLeadingWhitespace(model.getLineContent(range.startLineNumber + 1)), tabSize); + + if (newSpaceCntOfSecondLine !== oldSpaceCntOfSecondLine) { + let spaceCntOffset = newSpaceCntOfSecondLine - oldSpaceCntOfSecondLine; + for (let i = range.startLineNumber + 1; i <= range.endLineNumber; i++) { + let lineContent = model.getLineContent(i); + let originalIndent = strings.getLeadingWhitespace(lineContent); + let originalSpacesCnt = IndentUtil.getSpaceCnt(originalIndent, tabSize); + let newSpacesCnt = originalSpacesCnt + spaceCntOffset; + let newIndent = IndentUtil.generateIndent(newSpacesCnt, tabSize, insertSpaces); + + if (newIndent !== originalIndent) { + textEdits.push({ + range: new Range(i, 1, i, originalIndent.length + 1), + text: newIndent + }); + } + } + } + } + } + + let cmd = new AutoIndentOnPasteCommand(textEdits, this.editor.getSelection()); + this.editor.executeCommand('autoIndentOnPaste', cmd); + this.editor.pushUndoStop(); + } + + public getId(): string { + return AutoIndentOnPaste.ID; + } + + public dispose(): void { + this.callOnDispose = dispose(this.callOnDispose); + this.callOnModel = dispose(this.callOnModel); + } +} + function getIndentationEditOperations(model: ITokenizedModel, builder: IEditOperationBuilder, tabSize: number, tabsToSpaces: boolean): void { if (model.getLineCount() === 1 && model.getLineMaxColumn(1) === 1) { // Model is empty diff --git a/src/vs/editor/contrib/linesOperations/common/linesOperations.ts b/src/vs/editor/contrib/linesOperations/common/linesOperations.ts index 4bc4b88d0fa664b775b11837f7bb095316d42dbe..3c5229de4505ed9ad2177040f4eecee4a6465198 100644 --- a/src/vs/editor/contrib/linesOperations/common/linesOperations.ts +++ b/src/vs/editor/contrib/linesOperations/common/linesOperations.ts @@ -19,7 +19,7 @@ import { CopyLinesCommand } from './copyLinesCommand'; import { DeleteLinesCommand } from './deleteLinesCommand'; import { MoveLinesCommand } from './moveLinesCommand'; import { TypeOperations } from 'vs/editor/common/controller/cursorTypeOperations'; -import { CoreEditingCommands } from "vs/editor/common/controller/coreCommands"; +import { CoreEditingCommands } from 'vs/editor/common/controller/coreCommands'; // copy lines @@ -96,9 +96,10 @@ abstract class AbstractMoveLinesAction extends EditorAction { var commands: ICommand[] = []; var selections = editor.getSelections(); + var autoIndent = editor.getConfiguration().autoIndent; for (var i = 0; i < selections.length; i++) { - commands.push(new MoveLinesCommand(selections[i], this.down)); + commands.push(new MoveLinesCommand(selections[i], this.down, autoIndent)); } editor.pushUndoStop(); diff --git a/src/vs/editor/contrib/linesOperations/common/moveLinesCommand.ts b/src/vs/editor/contrib/linesOperations/common/moveLinesCommand.ts index 43ed98d212d8299bec6814ba5a24826f76f074e1..838ea2dc6fde1af040cb62519746fdcb06a0bc51 100644 --- a/src/vs/editor/contrib/linesOperations/common/moveLinesCommand.ts +++ b/src/vs/editor/contrib/linesOperations/common/moveLinesCommand.ts @@ -4,21 +4,28 @@ *--------------------------------------------------------------------------------------------*/ 'use strict'; +import * as strings from 'vs/base/common/strings'; import { Range } from 'vs/editor/common/core/range'; import { Selection } from 'vs/editor/common/core/selection'; import { ICommand, ICursorStateComputerData, IEditOperationBuilder, ITokenizedModel } from 'vs/editor/common/editorCommon'; +import { LanguageConfigurationRegistry, IndentConverter } from 'vs/editor/common/modes/languageConfigurationRegistry'; +import { ShiftCommand } from 'vs/editor/common/commands/shiftCommand'; +import * as IndentUtil from 'vs/editor/contrib/indentation/common/indentUtils'; +import { IndentAction } from 'vs/editor/common/modes/languageConfiguration'; export class MoveLinesCommand implements ICommand { private _selection: Selection; private _isMovingDown: boolean; + private _autoIndent: boolean; private _selectionId: string; private _moveEndPositionDown: boolean; - constructor(selection: Selection, isMovingDown: boolean) { + constructor(selection: Selection, isMovingDown: boolean, autoIndent: boolean) { this._selection = selection; this._isMovingDown = isMovingDown; + this._autoIndent = autoIndent; } public getEditOperations(model: ITokenizedModel, builder: IEditOperationBuilder): void { @@ -40,6 +47,22 @@ export class MoveLinesCommand implements ICommand { s = s.setEndPosition(s.endLineNumber - 1, model.getLineMaxColumn(s.endLineNumber - 1)); } + let tabSize = model.getOptions().tabSize; + let insertSpaces = model.getOptions().insertSpaces; + let indentConverter = this.buildIndentConverter(tabSize); + let virtualModel = { + getLineTokens: (lineNumber: number) => { + return model.getLineTokens(lineNumber); + }, + getLanguageIdentifier: () => { + return model.getLanguageIdentifier(); + }, + getLanguageIdAtPosition: (lineNumber: number, column: number) => { + return model.getLanguageIdAtPosition(lineNumber, column); + }, + getLineContent: null + }; + if (s.startLineNumber === s.endLineNumber && model.getLineMaxColumn(s.startLineNumber) === 1) { // Current line is empty var lineNumber = s.startLineNumber; @@ -67,12 +90,81 @@ export class MoveLinesCommand implements ICommand { if (this._isMovingDown) { movingLineNumber = s.endLineNumber + 1; movingLineText = model.getLineContent(movingLineNumber); - // Delete line that needs to be moved builder.addEditOperation(new Range(movingLineNumber - 1, model.getLineMaxColumn(movingLineNumber - 1), movingLineNumber, model.getLineMaxColumn(movingLineNumber)), null); - // Insert line that needs to be moved before - builder.addEditOperation(new Range(s.startLineNumber, 1, s.startLineNumber, 1), movingLineText + '\n'); + let insertingText = movingLineText; + + if (this.isAutoIndent(model, s)) { + let movingLineMatchResult = this.matchEnterRule(model, s.startLineNumber - 1, movingLineNumber, indentConverter, tabSize); + // if s.startLineNumber - 1 matches onEnter rule, we still honor that. + if (movingLineMatchResult !== null) { + let oldIndentation = strings.getLeadingWhitespace(model.getLineContent(movingLineNumber)); + let newSpaceCnt = movingLineMatchResult + IndentUtil.getSpaceCnt(oldIndentation, tabSize); + let newIndentation = IndentUtil.generateIndent(newSpaceCnt, tabSize, insertSpaces); + insertingText = newIndentation + this.trimLeft(movingLineText); + } else { + // no enter rule matches, let's check indentatin rules then. + virtualModel.getLineContent = (lineNumber) => { + if (lineNumber === s.startLineNumber) { + return model.getLineContent(movingLineNumber); + } else { + return model.getLineContent(lineNumber); + } + }; + let indentOfMovingLine = LanguageConfigurationRegistry.getGoodIndentForLine(virtualModel, model.getLanguageIdAtPosition( + movingLineNumber, 1), s.startLineNumber, indentConverter); + if (indentOfMovingLine !== null) { + let oldIndentation = strings.getLeadingWhitespace(model.getLineContent(movingLineNumber)); + let newSpaceCnt = IndentUtil.getSpaceCnt(indentOfMovingLine, tabSize); + let oldSpaceCnt = IndentUtil.getSpaceCnt(oldIndentation, tabSize); + if (newSpaceCnt !== oldSpaceCnt) { + let newIndentation = IndentUtil.generateIndent(newSpaceCnt, tabSize, insertSpaces); + insertingText = newIndentation + this.trimLeft(movingLineText); + } + } + } + + // add edit operations for moving line first to make sure it's executed after we make indentation change + // to s.startLineNumber + builder.addEditOperation(new Range(s.startLineNumber, 1, s.startLineNumber, 1), insertingText + '\n'); + + let ret = this.matchEnterRule(model, s.endLineNumber + 1, s.startLineNumber, indentConverter, tabSize); + // check if the line being moved before matches onEnter rules, if so let's adjust the indentation by onEnter rules. + if (ret !== null) { + if (ret !== 0) { + this.getIndentEditsOfMovingBlock(model, builder, s.startLineNumber, s.endLineNumber, tabSize, insertSpaces, ret); + } + } else { + // it doesn't match onEnter rules, let's check indentation rules then. + virtualModel.getLineContent = (lineNumber) => { + if (lineNumber === s.startLineNumber) { + return insertingText; + } else if (lineNumber >= s.startLineNumber + 1 && lineNumber <= s.endLineNumber + 1) { + return model.getLineContent(lineNumber - 1); + } else { + return model.getLineContent(lineNumber); + } + }; + + let newIndentatOfMovingBlock = LanguageConfigurationRegistry.getGoodIndentForLine(virtualModel, model.getLanguageIdAtPosition( + movingLineNumber, 1), s.startLineNumber + 1, indentConverter); + + if (newIndentatOfMovingBlock !== null) { + const oldIndentation = strings.getLeadingWhitespace(model.getLineContent(s.startLineNumber)); + const newSpaceCnt = IndentUtil.getSpaceCnt(newIndentatOfMovingBlock, tabSize); + const oldSpaceCnt = IndentUtil.getSpaceCnt(oldIndentation, tabSize); + if (newSpaceCnt !== oldSpaceCnt) { + const spaceCntOffset = newSpaceCnt - oldSpaceCnt; + + this.getIndentEditsOfMovingBlock(model, builder, s.startLineNumber, s.endLineNumber, tabSize, insertSpaces, spaceCntOffset); + } + } + } + } else { + // Insert line that needs to be moved before + builder.addEditOperation(new Range(s.startLineNumber, 1, s.startLineNumber, 1), insertingText + '\n'); + } } else { movingLineNumber = s.startLineNumber - 1; movingLineText = model.getLineContent(movingLineNumber); @@ -82,12 +174,123 @@ export class MoveLinesCommand implements ICommand { // Insert line that needs to be moved after builder.addEditOperation(new Range(s.endLineNumber, model.getLineMaxColumn(s.endLineNumber), s.endLineNumber, model.getLineMaxColumn(s.endLineNumber)), '\n' + movingLineText); + + if (this.isAutoIndent(model, s)) { + virtualModel.getLineContent = (lineNumber: number) => { + if (lineNumber === movingLineNumber) { + return model.getLineContent(s.startLineNumber); + } else { + return model.getLineContent(lineNumber); + } + }; + + let ret = this.matchEnterRule(model, s.startLineNumber - 2, s.startLineNumber, indentConverter, tabSize); + // check if s.startLineNumber - 2 matches onEnter rules, if so adjust the moving block by onEnter rules. + if (ret !== null) { + if (ret !== 0) { + this.getIndentEditsOfMovingBlock(model, builder, s.startLineNumber, s.endLineNumber, tabSize, insertSpaces, ret); + } + } else { + // it doesn't match any onEnter rule, let's check indentation rules then. + let indentOfFirstLine = LanguageConfigurationRegistry.getGoodIndentForLine(virtualModel, model.getLanguageIdAtPosition(s.startLineNumber, 1), movingLineNumber, indentConverter); + if (indentOfFirstLine !== null) { + // adjust the indentation of the moving block + let oldIndent = strings.getLeadingWhitespace(model.getLineContent(s.startLineNumber)); + let newSpaceCnt = IndentUtil.getSpaceCnt(indentOfFirstLine, tabSize); + let oldSpaceCnt = IndentUtil.getSpaceCnt(oldIndent, tabSize); + if (newSpaceCnt !== oldSpaceCnt) { + let spaceCntOffset = newSpaceCnt - oldSpaceCnt; + + this.getIndentEditsOfMovingBlock(model, builder, s.startLineNumber, s.endLineNumber, tabSize, insertSpaces, spaceCntOffset); + } + } + } + } } } this._selectionId = builder.trackSelection(s); } + private buildIndentConverter(tabSize: number): IndentConverter { + return { + shiftIndent: (indentation) => { + let desiredIndentCount = ShiftCommand.shiftIndentCount(indentation, indentation.length + 1, tabSize); + let newIndentation = ''; + for (let i = 0; i < desiredIndentCount; i++) { + newIndentation += '\t'; + } + + return newIndentation; + }, + unshiftIndent: (indentation) => { + let desiredIndentCount = ShiftCommand.unshiftIndentCount(indentation, indentation.length + 1, tabSize); + let newIndentation = ''; + for (let i = 0; i < desiredIndentCount; i++) { + newIndentation += '\t'; + } + + return newIndentation; + } + }; + } + + private matchEnterRule(model: ITokenizedModel, oneLineAbove: number, line: number, indentConverter: IndentConverter, tabSize: number) { + if (oneLineAbove < 1 || line > model.getLineCount()) { + return null; + } + + let maxColumn = model.getLineMaxColumn(oneLineAbove); + let enter = LanguageConfigurationRegistry.getEnterAction(model, new Range(oneLineAbove, maxColumn, oneLineAbove, maxColumn)); + + if (enter) { + let enterPrefix = enter.indentation; + let enterAction = enter.enterAction; + + if (enterAction.indentAction === IndentAction.None) { + enterPrefix = enter.indentation + enterAction.appendText; + } else if (enterAction.indentAction === IndentAction.Indent) { + enterPrefix = enter.indentation + enterAction.appendText; + } else if (enterAction.indentAction === IndentAction.IndentOutdent) { + enterPrefix = indentConverter.shiftIndent(enter.indentation) + enterAction.appendText; + } else if (enterAction.indentAction === IndentAction.Outdent) { + enterPrefix = indentConverter.unshiftIndent(enter.indentation) + enterAction.appendText; + } + let movingLineText = model.getLineContent(line); + if (this.trimLeft(movingLineText).indexOf(this.trimLeft(enterPrefix)) >= 0) { + let oldIndentation = strings.getLeadingWhitespace(model.getLineContent(line)); + let newIndentation = strings.getLeadingWhitespace(enterPrefix); + let newSpaceCnt = IndentUtil.getSpaceCnt(newIndentation, tabSize); + let oldSpaceCnt = IndentUtil.getSpaceCnt(oldIndentation, tabSize); + return newSpaceCnt - oldSpaceCnt; + } + } + + return null; + } + + private trimLeft(str: string) { + return str.replace(/^\s+/, ''); + } + + private isAutoIndent(model: ITokenizedModel, selection: Selection) { + return this._autoIndent && (model.getLanguageIdAtPosition(selection.startLineNumber, 1) === model.getLanguageIdAtPosition(selection.endLineNumber, 1)); + } + + private getIndentEditsOfMovingBlock(model: ITokenizedModel, builder: IEditOperationBuilder, startLineNumber: number, endLineNumber: number, tabSize: number, insertSpaces: boolean, offset: number) { + for (let i = startLineNumber; i <= endLineNumber; i++) { + let lineContent = model.getLineContent(i); + let originalIndent = strings.getLeadingWhitespace(lineContent); + let originalSpacesCnt = IndentUtil.getSpaceCnt(originalIndent, tabSize); + let newSpacesCnt = originalSpacesCnt + offset; + let newIndent = IndentUtil.generateIndent(newSpacesCnt, tabSize, insertSpaces); + + if (newIndent !== originalIndent) { + builder.addEditOperation(new Range(i, 1, i, originalIndent.length + 1), newIndent); + } + } + } + public computeCursorState(model: ITokenizedModel, helper: ICursorStateComputerData): Selection { var result = helper.getTrackedSelection(this._selectionId); diff --git a/src/vs/editor/contrib/linesOperations/test/common/linesOperations.test.ts b/src/vs/editor/contrib/linesOperations/test/common/linesOperations.test.ts index 4a56e203f656a24e0a602ac606135b0b0435fec8..64c67e2cb9ae3fb03e8a9e4455cf8f33da98be81 100644 --- a/src/vs/editor/contrib/linesOperations/test/common/linesOperations.test.ts +++ b/src/vs/editor/contrib/linesOperations/test/common/linesOperations.test.ts @@ -10,9 +10,9 @@ import { Position } from 'vs/editor/common/core/position'; import { Handler, IModel, DefaultEndOfLine } from 'vs/editor/common/editorCommon'; import { withMockCodeEditor } from 'vs/editor/test/common/mocks/mockCodeEditor'; import { DeleteAllLeftAction, JoinLinesAction, TransposeAction, UpperCaseAction, LowerCaseAction, DeleteAllRightAction, InsertLineBeforeAction, InsertLineAfterAction, IndentLinesAction } from 'vs/editor/contrib/linesOperations/common/linesOperations'; -import { Cursor } from "vs/editor/common/controller/cursor"; -import { Model } from "vs/editor/common/model/model"; -import { CoreEditingCommands } from "vs/editor/common/controller/coreCommands"; +import { Cursor } from 'vs/editor/common/controller/cursor'; +import { Model } from 'vs/editor/common/model/model'; +import { CoreEditingCommands } from 'vs/editor/common/controller/coreCommands'; suite('Editor Contrib - Line Operations', () => { suite('DeleteAllLeftAction', () => { diff --git a/src/vs/editor/contrib/linesOperations/test/common/moveLinesCommand.test.ts b/src/vs/editor/contrib/linesOperations/test/common/moveLinesCommand.test.ts index 429d896276ebb1232f4e594899e3e3fcba2d6997..518dbb2d762238a2062cc7de9e7659394f3f660d 100644 --- a/src/vs/editor/contrib/linesOperations/test/common/moveLinesCommand.test.ts +++ b/src/vs/editor/contrib/linesOperations/test/common/moveLinesCommand.test.ts @@ -3,17 +3,28 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ 'use strict'; - import { Selection } from 'vs/editor/common/core/selection'; import { MoveLinesCommand } from 'vs/editor/contrib/linesOperations/common/moveLinesCommand'; import { testCommand } from 'vs/editor/test/common/commands/commandTestUtils'; +import { MockMode } from 'vs/editor/test/common/mocks/mockMode'; +import { LanguageIdentifier } from 'vs/editor/common/modes'; +import { IndentationRule } from 'vs/editor/common/modes/languageConfiguration'; +import { LanguageConfigurationRegistry } from 'vs/editor/common/modes/languageConfigurationRegistry'; function testMoveLinesDownCommand(lines: string[], selection: Selection, expectedLines: string[], expectedSelection: Selection): void { - testCommand(lines, null, selection, (sel) => new MoveLinesCommand(sel, true), expectedLines, expectedSelection); + testCommand(lines, null, selection, (sel) => new MoveLinesCommand(sel, true, false), expectedLines, expectedSelection); } function testMoveLinesUpCommand(lines: string[], selection: Selection, expectedLines: string[], expectedSelection: Selection): void { - testCommand(lines, null, selection, (sel) => new MoveLinesCommand(sel, false), expectedLines, expectedSelection); + testCommand(lines, null, selection, (sel) => new MoveLinesCommand(sel, false, false), expectedLines, expectedSelection); +} + +function testMoveLinesDownWithIndentCommand(languageId: LanguageIdentifier, lines: string[], selection: Selection, expectedLines: string[], expectedSelection: Selection): void { + testCommand(lines, languageId, selection, (sel) => new MoveLinesCommand(sel, true, true), expectedLines, expectedSelection); +} + +function testMoveLinesUpWithIndentCommand(languageId: LanguageIdentifier, lines: string[], selection: Selection, expectedLines: string[], expectedSelection: Selection): void { + testCommand(lines, languageId, selection, (sel) => new MoveLinesCommand(sel, false, true), expectedLines, expectedSelection); } suite('Editor Contrib - Move Lines Command', () => { @@ -248,3 +259,73 @@ suite('Editor Contrib - Move Lines Command', () => { }); }); +class IndentRulesMode extends MockMode { + private static _id = new LanguageIdentifier('moveLinesIndentMode', 7); + constructor(indentationRules: IndentationRule) { + super(IndentRulesMode._id); + this._register(LanguageConfigurationRegistry.register(this.getLanguageIdentifier(), { + indentationRules: indentationRules + })); + } +} + +suite('Editor contrib - Move Lines Command honors Indentation Rules', () => { + let indentRules = { + decreaseIndentPattern: /^\s*((?!\S.*\/[*]).*[*]\/\s*)?[})\]]|^\s*(case\b.*|default):\s*(\/\/.*|\/[*].*[*]\/\s*)?$/, + increaseIndentPattern: /(\{[^}"'`]*|\([^)"']*|\[[^\]"']*|^\s*(\{\}|\(\)|\[\]|(case\b.*|default):))\s*(\/\/.*|\/[*].*[*]\/\s*)?$/, + indentNextLinePattern: /^\s*(for|while|if|else)\b(?!.*[;{}]\s*(\/\/.*|\/[*].*[*]\/\s*)?$)/, + unIndentedLinePattern: /^(?!.*([;{}]|\S:)\s*(\/\/.*|\/[*].*[*]\/\s*)?$)(?!.*(\{[^}"']*|\([^)"']*|\[[^\]"']*|^\s*(\{\}|\(\)|\[\]|(case\b.*|default):))\s*(\/\/.*|\/[*].*[*]\/\s*)?$)(?!^\s*((?!\S.*\/[*]).*[*]\/\s*)?[})\]]|^\s*(case\b.*|default):\s*(\/\/.*|\/[*].*[*]\/\s*)?$)(?!^\s*(for|while|if|else)\b(?!.*[;{}]\s*(\/\/.*|\/[*].*[*]\/\s*)?$))/ + }; + + // https://github.com/Microsoft/vscode/issues/28552#issuecomment-307862797 + test('first line indentation adjust to 0', () => { + let mode = new IndentRulesMode(indentRules); + + testMoveLinesUpWithIndentCommand( + mode.getLanguageIdentifier(), + [ + 'class X {', + '\tz = 2', + '}' + ], + new Selection(2, 1, 2, 1), + [ + 'z = 2', + 'class X {', + '}' + ], + new Selection(1, 1, 1, 1) + ); + + mode.dispose(); + }); + + // https://github.com/Microsoft/vscode/issues/28552#issuecomment-307867717 + test('move lines across block', () => { + let mode = new IndentRulesMode(indentRules); + + testMoveLinesDownWithIndentCommand( + mode.getLanguageIdentifier(), + [ + 'const value = 2;', + 'const standardLanguageDescriptions = [', + ' {', + ' diagnosticSource: \'js\',', + ' }', + '];' + ], + new Selection(1, 1, 1, 1), + [ + 'const standardLanguageDescriptions = [', + ' const value = 2;', + ' {', + ' diagnosticSource: \'js\',', + ' }', + '];' + ], + new Selection(2, 5, 2, 5) + ); + + mode.dispose(); + }); +}); \ No newline at end of file diff --git a/src/vs/editor/contrib/links/browser/links.ts b/src/vs/editor/contrib/links/browser/links.ts index 356f9bf6843b20fcd188bc720560084e4204513c..e3ab8e404c8e3b26e60ecc7c7c0ea12dda4de2ad 100644 --- a/src/vs/editor/contrib/links/browser/links.ts +++ b/src/vs/editor/contrib/links/browser/links.ts @@ -24,8 +24,8 @@ import { editorContribution } from 'vs/editor/browser/editorBrowserExtensions'; import { registerThemingParticipant } from 'vs/platform/theme/common/themeService'; import { editorActiveLinkForeground } from 'vs/platform/theme/common/colorRegistry'; import { Position } from 'vs/editor/common/core/position'; -import { ModelDecorationOptions } from "vs/editor/common/model/textModelWithDecorations"; -import { ClickLinkGesture, ClickLinkMouseEvent, ClickLinkKeyboardEvent } from "vs/editor/contrib/goToDeclaration/browser/clickLinkGesture"; +import { ModelDecorationOptions } from 'vs/editor/common/model/textModelWithDecorations'; +import { ClickLinkGesture, ClickLinkMouseEvent, ClickLinkKeyboardEvent } from 'vs/editor/contrib/goToDeclaration/browser/clickLinkGesture'; const HOVER_MESSAGE_GENERAL_META = ( platform.isMacintosh @@ -58,7 +58,7 @@ const decoration = { }), }; -class LinkOccurence { +class LinkOccurrence { public static decoration(link: Link, useMetaKey: boolean): editorCommon.IModelDeltaDecoration { return { @@ -68,7 +68,7 @@ class LinkOccurence { endLineNumber: link.range.endLineNumber, endColumn: link.range.endColumn }, - options: LinkOccurence._getOptions(useMetaKey, false) + options: LinkOccurrence._getOptions(useMetaKey, false) }; } @@ -88,11 +88,11 @@ class LinkOccurence { } public activate(changeAccessor: editorCommon.IModelDecorationsChangeAccessor, useMetaKey: boolean): void { - changeAccessor.changeDecorationOptions(this.decorationId, LinkOccurence._getOptions(useMetaKey, true)); + changeAccessor.changeDecorationOptions(this.decorationId, LinkOccurrence._getOptions(useMetaKey, true)); } public deactivate(changeAccessor: editorCommon.IModelDecorationsChangeAccessor, useMetaKey: boolean): void { - changeAccessor.changeDecorationOptions(this.decorationId, LinkOccurence._getOptions(useMetaKey, false)); + changeAccessor.changeDecorationOptions(this.decorationId, LinkOccurrence._getOptions(useMetaKey, false)); } } @@ -108,6 +108,7 @@ class LinkDetector implements editorCommon.IEditorContribution { static RECOMPUTE_TIME = 1000; // ms private editor: ICodeEditor; + private enabled: boolean; private listenersToRemove: IDisposable[]; private timeoutPromise: TPromise; private computePromise: TPromise; @@ -115,7 +116,7 @@ class LinkDetector implements editorCommon.IEditorContribution { private openerService: IOpenerService; private messageService: IMessageService; private editorWorkerService: IEditorWorkerService; - private currentOccurences: { [decorationId: string]: LinkOccurence; }; + private currentOccurrences: { [decorationId: string]: LinkOccurrence; }; constructor( editor: ICodeEditor, @@ -141,6 +142,24 @@ class LinkDetector implements editorCommon.IEditorContribution { this.cleanUpActiveLinkDecoration(); })); + this.enabled = editor.getConfiguration().contribInfo.links; + this.listenersToRemove.push(editor.onDidChangeConfiguration((e) => { + let enabled = editor.getConfiguration().contribInfo.links; + if (this.enabled === enabled) { + // No change in our configuration option + return; + } + this.enabled = enabled; + + // Remove any links (for the getting disabled case) + this.updateDecorations([]); + + // Stop any computation (for the getting disabled case) + this.stop(); + + // Start computing (for the getting enabled case) + this.beginCompute(); + })); this.listenersToRemove.push(editor.onDidChangeModelContent((e) => this.onChange())); this.listenersToRemove.push(editor.onDidChangeModel((e) => this.onModelChanged())); this.listenersToRemove.push(editor.onDidChangeModelLanguage((e) => this.onModelModeChanged())); @@ -148,7 +167,7 @@ class LinkDetector implements editorCommon.IEditorContribution { this.timeoutPromise = null; this.computePromise = null; - this.currentOccurences = {}; + this.currentOccurrences = {}; this.activeLinkDecorationId = null; this.beginCompute(); } @@ -162,7 +181,7 @@ class LinkDetector implements editorCommon.IEditorContribution { } private onModelChanged(): void { - this.currentOccurences = {}; + this.currentOccurrences = {}; this.activeLinkDecorationId = null; this.stop(); this.beginCompute(); @@ -184,7 +203,7 @@ class LinkDetector implements editorCommon.IEditorContribution { } private beginCompute(): void { - if (!this.editor.getModel()) { + if (!this.editor.getModel() || !this.enabled) { return; } @@ -199,13 +218,13 @@ class LinkDetector implements editorCommon.IEditorContribution { } private updateDecorations(links: Link[]): void { - const useMetaKey = (this.editor.getConfiguration().multicursorModifier === 'altKey'); + const useMetaKey = (this.editor.getConfiguration().multiCursorModifier === 'altKey'); this.editor.changeDecorations((changeAccessor: editorCommon.IModelDecorationsChangeAccessor) => { var oldDecorations: string[] = []; - let keys = Object.keys(this.currentOccurences); + let keys = Object.keys(this.currentOccurrences); for (let i = 0, len = keys.length; i < len; i++) { let decorationId = keys[i]; - let occurance = this.currentOccurences[decorationId]; + let occurance = this.currentOccurrences[decorationId]; oldDecorations.push(occurance.decorationId); } @@ -213,30 +232,30 @@ class LinkDetector implements editorCommon.IEditorContribution { if (links) { // Not sure why this is sometimes null for (var i = 0; i < links.length; i++) { - newDecorations.push(LinkOccurence.decoration(links[i], useMetaKey)); + newDecorations.push(LinkOccurrence.decoration(links[i], useMetaKey)); } } var decorations = changeAccessor.deltaDecorations(oldDecorations, newDecorations); - this.currentOccurences = {}; + this.currentOccurrences = {}; this.activeLinkDecorationId = null; for (let i = 0, len = decorations.length; i < len; i++) { - var occurance = new LinkOccurence(links[i], decorations[i]); - this.currentOccurences[occurance.decorationId] = occurance; + var occurance = new LinkOccurrence(links[i], decorations[i]); + this.currentOccurrences[occurance.decorationId] = occurance; } }); } private _onEditorMouseMove(mouseEvent: ClickLinkMouseEvent, withKey?: ClickLinkKeyboardEvent): void { - const useMetaKey = (this.editor.getConfiguration().multicursorModifier === 'altKey'); + const useMetaKey = (this.editor.getConfiguration().multiCursorModifier === 'altKey'); if (this.isEnabled(mouseEvent, withKey)) { this.cleanUpActiveLinkDecoration(); // always remove previous link decoration as their can only be one - var occurence = this.getLinkOccurence(mouseEvent.target.position); - if (occurence) { + var occurrence = this.getLinkOccurrence(mouseEvent.target.position); + if (occurrence) { this.editor.changeDecorations((changeAccessor) => { - occurence.activate(changeAccessor, useMetaKey); - this.activeLinkDecorationId = occurence.decorationId; + occurrence.activate(changeAccessor, useMetaKey); + this.activeLinkDecorationId = occurrence.decorationId; }); } } else { @@ -245,12 +264,12 @@ class LinkDetector implements editorCommon.IEditorContribution { } private cleanUpActiveLinkDecoration(): void { - const useMetaKey = (this.editor.getConfiguration().multicursorModifier === 'altKey'); + const useMetaKey = (this.editor.getConfiguration().multiCursorModifier === 'altKey'); if (this.activeLinkDecorationId) { - var occurence = this.currentOccurences[this.activeLinkDecorationId]; - if (occurence) { + var occurrence = this.currentOccurrences[this.activeLinkDecorationId]; + if (occurrence) { this.editor.changeDecorations((changeAccessor) => { - occurence.deactivate(changeAccessor, useMetaKey); + occurrence.deactivate(changeAccessor, useMetaKey); }); } @@ -262,20 +281,20 @@ class LinkDetector implements editorCommon.IEditorContribution { if (!this.isEnabled(mouseEvent)) { return; } - var occurence = this.getLinkOccurence(mouseEvent.target.position); - if (!occurence) { + var occurrence = this.getLinkOccurrence(mouseEvent.target.position); + if (!occurrence) { return; } - this.openLinkOccurence(occurence, mouseEvent.hasSideBySideModifier); + this.openLinkOccurrence(occurrence, mouseEvent.hasSideBySideModifier); } - public openLinkOccurence(occurence: LinkOccurence, openToSide: boolean): void { + public openLinkOccurrence(occurrence: LinkOccurrence, openToSide: boolean): void { if (!this.openerService) { return; } - const { link } = occurence; + const { link } = occurrence; link.resolve().then(uri => { // open the uri @@ -293,7 +312,7 @@ class LinkDetector implements editorCommon.IEditorContribution { }).done(null, onUnexpectedError); } - public getLinkOccurence(position: Position): LinkOccurence { + public getLinkOccurrence(position: Position): LinkOccurrence { var decorations = this.editor.getModel().getDecorationsInRange({ startLineNumber: position.lineNumber, startColumn: position.column, @@ -303,9 +322,9 @@ class LinkDetector implements editorCommon.IEditorContribution { for (var i = 0; i < decorations.length; i++) { var decoration = decorations[i]; - var currentOccurence = this.currentOccurences[decoration.id]; - if (currentOccurence) { - return currentOccurence; + var currentOccurrence = this.currentOccurrences[decoration.id]; + if (currentOccurrence) { + return currentOccurrence; } } @@ -354,9 +373,9 @@ class OpenLinkAction extends EditorAction { return; } - let link = linkDetector.getLinkOccurence(editor.getPosition()); + let link = linkDetector.getLinkOccurrence(editor.getPosition()); if (link) { - linkDetector.openLinkOccurence(link, false); + linkDetector.openLinkOccurrence(link, false); } } } diff --git a/src/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.ts b/src/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.ts index a9fec25edf6c140eecaa7ed459eb77f0e1cd7a87..d5ee521195b57d4f2b861ee72086ff32d5f6f6fc 100644 --- a/src/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.ts +++ b/src/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.ts @@ -81,7 +81,7 @@ export class ParameterHintsModel extends Disposable { } trigger(delay = ParameterHintsModel.DELAY): void { - if (!this.enabled || !SignatureHelpProviderRegistry.has(this.editor.getModel())) { + if (!SignatureHelpProviderRegistry.has(this.editor.getModel())) { return; } @@ -132,8 +132,11 @@ export class ParameterHintsModel extends Disposable { } this.triggerCharactersListeners.push(this.editor.onDidType((text: string) => { - let lastCharCode = text.charCodeAt(text.length - 1); - if (triggerChars.has(lastCharCode)) { + if (!this.enabled) { + return; + } + + if (triggerChars.has(text.charCodeAt(text.length - 1))) { this.trigger(); } })); @@ -221,7 +224,7 @@ export class ParameterHintsWidget implements IContentWidget, IDisposable { this.overloads = dom.append(wrapper, $('.overloads')); const body = $('.body'); - this.scrollbar = new DomScrollableElement(body, { canUseTranslate3d: false }); + this.scrollbar = new DomScrollableElement(body, {}); this.disposables.push(this.scrollbar); wrapper.appendChild(this.scrollbar.getDomNode()); diff --git a/src/vs/editor/contrib/quickOpen/common/quickOpen.ts b/src/vs/editor/contrib/quickOpen/common/quickOpen.ts index 1fc1f9fd5e6a733f9028f575edfe5fdf25d28a4a..dfe5d8adbc429fab140d90745e3284151194a102 100644 --- a/src/vs/editor/contrib/quickOpen/common/quickOpen.ts +++ b/src/vs/editor/contrib/quickOpen/common/quickOpen.ts @@ -11,14 +11,10 @@ import { TPromise } from 'vs/base/common/winjs.base'; import { Range } from 'vs/editor/common/core/range'; import { IModel } from 'vs/editor/common/editorCommon'; import { CommonEditorRegistry } from 'vs/editor/common/editorCommonExtensions'; -import { SymbolInformation, DocumentSymbolProviderRegistry } from 'vs/editor/common/modes'; +import { SymbolInformation, DocumentSymbolProviderRegistry, IOutline } from 'vs/editor/common/modes'; import { IModelService } from 'vs/editor/common/services/modelService'; import { asWinJsPromise } from 'vs/base/common/async'; -export interface IOutline { - entries: SymbolInformation[]; -} - export function getDocumentSymbols(model: IModel): TPromise { let entries: SymbolInformation[] = []; diff --git a/src/vs/editor/contrib/referenceSearch/browser/referenceSearch.ts b/src/vs/editor/contrib/referenceSearch/browser/referenceSearch.ts index 6249277425f0fdea59acf6e06993a52900562e06..805cdb2bddc4b39b9b0a435e2101ca84f61804ed 100644 --- a/src/vs/editor/contrib/referenceSearch/browser/referenceSearch.ts +++ b/src/vs/editor/contrib/referenceSearch/browser/referenceSearch.ts @@ -5,7 +5,6 @@ 'use strict'; import * as nls from 'vs/nls'; -import { alert } from 'vs/base/browser/ui/aria/aria'; import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; import URI from 'vs/base/common/uri'; import { TPromise } from 'vs/base/common/winjs.base'; @@ -85,11 +84,7 @@ export class ReferenceAction extends EditorAction { } let range = editor.getSelection(); let model = editor.getModel(); - let references = provideReferences(model, range.getStartPosition()).then(references => { - const model = new ReferencesModel(references); - alert(model.getAriaMessage()); - return model; - }); + let references = provideReferences(model, range.getStartPosition()).then(references => new ReferencesModel(references)); controller.toggleWidget(range, references, defaultReferenceSearchOptions); } } diff --git a/src/vs/editor/contrib/referenceSearch/browser/referencesController.ts b/src/vs/editor/contrib/referenceSearch/browser/referencesController.ts index 140a7e3e0e8d452175a608e325772f4c7f3732bd..08233448501556491f94ffdfff3ec95c21e33158 100644 --- a/src/vs/editor/contrib/referenceSearch/browser/referencesController.ts +++ b/src/vs/editor/contrib/referenceSearch/browser/referencesController.ts @@ -25,9 +25,10 @@ import { IPeekViewService } from 'vs/editor/contrib/zoneWidget/browser/peekViewW import { ReferencesModel, OneReference } from './referencesModel'; import { ReferenceWidget, LayoutData } from './referencesWidget'; import { Range } from 'vs/editor/common/core/range'; -import { ITextModelResolverService } from 'vs/editor/common/services/resolverService'; +import { ITextModelService } from 'vs/editor/common/services/resolverService'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { Position } from 'vs/editor/common/core/position'; +import { IEnvironmentService } from "vs/platform/environment/common/environment"; export const ctxReferenceSearchVisible = new RawContextKey('referenceSearchVisible', false); @@ -58,7 +59,7 @@ export class ReferencesController implements editorCommon.IEditorContribution { editor: ICodeEditor, @IContextKeyService contextKeyService: IContextKeyService, @IEditorService private _editorService: IEditorService, - @ITextModelResolverService private _textModelResolverService: ITextModelResolverService, + @ITextModelService private _textModelResolverService: ITextModelService, @ITelemetryService private _telemetryService: ITelemetryService, @IMessageService private _messageService: IMessageService, @IInstantiationService private _instantiationService: IInstantiationService, @@ -66,7 +67,8 @@ export class ReferencesController implements editorCommon.IEditorContribution { @IStorageService private _storageService: IStorageService, @IThemeService private _themeService: IThemeService, @IConfigurationService private _configurationService: IConfigurationService, - @optional(IPeekViewService) private _peekViewService: IPeekViewService + @optional(IPeekViewService) private _peekViewService: IPeekViewService, + @optional(IEnvironmentService) private _environmentService: IEnvironmentService ) { this._editor = editor; this._referenceSearchVisible = ctxReferenceSearchVisible.bindTo(contextKeyService); @@ -107,7 +109,7 @@ export class ReferencesController implements editorCommon.IEditorContribution { })); const storageKey = 'peekViewLayout'; const data = JSON.parse(this._storageService.get(storageKey, undefined, '{}')); - this._widget = new ReferenceWidget(this._editor, data, this._textModelResolverService, this._contextService, this._themeService, this._instantiationService); + this._widget = new ReferenceWidget(this._editor, data, this._textModelResolverService, this._contextService, this._themeService, this._instantiationService, this._environmentService); this._widget.setTitle(nls.localize('labelLoading', "Loading...")); this._widget.show(range); this._disposables.push(this._widget.onDidClose(() => { @@ -189,10 +191,11 @@ export class ReferencesController implements editorCommon.IEditorContribution { }); const onDone = stopwatch(fromPromise(promise)); + const mode = this._editor.getModel().getLanguageIdentifier().language; onDone(duration => this._telemetryService.publicLog('findReferences', { duration, - mode: this._editor.getModel().getLanguageIdentifier().language + mode })); } diff --git a/src/vs/editor/contrib/referenceSearch/browser/referencesModel.ts b/src/vs/editor/contrib/referenceSearch/browser/referencesModel.ts index b0660173eb5c6b740a6a34991dcfab7192bf80bf..06821595584e14a4cdd964f87e326231e46be633 100644 --- a/src/vs/editor/contrib/referenceSearch/browser/referencesModel.ts +++ b/src/vs/editor/contrib/referenceSearch/browser/referencesModel.ts @@ -15,7 +15,7 @@ import { defaultGenerator } from 'vs/base/common/idGenerator'; import { TPromise } from 'vs/base/common/winjs.base'; import { Range, IRange } from 'vs/editor/common/core/range'; import { Location } from 'vs/editor/common/modes'; -import { ITextModelResolverService, ITextEditorModel } from 'vs/editor/common/services/resolverService'; +import { ITextModelService, ITextEditorModel } from 'vs/editor/common/services/resolverService'; import { Position } from 'vs/editor/common/core/position'; export class OneReference { @@ -66,7 +66,7 @@ export class OneReference { public getAriaMessage(): string { return localize( 'aria.oneReference', "symbol in {0} on line {1} at column {2}", - this.uri.fsPath, this.range.startLineNumber, this.range.startColumn + basename(this.uri.fsPath), this.range.startLineNumber, this.range.startColumn ); } } @@ -154,13 +154,13 @@ export class FileReferences implements IDisposable { getAriaMessage(): string { const len = this.children.length; if (len === 1) { - return localize('aria.fileReferences.1', "1 symbol in {0}", this.uri.fsPath); + return localize('aria.fileReferences.1', "1 symbol in {0}, full path {1}", basename(this.uri.fsPath), this.uri.fsPath); } else { - return localize('aria.fileReferences.N', "{0} symbols in {1}", len, this.uri.fsPath); + return localize('aria.fileReferences.N', "{0} symbols in {1}, full path {2}", len, basename(this.uri.fsPath), this.uri.fsPath); } } - public resolve(textModelResolverService: ITextModelResolverService): TPromise { + public resolve(textModelResolverService: ITextModelService): TPromise { if (this._resolved) { return TPromise.as(this); diff --git a/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.css b/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.css index 922f4807e48ee2f5ba4ac50d2f9b3f597304cfdd..5b316141553977399850d051589f9e96fc25f984 100644 --- a/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.css +++ b/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.css @@ -37,17 +37,21 @@ } .monaco-editor .reference-zone-widget .ref-tree .reference-file { - position: relative; - line-height: 22px; + display: flex; + justify-content: space-between; + align-items: center; } .monaco-editor .reference-zone-widget .monaco-count-badge { - margin-right: 12px; + margin-right: .5em; + height: 15px; + padding: 0 .5em .5em .5em } /* High Contrast Theming */ .monaco-editor.hc-black .reference-zone-widget .ref-tree .reference-file { - line-height: 20px; font-weight: bold; -} \ No newline at end of file + display: flex; + justify-content: space-between; +} diff --git a/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.ts b/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.ts index a7175ad5a1f2c01f865abba3fd2b5ceaa8ab338e..d4b29664c7df7b5384f75f54877c06a2a740dc00 100644 --- a/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.ts +++ b/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.ts @@ -6,11 +6,10 @@ import 'vs/css!./referencesWidget'; import * as nls from 'vs/nls'; -import { alert } from 'vs/base/browser/ui/aria/aria'; import { onUnexpectedError } from 'vs/base/common/errors'; import { getPathLabel } from 'vs/base/common/labels'; import Event, { Emitter } from 'vs/base/common/event'; -import { IDisposable, dispose, Disposables, IReference } from 'vs/base/common/lifecycle'; +import { IDisposable, dispose, IReference } from 'vs/base/common/lifecycle'; import { Schemas } from 'vs/base/common/network'; import * as strings from 'vs/base/common/strings'; import { TPromise } from 'vs/base/common/winjs.base'; @@ -23,9 +22,8 @@ import { IMouseEvent } from 'vs/base/browser/mouseEvent'; import { GestureEvent } from 'vs/base/browser/touch'; import { CountBadge } from 'vs/base/browser/ui/countBadge/countBadge'; import { FileLabel } from 'vs/base/browser/ui/iconLabel/iconLabel'; -import { LeftRightWidget } from 'vs/base/browser/ui/leftRightWidget/leftRightWidget'; import * as tree from 'vs/base/parts/tree/browser/tree'; -import { DefaultController, LegacyRenderer } from 'vs/base/parts/tree/browser/treeDefaults'; +import { DefaultController } from 'vs/base/parts/tree/browser/treeDefaults'; import { Tree } from 'vs/base/parts/tree/browser/treeImpl'; import { IInstantiationService, optional } from 'vs/platform/instantiation/common/instantiation'; import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; @@ -37,14 +35,15 @@ import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; import { EmbeddedCodeEditorWidget } from 'vs/editor/browser/widget/embeddedCodeEditorWidget'; import { PeekViewWidget, IPeekViewService } from 'vs/editor/contrib/zoneWidget/browser/peekViewWidget'; import { FileReferences, OneReference, ReferencesModel } from './referencesModel'; -import { ITextModelResolverService, ITextEditorModel } from 'vs/editor/common/services/resolverService'; +import { ITextModelService, ITextEditorModel } from 'vs/editor/common/services/resolverService'; import { registerColor, activeContrastBorder, contrastBorder } from 'vs/platform/theme/common/colorRegistry'; import { registerThemingParticipant, ITheme, IThemeService } from 'vs/platform/theme/common/themeService'; import { attachListStyler, attachBadgeStyler } from 'vs/platform/theme/common/styler'; import { IModelDecorationsChangedEvent } from 'vs/editor/common/model/textModelEvents'; import { IEditorOptions } from 'vs/editor/common/config/editorOptions'; -import { IEnvironmentService } from "vs/platform/environment/common/environment"; -import { ModelDecorationOptions } from "vs/editor/common/model/textModelWithDecorations"; +import { IEnvironmentService } from 'vs/platform/environment/common/environment'; +import { ModelDecorationOptions } from 'vs/editor/common/model/textModelWithDecorations'; +import URI from 'vs/base/common/uri'; class DecorationsManager implements IDisposable { @@ -166,7 +165,7 @@ class DecorationsManager implements IDisposable { class DataSource implements tree.IDataSource { constructor( - @ITextModelResolverService private _textModelResolverService: ITextModelResolverService + @ITextModelService private _textModelResolverService: ITextModelService ) { // } @@ -344,81 +343,120 @@ class Controller extends DefaultController { } } -class Renderer extends LegacyRenderer { - private _contextService: IWorkspaceContextService; - private _themeService: IThemeService; - private _environmentService: IEnvironmentService; +class FileReferencesTemplate { + + readonly file: FileLabel; + readonly badge: CountBadge; + readonly dispose: () => void; constructor( - @IWorkspaceContextService contextService: IWorkspaceContextService, + container: HTMLElement, + @IWorkspaceContextService private _contextService: IWorkspaceContextService, + @optional(IEnvironmentService) private _environmentService: IEnvironmentService, @IThemeService themeService: IThemeService, - @optional(IEnvironmentService) environmentService: IEnvironmentService ) { - super(); - - this._contextService = contextService; - this._themeService = themeService; - this._environmentService = environmentService; - } - - public getHeight(tree: tree.ITree, element: any): number { - return 22; + const parent = document.createElement('div'); + dom.addClass(parent, 'reference-file'); + container.appendChild(parent); + + this.file = new FileLabel(parent, URI.parse('no:file'), this._contextService, this._environmentService); + this.badge = new CountBadge(parent); + const styler = attachBadgeStyler(this.badge, themeService); + this.dispose = () => styler.dispose(); + } + + set(element: FileReferences) { + this.file.setFile(element.uri, this._contextService, this._environmentService); + const len = element.children.length; + this.badge.setCount(len); + if (element.failure) { + this.badge.setTitleFormat(nls.localize('referencesFailre', "Failed to resolve file.")); + } else if (len > 1) { + this.badge.setTitleFormat(nls.localize('referencesCount', "{0} references", len)); + } else { + this.badge.setTitleFormat(nls.localize('referenceCount', "{0} reference", len)); + } } +} - protected render(tree: tree.ITree, element: FileReferences | OneReference, container: HTMLElement): tree.IElementCallback { - - const toDispose: IDisposable[] = []; - dom.clearNode(container); - - if (element instanceof FileReferences) { - const fileReferencesContainer = $('.reference-file'); +class OneReferenceTemplate { - /* tslint:disable:no-unused-expression */ - new LeftRightWidget(fileReferencesContainer, (left: HTMLElement) => { + readonly before: HTMLSpanElement; + readonly inside: HTMLSpanElement; + readonly after: HTMLSpanElement; - const label = new FileLabel(left, element.uri, this._contextService, this._environmentService); - toDispose.push(label); - return null; + constructor(container: HTMLElement) { + const parent = document.createElement('div'); + this.before = document.createElement('span'); + this.inside = document.createElement('span'); + this.after = document.createElement('span'); + dom.addClass(this.inside, 'referenceMatch'); + dom.addClass(parent, 'reference'); + parent.appendChild(this.before); + parent.appendChild(this.inside); + parent.appendChild(this.after); + container.appendChild(parent); + } - }, (right: HTMLElement) => { + set(element: OneReference): void { + const { before, inside, after } = element.parent.preview.preview(element.range); + this.before.innerHTML = strings.escape(before); + this.inside.innerHTML = strings.escape(inside); + this.after.innerHTML = strings.escape(after); + } +} - const len = element.children.length; - const badge = new CountBadge(right, { count: len }); - toDispose.push(attachBadgeStyler(badge, this._themeService)); +class Renderer implements tree.IRenderer { - if (element.failure) { - badge.setTitleFormat(nls.localize('referencesFailre', "Failed to resolve file.")); - } else if (len > 1) { - badge.setTitleFormat(nls.localize('referencesCount', "{0} references", len)); - } else { - badge.setTitleFormat(nls.localize('referenceCount', "{0} reference", len)); - } + private static _ids = { + FileReferences: 'FileReferences', + OneReference: 'OneReference' + }; - return null; - }); - /* tslint:enable:no-unused-expression */ + constructor( + @IWorkspaceContextService private _contextService: IWorkspaceContextService, + @IThemeService private _themeService: IThemeService, + @optional(IEnvironmentService) private _environmentService: IEnvironmentService, + ) { + // + } - fileReferencesContainer.appendTo(container); + getHeight(tree: tree.ITree, element: FileReferences | OneReference): number { + return 22; + } + getTemplateId(tree: tree.ITree, element: FileReferences | OneReference): string { + if (element instanceof FileReferences) { + return Renderer._ids.FileReferences; } else if (element instanceof OneReference) { + return Renderer._ids.OneReference; + } + throw element; + } - const preview = element.parent.preview.preview(element.range); - - if (!preview) { - return undefined; - } + renderTemplate(tree: tree.ITree, templateId: string, container: HTMLElement) { + if (templateId === Renderer._ids.FileReferences) { + return new FileReferencesTemplate(container, this._contextService, this._environmentService, this._themeService); + } else if (templateId === Renderer._ids.OneReference) { + return new OneReferenceTemplate(container); + } + throw templateId; + } - $('.reference').innerHtml( - strings.format( - '{0}{1}{2}', - strings.escape(preview.before), - strings.escape(preview.inside), - strings.escape(preview.after))).appendTo(container); + renderElement(tree: tree.ITree, element: FileReferences | OneReference, templateId: string, templateData: any): void { + if (element instanceof FileReferences) { + (templateData).set(element); + } else if (element instanceof OneReference) { + (templateData).set(element); + } else { + throw templateId; } + } - return () => { - dispose(toDispose); - }; + disposeTemplate(tree: tree.ITree, templateId: string, templateData: FileReferencesTemplate | OneReferenceTemplate): void { + if (templateData instanceof FileReferencesTemplate) { + templateData.dispose(); + } } } @@ -437,7 +475,7 @@ class AriaProvider implements tree.IAccessibilityProvider { class VSash { - private _disposables = new Disposables(); + private _disposables: IDisposable[] = []; private _sash: Sash; private _ratio: number; private _height: number; @@ -454,11 +492,11 @@ class VSash { // compute the current widget clientX postion since // the sash works with clientX when dragging let clientX: number; - this._disposables.add(this._sash.addListener('start', (e: ISashEvent) => { + this._disposables.push(this._sash.addListener('start', (e: ISashEvent) => { clientX = e.startX - (this._width * this.ratio); })); - this._disposables.add(this._sash.addListener('change', (e: ISashEvent) => { + this._disposables.push(this._sash.addListener('change', (e: ISashEvent) => { // compute the new position of the sash and from that // compute the new ratio that we are using let newLeft = e.currentX - clientX; @@ -473,7 +511,7 @@ class VSash { dispose() { this._sash.dispose(); this._onDidChangePercentages.dispose(); - this._disposables.dispose(); + dispose(this._disposables); } get onDidChangePercentages() { @@ -536,12 +574,13 @@ export class ReferenceWidget extends PeekViewWidget { constructor( editor: ICodeEditor, public layoutData: LayoutData, - private _textModelResolverService: ITextModelResolverService, + private _textModelResolverService: ITextModelService, private _contextService: IWorkspaceContextService, private _themeService: IThemeService, - private _instantiationService: IInstantiationService + private _instantiationService: IInstantiationService, + private _environmentService: IEnvironmentService ) { - super(editor, { showFrame: false, showArrow: true, isResizeable: true }); + super(editor, { showFrame: false, showArrow: true, isResizeable: true, isAccessible: true }); this._applyTheme(_themeService.getTheme()); this._callOnDispose.push(_themeService.onThemeChange(this._applyTheme.bind(this))); @@ -642,8 +681,7 @@ export class ReferenceWidget extends PeekViewWidget { dataSource: this._instantiationService.createInstance(DataSource), renderer: this._instantiationService.createInstance(Renderer), controller: new Controller(), - // TODO@{Joh,Ben} make this work with the embedded tree - // accessibilityProvider: new AriaProvider() + accessibilityProvider: new AriaProvider() }; var options = { @@ -721,11 +759,8 @@ export class ReferenceWidget extends PeekViewWidget { this._revealReference(element); this._onDidSelectReference.fire({ element, kind: 'show', source: 'tree' }); } - if (element instanceof OneReference || element instanceof FileReferences) { - const msg = element.getAriaMessage(); - alert(msg); - } })); + this._disposeOnNewModel.push(this._tree.addListener(Controller.Events.SELECTED, (element: any) => { if (element instanceof OneReference) { this._onDidSelectReference.fire({ element, kind: 'goto', source: 'tree' }); @@ -777,7 +812,7 @@ export class ReferenceWidget extends PeekViewWidget { // Update widget header if (reference.uri.scheme !== Schemas.inMemory) { - this.setTitle(reference.name, getPathLabel(reference.directory, this._contextService)); + this.setTitle(reference.name, getPathLabel(reference.directory, this._contextService, this._environmentService)); } else { this.setTitle(nls.localize('peekView.alternateTitle', "References")); } diff --git a/src/vs/editor/contrib/rename/browser/rename.ts b/src/vs/editor/contrib/rename/browser/rename.ts index 582e3a2ab4ea5000b9d5b6ffff294e38fd23b5ab..92284675cbeb0bbf9432c3d7a307f08c44b315aa 100644 --- a/src/vs/editor/contrib/rename/browser/rename.ts +++ b/src/vs/editor/contrib/rename/browser/rename.ts @@ -21,7 +21,7 @@ import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; import { BulkEdit, createBulkEdit } from 'vs/editor/common/services/bulkEdit'; import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; import RenameInputField from './renameInputField'; -import { ITextModelResolverService } from 'vs/editor/common/services/resolverService'; +import { ITextModelService } from 'vs/editor/common/services/resolverService'; import { optional } from 'vs/platform/instantiation/common/instantiation'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { sequence, asWinJsPromise } from 'vs/base/common/async'; @@ -38,7 +38,7 @@ export function rename(model: IReadOnlyModel, position: Position, newName: strin let hasResult = false; const factory = supports.map(support => { - return () => { + return (): TPromise => { if (!hasResult) { return asWinJsPromise((token) => { return support.provideRenameEdits(model, position, newName, token); @@ -99,7 +99,7 @@ class RenameController implements IEditorContribution { constructor( private editor: ICodeEditor, @IMessageService private _messageService: IMessageService, - @ITextModelResolverService private _textModelResolverService: ITextModelResolverService, + @ITextModelService private _textModelResolverService: ITextModelService, @IProgressService private _progressService: IProgressService, @IContextKeyService contextKeyService: IContextKeyService, @IThemeService themeService: IThemeService, diff --git a/src/vs/editor/contrib/snippet/browser/snippetController2.ts b/src/vs/editor/contrib/snippet/browser/snippetController2.ts index 3983e58599e0fc981105eafe8effa2f1a3eff42a..86c6c543eecae4149d91482b67c4483eaf597810 100644 --- a/src/vs/editor/contrib/snippet/browser/snippetController2.ts +++ b/src/vs/editor/contrib/snippet/browser/snippetController2.ts @@ -28,8 +28,9 @@ export class SnippetController2 { private readonly _hasNextTabstop: IContextKey; private readonly _hasPrevTabstop: IContextKey; - private _snippet: SnippetSession; + private _session: SnippetSession; private _snippetListener: IDisposable[] = []; + private _modelVersionId: number; constructor( private readonly _editor: ICommonCodeEditor, @@ -44,7 +45,7 @@ export class SnippetController2 { this._inSnippet.reset(); this._hasPrevTabstop.reset(); this._hasNextTabstop.reset(); - dispose(this._snippet); + dispose(this._session); } getId(): string { @@ -56,43 +57,59 @@ export class SnippetController2 { overwriteBefore: number = 0, overwriteAfter: number = 0, undoStopBefore: boolean = true, undoStopAfter: boolean = true ): void { + + // don't listen while inserting the snippet + // as that is the inflight state causing cancelation + this._snippetListener = dispose(this._snippetListener); + if (undoStopBefore) { this._editor.getModel().pushStackElement(); } - if (!this._snippet) { - // create a new session - this._snippet = new SnippetSession(this._editor); + + if (!this._session) { + this._modelVersionId = this._editor.getModel().getAlternativeVersionId(); + this._session = new SnippetSession(this._editor, template, overwriteBefore, overwriteAfter); + this._session.insert(); + } else { + this._session.merge(template, overwriteBefore, overwriteAfter); } - this._snippet.insert(template, overwriteBefore, overwriteAfter); + + if (undoStopAfter) { + this._editor.getModel().pushStackElement(); + } + this._snippetListener = [ this._editor.onDidChangeModel(() => this.cancel()), this._editor.onDidChangeCursorSelection(() => this._updateState()) ]; - if (undoStopAfter) { - this._editor.getModel().pushStackElement(); - } this._updateState(); } private _updateState(): void { - if (!this._snippet) { + if (!this._session) { // canceled in the meanwhile return; } - if (!this._snippet.hasPlaceholder) { + if (this._modelVersionId === this._editor.getModel().getAlternativeVersionId()) { + // undo until the 'before' state happened + // and makes use cancel snippet mode + return this.cancel(); + } + + if (!this._session.hasPlaceholder) { // don't listen for selection changes and don't // update context keys when the snippet is plain text return this.cancel(); } - if (this._snippet.isAtFinalPlaceholder || !this._snippet.isSelectionWithPlaceholders()) { + if (this._session.isAtLastPlaceholder || !this._session.isSelectionWithinPlaceholders()) { return this.cancel(); } this._inSnippet.set(true); - this._hasPrevTabstop.set(!this._snippet.isAtFirstPlaceholder); - this._hasNextTabstop.set(!this._snippet.isAtFinalPlaceholder); + this._hasPrevTabstop.set(!this._session.isAtFirstPlaceholder); + this._hasNextTabstop.set(!this._session.isAtLastPlaceholder); } finish(): void { @@ -102,28 +119,23 @@ export class SnippetController2 { } cancel(): void { - if (this._snippet) { - this._inSnippet.reset(); - this._hasPrevTabstop.reset(); - this._hasNextTabstop.reset(); - dispose(this._snippetListener); - dispose(this._snippet); - this._snippet = undefined; - } + this._inSnippet.reset(); + this._hasPrevTabstop.reset(); + this._hasNextTabstop.reset(); + dispose(this._snippetListener); + dispose(this._session); + this._session = undefined; + this._modelVersionId = -1; } prev(): void { - if (this._snippet) { - this._snippet.prev(); - this._updateState(); - } + this._session.prev(); + this._updateState(); } next(): void { - if (this._snippet) { - this._snippet.next(); - this._updateState(); - } + this._session.next(); + this._updateState(); } } diff --git a/src/vs/editor/contrib/snippet/browser/snippetParser.ts b/src/vs/editor/contrib/snippet/browser/snippetParser.ts index 0506b2b187b571943411ead2b1a40c851aec257e..c97a9e061db107049c6482711dad9b7b01247dd1 100644 --- a/src/vs/editor/contrib/snippet/browser/snippetParser.ts +++ b/src/vs/editor/contrib/snippet/browser/snippetParser.ts @@ -134,8 +134,19 @@ export abstract class Marker { parent: Marker; - protected _adopt(child: Marker): void { - child.parent = this; + private _children: Marker[] = []; + + set children(marker: Marker[]) { + this._children = []; + for (const m of marker) { + m.parent = this; + this._children.push(m); + } + // Object.freeze(this._children); + } + + get children(): Marker[] { + return this._children; } toString() { @@ -176,15 +187,15 @@ export class Placeholder extends Marker { } } - constructor(public index: string = '', public defaultValue: Marker[]) { + constructor(public index: number, children: Marker[]) { super(); - defaultValue.forEach(this._adopt, this); + this.children = children; } get isFinalTabstop() { - return this.index === '0'; + return this.index === 0; } toString() { - return Marker.toString(this.defaultValue); + return Marker.toString(this.children); } } @@ -192,9 +203,9 @@ export class Variable extends Marker { resolvedValue: string; - constructor(public name: string = '', public defaultValue: Marker[]) { + constructor(public name: string = '', children: Marker[]) { super(); - defaultValue.forEach(this._adopt, this); + this.children = children; } get isDefined(): boolean { return this.resolvedValue !== undefined; @@ -207,7 +218,7 @@ export class Variable extends Marker { } } toString() { - return this.isDefined ? this.resolvedValue : Marker.toString(this.defaultValue); + return this.isDefined ? this.resolvedValue : Marker.toString(this.children); } } export function walk(marker: Marker[], visitor: (marker: Marker) => boolean): void { @@ -218,37 +229,37 @@ export function walk(marker: Marker[], visitor: (marker: Marker) => boolean): vo if (!recurse) { break; } - if (marker instanceof Placeholder || marker instanceof Variable) { - stack.unshift(...marker.defaultValue); - } + stack.unshift(...marker.children); } } -export class TextmateSnippet { +export class TextmateSnippet extends Marker { - readonly marker: Marker[]; - readonly placeholders: Placeholder[]; + private _placeholders: Placeholder[]; constructor(marker: Marker[]) { - this.marker = marker; - this.placeholders = []; - - // fill in placeholders - walk(marker, candidate => { - if (candidate instanceof Placeholder) { - this.placeholders.push(candidate); - } - return true; - }); + super(); + this.children = marker; + } - Object.freeze(this.marker); - Object.freeze(this.placeholders); + get placeholders(): Placeholder[] { + if (!this._placeholders) { + // fill in placeholders + this._placeholders = []; + walk(this.children, candidate => { + if (candidate instanceof Placeholder) { + this.placeholders.push(candidate); + } + return true; + }); + } + return this._placeholders; } offset(marker: Marker): number { let pos = 0; let found = false; - walk(this.marker, candidate => { + walk(this.children, candidate => { if (candidate === marker) { found = true; return false; @@ -263,7 +274,7 @@ export class TextmateSnippet { return pos; } - len(marker: Marker): number { + fullLen(marker: Marker): number { let ret = 0; walk([marker], marker => { ret += marker.len(); @@ -285,22 +296,31 @@ export class TextmateSnippet { } get text() { - return Marker.toString(this.marker); + return Marker.toString(this.children); } resolveVariables(resolver: { resolve(name: string): string }): this { - walk(this.marker, candidate => { + walk(this.children, candidate => { if (candidate instanceof Variable) { candidate.resolvedValue = resolver.resolve(candidate.name); if (candidate.isDefined) { // remove default value from resolved variable - candidate.defaultValue.length = 0; + candidate.children = []; } } return true; }); return this; } + + replace(marker: Marker, others: Marker[]): void { + const { parent } = marker; + const idx = parent.children.indexOf(marker); + const newChildren = parent.children.slice(0); + newChildren.splice(idx, 1, ...others); + parent.children = newChildren; + this._placeholders = undefined; + } } export class SnippetParser { @@ -309,27 +329,21 @@ export class SnippetParser { return value.replace(/\$|}|\\/g, '\\$&'); } - static parse(template: string): TextmateSnippet { - const marker = new SnippetParser(true, false).parse(template, true); + static parse(template: string, enforceFinalTabstop?: boolean): TextmateSnippet { + const marker = new SnippetParser().parse(template, true, enforceFinalTabstop); return new TextmateSnippet(marker); } - private _enableTextMate: boolean; - private _enableInternal: boolean; private _scanner = new Scanner(); private _token: Token; private _prevToken: Token; - constructor(enableTextMate: boolean = true, enableInternal: boolean = true) { - this._enableTextMate = enableTextMate; - this._enableInternal = enableInternal; - } text(value: string): string { return Marker.toString(this.parse(value)); } - parse(value: string, insertFinalTabstop?: boolean): Marker[] { + parse(value: string, insertFinalTabstop?: boolean, enforceFinalTabstop?: boolean): Marker[] { const marker: Marker[] = []; this._scanner.text(value); @@ -340,7 +354,7 @@ export class SnippetParser { // * fill in default for empty placeHolders // * compact sibling Text markers - function walk(marker: Marker[], placeholderDefaultValues: Map) { + function walk(marker: Marker[], placeholderDefaultValues: Map) { for (let i = 0; i < marker.length; i++) { const thisMarker = marker[i]; @@ -349,17 +363,18 @@ export class SnippetParser { // fill in default values for repeated placeholders // like `${1:foo}and$1` becomes ${1:foo}and${1:foo} if (!placeholderDefaultValues.has(thisMarker.index)) { - placeholderDefaultValues.set(thisMarker.index, thisMarker.defaultValue); - } else if (thisMarker.defaultValue.length === 0) { - thisMarker.defaultValue = placeholderDefaultValues.get(thisMarker.index).slice(0); - } + placeholderDefaultValues.set(thisMarker.index, thisMarker.children); + walk(thisMarker.children, placeholderDefaultValues); - if (thisMarker.defaultValue.length > 0) { - walk(thisMarker.defaultValue, placeholderDefaultValues); + } else if (thisMarker.children.length === 0) { + // copy children from first placeholder definition, no need to + // recurse on them because they have been visited already + thisMarker.children = placeholderDefaultValues.get(thisMarker.index).slice(0); } + } else if (thisMarker instanceof Variable) { - walk(thisMarker.defaultValue, placeholderDefaultValues); + walk(thisMarker.children, placeholderDefaultValues); } else if (i > 0 && thisMarker instanceof Text && marker[i - 1] instanceof Text) { (marker[i - 1]).string += (marker[i]).string; @@ -369,17 +384,16 @@ export class SnippetParser { } } - const placeholderDefaultValues = new Map(); + const placeholderDefaultValues = new Map(); walk(marker, placeholderDefaultValues); if ( - insertFinalTabstop - && placeholderDefaultValues.size > 0 - && !placeholderDefaultValues.has('0') + !placeholderDefaultValues.has(0) && // there is no final tabstop + (insertFinalTabstop && placeholderDefaultValues.size > 0 || enforceFinalTabstop) ) { // the snippet uses placeholders but has no // final tabstop defined -> insert at the end - marker.push(new Placeholder('0', [])); + marker.push(new Placeholder(0, [])); } return marker; @@ -394,18 +408,10 @@ export class SnippetParser { return false; } - private _return(token: Token): void { - this._prevToken = undefined; - this._token = token; - this._scanner.pos = token.pos + token.len; - } - private _parseAny(marker: Marker[]): boolean { if (this._parseEscaped(marker)) { return true; - } else if (this._enableInternal && this._parseInternal(marker)) { - return true; - } else if (this._enableTextMate && this._parseTM(marker)) { + } else if (this._parseTM(marker)) { return true; } return false; @@ -426,7 +432,7 @@ export class SnippetParser { if (this._accept(TokenType.VariableName) || this._accept(TokenType.Int)) { // $FOO, $123 const idOrName = this._scanner.tokenText(this._prevToken); - marker.push(/^\d+$/.test(idOrName) ? new Placeholder(idOrName, []) : new Variable(idOrName, [])); + marker.push(/^\d+$/.test(idOrName) ? new Placeholder(Number(idOrName), []) : new Variable(idOrName, [])); return true; } else if (this._accept(TokenType.CurlyOpen)) { @@ -444,7 +450,7 @@ export class SnippetParser { if (this._accept(TokenType.CurlyClose)) { const idOrName = Marker.toString(name); - marker.push(/^\d+$/.test(idOrName) ? new Placeholder(idOrName, children) : new Variable(idOrName, children)); + marker.push(/^\d+$/.test(idOrName) ? new Placeholder(Number(idOrName), children) : new Variable(idOrName, children)); return true; } @@ -470,69 +476,9 @@ export class SnippetParser { return false; } - private _parseInternal(marker: Marker[]): boolean { - if (this._accept(TokenType.CurlyOpen)) { - - if (!this._accept(TokenType.CurlyOpen)) { - this._return(this._prevToken); - return false; - } - - // {{name:children}}, {{name}}, {{name:}} - let name: Marker[] = []; - let children: Marker[] = []; - let target = name; - - while (true) { - - if (this._accept(TokenType.Colon)) { - target = children; - continue; - } - - if (this._accept(TokenType.CurlyClose)) { - - if (!this._accept(TokenType.CurlyClose)) { - this._return(this._prevToken); - continue; - } - - if (children !== target) { - // we have not seen the colon which - // means use the ident also as - // default value - children = name; - } - - marker.push(new Placeholder(Marker.toString(name), children)); - return true; - } - - if (this._parseAny(target) || this._parseText(target)) { - continue; - } - - // fallback - if (children.length > 0) { - marker.push(new Text('{{' + Marker.toString(name) + ':')); - marker.push(...children); - } else { - marker.push(new Text('{{')); - marker.push(...name); - } - return true; - } - } - return false; - } - private _parseEscaped(marker: Marker[]): boolean { if (this._accept(TokenType.Backslash)) { - if (// Internal style - (this._enableInternal && (this._accept(TokenType.CurlyOpen) || this._accept(TokenType.CurlyClose) || this._accept(TokenType.Backslash))) - // TextMate style - || (this._enableTextMate && (this._accept(TokenType.Dollar) || this._accept(TokenType.CurlyClose) || this._accept(TokenType.Backslash))) - ) { + if (this._accept(TokenType.Dollar) || this._accept(TokenType.CurlyClose) || this._accept(TokenType.Backslash)) { // just consume them } marker.push(new Text(this._scanner.tokenText(this._prevToken))); diff --git a/src/vs/editor/contrib/snippet/browser/snippetSession.css b/src/vs/editor/contrib/snippet/browser/snippetSession.css index 6f839f10d22aecdeaf72ae8570626a583ac6b4fe..b6c7d72adda32abc2dc4ee1b2225d91df471f9ff 100644 --- a/src/vs/editor/contrib/snippet/browser/snippetSession.css +++ b/src/vs/editor/contrib/snippet/browser/snippetSession.css @@ -3,10 +3,6 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -.monaco-editor.vs .new-snippet { background-color: rgba(10, 50, 150, 0.1); } -.monaco-editor.vs-dark .new-snippet { background-color: rgba(100, 105, 110, 0.1); } -.monaco-editor.hc-black .new-snippet { background-color: rgba(100, 105, 110, 0.1); } - .monaco-editor.vs .snippet-placeholder { background-color: rgba(10, 50, 100, 0.1); } .monaco-editor.vs-dark .snippet-placeholder { background-color: rgba(124, 124, 124, 0.1); } .monaco-editor.hc-black .snippet-placeholder { background-color: rgba(124, 124, 124, 0.1); } diff --git a/src/vs/editor/contrib/snippet/browser/snippetSession.ts b/src/vs/editor/contrib/snippet/browser/snippetSession.ts index b5938e3c7e49a073f61e9b31f877e18ca7a75856..5f9a49a97e659d0a4051875a12e689572ee1e9f5 100644 --- a/src/vs/editor/contrib/snippet/browser/snippetSession.ts +++ b/src/vs/editor/contrib/snippet/browser/snippetSession.ts @@ -16,7 +16,7 @@ import { IPosition } from 'vs/editor/common/core/position'; import { groupBy } from 'vs/base/common/arrays'; import { dispose } from 'vs/base/common/lifecycle'; import { EditorSnippetVariableResolver } from "./snippetVariables"; -import { ModelDecorationOptions } from "vs/editor/common/model/textModelWithDecorations"; +import { ModelDecorationOptions } from 'vs/editor/common/model/textModelWithDecorations'; export class OneSnippet { @@ -65,7 +65,7 @@ export class OneSnippet { // create a decoration for each placeholder for (const placeholder of this._snippet.placeholders) { const placeholderOffset = this._snippet.offset(placeholder); - const placeholderLen = this._snippet.len(placeholder); + const placeholderLen = this._snippet.fullLen(placeholder); const range = Range.fromPositions( model.getPositionAt(this._offset + placeholderOffset), model.getPositionAt(this._offset + placeholderOffset + placeholderLen) @@ -77,14 +77,14 @@ export class OneSnippet { }); } - move(fwd: boolean): Selection[] { + move(fwd: boolean | undefined): Selection[] { this._initDecorations(); - if (fwd && this._placeholderGroupsIdx < this._placeholderGroups.length - 1) { + if (fwd === true && this._placeholderGroupsIdx < this._placeholderGroups.length - 1) { this._placeholderGroupsIdx += 1; - } else if (!fwd && this._placeholderGroupsIdx > 0) { + } else if (fwd === false && this._placeholderGroupsIdx > 0) { this._placeholderGroupsIdx -= 1; } else { @@ -130,15 +130,11 @@ export class OneSnippet { } get isAtFirstPlaceholder() { - return this._placeholderGroupsIdx === 0; + return this._placeholderGroupsIdx <= 0 || this._placeholderGroups.length === 0; } - get isAtFinalPlaceholder() { - if (this._placeholderGroupsIdx < 0) { - return false; - } else { - return this._placeholderGroups[this._placeholderGroupsIdx][0].isFinalTabstop; - } + get isAtLastPlaceholder() { + return this._placeholderGroupsIdx === this._placeholderGroups.length - 1; } get hasPlaceholder() { @@ -157,6 +153,57 @@ export class OneSnippet { }); return ret; } + + merge(others: OneSnippet[]): void { + + const model = this._editor.getModel(); + + this._editor.changeDecorations(accessor => { + + // For each active placeholder take one snippet and merge it + // in that the placeholder (can be many for `$1foo$1foo`). Because + // everything is sorted by editor selection we can simply remove + // elements from the beginning of the array + for (const placeholder of this._placeholderGroups[this._placeholderGroupsIdx]) { + const nested = others.shift(); + console.assert(!nested._placeholderDecorations); + + // Massage placeholder-indicies of the nested snippet to be + // sorted right after the insertion point. This ensures we move + // through the placeholders in the correct order + for (const nestedPlaceholder of nested._snippet.placeholders) { + if (nestedPlaceholder.isFinalTabstop) { + nestedPlaceholder.index = placeholder.index + (nested._snippet.placeholders.length / 10); + } else { + nestedPlaceholder.index = placeholder.index + (nestedPlaceholder.index / 10); + } + } + this._snippet.replace(placeholder, nested._snippet.children); + + // Remove the placeholder at which position are inserting + // the snippet and also remove its decoration. + const id = this._placeholderDecorations.get(placeholder); + accessor.removeDecoration(id); + this._placeholderDecorations.delete(placeholder); + + // For each *new* placeholder we create decoration to monitor + // how and if it grows/shrinks. + for (const placeholder of nested._snippet.placeholders) { + const placeholderOffset = nested._snippet.offset(placeholder); + const placeholderLen = nested._snippet.fullLen(placeholder); + const range = Range.fromPositions( + model.getPositionAt(nested._offset + placeholderOffset), + model.getPositionAt(nested._offset + placeholderOffset + placeholderLen) + ); + const handle = accessor.addDecoration(range, OneSnippet._decor.inactive); + this._placeholderDecorations.set(placeholder, handle); + } + } + + // Last, re-create the placeholder groups by sorting placeholders by their index. + this._placeholderGroups = groupBy(this._snippet.placeholders, Placeholder.compareByIndex); + }); + } } export class SnippetSession { @@ -196,12 +243,13 @@ export class SnippetSession { return selection; } - static makeInsertEditsAndSnippets(editor: ICommonCodeEditor, template: string, overwriteBefore: number = 0, overwriteAfter: number = 0): { edits: IIdentifiedSingleEditOperation[], snippets: OneSnippet[] } { + static createEditsAndSnippets(editor: ICommonCodeEditor, template: string, overwriteBefore: number, overwriteAfter: number, enforceFinalTabstop: boolean): { edits: IIdentifiedSingleEditOperation[], snippets: OneSnippet[] } { + + const model = editor.getModel(); + const edits: IIdentifiedSingleEditOperation[] = []; + const snippets: OneSnippet[] = []; let delta = 0; - let edits: IIdentifiedSingleEditOperation[] = []; - let snippets: OneSnippet[] = []; - let model = editor.getModel(); // know what text the overwrite[Before|After] extensions // of the primary curser have selected because only when @@ -240,14 +288,15 @@ export class SnippetSession { const start = snippetSelection.getStartPosition(); const adjustedTemplate = SnippetSession.adjustWhitespace(model, start, template); - const snippet = SnippetParser.parse(adjustedTemplate).resolveVariables(new EditorSnippetVariableResolver(model, snippetSelection)); + const snippet = SnippetParser.parse(adjustedTemplate, enforceFinalTabstop).resolveVariables(new EditorSnippetVariableResolver(model, selection)); + const offset = model.getOffsetAt(start) + delta; delta += snippet.text.length - model.getValueLengthInRange(snippetSelection); // store snippets with the index of their originating selection. // that ensures the primiary cursor stays primary despite not being // the one with lowest start position - edits[idx] = EditOperation.replaceMove(snippetSelection, snippet.text); + edits[idx] = EditOperation.replace(snippetSelection, snippet.text); snippets[idx] = new OneSnippet(editor, snippet, offset); } @@ -255,39 +304,55 @@ export class SnippetSession { } private readonly _editor: ICommonCodeEditor; - private _snippets: OneSnippet[]; + private readonly _template: string; + private readonly _overwriteBefore: number; + private readonly _overwriteAfter: number; + private _snippets: OneSnippet[] = []; - constructor(editor: ICommonCodeEditor) { + constructor(editor: ICommonCodeEditor, template: string, overwriteBefore: number = 0, overwriteAfter: number = 0) { this._editor = editor; + this._template = template; + this._overwriteBefore = overwriteBefore; + this._overwriteAfter = overwriteAfter; } dispose(): void { dispose(this._snippets); } - insert(template: string, overwriteBefore: number = 0, overwriteAfter: number = 0): void { + insert(): void { const model = this._editor.getModel(); - const { edits, snippets } = SnippetSession.makeInsertEditsAndSnippets( - this._editor, template, overwriteBefore, overwriteAfter - ); - - let isNestedInsert = true; - if (!this._snippets) { - // keep snippets around - this._snippets = snippets; - isNestedInsert = false; - } // make insert edit and start with first selections - const newSelections = model.pushEditOperations(this._editor.getSelections(), edits, undoEdits => { - if (!isNestedInsert && this._snippets[0].hasPlaceholder) { + const { edits, snippets } = SnippetSession.createEditsAndSnippets(this._editor, this._template, this._overwriteBefore, this._overwriteAfter, false); + this._snippets = snippets; + + this._editor.setSelections(model.pushEditOperations(this._editor.getSelections(), edits, undoEdits => { + if (this._snippets[0].hasPlaceholder) { return this._move(true); } else { return undoEdits.map(edit => Selection.fromPositions(edit.range.getEndPosition())); } - }); - this._editor.setSelections(newSelections); + })); + } + + merge(template: string, overwriteBefore: number = 0, overwriteAfter: number = 0): void { + const { edits, snippets } = SnippetSession.createEditsAndSnippets(this._editor, template, overwriteBefore, overwriteAfter, true); + + this._editor.setSelections(this._editor.getModel().pushEditOperations(this._editor.getSelections(), edits, undoEdits => { + + for (const snippet of this._snippets) { + snippet.merge(snippets); + } + console.assert(snippets.length === 0); + + if (this._snippets[0].hasPlaceholder) { + return this._move(undefined); + } else { + return undoEdits.map(edit => Selection.fromPositions(edit.range.getEndPosition())); + } + })); } next(): void { @@ -300,7 +365,7 @@ export class SnippetSession { this._editor.setSelections(newSelections); } - private _move(fwd: boolean): Selection[] { + private _move(fwd: boolean | undefined): Selection[] { const selections: Selection[] = []; for (const snippet of this._snippets) { const oneSelection = snippet.move(fwd); @@ -313,15 +378,20 @@ export class SnippetSession { return this._snippets[0].isAtFirstPlaceholder; } - get isAtFinalPlaceholder() { - return this._snippets[0].isAtFinalPlaceholder; + get isAtLastPlaceholder() { + return this._snippets[0].isAtLastPlaceholder; } get hasPlaceholder() { return this._snippets[0].hasPlaceholder; } - isSelectionWithPlaceholders(): boolean { + isSelectionWithinPlaceholders(): boolean { + + if (!this.hasPlaceholder) { + return false; + } + const selections = this._editor.getSelections(); if (selections.length < this._snippets.length) { // this means we started snippet mode with N diff --git a/src/vs/editor/contrib/snippet/browser/snippetVariables.ts b/src/vs/editor/contrib/snippet/browser/snippetVariables.ts index ab345893eacb26ba9c8f63e3de38fe3ff8494bcd..2953ee8bfc3bbefe8b18a410cf3f8940b901b31f 100644 --- a/src/vs/editor/contrib/snippet/browser/snippetVariables.ts +++ b/src/vs/editor/contrib/snippet/browser/snippetVariables.ts @@ -32,7 +32,7 @@ export class EditorSnippetVariableResolver { resolve(name: string): string { if (name === 'SELECTION' || name === 'TM_SELECTED_TEXT') { - return this._model.getValueInRange(this._selection); + return this._model.getValueInRange(this._selection) || undefined; } else if (name === 'TM_CURRENT_LINE') { return this._model.getLineContent(this._selection.positionLineNumber); @@ -42,7 +42,7 @@ export class EditorSnippetVariableResolver { lineNumber: this._selection.positionLineNumber, column: this._selection.positionColumn }); - return info ? info.word : ''; + return info && info.word || undefined; } else if (name === 'TM_LINE_INDEX') { return String(this._selection.positionLineNumber - 1); diff --git a/src/vs/editor/contrib/snippet/test/browser/snippetController2.old.test.ts b/src/vs/editor/contrib/snippet/test/browser/snippetController2.old.test.ts index 9e15e0bed55ef03dbdaca31f51c974786a3b947c..fc12236bd339fd31c059c8a53c295d8cd219b38b 100644 --- a/src/vs/editor/contrib/snippet/test/browser/snippetController2.old.test.ts +++ b/src/vs/editor/contrib/snippet/test/browser/snippetController2.old.test.ts @@ -10,8 +10,8 @@ import { Selection } from 'vs/editor/common/core/selection'; import { SnippetController2 } from 'vs/editor/contrib/snippet/browser/snippetController2'; import { MockCodeEditor, withMockCodeEditor } from 'vs/editor/test/common/mocks/mockCodeEditor'; import { Cursor } from 'vs/editor/common/controller/cursor'; -import { IContextKeyService } from "vs/platform/contextkey/common/contextkey"; -import { ICommonCodeEditor } from "vs/editor/common/editorCommon"; +import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; +import { ICommonCodeEditor } from 'vs/editor/common/editorCommon'; class TestSnippetController extends SnippetController2 { @@ -189,16 +189,16 @@ suite('SnippetController', () => { }); }); - // test('Stops when undoing', () => { - // snippetTest((editor, cursor, codeSnippet, snippetController) => { - // editor.setPosition({ lineNumber: 4, column: 2 }); - // snippetController.run(codeSnippet, 0, 0); + test('Stops when undoing', () => { + snippetTest((editor, cursor, codeSnippet, snippetController) => { + editor.setPosition({ lineNumber: 4, column: 2 }); + snippetController.insert(codeSnippet, 0, 0); - // editor.getModel().undo(); + editor.getModel().undo(); - // assert.equal(snippetController.isInSnippetMode(), false); - // }); - // }); + assert.equal(snippetController.isInSnippetMode(), false); + }); + }); test('Stops when moving cursor outside', () => { snippetTest((editor, cursor, codeSnippet, snippetController) => { diff --git a/src/vs/editor/contrib/snippet/test/browser/snippetController2.test.ts b/src/vs/editor/contrib/snippet/test/browser/snippetController2.test.ts index 04a866727d3df782f45f72840ed0fd995d09ac63..7b55d2061ffda35a5f9f4ecb9df8ae6610814480 100644 --- a/src/vs/editor/contrib/snippet/test/browser/snippetController2.test.ts +++ b/src/vs/editor/contrib/snippet/test/browser/snippetController2.test.ts @@ -9,7 +9,7 @@ import { Selection } from 'vs/editor/common/core/selection'; import { SnippetController2 } from 'vs/editor/contrib/snippet/browser/snippetController2'; import { ICommonCodeEditor } from 'vs/editor/common/editorCommon'; import { mockCodeEditor } from 'vs/editor/test/common/mocks/mockCodeEditor'; -import { Model } from "vs/editor/common/model/model"; +import { Model } from 'vs/editor/common/model/model'; import { MockContextKeyService } from 'vs/platform/keybinding/test/common/mockKeybindingService'; suite('SnippetController2', function () { @@ -131,7 +131,7 @@ suite('SnippetController2', function () { assertContextKeys(contextKeys, true, false, true); assertSelections(editor, new Selection(1, 1, 1, 7), new Selection(2, 5, 2, 11)); - editor.trigger('test', 'deleteLeft', {}); + editor.trigger('test', 'cut', {}); assertContextKeys(contextKeys, true, false, true); assertSelections(editor, new Selection(1, 1, 1, 1), new Selection(2, 5, 2, 5)); @@ -148,17 +148,99 @@ suite('SnippetController2', function () { // assertContextKeys(contextKeys, false, false, false); }); - test('insert, insert nested', function () { + test('insert, nested snippet', function () { + const ctrl = new SnippetController2(editor, contextKeys); + ctrl.insert('${1:foobar}$0'); + assertContextKeys(contextKeys, true, false, true); + assertSelections(editor, new Selection(1, 1, 1, 7), new Selection(2, 5, 2, 11)); + + ctrl.insert('far$1boo$0'); + assertSelections(editor, new Selection(1, 4, 1, 4), new Selection(2, 8, 2, 8)); + assertContextKeys(contextKeys, true, false, true); + + ctrl.next(); + assertSelections(editor, new Selection(1, 7, 1, 7), new Selection(2, 11, 2, 11)); + assertContextKeys(contextKeys, true, true, true); + + ctrl.next(); + assertSelections(editor, new Selection(1, 7, 1, 7), new Selection(2, 11, 2, 11)); + assertContextKeys(contextKeys, false, false, false); + }); + + test('insert, nested plain text', function () { const ctrl = new SnippetController2(editor, contextKeys); ctrl.insert('${1:foobar}$0'); assertContextKeys(contextKeys, true, false, true); assertSelections(editor, new Selection(1, 1, 1, 7), new Selection(2, 5, 2, 11)); ctrl.insert('farboo'); + assertSelections(editor, new Selection(1, 7, 1, 7), new Selection(2, 11, 2, 11)); assertContextKeys(contextKeys, true, false, true); + + ctrl.next(); assertSelections(editor, new Selection(1, 7, 1, 7), new Selection(2, 11, 2, 11)); + assertContextKeys(contextKeys, false, false, false); + }); + + test('Nested snippets without final placeholder jumps to next outer placeholder, #27898', function () { + const ctrl = new SnippetController2(editor, contextKeys); + + ctrl.insert('for(const ${1:element} of ${2:array}) {$0}'); + assertContextKeys(contextKeys, true, false, true); + assertSelections(editor, new Selection(1, 11, 1, 18), new Selection(2, 15, 2, 22)); + + ctrl.next(); + assertContextKeys(contextKeys, true, true, true); + assertSelections(editor, new Selection(1, 22, 1, 27), new Selection(2, 26, 2, 31)); + + ctrl.insert('document'); + assertContextKeys(contextKeys, true, true, true); + assertSelections(editor, new Selection(1, 30, 1, 30), new Selection(2, 34, 2, 34)); ctrl.next(); assertContextKeys(contextKeys, false, false, false); }); + + test('Inconsistent tab stop behaviour with recursive snippets and tab / shift tab, #27543', function () { + const ctrl = new SnippetController2(editor, contextKeys); + ctrl.insert('1_calize(${1:nl}, \'${2:value}\')$0'); + + assertContextKeys(contextKeys, true, false, true); + assertSelections(editor, new Selection(1, 10, 1, 12), new Selection(2, 14, 2, 16)); + + ctrl.insert('2_calize(${1:nl}, \'${2:value}\')$0'); + + assertSelections(editor, new Selection(1, 19, 1, 21), new Selection(2, 23, 2, 25)); + + ctrl.next(); // inner `value` + assertSelections(editor, new Selection(1, 24, 1, 29), new Selection(2, 28, 2, 33)); + + ctrl.next(); // inner `$0` + assertSelections(editor, new Selection(1, 31, 1, 31), new Selection(2, 35, 2, 35)); + + ctrl.next(); // outer `value` + assertSelections(editor, new Selection(1, 34, 1, 39), new Selection(2, 38, 2, 43)); + + ctrl.prev(); // inner `$0` + assertSelections(editor, new Selection(1, 31, 1, 31), new Selection(2, 35, 2, 35)); + }); + + test('Snippet tabstop selecting content of previously entered variable only works when separated by space, #23728', function () { + const ctrl = new SnippetController2(editor, contextKeys); + + model.setValue(''); + editor.setSelection(new Selection(1, 1, 1, 1)); + + ctrl.insert('import ${2:${1:module}} from \'${1: module }\'$0'); + + assertContextKeys(contextKeys, true, false, true); + assertSelections(editor, new Selection(1, 8, 1, 14), new Selection(1, 21, 1, 29)); + + ctrl.insert('foo'); + assertSelections(editor, new Selection(1, 11, 1, 11), new Selection(1, 21, 1, 21)); + + ctrl.next(); // ${2:...} + assertSelections(editor, new Selection(1, 8, 1, 11)); + }); + }); diff --git a/src/vs/editor/contrib/snippet/test/browser/snippetParser.test.ts b/src/vs/editor/contrib/snippet/test/browser/snippetParser.test.ts index 66e204e9da22566e00584ce1a1bd3e7bc8c83993..4879ac3b9f890781b9c028031216da55493df334 100644 --- a/src/vs/editor/contrib/snippet/test/browser/snippetParser.test.ts +++ b/src/vs/editor/contrib/snippet/test/browser/snippetParser.test.ts @@ -126,23 +126,23 @@ suite('SnippetParser', () => { assertText('\\}', '}'); assertText('\\abc', '\\abc'); assertText('foo${f:\\}}bar', 'foo}bar'); - assertText('\\{', '{'); + assertText('\\{', '\\{'); assertText('I need \\\\\\$', 'I need \\$'); assertText('\\', '\\'); - assertText('\\{{', '{{'); + assertText('\\{{', '\\{{'); assertText('{{', '{{'); assertText('{{dd', '{{dd'); assertText('}}', '}}'); assertText('ff}}', 'ff}}'); assertText('farboo', 'farboo'); - assertText('far{{}}boo', 'farboo'); - assertText('far{{123}}boo', 'far123boo'); - assertText('far\\{{123}}boo', 'far{{123}}boo'); - assertText('far{{id:bern}}boo', 'farbernboo'); - assertText('far{{id:bern {{basel}}}}boo', 'farbern baselboo'); - assertText('far{{id:bern {{id:basel}}}}boo', 'farbern baselboo'); - assertText('far{{id:bern {{id2:basel}}}}boo', 'farbern baselboo'); + assertText('far{{}}boo', 'far{{}}boo'); + assertText('far{{123}}boo', 'far{{123}}boo'); + assertText('far\\{{123}}boo', 'far\\{{123}}boo'); + assertText('far{{id:bern}}boo', 'far{{id:bern}}boo'); + assertText('far{{id:bern {{basel}}}}boo', 'far{{id:bern {{basel}}}}boo'); + assertText('far{{id:bern {{id:basel}}}}boo', 'far{{id:bern {{id:basel}}}}boo'); + assertText('far{{id:bern {{id2:basel}}}}boo', 'far{{id:bern {{id2:basel}}}}boo'); }); @@ -152,21 +152,21 @@ suite('SnippetParser', () => { assertTextAndMarker('foo${1:bar\\}${2:foo}}', 'foobar}foo', Text, Placeholder); - let [, placeholder] = new SnippetParser(true, false).parse('foo${1:bar\\}${2:foo}}'); - let { defaultValue } = (placeholder); + let [, placeholder] = new SnippetParser().parse('foo${1:bar\\}${2:foo}}'); + let { children } = (placeholder); assert.equal((placeholder).index, '1'); - assert.ok(defaultValue[0] instanceof Text); - assert.equal(defaultValue[0].toString(), 'bar}'); - assert.ok(defaultValue[1] instanceof Placeholder); - assert.equal(defaultValue[1].toString(), 'foo'); + assert.ok(children[0] instanceof Text); + assert.equal(children[0].toString(), 'bar}'); + assert.ok(children[1] instanceof Placeholder); + assert.equal(children[1].toString(), 'foo'); }); test('Parser, placeholder', () => { assertTextAndMarker('farboo', 'farboo', Text); - assertTextAndMarker('far{{}}boo', 'farboo', Text, Placeholder, Text); - assertTextAndMarker('far{{123}}boo', 'far123boo', Text, Placeholder, Text); - assertTextAndMarker('far\\{{123}}boo', 'far{{123}}boo', Text); + assertTextAndMarker('far{{}}boo', 'far{{}}boo', Text); + assertTextAndMarker('far{{123}}boo', 'far{{123}}boo', Text); + assertTextAndMarker('far\\{{123}}boo', 'far\\{{123}}boo', Text); }); test('Parser, literal code', () => { @@ -194,7 +194,7 @@ suite('SnippetParser', () => { }); test('Parser, only textmate', () => { - const p = new SnippetParser(true, false); + const p = new SnippetParser(); assertMarker(p.parse('far{{}}boo'), Text); assertMarker(p.parse('far{{123}}boo'), Text); assertMarker(p.parse('far\\{{123}}boo'), Text); @@ -204,17 +204,6 @@ suite('SnippetParser', () => { assertMarker(p.parse('far\\${123}boo'), Text); }); - test('Parser, only internal', () => { - const p = new SnippetParser(false, true); - assertMarker(p.parse('far{{}}boo'), Text, Placeholder, Text); - assertMarker(p.parse('far{{123}}boo'), Text, Placeholder, Text); - assertMarker(p.parse('far\\{{123}}boo'), Text); - - assertMarker(p.parse('far$0boo'), Text); - assertMarker(p.parse('far${123}boo'), Text); - assertMarker(p.parse('far\\${123}boo'), Text); - }); - test('Parser, real world', () => { let marker = new SnippetParser().parse('console.warn(${1: $TM_SELECTED_TEXT })'); @@ -225,58 +214,23 @@ suite('SnippetParser', () => { const placeholder = marker[1]; assert.equal(placeholder, false); assert.equal(placeholder.index, '1'); - assert.equal(placeholder.defaultValue.length, 3); - assert.ok(placeholder.defaultValue[0] instanceof Text); - assert.ok(placeholder.defaultValue[1] instanceof Variable); - assert.ok(placeholder.defaultValue[2] instanceof Text); - assert.equal(placeholder.defaultValue[0].toString(), ' '); - assert.equal(placeholder.defaultValue[1].toString(), ''); - assert.equal(placeholder.defaultValue[2].toString(), ' '); - - const nestedVariable = placeholder.defaultValue[1]; + assert.equal(placeholder.children.length, 3); + assert.ok(placeholder.children[0] instanceof Text); + assert.ok(placeholder.children[1] instanceof Variable); + assert.ok(placeholder.children[2] instanceof Text); + assert.equal(placeholder.children[0].toString(), ' '); + assert.equal(placeholder.children[1].toString(), ''); + assert.equal(placeholder.children[2].toString(), ' '); + + const nestedVariable = placeholder.children[1]; assert.equal(nestedVariable.name, 'TM_SELECTED_TEXT'); - assert.equal(nestedVariable.defaultValue.length, 0); + assert.equal(nestedVariable.children.length, 0); marker = new SnippetParser().parse('$TM_SELECTED_TEXT'); assert.equal(marker.length, 1); assert.ok(marker[0] instanceof Variable); }); - test('Parser, real world, mixed', () => { - - assertTextAndMarker( - 'finished:{{}}, second:{{2:name}}, first:{{1:}}, third:{{3:}}', - 'finished:, second:name, first:, third:', - Text, Placeholder, Text, Placeholder, Text, Placeholder, Text, Placeholder - ); - - - assertTextAndMarker( - 'begin\\{{{1:enumerate}}\\}\n\t{{}}\nend\\{{{1:}}\\}', - 'begin{enumerate}\n\t\nend{enumerate}', - Text, Placeholder, Text, Placeholder, Text, Placeholder, Text - ); - - }); - - test('Parser, default name/value', () => { - assertTextAndMarker( - '{{first}}-{{2:}}-{{second}}-{{1:}}', - 'first--second-', - Placeholder, Text, Placeholder, Text, Placeholder, Text, Placeholder - ); - - const [p1, , p2, , p3] = new SnippetParser().parse('{{first}}-{{2:}}-{{second}}-{{1:}}'); - assert.equal((p1).index, 'first'); - assert.equal(Marker.toString((p1).defaultValue), 'first'); - - assert.equal((p2).index, '2'); - assert.equal(Marker.toString((p2).defaultValue), ''); - - assert.equal((p3).index, 'second'); - assert.equal(Marker.toString((p3).defaultValue), 'second'); - }); - test('Parser, default placeholder values', () => { assertMarker('errorContext: `${1:err}`, error: $1', Text, Placeholder, Text, Placeholder); @@ -284,33 +238,33 @@ suite('SnippetParser', () => { const [, p1, , p2] = new SnippetParser().parse('errorContext: `${1:err}`, error:$1'); assert.equal((p1).index, '1'); - assert.equal((p1).defaultValue.length, '1'); - assert.equal(((p1).defaultValue[0]), 'err'); + assert.equal((p1).children.length, '1'); + assert.equal(((p1).children[0]), 'err'); assert.equal((p2).index, '1'); - assert.equal((p2).defaultValue.length, '1'); - assert.equal(((p2).defaultValue[0]), 'err'); + assert.equal((p2).children.length, '1'); + assert.equal(((p2).children[0]), 'err'); }); test('backspace esapce in TM only, #16212', () => { - const actual = new SnippetParser(true, false).text('Foo \\\\${abc}bar'); + const actual = new SnippetParser().text('Foo \\\\${abc}bar'); assert.equal(actual, 'Foo \\bar'); }); test('colon as variable/placeholder value, #16717', () => { - let actual = new SnippetParser(true, false).text('${TM_SELECTED_TEXT:foo:bar}'); + let actual = new SnippetParser().text('${TM_SELECTED_TEXT:foo:bar}'); assert.equal(actual, 'foo:bar'); - actual = new SnippetParser(true, false).text('${1:foo:bar}'); + actual = new SnippetParser().text('${1:foo:bar}'); assert.equal(actual, 'foo:bar'); }); test('marker#len', () => { function assertLen(template: string, ...lengths: number[]): void { - const { marker } = SnippetParser.parse(template); - walk(marker, m => { + const { children } = SnippetParser.parse(template); + walk(children, m => { const expected = lengths.shift(); assert.equal(m.len(), expected); return true; @@ -335,15 +289,15 @@ suite('SnippetParser', () => { assert.equal(first.index, '1'); assert.equal(second.index, '2'); assert.ok(second.parent === first); - assert.ok(first.parent === undefined); + assert.ok(first.parent === snippet); snippet = SnippetParser.parse('${VAR:default${1:value}}$0'); assert.equal(snippet.placeholders.length, 2); [first] = snippet.placeholders; assert.equal(first.index, '1'); - assert.ok(snippet.marker[0] instanceof Variable); - assert.ok(first.parent === snippet.marker[0]); + assert.ok(snippet.children[0] instanceof Variable); + assert.ok(first.parent === snippet.children[0]); }); test('TextmateSnippet#enclosingPlaceholders', function () { @@ -356,13 +310,13 @@ suite('SnippetParser', () => { test('TextmateSnippet#offset', () => { let snippet = SnippetParser.parse('te$1xt'); - assert.equal(snippet.offset(snippet.marker[0]), 0); - assert.equal(snippet.offset(snippet.marker[1]), 2); - assert.equal(snippet.offset(snippet.marker[2]), 2); + assert.equal(snippet.offset(snippet.children[0]), 0); + assert.equal(snippet.offset(snippet.children[1]), 2); + assert.equal(snippet.offset(snippet.children[2]), 2); snippet = SnippetParser.parse('${TM_SELECTED_TEXT:def}'); - assert.equal(snippet.offset(snippet.marker[0]), 0); - assert.equal(snippet.offset((snippet.marker[0]).defaultValue[0]), 0); + assert.equal(snippet.offset(snippet.children[0]), 0); + assert.equal(snippet.offset((snippet.children[0]).children[0]), 0); // forgein marker assert.equal(snippet.offset(new Text('foo')), -1); @@ -386,4 +340,57 @@ suite('SnippetParser', () => { placeholders = snippet.placeholders; assert.equal(placeholders.length, 3); }); + + test('TextmateSnippet#replace 1/2', function () { + let snippet = SnippetParser.parse('aaa${1:bbb${2:ccc}}$0'); + + assert.equal(snippet.placeholders.length, 3); + const [, second] = snippet.placeholders; + assert.equal(second.index, '2'); + + const enclosing = snippet.enclosingPlaceholders(second); + assert.equal(enclosing.length, 1); + assert.equal(enclosing[0].index, '1'); + + let nested = SnippetParser.parse('ddd$1eee$0'); + snippet.replace(second, nested.children); + + assert.equal(snippet.text, 'aaabbbdddeee'); + assert.equal(snippet.placeholders.length, 4); + assert.equal(snippet.placeholders[0].index, '1'); + assert.equal(snippet.placeholders[1].index, '1'); + assert.equal(snippet.placeholders[2].index, '0'); + assert.equal(snippet.placeholders[3].index, '0'); + + const newEnclosing = snippet.enclosingPlaceholders(snippet.placeholders[1]); + assert.ok(newEnclosing[0] === snippet.placeholders[0]); + assert.equal(newEnclosing.length, 1); + assert.equal(newEnclosing[0].index, '1'); + }); + + test('TextmateSnippet#replace 2/2', function () { + let snippet = SnippetParser.parse('aaa${1:bbb${2:ccc}}$0'); + + assert.equal(snippet.placeholders.length, 3); + const [, second] = snippet.placeholders; + assert.equal(second.index, '2'); + + let nested = SnippetParser.parse('dddeee$0'); + snippet.replace(second, nested.children); + + assert.equal(snippet.text, 'aaabbbdddeee'); + assert.equal(snippet.placeholders.length, 3); + }); + + test('Snippet order for placeholders, #28185', function () { + + const _10 = new Placeholder(10, []); + const _2 = new Placeholder(2, []); + + assert.equal(Placeholder.compareByIndex(_10, _2), 1); + }); + + test('Maximum call stack size exceeded, #28983', function () { + new SnippetParser().parse('${1:${foo:${1}}}'); + }); }); diff --git a/src/vs/editor/contrib/snippet/test/browser/snippetSession.test.ts b/src/vs/editor/contrib/snippet/test/browser/snippetSession.test.ts index 5eb6c7cba9357dd9b9967ed4f346401c756bb325..138d98856b96b6f85440fbbf257b67e1348687da 100644 --- a/src/vs/editor/contrib/snippet/test/browser/snippetSession.test.ts +++ b/src/vs/editor/contrib/snippet/test/browser/snippetSession.test.ts @@ -11,7 +11,7 @@ import { IPosition, Position } from 'vs/editor/common/core/position'; import { SnippetSession } from 'vs/editor/contrib/snippet/browser/snippetSession'; import { ICommonCodeEditor } from 'vs/editor/common/editorCommon'; import { mockCodeEditor } from 'vs/editor/test/common/mocks/mockCodeEditor'; -import { Model } from "vs/editor/common/model/model"; +import { Model } from 'vs/editor/common/model/model'; suite('SnippetSession', function () { @@ -67,8 +67,8 @@ suite('SnippetSession', function () { }); test('text edits & selection', function () { - const session = new SnippetSession(editor); - session.insert('foo${1:bar}foo$0'); + const session = new SnippetSession(editor, 'foo${1:bar}foo$0'); + session.insert(); assert.equal(editor.getModel().getValue(), 'foobarfoofunction foo() {\n foobarfooconsole.log(a);\n}'); assertSelections(editor, new Selection(1, 4, 1, 7), new Selection(2, 8, 2, 11)); @@ -78,17 +78,17 @@ suite('SnippetSession', function () { test('text edit with reversed selection', function () { - const session = new SnippetSession(editor); + const session = new SnippetSession(editor, '${1:bar}$0'); editor.setSelections([new Selection(2, 5, 2, 5), new Selection(1, 1, 1, 1)]); - session.insert('${1:bar}$0'); + session.insert(); assert.equal(model.getValue(), 'barfunction foo() {\n barconsole.log(a);\n}'); assertSelections(editor, new Selection(2, 5, 2, 8), new Selection(1, 1, 1, 4)); }); test('snippets, repeated tabstops', function () { - const session = new SnippetSession(editor); - session.insert('${1:abc}foo${1:abc}$0'); + const session = new SnippetSession(editor, '${1:abc}foo${1:abc}$0'); + session.insert(); assertSelections(editor, new Selection(1, 1, 1, 4), new Selection(1, 7, 1, 10), new Selection(2, 5, 2, 8), new Selection(2, 11, 2, 14), @@ -101,16 +101,16 @@ suite('SnippetSession', function () { }); test('snippets, just text', function () { - const session = new SnippetSession(editor); - session.insert('foobar'); + const session = new SnippetSession(editor, 'foobar'); + session.insert(); assert.equal(model.getValue(), 'foobarfunction foo() {\n foobarconsole.log(a);\n}'); assertSelections(editor, new Selection(1, 7, 1, 7), new Selection(2, 11, 2, 11)); }); test('snippets, selections and new text with newlines', () => { - const session = new SnippetSession(editor); - session.insert('foo\n\t${1:bar}\n$0'); + const session = new SnippetSession(editor, 'foo\n\t${1:bar}\n$0'); + session.insert(); assert.equal(editor.getModel().getValue(), 'foo\n bar\nfunction foo() {\n foo\n bar\n console.log(a);\n}'); @@ -122,8 +122,8 @@ suite('SnippetSession', function () { test('snippets, selections -> next/prev', () => { - const session = new SnippetSession(editor); - session.insert('f$1oo${2:bar}foo$0'); + const session = new SnippetSession(editor, 'f$1oo${2:bar}foo$0'); + session.insert(); // @ $2 assertSelections(editor, new Selection(1, 2, 1, 2), new Selection(2, 6, 2, 6)); @@ -142,8 +142,8 @@ suite('SnippetSession', function () { }); test('snippets, selections & typing', function () { - const session = new SnippetSession(editor); - session.insert('f${1:oo}_$2_$0'); + const session = new SnippetSession(editor, 'f${1:oo}_$2_$0'); + session.insert(); editor.trigger('test', 'type', { text: 'X' }); session.next(); @@ -167,7 +167,7 @@ suite('SnippetSession', function () { model.setValue('foo_bar_foo'); editor.setSelections([new Selection(1, 1, 1, 4), new Selection(1, 9, 1, 12)]); - new SnippetSession(editor).insert('x$0'); + new SnippetSession(editor, 'x$0').insert(); assert.equal(model.getValue(), 'x_bar_x'); assertSelections(editor, new Selection(1, 2, 1, 2), new Selection(1, 8, 1, 8)); }); @@ -176,7 +176,7 @@ suite('SnippetSession', function () { model.setValue('foo_bar_foo'); editor.setSelections([new Selection(1, 1, 1, 4), new Selection(1, 9, 1, 12)]); - new SnippetSession(editor).insert('LONGER$0'); + new SnippetSession(editor, 'LONGER$0').insert(); assert.equal(model.getValue(), 'LONGER_bar_LONGER'); assertSelections(editor, new Selection(1, 7, 1, 7), new Selection(1, 18, 1, 18)); }); @@ -184,8 +184,8 @@ suite('SnippetSession', function () { test('snippets, don\'t grow final tabstop', function () { model.setValue('foo_zzz_foo'); editor.setSelection(new Selection(1, 5, 1, 8)); - const session = new SnippetSession(editor); - session.insert('$1bar$0'); + const session = new SnippetSession(editor, '$1bar$0'); + session.insert(); assertSelections(editor, new Selection(1, 5, 1, 5)); editor.trigger('test', 'type', { text: 'foo-' }); @@ -204,8 +204,8 @@ suite('SnippetSession', function () { test('snippets, don\'t merge touching tabstops 1/2', function () { - const session = new SnippetSession(editor); - session.insert('$1$2$3$0'); + const session = new SnippetSession(editor, '$1$2$3$0'); + session.insert(); assertSelections(editor, new Selection(1, 1, 1, 1), new Selection(2, 5, 2, 5)); session.next(); @@ -242,8 +242,8 @@ suite('SnippetSession', function () { }); test('snippets, don\'t merge touching tabstops 2/2', function () { - const session = new SnippetSession(editor); - session.insert('$1$2$3$0'); + const session = new SnippetSession(editor, '$1$2$3$0'); + session.insert(); assertSelections(editor, new Selection(1, 1, 1, 1), new Selection(2, 5, 2, 5)); editor.trigger('test', 'type', { text: '111' }); @@ -257,71 +257,71 @@ suite('SnippetSession', function () { editor.trigger('test', 'type', { text: '333' }); session.next(); - assert.equal(session.isAtFinalPlaceholder, true); + assert.equal(session.isAtLastPlaceholder, true); }); test('snippets, gracefully move over final tabstop', function () { - const session = new SnippetSession(editor); - session.insert('${1}bar$0'); + const session = new SnippetSession(editor, '${1}bar$0'); + session.insert(); - assert.equal(session.isAtFinalPlaceholder, false); + assert.equal(session.isAtLastPlaceholder, false); assertSelections(editor, new Selection(1, 1, 1, 1), new Selection(2, 5, 2, 5)); session.next(); - assert.equal(session.isAtFinalPlaceholder, true); + assert.equal(session.isAtLastPlaceholder, true); assertSelections(editor, new Selection(1, 4, 1, 4), new Selection(2, 8, 2, 8)); session.next(); - assert.equal(session.isAtFinalPlaceholder, true); + assert.equal(session.isAtLastPlaceholder, true); assertSelections(editor, new Selection(1, 4, 1, 4), new Selection(2, 8, 2, 8)); }); test('snippets, overwriting nested placeholder', function () { - const session = new SnippetSession(editor); - session.insert('log(${1:"$2"});$0'); + const session = new SnippetSession(editor, 'log(${1:"$2"});$0'); + session.insert(); assertSelections(editor, new Selection(1, 5, 1, 7), new Selection(2, 9, 2, 11)); editor.trigger('test', 'type', { text: 'XXX' }); assert.equal(model.getValue(), 'log(XXX);function foo() {\n log(XXX);console.log(a);\n}'); session.next(); - assert.equal(session.isAtFinalPlaceholder, false); + assert.equal(session.isAtLastPlaceholder, false); // assertSelections(editor, new Selection(1, 7, 1, 7), new Selection(2, 11, 2, 11)); session.next(); - assert.equal(session.isAtFinalPlaceholder, true); + assert.equal(session.isAtLastPlaceholder, true); assertSelections(editor, new Selection(1, 10, 1, 10), new Selection(2, 14, 2, 14)); }); test('snippets, selections and snippet ranges', function () { - const session = new SnippetSession(editor); - session.insert('${1:foo}farboo${2:bar}$0'); + const session = new SnippetSession(editor, '${1:foo}farboo${2:bar}$0'); + session.insert(); assert.equal(model.getValue(), 'foofarboobarfunction foo() {\n foofarboobarconsole.log(a);\n}'); assertSelections(editor, new Selection(1, 1, 1, 4), new Selection(2, 5, 2, 8)); - assert.equal(session.isSelectionWithPlaceholders(), true); + assert.equal(session.isSelectionWithinPlaceholders(), true); editor.setSelections([new Selection(1, 1, 1, 1)]); - assert.equal(session.isSelectionWithPlaceholders(), false); + assert.equal(session.isSelectionWithinPlaceholders(), false); editor.setSelections([new Selection(1, 6, 1, 6), new Selection(2, 10, 2, 10)]); - assert.equal(session.isSelectionWithPlaceholders(), false); // in snippet, outside placeholder + assert.equal(session.isSelectionWithinPlaceholders(), false); // in snippet, outside placeholder editor.setSelections([new Selection(1, 6, 1, 6), new Selection(2, 10, 2, 10), new Selection(1, 1, 1, 1)]); - assert.equal(session.isSelectionWithPlaceholders(), false); // in snippet, outside placeholder + assert.equal(session.isSelectionWithinPlaceholders(), false); // in snippet, outside placeholder editor.setSelections([new Selection(1, 6, 1, 6), new Selection(2, 10, 2, 10), new Selection(2, 20, 2, 21)]); - assert.equal(session.isSelectionWithPlaceholders(), false); + assert.equal(session.isSelectionWithinPlaceholders(), false); // reset selection to placeholder session.next(); - assert.equal(session.isSelectionWithPlaceholders(), true); + assert.equal(session.isSelectionWithinPlaceholders(), true); assertSelections(editor, new Selection(1, 10, 1, 13), new Selection(2, 14, 2, 17)); // reset selection to placeholder session.next(); - assert.equal(session.isSelectionWithPlaceholders(), true); - assert.equal(session.isAtFinalPlaceholder, true); + assert.equal(session.isSelectionWithinPlaceholders(), true); + assert.equal(session.isAtLastPlaceholder, true); assertSelections(editor, new Selection(1, 13, 1, 13), new Selection(2, 17, 2, 17)); }); @@ -330,49 +330,49 @@ suite('SnippetSession', function () { model.setValue(''); editor.setSelection(new Selection(1, 1, 1, 1)); - const first = new SnippetSession(editor); - first.insert('foo${2:bar}foo$0'); + const first = new SnippetSession(editor, 'foo${2:bar}foo$0'); + first.insert(); assert.equal(model.getValue(), 'foobarfoo'); assertSelections(editor, new Selection(1, 4, 1, 7)); - const second = new SnippetSession(editor); - second.insert('ba${1:zzzz}$0'); + const second = new SnippetSession(editor, 'ba${1:zzzz}$0'); + second.insert(); assert.equal(model.getValue(), 'foobazzzzfoo'); assertSelections(editor, new Selection(1, 6, 1, 10)); second.next(); - assert.equal(second.isAtFinalPlaceholder, true); + assert.equal(second.isAtLastPlaceholder, true); assertSelections(editor, new Selection(1, 10, 1, 10)); first.next(); - assert.equal(first.isAtFinalPlaceholder, true); + assert.equal(first.isAtLastPlaceholder, true); assertSelections(editor, new Selection(1, 13, 1, 13)); }); test('snippets, typing at final tabstop', function () { - const session = new SnippetSession(editor); - session.insert('farboo$0'); - assert.equal(session.isAtFinalPlaceholder, true); - assert.equal(session.isSelectionWithPlaceholders(), false); + const session = new SnippetSession(editor, 'farboo$0'); + session.insert(); + assert.equal(session.isAtLastPlaceholder, true); + assert.equal(session.isSelectionWithinPlaceholders(), false); editor.trigger('test', 'type', { text: 'XXX' }); - assert.equal(session.isSelectionWithPlaceholders(), false); + assert.equal(session.isSelectionWithinPlaceholders(), false); }); test('snippets, typing at beginning', function () { editor.setSelection(new Selection(1, 2, 1, 2)); - const session = new SnippetSession(editor); - session.insert('farboo$0'); + const session = new SnippetSession(editor, 'farboo$0'); + session.insert(); editor.setSelection(new Selection(1, 2, 1, 2)); - assert.equal(session.isSelectionWithPlaceholders(), false); - assert.equal(session.isAtFinalPlaceholder, true); + assert.equal(session.isSelectionWithinPlaceholders(), false); + assert.equal(session.isAtLastPlaceholder, true); editor.trigger('test', 'type', { text: 'XXX' }); assert.equal(model.getLineContent(1), 'fXXXfarboounction foo() {'); - assert.equal(session.isSelectionWithPlaceholders(), false); + assert.equal(session.isSelectionWithinPlaceholders(), false); session.next(); assertSelections(editor, new Selection(1, 11, 1, 11)); @@ -381,14 +381,14 @@ suite('SnippetSession', function () { test('snippets, typing with nested placeholder', function () { editor.setSelection(new Selection(1, 1, 1, 1)); - const session = new SnippetSession(editor); - session.insert('This ${1:is ${2:nested}}.$0'); + const session = new SnippetSession(editor, 'This ${1:is ${2:nested}}.$0'); + session.insert(); assertSelections(editor, new Selection(1, 6, 1, 15)); session.next(); assertSelections(editor, new Selection(1, 9, 1, 15)); - editor.trigger('test', 'deleteLeft', {}); + editor.trigger('test', 'cut', {}); assertSelections(editor, new Selection(1, 9, 1, 9)); editor.trigger('test', 'type', { text: 'XXX' }); @@ -397,26 +397,41 @@ suite('SnippetSession', function () { }); test('snippets, snippet with variables', function () { - const session = new SnippetSession(editor); - session.insert('@line=$TM_LINE_NUMBER$0'); + const session = new SnippetSession(editor, '@line=$TM_LINE_NUMBER$0'); + session.insert(); assert.equal(model.getValue(), '@line=1function foo() {\n @line=2console.log(a);\n}'); assertSelections(editor, new Selection(1, 8, 1, 8), new Selection(2, 12, 2, 12)); }); - test('snippet, insert-nested', function () { - const session = new SnippetSession(editor); - session.insert('foo$1foo$0'); + test('snippets, merge', function () { + editor.setSelection(new Selection(1, 1, 1, 1)); + const session = new SnippetSession(editor, 'This ${1:is ${2:nested}}.$0'); + session.insert(); + session.next(); + assertSelections(editor, new Selection(1, 9, 1, 15)); - assertSelections(editor, new Selection(1, 4, 1, 4), new Selection(2, 8, 2, 8)); - session.insert('bar'); - assert.ok(session.isSelectionWithPlaceholders()); - assertSelections(editor, new Selection(1, 7, 1, 7), new Selection(2, 11, 2, 11)); + session.merge('really ${1:nested}$0'); + assertSelections(editor, new Selection(1, 16, 1, 22)); session.next(); - assertSelections(editor, new Selection(1, 10, 1, 10), new Selection(2, 14, 2, 14)); - assert.ok(session.isAtFinalPlaceholder); - }); + assertSelections(editor, new Selection(1, 22, 1, 22)); + assert.equal(session.isAtLastPlaceholder, false); + session.next(); + assert.equal(session.isAtLastPlaceholder, true); + assertSelections(editor, new Selection(1, 23, 1, 23)); + + session.prev(); + editor.trigger('test', 'type', { text: 'AAA' }); + + // back to `really ${1:nested}` + session.prev(); + assertSelections(editor, new Selection(1, 16, 1, 22)); + + // back to `${1:is ...}` which now grew + session.prev(); + assertSelections(editor, new Selection(1, 6, 1, 25)); + }); }); diff --git a/src/vs/editor/contrib/snippet/test/browser/snippetVariables.test.ts b/src/vs/editor/contrib/snippet/test/browser/snippetVariables.test.ts index fa0bb4034f901d9cad6fa9426a83f373b8ece677..926bb6f424eb159887d6ab3c6bbdc92797822e31 100644 --- a/src/vs/editor/contrib/snippet/test/browser/snippetVariables.test.ts +++ b/src/vs/editor/contrib/snippet/test/browser/snippetVariables.test.ts @@ -78,12 +78,12 @@ suite('Snippet Variables Resolver', function () { assert.equal(resolver.resolve('TM_LINE_NUMBER'), '1'); resolver = new EditorSnippetVariableResolver(model, new Selection(1, 2, 1, 2)); - assert.equal(resolver.resolve('TM_SELECTED_TEXT'), ''); + assert.equal(resolver.resolve('TM_SELECTED_TEXT'), undefined); assert.equal(resolver.resolve('TM_CURRENT_WORD'), 'this'); resolver = new EditorSnippetVariableResolver(model, new Selection(3, 1, 3, 1)); - assert.equal(resolver.resolve('TM_CURRENT_WORD'), ''); + assert.equal(resolver.resolve('TM_CURRENT_WORD'), undefined); }); diff --git a/src/vs/editor/contrib/suggest/browser/media/suggest.css b/src/vs/editor/contrib/suggest/browser/media/suggest.css index 08b4e45593d89868c74a64caa37df99de1616f30..1c3b4374b667de652c54f320d57873b76806faf0 100644 --- a/src/vs/editor/contrib/suggest/browser/media/suggest.css +++ b/src/vs/editor/contrib/suggest/browser/media/suggest.css @@ -14,16 +14,18 @@ width: 430px; } +.monaco-editor .suggest-widget > .message, .monaco-editor .suggest-widget > .tree, .monaco-editor .suggest-widget > .details { - width: 428px; + width: 100%; border-style: solid; border-width: 1px; + box-sizing: border-box; } +.monaco-editor.hc-black .suggest-widget > .message, .monaco-editor.hc-black .suggest-widget > .tree, .monaco-editor.hc-black .suggest-widget > .details { - width: 426px; border-width: 2px; } @@ -34,29 +36,19 @@ .monaco-editor .suggest-widget.docs-side > .tree, .monaco-editor .suggest-widget.docs-side > .details { - /* subtract 2px for border, and another 2 for the Chromium zoom issue - where the children get slightly bigger width than what is set - which makes the docs go below the list */ - width: calc(50% - 4px); + width: 50%; + float: left; } -.monaco-editor.hc-black .suggest-widget.docs-side > .tree, -.monaco-editor.hc-black .suggest-widget.docs-side > .details { - /* subtract 4px for border, and another 2 for the Chromium zoom issue - where the children get slightly bigger width than what is set - which makes the docs go below the list */ - width: calc(50% - 6px); +.monaco-editor .suggest-widget.docs-side.list-right > .tree, +.monaco-editor .suggest-widget.docs-side.list-right > .details { + float: right; } + /* Styles for Message element for when widget is loading or is empty */ .monaco-editor .suggest-widget > .message { padding-left: 22px; - border-style: solid; - border-width: 1px; -} - -.monaco-editor.hc-black .suggest-widget > .message { - border-width: 2px; } /** Styles for the list element **/ @@ -64,13 +56,7 @@ height: 100%; } -.monaco-editor .suggest-widget.docs-side > .tree { - float: left; -} -.monaco-editor .suggest-widget.docs-side.list-right > .tree { - float: right -} /** Styles for each row in the list element **/ @@ -103,7 +89,7 @@ /** Icon styles **/ -.monaco-editor .suggest-widget .details > .monaco-scrollable-element > .body > .close, +.monaco-editor .suggest-widget .details > .monaco-scrollable-element > .body > .header > .close, .monaco-editor .suggest-widget .monaco-list .monaco-list-row > .contents > .main > .readMore { opacity: 0.6; background-position: center center; @@ -112,16 +98,17 @@ cursor: pointer; } -.monaco-editor .suggest-widget .details > .monaco-scrollable-element > .body > .close { +.monaco-editor .suggest-widget .details > .monaco-scrollable-element > .body > .header > .close { background-image: url('./close.svg'); float: right; + margin-right: 5px; } .monaco-editor .suggest-widget .monaco-list .monaco-list-row > .contents > .main > .readMore { background-image: url('./info.svg'); } -.monaco-editor .suggest-widget .details > .monaco-scrollable-element > .body > .close:hover, +.monaco-editor .suggest-widget .details > .monaco-scrollable-element > .body > .header > .close:hover, .monaco-editor .suggest-widget .monaco-list .monaco-list-row > .contents > .main > .readMore:hover { opacity: 1; } @@ -203,7 +190,6 @@ /** Styles for the docs of the completion item in focus **/ .monaco-editor .suggest-widget .details { - max-height: 216px; display: flex; flex-direction: column; cursor: default; @@ -213,6 +199,10 @@ display: none; } +.monaco-editor .suggest-widget.docs-below .details { + border-top-width: 0px; +} + .monaco-editor .suggest-widget .details > .monaco-scrollable-element { flex: 1; } @@ -225,16 +215,17 @@ white-space: pre-wrap; } -.monaco-editor .suggest-widget .details > .monaco-scrollable-element > .body > .type { +.monaco-editor .suggest-widget .details > .monaco-scrollable-element > .body > .header > .type { flex: 2; overflow: hidden; text-overflow: ellipsis; opacity: 0.7; word-break: break-all; margin: 0; + padding: 4px 0 4px 5px; } -.monaco-editor .suggest-widget .details > .monaco-scrollable-element > .body > p { +.monaco-editor .suggest-widget .details > .monaco-scrollable-element > .body > .docs { margin: 0; padding: 4px 5px; } @@ -246,8 +237,8 @@ /* High Contrast and Dark Theming */ -.monaco-editor.vs-dark .suggest-widget .details > .monaco-scrollable-element > .body > .close, -.monaco-editor.hc-black .suggest-widget .details > .monaco-scrollable-element > .body > .close { +.monaco-editor.vs-dark .suggest-widget .details > .monaco-scrollable-element > .body > .header > .close, +.monaco-editor.hc-black .suggest-widget .details > .monaco-scrollable-element > .body > .header > .close { background-image: url('./close-dark.svg'); } diff --git a/src/vs/editor/contrib/suggest/browser/suggestWidget.ts b/src/vs/editor/contrib/suggest/browser/suggestWidget.ts index 56871ef950444b5af4385c9650143546c5b8cc50..6577a037c6ac26aca052a0a64589a038498ae614 100644 --- a/src/vs/editor/contrib/suggest/browser/suggestWidget.ts +++ b/src/vs/editor/contrib/suggest/browser/suggestWidget.ts @@ -34,6 +34,7 @@ import { IStorageService, StorageScope } from 'vs/platform/storage/common/storag const sticky = false; // for development purposes const expandSuggestionDocsByDefault = false; +const maxSuggestionsToShow = 12; interface ISuggestionTemplateData { root: HTMLElement; @@ -61,6 +62,9 @@ function matchesColor(text: string) { } function canExpandCompletionItem(item: ICompletionItem) { + if (!item) { + return false; + } const suggestion = item.suggestion; if (suggestion.documentation) { return true; @@ -189,10 +193,12 @@ class SuggestionDetails { private close: HTMLElement; private scrollbar: DomScrollableElement; private body: HTMLElement; + private header: HTMLElement; private type: HTMLElement; private docs: HTMLElement; private ariaLabel: string; private disposables: IDisposable[]; + private borderWidth: number = 1; constructor( container: HTMLElement, @@ -207,14 +213,14 @@ class SuggestionDetails { this.body = $('.body'); - this.scrollbar = new DomScrollableElement(this.body, { canUseTranslate3d: false }); + this.scrollbar = new DomScrollableElement(this.body, {}); append(this.el, this.scrollbar.getDomNode()); this.disposables.push(this.scrollbar); - this.close = append(this.body, $('span.close')); + this.header = append(this.body, $('.header')); + this.close = append(this.header, $('span.close')); this.close.title = nls.localize('readLess', "Read less...{0}", triggerKeybindingLabel); - this.type = append(this.body, $('p.type')); - + this.type = append(this.header, $('p.type')); this.docs = append(this.body, $('p.docs')); this.ariaLabel = null; @@ -239,10 +245,17 @@ class SuggestionDetails { return; } removeClass(this.el, 'no-docs'); - this.type.innerText = item.suggestion.detail || ''; this.docs.textContent = item.suggestion.documentation; - this.el.style.height = this.type.offsetHeight + this.docs.offsetHeight + 'px'; + if (item.suggestion.detail) { + this.type.innerText = item.suggestion.detail; + show(this.type); + } else { + this.type.innerText = ''; + hide(this.type); + } + + this.el.style.height = this.header.offsetHeight + this.docs.offsetHeight + (this.borderWidth * 2) + 'px'; this.close.onmousedown = e => { e.preventDefault(); @@ -288,6 +301,10 @@ class SuggestionDetails { this.scrollUp(80); } + setBorderWidth(width: number): void { + this.borderWidth = width; + } + private configureFont() { const configuration = this.editor.getConfiguration(); const fontFamily = configuration.fontInfo.fontFamily; @@ -357,6 +374,9 @@ export class SuggestWidget implements IContentWidget, IDelegate private detailsFocusBorderColor: string; private detailsBorderColor: string; + private storageServiceAvailable: boolean = true; + private expandSuggestionDocs: boolean = false; + constructor( private editor: ICodeEditor, @ITelemetryService private telemetryService: ITelemetryService, @@ -372,8 +392,12 @@ export class SuggestWidget implements IContentWidget, IDelegate this.isAuto = false; this.focusedItem = null; this.storageService = storageService; - this.element = $('.editor-widget.suggest-widget'); + const storageResult = this.storageService.store('expandSuggestionDocs', expandSuggestionDocsByDefault, StorageScope.GLOBAL); + if (storageResult === undefined) { + this.storageServiceAvailable = false; + } + this.element = $('.editor-widget.suggest-widget'); if (!this.editor.getConfiguration().contribInfo.iconsInSuggestions) { addClass(this.element, 'no-icons'); } @@ -495,6 +519,7 @@ export class SuggestWidget implements IContentWidget, IDelegate if (focusBorderColor) { this.detailsFocusBorderColor = focusBorderColor.toString(); } + this.details.setBorderWidth(theme.type === 'hc' ? 2 : 1); } private onListFocus(e: IListEvent): void { @@ -561,10 +586,8 @@ export class SuggestWidget implements IContentWidget, IDelegate this.list.setFocus([index]); this.list.reveal(index); - if (this.storageService.getBoolean('expandSuggestionDocs', StorageScope.GLOBAL, expandSuggestionDocsByDefault)) { + if (this.expandDocsSettingFromStorage()) { this.showDetails(); - - this._ariaAlert(this.details.getAriaLabel()); } else { removeClass(this.element, 'docs-side'); } @@ -612,7 +635,8 @@ export class SuggestWidget implements IContentWidget, IDelegate case State.Open: hide(this.messageElement); show(this.listElement); - if (this.storageService.getBoolean('expandSuggestionDocs', StorageScope.GLOBAL, expandSuggestionDocsByDefault)) { + if (this.expandDocsSettingFromStorage() + && canExpandCompletionItem(this.list.getFocusedElements()[0])) { show(this.details.element); this.expandSideOrBelow(); } else { @@ -696,6 +720,11 @@ export class SuggestWidget implements IContentWidget, IDelegate } else { this.setState(State.Open); } + + // Reset focus border + if (this.detailsBorderColor) { + this.details.element.style.borderColor = this.detailsBorderColor; + } } } @@ -799,42 +828,47 @@ export class SuggestWidget implements IContentWidget, IDelegate if (this.detailsBorderColor) { this.details.element.style.borderColor = this.detailsBorderColor; } - } else if (this.state === State.Open - && this.storageService.getBoolean('expandSuggestionDocs', StorageScope.GLOBAL, expandSuggestionDocsByDefault)) { + } else if (this.state === State.Open && this.expandDocsSettingFromStorage()) { this.setState(State.Details); if (this.detailsFocusBorderColor) { this.details.element.style.borderColor = this.detailsFocusBorderColor; } } + this.telemetryService.publicLog('suggestWidget:toggleDetailsFocus', this.editor.getTelemetryData()); } toggleDetails(): void { + if (!canExpandCompletionItem(this.list.getFocusedElements()[0])) { + return; + } - if (this.storageService.getBoolean('expandSuggestionDocs', StorageScope.GLOBAL, expandSuggestionDocsByDefault)) { - this.storageService.store('expandSuggestionDocs', false, StorageScope.GLOBAL); + if (this.expandDocsSettingFromStorage()) { + this.updateExpandDocsSetting(false); hide(this.details.element); removeClass(this.element, 'docs-side'); removeClass(this.element, 'docs-below'); this.editor.layoutContentWidget(this); + this.telemetryService.publicLog('suggestWidget:collapseDetails', this.editor.getTelemetryData()); } else { - this.storageService.store('expandSuggestionDocs', true, StorageScope.GLOBAL); - - this.expandSideOrBelow(); - + this.updateExpandDocsSetting(true); this.showDetails(); + this.telemetryService.publicLog('suggestWidget:expandDetails', this.editor.getTelemetryData()); } + } showDetails(): void { if (this.state !== State.Open && this.state !== State.Details) { return; } + this.expandSideOrBelow(); show(this.details.element); this.renderDetails(); + this.details.element.style.maxHeight = this.maxWidgetHeight + 'px'; - // With docs showing up, list might need adjustments to keep it close to the cursor - this.adjustListPosition(); + // Reset margin-top that was set as Fix for #26416 + this.listElement.style.marginTop = '0px'; // with docs showing up widget width/height may change, so reposition the widget this.editor.layoutContentWidget(this); @@ -842,6 +876,8 @@ export class SuggestWidget implements IContentWidget, IDelegate this.adjustDocsPosition(); this.editor.focus(); + + this._ariaAlert(this.details.getAriaLabel()); } private show(): void { @@ -887,17 +923,12 @@ export class SuggestWidget implements IContentWidget, IDelegate private updateListHeight(): number { let height = 0; - let maxSuggestionsToShow = 11; if (this.state === State.Empty || this.state === State.Loading) { height = this.unfocusedHeight; } else { - const focus = this.list.getFocusedElements()[0]; - const focusHeight = focus ? this.getHeight(focus) : this.unfocusedHeight; - height = focusHeight; - - const suggestionCount = (this.list.contentHeight - focusHeight) / this.unfocusedHeight; - height += Math.min(suggestionCount, maxSuggestionsToShow) * this.unfocusedHeight; + const suggestionCount = this.list.contentHeight / this.unfocusedHeight; + height = Math.min(suggestionCount, maxSuggestionsToShow) * this.unfocusedHeight; } this.element.style.lineHeight = `${this.unfocusedHeight}px`; @@ -910,6 +941,7 @@ export class SuggestWidget implements IContentWidget, IDelegate } private adjustDocsPosition() { + const lineHeight = this.editor.getConfiguration().fontInfo.lineHeight; const cursorCoords = this.editor.getScrolledVisiblePosition(this.editor.getPosition()); const editorCoords = getDomNodePagePosition(this.editor.getDomNode()); const cursorX = editorCoords.left + cursorCoords.left; @@ -924,15 +956,16 @@ export class SuggestWidget implements IContentWidget, IDelegate removeClass(this.element, 'list-right'); } - if (cursorY > widgetY) { - if (!hasClass(this.element, 'widget-above')) { - addClass(this.element, 'widget-above'); - // Since the widget was previously not above the cursor, - // the list needs to be adjusted to keep it close to the cursor - this.adjustListPosition(); - } - } else { - removeClass(this.element, 'widget-above'); + // Compare top of the cursor (cursorY - lineheight) with widgetTop to determine if + // margin-top needs to be applied on list to make it appear right above the cursor + // Cannot compare cursorY directly as it may be a few decimals off due to zoooming + if (hasClass(this.element, 'docs-side') + && cursorY - lineHeight > widgetY + && this.details.element.offsetHeight > this.listElement.offsetHeight) { + + // Fix for #26416 + // Docs is bigger than list and widget is above cursor, apply margin-top so that list appears right above cursor + this.listElement.style.marginTop = `${this.details.element.offsetHeight - this.listElement.offsetHeight}px`; } } @@ -947,17 +980,6 @@ export class SuggestWidget implements IContentWidget, IDelegate } } - private adjustListPosition(): void { - if (hasClass(this.element, 'widget-above') - && hasClass(this.element, 'docs-side') - && this.details.element.offsetHeight > this.listElement.offsetHeight) { - // Docs is bigger than list and widget is above cursor, apply margin-top so that list appears right above cursor - this.listElement.style.marginTop = `${this.details.element.offsetHeight - this.listElement.offsetHeight}px`; - } else { - this.listElement.style.marginTop = '0px'; - } - } - private renderDetails(): void { if (this.state === State.Details || this.state === State.Open) { this.details.render(this.list.getFocusedElements()[0]); @@ -968,8 +990,8 @@ export class SuggestWidget implements IContentWidget, IDelegate // Heights - private get focusHeight(): number { - return this.unfocusedHeight * 2; + private get maxWidgetHeight(): number { + return this.unfocusedHeight * maxSuggestionsToShow; } private get unfocusedHeight(): number { @@ -987,6 +1009,24 @@ export class SuggestWidget implements IContentWidget, IDelegate return 'suggestion'; } + // Monaco Editor does not have a storage service + private expandDocsSettingFromStorage(): boolean { + if (this.storageServiceAvailable) { + return this.storageService.getBoolean('expandSuggestionDocs', StorageScope.GLOBAL, expandSuggestionDocsByDefault); + } else { + return this.expandSuggestionDocs; + } + } + + // Monaco Editor does not have a storage service + private updateExpandDocsSetting(value: boolean) { + if (this.storageServiceAvailable) { + this.storageService.store('expandSuggestionDocs', value, StorageScope.GLOBAL); + } else { + this.expandSuggestionDocs = value; + } + } + dispose(): void { this.state = null; this.suggestionSupportsAutoAccept = null; diff --git a/src/vs/editor/contrib/wordHighlighter/common/wordHighlighter.ts b/src/vs/editor/contrib/wordHighlighter/common/wordHighlighter.ts index b3fcd42202ad5918bb76b38f620687f957334da2..52b6d50d1511c26d38ba37393527ef7ebd40e3d9 100644 --- a/src/vs/editor/contrib/wordHighlighter/common/wordHighlighter.ts +++ b/src/vs/editor/contrib/wordHighlighter/common/wordHighlighter.ts @@ -18,7 +18,7 @@ import { Position } from 'vs/editor/common/core/position'; import { registerColor, editorSelectionHighlight, activeContrastBorder } from 'vs/platform/theme/common/colorRegistry'; import { registerThemingParticipant } from 'vs/platform/theme/common/themeService'; import { CursorChangeReason, ICursorPositionChangedEvent } from 'vs/editor/common/controller/cursorEvents'; -import { ModelDecorationOptions } from "vs/editor/common/model/textModelWithDecorations"; +import { ModelDecorationOptions } from 'vs/editor/common/model/textModelWithDecorations'; export const editorWordHighlight = registerColor('editor.wordHighlightBackground', { dark: '#575757B8', light: '#57575740', hc: null }, nls.localize('wordHighlight', 'Background color of a symbol during read-access, like reading a variable.')); export const editorWordHighlightStrong = registerColor('editor.wordHighlightStrongBackground', { dark: '#004972B8', light: '#0e639c40', hc: null }, nls.localize('wordHighlightStrong', 'Background color of a symbol during write-access, like writing to a variable.')); @@ -32,7 +32,7 @@ export function getOccurrencesAtPosition(model: editorCommon.IReadOnlyModel, pos // until someone response with a good result // (good = none empty array) return sequence(orderedByScore.map(provider => { - return () => { + return (): TPromise => { if (!foundResult) { return asWinJsPromise((token) => { return provider.provideDocumentHighlights(model, position, token); @@ -188,8 +188,8 @@ class WordHighlighter { } // All the effort below is trying to achieve this: - // - when cursor is moved to a word, trigger immediately a findOccurences request - // - 250ms later after the last cursor move event, render the occurences + // - when cursor is moved to a word, trigger immediately a findOccurrences request + // - 250ms later after the last cursor move event, render the occurrences // - no flickering! var currentWordRange = new Range(lineNumber, word.startColumn, lineNumber, word.endColumn); diff --git a/src/vs/editor/contrib/wordOperations/common/wordOperations.ts b/src/vs/editor/contrib/wordOperations/common/wordOperations.ts index 469e9446eb24bea4cf5fcfd157cab0c790381401..a2da8517ce54f893b30c8072ad76433ce4934509 100644 --- a/src/vs/editor/contrib/wordOperations/common/wordOperations.ts +++ b/src/vs/editor/contrib/wordOperations/common/wordOperations.ts @@ -14,9 +14,9 @@ import { Position } from 'vs/editor/common/core/position'; import { Range } from 'vs/editor/common/core/range'; import { WordNavigationType, WordOperations } from 'vs/editor/common/controller/cursorWordOperations'; import { ReplaceCommand } from 'vs/editor/common/commands/replaceCommand'; -import { getMapForWordSeparators, WordCharacterClassifier } from "vs/editor/common/controller/wordCharacterClassifier"; -import { CursorState } from "vs/editor/common/controller/cursorCommon"; -import { CursorChangeReason } from "vs/editor/common/controller/cursorEvents"; +import { getMapForWordSeparators, WordCharacterClassifier } from 'vs/editor/common/controller/wordCharacterClassifier'; +import { CursorState } from 'vs/editor/common/controller/cursorCommon'; +import { CursorChangeReason } from 'vs/editor/common/controller/cursorEvents'; export interface MoveWordOptions extends ICommandOptions { inSelectionMode: boolean; diff --git a/src/vs/editor/contrib/wordOperations/test/common/wordOperations.test.ts b/src/vs/editor/contrib/wordOperations/test/common/wordOperations.test.ts index d67a436a400ca144f0e30a090b5245123433e166..40c303f0bec6a1ff01eae2c14b02e6e2c058ae41 100644 --- a/src/vs/editor/contrib/wordOperations/test/common/wordOperations.test.ts +++ b/src/vs/editor/contrib/wordOperations/test/common/wordOperations.test.ts @@ -17,7 +17,7 @@ import { DeleteWordLeft, DeleteWordStartLeft, DeleteWordEndLeft, DeleteWordRight, DeleteWordStartRight, DeleteWordEndRight } from 'vs/editor/contrib/wordOperations/common/wordOperations'; -import { EditorCommand } from "vs/editor/common/editorCommonExtensions"; +import { EditorCommand } from 'vs/editor/common/editorCommonExtensions'; suite('WordOperations', () => { diff --git a/src/vs/editor/contrib/zoneWidget/browser/peekViewWidget.ts b/src/vs/editor/contrib/zoneWidget/browser/peekViewWidget.ts index 97a76078bba1080793b0ab805e3eecb3656950a2..45e8d7a3e5697b1734a211029194b2b3d2440b9f 100644 --- a/src/vs/editor/contrib/zoneWidget/browser/peekViewWidget.ts +++ b/src/vs/editor/contrib/zoneWidget/browser/peekViewWidget.ts @@ -169,6 +169,7 @@ export abstract class PeekViewWidget extends ZoneWidget implements IPeekViewServ public setTitle(primaryHeading: string, secondaryHeading?: string): void { $(this._primaryHeading).safeInnerHtml(primaryHeading); + this._primaryHeading.setAttribute('aria-label', primaryHeading); if (secondaryHeading) { $(this._secondaryHeading).safeInnerHtml(secondaryHeading); } else { @@ -212,4 +213,4 @@ export abstract class PeekViewWidget extends ZoneWidget implements IPeekViewServ protected _doLayoutBody(heightInPixel: number, widthInPixel: number): void { this._bodyElement.style.height = strings.format('{0}px', heightInPixel); } -} \ No newline at end of file +} diff --git a/src/vs/editor/contrib/zoneWidget/browser/zoneWidget.css b/src/vs/editor/contrib/zoneWidget/browser/zoneWidget.css index 38b3e43abd8ac9620429d12e7b3c61174ff4340f..b9d960656edf36a7550fde8d7b8f8f0ea8a320ec 100644 --- a/src/vs/editor/contrib/zoneWidget/browser/zoneWidget.css +++ b/src/vs/editor/contrib/zoneWidget/browser/zoneWidget.css @@ -7,13 +7,6 @@ z-index: 10; } -.monaco-editor .zone-widget-arrow.below { - width: 0; - height: 0; - border-color: transparent; - border-style: solid; - position: absolute; -} .monaco-editor .zone-widget .zone-widget-container { border-top-style: solid; diff --git a/src/vs/editor/contrib/zoneWidget/browser/zoneWidget.ts b/src/vs/editor/contrib/zoneWidget/browser/zoneWidget.ts index e0de87646d8832e560bcece44827a1e28f96bf4c..eabf84bb2821d49f015d1cabd992d1a2cad903fe 100644 --- a/src/vs/editor/contrib/zoneWidget/browser/zoneWidget.ts +++ b/src/vs/editor/contrib/zoneWidget/browser/zoneWidget.ts @@ -6,7 +6,7 @@ 'use strict'; import 'vs/css!./zoneWidget'; -import { Disposables } from 'vs/base/common/lifecycle'; +import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { Widget } from 'vs/base/browser/ui/widget'; import * as objects from 'vs/base/common/objects'; import * as dom from 'vs/base/browser/dom'; @@ -16,7 +16,8 @@ import { ICodeEditor, IOverlayWidget, IOverlayWidgetPosition, IViewZone, IViewZo import { Color, RGBA } from 'vs/base/common/color'; import { EditorLayoutInfo } from 'vs/editor/common/config/editorOptions'; import { Position, IPosition } from 'vs/editor/common/core/position'; -import { ModelDecorationOptions } from "vs/editor/common/model/textModelWithDecorations"; +import { ModelDecorationOptions } from 'vs/editor/common/model/textModelWithDecorations'; +import { IdGenerator } from "vs/base/common/idGenerator"; export interface IOptions { showFrame?: boolean; @@ -99,23 +100,77 @@ export class OverlayWidgetDelegate implements IOverlayWidget { public getPosition(): IOverlayWidgetPosition { return null; } +} + +class Arrow { + + private static _IdGenerator = new IdGenerator('.arrow-decoration-'); + + private readonly _ruleName = Arrow._IdGenerator.nextId(); + private _decorations: string[] = []; + private _color: string; + private _height: number; + + constructor( + private readonly _editor: ICodeEditor + ) { + // + } + + dispose(): void { + this.hide(); + dom.removeCSSRulesContainingSelector(this._ruleName); + } + + set color(value: string) { + if (this._color !== value) { + this._color = value; + this._updateStyle(); + } + } + + set height(value: number) { + if (this._height !== value) { + this._height = value; + this._updateStyle(); + } + } + + private _updateStyle(): void { + dom.removeCSSRulesContainingSelector(this._ruleName); + dom.createCSSRule( + `.monaco-editor ${this._ruleName}`, + `border-style: solid; border-color: transparent; border-bottom-color: ${this._color}; border-width: ${this._height}px; bottom: -${this._height}px; margin-left: -${this._height}px; ` + ); + } + show(where: IPosition): void { + this._decorations = this._editor.deltaDecorations( + this._decorations, + [{ range: Range.fromPositions(where), options: { className: this._ruleName } }] + ); + } + + hide(): void { + this._editor.deltaDecorations(this._decorations, []); + } } export abstract class ZoneWidget extends Widget implements IHorizontalSashLayoutProvider { - private _overlayWidget: OverlayWidgetDelegate = null; + private _arrow: Arrow; + private _overlayWidget: OverlayWidgetDelegate; private _resizeSash: Sash; private _positionMarkerId: string[] = []; - protected _viewZone: ViewZoneDelegate = null; - protected _disposables = new Disposables(); + protected _viewZone: ViewZoneDelegate; + protected _disposables: IDisposable[] = []; - public container: HTMLElement = null; + public container: HTMLElement; public domNode: HTMLElement; public editor: ICodeEditor; public options: IOptions; - private arrow: HTMLElement = null; + constructor(editor: ICodeEditor, options: IOptions = {}) { super(); @@ -128,7 +183,7 @@ export abstract class ZoneWidget extends Widget implements IHorizontalSashLayout this.domNode.setAttribute('role', 'presentation'); } - this._disposables.add(this.editor.onDidLayoutChange((info: EditorLayoutInfo) => { + this._disposables.push(this.editor.onDidLayoutChange((info: EditorLayoutInfo) => { const width = this._getWidth(info); this.domNode.style.width = width + 'px'; this._onWidth(width); @@ -137,7 +192,7 @@ export abstract class ZoneWidget extends Widget implements IHorizontalSashLayout public dispose(): void { - this._disposables.dispose(); + dispose(this._disposables); if (this._overlayWidget) { this.editor.removeOverlayWidget(this._overlayWidget); @@ -163,8 +218,8 @@ export abstract class ZoneWidget extends Widget implements IHorizontalSashLayout dom.addClass(this.container, 'zone-widget-container'); this.domNode.appendChild(this.container); if (this.options.showArrow) { - this.arrow = document.createElement('div'); - this.arrow.className = 'zone-widget-arrow below'; + this._arrow = new Arrow(this.editor); + this._disposables.push(this._arrow); } this._fillContainer(this.container); this._initSash(); @@ -187,9 +242,9 @@ export abstract class ZoneWidget extends Widget implements IHorizontalSashLayout this.container.style.borderTopColor = frameColor; this.container.style.borderBottomColor = frameColor; } - if (this.arrow) { + if (this._arrow) { let arrowColor = this.options.arrowColor.toString(); - this.arrow.style.borderBottomColor = arrowColor; + this._arrow.color = arrowColor; } } @@ -243,6 +298,9 @@ export abstract class ZoneWidget extends Widget implements IHorizontalSashLayout this.editor.removeOverlayWidget(this._overlayWidget); this._overlayWidget = null; } + if (this._arrow) { + this._arrow.hide(); + } } private _decoratingElementsHeight(): number { @@ -271,9 +329,6 @@ export abstract class ZoneWidget extends Widget implements IHorizontalSashLayout const width = this._getWidth(); this.domNode.style.width = `${width}px`; - // Reveal position, to get the line rendered, such that the arrow can be positioned properly - this.editor.revealPosition(position); - // Render the widget as zone (rendering) and widget (lifecycle) const viewZoneDomNode = document.createElement('div'); viewZoneDomNode.style.overflow = 'hidden'; @@ -291,11 +346,8 @@ export abstract class ZoneWidget extends Widget implements IHorizontalSashLayout // Render the arrow one 1/3 of an editor line height if (this.options.showArrow) { arrowHeight = Math.round(lineHeight / 3); - this.arrow.style.top = -arrowHeight + 'px'; - this.arrow.style.borderWidth = arrowHeight + 'px'; - this.arrow.style.left = this.editor.getOffsetForColumn(position.lineNumber, position.column) + 'px'; - - viewZoneDomNode.appendChild(this.arrow); + this._arrow.height = arrowHeight; + this._arrow.show(position); } // Render the frame as 1/9 of an editor line height @@ -326,7 +378,6 @@ export abstract class ZoneWidget extends Widget implements IHorizontalSashLayout this.editor.addOverlayWidget(this._overlayWidget); }); - if (this.options.showFrame) { const width = this.options.frameWidth ? this.options.frameWidth : frameThickness; this.container.style.borderTopWidth = width + 'px'; @@ -351,15 +402,10 @@ export abstract class ZoneWidget extends Widget implements IHorizontalSashLayout protected setCssClass(className: string, classToReplace?: string): void { if (classToReplace) { this.container.classList.remove(classToReplace); - if (this.arrow) { - this.arrow.classList.remove(classToReplace); - } } dom.addClass(this.container, className); - if (this.arrow) { - dom.addClass(this.arrow, className); - } + } protected abstract _fillContainer(container: HTMLElement): void; @@ -392,7 +438,7 @@ export abstract class ZoneWidget extends Widget implements IHorizontalSashLayout } let data: { startY: number; heightInLines: number; }; - this._disposables.add(this._resizeSash.addListener('start', (e: ISashEvent) => { + this._disposables.push(this._resizeSash.addListener('start', (e: ISashEvent) => { if (this._viewZone) { data = { startY: e.startY, @@ -401,11 +447,11 @@ export abstract class ZoneWidget extends Widget implements IHorizontalSashLayout } })); - this._disposables.add(this._resizeSash.addListener('end', () => { + this._disposables.push(this._resizeSash.addListener('end', () => { data = undefined; })); - this._disposables.add(this._resizeSash.addListener('change', (evt: ISashEvent) => { + this._disposables.push(this._resizeSash.addListener('change', (evt: ISashEvent) => { if (data) { let lineDelta = (evt.currentY - data.startY) / this.editor.getConfiguration().lineHeight; let roundedLineDelta = lineDelta < 0 ? Math.ceil(lineDelta) : Math.floor(lineDelta); diff --git a/src/vs/editor/browser/editor.all.ts b/src/vs/editor/editor.all.ts similarity index 90% rename from src/vs/editor/browser/editor.all.ts rename to src/vs/editor/editor.all.ts index 4223fbac790411d306e5f40f3bc36d6c415662d8..326fb9fb029c8a7166776e17e06e2937bd0678ca 100644 --- a/src/vs/editor/browser/editor.all.ts +++ b/src/vs/editor/editor.all.ts @@ -8,17 +8,17 @@ import 'vs/editor/common/controller/coreCommands'; import 'vs/editor/browser/widget/codeEditorWidget'; import 'vs/editor/browser/widget/diffEditorWidget'; +import 'vs/editor/browser/widget/diffNavigator'; import 'vs/editor/contrib/bracketMatching/common/bracketMatching'; import 'vs/css!vs/editor/contrib/bracketMatching/browser/bracketMatching'; import 'vs/editor/contrib/caretOperations/common/caretOperations'; import 'vs/editor/contrib/caretOperations/common/transpose'; import 'vs/editor/contrib/clipboard/browser/clipboard'; -import 'vs/editor/contrib/codelens/browser/codelens'; +import 'vs/editor/contrib/codelens/browser/codelensController'; import 'vs/editor/contrib/comment/common/comment'; import 'vs/editor/contrib/contextmenu/browser/contextmenu'; import 'vs/editor/contrib/cursorUndo/browser/cursorUndo'; -import 'vs/editor/contrib/diffNavigator/common/diffNavigator'; import 'vs/editor/contrib/dnd/browser/dnd'; import 'vs/editor/contrib/find/browser/find'; import 'vs/editor/contrib/folding/browser/folding'; @@ -28,11 +28,9 @@ import 'vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse'; import 'vs/editor/contrib/gotoError/browser/gotoError'; import 'vs/editor/contrib/hover/browser/hover'; import 'vs/editor/contrib/inPlaceReplace/common/inPlaceReplace'; -import 'vs/editor/contrib/iPadShowKeyboard/browser/iPadShowKeyboard'; import 'vs/editor/contrib/linesOperations/common/linesOperations'; import 'vs/editor/contrib/links/browser/links'; import 'vs/editor/contrib/multicursor/common/multicursor'; -import 'vs/editor/contrib/multicursor/browser/menuPreventer'; import 'vs/editor/contrib/parameterHints/browser/parameterHints'; import 'vs/editor/contrib/quickFix/browser/quickFixCommands'; import 'vs/editor/contrib/referenceSearch/browser/referenceSearch'; diff --git a/src/vs/editor/editor.main.ts b/src/vs/editor/editor.main.ts index 8e3a8c151dd0697d7750fac021ca2a2fce37ea3c..d4e39e8151eedb4b1189e767c8d3b14e5cddf771 100644 --- a/src/vs/editor/editor.main.ts +++ b/src/vs/editor/editor.main.ts @@ -5,26 +5,35 @@ 'use strict'; -import 'vs/editor/browser/editor.all'; -import 'vs/editor/contrib/quickOpen/browser/quickOutline'; -import 'vs/editor/contrib/quickOpen/browser/gotoLine'; -import 'vs/editor/contrib/quickOpen/browser/quickCommand'; -import 'vs/editor/contrib/inspectTokens/browser/inspectTokens'; +import 'vs/editor/editor.all'; +import 'vs/editor/standalone/browser/inspectTokens/inspectTokens'; +import 'vs/editor/standalone/browser/iPadShowKeyboard/iPadShowKeyboard'; +import 'vs/editor/standalone/browser/quickOpen/quickOutline'; +import 'vs/editor/standalone/browser/quickOpen/gotoLine'; +import 'vs/editor/standalone/browser/quickOpen/quickCommand'; +import 'vs/editor/standalone/browser/toggleHighContrast/toggleHighContrast'; import { createMonacoBaseAPI } from 'vs/editor/common/standalone/standaloneBase'; -import { createMonacoEditorAPI } from 'vs/editor/browser/standalone/standaloneEditor'; -import { createMonacoLanguagesAPI } from 'vs/editor/browser/standalone/standaloneLanguages'; -import { EDITOR_DEFAULTS, WrappingIndent } from "vs/editor/common/config/editorOptions"; +import { createMonacoEditorAPI } from 'vs/editor/standalone/browser/standaloneEditor'; +import { createMonacoLanguagesAPI } from 'vs/editor/standalone/browser/standaloneLanguages'; +import { EDITOR_DEFAULTS, WrappingIndent } from 'vs/editor/common/config/editorOptions'; // Set defaults for standalone editor (EDITOR_DEFAULTS).wrappingIndent = WrappingIndent.None; (EDITOR_DEFAULTS.contribInfo).folding = false; (EDITOR_DEFAULTS.viewInfo).glyphMargin = false; +let base = createMonacoBaseAPI(); +for (let prop in base) { + if (base.hasOwnProperty(prop)) { + exports[prop] = base[prop]; + } +} +exports.editor = createMonacoEditorAPI(); +exports.languages = createMonacoLanguagesAPI(); + var global: any = self; -global.monaco = createMonacoBaseAPI(); -global.monaco.editor = createMonacoEditorAPI(); -global.monaco.languages = createMonacoLanguagesAPI(); +global.monaco = exports; if (typeof global.require !== 'undefined' && typeof global.require.config === 'function') { global.require.config({ diff --git a/src/vs/editor/browser/standalone/colorizer.ts b/src/vs/editor/standalone/browser/colorizer.ts similarity index 98% rename from src/vs/editor/browser/standalone/colorizer.ts rename to src/vs/editor/standalone/browser/colorizer.ts index 2351deff158e7bad7dfa471026cb8dfd697938b8..d3834a81578dca6eea4489926153e9fc9bf4ced0 100644 --- a/src/vs/editor/browser/standalone/colorizer.ts +++ b/src/vs/editor/standalone/browser/colorizer.ts @@ -13,7 +13,7 @@ import { renderViewLine, RenderLineInput } from 'vs/editor/common/viewLayout/vie import { ViewLineToken } from 'vs/editor/common/core/viewLineToken'; import { LineTokens } from 'vs/editor/common/core/lineTokens'; import * as strings from 'vs/base/common/strings'; -import { IStandaloneThemeService } from 'vs/editor/common/services/standaloneThemeService'; +import { IStandaloneThemeService } from 'vs/editor/standalone/common/standaloneThemeService'; export interface IColorizerOptions { tabSize?: number; diff --git a/src/vs/editor/contrib/iPadShowKeyboard/browser/iPadShowKeyboard.css b/src/vs/editor/standalone/browser/iPadShowKeyboard/iPadShowKeyboard.css similarity index 100% rename from src/vs/editor/contrib/iPadShowKeyboard/browser/iPadShowKeyboard.css rename to src/vs/editor/standalone/browser/iPadShowKeyboard/iPadShowKeyboard.css diff --git a/src/vs/editor/contrib/iPadShowKeyboard/browser/iPadShowKeyboard.ts b/src/vs/editor/standalone/browser/iPadShowKeyboard/iPadShowKeyboard.ts similarity index 100% rename from src/vs/editor/contrib/iPadShowKeyboard/browser/iPadShowKeyboard.ts rename to src/vs/editor/standalone/browser/iPadShowKeyboard/iPadShowKeyboard.ts diff --git a/src/vs/editor/contrib/iPadShowKeyboard/browser/keyboard-inverse.svg b/src/vs/editor/standalone/browser/iPadShowKeyboard/keyboard-inverse.svg similarity index 100% rename from src/vs/editor/contrib/iPadShowKeyboard/browser/keyboard-inverse.svg rename to src/vs/editor/standalone/browser/iPadShowKeyboard/keyboard-inverse.svg diff --git a/src/vs/editor/contrib/iPadShowKeyboard/browser/keyboard.svg b/src/vs/editor/standalone/browser/iPadShowKeyboard/keyboard.svg similarity index 100% rename from src/vs/editor/contrib/iPadShowKeyboard/browser/keyboard.svg rename to src/vs/editor/standalone/browser/iPadShowKeyboard/keyboard.svg diff --git a/src/vs/editor/contrib/inspectTokens/browser/inspectTokens.css b/src/vs/editor/standalone/browser/inspectTokens/inspectTokens.css similarity index 100% rename from src/vs/editor/contrib/inspectTokens/browser/inspectTokens.css rename to src/vs/editor/standalone/browser/inspectTokens/inspectTokens.css diff --git a/src/vs/editor/contrib/inspectTokens/browser/inspectTokens.ts b/src/vs/editor/standalone/browser/inspectTokens/inspectTokens.ts similarity index 99% rename from src/vs/editor/contrib/inspectTokens/browser/inspectTokens.ts rename to src/vs/editor/standalone/browser/inspectTokens/inspectTokens.ts index b84e899b1378ebfae4f9f6bf70395db02be2dca9..8964611f5878ec7719ea916e4128b4993a14ce36 100644 --- a/src/vs/editor/contrib/inspectTokens/browser/inspectTokens.ts +++ b/src/vs/editor/standalone/browser/inspectTokens/inspectTokens.ts @@ -17,7 +17,7 @@ import { IModeService } from 'vs/editor/common/services/modeService'; import { TokenMetadata } from 'vs/editor/common/model/tokensBinaryEncoding'; import { TokenizationRegistry, LanguageIdentifier, FontStyle, StandardTokenType, ITokenizationSupport, IState } from 'vs/editor/common/modes'; import { CharCode } from 'vs/base/common/charCode'; -import { IStandaloneThemeService } from 'vs/editor/common/services/standaloneThemeService'; +import { IStandaloneThemeService } from 'vs/editor/standalone/common/standaloneThemeService'; import { NULL_STATE, nullTokenize, nullTokenize2 } from 'vs/editor/common/modes/nullMode'; import { Token } from 'vs/editor/common/core/token'; import { Color } from 'vs/base/common/color'; diff --git a/src/vs/editor/contrib/quickOpen/browser/editorQuickOpen.ts b/src/vs/editor/standalone/browser/quickOpen/editorQuickOpen.ts similarity index 98% rename from src/vs/editor/contrib/quickOpen/browser/editorQuickOpen.ts rename to src/vs/editor/standalone/browser/quickOpen/editorQuickOpen.ts index 3b088852ed418e8b535e14aea37eb86980e64dcc..6117ad98768d43f0f8a163311652d3706063a4c7 100644 --- a/src/vs/editor/contrib/quickOpen/browser/editorQuickOpen.ts +++ b/src/vs/editor/standalone/browser/quickOpen/editorQuickOpen.ts @@ -14,7 +14,7 @@ import { Selection } from 'vs/editor/common/core/selection'; import { IActionOptions, EditorAction } from 'vs/editor/common/editorCommonExtensions'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { Range } from 'vs/editor/common/core/range'; -import { ModelDecorationOptions } from "vs/editor/common/model/textModelWithDecorations"; +import { ModelDecorationOptions } from 'vs/editor/common/model/textModelWithDecorations'; export interface IQuickOpenControllerOpts { inputAriaLabel: string; diff --git a/src/vs/editor/contrib/quickOpen/browser/gotoLine.css b/src/vs/editor/standalone/browser/quickOpen/gotoLine.css similarity index 100% rename from src/vs/editor/contrib/quickOpen/browser/gotoLine.css rename to src/vs/editor/standalone/browser/quickOpen/gotoLine.css diff --git a/src/vs/editor/contrib/quickOpen/browser/gotoLine.ts b/src/vs/editor/standalone/browser/quickOpen/gotoLine.ts similarity index 100% rename from src/vs/editor/contrib/quickOpen/browser/gotoLine.ts rename to src/vs/editor/standalone/browser/quickOpen/gotoLine.ts diff --git a/src/vs/editor/contrib/quickOpen/browser/quickCommand.ts b/src/vs/editor/standalone/browser/quickOpen/quickCommand.ts similarity index 100% rename from src/vs/editor/contrib/quickOpen/browser/quickCommand.ts rename to src/vs/editor/standalone/browser/quickOpen/quickCommand.ts diff --git a/src/vs/editor/contrib/quickOpen/browser/quickOpenEditorWidget.ts b/src/vs/editor/standalone/browser/quickOpen/quickOpenEditorWidget.ts similarity index 100% rename from src/vs/editor/contrib/quickOpen/browser/quickOpenEditorWidget.ts rename to src/vs/editor/standalone/browser/quickOpen/quickOpenEditorWidget.ts diff --git a/src/vs/editor/contrib/quickOpen/browser/quickOutline.css b/src/vs/editor/standalone/browser/quickOpen/quickOutline.css similarity index 100% rename from src/vs/editor/contrib/quickOpen/browser/quickOutline.css rename to src/vs/editor/standalone/browser/quickOpen/quickOutline.css diff --git a/src/vs/editor/contrib/quickOpen/browser/quickOutline.ts b/src/vs/editor/standalone/browser/quickOpen/quickOutline.ts similarity index 98% rename from src/vs/editor/contrib/quickOpen/browser/quickOutline.ts rename to src/vs/editor/standalone/browser/quickOpen/quickOutline.ts index 5c224a3d5a8dc53a2f37a1e773d8ee691093b4dd..47a23f9ebe5b135e0732351aecf8e04b7cf88cc8 100644 --- a/src/vs/editor/contrib/quickOpen/browser/quickOutline.ts +++ b/src/vs/editor/standalone/browser/quickOpen/quickOutline.ts @@ -15,9 +15,9 @@ import { IContext, IHighlight, QuickOpenEntryGroup, QuickOpenModel } from 'vs/ba import { IAutoFocus, Mode } from 'vs/base/parts/quickopen/common/quickOpen'; import { ICommonCodeEditor } from 'vs/editor/common/editorCommon'; import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import { SymbolInformation, DocumentSymbolProviderRegistry, symbolKindToCssClass } from 'vs/editor/common/modes'; +import { SymbolInformation, DocumentSymbolProviderRegistry, symbolKindToCssClass, IOutline } from 'vs/editor/common/modes'; import { BaseEditorQuickOpenAction, IDecorator } from './editorQuickOpen'; -import { getDocumentSymbols, IOutline } from 'vs/editor/contrib/quickOpen/common/quickOpen'; +import { getDocumentSymbols } from 'vs/editor/contrib/quickOpen/common/quickOpen'; import { editorAction, ServicesAccessor } from 'vs/editor/common/editorCommonExtensions'; import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; import { Range } from 'vs/editor/common/core/range'; diff --git a/src/vs/editor/contrib/quickOpen/browser/symbol-sprite.svg b/src/vs/editor/standalone/browser/quickOpen/symbol-sprite.svg similarity index 100% rename from src/vs/editor/contrib/quickOpen/browser/symbol-sprite.svg rename to src/vs/editor/standalone/browser/quickOpen/symbol-sprite.svg diff --git a/src/vs/editor/browser/standalone/simpleServices.ts b/src/vs/editor/standalone/browser/simpleServices.ts similarity index 81% rename from src/vs/editor/browser/standalone/simpleServices.ts rename to src/vs/editor/standalone/browser/simpleServices.ts index f9c2a8fc51e6d534e0f45c1ae1bee9173123251a..b2fbe6c070ec26d3b0499fb7208332e237178187 100644 --- a/src/vs/editor/browser/standalone/simpleServices.ts +++ b/src/vs/editor/standalone/browser/simpleServices.ts @@ -8,7 +8,7 @@ import { Schemas } from 'vs/base/common/network'; import Severity from 'vs/base/common/severity'; import URI from 'vs/base/common/uri'; import { TPromise } from 'vs/base/common/winjs.base'; -import { IConfigurationService, IConfigurationServiceEvent, IConfigurationValue, getConfigurationValue, IConfigurationKeys } from 'vs/platform/configuration/common/configuration'; +import { IConfigurationService, IConfigurationServiceEvent, IConfigurationValue, IConfigurationKeys, IConfigurationValues, Configuration, IConfigurationData, ConfigurationModel, IConfigurationOverrides } from 'vs/platform/configuration/common/configuration'; import { IEditor, IEditorInput, IEditorOptions, IEditorService, IResourceInput, Position } from 'vs/platform/editor/common/editor'; import { ICommandService, ICommand, ICommandEvent, ICommandHandler, CommandsRegistry } from 'vs/platform/commands/common/commands'; import { AbstractKeybindingService } from 'vs/platform/keybinding/common/abstractKeybindingService'; @@ -17,14 +17,16 @@ import { KeybindingResolver } from 'vs/platform/keybinding/common/keybindingReso import { IKeybindingEvent, KeybindingSource, IKeyboardEvent } from 'vs/platform/keybinding/common/keybinding'; import { ContextKeyExpr, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { IConfirmation, IMessageService } from 'vs/platform/message/common/message'; +import { IWorkspaceContextService, ILegacyWorkspace, IWorkspace } from 'vs/platform/workspace/common/workspace'; import * as editorCommon from 'vs/editor/common/editorCommon'; import { ICodeEditor, IDiffEditor } from 'vs/editor/browser/editorBrowser'; import { Selection } from 'vs/editor/common/core/selection'; import Event, { Emitter } from 'vs/base/common/event'; -import { getDefaultValues as getDefaultConfiguration } from 'vs/platform/configuration/common/model'; +import { DefaultConfigurationModel } from 'vs/platform/configuration/common/model'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IProgressService, IProgressRunner } from 'vs/platform/progress/common/progress'; -import { ITextModelResolverService, ITextModelContentProvider, ITextEditorModel } from 'vs/editor/common/services/resolverService'; +import { ITextResourceConfigurationService } from 'vs/editor/common/services/resourceConfiguration'; +import { ITextModelService, ITextModelContentProvider, ITextEditorModel } from 'vs/editor/common/services/resolverService'; import { IDisposable, IReference, ImmortalReference, combinedDisposable } from 'vs/base/common/lifecycle'; import * as dom from 'vs/base/browser/dom'; import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent'; @@ -172,7 +174,7 @@ export class SimpleEditorService implements IEditorService { } } -export class SimpleEditorModelResolverService implements ITextModelResolverService { +export class SimpleEditorModelResolverService implements ITextModelService { public _serviceBrand: any; private editor: SimpleEditor; @@ -430,31 +432,58 @@ export class SimpleConfigurationService implements IConfigurationService { private _onDidUpdateConfiguration = new Emitter(); public onDidUpdateConfiguration: Event = this._onDidUpdateConfiguration.event; - private _config: any; + private _configuration: Configuration; constructor() { - this._config = getDefaultConfiguration(); + this._configuration = new Configuration(new DefaultConfigurationModel(), new ConfigurationModel()); } - public getConfiguration(section?: any): T { - return this._config; + private configuration(): Configuration { + return this._configuration; } public reloadConfiguration(section?: string): TPromise { return TPromise.as(this.getConfiguration(section)); } - public lookup(key: string): IConfigurationValue { - return { - value: getConfigurationValue(this.getConfiguration(), key), - default: getConfigurationValue(this.getConfiguration(), key), - user: getConfigurationValue(this.getConfiguration(), key) - }; + public getConfiguration(section?: string, options?: IConfigurationOverrides): C { + return this.configuration().getValue(section, options); + } + + public lookup(key: string, options?: IConfigurationOverrides): IConfigurationValue { + return this.configuration().lookup(key, options); } public keys(): IConfigurationKeys { - return { default: [], user: [] }; + return this.configuration().keys(); + } + + public values(): IConfigurationValues { + return this._configuration.values(); + } + + public getConfigurationData(): IConfigurationData { + return this.configuration().toData(); + } +} + +export class SimpleResourceConfigurationService implements ITextResourceConfigurationService { + + _serviceBrand: any; + + public readonly onDidUpdateConfiguration: Event; + private readonly _onDidUpdateConfigurationEmitter = new Emitter(); + + constructor(private configurationService: SimpleConfigurationService) { + this.configurationService.onDidUpdateConfiguration(() => { + this._onDidUpdateConfigurationEmitter.fire(); + }); } + + public getConfiguration(): T { + return this.configurationService.getConfiguration(); + } + } export class SimpleMenuService implements IMenuService { @@ -489,3 +518,49 @@ export class StandaloneTelemetryService implements ITelemetryService { return null; } } + +export class SimpleWorkspaceContextService implements IWorkspaceContextService { + + public _serviceBrand: any; + + private static SCHEME: 'inmemory'; + + private readonly _onDidChangeWorkspaceRoots: Emitter = new Emitter(); + public readonly onDidChangeWorkspaceRoots: Event = this._onDidChangeWorkspaceRoots.event; + + private readonly legacyWorkspace: ILegacyWorkspace; + private readonly workspace: IWorkspace; + + constructor() { + this.legacyWorkspace = { resource: URI.from({ scheme: SimpleWorkspaceContextService.SCHEME, authority: 'model', path: '/' }) }; + this.workspace = { id: '4064f6ec-cb38-4ad0-af64-ee6467e63c82', roots: [this.legacyWorkspace.resource], name: this.legacyWorkspace.resource.fsPath }; + } + + public getWorkspace(): ILegacyWorkspace { + return this.legacyWorkspace; + } + + public getWorkspace2(): IWorkspace { + return this.workspace; + } + + public getRoot(resource: URI): URI { + return resource && resource.scheme === SimpleWorkspaceContextService.SCHEME ? this.workspace.roots[0] : void 0; + } + + public hasWorkspace(): boolean { + return true; + } + + public isInsideWorkspace(resource: URI): boolean { + return resource && resource.scheme === SimpleWorkspaceContextService.SCHEME; + } + + public toWorkspaceRelativePath(resource: URI, toOSPath?: boolean): string { + return resource.fsPath; + } + + public toResource(workspaceRelativePath: string): URI { + return URI.file(workspaceRelativePath); + } +} diff --git a/src/vs/editor/standalone/browser/standalone-tokens.css b/src/vs/editor/standalone/browser/standalone-tokens.css new file mode 100644 index 0000000000000000000000000000000000000000..09fa35644b2bb19d7d375a21f69a5fe0e036403c --- /dev/null +++ b/src/vs/editor/standalone/browser/standalone-tokens.css @@ -0,0 +1,251 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + + +/* Default standalone editor font */ +.monaco-editor { + font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", "Ubuntu", "Droid Sans", sans-serif; +} + +.monaco-menu .monaco-action-bar.vertical .action-item .action-label:focus { + color: #0059AC; + stroke-width: 1.2px; + text-shadow: 0px 0px 0.15px #0059AC; +} + +.monaco-editor.vs-dark .monaco-menu .monaco-action-bar.vertical .action-item .action-label:focus, +.monaco-editor.hc-black .monaco-menu .monaco-action-bar.vertical .action-item .action-label:focus { + color: #ACDDFF; + stroke-width: 1.2px; + text-shadow: 0px 0px 0.15px #ACDDFF; +} + +.monaco-editor-hover p { + margin: 0; +} + +/* The hc-black theme is already high contrast optimized */ +.monaco-editor.hc-black { + -ms-high-contrast-adjust: none; +} +/* In case the browser goes into high contrast mode and the editor is not configured with the hc-black theme */ +@media screen and (-ms-high-contrast:active) { + + /* current line highlight */ + .monaco-editor.vs .view-overlays .current-line, + .monaco-editor.vs-dark .view-overlays .current-line { + border-color: windowtext !important; + border-left: 0; + border-right: 0; + } + + /* view cursors */ + .monaco-editor.vs .cursor, + .monaco-editor.vs-dark .cursor { + background-color: windowtext !important; + } + /* dnd target */ + .monaco-editor.vs .dnd-target, + .monaco-editor.vs-dark .dnd-target { + border-color: windowtext !important; + } + + /* selected text background */ + .monaco-editor.vs .selected-text, + .monaco-editor.vs-dark .selected-text { + background-color: highlight !important; + } + + /* allow the text to have a transparent background. */ + .monaco-editor.vs .view-line, + .monaco-editor.vs-dark .view-line { + -ms-high-contrast-adjust: none; + } + + /* text color */ + .monaco-editor.vs .view-line span, + .monaco-editor.vs-dark .view-line span { + color: windowtext !important; + } + /* selected text color */ + .monaco-editor.vs .view-line span.inline-selected-text, + .monaco-editor.vs-dark .view-line span.inline-selected-text { + color: highlighttext !important; + } + + /* allow decorations */ + .monaco-editor.vs .view-overlays, + .monaco-editor.vs-dark .view-overlays { + -ms-high-contrast-adjust: none; + } + + /* various decorations */ + .monaco-editor.vs .selectionHighlight, + .monaco-editor.vs-dark .selectionHighlight, + .monaco-editor.vs .wordHighlight, + .monaco-editor.vs-dark .wordHighlight, + .monaco-editor.vs .wordHighlightStrong, + .monaco-editor.vs-dark .wordHighlightStrong, + .monaco-editor.vs .reference-decoration, + .monaco-editor.vs-dark .reference-decoration { + border: 2px dotted highlight !important; + background: transparent !important; + box-sizing: border-box; + } + .monaco-editor.vs .rangeHighlight, + .monaco-editor.vs-dark .rangeHighlight { + background: transparent !important; + border: 1px dotted activeborder !important; + box-sizing: border-box; + } + .monaco-editor.vs .bracket-match, + .monaco-editor.vs-dark .bracket-match { + border-color: windowtext !important; + background: transparent !important; + } + + /* find widget */ + .monaco-editor.vs .findMatch, + .monaco-editor.vs-dark .findMatch, + .monaco-editor.vs .currentFindMatch, + .monaco-editor.vs-dark .currentFindMatch { + border: 2px dotted activeborder !important; + background: transparent !important; + box-sizing: border-box; + } + .monaco-editor.vs .find-widget, + .monaco-editor.vs-dark .find-widget { + border: 1px solid windowtext; + } + + /* list - used by suggest widget */ + .monaco-editor.vs .monaco-list .monaco-list-row, + .monaco-editor.vs-dark .monaco-list .monaco-list-row { + -ms-high-contrast-adjust: none; + color: windowtext !important; + } + .monaco-editor.vs .monaco-list .monaco-list-row.focused, + .monaco-editor.vs-dark .monaco-list .monaco-list-row.focused { + color: highlighttext !important; + background-color: highlight !important; + } + .monaco-editor.vs .monaco-list .monaco-list-row:hover, + .monaco-editor.vs-dark .monaco-list .monaco-list-row:hover { + background: transparent !important; + border: 1px solid highlight; + box-sizing: border-box; + } + + /* tree */ + .monaco-editor.vs .monaco-tree .monaco-tree-row, + .monaco-editor.vs-dark .monaco-tree .monaco-tree-row { + -ms-high-contrast-adjust: none; + color: windowtext !important; + } + .monaco-editor.vs .monaco-tree .monaco-tree-row.selected, + .monaco-editor.vs-dark .monaco-tree .monaco-tree-row.selected, + .monaco-editor.vs .monaco-tree .monaco-tree-row.focused, + .monaco-editor.vs-dark .monaco-tree .monaco-tree-row.focused { + color: highlighttext !important; + background-color: highlight !important; + } + .monaco-editor.vs .monaco-tree .monaco-tree-row:hover, + .monaco-editor.vs-dark .monaco-tree .monaco-tree-row:hover { + background: transparent !important; + border: 1px solid highlight; + box-sizing: border-box; + } + + /* scrollbars */ + .monaco-editor.vs .monaco-scrollable-element > .scrollbar, + .monaco-editor.vs-dark .monaco-scrollable-element > .scrollbar { + -ms-high-contrast-adjust: none; + background: background !important; + border: 1px solid windowtext; + box-sizing: border-box; + } + .monaco-editor.vs .monaco-scrollable-element > .scrollbar > .slider, + .monaco-editor.vs-dark .monaco-scrollable-element > .scrollbar > .slider { + background: windowtext !important; + } + .monaco-editor.vs .monaco-scrollable-element > .scrollbar > .slider:hover, + .monaco-editor.vs-dark .monaco-scrollable-element > .scrollbar > .slider:hover { + background: highlight !important; + } + .monaco-editor.vs .monaco-scrollable-element > .scrollbar > .slider.active, + .monaco-editor.vs-dark .monaco-scrollable-element > .scrollbar > .slider.active { + background: highlight !important; + } + + /* overview ruler */ + .monaco-editor.vs .decorationsOverviewRuler, + .monaco-editor.vs-dark .decorationsOverviewRuler { + opacity: 0; + } + + /* minimap */ + .monaco-editor.vs .minimap, + .monaco-editor.vs-dark .minimap { + display: none; + } + + /* squiggles */ + .monaco-editor.vs .redsquiggly, + .monaco-editor.vs-dark .redsquiggly { + background: transparent !important; + border-bottom: 4px double #E47777; + } + .monaco-editor.vs .greensquiggly, + .monaco-editor.vs-dark .greensquiggly { + border-bottom: 4px double #71B771; + } + + /* contextmenu */ + .monaco-editor.vs .monaco-menu .monaco-action-bar.vertical .action-item .action-label:focus, + .monaco-editor.vs-dark .monaco-menu .monaco-action-bar.vertical .action-item .action-label:focus { + -ms-high-contrast-adjust: none; + color: highlighttext !important; + background-color: highlight !important; + } + .monaco-editor.vs .monaco-menu .monaco-action-bar.vertical .action-item .action-label:hover, + .monaco-editor.vs-dark .monaco-menu .monaco-action-bar.vertical .action-item .action-label:hover { + -ms-high-contrast-adjust: none; + background: transparent !important; + border: 1px solid highlight; + box-sizing: border-box; + } + + /* diff editor */ + .monaco-diff-editor.vs .diffOverviewRuler, + .monaco-diff-editor.vs-dark .diffOverviewRuler { + display: none; + } + .monaco-editor.vs .line-insert, + .monaco-editor.vs-dark .line-insert, + .monaco-editor.vs .line-delete, + .monaco-editor.vs-dark .line-delete { + background: transparent !important; + border: 1px solid highlight !important; + box-sizing: border-box; + } + .monaco-editor.vs .char-insert, + .monaco-editor.vs-dark .char-insert, + .monaco-editor.vs .char-delete, + .monaco-editor.vs-dark .char-delete { + background: transparent !important; + } +} + +/*.monaco-editor.vs [tabindex="0"]:focus { + outline: 1px solid rgba(0, 122, 204, 0.4); + outline-offset: -1px; + opacity: 1 !important; +} + +.monaco-editor.vs-dark [tabindex="0"]:focus { + outline: 1px solid rgba(14, 99, 156, 0.6); + outline-offset: -1px; + opacity: 1 !important; +}*/ diff --git a/src/vs/editor/browser/standalone/standaloneCodeEditor.ts b/src/vs/editor/standalone/browser/standaloneCodeEditor.ts similarity index 95% rename from src/vs/editor/browser/standalone/standaloneCodeEditor.ts rename to src/vs/editor/standalone/browser/standaloneCodeEditor.ts index 2a3a9789ed453e75065d4d4bbd01a9a129832646..eba533c0f79f6b731da70628de870015ff4b9824 100644 --- a/src/vs/editor/browser/standalone/standaloneCodeEditor.ts +++ b/src/vs/editor/standalone/browser/standaloneCodeEditor.ts @@ -15,16 +15,17 @@ import { ContextKeyExpr, IContextKey, IContextKeyService } from 'vs/platform/con import { IActionDescriptor, IModel, IModelChangedEvent } from 'vs/editor/common/editorCommon'; import { ICodeEditorService } from 'vs/editor/common/services/codeEditorService'; import { IEditorWorkerService } from 'vs/editor/common/services/editorWorkerService'; -import { StandaloneKeybindingService } from 'vs/editor/browser/standalone/simpleServices'; -import { IEditorContextViewService } from 'vs/editor/browser/standalone/standaloneServices'; +import { StandaloneKeybindingService } from 'vs/editor/standalone/browser/simpleServices'; +import { IEditorContextViewService } from 'vs/editor/standalone/browser/standaloneServices'; import { CodeEditor } from 'vs/editor/browser/codeEditor'; import { DiffEditorWidget } from 'vs/editor/browser/widget/diffEditorWidget'; import { ICodeEditor, IDiffEditor } from 'vs/editor/browser/editorBrowser'; -import { IStandaloneThemeService } from 'vs/editor/common/services/standaloneThemeService'; +import { IStandaloneThemeService } from 'vs/editor/standalone/common/standaloneThemeService'; import { InternalEditorAction } from 'vs/editor/common/editorAction'; import { MenuId, MenuRegistry, IMenuItem } from 'vs/platform/actions/common/actions'; import { IDiffEditorOptions, IEditorOptions } from 'vs/editor/common/config/editorOptions'; import { IThemeService } from 'vs/platform/theme/common/themeService'; +import * as aria from 'vs/base/browser/ui/aria/aria'; /** * The options to create an editor. @@ -83,6 +84,15 @@ export interface IStandaloneDiffEditor extends IDiffEditor { let LAST_GENERATED_COMMAND_ID = 0; +let ariaDomNodeCreated = false; +function createAriaDomNode() { + if (ariaDomNodeCreated) { + return; + } + ariaDomNodeCreated = true; + aria.setARIAContainer(document.body); +} + /** * A code editor to be used both by the standalone editor and the standalone diff editor. */ @@ -105,6 +115,9 @@ export class StandaloneCodeEditor extends CodeEditor implements IStandaloneCodeE if (keybindingService instanceof StandaloneKeybindingService) { this._standaloneKeybindingService = keybindingService; } + + // Create the ARIA dom node as soon as the first editor is instantiated + createAriaDomNode(); } public addCommand(keybinding: number, handler: ICommandHandler, context: string): string { diff --git a/src/vs/editor/browser/standalone/standaloneEditor.ts b/src/vs/editor/standalone/browser/standaloneEditor.ts similarity index 95% rename from src/vs/editor/browser/standalone/standaloneEditor.ts rename to src/vs/editor/standalone/browser/standaloneEditor.ts index 776016912c41f97989582f635de9e76a8d6405de..5b8a1babae82fdb6f9e0b70c9419c6ca0ff6daf4 100644 --- a/src/vs/editor/browser/standalone/standaloneEditor.ts +++ b/src/vs/editor/standalone/browser/standaloneEditor.ts @@ -4,23 +4,23 @@ *--------------------------------------------------------------------------------------------*/ 'use strict'; -import 'vs/css!./media/standalone-tokens'; +import 'vs/css!./standalone-tokens'; import * as editorCommon from 'vs/editor/common/editorCommon'; import { ICodeEditor, ContentWidgetPositionPreference, OverlayWidgetPositionPreference, MouseTargetType } from 'vs/editor/browser/editorBrowser'; -import { StandaloneEditor, IStandaloneCodeEditor, StandaloneDiffEditor, IStandaloneDiffEditor, IEditorConstructionOptions, IDiffEditorConstructionOptions } from 'vs/editor/browser/standalone/standaloneCodeEditor'; +import { StandaloneEditor, IStandaloneCodeEditor, StandaloneDiffEditor, IStandaloneDiffEditor, IEditorConstructionOptions, IDiffEditorConstructionOptions } from 'vs/editor/standalone/browser/standaloneCodeEditor'; import { ScrollbarVisibility } from 'vs/base/common/scrollable'; -import { IEditorOverrideServices, DynamicStandaloneServices, StaticServices } from 'vs/editor/browser/standalone/standaloneServices'; +import { IEditorOverrideServices, DynamicStandaloneServices, StaticServices } from 'vs/editor/standalone/browser/standaloneServices'; import { IDisposable } from 'vs/base/common/lifecycle'; import URI from 'vs/base/common/uri'; import { TPromise } from 'vs/base/common/winjs.base'; import { OpenerService } from 'vs/platform/opener/browser/openerService'; import { IOpenerService } from 'vs/platform/opener/common/opener'; -import { Colorizer, IColorizerElementOptions, IColorizerOptions } from 'vs/editor/browser/standalone/colorizer'; -import { SimpleEditorService, SimpleEditorModelResolverService } from 'vs/editor/browser/standalone/simpleServices'; +import { Colorizer, IColorizerElementOptions, IColorizerOptions } from 'vs/editor/standalone/browser/colorizer'; +import { SimpleEditorService, SimpleEditorModelResolverService } from 'vs/editor/standalone/browser/simpleServices'; import * as modes from 'vs/editor/common/modes'; import { IWebWorkerOptions, MonacoWebWorker, createWebWorker as actualCreateWebWorker } from 'vs/editor/common/services/webWorker'; import { IMarkerData } from 'vs/platform/markers/common/markers'; -import { DiffNavigator } from 'vs/editor/contrib/diffNavigator/common/diffNavigator'; +import { DiffNavigator } from 'vs/editor/browser/widget/diffNavigator'; import { IEditorService } from 'vs/platform/editor/common/editor'; import { ICommandService } from 'vs/platform/commands/common/commands'; import { IContextViewService } from 'vs/platform/contextview/browser/contextView'; @@ -29,9 +29,9 @@ import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { ICodeEditorService } from 'vs/editor/common/services/codeEditorService'; import { IEditorWorkerService } from 'vs/editor/common/services/editorWorkerService'; -import { ITextModelResolverService } from 'vs/editor/common/services/resolverService'; +import { ITextModelService } from 'vs/editor/common/services/resolverService'; import { NULL_STATE, nullTokenize } from 'vs/editor/common/modes/nullMode'; -import { IStandaloneThemeData, IStandaloneThemeService } from 'vs/editor/common/services/standaloneThemeService'; +import { IStandaloneThemeData, IStandaloneThemeService } from 'vs/editor/standalone/common/standaloneThemeService'; import { Token } from 'vs/editor/common/core/token'; import { FontInfo, BareFontInfo } from 'vs/editor/common/config/fontInfo'; import * as editorOptions from 'vs/editor/common/config/editorOptions'; @@ -55,9 +55,9 @@ function withAllStandaloneServices(domElement: H } let simpleEditorModelResolverService: SimpleEditorModelResolverService = null; - if (!services.has(ITextModelResolverService)) { + if (!services.has(ITextModelService)) { simpleEditorModelResolverService = new SimpleEditorModelResolverService(); - services.set(ITextModelResolverService, simpleEditorModelResolverService); + services.set(ITextModelService, simpleEditorModelResolverService); } if (!services.has(IOpenerService)) { diff --git a/src/vs/editor/browser/standalone/standaloneLanguages.ts b/src/vs/editor/standalone/browser/standaloneLanguages.ts similarity index 93% rename from src/vs/editor/browser/standalone/standaloneLanguages.ts rename to src/vs/editor/standalone/browser/standaloneLanguages.ts index 2e23e5a33ec02e317b03e429f135f2a5ee026d8c..176488944508b1118ca38c9d235afcc492c49cba 100644 --- a/src/vs/editor/browser/standalone/standaloneLanguages.ts +++ b/src/vs/editor/standalone/browser/standaloneLanguages.ts @@ -8,9 +8,9 @@ import { TPromise } from 'vs/base/common/winjs.base'; import { IDisposable } from 'vs/base/common/lifecycle'; import { ModesRegistry } from 'vs/editor/common/modes/modesRegistry'; -import { IMonarchLanguage } from 'vs/editor/common/modes/monarch/monarchTypes'; +import { IMonarchLanguage } from 'vs/editor/standalone/common/monarch/monarchTypes'; import { ILanguageExtensionPoint } from 'vs/editor/common/services/modeService'; -import { StaticServices } from 'vs/editor/browser/standalone/standaloneServices'; +import { StaticServices } from 'vs/editor/standalone/browser/standaloneServices'; import * as modes from 'vs/editor/common/modes'; import { LanguageConfiguration, IndentAction } from 'vs/editor/common/modes/languageConfiguration'; import * as editorCommon from 'vs/editor/common/editorCommon'; @@ -18,12 +18,12 @@ import { Position } from 'vs/editor/common/core/position'; import { Range } from 'vs/editor/common/core/range'; import { CancellationToken } from 'vs/base/common/cancellation'; import { toThenable } from 'vs/base/common/async'; -import { compile } from 'vs/editor/common/modes/monarch/monarchCompile'; -import { createTokenizationSupport } from 'vs/editor/common/modes/monarch/monarchLexer'; +import { compile } from 'vs/editor/standalone/common/monarch/monarchCompile'; +import { createTokenizationSupport } from 'vs/editor/standalone/common/monarch/monarchLexer'; import { LanguageConfigurationRegistry } from 'vs/editor/common/modes/languageConfigurationRegistry'; import { IMarkerData } from 'vs/platform/markers/common/markers'; import { Token, TokenizationResult, TokenizationResult2 } from 'vs/editor/common/core/token'; -import { IStandaloneThemeService } from 'vs/editor/common/services/standaloneThemeService'; +import { IStandaloneThemeService } from 'vs/editor/standalone/common/standaloneThemeService'; /** * Register information about a new language. @@ -89,9 +89,23 @@ export class TokenizationSupport2Adapter implements modes.ITokenizationSupport { private _toClassicTokens(tokens: IToken[], language: string, offsetDelta: number): Token[] { let result: Token[] = []; + let previousStartIndex: number = 0; for (let i = 0, len = tokens.length; i < len; i++) { - let t = tokens[i]; - result[i] = new Token(t.startIndex + offsetDelta, t.scopes, language); + const t = tokens[i]; + let startIndex = t.startIndex; + + // Prevent issues stemming from a buggy external tokenizer. + if (i === 0) { + // Force first token to start at first index! + startIndex = 0; + } else if (startIndex < previousStartIndex) { + // Force tokens to be after one another! + startIndex = previousStartIndex; + } + + result[i] = new Token(startIndex + offsetDelta, t.scopes, language); + + previousStartIndex = startIndex; } return result; } @@ -112,19 +126,34 @@ export class TokenizationSupport2Adapter implements modes.ITokenizationSupport { } private _toBinaryTokens(tokens: IToken[], offsetDelta: number): Uint32Array { - let languageId = this._languageIdentifier.id; - let tokenTheme = this._standaloneThemeService.getTheme().tokenTheme; + const languageId = this._languageIdentifier.id; + const tokenTheme = this._standaloneThemeService.getTheme().tokenTheme; let result: number[] = [], resultLen = 0; + let previousStartIndex: number = 0; for (let i = 0, len = tokens.length; i < len; i++) { - let t = tokens[i]; - let metadata = tokenTheme.match(languageId, t.scopes); + const t = tokens[i]; + const metadata = tokenTheme.match(languageId, t.scopes); if (resultLen > 0 && result[resultLen - 1] === metadata) { // same metadata continue; } - result[resultLen++] = t.startIndex; + + let startIndex = t.startIndex; + + // Prevent issues stemming from a buggy external tokenizer. + if (i === 0) { + // Force first token to start at first index! + startIndex = 0; + } else if (startIndex < previousStartIndex) { + // Force tokens to be after one another! + startIndex = previousStartIndex; + } + + result[resultLen++] = startIndex + offsetDelta; result[resultLen++] = metadata; + + previousStartIndex = startIndex; } let actualResult = new Uint32Array(resultLen); @@ -261,7 +290,7 @@ export function registerDocumentSymbolProvider(languageId: string, provider: mod } /** - * Register a document highlight provider (used by e.g. highlight occurences). + * Register a document highlight provider (used by e.g. highlight occurrences). */ export function registerDocumentHighlightProvider(languageId: string, provider: modes.DocumentHighlightProvider): IDisposable { return modes.DocumentHighlightProviderRegistry.register(languageId, provider); diff --git a/src/vs/editor/browser/standalone/standaloneServices.ts b/src/vs/editor/standalone/browser/standaloneServices.ts similarity index 88% rename from src/vs/editor/browser/standalone/standaloneServices.ts rename to src/vs/editor/standalone/browser/standaloneServices.ts index 550b5294605dd6121c12c65af21e93756830ee46..17ed8f6e8f15ca74cadd1cb01432448091c75278 100644 --- a/src/vs/editor/browser/standalone/standaloneServices.ts +++ b/src/vs/editor/standalone/browser/standaloneServices.ts @@ -5,7 +5,6 @@ 'use strict'; import { Disposable } from 'vs/base/common/lifecycle'; -import URI from 'vs/base/common/uri'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { ContextMenuService } from 'vs/platform/contextview/browser/contextMenuService'; import { IContextMenuService, IContextViewService } from 'vs/platform/contextview/browser/contextView'; @@ -22,24 +21,25 @@ import { IMessageService } from 'vs/platform/message/common/message'; import { IProgressService } from 'vs/platform/progress/common/progress'; import { IStorageService, NullStorageService } from 'vs/platform/storage/common/storage'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { IWorkspaceContextService, WorkspaceContextService } from 'vs/platform/workspace/common/workspace'; +import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { ICodeEditorService } from 'vs/editor/common/services/codeEditorService'; import { IEditorWorkerService } from 'vs/editor/common/services/editorWorkerService'; import { EditorWorkerServiceImpl } from 'vs/editor/common/services/editorWorkerServiceImpl'; +import { ITextResourceConfigurationService } from 'vs/editor/common/services/resourceConfiguration'; import { IModeService } from 'vs/editor/common/services/modeService'; import { ModeServiceImpl } from 'vs/editor/common/services/modeServiceImpl'; import { IModelService } from 'vs/editor/common/services/modelService'; import { ModelServiceImpl } from 'vs/editor/common/services/modelServiceImpl'; import { CodeEditorServiceImpl } from 'vs/editor/browser/services/codeEditorServiceImpl'; import { - SimpleConfigurationService, SimpleMenuService, SimpleMessageService, + SimpleConfigurationService, SimpleResourceConfigurationService, SimpleMenuService, SimpleMessageService, SimpleProgressService, StandaloneCommandService, StandaloneKeybindingService, - StandaloneTelemetryService -} from 'vs/editor/browser/standalone/simpleServices'; + StandaloneTelemetryService, SimpleWorkspaceContextService +} from 'vs/editor/standalone/browser/simpleServices'; import { ContextKeyService } from 'vs/platform/contextkey/browser/contextKeyService'; import { IMenuService } from 'vs/platform/actions/common/actions'; -import { IStandaloneThemeService } from 'vs/editor/common/services/standaloneThemeService'; -import { StandaloneThemeServiceImpl } from 'vs/editor/browser/services/standaloneThemeServiceImpl'; +import { IStandaloneThemeService } from 'vs/editor/standalone/common/standaloneThemeService'; +import { StandaloneThemeServiceImpl } from 'vs/editor/standalone/browser/standaloneThemeServiceImpl'; export interface IEditorContextViewService extends IContextViewService { dispose(): void; @@ -115,13 +115,14 @@ export module StaticServices { export const instantiationService = define(IInstantiationService, () => new InstantiationService(_serviceCollection, true)); - export const contextService = define(IWorkspaceContextService, () => new WorkspaceContextService({ - resource: URI.from({ scheme: 'inmemory', authority: 'model', path: '/' }) - })); + const configurationServiceImpl = new SimpleConfigurationService(); + export const configurationService = define(IConfigurationService, () => configurationServiceImpl); - export const telemetryService = define(ITelemetryService, () => new StandaloneTelemetryService()); + export const resourceConfigurationService = define(ITextResourceConfigurationService, () => new SimpleResourceConfigurationService(configurationServiceImpl)); + + export const contextService = define(IWorkspaceContextService, () => new SimpleWorkspaceContextService()); - export const configurationService = define(IConfigurationService, () => new SimpleConfigurationService()); + export const telemetryService = define(ITelemetryService, () => new StandaloneTelemetryService()); export const messageService = define(IMessageService, () => new SimpleMessageService()); @@ -131,7 +132,7 @@ export module StaticServices { export const modelService = define(IModelService, (o) => new ModelServiceImpl(markerService.get(o), configurationService.get(o))); - export const editorWorkerService = define(IEditorWorkerService, (o) => new EditorWorkerServiceImpl(modelService.get(o), configurationService.get(o), modeService.get(o))); + export const editorWorkerService = define(IEditorWorkerService, (o) => new EditorWorkerServiceImpl(modelService.get(o), resourceConfigurationService.get(o), modeService.get(o))); export const standaloneThemeService = define(IStandaloneThemeService, () => new StandaloneThemeServiceImpl()); diff --git a/src/vs/editor/browser/services/standaloneThemeServiceImpl.ts b/src/vs/editor/standalone/browser/standaloneThemeServiceImpl.ts similarity index 94% rename from src/vs/editor/browser/services/standaloneThemeServiceImpl.ts rename to src/vs/editor/standalone/browser/standaloneThemeServiceImpl.ts index ed9e8f753df3409d5c033dea06ecadd005b72dcf..be2163b1df41128b4cfcf77c5ef5334ea8643d69 100644 --- a/src/vs/editor/browser/services/standaloneThemeServiceImpl.ts +++ b/src/vs/editor/standalone/browser/standaloneThemeServiceImpl.ts @@ -5,14 +5,14 @@ 'use strict'; import { TokenTheme, ITokenThemeRule, generateTokensCSSForColorMap } from 'vs/editor/common/modes/supports/tokenization'; -import { IStandaloneThemeService, BuiltinTheme, IStandaloneThemeData, IStandaloneTheme, IColors } from 'vs/editor/common/services/standaloneThemeService'; -import { vs, vs_dark, hc_black } from 'vs/editor/common/standalone/themes'; +import { IStandaloneThemeService, BuiltinTheme, IStandaloneThemeData, IStandaloneTheme, IColors } from 'vs/editor/standalone/common/standaloneThemeService'; +import { vs, vs_dark, hc_black } from 'vs/editor/standalone/common/themes'; import * as dom from 'vs/base/browser/dom'; import { TokenizationRegistry } from 'vs/editor/common/modes'; import { Color } from 'vs/base/common/color'; import { Extensions, IColorRegistry, ColorIdentifier } from 'vs/platform/theme/common/colorRegistry'; import { Extensions as ThemingExtensions, IThemingRegistry, ICssStyleCollector } from 'vs/platform/theme/common/themeService'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import Event, { Emitter } from 'vs/base/common/event'; const VS_THEME_NAME = 'vs'; @@ -23,9 +23,10 @@ const colorRegistry = Registry.as(Extensions.ColorContribution); const themingRegistry = Registry.as(ThemingExtensions.ThemingContribution); class StandaloneTheme implements IStandaloneTheme { - id: string; + public readonly id: string; + public readonly themeName: string; private rules: ITokenThemeRule[]; - base: string; + public readonly base: string; private colors: { [colorId: string]: Color }; private defaultColors: { [colorId: string]: Color }; private _tokenTheme: TokenTheme; @@ -33,8 +34,10 @@ class StandaloneTheme implements IStandaloneTheme { constructor(base: string, name: string, colors: IColors, rules: ITokenThemeRule[]) { if (name.length > 0) { this.id = base + ' ' + name; + this.themeName = name; } else { this.id = base; + this.themeName = base; } this.base = base; this.rules = rules; diff --git a/src/vs/editor/standalone/browser/toggleHighContrast/toggleHighContrast.ts b/src/vs/editor/standalone/browser/toggleHighContrast/toggleHighContrast.ts new file mode 100644 index 0000000000000000000000000000000000000000..17197a6f7d39dd670d91c7f39a1eca0c1fed350e --- /dev/null +++ b/src/vs/editor/standalone/browser/toggleHighContrast/toggleHighContrast.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. + *--------------------------------------------------------------------------------------------*/ +'use strict'; + +import * as nls from 'vs/nls'; +import { ICommonCodeEditor } from 'vs/editor/common/editorCommon'; +import { editorAction, EditorAction, ServicesAccessor } from 'vs/editor/common/editorCommonExtensions'; +import { IStandaloneThemeService } from 'vs/editor/standalone/common/standaloneThemeService'; + +@editorAction +class ToggleHighContrast extends EditorAction { + + private _originalThemeName: string; + + constructor() { + super({ + id: 'editor.action.toggleHighContrast', + label: nls.localize('toggleHighContrast', "Toggle High Contrast Theme"), + alias: 'Toggle High Contrast Theme', + precondition: null + }); + this._originalThemeName = null; + } + + public run(accessor: ServicesAccessor, editor: ICommonCodeEditor): void { + const standaloneThemeService = accessor.get(IStandaloneThemeService); + if (this._originalThemeName) { + // We must toggle back to the integrator's theme + standaloneThemeService.setTheme(this._originalThemeName); + this._originalThemeName = null; + } else { + this._originalThemeName = standaloneThemeService.getTheme().themeName; + standaloneThemeService.setTheme('hc-black'); + } + } +} diff --git a/src/vs/editor/common/modes/monarch/monarchCommon.ts b/src/vs/editor/standalone/common/monarch/monarchCommon.ts similarity index 89% rename from src/vs/editor/common/modes/monarch/monarchCommon.ts rename to src/vs/editor/standalone/common/monarch/monarchCommon.ts index fd72d1d0cad5d444bf9b9064833588583ada2fcd..070d3572d34af12600f11e00cf4e0d4b3e9c2881 100644 --- a/src/vs/editor/common/modes/monarch/monarchCommon.ts +++ b/src/vs/editor/standalone/common/monarch/monarchCommon.ts @@ -46,19 +46,37 @@ export interface IBracket { close: string; } +export type FuzzyAction = IAction | string; + +export function isFuzzyActionArr(what: FuzzyAction | FuzzyAction[]): what is FuzzyAction[] { + return (Array.isArray(what)); +} + +export function isFuzzyAction(what: FuzzyAction | FuzzyAction[]): what is FuzzyAction { + return !isFuzzyActionArr(what); +} + +export function isString(what: FuzzyAction): what is string { + return (typeof what === 'string'); +} + +export function isIAction(what: FuzzyAction): what is IAction { + return !isString(what); +} + export interface IRule { regex: RegExp; - action: IAction; + action: FuzzyAction; matchOnlyAtLineStart: boolean; name: string; } export interface IAction { // an action is either a group of actions - group?: IAction[]; + group?: FuzzyAction[]; // or a function that returns a fresh action - test?: (id: string, matches: string[], state: string, eos: boolean) => IAction; + test?: (id: string, matches: string[], state: string, eos: boolean) => FuzzyAction; // or it is a declarative action with a token value and various other attributes token?: string; @@ -74,7 +92,7 @@ export interface IAction { export interface IBranch { name: string; - value: IAction; + value: FuzzyAction; test: (id: string, matches: string[], state: string, eos: boolean) => boolean; } diff --git a/src/vs/editor/common/modes/monarch/monarchCompile.ts b/src/vs/editor/standalone/common/monarch/monarchCompile.ts similarity index 97% rename from src/vs/editor/common/modes/monarch/monarchCompile.ts rename to src/vs/editor/standalone/common/monarch/monarchCompile.ts index 7f5fc6ebf60f1817c76b1c5e4e3803f05efcd9f2..5e730680d62b54c065e40acce4ddf7dc8f871ea6 100644 --- a/src/vs/editor/common/modes/monarch/monarchCompile.ts +++ b/src/vs/editor/standalone/common/monarch/monarchCompile.ts @@ -10,8 +10,8 @@ */ import * as objects from 'vs/base/common/objects'; -import * as monarchCommon from 'vs/editor/common/modes/monarch/monarchCommon'; -import { IMonarchLanguage, IMonarchLanguageBracket } from 'vs/editor/common/modes/monarch/monarchTypes'; +import * as monarchCommon from 'vs/editor/standalone/common/monarch/monarchCommon'; +import { IMonarchLanguage, IMonarchLanguageBracket } from 'vs/editor/standalone/common/monarch/monarchTypes'; /* * Type helpers @@ -118,7 +118,7 @@ function selectScrutinee(id: string, matches: string[], state: string, num: numb return null; } -function createGuard(lexer: monarchCommon.ILexerMin, ruleName: string, tkey: string, val: monarchCommon.IAction): monarchCommon.IBranch { +function createGuard(lexer: monarchCommon.ILexerMin, ruleName: string, tkey: string, val: monarchCommon.FuzzyAction): monarchCommon.IBranch { // get the scrutinee and pattern var scrut = -1; // -1: $!, 0-99: $n, 100+n: $Sn var oppat = tkey; @@ -222,7 +222,7 @@ function createGuard(lexer: monarchCommon.ILexerMin, ruleName: string, tkey: str * contains user functions as actions (which is usually not allowed), then this * may be called during lexing. It is important therefore to compile common cases efficiently */ -function compileAction(lexer: monarchCommon.ILexerMin, ruleName: string, action: any): monarchCommon.IAction { +function compileAction(lexer: monarchCommon.ILexerMin, ruleName: string, action: any): monarchCommon.FuzzyAction { if (!action) { return { token: '' }; } @@ -285,7 +285,7 @@ function compileAction(lexer: monarchCommon.ILexerMin, ruleName: string, action: } } else if (Array.isArray(action)) { - var results = []; + var results: monarchCommon.FuzzyAction[] = []; var idx: string; for (idx in action) { if (action.hasOwnProperty(idx)) { @@ -345,7 +345,7 @@ function compileAction(lexer: monarchCommon.ILexerMin, ruleName: string, action: */ class Rule implements monarchCommon.IRule { public regex: RegExp = new RegExp(''); - public action: monarchCommon.IAction = { token: '' }; + public action: monarchCommon.FuzzyAction = { token: '' }; public matchOnlyAtLineStart: boolean = false; public name: string = ''; diff --git a/src/vs/editor/common/modes/monarch/monarchLexer.ts b/src/vs/editor/standalone/common/monarch/monarchLexer.ts similarity index 96% rename from src/vs/editor/common/modes/monarch/monarchLexer.ts rename to src/vs/editor/standalone/common/monarch/monarchLexer.ts index fd57abca71ab989553e442aef2990be085473e33..c50d02a8129822b00de7efff71dc3d8716772847 100644 --- a/src/vs/editor/common/modes/monarch/monarchLexer.ts +++ b/src/vs/editor/standalone/common/monarch/monarchLexer.ts @@ -11,11 +11,11 @@ import { IDisposable } from 'vs/base/common/lifecycle'; import * as modes from 'vs/editor/common/modes'; -import * as monarchCommon from 'vs/editor/common/modes/monarch/monarchCommon'; +import * as monarchCommon from 'vs/editor/standalone/common/monarch/monarchCommon'; import { IModeService } from 'vs/editor/common/services/modeService'; import { Token, TokenizationResult, TokenizationResult2 } from 'vs/editor/common/core/token'; import { NULL_STATE, NULL_MODE_ID } from 'vs/editor/common/modes/nullMode'; -import { IStandaloneThemeService } from 'vs/editor/common/services/standaloneThemeService'; +import { IStandaloneThemeService } from 'vs/editor/standalone/common/standaloneThemeService'; import { TokenTheme } from 'vs/editor/common/modes/supports/tokenization'; const CACHE_STACK_DEPTH = 5; @@ -23,7 +23,7 @@ const CACHE_STACK_DEPTH = 5; /** * Reuse the same stack elements up to a certain depth. */ -export class MonarchStackElementFactory { +class MonarchStackElementFactory { private static _INSTANCE = new MonarchStackElementFactory(CACHE_STACK_DEPTH); public static create(parent: MonarchStackElement, state: string): MonarchStackElement { @@ -59,7 +59,7 @@ export class MonarchStackElementFactory { } } -export class MonarchStackElement { +class MonarchStackElement { public readonly parent: MonarchStackElement; public readonly state: string; @@ -125,7 +125,7 @@ export class MonarchStackElement { } } -export class EmbeddedModeData { +class EmbeddedModeData { public readonly modeId: string; public readonly state: modes.IState; @@ -154,7 +154,7 @@ export class EmbeddedModeData { /** * Reuse the same line states up to a certain depth. */ -export class MonarchLineStateFactory { +class MonarchLineStateFactory { private static _INSTANCE = new MonarchLineStateFactory(CACHE_STACK_DEPTH); public static create(stack: MonarchStackElement, embeddedModeData: EmbeddedModeData): MonarchLineState { @@ -190,7 +190,7 @@ export class MonarchLineStateFactory { } } -export class MonarchLineState implements modes.IState { +class MonarchLineState implements modes.IState { public readonly stack: MonarchStackElement; public readonly embeddedModeData: EmbeddedModeData; @@ -375,7 +375,7 @@ class MonarchModernTokensCollector implements IMonarchTokensCollector { } } -export class MonarchTokenizer implements modes.ITokenizationSupport { +class MonarchTokenizer implements modes.ITokenizationSupport { private readonly _modeService: IModeService; private readonly _standaloneThemeService: IStandaloneThemeService; @@ -459,7 +459,7 @@ export class MonarchTokenizer implements modes.ITokenizationSupport { continue; } let rule: monarchCommon.IRule = rules[idx]; - if (rule.action.nextEmbedded !== '@pop') { + if (monarchCommon.isIAction(rule.action) && rule.action.nextEmbedded !== '@pop') { continue; } hasEmbeddedPopRule = true; @@ -518,7 +518,7 @@ export class MonarchTokenizer implements modes.ITokenizationSupport { // regular expression group matching // these never need cloning or equality since they are only used within a line match - let groupActions: monarchCommon.IAction[] = null; + let groupActions: monarchCommon.FuzzyAction[] = null; let groupMatches: string[] = null; let groupMatched: string[] = null; let groupRule: monarchCommon.IRule = null; @@ -531,7 +531,7 @@ export class MonarchTokenizer implements modes.ITokenizationSupport { let matches: string[] = null; let matched: string = null; - let action: monarchCommon.IAction = null; + let action: monarchCommon.FuzzyAction | monarchCommon.FuzzyAction[] = null; let rule: monarchCommon.IRule = null; let enteringEmbeddedMode: string = null; @@ -604,22 +604,23 @@ export class MonarchTokenizer implements modes.ITokenizationSupport { pos += matched.length; // maybe call action function (used for 'cases') - while (action.test) { + while (monarchCommon.isFuzzyAction(action) && monarchCommon.isIAction(action) && action.test) { action = action.test(matched, matches, state, pos === lineLength); } - let result: string | monarchCommon.IAction[] = null; + let result: monarchCommon.FuzzyAction | monarchCommon.FuzzyAction[] = null; // set the result: either a string or an array of actions if (typeof action === 'string' || Array.isArray(action)) { result = action; } else if (action.group) { result = action.group; } else if (action.token !== null && action.token !== undefined) { - result = action.token; // do $n replacements? if (action.tokenSubst) { - result = monarchCommon.substituteMatches(this._lexer, result, matched, matches, state); + result = monarchCommon.substituteMatches(this._lexer, action.token, matched, matches, state); + } else { + result = action.token; } // enter embedded mode? @@ -739,7 +740,7 @@ export class MonarchTokenizer implements modes.ITokenizationSupport { // return the result (and check for brace matching) // todo: for efficiency we could pre-sanitize tokenPostfix and substitutions let tokenType: string = null; - if (result.indexOf('@brackets') === 0) { + if (monarchCommon.isString(result) && result.indexOf('@brackets') === 0) { let rest = result.substr('@brackets'.length); let bracket = findBracket(this._lexer, matched); if (!bracket) { @@ -755,7 +756,7 @@ export class MonarchTokenizer implements modes.ITokenizationSupport { tokensCollector.emit(pos0 + offsetDelta, tokenType); } - if (enteringEmbeddedMode) { + if (enteringEmbeddedMode !== null) { // substitute language alias to known modes to support syntax highlighting let enteringEmbeddedModeId = this._modeService.getModeIdForLanguageName(enteringEmbeddedMode); if (enteringEmbeddedModeId) { diff --git a/src/vs/editor/common/modes/monarch/monarchTypes.ts b/src/vs/editor/standalone/common/monarch/monarchTypes.ts similarity index 100% rename from src/vs/editor/common/modes/monarch/monarchTypes.ts rename to src/vs/editor/standalone/common/monarch/monarchTypes.ts diff --git a/src/vs/editor/common/services/standaloneThemeService.ts b/src/vs/editor/standalone/common/standaloneThemeService.ts similarity index 98% rename from src/vs/editor/common/services/standaloneThemeService.ts rename to src/vs/editor/standalone/common/standaloneThemeService.ts index 1cd8f788130e7ccc5fa38e958037ba236122b5f8..99e5bea92824ffd5e7e6f49c09bac12917e29921 100644 --- a/src/vs/editor/common/services/standaloneThemeService.ts +++ b/src/vs/editor/standalone/common/standaloneThemeService.ts @@ -22,6 +22,7 @@ export interface IStandaloneThemeData { export interface IStandaloneTheme extends ITheme { tokenTheme: TokenTheme; + themeName: string; } export interface IStandaloneThemeService extends IThemeService { diff --git a/src/vs/editor/common/standalone/themes.ts b/src/vs/editor/standalone/common/themes.ts similarity index 97% rename from src/vs/editor/common/standalone/themes.ts rename to src/vs/editor/standalone/common/themes.ts index a97a9fab1eedec5114cf78da1f5f3ead58db93aa..0a51ad13ed8e308f5c03acdb7e83b48f4b97fbab 100644 --- a/src/vs/editor/common/standalone/themes.ts +++ b/src/vs/editor/standalone/common/themes.ts @@ -5,9 +5,9 @@ 'use strict'; -import { IStandaloneThemeData } from 'vs/editor/common/services/standaloneThemeService'; -import { editorBackground, editorForeground, editorSelectionHighlight, editorInactiveSelection } from "vs/platform/theme/common/colorRegistry"; -import { editorIndentGuides } from "vs/editor/common/view/editorColorRegistry"; +import { IStandaloneThemeData } from 'vs/editor/standalone/common/standaloneThemeService'; +import { editorBackground, editorForeground, editorSelectionHighlight, editorInactiveSelection } from 'vs/platform/theme/common/colorRegistry'; +import { editorIndentGuides } from 'vs/editor/common/view/editorColorRegistry'; /* -------------------------------- Begin vs theme -------------------------------- */ export const vs: IStandaloneThemeData = { diff --git a/src/vs/editor/test/browser/standalone/simpleServices.test.ts b/src/vs/editor/standalone/test/browser/simpleServices.test.ts similarity index 98% rename from src/vs/editor/test/browser/standalone/simpleServices.test.ts rename to src/vs/editor/standalone/test/browser/simpleServices.test.ts index 14c53c99b5e145ddd2e5172cb02916d49312e825..12aaaad2825397e8cd2f4a7df26594eb358423f8 100644 --- a/src/vs/editor/test/browser/standalone/simpleServices.test.ts +++ b/src/vs/editor/standalone/test/browser/simpleServices.test.ts @@ -6,7 +6,7 @@ import * as assert from 'assert'; import { ContextKeyService } from 'vs/platform/contextkey/browser/contextKeyService'; -import { SimpleConfigurationService, SimpleMessageService, StandaloneKeybindingService, StandaloneCommandService } from 'vs/editor/browser/standalone/simpleServices'; +import { SimpleConfigurationService, SimpleMessageService, StandaloneKeybindingService, StandaloneCommandService } from 'vs/editor/standalone/browser/simpleServices'; import { InstantiationService } from 'vs/platform/instantiation/common/instantiationService'; import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; import { KeyCode } from 'vs/base/common/keyCodes'; diff --git a/src/vs/editor/standalone/test/browser/standaloneLanguages.test.ts b/src/vs/editor/standalone/test/browser/standaloneLanguages.test.ts new file mode 100644 index 0000000000000000000000000000000000000000..214aad7cb301066707b80a6079456f1eebaad7b0 --- /dev/null +++ b/src/vs/editor/standalone/test/browser/standaloneLanguages.test.ts @@ -0,0 +1,180 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +'use strict'; + +import * as assert from 'assert'; +import { TokenizationSupport2Adapter, TokensProvider, ILineTokens, IToken } from "vs/editor/standalone/browser/standaloneLanguages"; +import { IStandaloneThemeService, IStandaloneThemeData, IStandaloneTheme } from "vs/editor/standalone/common/standaloneThemeService"; +import Event from 'vs/base/common/event'; +import { ITheme, LIGHT } from "vs/platform/theme/common/themeService"; +import { LanguageIdentifier, LanguageId, IState, MetadataConsts } from "vs/editor/common/modes"; +import { Token } from "vs/editor/common/core/token"; +import { TokenTheme } from "vs/editor/common/modes/supports/tokenization"; +import { ColorIdentifier } from "vs/platform/theme/common/colorRegistry"; +import { Color } from "vs/base/common/color"; + +suite('TokenizationSupport2Adapter', () => { + + const languageIdentifier = new LanguageIdentifier('tttt', LanguageId.PlainText); + const tokenMetadata = (languageIdentifier.id << MetadataConsts.LANGUAGEID_OFFSET); + + class MockTokenTheme extends TokenTheme { + private counter = 0; + constructor() { + super(null, null); + } + public match(languageId: LanguageId, token: string): number { + return ( + ((this.counter++) << MetadataConsts.FOREGROUND_OFFSET) + | (languageId << MetadataConsts.LANGUAGEID_OFFSET) + ) >>> 0; + } + } + + class MockThemeService implements IStandaloneThemeService { + _serviceBrand = null; + public setTheme(themeName: string): string { + throw new Error('Not implemented'); + } + public defineTheme(themeName: string, themeData: IStandaloneThemeData): void { + throw new Error('Not implemented'); + } + public getTheme(): IStandaloneTheme { + return { + tokenTheme: new MockTokenTheme(), + + themeName: LIGHT, + + type: LIGHT, + + getColor: (color: ColorIdentifier, useDefault?: boolean): Color => { + throw new Error('Not implemented'); + }, + + defines: (color: ColorIdentifier): boolean => { + throw new Error('Not implemented'); + } + }; + } + public onThemeChange: Event = null; + } + + class MockState implements IState { + public static INSTANCE = new MockState(); + private constructor() { } + public clone(): IState { + return this; + } + public equals(other: IState): boolean { + return this === other; + } + } + + function testBadTokensProvider(providerTokens: IToken[], offsetDelta: number, expectedClassicTokens: Token[], expectedModernTokens: number[]): void { + + class BadTokensProvider implements TokensProvider { + public getInitialState(): IState { + return MockState.INSTANCE; + } + public tokenize(line: string, state: IState): ILineTokens { + return { + tokens: providerTokens, + endState: MockState.INSTANCE + }; + } + } + + const adapter = new TokenizationSupport2Adapter(new MockThemeService(), languageIdentifier, new BadTokensProvider()); + + const actualClassicTokens = adapter.tokenize('whatever', MockState.INSTANCE, offsetDelta); + assert.deepEqual(actualClassicTokens.tokens, expectedClassicTokens); + + const actualModernTokens = adapter.tokenize2('whatever', MockState.INSTANCE, offsetDelta); + const modernTokens: number[] = []; + for (let i = 0; i < actualModernTokens.tokens.length; i++) { + modernTokens[i] = actualModernTokens.tokens[i]; + } + assert.deepEqual(modernTokens, expectedModernTokens); + } + + test('tokens always start at index 0 (no offset delta)', () => { + testBadTokensProvider( + [ + { startIndex: 7, scopes: 'foo' }, + { startIndex: 0, scopes: 'bar' } + ], + 0, + [ + new Token(0, 'foo', languageIdentifier.language), + new Token(0, 'bar', languageIdentifier.language), + ], + [ + 0, tokenMetadata | (0 << MetadataConsts.FOREGROUND_OFFSET), + 0, tokenMetadata | (1 << MetadataConsts.FOREGROUND_OFFSET) + ] + ); + }); + + test('tokens always start after each other (no offset delta)', () => { + testBadTokensProvider( + [ + { startIndex: 0, scopes: 'foo' }, + { startIndex: 5, scopes: 'bar' }, + { startIndex: 3, scopes: 'foo' }, + ], + 0, + [ + new Token(0, 'foo', languageIdentifier.language), + new Token(5, 'bar', languageIdentifier.language), + new Token(5, 'foo', languageIdentifier.language), + ], + [ + 0, tokenMetadata | (0 << MetadataConsts.FOREGROUND_OFFSET), + 5, tokenMetadata | (1 << MetadataConsts.FOREGROUND_OFFSET), + 5, tokenMetadata | (2 << MetadataConsts.FOREGROUND_OFFSET) + ] + ); + }); + + test('tokens always start at index 0 (with offset delta)', () => { + testBadTokensProvider( + [ + { startIndex: 7, scopes: 'foo' }, + { startIndex: 0, scopes: 'bar' } + ], + 7, + [ + new Token(7, 'foo', languageIdentifier.language), + new Token(7, 'bar', languageIdentifier.language), + ], + [ + 7, tokenMetadata | (0 << MetadataConsts.FOREGROUND_OFFSET), + 7, tokenMetadata | (1 << MetadataConsts.FOREGROUND_OFFSET) + ] + ); + }); + + test('tokens always start after each other (with offset delta)', () => { + testBadTokensProvider( + [ + { startIndex: 0, scopes: 'foo' }, + { startIndex: 5, scopes: 'bar' }, + { startIndex: 3, scopes: 'foo' }, + ], + 7, + [ + new Token(7, 'foo', languageIdentifier.language), + new Token(12, 'bar', languageIdentifier.language), + new Token(12, 'foo', languageIdentifier.language), + ], + [ + 7, tokenMetadata | (0 << MetadataConsts.FOREGROUND_OFFSET), + 12, tokenMetadata | (1 << MetadataConsts.FOREGROUND_OFFSET), + 12, tokenMetadata | (2 << MetadataConsts.FOREGROUND_OFFSET) + ] + ); + }); + +}); \ No newline at end of file diff --git a/src/vs/editor/test/browser/controller/textAreaState.test.ts b/src/vs/editor/test/browser/controller/textAreaState.test.ts index 9170690d5ec84d0da136f834fdc50b0e8678dded..59552e7542e2b7eb930aeea8e9f4f3748e5fb3a8 100644 --- a/src/vs/editor/test/browser/controller/textAreaState.test.ts +++ b/src/vs/editor/test/browser/controller/textAreaState.test.ts @@ -9,7 +9,7 @@ import { ISimpleModel, TextAreaState, ITextAreaWrapper, PagedScreenReaderStrateg import { Range } from 'vs/editor/common/core/range'; import { EndOfLinePreference } from 'vs/editor/common/editorCommon'; import { Disposable } from 'vs/base/common/lifecycle'; -import { Model } from "vs/editor/common/model/model"; +import { Model } from 'vs/editor/common/model/model'; import { Selection } from 'vs/editor/common/core/selection'; export class MockTextAreaWrapper extends Disposable implements ITextAreaWrapper { diff --git a/src/vs/editor/test/browser/services/decorationRenderOptions.test.ts b/src/vs/editor/test/browser/services/decorationRenderOptions.test.ts index d68266803a77a1fbddb00de7b63a5bf1e530027c..2c76c1f196419170aecdec44bff4ef63d3eeb27c 100644 --- a/src/vs/editor/test/browser/services/decorationRenderOptions.test.ts +++ b/src/vs/editor/test/browser/services/decorationRenderOptions.test.ts @@ -9,7 +9,7 @@ import URI from 'vs/base/common/uri'; import * as dom from 'vs/base/browser/dom'; import { CodeEditorServiceImpl } from 'vs/editor/browser/services/codeEditorServiceImpl'; import { IDecorationRenderOptions } from 'vs/editor/common/editorCommon'; -import { TestThemeService, TestTheme } from 'vs/workbench/test/workbenchTestServices'; +import { TestTheme, TestThemeService } from "vs/platform/theme/test/common/testThemeService"; const themeServiceMock = new TestThemeService(); @@ -67,7 +67,7 @@ suite('Decoration Render Options', () => { var s = new CodeEditorServiceImpl(themeService, styleSheet); s.registerDecorationType('example', options); var sheet = readStyleSheet(styleSheet); - assert.equal(sheet, '.monaco-editor .ced-example-0 { background-color: rgb(255, 0, 0); }'); + assert.equal(sheet, '.monaco-editor .ced-example-0 { background-color: rgb(255, 0, 0); border-color: transparent; box-sizing: border-box; }'); colors = { editorBackground: '#EE0000', diff --git a/src/vs/editor/test/common/commands/commandTestUtils.ts b/src/vs/editor/test/common/commands/commandTestUtils.ts index b753b8a063a5eab1f13e840765cd03672d1457f0..184f5e8d99b84fb86915b58bb078eb8a85fe7711 100644 --- a/src/vs/editor/test/common/commands/commandTestUtils.ts +++ b/src/vs/editor/test/common/commands/commandTestUtils.ts @@ -10,7 +10,7 @@ import { Selection } from 'vs/editor/common/core/selection'; import * as editorCommon from 'vs/editor/common/editorCommon'; import { Model } from 'vs/editor/common/model/model'; import { LanguageIdentifier } from 'vs/editor/common/modes'; -import { withMockCodeEditor } from "vs/editor/test/common/mocks/mockCodeEditor"; +import { withMockCodeEditor } from 'vs/editor/test/common/mocks/mockCodeEditor'; export function testCommand( lines: string[], diff --git a/src/vs/editor/test/common/commands/shiftCommand.test.ts b/src/vs/editor/test/common/commands/shiftCommand.test.ts index 0ea6691e168ad453b4554fc0733447354811f1b4..5a2b2ad63750f22adaebde4a8aa081de4e868357 100644 --- a/src/vs/editor/test/common/commands/shiftCommand.test.ts +++ b/src/vs/editor/test/common/commands/shiftCommand.test.ts @@ -107,7 +107,7 @@ suite('Editor Commands - ShiftCommand', () => { '', '123' ], - new Selection(1, 2, 1, 2) + new Selection(1, 1, 1, 2) ); }); @@ -130,7 +130,7 @@ suite('Editor Commands - ShiftCommand', () => { '', '123' ], - new Selection(1, 4, 1, 2) + new Selection(1, 4, 1, 1) ); }); @@ -153,7 +153,7 @@ suite('Editor Commands - ShiftCommand', () => { '', '123' ], - new Selection(1, 2, 1, 4) + new Selection(1, 1, 1, 4) ); }); @@ -176,7 +176,7 @@ suite('Editor Commands - ShiftCommand', () => { '', '123' ], - new Selection(1, 2, 2, 1) + new Selection(1, 1, 2, 1) ); }); @@ -199,7 +199,7 @@ suite('Editor Commands - ShiftCommand', () => { '', '123' ], - new Selection(1, 2, 2, 1) + new Selection(1, 1, 2, 1) ); testShiftCommand( @@ -312,7 +312,7 @@ suite('Editor Commands - ShiftCommand', () => { '', '\t123' ], - new Selection(1, 2, 5, 3) + new Selection(1, 1, 5, 3) ); testShiftCommand( @@ -333,7 +333,7 @@ suite('Editor Commands - ShiftCommand', () => { '\t', '123' ], - new Selection(4, 2, 5, 1) + new Selection(4, 1, 5, 1) ); }); @@ -538,7 +538,7 @@ suite('Editor Commands - ShiftCommand', () => { '', '\t123' ], - new Selection(1, 2, 5, 5) + new Selection(1, 1, 5, 5) ); }); @@ -703,7 +703,7 @@ suite('Editor Commands - ShiftCommand', () => { ' eleven | 11', '', ], - new Selection(1, 5, 13, 1) + new Selection(1, 1, 13, 1) ); }); @@ -839,6 +839,28 @@ suite('Editor Commands - ShiftCommand', () => { ); }); + test('issue Microsoft/monaco-editor#443: Indentation of a single row deletes selected text in some cases', () => { + testCommand( + [ + 'Hello world!', + 'another line' + ], + null, + new Selection(1, 1, 1, 13), + (sel) => new ShiftCommand(sel, { + isUnshift: false, + tabSize: 4, + oneIndent: '\t', + useTabStops: true + }), + [ + '\tHello world!', + 'another line' + ], + new Selection(1, 1, 1, 14) + ); + }); + test('bug #16815:Shift+Tab doesn\'t go back to tabstop', () => { var repeatStr = (str: string, cnt: number): string => { diff --git a/src/vs/editor/test/common/commands/sideEditing.test.ts b/src/vs/editor/test/common/commands/sideEditing.test.ts index 2fa3ea6035f98fd7f44881a0311a66523e526b2b..af17bee84a254052efd24a4c2abf494eab01902a 100644 --- a/src/vs/editor/test/common/commands/sideEditing.test.ts +++ b/src/vs/editor/test/common/commands/sideEditing.test.ts @@ -11,7 +11,7 @@ import { Range } from 'vs/editor/common/core/range'; import { Selection } from 'vs/editor/common/core/selection'; import { IIdentifiedSingleEditOperation } from 'vs/editor/common/editorCommon'; import { ILineEdit, ModelLine, LineMarker, MarkersTracker } from 'vs/editor/common/model/modelLine'; -import { withMockCodeEditor } from "vs/editor/test/common/mocks/mockCodeEditor"; +import { withMockCodeEditor } from 'vs/editor/test/common/mocks/mockCodeEditor'; const NO_TAB_SIZE = 0; diff --git a/src/vs/editor/test/common/config/commonEditorConfig.test.ts b/src/vs/editor/test/common/config/commonEditorConfig.test.ts index 6abc5412b0303349c7a5b2a964836ddbeb6c28c7..4d5da6aec320a56fa668d8fbdbd4c9264ac613c0 100644 --- a/src/vs/editor/test/common/config/commonEditorConfig.test.ts +++ b/src/vs/editor/test/common/config/commonEditorConfig.test.ts @@ -7,8 +7,8 @@ import * as assert from 'assert'; import { EditorZoom } from 'vs/editor/common/config/editorZoom'; import { TestConfiguration } from 'vs/editor/test/common/mocks/testConfiguration'; -import { IEnvConfiguration } from "vs/editor/common/config/commonEditorConfig"; -import { AccessibilitySupport } from "vs/base/common/platform"; +import { IEnvConfiguration } from 'vs/editor/common/config/commonEditorConfig'; +import { AccessibilitySupport } from 'vs/base/common/platform'; suite('Common Editor Config', () => { test('Zoom Level', () => { @@ -59,7 +59,6 @@ suite('Common Editor Config', () => { extraEditorClassName: '', outerWidth: 1000, outerHeight: 100, - canUseTranslate3d: true, emptySelectionClipboard: true, pixelRatio: 1, zoomLevel: 0, @@ -89,13 +88,23 @@ suite('Common Editor Config', () => { let config = new TestWrappingConfiguration({ wordWrap: true }); - assertWrapping(config, true, 89); + assertWrapping(config, true, 81); }); test('wordWrap on', () => { let config = new TestWrappingConfiguration({ wordWrap: 'on' }); + assertWrapping(config, true, 81); + }); + + test('wordWrap on without minimap', () => { + let config = new TestWrappingConfiguration({ + wordWrap: 'on', + minimap: { + enabled: false + } + }); assertWrapping(config, true, 89); }); @@ -104,7 +113,7 @@ suite('Common Editor Config', () => { wordWrap: 'on', wordWrapColumn: 10 }); - assertWrapping(config, true, 89); + assertWrapping(config, true, 81); }); test('wordWrap off', () => { diff --git a/src/vs/editor/test/common/controller/cursor.test.ts b/src/vs/editor/test/common/controller/cursor.test.ts index 833bd813b474752267dad9a853a0032b241884ff..09a2cab35c4846bc542bfc062efaad9b89bc3c31 100644 --- a/src/vs/editor/test/common/controller/cursor.test.ts +++ b/src/vs/editor/test/common/controller/cursor.test.ts @@ -13,7 +13,7 @@ import { Selection } from 'vs/editor/common/core/selection'; import { EndOfLinePreference, Handler, DefaultEndOfLine, ITextModelCreationOptions, ICommand, - ITokenizedModel, IEditOperationBuilder, ICursorStateComputerData, EndOfLineSequence, ICommonCodeEditor + ITokenizedModel, IEditOperationBuilder, ICursorStateComputerData, EndOfLineSequence } from 'vs/editor/common/editorCommon'; import { Model } from 'vs/editor/common/model/model'; import { IndentAction, IndentationRule } from 'vs/editor/common/modes/languageConfiguration'; @@ -23,15 +23,9 @@ import { MockMode } from 'vs/editor/test/common/mocks/mockMode'; import { LanguageIdentifier } from 'vs/editor/common/modes'; import { IEditorOptions } from 'vs/editor/common/config/editorOptions'; import { CoreNavigationCommands, CoreEditingCommands } from 'vs/editor/common/controller/coreCommands'; -import { withMockCodeEditor, MockCodeEditor } from "vs/editor/test/common/mocks/mockCodeEditor"; -import { TextModel } from "vs/editor/common/model/textModel"; -import { ViewModel } from "vs/editor/common/viewModel/viewModelImpl"; -import * as viewEvents from 'vs/editor/common/view/viewEvents'; -import { ScreenReaderMessageGenerator } from "vs/editor/common/controller/accGenerator"; -import { - CursorWordLeft, CursorWordLeftSelect, CursorWordRight, CursorWordRightSelect -} from 'vs/editor/contrib/wordOperations/common/wordOperations'; -import { EditorCommand } from "vs/editor/common/editorCommonExtensions"; +import { withMockCodeEditor } from 'vs/editor/test/common/mocks/mockCodeEditor'; +import { TextModel } from 'vs/editor/common/model/textModel'; +import { ViewModel } from 'vs/editor/common/viewModel/viewModelImpl'; let H = Handler; // --------- utils @@ -1131,6 +1125,33 @@ class IndentRulesMode extends MockMode { } suite('Editor Controller - Regression tests', () => { + + test('issue Microsoft/monaco-editor#443: Indentation of a single row deletes selected text in some cases', () => { + let model = Model.createFromString( + [ + 'Hello world!', + 'another line' + ].join('\n'), + { + defaultEOL: DefaultEndOfLine.LF, + detectIndentation: false, + insertSpaces: false, + tabSize: 4, + trimAutoWhitespace: false + }, + ); + + withMockCodeEditor(null, { model: model }, (editor, cursor) => { + cursor.setSelections('test', [new Selection(1, 1, 1, 13)]); + + // Check that indenting maintains the selection start at column 1 + CoreEditingCommands.Tab.runEditorCommand(null, editor, null); + assert.deepEqual(cursor.getSelection(), new Selection(1, 1, 1, 14)); + }); + + model.dispose(); + }); + test('Bug 9121: Auto indent + undo + redo is funky', () => { let model = Model.createFromString( [ @@ -1195,172 +1216,6 @@ suite('Editor Controller - Regression tests', () => { model.dispose(); }); - test('bug #16543: Tab should indent to correct indentation spot immediately', () => { - let mode = new OnEnterMode(IndentAction.Indent); - let model = Model.createFromString( - [ - 'function baz() {', - '\tfunction hello() { // something here', - '\t', - '', - '\t}', - '}' - ].join('\n'), - { - defaultEOL: DefaultEndOfLine.LF, - detectIndentation: false, - insertSpaces: false, - tabSize: 4, - trimAutoWhitespace: true - }, - mode.getLanguageIdentifier() - ); - - withMockCodeEditor(null, { model: model }, (editor, cursor) => { - moveTo(cursor, 4, 1, false); - assertCursor(cursor, new Selection(4, 1, 4, 1)); - - CoreEditingCommands.Tab.runEditorCommand(null, editor, null); - assert.equal(model.getLineContent(4), '\t\t'); - }); - - model.dispose(); - mode.dispose(); - }); - - test('bug #2938 (1): When pressing Tab on white-space only lines, indent straight to the right spot (similar to empty lines)', () => { - let mode = new OnEnterMode(IndentAction.Indent); - let model = Model.createFromString( - [ - '\tfunction baz() {', - '\t\tfunction hello() { // something here', - '\t\t', - '\t', - '\t\t}', - '\t}' - ].join('\n'), - { - defaultEOL: DefaultEndOfLine.LF, - detectIndentation: false, - insertSpaces: false, - tabSize: 4, - trimAutoWhitespace: true - }, - mode.getLanguageIdentifier() - ); - - withMockCodeEditor(null, { model: model }, (editor, cursor) => { - moveTo(cursor, 4, 2, false); - assertCursor(cursor, new Selection(4, 2, 4, 2)); - - CoreEditingCommands.Tab.runEditorCommand(null, editor, null); - assert.equal(model.getLineContent(4), '\t\t\t'); - }); - - model.dispose(); - mode.dispose(); - }); - - - test('bug #2938 (2): When pressing Tab on white-space only lines, indent straight to the right spot (similar to empty lines)', () => { - let mode = new OnEnterMode(IndentAction.Indent); - let model = Model.createFromString( - [ - '\tfunction baz() {', - '\t\tfunction hello() { // something here', - '\t\t', - ' ', - '\t\t}', - '\t}' - ].join('\n'), - { - defaultEOL: DefaultEndOfLine.LF, - detectIndentation: false, - insertSpaces: false, - tabSize: 4, - trimAutoWhitespace: true - }, - mode.getLanguageIdentifier() - ); - - withMockCodeEditor(null, { model: model }, (editor, cursor) => { - moveTo(cursor, 4, 1, false); - assertCursor(cursor, new Selection(4, 1, 4, 1)); - - CoreEditingCommands.Tab.runEditorCommand(null, editor, null); - assert.equal(model.getLineContent(4), '\t\t\t'); - }); - - model.dispose(); - mode.dispose(); - }); - - test('bug #2938 (3): When pressing Tab on white-space only lines, indent straight to the right spot (similar to empty lines)', () => { - let mode = new OnEnterMode(IndentAction.Indent); - let model = Model.createFromString( - [ - '\tfunction baz() {', - '\t\tfunction hello() { // something here', - '\t\t', - '\t\t\t', - '\t\t}', - '\t}' - ].join('\n'), - { - defaultEOL: DefaultEndOfLine.LF, - detectIndentation: false, - insertSpaces: false, - tabSize: 4, - trimAutoWhitespace: true - }, - mode.getLanguageIdentifier() - ); - - withMockCodeEditor(null, { model: model }, (editor, cursor) => { - moveTo(cursor, 4, 3, false); - assertCursor(cursor, new Selection(4, 3, 4, 3)); - - CoreEditingCommands.Tab.runEditorCommand(null, editor, null); - assert.equal(model.getLineContent(4), '\t\t\t\t'); - }); - - model.dispose(); - mode.dispose(); - }); - - test('bug #2938 (4): When pressing Tab on white-space only lines, indent straight to the right spot (similar to empty lines)', () => { - let mode = new OnEnterMode(IndentAction.Indent); - let model = Model.createFromString( - [ - '\tfunction baz() {', - '\t\tfunction hello() { // something here', - '\t\t', - '\t\t\t\t', - '\t\t}', - '\t}' - ].join('\n'), - { - defaultEOL: DefaultEndOfLine.LF, - detectIndentation: false, - insertSpaces: false, - tabSize: 4, - trimAutoWhitespace: true - }, - mode.getLanguageIdentifier() - ); - - withMockCodeEditor(null, { model: model }, (editor, cursor) => { - moveTo(cursor, 4, 4, false); - assertCursor(cursor, new Selection(4, 4, 4, 4)); - - CoreEditingCommands.Tab.runEditorCommand(null, editor, null); - assert.equal(model.getLineContent(4), '\t\t\t\t\t'); - }); - - model.dispose(); - mode.dispose(); - }); - test('bug #16815:Shift+Tab doesn\'t go back to tabstop', () => { let mode = new OnEnterMode(IndentAction.IndentOutdent); let model = Model.createFromString( @@ -2396,8 +2251,6 @@ suite('Editor Controller - Indentation Rules', () => { unIndentedLinePattern: /^(?!.*([;{}]|\S:)\s*(\/\/.*|\/[*].*[*]\/\s*)?$)(?!.*(\{[^}"']*|\([^)"']*|\[[^\]"']*|^\s*(\{\}|\(\)|\[\]|(case\b.*|default):))\s*(\/\/.*|\/[*].*[*]\/\s*)?$)(?!^\s*((?!\S.*\/[*]).*[*]\/\s*)?[})\]]|^\s*(case\b.*|default):\s*(\/\/.*|\/[*].*[*]\/\s*)?$)(?!^\s*(for|while|if|else)\b(?!.*[;{}]\s*(\/\/.*|\/[*].*[*]\/\s*)?$))/ }); - let emptyRulesMode = new OnEnterMode(IndentAction.None); - test('Enter honors increaseIndentPattern', () => { usingCursor({ text: [ @@ -2481,6 +2334,37 @@ suite('Editor Controller - Indentation Rules', () => { }); }); + test('Enter honors indentNextLinePattern 2', () => { + let model = Model.createFromString( + [ + 'if (true)', + '\tif (true)' + ].join('\n'), + { + defaultEOL: DefaultEndOfLine.LF, + detectIndentation: false, + insertSpaces: false, + tabSize: 4, + trimAutoWhitespace: true + }, + mode.getLanguageIdentifier() + ); + + withMockCodeEditor(null, { model: model, autoIndent: true }, (editor, cursor) => { + moveTo(cursor, 2, 11, false); + assertCursor(cursor, new Selection(2, 11, 2, 11)); + + cursorCommand(cursor, H.Type, { text: '\n' }, 'keyboard'); + assertCursor(cursor, new Selection(3, 3, 3, 3)); + + cursorCommand(cursor, H.Type, { text: 'console.log();' }, 'keyboard'); + cursorCommand(cursor, H.Type, { text: '\n' }, 'keyboard'); + assertCursor(cursor, new Selection(4, 1, 4, 1)); + }); + + model.dispose(); + }); + test('Enter adjusts indentation of current line 1', () => { usingCursor({ text: [ @@ -2517,7 +2401,27 @@ suite('Editor Controller - Indentation Rules', () => { cursorCommand(cursor, H.Type, { text: '\n' }, 'keyboard'); assertCursor(cursor, new Selection(5, 1, 5, 1)); - assert.equal(model.getLineContent(4), '}', '001'); + assert.equal(model.getLineContent(4), '\t}', '001'); + }); + }); + + test('Enter honors intential indent', () => { + usingCursor({ + text: [ + 'if (true) {', + '\tif (true) {', + 'return true;', + '}}' + ], + languageIdentifier: mode.getLanguageIdentifier(), + modelOpts: { insertSpaces: false, tabSize: 4, detectIndentation: false, defaultEOL: DefaultEndOfLine.LF, trimAutoWhitespace: true } + }, (model, cursor) => { + moveTo(cursor, 3, 13, false); + assertCursor(cursor, new Selection(3, 13, 3, 13)); + + cursorCommand(cursor, H.Type, { text: '\n' }, 'keyboard'); + assertCursor(cursor, new Selection(4, 1, 4, 1)); + assert.equal(model.getLineContent(3), 'return true;', '001'); }); }); @@ -2634,27 +2538,27 @@ suite('Editor Controller - Indentation Rules', () => { }); }); - test('Enter supports intentional indentation', () => { - usingCursor({ - text: [ - '\tif (true) {', - '\t\tswitch(true) {', - '\t\t\tcase true:', - '\t\t\t\tbreak;', - '\t\t}', - '\t}' - ], - languageIdentifier: mode.getLanguageIdentifier(), - modelOpts: { insertSpaces: false, tabSize: 4, detectIndentation: false, defaultEOL: DefaultEndOfLine.LF, trimAutoWhitespace: true } - }, (model, cursor) => { - moveTo(cursor, 5, 4, false); - assertCursor(cursor, new Selection(5, 4, 5, 4)); - - cursorCommand(cursor, H.Type, { text: '\n' }, 'keyboard'); - assert.equal(model.getLineContent(5), '\t\t}'); - assertCursor(cursor, new Selection(6, 3, 6, 3)); - }); - }); + // test('Enter supports intentional indentation', () => { + // usingCursor({ + // text: [ + // '\tif (true) {', + // '\t\tswitch(true) {', + // '\t\t\tcase true:', + // '\t\t\t\tbreak;', + // '\t\t}', + // '\t}' + // ], + // languageIdentifier: mode.getLanguageIdentifier(), + // modelOpts: { insertSpaces: false, tabSize: 4, detectIndentation: false, defaultEOL: DefaultEndOfLine.LF, trimAutoWhitespace: true } + // }, (model, cursor) => { + // moveTo(cursor, 5, 4, false); + // assertCursor(cursor, new Selection(5, 4, 5, 4)); + + // cursorCommand(cursor, H.Type, { text: '\n' }, 'keyboard'); + // assert.equal(model.getLineContent(5), '\t\t}'); + // assertCursor(cursor, new Selection(6, 3, 6, 3)); + // }); + // }); test('issue Microsoft/monaco-editor#108 part 1/2: Auto indentation on Enter with selection is half broken', () => { usingCursor({ @@ -2720,7 +2624,6 @@ suite('Editor Controller - Indentation Rules', () => { '\t}', '?>' ], - languageIdentifier: emptyRulesMode.getLanguageIdentifier(), modelOpts: { insertSpaces: false, tabSize: 4, detectIndentation: false, defaultEOL: DefaultEndOfLine.LF, trimAutoWhitespace: true } }, (model, cursor) => { moveTo(cursor, 5, 3, false); @@ -2740,7 +2643,6 @@ suite('Editor Controller - Indentation Rules', () => { ' return 5;', ' ' ], - languageIdentifier: emptyRulesMode.getLanguageIdentifier(), modelOpts: { insertSpaces: false, tabSize: 4, detectIndentation: false, defaultEOL: DefaultEndOfLine.LF, trimAutoWhitespace: true } }, (model, cursor) => { moveTo(cursor, 3, 2, false); @@ -2751,17 +2653,229 @@ suite('Editor Controller - Indentation Rules', () => { assert.equal(model.getLineContent(4), '\t'); }); }); -}); - -interface ICursorOpts { - text: string[]; - languageIdentifier?: LanguageIdentifier; - modelOpts?: ITextModelCreationOptions; - editorOpts?: IEditorOptions; -} -function usingCursor(opts: ICursorOpts, callback: (model: Model, cursor: Cursor) => void): void { - let model = Model.createFromString(opts.text.join('\n'), opts.modelOpts, opts.languageIdentifier); + test('bug #16543: Tab should indent to correct indentation spot immediately', () => { + let model = Model.createFromString( + [ + 'function baz() {', + '\tfunction hello() { // something here', + '\t', + '', + '\t}', + '}' + ].join('\n'), + { + defaultEOL: DefaultEndOfLine.LF, + detectIndentation: false, + insertSpaces: false, + tabSize: 4, + trimAutoWhitespace: true + }, + mode.getLanguageIdentifier() + ); + + withMockCodeEditor(null, { model: model }, (editor, cursor) => { + moveTo(cursor, 4, 1, false); + assertCursor(cursor, new Selection(4, 1, 4, 1)); + + CoreEditingCommands.Tab.runEditorCommand(null, editor, null); + assert.equal(model.getLineContent(4), '\t\t'); + }); + + model.dispose(); + }); + + + test('bug #2938 (1): When pressing Tab on white-space only lines, indent straight to the right spot (similar to empty lines)', () => { + let model = Model.createFromString( + [ + '\tfunction baz() {', + '\t\tfunction hello() { // something here', + '\t\t', + '\t', + '\t\t}', + '\t}' + ].join('\n'), + { + defaultEOL: DefaultEndOfLine.LF, + detectIndentation: false, + insertSpaces: false, + tabSize: 4, + trimAutoWhitespace: true + }, + mode.getLanguageIdentifier() + ); + + withMockCodeEditor(null, { model: model }, (editor, cursor) => { + moveTo(cursor, 4, 2, false); + assertCursor(cursor, new Selection(4, 2, 4, 2)); + + CoreEditingCommands.Tab.runEditorCommand(null, editor, null); + assert.equal(model.getLineContent(4), '\t\t\t'); + }); + + model.dispose(); + }); + + + test('bug #2938 (2): When pressing Tab on white-space only lines, indent straight to the right spot (similar to empty lines)', () => { + let model = Model.createFromString( + [ + '\tfunction baz() {', + '\t\tfunction hello() { // something here', + '\t\t', + ' ', + '\t\t}', + '\t}' + ].join('\n'), + { + defaultEOL: DefaultEndOfLine.LF, + detectIndentation: false, + insertSpaces: false, + tabSize: 4, + trimAutoWhitespace: true + }, + mode.getLanguageIdentifier() + ); + + withMockCodeEditor(null, { model: model }, (editor, cursor) => { + moveTo(cursor, 4, 1, false); + assertCursor(cursor, new Selection(4, 1, 4, 1)); + + CoreEditingCommands.Tab.runEditorCommand(null, editor, null); + assert.equal(model.getLineContent(4), '\t\t\t'); + }); + + model.dispose(); + }); + + test('bug #2938 (3): When pressing Tab on white-space only lines, indent straight to the right spot (similar to empty lines)', () => { + let model = Model.createFromString( + [ + '\tfunction baz() {', + '\t\tfunction hello() { // something here', + '\t\t', + '\t\t\t', + '\t\t}', + '\t}' + ].join('\n'), + { + defaultEOL: DefaultEndOfLine.LF, + detectIndentation: false, + insertSpaces: false, + tabSize: 4, + trimAutoWhitespace: true + }, + mode.getLanguageIdentifier() + ); + + withMockCodeEditor(null, { model: model }, (editor, cursor) => { + moveTo(cursor, 4, 3, false); + assertCursor(cursor, new Selection(4, 3, 4, 3)); + + CoreEditingCommands.Tab.runEditorCommand(null, editor, null); + assert.equal(model.getLineContent(4), '\t\t\t\t'); + }); + + model.dispose(); + }); + + test('bug #2938 (4): When pressing Tab on white-space only lines, indent straight to the right spot (similar to empty lines)', () => { + let model = Model.createFromString( + [ + '\tfunction baz() {', + '\t\tfunction hello() { // something here', + '\t\t', + '\t\t\t\t', + '\t\t}', + '\t}' + ].join('\n'), + { + defaultEOL: DefaultEndOfLine.LF, + detectIndentation: false, + insertSpaces: false, + tabSize: 4, + trimAutoWhitespace: true + }, + mode.getLanguageIdentifier() + ); + + withMockCodeEditor(null, { model: model }, (editor, cursor) => { + moveTo(cursor, 4, 4, false); + assertCursor(cursor, new Selection(4, 4, 4, 4)); + + CoreEditingCommands.Tab.runEditorCommand(null, editor, null); + assert.equal(model.getLineContent(4), '\t\t\t\t\t'); + }); + + model.dispose(); + }); + + test('type honors indentation rules: ruby keywords', () => { + let rubyMode = new IndentRulesMode({ + increaseIndentPattern: /^\s*((begin|class|def|else|elsif|ensure|for|if|module|rescue|unless|until|when|while)|(.*\sdo\b))\b[^\{;]*$/, + decreaseIndentPattern: /^\s*([}\]]([,)]?\s*(#|$)|\.[a-zA-Z_]\w*\b)|(end|rescue|ensure|else|elsif|when)\b)/ + }); + let model = Model.createFromString( + [ + 'class Greeter', + ' def initialize(name)', + ' @name = name', + ' en' + ].join('\n'), + { + defaultEOL: DefaultEndOfLine.LF, + detectIndentation: false, + insertSpaces: true, + tabSize: 2, + trimAutoWhitespace: true + }, + rubyMode.getLanguageIdentifier() + ); + + withMockCodeEditor(null, { model: model, autoIndent: true }, (editor, cursor) => { + moveTo(cursor, 4, 7, false); + assertCursor(cursor, new Selection(4, 7, 4, 7)); + + cursorCommand(cursor, H.Type, { text: 'd' }, 'keyboard'); + assert.equal(model.getLineContent(4), ' end'); + }); + + rubyMode.dispose(); + model.dispose(); + }); + + test('Auto indent on type: increaseIndentPattern has higher priority than decreaseIndent when inheriting', () => { + usingCursor({ + text: [ + '\tif (true) {', + '\t\tconsole.log();', + '\t} else if {', + '\t\tconsole.log()', + '\t}' + ], + languageIdentifier: mode.getLanguageIdentifier(), + modelOpts: { insertSpaces: false, tabSize: 4, detectIndentation: false, defaultEOL: DefaultEndOfLine.LF, trimAutoWhitespace: true } + }, (model, cursor) => { + moveTo(cursor, 5, 3, false); + assertCursor(cursor, new Selection(5, 3, 5, 3)); + + cursorCommand(cursor, H.Type, { text: 'e' }, 'keyboard'); + assertCursor(cursor, new Selection(5, 4, 5, 4)); + assert.equal(model.getLineContent(5), '\t}e', 'This line should not decrease indent'); + }); + }); +}); + +interface ICursorOpts { + text: string[]; + languageIdentifier?: LanguageIdentifier; + modelOpts?: ITextModelCreationOptions; + editorOpts?: IEditorOptions; +} + +function usingCursor(opts: ICursorOpts, callback: (model: Model, cursor: Cursor) => void): void { + let model = Model.createFromString(opts.text.join('\n'), opts.modelOpts, opts.languageIdentifier); let config = new TestConfiguration(opts.editorOpts); let viewModel = new ViewModel(0, config, model); let cursor = new Cursor(config, model, viewModel); @@ -3034,7 +3148,7 @@ suite('autoClosingPairs', () => { class AutoClosingMode extends MockMode { - private static _id = new LanguageIdentifier('autoClosingMode', 3); + private static _id = new LanguageIdentifier('autoClosingMode', 5); constructor() { super(AutoClosingMode._id); @@ -3322,991 +3436,3 @@ suite('autoClosingPairs', () => { mode.dispose(); }); }); - - -suite('cursor screen reader message', () => { - - const _cursorWordLeft = new CursorWordLeft(); - const _cursorWordLeftSelect = new CursorWordLeftSelect(); - const _cursorWordRight = new CursorWordRight(); - const _cursorWordRightSelect = new CursorWordRightSelect(); - - function runEditorCommand(editor: ICommonCodeEditor, command: EditorCommand): void { - command.runEditorCommand(null, editor, null); - } - function moveWordLeft(editor: ICommonCodeEditor, inSelectionMode: boolean = false): void { - runEditorCommand(editor, inSelectionMode ? _cursorWordLeftSelect : _cursorWordLeft); - } - function moveWordRight(editor: ICommonCodeEditor, inSelectionMode: boolean = false): void { - runEditorCommand(editor, inSelectionMode ? _cursorWordRightSelect : _cursorWordRight); - } - - function assertScreenReaderMessage(lines: string[], initialSelection: Selection, expectedScreenReaderMessage: string, callback: (editor: MockCodeEditor, cursor: Cursor) => void): void { - withMockCodeEditor(lines, {}, (editor, cursor) => { - editor.setSelection(initialSelection); - - let actualScreenReaderMessage: string = null; - cursor.addEventListener((events: viewEvents.ViewEvent[]) => { - for (let i = 0, len = events.length; i < len; i++) { - const event = events[i]; - if (event.type === viewEvents.ViewEventType.ViewCursorStateChanged) { - actualScreenReaderMessage = event.screenReaderMessage; - } - } - }); - - callback(editor, cursor); - - // Disabled for now - assert.equal(actualScreenReaderMessage, null); - // assert.equal(actualScreenReaderMessage, expectedScreenReaderMessage); - }); - } - - suite('move down', () => { - test('start of line no selection', () => { - assertScreenReaderMessage( - [ - 'Hello world!', - 'How are you?', - 'I am good, thanks' - ], - new Selection(1, 1, 1, 1), - 'How are you?\n', - (editor, cursor) => { - moveDown(cursor, false); - } - ); - }); - test('start of line no selection - last line', () => { - assertScreenReaderMessage( - [ - 'Hello world!', - 'How are you?', - 'I am good, thanks' - ], - new Selection(2, 1, 2, 1), - 'I am good, thanks', - (editor, cursor) => { - moveDown(cursor, false); - } - ); - }); - test('middle of line no selection', () => { - assertScreenReaderMessage( - [ - 'Hello world!', - 'How are you?', - 'I am good, thanks' - ], - new Selection(1, 3, 1, 3), - 'How are you?\n', - (editor, cursor) => { - moveDown(cursor, false); - } - ); - }); - test('middle of line no selection - last line', () => { - assertScreenReaderMessage( - [ - 'Hello world!', - 'How are you?', - 'I am good, thanks' - ], - new Selection(2, 3, 2, 3), - 'I am good, thanks', - (editor, cursor) => { - moveDown(cursor, false); - } - ); - }); - - test('begin a selection', () => { - assertScreenReaderMessage( - [ - 'Hello world!', - 'How are you?', - 'I am good, thanks' - ], - new Selection(1, 1, 1, 1), - ScreenReaderMessageGenerator.xSelected('Hello world!\n'), - (editor, cursor) => { - moveDown(cursor, true); - } - ); - }); - - test('increase a selection', () => { - assertScreenReaderMessage( - [ - 'Hello world!', - 'How are you?', - 'I am good, thanks' - ], - new Selection(1, 1, 1, 6), - ScreenReaderMessageGenerator.xSelected(' world!\nHow a'), - (editor, cursor) => { - moveDown(cursor, true); - } - ); - }); - - test('decrease a selection', () => { - assertScreenReaderMessage( - [ - 'Hello world!', - 'How are you?', - 'I am good, thanks' - ], - new Selection(3, 1, 1, 1), - ScreenReaderMessageGenerator.xUnselected('Hello world!\n'), - (editor, cursor) => { - moveDown(cursor, true); - } - ); - }); - - test('cancel a selection', () => { - assertScreenReaderMessage( - [ - 'Hello world!', - 'How are you?', - 'I am good, thanks' - ], - new Selection(3, 1, 1, 1), - 'I am good, thanks\nHello world!\nHow are you?\n\nUnselected', - (editor, cursor) => { - moveDown(cursor, false); - } - ); - }); - }); - - suite('move up', () => { - test('start of line no selection', () => { - assertScreenReaderMessage( - [ - 'Hello world!', - 'How are you?', - 'I am good, thanks' - ], - new Selection(3, 1, 3, 1), - 'How are you?\n', - (editor, cursor) => { - moveUp(cursor, false); - } - ); - }); - test('start of line no selection - first line', () => { - assertScreenReaderMessage( - [ - 'Hello world!', - 'How are you?', - 'I am good, thanks' - ], - new Selection(2, 1, 2, 1), - 'Hello world!\n', - (editor, cursor) => { - moveUp(cursor, false); - } - ); - }); - test('middle of line no selection', () => { - assertScreenReaderMessage( - [ - 'Hello world!', - 'How are you?', - 'I am good, thanks' - ], - new Selection(3, 3, 3, 3), - 'How are you?\n', - (editor, cursor) => { - moveUp(cursor, false); - } - ); - }); - test('middle of line no selection - last line', () => { - assertScreenReaderMessage( - [ - 'Hello world!', - 'How are you?', - 'I am good, thanks' - ], - new Selection(2, 3, 2, 3), - 'Hello world!\n', - (editor, cursor) => { - moveUp(cursor, false); - } - ); - }); - - test('begin a selection', () => { - assertScreenReaderMessage( - [ - 'Hello world!', - 'How are you?', - 'I am good, thanks' - ], - new Selection(3, 1, 3, 1), - ScreenReaderMessageGenerator.xSelected('How are you?\n'), - (editor, cursor) => { - moveUp(cursor, true); - } - ); - }); - - test('increase a selection', () => { - assertScreenReaderMessage( - [ - 'Hello world!', - 'How are you?', - 'I am good, thanks' - ], - new Selection(3, 6, 3, 1), - ScreenReaderMessageGenerator.xSelected('How are you?\n'), - (editor, cursor) => { - moveUp(cursor, true); - } - ); - }); - - test('decrease a selection', () => { - assertScreenReaderMessage( - [ - 'Hello world!', - 'How are you?', - 'I am good, thanks' - ], - new Selection(1, 1, 3, 1), - ScreenReaderMessageGenerator.xUnselected('How are you?\n'), - (editor, cursor) => { - moveUp(cursor, true); - } - ); - }); - - test('cancel a selection', () => { - assertScreenReaderMessage( - [ - 'Hello world!', - 'How are you?', - 'I am good, thanks' - ], - new Selection(1, 1, 3, 1), - ScreenReaderMessageGenerator.xUnselected('Hello world!\nHow are you?\n'), - (editor, cursor) => { - moveUp(cursor, false); - } - ); - }); - }); - - suite('move right', () => { - test('start of line no selection', () => { - assertScreenReaderMessage( - [ - 'Hello world!', - 'How are you?', - 'I am good, thanks' - ], - new Selection(1, 1, 1, 1), - 'e', - (editor, cursor) => { - moveRight(cursor, false); - } - ); - }); - test('middle of line no selection', () => { - assertScreenReaderMessage( - [ - 'Hello world!', - 'How are you?', - 'I am good, thanks' - ], - new Selection(1, 2, 1, 2), - 'l', - (editor, cursor) => { - moveRight(cursor, false); - } - ); - }); - test('end of line no selection 1', () => { - assertScreenReaderMessage( - [ - 'Hello world!', - 'How are you?', - 'I am good, thanks' - ], - new Selection(1, 12, 1, 12), - '\n', - (editor, cursor) => { - moveRight(cursor, false); - } - ); - }); - test('end of line no selection 2', () => { - assertScreenReaderMessage( - [ - 'Hello world!', - 'How are you?', - 'I am good, thanks' - ], - new Selection(1, 13, 1, 13), - 'H', - (editor, cursor) => { - moveRight(cursor, false); - } - ); - }); - test('end of file no selection 1', () => { - assertScreenReaderMessage( - [ - 'Hello world!', - 'How are you?', - 'I am good, thanks' - ], - new Selection(3, 17, 3, 17), - '', - (editor, cursor) => { - moveRight(cursor, false); - } - ); - }); - test('end of file no selection 2', () => { - assertScreenReaderMessage( - [ - 'Hello world!', - 'How are you?', - 'I am good, thanks' - ], - new Selection(3, 18, 3, 18), - null, - (editor, cursor) => { - moveRight(cursor, false); - } - ); - }); - - test('begin a selection', () => { - assertScreenReaderMessage( - [ - 'Hello world!', - 'How are you?', - 'I am good, thanks' - ], - new Selection(1, 1, 1, 1), - ScreenReaderMessageGenerator.xSelected('H'), - (editor, cursor) => { - moveRight(cursor, true); - } - ); - }); - - test('increase a selection', () => { - assertScreenReaderMessage( - [ - 'Hello world!', - 'How are you?', - 'I am good, thanks' - ], - new Selection(1, 1, 1, 7), - ScreenReaderMessageGenerator.xSelected('w'), - (editor, cursor) => { - moveRight(cursor, true); - } - ); - }); - - test('decrease a selection', () => { - assertScreenReaderMessage( - [ - 'Hello world!', - 'How are you?', - 'I am good, thanks' - ], - new Selection(1, 7, 1, 1), - ScreenReaderMessageGenerator.xUnselected('H'), - (editor, cursor) => { - moveRight(cursor, true); - } - ); - }); - - test('cancel a selection', () => { - assertScreenReaderMessage( - [ - 'Hello world!', - 'How are you?', - 'I am good, thanks' - ], - new Selection(1, 1, 1, 8), - ScreenReaderMessageGenerator.xUnselected('Hello w'), - (editor, cursor) => { - moveRight(cursor, false); - } - ); - }); - }); - - suite('move left', () => { - test('end of line no selection', () => { - assertScreenReaderMessage( - [ - 'Hello world!', - 'How are you?', - 'I am good, thanks' - ], - new Selection(3, 18, 3, 18), - 's', - (editor, cursor) => { - moveLeft(cursor, false); - } - ); - }); - test('middle of line no selection', () => { - assertScreenReaderMessage( - [ - 'Hello world!', - 'How are you?', - 'I am good, thanks' - ], - new Selection(3, 4, 3, 4), - 'a', - (editor, cursor) => { - moveLeft(cursor, false); - } - ); - }); - test('start of line no selection 1', () => { - assertScreenReaderMessage( - [ - 'Hello world!', - 'How are you?', - 'I am good, thanks' - ], - new Selection(3, 2, 3, 2), - 'I', - (editor, cursor) => { - moveLeft(cursor, false); - } - ); - }); - test('start of line no selection 2', () => { - assertScreenReaderMessage( - [ - 'Hello world!', - 'How are you?', - 'I am good, thanks' - ], - new Selection(3, 1, 3, 1), - '\n', - (editor, cursor) => { - moveLeft(cursor, false); - } - ); - }); - test('start of file no selection 1', () => { - assertScreenReaderMessage( - [ - 'Hello world!', - 'How are you?', - 'I am good, thanks' - ], - new Selection(1, 2, 1, 2), - 'H', - (editor, cursor) => { - moveLeft(cursor, false); - } - ); - }); - test('start of file no selection 2', () => { - assertScreenReaderMessage( - [ - 'Hello world!', - 'How are you?', - 'I am good, thanks' - ], - new Selection(1, 1, 1, 1), - null, - (editor, cursor) => { - moveLeft(cursor, false); - } - ); - }); - - test('begin a selection', () => { - assertScreenReaderMessage( - [ - 'Hello world!', - 'How are you?', - 'I am good, thanks' - ], - new Selection(1, 6, 1, 6), - ScreenReaderMessageGenerator.xSelected('o'), - (editor, cursor) => { - moveLeft(cursor, true); - } - ); - }); - - test('increase a selection', () => { - assertScreenReaderMessage( - [ - 'Hello world!', - 'How are you?', - 'I am good, thanks' - ], - new Selection(1, 6, 1, 5), - ScreenReaderMessageGenerator.xSelected('l'), - (editor, cursor) => { - moveLeft(cursor, true); - } - ); - }); - - test('decrease a selection', () => { - assertScreenReaderMessage( - [ - 'Hello world!', - 'How are you?', - 'I am good, thanks' - ], - new Selection(1, 1, 1, 6), - ScreenReaderMessageGenerator.xUnselected('o'), - (editor, cursor) => { - moveLeft(cursor, true); - } - ); - }); - - test('cancel a selection', () => { - assertScreenReaderMessage( - [ - 'Hello world!', - 'How are you?', - 'I am good, thanks' - ], - new Selection(1, 2, 1, 8), - ScreenReaderMessageGenerator.xUnselected('ello w'), - (editor, cursor) => { - moveLeft(cursor, false); - } - ); - }); - }); - - suite('home', () => { - test('no selection', () => { - assertScreenReaderMessage( - [ - 'Hello world!', - 'How are you?', - 'I am good, thanks' - ], - new Selection(3, 18, 3, 18), - 'I', - (editor, cursor) => { - moveToBeginningOfLine(cursor, false); - } - ); - }); - - test('begin a selection', () => { - assertScreenReaderMessage( - [ - 'Hello world!', - 'How are you?', - 'I am good, thanks' - ], - new Selection(1, 6, 1, 6), - ScreenReaderMessageGenerator.xSelected('Hello'), - (editor, cursor) => { - moveToBeginningOfLine(cursor, true); - } - ); - }); - - test('increase a selection', () => { - assertScreenReaderMessage( - [ - 'Hello world!', - 'How are you?', - 'I am good, thanks' - ], - new Selection(1, 6, 1, 5), - ScreenReaderMessageGenerator.xSelected('Hell'), - (editor, cursor) => { - moveToBeginningOfLine(cursor, true); - } - ); - }); - - test('decrease a selection', () => { - assertScreenReaderMessage( - [ - 'Hello world!', - 'How are you?', - 'I am good, thanks' - ], - new Selection(1, 1, 2, 4), - ScreenReaderMessageGenerator.xUnselected('How'), - (editor, cursor) => { - moveToBeginningOfLine(cursor, true); - } - ); - }); - - test('cancel a selection 1', () => { - assertScreenReaderMessage( - [ - 'Hello world!', - 'How are you?', - 'I am good, thanks' - ], - new Selection(1, 1, 1, 8), - ScreenReaderMessageGenerator.xUnselected('Hello w'), - (editor, cursor) => { - moveToBeginningOfLine(cursor, false); - } - ); - }); - - test('cancel a selection 2', () => { - assertScreenReaderMessage( - [ - 'Hello world!', - 'How are you?', - 'I am good, thanks' - ], - new Selection(1, 7, 1, 12), - ScreenReaderMessageGenerator.xUnselected('H\nworld'), - (editor, cursor) => { - moveToBeginningOfLine(cursor, false); - } - ); - }); - }); - - suite('end', () => { - test('no selection', () => { - assertScreenReaderMessage( - [ - 'Hello world!', - 'How are you?', - 'I am good, thanks' - ], - new Selection(1, 1, 1, 1), - '\n', - (editor, cursor) => { - moveToEndOfLine(cursor, false); - } - ); - }); - - test('no selection at end of file', () => { - assertScreenReaderMessage( - [ - 'Hello world!', - 'How are you?', - 'I am good, thanks' - ], - new Selection(3, 1, 3, 1), - '', - (editor, cursor) => { - moveToEndOfLine(cursor, false); - } - ); - }); - - test('begin a selection', () => { - assertScreenReaderMessage( - [ - 'Hello world!', - 'How are you?', - 'I am good, thanks' - ], - new Selection(1, 7, 1, 7), - ScreenReaderMessageGenerator.xSelected('world!'), - (editor, cursor) => { - moveToEndOfLine(cursor, true); - } - ); - }); - - test('increase a selection', () => { - assertScreenReaderMessage( - [ - 'Hello world!', - 'How are you?', - 'I am good, thanks' - ], - new Selection(1, 1, 1, 7), - ScreenReaderMessageGenerator.xSelected('world!'), - (editor, cursor) => { - moveToEndOfLine(cursor, true); - } - ); - }); - - test('decrease a selection', () => { - assertScreenReaderMessage( - [ - 'Hello world!', - 'How are you?', - 'I am good, thanks' - ], - new Selection(2, 13, 1, 1), - ScreenReaderMessageGenerator.xUnselected('Hello world!'), - (editor, cursor) => { - moveToEndOfLine(cursor, true); - } - ); - }); - - test('cancel a selection 1', () => { - assertScreenReaderMessage( - [ - 'Hello world!', - 'How are you?', - 'I am good, thanks' - ], - new Selection(1, 13, 1, 8), - ScreenReaderMessageGenerator.xUnselected('orld!'), - (editor, cursor) => { - moveToEndOfLine(cursor, false); - } - ); - }); - - test('cancel a selection 2', () => { - assertScreenReaderMessage( - [ - 'Hello world!', - 'How are you?', - 'I am good, thanks' - ], - new Selection(1, 1, 1, 6), - ScreenReaderMessageGenerator.xUnselected('\n\nHello'), - (editor, cursor) => { - moveToEndOfLine(cursor, false); - } - ); - }); - }); - - suite('ctrl+right', () => { - test('no selection', () => { - assertScreenReaderMessage( - [ - 'Hello world!', - 'How are you?', - 'I am good, thanks' - ], - new Selection(1, 1, 1, 1), - 'Hello', - (editor, cursor) => { - moveWordRight(editor, false); - } - ); - }); - - test('accross lines', () => { - assertScreenReaderMessage( - [ - 'Hello world', - 'How are you', - 'I am good, thanks' - ], - new Selection(1, 12, 1, 12), - '\nHow', - (editor, cursor) => { - moveWordRight(editor, false); - } - ); - }); - - test('no selection at end of file', () => { - assertScreenReaderMessage( - [ - 'Hello world!', - 'How are you?', - 'I am good, thanks' - ], - new Selection(3, 12, 3, 12), - 'thanks', - (editor, cursor) => { - moveWordRight(editor, false); - } - ); - }); - - test('begin a selection', () => { - assertScreenReaderMessage( - [ - 'Hello world!', - 'How are you?', - 'I am good, thanks' - ], - new Selection(1, 1, 1, 1), - ScreenReaderMessageGenerator.xSelected('Hello'), - (editor, cursor) => { - moveWordRight(editor, true); - } - ); - }); - - test('increase a selection', () => { - assertScreenReaderMessage( - [ - 'Hello world!', - 'How are you?', - 'I am good, thanks' - ], - new Selection(1, 1, 1, 6), - ScreenReaderMessageGenerator.xSelected(' world'), - (editor, cursor) => { - moveWordRight(editor, true); - } - ); - }); - - test('decrease a selection', () => { - assertScreenReaderMessage( - [ - 'Hello world!', - 'How are you?', - 'I am good, thanks' - ], - new Selection(1, 12, 1, 1), - ScreenReaderMessageGenerator.xUnselected('Hello'), - (editor, cursor) => { - moveWordRight(editor, true); - } - ); - }); - - test('cancel a selection', () => { - assertScreenReaderMessage( - [ - 'Hello world!', - 'How are you?', - 'I am good, thanks' - ], - new Selection(2, 1, 2, 4), - ScreenReaderMessageGenerator.xUnselected(' are\nHow'), - (editor, cursor) => { - moveWordRight(editor, false); - } - ); - }); - }); - - suite('ctrl+left', () => { - test('no selection', () => { - assertScreenReaderMessage( - [ - 'Hello world!', - 'How are you?', - 'I am good, thanks' - ], - new Selection(1, 12, 1, 12), - 'world', - (editor, cursor) => { - moveWordLeft(editor, false); - } - ); - }); - - test('accross lines', () => { - assertScreenReaderMessage( - [ - 'Hello world', - 'How are you', - 'I am good, thanks' - ], - new Selection(2, 1, 2, 1), - 'world\n', - (editor, cursor) => { - moveWordLeft(editor, false); - } - ); - }); - - test('no selection at start of file', () => { - assertScreenReaderMessage( - [ - 'Hello world!', - 'How are you?', - 'I am good, thanks' - ], - new Selection(1, 6, 1, 6), - 'Hello', - (editor, cursor) => { - moveWordLeft(editor, false); - } - ); - }); - - test('begin a selection', () => { - assertScreenReaderMessage( - [ - 'Hello world!', - 'How are you?', - 'I am good, thanks' - ], - new Selection(1, 12, 1, 12), - ScreenReaderMessageGenerator.xSelected('world'), - (editor, cursor) => { - moveWordLeft(editor, true); - } - ); - }); - - test('increase a selection', () => { - assertScreenReaderMessage( - [ - 'Hello world!', - 'How are you?', - 'I am good, thanks' - ], - new Selection(1, 12, 1, 7), - ScreenReaderMessageGenerator.xSelected('Hello '), - (editor, cursor) => { - moveWordLeft(editor, true); - } - ); - }); - - test('decrease a selection', () => { - assertScreenReaderMessage( - [ - 'Hello world!', - 'How are you?', - 'I am good, thanks' - ], - new Selection(1, 1, 1, 12), - ScreenReaderMessageGenerator.xUnselected('world'), - (editor, cursor) => { - moveWordLeft(editor, true); - } - ); - }); - - test('cancel a selection', () => { - assertScreenReaderMessage( - [ - 'Hello world!', - 'How are you?', - 'I am good, thanks' - ], - new Selection(2, 4, 2, 1), - ScreenReaderMessageGenerator.xUnselected('!\n\nHow'), - (editor, cursor) => { - moveWordLeft(editor, false); - } - ); - }); - }); - - -}); diff --git a/src/vs/editor/test/common/controller/cursorMoveCommand.test.ts b/src/vs/editor/test/common/controller/cursorMoveCommand.test.ts index 1b4ae6b014de48543ed076ecbb1a0e278041890a..2b9ac20069d6f30a64337364a5991f23126c9256 100644 --- a/src/vs/editor/test/common/controller/cursorMoveCommand.test.ts +++ b/src/vs/editor/test/common/controller/cursorMoveCommand.test.ts @@ -13,7 +13,7 @@ import { CursorMove } from 'vs/editor/common/controller/cursorMoveCommands'; import { Range } from 'vs/editor/common/core/range'; import { Selection } from 'vs/editor/common/core/selection'; import { CoreNavigationCommands } from 'vs/editor/common/controller/coreCommands'; -import { ViewModel } from "vs/editor/common/viewModel/viewModelImpl"; +import { ViewModel } from 'vs/editor/common/viewModel/viewModelImpl'; suite('Cursor move command test', () => { diff --git a/src/vs/editor/test/common/mocks/testConfiguration.ts b/src/vs/editor/test/common/mocks/testConfiguration.ts index edddfa74fddd47bc59326edf94a4346b4df12173..b94830a845649832c66492a357dede7cc8a64de9 100644 --- a/src/vs/editor/test/common/mocks/testConfiguration.ts +++ b/src/vs/editor/test/common/mocks/testConfiguration.ts @@ -7,7 +7,7 @@ import { CommonEditorConfiguration, IEnvConfiguration } from 'vs/editor/common/config/commonEditorConfig'; import { IEditorOptions } from 'vs/editor/common/config/editorOptions'; import { FontInfo, BareFontInfo } from 'vs/editor/common/config/fontInfo'; -import { AccessibilitySupport } from "vs/base/common/platform"; +import { AccessibilitySupport } from 'vs/base/common/platform'; export class TestConfiguration extends CommonEditorConfiguration { @@ -21,7 +21,6 @@ export class TestConfiguration extends CommonEditorConfiguration { extraEditorClassName: '', outerWidth: 100, outerHeight: 100, - canUseTranslate3d: true, emptySelectionClipboard: true, pixelRatio: 1, zoomLevel: 0, diff --git a/src/vs/editor/test/common/model/indentRanges.test.ts b/src/vs/editor/test/common/model/indentRanges.test.ts index f65722224b9be3ed1729ef3d1475bbbdf0c79e59..55b5e1ad6dd61c3b972b255efb6b794aa90e8e42 100644 --- a/src/vs/editor/test/common/model/indentRanges.test.ts +++ b/src/vs/editor/test/common/model/indentRanges.test.ts @@ -7,11 +7,16 @@ import * as assert from 'assert'; import { Model } from 'vs/editor/common/model/model'; -import { IFoldingRange } from 'vs/editor/contrib/folding/common/foldingModel'; import { computeRanges } from 'vs/editor/common/model/indentRanges'; +export interface IndentRange { + startLineNumber: number; + endLineNumber: number; + indent: number; +} + suite('Indentation Folding', () => { - function assertRanges(lines: string[], expected: IFoldingRange[]): void { + function assertRanges(lines: string[], expected: IndentRange[]): void { let model = Model.createFromString(lines.join('\n')); let actual = computeRanges(model); actual.sort((r1, r2) => r1.startLineNumber - r2.startLineNumber); @@ -19,7 +24,7 @@ suite('Indentation Folding', () => { model.dispose(); } - function r(startLineNumber: number, endLineNumber: number, indent: number): IFoldingRange { + function r(startLineNumber: number, endLineNumber: number, indent: number): IndentRange { return { startLineNumber, endLineNumber, indent }; } diff --git a/src/vs/editor/test/common/model/textModelSearch.test.ts b/src/vs/editor/test/common/model/textModelSearch.test.ts index 4102cfad4fef06b7b0c94aabfba99a676fc48a06..97417836da7c4a6558bf1e4be2a8164cb9fc0a54 100644 --- a/src/vs/editor/test/common/model/textModelSearch.test.ts +++ b/src/vs/editor/test/common/model/textModelSearch.test.ts @@ -10,8 +10,8 @@ import { FindMatch, EndOfLineSequence } from 'vs/editor/common/editorCommon'; import { Range } from 'vs/editor/common/core/range'; import { TextModel } from 'vs/editor/common/model/textModel'; import { TextModelSearch, SearchParams, SearchData } from 'vs/editor/common/model/textModelSearch'; -import { getMapForWordSeparators } from "vs/editor/common/controller/wordCharacterClassifier"; -import { USUAL_WORD_SEPARATORS } from "vs/editor/common/model/wordHelper"; +import { getMapForWordSeparators } from 'vs/editor/common/controller/wordCharacterClassifier'; +import { USUAL_WORD_SEPARATORS } from 'vs/editor/common/model/wordHelper'; // --------- Find suite('TextModelSearch', () => { @@ -31,7 +31,7 @@ suite('TextModelSearch', () => { let match = TextModelSearch.findNextMatch(model, searchParams, startPos, false); assert.deepEqual(match, expectedMatches[0], `findNextMatch ${startPos}`); for (let i = 0; i < expectedMatches.length; i++) { - startPos = expectedMatches[i].range.getStartPosition();; + startPos = expectedMatches[i].range.getStartPosition(); match = TextModelSearch.findNextMatch(model, searchParams, startPos, false); assert.deepEqual(match, expectedMatches[i], `findNextMatch ${startPos}`); } @@ -354,6 +354,32 @@ suite('TextModelSearch', () => { ); }); + test('issue #27459: Match whole words regression', () => { + assertFindMatches( + [ + 'this._register(this._textAreaInput.onKeyDown((e: IKeyboardEvent) => {', + ' this._viewController.emitKeyDown(e);', + '}));', + ].join('\n'), + '((e: ', false, false, USUAL_WORD_SEPARATORS, + [ + [1, 45, 1, 50] + ] + ); + }); + + test('issue #27594: Search results disappear', () => { + assertFindMatches( + [ + 'this.server.listen(0);', + ].join('\n'), + 'listen(', false, false, USUAL_WORD_SEPARATORS, + [ + [1, 13, 1, 20] + ] + ); + }); + test('findNextMatch without regex', () => { let model = TextModel.createFromString('line line one\nline two\nthree'); diff --git a/src/vs/editor/test/common/modes/supports/onEnter.test.ts b/src/vs/editor/test/common/modes/supports/onEnter.test.ts index a0a6cf77fd00890ffd0392bac2e6be2814dde02d..8b47393c63535a30930b1a15fe3e5bc041756bfb 100644 --- a/src/vs/editor/test/common/modes/supports/onEnter.test.ts +++ b/src/vs/editor/test/common/modes/supports/onEnter.test.ts @@ -10,34 +10,6 @@ import { OnEnterSupport } from 'vs/editor/common/modes/supports/onEnter'; suite('OnEnter', () => { - test('uses indentationRules', () => { - var support = new OnEnterSupport({ - indentationRules: { - decreaseIndentPattern: /^\s*((?!\S.*\/[*]).*[*]\/\s*)?[})\]]|^\s*(case\b.*|default):\s*(\/\/.*|\/[*].*[*]\/\s*)?$/, - increaseIndentPattern: /(\{[^}"'`]*|\([^)"']*|\[[^\]"']*|^\s*(\{\}|\(\)|\[\]|(case\b.*|default):))\s*(\/\/.*|\/[*].*[*]\/\s*)?$/, - indentNextLinePattern: /^\s*(for|while|if|else)\b(?!.*[;{}]\s*(\/\/.*|\/[*].*[*]\/\s*)?$)/, - unIndentedLinePattern: /^(?!.*([;{}]|\S:)\s*(\/\/.*|\/[*].*[*]\/\s*)?$)(?!.*(\{[^}"']*|\([^)"']*|\[[^\]"']*|^\s*(\{\}|\(\)|\[\]|(case\b.*|default):))\s*(\/\/.*|\/[*].*[*]\/\s*)?$)(?!^\s*((?!\S.*\/[*]).*[*]\/\s*)?[})\]]|^\s*(case\b.*|default):\s*(\/\/.*|\/[*].*[*]\/\s*)?$)(?!^\s*(for|while|if|else)\b(?!.*[;{}]\s*(\/\/.*|\/[*].*[*]\/\s*)?$))/ - } - }); - - var testIndentAction = (oneLineAboveText: string, beforeText: string, afterText: string, expected: IndentAction) => { - var actual = support.onEnter(oneLineAboveText, beforeText, afterText); - if (expected === IndentAction.None) { - assert.equal(actual, null); - } else { - assert.equal(actual.indentAction, expected); - } - }; - - testIndentAction('', 'case', '', IndentAction.None); - testIndentAction('', 'case:', '', IndentAction.Indent); - testIndentAction('', 'if (true) {', '', IndentAction.Indent); - testIndentAction('', 'if (true)', '', IndentAction.Indent); - testIndentAction('', ' ', '}', IndentAction.Outdent); - testIndentAction('if(true)', '\treturn false', '', IndentAction.Outdent); - testIndentAction('', 'var foo = `{`;', '', IndentAction.None); - }); - test('uses brackets', () => { var brackets: CharacterPair[] = [ ['(', ')'], diff --git a/src/vs/loader.js b/src/vs/loader.js index 8245e83de2f5d35e50294a55dc798d4aade5f993..aa1ae79ae5e7ebc2051ceeca701b6db4e55b184d 100644 --- a/src/vs/loader.js +++ b/src/vs/loader.js @@ -1,3 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +'use strict'; /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. @@ -17,22 +22,35 @@ var _amdLoaderGlobal = this; var AMDLoader; (function (AMDLoader) { AMDLoader.global = _amdLoaderGlobal; - AMDLoader.isNode = (typeof module !== 'undefined' && !!module.exports); - AMDLoader.isWindows = (function _isWindows() { - if (typeof navigator !== 'undefined') { - if (navigator.userAgent && navigator.userAgent.indexOf('Windows') >= 0) { - return true; - } - } - if (typeof process !== 'undefined') { - return (process.platform === 'win32'); + var Environment = (function () { + function Environment(opts) { + this.isWindows = opts.isWindows; + this.isNode = opts.isNode; + this.isElectronRenderer = opts.isElectronRenderer; + this.isWebWorker = opts.isWebWorker; } - return false; - })(); - AMDLoader.isWebWorker = (typeof AMDLoader.global.importScripts === 'function'); - AMDLoader.isElectronRenderer = (typeof process !== 'undefined' && typeof process.versions !== 'undefined' && typeof process.versions.electron !== 'undefined' && process.type === 'renderer'); - AMDLoader.isElectronMain = (typeof process !== 'undefined' && typeof process.versions !== 'undefined' && typeof process.versions.electron !== 'undefined' && process.type === 'browser'); - AMDLoader.hasPerformanceNow = (AMDLoader.global.performance && typeof AMDLoader.global.performance.now === 'function'); + Environment.detect = function () { + return new Environment({ + isWindows: this._isWindows(), + isNode: (typeof module !== 'undefined' && !!module.exports), + isElectronRenderer: (typeof process !== 'undefined' && typeof process.versions !== 'undefined' && typeof process.versions.electron !== 'undefined' && process.type === 'renderer'), + isWebWorker: (typeof AMDLoader.global.importScripts === 'function') + }); + }; + Environment._isWindows = function () { + if (typeof navigator !== 'undefined') { + if (navigator.userAgent && navigator.userAgent.indexOf('Windows') >= 0) { + return true; + } + } + if (typeof process !== 'undefined') { + return (process.platform === 'win32'); + } + return false; + }; + return Environment; + }()); + AMDLoader.Environment = Environment; })(AMDLoader || (AMDLoader = {})); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. @@ -53,10 +71,6 @@ var AMDLoader; LoaderEventType[LoaderEventType["NodeBeginNativeRequire"] = 33] = "NodeBeginNativeRequire"; LoaderEventType[LoaderEventType["NodeEndNativeRequire"] = 34] = "NodeEndNativeRequire"; })(LoaderEventType = AMDLoader.LoaderEventType || (AMDLoader.LoaderEventType = {})); - function getHighPerformanceTimestamp() { - return (AMDLoader.hasPerformanceNow ? AMDLoader.global.performance.now() : Date.now()); - } - AMDLoader.getHighPerformanceTimestamp = getHighPerformanceTimestamp; var LoaderEvent = (function () { function LoaderEvent(type, detail, timestamp) { this.type = type; @@ -71,7 +85,7 @@ var AMDLoader; this._events = [new LoaderEvent(LoaderEventType.LoaderAvailable, '', loaderAvailableTimestamp)]; } LoaderEventRecorder.prototype.record = function (type, detail) { - this._events.push(new LoaderEvent(type, detail, getHighPerformanceTimestamp())); + this._events.push(new LoaderEvent(type, detail, AMDLoader.Utilities.getHighPerformanceTimestamp())); }; LoaderEventRecorder.prototype.getEvents = function () { return this._events; @@ -105,9 +119,9 @@ var AMDLoader; /** * This method does not take care of / vs \ */ - Utilities.fileUriToFilePath = function (uri) { + Utilities.fileUriToFilePath = function (isWindows, uri) { uri = decodeURI(uri); - if (AMDLoader.isWindows) { + if (isWindows) { if (/^file:\/\/\//.test(uri)) { // This is a URI without a hostname => return only the path segment return uri.substr(8); @@ -178,9 +192,18 @@ var AMDLoader; Utilities.isAnonymousModule = function (id) { return /^===anonymous/.test(id); }; + Utilities.getHighPerformanceTimestamp = function () { + if (!this.PERFORMANCE_NOW_PROBED) { + this.PERFORMANCE_NOW_PROBED = true; + this.HAS_PERFORMANCE_NOW = (AMDLoader.global.performance && typeof AMDLoader.global.performance.now === 'function'); + } + return (this.HAS_PERFORMANCE_NOW ? AMDLoader.global.performance.now() : Date.now()); + }; return Utilities; }()); Utilities.NEXT_ANONYMOUS_ID = 1; + Utilities.PERFORMANCE_NOW_PROBED = false; + Utilities.HAS_PERFORMANCE_NOW = false; AMDLoader.Utilities = Utilities; })(AMDLoader || (AMDLoader = {})); /*--------------------------------------------------------------------------------------------- @@ -195,7 +218,7 @@ var AMDLoader; /** * Ensure configuration options make sense */ - ConfigurationOptionsUtil.validateConfigurationOptions = function (options) { + ConfigurationOptionsUtil.validateConfigurationOptions = function (isWebWorker, options) { function defaultOnError(err) { if (err.errorCode === 'load') { console.error('Loading "' + err.moduleId + '" failed'); @@ -231,7 +254,7 @@ var AMDLoader; } if (typeof options.catchError === 'undefined') { // Catch errors by default in web workers, do not catch errors by default in other contexts - options.catchError = AMDLoader.isWebWorker; + options.catchError = isWebWorker; } if (typeof options.urlArgs !== 'string') { options.urlArgs = ''; @@ -272,7 +295,7 @@ var AMDLoader; } return options; }; - ConfigurationOptionsUtil.mergeConfigurationOptions = function (overwrite, base) { + ConfigurationOptionsUtil.mergeConfigurationOptions = function (isWebWorker, overwrite, base) { if (overwrite === void 0) { overwrite = null; } if (base === void 0) { base = null; } var result = AMDLoader.Utilities.recursiveClone(base || {}); @@ -291,24 +314,25 @@ var AMDLoader; result[key] = AMDLoader.Utilities.recursiveClone(value); } }); - return ConfigurationOptionsUtil.validateConfigurationOptions(result); + return ConfigurationOptionsUtil.validateConfigurationOptions(isWebWorker, result); }; return ConfigurationOptionsUtil; }()); AMDLoader.ConfigurationOptionsUtil = ConfigurationOptionsUtil; var Configuration = (function () { - function Configuration(options) { - this.options = ConfigurationOptionsUtil.mergeConfigurationOptions(options); + function Configuration(env, options) { + this._env = env; + this.options = ConfigurationOptionsUtil.mergeConfigurationOptions(this._env.isWebWorker, options); this._createIgnoreDuplicateModulesMap(); this._createNodeModulesMap(); this._createSortedPathsRules(); if (this.options.baseUrl === '') { - if (AMDLoader.isNode && this.options.nodeRequire && this.options.nodeRequire.main && this.options.nodeRequire.main.filename) { + if (this._env.isNode && this.options.nodeRequire && this.options.nodeRequire.main && this.options.nodeRequire.main.filename) { var nodeMain = this.options.nodeRequire.main.filename; var dirnameIndex = Math.max(nodeMain.lastIndexOf('/'), nodeMain.lastIndexOf('\\')); this.options.baseUrl = nodeMain.substring(0, dirnameIndex + 1); } - if (AMDLoader.isNode && this.options.nodeMain) { + if (this._env.isNode && this.options.nodeMain) { var nodeMain = this.options.nodeMain; var dirnameIndex = Math.max(nodeMain.lastIndexOf('/'), nodeMain.lastIndexOf('\\')); this.options.baseUrl = nodeMain.substring(0, dirnameIndex + 1); @@ -359,7 +383,7 @@ var AMDLoader; * @result A new configuration */ Configuration.prototype.cloneAndMerge = function (options) { - return new Configuration(ConfigurationOptionsUtil.mergeConfigurationOptions(options, this.options)); + return new Configuration(this._env, ConfigurationOptionsUtil.mergeConfigurationOptions(this._env.isWebWorker, options, this.options)); }; /** * Get current options bag. Useful for passing it forward to plugins. @@ -588,28 +612,30 @@ var AMDLoader; return WorkerScriptLoader; }()); var NodeScriptLoader = (function () { - function NodeScriptLoader() { + function NodeScriptLoader(env) { + this._env = env; this._didInitialize = false; this._didPatchNodeRequire = false; - // js-flags have an impact on cached data - this._jsflags = ''; - for (var _i = 0, _a = process.argv; _i < _a.length; _i++) { - var arg = _a[_i]; - if (arg.indexOf('--js-flags=') === 0) { - this._jsflags = arg; - break; - } - } } NodeScriptLoader.prototype._init = function (nodeRequire) { if (this._didInitialize) { return; } this._didInitialize = true; + // capture node modules this._fs = nodeRequire('fs'); this._vm = nodeRequire('vm'); this._path = nodeRequire('path'); this._crypto = nodeRequire('crypto'); + // js-flags have an impact on cached data + this._jsflags = ''; + for (var _i = 0, _a = process.argv; _i < _a.length; _i++) { + var arg = _a[_i]; + if (arg.indexOf('--js-flags=') === 0) { + this._jsflags = arg; + break; + } + } }; // patch require-function of nodejs such that we can manually create a script // from cached data. this is done by overriding the `Module._compile` function @@ -684,7 +710,7 @@ var AMDLoader; callback(); } else { - scriptSrc = AMDLoader.Utilities.fileUriToFilePath(scriptSrc); + scriptSrc = AMDLoader.Utilities.fileUriToFilePath(this._env.isWindows, scriptSrc); this._fs.readFile(scriptSrc, { encoding: 'utf8' }, function (err, data) { if (err) { errorback(err); @@ -693,7 +719,7 @@ var AMDLoader; var normalizedScriptSrc = _this._path.normalize(scriptSrc); var vmScriptSrc = normalizedScriptSrc; // Make the script src friendly towards electron - if (AMDLoader.isElectronRenderer) { + if (_this._env.isElectronRenderer) { var driveLetterMatch = vmScriptSrc.match(/^([a-z])\:(.*)/i); if (driveLetterMatch) { // windows @@ -713,7 +739,7 @@ var AMDLoader; } contents = nodeInstrumenter(contents, normalizedScriptSrc); if (!opts.nodeCachedDataDir) { - _this._loadAndEvalScript(scriptSrc, vmScriptSrc, contents, { filename: vmScriptSrc }, recorder); + _this._loadAndEvalScript(moduleManager, scriptSrc, vmScriptSrc, contents, { filename: vmScriptSrc }, recorder); callback(); } else { @@ -725,7 +751,7 @@ var AMDLoader; produceCachedData: typeof cachedData === 'undefined', cachedData: cachedData }; - var script = _this._loadAndEvalScript(scriptSrc, vmScriptSrc, contents, options, recorder); + var script = _this._loadAndEvalScript(moduleManager, scriptSrc, vmScriptSrc, contents, options, recorder); callback(); _this._processCachedData(moduleManager, script, cachedDataPath_1); }); @@ -733,12 +759,12 @@ var AMDLoader; }); } }; - NodeScriptLoader.prototype._loadAndEvalScript = function (scriptSrc, vmScriptSrc, contents, options, recorder) { + NodeScriptLoader.prototype._loadAndEvalScript = function (moduleManager, scriptSrc, vmScriptSrc, contents, options, recorder) { // create script, run script recorder.record(AMDLoader.LoaderEventType.NodeBeginEvaluatingScript, scriptSrc); var script = new this._vm.Script(contents, options); var r = script.runInThisContext(options); - r.call(AMDLoader.global, AMDLoader.RequireFunc, AMDLoader.DefineFunc, vmScriptSrc, this._path.dirname(scriptSrc)); + r.call(AMDLoader.global, moduleManager.getGlobalAMDRequireFunc(), moduleManager.getGlobalAMDDefineFunc(), vmScriptSrc, this._path.dirname(scriptSrc)); // signal done recorder.record(AMDLoader.LoaderEventType.NodeEndEvaluatingScript, scriptSrc); return script; @@ -756,17 +782,15 @@ var AMDLoader; errorCode: 'cachedDataRejected', path: cachedDataPath }); - NodeScriptLoader._runSoon(function () { - return _this._fs.unlink(cachedDataPath, function (err) { - if (err) { - moduleManager.getConfig().getOptionsLiteral().onNodeCachedData({ - errorCode: 'unlink', - path: cachedDataPath, - detail: err - }); - } - }); - }, moduleManager.getConfig().getOptionsLiteral().nodeCachedDataWriteDelay); + NodeScriptLoader._runSoon(function () { return _this._fs.unlink(cachedDataPath, function (err) { + if (err) { + moduleManager.getConfig().getOptionsLiteral().onNodeCachedData({ + errorCode: 'unlink', + path: cachedDataPath, + detail: err + }); + } + }); }, moduleManager.getConfig().getOptionsLiteral().nodeCachedDataWriteDelay); } else if (script.cachedDataProduced) { // data produced => tell outside world @@ -775,17 +799,15 @@ var AMDLoader; length: script.cachedData.length }); // data produced => write cache file - NodeScriptLoader._runSoon(function () { - return _this._fs.writeFile(cachedDataPath, script.cachedData, function (err) { - if (err) { - moduleManager.getConfig().getOptionsLiteral().onNodeCachedData({ - errorCode: 'writeFile', - path: cachedDataPath, - detail: err - }); - } - }); - }, moduleManager.getConfig().getOptionsLiteral().nodeCachedDataWriteDelay); + NodeScriptLoader._runSoon(function () { return _this._fs.writeFile(cachedDataPath, script.cachedData, function (err) { + if (err) { + moduleManager.getConfig().getOptionsLiteral().onNodeCachedData({ + errorCode: 'writeFile', + path: cachedDataPath, + detail: err + }); + } + }); }, moduleManager.getConfig().getOptionsLiteral().nodeCachedDataWriteDelay); } }; NodeScriptLoader._runSoon = function (callback, minTimeout) { @@ -795,11 +817,14 @@ var AMDLoader; return NodeScriptLoader; }()); NodeScriptLoader._BOM = 0xFEFF; - AMDLoader.scriptLoader = new OnlyOnceScriptLoader(AMDLoader.isWebWorker ? - new WorkerScriptLoader() - : AMDLoader.isNode ? - new NodeScriptLoader() - : new BrowserScriptLoader()); + function createScriptLoader(env) { + return new OnlyOnceScriptLoader(env.isWebWorker ? + new WorkerScriptLoader() + : env.isNode ? + new NodeScriptLoader(env) + : new BrowserScriptLoader()); + } + AMDLoader.createScriptLoader = createScriptLoader; })(AMDLoader || (AMDLoader = {})); /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. @@ -995,22 +1020,34 @@ var AMDLoader; }()); AMDLoader.PluginDependency = PluginDependency; var ModuleManager = (function () { - function ModuleManager(scriptLoader, loaderAvailableTimestamp) { + function ModuleManager(env, scriptLoader, defineFunc, requireFunc, loaderAvailableTimestamp) { if (loaderAvailableTimestamp === void 0) { loaderAvailableTimestamp = 0; } - this._recorder = null; + this._env = env; + this._scriptLoader = scriptLoader; this._loaderAvailableTimestamp = loaderAvailableTimestamp; + this._defineFunc = defineFunc; + this._requireFunc = requireFunc; this._moduleIdProvider = new ModuleIdProvider(); - this._config = new AMDLoader.Configuration(); - this._scriptLoader = scriptLoader; + this._config = new AMDLoader.Configuration(this._env); this._modules2 = []; this._knownModules2 = []; this._inverseDependencies2 = []; this._inversePluginDependencies2 = new Map(); this._currentAnnonymousDefineCall = null; + this._recorder = null; this._buildInfoPath = []; this._buildInfoDefineStack = []; this._buildInfoDependencies = []; } + ModuleManager.prototype.reset = function () { + return new ModuleManager(this._env, this._scriptLoader, this._defineFunc, this._requireFunc, this._loaderAvailableTimestamp); + }; + ModuleManager.prototype.getGlobalAMDDefineFunc = function () { + return this._defineFunc; + }; + ModuleManager.prototype.getGlobalAMDRequireFunc = function () { + return this._requireFunc; + }; ModuleManager._findRelevantLocationInStack = function (needle, stack) { var normalize = function (str) { return str.replace(/\\/g, '/'); }; var normalizedPath = normalize(needle); @@ -1176,7 +1213,7 @@ var AMDLoader; ModuleManager.prototype.configure = function (params, shouldOverwrite) { var oldShouldRecordStats = this._config.shouldRecordStats(); if (shouldOverwrite) { - this._config = new AMDLoader.Configuration(params); + this._config = new AMDLoader.Configuration(this._env, params); } else { this._config = this._config.cloneAndMerge(params); @@ -1341,7 +1378,7 @@ var AMDLoader; this._knownModules2[moduleId] = true; var strModuleId = this._moduleIdProvider.getStrModuleId(moduleId); var paths = this._config.moduleIdToPaths(strModuleId); - if (AMDLoader.isNode && strModuleId.indexOf('/') === -1) { + if (this._env.isNode && strModuleId.indexOf('/') === -1) { paths.push('node|' + strModuleId); } var lastPathIndex = -1; @@ -1524,19 +1561,14 @@ var AMDLoader; }()); AMDLoader.ModuleManager = ModuleManager; })(AMDLoader || (AMDLoader = {})); -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -'use strict'; -// Limitation: To load jquery through the loader, always require 'jquery' and add a path for it in the loader configuration var define; var AMDLoader; (function (AMDLoader) { - var moduleManager; - var loaderAvailableTimestamp; - var DefineFunc = (function () { - function DefineFunc(id, dependencies, callback) { + var moduleManager = null; + var DefineFunc = null; + var RequireFunc = null; + function createGlobalAMDFuncs() { + var _defineFunc = function (id, dependencies, callback) { if (typeof id !== 'string') { callback = dependencies; dependencies = id; @@ -1555,18 +1587,19 @@ var AMDLoader; else { moduleManager.enqueueDefineAnonymousModule(dependencies, callback); } - } - return DefineFunc; - }()); - DefineFunc.amd = { - jQuery: true - }; - AMDLoader.DefineFunc = DefineFunc; - var RequireFunc = (function () { - function RequireFunc() { + }; + DefineFunc = _defineFunc; + DefineFunc.amd = { + jQuery: true + }; + var _requireFunc_config = function (params, shouldOverwrite) { + if (shouldOverwrite === void 0) { shouldOverwrite = false; } + moduleManager.configure(params, shouldOverwrite); + }; + var _requireFunc = function () { if (arguments.length === 1) { if ((arguments[0] instanceof Object) && !Array.isArray(arguments[0])) { - RequireFunc.config(arguments[0]); + _requireFunc_config(arguments[0]); return; } if (typeof arguments[0] === 'string') { @@ -1580,38 +1613,28 @@ var AMDLoader; } } throw new Error('Unrecognized require call'); - } - RequireFunc.config = function (params, shouldOverwrite) { - if (shouldOverwrite === void 0) { shouldOverwrite = false; } - moduleManager.configure(params, shouldOverwrite); }; + RequireFunc = _requireFunc; + RequireFunc.config = _requireFunc_config; RequireFunc.getConfig = function () { return moduleManager.getConfig().getOptionsLiteral(); }; - /** - * Non standard extension to reset completely the loader state. This is used for running amdjs tests - */ RequireFunc.reset = function () { - moduleManager = new AMDLoader.ModuleManager(AMDLoader.scriptLoader, loaderAvailableTimestamp); + moduleManager = moduleManager.reset(); }; - /** - * Non standard extension to fetch loader state for building purposes. - */ RequireFunc.getBuildInfo = function () { return moduleManager.getBuildInfo(); }; - /** - * Non standard extension to fetch loader events - */ RequireFunc.getStats = function () { return moduleManager.getLoaderEvents(); }; - return RequireFunc; - }()); - AMDLoader.RequireFunc = RequireFunc; + } function init() { - moduleManager = new AMDLoader.ModuleManager(AMDLoader.scriptLoader, loaderAvailableTimestamp); - if (AMDLoader.isNode) { + createGlobalAMDFuncs(); + var env = AMDLoader.Environment.detect(); + var scriptLoader = AMDLoader.createScriptLoader(env); + moduleManager = new AMDLoader.ModuleManager(env, scriptLoader, DefineFunc, RequireFunc, AMDLoader.Utilities.getHighPerformanceTimestamp()); + if (env.isNode) { var _nodeRequire = (AMDLoader.global.require || require); var nodeRequire = function (what) { moduleManager.getRecorder().record(AMDLoader.LoaderEventType.NodeBeginNativeRequire, what); @@ -1625,7 +1648,7 @@ var AMDLoader; AMDLoader.global.nodeRequire = nodeRequire; RequireFunc.nodeRequire = nodeRequire; } - if (AMDLoader.isNode && !AMDLoader.isElectronRenderer) { + if (env.isNode && !env.isElectronRenderer) { module.exports = RequireFunc; // These two defs are fore the local closure defined in node in the case that the loader is concatenated define = function () { @@ -1638,7 +1661,7 @@ var AMDLoader; if (typeof AMDLoader.global.require !== 'undefined' && typeof AMDLoader.global.require !== 'function') { RequireFunc.config(AMDLoader.global.require); } - if (!AMDLoader.isElectronRenderer) { + if (!env.isElectronRenderer) { AMDLoader.global.define = define = DefineFunc; } else { @@ -1650,8 +1673,9 @@ var AMDLoader; AMDLoader.global.require.__$__nodeRequire = nodeRequire; } } - if (typeof AMDLoader.global.define !== 'function' || !AMDLoader.global.define.amd) { + AMDLoader.init = init; + if (typeof doNotInitLoader === 'undefined' && + (typeof AMDLoader.global.define !== 'function' || !AMDLoader.global.define.amd)) { init(); - loaderAvailableTimestamp = AMDLoader.getHighPerformanceTimestamp(); } })(AMDLoader || (AMDLoader = {})); diff --git a/src/vs/monaco.d.ts b/src/vs/monaco.d.ts index 7f3c80b83fa951101002ca9550598a21f0832a15..91b3303a2d0d75e90f336231fe0195680d3f2bac 100644 --- a/src/vs/monaco.d.ts +++ b/src/vs/monaco.d.ts @@ -1052,6 +1052,10 @@ declare module monaco.editor { Visible = 3, } + export interface ThemeColor { + id: string; + } + /** * Vertical Lane in the overview ruler of the editor. */ @@ -1092,7 +1096,7 @@ declare module monaco.editor { */ export interface IModelDecorationOptions { /** - * Customize the growing behaviour of the decoration when typing at the edges of the decoration. + * Customize the growing behavior of the decoration when typing at the edges of the decoration. * Defaults to TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges */ stickiness?: TrackedRangeStickiness; @@ -1638,7 +1642,8 @@ declare module monaco.editor { } /** - * Describes the behaviour of decorations when typing/editing near their edges. + * 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, @@ -2158,10 +2163,6 @@ declare module monaco.editor { restoreViewState?(state: any): void; } - export interface ThemeColor { - id: string; - } - export interface ICommonCodeEditor extends IEditor { /** * An event emitted when the content of the current model has changed. @@ -2654,6 +2655,11 @@ declare module monaco.editor { * Defaults to false. */ enabled?: boolean; + /** + * Control the rendering of the minimap slider. + * Defaults to 'mouseover'. + */ + showSlider?: 'always' | 'mouseover'; /** * Render the actual text on a line (as opposed to color blocks). * Defaults to true. @@ -2787,10 +2793,11 @@ declare module monaco.editor { */ fontLigatures?: boolean; /** - * Disable the use of `translate3d`. + * Disable the use of `will-change` for the editor margin and lines layers. + * The usage of `will-change` acts as a hint for browsers to create an extra layer. * Defaults to false. */ - disableTranslate3d?: boolean; + disableLayerHinting?: boolean; /** * Disable the optimizations for monospace fonts. * Defaults to false. @@ -2866,6 +2873,11 @@ declare module monaco.editor { * Defaults to true. */ hover?: boolean; + /** + * Enable detecting links and making them clickable. + * Defaults to true. + */ + links?: boolean; /** * Enable custom contextmenu. * Defaults to true. @@ -2880,7 +2892,12 @@ declare module monaco.editor { * The modifier to be used to add multiple cursors with the mouse. * Defaults to 'alt' */ - multicursorModifier?: 'cmd' | 'ctrl' | 'alt'; + multiCursorModifier?: 'ctrlCmd' | 'alt'; + /** + * Configure the editor's accessibility support. + * Defaults to 'auto'. It is best to leave this to 'auto'. + */ + accessibilitySupport?: 'auto' | 'off' | 'on'; /** * Enable quick suggestions (shadow suggestions) * Defaults to true. @@ -2909,6 +2926,11 @@ declare module monaco.editor { * Defaults to true. */ autoClosingBrackets?: boolean; + /** + * Enable auto indentation adjustment. + * Defaults to false. + */ + autoIndent?: boolean; /** * Enable format on type. * Defaults to false. @@ -3171,6 +3193,7 @@ declare module monaco.editor { export interface InternalEditorMinimapOptions { readonly enabled: boolean; + readonly showSlider: 'always' | 'mouseover'; readonly renderCharacters: boolean; readonly maxColumn: number; } @@ -3225,6 +3248,7 @@ declare module monaco.editor { export interface EditorContribOptions { readonly selectionClipboard: boolean; readonly hover: boolean; + readonly links: boolean; readonly contextmenu: boolean; readonly quickSuggestions: boolean | { other: boolean; @@ -3257,14 +3281,15 @@ declare module monaco.editor { */ export class InternalEditorOptions { readonly _internalEditorOptionsBrand: void; - readonly canUseTranslate3d: boolean; + readonly canUseLayerHinting: boolean; readonly pixelRatio: number; readonly editorClassName: string; readonly lineHeight: number; readonly readOnly: boolean; - readonly multicursorModifier: 'altKey' | 'ctrlKey' | 'metaKey'; + readonly multiCursorModifier: 'altKey' | 'ctrlKey' | 'metaKey'; readonly wordSeparators: string; readonly autoClosingBrackets: boolean; + readonly autoIndent: boolean; readonly useTabStops: boolean; readonly tabFocusMode: boolean; readonly dragAndDrop: boolean; @@ -3388,15 +3413,16 @@ declare module monaco.editor { * An event describing that the configuration of the editor has changed. */ export interface IConfigurationChangedEvent { - readonly canUseTranslate3d: boolean; + readonly canUseLayerHinting: boolean; readonly pixelRatio: boolean; readonly editorClassName: boolean; readonly lineHeight: boolean; readonly readOnly: boolean; readonly accessibilitySupport: boolean; - readonly multicursorModifier: boolean; + readonly multiCursorModifier: boolean; readonly wordSeparators: boolean; readonly autoClosingBrackets: boolean; + readonly autoIndent: boolean; readonly useTabStops: boolean; readonly tabFocusMode: boolean; readonly dragAndDrop: boolean; @@ -3942,7 +3968,7 @@ declare module monaco.languages { export function registerDocumentSymbolProvider(languageId: string, provider: DocumentSymbolProvider): IDisposable; /** - * Register a document highlight provider (used by e.g. highlight occurences). + * Register a document highlight provider (used by e.g. highlight occurrences). */ export function registerDocumentHighlightProvider(languageId: string, provider: DocumentHighlightProvider): IDisposable; diff --git a/src/vs/nls.build.js b/src/vs/nls.build.js new file mode 100644 index 0000000000000000000000000000000000000000..ece108ed635fa422566c3407696525e68fd21367 --- /dev/null +++ b/src/vs/nls.build.js @@ -0,0 +1,182 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +/*--------------------------------------------------------------------------------------------- + *--------------------------------------------------------------------------------------------- + *--------------------------------------------------------------------------------------------- + *--------------------------------------------------------------------------------------------- + *--------------------------------------------------------------------------------------------- + * Please make sure to make edits in the .ts file at https://github.com/Microsoft/vscode-loader/ + *--------------------------------------------------------------------------------------------- + *--------------------------------------------------------------------------------------------- + *--------------------------------------------------------------------------------------------- + *--------------------------------------------------------------------------------------------- + *--------------------------------------------------------------------------------------------*/ +'use strict'; +var _nlsPluginGlobal = this; +var NLSBuildLoaderPlugin; +(function (NLSBuildLoaderPlugin) { + var global = _nlsPluginGlobal || {}; + var Resources = global.Plugin && global.Plugin.Resources ? global.Plugin.Resources : undefined; + var IS_PSEUDO = (global && global.document && global.document.location && global.document.location.hash.indexOf('pseudo=true') >= 0); + function _format(message, args) { + var result; + if (args.length === 0) { + result = message; + } + else { + result = message.replace(/\{(\d+)\}/g, function (match, rest) { + var index = rest[0]; + return typeof args[index] !== 'undefined' ? args[index] : match; + }); + } + if (IS_PSEUDO) { + // FF3B and FF3D is the Unicode zenkaku representation for [ and ] + result = '\uFF3B' + result.replace(/[aouei]/g, '$&$&') + '\uFF3D'; + } + return result; + } + function findLanguageForModule(config, name) { + var result = config[name]; + if (result) + return result; + result = config['*']; + if (result) + return result; + return null; + } + function localize(data, message) { + var args = []; + for (var _i = 0; _i < (arguments.length - 2); _i++) { + args[_i] = arguments[_i + 2]; + } + return _format(message, args); + } + function createScopedLocalize(scope) { + return function (idx, defaultValue) { + var restArgs = Array.prototype.slice.call(arguments, 2); + return _format(scope[idx], restArgs); + }; + } + var NLSPlugin = (function () { + function NLSPlugin() { + this.localize = localize; + } + NLSPlugin.prototype.setPseudoTranslation = function (value) { + IS_PSEUDO = value; + }; + NLSPlugin.prototype.create = function (key, data) { + return { + localize: createScopedLocalize(data[key]) + }; + }; + NLSPlugin.prototype.load = function (name, req, load, config) { + config = config || {}; + if (!name || name.length === 0) { + load({ + localize: localize + }); + } + else { + var suffix = void 0; + if (Resources && Resources.getString) { + suffix = '.nls.keys'; + req([name + suffix], function (keyMap) { + load({ + localize: function (moduleKey, index) { + if (!keyMap[moduleKey]) + return 'NLS error: unknown key ' + moduleKey; + var mk = keyMap[moduleKey].keys; + if (index >= mk.length) + return 'NLS error unknow index ' + index; + var subKey = mk[index]; + var args = []; + args[0] = moduleKey + '_' + subKey; + for (var _i = 0; _i < (arguments.length - 2); _i++) { + args[_i + 1] = arguments[_i + 2]; + } + return Resources.getString.apply(Resources, args); + } + }); + }); + } + else { + if (config.isBuild) { + req([name + '.nls', name + '.nls.keys'], function (messages, keys) { + NLSPlugin.BUILD_MAP[name] = messages; + NLSPlugin.BUILD_MAP_KEYS[name] = keys; + load(messages); + }); + } + else { + var pluginConfig = config['vs/nls'] || {}; + var language = pluginConfig.availableLanguages ? findLanguageForModule(pluginConfig.availableLanguages, name) : null; + suffix = '.nls'; + if (language !== null && language !== NLSPlugin.DEFAULT_TAG) { + suffix = suffix + '.' + language; + } + req([name + suffix], function (messages) { + if (Array.isArray(messages)) { + messages.localize = createScopedLocalize(messages); + } + else { + messages.localize = createScopedLocalize(messages[name]); + } + load(messages); + }); + } + } + } + }; + NLSPlugin.prototype._getEntryPointsMap = function () { + global.nlsPluginEntryPoints = global.nlsPluginEntryPoints || {}; + return global.nlsPluginEntryPoints; + }; + NLSPlugin.prototype.write = function (pluginName, moduleName, write) { + // getEntryPoint is a Monaco extension to r.js + var entryPoint = write.getEntryPoint(); + // r.js destroys the context of this plugin between calling 'write' and 'writeFile' + // so the only option at this point is to leak the data to a global + var entryPointsMap = this._getEntryPointsMap(); + entryPointsMap[entryPoint] = entryPointsMap[entryPoint] || []; + entryPointsMap[entryPoint].push(moduleName); + if (moduleName !== entryPoint) { + write.asModule(pluginName + '!' + moduleName, 'define([\'vs/nls\', \'vs/nls!' + entryPoint + '\'], function(nls, data) { return nls.create("' + moduleName + '", data); });'); + } + }; + NLSPlugin.prototype.writeFile = function (pluginName, moduleName, req, write, config) { + var entryPointsMap = this._getEntryPointsMap(); + if (entryPointsMap.hasOwnProperty(moduleName)) { + var fileName = req.toUrl(moduleName + '.nls.js'); + var contents = [ + '/*---------------------------------------------------------', + ' * Copyright (c) Microsoft Corporation. All rights reserved.', + ' *--------------------------------------------------------*/' + ], entries = entryPointsMap[moduleName]; + var data = {}; + for (var i = 0; i < entries.length; i++) { + data[entries[i]] = NLSPlugin.BUILD_MAP[entries[i]]; + } + contents.push('define("' + moduleName + '.nls", ' + JSON.stringify(data, null, '\t') + ');'); + write(fileName, contents.join('\r\n')); + } + }; + NLSPlugin.prototype.finishBuild = function (write) { + write('nls.metadata.json', JSON.stringify({ + keys: NLSPlugin.BUILD_MAP_KEYS, + messages: NLSPlugin.BUILD_MAP, + bundles: this._getEntryPointsMap() + }, null, '\t')); + }; + ; + return NLSPlugin; + }()); + NLSPlugin.DEFAULT_TAG = 'i-default'; + NLSPlugin.BUILD_MAP = {}; + NLSPlugin.BUILD_MAP_KEYS = {}; + NLSBuildLoaderPlugin.NLSPlugin = NLSPlugin; + (function () { + define('vs/nls', new NLSPlugin()); + })(); +})(NLSBuildLoaderPlugin || (NLSBuildLoaderPlugin = {})); diff --git a/src/vs/nls.js b/src/vs/nls.js index 17a672ffae9f8c49ac86bb6ab9882dcfc4b6d43b..231b85d0c865717ae52da5a34740009184e6433a 100644 --- a/src/vs/nls.js +++ b/src/vs/nls.js @@ -1,183 +1,126 @@ /*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ +* Copyright (c) Microsoft Corporation. All rights reserved. +* Licensed under the MIT License. See License.txt in the project root for license information. +*--------------------------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------------------------- - *--------------------------------------------------------------------------------------------- - *--------------------------------------------------------------------------------------------- - *--------------------------------------------------------------------------------------------- - *--------------------------------------------------------------------------------------------- - * Please make sure to make edits in the .ts file at https://github.com/Microsoft/vscode-loader/ - *--------------------------------------------------------------------------------------------- - *--------------------------------------------------------------------------------------------- - *--------------------------------------------------------------------------------------------- - *--------------------------------------------------------------------------------------------- - *--------------------------------------------------------------------------------------------*/ +*--------------------------------------------------------------------------------------------- +*--------------------------------------------------------------------------------------------- +*--------------------------------------------------------------------------------------------- +*--------------------------------------------------------------------------------------------- +* Please make sure to make edits in the .ts file at https://github.com/Microsoft/vscode-loader/ +*--------------------------------------------------------------------------------------------- +*--------------------------------------------------------------------------------------------- +*--------------------------------------------------------------------------------------------- +*--------------------------------------------------------------------------------------------- +*--------------------------------------------------------------------------------------------*/ 'use strict'; -var _nlsPluginGlobal = this; var NLSLoaderPlugin; (function (NLSLoaderPlugin) { - var global = _nlsPluginGlobal || {}; - var Resources = global.Plugin && global.Plugin.Resources ? global.Plugin.Resources : undefined; - var DEFAULT_TAG = 'i-default'; - var IS_PSEUDO = (global && global.document && global.document.location && global.document.location.hash.indexOf('pseudo=true') >= 0); - var slice = Array.prototype.slice; - function _format(message, args) { - var result; - if (args.length === 0) { - result = message; - } - else { - result = message.replace(/\{(\d+)\}/g, function (match, rest) { - var index = rest[0]; - return typeof args[index] !== 'undefined' ? args[index] : match; - }); - } - if (IS_PSEUDO) { - // FF3B and FF3D is the Unicode zenkaku representation for [ and ] - result = '\uFF3B' + result.replace(/[aouei]/g, '$&$&') + '\uFF3D'; - } - return result; - } - function findLanguageForModule(config, name) { - var result = config[name]; - if (result) - return result; - result = config['*']; - if (result) - return result; - return null; - } - function localize(data, message) { - var args = []; - for (var _i = 0; _i < (arguments.length - 2); _i++) { - args[_i] = arguments[_i + 2]; - } - return _format(message, args); - } - function createScopedLocalize(scope) { - return function (idx, defaultValue) { - var restArgs = slice.call(arguments, 2); - return _format(scope[idx], restArgs); - }; - } - var NLSPlugin = (function () { - function NLSPlugin() { - this.localize = localize; - } - NLSPlugin.prototype.setPseudoTranslation = function (value) { - IS_PSEUDO = value; - }; - NLSPlugin.prototype.create = function (key, data) { - return { - localize: createScopedLocalize(data[key]) - }; - }; - NLSPlugin.prototype.load = function (name, req, load, config) { - config = config || {}; - if (!name || name.length === 0) { - load({ - localize: localize - }); - } - else { - var suffix = void 0; - if (Resources && Resources.getString) { - suffix = '.nls.keys'; - req([name + suffix], function (keyMap) { - load({ - localize: function (moduleKey, index) { - if (!keyMap[moduleKey]) - return 'NLS error: unknown key ' + moduleKey; - var mk = keyMap[moduleKey].keys; - if (index >= mk.length) - return 'NLS error unknow index ' + index; - var subKey = mk[index]; - var args = []; - args[0] = moduleKey + '_' + subKey; - for (var _i = 0; _i < (arguments.length - 2); _i++) { - args[_i + 1] = arguments[_i + 2]; - } - return Resources.getString.apply(Resources, args); - } - }); - }); - } - else { - if (config.isBuild) { - req([name + '.nls', name + '.nls.keys'], function (messages, keys) { - NLSPlugin.BUILD_MAP[name] = messages; - NLSPlugin.BUILD_MAP_KEYS[name] = keys; - load(messages); - }); - } - else { - var pluginConfig = config['vs/nls'] || {}; - var language = pluginConfig.availableLanguages ? findLanguageForModule(pluginConfig.availableLanguages, name) : null; - suffix = '.nls'; - if (language !== null && language !== DEFAULT_TAG) { - suffix = suffix + '.' + language; - } - req([name + suffix], function (messages) { - if (Array.isArray(messages)) { - messages.localize = createScopedLocalize(messages); - } - else { - messages.localize = createScopedLocalize(messages[name]); - } - load(messages); - }); - } - } - } - }; - NLSPlugin.prototype._getEntryPointsMap = function () { - global.nlsPluginEntryPoints = global.nlsPluginEntryPoints || {}; - return global.nlsPluginEntryPoints; - }; - NLSPlugin.prototype.write = function (pluginName, moduleName, write) { - // getEntryPoint is a Monaco extension to r.js - var entryPoint = write.getEntryPoint(); - // r.js destroys the context of this plugin between calling 'write' and 'writeFile' - // so the only option at this point is to leak the data to a global - var entryPointsMap = this._getEntryPointsMap(); - entryPointsMap[entryPoint] = entryPointsMap[entryPoint] || []; - entryPointsMap[entryPoint].push(moduleName); - if (moduleName !== entryPoint) { - write.asModule(pluginName + '!' + moduleName, 'define([\'vs/nls\', \'vs/nls!' + entryPoint + '\'], function(nls, data) { return nls.create("' + moduleName + '", data); });'); - } - }; - NLSPlugin.prototype.writeFile = function (pluginName, moduleName, req, write, config) { - var entryPointsMap = this._getEntryPointsMap(); - if (entryPointsMap.hasOwnProperty(moduleName)) { - var fileName = req.toUrl(moduleName + '.nls.js'); - var contents = [ - '/*---------------------------------------------------------', - ' * Copyright (c) Microsoft Corporation. All rights reserved.', - ' *--------------------------------------------------------*/' - ], entries = entryPointsMap[moduleName]; - var data = {}; - for (var i = 0; i < entries.length; i++) { - data[entries[i]] = NLSPlugin.BUILD_MAP[entries[i]]; - } - contents.push('define("' + moduleName + '.nls", ' + JSON.stringify(data, null, '\t') + ');'); - write(fileName, contents.join('\r\n')); - } - }; - NLSPlugin.prototype.finishBuild = function (write) { - write('nls.metadata.json', JSON.stringify({ - keys: NLSPlugin.BUILD_MAP_KEYS, - messages: NLSPlugin.BUILD_MAP, - bundles: this._getEntryPointsMap() - }, null, '\t')); - }; - ; - return NLSPlugin; - }()); - NLSPlugin.BUILD_MAP = {}; - NLSPlugin.BUILD_MAP_KEYS = {}; - NLSLoaderPlugin.NLSPlugin = NLSPlugin; - (function () { - define('vs/nls', new NLSPlugin()); - })(); + var Environment = (function () { + function Environment(isPseudo) { + this.isPseudo = isPseudo; + // + } + Environment.detect = function () { + var isPseudo = (typeof document !== 'undefined' && document.location && document.location.hash.indexOf('pseudo=true') >= 0); + return new Environment(isPseudo); + }; + return Environment; + }()); + function _format(message, args, env) { + var result; + if (args.length === 0) { + result = message; + } + else { + result = message.replace(/\{(\d+)\}/g, function (match, rest) { + var index = rest[0]; + return typeof args[index] !== 'undefined' ? args[index] : match; + }); + } + if (env.isPseudo) { + // FF3B and FF3D is the Unicode zenkaku representation for [ and ] + result = '\uFF3B' + result.replace(/[aouei]/g, '$&$&') + '\uFF3D'; + } + return result; + } + function findLanguageForModule(config, name) { + var result = config[name]; + if (result) + return result; + result = config['*']; + if (result) + return result; + return null; + } + function localize(env, data, message) { + var args = []; + for (var _i = 3; _i < arguments.length; _i++) { + args[_i - 3] = arguments[_i]; + } + return _format(message, args, env); + } + function createScopedLocalize(scope, env) { + return function (idx, defaultValue) { + var restArgs = Array.prototype.slice.call(arguments, 2); + return _format(scope[idx], restArgs, env); + }; + } + var NLSPlugin = (function () { + function NLSPlugin(env) { + var _this = this; + this._env = env; + this.localize = function (data, message) { + var args = []; + for (var _i = 2; _i < arguments.length; _i++) { + args[_i - 2] = arguments[_i]; + } + return localize.apply(void 0, [_this._env, data, message].concat(args)); + }; + } + NLSPlugin.prototype.setPseudoTranslation = function (value) { + this._env = new Environment(value); + }; + NLSPlugin.prototype.create = function (key, data) { + return { + localize: createScopedLocalize(data[key], this._env) + }; + }; + NLSPlugin.prototype.load = function (name, req, load, config) { + var _this = this; + config = config || {}; + if (!name || name.length === 0) { + load({ + localize: this.localize + }); + } + else { + var pluginConfig = config['vs/nls'] || {}; + var language = pluginConfig.availableLanguages ? findLanguageForModule(pluginConfig.availableLanguages, name) : null; + var suffix = '.nls'; + if (language !== null && language !== NLSPlugin.DEFAULT_TAG) { + suffix = suffix + '.' + language; + } + req([name + suffix], function (messages) { + if (Array.isArray(messages)) { + messages.localize = createScopedLocalize(messages, _this._env); + } + else { + messages.localize = createScopedLocalize(messages[name], _this._env); + } + load(messages); + }); + } + }; + return NLSPlugin; + }()); + NLSPlugin.DEFAULT_TAG = 'i-default'; + NLSLoaderPlugin.NLSPlugin = NLSPlugin; + function init() { + define('vs/nls', new NLSPlugin(Environment.detect())); + } + NLSLoaderPlugin.init = init; + if (typeof doNotInitLoader === 'undefined') { + init(); + } })(NLSLoaderPlugin || (NLSLoaderPlugin = {})); diff --git a/src/vs/platform/actions/electron-browser/menusExtensionPoint.ts b/src/vs/platform/actions/electron-browser/menusExtensionPoint.ts index a9a61d92d571b11b1c3129898b4c7cdd8a0ec4a9..401e489ee0f1a65df9e465434330800370c1b370 100644 --- a/src/vs/platform/actions/electron-browser/menusExtensionPoint.ts +++ b/src/vs/platform/actions/electron-browser/menusExtensionPoint.ts @@ -143,6 +143,16 @@ namespace schema { description: localize('menus.resourceStateContext', "The Source Control resource state context menu"), type: 'array', items: menuItem + }, + 'view/title': { + description: localize('view.viewTitle', "The contributed view title menu"), + type: 'array', + items: menuItem + }, + 'view/item/context': { + description: localize('view.itemContext', "The contributed view item context menu"), + type: 'array', + items: menuItem } } }; @@ -224,22 +234,22 @@ namespace schema { }, icon: { description: localize('vscode.extension.contributes.commandType.icon', '(Optional) Icon which is used to represent the command in the UI. Either a file path or a themable configuration'), - anyOf: [ - 'string', - { - type: 'object', - properties: { - light: { - description: localize('vscode.extension.contributes.commandType.icon.light', 'Icon path when a light theme is used'), - type: 'string' - }, - dark: { - description: localize('vscode.extension.contributes.commandType.icon.dark', 'Icon path when a dark theme is used'), - type: 'string' - } + anyOf: [{ + type: 'string' + }, + { + type: 'object', + properties: { + light: { + description: localize('vscode.extension.contributes.commandType.icon.light', 'Icon path when a light theme is used'), + type: 'string' + }, + dark: { + description: localize('vscode.extension.contributes.commandType.icon.dark', 'Icon path when a dark theme is used'), + type: 'string' } } - ] + }] } } }; diff --git a/src/vs/platform/backup/common/backup.ts b/src/vs/platform/backup/common/backup.ts index 9a53670387fc99f28dca4bb19b6b498ebb6f6f65..dcc3eec908ce4e139072ec85bd3034b2e418e235 100644 --- a/src/vs/platform/backup/common/backup.ts +++ b/src/vs/platform/backup/common/backup.ts @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { TPromise } from 'vs/base/common/winjs.base'; export interface IBackupWorkspacesFormat { folderWorkspaces: string[]; @@ -12,19 +11,12 @@ export interface IBackupWorkspacesFormat { } export const IBackupMainService = createDecorator('backupMainService'); -export const IBackupService = createDecorator('backupService'); -export interface IBackupMainService extends IBackupService { +export interface IBackupMainService { _serviceBrand: any; getWorkspaceBackupPaths(): string[]; getEmptyWorkspaceBackupPaths(): string[]; - registerWindowForBackupsSync(windowId: number, isEmptyWorkspace: boolean, backupFolder?: string, workspacePath?: string): void; -} - -export interface IBackupService { - _serviceBrand: any; - - getBackupPath(windowId: number): TPromise; + registerWindowForBackupsSync(windowId: number, isEmptyWorkspace: boolean, backupFolder?: string, workspacePath?: string): string; } \ No newline at end of file diff --git a/src/vs/platform/backup/common/backupIpc.ts b/src/vs/platform/backup/common/backupIpc.ts deleted file mode 100644 index 0fdfdb86824fc4ccb204c54a7e92ea85f2781450..0000000000000000000000000000000000000000 --- a/src/vs/platform/backup/common/backupIpc.ts +++ /dev/null @@ -1,38 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -'use strict'; - -import { TPromise } from 'vs/base/common/winjs.base'; -import { IChannel } from 'vs/base/parts/ipc/common/ipc'; -import { IBackupService } from './backup'; - -export interface IBackupChannel extends IChannel { - call(command: 'getBackupPath', arg: [number]): TPromise; - call(command: string, arg?: any): TPromise; -} - -export class BackupChannel implements IBackupChannel { - - constructor(private service: IBackupService) { } - - call(command: string, arg?: any): TPromise { - switch (command) { - case 'getBackupPath': return this.service.getBackupPath(arg); - } - return undefined; - } -} - -export class BackupChannelClient implements IBackupService { - - _serviceBrand: any; - - constructor(private channel: IBackupChannel) { } - - getBackupPath(windowId: number): TPromise { - return this.channel.call('getBackupPath', windowId); - } -} \ No newline at end of file diff --git a/src/vs/platform/backup/electron-main/backupMainService.ts b/src/vs/platform/backup/electron-main/backupMainService.ts index a5c984ca5ed8a245eb63853ae0bdf4526163b6de..59f9d014a8c69a34bc2a175956211f30a1d23451 100644 --- a/src/vs/platform/backup/electron-main/backupMainService.ts +++ b/src/vs/platform/backup/electron-main/backupMainService.ts @@ -13,7 +13,6 @@ import { IBackupWorkspacesFormat, IBackupMainService } from 'vs/platform/backup/ import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IFilesConfiguration, HotExitConfiguration } from 'vs/platform/files/common/files'; -import { TPromise } from 'vs/base/common/winjs.base'; export class BackupMainService implements IBackupMainService { @@ -23,7 +22,6 @@ export class BackupMainService implements IBackupMainService { protected workspacesJsonPath: string; private backups: IBackupWorkspacesFormat; - private mapWindowToBackupFolder: { [windowId: number]: string; }; constructor( @IEnvironmentService environmentService: IEnvironmentService, @@ -31,7 +29,6 @@ export class BackupMainService implements IBackupMainService { ) { this.backupHome = environmentService.backupHome; this.workspacesJsonPath = environmentService.backupWorkspacesPath; - this.mapWindowToBackupFolder = Object.create(null); this.loadSync(); } @@ -50,22 +47,16 @@ export class BackupMainService implements IBackupMainService { return this.backups.emptyWorkspaces.slice(0); // return a copy } - public getBackupPath(windowId: number): TPromise { - if (!this.mapWindowToBackupFolder[windowId]) { - throw new Error(`Unknown backup workspace for window ${windowId}`); - } - - return TPromise.as(path.join(this.backupHome, this.mapWindowToBackupFolder[windowId])); - } + public registerWindowForBackupsSync(windowId: number, isEmptyWorkspace: boolean, backupFolder?: string, workspacePath?: string): string { - public registerWindowForBackupsSync(windowId: number, isEmptyWorkspace: boolean, backupFolder?: string, workspacePath?: string): void { // Generate a new folder if this is a new empty workspace if (isEmptyWorkspace && !backupFolder) { backupFolder = this.getRandomEmptyWorkspaceId(); } - this.mapWindowToBackupFolder[windowId] = isEmptyWorkspace ? backupFolder : this.getWorkspaceHash(workspacePath); this.pushBackupPathsSync(isEmptyWorkspace ? backupFolder : workspacePath, isEmptyWorkspace); + + return path.join(this.backupHome, isEmptyWorkspace ? backupFolder : this.getWorkspaceHash(workspacePath)); } private pushBackupPathsSync(workspaceIdentifier: string, isEmptyWorkspace: boolean): string { diff --git a/src/vs/platform/backup/test/electron-main/backupMainService.test.ts b/src/vs/platform/backup/test/electron-main/backupMainService.test.ts index 179a648ba0b0b1f897ac3da50ad3e039b3f7a93d..9519702d03e8150855f64b0a4e56d4474fe43e8b 100644 --- a/src/vs/platform/backup/test/electron-main/backupMainService.test.ts +++ b/src/vs/platform/backup/test/electron-main/backupMainService.test.ts @@ -336,33 +336,6 @@ suite('BackupMainService', () => { }); }); - suite('getBackupPath', () => { - test('should return the window\'s correct path', done => { - service.registerWindowForBackupsSync(1, false, null, fooFile.fsPath); - service.registerWindowForBackupsSync(2, true, 'test'); - service.getBackupPath(1).then(window1Path => { - assert.equal(window1Path, service.toBackupPath(fooFile.fsPath)); - service.getBackupPath(2).then(window2Path => { - assert.equal(window2Path, path.join(backupHome, 'test')); - done(); - }); - }); - }); - - test('should override stale window paths with new paths', done => { - service.registerWindowForBackupsSync(1, false, null, fooFile.fsPath); - service.registerWindowForBackupsSync(1, false, null, barFile.fsPath); - service.getBackupPath(1).then(windowPath => { - assert.equal(windowPath, service.toBackupPath(barFile.fsPath)); - done(); - }); - }); - - test('should throw when the window is not registered', () => { - assert.throws(() => service.getBackupPath(1)); - }); - }); - suite('mixed path casing', () => { test('should handle case insensitive paths properly (registerWindowForBackupsSync)', done => { service.registerWindowForBackupsSync(1, false, null, fooFile.fsPath); diff --git a/src/vs/platform/configuration/common/configuration.ts b/src/vs/platform/configuration/common/configuration.ts index 7292988c11b187d448726c5330c9ddb67f8a801a..cad803b6fca0dc7752f50e025a82fec6b0224ca7 100644 --- a/src/vs/platform/configuration/common/configuration.ts +++ b/src/vs/platform/configuration/common/configuration.ts @@ -4,31 +4,40 @@ *--------------------------------------------------------------------------------------------*/ import { TPromise } from 'vs/base/common/winjs.base'; +import * as arrays from 'vs/base/common/arrays'; +import * as types from 'vs/base/common/types'; +import * as objects from 'vs/base/common/objects'; +import URI from 'vs/base/common/uri'; +import { StrictResourceMap } from 'vs/base/common/map'; +import { Workspace } from 'vs/platform/workspace/common/workspace'; import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; import Event from 'vs/base/common/event'; export const IConfigurationService = createDecorator('configurationService'); -export interface IConfigurationOptions { +export interface IConfigurationOverrides { overrideIdentifier?: string; - section?: string; + resource?: URI; } +export type IConfigurationValues = { [key: string]: IConfigurationValue }; + export interface IConfigurationService { _serviceBrand: any; + getConfigurationData(): IConfigurationData; + /** * Fetches the appropriate section of the configuration JSON file. * This will be an object keyed off the section name. */ - getConfiguration(section?: string): T; - getConfiguration(options?: IConfigurationOptions): T; + getConfiguration(section?: string, overrides?: IConfigurationOverrides): T; /** * Resolves a configuration key to its values in the different scopes * the setting is defined. */ - lookup(key: string, overrideIdentifier?: string): IConfigurationValue; + lookup(key: string, overrides?: IConfigurationOverrides): IConfigurationValue; /** * Returns the defined keys of configurations in the different scopes @@ -46,6 +55,11 @@ export interface IConfigurationService { * Event that fires when the configuration changes. */ onDidUpdateConfiguration: Event; + + /** + * Returns the defined values of configurations in the different scopes. + */ + values(): IConfigurationValues; } export enum ConfigurationSource { @@ -55,10 +69,6 @@ export enum ConfigurationSource { } export interface IConfigurationServiceEvent { - /** - * The full configuration. - */ - config: any; /** * The type of source that triggered this event. */ @@ -73,11 +83,14 @@ export interface IConfigurationValue { value: T; default: T; user: T; + workspace: T; + folder: T; } export interface IConfigurationKeys { default: string[]; user: string[]; + workspace: string[]; } /** @@ -101,18 +114,257 @@ export function getConfigurationValue(config: any, settingPath: string, defau return typeof result === 'undefined' ? defaultValue : result; } -export interface IConfigModel { +export function merge(base: any, add: any, overwrite: boolean): void { + Object.keys(add).forEach(key => { + if (key in base) { + if (types.isObject(base[key]) && types.isObject(add[key])) { + merge(base[key], add[key], overwrite); + } else if (overwrite) { + base[key] = add[key]; + } + } else { + base[key] = add[key]; + } + }); +} + +export interface IConfiguraionModel { contents: T; - overrides: IOverrides[]; keys: string[]; - errors: any[]; - - merge(other: IConfigModel, overwrite?: boolean): IConfigModel; - getContentsFor(section: string): V; - configWithOverrides(identifier: string, section?: string): IConfigModel; + overrides: IOverrides[]; } export interface IOverrides { contents: T; identifiers: string[]; } + +export class ConfigurationModel implements IConfiguraionModel { + + constructor(protected _contents: T = {}, protected _keys: string[] = [], protected _overrides: IOverrides[] = []) { + } + + public get contents(): T { + return this._contents; + } + + public get overrides(): IOverrides[] { + return this._overrides; + } + + public get keys(): string[] { + return this._keys; + } + + public getContentsFor(section: string): V { + return objects.clone(this.contents[section]); + } + + public override(identifier: string): ConfigurationModel { + const result = new ConfigurationModel(); + const contents = objects.clone(this.contents); + if (this._overrides) { + for (const override of this._overrides) { + if (override.identifiers.indexOf(identifier) !== -1) { + merge(contents, override.contents, true); + } + } + } + result._contents = contents; + return result; + } + + public merge(other: ConfigurationModel, overwrite: boolean = true): ConfigurationModel { + const mergedModel = new ConfigurationModel(); + this.doMerge(mergedModel, this, overwrite); + this.doMerge(mergedModel, other, overwrite); + return mergedModel; + } + + protected doMerge(source: ConfigurationModel, target: ConfigurationModel, overwrite: boolean = true) { + merge(source.contents, objects.clone(target.contents), overwrite); + const overrides = objects.clone(source._overrides); + for (const override of target._overrides) { + const [sourceOverride] = overrides.filter(o => arrays.equals(o.identifiers, override.identifiers)); + if (sourceOverride) { + merge(sourceOverride.contents, override.contents, overwrite); + } else { + overrides.push(override); + } + } + source._overrides = overrides; + } +} + +export interface IConfigurationData { + defaults: IConfiguraionModel; + user: IConfiguraionModel; + folders: { [folder: string]: IConfiguraionModel }; +} + +export class Configuration { + + private _globalConfiguration: ConfigurationModel; + private _workspaceConfiguration: ConfigurationModel; + protected _foldersConsolidatedConfigurations: StrictResourceMap>; + + constructor(protected _defaults: ConfigurationModel, protected _user: ConfigurationModel, protected folders: StrictResourceMap> = new StrictResourceMap>(), protected _workspace?: Workspace) { + this.merge(); + } + + get defaults(): ConfigurationModel { + return this._defaults; + } + + get user(): ConfigurationModel { + return this._user; + } + + protected merge(): void { + this._globalConfiguration = this._workspaceConfiguration = new ConfigurationModel().merge(this._defaults).merge(this._user); + this._foldersConsolidatedConfigurations = new StrictResourceMap>(); + for (const folder of this.folders.keys()) { + this.mergeFolder(folder); + } + } + + protected mergeFolder(folder: URI) { + if (this.workspaceUri && this.workspaceUri.fsPath === folder.fsPath) { + this._workspaceConfiguration = new ConfigurationModel().merge(this._globalConfiguration).merge(this.folders.get(this.workspaceUri)); + this._foldersConsolidatedConfigurations.set(folder, this._workspaceConfiguration); + } else { + this._foldersConsolidatedConfigurations.set(folder, new ConfigurationModel().merge(this._workspaceConfiguration).merge(this.folders.get(folder))); + } + } + + getValue(section: string = '', overrides: IConfigurationOverrides = {}): C { + const configModel = this.getConsolidateConfigurationModel(overrides); + return section ? configModel.getContentsFor(section) : configModel.contents; + } + + lookup(key: string, overrides: IConfigurationOverrides = {}): IConfigurationValue { + // make sure to clone the configuration so that the receiver does not tamper with the values + const consolidateConfigurationModel = this.getConsolidateConfigurationModel(overrides); + const workspaceConfigurationModel = this.getConfigurationModelForResource(this.workspaceUri); + const folderConfigurationModel = this.getConfigurationModelForResource(overrides.resource); + return { + default: objects.clone(getConfigurationValue(overrides.overrideIdentifier ? this._defaults.override(overrides.overrideIdentifier).contents : this._defaults.contents, key)), + user: objects.clone(getConfigurationValue(overrides.overrideIdentifier ? this._user.override(overrides.overrideIdentifier).contents : this._user.contents, key)), + workspace: objects.clone(workspaceConfigurationModel ? getConfigurationValue(overrides.overrideIdentifier ? workspaceConfigurationModel.override(overrides.overrideIdentifier).contents : workspaceConfigurationModel.contents, key) : void 0), + folder: objects.clone(folderConfigurationModel ? getConfigurationValue(overrides.overrideIdentifier ? folderConfigurationModel.override(overrides.overrideIdentifier).contents : folderConfigurationModel.contents, key) : void 0), + value: objects.clone(getConfigurationValue(consolidateConfigurationModel.contents, key)) + }; + } + + keys(): IConfigurationKeys { + return { + default: this._defaults.keys, + user: this._user.keys, + workspace: this.workspaceUri ? this.folders.get(this.workspaceUri).keys : [] + }; + } + + values(): IConfigurationValues { + const result = Object.create(null); + const keyset = this.keys(); + const keys = [...keyset.workspace, ...keyset.user, ...keyset.default].sort(); + + let lastKey: string; + for (const key of keys) { + if (key !== lastKey) { + lastKey = key; + result[key] = this.lookup(key); + } + } + + return result; + } + + values2(): Map> { + const result: Map> = new Map>(); + const keyset = this.keys(); + const keys = [...keyset.workspace, ...keyset.user, ...keyset.default].sort(); + + let lastKey: string; + for (const key of keys) { + if (key !== lastKey) { + lastKey = key; + result.set(key, this.lookup(key)); + } + } + + return result; + } + + protected get workspaceUri(): URI { + return this._workspace ? this._workspace.roots[0] : null; + } + + private getConsolidateConfigurationModel(overrides: IConfigurationOverrides): ConfigurationModel { + let configurationModel = this.getConsolidatedConfigurationModelForResource(overrides); + return overrides.overrideIdentifier ? configurationModel.override(overrides.overrideIdentifier) : configurationModel; + } + + private getConsolidatedConfigurationModelForResource({ resource }: IConfigurationOverrides): ConfigurationModel { + if (!this._workspace) { + return this._globalConfiguration; + } + + if (!resource) { + return this._workspaceConfiguration; + } + + const root = this._workspace.getRoot(resource); + if (!root) { + return this._workspaceConfiguration; + } + + return this._foldersConsolidatedConfigurations.get(root) || this._workspaceConfiguration; + } + + private getConfigurationModelForResource(resource: URI): ConfigurationModel { + if (!this._workspace) { + return null; + } + + if (!resource) { + return this.folders.get(this.workspaceUri); + } + + return this.folders.get(this._workspace.getRoot(resource) || this.workspaceUri); + } + + public toData(): IConfigurationData { + return { + defaults: { + contents: this._defaults.contents, + overrides: this._defaults.overrides, + keys: this._defaults.keys + }, + user: { + contents: this._user.contents, + overrides: this._user.overrides, + keys: this._user.keys + }, + folders: this.folders.keys().reduce((result, folder) => { + const { contents, overrides, keys } = this.folders.get(folder); + result[folder.toString()] = { contents, overrides, keys }; + return result; + }, Object.create({})) + }; + } + + public static parse(data: IConfigurationData, workspace: Workspace): Configuration { + const defaults = Configuration.parseConfigurationModel(data.defaults); + const user = Configuration.parseConfigurationModel(data.user); + const folders: StrictResourceMap> = Object.keys(data.folders).reduce((result, key) => { + result.set(URI.parse(key), Configuration.parseConfigurationModel(data.folders[key])); + return result; + }, new StrictResourceMap>()); + return new Configuration(defaults, user, folders, workspace); + } + + private static parseConfigurationModel(model: IConfiguraionModel): ConfigurationModel { + return new ConfigurationModel(model.contents, model.keys, model.overrides); + } +} \ No newline at end of file diff --git a/src/vs/platform/configuration/common/configurationRegistry.ts b/src/vs/platform/configuration/common/configurationRegistry.ts index a1f538bc6d43eb374d16f869d04189c0c2cc95ba..048c83f880f7ca5cf53af6249e6764fce7268bdf 100644 --- a/src/vs/platform/configuration/common/configurationRegistry.ts +++ b/src/vs/platform/configuration/common/configurationRegistry.ts @@ -7,11 +7,9 @@ import nls = require('vs/nls'); import Event, { Emitter } from 'vs/base/common/event'; import { IJSONSchema } from 'vs/base/common/jsonSchema'; -import { Registry } from 'vs/platform/platform'; -import objects = require('vs/base/common/objects'); +import { Registry } from 'vs/platform/registry/common/platform'; import types = require('vs/base/common/types'); import * as strings from 'vs/base/common/strings'; -import { ExtensionsRegistry, ExtensionMessageCollector } from 'vs/platform/extensions/common/extensionsRegistry'; import { IJSONContributionRegistry, Extensions as JSONExtensions } from 'vs/platform/jsonschemas/common/jsonContributionRegistry'; export const Extensions = { @@ -28,7 +26,9 @@ export interface IConfigurationRegistry { /** * Register multiple configurations to the registry. */ - registerConfigurations(configurations: IConfigurationNode[]): void; + registerConfigurations(configurations: IConfigurationNode[], validate?: boolean): void; + + registerDefaultConfigurations(defaultConfigurations: IDefaultConfigurationExtension[]): void; /** * Event that fires whenver a configuratio has been @@ -75,7 +75,7 @@ export interface IDefaultConfigurationExtension { } const schemaId = 'vscode://schemas/settings'; -const editorConfigurationSchemaId = 'vscode://schemas/settings/editor'; +export const editorConfigurationSchemaId = 'vscode://schemas/settings/editor'; const contributionRegistry = Registry.as(JSONExtensions.JSONContribution); class ConfigurationRegistry implements IConfigurationRegistry { @@ -281,36 +281,7 @@ function getDefaultValue(type: string | string[]): any { const configurationRegistry = new ConfigurationRegistry(); Registry.add(Extensions.Configuration, configurationRegistry); -const configurationExtPoint = ExtensionsRegistry.registerExtensionPoint('configuration', [], { - description: nls.localize('vscode.extension.contributes.configuration', 'Contributes configuration settings.'), - type: 'object', - defaultSnippets: [{ body: { title: '', properties: {} } }], - properties: { - title: { - description: nls.localize('vscode.extension.contributes.configuration.title', 'A summary of the settings. This label will be used in the settings file as separating comment.'), - type: 'string' - }, - properties: { - description: nls.localize('vscode.extension.contributes.configuration.properties', 'Description of the configuration properties.'), - type: 'object', - additionalProperties: { - anyOf: [ - { $ref: 'http://json-schema.org/draft-04/schema#' }, - { - type: 'object', - properties: { - isExecutable: { - type: 'boolean' - } - } - } - ] - } - } - } -}); - -function validateProperty(property: string): string { +export function validateProperty(property: string): string { if (OVERRIDE_PROPERTY_PATTERN.test(property)) { return nls.localize('config.property.languageDefault', "Cannot register '{0}'. This matches property pattern '\\\\[.*\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.", property); } @@ -319,78 +290,3 @@ function validateProperty(property: string): string { } return null; } - -function validateProperties(configuration: IConfigurationNode, collector: ExtensionMessageCollector): void { - let properties = configuration.properties; - if (properties) { - if (typeof properties !== 'object') { - collector.error(nls.localize('invalid.properties', "'configuration.properties' must be an object")); - configuration.properties = {}; - } - for (let key in properties) { - const message = validateProperty(key); - if (message) { - collector.warn(message); - delete properties[key]; - } - } - } - let subNodes = configuration.allOf; - if (subNodes) { - for (let node of subNodes) { - validateProperties(node, collector); - } - } -} - -configurationExtPoint.setHandler(extensions => { - const configurations: IConfigurationNode[] = []; - - - for (let i = 0; i < extensions.length; i++) { - const configuration = objects.clone(extensions[i].value); - const collector = extensions[i].collector; - - if (configuration.type && configuration.type !== 'object') { - collector.warn(nls.localize('invalid.type', "if set, 'configuration.type' must be set to 'object")); - } else { - configuration.type = 'object'; - } - - if (configuration.title && (typeof configuration.title !== 'string')) { - collector.error(nls.localize('invalid.title', "'configuration.title' must be a string")); - } - - validateProperties(configuration, collector); - - configuration.id = extensions[i].description.id; - configurations.push(configuration); - } - - configurationRegistry.registerConfigurations(configurations, false); -}); - -const defaultConfigurationExtPoint = ExtensionsRegistry.registerExtensionPoint('configurationDefaults', [], { - description: nls.localize('vscode.extension.contributes.defaultConfiguration', 'Contributes default editor configuration settings by language.'), - type: 'object', - defaultSnippets: [{ body: {} }], - patternProperties: { - '\\[.*\\]$': { - type: 'object', - default: {}, - $ref: editorConfigurationSchemaId, - } - } -}); - -defaultConfigurationExtPoint.setHandler(extensions => { - const defaultConfigurations: IDefaultConfigurationExtension[] = extensions.map(extension => { - const id = extension.description.id; - const name = extension.description.name; - const defaults = objects.clone(extension.value); - return { - id, name, defaults - }; - }); - configurationRegistry.registerDefaultConfigurations(defaultConfigurations); -}); \ No newline at end of file diff --git a/src/vs/platform/configuration/common/model.ts b/src/vs/platform/configuration/common/model.ts index cfbc368d83acd5e5467a92760e554716c666960f..55e875c58679648402e349b17fe172e7a88b476c 100644 --- a/src/vs/platform/configuration/common/model.ts +++ b/src/vs/platform/configuration/common/model.ts @@ -4,13 +4,10 @@ *--------------------------------------------------------------------------------------------*/ 'use strict'; -import { Registry } from 'vs/platform/platform'; -import * as types from 'vs/base/common/types'; +import { Registry } from 'vs/platform/registry/common/platform'; import * as json from 'vs/base/common/json'; -import * as objects from 'vs/base/common/objects'; -import * as arrays from 'vs/base/common/arrays'; import { IConfigurationRegistry, Extensions, OVERRIDE_PROPERTY_PATTERN } from 'vs/platform/configuration/common/configurationRegistry'; -import { IConfigModel, IOverrides } from 'vs/platform/configuration/common/configuration'; +import { ConfigurationModel, IOverrides } from 'vs/platform/configuration/common/configuration'; export function getDefaultValues(): any { const valueTreeRoot: any = Object.create(null); @@ -68,92 +65,45 @@ export function getConfigurationKeys(): string[] { return Object.keys(properties); } -export function merge(base: any, add: any, overwrite: boolean): void { - Object.keys(add).forEach(key => { - if (key in base) { - if (types.isObject(base[key]) && types.isObject(add[key])) { - merge(base[key], add[key], overwrite); - } else if (overwrite) { - base[key] = add[key]; - } - } else { - base[key] = add[key]; - } - }); +export class DefaultConfigurationModel extends ConfigurationModel { + + constructor() { + super(getDefaultValues()); + this._keys = getConfigurationKeys(); + this._overrides = Object.keys(this._contents) + .filter(key => OVERRIDE_PROPERTY_PATTERN.test(key)) + .map(key => { + return >{ + identifiers: [overrideIdentifierFromKey(key).trim()], + contents: toValuesTree(this._contents[key], message => console.error(`Conflict in default settings file: ${message}`)) + }; + }); + } + + public get keys(): string[] { + return this._keys; + } } interface Overrides extends IOverrides { raw: any; } -export class ConfigModel implements IConfigModel { +export class CustomConfigurationModel extends ConfigurationModel { - protected _contents: T = {}; - protected _overrides: IOverrides[] = []; - protected _keys: string[] = []; protected _parseErrors: any[] = []; constructor(content: string = '', private name: string = '') { + super(); if (content) { this.update(content); } } - public get contents(): T { - return this._contents; - } - - public get overrides(): IOverrides[] { - return this._overrides; - } - - public get keys(): string[] { - return this._keys; - } - public get errors(): any[] { return this._parseErrors; } - public merge(other: IConfigModel, overwrite: boolean = true): ConfigModel { - const mergedModel = new ConfigModel(null); - this.doMerge(mergedModel, this, overwrite); - this.doMerge(mergedModel, other, overwrite); - return mergedModel; - } - - protected doMerge(source: ConfigModel, target: IConfigModel, overwrite: boolean = true) { - merge(source.contents, objects.clone(target.contents), overwrite); - const overrides = objects.clone(source.overrides); - for (const override of target.overrides) { - const [sourceOverride] = overrides.filter(o => arrays.equals(o.identifiers, override.identifiers)); - if (sourceOverride) { - merge(sourceOverride.contents, override.contents, overwrite); - } else { - overrides.push(override); - } - } - source._overrides = overrides; - } - - public getContentsFor(section: string): V { - return objects.clone(this.contents[section]); - } - - public configWithOverrides(identifier: string): ConfigModel { - const result = new ConfigModel(null); - const contents = objects.clone(this.contents); - if (this.overrides) { - for (const override of this.overrides) { - if (override.identifiers.indexOf(identifier) !== -1) { - merge(contents, override.contents, true); - } - } - } - result._contents = contents; - return result; - } - public update(content: string): void { let parsed: T = {}; let overrides: Overrides[] = []; @@ -243,31 +193,6 @@ export class ConfigModel implements IConfigModel { } } -export class DefaultConfigModel extends ConfigModel { - - constructor() { - super(null); - this.update(); - } - - public get keys(): string[] { - return this._keys; - } - - public update(): void { - this._contents = getDefaultValues(); // defaults coming from contributions to registries - this._keys = getConfigurationKeys(); - this._overrides = Object.keys(this._contents) - .filter(key => OVERRIDE_PROPERTY_PATTERN.test(key)) - .map(key => { - return >{ - identifiers: [overrideIdentifierFromKey(key).trim()], - contents: toValuesTree(this._contents[key], message => console.error(`Conflict in default settings file: ${message}`)) - }; - }); - } -} - export function overrideIdentifierFromKey(key: string): string { return key.substring(1, key.length - 1); } diff --git a/src/vs/platform/configuration/node/configurationService.ts b/src/vs/platform/configuration/node/configurationService.ts index ea7164b96a1480b59a0388571da3c3a189f12ca2..2a44744742cefa789488e1e2b5ecbf9f7e8c120d 100644 --- a/src/vs/platform/configuration/node/configurationService.ts +++ b/src/vs/platform/configuration/node/configurationService.ts @@ -5,28 +5,21 @@ 'use strict'; import { TPromise } from 'vs/base/common/winjs.base'; -import * as objects from 'vs/base/common/objects'; import { ConfigWatcher } from 'vs/base/node/config'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { IConfigurationRegistry, Extensions } from 'vs/platform/configuration/common/configurationRegistry'; import { IDisposable, toDisposable, Disposable } from 'vs/base/common/lifecycle'; -import { ConfigurationSource, IConfigurationService, IConfigurationServiceEvent, IConfigurationValue, getConfigurationValue, IConfigurationKeys, IConfigModel, IConfigurationOptions } from 'vs/platform/configuration/common/configuration'; -import { ConfigModel, DefaultConfigModel } from 'vs/platform/configuration/common/model'; +import { ConfigurationSource, IConfigurationService, IConfigurationServiceEvent, IConfigurationValue, IConfigurationKeys, ConfigurationModel, IConfigurationOverrides, Configuration, IConfigurationValues, IConfigurationData } from 'vs/platform/configuration/common/configuration'; +import { CustomConfigurationModel, DefaultConfigurationModel } from 'vs/platform/configuration/common/model'; import Event, { Emitter } from 'vs/base/common/event'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -export interface ICache { - defaults: IConfigModel; - user: IConfigModel; - consolidated: IConfigModel; -} - export class ConfigurationService extends Disposable implements IConfigurationService, IDisposable { _serviceBrand: any; - private cache: ICache; - private userConfigModelWatcher: ConfigWatcher>; + private _configuration: Configuration; + private userConfigModelWatcher: ConfigWatcher>; private _onDidUpdateConfiguration: Emitter = this._register(new Emitter()); public readonly onDidUpdateConfiguration: Event = this._onDidUpdateConfiguration.event; @@ -37,8 +30,8 @@ export class ConfigurationService extends Disposable implements IConfiguratio super(); this.userConfigModelWatcher = new ConfigWatcher(environmentService.appSettingsPath, { - changeBufferDelay: 300, defaultConfig: new ConfigModel(null, environmentService.appSettingsPath), parse: (content: string, parseErrors: any[]) => { - const userConfigModel = new ConfigModel(content, environmentService.appSettingsPath); + changeBufferDelay: 300, defaultConfig: new CustomConfigurationModel(null, environmentService.appSettingsPath), parse: (content: string, parseErrors: any[]) => { + const userConfigModel = new CustomConfigurationModel(content, environmentService.appSettingsPath); parseErrors = [...userConfigModel.errors]; return userConfigModel; } @@ -50,13 +43,16 @@ export class ConfigurationService extends Disposable implements IConfiguratio this._register(Registry.as(Extensions.Configuration).onDidRegisterConfiguration(() => this.onConfigurationChange(ConfigurationSource.Default))); } + public configuration(): Configuration { + return this._configuration || (this._configuration = this.consolidateConfigurations()); + } + private onConfigurationChange(source: ConfigurationSource): void { - this.cache = void 0; // reset our caches + this.reset(); // reset our caches - const cache = this.getCache(); + const cache = this.configuration(); this._onDidUpdateConfiguration.fire({ - config: this.getConfiguration(), source, sourceConfig: source === ConfigurationSource.Default ? cache.defaults.contents : cache.user.contents }); @@ -65,60 +61,39 @@ export class ConfigurationService extends Disposable implements IConfiguratio public reloadConfiguration(section?: string): TPromise { return new TPromise(c => { this.userConfigModelWatcher.reload(() => { - this.cache = void 0; // reset our caches - + this.reset(); // reset our caches c(this.getConfiguration(section)); }); }); } - public getConfiguration(section?: string): C - public getConfiguration(options?: IConfigurationOptions): C - public getConfiguration(arg?: any): C { - const options = this.toOptions(arg); - const cache = this.getCache(); - const configModel = options.overrideIdentifier ? cache.consolidated.configWithOverrides(options.overrideIdentifier) : cache.consolidated; - return options.section ? configModel.getContentsFor(options.section) : configModel.contents; + public getConfiguration(section?: string, options?: IConfigurationOverrides): C { + return this.configuration().getValue(section, options); } - public lookup(key: string, overrideIdentifier?: string): IConfigurationValue { - const cache = this.getCache(); - - // make sure to clone the configuration so that the receiver does not tamper with the values - return { - default: objects.clone(getConfigurationValue(overrideIdentifier ? cache.defaults.configWithOverrides(overrideIdentifier).contents : cache.defaults.contents, key)), - user: objects.clone(getConfigurationValue(overrideIdentifier ? cache.user.configWithOverrides(overrideIdentifier).contents : cache.user.contents, key)), - value: objects.clone(getConfigurationValue(overrideIdentifier ? cache.consolidated.configWithOverrides(overrideIdentifier).contents : cache.consolidated.contents, key)) - }; + public lookup(key: string, options?: IConfigurationOverrides): IConfigurationValue { + return this.configuration().lookup(key, options); } public keys(): IConfigurationKeys { - const cache = this.getCache(); + return this.configuration().keys(); + } - return { - default: cache.defaults.keys, - user: cache.user.keys - }; + public values(): IConfigurationValues { + return this._configuration.values(); } - public getCache(): ICache { - return this.cache || (this.cache = this.consolidateConfigurations()); + public getConfigurationData(): IConfigurationData { + return this.configuration().toData(); } - private toOptions(arg: any): IConfigurationOptions { - if (typeof arg === 'string') { - return { section: arg }; - } - if (typeof arg === 'object') { - return arg; - } - return {}; + private reset(): void { + this._configuration = this.consolidateConfigurations(); } - private consolidateConfigurations(): ICache { - const defaults = new DefaultConfigModel(); + private consolidateConfigurations(): Configuration { + const defaults = new DefaultConfigurationModel(); const user = this.userConfigModelWatcher.getConfig(); - const consolidated = defaults.merge(user); - return { defaults, user, consolidated }; + return new Configuration(defaults, user); } } \ No newline at end of file diff --git a/src/vs/platform/configuration/test/common/configuration.test.ts b/src/vs/platform/configuration/test/common/configuration.test.ts new file mode 100644 index 0000000000000000000000000000000000000000..dfdb42ffd4b2a9d32185c1d4ab4d0e88ca45a30e --- /dev/null +++ b/src/vs/platform/configuration/test/common/configuration.test.ts @@ -0,0 +1,79 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +'use strict'; + +import * as assert from 'assert'; +import { ConfigurationModel, merge } from 'vs/platform/configuration/common/configuration'; +import { Extensions, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry'; +import { Registry } from 'vs/platform/registry/common/platform'; + +suite('Configuration', () => { + + suiteSetup(() => { + Registry.as(Extensions.Configuration).registerConfiguration({ + 'id': 'a', + 'order': 1, + 'title': 'a', + 'type': 'object', + 'properties': { + 'a': { + 'description': 'a', + 'type': 'boolean', + 'default': true, + 'overridable': true + } + } + }); + }); + + test('simple merge', () => { + let base = { 'a': 1, 'b': 2 }; + merge(base, { 'a': 3, 'c': 4 }, true); + assert.deepEqual(base, { 'a': 3, 'b': 2, 'c': 4 }); + base = { 'a': 1, 'b': 2 }; + merge(base, { 'a': 3, 'c': 4 }, false); + assert.deepEqual(base, { 'a': 1, 'b': 2, 'c': 4 }); + }); + + test('Recursive merge', () => { + const base = { 'a': { 'b': 1 } }; + merge(base, { 'a': { 'b': 2 } }, true); + assert.deepEqual(base, { 'a': { 'b': 2 } }); + }); + + test('simple merge using configuration', () => { + let base = new ConfigurationModel({ 'a': 1, 'b': 2 }); + let add = new ConfigurationModel({ 'a': 3, 'c': 4 }); + let result = base.merge(add); + assert.deepEqual(result.contents, { 'a': 3, 'b': 2, 'c': 4 }); + }); + + test('Recursive merge using config models', () => { + let base = new ConfigurationModel({ 'a': { 'b': 1 } }); + let add = new ConfigurationModel({ 'a': { 'b': 2 } }); + let result = base.merge(add); + assert.deepEqual(result.contents, { 'a': { 'b': 2 } }); + }); + + test('Test contents while getting an existing property', () => { + let testObject = new ConfigurationModel({ 'a': 1 }); + assert.deepEqual(testObject.getContentsFor('a'), 1); + + testObject = new ConfigurationModel({ 'a': { 'b': 1 } }); + assert.deepEqual(testObject.getContentsFor('a'), { 'b': 1 }); + }); + + test('Test contents are undefined for non existing properties', () => { + const testObject = new ConfigurationModel({ awesome: true }); + + assert.deepEqual(testObject.getContentsFor('unknownproperty'), undefined); + }); + + test('Test override gives all content merged with overrides', () => { + const testObject = new ConfigurationModel({ 'a': 1, 'c': 1 }, [], [{ identifiers: ['b'], contents: { 'a': 2 } }]); + + assert.deepEqual(testObject.override('b').contents, { 'a': 2, 'c': 1 }); + }); +}); \ No newline at end of file diff --git a/src/vs/platform/configuration/test/common/model.test.ts b/src/vs/platform/configuration/test/common/model.test.ts index db7edc4c0d751f71b4161ed4f5e5a372f955a43d..aa9597b670246fe0814a29a664355a99c46df042 100644 --- a/src/vs/platform/configuration/test/common/model.test.ts +++ b/src/vs/platform/configuration/test/common/model.test.ts @@ -5,11 +5,11 @@ 'use strict'; import * as assert from 'assert'; -import * as model from 'vs/platform/configuration/common/model'; +import { CustomConfigurationModel, DefaultConfigurationModel } from 'vs/platform/configuration/common/model'; import { Extensions, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; -suite('ConfigurationService - Model', () => { +suite('Configuration', () => { suiteSetup(() => { Registry.as(Extensions.Configuration).registerConfiguration({ @@ -28,62 +28,47 @@ suite('ConfigurationService - Model', () => { }); }); - test('simple merge', () => { - let base = { 'a': 1, 'b': 2 }; - model.merge(base, { 'a': 3, 'c': 4 }, true); - assert.deepEqual(base, { 'a': 3, 'b': 2, 'c': 4 }); - base = { 'a': 1, 'b': 2 }; - model.merge(base, { 'a': 3, 'c': 4 }, false); - assert.deepEqual(base, { 'a': 1, 'b': 2, 'c': 4 }); - }); - - test('Recursive merge', () => { - const base = { 'a': { 'b': 1 } }; - model.merge(base, { 'a': { 'b': 2 } }, true); - assert.deepEqual(base, { 'a': { 'b': 2 } }); - }); - test('simple merge using models', () => { - let base = new model.ConfigModel(JSON.stringify({ 'a': 1, 'b': 2 })); - let add = new model.ConfigModel(JSON.stringify({ 'a': 3, 'c': 4 })); + let base = new CustomConfigurationModel(JSON.stringify({ 'a': 1, 'b': 2 })); + let add = new CustomConfigurationModel(JSON.stringify({ 'a': 3, 'c': 4 })); let result = base.merge(add); assert.deepEqual(result.contents, { 'a': 3, 'b': 2, 'c': 4 }); }); test('simple merge with an undefined contents', () => { - let base = new model.ConfigModel(JSON.stringify({ 'a': 1, 'b': 2 })); - let add = new model.ConfigModel(null); + let base = new CustomConfigurationModel(JSON.stringify({ 'a': 1, 'b': 2 })); + let add = new CustomConfigurationModel(null); let result = base.merge(add); assert.deepEqual(result.contents, { 'a': 1, 'b': 2 }); - base = new model.ConfigModel(null); - add = new model.ConfigModel(JSON.stringify({ 'a': 1, 'b': 2 })); + base = new CustomConfigurationModel(null); + add = new CustomConfigurationModel(JSON.stringify({ 'a': 1, 'b': 2 })); result = base.merge(add); assert.deepEqual(result.contents, { 'a': 1, 'b': 2 }); - base = new model.ConfigModel(null); - add = new model.ConfigModel(null); + base = new CustomConfigurationModel(null); + add = new CustomConfigurationModel(null); result = base.merge(add); assert.deepEqual(result.contents, {}); }); test('Recursive merge using config models', () => { - let base = new model.ConfigModel(JSON.stringify({ 'a': { 'b': 1 } })); - let add = new model.ConfigModel(JSON.stringify({ 'a': { 'b': 2 } })); + let base = new CustomConfigurationModel(JSON.stringify({ 'a': { 'b': 1 } })); + let add = new CustomConfigurationModel(JSON.stringify({ 'a': { 'b': 2 } })); let result = base.merge(add); assert.deepEqual(result.contents, { 'a': { 'b': 2 } }); }); test('Test contents while getting an existing property', () => { - let testObject = new model.ConfigModel(JSON.stringify({ 'a': 1 })); + let testObject = new CustomConfigurationModel(JSON.stringify({ 'a': 1 })); assert.deepEqual(testObject.getContentsFor('a'), 1); - testObject = new model.ConfigModel(JSON.stringify({ 'a': { 'b': 1 } })); + testObject = new CustomConfigurationModel(JSON.stringify({ 'a': { 'b': 1 } })); assert.deepEqual(testObject.getContentsFor('a'), { 'b': 1 }); }); test('Test contents are undefined for non existing properties', () => { - const testObject = new model.ConfigModel(JSON.stringify({ + const testObject = new CustomConfigurationModel(JSON.stringify({ awesome: true })); @@ -91,25 +76,25 @@ suite('ConfigurationService - Model', () => { }); test('Test contents are undefined for undefined config', () => { - const testObject = new model.ConfigModel(null); + const testObject = new CustomConfigurationModel(null); assert.deepEqual(testObject.getContentsFor('unknownproperty'), undefined); }); test('Test configWithOverrides gives all content merged with overrides', () => { - const testObject = new model.ConfigModel(JSON.stringify({ 'a': 1, 'c': 1, '[b]': { 'a': 2 } })); + const testObject = new CustomConfigurationModel(JSON.stringify({ 'a': 1, 'c': 1, '[b]': { 'a': 2 } })); - assert.deepEqual(testObject.configWithOverrides('b').contents, { 'a': 2, 'c': 1, '[b]': { 'a': 2 } }); + assert.deepEqual(testObject.override('b').contents, { 'a': 2, 'c': 1, '[b]': { 'a': 2 } }); }); test('Test configWithOverrides gives empty contents', () => { - const testObject = new model.ConfigModel(null); + const testObject = new CustomConfigurationModel(null); - assert.deepEqual(testObject.configWithOverrides('b').contents, {}); + assert.deepEqual(testObject.override('b').contents, {}); }); test('Test update with empty data', () => { - const testObject = new model.ConfigModel(); + const testObject = new CustomConfigurationModel(); testObject.update(''); assert.deepEqual(testObject.contents, {}); @@ -140,7 +125,7 @@ suite('ConfigurationService - Model', () => { } } }); - assert.equal(true, new model.DefaultConfigModel().getContentsFor('a')); + assert.equal(true, new DefaultConfigurationModel().getContentsFor('a')); }); test('Test registering the language property', () => { @@ -157,7 +142,7 @@ suite('ConfigurationService - Model', () => { } } }); - assert.equal(undefined, new model.DefaultConfigModel().getContentsFor('[a]')); + assert.equal(undefined, new DefaultConfigurationModel().getContentsFor('[a]')); }); }); \ No newline at end of file diff --git a/src/vs/platform/configuration/test/common/testConfigurationService.ts b/src/vs/platform/configuration/test/common/testConfigurationService.ts index 9af8629a5bb2911fafa1d1bc73941215dcdea735..2f7161f56df0f3bc05368e86310f0d0ecf32c7de 100644 --- a/src/vs/platform/configuration/test/common/testConfigurationService.ts +++ b/src/vs/platform/configuration/test/common/testConfigurationService.ts @@ -8,7 +8,7 @@ import { TPromise } from 'vs/base/common/winjs.base'; import { EventEmitter } from 'vs/base/common/eventEmitter'; import { getConfigurationKeys } from 'vs/platform/configuration/common/model'; -import { IConfigurationService, getConfigurationValue, IConfigurationValue, IConfigurationKeys } from 'vs/platform/configuration/common/configuration'; +import { IConfigurationService, getConfigurationValue, IConfigurationValue, IConfigurationKeys, IConfigurationValues, IConfigurationData, Configuration, ConfigurationModel } from 'vs/platform/configuration/common/configuration'; export class TestConfigurationService extends EventEmitter implements IConfigurationService { public _serviceBrand: any; @@ -23,6 +23,10 @@ export class TestConfigurationService extends EventEmitter implements IConfigura return this.configuration; } + public getConfigurationData(): IConfigurationData { + return new Configuration(new ConfigurationModel(), new ConfigurationModel(this.configuration)).toData(); + } + public setUserConfiguration(key: any, value: any): Thenable { this.configuration[key] = value; return TPromise.as(null); @@ -36,14 +40,21 @@ export class TestConfigurationService extends EventEmitter implements IConfigura return { value: getConfigurationValue(this.getConfiguration(), key), default: getConfigurationValue(this.getConfiguration(), key), - user: getConfigurationValue(this.getConfiguration(), key) + user: getConfigurationValue(this.getConfiguration(), key), + workspace: null, + folder: null }; } public keys(): IConfigurationKeys { return { default: getConfigurationKeys(), - user: Object.keys(this.configuration) + user: Object.keys(this.configuration), + workspace: [] }; } + + public values(): IConfigurationValues { + return {}; + } } diff --git a/src/vs/platform/configuration/test/node/configurationService.test.ts b/src/vs/platform/configuration/test/node/configurationService.test.ts index 8896196e8588df0eb080b4b705b58cde107e6a03..594a6eb52871a2f426630f8cbeba77130da189b2 100644 --- a/src/vs/platform/configuration/test/node/configurationService.test.ts +++ b/src/vs/platform/configuration/test/node/configurationService.test.ts @@ -10,7 +10,7 @@ import os = require('os'); import path = require('path'); import fs = require('fs'); -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { ConfigurationService } from 'vs/platform/configuration/node/configurationService'; import { ParsedArgs } from 'vs/platform/environment/common/environment'; import { parseArgs } from 'vs/platform/environment/node/argv'; diff --git a/src/vs/platform/contextkey/browser/contextKeyService.ts b/src/vs/platform/contextkey/browser/contextKeyService.ts index 45d993851a4d8ea3acbe3d9a7270e6356e00b010..325e8cf9680f41d9448bd1e37ae67449a5eaf736 100644 --- a/src/vs/platform/contextkey/browser/contextKeyService.ts +++ b/src/vs/platform/contextkey/browser/contextKeyService.ts @@ -58,7 +58,7 @@ class ConfigAwareContextValuesContainer extends Context { super(id, null); this._emitter = emitter; - this._subscription = configurationService.onDidUpdateConfiguration(e => this._updateConfigurationContext(e.config)); + this._subscription = configurationService.onDidUpdateConfiguration(e => this._updateConfigurationContext(configurationService.getConfiguration())); this._updateConfigurationContext(configurationService.getConfiguration()); } diff --git a/src/vs/platform/editor/common/editor.ts b/src/vs/platform/editor/common/editor.ts index 81dc32ec8bc88c076c11de64cc62882c1e215231..08c7863ea1726da2a0fa950df50a564045ef40d1 100644 --- a/src/vs/platform/editor/common/editor.ts +++ b/src/vs/platform/editor/common/editor.ts @@ -9,7 +9,6 @@ import { TPromise } from 'vs/base/common/winjs.base'; import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; import Event from 'vs/base/common/event'; import { IDisposable } from 'vs/base/common/lifecycle'; -import { IEditorViewState } from 'vs/editor/common/editorCommon'; export const IEditorService = createDecorator('editorService'); @@ -90,6 +89,11 @@ export interface IUntitledResourceInput extends IBaseResourceInput { * Optional contents of the untitled resource. */ contents?: string; + + /** + * Optional encoding of the untitled resource. + */ + encoding?: string; } export interface IResourceDiffInput extends IBaseResourceInput { @@ -286,7 +290,7 @@ export interface ITextEditorOptions extends IEditorOptions { /** * Text editor view state. */ - viewState?: IEditorViewState; + viewState?: object; /** * Option to scroll vertically or horizontally as necessary and reveal a range centered vertically only if it lies outside the viewport. diff --git a/src/vs/platform/environment/node/environmentService.ts b/src/vs/platform/environment/node/environmentService.ts index 34a82d9d57185a0edb3746bb753b7247611719b8..2a93543b82f03278afb5443cd613da2fd422e713 100644 --- a/src/vs/platform/environment/node/environmentService.ts +++ b/src/vs/platform/environment/node/environmentService.ts @@ -30,6 +30,9 @@ function getUniqueUserId(): string { } function getNixIPCHandle(userDataPath: string, type: string): string { + if (process.env['XDG_RUNTIME_DIR']) { + return path.join(process.env['XDG_RUNTIME_DIR'], `${pkg.name}-${pkg.version}-${type}.sock`); + } return path.join(userDataPath, `${pkg.version}-${type}.sock`); } diff --git a/src/vs/platform/extensionManagement/common/extensionEnablementService.ts b/src/vs/platform/extensionManagement/common/extensionEnablementService.ts index 689c192d03a593b3b8e3b65f4dbc9b5c02cf0fbd..ca319bf47b63a81d01959e1232888a9cd5c33871 100644 --- a/src/vs/platform/extensionManagement/common/extensionEnablementService.ts +++ b/src/vs/platform/extensionManagement/common/extensionEnablementService.ts @@ -10,7 +10,7 @@ import Event, { Emitter } from 'vs/base/common/event'; import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { IExtensionManagementService, DidUninstallExtensionEvent, IExtensionEnablementService } from 'vs/platform/extensionManagement/common/extensionManagement'; import { adoptToGalleryExtensionId, getIdAndVersionFromLocalExtensionId } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; -import { IWorkspaceContextService, IWorkspace } from 'vs/platform/workspace/common/workspace'; +import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; @@ -34,8 +34,8 @@ export class ExtensionEnablementService implements IExtensionEnablementService { extensionManagementService.onDidUninstallExtension(this.onDidUninstallExtension, this, this.disposables); } - private get workspace(): IWorkspace { - return this.contextService.getWorkspace(); + private get hasWorkspace(): boolean { + return this.contextService.hasWorkspace(); } public getGloballyDisabledExtensions(): string[] { @@ -60,7 +60,7 @@ export class ExtensionEnablementService implements IExtensionEnablementService { } public setEnablement(identifier: string, enable: boolean, workspace: boolean = false): TPromise { - if (workspace && !this.workspace) { + if (workspace && !this.hasWorkspace) { return TPromise.wrapError(localize('noWorkspace', "No workspace.")); } @@ -106,7 +106,7 @@ export class ExtensionEnablementService implements IExtensionEnablementService { } private getDisabledExtensions(scope: StorageScope): string[] { - if (scope === StorageScope.WORKSPACE && !this.workspace) { + if (scope === StorageScope.WORKSPACE && !this.hasWorkspace) { return []; } const value = this.storageService.get(DISABLED_EXTENSIONS_STORAGE_PATH, scope, ''); diff --git a/src/vs/platform/extensionManagement/common/extensionManagement.ts b/src/vs/platform/extensionManagement/common/extensionManagement.ts index 8df367a9615f6923a8ec8404acfbd2634faabdfc..e60c845c300bf80de3c705ce25155b3640bee8b4 100644 --- a/src/vs/platform/extensionManagement/common/extensionManagement.ts +++ b/src/vs/platform/extensionManagement/common/extensionManagement.ts @@ -74,10 +74,9 @@ export interface ITheme { label: string; } -export interface ITreeExplorer { +export interface IView { id: string; - label: string; - icon: string; + name: string; } export interface IExtensionContributions { @@ -91,7 +90,7 @@ export interface IExtensionContributions { menus?: { [context: string]: IMenu[] }; snippets?: ISnippet[]; themes?: ITheme[]; - explorer?: ITreeExplorer; + views?: { [location: string]: IView[] }; } export interface IExtensionManifest { diff --git a/src/vs/platform/extensionManagement/node/extensionGalleryService.ts b/src/vs/platform/extensionManagement/node/extensionGalleryService.ts index ccce0192774aed98227f76a03a4da89b355c76c1..eaef70bbad3335312d01e8d61b907530894e4cf8 100644 --- a/src/vs/platform/extensionManagement/node/extensionGalleryService.ts +++ b/src/vs/platform/extensionManagement/node/extensionGalleryService.ts @@ -297,7 +297,7 @@ export class ExtensionGalleryService implements IExtensionGalleryService { } const type = options.names ? 'ids' : (options.text ? 'text' : 'all'); - const text = options.text || ''; + let text = options.text || ''; const pageSize = getOrDefault(options, o => o.pageSize, 50); this.telemetryService.publicLog('galleryService:query', { type, text }); @@ -310,7 +310,25 @@ export class ExtensionGalleryService implements IExtensionGalleryService { .withAssetTypes(AssetType.Icon, AssetType.License, AssetType.Details, AssetType.Manifest, AssetType.VSIX, AssetType.Changelog); if (text) { - query = query.withFilter(FilterType.SearchText, text).withSortBy(SortBy.NoneOrRelevance); + // Use category filter instead of "category:themes" + text = text.replace(/\bcategory:("([^"]*)"|([^"]\S*))(\s+|\b|$)/g, (_, quotedCategory, category) => { + query = query.withFilter(FilterType.Category, category || quotedCategory); + return ''; + }); + + // Use tag filter instead of "tag:debuggers" + text = text.replace(/\btag:("([^"]*)"|([^"]\S*))(\s+|\b|$)/g, (_, quotedTag, tag) => { + query = query.withFilter(FilterType.Tag, tag || quotedTag); + return ''; + }); + + text = text.trim(); + + if (text) { + query = query.withFilter(FilterType.SearchText, text); + } + + query = query.withSortBy(SortBy.NoneOrRelevance); } else if (options.ids) { query = query.withFilter(FilterType.ExtensionId, ...options.ids); } else if (options.names) { @@ -327,6 +345,8 @@ export class ExtensionGalleryService implements IExtensionGalleryService { query = query.withSortOrder(options.sortOrder); } + console.log(query.raw); + return this.queryGallery(query).then(({ galleryExtensions, total }) => { const extensions = galleryExtensions.map(e => toExtension(e, this.extensionsGalleryUrl)); const pageSize = query.pageSize; @@ -337,34 +357,34 @@ export class ExtensionGalleryService implements IExtensionGalleryService { }); } - private queryGallery(query: Query): TPromise<{ galleryExtensions: IRawGalleryExtension[], total: number; }> { - return this.commonHTTPHeaders - .then(headers => { - const data = JSON.stringify(query.raw); + private async queryGallery(query: Query): TPromise<{ galleryExtensions: IRawGalleryExtension[], total: number; }> { + const commonHeaders = await this.commonHTTPHeaders; + const data = JSON.stringify(query.raw); + const headers = assign({}, commonHeaders, { + 'Content-Type': 'application/json', + 'Accept': 'application/json;api-version=3.0-preview.1', + 'Accept-Encoding': 'gzip', + 'Content-Length': data.length + }); - headers = assign({}, headers, { - 'Content-Type': 'application/json', - 'Accept': 'application/json;api-version=3.0-preview.1', - 'Accept-Encoding': 'gzip', - 'Content-Length': data.length - }); + const context = await this.requestService.request({ + type: 'POST', + url: this.api('/extensionquery'), + data, + headers + }); - return this.requestService.request({ - type: 'POST', - url: this.api('/extensionquery'), - data, - headers - }); - }) - .then(context => asJson(context)) - .then(result => { - const r = result.results[0]; - const galleryExtensions = r.extensions; - const resultCount = r.resultMetadata && r.resultMetadata.filter(m => m.metadataType === 'ResultCount')[0]; - const total = resultCount && resultCount.metadataItems.filter(i => i.name === 'TotalCount')[0].count || 0; - - return { galleryExtensions, total }; - }); + if (context.res.statusCode >= 400 && context.res.statusCode < 500) { + return { galleryExtensions: [], total: 0 }; + } + + const result = await asJson(context); + const r = result.results[0]; + const galleryExtensions = r.extensions; + const resultCount = r.resultMetadata && r.resultMetadata.filter(m => m.metadataType === 'ResultCount')[0]; + const total = resultCount && resultCount.metadataItems.filter(i => i.name === 'TotalCount')[0].count || 0; + + return { galleryExtensions, total }; } download(extension: IGalleryExtension): TPromise { diff --git a/src/vs/platform/extensionManagement/test/common/extensionEnablementService.test.ts b/src/vs/platform/extensionManagement/test/common/extensionEnablementService.test.ts index 3ea2261d14af7c94293d758cdf7c364e2f69a218..33043b1764fd005a0a5107d58aab3106476e398e 100644 --- a/src/vs/platform/extensionManagement/test/common/extensionEnablementService.test.ts +++ b/src/vs/platform/extensionManagement/test/common/extensionEnablementService.test.ts @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ 'use strict'; -import * as sinon from 'sinon'; import * as assert from 'assert'; import { IExtensionManagementService, IExtensionEnablementService, DidUninstallExtensionEvent } from 'vs/platform/extensionManagement/common/extensionManagement'; import { ExtensionEnablementService } from 'vs/platform/extensionManagement/common/extensionEnablementService'; @@ -12,17 +11,23 @@ import { TestInstantiationService } from 'vs/platform/instantiation/test/common/ import { Emitter } from 'vs/base/common/event'; import { StorageService, InMemoryLocalStorage } from 'vs/platform/storage/common/storageService'; import { IStorageService } from 'vs/platform/storage/common/storage'; -import { IWorkspaceContextService, WorkspaceContextService } from 'vs/platform/workspace/common/workspace'; +import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { TestWorkspace } from 'vs/platform/workspace/test/common/testWorkspace'; + +// TODO@Sandeep layer breaker: cannot depend on node modules from /common/ and sinon is a node module +// tslint:disable-next-line:import-patterns +import * as sinon from 'sinon'; + +// TODO@Sandeep layer breaker: cannot depend on /workbench/ from /platform/ +// tslint:disable-next-line:import-patterns +import { TestContextService } from 'vs/workbench/test/workbenchTestServices'; function storageService(instantiationService: TestInstantiationService): IStorageService { let service = instantiationService.get(IStorageService); if (!service) { let workspaceContextService = instantiationService.get(IWorkspaceContextService); if (!workspaceContextService) { - workspaceContextService = instantiationService.stub(IWorkspaceContextService, WorkspaceContextService); - instantiationService.stub(IWorkspaceContextService, 'getWorkspace', TestWorkspace); + workspaceContextService = instantiationService.stub(IWorkspaceContextService, new TestContextService()); } service = instantiationService.stub(IStorageService, instantiationService.createInstance(StorageService, new InMemoryLocalStorage(), new InMemoryLocalStorage())); } @@ -70,7 +75,7 @@ suite('ExtensionEnablementService Test', () => { test('test when no extensions are disabled for workspace when there is no workspace', (done) => { testObject.setEnablement('pub.a', false, true) .then(() => { - instantiationService.stub(IWorkspaceContextService, 'getWorkspace', null); + instantiationService.stub(IWorkspaceContextService, 'hasWorkspace', false); assert.deepEqual([], testObject.getWorkspaceDisabledExtensions()); }) .then(done, done); @@ -175,7 +180,7 @@ suite('ExtensionEnablementService Test', () => { }); test('test disable an extension for workspace when there is no workspace throws error', (done) => { - instantiationService.stub(IWorkspaceContextService, 'getWorkspace', null); + instantiationService.stub(IWorkspaceContextService, 'hasWorkspace', false); testObject.setEnablement('pub.a', false, true) .then(() => assert.fail('should throw an error'), error => assert.ok(error)) .then(done, done); diff --git a/src/vs/platform/extensions/common/extensionsRegistry.ts b/src/vs/platform/extensions/common/extensionsRegistry.ts index 9c7b05edb71fcc357612df0d13f02f888bc2f7b3..8541f6b796fa30ead10846f4fa8b743bff0b7010 100644 --- a/src/vs/platform/extensions/common/extensionsRegistry.ts +++ b/src/vs/platform/extensions/common/extensionsRegistry.ts @@ -10,7 +10,7 @@ import { IJSONSchema } from 'vs/base/common/jsonSchema'; import Severity from 'vs/base/common/severity'; import { IMessage, IExtensionDescription } from 'vs/platform/extensions/common/extensions'; import { Extensions, IJSONContributionRegistry } from 'vs/platform/jsonschemas/common/jsonContributionRegistry'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; const hasOwnProperty = Object.hasOwnProperty; const schemaRegistry = Registry.as(Extensions.JSONContribution); @@ -182,7 +182,38 @@ const schema: IJSONSchema = { type: 'array', items: { type: 'string', - defaultSnippets: [{ label: 'onLanguage', body: 'onLanguage:${1:languageId}' }, { label: 'onCommand', body: 'onCommand:${2:commandId}' }, { label: 'onDebug', body: 'onDebug:${3:type}' }, { label: 'workspaceContains', body: 'workspaceContains:${4:fileName}' }], + defaultSnippets: [ + { + label: 'onLanguage', + description: nls.localize('vscode.extension.activationEvents.onLanguage', 'An activation event emitted whenever a file that resolves to the specified language gets opened.'), + body: 'onLanguage:${1:languageId}' + }, + { + label: 'onCommand', + description: nls.localize('vscode.extension.activationEvents.onCommand', 'An activation event emitted whenever the specified command gets invoked.'), + body: 'onCommand:${2:commandId}' + }, + { + label: 'onDebug', + description: nls.localize('vscode.extension.activationEvents.onDebug', 'An activation event emitted whenever a debug session of the specified type is started.'), + body: 'onDebug:${3:type}' + }, + { + label: 'workspaceContains', + description: nls.localize('vscode.extension.activationEvents.workspaceContains', 'An activation event emitted whenever a folder is opened that contains at least a file matching the specified glob pattern.'), + body: 'workspaceContains:${4:filePattern}' + }, + { + label: 'onView', + body: 'onView:${5:viewId}', + description: nls.localize('vscode.extension.activationEvents.onView', 'An activation event emitted whenever the specified view is expanded.'), + }, + { + label: '*', + description: nls.localize('vscode.extension.activationEvents.star', 'An activation event emitted on VS Code startup. To ensure a great end user experience, please use this activation event in your extension only when no other activation events combination works in your use-case.'), + body: '*' + } + ], } }, badges: { diff --git a/src/vs/platform/files/common/files.ts b/src/vs/platform/files/common/files.ts index 94d4d0295ddf9db82c7002f95fab489f4461501b..a1565f77403fd2987b9ae75ca78f24bb0da8370e 100644 --- a/src/vs/platform/files/common/files.ts +++ b/src/vs/platform/files/common/files.ts @@ -12,7 +12,7 @@ import events = require('vs/base/common/events'); import { isLinux } from 'vs/base/common/platform'; import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; import Event from 'vs/base/common/event'; -import { equalsIgnoreCase, beginsWithIgnoreCase } from 'vs/base/common/strings'; +import { beginsWithIgnoreCase } from 'vs/base/common/strings'; export const IFileService = createDecorator('fileService'); @@ -43,6 +43,11 @@ export interface IFileService { */ resolveFile(resource: URI, options?: IResolveFileOptions): TPromise; + /** + * Same as resolveFile but supports resolving mulitple resources in parallel. + */ + resolveFiles(toResolve: { resource: URI, options?: IResolveFileOptions }[]): TPromise; + /** *Finds out if a file identified by the resource exists. */ @@ -137,7 +142,7 @@ export interface IFileService { /** * Configures the file service with the provided options. */ - updateOptions(options: any): void; + updateOptions(options: object): void; /** * Returns the preferred encoding to use for a given resource. @@ -191,7 +196,7 @@ export enum FileChangeType { export interface IFileChange { /** - * The type of change that occured to the file. + * The type of change that occurred to the file. */ type: FileChangeType; @@ -231,10 +236,10 @@ export class FileChangesEvent extends events.Event { // For deleted also return true when deleted folder is parent of target path if (type === FileChangeType.DELETED) { - return isEqualOrParent(resource.fsPath, change.resource.fsPath, !isLinux /* ignorecase */); + return paths.isEqualOrParent(resource.fsPath, change.resource.fsPath, !isLinux /* ignorecase */); } - return isEqual(resource.fsPath, change.resource.fsPath, !isLinux /* ignorecase */); + return paths.isEqual(resource.fsPath, change.resource.fsPath, !isLinux /* ignorecase */); }); } @@ -291,19 +296,6 @@ export class FileChangesEvent extends events.Event { } } -export function isEqual(pathA: string, pathB: string, ignoreCase?: boolean): boolean { - const identityEquals = (pathA === pathB); - if (!ignoreCase || identityEquals) { - return identityEquals; - } - - if (!pathA || !pathB) { - return false; - } - - return equalsIgnoreCase(pathA, pathB); -} - export function isParent(path: string, candidate: string, ignoreCase?: boolean): boolean { if (!path || !candidate || path === candidate) { return false; @@ -324,43 +316,7 @@ export function isParent(path: string, candidate: string, ignoreCase?: boolean): return path.indexOf(candidate) === 0; } -export function isEqualOrParent(path: string, candidate: string, ignoreCase?: boolean): boolean { - if (path === candidate) { - return true; - } - if (!path || !candidate) { - return false; - } - - if (candidate.length > path.length) { - return false; - } - - if (ignoreCase) { - const beginsWith = beginsWithIgnoreCase(path, candidate); - if (!beginsWith) { - return false; - } - - if (candidate.length === path.length) { - return true; // same path, different casing - } - - let sepOffset = candidate.length; - if (candidate.charAt(candidate.length - 1) === paths.nativeSep) { - sepOffset--; // adjust the expected sep offset in case our candidate already ends in separator character - } - - return path.charAt(sepOffset) === paths.nativeSep; - } - - if (candidate.charAt(candidate.length - 1) !== paths.nativeSep) { - candidate += paths.nativeSep; - } - - return path.indexOf(candidate) === 0; -} export function indexOf(path: string, candidate: string, ignoreCase?: boolean): number { if (candidate.length > path.length) { @@ -587,6 +543,7 @@ export interface IFilesConfiguration { autoSaveDelay: number; eol: string; hotExit: string; + useExperimentalFileWatcher: boolean; }; } diff --git a/src/vs/platform/files/test/files.test.ts b/src/vs/platform/files/test/files.test.ts index 14f4643f7499160b68f0eb52b45626aaacd3878f..305db3647cd8329589c5dd19ecf519d04c246bb6 100644 --- a/src/vs/platform/files/test/files.test.ts +++ b/src/vs/platform/files/test/files.test.ts @@ -7,8 +7,8 @@ import * as assert from 'assert'; import URI from 'vs/base/common/uri'; -import { join } from 'vs/base/common/paths'; -import { FileChangeType, FileChangesEvent, isEqual, isParent, isEqualOrParent, indexOf } from 'vs/platform/files/common/files'; +import { join, isEqual, isEqualOrParent } from 'vs/base/common/paths'; +import { FileChangeType, FileChangesEvent, isParent, indexOf } from 'vs/platform/files/common/files'; import { isLinux, isMacintosh, isWindows } from 'vs/base/common/platform'; suite('Files', () => { diff --git a/src/vs/platform/history/electron-main/historyMainService.ts b/src/vs/platform/history/electron-main/historyMainService.ts new file mode 100644 index 0000000000000000000000000000000000000000..568b27917e7f598f8c6acb14b83d7412a4518f15 --- /dev/null +++ b/src/vs/platform/history/electron-main/historyMainService.ts @@ -0,0 +1,225 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +'use strict'; + +import * as path from 'path'; +import * as nls from 'vs/nls'; +import * as arrays from 'vs/base/common/arrays'; +import { trim } from 'vs/base/common/strings'; +import { IStorageService } from 'vs/platform/storage/node/storage'; +import { app } from 'electron'; +import { ILogService } from 'vs/platform/log/common/log'; +import { getPathLabel } from 'vs/base/common/labels'; +import { IPath } from 'vs/platform/windows/common/windows'; +import CommonEvent, { Emitter } from 'vs/base/common/event'; +import { createDecorator } from "vs/platform/instantiation/common/instantiation"; +import { isWindows, isMacintosh, isLinux } from "vs/base/common/platform"; + +export const IHistoryMainService = createDecorator('historyMainService'); + +export interface IRecentPathsList { + folders: string[]; + files: string[]; +} + +export interface IHistoryMainService { + _serviceBrand: any; + + // events + onRecentPathsChange: CommonEvent; + + // methods + + addToRecentPathsList(paths: { path: string; isFile?: boolean; }[]): void; + getRecentPathsList(workspacePath?: string, filesToOpen?: IPath[]): IRecentPathsList; + removeFromRecentPathsList(path: string): void; + removeFromRecentPathsList(paths: string[]): void; + clearRecentPathsList(): void; + updateWindowsJumpList(): void; +} + +export class HistoryMainService implements IHistoryMainService { + + private static MAX_TOTAL_RECENT_ENTRIES = 100; + + private static recentPathsListStorageKey = 'openedPathsList'; + + _serviceBrand: any; + + private _onRecentPathsChange = new Emitter(); + onRecentPathsChange: CommonEvent = this._onRecentPathsChange.event; + + constructor( + @IStorageService private storageService: IStorageService, + @ILogService private logService: ILogService + ) { + } + + public addToRecentPathsList(paths: { path: string; isFile?: boolean; }[]): void { + if (!paths || !paths.length) { + return; + } + + const mru = this.getRecentPathsList(); + paths.forEach(p => { + const { path, isFile } = p; + + if (isFile) { + mru.files.unshift(path); + mru.files = arrays.distinct(mru.files, (f) => isLinux ? f : f.toLowerCase()); + } else { + mru.folders.unshift(path); + mru.folders = arrays.distinct(mru.folders, (f) => isLinux ? f : f.toLowerCase()); + } + + // Make sure its bounded + mru.folders = mru.folders.slice(0, HistoryMainService.MAX_TOTAL_RECENT_ENTRIES); + mru.files = mru.files.slice(0, HistoryMainService.MAX_TOTAL_RECENT_ENTRIES); + + // Add to recent documents (Windows/macOS only) + if (isMacintosh || isWindows) { + app.addRecentDocument(path); + } + }); + + this.storageService.setItem(HistoryMainService.recentPathsListStorageKey, mru); + this._onRecentPathsChange.fire(); + } + + public removeFromRecentPathsList(path: string): void; + public removeFromRecentPathsList(paths: string[]): void; + public removeFromRecentPathsList(arg1: any): void { + let paths: string[]; + if (Array.isArray(arg1)) { + paths = arg1; + } else { + paths = [arg1]; + } + + const mru = this.getRecentPathsList(); + let update = false; + + paths.forEach(path => { + let index = mru.files.indexOf(path); + if (index >= 0) { + mru.files.splice(index, 1); + update = true; + } + + index = mru.folders.indexOf(path); + if (index >= 0) { + mru.folders.splice(index, 1); + update = true; + } + }); + + if (update) { + this.storageService.setItem(HistoryMainService.recentPathsListStorageKey, mru); + this._onRecentPathsChange.fire(); + } + } + + public clearRecentPathsList(): void { + this.storageService.setItem(HistoryMainService.recentPathsListStorageKey, { folders: [], files: [] }); + app.clearRecentDocuments(); + + // Event + this._onRecentPathsChange.fire(); + } + + public getRecentPathsList(workspacePath?: string, filesToOpen?: IPath[]): IRecentPathsList { + let files: string[]; + let folders: string[]; + + // Get from storage + const storedRecents = this.storageService.getItem(HistoryMainService.recentPathsListStorageKey); + if (storedRecents) { + files = storedRecents.files || []; + folders = storedRecents.folders || []; + } else { + files = []; + folders = []; + } + + // Add currently files to open to the beginning if any + if (filesToOpen) { + files.unshift(...filesToOpen.map(f => f.filePath)); + } + + // Add current workspace path to beginning if set + if (workspacePath) { + folders.unshift(workspacePath); + } + + // Clear those dupes + files = arrays.distinct(files); + folders = arrays.distinct(folders); + + return { files, folders }; + } + + public updateWindowsJumpList(): void { + if (!isWindows) { + return; // only on windows + } + + const jumpList: Electron.JumpListCategory[] = []; + + // Tasks + jumpList.push({ + type: 'tasks', + items: [ + { + type: 'task', + title: nls.localize('newWindow', "New Window"), + description: nls.localize('newWindowDesc', "Opens a new window"), + program: process.execPath, + args: '-n', // force new window + iconPath: process.execPath, + iconIndex: 0 + } + ] + }); + + // Recent Folders + if (this.getRecentPathsList().folders.length > 0) { + + // The user might have meanwhile removed items from the jump list and we have to respect that + // so we need to update our list of recent paths with the choice of the user to not add them again + // Also: Windows will not show our custom category at all if there is any entry which was removed + // by the user! See https://github.com/Microsoft/vscode/issues/15052 + this.removeFromRecentPathsList(app.getJumpListSettings().removedItems.map(r => trim(r.args, '"'))); + + // Add entries + jumpList.push({ + type: 'custom', + name: nls.localize('recentFolders', "Recent Folders"), + items: this.getRecentPathsList().folders.slice(0, 7 /* limit number of entries here */).map(folder => { + return { + type: 'task', + title: path.basename(folder) || folder, // use the base name to show shorter entries in the list + description: nls.localize('folderDesc', "{0} {1}", path.basename(folder), getPathLabel(path.dirname(folder))), + program: process.execPath, + args: `"${folder}"`, // open folder (use quotes to support paths with whitespaces) + iconPath: 'explorer.exe', // simulate folder icon + iconIndex: 0 + }; + }).filter(i => !!i) + }); + } + + // Recent + jumpList.push({ + type: 'recent' // this enables to show files in the "recent" category + }); + + try { + app.setJumpList(jumpList); + } catch (error) { + this.logService.log('#setJumpList', error); // since setJumpList is relatively new API, make sure to guard for errors + } + } +} \ No newline at end of file diff --git a/src/vs/platform/instantiation/test/common/instantiationServiceMock.ts b/src/vs/platform/instantiation/test/common/instantiationServiceMock.ts index c759246ea8f0894db4e2062737c76f9e2d37f702..fb37c3b046980e00ed893fa2d6247b095714ecaa 100644 --- a/src/vs/platform/instantiation/test/common/instantiationServiceMock.ts +++ b/src/vs/platform/instantiation/test/common/instantiationServiceMock.ts @@ -5,14 +5,16 @@ 'use strict'; -import * as sinon from 'sinon'; import { TPromise } from 'vs/base/common/winjs.base'; import * as types from 'vs/base/common/types'; -import { LinkedMap } from 'vs/base/common/map'; import { InstantiationService } from 'vs/platform/instantiation/common/instantiationService'; import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; import { ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation'; +// TODO@Sandeep layer breaker: cannot depend on node modules from /common/ and sinon is a node module +// tslint:disable-next-line:import-patterns +import * as sinon from 'sinon'; + interface IServiceMock { id: ServiceIdentifier; service: any; @@ -20,12 +22,12 @@ interface IServiceMock { export class TestInstantiationService extends InstantiationService { - private _servciesMap: LinkedMap, any>; + private _servciesMap: Map, any>; constructor(private _serviceCollection: ServiceCollection = new ServiceCollection()) { super(_serviceCollection); - this._servciesMap = new LinkedMap, any>(); + this._servciesMap = new Map, any>(); } public get(service: ServiceIdentifier): T { diff --git a/src/vs/platform/jsonschemas/common/jsonContributionRegistry.ts b/src/vs/platform/jsonschemas/common/jsonContributionRegistry.ts index 0c68f4cbd2b267109d7be5ad8645286509c481fe..5d4f91c0dff10502bd2cbd821a50d3cc87f467ec 100644 --- a/src/vs/platform/jsonschemas/common/jsonContributionRegistry.ts +++ b/src/vs/platform/jsonschemas/common/jsonContributionRegistry.ts @@ -5,7 +5,7 @@ 'use strict'; import { IJSONSchema } from 'vs/base/common/jsonSchema'; -import platform = require('vs/platform/platform'); +import platform = require('vs/platform/registry/common/platform'); import { EventEmitter } from 'vs/base/common/eventEmitter'; import { IDisposable } from 'vs/base/common/lifecycle'; diff --git a/src/vs/platform/keybinding/common/keybindingsRegistry.ts b/src/vs/platform/keybinding/common/keybindingsRegistry.ts index 46bdac8acc98b85108c1cb3f1fc05de5aa93a4ce..0ec39c34220c4f6fb077887fb61f399524609686 100644 --- a/src/vs/platform/keybinding/common/keybindingsRegistry.ts +++ b/src/vs/platform/keybinding/common/keybindingsRegistry.ts @@ -8,7 +8,7 @@ import { SimpleKeybinding, KeyCode, KeybindingType, createKeybinding, Keybinding import { OS, OperatingSystem } from 'vs/base/common/platform'; import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; import { CommandsRegistry, ICommandHandler, ICommandHandlerDescription } from 'vs/platform/commands/common/commands'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; export interface IKeybindingItem { keybinding: Keybinding; diff --git a/src/vs/platform/keybinding/common/usLayoutResolvedKeybinding.ts b/src/vs/platform/keybinding/common/usLayoutResolvedKeybinding.ts index 08d67882828f8a501cdfef1f90edbdde8b6e60c9..78861625e1a0c7098a0f30c2ea441348c02270f3 100644 --- a/src/vs/platform/keybinding/common/usLayoutResolvedKeybinding.ts +++ b/src/vs/platform/keybinding/common/usLayoutResolvedKeybinding.ts @@ -5,7 +5,7 @@ 'use strict'; import { ResolvedKeybinding, ResolvedKeybindingPart, KeyCode, KeyCodeUtils, Keybinding, KeybindingType, SimpleKeybinding } from 'vs/base/common/keyCodes'; -import { UILabelProvider, AriaLabelProvider, ElectronAcceleratorLabelProvider, UserSettingsLabelProvider } from 'vs/platform/keybinding/common/keybindingLabels'; +import { UILabelProvider, AriaLabelProvider, ElectronAcceleratorLabelProvider, UserSettingsLabelProvider } from 'vs/base/common/keybindingLabels'; import { OperatingSystem } from 'vs/base/common/platform'; /** diff --git a/src/vs/platform/lifecycle/common/lifecycle.ts b/src/vs/platform/lifecycle/common/lifecycle.ts index 1cd1ab93cea11c4b1b30399bea16d89d45e88566..c3ff228ae9b35f372d28a952fa1b2a426032efee 100644 --- a/src/vs/platform/lifecycle/common/lifecycle.ts +++ b/src/vs/platform/lifecycle/common/lifecycle.ts @@ -44,6 +44,12 @@ export enum StartupKind { ReopenedWindow = 4, } +export enum LifecyclePhase { + Starting = 1, + Running = 2, + ShuttingDown = 3 +} + /** * A lifecycle service informs about lifecycle events of the * application, such as shutdown. @@ -58,10 +64,14 @@ export interface ILifecycleService { readonly startupKind: StartupKind; /** - * A flag indicating if the application is in the process of shutting down. This will be true - * before the onWillShutdown event is fired and false if the shutdown is being vetoed. + * A flag indicating in what phase of the lifecycle we currently are. + */ + readonly phase: LifecyclePhase; + + /** + * An event that fire when the lifecycle phase has changed */ - readonly willShutdown: boolean; + readonly onDidChangePhase: Event; /** * Fired before shutdown happens. Allows listeners to veto against the @@ -80,8 +90,9 @@ export interface ILifecycleService { export const NullLifecycleService: ILifecycleService = { _serviceBrand: null, + phase: LifecyclePhase.Running, startupKind: StartupKind.NewWindow, - willShutdown: false, - onWillShutdown: () => ({ dispose() { } }), - onShutdown: (reason) => ({ dispose() { } }) + onDidChangePhase: Event.None, + onWillShutdown: Event.None, + onShutdown: Event.None }; diff --git a/src/vs/code/electron-main/lifecycle.ts b/src/vs/platform/lifecycle/electron-main/lifecycleMain.ts similarity index 85% rename from src/vs/code/electron-main/lifecycle.ts rename to src/vs/platform/lifecycle/electron-main/lifecycleMain.ts index 895f8b056846c453ffbe93b4273451da89cd9004..d89a243598dca0a32c1b0ca94690ff07c39b0495 100644 --- a/src/vs/code/electron-main/lifecycle.ts +++ b/src/vs/platform/lifecycle/electron-main/lifecycleMain.ts @@ -7,12 +7,13 @@ import { ipcMain as ipc, app } from 'electron'; import { TPromise, TValueCallback } from 'vs/base/common/winjs.base'; -import { ReadyState, VSCodeWindow } from 'vs/code/electron-main/window'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { ILogService } from 'vs/code/electron-main/log'; -import { IStorageService } from 'vs/code/electron-main/storage'; +import { ILogService } from 'vs/platform/log/common/log'; +import { IStorageService } from 'vs/platform/storage/node/storage'; import Event, { Emitter } from 'vs/base/common/event'; import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; +import { ICodeWindow } from "vs/platform/windows/electron-main/windows"; +import { ReadyState } from "vs/platform/windows/common/windows"; export const ILifecycleService = createDecorator('lifecycleService'); @@ -43,12 +44,12 @@ export interface ILifecycleService { * is called even when the window prevents the closing. We want an event that truly fires * before the window gets closed for real. */ - onBeforeWindowClose: Event; + onBeforeWindowClose: Event; ready(): void; - registerWindow(vscodeWindow: VSCodeWindow): void; + registerWindow(codeWindow: ICodeWindow): void; - unload(vscodeWindow: VSCodeWindow, reason: UnloadReason): TPromise; + unload(codeWindow: ICodeWindow, reason: UnloadReason): TPromise; relaunch(options?: { addArgs?: string[], removeArgs?: string[] }); @@ -74,8 +75,8 @@ export class LifecycleService implements ILifecycleService { private _onBeforeQuit = new Emitter(); onBeforeQuit: Event = this._onBeforeQuit.event; - private _onBeforeWindowClose = new Emitter(); - onBeforeWindowClose: Event = this._onBeforeWindowClose.event; + private _onBeforeWindowClose = new Emitter(); + onBeforeWindowClose: Event = this._onBeforeWindowClose.event; constructor( @IEnvironmentService private environmentService: IEnvironmentService, @@ -132,11 +133,11 @@ export class LifecycleService implements ILifecycleService { }); } - public registerWindow(vscodeWindow: VSCodeWindow): void { + public registerWindow(codeWindow: ICodeWindow): void { // Window Before Closing: Main -> Renderer - vscodeWindow.win.on('close', (e) => { - const windowId = vscodeWindow.id; + codeWindow.win.on('close', e => { + const windowId = codeWindow.id; this.logService.log('Lifecycle#window-before-close', windowId); // The window already acknowledged to be closed @@ -150,11 +151,11 @@ export class LifecycleService implements ILifecycleService { // Otherwise prevent unload and handle it from window e.preventDefault(); - this.unload(vscodeWindow, UnloadReason.CLOSE).done(veto => { + this.unload(codeWindow, UnloadReason.CLOSE).done(veto => { if (!veto) { this.windowToCloseRequest[windowId] = true; - this._onBeforeWindowClose.fire(vscodeWindow); - vscodeWindow.win.close(); + this._onBeforeWindowClose.fire(codeWindow); + codeWindow.close(); } else { this.quitRequested = false; delete this.windowToCloseRequest[windowId]; @@ -163,14 +164,14 @@ export class LifecycleService implements ILifecycleService { }); } - public unload(vscodeWindow: VSCodeWindow, reason: UnloadReason): TPromise { + public unload(codeWindow: ICodeWindow, reason: UnloadReason): TPromise { // Always allow to unload a window that is not yet ready - if (vscodeWindow.readyState !== ReadyState.READY) { + if (codeWindow.readyState !== ReadyState.READY) { return TPromise.as(false); } - this.logService.log('Lifecycle#unload()', vscodeWindow.id); + this.logService.log('Lifecycle#unload()', codeWindow.id); return new TPromise((c) => { const oneTimeEventToken = this.oneTimeListenerTokenGenerator++; @@ -193,7 +194,7 @@ export class LifecycleService implements ILifecycleService { c(true); // veto }); - vscodeWindow.send('vscode:beforeUnload', { okChannel, cancelChannel, reason: this.quitRequested ? UnloadReason.QUIT : reason }); + codeWindow.send('vscode:beforeUnload', { okChannel, cancelChannel, reason: this.quitRequested ? UnloadReason.QUIT : reason }); }); } diff --git a/src/vs/code/electron-main/log.ts b/src/vs/platform/log/common/log.ts similarity index 91% rename from src/vs/code/electron-main/log.ts rename to src/vs/platform/log/common/log.ts index caa630d6ad2e5a5b335a3950c56f1df7c5f36b01..51427842fea3d40b5f04f8d41c3b88640e4520a4 100644 --- a/src/vs/code/electron-main/log.ts +++ b/src/vs/platform/log/common/log.ts @@ -12,17 +12,18 @@ export const ILogService = createDecorator('logService'); export interface ILogService { _serviceBrand: any; + log(...args: any[]): void; } -export class MainLogService implements ILogService { +export class LogMainService implements ILogService { _serviceBrand: any; constructor( @IEnvironmentService private environmentService: IEnvironmentService) { } - log(...args: any[]): void { + public log(...args: any[]): void { if (this.environmentService.verbose) { console.log(`\x1b[93m[main ${new Date().toLocaleTimeString()}]\x1b[0m`, ...args); } diff --git a/src/vs/platform/markers/common/problemMatcher.ts b/src/vs/platform/markers/common/problemMatcher.ts index b42f0f2a90667e699634cb50d357aae377c04496..7e8507981dc98a25a2dbbcb3ff7ecfb2411c4d2e 100644 --- a/src/vs/platform/markers/common/problemMatcher.ts +++ b/src/vs/platform/markers/common/problemMatcher.ts @@ -115,10 +115,12 @@ export interface ProblemMatcher { export interface NamedProblemMatcher extends ProblemMatcher { name: string; + label: string; } export interface NamedMultiLineProblemPattern { name: string; + label: string; patterns: MultiLineProblemPattern; } @@ -495,6 +497,11 @@ export namespace Config { * The name of the problem pattern. */ name: string; + + /** + * A human readable label + */ + label?: string; } export namespace NamedProblemPattern { @@ -518,6 +525,11 @@ export namespace Config { */ name: string; + /** + * A human readable label + */ + label?: string; + /** * The actual patterns */ @@ -663,6 +675,11 @@ export namespace Config { * problem matchter from within a task. */ name?: string; + + /** + * A human reable label. + */ + label?: string; } export function isNamedProblemMatcher(value: ProblemMatcher): value is NamedProblemMatcher { @@ -704,6 +721,7 @@ class ProblemPatternParser extends Parser { private createNamedMultiLineProblemPattern(value: Config.NamedMultiLineProblemPattern): NamedMultiLineProblemPattern { let result = { name: value.name, + label: value.label ? value.label : value.name, patterns: this.createMultiLineProblemPattern(value.patterns) }; return result.patterns ? result : null; @@ -1229,7 +1247,8 @@ export class ProblemMatcherParser extends Parser { } } if (Config.isNamedProblemMatcher(description)) { - (result).name = description.name; + (result as NamedProblemMatcher).name = description.name; + (result as NamedProblemMatcher).label = Types.isString(description.label) ? description.label : description.name; } return result; } @@ -1466,9 +1485,13 @@ export namespace Schemas { export const NamedProblemMatcher: IJSONSchema = Objects.clone(ProblemMatcher); NamedProblemMatcher.properties = Objects.clone(NamedProblemMatcher.properties); - NamedProblemMatcher.properties['name'] = { + NamedProblemMatcher.properties.name = { + type: 'string', + description: localize('NamedProblemMatcherSchema.name', 'The name of the problem matcher used to refer to it.') + }; + NamedProblemMatcher.properties.label = { type: 'string', - description: localize('NamedProblemMatcherSchema.name', 'The name of the problem matcher.') + description: localize('NamedProblemMatcherSchema.label', 'A human readable label of the problem matcher.') }; } @@ -1481,12 +1504,14 @@ let problemMatchersExtPoint = ExtensionsRegistry.registerExtensionPoint; exists(name: string): boolean; - get(name: string): ProblemMatcher; + get(name: string): NamedProblemMatcher; + values(): NamedProblemMatcher[]; + keys(): string[]; } class ProblemMatcherRegistryImpl implements IProblemMatcherRegistry { - private matchers: IStringDictionary; + private matchers: IStringDictionary; private readyPromise: TPromise; constructor() { @@ -1501,7 +1526,7 @@ class ProblemMatcherRegistryImpl implements IProblemMatcherRegistry { for (let matcher of problemMatchers) { let result = parser.parse(matcher); if (result && isNamedProblemMatcher(result)) { - this.add(result.name, result); + this.add(result); } } }); @@ -1520,11 +1545,11 @@ class ProblemMatcherRegistryImpl implements IProblemMatcherRegistry { return this.readyPromise; } - public add(name: string, matcher: ProblemMatcher): void { - this.matchers[name] = matcher; + public add(matcher: NamedProblemMatcher): void { + this.matchers[matcher.name] = matcher; } - public get(name: string): ProblemMatcher { + public get(name: string): NamedProblemMatcher { return this.matchers[name]; } @@ -1536,15 +1561,27 @@ class ProblemMatcherRegistryImpl implements IProblemMatcherRegistry { delete this.matchers[name]; } + public keys(): string[] { + return Object.keys(this.matchers); + } + + public values(): NamedProblemMatcher[] { + return Object.keys(this.matchers).map(key => this.matchers[key]); + } + private fillDefaults(): void { - this.add('msCompile', { + this.add({ + name: 'msCompile', + label: localize('msCompile', 'Microsoft compiler problems'), owner: 'msCompile', applyTo: ApplyToKind.allDocuments, fileLocation: FileLocationKind.Absolute, pattern: ProblemPatternRegistry.get('msCompile') }); - this.add('lessCompile', { + this.add({ + name: 'lessCompile', + label: localize('lessCompile', 'Less problems'), owner: 'lessCompile', applyTo: ApplyToKind.allDocuments, fileLocation: FileLocationKind.Absolute, @@ -1552,7 +1589,9 @@ class ProblemMatcherRegistryImpl implements IProblemMatcherRegistry { severity: Severity.Error }); - this.add('gulp-tsc', { + this.add({ + name: 'gulp-tsc', + label: localize('gulp-tsc', 'Gulp TSC Problems'), owner: 'typescript', applyTo: ApplyToKind.closedDocuments, fileLocation: FileLocationKind.Relative, @@ -1560,21 +1599,27 @@ class ProblemMatcherRegistryImpl implements IProblemMatcherRegistry { pattern: ProblemPatternRegistry.get('gulp-tsc') }); - this.add('jshint', { + this.add({ + name: 'jshint', + label: localize('jshint', 'JSHint problems'), owner: 'jshint', applyTo: ApplyToKind.allDocuments, fileLocation: FileLocationKind.Absolute, pattern: ProblemPatternRegistry.get('jshint') }); - this.add('jshint-stylish', { + this.add({ + name: 'jshint-stylish', + label: localize('jshint-stylish', 'JSHint stylish problems'), owner: 'jshint', applyTo: ApplyToKind.allDocuments, fileLocation: FileLocationKind.Absolute, pattern: ProblemPatternRegistry.get('jshint-stylish') }); - this.add('eslint-compact', { + this.add({ + name: 'eslint-compact', + label: localize('eslint-compact', 'ESLint compact problems'), owner: 'eslint', applyTo: ApplyToKind.allDocuments, fileLocation: FileLocationKind.Relative, @@ -1582,14 +1627,18 @@ class ProblemMatcherRegistryImpl implements IProblemMatcherRegistry { pattern: ProblemPatternRegistry.get('eslint-compact') }); - this.add('eslint-stylish', { + this.add({ + name: 'eslint-stylish', + label: localize('eslint-stylish', 'ESLint stylish problems'), owner: 'eslint', applyTo: ApplyToKind.allDocuments, fileLocation: FileLocationKind.Absolute, pattern: ProblemPatternRegistry.get('eslint-stylish') }); - this.add('go', { + this.add({ + name: 'go', + label: localize('go', 'Go problems'), owner: 'go', applyTo: ApplyToKind.allDocuments, fileLocation: FileLocationKind.Relative, diff --git a/src/vs/platform/node/product.ts b/src/vs/platform/node/product.ts index 43be42470292eb445d22e7dfa3b94de433f8a7fa..d837f2aaad24ef55979123d7c3c95708e0f86c03 100644 --- a/src/vs/platform/node/product.ts +++ b/src/vs/platform/node/product.ts @@ -47,6 +47,7 @@ export interface IProductConfiguration { keyboardShortcutsUrlLinux: string; keyboardShortcutsUrlWin: string; introductoryVideosUrl: string; + tipsAndTricksUrl: string; twitterUrl: string; requestFeatureUrl: string; reportIssueUrl: string; diff --git a/src/vs/platform/quickOpen/common/quickOpen.ts b/src/vs/platform/quickOpen/common/quickOpen.ts index 6cc6781e1909fbfb8d14f344fd5daa2965571cee..2ce7f0a3691d47e3e8c23475c21e6eb3daaf13ec 100644 --- a/src/vs/platform/quickOpen/common/quickOpen.ts +++ b/src/vs/platform/quickOpen/common/quickOpen.ts @@ -57,6 +57,16 @@ export interface IPickOptions { * an optional flag to not close the picker on focus lost */ ignoreFocusLost?: boolean; + + /** + * enables quick navigate in the picker to open an element without typing + */ + quickNavigateConfiguration?: IQuickNavigateConfiguration; + + /** + * a context key to set when this picker is active + */ + contextKey?: string; } export interface IInputOptions { @@ -96,6 +106,7 @@ export interface IInputOptions { export interface IShowOptions { quickNavigateConfiguration?: IQuickNavigateConfiguration; + inputSelection?: { start: number; end: number; }; } export const IQuickOpenService = createDecorator('quickOpenService'); diff --git a/src/vs/platform/platform.ts b/src/vs/platform/registry/common/platform.ts similarity index 100% rename from src/vs/platform/platform.ts rename to src/vs/platform/registry/common/platform.ts diff --git a/src/vs/platform/test/common/platform.test.ts b/src/vs/platform/registry/test/common/platform.test.ts similarity index 95% rename from src/vs/platform/test/common/platform.test.ts rename to src/vs/platform/registry/test/common/platform.test.ts index 5f9ab7532402acfe170388606fe07924298591ab..4a26fd2eb363fcb1082f2d19ba7a4e32897ff04e 100644 --- a/src/vs/platform/test/common/platform.test.ts +++ b/src/vs/platform/registry/test/common/platform.test.ts @@ -5,7 +5,7 @@ 'use strict'; import assert = require('assert'); -import Platform = require('vs/platform/platform'); +import Platform = require('vs/platform/registry/common/platform'); import Types = require('vs/base/common/types'); suite('Platform / Registry', () => { diff --git a/src/vs/platform/request/node/request.ts b/src/vs/platform/request/node/request.ts index 9d42bbc4c2a1438b80ab6307f4fb36dc28b5ca53..b8d501fa2b5a7c2446497f1f35d6cb75954efa37 100644 --- a/src/vs/platform/request/node/request.ts +++ b/src/vs/platform/request/node/request.ts @@ -9,7 +9,7 @@ import { TPromise } from 'vs/base/common/winjs.base'; import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; import { IRequestOptions, IRequestContext } from 'vs/base/node/request'; import { IConfigurationRegistry, Extensions } from 'vs/platform/configuration/common/configurationRegistry'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; export const IRequestService = createDecorator('requestService2'); diff --git a/src/vs/platform/request/node/requestService.ts b/src/vs/platform/request/node/requestService.ts index ac91d258b24d625585818f24a33f89bf601cbe26..23033fbe4f036e2d7a880d162b060303c8de083a 100644 --- a/src/vs/platform/request/node/requestService.ts +++ b/src/vs/platform/request/node/requestService.ts @@ -10,7 +10,7 @@ import { assign } from 'vs/base/common/objects'; import { IRequestOptions, IRequestContext, IRequestFunction, request } from 'vs/base/node/request'; import { getProxyAgent } from 'vs/base/node/proxy'; import { IRequestService, IHTTPConfiguration } from 'vs/platform/request/node/request'; -import { IConfigurationService, IConfigurationServiceEvent } from 'vs/platform/configuration/common/configuration'; +import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; /** * This service exposes the `request` API, while using the global @@ -29,11 +29,7 @@ export class RequestService implements IRequestService { @IConfigurationService configurationService: IConfigurationService ) { this.configure(configurationService.getConfiguration()); - configurationService.onDidUpdateConfiguration(this.onDidUpdateConfiguration, this, this.disposables); - } - - private onDidUpdateConfiguration(e: IConfigurationServiceEvent) { - this.configure(e.config); + configurationService.onDidUpdateConfiguration(() => this.configure(configurationService.getConfiguration()), this, this.disposables); } private configure(config: IHTTPConfiguration) { diff --git a/src/vs/platform/search/common/replace.ts b/src/vs/platform/search/common/replace.ts index e57e23c10343558774d36e4521a0d8786a4d3bc0..647b5d51a0d1139b1e3892161c9f21675131ef6a 100644 --- a/src/vs/platform/search/common/replace.ts +++ b/src/vs/platform/search/common/replace.ts @@ -175,7 +175,7 @@ export class ReplacePattern { } if (substrFrom === 0) { - // no replacement occured + // no replacement occurred return; } diff --git a/src/vs/platform/search/common/search.ts b/src/vs/platform/search/common/search.ts index 365796b2a32bb1c33322d773eb5262f20e48ef62..15552953e76f3a69eb0ff7a822c77037469b83e8 100644 --- a/src/vs/platform/search/common/search.ts +++ b/src/vs/platform/search/common/search.ts @@ -25,16 +25,21 @@ export interface ISearchService { clearCache(cacheKey: string): TPromise; } +export interface IFolderQueryOptions { + folder: uri; + excludePattern?: IExpression; + fileEncoding?: string; +} + export interface IQueryOptions { - folderResources?: uri[]; extraFileResources?: uri[]; filePattern?: string; excludePattern?: IExpression; includePattern?: IExpression; + fileEncoding?: string; maxResults?: number; sortByScore?: boolean; cacheKey?: string; - fileEncoding?: string; useRipgrep?: boolean; disregardIgnoreFiles?: boolean; disregardExcludeSettings?: boolean; @@ -44,6 +49,7 @@ export interface IQueryOptions { export interface ISearchQuery extends IQueryOptions { type: QueryType; contentPattern?: IPatternInfo; + folderQueries?: IFolderQueryOptions[]; } export enum QueryType { diff --git a/src/vs/platform/statusbar/common/statusbar.ts b/src/vs/platform/statusbar/common/statusbar.ts index d42f792b801a3cc8b63b8fe0711b2e0f747e1619..a68317576e89478f7ef1a28575d6e1f3ac812703 100644 --- a/src/vs/platform/statusbar/common/statusbar.ts +++ b/src/vs/platform/statusbar/common/statusbar.ts @@ -7,7 +7,7 @@ import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; import { IDisposable } from 'vs/base/common/lifecycle'; -import { ThemeColor } from 'vs/editor/common/editorCommon'; +import { ThemeColor } from "vs/platform/theme/common/themeService"; export var IStatusbarService = createDecorator('statusbarService'); diff --git a/src/vs/platform/storage/common/storageService.ts b/src/vs/platform/storage/common/storageService.ts index d447bd0d18fd739c9292f3b25378bd83ef3ab6cb..da38c9355239492fe0d6f1d7a219fa810c5bdbb8 100644 --- a/src/vs/platform/storage/common/storageService.ts +++ b/src/vs/platform/storage/common/storageService.ts @@ -8,7 +8,7 @@ import types = require('vs/base/common/types'); import errors = require('vs/base/common/errors'); import strings = require('vs/base/common/strings'); import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; -import { IWorkspaceContextService, IWorkspace } from 'vs/platform/workspace/common/workspace'; +import { IWorkspace } from "vs/platform/workspace/common/workspace"; // Browser localStorage interface export interface IStorage { @@ -25,8 +25,8 @@ export class StorageService implements IStorageService { public _serviceBrand: any; private static COMMON_PREFIX = 'storage://'; - /*private*/ static GLOBAL_PREFIX = StorageService.COMMON_PREFIX + 'global/'; - private static WORKSPACE_PREFIX = StorageService.COMMON_PREFIX + 'workspace/'; + private static GLOBAL_PREFIX = `${StorageService.COMMON_PREFIX}global/`; + private static WORKSPACE_PREFIX = `${StorageService.COMMON_PREFIX}workspace/`; private static WORKSPACE_IDENTIFIER = 'workspaceIdentifier'; private static NO_WORKSPACE_IDENTIFIER = '__$noWorkspace__'; @@ -38,49 +38,44 @@ export class StorageService implements IStorageService { constructor( globalStorage: IStorage, workspaceStorage: IStorage, - @IWorkspaceContextService contextService: IWorkspaceContextService + workspace?: IWorkspace, + legacyWorkspaceId?: number ) { - const workspace = contextService.getWorkspace(); - this.globalStorage = globalStorage; this.workspaceStorage = workspaceStorage || globalStorage; // Calculate workspace storage key - this.workspaceKey = this.getWorkspaceKey(workspace); + this.workspaceKey = this.getWorkspaceKey(workspace ? workspace.id : void 0); // Make sure to delete all workspace storage if the workspace has been recreated meanwhile - const workspaceUniqueId: number = workspace ? workspace.uid : void 0; - if (types.isNumber(workspaceUniqueId)) { - this.cleanupWorkspaceScope(workspaceUniqueId, workspace.name); + // which is only possible if a id property is provided that we can check on + if (workspace && types.isNumber(legacyWorkspaceId)) { + this.cleanupWorkspaceScope(legacyWorkspaceId); } } - private getWorkspaceKey(workspace?: IWorkspace): string { - let workspaceUri: string = null; - if (workspace && workspace.resource) { - workspaceUri = workspace.resource.toString(); + private getWorkspaceKey(id?: string): string { + if (!id) { + return StorageService.NO_WORKSPACE_IDENTIFIER; } - return workspaceUri ? this.calculateWorkspaceKey(workspaceUri) : StorageService.NO_WORKSPACE_IDENTIFIER; - } - - private calculateWorkspaceKey(workspaceUrl: string): string { - const root = 'file:///'; - const index = workspaceUrl.indexOf(root); - if (index === 0) { - return strings.rtrim(workspaceUrl.substr(root.length), '/') + '/'; + // Special case file:// URIs: strip protocol from key to produce shorter key + const fileProtocol = 'file:///'; + if (id.indexOf(fileProtocol) === 0) { + id = id.substr(fileProtocol.length); } - return workspaceUrl; + // Always end with "/" + return `${strings.rtrim(id, '/')}/`; } - private cleanupWorkspaceScope(workspaceId: number, workspaceName: string): void { + private cleanupWorkspaceScope(workspaceUid: number): void { // Get stored identifier from storage const id = this.getInteger(StorageService.WORKSPACE_IDENTIFIER, StorageScope.WORKSPACE); // If identifier differs, assume the workspace got recreated and thus clean all storage for this workspace - if (types.isNumber(id) && workspaceId !== id) { + if (types.isNumber(id) && workspaceUid !== id) { const keyPrefix = this.toStorageKey('', StorageScope.WORKSPACE); const toDelete: string[] = []; const length = this.workspaceStorage.length; @@ -97,10 +92,6 @@ export class StorageService implements IStorageService { } } - if (toDelete.length > 0) { - console.warn('Clearing previous version of local storage for workspace ', workspaceName); - } - // Run the delete toDelete.forEach((keyToDelete) => { this.workspaceStorage.removeItem(keyToDelete); @@ -108,8 +99,8 @@ export class StorageService implements IStorageService { } // Store workspace identifier now - if (workspaceId !== id) { - this.store(StorageService.WORKSPACE_IDENTIFIER, workspaceId, StorageScope.WORKSPACE); + if (workspaceUid !== id) { + this.store(StorageService.WORKSPACE_IDENTIFIER, workspaceUid, StorageScope.WORKSPACE); } } @@ -199,7 +190,6 @@ export class StorageService implements IStorageService { } } -// In-Memory Local Storage Implementation export class InMemoryLocalStorage implements IStorage { private store: { [key: string]: string; }; diff --git a/src/vs/code/electron-main/storage.ts b/src/vs/platform/storage/node/storage.ts similarity index 94% rename from src/vs/code/electron-main/storage.ts rename to src/vs/platform/storage/node/storage.ts index d3f1351b6cca4610f0a818d50d512b1fde9de2f7..438a7af5b8d015bdc7d2502ac020498e418ee0ef 100644 --- a/src/vs/code/electron-main/storage.ts +++ b/src/vs/platform/storage/node/storage.ts @@ -30,7 +30,7 @@ export class StorageService implements IStorageService { this.dbPath = path.join(environmentService.userDataPath, 'storage.json'); } - getItem(key: string, defaultValue?: T): T { + public getItem(key: string, defaultValue?: T): T { if (!this.database) { this.database = this.load(); } @@ -43,7 +43,7 @@ export class StorageService implements IStorageService { return this.database[key]; } - setItem(key: string, data: any): void { + public setItem(key: string, data: any): void { if (!this.database) { this.database = this.load(); } @@ -59,7 +59,7 @@ export class StorageService implements IStorageService { this.save(); } - removeItem(key: string): void { + public removeItem(key: string): void { if (!this.database) { this.database = this.load(); } diff --git a/src/vs/platform/storage/test/storageService.test.ts b/src/vs/platform/storage/test/storageService.test.ts index 2765ef994c1300aa54010c105784ecee08398f00..19caaf99e98546d539c38df28f559b6ff0fd9f9a 100644 --- a/src/vs/platform/storage/test/storageService.test.ts +++ b/src/vs/platform/storage/test/storageService.test.ts @@ -6,25 +6,23 @@ 'use strict'; import * as assert from 'assert'; -import { clone } from 'vs/base/common/objects'; import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; import { StorageScope } from 'vs/platform/storage/common/storage'; -import { IWorkspaceContextService, WorkspaceContextService } from 'vs/platform/workspace/common/workspace'; +import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { StorageService, InMemoryLocalStorage } from 'vs/platform/storage/common/storageService'; -import { TestWorkspace } from 'vs/platform/workspace/test/common/testWorkspace'; +import { TestContextService } from 'vs/workbench/test/workbenchTestServices'; suite('Workbench StorageSevice', () => { - - let contextService, instantiationService; + let contextService: IWorkspaceContextService; + let instantiationService: TestInstantiationService; setup(() => { instantiationService = new TestInstantiationService(); - contextService = instantiationService.stub(IWorkspaceContextService, WorkspaceContextService); - instantiationService.stub(IWorkspaceContextService, 'getWorkspace', TestWorkspace); + contextService = instantiationService.stub(IWorkspaceContextService, new TestContextService()); }); test('Swap Data with undefined default value', () => { - let s = new StorageService(new InMemoryLocalStorage(), null, contextService); + let s = new StorageService(new InMemoryLocalStorage(), null, contextService.getWorkspace2()); s.swap('Monaco.IDE.Core.Storage.Test.swap', 'foobar', 'barfoo'); assert.strictEqual('foobar', s.get('Monaco.IDE.Core.Storage.Test.swap')); @@ -35,7 +33,7 @@ suite('Workbench StorageSevice', () => { }); test('Remove Data', () => { - let s = new StorageService(new InMemoryLocalStorage(), null, contextService); + let s = new StorageService(new InMemoryLocalStorage(), null, contextService.getWorkspace2()); s.store('Monaco.IDE.Core.Storage.Test.remove', 'foobar'); assert.strictEqual('foobar', s.get('Monaco.IDE.Core.Storage.Test.remove')); @@ -44,7 +42,7 @@ suite('Workbench StorageSevice', () => { }); test('Get Data, Integer, Boolean', () => { - let s = new StorageService(new InMemoryLocalStorage(), null, contextService); + let s = new StorageService(new InMemoryLocalStorage(), null, contextService.getWorkspace2()); assert.strictEqual(s.get('Monaco.IDE.Core.Storage.Test.get', StorageScope.GLOBAL, 'foobar'), 'foobar'); assert.strictEqual(s.get('Monaco.IDE.Core.Storage.Test.get', StorageScope.GLOBAL, ''), ''); @@ -78,14 +76,15 @@ suite('Workbench StorageSevice', () => { test('StorageSevice cleans up when workspace changes', () => { let storageImpl = new InMemoryLocalStorage(); - let s = new StorageService(storageImpl, null, contextService); + let time = new Date().getTime(); + let s = new StorageService(storageImpl, null, contextService.getWorkspace2(), time); s.store('key1', 'foobar'); s.store('key2', 'something'); s.store('wkey1', 'foo', StorageScope.WORKSPACE); s.store('wkey2', 'foo2', StorageScope.WORKSPACE); - s = new StorageService(storageImpl, null, contextService); + s = new StorageService(storageImpl, null, contextService.getWorkspace2(), time); assert.strictEqual(s.get('key1', StorageScope.GLOBAL), 'foobar'); assert.strictEqual(s.get('key1', StorageScope.WORKSPACE, null), null); @@ -94,10 +93,7 @@ suite('Workbench StorageSevice', () => { assert.strictEqual(s.get('wkey1', StorageScope.WORKSPACE), 'foo'); assert.strictEqual(s.get('wkey2', StorageScope.WORKSPACE), 'foo2'); - let ws: any = clone(TestWorkspace); - ws.uid = new Date().getTime() + 100; - instantiationService.stub(IWorkspaceContextService, 'getWorkspace', ws); - s = new StorageService(storageImpl, null, contextService); + s = new StorageService(storageImpl, null, contextService.getWorkspace2(), time + 100); assert.strictEqual(s.get('key1', StorageScope.GLOBAL), 'foobar'); assert.strictEqual(s.get('key1', StorageScope.WORKSPACE, null), null); diff --git a/src/vs/platform/telemetry/common/telemetry.ts b/src/vs/platform/telemetry/common/telemetry.ts index 983743b9205d0aeab9574faace54f8dc9a16f3e8..2e4a6f64022c4fc7b627a8038f7aa15ca17166f0 100644 --- a/src/vs/platform/telemetry/common/telemetry.ts +++ b/src/vs/platform/telemetry/common/telemetry.ts @@ -22,10 +22,8 @@ export interface ITelemetryData { } export interface ITelemetryExperiments { - showNewUserWatermark: boolean; - openUntitledFile: boolean; - enableWelcomePage: boolean; mergeQuickLinks: boolean; + showTaskDocumentation: boolean; } export interface ITelemetryService { diff --git a/src/vs/platform/telemetry/common/telemetryService.ts b/src/vs/platform/telemetry/common/telemetryService.ts index aa7e3f4a75458a7450bebe9000161cb3f468f116..edd480496c6c1029e079b6b11ad8dd916e4e8435 100644 --- a/src/vs/platform/telemetry/common/telemetryService.ts +++ b/src/vs/platform/telemetry/common/telemetryService.ts @@ -15,7 +15,7 @@ import { IConfigurationRegistry, Extensions } from 'vs/platform/configuration/co import { TPromise } from 'vs/base/common/winjs.base'; import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { cloneAndChange, mixin } from 'vs/base/common/objects'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; export interface ITelemetryServiceConfig { appender: ITelemetryAppender; diff --git a/src/vs/platform/telemetry/common/telemetryUtils.ts b/src/vs/platform/telemetry/common/telemetryUtils.ts index e3370d3d8655afbf047fac3bc729083fa33679aa..315690824d8122e9d1d0a79df532061f4e214e3f 100644 --- a/src/vs/platform/telemetry/common/telemetryUtils.ts +++ b/src/vs/platform/telemetry/common/telemetryUtils.ts @@ -13,17 +13,12 @@ import { ConfigurationSource, IConfigurationService } from 'vs/platform/configur import { IKeybindingService, KeybindingSource } from 'vs/platform/keybinding/common/keybinding'; import { ILifecycleService, ShutdownReason } from 'vs/platform/lifecycle/common/lifecycle'; import { IStorageService } from 'vs/platform/storage/common/storage'; -import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { ITelemetryService, ITelemetryExperiments, ITelemetryInfo, ITelemetryData } from 'vs/platform/telemetry/common/telemetry'; import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -import { StorageService } from 'vs/platform/storage/common/storageService'; -import * as objects from 'vs/base/common/objects'; export const defaultExperiments: ITelemetryExperiments = { - showNewUserWatermark: false, - openUntitledFile: true, - enableWelcomePage: true, mergeQuickLinks: false, + showTaskDocumentation: true }; export const NullTelemetryService = { @@ -46,43 +41,22 @@ export const NullTelemetryService = { }; export function loadExperiments(accessor: ServicesAccessor): ITelemetryExperiments { - const contextService = accessor.get(IWorkspaceContextService); const storageService = accessor.get(IStorageService); const configurationService = accessor.get(IConfigurationService); - updateExperimentsOverrides(configurationService); - configurationService.onDidUpdateConfiguration(e => updateExperimentsOverrides(configurationService)); - let { - showNewUserWatermark, - openUntitledFile, - enableWelcomePage, mergeQuickLinks, - } = splitExperimentsRandomness(); - - const newUserDuration = 24 * 60 * 60 * 1000; - const firstSessionDate = storageService.get('telemetry.firstSessionDate'); - const isNewUser = !firstSessionDate || Date.now() - Date.parse(firstSessionDate) < newUserDuration; - if (!isNewUser || contextService.hasWorkspace()) { - showNewUserWatermark = defaultExperiments.showNewUserWatermark; - openUntitledFile = defaultExperiments.openUntitledFile; - } + showTaskDocumentation, + } = splitExperimentsRandomness(storageService); return applyOverrides({ - showNewUserWatermark, - openUntitledFile, - enableWelcomePage, mergeQuickLinks, - }); + showTaskDocumentation, + }, configurationService); } -export function isWelcomePageEnabled() { - const overrides = getExperimentsOverrides(); - return 'enableWelcomePage' in overrides ? overrides.enableWelcomePage : splitExperimentsRandomness().enableWelcomePage; -} - -function applyOverrides(experiments: ITelemetryExperiments): ITelemetryExperiments { - const experimentsConfig = getExperimentsOverrides(); +function applyOverrides(experiments: ITelemetryExperiments, configurationService: IConfigurationService): ITelemetryExperiments { + const experimentsConfig = getExperimentsOverrides(configurationService); Object.keys(experiments).forEach(key => { if (key in experimentsConfig) { experiments[key] = experimentsConfig[key]; @@ -91,26 +65,25 @@ function applyOverrides(experiments: ITelemetryExperiments): ITelemetryExperimen return experiments; } -function splitExperimentsRandomness(): ITelemetryExperiments { - const random1 = getExperimentsRandomness(); - const [random2, showNewUserWatermark] = splitRandom(random1); - const [random3, openUntitledFile] = splitRandom(random2); +function splitExperimentsRandomness(storageService: IStorageService): ITelemetryExperiments { + const random1 = getExperimentsRandomness(storageService); + const [random2, showTaskDocumentation] = splitRandom(random1); + const [random3, /* openUntitledFile */] = splitRandom(random2); const [random4, mergeQuickLinks] = splitRandom(random3); - const [, enableWelcomePage] = splitRandom(random4); + // tslint:disable-next-line:no-unused-variable (https://github.com/Microsoft/TypeScript/issues/16628) + const [random5, /* enableWelcomePage */] = splitRandom(random4); return { - showNewUserWatermark, - openUntitledFile, - enableWelcomePage, mergeQuickLinks, + showTaskDocumentation, }; } -function getExperimentsRandomness() { - const key = StorageService.GLOBAL_PREFIX + 'experiments.randomness'; - let valueString = window.localStorage.getItem(key); +function getExperimentsRandomness(storageService: IStorageService) { + const key = 'experiments.randomness'; + let valueString = storageService.get(key); if (!valueString) { valueString = Math.random().toString(); - window.localStorage.setItem(key, valueString); + storageService.store(key, valueString); } return parseFloat(valueString); @@ -122,20 +95,9 @@ function splitRandom(random: number): [number, boolean] { return [scaled - i, i === 1]; } -const experimentsOverridesKey = StorageService.GLOBAL_PREFIX + 'experiments.overrides'; - -function getExperimentsOverrides(): ITelemetryExperiments { - const valueString = window.localStorage.getItem(experimentsOverridesKey); - return valueString ? JSON.parse(valueString) : {}; -} - -function updateExperimentsOverrides(configurationService: IConfigurationService) { - const storageOverrides = getExperimentsOverrides(); +function getExperimentsOverrides(configurationService: IConfigurationService): ITelemetryExperiments { const config: any = configurationService.getConfiguration('telemetry'); - const configOverrides = config && config.experiments || {}; - if (!objects.equals(storageOverrides, configOverrides)) { - window.localStorage.setItem(experimentsOverridesKey, JSON.stringify(configOverrides)); - } + return config && config.experiments || {}; } export interface ITelemetryAppender { @@ -190,82 +152,98 @@ export function telemetryURIDescriptor(uri: URI): URIDescriptor { * Only add settings that cannot contain any personal/private information of users (PII). */ const configurationValueWhitelist = [ - 'window.zoomLevel', - 'editor.fontSize', + 'editor.tabCompletion', 'editor.fontFamily', + 'editor.fontWeight', + 'editor.fontSize', + 'editor.lineHeight', + 'editor.letterSpacing', + 'editor.lineNumbers', + 'editor.rulers', + 'editor.wordSeparators', 'editor.tabSize', + 'editor.insertSpaces', + 'editor.detectIndentation', + 'editor.roundedSelection', + 'editor.scrollBeyondLastLine', + 'editor.minimap.enabled', + 'editor.minimap.renderCharacters', + 'editor.minimap.maxColumn', + 'editor.find.seedSearchStringFromSelection', + 'editor.find.autoFindInSelection', + 'editor.wordWrap', + 'editor.wordWrapColumn', + 'editor.wrappingIndent', + 'editor.mouseWheelScrollSensitivity', + 'editor.multiCursorModifier', + 'editor.quickSuggestions', + 'editor.quickSuggestionsDelay', + 'editor.parameterHints', + 'editor.autoClosingBrackets', + 'editor.autoIndent', + 'editor.formatOnType', + 'editor.formatOnPaste', + 'editor.suggestOnTriggerCharacters', + 'editor.acceptSuggestionOnEnter', + 'editor.acceptSuggestionOnCommitCharacter', + 'editor.snippetSuggestions', + 'editor.emptySelectionClipboard', + 'editor.wordBasedSuggestions', + 'editor.suggestFontSize', + 'editor.suggestLineHeight', + 'editor.selectionHighlight', + 'editor.occurrencesHighlight', + 'editor.overviewRulerLanes', + 'editor.overviewRulerBorder', + 'editor.cursorBlinking', + 'editor.cursorStyle', + 'editor.mouseWheelZoom', + 'editor.fontLigatures', + 'editor.hideCursorInOverviewRuler', + 'editor.renderWhitespace', + 'editor.renderControlCharacters', + 'editor.renderIndentGuides', + 'editor.renderLineHighlight', + 'editor.codeLens', + 'editor.folding', + 'editor.showFoldingControls', + 'editor.matchBrackets', + 'editor.glyphMargin', + 'editor.useTabStops', + 'editor.trimAutoWhitespace', + 'editor.stablePeek', + 'editor.dragAndDrop', + 'editor.formatOnSave', + + 'window.zoomLevel', 'files.autoSave', 'files.hotExit', 'typescript.check.tscVersion', - 'editor.renderWhitespace', - 'editor.cursorBlinking', - 'editor.cursorStyle', 'files.associations', 'workbench.statusBar.visible', - 'editor.wordWrap', - 'editor.wordWrapColumn', - 'editor.insertSpaces', - 'editor.renderIndentGuides', 'files.trimTrailingWhitespace', 'git.confirmSync', - 'editor.rulers', 'workbench.sideBar.location', - 'editor.fontLigatures', - 'editor.wordWrap', - 'editor.lineHeight', - 'editor.detectIndentation', - 'editor.formatOnType', - 'editor.formatOnSave', - 'editor.formatOnPaste', - 'editor.dragAndDrop', 'window.openFilesInNewWindow', 'javascript.validate.enable', - 'editor.mouseWheelZoom', - 'editor.fontWeight', - 'editor.scrollBeyondLastLine', - 'editor.lineNumbers', - 'editor.letterSpacing', - 'editor.wrappingIndent', - 'editor.renderControlCharacters', - 'editor.autoClosingBrackets', 'window.reopenFolders', + 'window.restoreWindows', 'extensions.autoUpdate', - 'editor.tabCompletion', 'files.eol', 'explorer.openEditors.visible', 'workbench.editor.enablePreview', 'files.autoSaveDelay', - 'editor.roundedSelection', - 'editor.quickSuggestions', - 'editor.acceptSuggestionOnEnter', - 'editor.acceptSuggestionOnCommitCharacter', 'workbench.editor.showTabs', 'files.encoding', 'files.autoGuessEncoding', - 'editor.quickSuggestionsDelay', - 'editor.snippetSuggestions', - 'editor.selectionHighlight', - 'editor.occurrencesHighlight', - 'editor.glyphMargin', - 'editor.wordSeparators', - 'editor.mouseWheelScrollSensitivity', - 'editor.suggestOnTriggerCharacters', 'git.enabled', 'http.proxyStrictSSL', 'terminal.integrated.fontFamily', - 'editor.overviewRulerLanes', - 'editor.overviewRulerBorder', - 'editor.wordBasedSuggestions', - 'editor.hideCursorInOverviewRuler', - 'editor.trimAutoWhitespace', - 'editor.folding', - 'editor.matchBrackets', 'workbench.editor.enablePreviewFromQuickOpen', 'workbench.editor.swipeToNavigate', 'php.builtInCompletions.enable', 'php.validate.enable', 'php.validate.run', - 'editor.parameterHints', 'workbench.welcome.enabled', ]; diff --git a/src/vs/platform/telemetry/test/electron-browser/commonProperties.test.ts b/src/vs/platform/telemetry/test/electron-browser/commonProperties.test.ts index 54bd6cb56184bab6f2c38ab9b63d6880f596b6a2..a504489d833b84b7facd8b2efd30a330cdadb1c3 100644 --- a/src/vs/platform/telemetry/test/electron-browser/commonProperties.test.ts +++ b/src/vs/platform/telemetry/test/electron-browser/commonProperties.test.ts @@ -6,9 +6,7 @@ import * as assert from 'assert'; import { TPromise } from 'vs/base/common/winjs.base'; -import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; import { resolveWorkbenchCommonProperties } from 'vs/platform/telemetry/node/workbenchCommonProperties'; -import { IWorkspaceContextService, WorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { StorageService, InMemoryLocalStorage } from 'vs/platform/storage/common/storageService'; import { TestWorkspace } from 'vs/platform/workspace/test/common/testWorkspace'; @@ -19,10 +17,7 @@ suite('Telemetry - common properties', function () { let storageService; setup(() => { - let instantiationService = new TestInstantiationService(); - let contextService = instantiationService.stub(IWorkspaceContextService, WorkspaceContextService); - instantiationService.stub(IWorkspaceContextService, 'getWorkspace', TestWorkspace); - storageService = new StorageService(new InMemoryLocalStorage(), null, contextService); + storageService = new StorageService(new InMemoryLocalStorage(), null, TestWorkspace); }); test('default', function () { diff --git a/src/vs/platform/telemetry/test/electron-browser/telemetryService.test.ts b/src/vs/platform/telemetry/test/electron-browser/telemetryService.test.ts index 0f6157ba5e6c0736b14f2a6f068b1cee9877229e..099d7bec0885b96321093b3782611ceb656f76de 100644 --- a/src/vs/platform/telemetry/test/electron-browser/telemetryService.test.ts +++ b/src/vs/platform/telemetry/test/electron-browser/telemetryService.test.ts @@ -263,7 +263,8 @@ suite('TelemetryService', () => { // })); test('Handle global errors', sinon.test(function () { - let errorStub = this.stub(window, 'onerror'); + let errorStub = sinon.stub(); + window.onerror = errorStub; let testAppender = new TestTelemetryAppender(); let service = new TelemetryService({ appender: testAppender }, undefined); @@ -289,7 +290,8 @@ suite('TelemetryService', () => { })); test('Uncaught Error Telemetry removes PII from filename', sinon.test(function () { - let errorStub = this.stub(window, 'onerror'); + let errorStub = sinon.stub(); + window.onerror = errorStub; let settings = new ErrorTestingSettings(); let testAppender = new TestTelemetryAppender(); let service = new TelemetryService({ appender: testAppender }, undefined); @@ -347,7 +349,8 @@ suite('TelemetryService', () => { })); test('Uncaught Error Telemetry removes PII', sinon.test(function () { - let errorStub = this.stub(window, 'onerror'); + let errorStub = sinon.stub(); + window.onerror = errorStub; let settings = new ErrorTestingSettings(); let testAppender = new TestTelemetryAppender(); let service = new TelemetryService({ appender: testAppender }, undefined); @@ -407,7 +410,8 @@ suite('TelemetryService', () => { })); test('Uncaught Error Telemetry removes PII but preserves Code file path', sinon.test(function () { - let errorStub = this.stub(window, 'onerror'); + let errorStub = sinon.stub(); + window.onerror = errorStub; let settings = new ErrorTestingSettings(); let testAppender = new TestTelemetryAppender(); let service = new TelemetryService({ appender: testAppender }, undefined); @@ -469,7 +473,8 @@ suite('TelemetryService', () => { })); test('Uncaught Error Telemetry removes PII but preserves Code file path when PIIPath is configured', sinon.test(function () { - let errorStub = this.stub(window, 'onerror'); + let errorStub = sinon.stub(); + window.onerror = errorStub; let settings = new ErrorTestingSettings(); let testAppender = new TestTelemetryAppender(); let service = new TelemetryService({ appender: testAppender, piiPaths: [settings.personalInfo + '/resources/app/'] }, undefined); @@ -531,7 +536,8 @@ suite('TelemetryService', () => { })); test('Uncaught Error Telemetry removes PII but preserves Missing Model error message', sinon.test(function () { - let errorStub = this.stub(window, 'onerror'); + let errorStub = sinon.stub(); + window.onerror = errorStub; let settings = new ErrorTestingSettings(); let testAppender = new TestTelemetryAppender(); let service = new TelemetryService({ appender: testAppender }, undefined); @@ -598,7 +604,8 @@ suite('TelemetryService', () => { Errors.setUnexpectedErrorHandler(() => { }); try { - let errorStub = this.stub(window, 'onerror'); + let errorStub = sinon.stub(); + window.onerror = errorStub; let settings = new ErrorTestingSettings(); let testAppender = new TestTelemetryAppender(); let service = new TelemetryService({ appender: testAppender }, undefined); @@ -674,6 +681,9 @@ suite('TelemetryService', () => { enableTelemetry }; }, + getConfigurationData(): any { + return null; + }, reloadConfiguration() { return TPromise.as(this.getConfiguration()); }, @@ -681,10 +691,13 @@ suite('TelemetryService', () => { return { value: getConfigurationValue(this.getConfiguration(), key), default: getConfigurationValue(this.getConfiguration(), key), - user: getConfigurationValue(this.getConfiguration(), key) + user: getConfigurationValue(this.getConfiguration(), key), + workspace: null, + folder: null }; }, - keys() { return { default: [], user: [] }; }, + keys() { return { default: [], user: [], workspace: [] }; }, + values() { return {}; }, onDidUpdateConfiguration: emitter.event }); diff --git a/src/vs/platform/theme/common/colorRegistry.ts b/src/vs/platform/theme/common/colorRegistry.ts index bc3da9fed1680e93679a7c2576b75cca12a99957..7efeec4794ea6ef48222eccdccd84c98cab2ae3f 100644 --- a/src/vs/platform/theme/common/colorRegistry.ts +++ b/src/vs/platform/theme/common/colorRegistry.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ 'use strict'; -import platform = require('vs/platform/platform'); +import platform = require('vs/platform/registry/common/platform'); import { IJSONSchema } from 'vs/base/common/jsonSchema'; import { Color, RGBA } from 'vs/base/common/color'; import { ITheme } from 'vs/platform/theme/common/themeService'; @@ -137,7 +137,7 @@ export const focusBorder = registerColor('focusBorder', { dark: Color.fromHex('# export const contrastBorder = registerColor('contrastBorder', { light: null, dark: null, hc: '#6FC3DF' }, nls.localize('contrastBorder', "An extra border around elements to separate them from others for greater contrast.")); export const activeContrastBorder = registerColor('contrastActiveBorder', { light: null, dark: null, hc: focusBorder }, nls.localize('activeContrastBorder', "An extra border around active elements to separate them from others for greater contrast.")); -export const selectionBackground = registerColor('selection.background', { light: null, dark: null, hc: null }, nls.localize('selectionBackground', "The background color of text selections in the workbench (e.g. for input fields or text areas). Note that this does not apply to selections within the editor and the terminal.")); +export const selectionBackground = registerColor('selection.background', { light: null, dark: null, hc: null }, nls.localize('selectionBackground', "The background color of text selections in the workbench (e.g. for input fields or text areas). Note that this does not apply to selections within the editor.")); // ------ text colors @@ -213,15 +213,16 @@ export const editorForeground = registerColor('editor.foreground', { light: '#33 * Editor widgets */ export const editorWidgetBackground = registerColor('editorWidget.background', { dark: '#2D2D30', light: '#EFEFF2', hc: '#0C141F' }, nls.localize('editorWidgetBackground', 'Background color of editor widgets, such as find/replace.')); -export const editorWidgetBorder = registerColor('editorWidget.border', { dark: '#454545', light: '#C8C8C8', hc: contrastBorder }, nls.localize('editorWidgetBorder', 'Border color of the editor widget.')); +export const editorWidgetBorder = registerColor('editorWidget.border', { dark: '#454545', light: '#C8C8C8', hc: contrastBorder }, nls.localize('editorWidgetBorder', 'Border color of editor widgets. The color is only used if the widget chooses to have a border and if the color is not overridden by a widget.')); /** * Editor selection colors. */ -export const editorSelection = registerColor('editor.selectionBackground', { light: '#ADD6FF', dark: '#264F78', hc: '#f3f518' }, nls.localize('editorSelection', "Color of the editor selection.")); -export const editorInactiveSelection = registerColor('editor.inactiveSelectionBackground', { light: transparent(editorSelection, 0.5), dark: transparent(editorSelection, 0.5), hc: null }, nls.localize('editorInactiveSelection', "Color of the selection in an inactive editor.")); -export const editorSelectionHighlight = registerColor('editor.selectionHighlightBackground', { light: lessProminent(editorSelection, editorBackground, 0.3, 0.6), dark: lessProminent(editorSelection, editorBackground, 0.3, 0.6), hc: null }, nls.localize('editorSelectionHighlight', 'Color for regions with the same content as the selection.')); +export const editorSelectionBackground = registerColor('editor.selectionBackground', { light: '#ADD6FF', dark: '#264F78', hc: '#f3f518' }, nls.localize('editorSelectionBackground', "Color of the editor selection.")); +export const editorSelectionForeground = registerColor('editor.selectionForeground', { light: null, dark: null, hc: '#000000' }, nls.localize('editorSelectionForeground', "Color of the selected text for high contrast.")); +export const editorInactiveSelection = registerColor('editor.inactiveSelectionBackground', { light: transparent(editorSelectionBackground, 0.5), dark: transparent(editorSelectionBackground, 0.5), hc: transparent(editorSelectionBackground, 0.5) }, nls.localize('editorInactiveSelection', "Color of the selection in an inactive editor.")); +export const editorSelectionHighlight = registerColor('editor.selectionHighlightBackground', { light: lessProminent(editorSelectionBackground, editorBackground, 0.3, 0.6), dark: lessProminent(editorSelectionBackground, editorBackground, 0.3, 0.6), hc: null }, nls.localize('editorSelectionHighlight', 'Color for regions with the same content as the selection.')); /** * Editor find match colors. @@ -254,6 +255,30 @@ export const diffRemoved = registerColor('diffEditor.removedTextBackground', { d export const diffInsertedOutline = registerColor('diffEditor.insertedTextBorder', { dark: null, light: null, hc: '#33ff2eff' }, nls.localize('diffEditorInsertedOutline', 'Outline color for the text that got inserted.')); export const diffRemovedOutline = registerColor('diffEditor.removedTextBorder', { dark: null, light: null, hc: '#FF008F' }, nls.localize('diffEditorRemovedOutline', 'Outline color for text that got removed.')); +/** + * Merge-conflict colors + */ + +const headerTransparency = 0.5; +const currentBaseColor = Color.fromHex('#40C8AE').transparent(headerTransparency); +const incomingBaseColor = Color.fromHex('#40A6FF').transparent(headerTransparency); +const commonBaseColor = Color.fromHex('#606060').transparent(0.4); +const contentTransparency = 0.4; +const rulerTransparency = 1; + +export const mergeCurrentHeaderBackground = registerColor('merge.currentHeaderBackground', { dark: currentBaseColor, light: currentBaseColor, hc: null }, nls.localize('mergeCurrentHeaderBackground', 'Current header background in inline merge-conflicts.')); +export const mergeCurrentContentBackground = registerColor('merge.currentContentBackground', { dark: transparent(mergeCurrentHeaderBackground, contentTransparency), light: transparent(mergeCurrentHeaderBackground, contentTransparency), hc: transparent(mergeCurrentHeaderBackground, contentTransparency) }, nls.localize('mergeCurrentContentBackground', 'Current content background in inline merge-conflicts.')); +export const mergeIncomingHeaderBackground = registerColor('merge.incomingHeaderBackground', { dark: incomingBaseColor, light: incomingBaseColor, hc: null }, nls.localize('mergeIncomingHeaderBackground', 'Incoming header background in inline merge-conflicts.')); +export const mergeIncomingContentBackground = registerColor('merge.incomingContentBackground', { dark: transparent(mergeIncomingHeaderBackground, contentTransparency), light: transparent(mergeIncomingHeaderBackground, contentTransparency), hc: transparent(mergeIncomingHeaderBackground, contentTransparency) }, nls.localize('mergeIncomingContentBackground', 'Incoming content background in inline merge-conflicts.')); +export const mergeCommonHeaderBackground = registerColor('merge.commonHeaderBackground', { dark: commonBaseColor, light: commonBaseColor, hc: null }, nls.localize('mergeCommonHeaderBackground', 'Common ancestor header background in inline merge-conflicts.')); +export const mergeCommonContentBackground = registerColor('merge.commonContentBackground', { dark: transparent(mergeCommonHeaderBackground, contentTransparency), light: transparent(mergeCommonHeaderBackground, contentTransparency), hc: transparent(mergeCommonHeaderBackground, contentTransparency) }, nls.localize('mergeCommonContentBackground', 'Common ancester content background in inline merge-conflicts.')); + +export const mergeBorder = registerColor('merge.border', { dark: null, light: null, hc: '#C3DF6F' }, nls.localize('mergeBorder', 'Border color on headers and the splitter in inline merge-conflicts.')); + +export const overviewRulerCurrentContentForeground = registerColor('editorOverviewRuler.currentContentForeground', { dark: transparent(mergeCurrentHeaderBackground, rulerTransparency), light: transparent(mergeCurrentHeaderBackground, rulerTransparency), hc: mergeBorder }, nls.localize('overviewRulerCurrentContentForeground', 'Current overview ruler foreground for inline merge-conflicts.')); +export const overviewRulerIncomingContentForeground = registerColor('editorOverviewRuler.incomingContentForeground', { dark: transparent(mergeIncomingHeaderBackground, rulerTransparency), light: transparent(mergeIncomingHeaderBackground, rulerTransparency), hc: mergeBorder }, nls.localize('overviewRulerIncomingContentForeground', 'Incoming overview ruler foreground for inline merge-conflicts.')); +export const overviewRulerCommonContentForeground = registerColor('editorOverviewRuler.commonContentForeground', { dark: transparent(mergeCommonHeaderBackground, rulerTransparency), light: transparent(mergeCommonHeaderBackground, rulerTransparency), hc: mergeBorder }, nls.localize('overviewRulerCommonContentForeground', 'Common ancestor overview ruler foreground for inline merge-conflicts.')); + // ----- color functions export function darken(colorValue: ColorValue, factor: number): ColorFunction { @@ -286,6 +311,18 @@ export function transparent(colorValue: ColorValue, factor: number): ColorFuncti }; } +export function oneOf(...colorValues: ColorValue[]): ColorFunction { + return (theme) => { + for (let colorValue of colorValues) { + let color = resolveColorValue(colorValue, theme); + if (color) { + return color; + } + } + return null; + }; +} + function lessProminent(colorValue: ColorValue, backgroundColorValue: ColorValue, factor: number, transparency: number): ColorFunction { return (theme) => { let from = resolveColorValue(colorValue, theme); diff --git a/src/vs/platform/theme/common/styler.ts b/src/vs/platform/theme/common/styler.ts index 35d4baee887bd25547505bce3936fa0c6f444043..b37a8542d45d6e3699984b273b00cf0ee0fc3135 100644 --- a/src/vs/platform/theme/common/styler.ts +++ b/src/vs/platform/theme/common/styler.ts @@ -8,7 +8,6 @@ import { ITheme, IThemeService } from 'vs/platform/theme/common/themeService'; import { inputBackground, inputForeground, ColorIdentifier, selectForeground, selectBackground, selectBorder, inputBorder, foreground, editorBackground, contrastBorder, inputActiveOptionBorder, listFocusBackground, listFocusForeground, listActiveSelectionBackground, listActiveSelectionForeground, listInactiveSelectionForeground, listInactiveSelectionBackground, listHoverBackground, listHoverForeground, listDropBackground, pickerGroupBorder, pickerGroupForeground, widgetShadow, inputValidationInfoBorder, inputValidationInfoBackground, inputValidationWarningBorder, inputValidationWarningBackground, inputValidationErrorBorder, inputValidationErrorBackground, activeContrastBorder, buttonForeground, buttonBackground, buttonHoverBackground, ColorFunction, lighten, badgeBackground, badgeForeground, progressBarBackground } from 'vs/platform/theme/common/colorRegistry'; import { IDisposable } from 'vs/base/common/lifecycle'; -import { SIDE_BAR_SECTION_HEADER_BACKGROUND, SIDE_BAR_SECTION_HEADER_FOREGROUND } from 'vs/workbench/common/theme'; export type styleFn = (colors: { [name: string]: ColorIdentifier }) => void; @@ -16,7 +15,7 @@ export interface IThemable { style: styleFn; } -function doAttachStyler(themeService: IThemeService, optionsMapping: { [optionsKey: string]: ColorIdentifier | ColorFunction }, widgetOrCallback: IThemable | styleFn): IDisposable { +export function attachStyler(themeService: IThemeService, optionsMapping: { [optionsKey: string]: ColorIdentifier | ColorFunction }, widgetOrCallback: IThemable | styleFn): IDisposable { function applyStyles(theme: ITheme): void { const styles = Object.create(null); for (let key in optionsMapping) { @@ -41,7 +40,7 @@ function doAttachStyler(themeService: IThemeService, optionsMapping: { [optionsK } export function attachCheckboxStyler(widget: IThemable, themeService: IThemeService, style?: { inputActiveOptionBorderColor?: ColorIdentifier }): IDisposable { - return doAttachStyler(themeService, { + return attachStyler(themeService, { inputActiveOptionBorder: (style && style.inputActiveOptionBorderColor) || inputActiveOptionBorder }, widget); } @@ -51,7 +50,7 @@ export function attachBadgeStyler(widget: IThemable, themeService: IThemeService badgeBackground?: ColorIdentifier, badgeForeground?: ColorIdentifier }): IDisposable { - return doAttachStyler(themeService, { + return attachStyler(themeService, { badgeBackground: (style && style.badgeBackground) || badgeBackground, badgeForeground: (style && style.badgeForeground) || badgeForeground, badgeBorder: contrastBorder @@ -70,7 +69,7 @@ export function attachInputBoxStyler(widget: IThemable, themeService: IThemeServ inputValidationErrorBorder?: ColorIdentifier, inputValidationErrorBackground?: ColorIdentifier }): IDisposable { - return doAttachStyler(themeService, { + return attachStyler(themeService, { inputBackground: (style && style.inputBackground) || inputBackground, inputForeground: (style && style.inputForeground) || inputForeground, inputBorder: (style && style.inputBorder) || inputBorder, @@ -84,7 +83,7 @@ export function attachInputBoxStyler(widget: IThemable, themeService: IThemeServ } export function attachSelectBoxStyler(widget: IThemable, themeService: IThemeService, style?: { selectBackground?: ColorIdentifier, selectForeground?: ColorIdentifier, selectBorder?: ColorIdentifier }): IDisposable { - return doAttachStyler(themeService, { + return attachStyler(themeService, { selectBackground: (style && style.selectBackground) || selectBackground, selectForeground: (style && style.selectForeground) || selectForeground, selectBorder: (style && style.selectBorder) || selectBorder @@ -104,7 +103,7 @@ export function attachFindInputBoxStyler(widget: IThemable, themeService: ITheme inputValidationErrorBorder?: ColorIdentifier, inputValidationErrorBackground?: ColorIdentifier }): IDisposable { - return doAttachStyler(themeService, { + return attachStyler(themeService, { inputBackground: (style && style.inputBackground) || inputBackground, inputForeground: (style && style.inputForeground) || inputForeground, inputBorder: (style && style.inputBorder) || inputBorder, @@ -150,7 +149,7 @@ export function attachQuickOpenStyler(widget: IThemable, themeService: IThemeSer listSelectionOutline?: ColorIdentifier, listHoverOutline?: ColorIdentifier }): IDisposable { - return doAttachStyler(themeService, { + return attachStyler(themeService, { foreground: (style && style.foreground) || foreground, background: (style && style.background) || editorBackground, borderColor: style && style.borderColor || contrastBorder, @@ -202,7 +201,7 @@ export function attachListStyler(widget: IThemable, themeService: IThemeService, listSelectionOutline?: ColorIdentifier, listHoverOutline?: ColorIdentifier, }): IDisposable { - return doAttachStyler(themeService, { + return attachStyler(themeService, { listFocusBackground: (style && style.listFocusBackground) || listFocusBackground, listFocusForeground: (style && style.listFocusForeground) || listFocusForeground, listActiveSelectionBackground: (style && style.listActiveSelectionBackground) || lighten(listActiveSelectionBackground, 0.1), @@ -222,16 +221,8 @@ export function attachListStyler(widget: IThemable, themeService: IThemeService, }, widget); } -export function attachHeaderViewStyler(widget: IThemable, themeService: IThemeService, options?: { noContrastBorder?: boolean }): IDisposable { - return doAttachStyler(themeService, { - headerForeground: SIDE_BAR_SECTION_HEADER_FOREGROUND, - headerBackground: SIDE_BAR_SECTION_HEADER_BACKGROUND, - headerHighContrastBorder: (options && options.noContrastBorder) ? null : contrastBorder - }, widget); -} - export function attachButtonStyler(widget: IThemable, themeService: IThemeService, style?: { buttonForeground?: ColorIdentifier, buttonBackground?: ColorIdentifier, buttonHoverBackground?: ColorIdentifier }): IDisposable { - return doAttachStyler(themeService, { + return attachStyler(themeService, { buttonForeground: (style && style.buttonForeground) || buttonForeground, buttonBackground: (style && style.buttonBackground) || buttonBackground, buttonHoverBackground: (style && style.buttonHoverBackground) || buttonHoverBackground, @@ -240,11 +231,11 @@ export function attachButtonStyler(widget: IThemable, themeService: IThemeServic } export function attachProgressBarStyler(widget: IThemable, themeService: IThemeService, style?: { progressBarBackground?: ColorIdentifier }): IDisposable { - return doAttachStyler(themeService, { + return attachStyler(themeService, { progressBarBackground: (style && style.progressBarBackground) || progressBarBackground }, widget); } export function attachStylerCallback(themeService: IThemeService, colors: { [name: string]: ColorIdentifier }, callback: styleFn): IDisposable { - return doAttachStyler(themeService, colors, callback); + return attachStyler(themeService, colors, callback); } \ No newline at end of file diff --git a/src/vs/platform/theme/common/themeService.ts b/src/vs/platform/theme/common/themeService.ts index 10305538863d47fa65c9a1cd4465909f2f215ca6..bad94658abd8190e3f5b6327964d282a8bdb225a 100644 --- a/src/vs/platform/theme/common/themeService.ts +++ b/src/vs/platform/theme/common/themeService.ts @@ -7,12 +7,16 @@ import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; import { Color } from 'vs/base/common/color'; import { IDisposable } from 'vs/base/common/lifecycle'; -import platform = require('vs/platform/platform'); +import platform = require('vs/platform/registry/common/platform'); import { ColorIdentifier } from 'vs/platform/theme/common/colorRegistry'; import Event, { Emitter } from 'vs/base/common/event'; export let IThemeService = createDecorator('themeService'); +export interface ThemeColor { + id: string; +} + // base themes export const DARK: ThemeType = 'dark'; export const LIGHT: ThemeType = 'light'; diff --git a/src/vs/platform/theme/test/common/testThemeService.ts b/src/vs/platform/theme/test/common/testThemeService.ts new file mode 100644 index 0000000000000000000000000000000000000000..358c842250ea9e27a90e1489bf92486c4efe18fc --- /dev/null +++ b/src/vs/platform/theme/test/common/testThemeService.ts @@ -0,0 +1,56 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +'use strict'; + +import Event, { Emitter } from 'vs/base/common/event'; +import { IThemeService, ITheme, DARK } from 'vs/platform/theme/common/themeService'; +import { Color } from 'vs/base/common/color'; + +export class TestTheme implements ITheme { + + constructor(private colors: { [id: string]: string; } = {}, public type = DARK) { + } + + getColor(color: string, useDefault?: boolean): Color { + let value = this.colors[color]; + if (value) { + return Color.fromHex(value); + } + return void 0; + } + + defines(color: string): boolean { + throw new Error('Method not implemented.'); + } +} + +export class TestThemeService implements IThemeService { + + _serviceBrand: any; + _theme: ITheme; + _onThemeChange = new Emitter(); + + constructor(theme = new TestTheme()) { + this._theme = theme; + } + + getTheme(): ITheme { + return this._theme; + } + + setTheme(theme: ITheme) { + this._theme = theme; + this.fireThemeChange(); + } + + fireThemeChange() { + this._onThemeChange.fire(this._theme); + } + + public get onThemeChange(): Event { + return this._onThemeChange.event; + } +} diff --git a/src/vs/platform/update/common/updateIpc.ts b/src/vs/platform/update/common/updateIpc.ts index 2076719e98a9b1a5a23ca0d77e3cd7acfc9eba83..0dd76ca51f65a0cd4d2dbf12e8887a3b9b75d35e 100644 --- a/src/vs/platform/update/common/updateIpc.ts +++ b/src/vs/platform/update/common/updateIpc.ts @@ -7,7 +7,8 @@ import { TPromise } from 'vs/base/common/winjs.base'; import { IChannel, eventToCall, eventFromCall } from 'vs/base/parts/ipc/common/ipc'; -import Event from 'vs/base/common/event'; +import Event, { Emitter } from 'vs/base/common/event'; +import { onUnexpectedError } from 'vs/base/common/errors'; import { IUpdateService, IRawUpdate, State, IUpdate } from './update'; export interface IUpdateChannel extends IChannel { @@ -18,6 +19,7 @@ export interface IUpdateChannel extends IChannel { call(command: 'event:onStateChange'): TPromise; call(command: 'checkForUpdates', arg: boolean): TPromise; call(command: 'quitAndInstall'): TPromise; + call(command: '_getInitialState'): TPromise; call(command: string, arg?: any): TPromise; } @@ -34,6 +36,7 @@ export class UpdateChannel implements IUpdateChannel { case 'event:onStateChange': return eventToCall(this.service.onStateChange); case 'checkForUpdates': return this.service.checkForUpdates(arg); case 'quitAndInstall': return this.service.quitAndInstall(); + case '_getInitialState': return TPromise.as(this.service.state); } return undefined; } @@ -55,14 +58,24 @@ export class UpdateChannelClient implements IUpdateService { private _onUpdateReady = eventFromCall(this.channel, 'event:onUpdateReady'); get onUpdateReady(): Event { return this._onUpdateReady; } - private _onStateChange = eventFromCall(this.channel, 'event:onStateChange'); - get onStateChange(): Event { return this._onStateChange; } + private _onRemoteStateChange = eventFromCall(this.channel, 'event:onStateChange'); + private _onStateChange = new Emitter(); + get onStateChange(): Event { return this._onStateChange.event; } private _state: State = State.Uninitialized; get state(): State { return this._state; }; - constructor(private channel: IChannel) { + constructor(private channel: IUpdateChannel) { + // always set this._state as the state changes this.onStateChange(state => this._state = state); + + channel.call('_getInitialState').done(state => { + // fire initial state + this._onStateChange.fire(state); + + // fire subsequent states as they come in from remote + this._onRemoteStateChange(state => this._onStateChange.fire(state)); + }, onUnexpectedError); } checkForUpdates(explicit: boolean): TPromise { diff --git a/src/vs/platform/update/electron-main/auto-updater.win32.ts b/src/vs/platform/update/electron-main/auto-updater.win32.ts index 1e0b72718c690285de9607de01fbf9dc2c342b42..4bc3db6a823c414b31ed7622ac66485740010da5 100644 --- a/src/vs/platform/update/electron-main/auto-updater.win32.ts +++ b/src/vs/platform/update/electron-main/auto-updater.win32.ts @@ -41,7 +41,7 @@ export class Win32AutoUpdaterImpl extends EventEmitter implements IAutoUpdater { } get cachePath(): TPromise { - const result = path.join(tmpdir(), 'vscode-update'); + const result = path.join(tmpdir(), `vscode-update-${process.arch}`); return new TPromise((c, e) => mkdirp(result, null, err => err ? e(err) : c(result))); } diff --git a/src/vs/platform/update/electron-main/updateService.ts b/src/vs/platform/update/electron-main/updateService.ts index aa3f75c6d5140bb8a8fc93b5595cc3ef1f4a28e4..8c387a907106438afbd1f146beaae4d6a49ff313 100644 --- a/src/vs/platform/update/electron-main/updateService.ts +++ b/src/vs/platform/update/electron-main/updateService.ts @@ -16,7 +16,7 @@ import { fromEventEmitter } from 'vs/base/node/event'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { Win32AutoUpdaterImpl } from './auto-updater.win32'; import { LinuxAutoUpdaterImpl } from './auto-updater.linux'; -import { ILifecycleService } from 'vs/code/electron-main/lifecycle'; +import { ILifecycleService } from 'vs/platform/lifecycle/electron-main/lifecycleMain'; import { IRequestService } from 'vs/platform/request/node/request'; import product from 'vs/platform/node/product'; import { TPromise } from 'vs/base/common/winjs.base'; @@ -44,8 +44,8 @@ export class UpdateService implements IUpdateService { private _onUpdateNotAvailable = new Emitter(); get onUpdateNotAvailable(): Event { return this._onUpdateNotAvailable.event; } - private _onUpdateReady = new Emitter(); - get onUpdateReady(): Event { return this._onUpdateReady.event; } + private _onUpdateReady = new Emitter(); + get onUpdateReady(): Event { return this._onUpdateReady.event; } private _onStateChange = new Emitter(); get onStateChange(): Event { return this._onStateChange.event; } @@ -180,7 +180,7 @@ export class UpdateService implements IUpdateService { this.telemetryService.publicLog('update:available', { explicit, version: update.version, currentVersion: product.commit }); } else { - const data: IUpdate = { + const data: IRawUpdate = { releaseNotes: update.releaseNotes, version: update.version, date: update.date @@ -221,11 +221,23 @@ export class UpdateService implements IUpdateService { return null; } - const platform = process.platform === 'linux' ? `linux-${process.arch}` : process.platform; + const platform = this.getUpdatePlatform(); return `${product.updateUrl}/api/update/${platform}/${channel}/${product.commit}`; } + private getUpdatePlatform(): string { + if (process.platform === 'linux') { + return `linux-${process.arch}`; + } + + if (process.platform === 'win32' && process.arch === 'x64') { + return 'win32-x64'; + } + + return process.platform; + } + quitAndInstall(): TPromise { if (!this._availableUpdate) { return TPromise.as(null); diff --git a/src/vs/platform/windows/common/windows.ts b/src/vs/platform/windows/common/windows.ts index d24aafc9bfbf44a0e84c293676ebe8a3af915341..81d5512a0ef3477ede880dd2fc8c7df1f1b52abe 100644 --- a/src/vs/platform/windows/common/windows.ts +++ b/src/vs/platform/windows/common/windows.ts @@ -9,6 +9,8 @@ import { TPromise } from 'vs/base/common/winjs.base'; import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; import Event from 'vs/base/common/event'; import { ITelemetryData } from 'vs/platform/telemetry/common/telemetry'; +import { IProcessEnvironment } from "vs/base/common/platform"; +import { ParsedArgs } from "vs/platform/environment/common/environment"; export const IWindowsService = createDecorator('windowsService'); @@ -19,9 +21,10 @@ export interface IWindowsService { onWindowOpen: Event; onWindowFocus: Event; - openFileFolderPicker(windowId: number, forceNewWindow?: boolean, data?: ITelemetryData): TPromise; - openFilePicker(windowId: number, forceNewWindow?: boolean, path?: string, data?: ITelemetryData): TPromise; - openFolderPicker(windowId: number, forceNewWindow?: boolean, data?: ITelemetryData): TPromise; + pickFileFolderAndOpen(windowId: number, forceNewWindow?: boolean, data?: ITelemetryData): TPromise; + pickFileAndOpen(windowId: number, forceNewWindow?: boolean, path?: string, data?: ITelemetryData): TPromise; + pickFolderAndOpen(windowId: number, forceNewWindow?: boolean, data?: ITelemetryData): TPromise; + pickFolder(options?: { buttonLabel: string; title: string; }): TPromise; reloadWindow(windowId: number): TPromise; openDevTools(windowId: number): TPromise; toggleDevTools(windowId: number): TPromise; @@ -37,6 +40,7 @@ export interface IWindowsService { isMaximized(windowId: number): TPromise; maximizeWindow(windowId: number): TPromise; unmaximizeWindow(windowId: number): TPromise; + onWindowTitleDoubleClick(windowId: number): TPromise; setDocumentEdited(windowId: number, flag: boolean): TPromise; quit(): TPromise; relaunch(options: { addArgs?: string[], removeArgs?: string[] }): TPromise; @@ -49,11 +53,11 @@ export interface IWindowsService { openWindow(paths: string[], options?: { forceNewWindow?: boolean, forceReuseWindow?: boolean }): TPromise; openNewWindow(): TPromise; showWindow(windowId: number): TPromise; - getWindows(): TPromise<{ id: number; path: string; title: string; }[]>; + getWindows(): TPromise<{ id: number; path: string; title: string; filename?: string; }[]>; getWindowCount(): TPromise; log(severity: string, ...messages: string[]): TPromise; // TODO@joao: what? - closeExtensionHostWindow(extensionDevelopmentPath: string): TPromise; + closeExtensionHostWindow(extensionDevelopmentPaths: string[]): TPromise; showItemInFolder(path: string): TPromise; // This needs to be handled from browser process to prevent @@ -71,9 +75,10 @@ export interface IWindowService { _serviceBrand: any; getCurrentWindowId(): number; - openFileFolderPicker(forceNewWindow?: boolean, data?: ITelemetryData): TPromise; - openFilePicker(forceNewWindow?: boolean, path?: string, data?: ITelemetryData): TPromise; - openFolderPicker(forceNewWindow?: boolean, data?: ITelemetryData): TPromise; + pickFileFolderAndOpen(forceNewWindow?: boolean, data?: ITelemetryData): TPromise; + pickFileAndOpen(forceNewWindow?: boolean, path?: string, data?: ITelemetryData): TPromise; + pickFolderAndOpen(forceNewWindow?: boolean, data?: ITelemetryData): TPromise; + pickFolder(options?: { buttonLabel: string; title: string; }): TPromise; reloadWindow(): TPromise; openDevTools(): TPromise; toggleDevTools(): TPromise; @@ -89,14 +94,20 @@ export interface IWindowService { isMaximized(): TPromise; maximizeWindow(): TPromise; unmaximizeWindow(): TPromise; + onWindowTitleDoubleClick(): TPromise; } export type MenuBarVisibility = 'default' | 'visible' | 'toggle' | 'hidden'; +export interface IWindowConfiguration { + window: IWindowSettings; +} + export interface IWindowSettings { openFilesInNewWindow: 'on' | 'off' | 'default'; openFoldersInNewWindow: 'on' | 'off' | 'default'; - reopenFolders: 'all' | 'one' | 'none'; + restoreWindows: 'all' | 'folders' | 'one' | 'none'; + reopenFolders: 'all' | 'one' | 'none'; // TODO@Ben deprecated restoreFullscreen: boolean; zoomLevel: number; titleBarStyle: 'native' | 'custom'; @@ -106,3 +117,93 @@ export interface IWindowSettings { nativeTabs: boolean; enableMenuBarMnemonics: boolean; } + +export enum OpenContext { + + // opening when running from the command line + CLI, + + // macOS only: opening from the dock (also when opening files to a running instance from desktop) + DOCK, + + // opening from the main application window + MENU, + + // opening from a file or folder dialog + DIALOG, + + // opening from the OS's UI + DESKTOP, + + // opening through the API + API +} + +export enum ReadyState { + + /** + * This window has not loaded any HTML yet + */ + NONE, + + /** + * This window is loading HTML + */ + LOADING, + + /** + * This window is navigating to another HTML + */ + NAVIGATING, + + /** + * This window is done loading HTML + */ + READY +} + +export interface IPath { + + // the file path to open within a Code instance + filePath?: string; + + // the line number in the file path to open + lineNumber?: number; + + // the column number in the file path to open + columnNumber?: number; +} + +export interface IOpenFileRequest { + filesToOpen?: IPath[]; + filesToCreate?: IPath[]; + filesToDiff?: IPath[]; +} + +export interface IWindowConfiguration extends ParsedArgs, IOpenFileRequest { + appRoot: string; + execPath: string; + + userEnv: IProcessEnvironment; + + isISOKeyboard?: boolean; + + zoomLevel?: number; + fullscreen?: boolean; + highContrast?: boolean; + baseTheme?: string; + backgroundColor?: string; + accessibilitySupport?: boolean; + + isInitialStartup?: boolean; + + perfStartTime?: number; + perfAppReady?: number; + perfWindowLoadTime?: number; + + workspacePath?: string; + + backupPath?: string; + + nodeCachedDataDir: string; +} \ No newline at end of file diff --git a/src/vs/platform/windows/common/windowsIpc.ts b/src/vs/platform/windows/common/windowsIpc.ts index 2d9e9d36506108faf9469e1efb7f750dd955253c..12b858979ca4dfcc54a5ad1f1fddcdf9a7bbc40c 100644 --- a/src/vs/platform/windows/common/windowsIpc.ts +++ b/src/vs/platform/windows/common/windowsIpc.ts @@ -14,9 +14,10 @@ import { ITelemetryData } from 'vs/platform/telemetry/common/telemetry'; export interface IWindowsChannel extends IChannel { call(command: 'event:onWindowOpen'): TPromise; call(command: 'event:onWindowFocus'): TPromise; - call(command: 'openFileFolderPicker', arg: [number, boolean, ITelemetryData]): TPromise; - call(command: 'openFilePicker', arg: [number, boolean, string, ITelemetryData]): TPromise; - call(command: 'openFolderPicker', arg: [number, boolean, ITelemetryData]): TPromise; + call(command: 'pickFileFolderAndOpen', arg: [number, boolean, ITelemetryData]): TPromise; + call(command: 'pickFileAndOpen', arg: [number, boolean, string, ITelemetryData]): TPromise; + call(command: 'pickFolderAndOpen', arg: [number, boolean, ITelemetryData]): TPromise; + call(command: 'pickFolder', arg: { buttonLabel: string; title: string; }): TPromise; call(command: 'reloadWindow', arg: number): TPromise; call(command: 'toggleDevTools', arg: number): TPromise; call(command: 'closeFolder', arg: number): TPromise; @@ -31,6 +32,7 @@ export interface IWindowsChannel extends IChannel { call(command: 'isMaximized', arg: number): TPromise; call(command: 'maximizeWindow', arg: number): TPromise; call(command: 'unmaximizeWindow', arg: number): TPromise; + call(command: 'onWindowTitleDoubleClick', arg: number): TPromise; call(command: 'setDocumentEdited', arg: [number, boolean]): TPromise; call(command: 'quit'): TPromise; call(command: 'openWindow', arg: [string[], { forceNewWindow?: boolean, forceReuseWindow?: boolean }]): TPromise; @@ -42,7 +44,7 @@ export interface IWindowsChannel extends IChannel { call(command: 'whenSharedProcessReady'): TPromise; call(command: 'toggleSharedProcess'): TPromise; call(command: 'log', arg: [string, string[]]): TPromise; - call(command: 'closeExtensionHostWindow', arg: string): TPromise; + call(command: 'closeExtensionHostWindow', arg: string[]): TPromise; call(command: 'showItemInFolder', arg: string): TPromise; call(command: 'openExternal', arg: string): TPromise; call(command: 'startCrashReporter', arg: Electron.CrashReporterStartOptions): TPromise; @@ -63,9 +65,10 @@ export class WindowsChannel implements IWindowsChannel { switch (command) { case 'event:onWindowOpen': return eventToCall(this.onWindowOpen); case 'event:onWindowFocus': return eventToCall(this.onWindowFocus); - case 'openFileFolderPicker': return this.service.openFileFolderPicker(arg[0], arg[1], arg[2]); - case 'openFilePicker': return this.service.openFilePicker(arg[0], arg[1], arg[2], arg[3]); - case 'openFolderPicker': return this.service.openFolderPicker(arg[0], arg[1], arg[2]); + case 'pickFileFolderAndOpen': return this.service.pickFileFolderAndOpen(arg[0], arg[1], arg[2]); + case 'pickFileAndOpen': return this.service.pickFileAndOpen(arg[0], arg[1], arg[2], arg[3]); + case 'pickFolderAndOpen': return this.service.pickFolderAndOpen(arg[0], arg[1], arg[2]); + case 'pickFolder': return this.service.pickFolder(arg); case 'reloadWindow': return this.service.reloadWindow(arg); case 'openDevTools': return this.service.openDevTools(arg); case 'toggleDevTools': return this.service.toggleDevTools(arg); @@ -81,6 +84,7 @@ export class WindowsChannel implements IWindowsChannel { case 'isMaximized': return this.service.isMaximized(arg); case 'maximizeWindow': return this.service.maximizeWindow(arg); case 'unmaximizeWindow': return this.service.unmaximizeWindow(arg); + case 'onWindowTitleDoubleClick': return this.service.onWindowTitleDoubleClick(arg); case 'setDocumentEdited': return this.service.setDocumentEdited(arg[0], arg[1]); case 'openWindow': return this.service.openWindow(arg[0], arg[1]); case 'openNewWindow': return this.service.openNewWindow(); @@ -113,16 +117,20 @@ export class WindowsChannelClient implements IWindowsService { private _onWindowFocus: Event = eventFromCall(this.channel, 'event:onWindowFocus'); get onWindowFocus(): Event { return this._onWindowFocus; } - openFileFolderPicker(windowId: number, forceNewWindow?: boolean, data?: ITelemetryData): TPromise { - return this.channel.call('openFileFolderPicker', [windowId, forceNewWindow, data]); + pickFileFolderAndOpen(windowId: number, forceNewWindow?: boolean, data?: ITelemetryData): TPromise { + return this.channel.call('pickFileFolderAndOpen', [windowId, forceNewWindow, data]); } - openFilePicker(windowId: number, forceNewWindow?: boolean, path?: string, data?: ITelemetryData): TPromise { - return this.channel.call('openFilePicker', [windowId, forceNewWindow, path, data]); + pickFileAndOpen(windowId: number, forceNewWindow?: boolean, path?: string, data?: ITelemetryData): TPromise { + return this.channel.call('pickFileAndOpen', [windowId, forceNewWindow, path, data]); } - openFolderPicker(windowId: number, forceNewWindow?: boolean, data?: ITelemetryData): TPromise { - return this.channel.call('openFolderPicker', [windowId, forceNewWindow, data]); + pickFolderAndOpen(windowId: number, forceNewWindow?: boolean, data?: ITelemetryData): TPromise { + return this.channel.call('pickFolderAndOpen', [windowId, forceNewWindow, data]); + } + + pickFolder(options?: { buttonLabel: string; title: string; }): TPromise { + return this.channel.call('pickFolder', options); } reloadWindow(windowId: number): TPromise { @@ -185,6 +193,10 @@ export class WindowsChannelClient implements IWindowsService { return this.channel.call('unmaximizeWindow', windowId); } + onWindowTitleDoubleClick(windowId: number): TPromise { + return this.channel.call('onWindowTitleDoubleClick', windowId); + } + setDocumentEdited(windowId: number, flag: boolean): TPromise { return this.channel.call('setDocumentEdited', [windowId, flag]); } @@ -229,8 +241,8 @@ export class WindowsChannelClient implements IWindowsService { return this.channel.call('log', [severity, messages]); } - closeExtensionHostWindow(extensionDevelopmentPath: string): TPromise { - return this.channel.call('closeExtensionHostWindow', extensionDevelopmentPath); + closeExtensionHostWindow(extensionDevelopmentPaths: string[]): TPromise { + return this.channel.call('closeExtensionHostWindow', extensionDevelopmentPaths); } showItemInFolder(path: string): TPromise { diff --git a/src/vs/platform/windows/electron-browser/windowService.ts b/src/vs/platform/windows/electron-browser/windowService.ts index c5d2e5c7e8a7d195b9d39d1b2aad05056ebc63be..1ed22b28043b8b55412dcf5cbfb83920d478c906 100644 --- a/src/vs/platform/windows/electron-browser/windowService.ts +++ b/src/vs/platform/windows/electron-browser/windowService.ts @@ -22,16 +22,20 @@ export class WindowService implements IWindowService { return this.windowId; } - openFileFolderPicker(forceNewWindow?: boolean, data?: ITelemetryData): TPromise { - return this.windowsService.openFileFolderPicker(this.windowId, forceNewWindow, data); + pickFileFolderAndOpen(forceNewWindow?: boolean, data?: ITelemetryData): TPromise { + return this.windowsService.pickFileFolderAndOpen(this.windowId, forceNewWindow, data); } - openFilePicker(forceNewWindow?: boolean, path?: string, data?: ITelemetryData): TPromise { - return this.windowsService.openFilePicker(this.windowId, forceNewWindow, path, data); + pickFileAndOpen(forceNewWindow?: boolean, path?: string, data?: ITelemetryData): TPromise { + return this.windowsService.pickFileAndOpen(this.windowId, forceNewWindow, path, data); } - openFolderPicker(forceNewWindow?: boolean, data?: ITelemetryData): TPromise { - return this.windowsService.openFolderPicker(this.windowId, forceNewWindow, data); + pickFolderAndOpen(forceNewWindow?: boolean, data?: ITelemetryData): TPromise { + return this.windowsService.pickFolderAndOpen(this.windowId, forceNewWindow, data); + } + + pickFolder(options?: { buttonLabel: string; title: string; }): TPromise { + return this.windowsService.pickFolder(options); } reloadWindow(): TPromise { @@ -90,6 +94,10 @@ export class WindowService implements IWindowService { return this.windowsService.unmaximizeWindow(this.windowId); } + onWindowTitleDoubleClick(): TPromise { + return this.windowsService.onWindowTitleDoubleClick(this.windowId); + } + setDocumentEdited(flag: boolean): TPromise { return this.windowsService.setDocumentEdited(this.windowId, flag); } diff --git a/src/vs/platform/windows/electron-main/windows.ts b/src/vs/platform/windows/electron-main/windows.ts new file mode 100644 index 0000000000000000000000000000000000000000..842de88e8de5f5434cd7e6a074a3c30e4cd701c8 --- /dev/null +++ b/src/vs/platform/windows/electron-main/windows.ts @@ -0,0 +1,86 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +'use strict'; + +import { TPromise } from 'vs/base/common/winjs.base'; +import { OpenContext, IWindowConfiguration, ReadyState, IPath } from 'vs/platform/windows/common/windows'; +import { ParsedArgs } from 'vs/platform/environment/common/environment'; +import Event from 'vs/base/common/event'; +import { ITelemetryData } from 'vs/platform/telemetry/common/telemetry'; +import { createDecorator } from "vs/platform/instantiation/common/instantiation"; +import { IProcessEnvironment } from "vs/base/common/platform"; + +export interface ICodeWindow { + id: number; + win: Electron.BrowserWindow; + config: IWindowConfiguration; + openedWorkspacePath: string; + + readyState: ReadyState; + + close(): void; + + send(channel: string, ...args: any[]): void; + sendWhenReady(channel: string, ...args: any[]): void; + + toggleFullScreen(): void; + hasHiddenTitleBarStyle(): boolean; + setRepresentedFilename(name: string): void; + getRepresentedFilename(): string; + onWindowTitleDoubleClick(): void; +} + +export const IWindowsMainService = createDecorator('windowsMainService'); + +export interface IWindowsMainService { + _serviceBrand: any; + + // events + onWindowReady: Event; + onWindowClose: Event; + onWindowReload: Event; + onPathsOpen: Event; + + // methods + ready(initialUserEnv: IProcessEnvironment): void; + reload(win: ICodeWindow, cli?: ParsedArgs): void; + open(openConfig: IOpenConfiguration): ICodeWindow[]; + openExtensionDevelopmentHostWindow(openConfig: IOpenConfiguration): void; + pickFileFolderAndOpen(forceNewWindow?: boolean, data?: ITelemetryData): void; + pickFileAndOpen(forceNewWindow?: boolean, path?: string, window?: ICodeWindow, data?: ITelemetryData): void; + pickFolderAndOpen(forceNewWindow?: boolean, window?: ICodeWindow, data?: ITelemetryData): void; + pickFolder(options?: { buttonLabel: string; title: string; }): TPromise; + focusLastActive(cli: ParsedArgs, context: OpenContext): ICodeWindow; + getLastActiveWindow(): ICodeWindow; + findWindow(workspacePath: string, filePath?: string, extensionDevelopmentPath?: string): ICodeWindow; + openNewWindow(context: OpenContext): void; + sendToFocused(channel: string, ...args: any[]): void; + sendToAll(channel: string, payload: any, windowIdsToIgnore?: number[]): void; + getFocusedWindow(): ICodeWindow; + getWindowById(windowId: number): ICodeWindow; + getWindows(): ICodeWindow[]; + getWindowCount(): number; + quit(): void; +} + +export interface IOpenConfiguration { + context: OpenContext; + cli: ParsedArgs; + userEnv?: IProcessEnvironment; + pathsToOpen?: string[]; + preferNewWindow?: boolean; + forceNewWindow?: boolean; + forceReuseWindow?: boolean; + forceEmpty?: boolean; + windowToUse?: ICodeWindow; + diffMode?: boolean; + initialStartup?: boolean; +} + +export interface ISharedProcess { + whenReady(): TPromise; + toggle(): void; +} \ No newline at end of file diff --git a/src/vs/platform/windows/electron-main/windowsService.ts b/src/vs/platform/windows/electron-main/windowsService.ts index f74c4e5af3997b833745a1fbce55bc1fd561ab90..28a9318a7ecd14ab8d0d12d572324ecfdff98d03 100644 --- a/src/vs/platform/windows/electron-main/windowsService.ts +++ b/src/vs/platform/windows/electron-main/windowsService.ts @@ -9,23 +9,16 @@ import { TPromise } from 'vs/base/common/winjs.base'; import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { assign } from 'vs/base/common/objects'; import URI from 'vs/base/common/uri'; -import { IWindowsService } from 'vs/platform/windows/common/windows'; +import { IWindowsService, OpenContext } from 'vs/platform/windows/common/windows'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import { shell, crashReporter, app } from 'electron'; import Event, { chain } from 'vs/base/common/event'; import { fromEventEmitter } from 'vs/base/node/event'; import { IURLService } from 'vs/platform/url/common/url'; import { ITelemetryData } from 'vs/platform/telemetry/common/telemetry'; - -// TODO@Joao: remove this dependency, move all implementation to this class -import { OpenContext } from 'vs/code/common/windows'; -import { IWindowsMainService } from 'vs/code/electron-main/windows'; -import { ILifecycleService } from "vs/code/electron-main/lifecycle"; - -export interface ISharedProcess { - whenReady(): TPromise; - toggle(): void; -} +import { ILifecycleService } from "vs/platform/lifecycle/electron-main/lifecycleMain"; +import { IWindowsMainService, ISharedProcess } from "vs/platform/windows/electron-main/windows"; +import { IHistoryMainService } from "vs/platform/history/electron-main/historyMainService"; export class WindowsService implements IWindowsService, IDisposable { @@ -41,57 +34,69 @@ export class WindowsService implements IWindowsService, IDisposable { @IWindowsMainService private windowsMainService: IWindowsMainService, @IEnvironmentService private environmentService: IEnvironmentService, @IURLService urlService: IURLService, - @ILifecycleService private lifecycleService: ILifecycleService + @ILifecycleService private lifecycleService: ILifecycleService, + @IHistoryMainService private historyService: IHistoryMainService ) { + // Catch file URLs chain(urlService.onOpenURL) .filter(uri => uri.authority === 'file' && !!uri.path) .map(uri => URI.file(uri.fsPath)) .on(this.openFileForURI, this, this.disposables); + + // Catch extension URLs when there are no windows open + chain(urlService.onOpenURL) + .filter(uri => /^extension/.test(uri.path)) + .filter(() => this.windowsMainService.getWindowCount() === 0) + .on(this.openExtensionForURI, this, this.disposables); } - openFileFolderPicker(windowId: number, forceNewWindow?: boolean, data?: ITelemetryData): TPromise { - this.windowsMainService.openFileFolderPicker(forceNewWindow, data); + pickFileFolderAndOpen(windowId: number, forceNewWindow?: boolean, data?: ITelemetryData): TPromise { + this.windowsMainService.pickFileFolderAndOpen(forceNewWindow, data); return TPromise.as(null); } - openFilePicker(windowId: number, forceNewWindow?: boolean, path?: string, data?: ITelemetryData): TPromise { - this.windowsMainService.openFilePicker(forceNewWindow, path, undefined, data); + pickFileAndOpen(windowId: number, forceNewWindow?: boolean, path?: string, data?: ITelemetryData): TPromise { + this.windowsMainService.pickFileAndOpen(forceNewWindow, path, undefined, data); return TPromise.as(null); } - openFolderPicker(windowId: number, forceNewWindow?: boolean, data?: ITelemetryData): TPromise { - const vscodeWindow = this.windowsMainService.getWindowById(windowId); - this.windowsMainService.openFolderPicker(forceNewWindow, vscodeWindow, data); + pickFolderAndOpen(windowId: number, forceNewWindow?: boolean, data?: ITelemetryData): TPromise { + const codeWindow = this.windowsMainService.getWindowById(windowId); + this.windowsMainService.pickFolderAndOpen(forceNewWindow, codeWindow, data); return TPromise.as(null); } + pickFolder(options?: { buttonLabel: string; title: string; }): TPromise { + return this.windowsMainService.pickFolder(options); + } + reloadWindow(windowId: number): TPromise { - const vscodeWindow = this.windowsMainService.getWindowById(windowId); + const codeWindow = this.windowsMainService.getWindowById(windowId); - if (vscodeWindow) { - this.windowsMainService.reload(vscodeWindow); + if (codeWindow) { + this.windowsMainService.reload(codeWindow); } return TPromise.as(null); } openDevTools(windowId: number): TPromise { - const vscodeWindow = this.windowsMainService.getWindowById(windowId); + const codeWindow = this.windowsMainService.getWindowById(windowId); - if (vscodeWindow) { - vscodeWindow.win.webContents.openDevTools(); + if (codeWindow) { + codeWindow.win.webContents.openDevTools(); } return TPromise.as(null); } toggleDevTools(windowId: number): TPromise { - const vscodeWindow = this.windowsMainService.getWindowById(windowId); + const codeWindow = this.windowsMainService.getWindowById(windowId); - if (vscodeWindow) { - const contents = vscodeWindow.win.webContents; - if (vscodeWindow.hasHiddenTitleBarStyle() && !vscodeWindow.win.isFullScreen() && !contents.isDevToolsOpened()) { + if (codeWindow) { + const contents = codeWindow.win.webContents; + if (codeWindow.hasHiddenTitleBarStyle() && !codeWindow.win.isFullScreen() && !contents.isDevToolsOpened()) { contents.openDevTools({ mode: 'undocked' }); // due to https://github.com/electron/electron/issues/3647 } else { contents.toggleDevTools(); @@ -102,57 +107,57 @@ export class WindowsService implements IWindowsService, IDisposable { } closeFolder(windowId: number): TPromise { - const vscodeWindow = this.windowsMainService.getWindowById(windowId); + const codeWindow = this.windowsMainService.getWindowById(windowId); - if (vscodeWindow) { - this.windowsMainService.open({ context: OpenContext.API, cli: this.environmentService.args, forceEmpty: true, windowToUse: vscodeWindow, forceReuseWindow: true }); + if (codeWindow) { + this.windowsMainService.open({ context: OpenContext.API, cli: this.environmentService.args, forceEmpty: true, windowToUse: codeWindow, forceReuseWindow: true }); } return TPromise.as(null); } toggleFullScreen(windowId: number): TPromise { - const vscodeWindow = this.windowsMainService.getWindowById(windowId); + const codeWindow = this.windowsMainService.getWindowById(windowId); - if (vscodeWindow) { - vscodeWindow.toggleFullScreen(); + if (codeWindow) { + codeWindow.toggleFullScreen(); } return TPromise.as(null); } setRepresentedFilename(windowId: number, fileName: string): TPromise { - const vscodeWindow = this.windowsMainService.getWindowById(windowId); + const codeWindow = this.windowsMainService.getWindowById(windowId); - if (vscodeWindow) { - vscodeWindow.win.setRepresentedFilename(fileName); + if (codeWindow) { + codeWindow.setRepresentedFilename(fileName); } return TPromise.as(null); } addToRecentlyOpen(paths: { path: string, isFile?: boolean }[]): TPromise { - this.windowsMainService.addToRecentPathsList(paths); + this.historyService.addToRecentPathsList(paths); return TPromise.as(null); } removeFromRecentlyOpen(paths: string[]): TPromise { - this.windowsMainService.removeFromRecentPathsList(paths); + this.historyService.removeFromRecentPathsList(paths); return TPromise.as(null); } clearRecentPathsList(): TPromise { - this.windowsMainService.clearRecentPathsList(); + this.historyService.clearRecentPathsList(); return TPromise.as(null); } getRecentlyOpen(windowId: number): TPromise<{ files: string[]; folders: string[]; }> { - const vscodeWindow = this.windowsMainService.getWindowById(windowId); + const codeWindow = this.windowsMainService.getWindowById(windowId); - if (vscodeWindow) { - const { files, folders } = this.windowsMainService.getRecentPathsList(vscodeWindow.config.workspacePath, vscodeWindow.config.filesToOpen); + if (codeWindow) { + const { files, folders } = this.historyService.getRecentPathsList(codeWindow.config.workspacePath, codeWindow.config.filesToOpen); return TPromise.as({ files, folders }); } @@ -160,60 +165,70 @@ export class WindowsService implements IWindowsService, IDisposable { } focusWindow(windowId: number): TPromise { - const vscodeWindow = this.windowsMainService.getWindowById(windowId); + const codeWindow = this.windowsMainService.getWindowById(windowId); - if (vscodeWindow) { - vscodeWindow.win.focus(); + if (codeWindow) { + codeWindow.win.focus(); } return TPromise.as(null); } isFocused(windowId: number): TPromise { - const vscodeWindow = this.windowsMainService.getWindowById(windowId); + const codeWindow = this.windowsMainService.getWindowById(windowId); - if (vscodeWindow) { - return TPromise.as(vscodeWindow.win.isFocused()); + if (codeWindow) { + return TPromise.as(codeWindow.win.isFocused()); } return TPromise.as(null); } isMaximized(windowId: number): TPromise { - const vscodeWindow = this.windowsMainService.getWindowById(windowId); + const codeWindow = this.windowsMainService.getWindowById(windowId); - if (vscodeWindow) { - return TPromise.as(vscodeWindow.win.isMaximized()); + if (codeWindow) { + return TPromise.as(codeWindow.win.isMaximized()); } return TPromise.as(null); } maximizeWindow(windowId: number): TPromise { - const vscodeWindow = this.windowsMainService.getWindowById(windowId); + const codeWindow = this.windowsMainService.getWindowById(windowId); - if (vscodeWindow) { - vscodeWindow.win.maximize(); + if (codeWindow) { + codeWindow.win.maximize(); } return TPromise.as(null); } unmaximizeWindow(windowId: number): TPromise { - const vscodeWindow = this.windowsMainService.getWindowById(windowId); + const codeWindow = this.windowsMainService.getWindowById(windowId); - if (vscodeWindow) { - vscodeWindow.win.unmaximize(); + if (codeWindow) { + codeWindow.win.unmaximize(); + } + + return TPromise.as(null); + } + + onWindowTitleDoubleClick(windowId: number): TPromise { + const codeWindow = this.windowsMainService.getWindowById(windowId); + + if (codeWindow) { + codeWindow.onWindowTitleDoubleClick(); } return TPromise.as(null); } setDocumentEdited(windowId: number, flag: boolean): TPromise { - const vscodeWindow = this.windowsMainService.getWindowById(windowId); + const codeWindow = this.windowsMainService.getWindowById(windowId); - if (vscodeWindow && vscodeWindow.win.isDocumentEdited() !== flag) { - vscodeWindow.win.setDocumentEdited(flag); + if (codeWindow && codeWindow.win.isDocumentEdited() !== flag) { + codeWindow.win.setDocumentEdited(flag); } return TPromise.as(null); @@ -234,10 +249,10 @@ export class WindowsService implements IWindowsService, IDisposable { } showWindow(windowId: number): TPromise { - const vscodeWindow = this.windowsMainService.getWindowById(windowId); + const codeWindow = this.windowsMainService.getWindowById(windowId); - if (vscodeWindow) { - vscodeWindow.win.show(); + if (codeWindow) { + codeWindow.win.show(); } return TPromise.as(null); @@ -245,7 +260,8 @@ export class WindowsService implements IWindowsService, IDisposable { getWindows(): TPromise<{ id: number; path: string; title: string; }[]> { const windows = this.windowsMainService.getWindows(); - const result = windows.map(w => ({ path: w.openedWorkspacePath, title: w.win.getTitle(), id: w.id })); + const result = windows.map(w => ({ path: w.openedWorkspacePath, title: w.win.getTitle(), id: w.id, filename: w.getRepresentedFilename() })); + return TPromise.as(result); } @@ -258,12 +274,12 @@ export class WindowsService implements IWindowsService, IDisposable { return TPromise.as(null); } - closeExtensionHostWindow(extensionDevelopmentPath: string): TPromise { - const windowOnExtension = this.windowsMainService.findWindow(null, null, extensionDevelopmentPath); - - if (windowOnExtension) { - windowOnExtension.win.close(); - } + closeExtensionHostWindow(extensionDevelopmentPaths: string[]): TPromise { + extensionDevelopmentPaths.map(p => this.windowsMainService.findWindow(null, null, p)).forEach(windowOnExtension => { + if (windowOnExtension) { + windowOnExtension.win.close(); + } + }); return TPromise.as(null); } @@ -310,7 +326,17 @@ export class WindowsService implements IWindowsService, IDisposable { return TPromise.as(null); } + /** + * This should only fire whenever an extension URL is open + * and there are no windows to handle it. + */ + private openExtensionForURI(uri: URI): TPromise { + const cli = assign(Object.create(null), this.environmentService.args); + this.windowsMainService.open({ context: OpenContext.API, cli }); + return TPromise.as(null); + } + dispose(): void { this.disposables = dispose(this.disposables); } -} +} \ No newline at end of file diff --git a/src/vs/platform/workspace/common/workspace.ts b/src/vs/platform/workspace/common/workspace.ts index 1218ddd4da827478f1efe8a6c7fad0743ed934a3..0c5daf8472f050f92644b389d129d89b40d20976 100644 --- a/src/vs/platform/workspace/common/workspace.ts +++ b/src/vs/platform/workspace/common/workspace.ts @@ -6,9 +6,10 @@ import URI from 'vs/base/common/uri'; import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import paths = require('vs/base/common/paths'); -import { isEqualOrParent } from 'vs/platform/files/common/files'; +import * as paths from 'vs/base/common/paths'; +import { TrieMap } from 'vs/base/common/map'; import { isLinux } from 'vs/base/common/platform'; +import Event from 'vs/base/common/event'; export const IWorkspaceContextService = createDecorator('contextService'); @@ -24,7 +25,24 @@ export interface IWorkspaceContextService { * Provides access to the workspace object the platform is running with. This may be null if the workbench was opened * without workspace (empty); */ - getWorkspace(): IWorkspace; + getWorkspace(): ILegacyWorkspace; + + /** + * Provides access to the workspace object the platform is running with. This may be null if the workbench was opened + * without workspace (empty); + */ + getWorkspace2(): IWorkspace; + + /** + * An event which fires on workspace roots change. + */ + onDidChangeWorkspaceRoots: Event; + + /** + * Returns the root for the given resource from the workspace. + * Can be null if there is no workspace or the resource is not inside the workspace. + */ + getRoot(resource: URI): URI; /** * Returns iff the provided resource is inside the workspace or not. @@ -44,66 +62,122 @@ export interface IWorkspaceContextService { toResource: (workspaceRelativePath: string) => URI; } -export interface IWorkspace { +export interface ILegacyWorkspace { /** * the full uri of the workspace. this is a file:// URL to the location * of the workspace on disk. */ resource: URI; +} + +export interface IWorkspace { /** - * the unique identifier of the workspace. if the workspace is deleted and recreated - * the identifier also changes. this makes the uid more unique compared to the id which - * is just derived from the workspace name. + * the unique identifier of the workspace. */ - uid?: number; + readonly id: string; /** - * the name of the workspace + * the name of the workspace. */ - name?: string; + readonly name: string; + + /** + * Mutliple roots in this workspace. First entry is master and never changes. + */ + readonly roots: URI[]; } -export class WorkspaceContextService implements IWorkspaceContextService { +export class LegacyWorkspace implements ILegacyWorkspace { + private _name: string; - public _serviceBrand: any; + constructor(private _resource: URI, private _ctime?: number) { + this._name = paths.basename(this._resource.fsPath) || this._resource.fsPath; + } - private workspace: IWorkspace; + public get resource(): URI { + return this._resource; + } - constructor(workspace: IWorkspace) { - this.workspace = workspace; + public get name(): string { + return this._name; } - public getWorkspace(): IWorkspace { - return this.workspace; + public get ctime(): number { + return this._ctime; } - public hasWorkspace(): boolean { - return !!this.workspace; + public toWorkspaceRelativePath(resource: URI, toOSPath?: boolean): string { + if (this.contains(resource)) { + return paths.normalize(paths.relative(this._resource.fsPath, resource.fsPath), toOSPath); + } + + return null; } - public isInsideWorkspace(resource: URI): boolean { - if (resource && this.workspace) { - return isEqualOrParent(resource.fsPath, this.workspace.resource.fsPath, !isLinux /* ignorecase */); + private contains(resource: URI): boolean { + if (resource) { + return paths.isEqualOrParent(resource.fsPath, this._resource.fsPath, !isLinux /* ignorecase */); } return false; } - public toWorkspaceRelativePath(resource: URI, toOSPath?: boolean): string { - if (this.isInsideWorkspace(resource)) { - return paths.normalize(paths.relative(this.workspace.resource.fsPath, resource.fsPath), toOSPath); + public toResource(workspaceRelativePath: string, root?: URI): URI { + if (typeof workspaceRelativePath === 'string') { + return URI.file(paths.join(root ? root.fsPath : this._resource.fsPath, workspaceRelativePath)); } return null; } +} + +export class Workspace implements IWorkspace { + + private _rootsMap: TrieMap = new TrieMap(TrieMap.PathSplitter); + + constructor( + public readonly id: string, + private _name: string, + private _roots: URI[] + ) { + this.updateRootsMap(); + } + + public get roots(): URI[] { + return this._roots; + } + + public set roots(roots: URI[]) { + this._roots = roots; + this.updateRootsMap(); + } + + public get name(): string { + return this._name; + } - public toResource(workspaceRelativePath: string): URI { - if (typeof workspaceRelativePath === 'string' && this.workspace) { - return URI.file(paths.join(this.workspace.resource.fsPath, workspaceRelativePath)); + public set name(name: string) { + this._name = name; + } + + public getRoot(resource: URI): URI { + if (!resource) { + return null; } - return null; + return this._rootsMap.findSubstr(resource.fsPath); + } + + private updateRootsMap(): void { + this._rootsMap = new TrieMap(TrieMap.PathSplitter); + for (const root of this.roots) { + this._rootsMap.insert(root.fsPath, root); + } + } + + public toJSON(): IWorkspace { + return { id: this.id, roots: this.roots, name: this.name }; } } \ No newline at end of file diff --git a/src/vs/platform/workspace/test/common/testWorkspace.ts b/src/vs/platform/workspace/test/common/testWorkspace.ts index 237d85295236cf3463cb19d7490b2301125ac8f3..e5453ed88c3ffd8e2c2932390d4a993e9be7bb21 100644 --- a/src/vs/platform/workspace/test/common/testWorkspace.ts +++ b/src/vs/platform/workspace/test/common/testWorkspace.ts @@ -3,11 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IWorkspace } from 'vs/platform/workspace/common/workspace'; import URI from 'vs/base/common/uri'; +import { Workspace } from "vs/platform/workspace/common/workspace"; -export const TestWorkspace: IWorkspace = { - resource: URI.file('C:\\testWorkspace'), - name: 'Test Workspace', - uid: Date.now() -}; +const wsUri = URI.file('C:\\testWorkspace'); +export const TestWorkspace = new Workspace( + wsUri.toString(), + wsUri.fsPath, + [wsUri] +); diff --git a/src/vs/vscode.d.ts b/src/vs/vscode.d.ts index 35a6a58cc03baa147f8ff34e1fc304e013b0a9a8..90bc45c524b51a31cfb27d83d24230e533f0ce46 100644 --- a/src/vs/vscode.d.ts +++ b/src/vs/vscode.d.ts @@ -201,7 +201,9 @@ declare module 'vscode' { * Get a word-range at the given position. By default words are defined by * common separators, like space, -, _, etc. In addition, per languge custom * [word definitions](#LanguageConfiguration.wordPattern) can be defined. It - * is also possible to provide a custom regular expression. + * is also possible to provide a custom regular expression. *Note* that a + * custom regular expression must not match the empty string and that it will + * be ignored if it does. * * The position will be [adjusted](#TextDocument.validatePosition). * @@ -698,6 +700,28 @@ declare module 'vscode' { Full = 7 } + /** + * Describes the behavior of decorations when typing/editing at their edges. + */ + export enum DecorationRangeBehavior { + /** + * The decoration's range will widen when edits occur at the start or end. + */ + OpenOpen = 0, + /** + * The decoration's range will not widen when edits occur at the start of end. + */ + ClosedClosed = 1, + /** + * The decoration's range will widen when edits occur at the start, but not at the end. + */ + OpenClosed = 2, + /** + * The decoration's range will widen when edits occur at the end, but not at the start. + */ + ClosedOpen = 3 + } + /** * Represents options to configure the behavior of showing a [document](#TextDocument) in an [editor](#TextEditor). */ @@ -904,6 +928,12 @@ declare module 'vscode' { */ isWholeLine?: boolean; + /** + * Customize the growing behavior of the decoration when edits occur at the edges of the decoration's range. + * Defaults to `DecorationRangeBehavior.OpenOpen`. + */ + rangeBehavior?: DecorationRangeBehavior; + /** * The position in the overview ruler where the decoration should be rendered. */ @@ -1005,7 +1035,7 @@ declare module 'vscode' { * callback executes. * * @param callback A function which can create edits using an [edit-builder](#TextEditorEdit). - * @param options The undo/redo behaviour around this edit. By default, undo stops will be created before and after this edit. + * @param options The undo/redo behavior around this edit. By default, undo stops will be created before and after this edit. * @return A promise that resolves with a value indicating if the edits could be applied. */ edit(callback: (editBuilder: TextEditorEdit) => void, options?: { undoStopBefore: boolean; undoStopAfter: boolean; }): Thenable; @@ -1017,7 +1047,7 @@ declare module 'vscode' { * * @param snippet The snippet to insert in this edit. * @param location Position or range at which to insert the snippet, defaults to the current editor selection or selections. - * @param options The undo/redo behaviour around this edit. By default, undo stops will be created before and after this edit. + * @param options The undo/redo behavior around this edit. By default, undo stops will be created before and after this edit. * @return A promise that resolves with a value indicating if the snippet could be inserted. Note that the promise does not signal * that the snippet is completely filled-in or accepted. */ @@ -3179,7 +3209,7 @@ declare module 'vscode' { } /** - * Denotes a column in the VS Code window. Columns are + * Denotes a column in the editor window. Columns are * used to show editors side by side. */ export enum ViewColumn { @@ -3507,526 +3537,6 @@ declare module 'vscode' { update(key: string, value: any): Thenable; } - /** - * Defines a problem pattern - */ - export interface ProblemPattern { - - /** - * The regular expression to find a problem in the console output of an - * executed task. - */ - regexp: RegExp; - - /** - * The match group index of the filename. - * - * Defaults to 1 if omitted. - */ - file?: number; - - /** - * The match group index of the problems's location. Valid location - * patterns are: (line), (line,column) and (startLine,startColumn,endLine,endColumn). - * If omitted the line and colum properties are used. - */ - location?: number; - - /** - * The match group index of the problem's line in the source file. - * - * Defaults to 2 if omitted. - */ - line?: number; - - /** - * The match group index of the problem's character in the source file. - * - * Defaults to 3 if omitted. - */ - character?: number; - - /** - * The match group index of the problem's end line in the source file. - * - * Defaults to undefined. No end line is captured. - */ - endLine?: number; - - /** - * The match group index of the problem's end character in the source file. - * - * Defaults to undefined. No end column is captured. - */ - endCharacter?: number; - - /** - * The match group index of the problem's severity. - * - * Defaults to undefined. In this case the problem matcher's severity - * is used. - */ - severity?: number; - - /** - * The match group index of the problems's code. - * - * Defaults to undefined. No code is captured. - */ - code?: number; - - /** - * The match group index of the message. If omitted it defaults - * to 4 if location is specified. Otherwise it defaults to 5. - */ - message?: number; - - /** - * Specifies if the last pattern in a multi line problem matcher should - * loop as long as it does match a line consequently. Only valid on the - * last problem pattern in a multi line problem matcher. - */ - loop?: boolean; - } - - /** - * A multi line problem pattern. - */ - export type MultiLineProblemPattern = ProblemPattern[]; - - /** - * The way how the file location is interpreted - */ - export enum FileLocationKind { - /** - * VS Code should decide based on whether the file path found in the - * output is absolute or relative. A relative file path will be treated - * relative to the workspace root. - */ - Auto = 1, - - /** - * Always treat the file path relative. - */ - Relative = 2, - - /** - * Always treat the file path absolute. - */ - Absolute = 3 - } - - /** - * Controls to which kind of documents problems are applied. - */ - export enum ApplyToKind { - /** - * Problems are applied to all documents. - */ - AllDocuments = 1, - - /** - * Problems are applied to open documents only. - */ - OpenDocuments = 2, - - - /** - * Problems are applied to closed documents only. - */ - ClosedDocuments = 3 - } - - - /** - * A background monitor pattern - */ - export interface BackgroundPattern { - /** - * The actual regular expression - */ - regexp: RegExp; - - /** - * The match group index of the filename. If provided the expression - * is matched for that file only. - */ - file?: number; - } - - /** - * A description to control the activity of a problem matcher - * watching a background task. - */ - export interface BackgroundMonitor { - /** - * If set to true the monitor is in active mode when the task - * starts. This is equals of issuing a line that matches the - * beginPattern. - */ - activeOnStart?: boolean; - - /** - * If matched in the output the start of a background activity is signaled. - */ - beginsPattern: RegExp | BackgroundPattern; - - /** - * If matched in the output the end of a background activity is signaled. - */ - endsPattern: RegExp | BackgroundPattern; - } - - /** - * Defines a problem matcher - */ - export interface ProblemMatcher { - /** - * The owner of a problem. Defaults to a generated id - * if omitted. - */ - owner?: string; - - /** - * The type of documents problems detected by this matcher - * apply to. Default to `ApplyToKind.AllDocuments` if omitted. - */ - applyTo?: ApplyToKind; - - /** - * How a file location recognized by a matcher should be interpreted. If omitted the file location - * if `FileLocationKind.Auto`. - */ - fileLocation?: FileLocationKind | string; - - /** - * The actual pattern used by the problem matcher. - */ - pattern: ProblemPattern | MultiLineProblemPattern; - - /** - * The default severity of a detected problem in the output. Used - * if the `ProblemPattern` doesn't define a severity match group. - */ - severity?: DiagnosticSeverity; - - /** - * A background monitor for tasks that are running in the background. - */ - backgound?: BackgroundMonitor; - } - - /** - * Controls the behaviour of the terminal's visibility. - */ - export enum RevealKind { - /** - * Always brings the terminal to front if the task is executed. - */ - Always = 1, - - /** - * Only brings the terminal to front if a problem is detected executing the task - * (e.g. the task couldn't be started because). - */ - Silent = 2, - - /** - * The terminal never comes to front when the task is executed. - */ - Never = 3 - } - - /** - * Controls terminal specific behaviour. - */ - export interface TerminalBehaviour { - /** - * Controls whether the terminal executing a task is brought to front or not. - * Defaults to `RevealKind.Always`. - */ - reveal?: RevealKind; - - /** - * Controls whether the command is echoed in the terminal or not. - */ - echo?: boolean; - } - - export interface ProcessOptions { - /** - * The current working directory of the executed program or shell. - * If omitted VSCode's current workspace root is used. - */ - cwd?: string; - - /** - * The additional environment of the executed program or shell. If omitted - * the parent process' environment is used. If provided it is merged with - * the parent process' environment. - */ - env?: { [key: string]: string }; - } - - export namespace TaskGroup { - /** - * The clean task group - */ - export const Clean: 'clean'; - /** - * The build task group - */ - export const Build: 'build'; - /** - * The rebuild all task group - */ - export const RebuildAll: 'rebuildAll'; - /** - * The test task group - */ - export const Test: 'test'; - } - - /** - * The supported task groups. - */ - export type TaskGroup = 'clean' | 'build' | 'rebuildAll' | 'test'; - - /** - * The ProblemMatchers type definition. - */ - export type ProblemMatchers = string | ProblemMatcher | (string | ProblemMatcher)[]; - - /** - * A task that starts an external process. - */ - export class ProcessTask { - - /** - * Creates a process task. - * - * @param name the task's name. Is presented in the user interface. - * @param process the process to start. - * @param problemMatchers the problem matchers to use. - */ - constructor(name: string, process: string, problemMatchers?: ProblemMatchers); - - /** - * Creates a process task. - * - * @param name the task's name. Is presented in the user interface. - * @param process the process to start. - * @param args arguments to be passed to the process. - * @param problemMatchers the problem matchers to use. - */ - constructor(name: string, process: string, args: string[], problemMatchers?: ProblemMatchers); - - /** - * Creates a process task. - * - * @param name the task's name. Is presented in the user interface. - * @param process the process to start. - * @param args arguments to be passed to the process. - * @param options additional options for the started process. - * @param problemMatchers the problem matchers to use. - */ - constructor(name: string, process: string, args: string[], options: ProcessOptions, problemMatchers?: ProblemMatchers); - - /** - * The task's name - */ - readonly name: string; - - /** - * The task's identifier. If omitted the name is - * used as an identifier. - */ - identifier: string; - - /** - * Whether the task is a background task or not. - */ - isBackground: boolean; - - /** - * The process to be executed. - */ - readonly process: string; - - /** - * The arguments passed to the process. Defaults to an empty array. - */ - args: string[]; - - /** - * The task group this tasks belongs to. Defaults to undefined meaning - * that the task doesn't belong to any special group. - */ - group?: TaskGroup; - - /** - * The process options used when the process is executed. - * Defaults to an empty object literal. - */ - options: ProcessOptions; - - /** - * The terminal options. Defaults to an empty object literal. - */ - terminal: TerminalBehaviour; - - /** - * The problem matchers attached to the task. Defaults to an empty - * array. - */ - problemMatchers: (string | ProblemMatcher)[]; - } - - export type ShellOptions = { - /** - * The shell executable. - */ - executable: string; - - /** - * The arguments to be passed to the shell executable used to run the task. - */ - shellArgs?: string[]; - - /** - * The current working directory of the executed shell. - * If omitted VSCode's current workspace root is used. - */ - cwd?: string; - - /** - * The additional environment of the executed shell. If omitted - * the parent process' environment is used. If provided it is merged with - * the parent process' environment. - */ - env?: { [key: string]: string }; - } | { - /** - * The current working directory of the executed shell. - * If omitted VSCode's current workspace root is used. - */ - cwd: string; - - /** - * The additional environment of the executed shell. If omitted - * the parent process' environment is used. If provided it is merged with - * the parent process' environment. - */ - env?: { [key: string]: string }; - } | { - /** - * The current working directory of the executed shell. - * If omitted VSCode's current workspace root is used. - */ - cwd?: string; - - /** - * The additional environment of the executed shell. If omitted - * the parent process' environment is used. If provided it is merged with - * the parent process' environment. - */ - env: { [key: string]: string }; - }; - - /** - * A task that executes a shell command. - */ - export class ShellTask { - - /** - * Creates a shell task. - * - * @param name the task's name. Is presented in the user interface. - * @param commandLine the command line to execute. - * @param problemMatchers the problem matchers to use. - */ - constructor(name: string, commandLine: string, problemMatchers?: ProblemMatchers); - - /** - * Creates a shell task. - * - * @param name the task's name. Is presented in the user interface. - * @param commandLine the command line to execute. - * @param options additional options used when creating the shell. - * @param problemMatchers the problem matchers to use. - */ - constructor(name: string, commandLine: string, options: ShellOptions, problemMatchers?: ProblemMatchers); - - /** - * The task's name - */ - readonly name: string; - - /** - * The task's identifier. If omitted the name is - * used as an identifier. - */ - identifier: string; - - /** - * Whether the task is a background task or not. - */ - isBackground: boolean; - - /** - * The command line to execute. - */ - readonly commandLine: string; - - /** - * The task group this tasks belongs to. Defaults to undefined meaning - * that the task doesn't belong to any special group. - */ - group?: TaskGroup; - - /** - * The shell options used when the shell is executed. Defaults to an - * empty object literal. - */ - options: ShellOptions; - - /** - * The terminal options. Defaults to an empty object literal. - */ - terminal: TerminalBehaviour; - - /** - * The problem matchers attached to the task. Defaults to an empty - * array. - */ - problemMatchers: (string | ProblemMatcher)[]; - } - - export type Task = ProcessTask | ShellTask; - - /** - * A task provider allows to add tasks to the task service. - * A task provider is registerd via #workspace.registerTaskProvider. - */ - export interface TaskProvider { - /** - * Provides additional tasks. - * @param token A cancellation token. - * @return a #TaskSet - */ - provideTasks(token: CancellationToken): ProviderResult; - } - - export namespace workspace { - /** - * Register a task provider. - * - * @param provider A task provider. - * @return A [disposable](#Disposable) that unregisters this provider when being disposed. - */ - export function registerTaskProvider(provider: TaskProvider): Disposable; - } - /** * Namespace describing the environment the editor runs in. */ @@ -4497,6 +4007,106 @@ declare module 'vscode' { * @return A new Terminal. */ export function createTerminal(options: TerminalOptions): Terminal; + + /** + * Register a [TreeDataProvider](#TreeDataProvider) for the view contributed using the extension point `views`. + * @param viewId Id of the view contributed using the extension point `views`. + * @param treeDataProvider A [TreeDataProvider](#TreeDataProvider) that provides tree data for the view + */ + export function registerTreeDataProvider(viewId: string, treeDataProvider: TreeDataProvider): Disposable; + } + + /** + * A data provider that provides tree data + */ + export interface TreeDataProvider { + /** + * An optional event to signal that an element or root has changed. + * To signal that root has changed, do not pass any argument or pass `undefined` or `null`. + */ + onDidChangeTreeData?: Event; + + /** + * Get [TreeItem](#TreeItem) representation of the `element` + * + * @param element The element for which [TreeItem](#TreeItem) representation is asked for. + * @return [TreeItem](#TreeItem) representation of the element + */ + getTreeItem(element: T): TreeItem | Thenable; + + /** + * Get the children of `element` or root if no element is passed. + * + * @param element The element from which the provider gets children. Can be `undefined`. + * @return Children of `element` or root if no element is passed. + */ + getChildren(element?: T): ProviderResult; + } + + export class TreeItem { + /** + * A human-readable string describing this item + */ + label: string; + + /** + * The icon path for the tree item + */ + iconPath?: string | Uri | { light: string | Uri; dark: string | Uri }; + + /** + * The [command](#Command) which should be run when the tree item is selected. + */ + command?: Command; + + /** + * [TreeItemCollapsibleState](#TreeItemCollapsibleState) of the tree item. + */ + collapsibleState?: TreeItemCollapsibleState; + + /** + * Context value of the tree item. This can be used to contribute item specific actions in the tree. + * For example, a tree item is given a context value as `folder`. When contributing actions to `view/item/context` + * using `menus` extension point, you can specify context value for key `viewItem` in `when` expression like `viewItem == folder`. + * ``` + * "contributes": { + * "menus": { + * "view/item/context": [ + * { + * "command": "extension.deleteFolder", + * "when": "viewItem == folder" + * } + * ] + * } + * } + * ``` + * This will show action `extension.deleteFolder` only for items with `contextValue` is `folder`. + */ + contextValue?: string; + + /** + * @param label A human-readable string describing this item + * @param collapsibleState [TreeItemCollapsibleState](#TreeItemCollapsibleState) of the tree item. Default is [TreeItemCollapsibleState.None](#TreeItemCollapsibleState.None) + */ + constructor(label: string, collapsibleState?: TreeItemCollapsibleState); + } + + /** + * Collapsible state of the tree item + */ + export enum TreeItemCollapsibleState { + /** + * Determines an item can be neither collapsed nor expanded. Implies it has no children. + */ + None = 0, + /** + * Determines an item is collapsed + */ + Collapsed = 1, + /** + * Determines an item is expanded + */ + Expanded = 2 } /** @@ -4678,6 +4288,8 @@ declare module 'vscode' { * A glob pattern that filters the file events must be provided. Optionally, flags to ignore certain * kinds of events can be provided. To stop listening to events the watcher must be disposed. * + * *Note* that only files within the current [workspace](#workspace.rootPath) can be watched. + * * @param globPattern A glob pattern that is applied to the names of created, changed, and deleted files. * @param ignoreCreateEvents Ignore when files have been created. * @param ignoreChangeEvents Ignore when files have been changed. @@ -4687,7 +4299,7 @@ declare module 'vscode' { export function createFileSystemWatcher(globPattern: string, ignoreCreateEvents?: boolean, ignoreChangeEvents?: boolean, ignoreDeleteEvents?: boolean): FileSystemWatcher; /** - * The folder that is open in VS Code. `undefined` when no folder + * The folder that is open in the editor. `undefined` when no folder * has been opened. * * @readonly @@ -4805,7 +4417,9 @@ declare module 'vscode' { export const onDidCloseTextDocument: Event; /** - * An event that is emitted when a [text document](#TextDocument) is changed. + * An event that is emitted when a [text document](#TextDocument) is changed. This usually happens + * when the [contents](#TextDocument.getText) changes but also when other things like the + * [dirty](TextDocument#isDirty)-state changes. */ export const onDidChangeTextDocument: Event; @@ -5435,7 +5049,7 @@ declare module 'vscode' { * Thenable is a common denominator between ES6 promises, Q, jquery.Deferred, WinJS.Promise, * and others. This API makes no assumption about what promise libary is being used which * enables reusing existing code without migrating to a specific promise implementation. Still, - * we recommend the use of native promises which are available in VS Code. + * we recommend the use of native promises which are available in this editor. */ interface Thenable { /** diff --git a/src/vs/vscode.proposed.d.ts b/src/vs/vscode.proposed.d.ts index cf0218df999bceb3b73c958814eae132059d2a63..2d65428674b927731d824303da71f9115e0f91c6 100644 --- a/src/vs/vscode.proposed.d.ts +++ b/src/vs/vscode.proposed.d.ts @@ -7,87 +7,354 @@ declare module 'vscode' { - export namespace window { + export namespace workspace { - export function sampleFunction(): Thenable; + export const onDidChangeWorkspaceFolders: Event; + + export let workspaceFolders: Uri[] | undefined; } - export namespace window { + /** + * Controls the behaviour of the terminal's visibility. + */ + export enum TaskRevealKind { + /** + * Always brings the terminal to front if the task is executed. + */ + Always = 1, + + /** + * Only brings the terminal to front if a problem is detected executing the task + * (e.g. the task couldn't be started because). + */ + Silent = 2, + + /** + * The terminal never comes to front when the task is executed. + */ + Never = 3 + } + + /** + * Controls how the task channel is used between tasks + */ + export enum TaskPanelKind { + + /** + * Shares a panel with other tasks. This is the default. + */ + Shared = 1, + + /** + * Uses a dedicated panel for this tasks. The panel is not + * shared with other tasks. + */ + Dedicated = 2, + + /** + * Creates a new panel whenever this task is executed. + */ + New = 3 + } + + /** + * Controls how the task is presented in the UI. + */ + export interface TaskPresentationOptions { + /** + * Controls whether the task output is reveal in the user interface. + * Defaults to `RevealKind.Always`. + */ + reveal?: TaskRevealKind; + + /** + * Controls whether the command associated with the task is echoed + * in the user interface. + */ + echo?: boolean; + + /** + * Controls whether the panel showing the task output is taking focus. + */ + focus?: boolean; + + /** + * Controls if the task panel is used for this task only (dedicated), + * shared between tasks (shared) or if a new panel is created on + * every task execution (new). Defaults to `TaskInstanceKind.Shared` + */ + panel?: TaskPanelKind; + } + + /** + * A grouping for tasks. The editor by default supports the + * 'Clean', 'Build', 'RebuildAll' and 'Test' group. + */ + export class TaskGroup { + + /** + * The clean task group; + */ + public static Clean: TaskGroup; + + /** + * The build task group; + */ + public static Build: TaskGroup; + + /** + * The rebuild all task group; + */ + public static RebuildAll: TaskGroup; + /** - * Register a [TreeDataProvider](#TreeDataProvider) for the registered view `id`. - * @param viewId View id. - * @param treeDataProvider A [TreeDataProvider](#TreeDataProvider) that provides tree data for the view + * The test all task group; */ - export function registerTreeDataProviderForView(viewId: string, treeDataProvider: TreeDataProvider): Disposable; + public static Test: TaskGroup; + + private constructor(id: string, label: string); } + /** - * A data provider that provides tree data for a view + * A structure that defines a task kind in the system. + * The value must be JSON-stringifyable. */ - export interface TreeDataProvider { + export interface TaskKind { /** - * An optional event to signal that an element or root has changed. + * The task type as defined by the extension implementing a + * task provider. Examples are 'grunt', 'npm' or 'tsc'. + * Usually a task provider defines more properties to identify + * a task. They need to be defined in the package.json of the + * extension under the 'taskKinds' extension point. */ - onDidChangeTreeData?: Event; + readonly type: string; + } + /** + * Options for a process execution + */ + export interface ProcessExecutionOptions { /** - * get [TreeItem](#TreeItem) representation of the `element` + * The current working directory of the executed program or shell. + * If omitted the tools current workspace root is used. + */ + cwd?: string; + + /** + * The additional environment of the executed program or shell. If omitted + * the parent process' environment is used. If provided it is merged with + * the parent process' environment. + */ + env?: { [key: string]: string }; + } + + /** + * The execution of a task happens as a external process + * without shell interaction. + */ + export class ProcessExecution { + + /** + * Creates a process execution. * - * @param element The element for which [TreeItem](#TreeItem) representation is asked for. - * @return [TreeItem](#TreeItem) representation of the element + * @param process The process to start. + * @param options Optional options for the started process. + */ + constructor(process: string, options?: ProcessExecutionOptions); + + /** + * Creates a process execution. + * + * @param process The process to start. + * @param args Arguments to be passed to the process. + * @param options Optional options for the started process. + */ + constructor(process: string, args: string[], options?: ProcessExecutionOptions); + + /** + * The process to be executed. + */ + process: string; + + /** + * The arguments passed to the process. Defaults to an empty array. + */ + args: string[]; + + /** + * The process options used when the process is executed. + * Defaults to undefined. + */ + options?: ProcessExecutionOptions; + } + + /** + * Options for a shell execution + */ + export type ShellExecutionOptions = { + /** + * The shell executable. */ - getTreeItem(element: T): TreeItem; + executable?: string; /** - * get the children of `element` or root. + * The arguments to be passed to the shell executable used to run the task. + */ + shellArgs?: string[]; + + /** + * The current working directory of the executed shell. + * If omitted the tools current workspace root is used. + */ + cwd?: string; + + /** + * The additional environment of the executed shell. If omitted + * the parent process' environment is used. If provided it is merged with + * the parent process' environment. + */ + env?: { [key: string]: string }; + }; + + + export class ShellExecution { + /** + * Creates a process execution. * - * @param element The element from which the provider gets children for. - * @return Children of `element` or root. + * @param commandLine The command line to execute. + * @param options Optional options for the started the shell. */ - getChildren(element?: T): T[] | Thenable; + constructor(commandLine: string, options?: ShellExecutionOptions); + + /** + * The shell command line + */ + commandLine: string; + + /** + * The shell options used when the command line is executed in a shell. + * Defaults to undefined. + */ + options?: ShellExecutionOptions; } - export interface TreeItem { + /** + * A task to execute + */ + export class Task { + /** - * Label of the tree item + * Creates a new task. A task without an exection set is resolved + * before executed. + * + * @param kind The task kind as defined in the 'taskKinds' extension point. + * @param name The task's name. Is presented in the user interface. */ - readonly label: string; + constructor(kind: TaskKind, name: string); /** - * The icon path for the tree item + * Creates a new task. + * + * @param kind The task kind as defined in the 'taskKinds' extension point. + * @param name The task's name. Is presented in the user interface. + * @param execution The process or shell execution. */ - readonly iconPath?: string | Uri | { light: string | Uri; dark: string | Uri }; + constructor(kind: TaskKind, name: string, execution: ProcessExecution | ShellExecution); /** - * The [command](#Command) which should be run when the tree item - * is open in the Source Control viewlet. + * Creates a new task. + * + * @param kind The task kind as defined in the 'taskKinds' extension point. + * @param name The task's name. Is presented in the user interface. + * @param execution The process or shell execution. + * @param problemMatchers the names of problem matchers to use, like '$tsc' + * or '$eslint'. Problem matchers can be contributed by an extension using + * the `problemMatchers` extension point. */ - readonly command?: Command; + constructor(kind: TaskKind, name: string, execution: ProcessExecution | ShellExecution, problemMatchers?: string | string[]); /** - * Context value of the tree node + * The task's kind. */ - readonly contextValue?: string; + kind: TaskKind; /** - * Collapsible state of the tree item. - * Required only when item has children. + * The task's name */ - readonly collapsibleState?: TreeItemCollapsibleState; + name: string; + + /** + * The task's execution engine + */ + execution: ProcessExecution | ShellExecution; + + /** + * Whether the task is a background task or not. + */ + isBackground: boolean; + + /** + * A human-readable string describing the source of this + * shell task, e.g. 'gulp' or 'npm'. + */ + source?: string; + + /** + * The task group this tasks belongs to. See TaskGroup + * for a predefined set of available groups. + * Defaults to undefined meaning that the task doesn't + * belong to any special group. + */ + group?: TaskGroup; + + /** + * The presentation options. Defaults to an empty literal. + */ + presentationOptions: TaskPresentationOptions; + + /** + * The problem matchers attached to the task. Defaults to an empty + * array. + */ + problemMatchers: string[]; } /** - * Collapsible state of the tree item + * A task provider allows to add tasks to the task service. + * A task provider is registerd via #workspace.registerTaskProvider. */ - export enum TreeItemCollapsibleState { + export interface TaskProvider { /** - * Determines an item is collapsed + * Provides tasks. + * @param token A cancellation token. + * @return an array of tasks */ - Collapsed = 1, + provideTasks(token: CancellationToken): ProviderResult; + + /** + * Resolves a task the has no execution set. + * @param task The task to resolve. + * @param token A cancellation token. + * @return the resolved task + */ + resolveTask(task: Task, token: CancellationToken): ProviderResult; + } + + export namespace workspace { /** - * Determines an item is expanded + * Register a task provider. + * + * @param type The task kind type this provider is registered for. + * @param provider A task provider. + * @return A [disposable](#Disposable) that unregisters this provider when being disposed. */ - Expanded = 2 + export function registerTaskProvider(type: string, provider: TaskProvider): Disposable; + } + + export namespace window { + + export function sampleFunction(): Thenable; } /** @@ -167,4 +434,67 @@ declare module 'vscode' { */ onData(callback: (data: string) => any): void; } + + /** + * Namespace for dealing with debug sessions. + */ + export namespace debug { + + /** + * An [event](#Event) which fires when a debug session has terminated. + */ + export const onDidTerminateDebugSession: Event; + + /** + * Create a new debug session based on the given launchConfig. + * @param launchConfig + */ + export function createDebugSession(launchConfig: DebugConfiguration): Thenable; + } + + /** + * Configuration for a debug session. + */ + export interface DebugConfiguration { + /** + * The type for the debug session. + */ + type: string; + + /** + * An optional name for the debug session. + */ + name?: string; + + /** + * The request type of the debug session. + */ + request: string; + + /** + * Additional debug type specific properties. + */ + [key: string]: any; + } + + /** + * A debug session. + */ + export interface DebugSession { + + /** + * The debug session's type from the debug configuration. + */ + readonly type: string; + + /** + * The debug session's name from the debug configuration. + */ + readonly name: string; + + /** + * Send a custom request to the debug adapter. + */ + customRequest(command: string, args?: any): Thenable; + } } diff --git a/src/vs/workbench/api/electron-browser/extensionHost.contribution.ts b/src/vs/workbench/api/electron-browser/extensionHost.contribution.ts index f60782ffe63179ed21f2cd102aae43d5388821ee..0ea7d2b799febd4002799441d18f917eb64cc580 100644 --- a/src/vs/workbench/api/electron-browser/extensionHost.contribution.ts +++ b/src/vs/workbench/api/electron-browser/extensionHost.contribution.ts @@ -6,7 +6,7 @@ 'use strict'; import { IWorkbenchContribution, IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } from 'vs/workbench/common/contributions'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { IInstantiationService, IConstructorSignature0 } from 'vs/platform/instantiation/common/instantiation'; import { IThreadService } from 'vs/workbench/services/thread/common/threadService'; import { MainContext, InstanceCollection } from '../node/extHost.protocol'; @@ -15,6 +15,7 @@ import { IExtensionService } from 'vs/platform/extensions/common/extensions'; // --- addressable import { MainThreadCommands } from './mainThreadCommands'; import { MainThreadConfiguration } from './mainThreadConfiguration'; +import { MainThreadDebugService } from './mainThreadDebugService'; import { MainThreadDiagnostics } from './mainThreadDiagnostics'; import { MainThreadDocuments } from './mainThreadDocuments'; import { MainThreadEditors } from './mainThreadEditors'; @@ -39,7 +40,7 @@ import { MainThreadSCM } from './mainThreadSCM'; // --- other interested parties import { MainThreadDocumentsAndEditors } from './mainThreadDocumentsAndEditors'; import { JSONValidationExtensionPoint } from 'vs/platform/jsonschemas/common/jsonValidationExtensionPoint'; -import { LanguageConfigurationFileHandler } from 'vs/editor/node/languageConfigurationExtensionPoint'; +import { LanguageConfigurationFileHandler } from 'vs/workbench/parts/codeEditor/electron-browser/languageConfiguration/languageConfigurationExtensionPoint'; import { SaveParticipant } from './mainThreadSaveParticipant'; // --- registers itself as service @@ -70,6 +71,7 @@ export class ExtHostContribution implements IWorkbenchContribution { const col = new InstanceCollection(); col.define(MainContext.MainThreadCommands).set(create(MainThreadCommands)); col.define(MainContext.MainThreadConfiguration).set(create(MainThreadConfiguration)); + col.define(MainContext.MainThreadDebugService).set(create(MainThreadDebugService)); col.define(MainContext.MainThreadDiagnostics).set(create(MainThreadDiagnostics)); col.define(MainContext.MainThreadDocuments).set(this.instantiationService.createInstance(MainThreadDocuments, documentsAndEditors)); col.define(MainContext.MainThreadEditors).set(this.instantiationService.createInstance(MainThreadEditors, documentsAndEditors)); diff --git a/src/vs/workbench/api/electron-browser/mainThreadConfiguration.ts b/src/vs/workbench/api/electron-browser/mainThreadConfiguration.ts index f3d1533b7dbc47bf0f8ef8cf3ec3cb599ed75adc..b08d8877d07abcfa65cc6a273ad2768f1bb34303 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadConfiguration.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadConfiguration.ts @@ -26,7 +26,7 @@ export class MainThreadConfiguration extends MainThreadConfigurationShape { const proxy = threadService.get(ExtHostContext.ExtHostConfiguration); this._toDispose = configurationService.onDidUpdateConfiguration(() => { - proxy.$acceptConfigurationChanged(configurationService.values()); + proxy.$acceptConfigurationChanged(configurationService.getConfigurationData()); }); } diff --git a/src/vs/workbench/api/electron-browser/mainThreadDebugService.ts b/src/vs/workbench/api/electron-browser/mainThreadDebugService.ts new file mode 100644 index 0000000000000000000000000000000000000000..15b4a1ec64947e9740291e5045fa309571640ab8 --- /dev/null +++ b/src/vs/workbench/api/electron-browser/mainThreadDebugService.ts @@ -0,0 +1,68 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +'use strict'; + +import { IDisposable, dispose } from 'vs/base/common/lifecycle'; +import { IDebugService, IProcess, IConfig } from 'vs/workbench/parts/debug/common/debug'; +import { IThreadService } from 'vs/workbench/services/thread/common/threadService'; +import { TPromise } from 'vs/base/common/winjs.base'; +import { ExtHostContext, ExtHostDebugServiceShape, MainThreadDebugServiceShape, DebugSessionUUID } from '../node/extHost.protocol'; + +export class MainThreadDebugService extends MainThreadDebugServiceShape { + + private _proxy: ExtHostDebugServiceShape; + private _toDispose: IDisposable[]; + + constructor( + @IThreadService threadService: IThreadService, + @IDebugService private debugService: IDebugService + ) { + super(); + this._proxy = threadService.get(ExtHostContext.ExtHostDebugService); + this._toDispose = []; + this._toDispose.push(debugService.onDidEndProcess(proc => this._proxy.$acceptDebugSessionTerminated(proc.getId(), proc.configuration.type, proc.name))); + } + + public dispose(): void { + this._toDispose = dispose(this._toDispose); + } + + public $createDebugSession(configuration: IConfig): TPromise { + if (configuration.request !== 'launch' && configuration.request !== 'attach') { + return TPromise.wrapError(`only 'launch' or 'attach' allowed for 'request' attribute`); + } + return this.debugService.createProcess(configuration).then(process => { + if (process) { + return process.getId(); + } + return TPromise.wrapError('cannot create debug session'); + }, err => { + return TPromise.wrapError(err && err.message ? err.message : 'cannot create debug session'); + }); + } + + public $customDebugAdapterRequest(sessionId: DebugSessionUUID, request: string, args: any): TPromise { + const process = this._findProcessByUUID(sessionId); + if (process) { + return process.session.custom(request, args).then(response => { + if (response.success) { + return response.body; + } else { + return TPromise.wrapError(response.message); + } + }); + } + return TPromise.wrapError('debug session not found'); + } + + private _findProcessByUUID(processId: DebugSessionUUID): IProcess | null { + const processes = this.debugService.getModel().getProcesses(); + const result = processes.filter(process => process.getId() === processId); + if (result.length > 0) { + return processes[0]; // there can only be one + } + return null; + } +} diff --git a/src/vs/workbench/api/electron-browser/mainThreadDocuments.ts b/src/vs/workbench/api/electron-browser/mainThreadDocuments.ts index 120beef086f76c1ce083619f616cf28dd0e19b28..83476253ea540bf8a7f9e2250cb8e4b0e6d19752 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadDocuments.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadDocuments.ts @@ -16,7 +16,7 @@ import { IModeService } from 'vs/editor/common/services/modeService'; import { IUntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService'; import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService'; import { ExtHostContext, MainThreadDocumentsShape, ExtHostDocumentsShape } from '../node/extHost.protocol'; -import { ITextModelResolverService } from 'vs/editor/common/services/resolverService'; +import { ITextModelService } from 'vs/editor/common/services/resolverService'; import { ICodeEditorService } from 'vs/editor/common/services/codeEditorService'; import { ITextSource } from 'vs/editor/common/model/textSource'; import { MainThreadDocumentsAndEditors } from './mainThreadDocumentsAndEditors'; @@ -71,7 +71,7 @@ export class MainThreadDocuments extends MainThreadDocumentsShape { private _modelService: IModelService; private _modeService: IModeService; - private _textModelResolverService: ITextModelResolverService; + private _textModelResolverService: ITextModelService; private _textFileService: ITextFileService; private _codeEditorService: ICodeEditorService; private _fileService: IFileService; @@ -93,7 +93,7 @@ export class MainThreadDocuments extends MainThreadDocumentsShape { @ITextFileService textFileService: ITextFileService, @ICodeEditorService codeEditorService: ICodeEditorService, @IFileService fileService: IFileService, - @ITextModelResolverService textModelResolverService: ITextModelResolverService, + @ITextModelService textModelResolverService: ITextModelService, @IUntitledEditorService untitledEditorService: IUntitledEditorService, @IEditorGroupService editorGroupService: IEditorGroupService ) { @@ -123,12 +123,12 @@ export class MainThreadDocuments extends MainThreadDocumentsShape { })); this._toDispose.push(textFileService.models.onModelReverted(e => { if (this._shouldHandleFileEvent(e)) { - this._proxy.$acceptModelReverted(e.resource.toString()); + this._proxy.$acceptDirtyStateChanged(e.resource.toString(), false); } })); this._toDispose.push(textFileService.models.onModelDirty(e => { if (this._shouldHandleFileEvent(e)) { - this._proxy.$acceptModelDirty(e.resource.toString()); + this._proxy.$acceptDirtyStateChanged(e.resource.toString(), true); } })); @@ -234,15 +234,17 @@ export class MainThreadDocuments extends MainThreadDocumentsShape { }, err => this._doCreateUntitled(asFileUri).then(resource => !!resource)); } - private _doCreateUntitled(uri?: URI, modeId?: string, initialValue?: string): TPromise { - let input = this._untitledEditorService.createOrGet(uri, modeId, initialValue); - return input.resolve(true).then(model => { - if (!this._modelIsSynced[input.getResource().toString()]) { - throw new Error(`expected URI ${input.getResource().toString()} to have come to LIFE`); + private _doCreateUntitled(resource?: URI, modeId?: string, initialValue?: string): TPromise { + return this._untitledEditorService.loadOrCreate({ resource, modeId, initialValue }).then(model => { + const resource = model.getResource(); + + if (!this._modelIsSynced[resource.toString()]) { + throw new Error(`expected URI ${resource.toString()} to have come to LIFE`); } - return this._proxy.$acceptModelDirty(input.getResource().toString()); // mark as dirty - }).then(() => { - return input.getResource(); + + this._proxy.$acceptDirtyStateChanged(resource.toString(), true); // mark as dirty + + return resource; }); } diff --git a/src/vs/workbench/api/electron-browser/mainThreadDocumentsAndEditors.ts b/src/vs/workbench/api/electron-browser/mainThreadDocumentsAndEditors.ts index 974d8a45c7091f2aa5759fd1ea712aef15ba0fd8..a6be9198dd5c633bb3ccfa70c1853607df44538b 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadDocumentsAndEditors.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadDocumentsAndEditors.ts @@ -10,7 +10,7 @@ import { compare } from 'vs/base/common/strings'; import { delta } from 'vs/base/common/arrays'; import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { ICodeEditorService } from 'vs/editor/common/services/codeEditorService'; -import Event, { Emitter, any } from 'vs/base/common/event'; +import Event, { Emitter } from 'vs/base/common/event'; import { ExtHostContext, ExtHostDocumentsAndEditorsShape, IModelAddedData, ITextEditorAddData, IDocumentsAndEditorsDelta } from '../node/extHost.protocol'; import { MainThreadTextEditor } from './mainThreadEditor'; import { IThreadService } from 'vs/workbench/services/thread/common/threadService'; @@ -127,12 +127,9 @@ class MainThreadDocumentAndEditorStateComputer { } private _onDidAddEditor(e: ICommonCodeEditor): void { - const listener = any( - e.onDidChangeModel, - e.onDidFocusEditor, - e.onDidBlurEditor - )(this._updateState, this); - this._toDisposeOnEditorRemove.set(e.getId(), listener); + this._toDisposeOnEditorRemove.set(e.getId(), e.onDidChangeModel(() => this._updateState())); + this._toDisposeOnEditorRemove.set(e.getId(), e.onDidFocusEditor(() => this._updateState())); + this._toDisposeOnEditorRemove.set(e.getId(), e.onDidBlurEditor(() => this._updateState())); this._updateState(); } diff --git a/src/vs/workbench/api/electron-browser/mainThreadEditor.ts b/src/vs/workbench/api/electron-browser/mainThreadEditor.ts index cd44f6778a1dcc879ab732c77f0ea60f5f5f0f88..a875e16c35ef2d8dcddfd649d571d2aeac0a5747 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadEditor.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadEditor.ts @@ -254,7 +254,7 @@ export class MainThreadTextEditor { break; case TextEditorRevealType.InCenter: this._codeEditor.revealRangeInCenter(range); - break;; + break; case TextEditorRevealType.InCenterIfOutsideViewport: this._codeEditor.revealRangeInCenterIfOutsideViewport(range); break; diff --git a/src/vs/workbench/api/electron-browser/mainThreadExtensionService.ts b/src/vs/workbench/api/electron-browser/mainThreadExtensionService.ts index 14b8d69f5dc5fdff2d0cb8aaf3fb634cd346f866..43b35d1908ab251d878b5e992ebbd8915a1f8717 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadExtensionService.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadExtensionService.ts @@ -89,13 +89,17 @@ export class MainProcessExtensionService extends AbstractExtensionService { + $show(options: IPickOptions): TPromise { const myToken = ++this._token; @@ -59,14 +59,14 @@ export class MainThreadQuickOpen extends MainThreadQuickOpenShape { }); } - $setItems(items: MyQuickPickItems[]): Thenable { + $setItems(items: MyQuickPickItems[]): TPromise { if (this._doSetItems) { this._doSetItems(items); } return undefined; } - $setError(error: Error): Thenable { + $setError(error: Error): TPromise { if (this._doSetError) { this._doSetError(error); } diff --git a/src/vs/workbench/api/electron-browser/mainThreadSaveParticipant.ts b/src/vs/workbench/api/electron-browser/mainThreadSaveParticipant.ts index d90c6409a68117243f848c29a5d9497b4dbd53ef..db1d0da3b56defc3d2a9b741d0cb61e4531ef091 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadSaveParticipant.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadSaveParticipant.ts @@ -40,8 +40,8 @@ class TrimWhitespaceParticipant implements INamedSaveParticpant { // Nothing } - public participate(model: ITextFileEditorModel, env: { reason: SaveReason }): any { - if (this.configurationService.lookup('files.trimTrailingWhitespace', model.textEditorModel.getLanguageIdentifier().language).value) { + public participate(model: ITextFileEditorModel, env: { reason: SaveReason }): void { + if (this.configurationService.lookup('files.trimTrailingWhitespace', { overrideIdentifier: model.textEditorModel.getLanguageIdentifier().language, resource: model.getResource() }).value) { this.doTrimTrailingWhitespace(model.textEditorModel, env.reason === SaveReason.AUTO); } } @@ -98,8 +98,8 @@ export class FinalNewLineParticipant implements INamedSaveParticpant { // Nothing } - public participate(model: ITextFileEditorModel, env: { reason: SaveReason }): any { - if (this.configurationService.lookup('files.insertFinalNewline', model.textEditorModel.getLanguageIdentifier().language).value) { + public participate(model: ITextFileEditorModel, env: { reason: SaveReason }): void { + if (this.configurationService.lookup('files.insertFinalNewline', { overrideIdentifier: model.textEditorModel.getLanguageIdentifier().language, resource: model.getResource() }).value) { this.doInsertFinalNewLine(model.textEditorModel); } } @@ -138,11 +138,11 @@ class FormatOnSaveParticipant implements INamedSaveParticpant { // Nothing } - participate(editorModel: ITextFileEditorModel, env: { reason: SaveReason }): TPromise { + participate(editorModel: ITextFileEditorModel, env: { reason: SaveReason }): TPromise { const model = editorModel.textEditorModel; if (env.reason === SaveReason.AUTO - || !this._configurationService.lookup('editor.formatOnSave', model.getLanguageIdentifier().language).value) { + || !this._configurationService.lookup('editor.formatOnSave', { overrideIdentifier: model.getLanguageIdentifier().language, resource: editorModel.getResource() }).value) { return undefined; } @@ -204,7 +204,7 @@ class ExtHostSaveParticipant implements INamedSaveParticpant { this._proxy = threadService.get(ExtHostContext.ExtHostDocumentSaveParticipant); } - participate(editorModel: ITextFileEditorModel, env: { reason: SaveReason }): TPromise { + participate(editorModel: ITextFileEditorModel, env: { reason: SaveReason }): TPromise { return new TPromise((resolve, reject) => { setTimeout(reject, 1750); this._proxy.$participateInSave(editorModel.getResource(), env.reason).then(values => { @@ -240,7 +240,7 @@ export class SaveParticipant implements ISaveParticipant { // Hook into model TextFileEditorModel.setSaveParticipant(this); } - participate(model: ITextFileEditorModel, env: { reason: SaveReason }): TPromise { + participate(model: ITextFileEditorModel, env: { reason: SaveReason }): TPromise { const stats: { [name: string]: number } = Object.create(null); diff --git a/src/vs/workbench/api/electron-browser/mainThreadStatusBar.ts b/src/vs/workbench/api/electron-browser/mainThreadStatusBar.ts index d16e17cda090695e144958d13f70e0f761ddb18d..1edba109555a14eac3daf5228a0e657db746ade2 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadStatusBar.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadStatusBar.ts @@ -7,7 +7,7 @@ import { IStatusbarService, StatusbarAlignment as MainThreadStatusBarAlignment } from 'vs/platform/statusbar/common/statusbar'; import { IDisposable } from 'vs/base/common/lifecycle'; import { MainThreadStatusBarShape } from '../node/extHost.protocol'; -import { ThemeColor } from 'vs/editor/common/editorCommon'; +import { ThemeColor } from "vs/platform/theme/common/themeService"; export class MainThreadStatusBar extends MainThreadStatusBarShape { private mapIdToDisposable: { [id: number]: IDisposable }; diff --git a/src/vs/workbench/api/electron-browser/mainThreadTreeViews.ts b/src/vs/workbench/api/electron-browser/mainThreadTreeViews.ts index 186c646eacedad682be03c4242368a93bc06ca23..18ea315cca72b41bf41ed9a7498668371cf03434 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadTreeViews.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadTreeViews.ts @@ -9,7 +9,8 @@ import { TPromise } from 'vs/base/common/winjs.base'; import { IThreadService } from 'vs/workbench/services/thread/common/threadService'; import { ExtHostContext, MainThreadTreeViewsShape, ExtHostTreeViewsShape } from '../node/extHost.protocol'; import { IMessageService, Severity } from 'vs/platform/message/common/message'; -import { ViewsRegistry, ITreeViewDataProvider, ITreeItem, TreeItemCollapsibleState } from 'vs/workbench/parts/views/browser/views'; +import { ViewsRegistry } from 'vs/workbench/parts/views/browser/viewsRegistry'; +import { ITreeViewDataProvider, ITreeItem, TreeItemCollapsibleState } from 'vs/workbench/parts/views/common/views'; export class MainThreadTreeViews extends MainThreadTreeViewsShape { @@ -39,8 +40,8 @@ type TreeItemHandle = number; class TreeViewDataProvider implements ITreeViewDataProvider { - private _onDidChange: Emitter = new Emitter(); - readonly onDidChange: Event = this._onDidChange.event; + private _onDidChange: Emitter = new Emitter(); + readonly onDidChange: Event = this._onDidChange.event; private childrenMap: Map = new Map(); private itemsMap: Map = new Map(); diff --git a/src/vs/workbench/api/electron-browser/mainThreadWorkspace.ts b/src/vs/workbench/api/electron-browser/mainThreadWorkspace.ts index 707349e5a9379f80ea7568eadf3c83d64dee59b1..6aa919fe9ebbac33ca99b631f0e56663ed07922d 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadWorkspace.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadWorkspace.ts @@ -13,47 +13,49 @@ import { ITextFileService } from 'vs/workbench/services/textfile/common/textfile import { ICommonCodeEditor, isCommonCodeEditor } from 'vs/editor/common/editorCommon'; import { bulkEdit, IResourceEdit } from 'vs/editor/common/services/bulkEdit'; import { TPromise } from 'vs/base/common/winjs.base'; -import { Uri } from 'vscode'; -import { MainThreadWorkspaceShape } from '../node/extHost.protocol'; -import { ITextModelResolverService } from 'vs/editor/common/services/resolverService'; +import { MainThreadWorkspaceShape, ExtHostWorkspaceShape, ExtHostContext } from '../node/extHost.protocol'; +import { ITextModelService } from 'vs/editor/common/services/resolverService'; import { IFileService } from 'vs/platform/files/common/files'; +import { IThreadService } from 'vs/workbench/services/thread/common/threadService'; +import { IDisposable } from 'vs/base/common/lifecycle'; + export class MainThreadWorkspace extends MainThreadWorkspaceShape { - private _activeSearches: { [id: number]: TPromise } = Object.create(null); - private _searchService: ISearchService; - private _contextService: IWorkspaceContextService; - private _textFileService: ITextFileService; - private _editorService: IWorkbenchEditorService; - private _textModelResolverService: ITextModelResolverService; - private _fileService: IFileService; + private readonly _toDispose: IDisposable[] = []; + private readonly _activeSearches: { [id: number]: TPromise } = Object.create(null); + private readonly _proxy: ExtHostWorkspaceShape; constructor( - @ISearchService searchService: ISearchService, - @IWorkspaceContextService contextService: IWorkspaceContextService, - @ITextFileService textFileService: ITextFileService, - @IWorkbenchEditorService editorService: IWorkbenchEditorService, - @ITextModelResolverService textModelResolverService: ITextModelResolverService, - @IFileService fileService: IFileService + @ISearchService private readonly _searchService: ISearchService, + @IWorkspaceContextService private readonly _contextService: IWorkspaceContextService, + @ITextFileService private readonly _textFileService: ITextFileService, + @IWorkbenchEditorService private readonly _editorService: IWorkbenchEditorService, + @ITextModelService private readonly _textModelResolverService: ITextModelService, + @IFileService private readonly _fileService: IFileService, + @IThreadService threadService: IThreadService ) { super(); + this._proxy = threadService.get(ExtHostContext.ExtHostWorkspace); + this._contextService.onDidChangeWorkspaceRoots(this._onDidChangeWorkspace, this, this._toDispose); + } + + // --- workspace --- - this._searchService = searchService; - this._contextService = contextService; - this._textFileService = textFileService; - this._editorService = editorService; - this._fileService = fileService; - this._textModelResolverService = textModelResolverService; + private _onDidChangeWorkspace(): void { + this._proxy.$acceptWorkspaceData(this._contextService.getWorkspace2()); } + // --- search --- + $startSearch(include: string, exclude: string, maxResults: number, requestId: number): Thenable { - const workspace = this._contextService.getWorkspace(); + const workspace = this._contextService.getWorkspace2(); if (!workspace) { return undefined; } const search = this._searchService.search({ - folderResources: [workspace.resource], + folderQueries: workspace.roots.map(root => ({ folder: root })), type: QueryType.File, maxResults, includePattern: { [include]: true }, @@ -84,6 +86,8 @@ export class MainThreadWorkspace extends MainThreadWorkspaceShape { return undefined; } + // --- save & edit resources --- + $saveAll(includeUntitled?: boolean): Thenable { return this._textFileService.saveAll(includeUntitled).then(result => { return result.results.every(each => each.success === true); diff --git a/src/vs/workbench/api/node/extHost.api.impl.ts b/src/vs/workbench/api/node/extHost.api.impl.ts index eb5b38f2391f0218b569e991ae65e0ff5725e206..6fa4d07407c9ffebfc5bd729f5fc1e11c34edf3f 100644 --- a/src/vs/workbench/api/node/extHost.api.impl.ts +++ b/src/vs/workbench/api/node/extHost.api.impl.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ 'use strict'; -import { Emitter, mapEvent } from 'vs/base/common/event'; +import { Emitter } from 'vs/base/common/event'; import { TrieMap } from 'vs/base/common/map'; import { score } from 'vs/editor/common/modes/languageSelector'; import * as Platform from 'vs/base/common/platform'; @@ -34,6 +34,7 @@ import { ExtHostLanguages } from 'vs/workbench/api/node/extHostLanguages'; import { ExtHostLanguageFeatures } from 'vs/workbench/api/node/extHostLanguageFeatures'; import { ExtHostApiCommands } from 'vs/workbench/api/node/extHostApiCommands'; import { ExtHostTask } from 'vs/workbench/api/node/extHostTask'; +import { ExtHostDebugService } from 'vs/workbench/api/node/extHostDebugService'; import * as extHostTypes from 'vs/workbench/api/node/extHostTypes'; import URI from 'vs/base/common/uri'; import Severity from 'vs/base/common/severity'; @@ -41,7 +42,6 @@ import EditorCommon = require('vs/editor/common/editorCommon'); import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; import { ExtHostExtensionService } from 'vs/workbench/api/node/extHostExtensionService'; import { TPromise } from 'vs/base/common/winjs.base'; -import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { CancellationTokenSource } from 'vs/base/common/cancellation'; import * as vscode from 'vscode'; @@ -55,6 +55,12 @@ export interface IExtensionApiFactory { (extension: IExtensionDescription): typeof vscode; } +function assertProposedApi(extension: IExtensionDescription): void { + if (!extension.enableProposedApi) { + throw new Error(`[${extension.id}]: Proposed API is only available when running out of dev or with the following command line switch: --enable-proposed-api ${extension.id}`); + } +} + function proposedApiFunction(extension: IExtensionDescription, fn: T): T { if (extension.enableProposedApi) { return fn; @@ -65,33 +71,6 @@ function proposedApiFunction(extension: IExtensionDescription, fn: T): T { } } -function proposed(extension: IExtensionDescription): Function { - return (target: any, key: string, descriptor: any) => { - let fnKey: string = null; - let fn: Function = null; - - if (typeof descriptor.value === 'function') { - fnKey = 'value'; - fn = descriptor.value; - } else if (typeof descriptor.get === 'function') { - fnKey = 'get'; - fn = descriptor.get; - } - - if (!fn) { - throw new Error('not supported'); - } - - if (extension.enableProposedApi) { - return; - } - - descriptor[fnKey] = () => { - throw new Error(`${extension.id} cannot access proposed api`); - }; - }; -} - /** * This method instantiates and returns the extension API surface */ @@ -99,20 +78,21 @@ export function createApiFactory( initData: IInitData, threadService: IThreadService, extensionService: ExtHostExtensionService, - contextService: IWorkspaceContextService, telemetryService: ITelemetryService ): IExtensionApiFactory { // Addressable instances const col = new InstanceCollection(); const extHostHeapService = col.define(ExtHostContext.ExtHostHeapService).set(new ExtHostHeapService()); + const extHostDebugService = col.define(ExtHostContext.ExtHostDebugService).set(new ExtHostDebugService(threadService)); const extHostDocumentsAndEditors = col.define(ExtHostContext.ExtHostDocumentsAndEditors).set(new ExtHostDocumentsAndEditors(threadService)); const extHostDocuments = col.define(ExtHostContext.ExtHostDocuments).set(new ExtHostDocuments(threadService, extHostDocumentsAndEditors)); const extHostDocumentSaveParticipant = col.define(ExtHostContext.ExtHostDocumentSaveParticipant).set(new ExtHostDocumentSaveParticipant(extHostDocuments, threadService.get(MainContext.MainThreadWorkspace))); const extHostEditors = col.define(ExtHostContext.ExtHostEditors).set(new ExtHostEditors(threadService, extHostDocumentsAndEditors)); const extHostCommands = col.define(ExtHostContext.ExtHostCommands).set(new ExtHostCommands(threadService, extHostHeapService)); const extHostTreeViews = col.define(ExtHostContext.ExtHostTreeViews).set(new ExtHostTreeViews(threadService, extHostCommands)); - const extHostConfiguration = col.define(ExtHostContext.ExtHostConfiguration).set(new ExtHostConfiguration(threadService.get(MainContext.MainThreadConfiguration), initData.configuration)); + const extHostWorkspace = col.define(ExtHostContext.ExtHostWorkspace).set(new ExtHostWorkspace(threadService, initData.workspace)); + const extHostConfiguration = col.define(ExtHostContext.ExtHostConfiguration).set(new ExtHostConfiguration(threadService.get(MainContext.MainThreadConfiguration), extHostWorkspace, initData.configuration)); const extHostDiagnostics = col.define(ExtHostContext.ExtHostDiagnostics).set(new ExtHostDiagnostics(threadService)); const languageFeatures = col.define(ExtHostContext.ExtHostLanguageFeatures).set(new ExtHostLanguageFeatures(threadService, extHostDocuments, extHostCommands, extHostHeapService, extHostDiagnostics)); const extHostFileSystemEvent = col.define(ExtHostContext.ExtHostFileSystemEventService).set(new ExtHostFileSystemEventService()); @@ -128,8 +108,6 @@ export function createApiFactory( const extHostStatusBar = new ExtHostStatusBar(threadService); const extHostProgress = new ExtHostProgress(threadService.get(MainContext.MainThreadProgress)); const extHostOutputService = new ExtHostOutputService(threadService); - const workspacePath = contextService.hasWorkspace() ? contextService.getWorkspace().resource.fsPath : undefined; - const extHostWorkspace = new ExtHostWorkspace(threadService, workspacePath); const extHostLanguages = new ExtHostLanguages(threadService); // Register API-ish commands @@ -153,14 +131,13 @@ export function createApiFactory( } } - class Commands { - + // namespace: commands + const commands: typeof vscode.commands = { registerCommand(id: string, command: (...args: any[]) => T | Thenable, thisArgs?: any): vscode.Disposable { return extHostCommands.registerCommand(id, command, thisArgs); - } - + }, registerTextEditorCommand(id: string, callback: (textEditor: vscode.TextEditor, edit: vscode.TextEditorEdit, ...args: any[]) => void, thisArg?: any): vscode.Disposable { - return extHostCommands.registerCommand(id, (...args: any[]) => { + return extHostCommands.registerCommand(id, (...args: any[]): any => { let activeTextEditor = extHostEditors.getActiveTextEditor(); if (!activeTextEditor) { console.warn('Cannot execute ' + id + ' because there is no active text editor.'); @@ -176,13 +153,11 @@ export function createApiFactory( console.warn('Edits from command ' + id + ' were not applied.'); } }, (err) => { - console.warn('An error occured while running command ' + id, err); + console.warn('An error occurred while running command ' + id, err); }); }); - } - - @proposed(extension) - registerDiffInformationCommand(id: string, callback: (diff: vscode.LineChange[], ...args: any[]) => any, thisArg?: any): vscode.Disposable { + }, + registerDiffInformationCommand: proposedApiFunction(extension, (id: string, callback: (diff: vscode.LineChange[], ...args: any[]) => any, thisArg?: any): vscode.Disposable => { return extHostCommands.registerCommand(id, async (...args: any[]) => { let activeTextEditor = extHostEditors.getActiveTextEditor(); if (!activeTextEditor) { @@ -193,19 +168,14 @@ export function createApiFactory( const diff = await extHostEditors.getDiffInformation(activeTextEditor.id); callback.apply(thisArg, [diff, ...args]); }); - } - + }), executeCommand(id: string, ...args: any[]): Thenable { return extHostCommands.executeCommand(id, ...args); - } - + }, getCommands(filterInternal: boolean = false): Thenable { return extHostCommands.getCommands(filterInternal); } - } - - // namespace: commands - const commands: typeof vscode.commands = new Commands(); + }; // namespace: env const env: typeof vscode.env = Object.freeze({ @@ -351,7 +321,7 @@ export function createApiFactory( }, withScmProgress(task: (progress: vscode.Progress) => Thenable) { console.warn(`[Deprecation Warning] function 'withScmProgress' is deprecated and should no longer be used. Use 'withProgress' instead.`); - return extHostProgress.withProgress(extension, { location: extHostTypes.ProgressLocation.SourceControl }, task); + return extHostProgress.withProgress(extension, { location: extHostTypes.ProgressLocation.SourceControl }, (progress, token) => task({ report(n: number) { /*noop*/ } })); }, withProgress(options: vscode.ProgressOptions, task: (progress: vscode.Progress<{ message?: string; percentage?: number }>) => Thenable) { return extHostProgress.withProgress(extension, options, task); @@ -365,23 +335,34 @@ export function createApiFactory( } return extHostTerminalService.createTerminal(nameOrOptions, shellPath, shellArgs); }, + registerTreeDataProvider(viewId: string, treeDataProvider: vscode.TreeDataProvider): vscode.Disposable { + return extHostTreeViews.registerTreeDataProvider(viewId, treeDataProvider); + }, // proposed API sampleFunction: proposedApiFunction(extension, () => { return extHostMessageService.showMessage(Severity.Info, 'Hello Proposed Api!', {}, []); }), - registerTreeDataProviderForView: proposedApiFunction(extension, (viewId: string, treeDataProvider: vscode.TreeDataProvider): vscode.Disposable => { - return extHostTreeViews.registerTreeDataProviderForView(viewId, treeDataProvider); - }) }; // namespace: workspace const workspace: typeof vscode.workspace = { get rootPath() { + telemetryService.publicLog('api-getter', { + name: 'workspace#rootPath', + extension: extension.id + }); return extHostWorkspace.getPath(); }, set rootPath(value) { throw errors.readonly(); }, + get workspaceFolders() { + assertProposedApi(extension); + return extHostWorkspace.getRoots(); + }, + onDidChangeWorkspaceFolders: proposedApiFunction(extension, (listener, thisArgs?, disposables?) => { + return extHostWorkspace.onDidChangeWorkspace(listener, thisArgs, disposables); + }), asRelativePath: (pathOrUri) => { return extHostWorkspace.getRelativePath(pathOrUri); }, @@ -442,35 +423,22 @@ export function createApiFactory( onWillSaveTextDocument: (listener, thisArgs?, disposables?) => { return extHostDocumentSaveParticipant.onWillSaveTextDocumentEvent(listener, thisArgs, disposables); }, - onDidChangeConfiguration: (listener: () => any, thisArgs?: any, disposables?: extHostTypes.Disposable[]) => { + onDidChangeConfiguration: (listener: (_: any) => any, thisArgs?: any, disposables?: extHostTypes.Disposable[]) => { return extHostConfiguration.onDidChangeConfiguration(listener, thisArgs, disposables); }, getConfiguration: (section?: string): vscode.WorkspaceConfiguration => { return extHostConfiguration.getConfiguration(section); }, - registerTaskProvider: (provider: vscode.TaskProvider) => { + registerTaskProvider: proposedApiFunction(extension, (type: string, provider: vscode.TaskProvider) => { return extHostTask.registerTaskProvider(extension, provider); - } + }) }; - class SCM { - - get activeSourceControl() { - return extHostSCM.activeProvider; - } - - get onDidChangeActiveSourceControl() { - return extHostSCM.onDidChangeActiveProvider; - } - + // namespace: scm + const scm: typeof vscode.scm = { get inputBox() { return extHostSCM.inputBox; - } - - get onDidAcceptInputValue() { - return mapEvent(extHostSCM.inputBox.onDidAccept, () => extHostSCM.inputBox); - } - + }, createSourceControl(id: string, label: string) { telemetryService.publicLog('registerSCMProvider', { extensionId: extension.id, @@ -480,10 +448,18 @@ export function createApiFactory( return extHostSCM.createSourceControl(id, label); } - } + }; + + // namespace: debug + const debug: typeof vscode.debug = { + createDebugSession: proposedApiFunction(extension, (config: vscode.DebugConfiguration) => { + return extHostDebugService.createDebugSession(config); + }), + onDidTerminateDebugSession: proposedApiFunction(extension, (listener, thisArg?, disposables?) => { + return extHostDebugService.onDidTerminateDebugSession(listener, thisArg, disposables); + }) + }; - // namespace: scm - const scm: typeof vscode.scm = new SCM(); return { version: pkg.version, @@ -495,6 +471,7 @@ export function createApiFactory( window, workspace, scm, + debug, // types CancellationTokenSource: CancellationTokenSource, CodeLens: extHostTypes.CodeLens, @@ -529,19 +506,21 @@ export function createApiFactory( TextEditorLineNumbersStyle: extHostTypes.TextEditorLineNumbersStyle, TextEditorRevealType: extHostTypes.TextEditorRevealType, TextEditorSelectionChangeKind: extHostTypes.TextEditorSelectionChangeKind, + DecorationRangeBehavior: extHostTypes.DecorationRangeBehavior, Uri: URI, ViewColumn: extHostTypes.ViewColumn, WorkspaceEdit: extHostTypes.WorkspaceEdit, ProgressLocation: extHostTypes.ProgressLocation, TreeItemCollapsibleState: extHostTypes.TreeItemCollapsibleState, + TreeItem: extHostTypes.TreeItem, ThemeColor: extHostTypes.ThemeColor, // functions - FileLocationKind: extHostTypes.FileLocationKind, - ApplyToKind: extHostTypes.ApplyToKind, - RevealKind: extHostTypes.RevealKind, + TaskRevealKind: extHostTypes.TaskRevealKind, + TaskPanelKind: extHostTypes.TaskPanelKind, TaskGroup: extHostTypes.TaskGroup, - ShellTask: extHostTypes.ShellTask, - ProcessTask: extHostTypes.ProcessTask + ProcessExecution: extHostTypes.ProcessExecution, + ShellExecution: extHostTypes.ShellExecution, + Task: extHostTypes.Task }; }; } diff --git a/src/vs/workbench/api/node/extHost.protocol.ts b/src/vs/workbench/api/node/extHost.protocol.ts index f9c02d01d8c10e5b5c81db3bd1376ff16a530701..1bcd2bea96c15fae62f3d927c69d658528d93c69 100644 --- a/src/vs/workbench/api/node/extHost.protocol.ts +++ b/src/vs/workbench/api/node/extHost.protocol.ts @@ -22,7 +22,6 @@ import { IExtensionDescription } from 'vs/platform/extensions/common/extensions' import { StatusbarAlignment as MainThreadStatusBarAlignment } from 'vs/platform/statusbar/common/statusbar'; import { ITelemetryInfo } from 'vs/platform/telemetry/common/telemetry'; import { ICommandHandlerDescription } from 'vs/platform/commands/common/commands'; -import { IWorkspace } from 'vs/platform/workspace/common/workspace'; import { IProgressOptions, IProgressStep } from 'vs/platform/progress/common/progress'; import * as editorCommon from 'vs/editor/common/editorCommon'; @@ -31,7 +30,7 @@ import { IResourceEdit } from 'vs/editor/common/services/bulkEdit'; import { ITextSource } from 'vs/editor/common/model/textSource'; import { ConfigurationTarget } from 'vs/workbench/services/configuration/common/configurationEditing'; -import { IWorkspaceConfigurationValues } from 'vs/workbench/services/configuration/common/configuration'; +import { IConfigurationData } from 'vs/platform/configuration/common/configuration'; import { IPickOpenEntry, IPickOptions } from 'vs/platform/quickOpen/common/quickOpen'; import { SaveReason } from 'vs/workbench/services/textfile/common/textfiles'; @@ -45,6 +44,9 @@ import { IPosition } from 'vs/editor/common/core/position'; import { IRange } from 'vs/editor/common/core/range'; import { ISelection, Selection } from 'vs/editor/common/core/selection'; +import { ITreeItem } from 'vs/workbench/parts/views/common/views'; +import { ThemeColor } from "vs/platform/theme/common/themeService"; + export interface IEnvironment { enableProposedApiForAll: boolean; enableProposedApiFor: string | string[]; @@ -55,14 +57,18 @@ export interface IEnvironment { extensionTestsPath: string; } +export interface IWorkspaceData { + id: string; + name: string; + roots: URI[]; +} + export interface IInitData { parentPid: number; environment: IEnvironment; - contextService: { - workspace: IWorkspace; - }; + workspace: IWorkspaceData; extensions: IExtensionDescription[]; - configuration: IWorkspaceConfigurationValues; + configuration: IConfigurationData; telemetryInfo: ITelemetryInfo; } @@ -80,9 +86,9 @@ export class InstanceCollection { public define(id: ProxyIdentifier): InstanceSetter { let that = this; return new class { - set(value: T) { + set(value: T): R { that._set(id, value); - return value; + return value; } }; } @@ -194,14 +200,6 @@ export abstract class MainThreadEditorsShape { $getDiffInformation(id: string): TPromise { throw ni(); } } -export interface TreeItem extends vscode.TreeItem { - handle: number; - commandId?: string; - icon?: string; - iconDark?: string; - children?: TreeItem[]; -} - export abstract class MainThreadTreeViewsShape { $registerView(treeViewId: string): void { throw ni(); } $refresh(treeViewId: string, treeItemHandle?: number): void { throw ni(); } @@ -270,14 +268,14 @@ export interface MyQuickPickItems extends IPickOpenEntry { handle: number; } export abstract class MainThreadQuickOpenShape { - $show(options: IPickOptions): Thenable { throw ni(); } - $setItems(items: MyQuickPickItems[]): Thenable { throw ni(); } - $setError(error: Error): Thenable { throw ni(); } + $show(options: IPickOptions): TPromise { throw ni(); } + $setItems(items: MyQuickPickItems[]): TPromise { throw ni(); } + $setError(error: Error): TPromise { throw ni(); } $input(options: vscode.InputBoxOptions, validateInput: boolean): TPromise { throw ni(); } } export abstract class MainThreadStatusBarShape { - $setEntry(id: number, extensionId: string, text: string, tooltip: string, command: string, color: string | editorCommon.ThemeColor, alignment: MainThreadStatusBarAlignment, priority: number): void { throw ni(); } + $setEntry(id: number, extensionId: string, text: string, tooltip: string, command: string, color: string | ThemeColor, alignment: MainThreadStatusBarAlignment, priority: number): void { throw ni(); } $dispose(id: number) { throw ni(); } } @@ -344,6 +342,13 @@ export abstract class MainThreadSCMShape { $setInputBoxValue(value: string): void { throw ni(); } } +export type DebugSessionUUID = string; + +export abstract class MainThreadDebugServiceShape { + $createDebugSession(config: vscode.DebugConfiguration): TPromise { throw ni(); } + $customDebugAdapterRequest(id: DebugSessionUUID, command: string, args: any): TPromise { throw ni(); } +} + // -- extension host export abstract class ExtHostCommandsShape { @@ -352,7 +357,7 @@ export abstract class ExtHostCommandsShape { } export abstract class ExtHostConfigurationShape { - $acceptConfigurationChanged(values: IWorkspaceConfigurationValues) { throw ni(); } + $acceptConfigurationChanged(data: IConfigurationData) { throw ni(); } } export abstract class ExtHostDiagnosticsShape { @@ -371,8 +376,7 @@ export abstract class ExtHostDocumentsShape { $provideTextDocumentContent(handle: number, uri: URI): TPromise { throw ni(); } $acceptModelModeChanged(strURL: string, oldModeId: string, newModeId: string): void { throw ni(); } $acceptModelSaved(strURL: string): void { throw ni(); } - $acceptModelDirty(strURL: string): void { throw ni(); } - $acceptModelReverted(strURL: string): void { throw ni(); } + $acceptDirtyStateChanged(strURL: string, isDirty: boolean): void { throw ni(); } $acceptModelChanged(strURL: string, e: IModelChangedEvent, isDirty: boolean): void { throw ni(); } } @@ -408,15 +412,13 @@ export abstract class ExtHostDocumentsAndEditorsShape { $acceptDocumentsAndEditorsDelta(delta: IDocumentsAndEditorsDelta): void { throw ni(); } } -export type TreeViewCommandArg = { - treeViewId: string, - treeItemHandle: number -}; - export abstract class ExtHostTreeViewsShape { - $getElements(treeViewId: string): TPromise { throw ni(); } - $getChildren(treeViewId: string, treeItemHandle: number): TPromise { throw ni(); } - $restore(treeViewId: string, treeItems: TreeItem[]): TPromise { throw ni(); } + $getElements(treeViewId: string): TPromise { throw ni(); } + $getChildren(treeViewId: string, treeItemHandle: number): TPromise { throw ni(); } +} + +export abstract class ExtHostWorkspaceShape { + $acceptWorkspaceData(workspace: IWorkspaceData): void { throw ni(); } } export abstract class ExtHostExtensionServiceShape { @@ -497,11 +499,16 @@ export abstract class ExtHostTaskShape { $provideTasks(handle: number): TPromise { throw ni(); } } +export abstract class ExtHostDebugServiceShape { + $acceptDebugSessionTerminated(id: DebugSessionUUID, type: string, name: string): void { throw ni(); } +} + // --- proxy identifiers export const MainContext = { MainThreadCommands: createMainId('MainThreadCommands', MainThreadCommandsShape), MainThreadConfiguration: createMainId('MainThreadConfiguration', MainThreadConfigurationShape), + MainThreadDebugService: createMainId('MainThreadDebugService', MainThreadDebugServiceShape), MainThreadDiagnostics: createMainId('MainThreadDiagnostics', MainThreadDiagnosticsShape), MainThreadDocuments: createMainId('MainThreadDocuments', MainThreadDocumentsShape), MainThreadEditors: createMainId('MainThreadEditors', MainThreadEditorsShape), @@ -527,6 +534,7 @@ export const ExtHostContext = { ExtHostCommands: createExtId('ExtHostCommands', ExtHostCommandsShape), ExtHostConfiguration: createExtId('ExtHostConfiguration', ExtHostConfigurationShape), ExtHostDiagnostics: createExtId('ExtHostDiagnostics', ExtHostDiagnosticsShape), + ExtHostDebugService: createExtId('ExtHostDebugService', ExtHostDebugServiceShape), ExtHostDocumentsAndEditors: createExtId('ExtHostDocumentsAndEditors', ExtHostDocumentsAndEditorsShape), ExtHostDocuments: createExtId('ExtHostDocuments', ExtHostDocumentsShape), ExtHostDocumentSaveParticipant: createExtId('ExtHostDocumentSaveParticipant', ExtHostDocumentSaveParticipantShape), @@ -539,5 +547,6 @@ export const ExtHostContext = { ExtHostExtensionService: createExtId('ExtHostExtensionService', ExtHostExtensionServiceShape), ExtHostTerminalService: createExtId('ExtHostTerminalService', ExtHostTerminalServiceShape), ExtHostSCM: createExtId('ExtHostSCM', ExtHostSCMShape), - ExtHostTask: createExtId('ExtHostTask', ExtHostTaskShape) + ExtHostTask: createExtId('ExtHostTask', ExtHostTaskShape), + ExtHostWorkspace: createExtId('ExtHostWorkspace', ExtHostWorkspaceShape), }; diff --git a/src/vs/workbench/api/node/extHostApiCommands.ts b/src/vs/workbench/api/node/extHostApiCommands.ts index aef4d71d01fe1d457a630a8a58b689eef1b813f1..86588985765fd31e1a7023400820ef360769aba3 100644 --- a/src/vs/workbench/api/node/extHostApiCommands.ts +++ b/src/vs/workbench/api/node/extHostApiCommands.ts @@ -14,9 +14,7 @@ import { ISingleEditOperation } from 'vs/editor/common/editorCommon'; import * as modes from 'vs/editor/common/modes'; import { ICommandHandlerDescription } from 'vs/platform/commands/common/commands'; import { ExtHostCommands } from 'vs/workbench/api/node/extHostCommands'; -import { IOutline } from 'vs/editor/contrib/quickOpen/common/quickOpen'; import { IWorkspaceSymbolProvider } from 'vs/workbench/parts/search/common/search'; -import { ICodeLensData } from 'vs/editor/contrib/codelens/common/codelens'; import { IEditorOptions } from 'vs/platform/editor/common/editor'; export class ExtHostApiCommands { @@ -183,7 +181,7 @@ export class ExtHostApiCommands { this._register('vscode.openFolder', (uri?: URI, forceNewWindow?: boolean) => { if (!uri) { - return this._commands.executeCommand('_files.openFolderPicker', forceNewWindow); + return this._commands.executeCommand('_files.pickFolderAndOpen', forceNewWindow); } return this._commands.executeCommand('_files.windowOpen', [uri.fsPath], forceNewWindow); @@ -386,7 +384,7 @@ export class ExtHostApiCommands { const args = { resource }; - return this._commands.executeCommand('_executeDocumentSymbolProvider', args).then(value => { + return this._commands.executeCommand('_executeDocumentSymbolProvider', args).then(value => { if (value && Array.isArray(value.entries)) { return value.entries.map(typeConverters.toSymbolInformation); } @@ -409,12 +407,12 @@ export class ExtHostApiCommands { private _executeCodeLensProvider(resource: URI): Thenable { const args = { resource }; - return this._commands.executeCommand('_executeCodeLensProvider', args).then(value => { + return this._commands.executeCommand('_executeCodeLensProvider', args).then(value => { if (Array.isArray(value)) { return value.map(item => { return new types.CodeLens( - typeConverters.toRange(item.symbol.range), - this._commands.converter.fromInternal(item.symbol.command)); + typeConverters.toRange(item.range), + this._commands.converter.fromInternal(item.command)); }); } return undefined; diff --git a/src/vs/workbench/api/node/extHostCommands.ts b/src/vs/workbench/api/node/extHostCommands.ts index 2095dac3b4aecc898e59c23a99937c2682b96894..e9c3afe662b64525551969aa2d6cf29dae667262 100644 --- a/src/vs/workbench/api/node/extHostCommands.ts +++ b/src/vs/workbench/api/node/extHostCommands.ts @@ -218,7 +218,7 @@ export class CommandsConverter { } } - private _executeConvertedCommand(...args: any[]) { + private _executeConvertedCommand(...args: any[]): Thenable { const actualCmd = this._heap.get(args[0]); return this._commands.executeCommand(actualCmd.command, ...actualCmd.arguments); } diff --git a/src/vs/workbench/api/node/extHostConfiguration.ts b/src/vs/workbench/api/node/extHostConfiguration.ts index 84b4d218335dc6d5741e5a256030d94790292842..2deff83f11afa5e81db50ee0adf4400da1ab02fb 100644 --- a/src/vs/workbench/api/node/extHostConfiguration.ts +++ b/src/vs/workbench/api/node/extHostConfiguration.ts @@ -7,10 +7,10 @@ import { mixin } from 'vs/base/common/objects'; import Event, { Emitter } from 'vs/base/common/event'; import { WorkspaceConfiguration } from 'vscode'; +import { ExtHostWorkspace } from 'vs/workbench/api/node/extHostWorkspace'; import { ExtHostConfigurationShape, MainThreadConfigurationShape } from './extHost.protocol'; +import { IConfigurationData, Configuration } from 'vs/platform/configuration/common/configuration'; import { ConfigurationTarget } from 'vs/workbench/services/configuration/common/configurationEditing'; -import { IWorkspaceConfigurationValues } from 'vs/workbench/services/configuration/common/configuration'; -import { toValuesTree } from 'vs/platform/configuration/common/model'; function lookUp(tree: any, key: string) { if (key) { @@ -23,51 +23,34 @@ function lookUp(tree: any, key: string) { } } -interface UsefulConfiguration { - data: IWorkspaceConfigurationValues; - valueTree: any; -} - -function createUsefulConfiguration(data: IWorkspaceConfigurationValues): { data: IWorkspaceConfigurationValues, valueTree: any } { - const valueMap: { [key: string]: any } = Object.create(null); - for (let key in data) { - if (Object.prototype.hasOwnProperty.call(data, key)) { - valueMap[key] = data[key].value; - } - } - const valueTree = toValuesTree(valueMap, message => console.error(`Conflict in configuration settings: ${message}`)); - return { - data, - valueTree - }; -} - export class ExtHostConfiguration extends ExtHostConfigurationShape { - private _onDidChangeConfiguration = new Emitter(); - private _proxy: MainThreadConfigurationShape; - private _configuration: UsefulConfiguration; + private readonly _onDidChangeConfiguration = new Emitter(); + private readonly _proxy: MainThreadConfigurationShape; + private readonly _extHostWorkspace: ExtHostWorkspace; + private _configuration: Configuration; - constructor(proxy: MainThreadConfigurationShape, data: IWorkspaceConfigurationValues) { + constructor(proxy: MainThreadConfigurationShape, extHostWorkspace: ExtHostWorkspace, data: IConfigurationData) { super(); this._proxy = proxy; - this._configuration = createUsefulConfiguration(data); + this._extHostWorkspace = extHostWorkspace; + this._configuration = Configuration.parse(data, extHostWorkspace.workspace); } get onDidChangeConfiguration(): Event { return this._onDidChangeConfiguration && this._onDidChangeConfiguration.event; } - public $acceptConfigurationChanged(data: IWorkspaceConfigurationValues) { - this._configuration = createUsefulConfiguration(data); + $acceptConfigurationChanged(data: IConfigurationData) { + this._configuration = Configuration.parse(data, this._extHostWorkspace.workspace); this._onDidChangeConfiguration.fire(undefined); } - public getConfiguration(section?: string): WorkspaceConfiguration { + getConfiguration(section?: string): WorkspaceConfiguration { const config = section - ? lookUp(this._configuration.valueTree, section) - : this._configuration.valueTree; + ? lookUp(this._configuration.getValue(), section) + : this._configuration.getValue(); const result: WorkspaceConfiguration = { has(key: string): boolean { @@ -91,7 +74,7 @@ export class ExtHostConfiguration extends ExtHostConfigurationShape { }, inspect: (key: string): { key: string; defaultValue?: T; globalValue?: T; workspaceValue?: T } => { key = section ? `${section}.${key}` : key; - const config = this._configuration.data[key]; + const config = this._configuration.values()[key]; if (config) { return { key, diff --git a/src/vs/workbench/api/node/extHostDebugService.ts b/src/vs/workbench/api/node/extHostDebugService.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b1a496cd6fafcfcc5d90b563288d301381cb4a0 --- /dev/null +++ b/src/vs/workbench/api/node/extHostDebugService.ts @@ -0,0 +1,80 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +'use strict'; + +import { TPromise } from 'vs/base/common/winjs.base'; +import Event, { Emitter } from 'vs/base/common/event'; + +import { IThreadService } from 'vs/workbench/services/thread/common/threadService'; +import { MainContext, MainThreadDebugServiceShape, ExtHostDebugServiceShape, DebugSessionUUID } from 'vs/workbench/api/node/extHost.protocol'; + +import * as vscode from 'vscode'; + + +export class ExtHostDebugService extends ExtHostDebugServiceShape { + + private _debugServiceProxy: MainThreadDebugServiceShape; + private _debugSessions: Map = new Map(); + + private _onDidTerminateDebugSession: Emitter; + get onDidTerminateDebugSession(): Event { return this._onDidTerminateDebugSession.event; } + + + constructor(threadService: IThreadService) { + super(); + + this._onDidTerminateDebugSession = new Emitter(); + this._debugServiceProxy = threadService.get(MainContext.MainThreadDebugService); + } + + public createDebugSession(config: vscode.DebugConfiguration): TPromise { + + return this._debugServiceProxy.$createDebugSession(config).then((id: DebugSessionUUID) => { + const debugSession = new ExtHostDebugSession(this._debugServiceProxy, id, config.type, config.name); + this._debugSessions.set(id, debugSession); + return debugSession; + }); + } + + public $acceptDebugSessionTerminated(id: DebugSessionUUID, type: string, name: string): void { + + let debugSession = this._debugSessions.get(id); + if (!debugSession) { + debugSession = new ExtHostDebugSession(this._debugServiceProxy, id, type, name); + } + this._onDidTerminateDebugSession.fire(debugSession); + this._debugSessions.delete(id); + } +} + +export class ExtHostDebugSession implements vscode.DebugSession { + + private _debugServiceProxy: MainThreadDebugServiceShape; + + private _id: DebugSessionUUID; + + private _type: string; + private _name: string; + + + constructor(proxy: MainThreadDebugServiceShape, id: DebugSessionUUID, type: string, name: string) { + this._debugServiceProxy = proxy; + this._id = id; + this._type = type; + this._name = name; + }; + + public get type(): string { + return this._type; + } + + public get name(): string { + return this._name; + } + + public customRequest(command: string, args: any): Thenable { + return this._debugServiceProxy.$customDebugAdapterRequest(this._id, command, args); + } +} diff --git a/src/vs/workbench/api/node/extHostDiagnostics.ts b/src/vs/workbench/api/node/extHostDiagnostics.ts index 7b720e5eec14322e2be6f471c80f4995a97e7618..eeb41c0b0e903e1a6da05188a1dd76b9038b1719 100644 --- a/src/vs/workbench/api/node/extHostDiagnostics.ts +++ b/src/vs/workbench/api/node/extHostDiagnostics.ts @@ -12,7 +12,7 @@ import Severity from 'vs/base/common/severity'; import * as vscode from 'vscode'; import { MainContext, MainThreadDiagnosticsShape, ExtHostDiagnosticsShape } from './extHost.protocol'; import { DiagnosticSeverity } from './extHostTypes'; -import { stableSort } from 'vs/base/common/arrays'; +import { mergeSort } from 'vs/base/common/arrays'; export class DiagnosticCollection implements vscode.DiagnosticCollection { @@ -76,7 +76,7 @@ export class DiagnosticCollection implements vscode.DiagnosticCollection { let lastUri: vscode.Uri; // ensure stable-sort - stableSort(first, DiagnosticCollection._compareIndexedTuplesByUri); + mergeSort(first, DiagnosticCollection._compareIndexedTuplesByUri); for (const tuple of first) { const [uri, diagnostics] = tuple; diff --git a/src/vs/workbench/api/node/extHostDocumentData.ts b/src/vs/workbench/api/node/extHostDocumentData.ts index 96cb2aec92d115e7df527a3d9ed06b02276f3f9e..edb38779935cdf136acd2034b97b613910b5c6ca 100644 --- a/src/vs/workbench/api/node/extHostDocumentData.ts +++ b/src/vs/workbench/api/node/extHostDocumentData.ts @@ -242,9 +242,17 @@ export class ExtHostDocumentData extends MirrorModel { private _getWordRangeAtPosition(_position: vscode.Position, regexp?: RegExp): vscode.Range { let position = this._validatePosition(_position); - if (!regexp || regExpLeadsToEndlessLoop(regexp)) { + + if (!regexp) { + // use default when custom-regexp isn't provided + regexp = getWordDefinitionFor(this._languageId); + + } else if (regExpLeadsToEndlessLoop(regexp)) { + // use default when custom-regexp is bad + console.warn(`[getWordRangeAtPosition]: ignoring custom regexp '${regexp.source}' because it matches the empty string.`); regexp = getWordDefinitionFor(this._languageId); } + let wordAtText = getWordAtText( position.character + 1, ensureValidWordDefinition(regexp), diff --git a/src/vs/workbench/api/node/extHostDocuments.ts b/src/vs/workbench/api/node/extHostDocuments.ts index 918efad51f393221b98f414c11ae57f4cfb64a61..eacff1334c5cfa7c18365b2f42523f0d5d780b19 100644 --- a/src/vs/workbench/api/node/extHostDocuments.ts +++ b/src/vs/workbench/api/node/extHostDocuments.ts @@ -171,18 +171,17 @@ export class ExtHostDocuments extends ExtHostDocumentsShape { public $acceptModelSaved(strURL: string): void { let data = this._documentsAndEditors.getDocument(strURL); - data._acceptIsDirty(false); + this.$acceptDirtyStateChanged(strURL, false); this._onDidSaveDocument.fire(data.document); } - public $acceptModelDirty(strURL: string): void { - let document = this._documentsAndEditors.getDocument(strURL); - document._acceptIsDirty(true); - } - - public $acceptModelReverted(strURL: string): void { - let document = this._documentsAndEditors.getDocument(strURL); - document._acceptIsDirty(false); + public $acceptDirtyStateChanged(strURL: string, isDirty: boolean): void { + let data = this._documentsAndEditors.getDocument(strURL); + data._acceptIsDirty(isDirty); + this._onDidChangeDocument.fire({ + document: data.document, + contentChanges: [] + }); } public $acceptModelChanged(strURL: string, events: IModelChangedEvent, isDirty: boolean): void { diff --git a/src/vs/workbench/api/node/extHostDocumentsAndEditors.ts b/src/vs/workbench/api/node/extHostDocumentsAndEditors.ts index 164827a79fd369fa6dca9521e0f656ac3b714902..27baef47f89372dea0648b346ec9002c3b6351b7 100644 --- a/src/vs/workbench/api/node/extHostDocumentsAndEditors.ts +++ b/src/vs/workbench/api/node/extHostDocumentsAndEditors.ts @@ -98,6 +98,9 @@ export class ExtHostDocumentsAndEditors extends ExtHostDocumentsAndEditorsShape this._activeEditorId = delta.newActiveEditor; } + dispose(removedDocuments); + dispose(removedEditors); + // now that the internal state is complete, fire events if (delta.removedDocuments) { this._onDidRemoveDocuments.fire(removedDocuments); @@ -112,10 +115,6 @@ export class ExtHostDocumentsAndEditors extends ExtHostDocumentsAndEditorsShape if (delta.newActiveEditor !== undefined) { this._onDidChangeActiveTextEditor.fire(this.activeEditor()); } - - // now that the events are out, dispose removed documents and editors - dispose(removedDocuments); - dispose(removedEditors); } getDocument(strUrl: string): ExtHostDocumentData { diff --git a/src/vs/workbench/api/node/extHostExtensionService.ts b/src/vs/workbench/api/node/extHostExtensionService.ts index ae75796c7e288291e8d0ba758778c0e2d6d1e714..d75347f83dc9ee4520ca8b96ffd05c8a42b1b4d1 100644 --- a/src/vs/workbench/api/node/extHostExtensionService.ts +++ b/src/vs/workbench/api/node/extHostExtensionService.ts @@ -15,9 +15,7 @@ import { ExtHostStorage } from 'vs/workbench/api/node/extHostStorage'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { createApiFactory, initializeExtensionApi } from 'vs/workbench/api/node/extHost.api.impl'; import { IThreadService } from 'vs/workbench/services/thread/common/threadService'; -import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; -import { MainContext, MainProcessExtensionServiceShape, IEnvironment, IInitData } from './extHost.protocol'; -import { createHash } from 'crypto'; +import { MainContext, MainProcessExtensionServiceShape, IWorkspaceData, IEnvironment, IInitData } from './extHost.protocol'; const hasOwnProperty = Object.hasOwnProperty; @@ -103,14 +101,14 @@ class ExtensionMemento implements IExtensionMemento { class ExtensionStoragePath { - private readonly _contextService: IWorkspaceContextService; + private readonly _workspace: IWorkspaceData; private readonly _environment: IEnvironment; private readonly _ready: TPromise; private _value: string; - constructor(contextService: IWorkspaceContextService, environment: IEnvironment) { - this._contextService = contextService; + constructor(workspace: IWorkspaceData, environment: IEnvironment) { + this._workspace = workspace; this._environment = environment; this._ready = this._getOrCreateWorkspaceStoragePath().then(value => this._value = value); } @@ -127,18 +125,10 @@ class ExtensionStoragePath { } private _getOrCreateWorkspaceStoragePath(): TPromise { - - const workspace = this._contextService.getWorkspace(); - - if (!workspace) { + if (!this._workspace) { return TPromise.as(undefined); } - - const storageName = createHash('md5') - .update(workspace.resource.fsPath) - .update(workspace.uid ? workspace.uid.toString() : '') - .digest('hex'); - + const storageName = this._workspace.id; const storagePath = join(this._environment.appSettingsHome, 'workspaceStorage', storageName); return dirExists(storagePath).then(exists => { @@ -171,23 +161,21 @@ export class ExtHostExtensionService extends AbstractExtensionService this._triggerOnReady()); } diff --git a/src/vs/workbench/api/node/extHostMessageService.ts b/src/vs/workbench/api/node/extHostMessageService.ts index 32572895213d229a61122138790b2a08c5dab1c4..31d5cbdcd225cb4f35e86126ab52501ef1a9f8ca 100644 --- a/src/vs/workbench/api/node/extHostMessageService.ts +++ b/src/vs/workbench/api/node/extHostMessageService.ts @@ -31,7 +31,9 @@ export class ExtHostMessageService { this._proxy = threadService.get(MainContext.MainThreadMessageService); } - showMessage(severity: Severity, message: string, optionsOrFirstItem: vscode.MessageOptions | string | vscode.MessageItem, rest: (string | vscode.MessageItem)[]): Thenable { + showMessage(severity: Severity, message: string, optionsOrFirstItem: vscode.MessageOptions | string, rest: string[]): Thenable; + showMessage(severity: Severity, message: string, optionsOrFirstItem: vscode.MessageOptions | vscode.MessageItem, rest: vscode.MessageItem[]): Thenable; + showMessage(severity: Severity, message: string, optionsOrFirstItem: vscode.MessageOptions | string | vscode.MessageItem, rest: (string | vscode.MessageItem)[]): Thenable { const { options, items } = parseMessageArguments(optionsOrFirstItem, rest); const commands: { title: string; isCloseAffordance: boolean; handle: number; }[] = []; diff --git a/src/vs/workbench/api/node/extHostQuickOpen.ts b/src/vs/workbench/api/node/extHostQuickOpen.ts index 05cab704c0f147e9af2f9ce713290075c7858ea9..183dcd1d7bc5d399e622b99c1492bd97b733b4a9 100644 --- a/src/vs/workbench/api/node/extHostQuickOpen.ts +++ b/src/vs/workbench/api/node/extHostQuickOpen.ts @@ -24,7 +24,9 @@ export class ExtHostQuickOpen extends ExtHostQuickOpenShape { this._proxy = threadService.get(MainContext.MainThreadQuickOpen); } - showQuickPick(itemsOrItemsPromise: Item[] | Thenable, options?: QuickPickOptions, token: CancellationToken = CancellationToken.None): Thenable { + showQuickPick(itemsOrItemsPromise: string[] | Thenable, options?: QuickPickOptions, token?: CancellationToken): Thenable; + showQuickPick(itemsOrItemsPromise: QuickPickItem[] | Thenable, options?: QuickPickOptions, token?: CancellationToken): Thenable; + showQuickPick(itemsOrItemsPromise: Item[] | Thenable, options?: QuickPickOptions, token: CancellationToken = CancellationToken.None): Thenable { // clear state from last invocation this._onDidSelectItem = undefined; diff --git a/src/vs/workbench/api/node/extHostSCM.ts b/src/vs/workbench/api/node/extHostSCM.ts index 9d40839b17791c1b6d6ed2362ff08f1d5cde8433..76c7078dda9866b658f19fe670334d61dc31c8fa 100644 --- a/src/vs/workbench/api/node/extHostSCM.ts +++ b/src/vs/workbench/api/node/extHostSCM.ts @@ -316,14 +316,17 @@ export class ExtHostSCM { return sourceControl; } - $provideOriginalResource(sourceControlHandle: number, uri: URI): TPromise { + $provideOriginalResource(sourceControlHandle: number, uri: URI): TPromise { const sourceControl = this._sourceControls.get(sourceControlHandle); if (!sourceControl || !sourceControl.quickDiffProvider) { return TPromise.as(null); } - return asWinJsPromise(token => sourceControl.quickDiffProvider.provideOriginalResource(uri, token)); + return asWinJsPromise(token => { + const result = sourceControl.quickDiffProvider.provideOriginalResource(uri, token); + return result && URI.parse(result.toString()); + }); } $onActiveSourceControlChange(handle: number): TPromise { diff --git a/src/vs/workbench/api/node/extHostTask.ts b/src/vs/workbench/api/node/extHostTask.ts index f1c5a8065b8af2898860c683043bd457151a2199..7f715afb86d5cd35c5790cc37604d9f7ba198ae6 100644 --- a/src/vs/workbench/api/node/extHostTask.ts +++ b/src/vs/workbench/api/node/extHostTask.ts @@ -4,17 +4,16 @@ *--------------------------------------------------------------------------------------------*/ 'use strict'; +import * as nls from 'vs/nls'; import { TPromise } from 'vs/base/common/winjs.base'; -import * as UUID from 'vs/base/common/uuid'; +import * as Objects from 'vs/base/common/objects'; import { asWinJsPromise } from 'vs/base/common/async'; -import * as Problems from 'vs/platform/markers/common/problemMatcher'; import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; import * as TaskSystem from 'vs/workbench/parts/tasks/common/tasks'; import { IThreadService } from 'vs/workbench/services/thread/common/threadService'; import { MainContext, MainThreadTaskShape, ExtHostTaskShape } from 'vs/workbench/api/node/extHost.protocol'; -import { fromDiagnosticSeverity } from 'vs/workbench/api/node/extHostTypeConverters'; import * as types from 'vs/workbench/api/node/extHostTypes'; import * as vscode from 'vscode'; @@ -23,6 +22,7 @@ interface StringMap { [key: string]: V; } +/* namespace ProblemPattern { export function from(value: vscode.ProblemPattern | vscode.MultiLineProblemPattern): Problems.ProblemPattern | Problems.MultiLineProblemPattern { if (value === void 0 || value === null) { @@ -144,7 +144,7 @@ namespace WatchingPattern { } } -namespace WathingMatcher { +namespace BackgroundMonitor { export function from(value: vscode.BackgroundMonitor): Problems.WatchingMatcher { if (value === void 0 || value === null) { return undefined; @@ -163,7 +163,7 @@ namespace ProblemMatcher { if (values === void 0 || values === null) { return undefined; } - let result: (string | Problems.ProblemMatcher)[]; + let result: (string | Problems.ProblemMatcher)[] = []; for (let value of values) { let converted = typeof value === 'string' ? value : fromSingle(value); if (converted) { @@ -190,28 +190,50 @@ namespace ProblemMatcher { return result; } } +*/ -namespace RevealKind { - export function from(value: vscode.RevealKind): TaskSystem.ShowOutput { +namespace TaskRevealKind { + export function from(value: vscode.TaskRevealKind): TaskSystem.RevealKind { if (value === void 0 || value === null) { - return TaskSystem.ShowOutput.Always; + return TaskSystem.RevealKind.Always; } switch (value) { - case types.RevealKind.Silent: - return TaskSystem.ShowOutput.Silent; - case types.RevealKind.Never: - return TaskSystem.ShowOutput.Never; + case types.TaskRevealKind.Silent: + return TaskSystem.RevealKind.Silent; + case types.TaskRevealKind.Never: + return TaskSystem.RevealKind.Never; } - return TaskSystem.ShowOutput.Always; + return TaskSystem.RevealKind.Always; } } -namespace TerminalBehaviour { - export function from(value: vscode.TerminalBehaviour): { showOutput: TaskSystem.ShowOutput, echo: boolean } { +namespace TaskPanelKind { + export function from(value: vscode.TaskPanelKind): TaskSystem.PanelKind { if (value === void 0 || value === null) { - return { showOutput: TaskSystem.ShowOutput.Always, echo: false }; + return TaskSystem.PanelKind.Shared; } - return { showOutput: RevealKind.from(value.reveal), echo: !!value.echo }; + switch (value) { + case types.TaskPanelKind.Dedicated: + return TaskSystem.PanelKind.Dedicated; + case types.TaskPanelKind.New: + return TaskSystem.PanelKind.New; + default: + return TaskSystem.PanelKind.Shared; + } + } +} + +namespace PresentationOptions { + export function from(value: vscode.TaskPresentationOptions): TaskSystem.PresentationOptions { + if (value === void 0 || value === null) { + return { reveal: TaskSystem.RevealKind.Always, echo: true, focus: false, panel: TaskSystem.PanelKind.Shared }; + } + return { + reveal: TaskRevealKind.from(value.reveal), + echo: value.echo === void 0 ? true : !!value.echo, + focus: !!value.focus, + panel: TaskPanelKind.from(value.panel) + }; } } @@ -230,7 +252,10 @@ namespace Strings { } namespace CommandOptions { - export function from(value: { cwd?: string; env?: { [key: string]: string; } }): TaskSystem.CommandOptions { + function isShellConfiguration(value: any): value is { executable: string; shellArgs?: string[] } { + return value && typeof value.executable === 'string'; + } + export function from(value: vscode.ShellExecutionOptions | vscode.ProcessExecutionOptions): TaskSystem.CommandOptions { if (value === void 0 || value === null) { return undefined; } @@ -248,19 +273,22 @@ namespace CommandOptions { } }); } + if (isShellConfiguration(value)) { + result.shell = ShellConfiguration.from(value); + } return result; } } namespace ShellConfiguration { - export function from(value: { executable?: string, args?: string[] }): boolean | TaskSystem.ShellConfiguration { - if (value === void 0 || value === null || typeof value.executable !== 'string') { - return true; + export function from(value: { executable?: string, shellArgs?: string[] }): TaskSystem.ShellConfiguration { + if (value === void 0 || value === null || !value.executable) { + return undefined; } let result: TaskSystem.ShellConfiguration = { executable: value.executable, - args: Strings.from(value.args) + args: Strings.from(value.shellArgs) }; return result; } @@ -268,66 +296,77 @@ namespace ShellConfiguration { namespace Tasks { - export function from(tasks: vscode.Task[], extension: IExtensionDescription, uuidMap: UUIDMap): TaskSystem.Task[] { + export function from(tasks: vscode.Task[], extension: IExtensionDescription): TaskSystem.Task[] { if (tasks === void 0 || tasks === null) { return []; } let result: TaskSystem.Task[] = []; - try { - uuidMap.start(); - for (let task of tasks) { - let converted = fromSingle(task, extension, uuidMap); - if (converted) { - result.push(converted); - } + for (let task of tasks) { + let converted = fromSingle(task, extension); + if (converted) { + result.push(converted); } - } finally { - uuidMap.finish(); } return result; } - function fromSingle(task: vscode.Task, extension: IExtensionDescription, uuidMap: UUIDMap): TaskSystem.Task { - if (typeof task.name !== 'string' || typeof task.identifier !== 'string') { + function fromSingle(task: vscode.Task, extension: IExtensionDescription): TaskSystem.ContributedTask { + if (typeof task.name !== 'string') { return undefined; } let command: TaskSystem.CommandConfiguration; - if (task instanceof types.ProcessTask) { - command = getProcessCommand(task); - } else if (task instanceof types.ShellTask) { - command = getShellCommand(task); + let execution = task.execution; + if (execution instanceof types.ProcessExecution) { + command = getProcessCommand(execution); + } else if (execution instanceof types.ShellExecution) { + command = getShellCommand(execution); } else { return undefined; } if (command === void 0) { return undefined; } - let behaviour = TerminalBehaviour.from(task.terminal); - command.echo = behaviour.echo; - let result: TaskSystem.Task = { - _id: uuidMap.getUUID(task.identifier), - _source: { kind: TaskSystem.TaskSourceKind.Extension, detail: extension.id }, + command.presentation = PresentationOptions.from(task.presentationOptions); + let source = { + kind: TaskSystem.TaskSourceKind.Extension, + label: typeof task.source === 'string' ? task.source : extension.name, + detail: extension.id + }; + let label = nls.localize('task.label', '{0}: {1}', source.label, task.name); + let key = (task as types.Task).kindKey; + let kind = (task as types.Task).kind; + let id = `${extension.id}.${key}`; + let taskKind: TaskSystem.TaskIdentifier = { + _key: key, + type: kind.type + }; + Objects.assign(taskKind, kind); + let result: TaskSystem.ContributedTask = { + _id: id, // uuidMap.getUUID(identifier), + _source: source, + _label: label, + type: kind.type, + defines: taskKind, name: task.name, - identifier: task.identifier, - group: types.TaskGroup.is(task.group) ? task.group : undefined, + identifier: label, + group: task.group ? (task.group as types.TaskGroup).id : undefined, command: command, - showOutput: behaviour.showOutput, isBackground: !!task.isBackground, - suppressTaskName: true, - problemMatchers: ProblemMatcher.from(task.problemMatchers) + problemMatchers: task.problemMatchers.slice() }; return result; } - function getProcessCommand(value: vscode.ProcessTask): TaskSystem.CommandConfiguration { + function getProcessCommand(value: vscode.ProcessExecution): TaskSystem.CommandConfiguration { if (typeof value.process !== 'string') { return undefined; } let result: TaskSystem.CommandConfiguration = { name: value.process, args: Strings.from(value.args), - isShellCommand: false, - echo: false, + runtime: TaskSystem.RuntimeType.Process, + suppressTaskName: true, + presentation: undefined }; if (value.options) { result.options = CommandOptions.from(value.options); @@ -335,14 +374,14 @@ namespace Tasks { return result; } - function getShellCommand(value: vscode.ShellTask): TaskSystem.CommandConfiguration { + function getShellCommand(value: vscode.ShellExecution): TaskSystem.CommandConfiguration { if (typeof value.commandLine !== 'string') { return undefined; } let result: TaskSystem.CommandConfiguration = { name: value.commandLine, - isShellCommand: ShellConfiguration.from(value.options), - echo: false + runtime: TaskSystem.RuntimeType.Shell, + presentation: undefined }; if (value.options) { result.options = CommandOptions.from(value.options); @@ -351,37 +390,6 @@ namespace Tasks { } } -class UUIDMap { - - private _map: StringMap; - private _unused: StringMap; - - constructor() { - this._map = Object.create(null); - } - - public start(): void { - this._unused = Object.create(null); - Object.keys(this._map).forEach(key => this._unused[key] = true); - } - - public getUUID(identifier: string): string { - delete this._unused[identifier]; - let result = this._map[identifier]; - if (result) { - return result; - } - result = UUID.generateUuid(); - this._map[identifier] = result; - return result; - } - - public finish(): void { - Object.keys(this._unused).forEach(key => delete this._map[key]); - this._unused = null; - } -} - interface HandlerData { provider: vscode.TaskProvider; extension: IExtensionDescription; @@ -392,14 +400,12 @@ export class ExtHostTask extends ExtHostTaskShape { private _proxy: MainThreadTaskShape; private _handleCounter: number; private _handlers: Map; - private _idMaps: Map; constructor(threadService: IThreadService) { super(); this._proxy = threadService.get(MainContext.MainThreadTask); this._handleCounter = 0; this._handlers = new Map(); - this._idMaps = new Map(); }; public registerTaskProvider(extension: IExtensionDescription, provider: vscode.TaskProvider): vscode.Disposable { @@ -422,7 +428,7 @@ export class ExtHostTask extends ExtHostTaskShape { } return asWinJsPromise(token => handler.provider.provideTasks(token)).then(value => { return { - tasks: Tasks.from(value, handler.extension, this.getUUIDMap(handler.extension.id)), + tasks: Tasks.from(value, handler.extension), extension: handler.extension }; }); @@ -431,14 +437,4 @@ export class ExtHostTask extends ExtHostTaskShape { private nextHandle(): number { return this._handleCounter++; } - - private getUUIDMap(extensionId: string): UUIDMap { - let result = this._idMaps.get(extensionId); - if (result) { - return result; - } - result = new UUIDMap(); - this._idMaps.set(extensionId, result); - return result; - } } \ No newline at end of file diff --git a/src/vs/workbench/api/node/extHostTreeViews.ts b/src/vs/workbench/api/node/extHostTreeViews.ts index b772b89459347c544447acb1f59f3ecc98c0cf13..452e83b8068448123b1fe74f8ff2b99feb611a5a 100644 --- a/src/vs/workbench/api/node/extHostTreeViews.ts +++ b/src/vs/workbench/api/node/extHostTreeViews.ts @@ -10,11 +10,11 @@ import URI from 'vs/base/common/uri'; import { TPromise } from 'vs/base/common/winjs.base'; import { Disposable } from 'vs/base/common/lifecycle'; import { IThreadService } from 'vs/workbench/services/thread/common/threadService'; -import { MainContext, ExtHostTreeViewsShape, MainThreadTreeViewsShape, TreeItem, TreeViewCommandArg } from './extHost.protocol'; +import { MainContext, ExtHostTreeViewsShape, MainThreadTreeViewsShape } from './extHost.protocol'; +import { ITreeItem, TreeViewItemHandleArg } from 'vs/workbench/parts/views/common/views'; import { TreeItemCollapsibleState } from './extHostTypes'; -import { ExtHostCommands } from 'vs/workbench/api/node/extHostCommands'; +import { ExtHostCommands, CommandsConverter } from 'vs/workbench/api/node/extHostCommands'; import { asWinJsPromise } from 'vs/base/common/async'; -import * as modes from 'vs/editor/common/modes'; type TreeItemHandle = number; @@ -31,7 +31,7 @@ export class ExtHostTreeViews extends ExtHostTreeViewsShape { this._proxy = threadService.get(MainContext.MainThreadTreeViews); commands.registerArgumentProcessor({ processArgument: arg => { - if (arg && arg.treeViewId && arg.treeItemHandle) { + if (arg && arg.$treeViewId && arg.$treeItemHandle) { return this.convertArgument(arg); } return arg; @@ -39,8 +39,8 @@ export class ExtHostTreeViews extends ExtHostTreeViewsShape { }); } - registerTreeDataProviderForView(id: string, treeDataProvider: vscode.TreeDataProvider): vscode.Disposable { - const treeView = new ExtHostTreeView(id, treeDataProvider, this._proxy); + registerTreeDataProvider(id: string, treeDataProvider: vscode.TreeDataProvider): vscode.Disposable { + const treeView = new ExtHostTreeView(id, treeDataProvider, this._proxy, this.commands.converter); this.treeViews.set(id, treeView); return { dispose: () => { @@ -50,28 +50,25 @@ export class ExtHostTreeViews extends ExtHostTreeViewsShape { }; } - $getElements(treeViewId: string): TPromise { + $getElements(treeViewId: string): TPromise { const treeView = this.treeViews.get(treeViewId); if (!treeView) { - return TPromise.wrapError(localize('treeView.notRegistered', 'No tree view with id \'{0}\' registered.', treeViewId)); + return TPromise.wrapError(localize('treeView.notRegistered', 'No tree view with id \'{0}\' registered.', treeViewId)); } return treeView.getTreeItems(); } - $getChildren(treeViewId: string, treeItemHandle?: number): TPromise { + $getChildren(treeViewId: string, treeItemHandle?: number): TPromise { const treeView = this.treeViews.get(treeViewId); if (!treeView) { - return TPromise.wrapError(localize('treeView.notRegistered', 'No tree view with id \'{0}\' registered.', treeViewId)); + return TPromise.wrapError(localize('treeView.notRegistered', 'No tree view with id \'{0}\' registered.', treeViewId)); } return treeView.getChildren(treeItemHandle); } - private convertArgument(arg: TreeViewCommandArg): any { - const treeView = this.treeViews.get(arg.treeViewId); - if (!treeView) { - return TPromise.wrapError(localize('treeView.notRegistered', 'No tree view with id \'{0}\' registered.', arg.treeViewId)); - } - return treeView.getExtensionElement(arg.treeItemHandle); + private convertArgument(arg: TreeViewItemHandleArg): any { + const treeView = this.treeViews.get(arg.$treeViewId); + return treeView ? treeView.getExtensionElement(arg.$treeItemHandle) : null; } } @@ -83,7 +80,7 @@ class ExtHostTreeView extends Disposable { private itemHandlesMap: Map = new Map(); private extChildrenElementsMap: Map = new Map(); - constructor(private viewId: string, private dataProvider: vscode.TreeDataProvider, private proxy: MainThreadTreeViewsShape) { + constructor(private viewId: string, private dataProvider: vscode.TreeDataProvider, private proxy: MainThreadTreeViewsShape, private commands: CommandsConverter, ) { super(); this.proxy.$registerView(viewId); if (dataProvider.onDidChangeTreeData) { @@ -91,7 +88,7 @@ class ExtHostTreeView extends Disposable { } } - getTreeItems(): TPromise { + getTreeItems(): TPromise { this.extChildrenElementsMap.clear(); this.extElementsMap.clear(); this.itemHandlesMap.clear(); @@ -100,12 +97,12 @@ class ExtHostTreeView extends Disposable { .then(elements => this.processAndMapElements(elements)); } - getChildren(treeItemHandle: TreeItemHandle): TPromise { + getChildren(treeItemHandle: TreeItemHandle): TPromise { let extElement = this.getExtensionElement(treeItemHandle); if (extElement) { this.clearChildren(extElement); } else { - return TPromise.wrapError(localize('treeItem.notFound', 'No tree item with id \'{0}\' found.', treeItemHandle)); + return TPromise.wrapError(localize('treeItem.notFound', 'No tree item with id \'{0}\' found.', treeItemHandle)); } return asWinJsPromise(() => this.dataProvider.getChildren(extElement)) @@ -127,33 +124,50 @@ class ExtHostTreeView extends Disposable { } } - private processAndMapElements(elements: T[]): TPromise { - const treeItemsPromises: TPromise[] = []; - for (const element of elements) { - if (this.extChildrenElementsMap.has(element)) { - return TPromise.wrapError(localize('treeView.duplicateElement', 'Element {0} is already registered', element)); - } - const treeItem = this.massageTreeItem(this.dataProvider.getTreeItem(element)); - this.itemHandlesMap.set(element, treeItem.handle); - this.extElementsMap.set(treeItem.handle, element); - if (treeItem.collapsibleState === TreeItemCollapsibleState.Expanded) { - treeItemsPromises.push(this.getChildren(treeItem.handle).then(children => { - treeItem.children = children; - return treeItem; - })); - } else { - treeItemsPromises.push(TPromise.as(treeItem)); - } + private processAndMapElements(elements: T[]): TPromise { + if (elements && elements.length) { + return TPromise.join( + elements.filter(element => !!element) + .map(element => { + if (this.extChildrenElementsMap.has(element)) { + return TPromise.wrapError(localize('treeView.duplicateElement', 'Element {0} is already registered', element)); + } + return this.resolveElement(element); + })) + .then(treeItems => treeItems.filter(treeItem => !!treeItem)); } - return TPromise.join(treeItemsPromises); + return TPromise.as([]); + } + + private resolveElement(element: T): TPromise { + return asWinJsPromise(() => this.dataProvider.getTreeItem(element)) + .then(extTreeItem => { + const treeItem = this.massageTreeItem(extTreeItem); + if (treeItem) { + this.itemHandlesMap.set(element, treeItem.handle); + this.extElementsMap.set(treeItem.handle, element); + if (treeItem.collapsibleState === TreeItemCollapsibleState.Expanded) { + return this.getChildren(treeItem.handle).then(children => { + treeItem.children = children; + return treeItem; + }); + } else { + return treeItem; + } + } + return null; + }); } - private massageTreeItem(extensionTreeItem: vscode.TreeItem): TreeItem { + private massageTreeItem(extensionTreeItem: vscode.TreeItem): ITreeItem { + if (!extensionTreeItem) { + return null; + } const icon = this.getLightIconPath(extensionTreeItem); return { handle: ++this._itemHandlePool, label: extensionTreeItem.label, - commandId: extensionTreeItem.command ? extensionTreeItem.command.command : void 0, + command: extensionTreeItem.command ? this.commands.toInternal(extensionTreeItem.command) : void 0, contextValue: extensionTreeItem.contextValue, icon, iconDark: this.getDarkIconPath(extensionTreeItem) || icon, diff --git a/src/vs/workbench/api/node/extHostTypes.ts b/src/vs/workbench/api/node/extHostTypes.ts index 20b0d2a1aff0aaf49289bb5da405ed3e04340245..61b9ef84b1c5210d4160261ed616422d2c39fc95 100644 --- a/src/vs/workbench/api/node/extHostTypes.ts +++ b/src/vs/workbench/api/node/extHostTypes.ts @@ -4,6 +4,8 @@ *--------------------------------------------------------------------------------------------*/ 'use strict'; +import * as crypto from 'crypto'; + import URI from 'vs/base/common/uri'; import { illegalArgument } from 'vs/base/common/errors'; import * as vscode from 'vscode'; @@ -962,6 +964,28 @@ export enum TextEditorSelectionChangeKind { Command = 3 } +/** + * These values match very carefully the values of `TrackedRangeStickiness` + */ +export enum DecorationRangeBehavior { + /** + * TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges + */ + OpenOpen = 0, + /** + * TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges + */ + ClosedClosed = 1, + /** + * TrackedRangeStickiness.GrowsOnlyWhenTypingBefore + */ + OpenClosed = 2, + /** + * TrackedRangeStickiness.GrowsOnlyWhenTypingAfter + */ + ClosedOpen = 3 +} + export namespace TextEditorSelectionChangeKind { export function fromValue(s: string) { switch (s) { @@ -991,282 +1015,296 @@ export class DocumentLink { } } -export enum FileLocationKind { - Auto = 1, +export enum TaskRevealKind { + Always = 1, - Relative = 2, + Silent = 2, - Absolute = 3 + Never = 3 } -export enum ApplyToKind { - AllDocuments = 1, +export enum TaskPanelKind { + Shared = 1, - OpenDocuments = 2, + Dedicated = 2, - ClosedDocuments = 3 + New = 3 } -export enum RevealKind { - Always = 1, +export class TaskGroup implements vscode.TaskGroup { - Silent = 2, + private _id: string; + private _label: string; - Never = 3 -} + public static Clean: TaskGroup = new TaskGroup('clean', 'Clean'); -export class BaseTask { + public static Build: TaskGroup = new TaskGroup('build', 'Build'); - private _name: string; - private _problemMatchers: (string | vscode.ProblemMatcher)[]; - private _identifier: string; - private _isBackground: boolean; - private _terminal: vscode.TerminalBehaviour; + public static RebuildAll: TaskGroup = new TaskGroup('rebuildAll', 'RebuildAll'); - constructor(name: string, problemMatchers: (string | vscode.ProblemMatcher)[]) { - if (typeof name !== 'string') { - throw illegalArgument('name'); - } - this._name = name; - this._identifier = name; - this._problemMatchers = problemMatchers || []; - this._isBackground = false; - this._terminal = Object.create(null); - } - - get identifier(): string { - return this._identifier; - } + public static Test: TaskGroup = new TaskGroup('clean', 'Clean'); - set identifier(value: string) { - if (typeof value !== 'string') { - throw illegalArgument('identifier'); + constructor(id: string, label: string) { + if (typeof id !== 'string') { + throw illegalArgument('name'); } - if (value.indexOf(':') !== -1) { - throw illegalArgument('identifier must not contain \':\''); + if (typeof label !== 'string') { + throw illegalArgument('name'); } - this._identifier = value; + this._id = id; + this._label = label; } - get name(): string { - return this._name; + get id(): string { + return this._id; } +} - get isBackground(): boolean { - return this._isBackground; - } +export class ProcessExecution implements vscode.ProcessExecution { - set isBackground(value: boolean) { - if (value !== true && value !== false) { - value = false; + private _process: string; + private _args: string[]; + private _options: vscode.ProcessExecutionOptions; + + constructor(process: string, options?: vscode.ProcessExecutionOptions); + constructor(process: string, args: string[], options?: vscode.ProcessExecutionOptions); + constructor(process: string, varg1?: string[] | vscode.ProcessExecutionOptions, varg2?: vscode.ProcessExecutionOptions) { + if (typeof process !== 'string') { + throw illegalArgument('process'); + } + this._process = process; + if (varg1 !== void 0) { + if (Array.isArray(varg1)) { + this._args = varg1; + this._options = varg2; + } else { + this._options = varg1; + } + } + if (this._args === void 0) { + this._args = []; } - this._isBackground = value; } - get terminal(): vscode.TerminalBehaviour { - return this._terminal; + + get process(): string { + return this._process; } - set terminal(value: vscode.TerminalBehaviour) { - if (value === void 0 || value === null) { - value = Object.create(null); + set process(value: string) { + if (typeof value !== 'string') { + throw illegalArgument('process'); } - this._terminal = value; + this._process = value; } - get problemMatchers(): (string | vscode.ProblemMatcher)[] { - return this._problemMatchers; + get args(): string[] { + return this._args; } - set problemMatchers(value: (string | vscode.ProblemMatcher)[]) { + set args(value: string[]) { if (!Array.isArray(value)) { value = []; } - this._problemMatchers = value; + this._args = value; } -} -namespace ProblemMatcher { - export function is(value: any): value is vscode.ProblemMatcher { - let candidate: vscode.ProblemMatcher = value; - return candidate && !!candidate.pattern; + get options(): vscode.ProcessExecutionOptions { + return this._options; } -} -namespace ShellOptions { - export function is(value: any): value is vscode.ShellOptions { - return value && ((typeof value.executable === 'string') || (typeof value.cwd === 'string') || !!value.env); + set options(value: vscode.ProcessExecutionOptions) { + this._options = value; } } -export namespace TaskGroup { - /** - * The clean task group - */ - export const Clean: 'clean' = 'clean'; +export class ShellExecution implements vscode.ShellExecution { - /** - * The build task group - */ - export const Build: 'build' = 'build'; + private _commandLine: string; + private _options: vscode.ShellExecutionOptions; - /** - * The rebuild all task group - */ - export const RebuildAll: 'rebuildAll' = 'rebuildAll'; + constructor(commandLine: string, options?: vscode.ShellExecutionOptions) { + if (typeof commandLine !== 'string') { + throw illegalArgument('commandLine'); + } + this._commandLine = commandLine; + this._options = options; + } - /** - * The test task group - */ - export const Test: 'test' = 'test'; + get commandLine(): string { + return this._commandLine; + } - export function is(value: string): value is vscode.TaskGroup { - return value === Clean || value === Build || value === RebuildAll || value === Test; + set commandLine(value: string) { + if (typeof value !== 'string') { + throw illegalArgument('commandLine'); + } + this._commandLine = value; + } + + get options(): vscode.ShellExecutionOptions { + return this._options; + } + + set options(value: vscode.ShellExecutionOptions) { + this._options = value; } } -export class ProcessTask extends BaseTask { +export class Task implements vscode.Task { - private _process: string; - private _args: string[]; - private _group: vscode.TaskGroup; - private _options: vscode.ProcessOptions; + private _kind: vscode.TaskKind; + private _kindKey: string; + private _name: string; + private _execution: ProcessExecution | ShellExecution; + private _problemMatchers: string[]; + private _isBackground: boolean; + private _source: string; + private _group: TaskGroup; + private _presentationOptions: vscode.TaskPresentationOptions; - constructor(name: string, process: string, args?: string[], problemMatchers?: vscode.ProblemMatchers); - constructor(name: string, process: string, args: string[] | undefined, options: vscode.ProcessOptions, problemMatchers?: vscode.ProblemMatchers); - constructor(name: string, process: string, arg3?: string[], arg4?: vscode.ProcessOptions | vscode.ProblemMatchers, arg5?: vscode.ProblemMatchers) { - if (typeof process !== 'string') { - throw illegalArgument('process'); - } - let args: string[]; - let options: vscode.ProcessOptions; - let problemMatchers: vscode.ProblemMatchers; - args = arg3 || []; - if (arg4) { - if (Array.isArray(arg4) || typeof arg4 === 'string' || ProblemMatcher.is(arg4)) { - problemMatchers = arg4; - } else { - options = arg4; - } - } - if (arg5 && !problemMatchers) { - problemMatchers = arg5; - } - let pm: (string | vscode.ProblemMatcher)[]; - if (problemMatchers && (typeof problemMatchers === 'string' || ProblemMatcher.is(problemMatchers))) { - pm = [problemMatchers]; + constructor(kind: vscode.TaskKind, name: string); + constructor(kind: vscode.TaskKind, name: string, execution: ProcessExecution | ShellExecution); + constructor(kind: vscode.TaskKind, name: string, execution: ProcessExecution | ShellExecution, problemMatchers?: string | string[]); + + constructor(kind: vscode.TaskKind, name: string, execution?: ProcessExecution | ShellExecution, problemMatchers?: string | string[]) { + this.kind = kind; + this.name = name; + this.execution = execution; + if (typeof problemMatchers === 'string') { + this._problemMatchers = [problemMatchers]; } else if (Array.isArray(problemMatchers)) { - pm = problemMatchers; + this._problemMatchers = problemMatchers; + } else { + this._problemMatchers = []; } - pm = pm || []; - super(name, pm); - this._process = process; - this._args = args; - this._options = options || Object.create(null); + this._isBackground = false; } - get process(): string { - return this._process; + get kind(): vscode.TaskKind { + return this._kind; } - get args(): string[] { - return this._args; + set kind(value: vscode.TaskKind) { + if (value === void 0 || value === null) { + throw illegalArgument('Kind can\'t be undefined or null'); + } + this._kindKey = undefined; + this._kind = value; } - set args(value: string[]) { - if (!Array.isArray(value)) { - value = []; + get kindKey(): string { + if (!this._kindKey) { + const hash = crypto.createHash('md5'); + hash.update(JSON.stringify(this._kind)); + this._kindKey = hash.digest('hex'); } - this._args = value; + return this._kindKey; } - get group(): vscode.TaskGroup { - return this._group; + get name(): string { + return this._name; } - set group(value: vscode.TaskGroup) { - if (!TaskGroup.is(value)) { - throw illegalArgument('group'); + set name(value: string) { + if (typeof value !== 'string') { + throw illegalArgument('name'); } - this._group = value; + this._name = value; } - get options(): vscode.ProcessOptions { - return this._options; + get execution(): ProcessExecution | ShellExecution { + return this._execution; } - set options(value: vscode.ProcessOptions) { - if (value === void 0 || value === null) { - value = Object.create(null); + set execution(value: ProcessExecution | ShellExecution) { + if (value === null) { + value = undefined; } - this._options = value; + this._execution = value; } -} - -export class ShellTask extends BaseTask implements vscode.ShellTask { - private _commandLine: string; - private _group: vscode.TaskGroup; - private _options: vscode.ShellOptions; + get problemMatchers(): string[] { + return this._problemMatchers; + } - constructor(name: string, commandLine: string, problemMatchers?: vscode.ProblemMatchers); - constructor(name: string, commandLine: string, options: vscode.ShellOptions, problemMatchers?: vscode.ProblemMatchers); - constructor(name: string, commandLine: string, optionsOrProblemMatchers?: vscode.ShellOptions | vscode.ProblemMatchers, problemMatchers?: vscode.ProblemMatchers) { - if (typeof commandLine !== 'string') { - throw illegalArgument('commandLine'); - } - let options: vscode.ShellOptions = undefined; - let pm: (string | vscode.ProblemMatcher)[]; - if (ShellOptions.is(optionsOrProblemMatchers)) { - options = optionsOrProblemMatchers; - } else { - problemMatchers = optionsOrProblemMatchers; + set problemMatchers(value: string[]) { + if (!Array.isArray(value)) { + value = []; } - if (problemMatchers && (typeof problemMatchers === 'string' || ProblemMatcher.is(problemMatchers))) { - pm = [problemMatchers]; - } else if (Array.isArray(problemMatchers)) { - pm = problemMatchers; + this._problemMatchers = value; + } + + get isBackground(): boolean { + return this._isBackground; + } + + set isBackground(value: boolean) { + if (value !== true && value !== false) { + value = false; } - pm = pm || []; - super(name, pm); - this._commandLine = commandLine; - this._options = options || Object.create(null); + this._isBackground = value; } - get commandLine(): string { - return this._commandLine; + get source(): string { + return this._source; } - get group(): vscode.TaskGroup { + set source(value: string) { + if (value === void 0 || value === null) { + this._source = undefined; + return; + } + if (typeof value !== 'string' || value.length === 0) { + throw illegalArgument('source must be a string of length > 0'); + } + this._source = value; + } + + get group(): TaskGroup { return this._group; } - set group(value: vscode.TaskGroup) { - if (!TaskGroup.is(value)) { - throw illegalArgument('group'); + set group(value: TaskGroup) { + if (value === void 0 || value === null) { + this._group = undefined; + return; } this._group = value; } - get options(): vscode.ShellOptions { - return this._options; + get presentationOptions(): vscode.TaskPresentationOptions { + return this._presentationOptions; } - set options(value: vscode.ShellOptions) { - if (value === void 0 || value === null) { - value = Object.create(null); + set presentationOptions(value: vscode.TaskPresentationOptions) { + if (value === null) { + value = undefined; } - this._options = value; + this._presentationOptions = value; } } + export enum ProgressLocation { SourceControl = 1, Window = 10, } +export class TreeItem { + + iconPath?: string | Uri | { light: string | Uri; dark: string | Uri }; + command?: vscode.Command; + contextValue?: string; + + constructor(public label: string, public collapsibleState: vscode.TreeItemCollapsibleState = TreeItemCollapsibleState.None) { + } + +} + export enum TreeItemCollapsibleState { + None = 0, Collapsed = 1, Expanded = 2 } diff --git a/src/vs/workbench/api/node/extHostWorkspace.ts b/src/vs/workbench/api/node/extHostWorkspace.ts index 38024197279d407468d21823cdda0885fd8ffc81..4976146efcbe0a5f59a6c5b00eea36e4c69173e0 100644 --- a/src/vs/workbench/api/node/extHostWorkspace.ts +++ b/src/vs/workbench/api/node/extHostWorkspace.ts @@ -5,29 +5,65 @@ 'use strict'; import URI from 'vs/base/common/uri'; +import Event, { Emitter } from 'vs/base/common/event'; import { normalize } from 'vs/base/common/paths'; +import { isFalsyOrEmpty } from 'vs/base/common/arrays'; import { relative } from 'path'; +import { Workspace } from 'vs/platform/workspace/common/workspace'; import { IThreadService } from 'vs/workbench/services/thread/common/threadService'; import { IResourceEdit } from 'vs/editor/common/services/bulkEdit'; import { TPromise } from 'vs/base/common/winjs.base'; import { fromRange, EndOfLine } from 'vs/workbench/api/node/extHostTypeConverters'; -import { MainContext, MainThreadWorkspaceShape } from './extHost.protocol'; +import { IWorkspaceData, ExtHostWorkspaceShape, MainContext, MainThreadWorkspaceShape } from './extHost.protocol'; import * as vscode from 'vscode'; -export class ExtHostWorkspace { +export class ExtHostWorkspace extends ExtHostWorkspaceShape { private static _requestIdPool = 0; - private _proxy: MainThreadWorkspaceShape; - private _workspacePath: string; + private readonly _onDidChangeWorkspace = new Emitter(); + private readonly _proxy: MainThreadWorkspaceShape; + private _workspace: Workspace; - constructor(threadService: IThreadService, workspacePath: string) { + readonly onDidChangeWorkspace: Event = this._onDidChangeWorkspace.event; + + constructor(threadService: IThreadService, data: IWorkspaceData) { + super(); this._proxy = threadService.get(MainContext.MainThreadWorkspace); - this._workspacePath = workspacePath; + this._workspace = data ? new Workspace(data.id, data.name, data.roots) : null; + } + + // --- workspace --- + + get workspace(): Workspace { + return this._workspace; + } + + getRoots(): URI[] { + if (!this._workspace) { + return undefined; + } else { + return this._workspace.roots.slice(0); + } } getPath(): string { - return this._workspacePath; + // this is legacy from the days before having + // multi-root and we keep it only alive if there + // is just one workspace folder. + if (!this._workspace) { + return undefined; + } + const { roots } = this._workspace; + if (roots.length === 0) { + return undefined; + } + // if (roots.length === 1) { + return roots[0].fsPath; + // } + // return `undefined` when there no or more than 1 + // root folder. + // return undefined; } getRelativePath(pathOrUri: string | vscode.Uri): string { @@ -43,18 +79,28 @@ export class ExtHostWorkspace { return path; } - if (!this._workspacePath) { + if (!this._workspace || isFalsyOrEmpty(this._workspace.roots)) { return normalize(path); } - let result = relative(this._workspacePath, path); - if (!result || result.indexOf('..') === 0) { - return normalize(path); + for (const { fsPath } of this._workspace.roots) { + let result = relative(fsPath, path); + if (!result || result.indexOf('..') === 0) { + continue; + } + return normalize(result); } - return normalize(result); + return normalize(path); } + $acceptWorkspaceData(data: IWorkspaceData): void { + this._workspace = data ? new Workspace(data.id, data.name, data.roots) : null; + this._onDidChangeWorkspace.fire(this.getRoots()); + } + + // --- search --- + findFiles(include: string, exclude: string, maxResults?: number, token?: vscode.CancellationToken): Thenable { const requestId = ExtHostWorkspace._requestIdPool++; const result = this._proxy.$startSearch(include, exclude, maxResults, requestId); diff --git a/src/vs/workbench/browser/actionBarRegistry.ts b/src/vs/workbench/browser/actions.ts similarity index 99% rename from src/vs/workbench/browser/actionBarRegistry.ts rename to src/vs/workbench/browser/actions.ts index 83bf621f88d30cb08a7695c577179133e9e97057..32bf1d5f56b11131913e29c93fad5ddf4846d125 100644 --- a/src/vs/workbench/browser/actionBarRegistry.ts +++ b/src/vs/workbench/browser/actions.ts @@ -5,7 +5,7 @@ 'use strict'; import { TPromise } from 'vs/base/common/winjs.base'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import types = require('vs/base/common/types'); import { Action, IAction } from 'vs/base/common/actions'; import { BaseActionItem, Separator } from 'vs/base/browser/ui/actionbar/actionbar'; diff --git a/src/vs/workbench/browser/actions/configureLocale.ts b/src/vs/workbench/browser/actions/configureLocale.ts index f9181f4260965017d62c84a158757025a9e2f366..29859fd2e1d2e96ba071eb6b0a51ec80c46e7ee3 100644 --- a/src/vs/workbench/browser/actions/configureLocale.ts +++ b/src/vs/workbench/browser/actions/configureLocale.ts @@ -12,7 +12,7 @@ import * as Labels from 'vs/base/common/labels'; import * as Platform from 'vs/base/common/platform'; import { Action } from 'vs/base/common/actions'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { IWorkbenchActionRegistry, Extensions } from 'vs/workbench/common/actionRegistry'; import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; diff --git a/src/vs/workbench/browser/actions/fileActions.ts b/src/vs/workbench/browser/actions/fileActions.ts index 13f2694a0fc6019d0b268d108612cbe635f015e7..f153239483e513af634a2a6885e5b1cc9ca6ff9a 100644 --- a/src/vs/workbench/browser/actions/fileActions.ts +++ b/src/vs/workbench/browser/actions/fileActions.ts @@ -10,6 +10,10 @@ import { Action } from 'vs/base/common/actions'; import nls = require('vs/nls'); import { IWindowService } from 'vs/platform/windows/common/windows'; import { ITelemetryData } from 'vs/platform/telemetry/common/telemetry'; +import { IWorkspaceContextService } from "vs/platform/workspace/common/workspace"; +import { IWorkspaceEditingService } from "vs/workbench/services/workspace/common/workspaceEditing"; +import URI from "vs/base/common/uri"; +import { IViewletService } from "vs/workbench/services/viewlet/browser/viewlet"; export class OpenFolderAction extends Action { @@ -25,7 +29,7 @@ export class OpenFolderAction extends Action { } run(event?: any, data?: ITelemetryData): TPromise { - return this.windowService.openFolderPicker(undefined, data); + return this.windowService.pickFolderAndOpen(undefined, data); } } @@ -43,6 +47,54 @@ export class OpenFileFolderAction extends Action { } run(event?: any, data?: ITelemetryData): TPromise { - return this.windowService.openFileFolderPicker(undefined, data); + return this.windowService.pickFileFolderAndOpen(undefined, data); + } +} + +export class AddRootFolderAction extends Action { + + static ID = 'workbench.action.addRootFolder'; + static LABEL = nls.localize('addFolder', "Add Root Folder..."); + + constructor( + id: string, + label: string, + @IWindowService private windowService: IWindowService, + @IWorkspaceContextService private contextService: IWorkspaceContextService, + @IWorkspaceEditingService private workspaceEditingService: IWorkspaceEditingService, + @IViewletService private viewletService: IViewletService + ) { + super(id, label); + } + + public run(): TPromise { + if (!this.contextService.hasWorkspace()) { + return this.windowService.pickFolderAndOpen(false /* prefer same window */); + } + + return this.windowService.pickFolder({ buttonLabel: nls.localize('add', "Add"), title: nls.localize('addRootFolder', "Add Root Folder") }).then(folders => { + return this.workspaceEditingService.addRoots(folders.map(folder => URI.file(folder))).then(() => { + return this.viewletService.openViewlet(this.viewletService.getDefaultViewletId(), true); + }); + }); + } +} + +export class RemoveRootFolderAction extends Action { + + static ID = 'workbench.action.removeRootFolder'; + static LABEL = nls.localize('removeRootFolder', "Remove Root Folder"); + + constructor( + private rootUri: URI, + id: string, + label: string, + @IWorkspaceEditingService private workspaceEditingService: IWorkspaceEditingService + ) { + super(id, label); + } + + public run(): TPromise { + return this.workspaceEditingService.removeRoots([this.rootUri]); } } diff --git a/src/vs/workbench/browser/actions/toggleActivityBarVisibility.ts b/src/vs/workbench/browser/actions/toggleActivityBarVisibility.ts index 0c191dd5a55e6c14ce7fac52ef3d2e732a875717..203f720458713037b8456b50791511972232c286 100644 --- a/src/vs/workbench/browser/actions/toggleActivityBarVisibility.ts +++ b/src/vs/workbench/browser/actions/toggleActivityBarVisibility.ts @@ -6,7 +6,7 @@ import { TPromise } from 'vs/base/common/winjs.base'; import nls = require('vs/nls'); -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { Action } from 'vs/base/common/actions'; import { SyncActionDescriptor } from 'vs/platform/actions/common/actions'; import { IWorkbenchActionRegistry, Extensions } from 'vs/workbench/common/actionRegistry'; diff --git a/src/vs/workbench/browser/actions/toggleEditorLayout.ts b/src/vs/workbench/browser/actions/toggleEditorLayout.ts index 0f7aea662daac9c8505a07a2f76b20599398af8e..762f2a2cfbb5c1bcbf85b24e480b0f58706de443 100644 --- a/src/vs/workbench/browser/actions/toggleEditorLayout.ts +++ b/src/vs/workbench/browser/actions/toggleEditorLayout.ts @@ -7,7 +7,7 @@ import 'vs/css!./media/actions'; import { TPromise } from 'vs/base/common/winjs.base'; import nls = require('vs/nls'); -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { Action } from 'vs/base/common/actions'; import { SyncActionDescriptor } from 'vs/platform/actions/common/actions'; import { IWorkbenchActionRegistry, Extensions } from 'vs/workbench/common/actionRegistry'; diff --git a/src/vs/workbench/browser/actions/toggleSidebarPosition.ts b/src/vs/workbench/browser/actions/toggleSidebarPosition.ts index 57364bd91882ddfa3a5ceb32abb1eb3ba699a599..b2dabccb989396cd2c2d776730860c9d299c3fb3 100644 --- a/src/vs/workbench/browser/actions/toggleSidebarPosition.ts +++ b/src/vs/workbench/browser/actions/toggleSidebarPosition.ts @@ -6,7 +6,7 @@ import { TPromise } from 'vs/base/common/winjs.base'; import nls = require('vs/nls'); -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { Action } from 'vs/base/common/actions'; import { SyncActionDescriptor } from 'vs/platform/actions/common/actions'; import { IWorkbenchActionRegistry, Extensions } from 'vs/workbench/common/actionRegistry'; @@ -42,4 +42,4 @@ export class ToggleSidebarPositionAction extends Action { } const registry = Registry.as(Extensions.WorkbenchActions); -registry.registerWorkbenchAction(new SyncActionDescriptor(ToggleSidebarPositionAction, ToggleSidebarPositionAction.ID, ToggleSidebarPositionAction.LABEL), 'View: Toggle Side Bar Position', nls.localize('view', "View")); \ No newline at end of file +registry.registerWorkbenchAction(new SyncActionDescriptor(ToggleSidebarPositionAction, ToggleSidebarPositionAction.ID, ToggleSidebarPositionAction.LABEL), 'View: Toggle Side Bar Location', nls.localize('view', "View")); \ No newline at end of file diff --git a/src/vs/workbench/browser/actions/toggleSidebarVisibility.ts b/src/vs/workbench/browser/actions/toggleSidebarVisibility.ts index a5d1f667ac775be1cf258631b13e77507b8d173b..43f156d934de40835bc732a0ae0077f75907b6de 100644 --- a/src/vs/workbench/browser/actions/toggleSidebarVisibility.ts +++ b/src/vs/workbench/browser/actions/toggleSidebarVisibility.ts @@ -6,7 +6,7 @@ import { TPromise } from 'vs/base/common/winjs.base'; import nls = require('vs/nls'); -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { Action } from 'vs/base/common/actions'; import { SyncActionDescriptor } from 'vs/platform/actions/common/actions'; import { IWorkbenchActionRegistry, Extensions } from 'vs/workbench/common/actionRegistry'; diff --git a/src/vs/workbench/browser/actions/toggleStatusbarVisibility.ts b/src/vs/workbench/browser/actions/toggleStatusbarVisibility.ts index ae231cc643c205d0eda018bf89a2fe0fdd68cf70..cf91fbb71a59ecac2c4c8e396ac0a2c5f49a4ad7 100644 --- a/src/vs/workbench/browser/actions/toggleStatusbarVisibility.ts +++ b/src/vs/workbench/browser/actions/toggleStatusbarVisibility.ts @@ -6,7 +6,7 @@ import { TPromise } from 'vs/base/common/winjs.base'; import nls = require('vs/nls'); -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { Action } from 'vs/base/common/actions'; import { SyncActionDescriptor } from 'vs/platform/actions/common/actions'; import { IWorkbenchActionRegistry, Extensions } from 'vs/workbench/common/actionRegistry'; diff --git a/src/vs/workbench/browser/actions/toggleZenMode.ts b/src/vs/workbench/browser/actions/toggleZenMode.ts index d542e39b8ee1520ee175b58540153542a720149b..f6209430da11aa00dd9b550a0d44fe3066fa2ac8 100644 --- a/src/vs/workbench/browser/actions/toggleZenMode.ts +++ b/src/vs/workbench/browser/actions/toggleZenMode.ts @@ -7,7 +7,7 @@ import { TPromise } from 'vs/base/common/winjs.base'; import nls = require('vs/nls'); import { Action } from 'vs/base/common/actions'; import { KeyCode, KeyMod, KeyChord } from 'vs/base/common/keyCodes'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { SyncActionDescriptor } from 'vs/platform/actions/common/actions'; import { IWorkbenchActionRegistry, Extensions } from 'vs/workbench/common/actionRegistry'; import { IPartService } from 'vs/workbench/services/part/common/partService'; diff --git a/src/vs/workbench/browser/activity.ts b/src/vs/workbench/browser/activity.ts new file mode 100644 index 0000000000000000000000000000000000000000..aff7d7553abb3bf72bd8c1a986f9fc64d88bef52 --- /dev/null +++ b/src/vs/workbench/browser/activity.ts @@ -0,0 +1,42 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { Registry } from 'vs/platform/registry/common/platform'; +import { IAction } from 'vs/base/common/actions'; +import { IConstructorSignature0 } from 'vs/platform/instantiation/common/instantiation'; + +export interface IActivity { + id: string; + name: string; + cssClass: string; +} + +export interface IGlobalActivity extends IActivity { + getActions(): IAction[]; +} + +export const GlobalActivityExtensions = 'workbench.contributions.globalActivities'; + +export interface IGlobalActivityRegistry { + registerActivity(descriptor: IConstructorSignature0): void; + getActivities(): IConstructorSignature0[]; +} + +export class GlobalActivityRegistry implements IGlobalActivityRegistry { + + private activityDescriptors = new Set>(); + + registerActivity(descriptor: IConstructorSignature0): void { + this.activityDescriptors.add(descriptor); + } + + getActivities(): IConstructorSignature0[] { + const result: IConstructorSignature0[] = []; + this.activityDescriptors.forEach(d => result.push(d)); + return result; + } +} + +Registry.add(GlobalActivityExtensions, new GlobalActivityRegistry()); \ No newline at end of file diff --git a/src/vs/workbench/browser/panel.ts b/src/vs/workbench/browser/panel.ts index b8a6c3cf1415ea8cdbf27e957bbbb124cd51503e..6e199f4f0f5416fadfe04277a0db136ec027b86e 100644 --- a/src/vs/workbench/browser/panel.ts +++ b/src/vs/workbench/browser/panel.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import * as DOM from 'vs/base/browser/dom'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { TPromise } from 'vs/base/common/winjs.base'; import { IPanel } from 'vs/workbench/common/panel'; import { Composite, CompositeDescriptor, CompositeRegistry } from 'vs/workbench/browser/composite'; diff --git a/src/vs/workbench/browser/parts/activitybar/activitybarActions.ts b/src/vs/workbench/browser/parts/activitybar/activitybarActions.ts index e1133c4e5ce2faf449c59c6c295fd2c8c0513595..17d00aba4da1926788ef9d86353f1d2a6141d248 100644 --- a/src/vs/workbench/browser/parts/activitybar/activitybarActions.ts +++ b/src/vs/workbench/browser/parts/activitybar/activitybarActions.ts @@ -20,23 +20,36 @@ import { ICommandService } from 'vs/platform/commands/common/commands'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { ViewletDescriptor } from 'vs/workbench/browser/viewlet'; +import { IActivity, IGlobalActivity } from 'vs/workbench/browser/activity'; import { dispose } from 'vs/base/common/lifecycle'; import { IViewletService, } from 'vs/workbench/services/viewlet/browser/viewlet'; import { IPartService, Parts } from 'vs/workbench/services/part/common/partService'; import { IThemeService, ITheme, registerThemingParticipant, ICssStyleCollector } from 'vs/platform/theme/common/themeService'; import { ACTIVITY_BAR_BADGE_FOREGROUND, ACTIVITY_BAR_BADGE_BACKGROUND, ACTIVITY_BAR_DRAG_AND_DROP_BACKGROUND, ACTIVITY_BAR_FOREGROUND } from 'vs/workbench/common/theme'; import { contrastBorder, activeContrastBorder, focusBorder } from 'vs/platform/theme/common/colorRegistry'; +import { StandardMouseEvent } from 'vs/base/browser/mouseEvent'; +import { KeyCode } from 'vs/base/common/keyCodes'; +import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent'; + +export interface IViewletActivity { + badge: IBadge; + clazz: string; +} export class ActivityAction extends Action { private badge: IBadge; private _onDidChangeBadge = new Emitter(); - constructor(id: string, name: string, clazz: string) { - super(id, name, clazz); + constructor(private _activity: IActivity) { + super(_activity.id, _activity.name, _activity.cssClass); this.badge = null; } + public get activity(): IActivity { + return this._activity; + } + public get onDidChangeBadge(): Event { return this._onDidChangeBadge.event; } @@ -74,7 +87,7 @@ export class ViewletActivityAction extends ActivityAction { @IViewletService private viewletService: IViewletService, @IPartService private partService: IPartService ) { - super(viewlet.id, viewlet.name, viewlet.cssClass); + super(viewlet); } public run(event): TPromise { @@ -102,7 +115,13 @@ export class ViewletActivityAction extends ActivityAction { } } -export abstract class ThemableActivityActionItem extends BaseActionItem { +export class ActivityActionItem extends BaseActionItem { + protected $container: Builder; + protected $label: Builder; + protected $badge: Builder; + + private $badgeContent: Builder; + private mouseUpTimeout: number; constructor( action: ActivityAction, @@ -112,54 +131,11 @@ export abstract class ThemableActivityActionItem extends BaseActionItem { super(null, action, options); this.themeService.onThemeChange(this.onThemeChange, this, this._callOnDispose); + action.onDidChangeBadge(this.handleBadgeChangeEvenet, this, this._callOnDispose); } - private onThemeChange(theme: ITheme): void { - this.updateStyles(); - } - - protected abstract updateStyles(): void; -} - -export class ActivityActionItem extends ThemableActivityActionItem { - - private static manageExtensionAction: ManageExtensionAction; - private static toggleViewletPinnedAction: ToggleViewletPinnedAction; - private static draggedViewlet: ViewletDescriptor; - - private $container: Builder; - private $label: Builder; - private name: string; - private _keybinding: string; - private cssClass: string; - private $badge: Builder; - private $badgeContent: Builder; - private mouseUpTimeout: number; - - constructor( - action: ActivityAction, - private viewlet: ViewletDescriptor, - @IContextMenuService private contextMenuService: IContextMenuService, - @IActivityBarService private activityBarService: IActivityBarService, - @IKeybindingService private keybindingService: IKeybindingService, - @IInstantiationService instantiationService: IInstantiationService, - @IThemeService themeService: IThemeService - ) { - super(action, { draggable: true }, themeService); - - this.cssClass = action.class; - this.name = viewlet.name; - this._keybinding = this.getKeybindingLabel(viewlet.id); - - if (!ActivityActionItem.manageExtensionAction) { - ActivityActionItem.manageExtensionAction = instantiationService.createInstance(ManageExtensionAction); - } - - if (!ActivityActionItem.toggleViewletPinnedAction) { - ActivityActionItem.toggleViewletPinnedAction = instantiationService.createInstance(ToggleViewletPinnedAction, void 0); - } - - action.onDidChangeBadge(this.handleBadgeChangeEvenet, this, this._callOnDispose); + protected get activity(): IActivity { + return (this._action as ActivityAction).activity; } protected updateStyles(): void { @@ -187,22 +163,14 @@ export class ActivityActionItem extends ThemableActivityActionItem { } } - private getKeybindingLabel(id: string): string { - const kb = this.keybindingService.lookupKeybinding(id); - if (kb) { - return kb.getLabel(); - } - - return null; - } - public render(container: HTMLElement): void { super.render(container); // Make the container tab-able for keyboard navigation this.$container = $(container).attr({ tabIndex: '0', - role: 'button' + role: 'button', + title: this.activity.name }); // Try hard to prevent keyboard only focus feedback when using mouse @@ -220,6 +188,128 @@ export class ActivityActionItem extends ThemableActivityActionItem { }, 800); // delayed to prevent focus feedback from showing on mouse up }); + // Label + this.$label = $('a.action-label').appendTo(this.builder); + if (this.activity.cssClass) { + this.$label.addClass(this.activity.cssClass); + } + + this.$badge = this.builder.clone().div({ 'class': 'badge' }, (badge: Builder) => { + this.$badgeContent = badge.div({ 'class': 'badge-content' }); + }); + + this.$badge.hide(); + + this.updateStyles(); + } + + private onThemeChange(theme: ITheme): void { + this.updateStyles(); + } + + public setBadge(badge: IBadge): void { + this.updateBadge(badge); + } + + protected updateBadge(badge: IBadge): void { + this.$badgeContent.empty(); + this.$badge.hide(); + + if (badge) { + + // Number + if (badge instanceof NumberBadge) { + if (badge.number) { + this.$badgeContent.text(badge.number > 99 ? '99+' : badge.number.toString()); + this.$badge.show(); + } + } + + // Text + else if (badge instanceof TextBadge) { + this.$badgeContent.text(badge.text); + this.$badge.show(); + } + + // Text + else if (badge instanceof IconBadge) { + this.$badge.show(); + } + + // Progress + else if (badge instanceof ProgressBadge) { + this.$badge.show(); + } + + this.$label.attr('aria-label', `${this.activity.name} - ${badge.getDescription()}`); + } + } + + private handleBadgeChangeEvenet(): void { + const action = this.getAction(); + if (action instanceof ActivityAction) { + this.updateBadge(action.getBadge()); + } + } + + public dispose(): void { + super.dispose(); + + if (this.mouseUpTimeout) { + clearTimeout(this.mouseUpTimeout); + } + + this.$badge.destroy(); + } +} + +export class ViewletActionItem extends ActivityActionItem { + + private static manageExtensionAction: ManageExtensionAction; + private static toggleViewletPinnedAction: ToggleViewletPinnedAction; + private static draggedViewlet: ViewletDescriptor; + + private _keybinding: string; + private cssClass: string; + + constructor( + private action: ViewletActivityAction, + @IContextMenuService private contextMenuService: IContextMenuService, + @IActivityBarService private activityBarService: IActivityBarService, + @IKeybindingService private keybindingService: IKeybindingService, + @IInstantiationService instantiationService: IInstantiationService, + @IThemeService themeService: IThemeService + ) { + super(action, { draggable: true }, themeService); + + this.cssClass = action.class; + this._keybinding = this.getKeybindingLabel(this.viewlet.id); + + if (!ViewletActionItem.manageExtensionAction) { + ViewletActionItem.manageExtensionAction = instantiationService.createInstance(ManageExtensionAction); + } + + if (!ViewletActionItem.toggleViewletPinnedAction) { + ViewletActionItem.toggleViewletPinnedAction = instantiationService.createInstance(ToggleViewletPinnedAction, void 0); + } + } + + private get viewlet(): ViewletDescriptor { + return this.action.activity as ViewletDescriptor; + } + + private getKeybindingLabel(id: string): string { + const kb = this.keybindingService.lookupKeybinding(id); + if (kb) { + return kb.getLabel(); + } + + return null; + } + + public render(container: HTMLElement): void { + super.render(container); + this.$container.on('contextmenu', e => { DOM.EventHelper.stop(e, true); @@ -240,7 +330,7 @@ export class ActivityActionItem extends ThemableActivityActionItem { // Drag enter let counter = 0; // see https://github.com/Microsoft/vscode/issues/14470 this.$container.on(DOM.EventType.DRAG_ENTER, (e: DragEvent) => { - const draggedViewlet = ActivityActionItem.getDraggedViewlet(); + const draggedViewlet = ViewletActionItem.getDraggedViewlet(); if (draggedViewlet && draggedViewlet.id !== this.viewlet.id) { counter++; this.updateFromDragging(container, true); @@ -249,7 +339,7 @@ export class ActivityActionItem extends ThemableActivityActionItem { // Drag leave this.$container.on(DOM.EventType.DRAG_LEAVE, (e: DragEvent) => { - const draggedViewlet = ActivityActionItem.getDraggedViewlet(); + const draggedViewlet = ViewletActionItem.getDraggedViewlet(); if (draggedViewlet) { counter--; if (counter === 0) { @@ -260,12 +350,12 @@ export class ActivityActionItem extends ThemableActivityActionItem { // Drag end this.$container.on(DOM.EventType.DRAG_END, (e: DragEvent) => { - const draggedViewlet = ActivityActionItem.getDraggedViewlet(); + const draggedViewlet = ViewletActionItem.getDraggedViewlet(); if (draggedViewlet) { counter = 0; this.updateFromDragging(container, false); - ActivityActionItem.clearDraggedViewlet(); + ViewletActionItem.clearDraggedViewlet(); } }); @@ -273,34 +363,21 @@ export class ActivityActionItem extends ThemableActivityActionItem { this.$container.on(DOM.EventType.DROP, (e: DragEvent) => { DOM.EventHelper.stop(e, true); - const draggedViewlet = ActivityActionItem.getDraggedViewlet(); + const draggedViewlet = ViewletActionItem.getDraggedViewlet(); if (draggedViewlet && draggedViewlet.id !== this.viewlet.id) { this.updateFromDragging(container, false); - ActivityActionItem.clearDraggedViewlet(); + ViewletActionItem.clearDraggedViewlet(); this.activityBarService.move(draggedViewlet.id, this.viewlet.id); } }); - // Label - this.$label = $('a.action-label').appendTo(this.builder); - if (this.cssClass) { - this.$label.addClass(this.cssClass); - } - - // Badge - this.$badge = this.builder.div({ 'class': 'badge' }, (badge: Builder) => { - this.$badgeContent = badge.div({ 'class': 'badge-content' }); - }); - - this.$badge.hide(); - // Keybinding this.keybinding = this._keybinding; // force update // Activate on drag over to reveal targets [this.$badge, this.$label].forEach(b => new DelayedDragHandler(b.getHTMLElement(), () => { - if (!ActivityActionItem.getDraggedViewlet() && !this.getAction().checked) { + if (!ViewletActionItem.getDraggedViewlet() && !this.getAction().checked) { this.getAction().run(); } })); @@ -316,29 +393,29 @@ export class ActivityActionItem extends ThemableActivityActionItem { } public static getDraggedViewlet(): ViewletDescriptor { - return ActivityActionItem.draggedViewlet; + return ViewletActionItem.draggedViewlet; } private setDraggedViewlet(viewlet: ViewletDescriptor): void { - ActivityActionItem.draggedViewlet = viewlet; + ViewletActionItem.draggedViewlet = viewlet; } public static clearDraggedViewlet(): void { - ActivityActionItem.draggedViewlet = void 0; + ViewletActionItem.draggedViewlet = void 0; } private showContextMenu(container: HTMLElement): void { - const actions: Action[] = [ActivityActionItem.toggleViewletPinnedAction]; + const actions: Action[] = [ViewletActionItem.toggleViewletPinnedAction]; if (this.viewlet.extensionId) { actions.push(new Separator()); - actions.push(ActivityActionItem.manageExtensionAction); + actions.push(ViewletActionItem.manageExtensionAction); } const isPinned = this.activityBarService.isPinned(this.viewlet.id); if (isPinned) { - ActivityActionItem.toggleViewletPinnedAction.label = nls.localize('removeFromActivityBar', "Remove from Activity Bar"); + ViewletActionItem.toggleViewletPinnedAction.label = nls.localize('removeFromActivityBar', "Remove from Activity Bar"); } else { - ActivityActionItem.toggleViewletPinnedAction.label = nls.localize('keepInActivityBar', "Keep in Activity Bar"); + ViewletActionItem.toggleViewletPinnedAction.label = nls.localize('keepInActivityBar', "Keep in Activity Bar"); } this.contextMenuService.showContextMenu({ @@ -352,10 +429,6 @@ export class ActivityActionItem extends ThemableActivityActionItem { this.$container.domFocus(); } - public setBadge(badge: IBadge): void { - this.updateBadge(badge); - } - public set keybinding(keybinding: string) { this._keybinding = keybinding; @@ -365,47 +438,14 @@ export class ActivityActionItem extends ThemableActivityActionItem { let title: string; if (keybinding) { - title = nls.localize('titleKeybinding', "{0} ({1})", this.name, keybinding); + title = nls.localize('titleKeybinding', "{0} ({1})", this.activity.name, keybinding); } else { - title = this.name; + title = this.activity.name; } this.$label.title(title); this.$badge.title(title); - } - - private updateBadge(badge: IBadge): void { - this.$badgeContent.empty(); - this.$badge.hide(); - - if (badge) { - - // Number - if (badge instanceof NumberBadge) { - if (badge.number) { - this.$badgeContent.text(badge.number > 99 ? '99+' : badge.number.toString()); - this.$badge.show(); - } - } - - // Text - else if (badge instanceof TextBadge) { - this.$badgeContent.text(badge.text); - this.$badge.show(); - } - - // Text - else if (badge instanceof IconBadge) { - this.$badge.show(); - } - - // Progress - else if (badge instanceof ProgressBadge) { - this.$badge.show(); - } - - this.$label.attr('aria-label', `${this.name} - ${badge.getDescription()}`); - } + this.$container.title(title); } protected _updateClass(): void { @@ -419,16 +459,9 @@ export class ActivityActionItem extends ThemableActivityActionItem { protected _updateChecked(): void { if (this.getAction().checked) { - this.$container.addClass('active'); + this.$container.addClass('checked'); } else { - this.$container.removeClass('active'); - } - } - - private handleBadgeChangeEvenet(): void { - const action = this.getAction(); - if (action instanceof ActivityAction) { - this.updateBadge(action.getBadge()); + this.$container.removeClass('checked'); } } @@ -443,13 +476,8 @@ export class ActivityActionItem extends ThemableActivityActionItem { public dispose(): void { super.dispose(); - ActivityActionItem.clearDraggedViewlet(); + ViewletActionItem.clearDraggedViewlet(); - if (this.mouseUpTimeout) { - clearTimeout(this.mouseUpTimeout); - } - - this.$badge.destroy(); this.$label.destroy(); } } @@ -459,7 +487,11 @@ export class ViewletOverflowActivityAction extends ActivityAction { constructor( private showMenu: () => void ) { - super('activitybar.additionalViewlets.action', nls.localize('additionalViews', "Additional Views"), 'toggle-more'); + super({ + id: 'activitybar.additionalViewlets.action', + name: nls.localize('additionalViews', "Additional Views"), + cssClass: 'toggle-more' + }); } public run(event): TPromise { @@ -469,8 +501,7 @@ export class ViewletOverflowActivityAction extends ActivityAction { } } -export class ViewletOverflowActivityActionItem extends ThemableActivityActionItem { - private $label: Builder; +export class ViewletOverflowActivityActionItem extends ActivityActionItem { private name: string; private cssClass: string; private actions: OpenViewletAction[]; @@ -481,7 +512,6 @@ export class ViewletOverflowActivityActionItem extends ThemableActivityActionIte private getBadge: (viewlet: ViewletDescriptor) => IBadge, @IInstantiationService private instantiationService: IInstantiationService, @IViewletService private viewletService: IViewletService, - @IKeybindingService private keybindingService: IKeybindingService, @IContextMenuService private contextMenuService: IContextMenuService, @IThemeService themeService: IThemeService ) { @@ -525,7 +555,6 @@ export class ViewletOverflowActivityActionItem extends ThemableActivityActionIte this.contextMenuService.showContextMenu({ getAnchor: () => this.builder.getHTMLElement(), getActions: () => TPromise.as(this.actions), - getKeyBinding: (action) => this.keybindingService.lookupKeybinding(action.id), onHide: () => dispose(this.actions) }); } @@ -626,6 +655,58 @@ export class ToggleViewletPinnedAction extends Action { } } +export class GlobalActivityAction extends ActivityAction { + + constructor(activity: IGlobalActivity) { + super(activity); + } +} + +export class GlobalActivityActionItem extends ActivityActionItem { + + constructor( + action: GlobalActivityAction, + @IThemeService themeService: IThemeService, + @IContextMenuService protected contextMenuService: IContextMenuService + ) { + super(action, { draggable: false }, themeService); + } + + public render(container: HTMLElement): void { + super.render(container); + + // Context menus are triggered on mouse down so that an item can be picked + // and executed with releasing the mouse over it + this.$container.on(DOM.EventType.MOUSE_DOWN, (e: MouseEvent) => { + DOM.EventHelper.stop(e, true); + + const event = new StandardMouseEvent(e); + this.showContextMenu({ x: event.posx, y: event.posy }); + }); + + this.$container.on(DOM.EventType.KEY_UP, (e: KeyboardEvent) => { + let event = new StandardKeyboardEvent(e); + if (event.equals(KeyCode.Enter) || event.equals(KeyCode.Space)) { + DOM.EventHelper.stop(e, true); + + this.showContextMenu(this.$container.getHTMLElement()); + } + }); + } + + private showContextMenu(location: HTMLElement | { x: number, y: number }): void { + const globalAction = this._action as GlobalActivityAction; + const activity = globalAction.activity as IGlobalActivity; + const actions = activity.getActions(); + + this.contextMenuService.showContextMenu({ + getAnchor: () => location, + getActions: () => TPromise.as(actions), + onHide: () => dispose(actions) + }); + } +} + registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => { // Styling with Outline color (e.g. high contrast theme) @@ -643,7 +724,9 @@ registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => { } .monaco-workbench > .activitybar > .content .monaco-action-bar .action-item.active:before, - .monaco-workbench > .activitybar > .content .monaco-action-bar .action-item.active:hover:before { + .monaco-workbench > .activitybar > .content .monaco-action-bar .action-item.active:hover:before, + .monaco-workbench > .activitybar > .content .monaco-action-bar .action-item.checked:before, + .monaco-workbench > .activitybar > .content .monaco-action-bar .action-item.checked:hover:before { outline: 1px solid; } @@ -652,6 +735,7 @@ registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => { } .monaco-workbench > .activitybar > .content .monaco-action-bar .action-item.active:before, + .monaco-workbench > .activitybar > .content .monaco-action-bar .action-item.checked:before, .monaco-workbench > .activitybar > .content .monaco-action-bar .action-item:hover:before { opacity: 1; } @@ -662,6 +746,8 @@ registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => { .monaco-workbench > .activitybar > .content .monaco-action-bar .action-item.active:before, .monaco-workbench > .activitybar > .content .monaco-action-bar .action-item.active:hover:before, + .monaco-workbench > .activitybar > .content .monaco-action-bar .action-item.checked:before, + .monaco-workbench > .activitybar > .content .monaco-action-bar .action-item.checked:hover:before, .monaco-workbench > .activitybar > .content .monaco-action-bar .action-item:hover:before { outline-color: ${outline}; } @@ -671,21 +757,23 @@ registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => { // Styling without outline color else { const focusBorderColor = theme.getColor(focusBorder); + if (focusBorderColor) { + collector.addRule(` + .monaco-workbench > .activitybar > .content .monaco-action-bar .action-item.active .action-label, + .monaco-workbench > .activitybar > .content .monaco-action-bar .action-item.checked .action-label, + .monaco-workbench > .activitybar > .content .monaco-action-bar .action-item:focus .action-label, + .monaco-workbench > .activitybar > .content .monaco-action-bar .action-item:hover .action-label { + opacity: 1; + } - collector.addRule(` - .monaco-workbench > .activitybar > .content .monaco-action-bar .action-item.active .action-label, - .monaco-workbench > .activitybar > .content .monaco-action-bar .action-item:focus .action-label, - .monaco-workbench > .activitybar > .content .monaco-action-bar .action-item:hover .action-label { - opacity: 1; - } - - .monaco-workbench > .activitybar > .content .monaco-action-bar .action-item .action-label { - opacity: 0.6; - } + .monaco-workbench > .activitybar > .content .monaco-action-bar .action-item .action-label { + opacity: 0.6; + } - .monaco-workbench > .activitybar > .content .monaco-action-bar .action-item:focus:before { - border-left-color: ${focusBorderColor}; - } - `); + .monaco-workbench > .activitybar > .content .monaco-action-bar .action-item:focus:before { + border-left-color: ${focusBorderColor}; + } + `); + } } }); \ No newline at end of file diff --git a/src/vs/workbench/browser/parts/activitybar/activitybarPart.ts b/src/vs/workbench/browser/parts/activitybar/activitybarPart.ts index d824b944e0c35d2d28d318e2ae14612c0c60c5b8..cc732f7305f6f8ac70a8f1f16780c833903abf91 100644 --- a/src/vs/workbench/browser/parts/activitybar/activitybarPart.ts +++ b/src/vs/workbench/browser/parts/activitybar/activitybarPart.ts @@ -15,9 +15,11 @@ import { Builder, $, Dimension } from 'vs/base/browser/builder'; import { Action } from 'vs/base/common/actions'; import { ActionsOrientation, ActionBar, IActionItem, Separator } from 'vs/base/browser/ui/actionbar/actionbar'; import { ViewletDescriptor } from 'vs/workbench/browser/viewlet'; +import { GlobalActivityExtensions, IGlobalActivityRegistry } from 'vs/workbench/browser/activity'; +import { Registry } from 'vs/platform/registry/common/platform'; import { Part } from 'vs/workbench/browser/part'; import { IViewlet } from 'vs/workbench/common/viewlet'; -import { ToggleViewletPinnedAction, ViewletActivityAction, ActivityAction, ActivityActionItem, ViewletOverflowActivityAction, ViewletOverflowActivityActionItem } from 'vs/workbench/browser/parts/activitybar/activitybarActions'; +import { ToggleViewletPinnedAction, ViewletActivityAction, ActivityAction, GlobalActivityActionItem, ViewletActionItem, ViewletOverflowActivityAction, ViewletOverflowActivityActionItem, GlobalActivityAction, IViewletActivity } from 'vs/workbench/browser/parts/activitybar/activitybarActions'; import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; import { IActivityBarService, IBadge } from 'vs/workbench/services/activity/common/activityBarService'; import { IPartService, Position as SideBarPosition } from 'vs/workbench/services/part/common/partService'; @@ -27,17 +29,12 @@ import { IStorageService } from 'vs/platform/storage/common/storage'; import { Scope as MementoScope } from 'vs/workbench/common/memento'; import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; import { StandardMouseEvent } from 'vs/base/browser/mouseEvent'; -import { dispose, IDisposable } from 'vs/base/common/lifecycle'; +import { dispose, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; import { ToggleActivityBarVisibilityAction } from 'vs/workbench/browser/actions/toggleActivityBarVisibility'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { ACTIVITY_BAR_BACKGROUND, ACTIVITY_BAR_BORDER } from 'vs/workbench/common/theme'; import { contrastBorder } from 'vs/platform/theme/common/colorRegistry'; -interface IViewletActivity { - badge: IBadge; - clazz: string; -} - export class ActivitybarPart extends Part implements IActivityBarService { private static readonly ACTIVITY_ACTION_HEIGHT = 50; @@ -47,6 +44,9 @@ export class ActivitybarPart extends Part implements IActivityBarService { private dimension: Dimension; + private globalActionBar: ActionBar; + private globalActivityIdToActions: { [globalActivityId: string]: GlobalActivityAction; }; + private viewletSwitcherBar: ActionBar; private viewletOverflowAction: ViewletOverflowActivityAction; private viewletOverflowActionItem: ViewletOverflowActivityActionItem; @@ -55,7 +55,7 @@ export class ActivitybarPart extends Part implements IActivityBarService { private viewletIdToActionItems: { [viewletId: string]: IActionItem; }; private viewletIdToActivityStack: { [viewletId: string]: IViewletActivity[]; }; - private memento: any; + private memento: object; private pinnedViewlets: string[]; private activeUnpinnedViewlet: ViewletDescriptor; @@ -71,6 +71,8 @@ export class ActivitybarPart extends Part implements IActivityBarService { ) { super(id, { hasTitle: false }, themeService); + this.globalActivityIdToActions = Object.create(null); + this.viewletIdToActionItems = Object.create(null); this.viewletIdToActions = Object.create(null); this.viewletIdToActivityStack = Object.create(null); @@ -123,6 +125,21 @@ export class ActivitybarPart extends Part implements IActivityBarService { } } + public showGlobalActivity(globalActivityId: string, badge: IBadge): IDisposable { + if (!badge) { + throw illegalArgument('badge'); + } + + const action = this.globalActivityIdToActions[globalActivityId]; + if (!action) { + throw illegalArgument('globalActivityId'); + } + + action.setBadge(badge); + + return toDisposable(() => action.setBadge(undefined)); + } + public showActivity(viewletId: string, badge: IBadge, clazz?: string): IDisposable { if (!badge) { throw illegalArgument('badge'); @@ -180,6 +197,9 @@ export class ActivitybarPart extends Part implements IActivityBarService { // Top Actionbar with action items for each viewlet action this.createViewletSwitcher($result.clone()); + // Top Actionbar with action items for each viewlet action + this.createGlobalActivityActionBar($result.getHTMLElement()); + // Contextmenu for viewlets $(parent).on('contextmenu', (e: MouseEvent) => { DOM.EventHelper.stop(e, true); @@ -189,11 +209,11 @@ export class ActivitybarPart extends Part implements IActivityBarService { // Allow to drop at the end to move viewlet to the end $(parent).on(DOM.EventType.DROP, (e: DragEvent) => { - const draggedViewlet = ActivityActionItem.getDraggedViewlet(); + const draggedViewlet = ViewletActionItem.getDraggedViewlet(); if (draggedViewlet) { DOM.EventHelper.stop(e, true); - ActivityActionItem.clearDraggedViewlet(); + ViewletActionItem.clearDraggedViewlet(); const targetId = this.pinnedViewlets[this.pinnedViewlets.length - 1]; if (targetId !== draggedViewlet.id) { @@ -252,7 +272,32 @@ export class ActivitybarPart extends Part implements IActivityBarService { this.extensionService.onReady().then(() => this.updateViewletSwitcher()); } + private createGlobalActivityActionBar(container: HTMLElement): void { + const activityRegistry = Registry.as(GlobalActivityExtensions); + const descriptors = activityRegistry.getActivities(); + const actions = descriptors + .map(d => this.instantiationService.createInstance(d)) + .map(a => new GlobalActivityAction(a)); + + this.globalActionBar = new ActionBar(container, { + actionItemProvider: a => this.instantiationService.createInstance(GlobalActivityActionItem, a), + orientation: ActionsOrientation.VERTICAL, + ariaLabel: nls.localize('globalActions', "Global Actions"), + animated: false + }); + + actions.forEach(a => { + this.globalActivityIdToActions[a.id] = a; + this.globalActionBar.push(a); + }); + } + private updateViewletSwitcher() { + if (!this.viewletSwitcherBar) { + // We have not been rendered yet so there is nothing to update. + return; + } + let viewletsToShow = this.getPinnedViewlets(); // Always show the active viewlet even if it is marked to be hidden @@ -371,7 +416,7 @@ export class ActivitybarPart extends Part implements IActivityBarService { private toAction(viewlet: ViewletDescriptor): ActivityAction { const action = this.instantiationService.createInstance(ViewletActivityAction, viewlet); - this.viewletIdToActionItems[action.id] = this.instantiationService.createInstance(ActivityActionItem, action, viewlet); + this.viewletIdToActionItems[action.id] = this.instantiationService.createInstance(ViewletActionItem, action); this.viewletIdToActions[viewlet.id] = action; return action; @@ -495,6 +540,11 @@ export class ActivitybarPart extends Part implements IActivityBarService { this.viewletSwitcherBar = null; } + if (this.globalActionBar) { + this.globalActionBar.dispose(); + this.globalActionBar = null; + } + super.dispose(); } diff --git a/src/vs/workbench/browser/parts/activitybar/media/activitybarpart.css b/src/vs/workbench/browser/parts/activitybar/media/activitybarpart.css index 7acd81393fbdd587a2caebe53e551066c2b913a4..50061325e7e2a443649af5b502e7c6e52bcfe3c8 100644 --- a/src/vs/workbench/browser/parts/activitybar/media/activitybarpart.css +++ b/src/vs/workbench/browser/parts/activitybar/media/activitybarpart.css @@ -9,6 +9,9 @@ .monaco-workbench > .activitybar > .content { height: 100%; + display: flex; + flex-direction: column; + justify-content: space-between; } .monaco-workbench > .activitybar > .content .monaco-action-bar { diff --git a/src/vs/workbench/browser/parts/compositePart.ts b/src/vs/workbench/browser/parts/compositePart.ts index bb92039a1f00c6d27965200fd81c6224f187ff50..ba057331bb3e974b2914a8cf1edcf45b0a2a1576 100644 --- a/src/vs/workbench/browser/parts/compositePart.ts +++ b/src/vs/workbench/browser/parts/compositePart.ts @@ -9,7 +9,7 @@ import 'vs/css!./media/compositepart'; import nls = require('vs/nls'); import { defaultGenerator } from 'vs/base/common/idGenerator'; import { TPromise } from 'vs/base/common/winjs.base'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { Dimension, Builder, $ } from 'vs/base/browser/builder'; import events = require('vs/base/common/events'); @@ -20,7 +20,7 @@ import errors = require('vs/base/common/errors'); import { CONTEXT as ToolBarContext, ToolBar } from 'vs/base/browser/ui/toolbar/toolbar'; import { IActionItem, ActionsOrientation } from 'vs/base/browser/ui/actionbar/actionbar'; import { ProgressBar } from 'vs/base/browser/ui/progressbar/progressbar'; -import { IActionBarRegistry, Extensions, prepareActions } from 'vs/workbench/browser/actionBarRegistry'; +import { IActionBarRegistry, Extensions, prepareActions } from 'vs/workbench/browser/actions'; import { Action, IAction } from 'vs/base/common/actions'; import { Part, IPartOptions } from 'vs/workbench/browser/part'; import { Composite, CompositeRegistry } from 'vs/workbench/browser/composite'; @@ -36,7 +36,7 @@ import { IProgressService } from 'vs/platform/progress/common/progress'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { IThemeService } from 'vs/platform/theme/common/themeService'; -import { attachProgressBarStyler } from "vs/platform/theme/common/styler"; +import { attachProgressBarStyler } from 'vs/platform/theme/common/styler'; export interface ICompositeTitleLabel { @@ -80,6 +80,7 @@ export abstract class CompositePart extends Part { themeService: IThemeService, private registry: CompositeRegistry, private activeCompositeSettingsKey: string, + private defaultCompositeId: string, private nameForTelemetry: string, private compositeCSSClass: string, private actionContributionScope: string, @@ -96,7 +97,7 @@ export abstract class CompositePart extends Part { this.activeComposite = null; this.instantiatedComposites = []; this.compositeLoaderPromises = {}; - this.lastActiveCompositeId = storageService.get(activeCompositeSettingsKey, StorageScope.WORKSPACE); + this.lastActiveCompositeId = storageService.get(activeCompositeSettingsKey, StorageScope.WORKSPACE, this.defaultCompositeId); } protected openComposite(id: string, focus?: boolean): TPromise { @@ -221,7 +222,12 @@ export abstract class CompositePart extends Part { this.activeComposite = composite; // Store in preferences - this.storageService.store(this.activeCompositeSettingsKey, this.activeComposite.getId(), StorageScope.WORKSPACE); + const id = this.activeComposite.getId(); + if (id !== this.defaultCompositeId) { + this.storageService.store(this.activeCompositeSettingsKey, id, StorageScope.WORKSPACE); + } else { + this.storageService.remove(this.activeCompositeSettingsKey, StorageScope.WORKSPACE); + } // Remember this.lastActiveCompositeId = this.activeComposite.getId(); diff --git a/src/vs/workbench/browser/parts/editor/baseEditor.ts b/src/vs/workbench/browser/parts/editor/baseEditor.ts index c113ae2837f13d09ff6f25f6841977783972eb6d..ba76dca67e99ae31fcb3097dc23c8d7c45dc3436 100644 --- a/src/vs/workbench/browser/parts/editor/baseEditor.ts +++ b/src/vs/workbench/browser/parts/editor/baseEditor.ts @@ -7,7 +7,7 @@ import { TPromise } from 'vs/base/common/winjs.base'; import types = require('vs/base/common/types'); import { Builder } from 'vs/base/browser/builder'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { Panel } from 'vs/workbench/browser/panel'; import { EditorInput, EditorOptions, IEditorDescriptor, IEditorInputFactory, IEditorRegistry, Extensions, IFileInputFactory } from 'vs/workbench/common/editor'; import { IEditor, Position } from 'vs/platform/editor/common/editor'; diff --git a/src/vs/workbench/browser/parts/editor/binaryEditor.ts b/src/vs/workbench/browser/parts/editor/binaryEditor.ts index f2e1ec0cde694f7d670eeb0a8f60302c3da22def..08ce253c8dbddc9ffd884a27dd1f78c42ec8d174 100644 --- a/src/vs/workbench/browser/parts/editor/binaryEditor.ts +++ b/src/vs/workbench/browser/parts/editor/binaryEditor.ts @@ -59,7 +59,7 @@ export abstract class BaseBinaryResourceEditor extends BaseEditor { this.binaryContainer.tabindex(0); // enable focus support from the editor part (do not remove) // Custom Scrollbars - this.scrollbar = new DomScrollableElement(binaryContainerElement, { canUseTranslate3d: false, horizontal: ScrollbarVisibility.Auto, vertical: ScrollbarVisibility.Auto }); + this.scrollbar = new DomScrollableElement(binaryContainerElement, { horizontal: ScrollbarVisibility.Auto, vertical: ScrollbarVisibility.Auto }); parent.getHTMLElement().appendChild(this.scrollbar.getDomNode()); } diff --git a/src/vs/workbench/browser/parts/editor/editor.contribution.ts b/src/vs/workbench/browser/parts/editor/editor.contribution.ts index e8a5d028fd331c29d28e7534ba5fb6c28b5b62a6..20234e71595887dad3adc458ce658736968850b9 100644 --- a/src/vs/workbench/browser/parts/editor/editor.contribution.ts +++ b/src/vs/workbench/browser/parts/editor/editor.contribution.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ 'use strict'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import nls = require('vs/nls'); import URI from 'vs/base/common/uri'; import { Action, IAction } from 'vs/base/common/actions'; @@ -23,19 +23,22 @@ import { ITextFileService } from 'vs/workbench/services/textfile/common/textfile import { BinaryResourceDiffEditor } from 'vs/workbench/browser/parts/editor/binaryDiffEditor'; import { ChangeEncodingAction, ChangeEOLAction, ChangeModeAction, EditorStatus } from 'vs/workbench/browser/parts/editor/editorStatus'; import { IWorkbenchActionRegistry, Extensions as ActionExtensions } from 'vs/workbench/common/actionRegistry'; -import { Scope, IActionBarRegistry, Extensions as ActionBarExtensions, ActionBarContributor } from 'vs/workbench/browser/actionBarRegistry'; +import { Scope, IActionBarRegistry, Extensions as ActionBarExtensions, ActionBarContributor } from 'vs/workbench/browser/actions'; import { SyncActionDescriptor } from 'vs/platform/actions/common/actions'; import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; import { KeyMod, KeyChord, KeyCode } from 'vs/base/common/keyCodes'; import { CloseEditorsInGroupAction, CloseEditorsInOtherGroupsAction, CloseAllEditorsAction, MoveGroupLeftAction, MoveGroupRightAction, SplitEditorAction, JoinTwoGroupsAction, KeepEditorAction, CloseOtherEditorsInGroupAction, OpenToSideAction, RevertAndCloseEditorAction, NavigateBetweenGroupsAction, FocusActiveGroupAction, FocusFirstGroupAction, FocusSecondGroupAction, FocusThirdGroupAction, EvenGroupWidthsAction, MaximizeGroupAction, MinimizeOtherGroupsAction, FocusPreviousGroup, FocusNextGroup, ShowEditorsInGroupOneAction, - toEditorQuickOpenEntry, CloseLeftEditorsInGroupAction, CloseRightEditorsInGroupAction, OpenNextEditor, OpenPreviousEditor, NavigateBackwardsAction, NavigateForwardAction, ReopenClosedEditorAction, OpenPreviousRecentlyUsedEditorInGroupAction, NAVIGATE_IN_GROUP_ONE_PREFIX, + toEditorQuickOpenEntry, CloseLeftEditorsInGroupAction, CloseRightEditorsInGroupAction, CloseUnmodifiedEditorsInGroupAction, OpenNextEditor, OpenPreviousEditor, NavigateBackwardsAction, NavigateForwardAction, ReopenClosedEditorAction, OpenPreviousRecentlyUsedEditorInGroupAction, NAVIGATE_IN_GROUP_ONE_PREFIX, OpenPreviousEditorFromHistoryAction, ShowAllEditorsAction, NAVIGATE_ALL_EDITORS_GROUP_PREFIX, ClearEditorHistoryAction, ShowEditorsInGroupTwoAction, MoveEditorRightInGroupAction, OpenNextEditorInGroup, OpenPreviousEditorInGroup, OpenNextRecentlyUsedEditorAction, OpenPreviousRecentlyUsedEditorAction, NAVIGATE_IN_GROUP_TWO_PREFIX, ShowEditorsInGroupThreeAction, NAVIGATE_IN_GROUP_THREE_PREFIX, FocusLastEditorInStackAction, OpenNextRecentlyUsedEditorInGroupAction, MoveEditorToPreviousGroupAction, MoveEditorToNextGroupAction, MoveEditorLeftInGroupAction, ClearRecentFilesAction } from 'vs/workbench/browser/parts/editor/editorActions'; import * as editorCommands from 'vs/workbench/browser/parts/editor/editorCommands'; import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; +import { getQuickNavigateHandler, inQuickOpenContext } from "vs/workbench/browser/parts/quickopen/quickopen"; +import { KeybindingsRegistry } from "vs/platform/keybinding/common/keybindingsRegistry"; +import { ContextKeyExpr } from "vs/platform/contextkey/common/contextkey"; // Register String Editor Registry.as(EditorExtensions.Editors).registerEditor( @@ -91,8 +94,9 @@ Registry.as(EditorExtensions.Editors).registerEditor( interface ISerializedUntitledEditorInput { resource: string; - resourceJSON: any; + resourceJSON: object; modeId: string; + encoding: string; } // Register Editor Input Factory @@ -118,7 +122,8 @@ class UntitledEditorInputFactory implements IEditorInputFactory { const serialized: ISerializedUntitledEditorInput = { resource: resource.toString(), // Keep for backwards compatibility resourceJSON: resource.toJSON(), - modeId: untitledEditorInput.getModeId() + modeId: untitledEditorInput.getModeId(), + encoding: untitledEditorInput.getEncoding() }; return JSON.stringify(serialized); @@ -130,8 +135,9 @@ class UntitledEditorInputFactory implements IEditorInputFactory { const resource = !!deserialized.resourceJSON ? URI.revive(deserialized.resourceJSON) : URI.parse(deserialized.resource); const filePath = resource.scheme === 'file' ? resource.fsPath : void 0; const language = deserialized.modeId; + const encoding = deserialized.encoding; - return accessor.get(IWorkbenchEditorService).createInput({ resource, filePath, language }) as UntitledEditorInput; + return accessor.get(IWorkbenchEditorService).createInput({ resource, filePath, language, encoding }) as UntitledEditorInput; }); } } @@ -254,11 +260,15 @@ export class QuickOpenActionContributor extends ActionBarContributor { const actionBarRegistry = Registry.as(ActionBarExtensions.Actionbar); actionBarRegistry.registerActionBarContributor(Scope.VIEWER, QuickOpenActionContributor); +const editorPickerContextKey = 'inEditorsPicker'; +const editorPickerContext = ContextKeyExpr.and(inQuickOpenContext, ContextKeyExpr.has(editorPickerContextKey)); + Registry.as(QuickOpenExtensions.Quickopen).registerQuickOpenHandler( new QuickOpenHandlerDescriptor( 'vs/workbench/browser/parts/editor/editorPicker', 'GroupOnePicker', NAVIGATE_IN_GROUP_ONE_PREFIX, + editorPickerContextKey, [ { prefix: NAVIGATE_IN_GROUP_ONE_PREFIX, @@ -284,6 +294,7 @@ Registry.as(QuickOpenExtensions.Quickopen).registerQuickOpen 'vs/workbench/browser/parts/editor/editorPicker', 'GroupTwoPicker', NAVIGATE_IN_GROUP_TWO_PREFIX, + editorPickerContextKey, [] ) ); @@ -293,6 +304,7 @@ Registry.as(QuickOpenExtensions.Quickopen).registerQuickOpen 'vs/workbench/browser/parts/editor/editorPicker', 'GroupThreePicker', NAVIGATE_IN_GROUP_THREE_PREFIX, + editorPickerContextKey, [] ) ); @@ -302,6 +314,7 @@ Registry.as(QuickOpenExtensions.Quickopen).registerQuickOpen 'vs/workbench/browser/parts/editor/editorPicker', 'AllEditorsPicker', NAVIGATE_ALL_EDITORS_GROUP_PREFIX, + editorPickerContextKey, [ { prefix: NAVIGATE_ALL_EDITORS_GROUP_PREFIX, @@ -315,11 +328,9 @@ Registry.as(QuickOpenExtensions.Quickopen).registerQuickOpen // Register Editor Actions const category = nls.localize('view', "View"); registry.registerWorkbenchAction(new SyncActionDescriptor(OpenNextEditorInGroup, OpenNextEditorInGroup.ID, OpenNextEditorInGroup.LABEL), 'View: Open Next Editor in Group', category); -registry.registerWorkbenchAction(new SyncActionDescriptor(OpenPreviousEditorInGroup, OpenPreviousEditorInGroup.ID, OpenPreviousEditorInGroup.LABEL), 'View: Open Next Recently Used Editor in Group', category); -registry.registerWorkbenchAction(new SyncActionDescriptor(OpenNextRecentlyUsedEditorAction, OpenNextRecentlyUsedEditorAction.ID, OpenNextRecentlyUsedEditorAction.LABEL), 'View: Open Next Recently Used Editor'); -registry.registerWorkbenchAction(new SyncActionDescriptor(OpenPreviousRecentlyUsedEditorAction, OpenPreviousRecentlyUsedEditorAction.ID, OpenPreviousRecentlyUsedEditorAction.LABEL), 'View: Open Previous Recently Used Editor'); -registry.registerWorkbenchAction(new SyncActionDescriptor(OpenNextRecentlyUsedEditorInGroupAction, OpenNextRecentlyUsedEditorInGroupAction.ID, OpenNextRecentlyUsedEditorInGroupAction.LABEL, { primary: KeyMod.CtrlCmd | KeyCode.Tab, mac: { primary: KeyMod.WinCtrl | KeyCode.Tab } }), 'Open Next Recently Used Editor in Group'); -registry.registerWorkbenchAction(new SyncActionDescriptor(OpenPreviousRecentlyUsedEditorInGroupAction, OpenPreviousRecentlyUsedEditorInGroupAction.ID, OpenPreviousRecentlyUsedEditorInGroupAction.LABEL, { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.Tab, mac: { primary: KeyMod.WinCtrl | KeyMod.Shift | KeyCode.Tab } }), 'Open Previous Recently Used Editor in Group'); +registry.registerWorkbenchAction(new SyncActionDescriptor(OpenPreviousEditorInGroup, OpenPreviousEditorInGroup.ID, OpenPreviousEditorInGroup.LABEL), 'View: Open Previous Editor in Group', category); +registry.registerWorkbenchAction(new SyncActionDescriptor(OpenNextRecentlyUsedEditorAction, OpenNextRecentlyUsedEditorAction.ID, OpenNextRecentlyUsedEditorAction.LABEL), 'View: Open Next Recently Used Editor', category); +registry.registerWorkbenchAction(new SyncActionDescriptor(OpenPreviousRecentlyUsedEditorAction, OpenPreviousRecentlyUsedEditorAction.ID, OpenPreviousRecentlyUsedEditorAction.LABEL), 'View: Open Previous Recently Used Editor', category); registry.registerWorkbenchAction(new SyncActionDescriptor(ShowAllEditorsAction, ShowAllEditorsAction.ID, ShowAllEditorsAction.LABEL, { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_P), mac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.Tab } }), 'View: Show All Editors', category); registry.registerWorkbenchAction(new SyncActionDescriptor(ShowEditorsInGroupOneAction, ShowEditorsInGroupOneAction.ID, ShowEditorsInGroupOneAction.LABEL), 'View: Show Editors in First Group', category); registry.registerWorkbenchAction(new SyncActionDescriptor(ShowEditorsInGroupTwoAction, ShowEditorsInGroupTwoAction.ID, ShowEditorsInGroupTwoAction.LABEL), 'View: Show Editors in Second Group', category); @@ -332,6 +343,7 @@ registry.registerWorkbenchAction(new SyncActionDescriptor(KeepEditorAction, Keep registry.registerWorkbenchAction(new SyncActionDescriptor(CloseAllEditorsAction, CloseAllEditorsAction.ID, CloseAllEditorsAction.LABEL, { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_W) }), 'View: Close All Editors', category); registry.registerWorkbenchAction(new SyncActionDescriptor(CloseLeftEditorsInGroupAction, CloseLeftEditorsInGroupAction.ID, CloseLeftEditorsInGroupAction.LABEL), 'View: Close Editors to the Left', category); registry.registerWorkbenchAction(new SyncActionDescriptor(CloseRightEditorsInGroupAction, CloseRightEditorsInGroupAction.ID, CloseRightEditorsInGroupAction.LABEL), 'View: Close Editors to the Right', category); +registry.registerWorkbenchAction(new SyncActionDescriptor(CloseUnmodifiedEditorsInGroupAction, CloseUnmodifiedEditorsInGroupAction.ID, CloseUnmodifiedEditorsInGroupAction.LABEL, { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyCode.KEY_U) }), 'View: Close Unmodified Editors in Group', category); registry.registerWorkbenchAction(new SyncActionDescriptor(CloseEditorsInGroupAction, CloseEditorsInGroupAction.ID, CloseEditorsInGroupAction.LABEL, { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyCode.KEY_W) }), 'View: Close All Editors in Group', category); registry.registerWorkbenchAction(new SyncActionDescriptor(CloseOtherEditorsInGroupAction, CloseOtherEditorsInGroupAction.ID, CloseOtherEditorsInGroupAction.LABEL, { primary: null, mac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KEY_T } }), 'View: Close Other Editors', category); registry.registerWorkbenchAction(new SyncActionDescriptor(CloseEditorsInOtherGroupsAction, CloseEditorsInOtherGroupsAction.ID, CloseEditorsInOtherGroupsAction.LABEL), 'View: Close Editors in Other Groups', category); @@ -342,7 +354,7 @@ registry.registerWorkbenchAction(new SyncActionDescriptor(FocusActiveGroupAction registry.registerWorkbenchAction(new SyncActionDescriptor(FocusFirstGroupAction, FocusFirstGroupAction.ID, FocusFirstGroupAction.LABEL, { primary: KeyMod.CtrlCmd | KeyCode.KEY_1 }), 'View: Focus First Editor Group', category); registry.registerWorkbenchAction(new SyncActionDescriptor(FocusSecondGroupAction, FocusSecondGroupAction.ID, FocusSecondGroupAction.LABEL, { primary: KeyMod.CtrlCmd | KeyCode.KEY_2 }), 'View: Focus Second Editor Group', category); registry.registerWorkbenchAction(new SyncActionDescriptor(FocusThirdGroupAction, FocusThirdGroupAction.ID, FocusThirdGroupAction.LABEL, { primary: KeyMod.CtrlCmd | KeyCode.KEY_3 }), 'View: Focus Third Editor Group', category); -registry.registerWorkbenchAction(new SyncActionDescriptor(FocusLastEditorInStackAction, FocusLastEditorInStackAction.ID, FocusLastEditorInStackAction.LABEL, { primary: KeyMod.Alt | KeyCode.KEY_0, mac: { primary: KeyMod.WinCtrl | KeyCode.KEY_0 } }), 'View: Focus Last Editor in Group', category); +registry.registerWorkbenchAction(new SyncActionDescriptor(FocusLastEditorInStackAction, FocusLastEditorInStackAction.ID, FocusLastEditorInStackAction.LABEL, { primary: KeyMod.Alt | KeyCode.KEY_0, mac: { primary: KeyMod.WinCtrl | KeyCode.KEY_0 } }), 'View: Open Last Editor in Group', category); registry.registerWorkbenchAction(new SyncActionDescriptor(EvenGroupWidthsAction, EvenGroupWidthsAction.ID, EvenGroupWidthsAction.LABEL), 'View: Even Editor Group Widths', category); registry.registerWorkbenchAction(new SyncActionDescriptor(MaximizeGroupAction, MaximizeGroupAction.ID, MaximizeGroupAction.LABEL), 'View: Maximize Editor Group and Hide Sidebar', category); registry.registerWorkbenchAction(new SyncActionDescriptor(MinimizeOtherGroupsAction, MinimizeOtherGroupsAction.ID, MinimizeOtherGroupsAction.LABEL), 'View: Minimize Other Editor Groups', category); @@ -360,5 +372,32 @@ registry.registerWorkbenchAction(new SyncActionDescriptor(OpenPreviousEditorFrom registry.registerWorkbenchAction(new SyncActionDescriptor(ClearEditorHistoryAction, ClearEditorHistoryAction.ID, ClearEditorHistoryAction.LABEL), 'Clear Editor History'); registry.registerWorkbenchAction(new SyncActionDescriptor(RevertAndCloseEditorAction, RevertAndCloseEditorAction.ID, RevertAndCloseEditorAction.LABEL), 'View: Revert and Close Editor', category); +// Register Editor Picker Actions including quick navigate support +const openNextEditorKeybinding = { primary: KeyMod.CtrlCmd | KeyCode.Tab, mac: { primary: KeyMod.WinCtrl | KeyCode.Tab } }; +const openPreviousEditorKeybinding = { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.Tab, mac: { primary: KeyMod.WinCtrl | KeyMod.Shift | KeyCode.Tab } }; +registry.registerWorkbenchAction(new SyncActionDescriptor(OpenNextRecentlyUsedEditorInGroupAction, OpenNextRecentlyUsedEditorInGroupAction.ID, OpenNextRecentlyUsedEditorInGroupAction.LABEL, openNextEditorKeybinding), 'Open Next Recently Used Editor in Group'); +registry.registerWorkbenchAction(new SyncActionDescriptor(OpenPreviousRecentlyUsedEditorInGroupAction, OpenPreviousRecentlyUsedEditorInGroupAction.ID, OpenPreviousRecentlyUsedEditorInGroupAction.LABEL, openPreviousEditorKeybinding), 'Open Previous Recently Used Editor in Group'); + +const quickOpenNavigateNextInEditorPickerId = 'workbench.action.quickOpenNavigateNextInEditorPicker'; +KeybindingsRegistry.registerCommandAndKeybindingRule({ + id: quickOpenNavigateNextInEditorPickerId, + weight: KeybindingsRegistry.WEIGHT.workbenchContrib(50), + handler: getQuickNavigateHandler(quickOpenNavigateNextInEditorPickerId, true), + when: editorPickerContext, + primary: openNextEditorKeybinding.primary, + mac: openNextEditorKeybinding.mac +}); + +const quickOpenNavigatePreviousInEditorPickerId = 'workbench.action.quickOpenNavigatePreviousInEditorPicker'; +KeybindingsRegistry.registerCommandAndKeybindingRule({ + id: quickOpenNavigatePreviousInEditorPickerId, + weight: KeybindingsRegistry.WEIGHT.workbenchContrib(50), + handler: getQuickNavigateHandler(quickOpenNavigatePreviousInEditorPickerId, false), + when: editorPickerContext, + primary: openPreviousEditorKeybinding.primary, + mac: openPreviousEditorKeybinding.mac +}); + + // Editor Commands editorCommands.setup(); \ No newline at end of file diff --git a/src/vs/workbench/browser/parts/editor/editorActions.ts b/src/vs/workbench/browser/parts/editor/editorActions.ts index f7f5e2e9b838296e9c45daeb1fd0ae41ecce9ec5..29cf34bc07c99599b462a4979224e44c817076f3 100644 --- a/src/vs/workbench/browser/parts/editor/editorActions.ts +++ b/src/vs/workbench/browser/parts/editor/editorActions.ts @@ -15,8 +15,7 @@ import { EditorQuickOpenEntry, EditorQuickOpenEntryGroup, IEditorQuickOpenEntry, import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IQuickOpenService } from 'vs/platform/quickOpen/common/quickOpen'; import { IPartService } from 'vs/workbench/services/part/common/partService'; -import { Position, IEditor, Direction, IResourceInput, IEditorInput, POSITIONS } from 'vs/platform/editor/common/editor'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; +import { Position, IEditor, Direction, IResourceInput, IEditorInput } from 'vs/platform/editor/common/editor'; import { IHistoryService } from 'vs/workbench/services/history/common/history'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { IEditorGroupService, GroupArrangement } from 'vs/workbench/services/group/common/groupService'; @@ -414,19 +413,17 @@ export class FocusPreviousGroup extends Action { return TPromise.as(true); } + const stacks = this.editorGroupService.getStacksModel(); + const groupCount = stacks.groups.length; - // Find the next position to the left/top - let nextPosition: Position = Position.ONE; - if (activeEditor.position === Position.THREE) { - nextPosition = Position.TWO; - } else if (activeEditor.position === Position.ONE) { - // Get the last active position - const lastPosition = this.editorGroupService.getStacksModel().groups.length - 1; - nextPosition = lastPosition; + // Nothing to do if the only group + if (groupCount === 1) { + return TPromise.as(true); } - // Focus next position if provided - this.editorGroupService.focusGroup(nextPosition); + // Nevigate to the previous group or to the last group if the first group is active + const newPositionIndex = (activeEditor.position + groupCount - 1) % groupCount; + this.editorGroupService.focusGroup(newPositionIndex); return TPromise.as(true); } @@ -437,42 +434,35 @@ export class FocusNextGroup extends Action { public static ID = 'workbench.action.focusNextGroup'; public static LABEL = nls.localize('focusNextGroup', "Focus Next Group"); - private navigateActions: Action[]; - constructor( id: string, label: string, - @IWorkbenchEditorService private editorService: IWorkbenchEditorService, - @IInstantiationService instantiationService: IInstantiationService + @IEditorGroupService private editorGroupService: IEditorGroupService, + @IWorkbenchEditorService private editorService: IWorkbenchEditorService ) { super(id, label); - - this.navigateActions = []; - this.navigateActions[Position.ONE] = instantiationService.createInstance(FocusFirstGroupAction, FocusFirstGroupAction.ID, FocusFirstGroupAction.LABEL); - this.navigateActions[Position.TWO] = instantiationService.createInstance(FocusSecondGroupAction, FocusSecondGroupAction.ID, FocusSecondGroupAction.LABEL); - this.navigateActions[Position.THREE] = instantiationService.createInstance(FocusThirdGroupAction, FocusThirdGroupAction.ID, FocusThirdGroupAction.LABEL); } public run(event?: any): TPromise { - // Find the next position to the right/bottom to use - let nextPosition: Position; const activeEditor = this.editorService.getActiveEditor(); - const lastPosition = POSITIONS[POSITIONS.length - 1]; - if (!activeEditor || activeEditor.position === lastPosition) { - nextPosition = Position.ONE; - } else if (activeEditor.position === Position.ONE) { - nextPosition = Position.TWO; - } else if (activeEditor.position === Position.TWO) { - nextPosition = Position.THREE; + if (!activeEditor) { + return TPromise.as(true); } - // Run the action for the target next position - if (typeof nextPosition === 'number' && this.navigateActions[nextPosition]) { - return this.navigateActions[nextPosition].run(event); + const stacks = this.editorGroupService.getStacksModel(); + const groupCount = stacks.groups.length; + + // Nowhere to switch if the only group + if (groupCount === 1) { + return TPromise.as(true); } + // Nevigate to the next group or to the first group if the last group is active + const newPositionIndex = (activeEditor.position + 1) % groupCount; + this.editorGroupService.focusGroup(newPositionIndex); + return TPromise.as(true); } } @@ -627,7 +617,7 @@ export class CloseLeftEditorsInGroupAction extends Action { public run(context?: IEditorContext): TPromise { const editor = getTarget(this.editorService, this.groupService, context); if (editor) { - return this.editorService.closeEditors(editor.position, editor.input, Direction.LEFT); + return this.editorService.closeEditors(editor.position, { except: editor.input, direction: Direction.LEFT }); } return TPromise.as(false); @@ -651,7 +641,7 @@ export class CloseRightEditorsInGroupAction extends Action { public run(context?: IEditorContext): TPromise { const editor = getTarget(this.editorService, this.groupService, context); if (editor) { - return this.editorService.closeEditors(editor.position, editor.input, Direction.RIGHT); + return this.editorService.closeEditors(editor.position, { except: editor.input, direction: Direction.RIGHT }); } return TPromise.as(false); @@ -701,6 +691,39 @@ export class CloseAllEditorsAction extends Action { } } +export class CloseUnmodifiedEditorsInGroupAction extends Action { + + public static ID = 'workbench.action.closeUnmodifiedEditors'; + public static LABEL = nls.localize('closeUnmodifiedEditors', "Close Unmodified Editors in Group"); + + constructor( + id: string, + label: string, + @IEditorGroupService private editorGroupService: IEditorGroupService, + @IWorkbenchEditorService private editorService: IWorkbenchEditorService + ) { + super(id, label); + } + + public run(context?: IEditorContext): TPromise { + let position = context ? this.editorGroupService.getStacksModel().positionOfGroup(context.group) : null; + + // If position is not passed in take the position of the active editor. + if (typeof position !== 'number') { + const active = this.editorService.getActiveEditor(); + if (active) { + position = active.position; + } + } + + if (typeof position === 'number') { + return this.editorService.closeEditors(position, { unmodifiedOnly: true }); + } + + return TPromise.as(false); + } +} + export class CloseEditorsInOtherGroupsAction extends Action { public static ID = 'workbench.action.closeEditorsInOtherGroups'; @@ -758,7 +781,7 @@ export class CloseOtherEditorsInGroupAction extends Action { } if (typeof position === 'number' && input) { - return this.editorService.closeEditors(position, input); + return this.editorService.closeEditors(position, { except: input }); } return TPromise.as(false); diff --git a/src/vs/workbench/browser/parts/editor/editorGroupsControl.ts b/src/vs/workbench/browser/parts/editor/editorGroupsControl.ts index 05bf24ac197bb718440ac905066cab6acc124066..4bc4a3b143a7d7c86eacba0408c4a431fcaf5434 100644 --- a/src/vs/workbench/browser/parts/editor/editorGroupsControl.ts +++ b/src/vs/workbench/browser/parts/editor/editorGroupsControl.ts @@ -36,7 +36,7 @@ import { getCodeEditor } from 'vs/editor/common/services/codeEditorService'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { editorBackground, contrastBorder, activeContrastBorder } from 'vs/platform/theme/common/colorRegistry'; import { Themable, EDITOR_GROUP_HEADER_TABS_BACKGROUND, EDITOR_GROUP_HEADER_NO_TABS_BACKGROUND, EDITOR_GROUP_BORDER, EDITOR_DRAG_AND_DROP_BACKGROUND, EDITOR_GROUP_BACKGROUND, EDITOR_GROUP_HEADER_TABS_BORDER } from 'vs/workbench/common/theme'; -import { attachProgressBarStyler } from "vs/platform/theme/common/styler"; +import { attachProgressBarStyler } from 'vs/platform/theme/common/styler'; export enum Rochade { NONE, diff --git a/src/vs/workbench/browser/parts/editor/editorPart.ts b/src/vs/workbench/browser/parts/editor/editorPart.ts index be76d1a4ff6db72500b88ee669c21008fe794563..697f0dcfe3c12d9fc73d07efb3f12f6dac4c71a6 100644 --- a/src/vs/workbench/browser/parts/editor/editorPart.ts +++ b/src/vs/workbench/browser/parts/editor/editorPart.ts @@ -8,7 +8,7 @@ import 'vs/css!./media/editorpart'; import 'vs/workbench/browser/parts/editor/editor.contribution'; import { TPromise } from 'vs/base/common/winjs.base'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { Dimension, Builder, $ } from 'vs/base/browser/builder'; import nls = require('vs/nls'); import strings = require('vs/base/common/strings'); @@ -86,7 +86,7 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService private dimension: Dimension; private editorGroupsControl: IEditorGroupsControl; - private memento: any; + private memento: object; private stacks: EditorStacksModel; private tabOptions: ITabOptions; private forceHideTabs: boolean; @@ -182,7 +182,7 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService this.toUnbind.push(this.stacks.onEditorClosed(event => this.onEditorClosed(event))); this.toUnbind.push(this.stacks.onGroupOpened(event => this.onEditorGroupOpenedOrClosed())); this.toUnbind.push(this.stacks.onGroupClosed(event => this.onEditorGroupOpenedOrClosed())); - this.toUnbind.push(this.configurationService.onDidUpdateConfiguration(e => this.onConfigurationUpdated(e.config))); + this.toUnbind.push(this.configurationService.onDidUpdateConfiguration(e => this.onConfigurationUpdated(this.configurationService.getConfiguration()))); } private onEditorGroupOpenedOrClosed(): void { @@ -361,7 +361,7 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService // Hide active one first if (editorAtPosition) { - this.doHideEditor(position, false); + this.doHideEditor(editorAtPosition, position, false); } // Create Editor @@ -441,22 +441,18 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService const editorInstantiationService = this.editorGroupsControl.getInstantiationService(position).createChild(new ServiceCollection([IProgressService, progressService])); let loaded = false; - const onInstantiate = (arg: BaseEditor | Error): TPromise => { + const onInstantiate = (arg: BaseEditor): TPromise => { const position = this.stacks.positionOfGroup(group); // might have changed due to a rochade meanwhile loaded = true; delete this.mapEditorInstantiationPromiseToEditor[position][descriptor.getId()]; - if (arg instanceof BaseEditor) { - this.instantiatedEditors[position].push(arg); + this.instantiatedEditors[position].push(arg); - return TPromise.as(arg); - } - - return TPromise.wrapError(arg); + return TPromise.as(arg); }; - const instantiateEditorPromise = editorInstantiationService.createInstance(descriptor).then(onInstantiate, onInstantiate); + const instantiateEditorPromise = editorInstantiationService.createInstance(descriptor).then(onInstantiate); if (!loaded) { this.mapEditorInstantiationPromiseToEditor[position][descriptor.getId()] = instantiateEditorPromise; @@ -464,6 +460,7 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService return instantiateEditorPromise.then(result => { progressService.dispose(); + return result; }); } @@ -595,8 +592,11 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService // Update stacks model this.modifyGroups(() => this.stacks.closeGroup(group)); - // Hide Editor - this.doHideEditor(position, true); + // Hide Editor if there is one + const editor = this.visibleEditors[position]; + if (editor) { + this.doHideEditor(editor, position, true); + } // Emit Change Event this._onEditorsChanged.fire(); @@ -616,8 +616,7 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService } } - private doHideEditor(position: Position, layoutAndRochade: boolean): void { - const editor = this.visibleEditors[position]; + private doHideEditor(editor: BaseEditor, position: Position, layoutAndRochade: boolean): void { // Hide in side by side control const rochade = this.editorGroupsControl.hide(editor, position, layoutAndRochade); @@ -668,18 +667,23 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService }); } - public closeEditors(position: Position, except?: EditorInput, direction?: Direction): TPromise { + public closeEditors(position: Position, filter: { except?: EditorInput, direction?: Direction, unmodifiedOnly?: boolean } = Object.create(null)): TPromise { const group = this.stacks.groupAt(position); if (!group) { return TPromise.as(null); } + let editors = group.getEditors(); + if (filter.unmodifiedOnly) { + editors = editors.filter(e => !e.isDirty()); + } + // Check for dirty and veto let editorsToClose: EditorInput[]; - if (types.isUndefinedOrNull(direction)) { - editorsToClose = group.getEditors().filter(e => !except || !e.matches(except)); + if (types.isUndefinedOrNull(filter.direction)) { + editorsToClose = editors.filter(e => !filter.except || !e.matches(filter.except)); } else { - editorsToClose = (direction === Direction.LEFT) ? group.getEditors().slice(0, group.indexOf(except)) : group.getEditors().slice(group.indexOf(except) + 1); + editorsToClose = (filter.direction === Direction.LEFT) ? editors.slice(0, group.indexOf(filter.except)) : editors.slice(group.indexOf(filter.except) + 1); } return this.handleDirty(editorsToClose.map(editor => { return { group, editor }; }), true /* ignore if opened in other group */).then(veto => { @@ -687,14 +691,26 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService return; } - this.doCloseEditors(group, except, direction); + this.doCloseEditors(group, filter); }); } - private doCloseEditors(group: EditorGroup, except?: EditorInput, direction?: Direction): void { + private doCloseEditors(group: EditorGroup, filter: { except?: EditorInput, direction?: Direction, unmodifiedOnly?: boolean } = Object.create(null)): void { + + // Close all editors if there is no editor to except and + // we either are not only closing unmodified editors or + // there are no dirty editors. + let closeAllEditors = false; + if (!filter.except) { + if (!filter.unmodifiedOnly) { + closeAllEditors = true; + } else { + closeAllEditors = !group.getEditors().some(e => e.isDirty()); + } + } // Close all editors in group - if (!except) { + if (closeAllEditors) { // Update stacks model: remove all non active editors first to prevent opening the next editor in group group.closeEditors(group.activeEditor); @@ -703,23 +719,42 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService this.doCloseActiveEditor(group); } + // Close unmodified editors in group + else if (filter.unmodifiedOnly) { + + // We can just close all unmodified editors around the currently active dirty one + if (group.activeEditor.isDirty()) { + group.getEditors().filter(editor => !editor.isDirty() && !editor.matches(filter.except)).forEach(editor => this.doCloseInactiveEditor(group, editor)); + } + + // Active editor is also a candidate to close, thus we make the first dirty editor + // active and then close the other ones + else { + const firstDirtyEditor = group.getEditors().filter(editor => editor.isDirty())[0]; + + this.openEditor(firstDirtyEditor, null, this.stacks.positionOfGroup(group)).done(() => { + this.doCloseEditors(group, filter); + }, errors.onUnexpectedError); + } + } + // Close all editors in group except active one - else if (except.matches(group.activeEditor)) { + else if (filter.except && filter.except.matches(group.activeEditor)) { // Update stacks model: close non active editors supporting the direction - group.closeEditors(group.activeEditor, direction); + group.closeEditors(group.activeEditor, filter.direction); } // Finally: we are asked to close editors around a non-active editor // Thus we make the non-active one active and then close the others else { - this.openEditor(except, null, this.stacks.positionOfGroup(group)).done(() => { + this.openEditor(filter.except, null, this.stacks.positionOfGroup(group)).done(() => { // since the opening might have failed, we have to check again for the active editor // being the expected one, otherwise we end up in an endless loop trying to open the // editor - if (except.matches(group.activeEditor)) { - this.doCloseEditors(group, except, direction); + if (filter.except.matches(group.activeEditor)) { + this.doCloseEditors(group, filter); } }, errors.onUnexpectedError); } @@ -1031,6 +1066,10 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService return this.doOpenEditors(editors, activePosition, ratio); } + public hasEditorsToRestore(): boolean { + return this.stacks.groups.some(g => g.count > 0); + } + public restoreEditors(): TPromise { const editors = this.stacks.groups.map((group, index) => { return { @@ -1249,7 +1288,11 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService // Persist UI State const editorState: IEditorPartUIState = { ratio: this.editorGroupsControl.getRatio(), groupOrientation: this.editorGroupsControl.getGroupOrientation() }; - this.memento[EditorPart.EDITOR_PART_UI_STATE_STORAGE_KEY] = editorState; + if (editorState.ratio.length || editorState.groupOrientation !== 'vertical') { + this.memento[EditorPart.EDITOR_PART_UI_STATE_STORAGE_KEY] = editorState; + } else { + delete this.memento[EditorPart.EDITOR_PART_UI_STATE_STORAGE_KEY]; + } // Unload all Instantiated Editors for (let i = 0; i < this.instantiatedEditors.length; i++) { diff --git a/src/vs/workbench/browser/parts/editor/editorPicker.ts b/src/vs/workbench/browser/parts/editor/editorPicker.ts index d1a0d74383df792445ee90141941d175d7c53da4..4e73f77bb156429e8a9bab55598d7760c0b34aaf 100644 --- a/src/vs/workbench/browser/parts/editor/editorPicker.ts +++ b/src/vs/workbench/browser/parts/editor/editorPicker.ts @@ -12,7 +12,7 @@ import URI from 'vs/base/common/uri'; import errors = require('vs/base/common/errors'); import strings = require('vs/base/common/strings'); import { IIconLabelOptions } from 'vs/base/browser/ui/iconLabel/iconLabel'; -import { IAutoFocus, Mode, IEntryRunContext, IQuickNavigateConfiguration } from 'vs/base/parts/quickopen/common/quickOpen'; +import { IAutoFocus, Mode, IEntryRunContext, IQuickNavigateConfiguration, IModel } from 'vs/base/parts/quickopen/common/quickOpen'; import { QuickOpenModel, QuickOpenEntry, QuickOpenEntryGroup } from 'vs/base/parts/quickopen/browser/quickOpenModel'; import scorer = require('vs/base/common/scorer'); import { IModeService } from 'vs/editor/common/services/modeService'; @@ -185,8 +185,8 @@ export abstract class EditorGroupPicker extends BaseEditorPicker { return nls.localize('noOpenedEditors', "List of opened editors is currently empty in group"); } - public getAutoFocus(searchValue: string, quickNavigateConfiguration: IQuickNavigateConfiguration): IAutoFocus { - if (searchValue || !quickNavigateConfiguration) { + public getAutoFocus(searchValue: string, context: { model: IModel, quickNavigateConfiguration?: IQuickNavigateConfiguration }): IAutoFocus { + if (searchValue || !context.quickNavigateConfiguration) { return { autoFocusFirstEntry: true }; @@ -195,10 +195,10 @@ export abstract class EditorGroupPicker extends BaseEditorPicker { const stacks = this.editorGroupService.getStacksModel(); const group = stacks.groupAt(this.getPosition()); if (!group) { - return super.getAutoFocus(searchValue); + return super.getAutoFocus(searchValue, context); } - const isShiftNavigate = (quickNavigateConfiguration && quickNavigateConfiguration.keybindings.some(k => { + const isShiftNavigate = (context.quickNavigateConfiguration && context.quickNavigateConfiguration.keybindings.some(k => { const [firstPart, chordPart] = k.getParts(); if (chordPart) { return false; @@ -262,13 +262,13 @@ export class AllEditorsPicker extends BaseEditorPicker { return nls.localize('noOpenedEditorsAllGroups', "List of opened editors is currently empty"); } - public getAutoFocus(searchValue: string): IAutoFocus { + public getAutoFocus(searchValue: string, context: { model: IModel, quickNavigateConfiguration?: IQuickNavigateConfiguration }): IAutoFocus { if (searchValue) { return { autoFocusFirstEntry: true }; } - return super.getAutoFocus(searchValue); + return super.getAutoFocus(searchValue, context); } } \ No newline at end of file diff --git a/src/vs/workbench/browser/parts/editor/editorStatus.ts b/src/vs/workbench/browser/parts/editor/editorStatus.ts index 831f68974712e7864e1a01909f94c251a2370e16..a631eb935947547560d26804eb8ffec5dfc79b15 100644 --- a/src/vs/workbench/browser/parts/editor/editorStatus.ts +++ b/src/vs/workbench/browser/parts/editor/editorStatus.ts @@ -14,7 +14,6 @@ import paths = require('vs/base/common/paths'); import types = require('vs/base/common/types'); import uri from 'vs/base/common/uri'; import errors = require('vs/base/common/errors'); -import * as browser from 'vs/base/browser/browser'; import { IStatusbarItem } from 'vs/workbench/browser/parts/statusbar/statusbar'; import { Action } from 'vs/base/common/actions'; import { language, LANGUAGE_DEFAULT, AccessibilitySupport } from 'vs/base/common/platform'; @@ -34,7 +33,7 @@ import { IEditor as IBaseEditor, IEditorInput } from 'vs/platform/editor/common/ import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IQuickOpenService, IPickOpenEntry, IFilePickOpenEntry } from 'vs/platform/quickOpen/common/quickOpen'; import { IWorkspaceConfigurationService } from 'vs/workbench/services/configuration/common/configuration'; -import { IFilesConfiguration, SUPPORTED_ENCODINGS, IFileService } from 'vs/platform/files/common/files'; +import { SUPPORTED_ENCODINGS, IFileService } from 'vs/platform/files/common/files'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IModeService } from 'vs/editor/common/services/modeService'; import { IModelService } from 'vs/editor/common/services/modelService'; @@ -45,8 +44,12 @@ import { ICommandService } from 'vs/platform/commands/common/commands'; import { IExtensionGalleryService } from 'vs/platform/extensionManagement/common/extensionManagement'; import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; import { getCodeEditor as getEditorWidget } from 'vs/editor/common/services/codeEditorService'; -import { IPreferencesService } from 'vs/workbench/parts/preferences/common/preferences'; import { ICursorPositionChangedEvent } from 'vs/editor/common/controller/cursorEvents'; +import { IConfigurationChangedEvent } from "vs/editor/common/config/editorOptions"; + +// TODO@Sandeep layer breaker +// tslint:disable-next-line:import-patterns +import { IPreferencesService } from 'vs/workbench/parts/preferences/common/preferences'; function toEditorWithEncodingSupport(input: IEditorInput): IEncodingSupport { if (input instanceof SideBySideEditorInput) { @@ -225,8 +228,9 @@ const nlsMultiSelectionRange = nls.localize('multiSelectionRange', "{0} selectio const nlsMultiSelection = nls.localize('multiSelection', "{0} selections"); const nlsEOLLF = nls.localize('endOfLineLineFeed', "LF"); const nlsEOLCRLF = nls.localize('endOfLineCarriageReturnLineFeed', "CRLF"); -const nlsTabFocusMode = nls.localize('tabFocusModeEnabled', "Tab moves focus"); -const nlsScreenReaderDetected = nls.localize('screenReaderDetected', "Screen reader detected"); +const nlsTabFocusMode = nls.localize('tabFocusModeEnabled', "Tab Moves Focus"); +const nlsScreenReaderDetected = nls.localize('screenReaderDetected', "Screen Reader Detected"); +const nlsScreenReaderDetectedTitle = nls.localize('screenReaderDetectedExtra', "If you are not using a Screen Reader, please change the setting `editor.accessibilitySupport` to \"off\"."); function _setDisplay(el: HTMLElement, desiredValue: string): void { if (el.style.display !== desiredValue) { @@ -282,6 +286,7 @@ export class EditorStatus implements IStatusbarItem { this.screenRedearModeElement = append(this.element, $('a.editor-status-screenreadermode.status-bar-info')); this.screenRedearModeElement.textContent = nlsScreenReaderDetected; + this.screenRedearModeElement.title = nlsScreenReaderDetectedTitle; hide(this.screenRedearModeElement); this.selectionElement = append(this.element, $('a.editor-status-selection')); @@ -329,9 +334,7 @@ export class EditorStatus implements IStatusbarItem { this.untitledEditorService.onDidChangeEncoding(r => this.onResourceEncodingChange(r)), this.textFileService.models.onModelEncodingChanged(e => this.onResourceEncodingChange(e.resource)), TabFocus.onDidChangeTabFocus(e => this.onTabFocusModeChange()), - browser.onDidChangeAccessibilitySupport(() => this.onScreenReaderModeChange()) ); - this.onScreenReaderModeChange(); return combinedDisposable(this.toDispose); } @@ -492,6 +495,7 @@ export class EditorStatus implements IStatusbarItem { const control = getEditorWidget(activeEditor); // Update all states + this.onScreenReaderModeChange(control); this.onSelectionChange(control); this.onModeChange(control); this.onEOLChange(control); @@ -505,6 +509,13 @@ export class EditorStatus implements IStatusbarItem { // Attach new listeners to active editor if (control) { + // Hook Listener for Configuration changes + this.activeEditorListeners.push(control.onDidChangeConfiguration((event: IConfigurationChangedEvent) => { + if (event.accessibilitySupport) { + this.onScreenReaderModeChange(control); + } + })); + // Hook Listener for Selection changes this.activeEditorListeners.push(control.onDidChangeCursorPosition((event: ICursorPositionChangedEvent) => { this.onSelectionChange(control); @@ -595,6 +606,18 @@ export class EditorStatus implements IStatusbarItem { this.updateState(update); } + private onScreenReaderModeChange(editorWidget: ICommonCodeEditor): void { + let screenReaderMode = false; + + // We only support text based editors + if (editorWidget) { + + screenReaderMode = (editorWidget.getConfiguration().accessibilitySupport === AccessibilitySupport.Enabled); + } + + this.updateState({ screenReaderMode: screenReaderMode }); + } + private onSelectionChange(editorWidget: ICommonCodeEditor): void { const info: IEditorSelectionStatus = {}; @@ -685,12 +708,6 @@ export class EditorStatus implements IStatusbarItem { this.updateState(info); } - private onScreenReaderModeChange(): void { - const info: StateDelta = { screenReaderMode: browser.getAccessibilitySupport() === AccessibilitySupport.Enabled }; - - this.updateState(info); - } - private isActiveEditor(e: IBaseEditor): boolean { const activeEditor = this.editorService.getActiveEditor(); @@ -1082,20 +1099,18 @@ export class ChangeEncodingAction extends Action { return undefined; } + const resource = toResource(activeEditor.input, { filter: 'file', supportSideBySide: true }); + if (!resource) { + return TPromise.as(null); + } + return TPromise.timeout(50 /* quick open is sensitive to being opened so soon after another */) .then(() => { - const resource = toResource(activeEditor.input, { filter: 'file', supportSideBySide: true }); - if (!resource) { - return TPromise.as(null); - } - return this.fileService.resolveContent(resource, { autoGuessEncoding: true, acceptTextOnly: true }).then(content => content.encoding, err => null); }) - .then(guessedEncoding => { - const configuration = this.configurationService.getConfiguration(); - + .then((guessedEncoding: string) => { const isReopenWithEncoding = (action === reopenWithEncodingPick); - const configuredEncoding = configuration && configuration.files && configuration.files.encoding; + const configuredEncoding = this.configurationService.lookup('files.encoding', { resource }).value; let directMatchIndex: number; let aliasMatchIndex: number; diff --git a/src/vs/workbench/browser/parts/editor/media/editorstatus.css b/src/vs/workbench/browser/parts/editor/media/editorstatus.css index 5d33e7ae6fdcf0b08ca94a44ec088b277359a4ae..b4fd4bdd7d21f31455db4e63adfa4066fd02066d 100644 --- a/src/vs/workbench/browser/parts/editor/media/editorstatus.css +++ b/src/vs/workbench/browser/parts/editor/media/editorstatus.css @@ -12,17 +12,13 @@ .monaco-workbench .editor-statusbar-item > .editor-status-eol, .monaco-workbench .editor-statusbar-item > .editor-status-selection, .monaco-workbench .editor-statusbar-item > .editor-status-indentation, -.monaco-workbench .editor-statusbar-item > .editor-status-metadata { +.monaco-workbench .editor-statusbar-item > .editor-status-metadata, +.monaco-workbench .editor-statusbar-item > .editor-status-tabfocusmode, +.monaco-workbench .editor-statusbar-item > .editor-status-screenreadermode { padding: 0 5px 0 5px; } -.monaco-workbench .editor-statusbar-item > .editor-status-metadata { - cursor: default; -} - -.monaco-workbench .editor-statusbar-item > .editor-status-tabfocusmode { - padding: 0 5px 0 5px; +.monaco-workbench .editor-statusbar-item > .editor-status-metadata, +.monaco-workbench > .part.statusbar > .statusbar-item > .editor-statusbar-item > a.editor-status-screenreadermode { + cursor: default !important; } -.monaco-workbench .editor-statusbar-item > .editor-status-screenreadermode { - padding: 0 5px 0 5px; -} \ No newline at end of file diff --git a/src/vs/workbench/browser/parts/editor/noTabsTitleControl.ts b/src/vs/workbench/browser/parts/editor/noTabsTitleControl.ts index fa83f95df080dcdb9d5b6aa804795283db538ed1..6814ef611b8b153b007d3133ee60be1cff0aa544 100644 --- a/src/vs/workbench/browser/parts/editor/noTabsTitleControl.ts +++ b/src/vs/workbench/browser/parts/editor/noTabsTitleControl.ts @@ -12,7 +12,7 @@ import DOM = require('vs/base/browser/dom'); import { TitleControl } from 'vs/workbench/browser/parts/editor/titleControl'; import { EditorLabel } from 'vs/workbench/browser/labels'; import { Verbosity } from 'vs/platform/editor/common/editor'; -import { TAB_ACTIVE_FOREGROUND } from 'vs/workbench/common/theme'; +import { TAB_ACTIVE_FOREGROUND, TAB_UNFOCUSED_ACTIVE_FOREGROUND } from 'vs/workbench/common/theme'; export class NoTabsTitleControl extends TitleControl { private titleContainer: HTMLElement; @@ -126,19 +126,11 @@ export class NoTabsTitleControl extends TitleControl { } this.editorLabel.setLabel({ name, description, resource }, { title, italic: !isPinned, extraClasses: ['title-label'] }); - this.editorLabel.element.style.color = this.getColor(TAB_ACTIVE_FOREGROUND, (color, theme) => { - if (!isActive) { - if (theme.type === 'dark') { - return color.transparent(0.5); - } - - if (theme.type === 'light') { - return color.transparent(0.7); - } - } - - return color; - }); + if (isActive) { + this.editorLabel.element.style.color = this.getColor(TAB_ACTIVE_FOREGROUND); + } else { + this.editorLabel.element.style.color = this.getColor(TAB_UNFOCUSED_ACTIVE_FOREGROUND); + } // Update Editor Actions Toolbar this.updateEditorActionsToolbar(); diff --git a/src/vs/workbench/browser/parts/editor/sideBySideEditor.ts b/src/vs/workbench/browser/parts/editor/sideBySideEditor.ts index 1d3bcca6be1313be93dc758d354f984335ca3448..3d5243a8e5e390842e4c39d575a0999c21af9e49 100644 --- a/src/vs/workbench/browser/parts/editor/sideBySideEditor.ts +++ b/src/vs/workbench/browser/parts/editor/sideBySideEditor.ts @@ -8,7 +8,7 @@ import * as strings from 'vs/base/common/strings'; import * as DOM from 'vs/base/browser/dom'; import { Dimension, Builder } from 'vs/base/browser/builder'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { IEditorRegistry, Extensions as EditorExtensions, EditorInput, EditorOptions, SideBySideEditorInput } from 'vs/workbench/common/editor'; import { BaseEditor, EditorDescriptor } from 'vs/workbench/browser/parts/editor/baseEditor'; import { IEditorControl, Position, IEditor } from 'vs/platform/editor/common/editor'; diff --git a/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts b/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts index 3999342995253200c7161422a0c7440aff3c6e45..f1c850050b4b6b10f2f744b325efcad3b395f103 100644 --- a/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts +++ b/src/vs/workbench/browser/parts/editor/tabsTitleControl.ts @@ -36,11 +36,11 @@ import { IDisposable, dispose, combinedDisposable } from 'vs/base/common/lifecyc import { ScrollableElement } from 'vs/base/browser/ui/scrollbar/scrollableElement'; import { ScrollbarVisibility } from 'vs/base/common/scrollable'; import { extractResources } from 'vs/base/browser/dnd'; -import { LinkedMap } from 'vs/base/common/map'; +import { getOrSet } from 'vs/base/common/map'; import { DelegatingWorkbenchEditorService } from 'vs/workbench/services/editor/browser/editorService'; import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; import { IThemeService, registerThemingParticipant, ITheme, ICssStyleCollector } from 'vs/platform/theme/common/themeService'; -import { TAB_INACTIVE_BACKGROUND, TAB_ACTIVE_BACKGROUND, TAB_ACTIVE_FOREGROUND, TAB_INACTIVE_FOREGROUND, TAB_BORDER, EDITOR_DRAG_AND_DROP_BACKGROUND } from 'vs/workbench/common/theme'; +import { TAB_INACTIVE_BACKGROUND, TAB_ACTIVE_BACKGROUND, TAB_ACTIVE_FOREGROUND, TAB_INACTIVE_FOREGROUND, TAB_BORDER, EDITOR_DRAG_AND_DROP_BACKGROUND, TAB_UNFOCUSED_ACTIVE_FOREGROUND, TAB_UNFOCUSED_INACTIVE_FOREGROUND } from 'vs/workbench/common/theme'; import { activeContrastBorder, contrastBorder } from 'vs/platform/theme/common/colorRegistry'; interface IEditorInputLabel { @@ -152,7 +152,6 @@ export class TabsTitleControl extends TitleControl { vertical: ScrollbarVisibility.Hidden, scrollYToX: true, useShadows: false, - canUseTranslate3d: false, horizontalScrollbarSize: 3 }); @@ -212,7 +211,7 @@ export class TabsTitleControl extends TitleControl { private updateDropFeedback(element: HTMLElement, isDND: boolean, index?: number): void { const isTab = (typeof index === 'number'); - const isActiveTab = isTab && this.context.isActive(this.context.getEditor(index)); + const isActiveTab = isTab && this.context && this.context.isActive(this.context.getEditor(index)); // Background const noDNDBackgroundColor = isTab ? this.getColor(isActiveTab ? TAB_ACTIVE_BACKGROUND : TAB_INACTIVE_BACKGROUND) : null; @@ -272,8 +271,8 @@ export class TabsTitleControl extends TitleControl { // Container tabContainer.setAttribute('aria-label', `${name}, tab`); tabContainer.title = title; - tabContainer.style.borderLeftColor = (index !== 0) ? (this.getColor(TAB_BORDER) || this.getColor(contrastBorder)) : null;; - tabContainer.style.borderRightColor = (index === editorsOfGroup.length - 1) ? (this.getColor(TAB_BORDER) || this.getColor(contrastBorder)) : null;; + tabContainer.style.borderLeftColor = (index !== 0) ? (this.getColor(TAB_BORDER) || this.getColor(contrastBorder)) : null; + tabContainer.style.borderRightColor = (index === editorsOfGroup.length - 1) ? (this.getColor(TAB_BORDER) || this.getColor(contrastBorder)) : null; tabContainer.style.outlineColor = this.getColor(activeContrastBorder); const tabOptions = this.editorGroupService.getTabOptions(); @@ -291,38 +290,14 @@ export class TabsTitleControl extends TitleControl { DOM.addClass(tabContainer, 'active'); tabContainer.setAttribute('aria-selected', 'true'); tabContainer.style.backgroundColor = this.getColor(TAB_ACTIVE_BACKGROUND); - tabLabel.element.style.color = this.getColor(TAB_ACTIVE_FOREGROUND, (color, theme) => { - if (!isGroupActive) { - if (theme.type === 'dark') { - return color.transparent(0.5); - } - - if (theme.type === 'light') { - return color.transparent(0.7); - } - } - - return color; - }); + tabLabel.element.style.color = this.getColor(isGroupActive ? TAB_ACTIVE_FOREGROUND : TAB_UNFOCUSED_ACTIVE_FOREGROUND); this.activeTab = tabContainer; } else { DOM.removeClass(tabContainer, 'active'); tabContainer.setAttribute('aria-selected', 'false'); tabContainer.style.backgroundColor = this.getColor(TAB_INACTIVE_BACKGROUND); - tabLabel.element.style.color = this.getColor(TAB_INACTIVE_FOREGROUND, (color, theme) => { - if (!isGroupActive) { - if (theme.type === 'dark') { - return color.transparent(0.5); - } - - if (theme.type === 'light') { - return color.transparent(0.5); - } - } - - return color; - }); + tabLabel.element.style.color = this.getColor(isGroupActive ? TAB_INACTIVE_FOREGROUND : TAB_UNFOCUSED_INACTIVE_FOREGROUND); } // Dirty State @@ -344,8 +319,8 @@ export class TabsTitleControl extends TitleControl { private getUniqueTabLabels(editors: IEditorInput[]): IEditorInputLabel[] { const labels: IEditorInputLabel[] = []; - const mapLabelToDuplicates = new LinkedMap(); - const mapLabelAndDescriptionToDuplicates = new LinkedMap(); + const mapLabelToDuplicates = new Map(); + const mapLabelAndDescriptionToDuplicates = new Map(); // Build labels and descriptions for each editor editors.forEach(editor => { @@ -358,16 +333,15 @@ export class TabsTitleControl extends TitleControl { }; labels.push(item); - mapLabelToDuplicates.getOrSet(item.name, []).push(item); + getOrSet(mapLabelToDuplicates, item.name, []).push(item); if (typeof description === 'string') { - mapLabelAndDescriptionToDuplicates.getOrSet(`${item.name}${item.description}`, []).push(item); + getOrSet(mapLabelAndDescriptionToDuplicates, `${item.name}${item.description}`, []).push(item); } }); // Mark duplicates and shorten their descriptions - const labelDuplicates = mapLabelToDuplicates.values(); - labelDuplicates.forEach(duplicates => { + mapLabelToDuplicates.forEach(duplicates => { if (duplicates.length > 1) { duplicates = duplicates.filter(d => { // we could have items with equal label and description. in that case it does not make much @@ -750,7 +724,7 @@ class TabActionRunner extends ActionRunner { super(); } - public run(action: IAction, context?: any): TPromise { + public run(action: IAction, context?: any): TPromise { const group = this.group(); if (!group) { return TPromise.as(void 0); diff --git a/src/vs/workbench/browser/parts/editor/textDiffEditor.ts b/src/vs/workbench/browser/parts/editor/textDiffEditor.ts index e22ac2936abd67ca8e0c7ce0a10b4095dfe3146c..87541968878a93cd9b67824cc2f04f84ab20ab0f 100644 --- a/src/vs/workbench/browser/parts/editor/textDiffEditor.ts +++ b/src/vs/workbench/browser/parts/editor/textDiffEditor.ts @@ -19,14 +19,14 @@ import { BaseTextEditor, IEditorConfiguration } from 'vs/workbench/browser/parts import { TextEditorOptions, TextDiffEditorOptions, EditorInput, EditorOptions, TEXT_DIFF_EDITOR_ID, IFileEditorInput } from 'vs/workbench/common/editor'; import { ResourceEditorInput } from 'vs/workbench/common/editor/resourceEditorInput'; import { DiffEditorInput } from 'vs/workbench/common/editor/diffEditorInput'; -import { DiffNavigator } from 'vs/editor/contrib/diffNavigator/common/diffNavigator'; +import { DiffNavigator } from 'vs/editor/browser/widget/diffNavigator'; import { DiffEditorWidget } from 'vs/editor/browser/widget/diffEditorWidget'; import { TextDiffEditorModel } from 'vs/workbench/common/editor/textDiffEditorModel'; import { DelegatingWorkbenchEditorService } from 'vs/workbench/services/editor/browser/editorService'; import { IFileOperationResult, FileOperationResult } from 'vs/platform/files/common/files'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IStorageService } from 'vs/platform/storage/common/storage'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; +import { ITextResourceConfigurationService } from 'vs/editor/common/services/resourceConfiguration'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; @@ -51,7 +51,7 @@ export class TextDiffEditor extends BaseTextEditor { @ITelemetryService telemetryService: ITelemetryService, @IInstantiationService instantiationService: IInstantiationService, @IStorageService storageService: IStorageService, - @IConfigurationService configurationService: IConfigurationService, + @ITextResourceConfigurationService configurationService: ITextResourceConfigurationService, @IWorkbenchEditorService private editorService: IWorkbenchEditorService, @IThemeService themeService: IThemeService, @IEditorGroupService editorGroupService: IEditorGroupService, @@ -215,11 +215,6 @@ export class TextDiffEditor extends BaseTextEditor { objects.mixin(editorConfiguration, configuration.diffEditor); } - const language = this.getLanguage(); - if (language) { - objects.assign(editorConfiguration, this.configurationService.getConfiguration({ overrideIdentifier: language, section: 'diffEditor' })); - } - return editorConfiguration; } @@ -365,7 +360,7 @@ class ToggleEditorModeAction extends Action { return ToggleEditorModeAction.isInlineMode(this.editor) ? ToggleEditorModeAction.SIDEBYSIDE_LABEL : ToggleEditorModeAction.INLINE_LABEL; } - public run(): TPromise { + public run(): TPromise { const inlineModeActive = ToggleEditorModeAction.isInlineMode(this.editor); const control = this.editor.getControl(); diff --git a/src/vs/workbench/browser/parts/editor/textEditor.ts b/src/vs/workbench/browser/parts/editor/textEditor.ts index d9cb5e09200d66a54f6485d17248756f1a9dd3a6..8ef5e97585d6b1d94c8461e1b836f65783546c40 100644 --- a/src/vs/workbench/browser/parts/editor/textEditor.ts +++ b/src/vs/workbench/browser/parts/editor/textEditor.ts @@ -7,6 +7,7 @@ import nls = require('vs/nls'); import { TPromise } from 'vs/base/common/winjs.base'; +import URI from 'vs/base/common/uri'; import { Dimension, Builder } from 'vs/base/browser/builder'; import objects = require('vs/base/common/objects'); import types = require('vs/base/common/types'); @@ -18,7 +19,6 @@ import { BaseEditor } from 'vs/workbench/browser/parts/editor/baseEditor'; import { IEditorViewState, IEditor, isCommonCodeEditor, isCommonDiffEditor } from 'vs/editor/common/editorCommon'; import { Position } from 'vs/platform/editor/common/editor'; import { IStorageService } from 'vs/platform/storage/common/storage'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IThemeService } from 'vs/platform/theme/common/themeService'; @@ -26,6 +26,7 @@ import { Scope } from 'vs/workbench/common/memento'; import { getCodeEditor } from 'vs/editor/common/services/codeEditorService'; import { IModeService } from 'vs/editor/common/services/modeService'; import { ITextFileService, SaveReason, AutoSaveMode } from 'vs/workbench/services/textfile/common/textfiles'; +import { ITextResourceConfigurationService } from 'vs/editor/common/services/resourceConfiguration'; import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService'; import { IEditorOptions } from 'vs/editor/common/config/editorOptions'; @@ -38,8 +39,8 @@ interface ITextEditorViewState { } export interface IEditorConfiguration { - editor: any; - diffEditor: any; + editor: object; + diffEditor: object; } /** @@ -57,7 +58,7 @@ export abstract class BaseTextEditor extends BaseEditor { @ITelemetryService telemetryService: ITelemetryService, @IInstantiationService private _instantiationService: IInstantiationService, @IStorageService private storageService: IStorageService, - @IConfigurationService private _configurationService: IConfigurationService, + @ITextResourceConfigurationService private _configurationService: ITextResourceConfigurationService, @IThemeService protected themeService: IThemeService, @IModeService private modeService: IModeService, @ITextFileService private textFileService: ITextFileService, @@ -65,14 +66,14 @@ export abstract class BaseTextEditor extends BaseEditor { ) { super(id, telemetryService, themeService); - this.toUnbind.push(this.configurationService.onDidUpdateConfiguration(e => this.handleConfigurationChangeEvent(e.config))); + this.toUnbind.push(this.configurationService.onDidUpdateConfiguration(e => this.handleConfigurationChangeEvent(this.configurationService.getConfiguration(this.getResource())))); } protected get instantiationService(): IInstantiationService { return this._instantiationService; } - protected get configurationService(): IConfigurationService { + protected get configurationService(): ITextResourceConfigurationService { return this._configurationService; } @@ -116,11 +117,6 @@ export abstract class BaseTextEditor extends BaseEditor { protected getConfigurationOverrides(): IEditorOptions { const overrides = {}; - const language = this.getLanguage(); - if (language) { - objects.assign(overrides, this.configurationService.getConfiguration({ overrideIdentifier: language, section: 'editor' })); - } - objects.assign(overrides, { overviewRulerLanes: 3, lineNumbersMinChars: 3, @@ -134,7 +130,7 @@ export abstract class BaseTextEditor extends BaseEditor { // Editor for Text this._editorContainer = parent; - this.editorControl = this.createEditorControl(parent, this.computeConfiguration(this.configurationService.getConfiguration())); + this.editorControl = this.createEditorControl(parent, this.computeConfiguration(this.configurationService.getConfiguration(this.getResource()))); // Model & Language changes const codeEditor = getCodeEditor(this); @@ -286,7 +282,7 @@ export abstract class BaseTextEditor extends BaseEditor { return null; } - private updateEditorConfiguration(configuration = this.configurationService.getConfiguration()): void { + private updateEditorConfiguration(configuration = this.configurationService.getConfiguration(this.getResource())): void { if (!this.editorControl) { return; } @@ -307,20 +303,17 @@ export abstract class BaseTextEditor extends BaseEditor { } } - protected getLanguage(): string { + protected getResource(): URI { const codeEditor = getCodeEditor(this); if (codeEditor) { const model = codeEditor.getModel(); if (model) { - return model.getLanguageIdentifier().language; + return model.uri; } } if (this.input) { - const resource = toResource(this.input); - if (resource) { - return this.modeService.getModeIdByFilenameOrFirstLine(resource.fsPath); - } + return toResource(this.input); } return null; diff --git a/src/vs/workbench/browser/parts/editor/textResourceEditor.ts b/src/vs/workbench/browser/parts/editor/textResourceEditor.ts index dda89f7447b1d01e528ba09d59e273a27acf1038..facd8e271d830a380b79cba7d86d0332763ee792 100644 --- a/src/vs/workbench/browser/parts/editor/textResourceEditor.ts +++ b/src/vs/workbench/browser/parts/editor/textResourceEditor.ts @@ -14,16 +14,15 @@ import { ResourceEditorInput } from 'vs/workbench/common/editor/resourceEditorIn import { BaseTextEditorModel } from 'vs/workbench/common/editor/textEditorModel'; import { UntitledEditorInput } from 'vs/workbench/common/editor/untitledEditorInput'; import { BaseTextEditor } from 'vs/workbench/browser/parts/editor/textEditor'; -import URI from 'vs/base/common/uri'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IStorageService } from 'vs/platform/storage/common/storage'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; +import { ITextResourceConfigurationService } from 'vs/editor/common/services/resourceConfiguration'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IThemeService } from 'vs/platform/theme/common/themeService'; -import { IUntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService'; import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService'; import { IModeService } from 'vs/editor/common/services/modeService'; import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; +import { once } from "vs/base/common/event"; /** * An editor implementation that is capable of showing the contents of resource inputs. Uses @@ -37,22 +36,13 @@ export class TextResourceEditor extends BaseTextEditor { @ITelemetryService telemetryService: ITelemetryService, @IInstantiationService instantiationService: IInstantiationService, @IStorageService storageService: IStorageService, - @IConfigurationService configurationService: IConfigurationService, + @ITextResourceConfigurationService configurationService: ITextResourceConfigurationService, @IThemeService themeService: IThemeService, - @IUntitledEditorService private untitledEditorService: IUntitledEditorService, @IEditorGroupService editorGroupService: IEditorGroupService, @IModeService modeService: IModeService, @ITextFileService textFileService: ITextFileService ) { super(TextResourceEditor.ID, telemetryService, instantiationService, storageService, configurationService, themeService, modeService, textFileService, editorGroupService); - - this.toUnbind.push(this.untitledEditorService.onDidChangeDirty(e => this.onUntitledDirtyChange(e))); - } - - private onUntitledDirtyChange(resource: URI): void { - if (!this.untitledEditorService.isDirty(resource)) { - this.clearTextEditorViewState([resource.toString()]); // untitled file got reverted, so remove view state - } } public getTitle(): string { @@ -83,7 +73,7 @@ export class TextResourceEditor extends BaseTextEditor { } // Remember view settings if input changes - this.saveTextEditorViewState(oldInput); + this.saveTextEditorViewStateForInput(oldInput); // Different Input (Reload) return input.resolve(true).then((resolvedModel: EditorModel) => { @@ -152,7 +142,6 @@ export class TextResourceEditor extends BaseTextEditor { /** * Reveals the last line of this editor if it has a model set. - * If smart reveal is true will only reveal the last line if the line before last is visible #3351 */ public revealLastLine(): void { const codeEditor = this.getControl(); @@ -160,14 +149,14 @@ export class TextResourceEditor extends BaseTextEditor { if (model) { const lastLine = model.getLineCount(); - codeEditor.revealLine(lastLine); + codeEditor.revealPosition({ lineNumber: lastLine, column: model.getLineMaxColumn(lastLine) }); } } public clearInput(): void { // Keep editor view state in settings to restore when coming back - this.saveTextEditorViewState(this.input); + this.saveTextEditorViewStateForInput(this.input); // Clear Model this.getControl().setModel(null); @@ -177,22 +166,35 @@ export class TextResourceEditor extends BaseTextEditor { public shutdown(): void { - // Save View State - this.saveTextEditorViewState(this.input); + // Save View State (only for untitled) + if (this.input instanceof UntitledEditorInput) { + this.saveTextEditorViewStateForInput(this.input); + } // Call Super super.shutdown(); } - protected saveTextEditorViewState(input: EditorInput): void; - protected saveTextEditorViewState(key: string): void; - protected saveTextEditorViewState(arg1: EditorInput | string): void { - if (typeof arg1 === 'string') { - return super.saveTextEditorViewState(arg1); + protected saveTextEditorViewStateForInput(input: EditorInput): void { + if (!(input instanceof UntitledEditorInput) && !(input instanceof ResourceEditorInput)) { + return; // only enabled for untitled and resource inputs } - if ((arg1 instanceof UntitledEditorInput || arg1 instanceof ResourceEditorInput) && !arg1.isDisposed()) { - return super.saveTextEditorViewState(arg1.getResource().toString()); + const key = input.getResource().toString(); + + // Clear view state if input is disposed + if (input.isDisposed()) { + super.clearTextEditorViewState([key]); + } + + // Otherwise save it + else { + super.saveTextEditorViewState(key); + + // Make sure to clean up when the input gets disposed + once(input.onDispose)(() => { + super.clearTextEditorViewState([key]); + }); } } } \ No newline at end of file diff --git a/src/vs/workbench/browser/parts/editor/titleControl.ts b/src/vs/workbench/browser/parts/editor/titleControl.ts index acb5d5e3e26ab7c261ce45ee92c9fdbd2824a26a..7e03939d208c29697c61200d80408db06a9d1597 100644 --- a/src/vs/workbench/browser/parts/editor/titleControl.ts +++ b/src/vs/workbench/browser/parts/editor/titleControl.ts @@ -7,8 +7,8 @@ import 'vs/css!./media/titlecontrol'; import nls = require('vs/nls'); -import { Registry } from 'vs/platform/platform'; -import { Scope, IActionBarRegistry, Extensions, prepareActions } from 'vs/workbench/browser/actionBarRegistry'; +import { Registry } from 'vs/platform/registry/common/platform'; +import { Scope, IActionBarRegistry, Extensions, prepareActions } from 'vs/workbench/browser/actions'; import { IAction, Action } from 'vs/base/common/actions'; import errors = require('vs/base/common/errors'); import DOM = require('vs/base/browser/dom'); @@ -32,7 +32,7 @@ import { IQuickOpenService } from 'vs/platform/quickOpen/common/quickOpen'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { ResolvedKeybinding } from 'vs/base/common/keyCodes'; import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { CloseEditorsInGroupAction, SplitEditorAction, CloseEditorAction, KeepEditorAction, CloseOtherEditorsInGroupAction, CloseRightEditorsInGroupAction, ShowEditorsInGroupAction } from 'vs/workbench/browser/parts/editor/editorActions'; +import { CloseEditorsInGroupAction, SplitEditorAction, CloseEditorAction, KeepEditorAction, CloseOtherEditorsInGroupAction, CloseRightEditorsInGroupAction, ShowEditorsInGroupAction, CloseUnmodifiedEditorsInGroupAction } from 'vs/workbench/browser/parts/editor/editorActions'; import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { createActionItem, fillInActions } from 'vs/platform/actions/browser/menuItemActionItem'; import { IMenuService, MenuId, IMenu, ExecuteCommandAction } from 'vs/platform/actions/common/actions'; @@ -71,6 +71,7 @@ export abstract class TitleControl extends Themable implements ITitleAreaControl protected pinEditorAction: KeepEditorAction; protected closeOtherEditorsAction: CloseOtherEditorsInGroupAction; protected closeRightEditorsAction: CloseRightEditorsInGroupAction; + protected closeUnmodifiedEditorsInGroupAction: CloseUnmodifiedEditorsInGroupAction; protected closeEditorsInGroupAction: CloseEditorsInGroupAction; protected splitEditorAction: SplitEditorAction; protected showEditorsInGroupAction: ShowEditorsInGroupAction; @@ -228,6 +229,7 @@ export abstract class TitleControl extends Themable implements ITitleAreaControl this.closeOtherEditorsAction = services.createInstance(CloseOtherEditorsInGroupAction, CloseOtherEditorsInGroupAction.ID, nls.localize('closeOthers', "Close Others")); this.closeRightEditorsAction = services.createInstance(CloseRightEditorsInGroupAction, CloseRightEditorsInGroupAction.ID, nls.localize('closeRight', "Close to the Right")); this.closeEditorsInGroupAction = services.createInstance(CloseEditorsInGroupAction, CloseEditorsInGroupAction.ID, nls.localize('closeAll', "Close All")); + this.closeUnmodifiedEditorsInGroupAction = services.createInstance(CloseUnmodifiedEditorsInGroupAction, CloseUnmodifiedEditorsInGroupAction.ID, nls.localize('closeAllUnmodified', "Close Unmodified")); this.pinEditorAction = services.createInstance(KeepEditorAction, KeepEditorAction.ID, nls.localize('keepOpen', "Keep Open")); this.showEditorsInGroupAction = services.createInstance(ShowEditorsInGroupAction, ShowEditorsInGroupAction.ID, nls.localize('showOpenedEditors', "Show Opened Editors")); this.splitEditorAction = services.createInstance(SplitEditorAction, SplitEditorAction.ID, SplitEditorAction.LABEL); @@ -355,6 +357,7 @@ export abstract class TitleControl extends Themable implements ITitleAreaControl } secondaryEditorActions.push(this.showEditorsInGroupAction); secondaryEditorActions.push(new Separator()); + secondaryEditorActions.push(this.closeUnmodifiedEditorsInGroupAction); secondaryEditorActions.push(this.closeEditorsInGroupAction); } @@ -440,6 +443,7 @@ export abstract class TitleControl extends Themable implements ITitleAreaControl actions.push(this.closeRightEditorsAction); } + actions.push(this.closeUnmodifiedEditorsInGroupAction); actions.push(this.closeEditorsInGroupAction); if (tabOptions.previewEditors) { @@ -461,6 +465,7 @@ export abstract class TitleControl extends Themable implements ITitleAreaControl this.showEditorsInGroupAction, this.closeEditorAction, this.closeRightEditorsAction, + this.closeUnmodifiedEditorsInGroupAction, this.closeOtherEditorsAction, this.closeEditorsInGroupAction, this.pinEditorAction diff --git a/src/vs/workbench/browser/parts/editor/webviewEditor.ts b/src/vs/workbench/browser/parts/editor/webviewEditor.ts index cf852a3d1a5b2704e9bb0587fd96014d3bbf0cc9..50f792c3e9dd9a96c9c35ebdd6af88be185e9a24 100644 --- a/src/vs/workbench/browser/parts/editor/webviewEditor.ts +++ b/src/vs/workbench/browser/parts/editor/webviewEditor.ts @@ -5,10 +5,10 @@ 'use strict'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IThemeService } from 'vs/platform/theme/common/themeService'; -import { BaseEditor } from "vs/workbench/browser/parts/editor/baseEditor"; -import URI from "vs/base/common/uri"; -import { IStorageService } from "vs/platform/storage/common/storage"; -import { Scope } from "vs/workbench/common/memento"; +import { BaseEditor } from 'vs/workbench/browser/parts/editor/baseEditor'; +import URI from 'vs/base/common/uri'; +import { IStorageService } from 'vs/platform/storage/common/storage'; +import { Scope } from 'vs/workbench/common/memento'; export interface HtmlPreviewEditorViewState { scrollYPercentage: number; diff --git a/src/vs/workbench/browser/parts/panel/panelActions.ts b/src/vs/workbench/browser/parts/panel/panelActions.ts index 8ef9ca2e6db416f76627f15c14bd59d2650550d4..934dacdb8b909d4bb72ee8f5611c5507f8b97d76 100644 --- a/src/vs/workbench/browser/parts/panel/panelActions.ts +++ b/src/vs/workbench/browser/parts/panel/panelActions.ts @@ -9,7 +9,7 @@ import { TPromise } from 'vs/base/common/winjs.base'; import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { KeyMod, KeyCode } from 'vs/base/common/keyCodes'; import { Action } from 'vs/base/common/actions'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { SyncActionDescriptor } from 'vs/platform/actions/common/actions'; import { IWorkbenchActionRegistry, Extensions as WorkbenchExtensions } from 'vs/workbench/common/actionRegistry'; import { IPanelService, IPanelIdentifier } from 'vs/workbench/services/panel/common/panelService'; @@ -150,7 +150,7 @@ export class ToggleMaximizedPanelAction extends Action { } const actionRegistry = Registry.as(WorkbenchExtensions.WorkbenchActions); -actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(TogglePanelAction, TogglePanelAction.ID, TogglePanelAction.LABEL, { primary: KeyMod.CtrlCmd | KeyCode.KEY_J }), 'View: Toggle Panel Visibility', nls.localize('view', "View")); +actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(TogglePanelAction, TogglePanelAction.ID, TogglePanelAction.LABEL, { primary: KeyMod.CtrlCmd | KeyCode.KEY_J }), 'View: Toggle Panel', nls.localize('view', "View")); actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(FocusPanelAction, FocusPanelAction.ID, FocusPanelAction.LABEL), 'View: Focus into Panel', nls.localize('view', "View")); actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(ToggleMaximizedPanelAction, ToggleMaximizedPanelAction.ID, ToggleMaximizedPanelAction.LABEL), 'View: Toggle Maximized Panel', nls.localize('view', "View")); actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(ClosePanelAction, ClosePanelAction.ID, ClosePanelAction.LABEL), 'View: Close Panel', nls.localize('view', "View")); \ No newline at end of file diff --git a/src/vs/workbench/browser/parts/panel/panelPart.ts b/src/vs/workbench/browser/parts/panel/panelPart.ts index f163fd6aa151b7ecec16c9c6266af17dfb7aed6d..9e761d9263ef694139483fec269c6ad4eda7b904 100644 --- a/src/vs/workbench/browser/parts/panel/panelPart.ts +++ b/src/vs/workbench/browser/parts/panel/panelPart.ts @@ -9,8 +9,8 @@ import { TPromise } from 'vs/base/common/winjs.base'; import { IAction } from 'vs/base/common/actions'; import Event from 'vs/base/common/event'; import { Builder, $ } from 'vs/base/browser/builder'; -import { Registry } from 'vs/platform/platform'; -import { Scope } from 'vs/workbench/browser/actionBarRegistry'; +import { Registry } from 'vs/platform/registry/common/platform'; +import { Scope } from 'vs/workbench/browser/actions'; import { IPanel } from 'vs/workbench/common/panel'; import { CompositePart, ICompositeTitleLabel } from 'vs/workbench/browser/parts/compositePart'; import { Panel, PanelRegistry, Extensions as PanelExtensions } from 'vs/workbench/browser/panel'; @@ -26,7 +26,7 @@ import { ActionsOrientation, ActionBar } from 'vs/base/browser/ui/actionbar/acti import { ClosePanelAction, PanelAction, ToggleMaximizedPanelAction } from 'vs/workbench/browser/parts/panel/panelActions'; import { IThemeService, registerThemingParticipant, ITheme, ICssStyleCollector } from 'vs/platform/theme/common/themeService'; import { PANEL_BACKGROUND, PANEL_BORDER, PANEL_ACTIVE_TITLE_FOREGROUND, PANEL_INACTIVE_TITLE_FOREGROUND, PANEL_ACTIVE_TITLE_BORDER } from 'vs/workbench/common/theme'; -import { activeContrastBorder, focusBorder, contrastBorder } from 'vs/platform/theme/common/colorRegistry'; +import { activeContrastBorder, focusBorder, contrastBorder, editorBackground } from 'vs/platform/theme/common/colorRegistry'; export class PanelPart extends CompositePart implements IPanelService { @@ -61,6 +61,7 @@ export class PanelPart extends CompositePart implements IPanelService { themeService, Registry.as(PanelExtensions.Panels), PanelPart.activePanelSettingsKey, + Registry.as(PanelExtensions.Panels).getDefaultPanelId(), 'panel', 'panel', Scope.PANEL, @@ -194,35 +195,55 @@ export class PanelPart extends CompositePart implements IPanelService { registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => { + // Panel Background: since panels can host editors, we apply a background rule if the panel background + // color is different from the editor background color. This is a bit of a hack though. The better way + // would be to have a way to push the background color onto each editor widget itself somehow. + const panelBackground = theme.getColor(PANEL_BACKGROUND); + if (panelBackground && panelBackground !== theme.getColor(editorBackground)) { + collector.addRule(` + .monaco-workbench > .part.panel > .content .monaco-editor, + .monaco-workbench > .part.panel > .content .monaco-editor .margin, + .monaco-workbench > .part.panel > .content .monaco-editor .monaco-editor-background { + background-color: ${panelBackground}; + } + `); + } + // Title Active const titleActive = theme.getColor(PANEL_ACTIVE_TITLE_FOREGROUND); const titleActiveBorder = theme.getColor(PANEL_ACTIVE_TITLE_BORDER); - collector.addRule(` - .monaco-workbench > .part.panel > .title > .panel-switcher-container > .monaco-action-bar .action-item:hover .action-label, - .monaco-workbench > .part.panel > .title > .panel-switcher-container > .monaco-action-bar .action-item .action-label.checked { - color: ${titleActive}; - border-bottom-color: ${titleActiveBorder}; - } - `); + if (titleActive || titleActiveBorder) { + collector.addRule(` + .monaco-workbench > .part.panel > .title > .panel-switcher-container > .monaco-action-bar .action-item:hover .action-label, + .monaco-workbench > .part.panel > .title > .panel-switcher-container > .monaco-action-bar .action-item .action-label.checked { + color: ${titleActive}; + border-bottom-color: ${titleActiveBorder}; + } + `); + } // Title Inactive const titleInactive = theme.getColor(PANEL_INACTIVE_TITLE_FOREGROUND); - collector.addRule(` - .monaco-workbench > .part.panel > .title > .panel-switcher-container > .monaco-action-bar .action-item .action-label { - color: ${titleInactive}; - } - `); + if (titleInactive) { + collector.addRule(` + .monaco-workbench > .part.panel > .title > .panel-switcher-container > .monaco-action-bar .action-item .action-label { + color: ${titleInactive}; + } + `); + } // Title focus const focusBorderColor = theme.getColor(focusBorder); - collector.addRule(` - .monaco-workbench > .part.panel > .title > .panel-switcher-container > .monaco-action-bar .action-item .action-label:focus { - color: ${titleActive}; - border-bottom-color: ${focusBorderColor} !important; - border-bottom: 1px solid; - outline: none; - } - `); + if (focusBorderColor) { + collector.addRule(` + .monaco-workbench > .part.panel > .title > .panel-switcher-container > .monaco-action-bar .action-item .action-label:focus { + color: ${titleActive}; + border-bottom-color: ${focusBorderColor} !important; + border-bottom: 1px solid; + outline: none; + } + `); + } // Styling with Outline color (e.g. high contrast theme) const outline = theme.getColor(activeContrastBorder); diff --git a/src/vs/workbench/browser/parts/quickopen/quickOpenController.ts b/src/vs/workbench/browser/parts/quickopen/quickOpenController.ts index e86aa2e27e3faff47841cc72d0928d3f4b7f5189..4a35d8d7648debf74d058d6ff6d3974317bba813 100644 --- a/src/vs/workbench/browser/parts/quickopen/quickOpenController.ts +++ b/src/vs/workbench/browser/parts/quickopen/quickOpenController.ts @@ -22,11 +22,11 @@ import { CancellationToken } from 'vs/base/common/cancellation'; import { Mode, IEntryRunContext, IAutoFocus, IQuickNavigateConfiguration, IModel } from 'vs/base/parts/quickopen/common/quickOpen'; import { QuickOpenEntry, QuickOpenModel, QuickOpenEntryGroup } from 'vs/base/parts/quickopen/browser/quickOpenModel'; import { QuickOpenWidget, HideReason } from 'vs/base/parts/quickopen/browser/quickOpenWidget'; -import { ContributableActionProvider } from 'vs/workbench/browser/actionBarRegistry'; +import { ContributableActionProvider } from 'vs/workbench/browser/actions'; import labels = require('vs/base/common/labels'); import paths = require('vs/base/common/paths'); import { ITextFileService, AutoSaveMode } from 'vs/workbench/services/textfile/common/textfiles'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { IResourceInput, IEditorInput } from 'vs/platform/editor/common/editor'; import { IModeService } from 'vs/editor/common/services/modeService'; import { getIconClasses } from 'vs/workbench/browser/labels'; @@ -36,7 +36,7 @@ import { Component } from 'vs/workbench/common/component'; import Event, { Emitter } from 'vs/base/common/event'; import { IPartService } from 'vs/workbench/services/part/common/partService'; import { KeyMod } from 'vs/base/common/keyCodes'; -import { QuickOpenHandler, QuickOpenHandlerDescriptor, IQuickOpenRegistry, Extensions, EditorQuickOpenEntry } from 'vs/workbench/browser/quickopen'; +import { QuickOpenHandler, QuickOpenHandlerDescriptor, IQuickOpenRegistry, Extensions, EditorQuickOpenEntry, IWorkbenchQuickOpenConfiguration } from 'vs/workbench/browser/quickopen'; import errors = require('vs/base/common/errors'); import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IPickOpenEntry, IFilePickOpenEntry, IInputOptions, IQuickOpenService, IPickOptions, IShowOptions } from 'vs/platform/quickOpen/common/quickOpen'; @@ -55,15 +55,8 @@ import { IEnvironmentService } from 'vs/platform/environment/common/environment' const HELP_PREFIX = '?'; -interface IWorkbenchQuickOpenConfiguration { - workbench: { - quickOpen: { - closeOnFocusLost: boolean; - } - }; -} - interface IInternalPickOptions { + contextKey?: string; value?: string; valueSelection?: [number, number]; placeHolder?: string; @@ -73,6 +66,7 @@ interface IInternalPickOptions { matchOnDescription?: boolean; matchOnDetail?: boolean; ignoreFocusLost?: boolean; + quickNavigateConfiguration?: IQuickNavigateConfiguration; onDidType?: (value: string) => any; } @@ -91,6 +85,7 @@ export class QuickOpenController extends Component implements IQuickOpenService private pickOpenWidget: QuickOpenWidget; private layoutDimensions: Dimension; private mapResolvedHandlersToPrefix: { [prefix: string]: TPromise; }; + private mapContextKeyToContext: { [id: string]: IContextKey; }; private handlerOnOpenCalled: { [prefix: string]: boolean; }; private currentResultToken: string; private currentPickerToken: string; @@ -107,7 +102,7 @@ export class QuickOpenController extends Component implements IQuickOpenService @IMessageService private messageService: IMessageService, @ITelemetryService private telemetryService: ITelemetryService, @IWorkspaceContextService private contextService: IWorkspaceContextService, - @IContextKeyService contextKeyService: IContextKeyService, + @IContextKeyService private contextKeyService: IContextKeyService, @IConfigurationService private configurationService: IConfigurationService, @IHistoryService private historyService: IHistoryService, @IInstantiationService private instantiationService: IInstantiationService, @@ -119,6 +114,7 @@ export class QuickOpenController extends Component implements IQuickOpenService this.mapResolvedHandlersToPrefix = {}; this.handlerOnOpenCalled = {}; + this.mapContextKeyToContext = {}; this.promisesToCompleteOnHide = []; @@ -133,13 +129,13 @@ export class QuickOpenController extends Component implements IQuickOpenService } private registerListeners(): void { - this.toUnbind.push(this.configurationService.onDidUpdateConfiguration(e => this.updateConfiguration(e.config))); + this.toUnbind.push(this.configurationService.onDidUpdateConfiguration(e => this.updateConfiguration(this.configurationService.getConfiguration()))); this.toUnbind.push(this.partService.onTitleBarVisibilityChange(() => this.positionQuickOpenWidget())); this.toUnbind.push(browser.onDidChangeZoomLevel(() => this.positionQuickOpenWidget())); } private updateConfiguration(settings: IWorkbenchQuickOpenConfiguration): void { - this.closeOnFocusLost = settings.workbench.quickOpen.closeOnFocusLost; + this.closeOnFocusLost = settings.workbench && settings.workbench.quickOpen && settings.workbench.quickOpen.closeOnFocusLost; } public get onShow(): Event { @@ -155,8 +151,8 @@ export class QuickOpenController extends Component implements IQuickOpenService this.quickOpenWidget.navigate(next, quickNavigate); } - if (!quickNavigate && this.pickOpenWidget) { - this.pickOpenWidget.navigate(next); // quick-navigate is only supported in quick open, not picker + if (this.pickOpenWidget) { + this.pickOpenWidget.navigate(next, quickNavigate); } } @@ -199,6 +195,7 @@ export class QuickOpenController extends Component implements IQuickOpenService currentDecoration = !!message ? Severity.Error : void 0; const newPick = message || defaultMessage; if (newPick !== currentPick) { + options.valueSelection = [lastValue.length, lastValue.length]; currentPick = newPick; resolve(new TPromise(init)); } @@ -275,6 +272,9 @@ export class QuickOpenController extends Component implements IQuickOpenService const currentPickerToken = defaultGenerator.nextId(); this.currentPickerToken = currentPickerToken; + // Update context + this.setQuickOpenContextKey(options.contextKey); + // Create upon first open if (!this.pickOpenWidget) { this.pickOpenWidget = new QuickOpenWidget( @@ -446,7 +446,7 @@ export class QuickOpenController extends Component implements IQuickOpenService // Set input if (!this.pickOpenWidget.isVisible()) { - this.pickOpenWidget.show(model, { autoFocus }); + this.pickOpenWidget.show(model, { autoFocus, quickNavigateConfiguration: options.quickNavigateConfiguration }); } else { this.pickOpenWidget.setInput(model, autoFocus); } @@ -519,6 +519,7 @@ export class QuickOpenController extends Component implements IQuickOpenService public show(prefix?: string, options?: IShowOptions): TPromise { let quickNavigateConfiguration = options ? options.quickNavigateConfiguration : void 0; + let inputSelection = options ? options.inputSelection : void 0; this.previousValue = prefix; @@ -569,7 +570,7 @@ export class QuickOpenController extends Component implements IQuickOpenService // Show quick open with prefix or editor history if (!this.quickOpenWidget.isVisible() || quickNavigateConfiguration) { if (prefix) { - this.quickOpenWidget.show(prefix, { quickNavigateConfiguration }); + this.quickOpenWidget.show(prefix, { quickNavigateConfiguration, inputSelection }); } else { const editorHistory = this.getEditorHistoryWithGroupLabel(); if (editorHistory.getEntries().length < 2) { @@ -584,13 +585,17 @@ export class QuickOpenController extends Component implements IQuickOpenService autoFocus = { autoFocusFirstEntry: visibleEditorCount === 0, autoFocusSecondEntry: visibleEditorCount !== 0 }; } - this.quickOpenWidget.show(editorHistory, { quickNavigateConfiguration, autoFocus }); + // Update context + const registry = Registry.as(Extensions.Quickopen); + this.setQuickOpenContextKey(registry.getDefaultQuickOpenHandler().contextKey); + + this.quickOpenWidget.show(editorHistory, { quickNavigateConfiguration, autoFocus, inputSelection }); } } // Otherwise reset the widget to the prefix that is passed in else { - this.quickOpenWidget.show(prefix || ''); + this.quickOpenWidget.show(prefix || '', { inputSelection }); } return promiseCompletedOnHide; @@ -631,8 +636,8 @@ export class QuickOpenController extends Component implements IQuickOpenService const promise = this.mapResolvedHandlersToPrefix[prefix]; promise.then(handler => { this.handlerOnOpenCalled[prefix] = false; - // Don't check if onOpen was called to preserve old behaviour for now - handler.onClose(reason === HideReason.CANCELED); + + handler.onClose(reason === HideReason.CANCELED); // Don't check if onOpen was called to preserve old behaviour for now }); } } @@ -647,10 +652,39 @@ export class QuickOpenController extends Component implements IQuickOpenService this.restoreFocus(); // focus back to editor unless user clicked somewhere else } + // Reset context keys this.inQuickOpenMode.reset(); + this.resetQuickOpenContextKeys(); + + // Events this.emitQuickOpenVisibilityChange(false); } + private resetQuickOpenContextKeys(): void { + Object.keys(this.mapContextKeyToContext).forEach(k => this.mapContextKeyToContext[k].reset()); + } + + private setQuickOpenContextKey(id?: string): void { + let key: IContextKey; + if (id) { + key = this.mapContextKeyToContext[id]; + if (!key) { + key = new RawContextKey(id, false).bindTo(this.contextKeyService); + this.mapContextKeyToContext[id] = key; + } + } + + if (key && key.get()) { + return; // already active context + } + + this.resetQuickOpenContextKeys(); + + if (key) { + key.set(true); + } + } + private hasHandler(prefix: string): boolean { return !!Registry.as(Extensions.Quickopen).getQuickOpenHandler(prefix); } @@ -683,6 +717,7 @@ export class QuickOpenController extends Component implements IQuickOpenService const handlerDescriptor = registry.getQuickOpenHandler(value); const defaultHandlerDescriptor = registry.getDefaultQuickOpenHandler(); const instantProgress = handlerDescriptor && handlerDescriptor.instantProgress; + const contextKey = handlerDescriptor ? handlerDescriptor.contextKey : defaultHandlerDescriptor.contextKey; // Use a generated token to avoid race conditions from long running promises const currentResultToken = defaultGenerator.nextId(); @@ -696,6 +731,9 @@ export class QuickOpenController extends Component implements IQuickOpenService // Reset Extra Class this.quickOpenWidget.setExtraClass(null); + // Update context + this.setQuickOpenContextKey(contextKey); + // Remove leading and trailing whitespace const trimmedValue = strings.trim(value); @@ -707,6 +745,7 @@ export class QuickOpenController extends Component implements IQuickOpenService .done(null, errors.onUnexpectedError); this.quickOpenWidget.setInput(this.getEditorHistoryWithGroupLabel(), { autoFocusFirstEntry: true }); + return; } @@ -886,7 +925,7 @@ export class QuickOpenController extends Component implements IQuickOpenService const placeHolderLabel = (typeof canRun === 'string') ? canRun : nls.localize('canNotRunPlaceholder', "This quick open handler can not be used in the current context"); const model = new QuickOpenModel([new PlaceholderQuickOpenEntry(placeHolderLabel)], this.actionProvider); - this.showModel(model, resolvedHandler.getAutoFocus(value, this.quickOpenWidget.getQuickNavigateConfiguration()), resolvedHandler.getAriaLabel()); + this.showModel(model, resolvedHandler.getAutoFocus(value, { model, quickNavigateConfiguration: this.quickOpenWidget.getQuickNavigateConfiguration() }), resolvedHandler.getAriaLabel()); return TPromise.as(null); } @@ -907,9 +946,9 @@ export class QuickOpenController extends Component implements IQuickOpenService if (this.currentResultToken === currentResultToken) { if (!result || !result.entries.length) { const model = new QuickOpenModel([new PlaceholderQuickOpenEntry(resolvedHandler.getEmptyLabel(value))]); - this.showModel(model, resolvedHandler.getAutoFocus(value, this.quickOpenWidget.getQuickNavigateConfiguration()), resolvedHandler.getAriaLabel()); + this.showModel(model, resolvedHandler.getAutoFocus(value, { model, quickNavigateConfiguration: this.quickOpenWidget.getQuickNavigateConfiguration() }), resolvedHandler.getAriaLabel()); } else { - this.showModel(result, resolvedHandler.getAutoFocus(value, this.quickOpenWidget.getQuickNavigateConfiguration()), resolvedHandler.getAriaLabel()); + this.showModel(result, resolvedHandler.getAutoFocus(value, { model: result, quickNavigateConfiguration: this.quickOpenWidget.getQuickNavigateConfiguration() }), resolvedHandler.getAriaLabel()); } } }); diff --git a/src/vs/workbench/browser/parts/quickopen/quickopen.contribution.ts b/src/vs/workbench/browser/parts/quickopen/quickopen.contribution.ts index 6d696c729c08a5cd3bf4410f15201b754f8a01db..6cc2060c9fdb1175953a612817581d1bf8c6db8e 100644 --- a/src/vs/workbench/browser/parts/quickopen/quickopen.contribution.ts +++ b/src/vs/workbench/browser/parts/quickopen/quickopen.contribution.ts @@ -4,122 +4,14 @@ *--------------------------------------------------------------------------------------------*/ 'use strict'; -import { Registry } from 'vs/platform/platform'; -import { TPromise } from 'vs/base/common/winjs.base'; -import nls = require('vs/nls'); -import { Action } from 'vs/base/common/actions'; +import { Registry } from 'vs/platform/registry/common/platform'; import { IQuickOpenService } from 'vs/platform/quickOpen/common/quickOpen'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; import { SyncActionDescriptor } from 'vs/platform/actions/common/actions'; import { KeyMod, KeyCode } from 'vs/base/common/keyCodes'; import { IWorkbenchActionRegistry, Extensions as ActionExtensions } from 'vs/workbench/common/actionRegistry'; -import { KeybindingsRegistry, IKeybindings } from 'vs/platform/keybinding/common/keybindingsRegistry'; +import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry'; import { RemoveFromEditorHistoryAction } from 'vs/workbench/browser/parts/quickopen/quickOpenController'; - -export class GlobalQuickOpenAction extends Action { - - public static ID = 'workbench.action.quickOpen'; - public static LABEL = nls.localize('quickOpen', "Go to File..."); - - constructor(id: string, label: string, @IQuickOpenService private quickOpenService: IQuickOpenService) { - super(id, label); - - this.order = 100; // Allow other actions to position before or after - this.class = 'quickopen'; - } - - public run(): TPromise { - this.quickOpenService.show(null); - - return TPromise.as(true); - } -} - -export class BaseQuickOpenNavigateAction extends Action { - - constructor( - id: string, - label: string, - private next: boolean, - private quickNavigate: boolean, - @IQuickOpenService private quickOpenService: IQuickOpenService, - @IKeybindingService private keybindingService: IKeybindingService - ) { - super(id, label); - } - - public run(event?: any): TPromise { - const keys = this.keybindingService.lookupKeybindings(this.id); - const quickNavigate = this.quickNavigate ? { keybindings: keys } : void 0; - - this.quickOpenService.navigate(this.next, quickNavigate); - - return TPromise.as(true); - } -} - -export class QuickOpenNavigateNextAction extends BaseQuickOpenNavigateAction { - - public static ID = 'workbench.action.quickOpenNavigateNext'; - public static LABEL = nls.localize('quickNavigateNext', "Navigate Next in Quick Open"); - - constructor( - id: string, - label: string, - @IQuickOpenService quickOpenService: IQuickOpenService, - @IKeybindingService keybindingService: IKeybindingService - ) { - super(id, label, true, true, quickOpenService, keybindingService); - } -} - -export class QuickOpenNavigatePreviousAction extends BaseQuickOpenNavigateAction { - - public static ID = 'workbench.action.quickOpenNavigatePrevious'; - public static LABEL = nls.localize('quickNavigatePrevious', "Navigate Previous in Quick Open"); - - constructor( - id: string, - label: string, - @IQuickOpenService quickOpenService: IQuickOpenService, - @IKeybindingService keybindingService: IKeybindingService - ) { - super(id, label, false, true, quickOpenService, keybindingService); - } -} - -export class QuickOpenSelectNextAction extends BaseQuickOpenNavigateAction { - - public static ID = 'workbench.action.quickOpenSelectNext'; - public static LABEL = nls.localize('quickSelectNext', "Select Next in Quick Open"); - - constructor( - id: string, - label: string, - @IQuickOpenService quickOpenService: IQuickOpenService, - @IKeybindingService keybindingService: IKeybindingService - ) { - super(id, label, true, false, quickOpenService, keybindingService); - } -} - -export class QuickOpenSelectPreviousAction extends BaseQuickOpenNavigateAction { - - public static ID = 'workbench.action.quickOpenSelectPrevious'; - public static LABEL = nls.localize('quickSelectPrevious', "Select Previous in Quick Open"); - - constructor( - id: string, - label: string, - @IQuickOpenService quickOpenService: IQuickOpenService, - @IKeybindingService keybindingService: IKeybindingService - ) { - super(id, label, false, false, quickOpenService, keybindingService); - } -} - -const inQuickOpenContext = ContextKeyExpr.has('inQuickOpen'); +import { GlobalQuickOpenAction, QuickOpenSelectNextAction, QuickOpenSelectPreviousAction, inQuickOpenContext, getQuickNavigateHandler, QuickOpenNavigateNextAction, QuickOpenNavigatePreviousAction, defaultQuickOpenContext } from "vs/workbench/browser/parts/quickopen/quickopen"; KeybindingsRegistry.registerCommandAndKeybindingRule({ id: 'workbench.action.closeQuickOpen', @@ -154,41 +46,38 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({ } }); -function navigateKeybinding(shift: boolean): IKeybindings { - if (!shift) { - return { - primary: KeyMod.CtrlCmd | KeyCode.Tab, - secondary: [KeyMod.CtrlCmd | KeyCode.KEY_Q, KeyMod.CtrlCmd | KeyCode.KEY_E, KeyMod.CtrlCmd | KeyCode.KEY_P], - mac: { - primary: KeyMod.WinCtrl | KeyCode.Tab, - secondary: [KeyMod.WinCtrl | KeyCode.KEY_Q, KeyMod.CtrlCmd | KeyCode.KEY_P] - }, - linux: { - primary: KeyMod.CtrlCmd | KeyCode.Tab, - secondary: [KeyMod.CtrlCmd | KeyCode.KEY_E, KeyMod.CtrlCmd | KeyCode.KEY_P] - } - }; - } - - return { - primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.Tab, - secondary: [KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_Q, KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_E, KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_P], - mac: { - primary: KeyMod.WinCtrl | KeyMod.Shift | KeyCode.Tab, - secondary: [KeyMod.WinCtrl | KeyMod.Shift | KeyCode.KEY_Q, KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_P] - }, - linux: { - primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.Tab, - secondary: [KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_E, KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_P] - } - }; -} - const registry = Registry.as(ActionExtensions.WorkbenchActions); -registry.registerWorkbenchAction(new SyncActionDescriptor(GlobalQuickOpenAction, GlobalQuickOpenAction.ID, GlobalQuickOpenAction.LABEL, { primary: KeyMod.CtrlCmd | KeyCode.KEY_P, secondary: [KeyMod.CtrlCmd | KeyCode.KEY_E], mac: { primary: KeyMod.CtrlCmd | KeyCode.KEY_P, secondary: null } }), 'Go to File...'); -registry.registerWorkbenchAction(new SyncActionDescriptor(QuickOpenNavigateNextAction, QuickOpenNavigateNextAction.ID, QuickOpenNavigateNextAction.LABEL, navigateKeybinding(false), inQuickOpenContext, KeybindingsRegistry.WEIGHT.workbenchContrib(50)), 'Navigate Next in Quick Open'); -registry.registerWorkbenchAction(new SyncActionDescriptor(QuickOpenNavigatePreviousAction, QuickOpenNavigatePreviousAction.ID, QuickOpenNavigatePreviousAction.LABEL, navigateKeybinding(true), inQuickOpenContext, KeybindingsRegistry.WEIGHT.workbenchContrib(50)), 'Navigate Previous in Quick Open'); +const globalQuickOpenKeybinding = { primary: KeyMod.CtrlCmd | KeyCode.KEY_P, secondary: [KeyMod.CtrlCmd | KeyCode.KEY_E], mac: { primary: KeyMod.CtrlCmd | KeyCode.KEY_P, secondary: null } }; + +registry.registerWorkbenchAction(new SyncActionDescriptor(GlobalQuickOpenAction, GlobalQuickOpenAction.ID, GlobalQuickOpenAction.LABEL, globalQuickOpenKeybinding), 'Go to File...'); registry.registerWorkbenchAction(new SyncActionDescriptor(QuickOpenSelectNextAction, QuickOpenSelectNextAction.ID, QuickOpenSelectNextAction.LABEL, { primary: null, mac: { primary: KeyMod.WinCtrl | KeyCode.KEY_N } }, inQuickOpenContext, KeybindingsRegistry.WEIGHT.workbenchContrib(50)), 'Select Next in Quick Open'); registry.registerWorkbenchAction(new SyncActionDescriptor(QuickOpenSelectPreviousAction, QuickOpenSelectPreviousAction.ID, QuickOpenSelectPreviousAction.LABEL, { primary: null, mac: { primary: KeyMod.WinCtrl | KeyCode.KEY_P } }, inQuickOpenContext, KeybindingsRegistry.WEIGHT.workbenchContrib(50)), 'Select Previous in Quick Open'); +registry.registerWorkbenchAction(new SyncActionDescriptor(QuickOpenNavigateNextAction, QuickOpenNavigateNextAction.ID, QuickOpenNavigateNextAction.LABEL), 'Navigate Next in Quick Open'); +registry.registerWorkbenchAction(new SyncActionDescriptor(QuickOpenNavigatePreviousAction, QuickOpenNavigatePreviousAction.ID, QuickOpenNavigatePreviousAction.LABEL), 'Navigate Previous in Quick Open'); registry.registerWorkbenchAction(new SyncActionDescriptor(RemoveFromEditorHistoryAction, RemoveFromEditorHistoryAction.ID, RemoveFromEditorHistoryAction.LABEL), 'Remove From History'); + +const quickOpenNavigateNextInFilePickerId = 'workbench.action.quickOpenNavigateNextInFilePicker'; +KeybindingsRegistry.registerCommandAndKeybindingRule({ + id: quickOpenNavigateNextInFilePickerId, + weight: KeybindingsRegistry.WEIGHT.workbenchContrib(50), + handler: getQuickNavigateHandler(quickOpenNavigateNextInFilePickerId, true), + when: defaultQuickOpenContext, + primary: globalQuickOpenKeybinding.primary, + secondary: globalQuickOpenKeybinding.secondary, + mac: globalQuickOpenKeybinding.mac +}); + +const quickOpenNavigatePreviousInFilePickerId = 'workbench.action.quickOpenNavigatePreviousInFilePicker'; +KeybindingsRegistry.registerCommandAndKeybindingRule({ + id: quickOpenNavigatePreviousInFilePickerId, + weight: KeybindingsRegistry.WEIGHT.workbenchContrib(50), + handler: getQuickNavigateHandler(quickOpenNavigatePreviousInFilePickerId, false), + when: defaultQuickOpenContext, + primary: globalQuickOpenKeybinding.primary | KeyMod.Shift, + secondary: [globalQuickOpenKeybinding.secondary[0] | KeyMod.Shift], + mac: { + primary: globalQuickOpenKeybinding.mac.primary | KeyMod.Shift, + secondary: null + } +}); \ No newline at end of file diff --git a/src/vs/workbench/browser/parts/quickopen/quickopen.ts b/src/vs/workbench/browser/parts/quickopen/quickopen.ts new file mode 100644 index 0000000000000000000000000000000000000000..be16c8f57b2dd5598eccd565e3d55456cdfc6560 --- /dev/null +++ b/src/vs/workbench/browser/parts/quickopen/quickopen.ts @@ -0,0 +1,132 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +'use strict'; + +import { TPromise } from 'vs/base/common/winjs.base'; +import nls = require('vs/nls'); +import { Action } from 'vs/base/common/actions'; +import { IQuickOpenService } from 'vs/platform/quickOpen/common/quickOpen'; +import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; +import { ContextKeyExpr } from "vs/platform/contextkey/common/contextkey"; +import { ICommandHandler } from "vs/platform/commands/common/commands"; + +export const inQuickOpenContext = ContextKeyExpr.has('inQuickOpen'); +export const defaultQuickOpenContextKey = 'inFilesPicker'; +export const defaultQuickOpenContext = ContextKeyExpr.and(inQuickOpenContext, ContextKeyExpr.has(defaultQuickOpenContextKey)); + +export class GlobalQuickOpenAction extends Action { + + public static ID = 'workbench.action.quickOpen'; + public static LABEL = nls.localize('quickOpen', "Go to File..."); + + constructor(id: string, label: string, @IQuickOpenService private quickOpenService: IQuickOpenService) { + super(id, label); + + this.order = 100; // Allow other actions to position before or after + this.class = 'quickopen'; + } + + public run(): TPromise { + this.quickOpenService.show(null); + + return TPromise.as(true); + } +} + +export class BaseQuickOpenNavigateAction extends Action { + + constructor( + id: string, + label: string, + private next: boolean, + private quickNavigate: boolean, + @IQuickOpenService private quickOpenService: IQuickOpenService, + @IKeybindingService private keybindingService: IKeybindingService + ) { + super(id, label); + } + + public run(event?: any): TPromise { + const keys = this.keybindingService.lookupKeybindings(this.id); + const quickNavigate = this.quickNavigate ? { keybindings: keys } : void 0; + + this.quickOpenService.navigate(this.next, quickNavigate); + + return TPromise.as(true); + } +} + +export function getQuickNavigateHandler(id: string, next?: boolean): ICommandHandler { + return accessor => { + const keybindingService = accessor.get(IKeybindingService); + const quickOpenService = accessor.get(IQuickOpenService); + + const keys = keybindingService.lookupKeybindings(id); + const quickNavigate = { keybindings: keys }; + + quickOpenService.navigate(next, quickNavigate); + }; +} + +export class QuickOpenNavigateNextAction extends BaseQuickOpenNavigateAction { + + public static ID = 'workbench.action.quickOpenNavigateNext'; + public static LABEL = nls.localize('quickNavigateNext', "Navigate Next in Quick Open"); + + constructor( + id: string, + label: string, + @IQuickOpenService quickOpenService: IQuickOpenService, + @IKeybindingService keybindingService: IKeybindingService + ) { + super(id, label, true, true, quickOpenService, keybindingService); + } +} + +export class QuickOpenNavigatePreviousAction extends BaseQuickOpenNavigateAction { + + public static ID = 'workbench.action.quickOpenNavigatePrevious'; + public static LABEL = nls.localize('quickNavigatePrevious', "Navigate Previous in Quick Open"); + + constructor( + id: string, + label: string, + @IQuickOpenService quickOpenService: IQuickOpenService, + @IKeybindingService keybindingService: IKeybindingService + ) { + super(id, label, false, true, quickOpenService, keybindingService); + } +} + +export class QuickOpenSelectNextAction extends BaseQuickOpenNavigateAction { + + public static ID = 'workbench.action.quickOpenSelectNext'; + public static LABEL = nls.localize('quickSelectNext', "Select Next in Quick Open"); + + constructor( + id: string, + label: string, + @IQuickOpenService quickOpenService: IQuickOpenService, + @IKeybindingService keybindingService: IKeybindingService + ) { + super(id, label, true, false, quickOpenService, keybindingService); + } +} + +export class QuickOpenSelectPreviousAction extends BaseQuickOpenNavigateAction { + + public static ID = 'workbench.action.quickOpenSelectPrevious'; + public static LABEL = nls.localize('quickSelectPrevious', "Select Previous in Quick Open"); + + constructor( + id: string, + label: string, + @IQuickOpenService quickOpenService: IQuickOpenService, + @IKeybindingService keybindingService: IKeybindingService + ) { + super(id, label, false, false, quickOpenService, keybindingService); + } +} \ No newline at end of file diff --git a/src/vs/workbench/browser/parts/sidebar/sidebarPart.ts b/src/vs/workbench/browser/parts/sidebar/sidebarPart.ts index fa5d1156e363ac45d02d80bd0e8bbdacb8c7cac6..f8bd26770d54eed51b1bcb6e8b3335eabf6760e2 100644 --- a/src/vs/workbench/browser/parts/sidebar/sidebarPart.ts +++ b/src/vs/workbench/browser/parts/sidebar/sidebarPart.ts @@ -6,7 +6,7 @@ import 'vs/css!./media/sidebarpart'; import { TPromise } from 'vs/base/common/winjs.base'; import nls = require('vs/nls'); -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { Action } from 'vs/base/common/actions'; import { CompositePart } from 'vs/workbench/browser/parts/compositePart'; import { Viewlet, ViewletRegistry, Extensions as ViewletExtensions } from 'vs/workbench/browser/viewlet'; @@ -15,7 +15,7 @@ import { SyncActionDescriptor } from 'vs/platform/actions/common/actions'; import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; import { IPartService, Parts, Position as SideBarPosition } from 'vs/workbench/services/part/common/partService'; import { IViewlet } from 'vs/workbench/common/viewlet'; -import { Scope } from 'vs/workbench/browser/actionBarRegistry'; +import { Scope } from 'vs/workbench/browser/actions'; import { IStorageService } from 'vs/platform/storage/common/storage'; import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; import { IMessageService } from 'vs/platform/message/common/message'; @@ -58,6 +58,7 @@ export class SidebarPart extends CompositePart { themeService, Registry.as(ViewletExtensions.Viewlets), SidebarPart.activeViewletSettingsKey, + Registry.as(ViewletExtensions.Viewlets).getDefaultViewletId(), 'sideBar', 'viewlet', Scope.VIEWLET, @@ -68,11 +69,11 @@ export class SidebarPart extends CompositePart { } public get onDidViewletOpen(): Event { - return this._onDidCompositeOpen.event; + return this._onDidCompositeOpen.event as Event; } public get onDidViewletClose(): Event { - return this._onDidCompositeClose.event; + return this._onDidCompositeClose.event as Event; } public updateStyles(): void { @@ -100,7 +101,7 @@ export class SidebarPart extends CompositePart { } // First check if sidebar is hidden and show if so - let promise = TPromise.as(null); + let promise = TPromise.as(null); if (!this.partService.isVisible(Parts.SIDEBAR_PART)) { try { this.blockOpeningViewlet = true; @@ -110,7 +111,7 @@ export class SidebarPart extends CompositePart { } } - return promise.then(() => this.openComposite(id, focus)); + return promise.then(() => this.openComposite(id, focus)) as TPromise; } public getActiveViewlet(): IViewlet { diff --git a/src/vs/workbench/browser/parts/statusbar/statusbar.ts b/src/vs/workbench/browser/parts/statusbar/statusbar.ts index 6eb4f4589303b77a65d1ca472a1adc9677408db4..d46fd03dc31ba453b2060a6b31bb5a6092f538e5 100644 --- a/src/vs/workbench/browser/parts/statusbar/statusbar.ts +++ b/src/vs/workbench/browser/parts/statusbar/statusbar.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ 'use strict'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { IDisposable } from 'vs/base/common/lifecycle'; import * as statusbarService from 'vs/platform/statusbar/common/statusbar'; import { SyncDescriptor0, createSyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; diff --git a/src/vs/workbench/browser/parts/statusbar/statusbarPart.ts b/src/vs/workbench/browser/parts/statusbar/statusbarPart.ts index fd2fd574fb4b4381be2921b876c15fb675c21184..6e89598086f80590b57938ccbfa034d1562869ec 100644 --- a/src/vs/workbench/browser/parts/statusbar/statusbarPart.ts +++ b/src/vs/workbench/browser/parts/statusbar/statusbarPart.ts @@ -13,7 +13,7 @@ import { TPromise } from 'vs/base/common/winjs.base'; import { dispose, IDisposable } from 'vs/base/common/lifecycle'; import { Builder, $ } from 'vs/base/browser/builder'; import { OcticonLabel } from 'vs/base/browser/ui/octiconLabel/octiconLabel'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { ICommandService } from 'vs/platform/commands/common/commands'; import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; import { Part } from 'vs/workbench/browser/part'; @@ -30,7 +30,7 @@ import { IThemeService, registerThemingParticipant, ITheme, ICssStyleCollector } import { STATUS_BAR_BACKGROUND, STATUS_BAR_FOREGROUND, STATUS_BAR_NO_FOLDER_BACKGROUND, STATUS_BAR_ITEM_HOVER_BACKGROUND, STATUS_BAR_ITEM_ACTIVE_BACKGROUND, STATUS_BAR_PROMINENT_ITEM_BACKGROUND, STATUS_BAR_PROMINENT_ITEM_HOVER_BACKGROUND, STATUS_BAR_BORDER, STATUS_BAR_NO_FOLDER_FOREGROUND } from 'vs/workbench/common/theme'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { contrastBorder } from 'vs/platform/theme/common/colorRegistry'; -import { isThemeColor } from "vs/editor/common/editorCommon"; +import { isThemeColor } from 'vs/editor/common/editorCommon'; import { Color } from 'vs/base/common/color'; export class StatusbarPart extends Part implements IStatusbarService { diff --git a/src/vs/workbench/browser/parts/titlebar/titlebarPart.ts b/src/vs/workbench/browser/parts/titlebar/titlebarPart.ts index 1e1aa16a14f0521d1c9188e5dc589d7d56a70518..7d3de6cb827846d0f9744a812c885117ec766eb5 100644 --- a/src/vs/workbench/browser/parts/titlebar/titlebarPart.ts +++ b/src/vs/workbench/browser/parts/titlebar/titlebarPart.ts @@ -25,12 +25,13 @@ import { IEditorGroupService } from 'vs/workbench/services/group/common/groupSer import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import nls = require('vs/nls'); import * as labels from 'vs/base/common/labels'; -import { EditorInput } from 'vs/workbench/common/editor'; +import { EditorInput, toResource } from 'vs/workbench/common/editor'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { Verbosity } from 'vs/platform/editor/common/editor'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { TITLE_BAR_ACTIVE_BACKGROUND, TITLE_BAR_ACTIVE_FOREGROUND, TITLE_BAR_INACTIVE_FOREGROUND, TITLE_BAR_INACTIVE_BACKGROUND } from 'vs/workbench/common/theme'; +import URI from "vs/base/common/uri"; export class TitlebarPart extends Part implements ITitleService { @@ -52,7 +53,6 @@ export class TitlebarPart extends Part implements ITitleService { private titleTemplate: string; private isPure: boolean; private activeEditorListeners: IDisposable[]; - private workspacePath: string; constructor( id: string, @@ -71,7 +71,6 @@ export class TitlebarPart extends Part implements ITitleService { this.isPure = true; this.activeEditorListeners = []; - this.workspacePath = contextService.hasWorkspace() ? labels.getPathLabel(contextService.getWorkspace().resource, void 0, environmentService) : ''; this.init(); @@ -100,6 +99,7 @@ export class TitlebarPart extends Part implements ITitleService { this.toUnbind.push(DOM.addDisposableListener(window, DOM.EventType.FOCUS, () => this.onFocus())); this.toUnbind.push(this.configurationService.onDidUpdateConfiguration(() => this.onConfigurationChanged(true))); this.toUnbind.push(this.editorGroupService.onEditorsChanged(() => this.onEditorsChanged())); + this.toUnbind.push(this.contextService.onDidChangeWorkspaceRoots(() => this.onDidChangeWorkspaceRoots())); } private onBlur(): void { @@ -112,6 +112,10 @@ export class TitlebarPart extends Part implements ITitleService { this.updateStyles(); } + private onDidChangeWorkspaceRoots(): void { + this.setTitle(this.getWindowTitle()); + } + private onConfigurationChanged(update?: boolean): void { const currentTitleTemplate = this.titleTemplate; this.titleTemplate = this.configurationService.lookup('window.title').value; @@ -169,22 +173,48 @@ export class TitlebarPart extends Part implements ITitleService { * {activeEditorLong}: e.g. /Users/Development/myProject/myFolder/myFile.txt * {activeEditorMedium}: e.g. myFolder/myFile.txt * {activeEditorShort}: e.g. myFile.txt - * {rootName}: e.g. myProject + * {rootName}: e.g. myFolder1, myFolder2, myFolder3 * {rootPath}: e.g. /Users/Development/myProject + * {folderName}: e.g. myFolder + * {folderPath}: e.g. /Users/Development/myFolder * {appName}: e.g. VS Code * {dirty}: indiactor * {separator}: conditional separator */ private doGetWindowTitle(): string { const input = this.editorService.getActiveEditorInput(); - const workspace = this.contextService.getWorkspace(); + const workspace = this.contextService.getWorkspace2(); + + // Compute root resource + // Single Root Workspace: always the single root workspace in this case + // Multi Root Workspace: not yet defined (TODO@Ben multi root) + let root: URI; + if (workspace) { + if (workspace.roots.length === 1) { + root = workspace.roots[0]; + } + } + + // Compute folder resource + // Single Root Workspace: always the root single workspace in this case + // Multi Root Workspace: root folder of the currently active file if any + let folder: URI; + if (workspace) { + if (workspace.roots.length === 1) { + folder = workspace.roots[0]; + } else { + folder = this.contextService.getRoot(toResource(input, { supportSideBySide: true, filter: 'file' })); + } + } // Variables const activeEditorShort = input ? input.getTitle(Verbosity.SHORT) : ''; const activeEditorMedium = input ? input.getTitle(Verbosity.MEDIUM) : activeEditorShort; const activeEditorLong = input ? input.getTitle(Verbosity.LONG) : activeEditorMedium; const rootName = workspace ? workspace.name : ''; - const rootPath = workspace ? this.workspacePath : ''; + const rootPath = workspace ? labels.getPathLabel(root, void 0, this.environmentService) : ''; + const folderName = folder ? (paths.basename(folder.fsPath) || folder.fsPath) : ''; + const folderPath = folder ? labels.getPathLabel(folder, void 0, this.environmentService) : ''; const dirty = input && input.isDirty() ? TitlebarPart.TITLE_DIRTY : ''; const appName = this.environmentService.appNameLong; const separator = TitlebarPart.TITLE_SEPARATOR; @@ -195,6 +225,8 @@ export class TitlebarPart extends Part implements ITitleService { activeEditorMedium, rootName, rootPath, + folderName, + folderPath, dirty, appName, separator: { label: separator } @@ -241,13 +273,7 @@ export class TitlebarPart extends Part implements ITitleService { } private onTitleDoubleclick(): void { - this.windowService.isMaximized().then(maximized => { - if (maximized) { - this.windowService.unmaximizeWindow().done(null, errors.onUnexpectedError); - } else { - this.windowService.maximizeWindow().done(null, errors.onUnexpectedError); - } - }, errors.onUnexpectedError); + this.windowService.onWindowTitleDoubleClick().then(null, errors.onUnexpectedError); } private onContextMenu(e: MouseEvent): void { diff --git a/src/vs/workbench/browser/quickopen.ts b/src/vs/workbench/browser/quickopen.ts index ebb31e7a83392743e2247cb6ee4d812a7e9d2c92..f64144d4acccc575bcea65a9f5a3551352856b04 100644 --- a/src/vs/workbench/browser/quickopen.ts +++ b/src/vs/workbench/browser/quickopen.ts @@ -7,22 +7,33 @@ import nls = require('vs/nls'); import { TPromise } from 'vs/base/common/winjs.base'; import * as objects from 'vs/base/common/objects'; -import filters = require('vs/base/common/filters'); import arrays = require('vs/base/common/arrays'); import strings = require('vs/base/common/strings'); import types = require('vs/base/common/types'); import errors = require('vs/base/common/errors'); -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { Action } from 'vs/base/common/actions'; import { KeyMod } from 'vs/base/common/keyCodes'; import { Mode, IEntryRunContext, IAutoFocus, IModel, IQuickNavigateConfiguration } from 'vs/base/parts/quickopen/common/quickOpen'; -import { QuickOpenEntry, IHighlight, QuickOpenEntryGroup, QuickOpenModel } from 'vs/base/parts/quickopen/browser/quickOpenModel'; +import { QuickOpenEntry, IHighlight, QuickOpenEntryGroup } from 'vs/base/parts/quickopen/browser/quickOpenModel'; import { EditorOptions, EditorInput } from 'vs/workbench/common/editor'; import { IResourceInput, IEditorInput, IEditorOptions } from 'vs/platform/editor/common/editor'; import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IQuickOpenService } from 'vs/platform/quickOpen/common/quickOpen'; import { AsyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; +export interface IWorkbenchQuickOpenConfiguration { + workbench: { + quickOpen: { + closeOnFocusLost: boolean; + }, + commandPalette: { + history: number; + preserveInput: boolean; + } + }; +} + export class QuickOpenHandler { /** @@ -71,7 +82,7 @@ export class QuickOpenHandler { * Indicates if the handler wishes the quick open widget to automatically select the first result entry or an entry * based on a specific prefix match. */ - public getAutoFocus(searchValue: string, quickNavigateConfiguration?: IQuickNavigateConfiguration): IAutoFocus { + public getAutoFocus(searchValue: string, context: { model: IModel, quickNavigateConfiguration?: IQuickNavigateConfiguration }): IAutoFocus { return {}; } @@ -120,18 +131,21 @@ export interface QuickOpenHandlerHelpEntry { export class QuickOpenHandlerDescriptor extends AsyncDescriptor { public prefix: string; public description: string; + public contextKey: string; public isDefault: boolean; public helpEntries: QuickOpenHandlerHelpEntry[]; public instantProgress: boolean; + private id: string; - constructor(moduleId: string, ctorName: string, prefix: string, description: string, instantProgress?: boolean); - constructor(moduleId: string, ctorName: string, prefix: string, helpEntries: QuickOpenHandlerHelpEntry[], instantProgress?: boolean); - constructor(moduleId: string, ctorName: string, prefix: string, param: any, instantProgress: boolean = false) { + constructor(moduleId: string, ctorName: string, prefix: string, contextKey: string, description: string, instantProgress?: boolean); + constructor(moduleId: string, ctorName: string, prefix: string, contextKey: string, helpEntries: QuickOpenHandlerHelpEntry[], instantProgress?: boolean); + constructor(moduleId: string, ctorName: string, prefix: string, contextKey: string, param: any, instantProgress: boolean = false) { super(moduleId, ctorName); - this.prefix = prefix; this.id = moduleId + ctorName; + this.prefix = prefix; + this.contextKey = contextKey; this.instantProgress = instantProgress; if (types.isString(param)) { @@ -341,94 +355,22 @@ export interface ICommandQuickOpenHandlerOptions { defaultCommand?: ICommand; } -export abstract class CommandQuickOpenHandler extends QuickOpenHandler { - +export class QuickOpenAction extends Action { private prefix: string; - private defaultCommand: ICommand; - private commands: { regexp: RegExp; command: ICommand; }[]; constructor( - @IQuickOpenService private quickOpenService: IQuickOpenService, - options: ICommandQuickOpenHandlerOptions + id: string, + label: string, + prefix: string, + @IQuickOpenService private quickOpenService: IQuickOpenService ) { - super(); - - this.prefix = options.prefix; - this.commands = options.commands.map(c => ({ - regexp: new RegExp('^(' + c.aliases.join('|') + ')\\b\\W+'), - command: c - })); - this.defaultCommand = options.defaultCommand || null; - } - - public getResults(input: string): TPromise { - let match: RegExpMatchArray; - let command = arrays.first(this.commands, c => !!(match = input.match(c.regexp))); - let promise: TPromise; - - if (command) { - promise = command.command.getResults(input.substr(match[0].length)); - } else if (this.defaultCommand) { - promise = this.defaultCommand.getResults(input); - } else { - promise = this.getCommands(input); - } - - return promise.then(e => new QuickOpenModel(e)); - } - - private getCommands(input: string): TPromise { - let entries: QuickOpenEntry[] = this.commands - .map(c => ({ command: c.command, highlights: filters.matchesFuzzy(input, c.command.aliases[0]) })) - .filter(({ command, highlights }) => !!highlights || command.aliases.some(a => input === a)) - .map(({ command, highlights }) => new CommandEntry(this.quickOpenService, this.prefix, command, highlights)); - - return TPromise.as(entries); - } - - public getClass(): string { - return null; - } - - public canRun(): boolean { - return true; - } - - public getAutoFocus(input: string): IAutoFocus { - return { autoFocusFirstEntry: true }; - } - - public onClose(canceled: boolean): void { - return; - } - - public getGroupLabel(): string { - return null; - } - - public getEmptyLabel(input: string): string { - let match: RegExpMatchArray; - let command = arrays.first(this.commands, c => !!(match = input.match(c.regexp))); - - if (!command) { - return nls.localize('noCommands', "No commands matching"); - } - - return command.command.getEmptyLabel(input); - } -} - -export class QuickOpenAction extends Action { - private prefix: string; - - constructor(actionId: string, actionLabel: string, prefix: string, @IQuickOpenService private quickOpenService: IQuickOpenService) { - super(actionId, actionLabel); + super(id, label); this.prefix = prefix; this.enabled = !!this.quickOpenService; } - public run(context?: any): TPromise { + public run(context?: any): TPromise { // Show with prefix this.quickOpenService.show(this.prefix); diff --git a/src/vs/workbench/browser/viewlet.ts b/src/vs/workbench/browser/viewlet.ts index 56c11d7b11a108bd483f29589a947c991b3f2be9..b4baf6d3d6fb526dee669ad917ab532ca888781e 100644 --- a/src/vs/workbench/browser/viewlet.ts +++ b/src/vs/workbench/browser/viewlet.ts @@ -7,24 +7,14 @@ import nls = require('vs/nls'); import { TPromise } from 'vs/base/common/winjs.base'; import DOM = require('vs/base/browser/dom'); import errors = require('vs/base/common/errors'); -import { Registry } from 'vs/platform/platform'; -import { Dimension, Builder, $ } from 'vs/base/browser/builder'; -import { IAction, IActionRunner, Action } from 'vs/base/common/actions'; -import { IActionItem, ActionsOrientation } from 'vs/base/browser/ui/actionbar/actionbar'; +import { Registry } from 'vs/platform/registry/common/platform'; +import { Dimension, Builder } from 'vs/base/browser/builder'; +import { Action } from 'vs/base/common/actions'; import { ITree, IFocusEvent, ISelectionEvent } from 'vs/base/parts/tree/browser/tree'; -import { prepareActions } from 'vs/workbench/browser/actionBarRegistry'; -import { ToolBar } from 'vs/base/browser/ui/toolbar/toolbar'; -import { DelayedDragHandler } from 'vs/base/browser/dnd'; -import { dispose, IDisposable } from 'vs/base/common/lifecycle'; -import { CollapsibleView, CollapsibleState, FixedCollapsibleView, IView } from 'vs/base/browser/ui/splitview/splitview'; import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IViewlet } from 'vs/workbench/common/viewlet'; import { Composite, CompositeDescriptor, CompositeRegistry } from 'vs/workbench/browser/composite'; -import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; -import { IMessageService } from 'vs/platform/message/common/message'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { IThemable } from 'vs/platform/theme/common/styler'; export abstract class Viewlet extends Composite implements IViewlet { @@ -287,325 +277,4 @@ export class CollapseAction extends Action { return TPromise.as(null); }); } -} - -export interface IViewletView extends IView, IThemable { - id?: string; - create(): TPromise; - setVisible(visible: boolean): TPromise; - getActions(): IAction[]; - getSecondaryActions(): IAction[]; - getActionItem(action: IAction): IActionItem; - showHeader(): boolean; - hideHeader(): boolean; - shutdown(): void; - focusBody(): void; - isExpanded(): boolean; -} - -/** - * The AdaptiveCollapsibleViewletView can grow with the content inside dynamically. - */ -export abstract class AdaptiveCollapsibleViewletView extends FixedCollapsibleView implements IViewletView { - protected treeContainer: HTMLElement; - protected tree: ITree; - protected toDispose: IDisposable[]; - protected isVisible: boolean; - protected toolBar: ToolBar; - protected actionRunner: IActionRunner; - protected isDisposed: boolean; - - private dragHandler: DelayedDragHandler; - - constructor( - actionRunner: IActionRunner, - initialBodySize: number, - collapsed: boolean, - private viewName: string, - protected keybindingService: IKeybindingService, - protected contextMenuService: IContextMenuService - ) { - super({ - expandedBodySize: initialBodySize, - initialState: collapsed ? CollapsibleState.COLLAPSED : CollapsibleState.EXPANDED, - ariaHeaderLabel: viewName, - headerSize: 22, - }); - - this.actionRunner = actionRunner; - this.toDispose = []; - } - - protected changeState(state: CollapsibleState): void { - updateTreeVisibility(this.tree, state === CollapsibleState.EXPANDED); - - super.changeState(state); - } - - public create(): TPromise { - return TPromise.as(null); - } - - public renderHeader(container: HTMLElement): void { - - // Tool bar - this.toolBar = new ToolBar($('div.actions').appendTo(container).getHTMLElement(), this.contextMenuService, { - orientation: ActionsOrientation.HORIZONTAL, - actionItemProvider: (action) => this.getActionItem(action), - ariaLabel: nls.localize('viewToolbarAriaLabel', "{0} actions", this.viewName), - getKeyBinding: (action) => this.keybindingService.lookupKeybinding(action.id) - }); - this.toolBar.actionRunner = this.actionRunner; - this.updateActions(); - - // Expand on drag over - this.dragHandler = new DelayedDragHandler(container, () => { - if (!this.isExpanded()) { - this.expand(); - } - }); - } - - protected updateActions(): void { - this.toolBar.setActions(prepareActions(this.getActions()), prepareActions(this.getSecondaryActions()))(); - } - - protected renderViewTree(container: HTMLElement): HTMLElement { - return renderViewTree(container); - } - - public getViewer(): ITree { - return this.tree; - } - - public setVisible(visible: boolean): TPromise { - this.isVisible = visible; - - updateTreeVisibility(this.tree, visible && this.state === CollapsibleState.EXPANDED); - - return TPromise.as(null); - } - - public focusBody(): void { - focus(this.tree); - } - - protected reveal(element: any, relativeTop?: number): TPromise { - return reveal(this.tree, element, relativeTop); - } - - protected layoutBody(size: number): void { - this.treeContainer.style.height = size + 'px'; - this.tree.layout(size); - } - - public getActions(): IAction[] { - return []; - } - - public getSecondaryActions(): IAction[] { - return []; - } - - public getActionItem(action: IAction): IActionItem { - return null; - } - - public shutdown(): void { - // Subclass to implement - } - - public dispose(): void { - this.isDisposed = true; - this.treeContainer = null; - this.tree.dispose(); - - this.dragHandler.dispose(); - - this.toDispose = dispose(this.toDispose); - - if (this.toolBar) { - this.toolBar.dispose(); - } - - super.dispose(); - } -} - -export abstract class CollapsibleViewletView extends CollapsibleView implements IViewletView { - protected treeContainer: HTMLElement; - protected tree: ITree; - protected toDispose: IDisposable[]; - protected isVisible: boolean; - protected toolBar: ToolBar; - protected actionRunner: IActionRunner; - protected isDisposed: boolean; - - private dragHandler: DelayedDragHandler; - - constructor( - actionRunner: IActionRunner, - collapsed: boolean, - private viewName: string, - protected messageService: IMessageService, - protected keybindingService: IKeybindingService, - protected contextMenuService: IContextMenuService, - headerSize?: number, - minimumSize?: number - ) { - super({ - minimumSize: minimumSize === void 0 ? 5 * 22 : minimumSize, - initialState: collapsed ? CollapsibleState.COLLAPSED : CollapsibleState.EXPANDED, - ariaHeaderLabel: viewName, - headerSize - }); - - this.actionRunner = actionRunner; - this.toDispose = []; - } - - protected changeState(state: CollapsibleState): void { - updateTreeVisibility(this.tree, state === CollapsibleState.EXPANDED); - - super.changeState(state); - } - - public create(): TPromise { - return TPromise.as(null); - } - - public renderHeader(container: HTMLElement): void { - - // Tool bar - this.toolBar = new ToolBar($('div.actions').appendTo(container).getHTMLElement(), this.contextMenuService, { - orientation: ActionsOrientation.HORIZONTAL, - actionItemProvider: (action) => this.getActionItem(action), - ariaLabel: nls.localize('viewToolbarAriaLabel', "{0} actions", this.viewName), - getKeyBinding: (action) => this.keybindingService.lookupKeybinding(action.id) - }); - this.toolBar.actionRunner = this.actionRunner; - this.updateActions(); - - // Expand on drag over - this.dragHandler = new DelayedDragHandler(container, () => { - if (!this.isExpanded()) { - this.expand(); - } - }); - } - - protected updateActions(): void { - this.toolBar.setActions(prepareActions(this.getActions()), prepareActions(this.getSecondaryActions()))(); - } - - protected renderViewTree(container: HTMLElement): HTMLElement { - return renderViewTree(container); - } - - public getViewer(): ITree { - return this.tree; - } - - public setVisible(visible: boolean): TPromise { - this.isVisible = visible; - - updateTreeVisibility(this.tree, visible && this.state === CollapsibleState.EXPANDED); - - return TPromise.as(null); - } - - public focusBody(): void { - focus(this.tree); - } - - protected reveal(element: any, relativeTop?: number): TPromise { - return reveal(this.tree, element, relativeTop); - } - - public layoutBody(size: number): void { - this.treeContainer.style.height = size + 'px'; - this.tree.layout(size); - } - - public getActions(): IAction[] { - return []; - } - - public getSecondaryActions(): IAction[] { - return []; - } - - public getActionItem(action: IAction): IActionItem { - return null; - } - - public shutdown(): void { - // Subclass to implement - } - - public dispose(): void { - this.isDisposed = true; - this.treeContainer = null; - this.tree.dispose(); - - if (this.dragHandler) { - this.dragHandler.dispose(); - } - - this.toDispose = dispose(this.toDispose); - - if (this.toolBar) { - this.toolBar.dispose(); - } - - super.dispose(); - } -} - -function renderViewTree(container: HTMLElement): HTMLElement { - const treeContainer = document.createElement('div'); - container.appendChild(treeContainer); - - return treeContainer; -} - -function updateTreeVisibility(tree: ITree, isVisible: boolean): void { - if (!tree) { - return; - } - - if (isVisible) { - $(tree.getHTMLElement()).show(); - } else { - $(tree.getHTMLElement()).hide(); // make sure the tree goes out of the tabindex world by hiding it - } - - if (isVisible) { - tree.onVisible(); - } else { - tree.onHidden(); - } -} - -function focus(tree: ITree): void { - if (!tree) { - return; // return early if viewlet has not yet been created - } - - // Make sure the current selected element is revealed - const selection = tree.getSelection(); - if (selection.length > 0) { - reveal(tree, selection[0], 0.5).done(null, errors.onUnexpectedError); - } - - // Pass Focus to Viewer - tree.DOMFocus(); -} - -function reveal(tree: ITree, element: any, relativeTop?: number): TPromise { - if (!tree) { - return TPromise.as(null); // return early if viewlet has not yet been created - } - - return tree.reveal(element, relativeTop); } \ No newline at end of file diff --git a/src/vs/workbench/buildfile.js b/src/vs/workbench/buildfile.js index b4102009d69e50b2b9f7e236a786986fe551d760..4b83a39ab10203ccd155a168f78c35e75a6547a6 100644 --- a/src/vs/workbench/buildfile.js +++ b/src/vs/workbench/buildfile.js @@ -15,7 +15,7 @@ function createModuleDescription(name, exclude) { return result; } -exports.collectModules = function (excludes) { +exports.collectModules = function () { var modules = [ createModuleDescription('vs/workbench/parts/output/common/outputLinkComputer', ['vs/base/common/worker/simpleWorker', 'vs/editor/common/services/editorSimpleWorker']), @@ -24,6 +24,7 @@ exports.collectModules = function (excludes) { createModuleDescription('vs/workbench/services/search/node/searchApp', []), createModuleDescription('vs/workbench/services/search/node/worker/searchWorkerApp', []), createModuleDescription('vs/workbench/services/files/node/watcher/unix/watcherApp', []), + createModuleDescription('vs/workbench/services/files/node/watcher/nsfw/watcherApp', []), createModuleDescription('vs/workbench/node/extensionHostProcess', []), diff --git a/src/vs/workbench/common/actionRegistry.ts b/src/vs/workbench/common/actionRegistry.ts index 95669c4d86e3ba94f69b00d755e02b2c55a9f0ee..2f23215eb95e0c7fb90d79f109c637193f621d8a 100644 --- a/src/vs/workbench/common/actionRegistry.ts +++ b/src/vs/workbench/common/actionRegistry.ts @@ -6,7 +6,7 @@ import { TPromise } from 'vs/base/common/winjs.base'; import collections = require('vs/base/common/collections'); -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { IAction } from 'vs/base/common/actions'; import { KeybindingsRegistry, ICommandAndKeybindingRule } from 'vs/platform/keybinding/common/keybindingsRegistry'; import { IPartService } from 'vs/workbench/services/part/common/partService'; diff --git a/src/vs/workbench/common/component.ts b/src/vs/workbench/common/component.ts index 8a238f9868cac4d748359b87a58371022d723308..99cafcca30ccc898fbd539bb18e1e9e116364aa8 100644 --- a/src/vs/workbench/common/component.ts +++ b/src/vs/workbench/common/component.ts @@ -58,7 +58,7 @@ export class Component extends Themable implements IWorkbenchComponent { * Mementos are shared across components with the same id. This means that multiple components * with the same id will store data into the same data structure. */ - protected getMemento(storageService: IStorageService, scope: Scope = Scope.GLOBAL): any { + protected getMemento(storageService: IStorageService, scope: Scope = Scope.GLOBAL): object { return this.componentMemento.getMemento(storageService, scope); } diff --git a/src/vs/workbench/common/contributions.ts b/src/vs/workbench/common/contributions.ts index b1c6cdb41b706fef842be88e51016ee8cb732674..47841f217691e12ce800ddc4d81b8d0c8d9fc26c 100644 --- a/src/vs/workbench/common/contributions.ts +++ b/src/vs/workbench/common/contributions.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ 'use strict'; -import { Registry, BaseRegistry } from 'vs/platform/platform'; +import { Registry, BaseRegistry } from 'vs/platform/registry/common/platform'; import { IInstantiationService, IConstructorSignature0 } from 'vs/platform/instantiation/common/instantiation'; // --- Workbench Contribution Registry diff --git a/src/vs/workbench/common/editor.ts b/src/vs/workbench/common/editor.ts index 3767ac95928ffb9608638bccead1640be12b4d16..dfb127cc30aae1e2ceba7ffc4157574b752f76cd 100644 --- a/src/vs/workbench/common/editor.ts +++ b/src/vs/workbench/common/editor.ts @@ -10,12 +10,11 @@ import * as objects from 'vs/base/common/objects'; import types = require('vs/base/common/types'); import URI from 'vs/base/common/uri'; import { IDisposable, dispose, Disposable } from 'vs/base/common/lifecycle'; -import { IEditor, ICommonCodeEditor, IEditorViewState, IModel } from 'vs/editor/common/editorCommon'; +import { IEditor, IEditorViewState, IModel } from 'vs/editor/common/editorCommon'; import { IEditorInput, IEditorModel, IEditorOptions, ITextEditorOptions, IBaseResourceInput, Position, Verbosity } from 'vs/platform/editor/common/editor'; import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; import { IInstantiationService, IConstructorSignature0 } from 'vs/platform/instantiation/common/instantiation'; import { RawContextKey } from 'vs/platform/contextkey/common/contextkey'; -import * as editorOptions from 'vs/editor/common/config/editorOptions'; export const TextCompareEditorVisible = new RawContextKey('textCompareEditorVisible', false); @@ -586,7 +585,6 @@ export class TextEditorOptions extends EditorOptions { private revealInCenterIfOutsideViewport: boolean; private editorViewState: IEditorViewState; - private editorOptions: editorOptions.IEditorOptions; public static from(input: IBaseResourceInput): TextEditorOptions { let options: TextEditorOptions = null; @@ -629,7 +627,7 @@ export class TextEditorOptions extends EditorOptions { } if (input.options.viewState) { - options.editorViewState = input.options.viewState; + options.editorViewState = input.options.viewState as IEditorViewState; } if (typeof input.options.index === 'number') { @@ -691,17 +689,6 @@ export class TextEditorOptions extends EditorOptions { // View state options.editorViewState = editor.saveViewState(); - // Selected editor options - const codeEditor = editor; - if (typeof codeEditor.getConfiguration === 'function') { - const config = codeEditor.getConfiguration(); - if (config && config.viewInfo && config.wrappingInfo) { - options.editorOptions = Object.create(null); - options.editorOptions.renderWhitespace = config.viewInfo.renderWhitespace; - options.editorOptions.renderControlCharacters = config.viewInfo.renderControlCharacters; - options.editorOptions.wordWrap = config.wrappingInfo.isViewportWrapping ? 'on' : 'off'; - } - } return options; } @@ -712,11 +699,6 @@ export class TextEditorOptions extends EditorOptions { */ public apply(editor: IEditor): boolean { - // Editor options - if (this.editorOptions) { - editor.updateOptions(this.editorOptions); - } - // View state return this.applyViewState(editor); } diff --git a/src/vs/workbench/common/editor/diffEditorInput.ts b/src/vs/workbench/common/editor/diffEditorInput.ts index df3376af9212757bbc2cf72f133a3b0e5c5f8748..6d7b5cbfdaea5d9adb2869b4a3060b2a1b3b72ef 100644 --- a/src/vs/workbench/common/editor/diffEditorInput.ts +++ b/src/vs/workbench/common/editor/diffEditorInput.ts @@ -70,7 +70,7 @@ export class DiffEditorInput extends SideBySideEditorInput { private createModel(refresh?: boolean): TPromise { // Join resolve call over two inputs and build diff editor model - return TPromise.join([ + return TPromise.join([ this.originalInput.resolve(refresh), this.modifiedInput.resolve(refresh) ]).then((models) => { diff --git a/src/vs/workbench/common/editor/diffEditorModel.ts b/src/vs/workbench/common/editor/diffEditorModel.ts index e12b560ef53bd438ef1b4ed9ae187dbe943216c7..fc13842aa182ee80db2ac2bf7170257143e4a198 100644 --- a/src/vs/workbench/common/editor/diffEditorModel.ts +++ b/src/vs/workbench/common/editor/diffEditorModel.ts @@ -6,16 +6,17 @@ import { TPromise } from 'vs/base/common/winjs.base'; import { EditorModel } from 'vs/workbench/common/editor'; +import { IEditorModel } from "vs/platform/editor/common/editor"; /** * The base editor model for the diff editor. It is made up of two editor models, the original version * and the modified version. */ export class DiffEditorModel extends EditorModel { - protected _originalModel: EditorModel; - protected _modifiedModel: EditorModel; + protected _originalModel: IEditorModel; + protected _modifiedModel: IEditorModel; - constructor(originalModel: EditorModel, modifiedModel: EditorModel) { + constructor(originalModel: IEditorModel, modifiedModel: IEditorModel) { super(); this._originalModel = originalModel; @@ -23,15 +24,15 @@ export class DiffEditorModel extends EditorModel { } public get originalModel(): EditorModel { - return this._originalModel; + return this._originalModel as EditorModel; } public get modifiedModel(): EditorModel { - return this._modifiedModel; + return this._modifiedModel as EditorModel; } public load(): TPromise { - return TPromise.join([ + return TPromise.join([ this._originalModel.load(), this._modifiedModel.load() ]).then(() => { @@ -40,7 +41,7 @@ export class DiffEditorModel extends EditorModel { } public isResolved(): boolean { - return this._originalModel.isResolved() && this._modifiedModel.isResolved(); + return this.originalModel.isResolved() && this.modifiedModel.isResolved(); } public dispose(): void { diff --git a/src/vs/workbench/common/editor/editorStacksModel.ts b/src/vs/workbench/common/editor/editorStacksModel.ts index c61412c99f80895d3d8d1e0a3b528de6b6067a4f..2191d20535c2f6d97d51bd4529f5d6e446f0e10b 100644 --- a/src/vs/workbench/common/editor/editorStacksModel.ts +++ b/src/vs/workbench/common/editor/editorStacksModel.ts @@ -13,7 +13,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { ILifecycleService } from 'vs/platform/lifecycle/common/lifecycle'; import { dispose, IDisposable } from 'vs/base/common/lifecycle'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { Position, Direction } from 'vs/platform/editor/common/editor'; import { ResourceMap } from 'vs/base/common/map'; @@ -110,7 +110,7 @@ export class EditorGroup implements IEditorGroup { } private registerListeners(): void { - this.toDispose.push(this.configurationService.onDidUpdateConfiguration(e => this.onConfigurationUpdated(e.config))); + this.toDispose.push(this.configurationService.onDidUpdateConfiguration(e => this.onConfigurationUpdated(this.configurationService.getConfiguration()))); } private onConfigurationUpdated(config: IWorkbenchEditorConfiguration): void { @@ -277,8 +277,7 @@ export class EditorGroup implements IEditorGroup { targetIndex--; // accomodate for the fact that the preview editor closes } - this.closeEditor(this.preview, !makeActive); // optimization to prevent multiple setActive() in one call - this.splice(targetIndex, false, editor); + this.replaceEditor(this.preview, editor, targetIndex, !makeActive); } this.preview = editor; @@ -345,10 +344,31 @@ export class EditorGroup implements IEditorGroup { })); } + public replaceEditor(toReplace: EditorInput, replaceWidth: EditorInput, replaceIndex: number, openNext = true): void { + const event = this.doCloseEditor(toReplace, openNext); // optimization to prevent multiple setActive() in one call + + // We want to first add the new editor into our model before emitting the close event because + // firing the close event can trigger a dispose on the same editor that is now being added. + // This can lead into opening a disposed editor which is not what we want. + this.splice(replaceIndex, false, replaceWidth); + + if (event) { + this.fireEvent(this._onEditorClosed, event, true); + } + } + public closeEditor(editor: EditorInput, openNext = true): void { + const event = this.doCloseEditor(editor, openNext); + + if (event) { + this.fireEvent(this._onEditorClosed, event, true); + } + } + + private doCloseEditor(editor: EditorInput, openNext = true): EditorCloseEvent { const index = this.indexOf(editor); if (index === -1) { - return; // not found + return null; // not found } // Active Editor closed @@ -376,7 +396,7 @@ export class EditorGroup implements IEditorGroup { this.splice(index, true); // Event - this.fireEvent(this._onEditorClosed, { editor, pinned, index, group: this }, true); + return { editor, pinned, index, group: this }; } public closeEditors(except: EditorInput, direction?: Direction): void { @@ -1064,7 +1084,11 @@ export class EditorStacksModel implements IEditorStacksModel { private save(): void { const serialized = this.serialize(); - this.storageService.store(EditorStacksModel.STORAGE_KEY, JSON.stringify(serialized), StorageScope.WORKSPACE); + if (serialized.groups.length) { + this.storageService.store(EditorStacksModel.STORAGE_KEY, JSON.stringify(serialized), StorageScope.WORKSPACE); + } else { + this.storageService.remove(EditorStacksModel.STORAGE_KEY, StorageScope.WORKSPACE); + } } private serialize(): ISerializedEditorStacksModel { diff --git a/src/vs/workbench/common/editor/rangeDecorations.ts b/src/vs/workbench/common/editor/rangeDecorations.ts index 7c8678ab24cc391c7a3ce548b03089570dbc5645..730062404f4d88d0e77892725cf8446ff8a19883 100644 --- a/src/vs/workbench/common/editor/rangeDecorations.ts +++ b/src/vs/workbench/common/editor/rangeDecorations.ts @@ -9,10 +9,10 @@ import Event, { Emitter } from 'vs/base/common/event'; import * as editorCommon from 'vs/editor/common/editorCommon'; import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; import { toResource } from 'vs/workbench/common/editor'; -import { isEqual } from 'vs/platform/files/common/files'; +import { isEqual } from 'vs/base/common/paths'; import { IRange } from 'vs/editor/common/core/range'; import { CursorChangeReason, ICursorPositionChangedEvent } from 'vs/editor/common/controller/cursorEvents'; -import { ModelDecorationOptions } from "vs/editor/common/model/textModelWithDecorations"; +import { ModelDecorationOptions } from 'vs/editor/common/model/textModelWithDecorations'; export interface IRangeHighlightDecoration { resource: URI; diff --git a/src/vs/workbench/common/editor/resourceEditorInput.ts b/src/vs/workbench/common/editor/resourceEditorInput.ts index b99b12ecd05e90263b5570fd8cf51fddf74b9db6..0f41e0edc5c776cae8f316d8ddbeadcaa34a974c 100644 --- a/src/vs/workbench/common/editor/resourceEditorInput.ts +++ b/src/vs/workbench/common/editor/resourceEditorInput.ts @@ -9,7 +9,7 @@ import { EditorInput, ITextEditorModel } from 'vs/workbench/common/editor'; import URI from 'vs/base/common/uri'; import { IReference } from 'vs/base/common/lifecycle'; import { telemetryURIDescriptor } from 'vs/platform/telemetry/common/telemetryUtils'; -import { ITextModelResolverService } from 'vs/editor/common/services/resolverService'; +import { ITextModelService } from 'vs/editor/common/services/resolverService'; import { ResourceEditorModel } from 'vs/workbench/common/editor/resourceEditorModel'; /** @@ -29,7 +29,7 @@ export class ResourceEditorInput extends EditorInput { name: string, description: string, resource: URI, - @ITextModelResolverService private textModelResolverService: ITextModelResolverService + @ITextModelService private textModelResolverService: ITextModelService ) { super(); diff --git a/src/vs/workbench/common/editor/untitledEditorInput.ts b/src/vs/workbench/common/editor/untitledEditorInput.ts index 753220ec1baf4d905bec64ac65dd43453f008ce7..081b9bd7df4196ed7681aeddea2d10f662035c2b 100644 --- a/src/vs/workbench/common/editor/untitledEditorInput.ts +++ b/src/vs/workbench/common/editor/untitledEditorInput.ts @@ -26,12 +26,8 @@ import { IEnvironmentService } from 'vs/platform/environment/common/environment' export class UntitledEditorInput extends EditorInput implements IEncodingSupport { public static ID: string = 'workbench.editors.untitledEditorInput'; - public static SCHEMA: string = 'untitled'; - private resource: URI; private _hasAssociatedFilePath: boolean; - private initialValue: string; - private modeId: string; private cachedModel: UntitledEditorModel; private modelResolve: TPromise; @@ -41,10 +37,11 @@ export class UntitledEditorInput extends EditorInput implements IEncodingSupport private toUnbind: IDisposable[]; constructor( - resource: URI, + private resource: URI, hasAssociatedFilePath: boolean, - modeId: string, - initialValue: string, + private modeId: string, + private initialValue: string, + private preferredEncoding: string, @IInstantiationService private instantiationService: IInstantiationService, @IWorkspaceContextService private contextService: IWorkspaceContextService, @ITextFileService private textFileService: ITextFileService, @@ -52,11 +49,9 @@ export class UntitledEditorInput extends EditorInput implements IEncodingSupport ) { super(); - this.resource = resource; - this.initialValue = initialValue; this._hasAssociatedFilePath = hasAssociatedFilePath; - this.modeId = modeId; this.toUnbind = []; + this._onDidModelChangeContent = new Emitter(); this._onDidModelChangeEncoding = new Emitter(); } @@ -147,16 +142,18 @@ export class UntitledEditorInput extends EditorInput implements IEncodingSupport return this.cachedModel.getEncoding(); } - return null; + return this.preferredEncoding; } public setEncoding(encoding: string, mode: EncodingMode /* ignored, we only have Encode */): void { + this.preferredEncoding = encoding; + if (this.cachedModel) { this.cachedModel.setEncoding(encoding); } } - public resolve(refresh?: boolean): TPromise { + public resolve(): TPromise { // Join a model resolve if we have had one before if (this.modelResolve) { @@ -171,7 +168,7 @@ export class UntitledEditorInput extends EditorInput implements IEncodingSupport } private createModel(): UntitledEditorModel { - const model = this.instantiationService.createInstance(UntitledEditorModel, this.modeId, this.resource, this.hasAssociatedFilePath, this.initialValue); + const model = this.instantiationService.createInstance(UntitledEditorModel, this.modeId, this.resource, this.hasAssociatedFilePath, this.initialValue, this.preferredEncoding); // re-emit some events from the model this.toUnbind.push(model.onDidChangeContent(() => this._onDidModelChangeContent.fire())); diff --git a/src/vs/workbench/common/editor/untitledEditorModel.ts b/src/vs/workbench/common/editor/untitledEditorModel.ts index bd0bb5300b1b064f9a01aa2daa5f41f136d6f53f..89903fd66b76f4f18d6bd99b0a26bd4c5dec765c 100644 --- a/src/vs/workbench/common/editor/untitledEditorModel.ts +++ b/src/vs/workbench/common/editor/untitledEditorModel.ts @@ -6,7 +6,7 @@ import { IDisposable } from 'vs/base/common/lifecycle'; import { TPromise } from 'vs/base/common/winjs.base'; -import { EditorModel, IEncodingSupport } from 'vs/workbench/common/editor'; +import { IEncodingSupport } from 'vs/workbench/common/editor'; import { BaseTextEditorModel } from 'vs/workbench/common/editor/textEditorModel'; import URI from 'vs/base/common/uri'; import { PLAINTEXT_MODE_ID } from 'vs/editor/common/modes/modesRegistry'; @@ -38,16 +38,13 @@ export class UntitledEditorModel extends BaseTextEditorModel implements IEncodin private contentChangeEventScheduler: RunOnceScheduler; private configuredEncoding: string; - private preferredEncoding: string; - - private hasAssociatedFilePath: boolean; - private initialValue: string; constructor( private modeId: string, private resource: URI, - hasAssociatedFilePath: boolean, - initialValue: string, + private hasAssociatedFilePath: boolean, + private initialValue: string, + private preferredEncoding: string, @IModeService modeService: IModeService, @IModelService modelService: IModelService, @IBackupFileService private backupFileService: IBackupFileService, @@ -56,8 +53,6 @@ export class UntitledEditorModel extends BaseTextEditorModel implements IEncodin ) { super(modelService, modeService); - this.hasAssociatedFilePath = hasAssociatedFilePath; - this.initialValue = initialValue; this.dirty = false; this.versionId = 0; @@ -93,7 +88,7 @@ export class UntitledEditorModel extends BaseTextEditorModel implements IEncodin private registerListeners(): void { // Config Changes - this.configurationChangeListener = this.configurationService.onDidUpdateConfiguration(e => this.onConfigurationChange(e.config)); + this.configurationChangeListener = this.configurationService.onDidUpdateConfiguration(e => this.onConfigurationChange(this.configurationService.getConfiguration())); } private onConfigurationChange(configuration: IFilesConfiguration): void { @@ -158,7 +153,7 @@ export class UntitledEditorModel extends BaseTextEditorModel implements IEncodin this.contentChangeEventScheduler.schedule(); } - public load(): TPromise { + public load(): TPromise { // Check for backups first return this.backupFileService.loadBackupResource(this.resource).then(backupResource => { @@ -188,11 +183,11 @@ export class UntitledEditorModel extends BaseTextEditorModel implements IEncodin }); } - private doLoad(content: string): TPromise { + private doLoad(content: string): TPromise { // Create text editor model if not yet done if (!this.textEditorModel) { - return this.createTextEditorModel(content, this.resource, this.modeId); + return this.createTextEditorModel(content, this.resource, this.modeId).then(model => this); } // Otherwise update @@ -200,7 +195,7 @@ export class UntitledEditorModel extends BaseTextEditorModel implements IEncodin this.updateTextEditorModel(content); } - return TPromise.as(this); + return TPromise.as(this); } private onModelContentChanged(): void { diff --git a/src/vs/workbench/common/memento.ts b/src/vs/workbench/common/memento.ts index 78881e90d875198c9fb26c00d8ec22e87546c5a9..eff56087e986be4fd61cb335e680f8b5a3aa81fa 100644 --- a/src/vs/workbench/common/memento.ts +++ b/src/vs/workbench/common/memento.ts @@ -46,7 +46,7 @@ export class Memento { * provided, the scope will be global, Memento.Scope.WORKSPACE can be used to * scope the memento to the workspace. */ - public getMemento(storageService: IStorageService, scope: Scope = Scope.GLOBAL): any { + public getMemento(storageService: IStorageService, scope: Scope = Scope.GLOBAL): object { // Scope by Workspace if (scope === Scope.WORKSPACE) { @@ -89,7 +89,7 @@ export class Memento { class ScopedMemento { private id: string; - private mementoObj: any; + private mementoObj: object; private scope: Scope; constructor(id: string, scope: Scope, private storageService: IStorageService) { @@ -98,11 +98,11 @@ class ScopedMemento { this.mementoObj = this.loadMemento(); } - public getMemento(): any { + public getMemento(): object { return this.mementoObj; } - private loadMemento(): any { + private loadMemento(): object { let storageScope = this.scope === Scope.GLOBAL ? StorageScope.GLOBAL : StorageScope.WORKSPACE; let memento = this.storageService.get(this.id, storageScope); if (memento) { diff --git a/src/vs/workbench/common/theme.ts b/src/vs/workbench/common/theme.ts index ae51ff8ef6dace27744c623984949a38717222b0..65746b39738e1d42beb3002f0e85401f57dd7788 100644 --- a/src/vs/workbench/common/theme.ts +++ b/src/vs/workbench/common/theme.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import nls = require('vs/nls'); -import { registerColor, editorBackground, contrastBorder, transparent, badgeForeground, badgeBackground } from 'vs/platform/theme/common/colorRegistry'; +import { registerColor, editorBackground, contrastBorder, transparent, lighten, darken } from 'vs/platform/theme/common/colorRegistry'; import { IDisposable, Disposable, dispose } from 'vs/base/common/lifecycle'; import { IThemeService, ITheme } from 'vs/platform/theme/common/themeService'; import { Color } from 'vs/base/common/color'; @@ -33,13 +33,25 @@ export const TAB_ACTIVE_FOREGROUND = registerColor('tab.activeForeground', { dark: Color.white, light: '#333333', hc: Color.white -}, nls.localize('tabActiveEditorGroupActiveForeground', "Active tab foreground color in an active group. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups.")); +}, nls.localize('tabActiveForeground', "Active tab foreground color in an active group. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups.")); export const TAB_INACTIVE_FOREGROUND = registerColor('tab.inactiveForeground', { dark: transparent(TAB_ACTIVE_FOREGROUND, 0.5), light: transparent(TAB_ACTIVE_FOREGROUND, 0.5), hc: Color.white -}, nls.localize('tabInactiveEditorGroupActiveForeground', "Inactive tab foreground color in an active group. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups.")); +}, nls.localize('tabInactiveForeground', "Inactive tab foreground color in an active group. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups.")); + +export const TAB_UNFOCUSED_ACTIVE_FOREGROUND = registerColor('tab.unfocusedActiveForeground', { + dark: transparent(TAB_ACTIVE_FOREGROUND, 0.5), + light: transparent(TAB_ACTIVE_FOREGROUND, 0.7), + hc: Color.white +}, nls.localize('tabUnfocusedActiveForeground', "Active tab foreground color in an inactive group. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups.")); + +export const TAB_UNFOCUSED_INACTIVE_FOREGROUND = registerColor('tab.unfocusedInactiveForeground', { + dark: transparent(TAB_INACTIVE_FOREGROUND, 0.5), + light: transparent(TAB_INACTIVE_FOREGROUND, 0.5), + hc: Color.white +}, nls.localize('tabUnfocusedInactiveForeground', "Inactive tab foreground color in an inactive group. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups.")); // < --- Editors --- > @@ -201,15 +213,15 @@ export const ACTIVITY_BAR_DRAG_AND_DROP_BACKGROUND = registerColor('activityBar. }, nls.localize('activityBarDragAndDropBackground', "Drag and drop feedback color for the activity bar items. The color should have transparency so that the activity bar entries can still shine through. The activity bar is showing on the far left or right and allows to switch between views of the side bar.")); export const ACTIVITY_BAR_BADGE_BACKGROUND = registerColor('activityBarBadge.background', { - dark: badgeBackground, - light: badgeBackground, - hc: badgeBackground + dark: '#007ACC', + light: '#007ACC', + hc: '#000000' }, nls.localize('activityBarBadgeBackground', "Activity notification badge background color. The activity bar is showing on the far left or right and allows to switch between views of the side bar.")); export const ACTIVITY_BAR_BADGE_FOREGROUND = registerColor('activityBarBadge.foreground', { - dark: badgeForeground, - light: badgeForeground, - hc: badgeForeground + dark: Color.white, + light: Color.white, + hc: Color.white }, nls.localize('activityBarBadgeForeground', "Activity notification badge foreground color. The activity bar is showing on the far left or right and allows to switch between views of the side bar.")); @@ -294,6 +306,60 @@ export const NOTIFICATIONS_BACKGROUND = registerColor('notification.background', hc: '#000000' }, nls.localize('notificationsBackground', "Notifications background color. Notifications slide in from the top of the window.")); +export const NOTIFICATIONS_BUTTON_BACKGROUND = registerColor('notification.buttonBackground', { + dark: '#0E639C', + light: '#007ACC', + hc: null +}, nls.localize('notificationsButtonBackground', "Notifications button background color. Notifications slide in from the top of the window.")); + +export const NOTIFICATIONS_BUTTON_HOVER_BACKGROUND = registerColor('notification.buttonHoverBackground', { + dark: lighten(NOTIFICATIONS_BUTTON_BACKGROUND, 0.2), + light: darken(NOTIFICATIONS_BUTTON_BACKGROUND, 0.2), + hc: null +}, nls.localize('notificationsButtonHoverBackground', "Notifications button background color when hovering. Notifications slide in from the top of the window.")); + +export const NOTIFICATIONS_BUTTON_FOREGROUND = registerColor('notification.buttonForeground', { + dark: Color.white, + light: Color.white, + hc: Color.white +}, nls.localize('notificationsButtonForeground', "Notifications button foreground color. Notifications slide in from the top of the window.")); + +export const NOTIFICATIONS_INFO_BACKGROUND = registerColor('notification.infoBackground', { + dark: '#007acc', + light: '#007acc', + hc: contrastBorder +}, nls.localize('notificationsInfoBackground', "Notifications info background color. Notifications slide in from the top of the window.")); + +export const NOTIFICATIONS_INFO_FOREGROUND = registerColor('notification.infoForeground', { + dark: NOTIFICATIONS_FOREGROUND, + light: NOTIFICATIONS_FOREGROUND, + hc: null +}, nls.localize('notificationsInfoForeground', "Notifications info foreground color. Notifications slide in from the top of the window.")); + +export const NOTIFICATIONS_WARNING_BACKGROUND = registerColor('notification.warningBackground', { + dark: '#B89500', + light: '#B89500', + hc: contrastBorder +}, nls.localize('notificationsWarningBackground', "Notifications warning background color. Notifications slide in from the top of the window.")); + +export const NOTIFICATIONS_WARNING_FOREGROUND = registerColor('notification.warningForeground', { + dark: NOTIFICATIONS_FOREGROUND, + light: NOTIFICATIONS_FOREGROUND, + hc: null +}, nls.localize('notificationsWarningForeground', "Notifications warning foreground color. Notifications slide in from the top of the window.")); + +export const NOTIFICATIONS_ERROR_BACKGROUND = registerColor('notification.errorBackground', { + dark: '#BE1100', + light: '#BE1100', + hc: contrastBorder +}, nls.localize('notificationsErrorBackground', "Notifications error background color. Notifications slide in from the top of the window.")); + +export const NOTIFICATIONS_ERROR_FOREGROUND = registerColor('notification.errorForeground', { + dark: NOTIFICATIONS_FOREGROUND, + light: NOTIFICATIONS_FOREGROUND, + hc: null +}, nls.localize('notificationsErrorForeground', "Notifications error foreground color. Notifications slide in from the top of the window.")); + /** * Base class for all themable workbench components. */ diff --git a/src/vs/workbench/electron-browser/actions.ts b/src/vs/workbench/electron-browser/actions.ts index 98e0d84f20c1cc4ef869bc917a84969b2fe98cd7..745fdf2d2c42f2798a32e44e140dd9f4b40674fc 100644 --- a/src/vs/workbench/electron-browser/actions.ts +++ b/src/vs/workbench/electron-browser/actions.ts @@ -6,6 +6,7 @@ 'use strict'; import URI from 'vs/base/common/uri'; +import * as collections from 'vs/base/common/collections'; import { TPromise } from 'vs/base/common/winjs.base'; import { Action } from 'vs/base/common/actions'; import { IWindowIPCService } from 'vs/workbench/services/window/electron-browser/windowService'; @@ -34,9 +35,12 @@ import { IEditorGroupService } from 'vs/workbench/services/group/common/groupSer import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; import { IPartService, Parts, Position as SidebarPosition } from 'vs/workbench/services/part/common/partService'; import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; - +import { IKeybindingService } from "vs/platform/keybinding/common/keybinding"; import * as os from 'os'; import { webFrame } from 'electron'; +import { getPathLabel } from "vs/base/common/labels"; +import { IViewlet } from "vs/workbench/common/viewlet"; +import { IPanel } from "vs/workbench/common/panel"; // --- actions @@ -53,13 +57,13 @@ export class CloseEditorAction extends Action { super(id, label); } - public run(): TPromise { + public run(): TPromise { const activeEditor = this.editorService.getActiveEditor(); if (activeEditor) { return this.editorService.closeEditor(activeEditor.position, activeEditor.input); } - return TPromise.as(false); + return TPromise.as(null); } } @@ -79,37 +83,6 @@ export class CloseWindowAction extends Action { } } -export class SwitchWindow extends Action { - - static ID = 'workbench.action.switchWindow'; - static LABEL = nls.localize('switchWindow', "Switch Window"); - - constructor( - id: string, - label: string, - @IWindowsService private windowsService: IWindowsService, - @IWindowService private windowService: IWindowService, - @IQuickOpenService private quickOpenService: IQuickOpenService - ) { - super(id, label); - } - - run(): TPromise { - const currentWindowId = this.windowService.getCurrentWindowId(); - - return this.windowsService.getWindows().then(workspaces => { - const placeHolder = nls.localize('switchWindowPlaceHolder', "Select a window"); - const picks = workspaces.map(w => ({ - label: w.title, - description: (currentWindowId === w.id) ? nls.localize('current', "Current Window") : void 0, - run: () => this.windowsService.showWindow(w.id) - })); - - this.quickOpenService.pick(picks, { placeHolder }); - }); - } -} - export class CloseFolderAction extends Action { static ID = 'workbench.action.closeFolder'; @@ -184,7 +157,7 @@ export class ToggleMenuBarAction extends Action { super(id, label); } - public run(): TPromise { + public run(): TPromise { let currentVisibilityValue = this.configurationService.lookup(ToggleMenuBarAction.menuBarVisibilityKey).value; if (typeof currentVisibilityValue !== 'string') { currentVisibilityValue = 'default'; @@ -584,36 +557,132 @@ export class ReloadWindowAction extends Action { } } -export class OpenRecentAction extends Action { +export abstract class BaseSwitchWindow extends Action { - public static ID = 'workbench.action.openRecent'; - public static LABEL = nls.localize('openRecent', "Open Recent"); + constructor( + id: string, + label: string, + private windowsService: IWindowsService, + private windowService: IWindowService, + private quickOpenService: IQuickOpenService, + private keybindingService: IKeybindingService + ) { + super(id, label); + } + + protected abstract isQuickNavigate(): boolean; + + public run(): TPromise { + const currentWindowId = this.windowService.getCurrentWindowId(); + + return this.windowsService.getWindows().then(workspaces => { + const placeHolder = nls.localize('switchWindowPlaceHolder', "Select a window to switch to"); + const picks = workspaces.map(win => ({ + resource: win.filename ? URI.file(win.filename) : win.path, + isFolder: !win.filename && !!win.path, + label: win.title, + description: (currentWindowId === win.id) ? nls.localize('current', "Current Window") : void 0, + run: () => { + setTimeout(() => { + // Bug: somehow when not running this code in a timeout, it is not possible to use this picker + // with quick navigate keys (not able to trigger quick navigate once running it once). + this.windowsService.showWindow(win.id).done(null, errors.onUnexpectedError); + }); + } + } as IFilePickOpenEntry)); + + this.quickOpenService.pick(picks, { + contextKey: 'inWindowsPicker', + autoFocus: { autoFocusFirstEntry: true }, + placeHolder, + quickNavigateConfiguration: this.isQuickNavigate() ? { keybindings: this.keybindingService.lookupKeybindings(this.id) } : void 0 + }); + }); + } +} + +export class SwitchWindow extends BaseSwitchWindow { + + static ID = 'workbench.action.switchWindow'; + static LABEL = nls.localize('switchWindow', "Switch Window..."); constructor( id: string, label: string, - @IWindowsService private windowsService: IWindowsService, - @IWindowService private windowService: IWindowService, - @IQuickOpenService private quickOpenService: IQuickOpenService, - @IWorkspaceContextService private contextService: IWorkspaceContextService + @IWindowsService windowsService: IWindowsService, + @IWindowService windowService: IWindowService, + @IQuickOpenService quickOpenService: IQuickOpenService, + @IKeybindingService keybindingService: IKeybindingService + ) { + super(id, label, windowsService, windowService, quickOpenService, keybindingService); + } + + protected isQuickNavigate(): boolean { + return false; + } +} + +export class QuickSwitchWindow extends BaseSwitchWindow { + + static ID = 'workbench.action.quickSwitchWindow'; + static LABEL = nls.localize('quickSwitchWindow', "Quick Switch Window..."); + + constructor( + id: string, + label: string, + @IWindowsService windowsService: IWindowsService, + @IWindowService windowService: IWindowService, + @IQuickOpenService quickOpenService: IQuickOpenService, + @IKeybindingService keybindingService: IKeybindingService + ) { + super(id, label, windowsService, windowService, quickOpenService, keybindingService); + } + + protected isQuickNavigate(): boolean { + return true; + } +} + +export const inRecentFilesPickerContextKey = 'inRecentFilesPicker'; + +export abstract class BaseOpenRecentAction extends Action { + + constructor( + id: string, + label: string, + private windowsService: IWindowsService, + private windowService: IWindowService, + private quickOpenService: IQuickOpenService, + private contextService: IWorkspaceContextService, + private environmentService: IEnvironmentService, + private keybindingService: IKeybindingService ) { super(id, label); } + protected abstract isQuickNavigate(): boolean; + public run(): TPromise { return this.windowService.getRecentlyOpen() .then(({ files, folders }) => this.openRecent(files, folders)); } private openRecent(recentFiles: string[], recentFolders: string[]): void { - function toPick(path: string, separator: ISeparator, isFolder: boolean): IFilePickOpenEntry { + + function toPick(path: string, separator: ISeparator, isFolder: boolean, environmentService: IEnvironmentService): IFilePickOpenEntry { return { resource: URI.file(path), isFolder, label: paths.basename(path), - description: paths.dirname(path), + description: getPathLabel(paths.dirname(path), null, environmentService), separator, - run: context => runPick(path, context) + run: context => { + setTimeout(() => { + // Bug: somehow when not running this code in a timeout, it is not possible to use this picker + // with quick navigate keys (not able to trigger quick navigate once running it once). + runPick(path, context); + }); + } }; } @@ -622,19 +691,67 @@ export class OpenRecentAction extends Action { this.windowsService.openWindow([path], { forceNewWindow }); }; - const folderPicks: IFilePickOpenEntry[] = recentFolders.map((p, index) => toPick(p, index === 0 ? { label: nls.localize('folders', "folders") } : void 0, true)); - const filePicks: IFilePickOpenEntry[] = recentFiles.map((p, index) => toPick(p, index === 0 ? { label: nls.localize('files', "files"), border: true } : void 0, false)); + const folderPicks: IFilePickOpenEntry[] = recentFolders.map((p, index) => toPick(p, index === 0 ? { label: nls.localize('folders', "folders") } : void 0, true, this.environmentService)); + const filePicks: IFilePickOpenEntry[] = recentFiles.map((p, index) => toPick(p, index === 0 ? { label: nls.localize('files', "files"), border: true } : void 0, false, this.environmentService)); const hasWorkspace = this.contextService.hasWorkspace(); this.quickOpenService.pick(folderPicks.concat(...filePicks), { + contextKey: inRecentFilesPickerContextKey, autoFocus: { autoFocusFirstEntry: !hasWorkspace, autoFocusSecondEntry: hasWorkspace }, placeHolder: isMacintosh ? nls.localize('openRecentPlaceHolderMac', "Select a path (hold Cmd-key to open in new window)") : nls.localize('openRecentPlaceHolder', "Select a path to open (hold Ctrl-key to open in new window)"), - matchOnDescription: true + matchOnDescription: true, + quickNavigateConfiguration: this.isQuickNavigate() ? { keybindings: this.keybindingService.lookupKeybindings(this.id) } : void 0 }).done(null, errors.onUnexpectedError); } } +export class OpenRecentAction extends BaseOpenRecentAction { + + public static ID = 'workbench.action.openRecent'; + public static LABEL = nls.localize('openRecent', "Open Recent..."); + + constructor( + id: string, + label: string, + @IWindowsService windowsService: IWindowsService, + @IWindowService windowService: IWindowService, + @IQuickOpenService quickOpenService: IQuickOpenService, + @IWorkspaceContextService contextService: IWorkspaceContextService, + @IEnvironmentService environmentService: IEnvironmentService, + @IKeybindingService keybindingService: IKeybindingService + ) { + super(id, label, windowsService, windowService, quickOpenService, contextService, environmentService, keybindingService); + } + + protected isQuickNavigate(): boolean { + return false; + } +} + +export class QuickOpenRecentAction extends BaseOpenRecentAction { + + public static ID = 'workbench.action.quickOpenRecent'; + public static LABEL = nls.localize('quickOpenRecent', "Quick Open Recent..."); + + constructor( + id: string, + label: string, + @IWindowsService windowsService: IWindowsService, + @IWindowService windowService: IWindowService, + @IQuickOpenService quickOpenService: IQuickOpenService, + @IWorkspaceContextService contextService: IWorkspaceContextService, + @IEnvironmentService environmentService: IEnvironmentService, + @IKeybindingService keybindingService: IKeybindingService + ) { + super(id, label, windowsService, windowService, quickOpenService, contextService, environmentService, keybindingService); + } + + protected isQuickNavigate(): boolean { + return true; + } +} + export class CloseMessagesAction extends Action { public static ID = 'workbench.action.closeMessages'; @@ -721,21 +838,33 @@ Steps to Reproduce: } private generateExtensionTable(extensions: ILocalExtension[]): string { + const { nonThemes, themes } = collections.groupBy(extensions, ext => { + const manifestKeys = ext.manifest.contributes ? Object.keys(ext.manifest.contributes) : []; + const onlyTheme = !ext.manifest.activationEvents && manifestKeys.length === 1 && manifestKeys[0] === 'themes'; + return onlyTheme ? 'themes' : 'nonThemes'; + }); + + const themeExclusionStr = (themes && themes.length) ? `\n(${themes.length} theme extensions excluded)` : ''; + extensions = nonThemes || []; + if (!extensions.length) { - return 'none'; + return 'none' + themeExclusionStr; } - let tableHeader = `|Extension|Author|Version| -|---|---|---|`; + let tableHeader = `Extension|Author (truncated)|Version +---|---|---`; const table = extensions.map(e => { - return `|${e.manifest.name}|${e.manifest.publisher}|${e.manifest.version}|`; + return `${e.manifest.name}|${e.manifest.publisher.substr(0, 3)}|${e.manifest.version}`; }).join('\n'); const extensionTable = ` -${tableHeader}\n${table}; +${tableHeader} +${table} +${themeExclusionStr} `; + // 2000 chars is browsers de-facto limit for URLs, 400 chars are allowed for other string parts of the issue URL // http://stackoverflow.com/questions/417142/what-is-the-maximum-length-of-a-url-in-different-browsers if (encodeURIComponent(extensionTable).length > 1600) { @@ -929,6 +1058,27 @@ export class OpenIntroductoryVideosUrlAction extends Action { } } +export class OpenTipsAndTricksUrlAction extends Action { + + public static ID = 'workbench.action.openTipsAndTricksUrl'; + public static LABEL = nls.localize('openTipsAndTricksUrl', "Tips and Tricks"); + + private static URL = product.tipsAndTricksUrl; + public static AVAILABLE = !!OpenTipsAndTricksUrlAction.URL; + + constructor( + id: string, + label: string + ) { + super(id, label); + } + + public run(): TPromise { + window.open(OpenTipsAndTricksUrlAction.URL); + return null; + } +} + export class ToggleSharedProcessAction extends Action { static ID = 'workbench.action.toggleSharedProcess'; @@ -984,37 +1134,39 @@ export abstract class BaseNavigationAction extends Action { return TPromise.as(false); } - protected navigateOnEditorFocus(isEditorGroupVertical: boolean, isSidebarPositionLeft: boolean): TPromise { + protected navigateOnEditorFocus(isEditorGroupVertical: boolean, isSidebarPositionLeft: boolean): TPromise { return TPromise.as(true); } - protected navigateOnPanelFocus(isEditorGroupVertical: boolean, isSidebarPositionLeft: boolean): TPromise { + protected navigateOnPanelFocus(isEditorGroupVertical: boolean, isSidebarPositionLeft: boolean): TPromise { return TPromise.as(true); } - protected navigateOnSidebarFocus(isEditorGroupVertical: boolean, isSidebarPositionLeft: boolean): TPromise { + protected navigateOnSidebarFocus(isEditorGroupVertical: boolean, isSidebarPositionLeft: boolean): TPromise { return TPromise.as(true); } - protected navigateToPanel(): TPromise { + protected navigateToPanel(): TPromise { if (!this.partService.isVisible(Parts.PANEL_PART)) { return TPromise.as(false); } const activePanelId = this.panelService.getActivePanel().getId(); + return this.panelService.openPanel(activePanelId, true); } - protected navigateToSidebar(): TPromise { + protected navigateToSidebar(): TPromise { if (!this.partService.isVisible(Parts.SIDEBAR_PART)) { return TPromise.as(false); } const activeViewletId = this.viewletService.getActiveViewlet().getId(); + return this.viewletService.openViewlet(activeViewletId, true); } - protected navigateAcrossEditorGroup(direction): TPromise { + protected navigateAcrossEditorGroup(direction): TPromise { const model = this.groupService.getStacksModel(); const currentPosition = model.positionOfGroup(model.activeGroup); const nextPosition = direction === Direction.Next ? currentPosition + 1 : currentPosition - 1; @@ -1024,25 +1176,29 @@ export abstract class BaseNavigationAction extends Action { } this.groupService.focusGroup(nextPosition); + return TPromise.as(true); } - protected navigateToLastActiveGroup(): TPromise { + protected navigateToLastActiveGroup(): TPromise { const model = this.groupService.getStacksModel(); const lastActiveGroup = model.activeGroup; this.groupService.focusGroup(lastActiveGroup); + return TPromise.as(true); } - protected navigateToFirstEditorGroup(): TPromise { + protected navigateToFirstEditorGroup(): TPromise { this.groupService.focusGroup(0); + return TPromise.as(true); } - protected navigateToLastEditorGroup(): TPromise { + protected navigateToLastEditorGroup(): TPromise { const model = this.groupService.getStacksModel(); const lastEditorGroupPosition = model.groups.length - 1; this.groupService.focusGroup(lastEditorGroupPosition); + return TPromise.as(true); } } @@ -1050,7 +1206,7 @@ export abstract class BaseNavigationAction extends Action { export class NavigateLeftAction extends BaseNavigationAction { public static ID = 'workbench.action.navigateLeft'; - public static LABEL = nls.localize('navigateLeft', "Move to the View on the Left"); + public static LABEL = nls.localize('navigateLeft', "Navigate to the View on the Left"); constructor( id: string, @@ -1063,7 +1219,7 @@ export class NavigateLeftAction extends BaseNavigationAction { super(id, label, groupService, panelService, partService, viewletService); } - protected navigateOnEditorFocus(isEditorGroupVertical, isSidebarPositionLeft): TPromise { + protected navigateOnEditorFocus(isEditorGroupVertical, isSidebarPositionLeft): TPromise { if (!isEditorGroupVertical) { if (isSidebarPositionLeft) { return this.navigateToSidebar(); @@ -1079,10 +1235,11 @@ export class NavigateLeftAction extends BaseNavigationAction { }); } - protected navigateOnPanelFocus(isEditorGroupVertical, isSidebarPositionLeft): TPromise { + protected navigateOnPanelFocus(isEditorGroupVertical, isSidebarPositionLeft): TPromise { if (isSidebarPositionLeft) { return this.navigateToSidebar(); } + return TPromise.as(false); } @@ -1090,9 +1247,11 @@ export class NavigateLeftAction extends BaseNavigationAction { if (isSidebarPositionLeft) { return TPromise.as(false); } + if (isEditorGroupVertical) { return this.navigateToLastEditorGroup(); } + return this.navigateToLastActiveGroup(); } } @@ -1100,7 +1259,7 @@ export class NavigateLeftAction extends BaseNavigationAction { export class NavigateRightAction extends BaseNavigationAction { public static ID = 'workbench.action.navigateRight'; - public static LABEL = nls.localize('navigateRight', "Move to the View on the Right"); + public static LABEL = nls.localize('navigateRight', "Navigate to the View on the Right"); constructor( id: string, @@ -1113,13 +1272,14 @@ export class NavigateRightAction extends BaseNavigationAction { super(id, label, groupService, panelService, partService, viewletService); } - protected navigateOnEditorFocus(isEditorGroupVertical, isSidebarPositionLeft): TPromise { + protected navigateOnEditorFocus(isEditorGroupVertical, isSidebarPositionLeft): TPromise { if (!isEditorGroupVertical) { if (!isSidebarPositionLeft) { return this.navigateToSidebar(); } return TPromise.as(false); } + return this.navigateAcrossEditorGroup(Direction.Next) .then(didNavigate => { if (!didNavigate && !isSidebarPositionLeft) { @@ -1129,10 +1289,11 @@ export class NavigateRightAction extends BaseNavigationAction { }); } - protected navigateOnPanelFocus(isEditorGroupVertical, isSidebarPositionLeft): TPromise { + protected navigateOnPanelFocus(isEditorGroupVertical, isSidebarPositionLeft): TPromise { if (!isSidebarPositionLeft) { return this.navigateToSidebar(); } + return TPromise.as(false); } @@ -1140,9 +1301,11 @@ export class NavigateRightAction extends BaseNavigationAction { if (!isSidebarPositionLeft) { return TPromise.as(false); } + if (isEditorGroupVertical) { return this.navigateToFirstEditorGroup(); } + return this.navigateToLastActiveGroup(); } } @@ -1150,7 +1313,7 @@ export class NavigateRightAction extends BaseNavigationAction { export class NavigateUpAction extends BaseNavigationAction { public static ID = 'workbench.action.navigateUp'; - public static LABEL = nls.localize('navigateUp', "Move to the View Above"); + public static LABEL = nls.localize('navigateUp', "Navigate to the View Above"); constructor( id: string, @@ -1181,7 +1344,7 @@ export class NavigateUpAction extends BaseNavigationAction { export class NavigateDownAction extends BaseNavigationAction { public static ID = 'workbench.action.navigateDown'; - public static LABEL = nls.localize('navigateDown', "Move to the View Below"); + public static LABEL = nls.localize('navigateDown', "Navigate to the View Below"); constructor( id: string, @@ -1194,10 +1357,11 @@ export class NavigateDownAction extends BaseNavigationAction { super(id, label, groupService, panelService, partService, viewletService); } - protected navigateOnEditorFocus(isEditorGroupVertical, isSidebarPositionLeft): TPromise { + protected navigateOnEditorFocus(isEditorGroupVertical, isSidebarPositionLeft): TPromise { if (isEditorGroupVertical) { return this.navigateToPanel(); } + return this.navigateAcrossEditorGroup(Direction.Next) .then(didNavigate => { if (didNavigate) { @@ -1279,4 +1443,4 @@ export class DecreaseViewSizeAction extends BaseResizeViewAction { this.resizePart(-BaseResizeViewAction.RESIZE_INCREMENT); return TPromise.as(true); } -} +} \ No newline at end of file diff --git a/src/vs/workbench/electron-browser/bootstrap/index.html b/src/vs/workbench/electron-browser/bootstrap/index.html index 018512e1164dfffe53eaa7585aa88c40d0b23485..c14ebbe8653233124b738935086e734b532ee64d 100644 --- a/src/vs/workbench/electron-browser/bootstrap/index.html +++ b/src/vs/workbench/electron-browser/bootstrap/index.html @@ -3,42 +3,10 @@ + - + diff --git a/src/vs/workbench/electron-browser/bootstrap/index.js b/src/vs/workbench/electron-browser/bootstrap/index.js index c01da62847a48a91eb743fcc5782a8863c49ce0d..d79e86de78518379f3809e753eabf3705176b5f3 100644 --- a/src/vs/workbench/electron-browser/bootstrap/index.js +++ b/src/vs/workbench/electron-browser/bootstrap/index.js @@ -12,7 +12,7 @@ if (window.location.search.indexOf('prof-startup') >= 0) { profiler.startProfiling('renderer', true); } -/*global window,document,define*/ +/*global window,document,define,Monaco_Loader_Init*/ const startTimer = require('../../../base/node/startupTimers').startTimer; const path = require('path'); @@ -23,7 +23,7 @@ const ipc = electron.ipcRenderer; process.lazyEnv = new Promise(function (resolve) { const handle = setTimeout(function () { resolve(); - console.warn('renderer did not receive lazyEnv in time') + console.warn('renderer did not receive lazyEnv in time'); }, 10000); ipc.once('vscode:acceptShellEnv', function (event, shellEnv) { clearTimeout(handle); @@ -107,14 +107,14 @@ function registerListeners(enableDeveloperTools) { window.addEventListener('keydown', listener); } - process.on('uncaughtException', function (error) { onError(error, enableDeveloperTools) }); + process.on('uncaughtException', function (error) { onError(error, enableDeveloperTools); }); return function () { if (listener) { window.removeEventListener('keydown', listener); listener = void 0; } - } + }; } function main() { @@ -157,10 +157,7 @@ function main() { // Load the loader and start loading the workbench const rootUrl = uriFromPath(configuration.appRoot) + '/out'; - // In the bundled version the nls plugin is packaged with the loader so the NLS Plugins - // loads as soon as the loader loads. To be able to have pseudo translation - const loaderTimer = startTimer('load:loader') - createScript(rootUrl + '/vs/loader.js', function () { + function onLoader() { define('fs', ['original-fs'], function (originalFS) { return originalFS; }); // replace the patched electron fs with the original node fs for all AMD code loaderTimer.stop(); @@ -172,7 +169,7 @@ function main() { 'vs/nls': nlsConfig, recordStats: !!configuration.performance, nodeCachedDataDir: configuration.nodeCachedDataDir, - onNodeCachedData: function () { onNodeCachedData.push(arguments) }, + onNodeCachedData: function () { onNodeCachedData.push(arguments); }, nodeModules: [/*BUILD->INSERT_NODE_MODULES*/] }); @@ -192,7 +189,7 @@ function main() { beforeLoadWorkbenchMain: Date.now() }; - const workbenchMainTimer = startTimer('load:workbench.main') + const workbenchMainTimer = startTimer('load:workbench.main'); require([ 'vs/workbench/electron-browser/workbench.main', 'vs/nls!vs/workbench/electron-browser/workbench.main', @@ -211,7 +208,19 @@ function main() { }); }); }); - }); + } + + // In the bundled version the nls plugin is packaged with the loader so the NLS Plugins + // loads as soon as the loader loads. To be able to have pseudo translation + const loaderTimer = startTimer('load:loader'); + if (typeof Monaco_Loader_Init === 'function') { + //eslint-disable-next-line no-global-assign + define = Monaco_Loader_Init(); + onLoader(); + + } else { + createScript(rootUrl + '/vs/loader.js', onLoader); + } } main(); diff --git a/src/vs/workbench/electron-browser/bootstrap/preload.js b/src/vs/workbench/electron-browser/bootstrap/preload.js new file mode 100644 index 0000000000000000000000000000000000000000..d451c2d5fb720a2faedd852363f4e9696eaa93b3 --- /dev/null +++ b/src/vs/workbench/electron-browser/bootstrap/preload.js @@ -0,0 +1,39 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +'use strict'; + +(function() { + function getConfig() { + const queryParams = window.location.search.substring(1).split('&'); + for (var i = 0; i < queryParams.length; i++) { + var kv = queryParams[i].split('='); + if (kv[0] === 'config' && kv[1]) { + return JSON.parse(decodeURIComponent(kv[1])); + } + } + return {}; + } + try { + const config = getConfig(); + const document = window.document; + + // sets the base theme class ('vs', 'vs-dark', 'hc-black') + const baseTheme = config.baseTheme || 'vs'; + document.body.className = 'monaco-shell ' + baseTheme; + + // adds a stylesheet with the backgrdound color + var backgroundColor = config.backgroundColor; + if (!backgroundColor) { + backgroundColor = baseTheme === 'hc-black' ? '#000000' : (baseTheme === 'vs' ? '#FFFFFF' : '#1E1E1E'); + } + const foregroundColor = baseTheme === 'hc-black' ? '#FFFFFF' : (baseTheme === 'vs' ? '#6C6C6C' : '#CCCCCC'); + const style = document.createElement('style'); + style.innerHTML = '.monaco-shell { background-color:' + backgroundColor + '; color:' + foregroundColor + '; }'; + document.head.appendChild(style); + + } catch (error) { + console.error(error); + } +})(); \ No newline at end of file diff --git a/src/vs/workbench/electron-browser/common.ts b/src/vs/workbench/electron-browser/common.ts deleted file mode 100644 index 9ddf433eeed20e67005e3cdcd62208b0d9fbaeed..0000000000000000000000000000000000000000 --- a/src/vs/workbench/electron-browser/common.ts +++ /dev/null @@ -1,22 +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 { IWindowSettings } from 'vs/platform/windows/common/windows'; - -export interface IPath { - filePath: string; - lineNumber?: number; - columnNumber?: number; -} - -export interface IOpenFileRequest { - filesToOpen?: IPath[]; - filesToCreate?: IPath[]; - filesToDiff?: IPath[]; -} - -export interface IWindowConfiguration { - window: IWindowSettings; -} \ No newline at end of file diff --git a/src/vs/workbench/electron-browser/crashReporter.ts b/src/vs/workbench/electron-browser/crashReporter.ts deleted file mode 100644 index 119229bc2d46fe7042f9845b25a37f117b449090..0000000000000000000000000000000000000000 --- a/src/vs/workbench/electron-browser/crashReporter.ts +++ /dev/null @@ -1,71 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -'use strict'; - -import nls = require('vs/nls'); -import { onUnexpectedError } from 'vs/base/common/errors'; -import { assign, clone } from 'vs/base/common/objects'; -import { IConfigurationRegistry, Extensions } from 'vs/platform/configuration/common/configurationRegistry'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IWindowsService } from 'vs/platform/windows/common/windows'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { Registry } from 'vs/platform/platform'; -import { crashReporter } from 'electron'; -import product from 'vs/platform/node/product'; -import pkg from 'vs/platform/node/package'; - -const TELEMETRY_SECTION_ID = 'telemetry'; - -interface ICrashReporterConfig { - enableCrashReporter: boolean; -} - -const configurationRegistry = Registry.as(Extensions.Configuration); -configurationRegistry.registerConfiguration({ - 'id': TELEMETRY_SECTION_ID, - 'order': 110, - title: nls.localize('telemetryConfigurationTitle', "Telemetry"), - 'type': 'object', - 'properties': { - 'telemetry.enableCrashReporter': { - 'type': 'boolean', - 'description': nls.localize('telemetry.enableCrashReporting', "Enable crash reports to be sent to Microsoft.\nThis option requires restart to take effect."), - 'default': true - } - } -}); - -export class CrashReporter { - - constructor( - configuration: Electron.CrashReporterStartOptions, - @ITelemetryService telemetryService: ITelemetryService, - @IWindowsService windowsService: IWindowsService, - @IConfigurationService configurationService: IConfigurationService - ) { - const config = configurationService.getConfiguration(TELEMETRY_SECTION_ID); - - if (!config.enableCrashReporter) { - return; - } - - telemetryService.getTelemetryInfo() - .then(info => ({ - vscode_sessionId: info.sessionId, - vscode_version: pkg.version, - vscode_commit: product.commit, - vscode_machineId: info.machineId - })) - .then(extra => assign(configuration, { extra })) - .then(configuration => { - // start crash reporter right here - crashReporter.start(clone(configuration)); - - // TODO: start crash reporter in the main process - return windowsService.startCrashReporter(configuration); - }) - .done(null, onUnexpectedError); - } -} \ No newline at end of file diff --git a/src/vs/workbench/electron-browser/extensionHost.ts b/src/vs/workbench/electron-browser/extensionHost.ts index e8f82622b43d8f554d529b08eec259f36277c13a..7c29456900eb9ce32790b61de310bd559999ceb9 100644 --- a/src/vs/workbench/electron-browser/extensionHost.ts +++ b/src/vs/workbench/electron-browser/extensionHost.ts @@ -11,11 +11,12 @@ import { stringify } from 'vs/base/common/marshalling'; import * as objects from 'vs/base/common/objects'; import URI from 'vs/base/common/uri'; import { TPromise } from 'vs/base/common/winjs.base'; +import { Action } from 'vs/base/common/actions'; import { isWindows } from 'vs/base/common/platform'; import { findFreePort } from 'vs/base/node/ports'; import { IMessageService, Severity } from 'vs/platform/message/common/message'; import { ILifecycleService, ShutdownEvent } from 'vs/platform/lifecycle/common/lifecycle'; -import { IWindowsService } from 'vs/platform/windows/common/windows'; +import { IWindowsService, IWindowService } from 'vs/platform/windows/common/windows'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IWindowIPCService } from 'vs/workbench/services/window/electron-browser/windowService'; @@ -28,10 +29,12 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti import { IMessagePassingProtocol } from 'vs/base/parts/ipc/common/ipc'; import { generateRandomPipeName, Protocol } from 'vs/base/parts/ipc/node/ipc.net'; import { createServer, Server } from 'net'; -import Event, { Emitter } from 'vs/base/common/event'; -import { IInitData } from 'vs/workbench/api/node/extHost.protocol'; +import Event, { Emitter, debounceEvent, mapEvent, any } from 'vs/base/common/event'; +import { fromEventEmitter } from 'vs/base/node/event'; +import { IInitData, IWorkspaceData } from 'vs/workbench/api/node/extHost.protocol'; import { MainProcessExtensionService } from 'vs/workbench/api/electron-browser/mainThreadExtensionService'; import { IWorkspaceConfigurationService } from 'vs/workbench/services/configuration/common/configuration'; +import { ICrashReporterService } from 'vs/workbench/services/crashReporter/common/crashReporterService'; export const EXTENSION_LOG_BROADCAST_CHANNEL = 'vscode:extensionLog'; export const EXTENSION_ATTACH_BROADCAST_CHANNEL = 'vscode:extensionAttach'; @@ -87,12 +90,15 @@ export class ExtensionHostProcessWorker { @IWorkspaceContextService private contextService: IWorkspaceContextService, @IMessageService private messageService: IMessageService, @IWindowsService private windowsService: IWindowsService, - @IWindowIPCService private windowService: IWindowIPCService, + @IWindowService private windowService: IWindowService, + @IWindowIPCService private windowIpcService: IWindowIPCService, @ILifecycleService lifecycleService: ILifecycleService, @IInstantiationService private instantiationService: IInstantiationService, @IEnvironmentService private environmentService: IEnvironmentService, @IWorkspaceConfigurationService private configurationService: IWorkspaceConfigurationService, - @ITelemetryService private telemetryService: ITelemetryService + @ITelemetryService private telemetryService: ITelemetryService, + @ICrashReporterService private crashReporterService: ICrashReporterService + ) { // handle extension host lifecycle a bit special when we know we are developing an extension that runs inside this.isExtensionDevelopmentHost = environmentService.isExtensionDevelopment; @@ -111,12 +117,12 @@ export class ExtensionHostProcessWorker { const [server, hook] = <[Server, string]>data[0]; const port = data[1]; - let opts = { + const opts = { env: objects.mixin(objects.clone(process.env), { AMD_ENTRYPOINT: 'vs/workbench/node/extensionHostProcess', PIPE_LOGGING: 'true', VERBOSE_LOGGING: true, - VSCODE_WINDOW_ID: String(this.windowService.getWindowId()), + VSCODE_WINDOW_ID: String(this.windowIpcService.getWindowId()), VSCODE_IPC_HOOK_EXTHOST: hook, ELECTRON_NO_ASAR: '1' }), @@ -127,12 +133,43 @@ export class ExtensionHostProcessWorker { detached: !!isWindows, execArgv: port ? ['--nolazy', (this.isExtensionDevelopmentDebugBrk ? '--debug-brk=' : '--debug=') + port] - : undefined + : undefined, + silent: true }; + const crashReporterOptions = this.crashReporterService.getChildProcessStartOptions('extensionHost'); + if (crashReporterOptions) { + opts.env.CRASH_REPORTER_START_OPTIONS = JSON.stringify(crashReporterOptions); + } + // Run Extension Host as fork of current process this.extensionHostProcess = fork(URI.parse(require.toUrl('bootstrap')).fsPath, ['--type=extensionHost'], opts); + // Catch all output coming from the extension host process + type Output = { data: string, format: string[] }; + this.extensionHostProcess.stdout.setEncoding('utf8'); + this.extensionHostProcess.stderr.setEncoding('utf8'); + const onStdout = fromEventEmitter(this.extensionHostProcess.stdout, 'data'); + const onStderr = fromEventEmitter(this.extensionHostProcess.stderr, 'data'); + const onOutput = any( + mapEvent(onStdout, o => ({ data: `%c${o}`, format: [''] })), + mapEvent(onStderr, o => ({ data: `%c${o}`, format: ['color: red'] })) + ); + + // Debounce all output, so we can render it in the Chrome console as a group + const onDebouncedOutput = debounceEvent(onOutput, (r, o) => { + return r + ? { data: r.data + o.data, format: [...r.format, ...o.format] } + : { data: o.data, format: o.format }; + }, 100); + + // Print out extension host output + onDebouncedOutput(data => { + console.group('Extension Host'); + console.log(data.data, ...data.format); + console.groupEnd(); + }); + // Support logging from extension host this.extensionHostProcess.on('message', msg => { if (msg && (msg).type === '__$console') { @@ -148,7 +185,7 @@ export class ExtensionHostProcessWorker { // Notify debugger that we are ready to attach to the process if we run a development extension if (this.isExtensionDevelopmentHost && port) { - this.windowService.broadcast({ + this.windowIpcService.broadcast({ channel: EXTENSION_ATTACH_BROADCAST_CHANNEL, payload: { port } }, this.environmentService.extensionDevelopmentPath /* target */); @@ -251,11 +288,9 @@ export class ExtensionHostProcessWorker { enableProposedApiForAll: !this.environmentService.isBuilt || (!!this.environmentService.extensionDevelopmentPath && product.nameLong.indexOf('Insiders') >= 0), enableProposedApiFor: this.environmentService.args['enable-proposed-api'] || [] }, - contextService: { - workspace: this.contextService.getWorkspace() - }, + workspace: this.contextService.getWorkspace2(), extensions: extensionDescriptions, - configuration: this.configurationService.values(), + configuration: this.configurationService.getConfigurationData(), telemetryInfo }; }); @@ -292,7 +327,7 @@ export class ExtensionHostProcessWorker { // Broadcast to other windows if we are in development mode else if (!this.environmentService.isBuilt || this.isExtensionDevelopmentHost) { - this.windowService.broadcast({ + this.windowIpcService.broadcast({ channel: EXTENSION_LOG_BROADCAST_CHANNEL, payload: logEntry }, this.environmentService.extensionDevelopmentPath /* target */); @@ -317,16 +352,25 @@ export class ExtensionHostProcessWorker { // Unexpected termination if (!this.isExtensionDevelopmentHost) { + const openDevTools = new Action('openDevTools', nls.localize('devTools', "Developer Tools"), '', true, async (): TPromise => { + await this.windowService.openDevTools(); + return false; + }); + this.messageService.show(Severity.Error, { message: nls.localize('extensionHostProcess.crash', "Extension host terminated unexpectedly. Please reload the window to recover."), - actions: [this.instantiationService.createInstance(ReloadWindowAction, ReloadWindowAction.ID, ReloadWindowAction.LABEL)] + actions: [ + openDevTools, + this.instantiationService.createInstance(ReloadWindowAction, ReloadWindowAction.ID, ReloadWindowAction.LABEL) + ] }); + console.error('Extension host terminated unexpectedly. Code: ', code, ' Signal: ', signal); } // Expected development extension termination: When the extension host goes down we also shutdown the window else if (!this.isExtensionDevelopmentTestFromCli) { - this.windowService.getWindow().close(); + this.windowIpcService.getWindow().close(); } // When CLI testing make sure to exit with proper exit code @@ -350,7 +394,7 @@ export class ExtensionHostProcessWorker { // If the extension development host was started without debugger attached we need // to communicate this back to the main side to terminate the debug session if (this.isExtensionDevelopmentHost && !this.isExtensionDevelopmentTestFromCli && !this.isExtensionDevelopmentDebug) { - this.windowService.broadcast({ + this.windowIpcService.broadcast({ channel: EXTENSION_TERMINATE_BROADCAST_CHANNEL, payload: true }, this.environmentService.extensionDevelopmentPath /* target */); diff --git a/src/vs/workbench/electron-browser/main.contribution.ts b/src/vs/workbench/electron-browser/main.contribution.ts index 46b0bce9b765ceb141bb8406053b240b2cf71191..e9bde5ed3beceb6d7f61d326179f68e5810627d5 100644 --- a/src/vs/workbench/electron-browser/main.contribution.ts +++ b/src/vs/workbench/electron-browser/main.contribution.ts @@ -5,7 +5,7 @@ 'use strict'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import nls = require('vs/nls'); import product from 'vs/platform/node/product'; import * as os from 'os'; @@ -14,10 +14,11 @@ import { IConfigurationRegistry, Extensions as ConfigurationExtensions } from 'v import { IWorkbenchActionRegistry, Extensions } from 'vs/workbench/common/actionRegistry'; import { KeyMod, KeyChord, KeyCode } from 'vs/base/common/keyCodes'; import { isWindows, isLinux, isMacintosh } from 'vs/base/common/platform'; -import { CloseEditorAction, KeybindingsReferenceAction, OpenDocumentationUrlAction, OpenIntroductoryVideosUrlAction, ReportIssueAction, ReportPerformanceIssueAction, ZoomResetAction, ZoomOutAction, ZoomInAction, ToggleFullScreenAction, ToggleMenuBarAction, CloseFolderAction, CloseWindowAction, SwitchWindow, NewWindowAction, CloseMessagesAction, NavigateUpAction, NavigateDownAction, NavigateLeftAction, NavigateRightAction, IncreaseViewSizeAction, DecreaseViewSizeAction, ShowStartupPerformance, ToggleSharedProcessAction } from 'vs/workbench/electron-browser/actions'; +import { CloseEditorAction, KeybindingsReferenceAction, OpenDocumentationUrlAction, OpenIntroductoryVideosUrlAction, OpenTipsAndTricksUrlAction, ReportIssueAction, ReportPerformanceIssueAction, ZoomResetAction, ZoomOutAction, ZoomInAction, ToggleFullScreenAction, ToggleMenuBarAction, CloseFolderAction, CloseWindowAction, SwitchWindow, NewWindowAction, CloseMessagesAction, NavigateUpAction, NavigateDownAction, NavigateLeftAction, NavigateRightAction, IncreaseViewSizeAction, DecreaseViewSizeAction, ShowStartupPerformance, ToggleSharedProcessAction, QuickSwitchWindow, QuickOpenRecentAction } from 'vs/workbench/electron-browser/actions'; import { MessagesVisibleContext } from 'vs/workbench/electron-browser/workbench'; import { IJSONSchema } from 'vs/base/common/jsonSchema'; import { registerCommands } from 'vs/workbench/electron-browser/commands'; +import { AddRootFolderAction } from "vs/workbench/browser/actions/fileActions"; // Contribute Commands registerCommands(); @@ -29,11 +30,13 @@ const fileCategory = nls.localize('file', "File"); const workbenchActionsRegistry = Registry.as(Extensions.WorkbenchActions); workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(NewWindowAction, NewWindowAction.ID, NewWindowAction.LABEL, { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_N }), 'New Window'); workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(CloseWindowAction, CloseWindowAction.ID, CloseWindowAction.LABEL, { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_W }), 'Close Window'); -workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(SwitchWindow, SwitchWindow.ID, SwitchWindow.LABEL), 'Switch Window'); +workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(SwitchWindow, SwitchWindow.ID, SwitchWindow.LABEL, { primary: null, mac: { primary: KeyMod.WinCtrl | KeyCode.KEY_W } }), 'Switch Window...'); +workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(QuickSwitchWindow, QuickSwitchWindow.ID, QuickSwitchWindow.LABEL), 'Quick Switch Window...'); +workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(QuickOpenRecentAction, QuickOpenRecentAction.ID, QuickOpenRecentAction.LABEL), 'File: Quick Open Recent...', fileCategory); workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(CloseFolderAction, CloseFolderAction.ID, CloseFolderAction.LABEL, { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyCode.KEY_F) }), 'File: Close Folder', fileCategory); if (!!product.reportIssueUrl) { workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(ReportIssueAction, ReportIssueAction.ID, ReportIssueAction.LABEL), 'Help: Report Issues', helpCategory); - workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(ReportPerformanceIssueAction, ReportPerformanceIssueAction.ID, ReportPerformanceIssueAction.LABEL), 'Help: Report Performance Issues', helpCategory); + workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(ReportPerformanceIssueAction, ReportPerformanceIssueAction.ID, ReportPerformanceIssueAction.LABEL), 'Help: Report Performance Issue', helpCategory); } if (KeybindingsReferenceAction.AVAILABLE) { workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(KeybindingsReferenceAction, KeybindingsReferenceAction.ID, KeybindingsReferenceAction.LABEL, { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_R) }), 'Help: Keyboard Shortcuts Reference', helpCategory); @@ -44,6 +47,9 @@ if (OpenDocumentationUrlAction.AVAILABLE) { if (OpenIntroductoryVideosUrlAction.AVAILABLE) { workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(OpenIntroductoryVideosUrlAction, OpenIntroductoryVideosUrlAction.ID, OpenIntroductoryVideosUrlAction.LABEL), 'Help: Introductory Videos', helpCategory); } +if (OpenTipsAndTricksUrlAction.AVAILABLE) { + workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(OpenTipsAndTricksUrlAction, OpenTipsAndTricksUrlAction.ID, OpenTipsAndTricksUrlAction.LABEL), 'Help: Tips and Tricks', helpCategory); +} workbenchActionsRegistry.registerWorkbenchAction( new SyncActionDescriptor(ZoomInAction, ZoomInAction.ID, ZoomInAction.LABEL, { primary: KeyMod.CtrlCmd | KeyCode.US_EQUAL, @@ -72,8 +78,13 @@ workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(Naviga workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(NavigateLeftAction, NavigateLeftAction.ID, NavigateLeftAction.LABEL, null), 'View: Move to the View on the Left', viewCategory); workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(NavigateRightAction, NavigateRightAction.ID, NavigateRightAction.LABEL, null), 'View: Move to the View on the Right', viewCategory); -workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(IncreaseViewSizeAction, IncreaseViewSizeAction.ID, IncreaseViewSizeAction.LABEL, null), 'View: Increase View Size', viewCategory); -workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(DecreaseViewSizeAction, DecreaseViewSizeAction.ID, DecreaseViewSizeAction.LABEL, null), 'View: Decrease View Size', viewCategory); +workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(IncreaseViewSizeAction, IncreaseViewSizeAction.ID, IncreaseViewSizeAction.LABEL, null), 'View: Increase Current View Size', viewCategory); +workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(DecreaseViewSizeAction, DecreaseViewSizeAction.ID, DecreaseViewSizeAction.LABEL, null), 'View: Decrease Current View Size', viewCategory); + +// TODO@Ben multi root +if (product.quality !== 'stable') { + workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(AddRootFolderAction, AddRootFolderAction.ID, AddRootFolderAction.LABEL), 'Files: Add Root Folder...', fileCategory); +} // Developer related actions const developerCategory = nls.localize('developer', "Developer"); @@ -121,6 +132,16 @@ let workbenchProperties: { [path: string]: IJSONSchema; } = { 'description': nls.localize('revealIfOpen', "Controls if an editor is revealed in any of the visible groups if opened. If disabled, an editor will prefer to open in the currently active editor group. If enabled, an already opened editor will be revealed instead of opened again in the currently active editor group. Note that there are some cases where this setting is ignored, e.g. when forcing an editor to open in a specific group or to the side of the currently active group."), 'default': false }, + 'workbench.commandPalette.history': { + 'type': 'number', + 'description': nls.localize('commandHistory', "Controls if the number of recently used commands to keep in history for the command palette. Set to 0 to disable command history."), + 'default': 50 + }, + 'workbench.commandPalette.preserveInput': { + 'type': 'boolean', + 'description': nls.localize('preserveInput', "Controls if the last typed input to the command palette should be restored when opening it the next time."), + 'default': false + }, 'workbench.quickOpen.closeOnFocusLost': { 'type': 'boolean', 'description': nls.localize('closeOnFocusLost', "Controls if Quick Open should close automatically once it loses focus."), @@ -182,7 +203,7 @@ let properties: { [path: string]: IJSONSchema; } = { nls.localize({ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'window.openFilesInNewWindow.off' }, "Files will open in the window with the files' folder open or the last active window"), nls.localize({ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'window.openFilesInNewWindow.default' }, "Files will open in the window with the files' folder open or the last active window unless opened via the dock or from finder (macOS only)") ], - 'default': 'default', + 'default': 'off', 'description': nls.localize('openFilesInNewWindow', `Controls if files should open in a new window. @@ -209,16 +230,17 @@ Note that there can still be cases where this setting is ignored (e.g. when usin Note that there can still be cases where this setting is ignored (e.g. when using the -new-window or -reuse-window command line option).` ) }, - 'window.reopenFolders': { + 'window.restoreWindows': { 'type': 'string', - 'enum': ['none', 'one', 'all'], + 'enum': ['all', 'folders', 'one', 'none'], 'enumDescriptions': [ - nls.localize({ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'window.reopenFolders.none' }, "Never reopen a folder."), - nls.localize({ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'window.reopenFolders.one' }, "Reopen the last active folder."), - nls.localize({ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'window.reopenFolders.all' }, "Reopen all folders of the last session."), + nls.localize({ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'window.reopenFolders.all' }, "Reopen all windows."), + nls.localize({ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'window.reopenFolders.folders' }, "Reopen all folders. Empty windows will not be restored."), + nls.localize({ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'window.reopenFolders.one' }, "Reopen the last active window."), + nls.localize({ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'window.reopenFolders.none' }, "Never reopen a window. Always start with an empty one.") ], 'default': 'one', - 'description': nls.localize('reopenFolders', "Controls how folders are being reopened after a restart. Select 'none' to never reopen a folder, 'one' to reopen the last folder you worked on or 'all' to reopen all folders of your last session.") + 'description': nls.localize('restoreWindows', "Controls how windows are being reopened after a restart. Select 'none' to always start with an empty window, 'one' to reopen the last window you worked on, 'folders' to reopen all folders you had opened or 'all' to reopen all windows of your last session.") }, 'window.restoreFullscreen': { 'type': 'boolean', @@ -232,14 +254,16 @@ Note that there can still be cases where this setting is ignored (e.g. when usin }, 'window.title': { 'type': 'string', - 'default': isMacintosh ? '${activeEditorShort}${separator}${rootName}' : '${dirty}${activeEditorShort}${separator}${rootName}${separator}${appName}', + 'default': isMacintosh ? '${activeEditorShort}${separator}${folderName}' : '${dirty}${activeEditorShort}${separator}${folderName}${separator}${appName}', 'description': nls.localize({ comment: ['This is the description for a setting. Values surrounded by parenthesis are not to be translated.'], key: 'title' }, `Controls the window title based on the active editor. Variables are substituted based on the context: \${activeEditorShort}: e.g. myFile.txt \${activeEditorMedium}: e.g. myFolder/myFile.txt \${activeEditorLong}: e.g. /Users/Development/myProject/myFolder/myFile.txt -\${rootName}: e.g. myProject -\${rootPath}: e.g. /Users/Development/myProject +\${folderName}: e.g. myFolder +\${folderPath}: e.g. /Users/Development/myFolder +\${rootName}: e.g. myFolder1, myFolder2, myFolder3 +\${rootPath}: e.g. /Users/Development/myWorkspace \${appName}: e.g. VS Code \${dirty}: a dirty indicator if the active editor is dirty \${separator}: a conditional separator (" - ") that only shows when surrounded by variables with values`) @@ -346,3 +370,35 @@ configurationRegistry.registerConfiguration({ } } }); + +// Configuration: Workspace +// TODO@Ben multi root +if (product.quality !== 'stable') { + configurationRegistry.registerConfiguration({ + 'id': 'workspace', + 'order': 10000, + 'title': nls.localize('workspaceConfigurationTitle', "Workspace"), + 'type': 'object', + 'properties': { + 'workspace': { + 'type': 'object', + 'description': nls.localize('workspaces.title', "Folder configuration of the workspace"), + 'additionalProperties': { + 'anyOf': [{ + 'type': 'object', + 'description': nls.localize('files.exclude.boolean', "The glob pattern to match file paths against. Set to true or false to enable or disable the pattern."), + 'properties': { + 'folders': { + 'description': nls.localize('workspaces.additionalFolders', "Folders of this workspace"), + 'type': 'array', + 'items': { + 'type': 'string' + } + } + } + }] + } + } + } + }); +} \ No newline at end of file diff --git a/src/vs/workbench/electron-browser/main.ts b/src/vs/workbench/electron-browser/main.ts index fb179f3196cab6d85c305a576e625cbaf479f0f7..6fd5754cbe173434927be6720393b5068d397016 100644 --- a/src/vs/workbench/electron-browser/main.ts +++ b/src/vs/workbench/electron-browser/main.ts @@ -18,59 +18,40 @@ import paths = require('vs/base/common/paths'); import uri from 'vs/base/common/uri'; import strings = require('vs/base/common/strings'); import { IResourceInput } from 'vs/platform/editor/common/editor'; -import { IWorkspace, WorkspaceContextService } from 'vs/platform/workspace/common/workspace'; -import { WorkspaceConfigurationService } from 'vs/workbench/services/configuration/node/configurationService'; -import { ParsedArgs } from 'vs/platform/environment/common/environment'; +import { LegacyWorkspace, Workspace } from "vs/platform/workspace/common/workspace"; +import { WorkspaceConfigurationService } from 'vs/workbench/services/configuration/node/configuration'; import { realpath, stat } from 'vs/base/node/pfs'; import { EnvironmentService } from 'vs/platform/environment/node/environmentService'; import path = require('path'); import gracefulFs = require('graceful-fs'); -import { IPath, IOpenFileRequest } from 'vs/workbench/electron-browser/common'; import { IInitData } from 'vs/workbench/services/timer/common/timerService'; import { TimerService } from 'vs/workbench/services/timer/node/timerService'; import { KeyboardMapperFactory } from "vs/workbench/services/keybinding/electron-browser/keybindingService"; +import { IWindowConfiguration, IPath } from "vs/platform/windows/common/windows"; +import { IStorageService } from "vs/platform/storage/common/storage"; +import { IEnvironmentService } from "vs/platform/environment/common/environment"; +import { StorageService, inMemoryLocalStorageInstance } from "vs/platform/storage/common/storageService"; import { webFrame } from 'electron'; import fs = require('fs'); +import { createHash } from "crypto"; gracefulFs.gracefulify(fs); // enable gracefulFs -export interface IWindowConfiguration extends ParsedArgs, IOpenFileRequest { - - /** - * The physical keyboard is of ISO type (on OSX). - */ - isISOKeyboard?: boolean; - - /** - * Accessibility support is enabled. - */ - accessibilitySupportEnabled?: boolean; - - appRoot: string; - execPath: string; - - userEnv: any; /* vs/code/electron-main/env/IProcessEnvironment*/ - - workspacePath?: string; - - zoomLevel?: number; - fullscreen?: boolean; -} - export function startup(configuration: IWindowConfiguration): TPromise { // Ensure others can listen to zoom level changes browser.setZoomFactor(webFrame.getZoomFactor()); + // See https://github.com/Microsoft/vscode/issues/26151 // Can be trusted because we are not setting it ourselves. - browser.setZoomLevel(webFrame.getZoomLevel(), /*isTrusted*/true); + browser.setZoomLevel(webFrame.getZoomLevel(), true /* isTrusted */); browser.setFullscreen(!!configuration.fullscreen); KeyboardMapperFactory.INSTANCE._onKeyboardLayoutChanged(configuration.isISOKeyboard); - browser.setAccessibilitySupport(configuration.accessibilitySupportEnabled ? platform.AccessibilitySupport.Enabled : platform.AccessibilitySupport.Disabled); + browser.setAccessibilitySupport(configuration.accessibilitySupport ? platform.AccessibilitySupport.Enabled : platform.AccessibilitySupport.Disabled); // Setup Intl comparer.setFileNameComparer(new Intl.Collator(undefined, { numeric: true, sensitivity: 'base' })); @@ -85,12 +66,8 @@ export function startup(configuration: IWindowConfiguration): TPromise { filesToDiff }; - // Resolve workspace - return getWorkspace(configuration.workspacePath).then(workspace => { - - // Open workbench - return openWorkbench(configuration, workspace, shellOptions); - }); + // Open workbench + return openWorkbench(configuration, shellOptions); } function toInputs(paths: IPath[], isUntitledFile?: boolean): IResourceInput[] { @@ -118,12 +95,64 @@ function toInputs(paths: IPath[], isUntitledFile?: boolean): IResourceInput[] { }); } -function getWorkspace(workspacePath: string): TPromise { - if (!workspacePath) { +function openWorkbench(configuration: IWindowConfiguration, options: IOptions): TPromise { + return resolveLegacyWorkspace(configuration).then(legacyWorkspace => { + const workspace = legacyWorkspaceToMultiRootWorkspace(legacyWorkspace); + const environmentService = new EnvironmentService(configuration, configuration.execPath); + const workspaceConfigurationService = new WorkspaceConfigurationService(environmentService, workspace); + const timerService = new TimerService((window).MonacoEnvironment.timers as IInitData, !!workspace); + const storageService = createStorageService(legacyWorkspace, workspace, configuration, environmentService); + + // Since the configuration service is one of the core services that is used in so many places, we initialize it + // right before startup of the workbench shell to have its data ready for consumers + return workspaceConfigurationService.initialize().then(() => { + timerService.beforeDOMContentLoaded = Date.now(); + + return domContentLoaded().then(() => { + timerService.afterDOMContentLoaded = Date.now(); + + // Open Shell + timerService.beforeWorkbenchOpen = Date.now(); + const shell = new WorkbenchShell(document.body, { + contextService: workspaceConfigurationService, + configurationService: workspaceConfigurationService, + environmentService, + timerService, + storageService + }, configuration, options); + shell.open(); + + // Inform user about loading issues from the loader + (self).require.config({ + onError: (err: any) => { + if (err.errorCode === 'load') { + shell.onUnexpectedError(loaderError(err)); + } + } + }); + }); + }); + }); +} + +function legacyWorkspaceToMultiRootWorkspace(legacyWorkspace: LegacyWorkspace): Workspace { + if (!legacyWorkspace) { + return null; + } + + return new Workspace( + createHash('md5').update(legacyWorkspace.resource.fsPath).update(legacyWorkspace.ctime ? String(legacyWorkspace.ctime) : '').digest('hex'), + path.basename(legacyWorkspace.resource.fsPath), + [legacyWorkspace.resource] + ); +} + +function resolveLegacyWorkspace(configuration: IWindowConfiguration): TPromise { + if (!configuration.workspacePath) { return TPromise.as(null); } - return realpath(workspacePath).then(realWorkspacePath => { + return realpath(configuration.workspacePath).then(realWorkspacePath => { // for some weird reason, node adds a trailing slash to UNC paths // we never ever want trailing slashes as our workspace path unless @@ -133,57 +162,39 @@ function getWorkspace(workspacePath: string): TPromise { realWorkspacePath = strings.rtrim(realWorkspacePath, paths.nativeSep); } - const workspaceResource = uri.file(realWorkspacePath); - const folderName = path.basename(realWorkspacePath) || realWorkspacePath; + // update config + configuration.workspacePath = realWorkspacePath; - return stat(realWorkspacePath).then(folderStat => { - return { - 'resource': workspaceResource, - 'name': folderName, - 'uid': platform.isLinux ? folderStat.ino : folderStat.birthtime.getTime() // On Linux, birthtime is ctime, so we cannot use it! We use the ino instead! - }; - }); - }, (error) => { + // resolve ctime of workspace + return stat(realWorkspacePath).then(folderStat => new LegacyWorkspace( + uri.file(realWorkspacePath), + platform.isLinux ? folderStat.ino : folderStat.birthtime.getTime() // On Linux, birthtime is ctime, so we cannot use it! We use the ino instead! + )); + }, error => { errors.onUnexpectedError(error); return null; // treat invalid paths as empty workspace }); } -function openWorkbench(environment: IWindowConfiguration, workspace: IWorkspace, options: IOptions): TPromise { - const environmentService = new EnvironmentService(environment, environment.execPath); - const contextService = new WorkspaceContextService(workspace); - const configurationService = new WorkspaceConfigurationService(contextService, environmentService); - const timerService = new TimerService((window).MonacoEnvironment.timers as IInitData, !contextService.hasWorkspace()); - - // Since the configuration service is one of the core services that is used in so many places, we initialize it - // right before startup of the workbench shell to have its data ready for consumers - return configurationService.initialize().then(() => { - timerService.beforeDOMContentLoaded = Date.now(); - - return domContentLoaded().then(() => { - timerService.afterDOMContentLoaded = Date.now(); - - // Open Shell - timerService.beforeWorkbenchOpen = Date.now(); - const shell = new WorkbenchShell(document.body, { - configurationService, - contextService, - environmentService, - timerService - }, options); - shell.open(); - - // Inform user about loading issues from the loader - (self).require.config({ - onError: (err: any) => { - if (err.errorCode === 'load') { - shell.onUnexpectedError(loaderError(err)); - } - } - }); - }); - }); +function createStorageService(legacyWorkspace: LegacyWorkspace, workspace: Workspace, configuration: IWindowConfiguration, environmentService: IEnvironmentService): IStorageService { + let id: string; + if (workspace) { + id = legacyWorkspace.resource.toString(); + } else if (configuration.backupPath) { + // if we do not have a workspace open, we need to find another identifier for the window to store + // workspace UI state. if we have a backup path in the configuration we can use that because this + // will be a unique identifier per window that is stable between restarts as long as there are + // dirty files in the workspace. + // We use basename() to produce a short identifier, we do not need the full path. We use a custom + // scheme so that we can later distinguish these identifiers from the workspace one. + id = uri.from({ path: path.basename(configuration.backupPath), scheme: 'empty' }).toString(); + } + + const disableStorage = !!environmentService.extensionTestsPath; // never keep any state when running extension tests! + const storage = disableStorage ? inMemoryLocalStorageInstance : window.localStorage; + + return new StorageService(storage, storage, { id, name: workspace && workspace.name, roots: workspace && workspace.roots }, legacyWorkspace ? legacyWorkspace.ctime : void 0); } function loaderError(err: Error): Error { diff --git a/src/vs/workbench/electron-browser/media/shell.css b/src/vs/workbench/electron-browser/media/shell.css index 5696fc87867aae8895c2f83dd2d18c94eae39526..f734da27292c903ab9acf2704057e388a2500b90 100644 --- a/src/vs/workbench/electron-browser/media/shell.css +++ b/src/vs/workbench/electron-browser/media/shell.css @@ -15,7 +15,7 @@ /* Font Families (with CJK support) */ -.monaco-shell { font-family: system-ui, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", "Ubuntu", "Droid Sans", sans-serif; } +.monaco-shell { font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", "Ubuntu", "Droid Sans", sans-serif; } .monaco-shell:lang(zh-Hans) { font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", "Noto Sans", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Source Han Sans SC", "Source Han Sans CN", "Source Han Sans", sans-serif; } .monaco-shell:lang(zh-Hant) { font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", "Noto Sans", "Microsoft Jhenghei", "PingFang TC", "Source Han Sans TC", "Source Han Sans", "Source Han Sans TW", sans-serif; } .monaco-shell:lang(ja) { font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", "Noto Sans", "Meiryo", "Hiragino Kaku Gothic Pro", "Source Han Sans J", "Source Han Sans JP", "Source Han Sans", "Sazanami Gothic", "IPA Gothic", sans-serif; } diff --git a/src/vs/workbench/electron-browser/shell.ts b/src/vs/workbench/electron-browser/shell.ts index bec5d37606b9e6312e8552a576652d3644ee25a5..ab4f6c3f4ba2fd1a485c6e4b6b59a9c3057547b6 100644 --- a/src/vs/workbench/electron-browser/shell.ts +++ b/src/vs/workbench/electron-browser/shell.ts @@ -13,7 +13,7 @@ import * as platform from 'vs/base/common/platform'; import { Dimension, Builder, $ } from 'vs/base/browser/builder'; import dom = require('vs/base/browser/dom'); import aria = require('vs/base/browser/ui/aria/aria'); -import { dispose, IDisposable, Disposables } from 'vs/base/common/lifecycle'; +import { dispose, IDisposable } from 'vs/base/common/lifecycle'; import errors = require('vs/base/common/errors'); import { toErrorMessage } from 'vs/base/common/errorMessage'; import product from 'vs/platform/node/product'; @@ -21,7 +21,6 @@ import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; import pkg from 'vs/platform/node/package'; import { ContextViewService } from 'vs/platform/contextview/browser/contextViewService'; import { Workbench, IWorkbenchStartedInfo } from 'vs/workbench/electron-browser/workbench'; -import { StorageService, inMemoryLocalStorageInstance } from 'vs/platform/storage/common/storageService'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { NullTelemetryService, configurationTelemetry, loadExperiments, lifecycleTelemetry } from 'vs/platform/telemetry/common/telemetryUtils'; import { ITelemetryAppenderChannel, TelemetryAppenderClient } from 'vs/platform/telemetry/common/telemetryIpc'; @@ -33,7 +32,7 @@ import { resolveWorkbenchCommonProperties, getOrCreateMachineId } from 'vs/platf import { machineIdIpcChannel } from 'vs/platform/telemetry/node/commonProperties'; import { WorkspaceStats } from 'vs/workbench/services/telemetry/common/workspaceStats'; import { IWindowIPCService, WindowIPCService } from 'vs/workbench/services/window/electron-browser/windowService'; -import { IWindowsService, IWindowService } from 'vs/platform/windows/common/windows'; +import { IWindowsService, IWindowService, IWindowConfiguration } from 'vs/platform/windows/common/windows'; import { WindowsChannelClient } from 'vs/platform/windows/common/windowsIpc'; import { WindowService } from 'vs/platform/windows/electron-browser/windowService'; import { MessageService } from 'vs/workbench/services/message/electron-browser/messageService'; @@ -59,10 +58,10 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; import { InstantiationService } from 'vs/platform/instantiation/common/instantiationService'; import { IContextViewService } from 'vs/platform/contextview/browser/contextView'; -import { ILifecycleService } from 'vs/platform/lifecycle/common/lifecycle'; +import { ILifecycleService, LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle'; import { IMarkerService } from 'vs/platform/markers/common/markers'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { IMessageService, IChoiceService, Severity, CloseAction } from 'vs/platform/message/common/message'; +import { IMessageService, IChoiceService, Severity } from 'vs/platform/message/common/message'; import { ChoiceChannel } from 'vs/platform/message/common/messageIpc'; import { ISearchService } from 'vs/platform/search/common/search'; import { IThreadService } from 'vs/workbench/services/thread/common/threadService'; @@ -73,7 +72,8 @@ import { IExtensionService } from 'vs/platform/extensions/common/extensions'; import { WorkbenchModeServiceImpl } from 'vs/workbench/services/mode/common/workbenchModeService'; import { IModeService } from 'vs/editor/common/services/modeService'; import { IUntitledEditorService, UntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService'; -import { CrashReporter } from 'vs/workbench/electron-browser/crashReporter'; +import { ICrashReporterService, NullCrashReporterService } from 'vs/workbench/services/crashReporter/common/crashReporterService'; +import { CrashReporterService } from 'vs/workbench/services/crashReporter/electron-browser/crashReporterService'; import { NodeCachedDataManager } from 'vs/workbench/electron-browser/nodeCachedDataManager'; import { getDelayedChannel } from 'vs/base/parts/ipc/common/ipc'; import { connect as connectNet } from 'vs/base/parts/ipc/node/ipc.net'; @@ -85,22 +85,21 @@ import { UpdateChannelClient } from 'vs/platform/update/common/updateIpc'; import { IUpdateService } from 'vs/platform/update/common/update'; import { URLChannelClient } from 'vs/platform/url/common/urlIpc'; import { IURLService } from 'vs/platform/url/common/url'; -import { IBackupService } from 'vs/platform/backup/common/backup'; -import { BackupChannelClient } from 'vs/platform/backup/common/backupIpc'; -import { ReportPerformanceIssueAction } from 'vs/workbench/electron-browser/actions'; import { ExtensionHostProcessWorker } from 'vs/workbench/electron-browser/extensionHost'; import { ITimerService } from 'vs/workbench/services/timer/common/timerService'; import { remote, ipcRenderer as ipc } from 'electron'; -import { ITextMateService } from 'vs/editor/node/textMate/textMateService'; -import { MainProcessTextMateSyntax } from 'vs/editor/electron-browser/textMate/TMSyntax'; import { BareFontInfo } from 'vs/editor/common/config/fontInfo'; import { restoreFontInfo, readFontInfo, saveFontInfo } from 'vs/editor/browser/config/configuration'; import * as browser from 'vs/base/browser/browser'; import 'vs/platform/opener/browser/opener.contribution'; import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService'; import { WorkbenchThemeService } from 'vs/workbench/services/themes/electron-browser/workbenchThemeService'; +import { ITextResourceConfigurationService } from 'vs/editor/common/services/resourceConfiguration'; +import { TextResourceConfigurationService } from 'vs/editor/common/services/resourceConfigurationImpl'; import { registerThemingParticipant, ITheme, ICssStyleCollector } from 'vs/platform/theme/common/themeService'; import { foreground, selectionBackground, focusBorder, scrollbarShadow, scrollbarSliderActiveBackground, scrollbarSliderBackground, scrollbarSliderHoverBackground, listHighlightForeground, inputPlaceholderForeground } from 'vs/platform/theme/common/colorRegistry'; +import { TextMateService } from 'vs/workbench/services/textMate/electron-browser/TMSyntax'; +import { ITextMateService } from 'vs/workbench/services/textMate/electron-browser/textMateService'; /** * Services that we require for the Shell @@ -110,6 +109,7 @@ export interface ICoreServices { configurationService: IConfigurationService; environmentService: IEnvironmentService; timerService: ITimerService; + storageService: IStorageService; } const currentWindow = remote.getCurrentWindow(); @@ -132,7 +132,7 @@ export class WorkbenchShell { private windowIPCService: IWindowIPCService; private timerService: ITimerService; private themeService: WorkbenchThemeService; - private lifecycleService: ILifecycleService; + private lifecycleService: LifecycleService; private container: HTMLElement; private toUnbind: IDisposable[]; @@ -141,18 +141,21 @@ export class WorkbenchShell { private content: HTMLElement; private contentsContainer: Builder; + private configuration: IWindowConfiguration; private options: IOptions; private workbench: Workbench; - constructor(container: HTMLElement, services: ICoreServices, options: IOptions) { + constructor(container: HTMLElement, services: ICoreServices, configuration: IWindowConfiguration, options: IOptions) { this.container = container; + this.configuration = configuration; this.options = options; this.contextService = services.contextService; this.configurationService = services.configurationService; this.environmentService = services.environmentService; this.timerService = services.timerService; + this.storageService = services.storageService; this.toUnbind = []; this.previousErrorTime = 0; @@ -169,39 +172,20 @@ export class WorkbenchShell { // Instantiation service with services const [instantiationService, serviceCollection] = this.initServiceCollection(parent.getHTMLElement()); - //crash reporting - if (product.crashReporter && product.hockeyApp) { - let submitURL: string; - - if (platform.isWindows) { - submitURL = product.hockeyApp[`win32-${process.arch}`]; - } else if (platform.isMacintosh) { - submitURL = product.hockeyApp.darwin; - } else if (platform.isLinux) { - submitURL = product.hockeyApp[`linux-${process.arch}`]; - } - - if (submitURL) { - const opts: Electron.CrashReporterStartOptions = { - companyName: product.crashReporter.companyName, - productName: product.crashReporter.productName, - submitURL - }; - - instantiationService.createInstance(CrashReporter, opts); - } - } - // Workbench - this.workbench = instantiationService.createInstance(Workbench, parent.getHTMLElement(), workbenchContainer.getHTMLElement(), this.options, serviceCollection); + this.workbench = instantiationService.createInstance(Workbench, parent.getHTMLElement(), workbenchContainer.getHTMLElement(), this.configuration, this.options, serviceCollection); this.workbench.startup({ onWorkbenchStarted: (info: IWorkbenchStartedInfo) => { // run workbench started logic - this.onWorkbenchStarted(instantiationService, info); + this.onWorkbenchStarted(info); // start cached data manager instantiationService.createInstance(NodeCachedDataManager); + + // Set lifecycle phase to `Runnning` so that other contributions + // can now do something + this.lifecycleService.phase = LifecyclePhase.Running; } }); @@ -221,7 +205,7 @@ export class WorkbenchShell { return workbenchContainer; } - private onWorkbenchStarted(instantiationService: IInstantiationService, info: IWorkbenchStartedInfo): void { + private onWorkbenchStarted(info: IWorkbenchStartedInfo): void { // Telemetry: workspace info const { filesToOpen, filesToCreate, filesToDiff } = this.options; @@ -248,12 +232,6 @@ export class WorkbenchShell { this.timerService.restoreViewletDuration = info.restoreViewletDuration; this.extensionService.onReady().done(() => { this.telemetryService.publicLog('startupTime', this.timerService.startupMetrics); - - // Check for negative performance numbers (insiders only) - // TODO@Ben remove me - if (product.quality !== 'stable' && this.timerService.startupMetrics.ellapsed < 0) { - this.handleNegativePerformanceNumbers(instantiationService, this.timerService.startupMetrics.ellapsed); - } }); // Telemetry: workspace tags @@ -266,24 +244,15 @@ export class WorkbenchShell { } } - private handleNegativePerformanceNumbers(i: IInstantiationService, time: number): void { - this.messageService.show(Severity.Warning, { - message: `Something went wrong measuring startup performance numbers (ellapsed: ${time}ms). We would like to learn more about this issue.`, - actions: [ - i.createInstance(ReportPerformanceIssueAction, ReportPerformanceIssueAction.ID, ReportPerformanceIssueAction.LABEL), - CloseAction - ] - }); - } - private initServiceCollection(container: HTMLElement): [IInstantiationService, ServiceCollection] { - const disposables = new Disposables(); + const disposables: IDisposable[] = []; const serviceCollection = new ServiceCollection(); serviceCollection.set(IWorkspaceContextService, this.contextService); serviceCollection.set(IConfigurationService, this.configurationService); serviceCollection.set(IEnvironmentService, this.environmentService); serviceCollection.set(ITimerService, this.timerService); + serviceCollection.set(IStorageService, this.storageService); const instantiationService: IInstantiationService = new InstantiationService(serviceCollection, true); @@ -292,7 +261,7 @@ export class WorkbenchShell { serviceCollection.set(IWindowIPCService, this.windowIPCService); const mainProcessClient = new ElectronIPCClient(String(`window${currentWindow.id}`)); - disposables.add(mainProcessClient); + disposables.push(mainProcessClient); const windowsChannel = mainProcessClient.getChannel('windows'); this.windowsService = new WindowsChannelClient(windowsChannel); @@ -306,11 +275,6 @@ export class WorkbenchShell { sharedProcess .done(client => client.registerChannel('choice', instantiationService.createInstance(ChoiceChannel))); - // Storage Sevice - const disableWorkspaceStorage = this.environmentService.extensionTestsPath || (!this.contextService.hasWorkspace() && !this.environmentService.isExtensionDevelopment); // without workspace or in any extension test, we use inMemory storage unless we develop an extension where we want to preserve state - this.storageService = instantiationService.createInstance(StorageService, window.localStorage, disableWorkspaceStorage ? inMemoryLocalStorageInstance : window.localStorage); - serviceCollection.set(IStorageService, this.storageService); - // Warm up font cache information before building up too many dom elements restoreFontInfo(this.storageService); readFontInfo(BareFontInfo.createFromRawSettings(this.configurationService.getConfiguration('editor'), browser.getZoomLevel())); @@ -341,24 +305,30 @@ export class WorkbenchShell { : TelemetryService.IDLE_START_EVENT_NAME )); - disposables.add(telemetryService, errorTelemetry, listener, idleMonitor); + disposables.push(telemetryService, errorTelemetry, listener, idleMonitor); } else { NullTelemetryService._experiments = instantiationService.invokeFunction(loadExperiments); this.telemetryService = NullTelemetryService; } serviceCollection.set(ITelemetryService, this.telemetryService); - disposables.add(configurationTelemetry(this.telemetryService, this.configurationService)); + disposables.push(configurationTelemetry(this.telemetryService, this.configurationService)); + + let crashReporterService = NullCrashReporterService; + if (product.crashReporter && product.hockeyApp) { + crashReporterService = instantiationService.createInstance(CrashReporterService); + } + serviceCollection.set(ICrashReporterService, crashReporterService); this.messageService = instantiationService.createInstance(MessageService, container); serviceCollection.set(IMessageService, this.messageService); serviceCollection.set(IChoiceService, this.messageService); const lifecycleService = instantiationService.createInstance(LifecycleService); - this.toUnbind.push(lifecycleService.onShutdown(reason => disposables.dispose())); + this.toUnbind.push(lifecycleService.onShutdown(reason => dispose(disposables))); this.toUnbind.push(lifecycleService.onShutdown(reason => saveFontInfo(this.storageService))); serviceCollection.set(ILifecycleService, lifecycleService); - disposables.add(lifecycleTelemetry(this.telemetryService, lifecycleService)); + disposables.push(lifecycleTelemetry(this.telemetryService, lifecycleService)); this.lifecycleService = lifecycleService; const extensionManagementChannel = getDelayedChannel(sharedProcess.then(c => c.getChannel('extensions'))); @@ -366,7 +336,7 @@ export class WorkbenchShell { const extensionEnablementService = instantiationService.createInstance(ExtensionEnablementService); serviceCollection.set(IExtensionEnablementService, extensionEnablementService); - disposables.add(extensionEnablementService); + disposables.push(extensionEnablementService); const extensionHostProcessWorker = instantiationService.createInstance(ExtensionHostProcessWorker); this.threadService = instantiationService.createInstance(MainThreadService, extensionHostProcessWorker.messagingProtocol); @@ -397,11 +367,13 @@ export class WorkbenchShell { serviceCollection.set(IModelService, new SyncDescriptor(ModelServiceImpl)); + serviceCollection.set(ITextResourceConfigurationService, new SyncDescriptor(TextResourceConfigurationService)); + serviceCollection.set(IEditorWorkerService, new SyncDescriptor(EditorWorkerServiceImpl)); serviceCollection.set(IUntitledEditorService, new SyncDescriptor(UntitledEditorService)); - serviceCollection.set(ITextMateService, new SyncDescriptor(MainProcessTextMateSyntax)); + serviceCollection.set(ITextMateService, new SyncDescriptor(TextMateService)); serviceCollection.set(ISearchService, new SyncDescriptor(SearchService)); @@ -415,9 +387,6 @@ export class WorkbenchShell { const urlChannel = mainProcessClient.getChannel('url'); serviceCollection.set(IURLService, new SyncDescriptor(URLChannelClient, urlChannel, this.windowIPCService.getWindowId())); - const backupChannel = mainProcessClient.getChannel('backup'); - serviceCollection.set(IBackupService, new SyncDescriptor(BackupChannelClient, backupChannel)); - return [instantiationService, serviceCollection]; } diff --git a/src/vs/workbench/electron-browser/window.ts b/src/vs/workbench/electron-browser/window.ts index be59101349eb9bded899bed3bdf24c4f6558d8cd..fadbbda88acb9c700db4d9a9a258cfe19bd0e984 100644 --- a/src/vs/workbench/electron-browser/window.ts +++ b/src/vs/workbench/electron-browser/window.ts @@ -25,20 +25,20 @@ import { toResource } from 'vs/workbench/common/editor'; import { IWorkbenchEditorService, IResourceInputType } from 'vs/workbench/services/editor/common/editorService'; import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService'; import { IMessageService } from 'vs/platform/message/common/message'; +import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IWorkspaceConfigurationService } from 'vs/workbench/services/configuration/common/configuration'; -import { IWindowsService, IWindowService, IWindowSettings } from 'vs/platform/windows/common/windows'; +import { IWindowsService, IWindowService, IWindowSettings, IWindowConfiguration, IPath, IOpenFileRequest } from 'vs/platform/windows/common/windows'; import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; import { IWindowIPCService } from 'vs/workbench/services/window/electron-browser/windowService'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { IPath, IOpenFileRequest, IWindowConfiguration } from 'vs/workbench/electron-browser/common'; import { IConfigurationEditingService, ConfigurationTarget } from 'vs/workbench/services/configuration/common/configurationEditing'; import { ITitleService } from 'vs/workbench/services/title/common/titleService'; import { IWorkbenchThemeService, VS_HC_THEME, VS_DARK_THEME } from 'vs/workbench/services/themes/common/workbenchThemeService'; import * as browser from 'vs/base/browser/browser'; import { ICommandService } from 'vs/platform/commands/common/commands'; import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; -import { Position, IResourceInput, IUntitledResourceInput } from 'vs/platform/editor/common/editor'; +import { Position, IResourceInput, IUntitledResourceInput, IEditor } from 'vs/platform/editor/common/editor'; import { IExtensionService } from 'vs/platform/extensions/common/extensions'; import { KeyboardMapperFactory } from 'vs/workbench/services/keybinding/electron-browser/keybindingService'; import { Themable, EDITOR_DRAG_AND_DROP_BACKGROUND } from 'vs/workbench/common/theme'; @@ -85,7 +85,8 @@ export class ElectronWindow extends Themable { @IViewletService private viewletService: IViewletService, @IContextMenuService private contextMenuService: IContextMenuService, @IKeybindingService private keybindingService: IKeybindingService, - @IEnvironmentService private environmentService: IEnvironmentService + @IEnvironmentService private environmentService: IEnvironmentService, + @ITelemetryService private telemetryService: ITelemetryService ) { super(themeService); @@ -98,14 +99,12 @@ export class ElectronWindow extends Themable { private registerListeners(): void { - // React to editor input changes (Mac only) - if (platform.platform === platform.Platform.Mac) { - this.editorGroupService.onEditorsChanged(() => { - const file = toResource(this.editorService.getActiveEditorInput(), { supportSideBySide: true, filter: 'file' }); + // React to editor input changes + this.editorGroupService.onEditorsChanged(() => { + const file = toResource(this.editorService.getActiveEditorInput(), { supportSideBySide: true, filter: 'file' }); - this.titleService.setRepresentedFilename(file ? file.fsPath : ''); - }); - } + this.titleService.setRepresentedFilename(file ? file.fsPath : ''); + }); let draggedExternalResources: URI[]; let dropOverlay: Builder; @@ -151,7 +150,8 @@ export class ElectronWindow extends Themable { if (draggedExternalResources.length > 20) { doOpen = this.messageService.confirm({ message: nls.localize('confirmOpen', "Are you sure you want to open {0} folders?", draggedExternalResources.length), - primaryButton: nls.localize({ key: 'confirmOpenButton', comment: ['&& denotes a mnemonic'] }, "&&Open") + primaryButton: nls.localize({ key: 'confirmOpenButton', comment: ['&& denotes a mnemonic'] }, "&&Open"), + type: 'question' }); } @@ -208,7 +208,11 @@ export class ElectronWindow extends Themable { // Support runAction event ipc.on('vscode:runAction', (event, actionId: string) => { - this.commandService.executeCommand(actionId, { from: 'menu' }).done(undefined, err => this.messageService.show(Severity.Error, err)); + this.commandService.executeCommand(actionId, { from: 'menu' }).done(_ => { + this.telemetryService.publicLog('commandExecuted', { id: actionId, from: 'menu' }); + }, err => { + this.messageService.show(Severity.Error, err); + }); }); // Support resolve keybindings event @@ -304,7 +308,7 @@ export class ElectronWindow extends Themable { // Configuration changes let previousConfiguredZoomLevel: number; this.configurationService.onDidUpdateConfiguration(e => { - const windowConfig: IWindowConfiguration = e.config; + const windowConfig: IWindowConfiguration = this.configurationService.getConfiguration(); let newZoomLevel = 0; if (windowConfig.window && typeof windowConfig.window.zoomLevel === 'number') { @@ -337,9 +341,8 @@ export class ElectronWindow extends Themable { e.stopPropagation(); this.contextMenuService.showContextMenu({ - getAnchor: () => target, - getActions: () => TPromise.as(TextInputActions), - getKeyBinding: action => this.keybindingService.lookupKeybinding(action.id) + getAnchor: () => e, + getActions: () => TPromise.as(TextInputActions) }); } } @@ -392,8 +395,9 @@ export class ElectronWindow extends Themable { } } - private openResources(resources: (IResourceInput | IUntitledResourceInput)[], diffMode: boolean): TPromise { - return this.partService.joinCreation().then(() => { + private openResources(resources: (IResourceInput | IUntitledResourceInput)[], diffMode: boolean): TPromise { + return this.partService.joinCreation().then((): TPromise => { + // In diffMode we open 2 resources as diff if (diffMode && resources.length === 2) { @@ -479,4 +483,4 @@ export class ElectronWindow extends Themable { public focus(): TPromise { return this.windowService.focusWindow(); } -} \ No newline at end of file +} diff --git a/src/vs/workbench/electron-browser/workbench.main.ts b/src/vs/workbench/electron-browser/workbench.main.ts index 0d6c2c4aa0c22da3c97e366631bb5c43f2d59d61..5dfb796f5424f47f8ea9765cf5abe7b4f385cf98 100644 --- a/src/vs/workbench/electron-browser/workbench.main.ts +++ b/src/vs/workbench/electron-browser/workbench.main.ts @@ -10,10 +10,7 @@ import 'vs/base/common/strings'; import 'vs/base/common/errors'; // Editor -import 'vs/editor/contrib/accessibility/browser/accessibility'; -import 'vs/editor/contrib/inspectTMScopes/electron-browser/inspectTMScopes'; -import 'vs/editor/contrib/selectionClipboard/electron-browser/selectionClipboard'; -import 'vs/editor/browser/editor.all'; +import 'vs/editor/editor.all'; // Menus/Actions import 'vs/platform/actions/electron-browser/menusExtensionPoint'; @@ -32,6 +29,7 @@ import 'vs/workbench/parts/preferences/browser/preferences.contribution'; import 'vs/workbench/parts/preferences/browser/keybindingsEditorContribution'; import 'vs/workbench/browser/actions/configureLocale'; +import 'vs/workbench/browser/parts/quickopen/quickopen.contribution'; import 'vs/workbench/parts/quickopen/browser/quickopen.contribution'; import 'vs/workbench/browser/parts/editor/editorPicker'; diff --git a/src/vs/workbench/electron-browser/workbench.ts b/src/vs/workbench/electron-browser/workbench.ts index 86c445e811c253f54c1bfab6363b03e6086b3786..4b0b4b861b58b174bbf80b15b9997b5b20895a2c 100644 --- a/src/vs/workbench/electron-browser/workbench.ts +++ b/src/vs/workbench/electron-browser/workbench.ts @@ -7,6 +7,7 @@ import 'vs/css!./media/workbench'; +import { localize } from 'vs/nls'; import { TPromise, ValueCallback } from 'vs/base/common/winjs.base'; import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import Event, { Emitter, chain } from 'vs/base/common/event'; @@ -21,7 +22,7 @@ import errors = require('vs/base/common/errors'); import { BackupFileService } from 'vs/workbench/services/backup/node/backupFileService'; import { IBackupFileService } from 'vs/workbench/services/backup/common/backup'; import { toErrorMessage } from 'vs/base/common/errorMessage'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { isWindows, isLinux, isMacintosh } from 'vs/base/common/platform'; import { IOptions } from 'vs/workbench/common/options'; import { Position as EditorPosition, IResourceDiffInput, IUntitledResourceInput, IEditor } from 'vs/platform/editor/common/editor'; @@ -35,7 +36,7 @@ import { PanelPart } from 'vs/workbench/browser/parts/panel/panelPart'; import { StatusbarPart } from 'vs/workbench/browser/parts/statusbar/statusbarPart'; import { TitlebarPart } from 'vs/workbench/browser/parts/titlebar/titlebarPart'; import { WorkbenchLayout } from 'vs/workbench/browser/layout'; -import { IActionBarRegistry, Extensions as ActionBarExtensions } from 'vs/workbench/browser/actionBarRegistry'; +import { IActionBarRegistry, Extensions as ActionBarExtensions } from 'vs/workbench/browser/actions'; import { PanelRegistry, Extensions as PanelExtensions } from 'vs/workbench/browser/panel'; import { QuickOpenController } from 'vs/workbench/browser/parts/quickopen/quickOpenController'; import { getServices } from 'vs/platform/instantiation/common/extensions'; @@ -46,7 +47,7 @@ import { IStorageService, StorageScope } from 'vs/platform/storage/common/storag import { ContextMenuService } from 'vs/workbench/services/contextview/electron-browser/contextmenuService'; import { WorkbenchKeybindingService } from 'vs/workbench/services/keybinding/electron-browser/keybindingService'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { WorkspaceConfigurationService } from 'vs/workbench/services/configuration/node/configurationService'; +import { WorkspaceConfigurationService } from 'vs/workbench/services/configuration/node/configuration'; import { IConfigurationEditingService } from 'vs/workbench/services/configuration/common/configurationEditing'; import { ConfigurationEditingService } from 'vs/workbench/services/configuration/node/configurationEditingService'; import { ContextKeyService } from 'vs/platform/contextkey/browser/contextKeyService'; @@ -79,10 +80,10 @@ import { SCMService } from 'vs/workbench/services/scm/common/scmService'; import { IProgressService2 } from 'vs/platform/progress/common/progress'; import { ProgressService2 } from 'vs/workbench/services/progress/browser/progressService2'; import { TextModelResolverService } from 'vs/workbench/services/textmodelResolver/common/textModelResolverService'; -import { ITextModelResolverService } from 'vs/editor/common/services/resolverService'; +import { ITextModelService } from 'vs/editor/common/services/resolverService'; import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; import { ILifecycleService, ShutdownReason } from 'vs/platform/lifecycle/common/lifecycle'; -import { IWindowService } from 'vs/platform/windows/common/windows'; +import { IWindowService, IWindowConfiguration as IWindowSettings, IWindowConfiguration } from 'vs/platform/windows/common/windows'; import { IMessageService } from 'vs/platform/message/common/message'; import { IStatusbarService } from 'vs/platform/statusbar/common/statusbar'; import { IMenuService, SyncActionDescriptor } from 'vs/platform/actions/common/actions'; @@ -90,12 +91,13 @@ import { MenuService } from 'vs/platform/actions/common/menuService'; import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { IWindowConfiguration } from 'vs/workbench/electron-browser/common'; -import { localize } from "vs/nls"; -import { IWorkbenchActionRegistry, Extensions } from "vs/workbench/common/actionRegistry"; -import { OpenRecentAction, ToggleDevToolsAction, ReloadWindowAction } from "vs/workbench/electron-browser/actions"; -import { KeyMod } from "vs/base/common/keyCodes"; -import { KeyCode } from "vs/editor/common/standalone/standaloneBase"; +import { IWorkbenchActionRegistry, Extensions } from 'vs/workbench/common/actionRegistry'; +import { OpenRecentAction, ToggleDevToolsAction, ReloadWindowAction, inRecentFilesPickerContextKey } from "vs/workbench/electron-browser/actions"; +import { KeyMod, KeyCode } from 'vs/base/common/keyCodes'; +import { KeybindingsRegistry } from "vs/platform/keybinding/common/keybindingsRegistry"; +import { getQuickNavigateHandler, inQuickOpenContext } from "vs/workbench/browser/parts/quickopen/quickopen"; +import { IWorkspaceEditingService } from "vs/workbench/services/workspace/common/workspaceEditing"; +import { WorkspaceEditingService } from "vs/workbench/services/workspace/node/workspaceEditingService"; export const MessagesVisibleContext = new RawContextKey('globalMessageVisible', false); export const EditorsVisibleContext = new RawContextKey('editorIsOpen', false); @@ -104,6 +106,7 @@ export const NoEditorsVisibleContext: ContextKeyExpr = EditorsVisibleContext.toN interface WorkbenchParams { options: IOptions; + configuration: IWindowConfiguration; serviceCollection: ServiceCollection; } @@ -204,6 +207,7 @@ export class Workbench implements IPartService { constructor( parent: HTMLElement, container: HTMLElement, + configuration: IWindowConfiguration, options: IOptions, serviceCollection: ServiceCollection, @IInstantiationService private instantiationService: IInstantiationService, @@ -221,6 +225,7 @@ export class Workbench implements IPartService { this.workbenchParams = { options, + configuration, serviceCollection }; @@ -390,7 +395,29 @@ export class Workbench implements IPartService { const workbenchActionsRegistry = Registry.as(Extensions.WorkbenchActions); workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(ReloadWindowAction, ReloadWindowAction.ID, ReloadWindowAction.LABEL, isDeveloping ? { primary: KeyMod.CtrlCmd | KeyCode.KEY_R } : void 0), 'Reload Window'); workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(ToggleDevToolsAction, ToggleDevToolsAction.ID, ToggleDevToolsAction.LABEL, isDeveloping ? { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_I, mac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KEY_I } } : void 0), 'Developer: Toggle Developer Tools', localize('developer', "Developer")); - workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(OpenRecentAction, OpenRecentAction.ID, OpenRecentAction.LABEL, { primary: isDeveloping ? null : KeyMod.CtrlCmd | KeyCode.KEY_R, mac: { primary: KeyMod.WinCtrl | KeyCode.KEY_R } }), 'File: Open Recent', localize('file', "File")); + workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(OpenRecentAction, OpenRecentAction.ID, OpenRecentAction.LABEL, { primary: isDeveloping ? null : KeyMod.CtrlCmd | KeyCode.KEY_R, mac: { primary: KeyMod.WinCtrl | KeyCode.KEY_R } }), 'File: Open Recent...', localize('file', "File")); + + const recentFilesPickerContext = ContextKeyExpr.and(inQuickOpenContext, ContextKeyExpr.has(inRecentFilesPickerContextKey)); + + const quickOpenNavigateNextInRecentFilesPickerId = 'workbench.action.quickOpenNavigateNextInRecentFilesPicker'; + KeybindingsRegistry.registerCommandAndKeybindingRule({ + id: quickOpenNavigateNextInRecentFilesPickerId, + weight: KeybindingsRegistry.WEIGHT.workbenchContrib(50), + handler: getQuickNavigateHandler(quickOpenNavigateNextInRecentFilesPickerId, true), + when: recentFilesPickerContext, + primary: KeyMod.CtrlCmd | KeyCode.KEY_R, + mac: { primary: KeyMod.WinCtrl | KeyCode.KEY_R } + }); + + const quickOpenNavigatePreviousInRecentFilesPicker = 'workbench.action.quickOpenNavigatePreviousInRecentFilesPicker'; + KeybindingsRegistry.registerCommandAndKeybindingRule({ + id: quickOpenNavigatePreviousInRecentFilesPicker, + weight: KeybindingsRegistry.WEIGHT.workbenchContrib(50), + handler: getQuickNavigateHandler(quickOpenNavigatePreviousInRecentFilesPicker, false), + when: recentFilesPickerContext, + primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_R, + mac: { primary: KeyMod.WinCtrl | KeyMod.Shift | KeyCode.KEY_R } + }); } private resolveEditorsToOpen(): TPromise { @@ -424,8 +451,12 @@ export class Workbench implements IPartService { } } - // Empty workbench: some first time users will not have an untiled file; returning users will always have one - else if (!this.contextService.hasWorkspace() && this.telemetryService.getExperiments().openUntitledFile && !this.configurationService.lookup('workbench.welcome.enabled').value) { + // Empty workbench + else if (!this.contextService.hasWorkspace() && this.openUntitledFile()) { + if (this.editorPart.hasEditorsToRestore()) { + return TPromise.as([]); // do not open any empty untitled file if we have editors to restore + } + return this.backupFileService.hasBackups().then(hasBackups => { if (hasBackups) { return TPromise.as([]); // do not open any empty untitled file if we have backups to restore @@ -438,6 +469,10 @@ export class Workbench implements IPartService { return TPromise.as([]); } + private openUntitledFile() { + return !this.configurationService.lookup('workbench.welcome.enabled').value; + } + private initServices(): void { const { serviceCollection } = this.workbenchParams; @@ -518,7 +553,7 @@ export class Workbench implements IPartService { serviceCollection.set(IHistoryService, new SyncDescriptor(HistoryService)); // Backup File Service - this.backupFileService = this.instantiationService.createInstance(BackupFileService); + this.backupFileService = this.instantiationService.createInstance(BackupFileService, this.workbenchParams.configuration.backupPath); serviceCollection.set(IBackupFileService, this.backupFileService); // Text File Service @@ -528,12 +563,15 @@ export class Workbench implements IPartService { serviceCollection.set(ISCMService, new SyncDescriptor(SCMService)); // Text Model Resolver Service - serviceCollection.set(ITextModelResolverService, new SyncDescriptor(TextModelResolverService)); + serviceCollection.set(ITextModelService, new SyncDescriptor(TextModelResolverService)); // Configuration Editing this.configurationEditingService = this.instantiationService.createInstance(ConfigurationEditingService); serviceCollection.set(IConfigurationEditingService, this.configurationEditingService); + // Workspace Editing + serviceCollection.set(IWorkspaceEditingService, new SyncDescriptor(WorkspaceEditingService)); + // Keybinding Editing serviceCollection.set(IKeybindingEditingService, this.instantiationService.createInstance(KeybindingsEditingService)); @@ -562,16 +600,13 @@ export class Workbench implements IPartService { private initSettings(): void { // Sidebar visibility - this.sideBarHidden = this.storageService.getBoolean(Workbench.sidebarHiddenSettingKey, StorageScope.WORKSPACE, false); - if (!this.contextService.hasWorkspace()) { - this.sideBarHidden = true; // we hide sidebar in single-file-mode - } + this.sideBarHidden = this.storageService.getBoolean(Workbench.sidebarHiddenSettingKey, StorageScope.WORKSPACE, !this.contextService.hasWorkspace()); // Panel part visibility const panelRegistry = Registry.as(PanelExtensions.Panels); this.panelHidden = this.storageService.getBoolean(Workbench.panelHiddenSettingKey, StorageScope.WORKSPACE, true); - if (!this.contextService.hasWorkspace() || !panelRegistry.getDefaultPanelId()) { - this.panelHidden = true; // we hide panel part in single-file-mode or if there is no default panel + if (!panelRegistry.getDefaultPanelId()) { + this.panelHidden = true; // we hide panel part if there is no default panel } // Sidebar position @@ -684,7 +719,7 @@ export class Workbench implements IPartService { return null; // not enabled when developing due to https://github.com/electron/electron/issues/3647 } - const windowConfig = this.configurationService.getConfiguration(); + const windowConfig = this.configurationService.getConfiguration(); if (windowConfig && windowConfig.window) { const useNativeTabs = windowConfig.window.nativeTabs; if (useNativeTabs) { @@ -730,8 +765,8 @@ export class Workbench implements IPartService { this.workbench.removeClass('nosidebar'); } - let promise = TPromise.as(null); // If sidebar becomes hidden, also hide the current active Viewlet if any + let promise = TPromise.as(null); if (hidden && this.sidebarPart.getActiveViewlet()) { promise = this.sidebarPart.hideActiveViewlet().then(() => { const activeEditor = this.editorPart.getActiveEditor(); @@ -748,15 +783,21 @@ export class Workbench implements IPartService { // If sidebar becomes visible, show last active Viewlet or default viewlet else if (!hidden && !this.sidebarPart.getActiveViewlet()) { - const viewletToOpen = this.sidebarPart.getLastActiveViewletId() || this.viewletService.getDefaultViewletId(); + const viewletToOpen = this.sidebarPart.getLastActiveViewletId(); if (viewletToOpen) { promise = this.sidebarPart.openViewlet(viewletToOpen, true); } } return promise.then(() => { + // Remember in settings - this.storageService.store(Workbench.sidebarHiddenSettingKey, hidden ? 'true' : 'false', StorageScope.WORKSPACE); + const defaultHidden = !this.contextService.hasWorkspace(); + if (hidden !== defaultHidden) { + this.storageService.store(Workbench.sidebarHiddenSettingKey, hidden ? 'true' : 'false', StorageScope.WORKSPACE); + } else { + this.storageService.remove(Workbench.sidebarHiddenSettingKey, StorageScope.WORKSPACE); + } // Layout if (!skipLayout) { @@ -775,8 +816,8 @@ export class Workbench implements IPartService { this.workbench.removeClass('nopanel'); } - let promise = TPromise.as(null); // If panel part becomes hidden, also hide the current active panel if any + let promise = TPromise.as(null); if (hidden && this.panelPart.getActivePanel()) { promise = this.panelPart.hideActivePanel().then(() => { // Pass Focus to Editor if Panel part is now hidden @@ -789,16 +830,20 @@ export class Workbench implements IPartService { // If panel part becomes visible, show last active panel or default panel else if (!hidden && !this.panelPart.getActivePanel()) { - const registry = Registry.as(PanelExtensions.Panels); - const panelToOpen = this.panelPart.getLastActivePanelId() || registry.getDefaultPanelId(); + const panelToOpen = this.panelPart.getLastActivePanelId(); if (panelToOpen) { promise = this.panelPart.openPanel(panelToOpen, true); } } return promise.then(() => { + // Remember in settings - this.storageService.store(Workbench.panelHiddenSettingKey, hidden ? 'true' : 'false', StorageScope.WORKSPACE); + if (!hidden) { + this.storageService.store(Workbench.panelHiddenSettingKey, 'false', StorageScope.WORKSPACE); + } else { + this.storageService.remove(Workbench.panelHiddenSettingKey, StorageScope.WORKSPACE); + } // Layout if (!skipLayout) { @@ -868,9 +913,14 @@ export class Workbench implements IPartService { this.storageService.store(Workbench.sidebarRestoreSettingKey, 'true', StorageScope.WORKSPACE); } - const zenConfig = this.configurationService.getConfiguration('zenMode'); // Preserve zen mode only on reload. Real quit gets out of zen mode so novice users do not get stuck in zen mode. - this.storageService.store(Workbench.zenModeActiveSettingKey, (zenConfig.restore || reason === ShutdownReason.RELOAD) && this.zenMode.active, StorageScope.WORKSPACE); + const zenConfig = this.configurationService.getConfiguration('zenMode'); + const zenModeActive = (zenConfig.restore || reason === ShutdownReason.RELOAD) && this.zenMode.active; + if (zenModeActive) { + this.storageService.store(Workbench.zenModeActiveSettingKey, true, StorageScope.WORKSPACE); + } else { + this.storageService.remove(Workbench.zenModeActiveSettingKey, StorageScope.WORKSPACE); + } // Pass shutdown on to each participant this.toShutdown.forEach(s => s.shutdown()); diff --git a/src/vs/workbench/node/extensionHostMain.ts b/src/vs/workbench/node/extensionHostMain.ts index d84ec84c924266ec1c7d34b8f858f4e117b230a5..36507564ad4b347e83fa998251a3e67ba4d698b7 100644 --- a/src/vs/workbench/node/extensionHostMain.ts +++ b/src/vs/workbench/node/extensionHostMain.ts @@ -12,9 +12,10 @@ import { join } from 'path'; import { IRemoteCom } from 'vs/platform/extensions/common/ipcRemoteCom'; import { ExtHostExtensionService } from 'vs/workbench/api/node/extHostExtensionService'; import { ExtHostThreadService } from 'vs/workbench/services/thread/common/extHostThreadService'; +import { QueryType, ISearchQuery } from 'vs/platform/search/common/search'; +import { DiskSearch } from 'vs/workbench/services/search/node/searchService'; import { RemoteTelemetryService } from 'vs/workbench/api/node/extHostTelemetry'; -import { IWorkspaceContextService, WorkspaceContextService } from 'vs/platform/workspace/common/workspace'; -import { IInitData, IEnvironment, MainContext } from 'vs/workbench/api/node/extHost.protocol'; +import { IInitData, IEnvironment, IWorkspaceData, MainContext } from 'vs/workbench/api/node/extHost.protocol'; import * as errors from 'vs/base/common/errors'; const nativeExit = process.exit.bind(process); @@ -33,17 +34,19 @@ interface ITestRunner { export class ExtensionHostMain { private _isTerminating: boolean = false; - private _contextService: IWorkspaceContextService; + private _diskSearch: DiskSearch; + private _workspace: IWorkspaceData; private _environment: IEnvironment; private _extensionService: ExtHostExtensionService; constructor(remoteCom: IRemoteCom, initData: IInitData) { - // services this._environment = initData.environment; - this._contextService = new WorkspaceContextService(initData.contextService.workspace); + this._workspace = initData.workspace; + + // services const threadService = new ExtHostThreadService(remoteCom); const telemetryService = new RemoteTelemetryService('pluginHostTelemetry', threadService); - this._extensionService = new ExtHostExtensionService(initData, threadService, telemetryService, this._contextService); + this._extensionService = new ExtHostExtensionService(initData, threadService, telemetryService); // Error forwarding const mainThreadErrors = threadService.get(MainContext.MainThreadErrors); @@ -97,13 +100,10 @@ export class ExtensionHostMain { } private handleWorkspaceContainsEagerExtensions(): TPromise { - let workspace = this._contextService.getWorkspace(); - if (!workspace || !workspace.resource) { + if (!this._workspace || this._workspace.roots.length === 0) { return TPromise.as(null); } - const folderPath = workspace.resource.fsPath; - const desiredFilesMap: { [filename: string]: boolean; } = {}; @@ -122,13 +122,42 @@ export class ExtensionHostMain { } }); - const fileNames = Object.keys(desiredFilesMap); + const matchingPatterns = Object.keys(desiredFilesMap).map(p => { + // TODO: This is a bit hacky -- maybe this should be implemented by using something like + // `workspaceGlob` or something along those lines? + if (p.indexOf('*') > -1 || p.indexOf('?') > -1) { + if (!this._diskSearch) { + // Shut down this search process after 1s + this._diskSearch = new DiskSearch(false, 1000); + } + + const query: ISearchQuery = { + folderQueries: this._workspace.roots.map(root => ({ folder: root })), + type: QueryType.File, + maxResults: 1, + includePattern: { [p]: true } + }; + + return this._diskSearch.search(query).then(result => result.results.length ? p : undefined); + } else { + // find exact path + return new TPromise(async resolve => { + for (const { fsPath } of this._workspace.roots) { + if (await pfs.exists(join(fsPath, p))) { + resolve(p); + return; + } + } + resolve(undefined); + }); + } + }); - return TPromise.join(fileNames.map(f => pfs.exists(join(folderPath, f)))).then(exists => { - fileNames - .filter((f, i) => exists[i]) - .forEach(fileName => { - const activationEvent = `workspaceContains:${fileName}`; + return TPromise.join(matchingPatterns).then(patterns => { + patterns + .filter(p => p !== undefined) + .forEach(p => { + const activationEvent = `workspaceContains:${p}`; this._extensionService.activateByEvent(activationEvent) .done(null, err => console.error(err)); diff --git a/src/vs/workbench/node/extensionPoints.ts b/src/vs/workbench/node/extensionPoints.ts index bcb6fc2206d194edb68ebcb3afc7be14baa3c89b..c1b76d345ecf186a365ce067ab858161a4046dae 100644 --- a/src/vs/workbench/node/extensionPoints.ts +++ b/src/vs/workbench/node/extensionPoints.ts @@ -18,7 +18,7 @@ import Types = require('vs/base/common/types'); import { isValidExtensionDescription } from 'vs/platform/extensions/node/extensionValidator'; import * as semver from 'semver'; import { getIdAndVersionFromLocalExtensionId } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; -import { getParseErrorMessage } from "vs/base/common/jsonErrorMessages"; +import { getParseErrorMessage } from 'vs/base/common/jsonErrorMessages'; const MANIFEST_FILE = 'package.json'; diff --git a/src/vs/workbench/parts/backup/common/backup.contribution.ts b/src/vs/workbench/parts/backup/common/backup.contribution.ts index c531ff3baa371903b0a671e355896f22ae42f8bd..cd58285fff020011f1603d601bdbc417f048094e 100644 --- a/src/vs/workbench/parts/backup/common/backup.contribution.ts +++ b/src/vs/workbench/parts/backup/common/backup.contribution.ts @@ -5,7 +5,7 @@ 'use strict'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } from 'vs/workbench/common/contributions'; import { BackupModelTracker } from 'vs/workbench/parts/backup/common/backupModelTracker'; import { BackupRestorer } from 'vs/workbench/parts/backup/common/backupRestorer'; diff --git a/src/vs/workbench/parts/backup/common/backupModelTracker.ts b/src/vs/workbench/parts/backup/common/backupModelTracker.ts index c437b4d70f8756eeabb8ece2415444a6ffb38da4..787897cd389bc19005af52587373a24a35df8743 100644 --- a/src/vs/workbench/parts/backup/common/backupModelTracker.ts +++ b/src/vs/workbench/parts/backup/common/backupModelTracker.ts @@ -11,7 +11,6 @@ import { IBackupFileService } from 'vs/workbench/services/backup/common/backup'; import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { ITextFileService, TextFileModelChangeEvent, StateChange } from 'vs/workbench/services/textfile/common/textfiles'; import { IUntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import { IWorkbenchContribution } from 'vs/workbench/common/contributions'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IFilesConfiguration, AutoSaveConfiguration, CONTENT_CHANGE_EVENT_BUFFER_DELAY } from 'vs/platform/files/common/files'; @@ -29,7 +28,6 @@ export class BackupModelTracker implements IWorkbenchContribution { @IBackupFileService private backupFileService: IBackupFileService, @ITextFileService private textFileService: ITextFileService, @IUntitledEditorService private untitledEditorService: IUntitledEditorService, - @IEnvironmentService private environmentService: IEnvironmentService, @IConfigurationService private configurationService: IConfigurationService ) { this.toDispose = []; @@ -38,7 +36,7 @@ export class BackupModelTracker implements IWorkbenchContribution { } private registerListeners() { - if (this.environmentService.isExtensionDevelopment) { + if (!this.backupFileService.backupEnabled) { return; } @@ -52,7 +50,7 @@ export class BackupModelTracker implements IWorkbenchContribution { this.toDispose.push(this.untitledEditorService.onDidDisposeModel((e) => this.discardBackup(e))); // Listen to config changes - this.toDispose.push(this.configurationService.onDidUpdateConfiguration(e => this.onConfigurationChange(e.config))); + this.toDispose.push(this.configurationService.onDidUpdateConfiguration(e => this.onConfigurationChange(this.configurationService.getConfiguration()))); } private onConfigurationChange(configuration: IFilesConfiguration): void { @@ -80,9 +78,8 @@ export class BackupModelTracker implements IWorkbenchContribution { } private onUntitledModelChanged(resource: Uri): void { - const input = this.untitledEditorService.get(resource); - if (input.isDirty()) { - input.resolve().then(model => this.backupFileService.backupResource(resource, model.getValue(), model.getVersionId())).done(null, errors.onUnexpectedError); + if (this.untitledEditorService.isDirty(resource)) { + this.untitledEditorService.loadOrCreate({ resource }).then(model => this.backupFileService.backupResource(resource, model.getValue(), model.getVersionId())).done(null, errors.onUnexpectedError); } else { this.discardBackup(resource); } diff --git a/src/vs/workbench/parts/backup/common/backupRestorer.ts b/src/vs/workbench/parts/backup/common/backupRestorer.ts index 77603e199d9c08f8ba1b9bc9a930766a3ba03327..76380720bce1d13d46435a8eb4acc608df5d14a1 100644 --- a/src/vs/workbench/parts/backup/common/backupRestorer.ts +++ b/src/vs/workbench/parts/backup/common/backupRestorer.ts @@ -7,8 +7,7 @@ import URI from 'vs/base/common/uri'; import { TPromise } from 'vs/base/common/winjs.base'; -import { IUntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; +import { IUntitledEditorService, UNTITLED_SCHEMA } from 'vs/workbench/services/untitled/common/untitledEditorService'; import { IWorkbenchContribution } from 'vs/workbench/common/contributions'; import { IPartService } from 'vs/workbench/services/part/common/partService'; import errors = require('vs/base/common/errors'); @@ -17,6 +16,7 @@ import { IEditorGroupService } from 'vs/workbench/services/group/common/groupSer import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; import { Position, IResourceInput, IUntitledResourceInput } from 'vs/platform/editor/common/editor'; import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; +import { Schemas } from "vs/base/common/network"; export class BackupRestorer implements IWorkbenchContribution { @@ -24,7 +24,6 @@ export class BackupRestorer implements IWorkbenchContribution { constructor( @IUntitledEditorService private untitledEditorService: IUntitledEditorService, - @IEnvironmentService private environmentService: IEnvironmentService, @IPartService private partService: IPartService, @IWorkbenchEditorService private editorService: IWorkbenchEditorService, @IBackupFileService private backupFileService: IBackupFileService, @@ -35,14 +34,14 @@ export class BackupRestorer implements IWorkbenchContribution { } private restoreBackups(): void { - if (!this.environmentService.isExtensionDevelopment) { + if (this.backupFileService.backupEnabled) { this.partService.joinCreation().then(() => { this.doRestoreBackups().done(null, errors.onUnexpectedError); }); } } - private doRestoreBackups(): TPromise { + private doRestoreBackups(): TPromise { // Find all files and untitled with backups return this.backupFileService.getWorkspaceFileBackups().then(backups => { @@ -54,7 +53,8 @@ export class BackupRestorer implements IWorkbenchContribution { if (unresolved.length > 0) { return this.doOpenEditors(unresolved).then(() => this.doResolveOpenedBackups(unresolved)); } - return undefined; + + return void 0; }); }); } @@ -62,15 +62,15 @@ export class BackupRestorer implements IWorkbenchContribution { private doResolveOpenedBackups(backups: URI[]): TPromise { const stacks = this.groupService.getStacksModel(); - const restorePromises: TPromise[] = []; + const restorePromises: TPromise[] = []; const unresolved: URI[] = []; backups.forEach(backup => { if (stacks.isOpen(backup)) { - if (backup.scheme === 'file') { + if (backup.scheme === Schemas.file) { restorePromises.push(this.textFileService.models.loadOrCreate(backup).then(null, () => unresolved.push(backup))); - } else if (backup.scheme === 'untitled') { - restorePromises.push(this.untitledEditorService.get(backup).resolve().then(null, () => unresolved.push(backup))); + } else if (backup.scheme === UNTITLED_SCHEMA) { + restorePromises.push(this.untitledEditorService.loadOrCreate({ resource: backup }).then(null, () => unresolved.push(backup))); } } else { unresolved.push(backup); @@ -92,7 +92,7 @@ export class BackupRestorer implements IWorkbenchContribution { private resolveInput(resource: URI, index: number, hasOpenedEditors: boolean): IResourceInput | IUntitledResourceInput { const options = { pinned: true, preserveFocus: true, inactive: index > 0 || hasOpenedEditors }; - if (resource.scheme === 'untitled' && !BackupRestorer.UNTITLED_REGEX.test(resource.fsPath)) { + if (resource.scheme === UNTITLED_SCHEMA && !BackupRestorer.UNTITLED_REGEX.test(resource.fsPath)) { // TODO@Ben debt: instead of guessing if an untitled file has an associated file path or not // this information should be provided by the backup service and stored as meta data within return { filePath: resource.fsPath, options }; @@ -101,7 +101,6 @@ export class BackupRestorer implements IWorkbenchContribution { return { resource, options }; } - public getId(): string { return 'vs.backup.backupRestorer'; } diff --git a/src/vs/workbench/parts/cli/electron-browser/cli.contribution.ts b/src/vs/workbench/parts/cli/electron-browser/cli.contribution.ts index 4ee6bb14480f075e9d216077fc700662cfa84d5e..053bfa2d5546a5de3c9c29017b966110936e478b 100644 --- a/src/vs/workbench/parts/cli/electron-browser/cli.contribution.ts +++ b/src/vs/workbench/parts/cli/electron-browser/cli.contribution.ts @@ -12,7 +12,7 @@ import { TPromise } from 'vs/base/common/winjs.base'; import URI from 'vs/base/common/uri'; import { Action } from 'vs/base/common/actions'; import { IWorkbenchActionRegistry, Extensions as ActionExtensions } from 'vs/workbench/common/actionRegistry'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { SyncActionDescriptor } from 'vs/platform/actions/common/actions'; import { IMessageService, Severity } from 'vs/platform/message/common/message'; import { IEditorService } from 'vs/platform/editor/common/editor'; diff --git a/src/vs/workbench/parts/codeEditor/codeEditor.contribution.ts b/src/vs/workbench/parts/codeEditor/codeEditor.contribution.ts index 7e8a05cdce05f9cc42c7ca0bd48d64bff8051ac4..ce3998d91879c10d69eafc742372ace2003314f4 100644 --- a/src/vs/workbench/parts/codeEditor/codeEditor.contribution.ts +++ b/src/vs/workbench/parts/codeEditor/codeEditor.contribution.ts @@ -3,8 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ +import './electron-browser/accessibility'; +import './electron-browser/inspectKeybindings'; +import './electron-browser/menuPreventer'; +import './electron-browser/selectionClipboard'; +import './electron-browser/textMate/inspectTMScopes'; +import './electron-browser/toggleMultiCursorModifier'; import './electron-browser/toggleRenderControlCharacter'; import './electron-browser/toggleRenderWhitespace'; import './electron-browser/toggleWordWrap'; import './electron-browser/wordWrapMigration'; -import './electron-browser/inspectKeybindings'; diff --git a/src/vs/editor/contrib/accessibility/browser/accessibility.css b/src/vs/workbench/parts/codeEditor/electron-browser/accessibility.css similarity index 100% rename from src/vs/editor/contrib/accessibility/browser/accessibility.css rename to src/vs/workbench/parts/codeEditor/electron-browser/accessibility.css diff --git a/src/vs/editor/contrib/accessibility/browser/accessibility.ts b/src/vs/workbench/parts/codeEditor/electron-browser/accessibility.ts similarity index 60% rename from src/vs/editor/contrib/accessibility/browser/accessibility.ts rename to src/vs/workbench/parts/codeEditor/electron-browser/accessibility.ts index 1294dc7b3065fe30070c4dd83556dc5e6bb42b63..a88b7a7d35433b22bc07d50af661b844da939b7b 100644 --- a/src/vs/editor/contrib/accessibility/browser/accessibility.ts +++ b/src/vs/workbench/parts/codeEditor/electron-browser/accessibility.ts @@ -10,11 +10,11 @@ import * as nls from 'vs/nls'; import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; import { Disposable } from 'vs/base/common/lifecycle'; import * as strings from 'vs/base/common/strings'; -import { clearNode } from 'vs/base/browser/dom'; -import { renderHtml } from 'vs/base/browser/htmlContentRenderer'; +import * as dom from 'vs/base/browser/dom'; +import { renderFormattedText } from 'vs/base/browser/htmlContentRenderer'; import { FastDomNode, createFastDomNode } from 'vs/base/browser/fastDomNode'; import { Widget } from 'vs/base/browser/ui/widget'; -import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; +import { ServicesAccessor, IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { RawContextKey, IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { ICommonCodeEditor, IEditorContribution } from 'vs/editor/common/editorCommon'; @@ -25,6 +25,13 @@ import { editorContribution } from 'vs/editor/browser/editorBrowserExtensions'; import { ToggleTabFocusModeAction } from 'vs/editor/contrib/toggleTabFocusMode/common/toggleTabFocusMode'; import { registerThemingParticipant } from 'vs/platform/theme/common/themeService'; import { editorWidgetBackground, widgetShadow, contrastBorder } from 'vs/platform/theme/common/colorRegistry'; +import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; +import * as editorOptions from 'vs/editor/common/config/editorOptions'; +import * as platform from 'vs/base/common/platform'; +import { IConfigurationEditingService, ConfigurationTarget } from 'vs/workbench/services/configuration/common/configurationEditing'; +import { alert } from 'vs/base/browser/ui/aria/aria'; +import { IOpenerService } from 'vs/platform/opener/common/opener'; +import URI from 'vs/base/common/uri'; const CONTEXT_ACCESSIBILITY_WIDGET_VISIBLE = new RawContextKey('accessibilityHelpWidgetVisible', false); @@ -42,13 +49,12 @@ class AccessibilityHelpController extends Disposable implements IEditorContribut constructor( editor: ICodeEditor, - @IContextKeyService contextKeyService: IContextKeyService, - @IKeybindingService keybindingService: IKeybindingService + @IInstantiationService instantiationService: IInstantiationService ) { super(); this._editor = editor; - this._widget = this._register(new AccessibilityHelpWidget(this._editor, contextKeyService, keybindingService)); + this._widget = this._register(instantiationService.createInstance(AccessibilityHelpWidget, this._editor)); } public getId(): string { @@ -71,25 +77,36 @@ class AccessibilityHelpWidget extends Widget implements IOverlayWidget { private static HEIGHT = 300; private _editor: ICodeEditor; - private _keybindingService: IKeybindingService; private _domNode: FastDomNode; + private _contentDomNode: FastDomNode; private _isVisible: boolean; private _isVisibleKey: IContextKey; - constructor(editor: ICodeEditor, contextKeyService: IContextKeyService, keybindingService: IKeybindingService) { + constructor( + editor: ICodeEditor, + @IContextKeyService private _contextKeyService: IContextKeyService, + @IKeybindingService private _keybindingService: IKeybindingService, + @IConfigurationService private _configurationService: IConfigurationService, + @IConfigurationEditingService private _configurationEditingService: IConfigurationEditingService, + @IOpenerService private _openerService: IOpenerService + ) { super(); this._editor = editor; - this._keybindingService = keybindingService; - this._isVisibleKey = CONTEXT_ACCESSIBILITY_WIDGET_VISIBLE.bindTo(contextKeyService); + this._isVisibleKey = CONTEXT_ACCESSIBILITY_WIDGET_VISIBLE.bindTo(this._contextKeyService); this._domNode = createFastDomNode(document.createElement('div')); this._domNode.setClassName('accessibilityHelpWidget'); this._domNode.setWidth(AccessibilityHelpWidget.WIDTH); this._domNode.setHeight(AccessibilityHelpWidget.HEIGHT); this._domNode.setDisplay('none'); - this._domNode.setAttribute('role', 'tooltip'); + this._domNode.setAttribute('role', 'dialog'); this._domNode.setAttribute('aria-hidden', 'true'); + + this._contentDomNode = createFastDomNode(document.createElement('div')); + this._contentDomNode.setAttribute('role', 'document'); + this._domNode.appendChild(this._contentDomNode); + this._isVisible = false; this._register(this._editor.onDidLayoutChange(() => { @@ -97,7 +114,36 @@ class AccessibilityHelpWidget extends Widget implements IOverlayWidget { this._layout(); } })); - this.onblur(this._domNode.domNode, () => { + + // Intentionally not configurable! + this._register(dom.addStandardDisposableListener(this._contentDomNode.domNode, 'keydown', (e) => { + if (!this._isVisible) { + return; + } + + if (e.equals(KeyMod.CtrlCmd | KeyCode.KEY_E)) { + alert(nls.localize('emergencyConfOn', "Now changing the setting `editor.accessibilitySupport` to 'on'.")); + + this._configurationEditingService.writeConfiguration(ConfigurationTarget.USER, { + key: 'editor.accessibilitySupport', + value: 'on' + }); + + e.preventDefault(); + e.stopPropagation(); + } + + if (e.equals(KeyMod.CtrlCmd | KeyCode.KEY_H)) { + alert(nls.localize('openingDocs', "Now opening the VS Code Accessibility documentation page.")); + + this._openerService.open(URI.parse('https://go.microsoft.com/fwlink/?linkid=851010')); + + e.preventDefault(); + e.stopPropagation(); + } + })); + + this.onblur(this._contentDomNode.domNode, () => { this.hide(); }); @@ -132,9 +178,9 @@ class AccessibilityHelpWidget extends Widget implements IOverlayWidget { this._layout(); this._domNode.setDisplay('block'); this._domNode.setAttribute('aria-hidden', 'false'); - this._domNode.domNode.tabIndex = 0; + this._contentDomNode.domNode.tabIndex = 0; this._buildContent(); - this._domNode.domNode.focus(); + this._contentDomNode.domNode.focus(); } private _descriptionForCommand(commandId: string, msg: string, noKbMsg: string): string { @@ -151,6 +197,40 @@ class AccessibilityHelpWidget extends Widget implements IOverlayWidget { text += '\n\n' + nls.localize('status', "Status:"); + const configuredValue = this._configurationService.getConfiguration('editor').accessibilitySupport; + const actualValue = opts.accessibilitySupport; + + const emergencyTurnOnMessage = ( + platform.isMacintosh + ? nls.localize('changeConfigToOnMac', "To configure the editor to be permanently optimized for usage with a Screen Reader press Command+E now.") + : nls.localize('changeConfigToOnWinLinux', "To configure the editor to be permanently optimized for usage with a Screen Reader press Control+E now.") + ); + + switch (configuredValue) { + case 'auto': + switch (actualValue) { + case platform.AccessibilitySupport.Unknown: + // Should never happen in VS Code + text += '\n\n - ' + nls.localize('auto_unknown', "The editor is configured to use platform APIs to detect when a Screen Reader is attached, but the current runtime does not support this."); + break; + case platform.AccessibilitySupport.Enabled: + text += '\n\n - ' + nls.localize('auto_on', "The editor has automatically detected a Screen Reader is attached."); + break; + case platform.AccessibilitySupport.Disabled: + text += '\n\n - ' + nls.localize('auto_off', "The editor is configured to automatically detect when a Screen Reader is attached, which is not the case at this time."); + text += ' ' + emergencyTurnOnMessage; + break; + } + break; + case 'on': + text += '\n\n - ' + nls.localize('configuredOn', "The editor is configured to be permanently optimized for usage with a Screen Reader - you can change this by editing the setting `editor.accessibilitySupport`."); + break; + case 'off': + text += '\n\n - ' + nls.localize('configuredOff', "The editor is configured to never be optimized for usage with a Screen Reader."); + text += ' ' + emergencyTurnOnMessage; + break; + } + const NLS_TAB_FOCUS_MODE_ON = nls.localize('tabFocusModeOnMsg', "Pressing Tab in the current editor will move focus to the next focusable element. Toggle this behavior by pressing {0}."); const NLS_TAB_FOCUS_MODE_ON_NO_KB = nls.localize('tabFocusModeOnMsgNoKb', "Pressing Tab in the current editor will move focus to the next focusable element. The command {0} is currently not triggerable by a keybinding."); const NLS_TAB_FOCUS_MODE_OFF = nls.localize('tabFocusModeOffMsg', "Pressing Tab in the current editor will insert the tab character. Toggle this behavior by pressing {0}."); @@ -162,11 +242,17 @@ class AccessibilityHelpWidget extends Widget implements IOverlayWidget { text += '\n\n - ' + this._descriptionForCommand(ToggleTabFocusModeAction.ID, NLS_TAB_FOCUS_MODE_OFF, NLS_TAB_FOCUS_MODE_OFF_NO_KB); } - text += '\n\n' + nls.localize('outroMsg', "You can dismiss this tooltip and return to the editor by pressing Escape."); + const openDocMessage = ( + platform.isMacintosh + ? nls.localize('openDocMac', "Press Command+H now to open a browser window with more VS Code information related to Accessibility.") + : nls.localize('openDocWinLinux', "Press Control+H now to open a browser window with more VS Code information related to Accessibility.") + ); - this._domNode.domNode.appendChild(renderHtml({ - formattedText: text - })); + text += '\n\n' + openDocMessage; + + text += '\n\n' + nls.localize('outroMsg', "You can dismiss this tooltip and return to the editor by pressing Escape or Shift+Escape."); + + this._contentDomNode.domNode.appendChild(renderFormattedText(text)); } public hide(): void { @@ -177,8 +263,8 @@ class AccessibilityHelpWidget extends Widget implements IOverlayWidget { this._isVisibleKey.reset(); this._domNode.setDisplay('none'); this._domNode.setAttribute('aria-hidden', 'true'); - this._domNode.domNode.tabIndex = -1; - clearNode(this._domNode.domNode); + this._contentDomNode.domNode.tabIndex = -1; + dom.clearNode(this._contentDomNode.domNode); this._editor.focus(); } diff --git a/src/vs/editor/node/languageConfigurationExtensionPoint.ts b/src/vs/workbench/parts/codeEditor/electron-browser/languageConfiguration/languageConfigurationExtensionPoint.ts similarity index 57% rename from src/vs/editor/node/languageConfigurationExtensionPoint.ts rename to src/vs/workbench/parts/codeEditor/electron-browser/languageConfiguration/languageConfigurationExtensionPoint.ts index ee24733bf1bfc6a15f181bdde35e28b229b806cb..e36b6f9e85c363c42bc5b5af52d1870c22f298fc 100644 --- a/src/vs/editor/node/languageConfigurationExtensionPoint.ts +++ b/src/vs/workbench/parts/codeEditor/electron-browser/languageConfiguration/languageConfigurationExtensionPoint.ts @@ -7,26 +7,34 @@ import * as nls from 'vs/nls'; import { parse, ParseError } from 'vs/base/common/json'; import { readFile } from 'vs/base/node/pfs'; -import { CharacterPair, LanguageConfiguration, IAutoClosingPair, IAutoClosingPairConditional, CommentRule } from 'vs/editor/common/modes/languageConfiguration'; +import { CharacterPair, LanguageConfiguration, IAutoClosingPair, IAutoClosingPairConditional, IndentationRule, CommentRule } from 'vs/editor/common/modes/languageConfiguration'; import { IModeService } from 'vs/editor/common/services/modeService'; import { LanguageConfigurationRegistry } from 'vs/editor/common/modes/languageConfigurationRegistry'; import { Extensions, IJSONContributionRegistry } from 'vs/platform/jsonschemas/common/jsonContributionRegistry'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { IJSONSchema } from 'vs/base/common/jsonSchema'; import { LanguageIdentifier } from 'vs/editor/common/modes'; -import { ITextMateService } from 'vs/editor/node/textMate/textMateService'; +import { ITextMateService } from 'vs/workbench/services/textMate/electron-browser/textMateService'; interface IRegExp { pattern: string; flags?: string; } +interface IIndentationRules { + decreaseIndentPattern: string | IRegExp; + increaseIndentPattern: string | IRegExp; + indentNextLinePattern?: string | IRegExp; + unIndentedLinePattern?: string | IRegExp; +} + interface ILanguageConfiguration { comments?: CommentRule; brackets?: CharacterPair[]; autoClosingPairs?: (CharacterPair | IAutoClosingPairConditional)[]; surroundingPairs?: (CharacterPair | IAutoClosingPair)[]; wordPattern?: string | IRegExp; + indentationRules?: IIndentationRules; } export class LanguageConfigurationFileHandler { @@ -92,26 +100,61 @@ export class LanguageConfigurationFileHandler { } if (configuration.wordPattern) { - let pattern = ''; - let flags = ''; + try { + let wordPattern = this._parseRegex(configuration.wordPattern); + if (wordPattern) { + richEditConfig.wordPattern = wordPattern; + } + } catch (error) { + // Malformed regexes are ignored + } + } - if (typeof configuration.wordPattern === 'string') { - pattern = configuration.wordPattern; - } else if (typeof configuration.wordPattern === 'object') { - pattern = configuration.wordPattern.pattern; - flags = configuration.wordPattern.flags; + if (configuration.indentationRules) { + let indentationRules = this._mapIndentationRules(configuration.indentationRules); + if (indentationRules) { + richEditConfig.indentationRules = indentationRules; } + } + + LanguageConfigurationRegistry.register(languageIdentifier, richEditConfig); + } + + private _parseRegex(value: string | IRegExp) { + if (typeof value === 'string') { + return new RegExp(value, ''); + } else if (typeof value === 'object') { + return new RegExp(value.pattern, value.flags); + } - if (pattern) { - try { - richEditConfig.wordPattern = new RegExp(pattern, flags); - } catch (error) { - // Malformed regexes are ignored + return null; + } + + private _mapIndentationRules(indentationRules: IIndentationRules): IndentationRule { + try { + let increaseIndentPattern = this._parseRegex(indentationRules.increaseIndentPattern); + let decreaseIndentPattern = this._parseRegex(indentationRules.decreaseIndentPattern); + + if (increaseIndentPattern && decreaseIndentPattern) { + let result: IndentationRule = { + increaseIndentPattern: increaseIndentPattern, + decreaseIndentPattern: decreaseIndentPattern + }; + + if (indentationRules.indentNextLinePattern) { + result.indentNextLinePattern = this._parseRegex(indentationRules.indentNextLinePattern); + } + if (indentationRules.unIndentedLinePattern) { + result.unIndentedLinePattern = this._parseRegex(indentationRules.unIndentedLinePattern); } + + return result; } + } catch (error) { + // Malformed regexes are ignored } - LanguageConfigurationRegistry.register(languageIdentifier, richEditConfig); + return null; } private _mapCharacterPairs(pairs: (CharacterPair | IAutoClosingPairConditional)[]): IAutoClosingPairConditional[] { @@ -252,6 +295,88 @@ const schema: IJSONSchema = { patternErrorMessage: nls.localize('schema.wordPattern.flags.errorMessage', 'Must match the pattern `/^([gimuy]+)$/`.') } } + }, + indentationRules: { + default: { + increaseIndentPattern: '', + decreaseIndentPattern: '' + }, + description: nls.localize('schema.indentationRules', 'The language\'s indentation settings.'), + type: 'object', + properties: { + increaseIndentPattern: { + type: ['string', 'object'], + description: nls.localize('schema.indentationRules.increaseIndentPattern', 'If a line matches this pattern, then all the lines after it should be indented once (until another rule matches).'), + properties: { + pattern: { + type: 'string', + description: nls.localize('schema.indentationRules.increaseIndentPattern.pattern', 'The RegExp pattern for increaseIndentPattern.'), + default: '', + }, + flags: { + type: 'string', + description: nls.localize('schema.indentationRules.increaseIndentPattern.flags', 'The RegExp flags for increaseIndentPattern.'), + default: '', + pattern: '^([gimuy]+)$', + patternErrorMessage: nls.localize('schema.indentationRules.increaseIndentPattern.errorMessage', 'Must match the pattern `/^([gimuy]+)$/`.') + } + } + }, + decreaseIndentPattern: { + type: ['string', 'object'], + description: nls.localize('schema.indentationRules.decreaseIndentPattern', 'If a line matches this pattern, then all the lines after it should be unindendented once (until another rule matches).'), + properties: { + pattern: { + type: 'string', + description: nls.localize('schema.indentationRules.decreaseIndentPattern.pattern', 'The RegExp pattern for decreaseIndentPattern.'), + default: '', + }, + flags: { + type: 'string', + description: nls.localize('schema.indentationRules.decreaseIndentPattern.flags', 'The RegExp flags for decreaseIndentPattern.'), + default: '', + pattern: '^([gimuy]+)$', + patternErrorMessage: nls.localize('schema.indentationRules.decreaseIndentPattern.errorMessage', 'Must match the pattern `/^([gimuy]+)$/`.') + } + } + }, + indentNextLinePattern: { + type: ['string', 'object'], + description: nls.localize('schema.indentationRules.indentNextLinePattern', 'If a line matches this pattern, then **only the next line** after it should be indented once.'), + properties: { + pattern: { + type: 'string', + description: nls.localize('schema.indentationRules.indentNextLinePattern.pattern', 'The RegExp pattern for indentNextLinePattern.'), + default: '', + }, + flags: { + type: 'string', + description: nls.localize('schema.indentationRules.indentNextLinePattern.flags', 'The RegExp flags for indentNextLinePattern.'), + default: '', + pattern: '^([gimuy]+)$', + patternErrorMessage: nls.localize('schema.indentationRules.indentNextLinePattern.errorMessage', 'Must match the pattern `/^([gimuy]+)$/`.') + } + } + }, + unIndentedLinePattern: { + type: ['string', 'object'], + description: nls.localize('schema.indentationRules.unIndentedLinePattern', 'If a line matches this pattern, then its indentation should not be changed and it should not be evaluated against the other rules.'), + properties: { + pattern: { + type: 'string', + description: nls.localize('schema.indentationRules.unIndentedLinePattern.pattern', 'The RegExp pattern for unIndentedLinePattern.'), + default: '', + }, + flags: { + type: 'string', + description: nls.localize('schema.indentationRules.unIndentedLinePattern.flags', 'The RegExp flags for unIndentedLinePattern.'), + default: '', + pattern: '^([gimuy]+)$', + patternErrorMessage: nls.localize('schema.indentationRules.unIndentedLinePattern.errorMessage', 'Must match the pattern `/^([gimuy]+)$/`.') + } + } + } + } } } }; diff --git a/src/vs/editor/contrib/multicursor/browser/menuPreventer.ts b/src/vs/workbench/parts/codeEditor/electron-browser/menuPreventer.ts similarity index 100% rename from src/vs/editor/contrib/multicursor/browser/menuPreventer.ts rename to src/vs/workbench/parts/codeEditor/electron-browser/menuPreventer.ts diff --git a/src/vs/editor/contrib/selectionClipboard/electron-browser/selectionClipboard.ts b/src/vs/workbench/parts/codeEditor/electron-browser/selectionClipboard.ts similarity index 100% rename from src/vs/editor/contrib/selectionClipboard/electron-browser/selectionClipboard.ts rename to src/vs/workbench/parts/codeEditor/electron-browser/selectionClipboard.ts diff --git a/src/vs/editor/contrib/inspectTMScopes/electron-browser/inspectTMScopes.css b/src/vs/workbench/parts/codeEditor/electron-browser/textMate/inspectTMScopes.css similarity index 100% rename from src/vs/editor/contrib/inspectTMScopes/electron-browser/inspectTMScopes.css rename to src/vs/workbench/parts/codeEditor/electron-browser/textMate/inspectTMScopes.css diff --git a/src/vs/editor/contrib/inspectTMScopes/electron-browser/inspectTMScopes.ts b/src/vs/workbench/parts/codeEditor/electron-browser/textMate/inspectTMScopes.ts similarity index 96% rename from src/vs/editor/contrib/inspectTMScopes/electron-browser/inspectTMScopes.ts rename to src/vs/workbench/parts/codeEditor/electron-browser/textMate/inspectTMScopes.ts index b0792b493ef563602d27a9d9d1a3615ce40956f1..0518392efba2f06d928a7953389e89c89177213b 100644 --- a/src/vs/editor/contrib/inspectTMScopes/electron-browser/inspectTMScopes.ts +++ b/src/vs/workbench/parts/codeEditor/electron-browser/textMate/inspectTMScopes.ts @@ -9,6 +9,7 @@ import * as nls from 'vs/nls'; import * as dom from 'vs/base/browser/dom'; import { Disposable } from 'vs/base/common/lifecycle'; import { escape } from 'vs/base/common/strings'; +import { KeyCode } from 'vs/base/common/keyCodes'; import { Position } from 'vs/editor/common/core/position'; import { ICommonCodeEditor, IEditorContribution, IModel } from 'vs/editor/common/editorCommon'; import { editorAction, EditorAction, ServicesAccessor } from 'vs/editor/common/editorCommonExtensions'; @@ -16,12 +17,12 @@ import { ICodeEditor, ContentWidgetPositionPreference, IContentWidget, IContentW import { editorContribution } from 'vs/editor/browser/editorBrowserExtensions'; import { TPromise } from 'vs/base/common/winjs.base'; import { IGrammar, StackElement, IToken } from 'vscode-textmate'; -import { ITextMateService } from 'vs/editor/node/textMate/textMateService'; +import { ITextMateService } from 'vs/workbench/services/textMate/electron-browser/textMateService'; import { IModeService } from 'vs/editor/common/services/modeService'; import { TokenMetadata } from 'vs/editor/common/model/tokensBinaryEncoding'; import { TokenizationRegistry, LanguageIdentifier, FontStyle, StandardTokenType } from 'vs/editor/common/modes'; import { CharCode } from 'vs/base/common/charCode'; -import { findMatchingThemeRule } from 'vs/editor/electron-browser/textMate/TMHelper'; +import { findMatchingThemeRule } from 'vs/workbench/services/textMate/electron-browser/TMHelper'; import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService'; import { Color } from 'vs/base/common/color'; import { IMessageService } from 'vs/platform/message/common/message'; @@ -62,6 +63,7 @@ class InspectTMScopesController extends Disposable implements IEditorContributio this._register(this._editor.onDidChangeModel((e) => this.stop())); this._register(this._editor.onDidChangeModelLanguage((e) => this.stop())); + this._register(this._editor.onKeyUp((e) => e.keyCode === KeyCode.Escape && this.stop())); } public getId(): string { @@ -89,6 +91,14 @@ class InspectTMScopesController extends Disposable implements IEditorContributio this._widget = null; } } + + public toggle(): void { + if (!this._widget) { + this.launch(); + } else { + this.stop(); + } + } } @editorAction @@ -106,7 +116,7 @@ class InspectTMScopes extends EditorAction { public run(accessor: ServicesAccessor, editor: ICommonCodeEditor): void { let controller = InspectTMScopesController.get(editor); if (controller) { - controller.launch(); + controller.toggle(); } } } diff --git a/src/vs/workbench/parts/codeEditor/electron-browser/toggleMultiCursorModifier.ts b/src/vs/workbench/parts/codeEditor/electron-browser/toggleMultiCursorModifier.ts new file mode 100644 index 0000000000000000000000000000000000000000..b39ffe5ea9f169f79a4326778bba1191d9f820d0 --- /dev/null +++ b/src/vs/workbench/parts/codeEditor/electron-browser/toggleMultiCursorModifier.ts @@ -0,0 +1,45 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +'use strict'; + +import { TPromise } from 'vs/base/common/winjs.base'; +import * as nls from 'vs/nls'; +import { Registry } from 'vs/platform/registry/common/platform'; +import { Action } from 'vs/base/common/actions'; +import { SyncActionDescriptor } from 'vs/platform/actions/common/actions'; +import { IWorkbenchActionRegistry, Extensions } from 'vs/workbench/common/actionRegistry'; +import { IConfigurationEditingService, ConfigurationTarget } from 'vs/workbench/services/configuration/common/configurationEditing'; +import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; + +export class ToggleMultiCursorModifierAction extends Action { + + public static ID = 'workbench.action.toggleMultiCursorModifier'; + public static LABEL = nls.localize('toggleLocation', "Toggle Multi-Cursor Modifier"); + + private static multiCursorModifierConfigurationKey = 'editor.multiCursorModifier'; + + constructor( + id: string, + label: string, + @IConfigurationService private configurationService: IConfigurationService, + @IConfigurationEditingService private configurationEditingService: IConfigurationEditingService + ) { + super(id, label); + + this.enabled = !!this.configurationService && !!this.configurationEditingService; + } + + public run(): TPromise { + const editorConf = this.configurationService.getConfiguration<{ multiCursorModifier: 'ctrlCmd' | 'alt' }>('editor'); + const newValue: 'ctrlCmd' | 'alt' = (editorConf.multiCursorModifier === 'ctrlCmd' ? 'alt' : 'ctrlCmd'); + + this.configurationEditingService.writeConfiguration(ConfigurationTarget.USER, { key: ToggleMultiCursorModifierAction.multiCursorModifierConfigurationKey, value: newValue }); + + return TPromise.as(null); + } +} + +const registry = Registry.as(Extensions.WorkbenchActions); +registry.registerWorkbenchAction(new SyncActionDescriptor(ToggleMultiCursorModifierAction, ToggleMultiCursorModifierAction.ID, ToggleMultiCursorModifierAction.LABEL), 'Toggle Multi-Cursor Modifier'); diff --git a/src/vs/workbench/parts/codeEditor/electron-browser/toggleRenderControlCharacter.ts b/src/vs/workbench/parts/codeEditor/electron-browser/toggleRenderControlCharacter.ts index 584821e2d3ada84c136ba0f47cd79094ea11817f..7428c61dc87837d384f015baa8963a4bf84aac7f 100644 --- a/src/vs/workbench/parts/codeEditor/electron-browser/toggleRenderControlCharacter.ts +++ b/src/vs/workbench/parts/codeEditor/electron-browser/toggleRenderControlCharacter.ts @@ -16,7 +16,7 @@ export class ToggleRenderControlCharacterAction extends EditorAction { super({ id: 'editor.action.toggleRenderControlCharacter', label: nls.localize('toggleRenderControlCharacters', "Toggle Control Characters"), - alias: 'Toggle Render Control Characters', + alias: 'Toggle Control Characters', precondition: null }); } diff --git a/src/vs/workbench/parts/codeEditor/electron-browser/toggleWordWrap.ts b/src/vs/workbench/parts/codeEditor/electron-browser/toggleWordWrap.ts index e0bf3b526293579fa999190aedc1ac33d8a79f7e..4d4c999276f1c9bfc2e422b38f7720e10c3b3aaf 100644 --- a/src/vs/workbench/parts/codeEditor/electron-browser/toggleWordWrap.ts +++ b/src/vs/workbench/parts/codeEditor/electron-browser/toggleWordWrap.ts @@ -10,7 +10,6 @@ import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; import { ICommonCodeEditor, IEditorContribution, IModel } from 'vs/editor/common/editorCommon'; import { editorAction, ServicesAccessor, EditorAction, commonEditorContribution } from 'vs/editor/common/editorCommonExtensions'; import { ICodeEditorService } from 'vs/editor/common/services/codeEditorService'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { MenuRegistry, MenuId } from 'vs/platform/actions/common/actions'; import { ContextKeyExpr, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { Disposable } from 'vs/base/common/lifecycle'; @@ -18,6 +17,7 @@ import { IMessageService } from 'vs/platform/message/common/message'; import Severity from 'vs/base/common/severity'; import URI from 'vs/base/common/uri'; import { InternalEditorOptions, EDITOR_DEFAULTS } from 'vs/editor/common/config/editorOptions'; +import { ITextResourceConfigurationService } from "vs/editor/common/services/resourceConfiguration"; const transientWordWrapState = 'transientWordWrapState'; const isWordWrapMinifiedKey = 'isWordWrapMinified'; @@ -52,8 +52,9 @@ function readTransientState(model: IModel, codeEditorService: ICodeEditorService return codeEditorService.getTransientModelProperty(model, transientWordWrapState); } -function readWordWrapState(model: IModel, configurationService: IConfigurationService, codeEditorService: ICodeEditorService): IWordWrapState { - let _configuredWordWrap = configurationService.lookup<'on' | 'off' | 'wordWrapColumn' | 'bounded'>('editor.wordWrap', model.getLanguageIdentifier().language).value; +function readWordWrapState(model: IModel, configurationService: ITextResourceConfigurationService, codeEditorService: ICodeEditorService): IWordWrapState { + const editorConfig = configurationService.getConfiguration(model.uri, 'editor') as { wordWrap: 'on' | 'off' | 'wordWrapColumn' | 'bounded'; wordWrapMinified: boolean }; + let _configuredWordWrap = editorConfig && typeof editorConfig.wordWrap === 'string' ? editorConfig.wordWrap : void 0; // Compatibility with old true or false values if (_configuredWordWrap === true) { @@ -62,11 +63,11 @@ function readWordWrapState(model: IModel, configurationService: IConfigurationSe _configuredWordWrap = 'off'; } - const _configuredWordWrapMinified = configurationService.lookup('editor.wordWrapMinified', model.getLanguageIdentifier().language); + const _configuredWordWrapMinified = editorConfig && typeof editorConfig.wordWrapMinified === 'boolean' ? editorConfig.wordWrapMinified : void 0; const _transientState = readTransientState(model, codeEditorService); return { configuredWordWrap: _configuredWordWrap, - configuredWordWrapMinified: (typeof _configuredWordWrapMinified.value === 'undefined' ? EDITOR_DEFAULTS.wordWrapMinified : _configuredWordWrapMinified.value), + configuredWordWrapMinified: (typeof _configuredWordWrapMinified === 'boolean' ? _configuredWordWrapMinified : EDITOR_DEFAULTS.wordWrapMinified), transientState: _transientState }; } @@ -154,7 +155,7 @@ class ToggleWordWrapAction extends EditorAction { return; } - const configurationService = accessor.get(IConfigurationService); + const textResourceConfigurationService = accessor.get(ITextResourceConfigurationService); const codeEditorService = accessor.get(ICodeEditorService); const model = editor.getModel(); @@ -163,7 +164,7 @@ class ToggleWordWrapAction extends EditorAction { } // Read the current state - const currentState = readWordWrapState(model, configurationService, codeEditorService); + const currentState = readWordWrapState(model, textResourceConfigurationService, codeEditorService); // Compute the new state const newState = toggleWordWrap(editor, currentState); // Write the new state @@ -181,7 +182,7 @@ class ToggleWordWrapController extends Disposable implements IEditorContribution constructor( private readonly editor: ICommonCodeEditor, @IContextKeyService readonly contextKeyService: IContextKeyService, - @IConfigurationService readonly configurationService: IConfigurationService, + @ITextResourceConfigurationService readonly configurationService: ITextResourceConfigurationService, @ICodeEditorService readonly codeEditorService: ICodeEditorService ) { super(); diff --git a/src/vs/workbench/parts/debug/browser/debugActionItems.ts b/src/vs/workbench/parts/debug/browser/debugActionItems.ts index edb07e3d969ccc10fe2fb7272726975db70b0aa8..50d19edfefb1565b7d63ef431e68102bf3ad335b 100644 --- a/src/vs/workbench/parts/debug/browser/debugActionItems.ts +++ b/src/vs/workbench/parts/debug/browser/debugActionItems.ts @@ -19,7 +19,7 @@ import { IDebugService } from 'vs/workbench/parts/debug/common/debug'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { attachSelectBoxStyler, attachStylerCallback } from 'vs/platform/theme/common/styler'; import { SIDE_BAR_BACKGROUND } from 'vs/workbench/common/theme'; -import { selectBorder } from "vs/platform/theme/common/colorRegistry"; +import { selectBorder } from 'vs/platform/theme/common/colorRegistry'; const $ = dom.$; diff --git a/src/vs/workbench/parts/debug/browser/debugActions.ts b/src/vs/workbench/parts/debug/browser/debugActions.ts index 6a23b8588cd8ac21ab41de45cd417ce8e1b0bb47..159cbaf03b87060c7b6f469ff59c9240fd6e52e0 100644 --- a/src/vs/workbench/parts/debug/browser/debugActions.ts +++ b/src/vs/workbench/parts/debug/browser/debugActions.ts @@ -98,7 +98,7 @@ export class ConfigureAction extends AbstractDebugAction { } public run(event?: any): TPromise { - if (!this.contextService.getWorkspace()) { + if (!this.contextService.hasWorkspace()) { this.messageService.show(severity.Info, nls.localize('noFolderDebugConfig', "Please first open a folder in order to do advanced debug configuration.")); return TPromise.as(null); } @@ -137,7 +137,7 @@ export class StartAction extends AbstractDebugAction { const compound = this.debugService.getConfigurationManager().getCompound(this.debugService.getViewModel().selectedConfigurationName); return state !== State.Initializing && processes.every(p => p.name !== this.debugService.getViewModel().selectedConfigurationName) && (!compound || !compound.configurations || processes.every(p => compound.configurations.indexOf(p.name) === -1)) && - (!this.contextService || !!this.contextService.getWorkspace() || processes.length === 0); + (!this.contextService || this.contextService.hasWorkspace() || processes.length === 0); } } diff --git a/src/vs/workbench/parts/debug/browser/debugActionsWidget.ts b/src/vs/workbench/parts/debug/browser/debugActionsWidget.ts index dc9a9d0d19dcd733d0692b695a751d11f38ed8ac..44b9db45be34c8aae4a1180ded73d194310d2ad6 100644 --- a/src/vs/workbench/parts/debug/browser/debugActionsWidget.ts +++ b/src/vs/workbench/parts/debug/browser/debugActionsWidget.ts @@ -115,7 +115,7 @@ export class DebugActionsWidget extends Themable implements IWorkbenchContributi if (mouseClickEvent.detail === 2) { // double click on debug bar centers it again #8250 const widgetWidth = this.$el.getHTMLElement().clientWidth; - this.setXCoordinate(window.innerWidth - widgetWidth); + this.setXCoordinate(0.5 * window.innerWidth - 0.5 * widgetWidth); this.storePosition(); } }); @@ -173,11 +173,12 @@ export class DebugActionsWidget extends Themable implements IWorkbenchContributi if (!this.isVisible) { return; } + const widgetWidth = this.$el.getHTMLElement().clientWidth; if (x === undefined) { - x = parseFloat(this.storageService.get(DEBUG_ACTIONS_WIDGET_POSITION_KEY, StorageScope.WORKSPACE, '1')) * window.innerWidth; + const positionPercentage = this.storageService.get(DEBUG_ACTIONS_WIDGET_POSITION_KEY, StorageScope.WORKSPACE); + x = positionPercentage !== undefined ? parseFloat(positionPercentage) * window.innerWidth : (0.5 * window.innerWidth - 0.5 * widgetWidth); } - const widgetWidth = this.$el.getHTMLElement().clientWidth; x = Math.max(0, Math.min(x, window.innerWidth - widgetWidth)); // do not allow the widget to overflow on the right this.$el.style('left', `${x}px`); } diff --git a/src/vs/workbench/parts/debug/browser/debugContentProvider.ts b/src/vs/workbench/parts/debug/browser/debugContentProvider.ts index 0ad6436765e0ac4e62b9dfbc0f2b1c3118e45064..37ca325f419886bf47c23d56bb13ce08e83d6318 100644 --- a/src/vs/workbench/parts/debug/browser/debugContentProvider.ts +++ b/src/vs/workbench/parts/debug/browser/debugContentProvider.ts @@ -10,14 +10,14 @@ import { guessMimeTypes, MIME_TEXT } from 'vs/base/common/mime'; import { IModel } from 'vs/editor/common/editorCommon'; import { IModelService } from 'vs/editor/common/services/modelService'; import { IModeService } from 'vs/editor/common/services/modeService'; -import { ITextModelResolverService, ITextModelContentProvider } from 'vs/editor/common/services/resolverService'; +import { ITextModelService, ITextModelContentProvider } from 'vs/editor/common/services/resolverService'; import { IWorkbenchContribution } from 'vs/workbench/common/contributions'; import { DEBUG_SCHEME, IDebugService } from 'vs/workbench/parts/debug/common/debug'; export class DebugContentProvider implements IWorkbenchContribution, ITextModelContentProvider { constructor( - @ITextModelResolverService textModelResolverService: ITextModelResolverService, + @ITextModelService textModelResolverService: ITextModelService, @IDebugService private debugService: IDebugService, @IModelService private modelService: IModelService, @IModeService private modeService: IModeService @@ -51,7 +51,7 @@ export class DebugContentProvider implements IWorkbenchContribution, ITextModelC return model; }, (err: DebugProtocol.ErrorResponse) => { - this.debugService.deemphasizeSource(resource); + this.debugService.sourceIsNotAvailable(resource); const modePromise = this.modeService.getOrCreateMode(MIME_TEXT); const model = this.modelService.createModel(err.message, modePromise, resource); diff --git a/src/vs/workbench/parts/debug/browser/debugViewRegistry.ts b/src/vs/workbench/parts/debug/browser/debugViewRegistry.ts deleted file mode 100644 index 0a2ae20976071b4b517d1fba677d8bcd6794e97f..0000000000000000000000000000000000000000 --- a/src/vs/workbench/parts/debug/browser/debugViewRegistry.ts +++ /dev/null @@ -1,37 +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 { IActionRunner } from 'vs/base/common/actions'; -import { IViewletView } from 'vs/workbench/browser/viewlet'; - -// Debug view registration - -export interface IDebugViewConstructorSignature { - new (actionRunner: IActionRunner, viewletSetings: any, ...services: { _serviceBrand: any; }[]): IViewletView; -} - -export interface IDebugViewRegistry { - registerDebugView(view: IDebugViewConstructorSignature, order: number, weight: number): void; - getDebugViews(): { view: IDebugViewConstructorSignature, weight: number }[]; -} - -class DebugViewRegistryImpl implements IDebugViewRegistry { - private debugViews: { view: IDebugViewConstructorSignature, order: number, weight: number }[]; - - constructor() { - this.debugViews = []; - } - - public registerDebugView(view: IDebugViewConstructorSignature, order: number, weight: number): void { - this.debugViews.push({ view, order, weight }); - } - - public getDebugViews(): { view: IDebugViewConstructorSignature, weight: number }[] { - return this.debugViews.sort((first, second) => first.order - second.order) - .map(viewWithOrder => ({ view: viewWithOrder.view, weight: viewWithOrder.weight })); - } -} - -export const DebugViewRegistry = new DebugViewRegistryImpl(); diff --git a/src/vs/workbench/parts/debug/browser/debugViewlet.ts b/src/vs/workbench/parts/debug/browser/debugViewlet.ts index a36d31280224ba992e3c5e667489821000d21374..b8a3889034432e4bd9fa2165dafbaeac42c5e987 100644 --- a/src/vs/workbench/parts/debug/browser/debugViewlet.ts +++ b/src/vs/workbench/parts/debug/browser/debugViewlet.ts @@ -4,113 +4,57 @@ *--------------------------------------------------------------------------------------------*/ import 'vs/css!./media/debugViewlet'; -import { Builder, Dimension } from 'vs/base/browser/builder'; +import { Builder } from 'vs/base/browser/builder'; +import * as DOM from 'vs/base/browser/dom'; import { TPromise } from 'vs/base/common/winjs.base'; -import * as lifecycle from 'vs/base/common/lifecycle'; import { IAction } from 'vs/base/common/actions'; import { IActionItem } from 'vs/base/browser/ui/actionbar/actionbar'; -import { SplitView, HeaderView } from 'vs/base/browser/ui/splitview/splitview'; -import { ILifecycleService } from 'vs/platform/lifecycle/common/lifecycle'; -import { Scope } from 'vs/workbench/common/memento'; -import { IViewletView, Viewlet } from 'vs/workbench/browser/viewlet'; +import { ComposedViewsViewlet } from 'vs/workbench/parts/views/browser/views'; import { IDebugService, VIEWLET_ID, State } from 'vs/workbench/parts/debug/common/debug'; -import { DebugViewRegistry } from 'vs/workbench/parts/debug/browser/debugViewRegistry'; import { StartAction, ToggleReplAction, ConfigureAction } from 'vs/workbench/parts/debug/browser/debugActions'; import { StartDebugActionItem } from 'vs/workbench/parts/debug/browser/debugActionItems'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IProgressService, IProgressRunner } from 'vs/platform/progress/common/progress'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; +import { IStorageService } from 'vs/platform/storage/common/storage'; import { IThemeService } from 'vs/platform/theme/common/themeService'; -import { attachHeaderViewStyler } from 'vs/platform/theme/common/styler'; +import { ViewLocation } from 'vs/workbench/parts/views/browser/viewsRegistry'; +import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; +import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; -const DEBUG_VIEWS_WEIGHTS = 'debug.viewsweights'; +export class DebugViewlet extends ComposedViewsViewlet { -export class DebugViewlet extends Viewlet { - - private toDispose: lifecycle.IDisposable[]; private actions: IAction[]; private startDebugActionItem: StartDebugActionItem; private progressRunner: IProgressRunner; - private viewletSettings: any; - - private $el: Builder; - private splitView: SplitView; - private views: IViewletView[]; constructor( @ITelemetryService telemetryService: ITelemetryService, @IProgressService private progressService: IProgressService, @IDebugService private debugService: IDebugService, - @IInstantiationService private instantiationService: IInstantiationService, - @IWorkspaceContextService private contextService: IWorkspaceContextService, - @IStorageService private storageService: IStorageService, - @ILifecycleService lifecycleService: ILifecycleService, - @IThemeService themeService: IThemeService + @IInstantiationService instantiationService: IInstantiationService, + @IWorkspaceContextService contextService: IWorkspaceContextService, + @IStorageService storageService: IStorageService, + @IThemeService themeService: IThemeService, + @IContextKeyService contextKeyService: IContextKeyService, + @IContextMenuService contextMenuService: IContextMenuService ) { - super(VIEWLET_ID, telemetryService, themeService); + super(VIEWLET_ID, ViewLocation.Debug, `${VIEWLET_ID}.state`, telemetryService, storageService, instantiationService, themeService, contextService, contextKeyService, contextMenuService); this.progressRunner = null; - this.viewletSettings = this.getMemento(storageService, Scope.WORKSPACE); - this.toDispose = []; - this.views = []; - this.toDispose.push(this.debugService.onDidChangeState(state => { - this.onDebugServiceStateChange(state); - })); - lifecycleService.onShutdown(this.store, this); - } - - // viewlet - - public create(parent: Builder): TPromise { - super.create(parent); - this.$el = parent.div().addClass('debug-viewlet'); - - const actionRunner = this.getActionRunner(); - const registeredViews = DebugViewRegistry.getDebugViews(); - this.views = registeredViews.map(viewConstructor => this.instantiationService.createInstance( - viewConstructor.view, - actionRunner, - this.viewletSettings) - ); - - this.views.forEach((view, index) => { - if (view instanceof HeaderView) { - attachHeaderViewStyler(view, this.themeService, { noContrastBorder: index === 0 }); - } - }); - - this.splitView = new SplitView(this.$el.getHTMLElement()); - this.toDispose.push(this.splitView); - let weights: number[] = JSON.parse(this.storageService.get(DEBUG_VIEWS_WEIGHTS, StorageScope.WORKSPACE, '[]')); - if (!weights.length) { - weights = registeredViews.map(v => v.weight); - } - - for (let i = 0; i < this.views.length; i++) { - this.splitView.addView(this.views[i], Math.max(weights[i], 1)); - } - - return TPromise.as(null); - } - public setVisible(visible: boolean): TPromise { - return super.setVisible(visible).then(() => { - return TPromise.join(this.views.map(view => view.setVisible(visible))); - }); + this._register(this.debugService.onDidChangeState(state => this.onDebugServiceStateChange(state))); } - public layout(dimension: Dimension): void { - if (this.splitView) { - this.splitView.layout(dimension.height); - } + public create(parent: Builder): TPromise { + return super.create(parent).then(() => DOM.addClass(this.viewletContainer, 'debug-viewlet')); } public focus(): void { super.focus(); - if (!this.contextService.getWorkspace()) { + if (!this.contextService.hasWorkspace()) { this.views[0].focusBody(); } @@ -123,21 +67,21 @@ export class DebugViewlet extends Viewlet { if (!this.actions) { this.actions = []; this.actions.push(this.instantiationService.createInstance(StartAction, StartAction.ID, StartAction.LABEL)); - if (this.contextService.getWorkspace()) { + if (this.contextService.hasWorkspace()) { this.actions.push(this.instantiationService.createInstance(ConfigureAction, ConfigureAction.ID, ConfigureAction.LABEL)); } - this.actions.push(this.instantiationService.createInstance(ToggleReplAction, ToggleReplAction.ID, ToggleReplAction.LABEL)); - - this.actions.forEach(a => { - this.toDispose.push(a); - }); + this.actions.push(this._register(this.instantiationService.createInstance(ToggleReplAction, ToggleReplAction.ID, ToggleReplAction.LABEL))); } return this.actions; } + public getSecondaryActions(): IAction[] { + return []; + } + public getActionItem(action: IAction): IActionItem { - if (action.id === StartAction.ID && this.contextService.getWorkspace()) { + if (action.id === StartAction.ID && this.contextService.hasWorkspace()) { this.startDebugActionItem = this.instantiationService.createInstance(StartDebugActionItem, null, action); return this.startDebugActionItem; } @@ -156,19 +100,4 @@ export class DebugViewlet extends Viewlet { this.progressRunner = null; } } - - private store(): void { - this.storageService.store(DEBUG_VIEWS_WEIGHTS, JSON.stringify(this.views.map(view => view.size)), StorageScope.WORKSPACE); - } - - public dispose(): void { - this.toDispose = lifecycle.dispose(this.toDispose); - - super.dispose(); - } - - public shutdown(): void { - this.views.forEach(v => v.shutdown()); - super.shutdown(); - } } diff --git a/src/vs/workbench/parts/debug/browser/exceptionWidget.ts b/src/vs/workbench/parts/debug/browser/exceptionWidget.ts index a54e0e1ff20933a229183af0f62e0448f6510f45..3719a86393b25f49415e0b1b714441eb4a4301e6 100644 --- a/src/vs/workbench/parts/debug/browser/exceptionWidget.ts +++ b/src/vs/workbench/parts/debug/browser/exceptionWidget.ts @@ -11,9 +11,9 @@ import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; import { IContextViewService } from 'vs/platform/contextview/browser/contextView'; import { IDebugService, IExceptionInfo } from 'vs/workbench/parts/debug/common/debug'; import { RunOnceScheduler } from 'vs/base/common/async'; -import { IThemeService, ITheme } from "vs/platform/theme/common/themeService"; -import { Color } from "vs/base/common/color"; -import { registerColor } from "vs/platform/theme/common/colorRegistry"; +import { IThemeService, ITheme } from 'vs/platform/theme/common/themeService'; +import { Color } from 'vs/base/common/color'; +import { registerColor } from 'vs/platform/theme/common/colorRegistry'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { LinkDetector } from 'vs/workbench/parts/debug/browser/linkDetector'; const $ = dom.$; @@ -38,13 +38,13 @@ export class ExceptionWidget extends ZoneWidget { this._backgroundColor = Color.white; this._applyTheme(themeService.getTheme()); - this._disposables.add(themeService.onThemeChange(this._applyTheme.bind(this))); + this._disposables.push(themeService.onThemeChange(this._applyTheme.bind(this))); this.create(); const onDidLayoutChangeScheduler = new RunOnceScheduler(() => this._doLayout(undefined, undefined), 50); - this._disposables.add(this.editor.onDidLayoutChange(() => onDidLayoutChangeScheduler.schedule())); - this._disposables.add(onDidLayoutChangeScheduler); + this._disposables.push(this.editor.onDidLayoutChange(() => onDidLayoutChangeScheduler.schedule())); + this._disposables.push(onDidLayoutChangeScheduler); } private _applyTheme(theme: ITheme): void { diff --git a/src/vs/workbench/parts/debug/browser/linkDetector.ts b/src/vs/workbench/parts/debug/browser/linkDetector.ts index d2fd4efab48df143dd16fafba4f975a4c25cc894..f79930d072e1499568da97010397a8f6c79eef35 100644 --- a/src/vs/workbench/parts/debug/browser/linkDetector.ts +++ b/src/vs/workbench/parts/debug/browser/linkDetector.ts @@ -48,7 +48,7 @@ export class LinkDetector { let resource: uri = null; try { resource = (match && !strings.startsWith(match[0], 'http')) - && (match[2] || strings.startsWith(match[0], '/') ? uri.file(match[1]) : this.contextService.toResource(match[1])); + && (match[2] || strings.startsWith(match[1], '/') ? uri.file(match[1]) : this.contextService.toResource(match[1])); } catch (e) { } if (!resource) { diff --git a/src/vs/workbench/parts/debug/browser/media/debug.contribution.css b/src/vs/workbench/parts/debug/browser/media/debug.contribution.css index 7c67f7d14b8a233122749d61dd4e1249618de4f9..aa82f5ccf2a9b06a2dcfc187686d255b45f75290 100644 --- a/src/vs/workbench/parts/debug/browser/media/debug.contribution.css +++ b/src/vs/workbench/parts/debug/browser/media/debug.contribution.css @@ -163,6 +163,18 @@ color: #B5CEA8; } +.hc-black .monaco-workbench .monaco-tree-row:not(.selected) .expression .value.number { + color: #89d185; +} + +.hc-black .monaco-workbench .monaco-tree-row:not(.selected) .expression .value.boolean { + color: #75bdfe; +} + +.hc-black .monaco-workbench .monaco-tree-row:not(.selected) .expression .value.string { + color: #f48771; +} + .vs-dark .monaco-workbench .monaco-tree-row:not(.selected) .expression .value.boolean { color: #4E94CE; } @@ -234,6 +246,10 @@ /* High Contrast Theming */ +.monaco-editor.hc-black .debug-focused-stack-frame-line { + background: rgba(206, 231, 206, 1); +} + .hc-black .monaco-workbench .monaco-tree-row:not(.selected) .expression .name { color: inherit; } diff --git a/src/vs/workbench/parts/debug/browser/media/debugHover.css b/src/vs/workbench/parts/debug/browser/media/debugHover.css index a734651beab4dccadd8f836463f453c80522e96e..6dd157e94495fe543e74467f972b6e6a6849d268 100644 --- a/src/vs/workbench/parts/debug/browser/media/debugHover.css +++ b/src/vs/workbench/parts/debug/browser/media/debugHover.css @@ -26,7 +26,7 @@ word-break: normal; text-overflow: ellipsis; height: 18px; - overflow: hidden; + overflow: auto; border-bottom: 1px solid rgba(128, 128, 128, 0.35); } @@ -64,6 +64,8 @@ .monaco-editor .debug-hover-widget .value { white-space: pre-wrap; color: rgba(108, 108, 108, 0.8); + overflow: auto; + max-height: 500px; } .monaco-editor .debug-hover-widget .error { diff --git a/src/vs/workbench/parts/debug/browser/media/debugViewlet.css b/src/vs/workbench/parts/debug/browser/media/debugViewlet.css index b0d6b4510a12def8fb9e76e0115ed624334b8716..174bf9f39aae5e1711276d8bc474f27b9eea8f07 100644 --- a/src/vs/workbench/parts/debug/browser/media/debugViewlet.css +++ b/src/vs/workbench/parts/debug/browser/media/debugViewlet.css @@ -207,6 +207,10 @@ font-style: italic; } +.debug-viewlet .debug-call-stack .stack-frame.subtle { + font-style: italic; +} + .debug-viewlet .debug-call-stack .stack-frame.label > .file { display: none; } diff --git a/src/vs/workbench/parts/debug/common/debug.ts b/src/vs/workbench/parts/debug/common/debug.ts index 5947fe89104dcc3f4ac15563c9974999b0ec367c..c442497598ac08a3e6abaa331613ff7cc31c272f 100644 --- a/src/vs/workbench/parts/debug/common/debug.ts +++ b/src/vs/workbench/parts/debug/common/debug.ts @@ -184,6 +184,7 @@ export interface IScope extends IExpressionContainer { export interface IStackFrame extends ITreeElement { thread: IThread; name: string; + presentationHint: string; frameId: number; range: IRange; source: Source; @@ -306,7 +307,6 @@ export interface IDebugConfiguration { inlineValues: boolean; hideActionBar: boolean; internalConsoleOptions: string; - variablesDelay: number; } export interface IGlobalConfig { @@ -432,6 +432,11 @@ export interface IDebugService { */ onDidChangeState: Event; + /** + * Allows to register on end process events. + */ + onDidEndProcess: Event; + /** * Gets the current configuration manager. */ @@ -527,7 +532,7 @@ export interface IDebugService { /** * Creates a new debug process. Depending on the configuration will either 'launch' or 'attach'. */ - createProcess(config: IConfig): TPromise; + createProcess(config: IConfig): TPromise; /** * Restarts a process or creates a new one if there is no active session. @@ -540,9 +545,9 @@ export interface IDebugService { stopProcess(process: IProcess): TPromise; /** - * Deemphasizes all sources with the passed uri. Source will appear as grayed out in callstack view. + * Makes unavailable all sources with the passed uri. Source will appear as grayed out in callstack view. */ - deemphasizeSource(uri: uri): void; + sourceIsNotAvailable(uri: uri): void; /** * Gets the current debug model. diff --git a/src/vs/workbench/parts/debug/common/debugModel.ts b/src/vs/workbench/parts/debug/common/debugModel.ts index 4b0a76db3205a4b4b6dac5767d324e7d3b817481..8bac39e3df7163f7aedec6c1f292b32cf7b4af7b 100644 --- a/src/vs/workbench/parts/debug/common/debugModel.ts +++ b/src/vs/workbench/parts/debug/common/debugModel.ts @@ -9,6 +9,8 @@ import { TPromise } from 'vs/base/common/winjs.base'; import * as lifecycle from 'vs/base/common/lifecycle'; import Event, { Emitter } from 'vs/base/common/event'; import { generateUuid } from 'vs/base/common/uuid'; +import * as errors from 'vs/base/common/errors'; +import { RunOnceScheduler } from 'vs/base/common/async'; import { clone } from 'vs/base/common/objects'; import severity from 'vs/base/common/severity'; import { isObject, isString } from 'vs/base/common/types'; @@ -96,7 +98,7 @@ export class OutputNameValueElement extends AbstractOutputElement implements IEx } public toString(): string { - return `${this.name}: ${this.value}`; + return this.name ? `${this.name}: ${this.value}` : this.value; } } @@ -333,13 +335,15 @@ export class StackFrame implements IStackFrame { public frameId: number, public source: Source, public name: string, - public range: IRange + public presentationHint: string, + public range: IRange, + private index: number ) { this.scopes = null; } public getId(): string { - return `stackframe:${this.thread.getId()}:${this.frameId}`; + return `stackframe:${this.thread.getId()}:${this.frameId}:${this.index}`; } public getScopes(): TPromise { @@ -383,7 +387,7 @@ export class StackFrame implements IStackFrame { description: this.source.origin, options: { preserveFocus, - selection: { startLineNumber: this.range.startLineNumber, startColumn: 1 }, + selection: this.range, revealIfVisible: true, revealInCenterIfOutsideViewport: true, pinned: !preserveFocus @@ -434,22 +438,14 @@ export class Thread implements IThread { * Only fetches the first stack frame for performance reasons. Calling this method consecutive times * gets the remainder of the call stack. */ - public fetchCallStack(): TPromise { + public fetchCallStack(levels = 20): TPromise { if (!this.stopped) { return TPromise.as(null); } - if (!this.fetchPromise) { - this.fetchPromise = this.getCallStackImpl(0, 1).then(callStack => { - this.callStack = callStack || []; - }); - } else { - this.fetchPromise = this.fetchPromise.then(() => this.getCallStackImpl(this.callStack.length, 20).then(callStackSecondPart => { - this.callStack = this.callStack.concat(callStackSecondPart); - })); - } - - return this.fetchPromise; + return this.getCallStackImpl(this.callStack.length, levels).then(callStack => { + this.callStack = this.callStack.concat(callStack || []); + }); } private getCallStackImpl(startFrame: number, levels: number): TPromise { @@ -462,22 +458,20 @@ export class Thread implements IThread { this.stoppedDetails.totalFrames = response.body.totalFrames; } - return response.body.stackFrames.map((rsf, level) => { - let source = new Source(rsf.source, rsf.source ? rsf.source.presentationHint : rsf.presentationHint); + return response.body.stackFrames.map((rsf, index) => { + let source = new Source(rsf.source); if (this.process.sources.has(source.uri.toString())) { - const alreadyCreatedSource = this.process.sources.get(source.uri.toString()); - alreadyCreatedSource.presenationHint = source.presenationHint; - source = alreadyCreatedSource; + source = this.process.sources.get(source.uri.toString()); } else { this.process.sources.set(source.uri.toString(), source); } - return new StackFrame(this, rsf.id, source, rsf.name, new Range( + return new StackFrame(this, rsf.id, source, rsf.name, rsf.presentationHint, new Range( rsf.line, rsf.column, rsf.endLine, rsf.endColumn - )); + ), startFrame + index); }); }, (err: Error) => { if (this.stoppedDetails) { @@ -501,12 +495,18 @@ export class Thread implements IThread { }); } - return session.exceptionInfo({ threadId: this.threadId }).then(exception => ({ - id: exception.body.exceptionId, - description: exception.body.description, - breakMode: exception.body.breakMode, - details: exception.body.details - })); + return session.exceptionInfo({ threadId: this.threadId }).then(exception => { + if (!exception) { + return null; + } + + return { + id: exception.body.exceptionId, + description: exception.body.description, + breakMode: exception.body.breakMode, + details: exception.body.details + }; + }); } return TPromise.as(null); @@ -737,6 +737,7 @@ export class Model implements IModel { private processes: Process[]; private toDispose: lifecycle.IDisposable[]; private replElements: IReplElement[]; + private schedulers = new Map(); private _onDidChangeBreakpoints: Emitter; private _onDidChangeCallStack: Emitter; private _onDidChangeWatchExpressions: Emitter; @@ -804,16 +805,31 @@ export class Model implements IModel { public clearThreads(id: string, removeThreads: boolean, reference: number = undefined): void { const process = this.processes.filter(p => p.getId() === id).pop(); + this.schedulers.forEach(scheduler => scheduler.dispose()); + this.schedulers.clear(); + if (process) { process.clearThreads(removeThreads, reference); this._onDidChangeCallStack.fire(); } } - public fetchCallStack(thread: IThread): TPromise { - return (thread).fetchCallStack().then(() => { - this._onDidChangeCallStack.fire(); - }); + public fetchCallStack(thread: Thread): TPromise { + if (thread.process.session.capabilities.supportsDelayedStackTraceLoading) { + // For improved performance load the first stack frame and then load the rest async. + return thread.fetchCallStack(1).then(() => { + if (!this.schedulers.has(thread.getId())) { + this.schedulers.set(thread.getId(), new RunOnceScheduler(() => { + thread.fetchCallStack(19).done(() => this._onDidChangeCallStack.fire(), errors.onUnexpectedError); + }, 420)); + } + + this.schedulers.get(thread.getId()).schedule(); + this._onDidChangeCallStack.fire(); + }); + } + + return thread.fetchCallStack(); } public getBreakpoints(): Breakpoint[] { @@ -938,9 +954,11 @@ export class Model implements IModel { public appendToRepl(output: string | IExpression, severity: severity): void { if (typeof output === 'string') { const previousOutput = this.replElements.length && (this.replElements[this.replElements.length - 1] as OutputElement); - if (previousOutput instanceof OutputElement && severity === previousOutput.severity && previousOutput.value === output && output.trim() && output.length > 1) { + const lastNonEmpty = previousOutput && previousOutput.value.trim() ? previousOutput : this.replElements.length > 1 ? this.replElements[this.replElements.length - 2] : undefined; + + if (lastNonEmpty instanceof OutputElement && severity === lastNonEmpty.severity && lastNonEmpty.value === output.trim() && output.trim() && output.length > 1) { // we got the same output (but not an empty string when trimmed) so we just increment the counter - previousOutput.counter++; + lastNonEmpty.counter++; } else { const toAdd = output.split('\n').map(line => new OutputElement(line, severity)); if (previousOutput instanceof OutputElement && severity === previousOutput.severity && toAdd.length) { @@ -1033,10 +1051,10 @@ export class Model implements IModel { this._onDidChangeWatchExpressions.fire(); } - public deemphasizeSource(uri: uri): void { + public sourceIsNotAvailable(uri: uri): void { this.processes.forEach(p => { if (p.sources.has(uri.toString())) { - p.sources.get(uri.toString()).presenationHint = 'deemphasize'; + p.sources.get(uri.toString()).available = false; } }); this._onDidChangeCallStack.fire(); diff --git a/src/vs/workbench/parts/debug/common/debugProtocol.d.ts b/src/vs/workbench/parts/debug/common/debugProtocol.d.ts index b6b16f7ad5bff9ff96a32426d98970da15ab59e3..04ae77ec97edbe298b6d59328605a176f83b4be9 100644 --- a/src/vs/workbench/parts/debug/common/debugProtocol.d.ts +++ b/src/vs/workbench/parts/debug/common/debugProtocol.d.ts @@ -988,6 +988,8 @@ declare module DebugProtocol { supportsExceptionInfoRequest?: boolean; /** The debug adapter supports the 'terminateDebuggee' attribute on the 'disconnect' request. */ supportTerminateDebuggee?: boolean; + /** The debug adapter supports the delayed loading of parts of the stack, which requires that both the 'startFrame' and 'levels' arguments and the 'totalFrames' result of the 'StackTrace' request are supported. */ + supportsDelayedStackTraceLoading?: boolean; } /** An ExceptionBreakpointsFilter is shown in the UI as an option for configuring how exceptions are dealt with. */ @@ -1123,8 +1125,8 @@ declare module DebugProtocol { endColumn?: number; /** The module associated with this frame, if any. */ moduleId?: number | string; - /** An optional hint for how to present this frame in the UI. A value of 'label' can be used to indicate that the frame is an artificial frame that is used as a visual label or separator. */ - presentationHint?: 'normal' | 'label'; + /** An optional hint for how to present this frame in the UI. A value of 'label' can be used to indicate that the frame is an artificial frame that is used as a visual label or separator. A value of 'subtle' can be used to change the appearance of a frame in a 'subtle' way. */ + presentationHint?: 'normal' | 'label' | 'subtle'; } /** A Scope is a named container for variables. Optionally a scope can map to a source or a range within a source. */ @@ -1305,6 +1307,8 @@ declare module DebugProtocol { line?: boolean; /** Displays the module of the stack frame. */ module?: boolean; + /** Includes all stack frames, including those the debug adapter might otherwise hide. */ + includeAll?: boolean; } /** An ExceptionOptions assigns configuration options to a set of exceptions. */ diff --git a/src/vs/workbench/parts/debug/common/debugSource.ts b/src/vs/workbench/parts/debug/common/debugSource.ts index 103ec1d9ec8eba59720053ae2d68501eced411dc..4ccf9f55e4325685ea3b4b54baf2acc03c978943 100644 --- a/src/vs/workbench/parts/debug/common/debugSource.ts +++ b/src/vs/workbench/parts/debug/common/debugSource.ts @@ -12,12 +12,14 @@ const UNKNOWN_SOURCE_LABEL = nls.localize('unknownSource', "Unknown Source"); export class Source { public uri: uri; + public available: boolean; - constructor(public raw: DebugProtocol.Source, public presenationHint: string) { + constructor(public raw: DebugProtocol.Source) { if (!raw) { this.raw = { name: UNKNOWN_SOURCE_LABEL }; } const path = this.raw.path || this.raw.name; + this.available = this.raw.name !== UNKNOWN_SOURCE_LABEL; this.uri = this.raw.sourceReference > 0 ? uri.parse(`${DEBUG_SCHEME}:${path}`) : uri.file(path); } @@ -29,12 +31,12 @@ export class Source { return this.raw.origin; } - public get reference() { - return this.raw.sourceReference; + public get presentationHint() { + return this.raw.presentationHint; } - public get available() { - return this.raw.name !== UNKNOWN_SOURCE_LABEL; + public get reference() { + return this.raw.sourceReference; } public get inMemory() { diff --git a/src/vs/workbench/parts/debug/electron-browser/debug.contribution.ts b/src/vs/workbench/parts/debug/electron-browser/debug.contribution.ts index b8faa49a1a163f5ba866cb6bf6ac805e967e4505..4468fb8c807d51361219809c7c6763d0021384b6 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debug.contribution.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debug.contribution.ts @@ -8,14 +8,13 @@ import 'vs/css!../browser/media/debugHover'; import * as nls from 'vs/nls'; import { KeyMod, KeyCode } from 'vs/base/common/keyCodes'; import { SyncActionDescriptor } from 'vs/platform/actions/common/actions'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { KeybindingsRegistry, IKeybindings } from 'vs/platform/keybinding/common/keybindingsRegistry'; import { IConfigurationRegistry, Extensions as ConfigurationExtensions } from 'vs/platform/configuration/common/configurationRegistry'; import { IWorkbenchActionRegistry, Extensions as WorkbenchActionRegistryExtensions } from 'vs/workbench/common/actionRegistry'; import { ToggleViewletAction, Extensions as ViewletExtensions, ViewletRegistry, ViewletDescriptor } from 'vs/workbench/browser/viewlet'; import { TogglePanelAction, Extensions as PanelExtensions, PanelRegistry, PanelDescriptor } from 'vs/workbench/browser/panel'; -import { DebugViewRegistry } from 'vs/workbench/parts/debug/browser/debugViewRegistry'; import { VariablesView, WatchExpressionsView, CallStackView, BreakpointsView } from 'vs/workbench/parts/debug/electron-browser/debugViews'; import { Extensions as WorkbenchExtensions, IWorkbenchContributionsRegistry } from 'vs/workbench/common/contributions'; import { IDebugService, VIEWLET_ID, REPL_ID, CONTEXT_NOT_IN_DEBUG_MODE, CONTEXT_IN_DEBUG_MODE, INTERNAL_CONSOLE_OPTIONS_SCHEMA } from 'vs/workbench/parts/debug/common/debug'; @@ -35,6 +34,7 @@ import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/edi import * as debugCommands from 'vs/workbench/parts/debug/electron-browser/debugCommands'; import { IQuickOpenRegistry, Extensions as QuickOpenExtensions, QuickOpenHandlerDescriptor } from 'vs/workbench/browser/quickopen'; import { StatusBarColorProvider } from 'vs/workbench/parts/debug/electron-browser/statusbarColorProvider'; +import { ViewLocation, ViewsRegistry } from 'vs/workbench/parts/views/browser/viewsRegistry'; class OpenDebugViewletAction extends ToggleViewletAction { public static ID = VIEWLET_ID; @@ -94,10 +94,10 @@ Registry.as(PanelExtensions.Panels).registerPanel(new PanelDescri Registry.as(PanelExtensions.Panels).setDefaultPanelId(REPL_ID); // Register default debug views -DebugViewRegistry.registerDebugView(VariablesView, 10, 40); -DebugViewRegistry.registerDebugView(WatchExpressionsView, 20, 10); -DebugViewRegistry.registerDebugView(CallStackView, 30, 30); -DebugViewRegistry.registerDebugView(BreakpointsView, 40, 20); +ViewsRegistry.registerViews([{ id: 'workbench.debug.variablesView', name: '', ctor: VariablesView, order: 10, size: 40, location: ViewLocation.Debug }]); +ViewsRegistry.registerViews([{ id: 'workbench.debug.watchExpressionsView', name: '', ctor: WatchExpressionsView, order: 20, size: 10, location: ViewLocation.Debug }]); +ViewsRegistry.registerViews([{ id: 'workbench.debug.callStackView', name: '', ctor: CallStackView, order: 30, size: 30, location: ViewLocation.Debug }]); +ViewsRegistry.registerViews([{ id: 'workbench.debug.breakPointsView', name: '', ctor: BreakpointsView, order: 40, size: 20, location: ViewLocation.Debug }]); // register action to open viewlet const registry = Registry.as(WorkbenchActionRegistryExtensions.WorkbenchActions); @@ -127,9 +127,9 @@ registry.registerWorkbenchAction(new SyncActionDescriptor(RunAction, RunAction.I registry.registerWorkbenchAction(new SyncActionDescriptor(RemoveAllBreakpointsAction, RemoveAllBreakpointsAction.ID, RemoveAllBreakpointsAction.LABEL), 'Debug: Remove All Breakpoints', debugCategory); registry.registerWorkbenchAction(new SyncActionDescriptor(EnableAllBreakpointsAction, EnableAllBreakpointsAction.ID, EnableAllBreakpointsAction.LABEL), 'Debug: Enable All Breakpoints', debugCategory); registry.registerWorkbenchAction(new SyncActionDescriptor(DisableAllBreakpointsAction, DisableAllBreakpointsAction.ID, DisableAllBreakpointsAction.LABEL), 'Debug: Disable All Breakpoints', debugCategory); -registry.registerWorkbenchAction(new SyncActionDescriptor(ClearReplAction, ClearReplAction.ID, ClearReplAction.LABEL), 'Debug: Clear Debug Console', debugCategory); +registry.registerWorkbenchAction(new SyncActionDescriptor(ClearReplAction, ClearReplAction.ID, ClearReplAction.LABEL), 'Debug: Clear Console', debugCategory); registry.registerWorkbenchAction(new SyncActionDescriptor(FocusReplAction, FocusReplAction.ID, FocusReplAction.LABEL), 'Debug: Focus Debug Console', debugCategory); -registry.registerWorkbenchAction(new SyncActionDescriptor(SelectAndStartAction, SelectAndStartAction.ID, SelectAndStartAction.LABEL), 'Debug: Launch Configuration', debugCategory); +registry.registerWorkbenchAction(new SyncActionDescriptor(SelectAndStartAction, SelectAndStartAction.ID, SelectAndStartAction.LABEL), 'Debug: Select and Start Debugging', debugCategory); // Register Quick Open (Registry.as(QuickOpenExtensions.Quickopen)).registerQuickOpenHandler( @@ -137,6 +137,7 @@ registry.registerWorkbenchAction(new SyncActionDescriptor(SelectAndStartAction, 'vs/workbench/parts/debug/browser/debugQuickOpen', 'DebugQuickOpenHandler', 'debug ', + 'inLaunchConfigurationsPicker', nls.localize('debugCommands', "Debug Configuration") ) ); @@ -173,10 +174,6 @@ configurationRegistry.registerConfiguration({ default: false }, 'debug.internalConsoleOptions': INTERNAL_CONSOLE_OPTIONS_SCHEMA, - 'debug.variablesDelay': { - type: 'number', - default: 400 - }, 'launch': { type: 'object', description: nls.localize({ comment: ['This is the description for a setting'], key: 'launch' }, "Global debug launch configuration. Should be used as an alternative to 'launch.json' that is shared across workspaces"), diff --git a/src/vs/workbench/parts/debug/electron-browser/debugCommands.ts b/src/vs/workbench/parts/debug/electron-browser/debugCommands.ts index ec6a8673d4f3b4c70a4649c424862f4a3a73a409..80af473e78ee9c3200574ee381cebe4ee8e1b2d2 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debugCommands.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debugCommands.ts @@ -33,9 +33,9 @@ export function registerCommands(): void { if (typeof configurationOrName === 'string') { debugService.getViewModel().setSelectedConfigurationName(configurationOrName); - return debugService.startDebugging(); + debugService.startDebugging(); } else { - return debugService.createProcess(configurationOrName); + debugService.createProcess(configurationOrName); } }, when: CONTEXT_NOT_IN_DEBUG_MODE, @@ -199,7 +199,7 @@ export function registerCommands(): void { primary: undefined, handler: (accessor) => { const manager = accessor.get(IDebugService).getConfigurationManager(); - if (!accessor.get(IWorkspaceContextService).getWorkspace()) { + if (!accessor.get(IWorkspaceContextService).hasWorkspace()) { accessor.get(IMessageService).show(severity.Info, nls.localize('noFolderDebugConfig', "Please first open a folder in order to do advanced debug configuration.")); return TPromise.as(null); } diff --git a/src/vs/workbench/parts/debug/electron-browser/debugConfigurationManager.ts b/src/vs/workbench/parts/debug/electron-browser/debugConfigurationManager.ts index 35091fbd8b73a7d1e0ccb0a9d8190fc8b947f91d..787275982d9d475cdddd35aaeab3dbcfb18d8373 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debugConfigurationManager.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debugConfigurationManager.ts @@ -15,7 +15,7 @@ import { IJSONSchema } from 'vs/base/common/jsonSchema'; import { IModel, isCommonCodeEditor } from 'vs/editor/common/editorCommon'; import { IEditor } from 'vs/platform/editor/common/editor'; import * as extensionsRegistry from 'vs/platform/extensions/common/extensionsRegistry'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { IJSONContributionRegistry, Extensions as JSONExtensions } from 'vs/platform/jsonschemas/common/jsonContributionRegistry'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IFileService } from 'vs/platform/files/common/files'; @@ -272,7 +272,7 @@ export class ConfigurationManager implements debug.IConfigurationManager { } public getCompound(name: string): debug.ICompound { - if (!this.contextService.getWorkspace()) { + if (!this.contextService.hasWorkspace()) { return null; } @@ -302,7 +302,7 @@ export class ConfigurationManager implements debug.IConfigurationManager { } public getConfiguration(name: string): debug.IConfig { - if (!this.contextService.getWorkspace()) { + if (!this.contextService.hasWorkspace()) { return null; } @@ -315,7 +315,7 @@ export class ConfigurationManager implements debug.IConfigurationManager { } public resloveConfiguration(config: debug.IConfig): TPromise { - if (!this.contextService.getWorkspace()) { + if (!this.contextService.hasWorkspace()) { return TPromise.as(config); } diff --git a/src/vs/workbench/parts/debug/electron-browser/debugEditorContribution.ts b/src/vs/workbench/parts/debug/electron-browser/debugEditorContribution.ts index f0e0ed7a9bdef2d45fb876723e795714a425aa01..4870b63347007dda9e947b54dca2e7961d8ae4e8 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debugEditorContribution.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debugEditorContribution.ts @@ -37,7 +37,8 @@ import { FloatingClickWidget } from 'vs/workbench/parts/preferences/browser/pref import { IListService } from 'vs/platform/list/browser/listService'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { Position } from 'vs/editor/common/core/position'; -import { CoreEditingCommands } from "vs/editor/common/controller/coreCommands"; +import { CoreEditingCommands } from 'vs/editor/common/controller/coreCommands'; +import { first } from 'vs/base/common/arrays'; const HOVER_DELAY = 300; const LAUNCH_JSON_REGEX = /launch\.json$/; @@ -362,8 +363,13 @@ export class DebugEditorContribution implements IDebugEditorContribution { return; } - // First call stack frame is the frame where exception has been thrown - const exceptionSf = callStack[0]; + // First call stack frame that is available is the frame where exception has been thrown + const exceptionSf = first(callStack, sf => sf.source && sf.source.available, undefined); + if (!exceptionSf) { + this.closeExceptionWidget(); + return; + } + const sameUri = exceptionSf.source.uri.toString() === model.uri.toString(); if (this.exceptionWidget && !sameUri) { this.closeExceptionWidget(); diff --git a/src/vs/workbench/parts/debug/electron-browser/debugHover.ts b/src/vs/workbench/parts/debug/electron-browser/debugHover.ts index 4e5b9be2e79f50909fdb1f30c8f4dd8a745fcbfe..6948d29a257bfd06b1e1d4c9536f0e59a7bef6b9 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debugHover.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debugHover.ts @@ -21,13 +21,13 @@ import { IDebugService, IExpression, IExpressionContainer } from 'vs/workbench/p import { Expression } from 'vs/workbench/parts/debug/common/debugModel'; import { VariablesRenderer, renderExpressionValue, VariablesDataSource } from 'vs/workbench/parts/debug/electron-browser/debugViewer'; import { IListService } from 'vs/platform/list/browser/listService'; +import { DomScrollableElement } from 'vs/base/browser/ui/scrollbar/scrollableElement'; import { attachListStyler, attachStylerCallback } from 'vs/platform/theme/common/styler'; import { IThemeService } from 'vs/platform/theme/common/themeService'; -import { editorHoverBackground, editorHoverBorder } from "vs/platform/theme/common/colorRegistry"; +import { editorHoverBackground, editorHoverBorder } from 'vs/platform/theme/common/colorRegistry'; const $ = dom.$; const MAX_ELEMENTS_SHOWN = 18; -const MAX_VALUE_RENDER_LENGTH_IN_HOVER = 4096; export class DebugHoverWidget implements IContentWidget { @@ -46,6 +46,7 @@ export class DebugHoverWidget implements IContentWidget { private valueContainer: HTMLElement; private stoleFocus: boolean; private toDispose: lifecycle.IDisposable[]; + private scrollbar: DomScrollableElement; constructor( private editor: ICodeEditor, @@ -58,9 +59,12 @@ export class DebugHoverWidget implements IContentWidget { this.create(instantiationService); this.registerListeners(); - this.valueContainer = dom.append(this.domNode, $('.value')); + this.valueContainer = $('.value'); this.valueContainer.tabIndex = 0; this.valueContainer.setAttribute('role', 'tooltip'); + this.scrollbar = new DomScrollableElement(this.valueContainer, {}); + this.domNode.appendChild(this.scrollbar.getDomNode()); + this.toDispose.push(this.scrollbar); this._isVisible = false; this.showAtPosition = null; @@ -249,9 +253,9 @@ export class DebugHoverWidget implements IContentWidget { this.valueContainer.hidden = false; renderExpressionValue(expression, this.valueContainer, { showChanged: false, - maxValueLength: MAX_VALUE_RENDER_LENGTH_IN_HOVER, preserveWhitespace: true }); + this.scrollbar.scanDomNode(); this.valueContainer.title = ''; this.editor.layoutContentWidget(this); if (focus) { diff --git a/src/vs/workbench/parts/debug/electron-browser/debugService.ts b/src/vs/workbench/parts/debug/electron-browser/debugService.ts index c54ba326fb556872e58c1921976fb7beda06374c..94e68aca9d4408c8737a6b2dddbb200f19707e29 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debugService.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debugService.ts @@ -7,7 +7,6 @@ import * as nls from 'vs/nls'; import * as lifecycle from 'vs/base/common/lifecycle'; import Event, { Emitter } from 'vs/base/common/event'; import * as paths from 'vs/base/common/paths'; -import { RunOnceScheduler } from 'vs/base/common/async'; import * as strings from 'vs/base/common/strings'; import { generateUuid } from 'vs/base/common/uuid'; import uri from 'vs/base/common/uri'; @@ -69,6 +68,7 @@ export class DebugService implements debug.IDebugService { private sessionStates: Map; private _onDidChangeState: Emitter; + private _onDidEndProcess: Emitter; private model: Model; private viewModel: ViewModel; private configurationManager: ConfigurationManager; @@ -80,7 +80,7 @@ export class DebugService implements debug.IDebugService { private debugType: IContextKey; private debugState: IContextKey; private breakpointsToSendOnResourceSaved: Set; - private callStackScheduler: RunOnceScheduler; + private launchJsonChanged: boolean; constructor( @IStorageService private storageService: IStorageService, @@ -108,6 +108,7 @@ export class DebugService implements debug.IDebugService { this.toDisposeOnSessionEnd = new Map(); this.breakpointsToSendOnResourceSaved = new Set(); this._onDidChangeState = new Emitter(); + this._onDidEndProcess = new Emitter(); this.sessionStates = new Map(); this.configurationManager = this.instantiationService.createInstance(ConfigurationManager); @@ -119,17 +120,6 @@ export class DebugService implements debug.IDebugService { this.loadExceptionBreakpoints(), this.loadWatchExpressions()); this.toDispose.push(this.model); this.viewModel = new ViewModel(this.storageService.get(DEBUG_SELECTED_CONFIG_NAME_KEY, StorageScope.WORKSPACE, null)); - this.callStackScheduler = new RunOnceScheduler(() => { - const focusedThread = this.viewModel.focusedThread; - if (focusedThread) { - const callStack = focusedThread.getCallStack(); - // Some adapters might not respect the number levels in StackTraceRequest and might - // return more stackFrames than requested. For those do not send an additional stackTrace request. - if (callStack.length <= 1) { - this.model.fetchCallStack(focusedThread).done(undefined, errors.onUnexpectedError); - } - } - }, 420); this.registerListeners(lifecycleService); } @@ -171,7 +161,7 @@ export class DebugService implements debug.IDebugService { // attach: PH is ready to be attached to // TODO@Isidor this is a hack to just get any 'extensionHost' session. // Optimally the broadcast would contain the id of the session - // We are only intersted if we have an active debug session for extensionHost + // We are only interested if we have an active debug session for extensionHost const process = this.model.getProcesses().filter(p => strings.equalsIgnoreCase(p.configuration.type, 'extensionhost')).pop(); const session = process ? process.session : null; if (broadcast.channel === EXTENSION_ATTACH_BROADCAST_CHANNEL) { @@ -224,12 +214,12 @@ export class DebugService implements debug.IDebugService { // flush any existing simple values logged if (simpleVals.length) { - this.model.appendToRepl(simpleVals.join(' '), sev); + this.logToRepl(simpleVals.join(' '), sev); simpleVals = []; } // show object - this.model.appendToRepl(new OutputNameValueElement((a).prototype, a, nls.localize('snapshotObj', "Only primitive values are shown for this object.")), sev); + this.logToRepl(new OutputNameValueElement((a).prototype, a, nls.localize('snapshotObj', "Only primitive values are shown for this object.")), sev); } // string: watch out for % replacement directive @@ -257,13 +247,34 @@ export class DebugService implements debug.IDebugService { } // flush simple values - // always append a new line for output coming from an extension such that seperate logs go to seperate lines #23695 + // always append a new line for output coming from an extension such that separate logs go to separate lines #23695 if (simpleVals.length) { - this.model.appendToRepl(simpleVals.join(' ') + '\n', sev); + this.logToRepl(simpleVals.join(' ') + '\n', sev); } } } + private tryToAutoFocusStackFrame(thread: debug.IThread): TPromise { + const callStack = thread.getCallStack(); + if (!callStack.length || this.viewModel.focusedStackFrame) { + return TPromise.as(null); + } + + // focus first stack frame from top that has source location if no other stack frame is focussed + const stackFrameToFocus = first(callStack, sf => sf.source && sf.source.available, undefined); + if (!stackFrameToFocus) { + return TPromise.as(null); + } + + this.focusStackFrameAndEvaluate(stackFrameToFocus).done(null, errors.onUnexpectedError); + if (thread.stoppedDetails) { + this.windowService.getWindow().focus(); + aria.alert(nls.localize('debuggingPaused', "Debugging paused, reason {0}, {1} {2}", thread.stoppedDetails.reason, stackFrameToFocus.source ? stackFrameToFocus.source.name : '', stackFrameToFocus.range.startLineNumber)); + } + + return stackFrameToFocus.openInEditor(this.editorService); + } + private registerSessionListeners(process: Process, session: RawDebugSession): void { this.toDisposeOnSessionEnd.get(session.getId()).push(session); this.toDisposeOnSessionEnd.get(session.getId()).push(session.onDidInitialize(event => { @@ -307,18 +318,7 @@ export class DebugService implements debug.IDebugService { // Call fetch call stack twice, the first only return the top stack frame. // Second retrieves the rest of the call stack. For performance reasons #25605 this.model.fetchCallStack(thread).then(() => { - const callStack = thread.getCallStack(); - this.callStackScheduler.schedule(); - if (callStack.length > 0 && !this.viewModel.focusedStackFrame) { - // focus first stack frame from top that has source location if no other stack frame is focussed - const stackFrameToFocus = first(callStack, sf => sf.source && sf.source.available, callStack[0]); - this.focusStackFrameAndEvaluate(stackFrameToFocus).done(null, errors.onUnexpectedError); - this.windowService.getWindow().focus(); - aria.alert(nls.localize('debuggingPaused', "Debugging paused, reason {0}, {1} {2}", event.body.reason, stackFrameToFocus.source ? stackFrameToFocus.source.name : '', stackFrameToFocus.range.startLineNumber)); - - return stackFrameToFocus.openInEditor(this.editorService); - } - return undefined; + return this.tryToAutoFocusStackFrame(thread); }); } }, errors.onUnexpectedError); @@ -370,11 +370,11 @@ export class DebugService implements debug.IDebugService { children.forEach(child => { // Since we can not display multiple trees in a row, we are displaying these variables one after the other (ignoring their names) child.name = null; - this.model.appendToRepl(child, outputSeverity); + this.logToRepl(child, outputSeverity); }); }); } else if (typeof event.body.output === 'string') { - this.model.appendToRepl(event.body.output, outputSeverity); + this.logToRepl(event.body.output, outputSeverity); } })); @@ -398,8 +398,8 @@ export class DebugService implements debug.IDebugService { // 'Run without debugging' mode VSCode must terminate the extension host. More details: #3905 const process = this.viewModel.focusedProcess; if (process && session && process.getId() === session.getId() && strings.equalsIgnoreCase(process.configuration.type, 'extensionhost') && this.sessionStates.get(session.getId()) === debug.State.Running && - process && this.contextService.getWorkspace() && process.configuration.noDebug) { - this.windowsService.closeExtensionHostWindow(this.contextService.getWorkspace().resource.fsPath); + process && this.contextService.hasWorkspace() && process.configuration.noDebug) { + this.windowsService.closeExtensionHostWindow(this.contextService.getWorkspace2().roots.map(r => r.fsPath)); } if (session && session.getId() === event.body.sessionId) { this.onSessionEnd(session); @@ -484,6 +484,10 @@ export class DebugService implements debug.IDebugService { return this._onDidChangeState.event; } + public get onDidEndProcess(): Event { + return this._onDidEndProcess.event; + } + private updateStateAndEmit(sessionId?: string, newState?: debug.State): void { if (sessionId) { if (newState === debug.State.Inactive) { @@ -494,7 +498,10 @@ export class DebugService implements debug.IDebugService { } const state = this.state; - this.debugState.set(debug.State[state].toLowerCase()); + const stateLabel = debug.State[state]; + if (stateLabel) { + this.debugState.set(stateLabel.toLowerCase()); + } this._onDidChangeState.fire(state); } @@ -581,8 +588,13 @@ export class DebugService implements debug.IDebugService { this.model.removeReplExpressions(); } - public logToRepl(value: string, sev = severity.Info): void { - this.model.appendToRepl(value, sev); + public logToRepl(value: string | debug.IExpression, sev = severity.Info): void { + if (typeof value === 'string' && '[2J'.localeCompare(value) === 0) { + // [2J is the ansi escape sequence for clearing the display http://ascii-table.com/ansi-escape-sequences.php + this.model.removeReplExpressions(); + } else { + this.model.appendToRepl(value, sev); + } } public addWatchExpression(name: string): TPromise { @@ -608,6 +620,7 @@ export class DebugService implements debug.IDebugService { if (this.model.getProcesses().length === 0) { this.removeReplExpressions(); } + this.launchJsonChanged = false; const manager = this.getConfigurationManager(); configName = configName || this.viewModel.selectedConfigurationName; const config = manager.getConfiguration(configName); @@ -631,7 +644,7 @@ export class DebugService implements debug.IDebugService { if (commandAndType && commandAndType.command) { const defaultConfig = noDebug ? { noDebug: true } : {}; return this.commandService.executeCommand(commandAndType.command, config || defaultConfig).then((result: StartSessionResult) => { - if (this.contextService.getWorkspace()) { + if (this.contextService.hasWorkspace()) { if (result && result.status === 'initialConfiguration') { return manager.openConfigFile(false, commandAndType.type); } @@ -647,7 +660,7 @@ export class DebugService implements debug.IDebugService { if (config) { return this.createProcess(config); } - if (this.contextService.getWorkspace() && commandAndType) { + if (this.contextService.hasWorkspace() && commandAndType) { return manager.openConfigFile(false, commandAndType.type); } @@ -657,7 +670,7 @@ export class DebugService implements debug.IDebugService { )); } - public createProcess(config: debug.IConfig): TPromise { + public createProcess(config: debug.IConfig): TPromise { return this.textFileService.saveAll().then(() => this.configurationManager.resloveConfiguration(config).then(resolvedConfig => { if (!resolvedConfig) { @@ -704,7 +717,7 @@ export class DebugService implements debug.IDebugService { }); }); }, err => { - if (!this.contextService.getWorkspace()) { + if (!this.contextService.hasWorkspace()) { return this.messageService.show(severity.Error, nls.localize('noFolderWorkspaceDebugError', "The active file can not be debugged. Make sure it is saved on disk and that you have a debug extension installed for that file type.")); } @@ -717,7 +730,7 @@ export class DebugService implements debug.IDebugService { ); } - private doCreateProcess(configuration: debug.IConfig): TPromise { + private doCreateProcess(configuration: debug.IConfig): TPromise { const sessionId = generateUuid(); this.updateStateAndEmit(sessionId, debug.State.Initializing); @@ -788,7 +801,7 @@ export class DebugService implements debug.IDebugService { this.panelService.openPanel(debug.REPL_ID, false).done(undefined, errors.onUnexpectedError); } - if (!this.viewModel.changedWorkbenchViewState && (this.partService.isVisible(Parts.SIDEBAR_PART) || !this.contextService.getWorkspace())) { + if (!this.viewModel.changedWorkbenchViewState && (this.partService.isVisible(Parts.SIDEBAR_PART) || !this.contextService.hasWorkspace())) { // We only want to change the workbench view state on the first debug session #5738 and if the side bar is not hidden this.viewModel.changedWorkbenchViewState = true; this.viewletService.openViewlet(debug.VIEWLET_ID); @@ -811,7 +824,7 @@ export class DebugService implements debug.IDebugService { isBuiltin: adapter.extensionDescription.isBuiltin, launchJsonExists: !!this.configurationService.getConfiguration('launch') }); - }).then(undefined, (error: any) => { + }).then(() => process, (error: any) => { if (error instanceof Error && error.message === 'Canceled') { // Do not show 'canceled' error messages to the user #7906 return TPromise.as(null); @@ -887,13 +900,13 @@ export class DebugService implements debug.IDebugService { }); } - public deemphasizeSource(uri: uri): void { - this.model.deemphasizeSource(uri); + public sourceIsNotAvailable(uri: uri): void { + this.model.sourceIsNotAvailable(uri); } public restartProcess(process: debug.IProcess, restartData?: any): TPromise { if (process.session.capabilities.supportsRestartRequest) { - return process.session.custom('restart', null); + return this.textFileService.saveAll().then(() => process.session.custom('restart', null)); } const focusedProcess = this.viewModel.focusedProcess; const preserveFocus = focusedProcess && process.getId() === focusedProcess.getId(); @@ -901,15 +914,17 @@ export class DebugService implements debug.IDebugService { return process.session.disconnect(true).then(() => new TPromise((c, e) => { setTimeout(() => { - // Read the configuration again if a launch.json exists, if not just use the inmemory configuration #19366 - const config = this.configurationManager.getConfiguration(process.configuration.name); - if (config) { + // Read the configuration again if a launch.json has been changed, if not just use the inmemory configuration + let config = process.configuration; + if (this.launchJsonChanged) { + this.launchJsonChanged = false; + config = this.configurationManager.getConfiguration(process.configuration.name) || config; // Take the type from the process since the debug extension might overwrite it #21316 config.type = process.configuration.type; config.noDebug = process.configuration.noDebug; - config.__restart = restartData; } - this.createProcess(config || process.configuration).then(() => c(null), err => e(err)); + config.__restart = restartData; + this.createProcess(config).then(() => c(null), err => e(err)); }, 300); }) ).then(() => { @@ -950,6 +965,9 @@ export class DebugService implements debug.IDebugService { }); this.model.removeProcess(session.getId()); + if (process) { + this._onDidEndProcess.fire(process); + } this.toDisposeOnSessionEnd.set(session.getId(), lifecycle.dispose(this.toDisposeOnSessionEnd.get(session.getId()))); const focusedProcess = this.viewModel.focusedProcess; @@ -1095,16 +1113,48 @@ export class DebugService implements debug.IDebugService { this.breakpointsToSendOnResourceSaved.delete(event.resource.toString()); this.sendBreakpoints(event.resource, true).done(null, errors.onUnexpectedError); } + if (event.resource.toString().indexOf('.vscode/launch.json') >= 0) { + this.launchJsonChanged = true; + } }); } private store(): void { - this.storageService.store(DEBUG_BREAKPOINTS_KEY, JSON.stringify(this.model.getBreakpoints()), StorageScope.WORKSPACE); - this.storageService.store(DEBUG_BREAKPOINTS_ACTIVATED_KEY, this.model.areBreakpointsActivated() ? 'true' : 'false', StorageScope.WORKSPACE); - this.storageService.store(DEBUG_FUNCTION_BREAKPOINTS_KEY, JSON.stringify(this.model.getFunctionBreakpoints()), StorageScope.WORKSPACE); - this.storageService.store(DEBUG_EXCEPTION_BREAKPOINTS_KEY, JSON.stringify(this.model.getExceptionBreakpoints()), StorageScope.WORKSPACE); + const breakpoints = this.model.getBreakpoints(); + if (breakpoints.length) { + this.storageService.store(DEBUG_BREAKPOINTS_KEY, JSON.stringify(breakpoints), StorageScope.WORKSPACE); + } else { + this.storageService.remove(DEBUG_BREAKPOINTS_KEY, StorageScope.WORKSPACE); + } + + if (!this.model.areBreakpointsActivated()) { + this.storageService.store(DEBUG_BREAKPOINTS_ACTIVATED_KEY, 'false', StorageScope.WORKSPACE); + } else { + this.storageService.remove(DEBUG_BREAKPOINTS_ACTIVATED_KEY, StorageScope.WORKSPACE); + } + + const functionBreakpoints = this.model.getFunctionBreakpoints(); + if (functionBreakpoints.length) { + this.storageService.store(DEBUG_FUNCTION_BREAKPOINTS_KEY, JSON.stringify(functionBreakpoints), StorageScope.WORKSPACE); + } else { + this.storageService.remove(DEBUG_FUNCTION_BREAKPOINTS_KEY, StorageScope.WORKSPACE); + } + + const exceptionBreakpoints = this.model.getExceptionBreakpoints(); + if (exceptionBreakpoints.length) { + this.storageService.store(DEBUG_EXCEPTION_BREAKPOINTS_KEY, JSON.stringify(exceptionBreakpoints), StorageScope.WORKSPACE); + } else { + this.storageService.remove(DEBUG_EXCEPTION_BREAKPOINTS_KEY, StorageScope.WORKSPACE); + } + this.storageService.store(DEBUG_SELECTED_CONFIG_NAME_KEY, this.viewModel.selectedConfigurationName, StorageScope.WORKSPACE); - this.storageService.store(DEBUG_WATCH_EXPRESSIONS_KEY, JSON.stringify(this.model.getWatchExpressions().map(we => ({ name: we.name, id: we.getId() }))), StorageScope.WORKSPACE); + + const watchExpressions = this.model.getWatchExpressions(); + if (watchExpressions.length) { + this.storageService.store(DEBUG_WATCH_EXPRESSIONS_KEY, JSON.stringify(watchExpressions.map(we => ({ name: we.name, id: we.getId() }))), StorageScope.WORKSPACE); + } else { + this.storageService.remove(DEBUG_WATCH_EXPRESSIONS_KEY, StorageScope.WORKSPACE); + } } public dispose(): void { diff --git a/src/vs/workbench/parts/debug/electron-browser/debugViewer.ts b/src/vs/workbench/parts/debug/electron-browser/debugViewer.ts index 2c8391b709fbe5e37ed8846c1648c3af695ac8b4..64333e221426f4d8712164c61e5e5e1c54108afe 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debugViewer.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debugViewer.ts @@ -19,6 +19,7 @@ import { IActionItem, Separator } from 'vs/base/browser/ui/actionbar/actionbar'; import { ITree, IAccessibilityProvider, ContextMenuEvent, IDataSource, IRenderer, DRAG_OVER_REJECT, IDragAndDropData, IDragOverReaction, IActionProvider } from 'vs/base/parts/tree/browser/tree'; import { InputBox, IInputValidationOptions } from 'vs/base/browser/ui/inputbox/inputBox'; import { DefaultController, DefaultDragAndDrop, ClickBehavior } from 'vs/base/parts/tree/browser/treeDefaults'; +import { Constants } from 'vs/editor/common/core/uint'; import { IContextViewService, IContextMenuService } from 'vs/platform/contextview/browser/contextView'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; @@ -35,6 +36,7 @@ import { Source } from 'vs/workbench/parts/debug/common/debugSource'; import { once } from 'vs/base/common/functional'; import { attachInputBoxStyler } from 'vs/platform/theme/common/styler'; import { IThemeService } from 'vs/platform/theme/common/themeService'; +import { IEnvironmentService } from "vs/platform/environment/common/environment"; const $ = dom.$; const booleanRegex = /^true|false$/i; @@ -178,12 +180,12 @@ function renderRenameBox(debugService: debug.IDebugService, contextViewService: })); } -function getSourceName(source: Source, contextService: IWorkspaceContextService): string { +function getSourceName(source: Source, contextService: IWorkspaceContextService, environmentService?: IEnvironmentService): string { if (source.name) { return source.name; } - return getPathLabel(paths.basename(source.uri.fsPath), contextService); + return getPathLabel(paths.basename(source.uri.fsPath), contextService, environmentService); } export class BaseDebugController extends DefaultController { @@ -250,7 +252,9 @@ export class CallStackController extends BaseDebugController { return this.showMoreStackFrames(tree, element); } if (element instanceof StackFrame) { + super.onLeftClick(tree, element, event); this.focusStackFrame(element, event, event.detail !== 2); + return true; } return super.onLeftClick(tree, element, event); @@ -351,7 +355,7 @@ export class CallStackDataSource implements IDataSource { public getChildren(tree: ITree, element: any): TPromise { if (element instanceof Thread) { - return TPromise.as(this.getThreadChildren(element)); + return this.getThreadChildren(element); } if (element instanceof Model) { return TPromise.as(element.getProcesses()); @@ -361,25 +365,25 @@ export class CallStackDataSource implements IDataSource { return TPromise.as(process.getAllThreads()); } - private getThreadChildren(thread: Thread): any[] { - const callStack: any[] = thread.getCallStack(); - if (!callStack) { - return []; + private getThreadChildren(thread: Thread): TPromise { + let callStack: any[] = thread.getCallStack(); + if (!callStack || !callStack.length) { + thread.fetchCallStack().then(() => callStack = thread.getCallStack()); } if (callStack.length === 1) { // To reduce flashing of the call stack view simply append the stale call stack // once we have the correct data the tree will refresh and we will no longer display it. - return callStack.concat(thread.getStaleCallStack().slice(1)); + return TPromise.as(callStack.concat(thread.getStaleCallStack().slice(1))); } if (thread.stoppedDetails && thread.stoppedDetails.framesErrorMessage) { - return callStack.concat([thread.stoppedDetails.framesErrorMessage]); + return TPromise.as(callStack.concat([thread.stoppedDetails.framesErrorMessage])); } if (thread.stoppedDetails && thread.stoppedDetails.totalFrames > callStack.length && callStack.length > 1) { - return callStack.concat([new ThreadAndProcessIds(thread.process.getId(), thread.threadId)]); + return TPromise.as(callStack.concat([new ThreadAndProcessIds(thread.process.getId(), thread.threadId)])); } - return callStack; + return TPromise.as(callStack); } public getParent(tree: ITree, element: any): TPromise { @@ -425,7 +429,10 @@ export class CallStackRenderer implements IRenderer { private static LOAD_MORE_TEMPLATE_ID = 'loadMore'; private static PROCESS_TEMPLATE_ID = 'process'; - constructor( @IWorkspaceContextService private contextService: IWorkspaceContextService) { + constructor( + @IWorkspaceContextService private contextService: IWorkspaceContextService, + @IEnvironmentService private environmentService: IEnvironmentService + ) { // noop } @@ -537,15 +544,17 @@ export class CallStackRenderer implements IRenderer { } private renderStackFrame(stackFrame: debug.IStackFrame, data: IStackFrameTemplateData): void { - stackFrame.source.presenationHint === 'deemphasize' ? dom.addClass(data.stackFrame, 'disabled') : dom.removeClass(data.stackFrame, 'disabled'); - stackFrame.source.presenationHint === 'label' ? dom.addClass(data.stackFrame, 'label') : dom.removeClass(data.stackFrame, 'label'); + dom.toggleClass(data.stackFrame, 'disabled', !stackFrame.source.available || stackFrame.source.presentationHint === 'deemphasize'); + dom.toggleClass(data.stackFrame, 'label', stackFrame.presentationHint === 'label'); + dom.toggleClass(data.stackFrame, 'subtle', stackFrame.presentationHint === 'subtle'); + data.file.title = stackFrame.source.raw.path || stackFrame.source.name; if (stackFrame.source.raw.origin) { data.file.title += `\n${stackFrame.source.raw.origin}`; } data.label.textContent = stackFrame.name; data.label.title = stackFrame.name; - data.fileName.textContent = getSourceName(stackFrame.source, this.contextService); + data.fileName.textContent = getSourceName(stackFrame.source, this.contextService, this.environmentService); if (stackFrame.range.startLineNumber !== undefined) { data.lineNumber.textContent = `${stackFrame.range.startLineNumber}`; if (stackFrame.range.startColumn) { @@ -1020,7 +1029,7 @@ export class BreakpointsActionProvider implements IActionProvider { } public hasActions(tree: ITree, element: any): boolean { - return false;; + return false; } public hasSecondaryActions(tree: ITree, element: any): boolean { @@ -1103,7 +1112,8 @@ export class BreakpointsRenderer implements IRenderer { @IWorkspaceContextService private contextService: IWorkspaceContextService, @debug.IDebugService private debugService: debug.IDebugService, @IContextViewService private contextViewService: IContextViewService, - @IThemeService private themeService: IThemeService + @IThemeService private themeService: IThemeService, + @IEnvironmentService private environmentService: IEnvironmentService ) { // noop } @@ -1165,7 +1175,7 @@ export class BreakpointsRenderer implements IRenderer { } private renderExceptionBreakpoint(exceptionBreakpoint: debug.IExceptionBreakpoint, data: IBaseBreakpointTemplateData): void { - data.name.textContent = exceptionBreakpoint.label || `${exceptionBreakpoint.filter} exceptions`;; + data.name.textContent = exceptionBreakpoint.label || `${exceptionBreakpoint.filter} exceptions`; data.breakpoint.title = data.name.textContent; data.checkbox.checked = exceptionBreakpoint.enabled; } @@ -1200,12 +1210,12 @@ export class BreakpointsRenderer implements IRenderer { private renderBreakpoint(tree: ITree, breakpoint: debug.IBreakpoint, data: IBreakpointTemplateData): void { this.debugService.getModel().areBreakpointsActivated() ? tree.removeTraits('disabled', [breakpoint]) : tree.addTraits('disabled', [breakpoint]); - data.name.textContent = getPathLabel(paths.basename(breakpoint.uri.fsPath), this.contextService); + data.name.textContent = paths.basename(getPathLabel(breakpoint.uri, this.contextService)); data.lineNumber.textContent = breakpoint.lineNumber.toString(); if (breakpoint.column) { data.lineNumber.textContent += `:${breakpoint.column}`; } - data.filePath.textContent = getPathLabel(paths.dirname(breakpoint.uri.fsPath), this.contextService); + data.filePath.textContent = getPathLabel(paths.dirname(breakpoint.uri.fsPath), this.contextService, this.environmentService); data.checkbox.checked = breakpoint.enabled; const debugActive = this.debugService.state === debug.State.Running || this.debugService.state === debug.State.Stopped || this.debugService.state === debug.State.Initializing; @@ -1253,7 +1263,9 @@ export class BreakpointsController extends BaseDebugController { return true; } if (element instanceof Breakpoint) { + super.onLeftClick(tree, element, event); this.openBreakpointSource(element, event, event.detail !== 2); + return true; } return super.onLeftClick(tree, element, event); @@ -1268,7 +1280,9 @@ export class BreakpointsController extends BaseDebugController { endColumn: breakpoint.endColumn } : { startLineNumber: breakpoint.lineNumber, - startColumn: 1 + startColumn: breakpoint.column || 1, + endLineNumber: breakpoint.lineNumber, + endColumn: breakpoint.column || Constants.MAX_SAFE_SMALL_INTEGER }; this.editorService.openEditor({ diff --git a/src/vs/workbench/parts/debug/electron-browser/debugViews.ts b/src/vs/workbench/parts/debug/electron-browser/debugViews.ts index 63d48fe56945c1f82edbe2f84fed176b99b02351..07393efb17c0d4f9237ea1391e150f3b1ce0b289 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debugViews.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debugViews.ts @@ -11,13 +11,14 @@ import * as builder from 'vs/base/browser/builder'; import { TPromise } from 'vs/base/common/winjs.base'; import * as errors from 'vs/base/common/errors'; import { EventType } from 'vs/base/common/events'; -import { IActionRunner, IAction } from 'vs/base/common/actions'; -import { prepareActions } from 'vs/workbench/browser/actionBarRegistry'; +import { IAction } from 'vs/base/common/actions'; +import { prepareActions } from 'vs/workbench/browser/actions'; import { IHighlightEvent, ITree } from 'vs/base/parts/tree/browser/tree'; import { Tree } from 'vs/base/parts/tree/browser/treeImpl'; -import { CollapsibleState } from 'vs/base/browser/ui/splitview/splitview'; -import { CollapsibleViewletView, AdaptiveCollapsibleViewletView, CollapseAction } from 'vs/workbench/browser/viewlet'; -import { IDebugService, State, IDebugConfiguration, IBreakpoint, IExpression, CONTEXT_BREAKPOINTS_FOCUSED, CONTEXT_WATCH_EXPRESSIONS_FOCUSED, CONTEXT_VARIABLES_FOCUSED } from 'vs/workbench/parts/debug/common/debug'; +import { CollapsibleState, ViewSizing } from 'vs/base/browser/ui/splitview/splitview'; +import { CollapseAction } from 'vs/workbench/browser/viewlet'; +import { CollapsibleView, IViewletViewOptions, IViewOptions } from 'vs/workbench/parts/views/browser/views'; +import { IDebugService, State, IBreakpoint, IExpression, CONTEXT_BREAKPOINTS_FOCUSED, CONTEXT_WATCH_EXPRESSIONS_FOCUSED, CONTEXT_VARIABLES_FOCUSED } from 'vs/workbench/parts/debug/common/debug'; import { Expression, Variable, ExceptionBreakpoint, FunctionBreakpoint, Thread, StackFrame, Breakpoint, ThreadAndProcessIds } from 'vs/workbench/parts/debug/common/debugModel'; import * as viewer from 'vs/workbench/parts/debug/electron-browser/debugViewer'; import { AddWatchExpressionAction, RemoveAllWatchExpressionsAction, AddFunctionBreakpointAction, ToggleBreakpointsActivatedAction, RemoveAllBreakpointsAction } from 'vs/workbench/parts/debug/browser/debugActions'; @@ -25,8 +26,6 @@ import { IContextMenuService } from 'vs/platform/contextview/browser/contextView import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { MenuId } from 'vs/platform/actions/common/actions'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { IMessageService } from 'vs/platform/message/common/message'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey'; import { IListService } from 'vs/platform/list/browser/listService'; @@ -43,16 +42,15 @@ function renderViewTree(container: HTMLElement): HTMLElement { const $ = builder.$; const twistiePixels = 20; -export class VariablesView extends CollapsibleViewletView { +export class VariablesView extends CollapsibleView { private static MEMENTO = 'variablesview.memento'; private onFocusStackFrameScheduler: RunOnceScheduler; private variablesFocusedContext: IContextKey; + private settings: any; constructor( - actionRunner: IActionRunner, - private settings: any, - @IMessageService messageService: IMessageService, + options: IViewletViewOptions, @IContextMenuService contextMenuService: IContextMenuService, @ITelemetryService private telemetryService: ITelemetryService, @IDebugService private debugService: IDebugService, @@ -60,13 +58,13 @@ export class VariablesView extends CollapsibleViewletView { @IInstantiationService private instantiationService: IInstantiationService, @IContextKeyService contextKeyService: IContextKeyService, @IListService private listService: IListService, - @IThemeService private themeService: IThemeService, - @IConfigurationService private configurationService: IConfigurationService + @IThemeService private themeService: IThemeService ) { - super(actionRunner, !!settings[VariablesView.MEMENTO], nls.localize('variablesSection', "Variables Section"), messageService, keybindingService, contextMenuService); + super({ ...(options as IViewOptions), sizing: ViewSizing.Flexible, ariaHeaderLabel: nls.localize('variablesSection', "Variables Section") }, keybindingService, contextMenuService); + this.settings = options.viewletSettings; this.variablesFocusedContext = CONTEXT_VARIABLES_FOCUSED.bindTo(contextKeyService); - // Use schedulre to prevent unnecessary flashing + // Use scheduler to prevent unnecessary flashing this.onFocusStackFrameScheduler = new RunOnceScheduler(() => { // Always clear tree highlight to avoid ending up in a broken state #12203 this.tree.clearHighlight(); @@ -82,7 +80,7 @@ export class VariablesView extends CollapsibleViewletView { } return undefined; }).done(null, errors.onUnexpectedError); - }, this.configurationService.getConfiguration('debug').variablesDelay); + }, 400); } public renderHeader(container: HTMLElement): void { @@ -118,7 +116,7 @@ export class VariablesView extends CollapsibleViewletView { this.toolBar.setActions(prepareActions([collapseAction]))(); this.toDispose.push(viewModel.onDidFocusStackFrame(sf => { - // Refresh the tree immediatly if it is not visible. + // Refresh the tree immediately if it is not visible. // Otherwise postpone the refresh until user stops stepping. if (!this.tree.getContentHeight()) { this.onFocusStackFrameScheduler.schedule(0); @@ -152,17 +150,16 @@ export class VariablesView extends CollapsibleViewletView { } } -export class WatchExpressionsView extends CollapsibleViewletView { +export class WatchExpressionsView extends CollapsibleView { private static MEMENTO = 'watchexpressionsview.memento'; private onWatchExpressionsUpdatedScheduler: RunOnceScheduler; private toReveal: IExpression; private watchExpressionsFocusedContext: IContextKey; + private settings: any; constructor( - actionRunner: IActionRunner, - private settings: any, - @IMessageService messageService: IMessageService, + options: IViewletViewOptions, @IContextMenuService contextMenuService: IContextMenuService, @IDebugService private debugService: IDebugService, @IKeybindingService keybindingService: IKeybindingService, @@ -171,7 +168,8 @@ export class WatchExpressionsView extends CollapsibleViewletView { @IListService private listService: IListService, @IThemeService private themeService: IThemeService ) { - super(actionRunner, !!settings[WatchExpressionsView.MEMENTO], nls.localize('expressionsSection', "Expressions Section"), messageService, keybindingService, contextMenuService); + super({ ...(options as IViewOptions), ariaHeaderLabel: nls.localize('expressionsSection', "Expressions Section"), sizing: ViewSizing.Flexible }, keybindingService, contextMenuService); + this.settings = options.viewletSettings; this.toDispose.push(this.debugService.getModel().onDidChangeWatchExpressions(we => { // only expand when a new watch expression is added. @@ -251,17 +249,16 @@ export class WatchExpressionsView extends CollapsibleViewletView { } } -export class CallStackView extends CollapsibleViewletView { +export class CallStackView extends CollapsibleView { private static MEMENTO = 'callstackview.memento'; private pauseMessage: builder.Builder; private pauseMessageLabel: builder.Builder; private onCallStackChangeScheduler: RunOnceScheduler; + private settings: any; constructor( - actionRunner: IActionRunner, - private settings: any, - @IMessageService messageService: IMessageService, + options: IViewletViewOptions, @IContextMenuService contextMenuService: IContextMenuService, @ITelemetryService private telemetryService: ITelemetryService, @IDebugService private debugService: IDebugService, @@ -270,7 +267,8 @@ export class CallStackView extends CollapsibleViewletView { @IListService private listService: IListService, @IThemeService private themeService: IThemeService ) { - super(actionRunner, !!settings[CallStackView.MEMENTO], nls.localize('callstackSection', "Call Stack Section"), messageService, keybindingService, contextMenuService); + super({ ...(options as IViewOptions), ariaHeaderLabel: nls.localize('callstackSection', "Call Stack Section"), sizing: ViewSizing.Flexible }, keybindingService, contextMenuService); + this.settings = options.viewletSettings; // Create scheduler to prevent unnecessary flashing of tree when reacting to changes this.onCallStackChangeScheduler = new RunOnceScheduler(() => { @@ -283,7 +281,7 @@ export class CallStackView extends CollapsibleViewletView { } // Only show the global pause message if we do not display threads. - // Otherwsie there will be a pause message per thread and there is no need for a global one. + // Otherwise there will be a pause message per thread and there is no need for a global one. if (newTreeInput instanceof Thread && newTreeInput.stoppedDetails) { this.pauseMessageLabel.text(newTreeInput.stoppedDetails.description || nls.localize('debugStopped', "Paused on {0}", newTreeInput.stoppedDetails.reason)); if (newTreeInput.stoppedDetails.text) { @@ -357,7 +355,7 @@ export class CallStackView extends CollapsibleViewletView { private updateTreeSelection(): TPromise { if (!this.tree.getInput()) { - // Tree not initialitized yet + // Tree not initialized yet return TPromise.as(null); } @@ -386,15 +384,15 @@ export class CallStackView extends CollapsibleViewletView { } } -export class BreakpointsView extends AdaptiveCollapsibleViewletView { +export class BreakpointsView extends CollapsibleView { private static MAX_VISIBLE_FILES = 9; private static MEMENTO = 'breakopintsview.memento'; private breakpointsFocusedContext: IContextKey; + private settings: any; constructor( - actionRunner: IActionRunner, - private settings: any, + options: IViewletViewOptions, @IContextMenuService contextMenuService: IContextMenuService, @IDebugService private debugService: IDebugService, @IKeybindingService keybindingService: IKeybindingService, @@ -403,10 +401,14 @@ export class BreakpointsView extends AdaptiveCollapsibleViewletView { @IListService private listService: IListService, @IThemeService private themeService: IThemeService ) { - super(actionRunner, BreakpointsView.getExpandedBodySize( - debugService.getModel().getBreakpoints().length + debugService.getModel().getFunctionBreakpoints().length + debugService.getModel().getExceptionBreakpoints().length), - !!settings[BreakpointsView.MEMENTO], nls.localize('breakpointsSection', "Breakpoints Section"), keybindingService, contextMenuService); - + super({ + ...(options as IViewOptions), + ariaHeaderLabel: nls.localize('breakpointsSection', "Breakpoints Section"), + sizing: ViewSizing.Fixed, initialBodySize: BreakpointsView.getExpandedBodySize( + debugService.getModel().getBreakpoints().length + debugService.getModel().getFunctionBreakpoints().length + debugService.getModel().getExceptionBreakpoints().length) + }, keybindingService, contextMenuService); + + this.settings = options.viewletSettings; this.breakpointsFocusedContext = CONTEXT_BREAKPOINTS_FOCUSED.bindTo(contextKeyService); this.toDispose.push(this.debugService.getModel().onDidChangeBreakpoints(() => this.onBreakpointsChange())); } @@ -504,8 +506,8 @@ export class BreakpointsView extends AdaptiveCollapsibleViewletView { private onBreakpointsChange(): void { const model = this.debugService.getModel(); - this.expandedBodySize = BreakpointsView.getExpandedBodySize( - model.getBreakpoints().length + model.getExceptionBreakpoints().length + model.getFunctionBreakpoints().length); + this.setBodySize(BreakpointsView.getExpandedBodySize( + model.getBreakpoints().length + model.getExceptionBreakpoints().length + model.getFunctionBreakpoints().length)); if (this.tree) { this.tree.refresh(); diff --git a/src/vs/workbench/parts/debug/electron-browser/electronDebugActions.ts b/src/vs/workbench/parts/debug/electron-browser/electronDebugActions.ts index aef048ce10ffdc87a3bb5c5c67d71297de249ee3..eae64f5c6c4f7a37c5b4989bab1f7a402c93a328 100644 --- a/src/vs/workbench/parts/debug/electron-browser/electronDebugActions.ts +++ b/src/vs/workbench/parts/debug/electron-browser/electronDebugActions.ts @@ -7,6 +7,7 @@ import * as nls from 'vs/nls'; import { Action } from 'vs/base/common/actions'; import { TPromise } from 'vs/base/common/winjs.base'; import { ITree } from 'vs/base/parts/tree/browser/tree'; +import { removeAnsiEscapeCodes } from 'vs/base/common/strings'; import { Variable } from 'vs/workbench/parts/debug/common/debugModel'; import { IDebugService, IStackFrame } from 'vs/workbench/parts/debug/common/debug'; import { clipboard } from 'electron'; @@ -62,7 +63,7 @@ export class CopyAllAction extends Action { text += navigator.current().toString(); } - clipboard.writeText(text); + clipboard.writeText(removeAnsiEscapeCodes(text)); return TPromise.as(null); } } diff --git a/src/vs/workbench/parts/debug/electron-browser/rawDebugSession.ts b/src/vs/workbench/parts/debug/electron-browser/rawDebugSession.ts index 0df197051a3cd12a18c9bbd42fdb149e10bbb81f..d83e1999d53068539d8d19e22b9875b1b1a986f2 100644 --- a/src/vs/workbench/parts/debug/electron-browser/rawDebugSession.ts +++ b/src/vs/workbench/parts/debug/electron-browser/rawDebugSession.ts @@ -197,7 +197,7 @@ export class RawDebugSession extends v8.V8Protocol implements debug.ISession { this.emittedStopped = true; this._onDidStop.fire(event); } else if (event.event === 'continued') { - this.allThreadsContinued = (event).body.allThreadsContinued = false ? false : true; + this.allThreadsContinued = (event).body.allThreadsContinued === false ? false : true; this._onDidContinued.fire(event); } else if (event.event === 'thread') { this._onDidThread.fire(event); @@ -278,7 +278,7 @@ export class RawDebugSession extends v8.V8Protocol implements debug.ISession { return this.send('restartFrame', args).then(response => { this.fireFakeContinued(threadId); return response; - });; + }); } public completions(args: DebugProtocol.CompletionsArguments): TPromise { diff --git a/src/vs/workbench/parts/debug/electron-browser/repl.ts b/src/vs/workbench/parts/debug/electron-browser/repl.ts index cf2e3937375e1361a106e2b05c7641bc0ac27f1c..5823a900518f4b6b0d7ae142eed7afbe514a5bd2 100644 --- a/src/vs/workbench/parts/debug/electron-browser/repl.ts +++ b/src/vs/workbench/parts/debug/electron-browser/repl.ts @@ -43,6 +43,7 @@ import { IListService } from 'vs/platform/list/browser/listService'; import { attachListStyler } from 'vs/platform/theme/common/styler'; import { IEditorOptions } from 'vs/editor/common/config/editorOptions'; import { IThemeService } from 'vs/platform/theme/common/themeService'; +import { clipboard } from 'electron'; const $ = dom.$; @@ -59,6 +60,7 @@ export interface IPrivateReplService { _serviceBrand: any; navigateHistory(previous: boolean): void; acceptReplInput(): void; + getVisibleContent(): string; } export class Repl extends Panel implements IPrivateReplService { @@ -230,6 +232,20 @@ export class Repl extends Panel implements IPrivateReplService { this.layout(this.dimension); } + public getVisibleContent(): string { + let text = ''; + const navigator = this.tree.getNavigator(); + // skip first navigator element - the root node + while (navigator.next()) { + if (text) { + text += `\n`; + } + text += navigator.current().toString(); + } + + return text; + } + public layout(dimension: Dimension): void { this.dimension = dimension; if (this.tree) { @@ -262,7 +278,12 @@ export class Repl extends Panel implements IPrivateReplService { } public shutdown(): void { - this.storageService.store(HISTORY_STORAGE_KEY, JSON.stringify(Repl.HISTORY.save()), StorageScope.WORKSPACE); + const replHistory = Repl.HISTORY.save(); + if (replHistory.length) { + this.storageService.store(HISTORY_STORAGE_KEY, JSON.stringify(replHistory), StorageScope.WORKSPACE); + } else { + this.storageService.remove(HISTORY_STORAGE_KEY, StorageScope.WORKSPACE); + } } private getReplInputOptions(): IEditorOptions { @@ -281,7 +302,10 @@ export class Repl extends Panel implements IPrivateReplService { scrollBeyondLastLine: false, renderLineHighlight: 'none', fixedOverflowWidgets: true, - acceptSuggestionOnEnter: 'smart' + acceptSuggestionOnEnter: 'smart', + minimap: { + enabled: false + } }; } @@ -375,3 +399,20 @@ CommonEditorRegistry.registerEditorCommand(new SuggestCommand({ primary: KeyCode.RightArrow } })); + +@editorAction +export class ReplCopyAllAction extends EditorAction { + + constructor() { + super({ + id: 'repl.action.copyAll', + label: nls.localize('actions.repl.copyAll', "Debug: Console Copy All"), + alias: 'Debug Console Copy All', + precondition: debug.CONTEXT_IN_DEBUG_REPL, + }); + } + + public run(accessor: ServicesAccessor, editor: ICommonCodeEditor): void | TPromise { + clipboard.writeText(accessor.get(IPrivateReplService).getVisibleContent()); + } +} diff --git a/src/vs/workbench/parts/debug/electron-browser/replEditor.ts b/src/vs/workbench/parts/debug/electron-browser/replEditor.ts index dfa70d783bd4fdb473f313d917379c3c8d10f24c..a1ffe9fe3cf7f0f3082d9498029371214ad9a103 100644 --- a/src/vs/workbench/parts/debug/electron-browser/replEditor.ts +++ b/src/vs/workbench/parts/debug/electron-browser/replEditor.ts @@ -13,8 +13,8 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti import { ICommandService } from 'vs/platform/commands/common/commands'; // Allowed Editor Contributions: -import { MenuPreventer } from 'vs/editor/contrib/multicursor/browser/menuPreventer'; -import { SelectionClipboard } from 'vs/editor/contrib/selectionClipboard/electron-browser/selectionClipboard'; +import { MenuPreventer } from 'vs/workbench/parts/codeEditor/electron-browser/menuPreventer'; +import { SelectionClipboard } from 'vs/workbench/parts/codeEditor/electron-browser/selectionClipboard'; import { ContextMenuController } from 'vs/editor/contrib/contextmenu/browser/contextmenu'; import { SuggestController } from 'vs/editor/contrib/suggest/browser/suggestController'; import { SnippetController2 } from 'vs/editor/contrib/snippet/browser/snippetController2'; diff --git a/src/vs/workbench/parts/debug/electron-browser/statusbarColorProvider.ts b/src/vs/workbench/parts/debug/electron-browser/statusbarColorProvider.ts index fe69b0ad530e638a49fb724c5c8b86b5ab17524a..78ba083f9a0411232d9f6602e8ee4f866b32a1a6 100644 --- a/src/vs/workbench/parts/debug/electron-browser/statusbarColorProvider.ts +++ b/src/vs/workbench/parts/debug/electron-browser/statusbarColorProvider.ts @@ -11,7 +11,7 @@ import { IPartService, Parts } from 'vs/workbench/services/part/common/partServi import { IDebugService, State } from 'vs/workbench/parts/debug/common/debug'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { STATUS_BAR_NO_FOLDER_BACKGROUND, STATUS_BAR_NO_FOLDER_FOREGROUND, STATUS_BAR_BACKGROUND, Themable, STATUS_BAR_FOREGROUND } from 'vs/workbench/common/theme'; -import { addClass, removeClass } from "vs/base/browser/dom"; +import { addClass, removeClass } from 'vs/base/browser/dom'; // colors for theming diff --git a/src/vs/workbench/parts/debug/test/common/debugSource.test.ts b/src/vs/workbench/parts/debug/test/common/debugSource.test.ts index 43606a43d155bed0a74733ac032cdb4a50d41bfc..efba17f4728dfa76df530ed04579e43dd632fae6 100644 --- a/src/vs/workbench/parts/debug/test/common/debugSource.test.ts +++ b/src/vs/workbench/parts/debug/test/common/debugSource.test.ts @@ -10,30 +10,30 @@ import { Source } from 'vs/workbench/parts/debug/common/debugSource'; suite('Debug - Source', () => { test('from raw source', () => { - const rawSource = { + const source = new Source({ name: 'zz', path: '/xx/yy/zz', - sourceReference: 0 - }; - const source = new Source(rawSource, 'label'); + sourceReference: 0, + presentationHint: 'emphasize' + }); - assert.equal(source.presenationHint, 'label'); - assert.equal(source.name, rawSource.name); + assert.equal(source.presentationHint, 'emphasize'); + assert.equal(source.name, 'zz'); assert.equal(source.inMemory, false); - assert.equal(source.reference, rawSource.sourceReference); - assert.equal(source.uri.toString(), uri.file(rawSource.path).toString()); + assert.equal(source.reference, 0); + assert.equal(source.uri.toString(), uri.file('/xx/yy/zz').toString()); }); test('from raw internal source', () => { - const rawSource = { + const source = new Source({ name: 'internalModule.js', - sourceReference: 11 - }; - const source = new Source(rawSource, 'deemphasize'); + sourceReference: 11, + presentationHint: 'deemphasize' + }); - assert.equal(source.presenationHint, 'deemphasize'); - assert.equal(source.name, rawSource.name); + assert.equal(source.presentationHint, 'deemphasize'); + assert.equal(source.name, 'internalModule.js'); assert.equal(source.inMemory, true); - assert.equal(source.reference, rawSource.sourceReference); + assert.equal(source.reference, 11); }); }); diff --git a/src/vs/workbench/parts/debug/test/common/debugViewModel.test.ts b/src/vs/workbench/parts/debug/test/common/debugViewModel.test.ts index 872818bd72757055710f6e7ffcf7f535c7fc1027..6e6596e17aab938dcb8771f17989a3381460f8d1 100644 --- a/src/vs/workbench/parts/debug/test/common/debugViewModel.test.ts +++ b/src/vs/workbench/parts/debug/test/common/debugViewModel.test.ts @@ -25,7 +25,7 @@ suite('Debug - View Model', () => { const mockSession = new MockSession(); const process = new Process({ name: 'mockProcess', type: 'node', request: 'launch' }, mockSession); const thread = new Thread(process, 'myThread', 1); - const frame = new StackFrame(thread, 1, null, 'app.js', { startColumn: 1, startLineNumber: 1, endColumn: undefined, endLineNumber: undefined }); + const frame = new StackFrame(thread, 1, null, 'app.js', 'normal', { startColumn: 1, startLineNumber: 1, endColumn: undefined, endLineNumber: undefined }, 0); model.setFocusedStackFrame(frame, process); assert.equal(model.focusedStackFrame.getId(), frame.getId()); diff --git a/src/vs/workbench/parts/debug/test/common/mockDebug.ts b/src/vs/workbench/parts/debug/test/common/mockDebug.ts index c2f725b82c152c766ee8d7c2c99b08f6df3ad24a..7594be117a8c38c0bf5ab0f4278deb7b8ed4decd 100644 --- a/src/vs/workbench/parts/debug/test/common/mockDebug.ts +++ b/src/vs/workbench/parts/debug/test/common/mockDebug.ts @@ -15,6 +15,10 @@ export class MockDebugService implements debug.IDebugService { return null; } + public get onDidEndProcess(): Event { + return null; + } + public get onDidChangeState(): Event { return null; } @@ -97,7 +101,7 @@ export class MockDebugService implements debug.IDebugService { public logToRepl(value: string): void { } - public deemphasizeSource(uri: uri): void { } + public sourceIsNotAvailable(uri: uri): void { } } export class MockSession implements debug.ISession { @@ -114,6 +118,11 @@ export class MockSession implements debug.ISession { public stackTrace(args: DebugProtocol.StackTraceArguments): TPromise { return TPromise.as({ + seq: 1, + type: 'response', + request_seq: 1, + success: true, + command: 'stackTrace', body: { stackFrames: [{ id: 1, @@ -126,12 +135,7 @@ export class MockSession implements debug.ISession { } public exceptionInfo(args: DebugProtocol.ExceptionInfoArguments): TPromise { - return TPromise.as({ - body: { - exceptionId: 'mockExceptionId', - breakMode: 'unhandled' - } - }); + return TPromise.as(null); } public attach(args: DebugProtocol.AttachRequestArguments): TPromise { diff --git a/src/vs/workbench/parts/debug/test/node/debugModel.test.ts b/src/vs/workbench/parts/debug/test/node/debugModel.test.ts index da310a4f6225ff9b41c18c2642dbf40ff71b82e5..800e65bb92bb30f7b2070a69f8c82c9522c16a97 100644 --- a/src/vs/workbench/parts/debug/test/node/debugModel.test.ts +++ b/src/vs/workbench/parts/debug/test/node/debugModel.test.ts @@ -304,7 +304,7 @@ suite('Debug - Model', () => { assert.equal(model.getWatchExpressions().length, 0); const process = new Process({ name: 'mockProcess', type: 'node', request: 'launch' }, rawSession); const thread = new Thread(process, 'mockthread', 1); - const stackFrame = new StackFrame(thread, 1, null, 'app.js', { startLineNumber: 1, startColumn: 1, endLineNumber: undefined, endColumn: undefined }); + const stackFrame = new StackFrame(thread, 1, null, 'app.js', 'normal', { startLineNumber: 1, startColumn: 1, endLineNumber: undefined, endColumn: undefined }, 0); model.addWatchExpression(process, stackFrame, 'console').done(); model.addWatchExpression(process, stackFrame, 'console').done(); let watchExpressions = model.getWatchExpressions(); @@ -332,7 +332,7 @@ suite('Debug - Model', () => { assert.equal(model.getReplElements().length, 0); const process = new Process({ name: 'mockProcess', type: 'node', request: 'launch' }, rawSession); const thread = new Thread(process, 'mockthread', 1); - const stackFrame = new StackFrame(thread, 1, null, 'app.js', { startLineNumber: 1, startColumn: 1, endLineNumber: 1, endColumn: 10 }); + const stackFrame = new StackFrame(thread, 1, null, 'app.js', 'normal', { startLineNumber: 1, startColumn: 1, endLineNumber: 1, endColumn: 10 }, 1); model.addReplExpression(process, stackFrame, 'myVariable').done(); model.addReplExpression(process, stackFrame, 'myVariable').done(); model.addReplExpression(process, stackFrame, 'myVariable').done(); diff --git a/src/vs/workbench/parts/emmet/browser/actions/showEmmetCommands.ts b/src/vs/workbench/parts/emmet/browser/actions/showEmmetCommands.ts index ba0bb893893d3289cb37c80d49b0250b33942b18..f2048f527b854d35483d89bfed99e61ed0c90a37 100644 --- a/src/vs/workbench/parts/emmet/browser/actions/showEmmetCommands.ts +++ b/src/vs/workbench/parts/emmet/browser/actions/showEmmetCommands.ts @@ -8,7 +8,7 @@ import nls = require('vs/nls'); import { SyncActionDescriptor } from 'vs/platform/actions/common/actions'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { QuickOpenAction } from 'vs/workbench/browser/quickopen'; import { IWorkbenchActionRegistry, Extensions as ActionExtensions } from 'vs/workbench/common/actionRegistry'; diff --git a/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.ts b/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.ts index d74d9e327718dc4a4c58a7692ecf4daa2a585af4..cd52920c25dbda0d3dbb6366dbe879624a8dd30e 100644 --- a/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.ts +++ b/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.ts @@ -15,8 +15,8 @@ class PreviousEditPointAction extends BasicEmmetEditorAction { constructor() { super( 'editor.emmet.action.previousEditPoint', - nls.localize('previousEditPoint', "Emmet: Previous Edit Point"), - 'Emmet: Previous Edit Point', + nls.localize('previousEditPoint', "Emmet: Go to Previous Edit Point"), + 'Emmet: Go to Previous Edit Point', 'prev_edit_point' ); } @@ -27,8 +27,8 @@ class NextEditPointAction extends BasicEmmetEditorAction { constructor() { super( 'editor.emmet.action.nextEditPoint', - nls.localize('nextEditPoint', "Emmet: Next Edit Point"), - 'Emmet: Next Edit Point', + nls.localize('nextEditPoint', "Emmet: Go to Next Edit Point"), + 'Emmet: Go to Next Edit Point', 'next_edit_point' ); } diff --git a/src/vs/workbench/parts/emmet/electron-browser/actions/expandAbbreviation.ts b/src/vs/workbench/parts/emmet/electron-browser/actions/expandAbbreviation.ts index f1db99bf6475ea1a0f557aefe023328c1b9bd879..05acd8aa0459e8e63068f80575ee8b56dd6d559e 100644 --- a/src/vs/workbench/parts/emmet/electron-browser/actions/expandAbbreviation.ts +++ b/src/vs/workbench/parts/emmet/electron-browser/actions/expandAbbreviation.ts @@ -11,7 +11,7 @@ import { BasicEmmetEditorAction } from 'vs/workbench/parts/emmet/electron-browse import { editorAction } from 'vs/editor/common/editorCommonExtensions'; import { ICommonCodeEditor } from 'vs/editor/common/editorCommon'; import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -import { CoreEditingCommands } from "vs/editor/common/controller/coreCommands"; +import { CoreEditingCommands } from 'vs/editor/common/controller/coreCommands'; import { KeyCode } from 'vs/base/common/keyCodes'; import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; @@ -33,7 +33,7 @@ class ExpandAbbreviationAction extends BasicEmmetEditorAction { EditorContextKeys.hasSingleSelection, EditorContextKeys.tabDoesNotMoveFocus, ContextKeyExpr.has('config.emmet.triggerExpansionOnTab'), - ContextKeyExpr.not('config.emmet.suggestExpandedAbbreviation') + ContextKeyExpr.not('config.emmet.useNewEmmet') ) } ); diff --git a/src/vs/workbench/parts/emmet/electron-browser/editorAccessor.ts b/src/vs/workbench/parts/emmet/electron-browser/editorAccessor.ts index 38cb77ea2fd1faf09825bced1fdfe20be641e3ac..dcc5e5ad74da57343132d25152af3e754d7a6319 100644 --- a/src/vs/workbench/parts/emmet/electron-browser/editorAccessor.ts +++ b/src/vs/workbench/parts/emmet/electron-browser/editorAccessor.ts @@ -11,7 +11,7 @@ import { Range } from 'vs/editor/common/core/range'; import { SnippetController2 } from 'vs/editor/contrib/snippet/browser/snippetController2'; import { LanguageId, LanguageIdentifier } from 'vs/editor/common/modes'; import { Position } from 'vs/editor/common/core/position'; -import { CoreEditingCommands } from "vs/editor/common/controller/coreCommands"; +import { CoreEditingCommands } from 'vs/editor/common/controller/coreCommands'; import { SnippetParser, walk, Placeholder, Variable, Text, Marker } from 'vs/editor/contrib/snippet/browser/snippetParser'; import emmet = require('emmet'); @@ -114,13 +114,13 @@ export class EditorAccessor implements emmet.Editor { // string to string conversion that tries to fix the // snippet in-place - let marker = new SnippetParser(true, false).parse(template); + let marker = new SnippetParser().parse(template); let maxIndex = -Number.MIN_VALUE; // find highest placeholder index walk(marker, candidate => { if (candidate instanceof Placeholder) { - let index = Number(candidate.index); + let index = candidate.index; if (index > maxIndex) { maxIndex = index; } @@ -132,7 +132,7 @@ export class EditorAccessor implements emmet.Editor { walk(marker, candidate => { if (candidate instanceof Placeholder) { if (candidate.isFinalTabstop) { - candidate.index = String(++maxIndex); + candidate.index = ++maxIndex; } } return true; @@ -144,14 +144,14 @@ export class EditorAccessor implements emmet.Editor { return SnippetParser.escape(marker.string); } else if (marker instanceof Placeholder) { - if (marker.defaultValue.length > 0) { - return `\${${marker.index}:${marker.defaultValue.map(toSnippetString).join('')}}`; + if (marker.children.length > 0) { + return `\${${marker.index}:${marker.children.map(toSnippetString).join('')}}`; } else { return `\$${marker.index}`; } } else if (marker instanceof Variable) { - if (marker.defaultValue.length > 0) { - return `\${${marker.name}:${marker.defaultValue.map(toSnippetString).join('')}}`; + if (marker.children.length > 0) { + return `\${${marker.name}:${marker.children.map(toSnippetString).join('')}}`; } else { return `\$${marker.name}`; } diff --git a/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.ts b/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.ts index 0a177c237f649d65818d2fbc5fbd1f565fcded66..a56ce59bfd3ab6d4c464045d95a3910e2a1901b6 100644 --- a/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.ts +++ b/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.ts @@ -7,7 +7,7 @@ import nls = require('vs/nls'); -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { IConfigurationRegistry, Extensions as ConfigurationExtensions } from 'vs/platform/configuration/common/configurationRegistry'; import './actions/expandAbbreviation'; @@ -60,10 +60,10 @@ configurationRegistry.registerConfiguration({ 'default': null, 'description': nls.localize('emmetExtensionsPath', 'Path to a folder containing emmet profiles, snippets and preferences') }, - 'emmet.useModules': { + 'emmet.useNewEmmet': { 'type': 'boolean', - 'default': false, - 'description': nls.localize('emmetUseModules', 'Use the new emmet modules for emmet features than the single emmet library.') + 'default': true, + 'description': nls.localize('useNewEmmet', 'Try out the new emmet modules (which will eventually replace the old single emmet library) for all emmet features.') } } }); diff --git a/src/vs/workbench/parts/emmet/electron-browser/emmetActions.ts b/src/vs/workbench/parts/emmet/electron-browser/emmetActions.ts index c2325f2a22f59d17035653bc37ae55715efce792..6778a0f4c6e402f6520ef01d589938bacd2ca9f6 100644 --- a/src/vs/workbench/parts/emmet/electron-browser/emmetActions.ts +++ b/src/vs/workbench/parts/emmet/electron-browser/emmetActions.ts @@ -9,7 +9,7 @@ import { TPromise } from 'vs/base/common/winjs.base'; import { ICommonCodeEditor } from 'vs/editor/common/editorCommon'; import { EditorAction, ServicesAccessor, IActionOptions, ICommandKeybindingsOptions } from 'vs/editor/common/editorCommonExtensions'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { grammarsExtPoint, ITMSyntaxExtensionPoint } from 'vs/editor/node/textMate/TMGrammars'; +import { grammarsExtPoint, ITMSyntaxExtensionPoint } from 'vs/workbench/services/textMate/electron-browser/TMGrammars'; import { IModeService } from 'vs/editor/common/services/modeService'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { EditorAccessor, IGrammarContributions } from 'vs/workbench/parts/emmet/electron-browser/editorAccessor'; @@ -31,7 +31,7 @@ interface IEmmetConfiguration { triggerExpansionOnTab: boolean, excludeLanguages: string[], extensionsPath: string, - useModules: boolean + useNewEmmet: boolean }; } @@ -250,7 +250,14 @@ export abstract class EmmetEditorAction extends EditorAction { 'editor.emmet.action.selectPreviousItem': 'emmet.selectPrevItem', 'editor.emmet.action.selectNextItem': 'emmet.selectNextItem', 'editor.emmet.action.splitJoinTag': 'emmet.splitJoinTag', - 'editor.emmet.action.toggleComment': 'emmet.toggleComment' + 'editor.emmet.action.toggleComment': 'emmet.toggleComment', + 'editor.emmet.action.evaluateMath': 'emmet.evaluateMathExpression', + 'editor.emmet.action.incrementNumberByOneTenth': 'emmet.incrementNumberByOneTenth', + 'editor.emmet.action.incrementNumberByOne': 'emmet.incrementNumberByOne', + 'editor.emmet.action.incrementNumberByTen': 'emmet.incrementNumberByTen', + 'editor.emmet.action.decrementNumberByOneTenth': 'emmet.decrementNumberByOneTenth', + 'editor.emmet.action.decrementNumberByOne': 'emmet.decrementNumberByOne', + 'editor.emmet.action.decrementNumberByTen': 'emmet.decrementNumberByTen' }; protected emmetActionName: string; @@ -285,12 +292,12 @@ export abstract class EmmetEditorAction extends EditorAction { const modeService = accessor.get(IModeService); const messageService = accessor.get(IMessageService); const contextService = accessor.get(IWorkspaceContextService); - const workspaceRoot = contextService.getWorkspace() ? contextService.getWorkspace().resource.fsPath : ''; + const workspaceRoot = contextService.hasWorkspace() ? contextService.getWorkspace().resource.fsPath : ''; const telemetryService = accessor.get(ITelemetryService); const commandService = accessor.get(ICommandService); - let mappedCommand = this.actionMap[this.id]; - if (mappedCommand && configurationService.getConfiguration().emmet.useModules) { + let mappedCommand = configurationService.getConfiguration().emmet.useNewEmmet ? this.actionMap[this.id] : undefined; + if (mappedCommand && mappedCommand !== 'emmet.expandAbbreviation') { return commandService.executeCommand(mappedCommand); } @@ -305,6 +312,11 @@ export abstract class EmmetEditorAction extends EditorAction { this.emmetActionName ); + if (mappedCommand === 'emmet.expandAbbreviation') { + let syntax = editorAccessor.getSyntax(); + return commandService.executeCommand(mappedCommand, { syntax }); + } + if (!editorAccessor.isEmmetEnabledMode()) { this.noExpansionOccurred(editor); return undefined; diff --git a/src/vs/workbench/parts/execution/electron-browser/terminal.contribution.ts b/src/vs/workbench/parts/execution/electron-browser/terminal.contribution.ts index c7b09a28e16c788a25bba957e1c4800212b22faa..101a5d3c3a047c49c83fb8d98411e2aafb6379f9 100644 --- a/src/vs/workbench/parts/execution/electron-browser/terminal.contribution.ts +++ b/src/vs/workbench/parts/execution/electron-browser/terminal.contribution.ts @@ -6,12 +6,12 @@ import nls = require('vs/nls'); import { TPromise } from 'vs/base/common/winjs.base'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import baseplatform = require('vs/base/common/platform'); import { IAction, Action } from 'vs/base/common/actions'; import { IWorkbenchActionRegistry, Extensions as ActionExtensions } from 'vs/workbench/common/actionRegistry'; import paths = require('vs/base/common/paths'); -import { Scope, IActionBarRegistry, Extensions as ActionBarExtensions, ActionBarContributor } from 'vs/workbench/browser/actionBarRegistry'; +import { Scope, IActionBarRegistry, Extensions as ActionBarExtensions, ActionBarContributor } from 'vs/workbench/browser/actions'; import uri from 'vs/base/common/uri'; import { explorerItemToFileResource } from 'vs/workbench/parts/files/common/files'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; @@ -24,6 +24,7 @@ import { KeyMod, KeyCode } from 'vs/base/common/keyCodes'; import { Extensions, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry'; import { KEYBINDING_CONTEXT_TERMINAL_NOT_FOCUSED } from 'vs/workbench/parts/terminal/common/terminal'; import { DEFAULT_TERMINAL_WINDOWS, DEFAULT_TERMINAL_LINUX_READY, DEFAULT_TERMINAL_OSX } from 'vs/workbench/parts/execution/electron-browser/terminal'; +import { IHistoryService } from "vs/workbench/services/history/common/history"; DEFAULT_TERMINAL_LINUX_READY.then(defaultTerminalLinux => { let configurationRegistry = Registry.as(Extensions.Configuration); @@ -70,7 +71,8 @@ export class OpenConsoleAction extends Action { label: string, @ITerminalService private terminalService: ITerminalService, @IWorkbenchEditorService private editorService: IWorkbenchEditorService, - @IWorkspaceContextService private contextService: IWorkspaceContextService + @IWorkspaceContextService private contextService: IWorkspaceContextService, + @IHistoryService private historyService: IHistoryService ) { super(id, label); @@ -86,8 +88,8 @@ export class OpenConsoleAction extends Action { let pathToOpen: string; // Try workspace path first - let workspace = this.contextService.getWorkspace(); - pathToOpen = this.resource ? this.resource.fsPath : (workspace && workspace.resource.fsPath); + const root = this.historyService.getLastActiveWorkspaceRoot(); + pathToOpen = this.resource ? this.resource.fsPath : (root && root.fsPath); // Otherwise check if we have an active file open if (!pathToOpen) { diff --git a/src/vs/workbench/parts/extensions/browser/extensionEditor.ts b/src/vs/workbench/parts/extensions/browser/extensionEditor.ts index 11915ba81c4446b529eb599693ce99eb4cf657c2..0d37d0eecfd1343a9a8286316a64ae8094ce4cb5 100644 --- a/src/vs/workbench/parts/extensions/browser/extensionEditor.ts +++ b/src/vs/workbench/parts/extensions/browser/extensionEditor.ts @@ -25,7 +25,7 @@ import { BaseEditor } from 'vs/workbench/browser/parts/editor/baseEditor'; import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IExtensionGalleryService, IExtensionManifest, IKeyBinding } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { IExtensionGalleryService, IExtensionManifest, IKeyBinding, IView } from 'vs/platform/extensionManagement/common/extensionManagement'; import { ResolvedKeybinding } from 'vs/base/common/keyCodes'; import { ExtensionsInput } from 'vs/workbench/parts/extensions/common/extensionsInput'; import { IExtensionsWorkbenchService, IExtensionsViewlet, VIEWLET_ID, IExtension, IExtensionDependencies } from 'vs/workbench/parts/extensions/common/extensions'; @@ -56,7 +56,7 @@ function renderBody(body: string): string { - + ${body} @@ -358,7 +358,7 @@ export class ExtensionEditor extends BaseEditor { return this.loadContents(() => this.extensionManifest.get() .then(manifest => { const content = $('div', { class: 'subcontent' }); - const scrollableContent = new DomScrollableElement(content, { canUseTranslate3d: false }); + const scrollableContent = new DomScrollableElement(content, {}); const layout = () => scrollableContent.scanDomNode(); const removeLayoutParticipant = arrays.insert(this.layoutParticipants, { layout }); @@ -370,7 +370,8 @@ export class ExtensionEditor extends BaseEditor { this.renderLanguages(content, manifest, layout), this.renderThemes(content, manifest, layout), this.renderJSONValidation(content, manifest, layout), - this.renderDebuggers(content, manifest, layout) + this.renderDebuggers(content, manifest, layout), + this.renderViews(content, manifest, layout) ]; const isEmpty = !renders.reduce((v, r) => r || v, false); @@ -395,7 +396,7 @@ export class ExtensionEditor extends BaseEditor { return this.loadContents(() => { return this.extensionDependencies.get().then(extensionDependencies => { const content = $('div', { class: 'subcontent' }); - const scrollableContent = new DomScrollableElement(content, { canUseTranslate3d: false }); + const scrollableContent = new DomScrollableElement(content, {}); append(this.content, scrollableContent.getDomNode()); this.contentDisposables.push(scrollableContent); @@ -495,6 +496,32 @@ export class ExtensionEditor extends BaseEditor { return true; } + private renderViews(container: HTMLElement, manifest: IExtensionManifest, onDetailsToggle: Function): boolean { + const contributes = manifest.contributes; + const contrib = contributes && contributes.views || {}; + + let views = <{ id: string, name: string, location: string }[]>Object.keys(contrib).reduce((result, location) => { + let viewsForLocation: IView[] = contrib[location]; + result.push(...viewsForLocation.map(view => ({ ...view, location }))); + return result; + }, []); + + if (!views.length) { + return false; + } + + const details = $('details', { open: true, ontoggle: onDetailsToggle }, + $('summary', null, localize('views', "Views ({0})", views.length)), + $('table', null, + $('tr', null, $('th', null, localize('view id', "ID")), $('th', null, localize('view name', "Name")), $('th', null, localize('view location', "Where"))), + ...views.map(view => $('tr', null, $('td', null, view.id), $('td', null, view.name), $('td', null, view.location))) + ) + ); + + append(container, details); + return true; + } + private renderThemes(container: HTMLElement, manifest: IExtensionManifest, onDetailsToggle: Function): boolean { const contributes = manifest.contributes; const contrib = contributes && contributes.themes || []; diff --git a/src/vs/workbench/parts/extensions/browser/extensionsActions.ts b/src/vs/workbench/parts/extensions/browser/extensionsActions.ts index f2cf8c9cacdbb90cd0a464307eed1d89cfd7e356..7772286d98b294225d942a77cab30f6cd82625f8 100644 --- a/src/vs/workbench/parts/extensions/browser/extensionsActions.ts +++ b/src/vs/workbench/parts/extensions/browser/extensionsActions.ts @@ -32,9 +32,9 @@ import { IExtensionService, IExtensionDescription } from 'vs/platform/extensions import URI from 'vs/base/common/uri'; import { CommandsRegistry } from 'vs/platform/commands/common/commands'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { registerThemingParticipant, ITheme, ICssStyleCollector } from "vs/platform/theme/common/themeService"; -import { buttonBackground, buttonForeground, buttonHoverBackground, contrastBorder, registerColor, foreground } from "vs/platform/theme/common/colorRegistry"; -import { Color } from "vs/base/common/color"; +import { registerThemingParticipant, ITheme, ICssStyleCollector } from 'vs/platform/theme/common/themeService'; +import { buttonBackground, buttonForeground, buttonHoverBackground, contrastBorder, registerColor, foreground } from 'vs/platform/theme/common/colorRegistry'; +import { Color } from 'vs/base/common/color'; export class InstallAction extends Action { @@ -865,7 +865,7 @@ export class ReloadAction extends Action { } run(): TPromise { - if (this.messageService.confirm({ message: this.reloadMessaage, primaryButton: localize('reload', "&&Reload Window") })) { + if (this.messageService.confirm({ message: this.reloadMessaage, type: 'question', primaryButton: localize('reload', "&&Reload Window") })) { return this.windowService.reloadWindow(); } return TPromise.wrap(null); @@ -940,7 +940,7 @@ export class ShowDisabledExtensionsAction extends Action { } } -export class ClearExtensionsInputAction extends ShowInstalledExtensionsAction { +export class ClearExtensionsInputAction extends Action { static ID = 'workbench.extensions.action.clearExtensionsInput'; static LABEL = localize('clearExtensionsInput', "Clear Extensions Input"); @@ -951,10 +951,10 @@ export class ClearExtensionsInputAction extends ShowInstalledExtensionsAction { id: string, label: string, onSearchChange: Event, - @IViewletService viewletService: IViewletService, - @IExtensionsWorkbenchService extensionsWorkbenchService: IExtensionsWorkbenchService + @IViewletService private viewletService: IViewletService, + @IExtensionsWorkbenchService private extensionsWorkbenchService: IExtensionsWorkbenchService ) { - super(id, label, viewletService, extensionsWorkbenchService); + super(id, label, 'clear-extensions', true); this.enabled = false; onSearchChange(this.onSearchChange, this, this.disposables); } @@ -963,6 +963,15 @@ export class ClearExtensionsInputAction extends ShowInstalledExtensionsAction { this.enabled = !!value; } + run(): TPromise { + return this.viewletService.openViewlet(VIEWLET_ID, true) + .then(viewlet => viewlet as IExtensionsViewlet) + .then(viewlet => { + viewlet.search(''); + viewlet.focus(); + }); + } + dispose(): void { this.disposables = dispose(this.disposables); } diff --git a/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.ts b/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.ts index c5f9866b41eb76abba92601862ac0d627f5da544..cee6e0cf649ccc9538c1704d2a0736a1459cb798 100644 --- a/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.ts +++ b/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.ts @@ -38,7 +38,7 @@ export class ExtensionTipsService implements IExtensionTipsService { private _recommendations: { [id: string]: boolean; } = Object.create(null); private _availableRecommendations: { [pattern: string]: string[] } = Object.create(null); - private importantRecommendations: { [id: string]: { name: string; pattern: string; } }; + private importantRecommendations: { [id: string]: { name: string; pattern: string; } } = Object.create(null); private importantRecommendationsIgnoreList: string[]; private _allRecommendations: string[]; private _disposables: IDisposable[] = []; diff --git a/src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.ts b/src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.ts index 7e6ec97a78eccbe589f5c26b7b64bb98a3e78b75..1c3464e2c12b360439d984b586ae74ed2ff821fb 100644 --- a/src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.ts +++ b/src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.ts @@ -7,7 +7,7 @@ import 'vs/css!./media/extensions'; import { localize } from 'vs/nls'; import * as errors from 'vs/base/common/errors'; import { KeyMod, KeyChord, KeyCode } from 'vs/base/common/keyCodes'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { SyncActionDescriptor } from 'vs/platform/actions/common/actions'; import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { IExtensionGalleryService, IExtensionTipsService, ExtensionsLabel, ExtensionsChannelId, PreferencesLabel } from 'vs/platform/extensionManagement/common/extensionManagement'; @@ -59,6 +59,7 @@ Registry.as(Extensions.Quickopen).registerQuickOpenHandler( 'vs/workbench/parts/extensions/browser/extensionsQuickOpen', 'ExtensionsHandler', 'ext ', + null, localize('extensionsCommands', "Manage Extensions"), true ) @@ -69,6 +70,7 @@ Registry.as(Extensions.Quickopen).registerQuickOpenHandler( 'vs/workbench/parts/extensions/browser/extensionsQuickOpen', 'GalleryExtensionsHandler', 'ext install ', + null, localize('galleryExtensionsCommands', "Install Gallery Extensions"), true ) @@ -105,7 +107,7 @@ const openViewletActionDescriptor = new SyncActionDescriptor(OpenExtensionsViewl actionRegistry.registerWorkbenchAction(openViewletActionDescriptor, 'View: Show Extensions', localize('view', "View")); const installActionDescriptor = new SyncActionDescriptor(InstallExtensionsAction, InstallExtensionsAction.ID, InstallExtensionsAction.LABEL); -actionRegistry.registerWorkbenchAction(installActionDescriptor, 'Extensions: Install', ExtensionsLabel); +actionRegistry.registerWorkbenchAction(installActionDescriptor, 'Extensions: Install Extensions', ExtensionsLabel); const listOutdatedActionDescriptor = new SyncActionDescriptor(ShowOutdatedExtensionsAction, ShowOutdatedExtensionsAction.ID, ShowOutdatedExtensionsAction.LABEL); actionRegistry.registerWorkbenchAction(listOutdatedActionDescriptor, 'Extensions: Show Outdated Extensions', ExtensionsLabel); @@ -117,7 +119,7 @@ const keymapRecommendationsActionDescriptor = new SyncActionDescriptor(ShowRecom actionRegistry.registerWorkbenchAction(keymapRecommendationsActionDescriptor, 'Preferences: Keymaps', PreferencesLabel); const languageExtensionsActionDescriptor = new SyncActionDescriptor(ShowLanguageExtensionsAction, ShowLanguageExtensionsAction.ID, ShowLanguageExtensionsAction.SHORT_LABEL); -actionRegistry.registerWorkbenchAction(languageExtensionsActionDescriptor, 'Extensions: Language Extensions', PreferencesLabel); +actionRegistry.registerWorkbenchAction(languageExtensionsActionDescriptor, 'Preferences: Language Extensions', PreferencesLabel); const workspaceRecommendationsActionDescriptor = new SyncActionDescriptor(ShowWorkspaceRecommendedExtensionsAction, ShowWorkspaceRecommendedExtensionsAction.ID, ShowWorkspaceRecommendedExtensionsAction.LABEL); actionRegistry.registerWorkbenchAction(workspaceRecommendationsActionDescriptor, 'Extensions: Show Workspace Recommended Extensions', ExtensionsLabel); @@ -138,22 +140,22 @@ const openExtensionsFolderActionDescriptor = new SyncActionDescriptor(OpenExtens actionRegistry.registerWorkbenchAction(openExtensionsFolderActionDescriptor, 'Extensions: Open Extensions Folder', ExtensionsLabel); const openExtensionsFileActionDescriptor = new SyncActionDescriptor(ConfigureWorkspaceRecommendedExtensionsAction, ConfigureWorkspaceRecommendedExtensionsAction.ID, ConfigureWorkspaceRecommendedExtensionsAction.LABEL); -actionRegistry.registerWorkbenchAction(openExtensionsFileActionDescriptor, 'Extensions: Open Extensions File', ExtensionsLabel); +actionRegistry.registerWorkbenchAction(openExtensionsFileActionDescriptor, 'Extensions: Configure Recommended Extensions (Workspace)', ExtensionsLabel); const installVSIXActionDescriptor = new SyncActionDescriptor(InstallVSIXAction, InstallVSIXAction.ID, InstallVSIXAction.LABEL); actionRegistry.registerWorkbenchAction(installVSIXActionDescriptor, 'Extensions: Install from VSIX...', ExtensionsLabel); const disableAllAction = new SyncActionDescriptor(DisableAllAction, DisableAllAction.ID, DisableAllAction.LABEL); -actionRegistry.registerWorkbenchAction(disableAllAction, 'Extensions: Disable All', ExtensionsLabel); +actionRegistry.registerWorkbenchAction(disableAllAction, 'Extensions: Disable All Installed Extensions', ExtensionsLabel); const disableAllWorkspaceAction = new SyncActionDescriptor(DisableAllWorkpsaceAction, DisableAllWorkpsaceAction.ID, DisableAllWorkpsaceAction.LABEL); -actionRegistry.registerWorkbenchAction(disableAllWorkspaceAction, 'Extensions: Disable All (Workspace)', ExtensionsLabel); +actionRegistry.registerWorkbenchAction(disableAllWorkspaceAction, 'Extensions: Disable All Installed Extensions for this Workspace', ExtensionsLabel); const enableAllAction = new SyncActionDescriptor(EnableAllAction, EnableAllAction.ID, EnableAllAction.LABEL); -actionRegistry.registerWorkbenchAction(enableAllAction, 'Extensions: Enable All', ExtensionsLabel); +actionRegistry.registerWorkbenchAction(enableAllAction, 'Extensions: Enable All Installed Extensions', ExtensionsLabel); const enableAllWorkspaceAction = new SyncActionDescriptor(EnableAllWorkpsaceAction, EnableAllWorkpsaceAction.ID, EnableAllWorkpsaceAction.LABEL); -actionRegistry.registerWorkbenchAction(enableAllWorkspaceAction, 'Extensions: Enable All (Workspace)', ExtensionsLabel); +actionRegistry.registerWorkbenchAction(enableAllWorkspaceAction, 'Extensions: Enable All Installed Extensions for this Workspace', ExtensionsLabel); const checkForUpdatesAction = new SyncActionDescriptor(CheckForUpdatesAction, CheckForUpdatesAction.ID, CheckForUpdatesAction.LABEL); actionRegistry.registerWorkbenchAction(checkForUpdatesAction, `Extensions: Check for Updates`, ExtensionsLabel); @@ -171,7 +173,7 @@ Registry.as(ConfigurationExtensions.Configuration) 'extensions.autoUpdate': { type: 'boolean', description: localize('extensionsAutoUpdate', "Automatically update extensions"), - default: false + default: true }, 'extensions.ignoreRecommendations': { type: 'boolean', diff --git a/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.ts b/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.ts index bff8aa3754baff8deaff1a3b71752e2df4276e8e..c33a4ecd7d4ea3359514dafa1ebc9023f9fc1796 100644 --- a/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.ts +++ b/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.ts @@ -73,7 +73,7 @@ export class KeymapExtensions implements IWorkbenchContribution { oldKeymaps: oldKeymaps.map(k => k.identifier) }; this.telemetryService.publicLog('disableOtherKeymapsConfirmation', telemetryData); - const message = localize('disableOtherKeymapsConfirmation', "Disable other keymaps to avoid conflicts between keybindings?"); + const message = localize('disableOtherKeymapsConfirmation', "Disable other keymaps ({0}) to avoid conflicts between keybindings?", oldKeymaps.map(k => `'${k.local.manifest.displayName}'`).join(', ')); const options = [ localize('yes', "Yes"), localize('no', "No") diff --git a/src/vs/workbench/parts/extensions/electron-browser/extensionsViewlet.ts b/src/vs/workbench/parts/extensions/electron-browser/extensionsViewlet.ts index 63d676aa2fbaa42f5cdd3e27a1cfe12549e5cd8a..5f879f7ee15cc45dfa861d3fa1fc21e446754e22 100644 --- a/src/vs/workbench/parts/extensions/electron-browser/extensionsViewlet.ts +++ b/src/vs/workbench/parts/extensions/electron-browser/extensionsViewlet.ts @@ -13,62 +13,64 @@ import { isPromiseCanceledError, onUnexpectedError, create as createError } from import { IWorkbenchContribution } from 'vs/workbench/common/contributions'; import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { Builder, Dimension } from 'vs/base/browser/builder'; -import { assign } from 'vs/base/common/objects'; import EventOf, { mapEvent, chain } from 'vs/base/common/event'; import { IAction } from 'vs/base/common/actions'; import { domEvent } from 'vs/base/browser/event'; import { Separator } from 'vs/base/browser/ui/actionbar/actionbar'; import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent'; import { KeyCode } from 'vs/base/common/keyCodes'; -import { Viewlet } from 'vs/workbench/browser/viewlet'; import { IViewlet } from 'vs/workbench/common/viewlet'; import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; import { append, $, addStandardDisposableListener, EventType, addClass, removeClass, toggleClass } from 'vs/base/browser/dom'; -import { PagedModel, IPagedModel, mergePagers, IPager } from 'vs/base/common/paging'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { PagedList } from 'vs/base/browser/ui/list/listPaging'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { Delegate, Renderer } from 'vs/workbench/parts/extensions/browser/extensionsList'; -import { IExtensionsWorkbenchService, IExtension, IExtensionsViewlet, VIEWLET_ID, ExtensionState } from '../common/extensions'; +import { IExtensionsWorkbenchService, IExtensionsViewlet, VIEWLET_ID, ExtensionState } from '../common/extensions'; import { - ShowRecommendedExtensionsAction, ShowWorkspaceRecommendedExtensionsAction, ShowRecommendedKeymapExtensionsAction, ShowPopularExtensionsAction, ShowInstalledExtensionsAction, ShowDisabledExtensionsAction, + ShowInstalledExtensionsAction, ShowRecommendedExtensionsAction, ShowWorkspaceRecommendedExtensionsAction, ShowRecommendedKeymapExtensionsAction, ShowPopularExtensionsAction, ShowDisabledExtensionsAction, ShowOutdatedExtensionsAction, ClearExtensionsInputAction, ChangeSortAction, UpdateAllAction, CheckForUpdatesAction, DisableAllAction, EnableAllAction, EnableAutoUpdateAction, DisableAutoUpdateAction } from 'vs/workbench/parts/extensions/browser/extensionsActions'; import { InstallVSIXAction } from 'vs/workbench/parts/extensions/electron-browser/extensionsActions'; -import { IExtensionManagementService, IExtensionGalleryService, IExtensionTipsService, SortBy, SortOrder, IQueryOptions, LocalExtensionType } from 'vs/platform/extensionManagement/common/extensionManagement'; -import { areSameExtensions } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; import { ExtensionsInput } from 'vs/workbench/parts/extensions/common/extensionsInput'; -import { Query } from '../common/extensionQuery'; +import { ExtensionsListView, InstalledExtensionsView, RecommendedExtensionsView } from './extensionsViews'; import { OpenGlobalSettingsAction } from 'vs/workbench/parts/preferences/browser/preferencesActions'; import { IProgressService } from 'vs/platform/progress/common/progress'; -import { IListService } from 'vs/platform/list/browser/listService'; import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService'; import { IMessageService, CloseAction } from 'vs/platform/message/common/message'; import Severity from 'vs/base/common/severity'; import { IActivityBarService, ProgressBadge, NumberBadge } from 'vs/workbench/services/activity/common/activityBarService'; -import { IExtensionService } from 'vs/platform/extensions/common/extensions'; -import { IModeService } from 'vs/editor/common/services/modeService'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { inputForeground, inputBackground, inputBorder } from 'vs/platform/theme/common/colorRegistry'; -import { attachListStyler } from 'vs/platform/theme/common/styler'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; +import { ViewsRegistry, ViewLocation, IViewDescriptor } from 'vs/workbench/parts/views/browser/viewsRegistry'; +import { ComposedViewsViewlet } from 'vs/workbench/parts/views/browser/views'; +import { IStorageService } from 'vs/platform/storage/common/storage'; +import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; +import { IContextKeyService, ContextKeyExpr, RawContextKey, IContextKey } from 'vs/platform/contextkey/common/contextkey'; +import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; interface SearchInputEvent extends Event { target: HTMLInputElement; immediate?: boolean; } -export class ExtensionsViewlet extends Viewlet implements IExtensionsViewlet { +const SearchExtensionsContext = new RawContextKey('searchExtensions', false); +const SearchInstalledExtensionsContext = new RawContextKey('searchInstalledExtensions', false); +const SearchRecommendedExtensionsContext = new RawContextKey('searchRecommendedExtensions', false); + +export class ExtensionsViewlet extends ComposedViewsViewlet implements IExtensionsViewlet { private onSearchChange: EventOf; + private searchExtensionsContextKey: IContextKey; + private searchInstalledExtensionsContextKey: IContextKey; + private searchRecommendedExtensionsContextKey: IContextKey; + private searchDelayer: ThrottledDelayer; private root: HTMLElement; + private searchBox: HTMLInputElement; private extensionsBox: HTMLElement; - private messageBox: HTMLElement; - private list: PagedList; private primaryActions: IAction[]; private secondaryActions: IAction[]; private disposables: IDisposable[] = []; @@ -77,24 +79,27 @@ export class ExtensionsViewlet extends Viewlet implements IExtensionsViewlet { constructor( @ITelemetryService telemetryService: ITelemetryService, - @IExtensionGalleryService private galleryService: IExtensionGalleryService, - @IExtensionManagementService private extensionManagementService: IExtensionManagementService, @IProgressService private progressService: IProgressService, - @IInstantiationService private instantiationService: IInstantiationService, + @IInstantiationService instantiationService: IInstantiationService, @IWorkbenchEditorService private editorService: IWorkbenchEditorService, @IEditorGroupService private editorInputService: IEditorGroupService, - @IListService private listService: IListService, @IExtensionsWorkbenchService private extensionsWorkbenchService: IExtensionsWorkbenchService, - @IExtensionTipsService private tipsService: IExtensionTipsService, @IMessageService private messageService: IMessageService, @IViewletService private viewletService: IViewletService, - @IExtensionService private extensionService: IExtensionService, - @IModeService private modeService: IModeService, @IThemeService themeService: IThemeService, @IConfigurationService private configurationService: IConfigurationService, + @IStorageService storageService: IStorageService, + @IWorkspaceContextService contextService: IWorkspaceContextService, + @IContextKeyService contextKeyService: IContextKeyService, + @IContextMenuService contextMenuService: IContextMenuService ) { - super(VIEWLET_ID, telemetryService, themeService); + super(VIEWLET_ID, ViewLocation.Extensions, `${VIEWLET_ID}.state`, telemetryService, storageService, instantiationService, themeService, contextService, contextKeyService, contextMenuService); + + this.registerViews(); this.searchDelayer = new ThrottledDelayer(500); + this.searchExtensionsContextKey = SearchExtensionsContext.bindTo(contextKeyService); + this.searchInstalledExtensionsContextKey = SearchInstalledExtensionsContext.bindTo(contextKeyService); + this.searchRecommendedExtensionsContextKey = SearchRecommendedExtensionsContext.bindTo(contextKeyService); this.disposables.push(viewletService.onDidViewletOpen(this.onViewletOpen, this, this.disposables)); this.isAutoUpdateEnabled = this.extensionsWorkbenchService.isAutoUpdateEnabled; @@ -109,8 +114,60 @@ export class ExtensionsViewlet extends Viewlet implements IExtensionsViewlet { }, this, this.disposables); } + private registerViews(): void { + let viewDescriptors = []; + viewDescriptors.push(this.createMarketPlaceExtensionsListViewDescriptor()); + viewDescriptors.push(this.createInstalledExtensionsListViewDescriptor()); + viewDescriptors.push(this.createSearchInstalledExtensionsListViewDescriptor()); + viewDescriptors.push(this.createRecommendedExtensionsListViewDescriptor()); + ViewsRegistry.registerViews(viewDescriptors); + } + + private createMarketPlaceExtensionsListViewDescriptor(): IViewDescriptor { + return { + id: 'extensions.listView', + name: localize('marketPlace', "Marketplace"), + location: ViewLocation.Extensions, + ctor: ExtensionsListView, + when: ContextKeyExpr.and(ContextKeyExpr.has('searchExtensions'), ContextKeyExpr.not('searchInstalledExtensions')), + size: 100 + }; + } + + private createInstalledExtensionsListViewDescriptor(): IViewDescriptor { + return { + id: 'extensions.installedList', + name: localize('installedExtensions', "Installed"), + location: ViewLocation.Extensions, + ctor: InstalledExtensionsView, + when: ContextKeyExpr.not('searchExtensions'), + size: 50 + }; + } + + private createSearchInstalledExtensionsListViewDescriptor(): IViewDescriptor { + return { + id: 'extensions.searchInstalledList', + name: localize('searchInstalledExtensions', "Installed"), + location: ViewLocation.Extensions, + ctor: InstalledExtensionsView, + when: ContextKeyExpr.has('searchInstalledExtensions'), + size: 50 + }; + } + + private createRecommendedExtensionsListViewDescriptor(): IViewDescriptor { + return { + id: 'extensions.recommendedList', + name: localize('recommendedExtensions', "Recommended"), + location: ViewLocation.Extensions, + ctor: RecommendedExtensionsView, + when: ContextKeyExpr.not('searchExtensions'), + size: 50 + }; + } + create(parent: Builder): TPromise { - super.create(parent); parent.addClass('extensions-viewlet'); this.root = parent.getHTMLElement(); @@ -122,40 +179,25 @@ export class ExtensionsViewlet extends Viewlet implements IExtensionsViewlet { this.disposables.push(addStandardDisposableListener(this.searchBox, EventType.BLUR, () => removeClass(this.searchBox, 'synthetic-focus'))); this.extensionsBox = append(this.root, $('.extensions')); - this.messageBox = append(this.root, $('.message')); - - const delegate = new Delegate(); - const renderer = this.instantiationService.createInstance(Renderer); - this.list = new PagedList(this.extensionsBox, delegate, [renderer], { - ariaLabel: localize('extensions', "Extensions"), - keyboardSupport: false - }); - - this.disposables.push(attachListStyler(this.list.widget, this.themeService)); - this.disposables.push(this.listService.register(this.list.widget)); const onKeyDown = chain(domEvent(this.searchBox, 'keydown')) - .filter(() => this.list.length > 0) .map(e => new StandardKeyboardEvent(e)); - - onKeyDown.filter(e => e.keyCode === KeyCode.Enter).on(this.onEnter, this, this.disposables); onKeyDown.filter(e => e.keyCode === KeyCode.Escape).on(this.onEscape, this, this.disposables); - onKeyDown.filter(e => e.keyCode === KeyCode.UpArrow).on(this.onUpArrow, this, this.disposables); - onKeyDown.filter(e => e.keyCode === KeyCode.DownArrow).on(this.onDownArrow, this, this.disposables); - onKeyDown.filter(e => e.keyCode === KeyCode.PageUp).on(this.onPageUpArrow, this, this.disposables); - onKeyDown.filter(e => e.keyCode === KeyCode.PageDown).on(this.onPageDownArrow, this, this.disposables); + + const onKeyDownForList = onKeyDown.filter(() => this.count() > 0); + onKeyDownForList.filter(e => e.keyCode === KeyCode.Enter).on(this.onEnter, this, this.disposables); + onKeyDownForList.filter(e => e.keyCode === KeyCode.UpArrow).on(this.onUpArrow, this, this.disposables); + onKeyDownForList.filter(e => e.keyCode === KeyCode.DownArrow).on(this.onDownArrow, this, this.disposables); + onKeyDownForList.filter(e => e.keyCode === KeyCode.PageUp).on(this.onPageUpArrow, this, this.disposables); + onKeyDownForList.filter(e => e.keyCode === KeyCode.PageDown).on(this.onPageDownArrow, this, this.disposables); const onSearchInput = domEvent(this.searchBox, 'input') as EventOf; - onSearchInput(e => this.triggerSearch(e.target.value, e.immediate), null, this.disposables); + onSearchInput(e => this.triggerSearch(e.immediate), null, this.disposables); this.onSearchChange = mapEvent(onSearchInput, e => e.target.value); - chain(this.list.onSelectionChange) - .map(e => e.elements[0]) - .filter(e => !!e) - .on(this.openExtension, this, this.disposables); - - return TPromise.as(null); + this.searchExtensionsContextKey.set(!!this.searchBox.value); + return super.create(new Builder(this.extensionsBox)); } public updateStyles(): void { @@ -171,13 +213,18 @@ export class ExtensionsViewlet extends Viewlet implements IExtensionsViewlet { } setVisible(visible: boolean): TPromise { - return super.setVisible(visible).then(() => { + const isVisibilityChanged = this.isVisible() !== visible; + if (isVisibilityChanged) { if (visible) { this.searchBox.focus(); this.searchBox.setSelectionRange(0, this.searchBox.value.length); - this.triggerSearch(this.searchBox.value, true, true); - } else { - this.setModel(new PagedModel([])); + } + } + return super.setVisible(visible).then(() => { + if (isVisibilityChanged) { + if (visible) { + this.doSearch(); + } } }); } @@ -186,9 +233,9 @@ export class ExtensionsViewlet extends Viewlet implements IExtensionsViewlet { this.searchBox.focus(); } - layout({ height, width }: Dimension): void { - this.list.layout(height - 38); - toggleClass(this.root, 'narrow', width <= 300); + layout(dimension: Dimension): void { + toggleClass(this.root, 'narrow', dimension.width <= 300); + super.layout(new Dimension(dimension.width, dimension.height - 38)); } getOptimalWidth(): number { @@ -201,7 +248,6 @@ export class ExtensionsViewlet extends Viewlet implements IExtensionsViewlet { this.instantiationService.createInstance(ClearExtensionsInputAction, ClearExtensionsInputAction.ID, ClearExtensionsInputAction.LABEL, this.onSearchChange) ]; } - return this.primaryActions; } @@ -232,20 +278,6 @@ export class ExtensionsViewlet extends Viewlet implements IExtensionsViewlet { return this.secondaryActions; } - private setModel(model: IPagedModel) { - this.list.model = model; - this.list.scrollTop = 0; - - toggleClass(this.extensionsBox, 'hidden', model.length === 0); - toggleClass(this.messageBox, 'hidden', model.length > 0); - - if (model.length === 0 && this.isVisible()) { - this.messageBox.textContent = localize('no extensions found', "No extensions found."); - } else { - this.messageBox.textContent = ''; - } - } - search(value: string): void { const event = new Event('input', { bubbles: true }) as SearchInputEvent; event.immediate = true; @@ -254,220 +286,47 @@ export class ExtensionsViewlet extends Viewlet implements IExtensionsViewlet { this.searchBox.dispatchEvent(event); } - private triggerSearch(value: string, immediate = false, suggestPopular = false): void { - this.searchDelayer.trigger(() => this.doSearch(value, suggestPopular), immediate || !value ? 0 : 500) + private triggerSearch(immediate = false, showPopular: boolean = false): void { + this.searchDelayer.trigger(() => this.doSearch(), immediate || !this.searchBox.value ? 0 : 500) .done(null, err => this.onError(err)); } - private async doSearch(value: string = '', suggestPopular = false): TPromise { - const model = await this.progress(this.query(value)); + private async doSearch(): TPromise { + const value = this.searchBox.value || ''; + this.searchExtensionsContextKey.set(!!value); + this.searchInstalledExtensionsContextKey.set(InstalledExtensionsView.isInsalledExtensionsQuery(value)); + this.searchRecommendedExtensionsContextKey.set(RecommendedExtensionsView.isRecommendedExtensionsQuery(value)); - if (!value && model.length === 0 && suggestPopular) { - return this.search('@sort:installs '); - } - - this.setModel(model); + await this.updateViews(); + await this.progress(TPromise.join(this.views.map(view => (view).show(value)))); } - private async query(value: string): TPromise> { - const query = Query.parse(value); - - let options: IQueryOptions = { - sortOrder: SortOrder.Default - }; - - switch (query.sortBy) { - case 'installs': options = assign(options, { sortBy: SortBy.InstallCount }); break; - case 'rating': options = assign(options, { sortBy: SortBy.AverageRating }); break; - case 'name': options = assign(options, { sortBy: SortBy.Title }); break; - } - - if (!value || /@installed/i.test(value)) { - // Show installed extensions - value = value ? value.replace(/@installed/g, '').replace(/@sort:(\w+)(-\w*)?/g, '').trim().toLowerCase() : ''; - - let result = await this.extensionsWorkbenchService.queryLocal(); - - switch (options.sortBy) { - case SortBy.InstallCount: - result = result.sort((e1, e2) => e2.installCount - e1.installCount); - break; - case SortBy.AverageRating: - result = result.sort((e1, e2) => e2.rating - e1.rating); - break; - default: - result = result.sort((e1, e2) => e1.displayName.localeCompare(e2.displayName)); - break; - } - - if (options.sortOrder === SortOrder.Descending) { - result = result.reverse(); - } - - result = result - .filter(e => e.type === LocalExtensionType.User && e.name.toLowerCase().indexOf(value) > -1); - - return new PagedModel(result); - } - - if (/@outdated/i.test(value)) { - value = value.replace(/@outdated/g, '').trim().toLowerCase(); - - const local = await this.extensionsWorkbenchService.queryLocal(); - const result = local - .sort((e1, e2) => e1.displayName.localeCompare(e2.displayName)) - .filter(extension => extension.outdated && extension.name.toLowerCase().indexOf(value) > -1); - - return new PagedModel(result); - } - - if (/@disabled/i.test(value)) { - value = value.replace(/@disabled/g, '').trim().toLowerCase(); - - const local = await this.extensionsWorkbenchService.queryLocal(); - const runningExtensions = await this.extensionService.getExtensions(); - - const result = local - .sort((e1, e2) => e1.displayName.localeCompare(e2.displayName)) - .filter(e => runningExtensions.every(r => !areSameExtensions(r, e)) && e.name.toLowerCase().indexOf(value) > -1); - - return new PagedModel(result); - } - - if (/@recommended:workspace/i.test(query.value)) { - return this.getWorkspaceRecommendationsModel(query, options); - } else if (/@recommended:keymaps/i.test(query.value)) { - return this.getKeymapRecommendationsModel(query, options); - } else if (/@recommended/i.test(query.value)) { - return this.getRecommendationsModel(query, options); - } - - const pagerPromises: TPromise>[] = []; - let text = query.value; - const extensionRegex = /\bext:([^\s]+)\b/g; - - if (extensionRegex.test(query.value)) { - let names: string[] = []; - - text = query.value.replace(extensionRegex, (m, ext) => { - names.push(...this.tipsService.getRecommendationsForExtension(ext)); - - // Get curated keywords - const keywords = this.tipsService.getKeywordsForExtension(ext); - - // Get mode name - const modeId = this.modeService.getModeIdByFilenameOrFirstLine(`.${ext}`); - const languageName = modeId && this.modeService.getLanguageName(modeId); - const languageTag = languageName ? ` tag:"${languageName}"` : ''; - - // Construct a rich query - return `tag:"__ext_${ext}"${keywords.map(tag => ` tag:${tag}`)}${languageTag}`; - }); - - if (names.length) { - const namesOptions = assign({}, options, { names }); - pagerPromises.push(this.extensionsWorkbenchService.queryGallery(namesOptions)); - } - } - - if (text) { - options = assign(options, { text: text.substr(0, 350) }); - } - - pagerPromises.push(this.extensionsWorkbenchService.queryGallery(options)); - - const pagers = await TPromise.join(pagerPromises); - const pager = pagers.length === 2 ? mergePagers(pagers[0], pagers[1]) : pagers[0]; - - return new PagedModel(pager); - } - - private getRecommendationsModel(query: Query, options: IQueryOptions): TPromise> { - const value = query.value.replace(/@recommended/g, '').trim().toLowerCase(); - - return this.extensionsWorkbenchService.queryLocal() - .then(result => result.filter(e => e.type === LocalExtensionType.User)) - .then(local => { - const names = this.tipsService.getRecommendations() - .filter(name => local.every(ext => `${ext.publisher}.${ext.name}` !== name)) - .filter(name => name.toLowerCase().indexOf(value) > -1); - - this.telemetryService.publicLog('extensionRecommendations:open', { count: names.length }); - - if (!names.length) { - return TPromise.as(new PagedModel([])); - } - - return this.extensionsWorkbenchService.queryGallery(assign(options, { names, pageSize: names.length })) - .then(result => new PagedModel(result)); - }); + private count(): number { + return this.views.reduce((count, view) => (view).count() + count, 0); } - private getWorkspaceRecommendationsModel(query: Query, options: IQueryOptions): TPromise> { - const value = query.value.replace(/@recommended:workspace/g, '').trim().toLowerCase(); - return this.tipsService.getWorkspaceRecommendations() - .then(recommendations => { - const names = recommendations.filter(name => name.toLowerCase().indexOf(value) > -1); - this.telemetryService.publicLog('extensionWorkspaceRecommendations:open', { count: names.length }); - - if (!names.length) { - return TPromise.as(new PagedModel([])); - } - - return this.extensionsWorkbenchService.queryGallery(assign(options, { names, pageSize: names.length })) - .then(result => new PagedModel(result)); - }); - } - - private getKeymapRecommendationsModel(query: Query, options: IQueryOptions): TPromise> { - const value = query.value.replace(/@recommended:keymaps/g, '').trim().toLowerCase(); - const names = this.tipsService.getKeymapRecommendations() - .filter(name => name.toLowerCase().indexOf(value) > -1); - this.telemetryService.publicLog('extensionKeymapRecommendations:open', { count: names.length }); - - if (!names.length) { - return TPromise.as(new PagedModel([])); - } - - return this.extensionsWorkbenchService.queryGallery(assign(options, { names, pageSize: names.length })) - .then(result => new PagedModel(result)); - } - - private openExtension(extension: IExtension): void { - this.extensionsWorkbenchService.open(extension).done(null, err => this.onError(err)); + private onEscape(): void { + this.search(''); } private onEnter(): void { - this.list.setSelection(this.list.getFocus()); - } - - private onEscape(): void { - this.search(''); + (this.views[0]).select(); } private onUpArrow(): void { - this.list.focusPrevious(); - this.list.reveal(this.list.getFocus()[0]); + (this.views[0]).showPrevious(); } private onDownArrow(): void { - this.list.focusNext(); - this.list.reveal(this.list.getFocus()[0]); + (this.views[0]).showNext(); } private onPageUpArrow(): void { - this.list.focusPreviousPage(); - this.list.reveal(this.list.getFocus()[0]); + (this.views[0]).showPreviousPage(); } private onPageDownArrow(): void { - this.list.focusNextPage(); - this.list.reveal(this.list.getFocus()[0]); - } - - private progress(promise: TPromise): TPromise { - const progressRunner = this.progressService.show(true); - return always(promise, () => progressRunner.done()); + (this.views[0]).showNextPage(); } private onViewletOpen(viewlet: IViewlet): void { @@ -488,6 +347,11 @@ export class ExtensionsViewlet extends Viewlet implements IExtensionsViewlet { TPromise.join(promises).done(null, onUnexpectedError); } + private progress(promise: TPromise): TPromise { + const progressRunner = this.progressService.show(true); + return always(promise, () => progressRunner.done()); + } + private onError(err: any): void { if (isPromiseCanceledError(err)) { return; diff --git a/src/vs/workbench/parts/extensions/electron-browser/extensionsViews.ts b/src/vs/workbench/parts/extensions/electron-browser/extensionsViews.ts new file mode 100644 index 0000000000000000000000000000000000000000..f739e1392ec76615129094ece05ef4dae33b04d1 --- /dev/null +++ b/src/vs/workbench/parts/extensions/electron-browser/extensionsViews.ts @@ -0,0 +1,457 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +'use strict'; + +import { localize } from 'vs/nls'; +import { TPromise } from 'vs/base/common/winjs.base'; +import { IDisposable, dispose } from 'vs/base/common/lifecycle'; +import { assign } from 'vs/base/common/objects'; +import { distinct } from 'vs/base/common/arrays'; +import { chain } from 'vs/base/common/event'; +import { isPromiseCanceledError, create as createError } from 'vs/base/common/errors'; +import Severity from 'vs/base/common/severity'; +import { PagedModel, IPagedModel, mergePagers, IPager } from 'vs/base/common/paging'; +import { ViewSizing } from 'vs/base/browser/ui/splitview/splitview'; +import { IMessageService, CloseAction } from 'vs/platform/message/common/message'; +import { SortBy, SortOrder, IQueryOptions, LocalExtensionType, IExtensionTipsService } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { areSameExtensions } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; +import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; +import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; +import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; +import { ICommandService } from 'vs/platform/commands/common/commands'; +import { append, $, toggleClass } from 'vs/base/browser/dom'; +import { PagedList } from 'vs/base/browser/ui/list/listPaging'; +import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; +import { Delegate, Renderer } from 'vs/workbench/parts/extensions/browser/extensionsList'; +import { IExtension, IExtensionsWorkbenchService } from '../common/extensions'; +import { Query } from '../common/extensionQuery'; +import { IListService } from 'vs/platform/list/browser/listService'; +import { IExtensionService } from 'vs/platform/extensions/common/extensions'; +import { IThemeService } from 'vs/platform/theme/common/themeService'; +import { attachListStyler, attachBadgeStyler } from 'vs/platform/theme/common/styler'; +import { CollapsibleView, IViewletViewOptions, IViewOptions } from 'vs/workbench/parts/views/browser/views'; +import { OpenGlobalSettingsAction } from 'vs/workbench/parts/preferences/browser/preferencesActions'; +import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; +import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService'; +import { IModeService } from 'vs/editor/common/services/modeService'; +import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; +import { IProgressService } from 'vs/platform/progress/common/progress'; +import { CountBadge } from 'vs/base/browser/ui/countBadge/countBadge'; + +export class ExtensionsListView extends CollapsibleView { + + private messageBox: HTMLElement; + private extensionsList: HTMLElement; + private badge: CountBadge; + + private list: PagedList; + private disposables: IDisposable[] = []; + + constructor( + private options: IViewletViewOptions, + @IMessageService private messageService: IMessageService, + @IKeybindingService keybindingService: IKeybindingService, + @IContextMenuService contextMenuService: IContextMenuService, + @IInstantiationService private instantiationService: IInstantiationService, + @IListService private listService: IListService, + @IThemeService private themeService: IThemeService, + @IContextKeyService private contextKeyService: IContextKeyService, + @IExtensionService private extensionService: IExtensionService, + @ICommandService private commandService: ICommandService, + @IExtensionsWorkbenchService private extensionsWorkbenchService: IExtensionsWorkbenchService, + @IWorkbenchEditorService private editorService: IWorkbenchEditorService, + @IEditorGroupService private editorInputService: IEditorGroupService, + @IExtensionTipsService private tipsService: IExtensionTipsService, + @IModeService private modeService: IModeService, + @ITelemetryService private telemetryService: ITelemetryService, + @IProgressService private progressService: IProgressService + ) { + super({ ...(options as IViewOptions), ariaHeaderLabel: options.name, sizing: ViewSizing.Flexible, collapsed: !!options.collapsed, initialBodySize: 1 * 62 }, keybindingService, contextMenuService); + } + + renderHeader(container: HTMLElement): void { + const titleDiv = append(container, $('div.title')); + append(titleDiv, $('span')).textContent = this.options.name; + this.badge = new CountBadge(append(container, $('.count-badge-wrapper'))); + this.disposables.push(attachBadgeStyler(this.badge, this.themeService)); + } + + renderBody(container: HTMLElement): void { + this.extensionsList = append(container, $('.extensions-list')); + this.messageBox = append(container, $('.message')); + const delegate = new Delegate(); + const renderer = this.instantiationService.createInstance(Renderer); + this.list = new PagedList(this.extensionsList, delegate, [renderer], { + ariaLabel: localize('extensions', "Extensions"), + keyboardSupport: false + }); + + this.disposables.push(attachListStyler(this.list.widget, this.themeService)); + this.disposables.push(this.listService.register(this.list.widget)); + + chain(this.list.onSelectionChange) + .map(e => e.elements[0]) + .filter(e => !!e) + .on(this.openExtension, this, this.disposables); + + chain(this.list.onPin) + .map(e => e.elements[0]) + .filter(e => !!e) + .on(this.pin, this, this.disposables); + } + + setVisible(visible: boolean): TPromise { + return super.setVisible(visible).then(() => { + if (!visible) { + this.setModel(new PagedModel([])); + } + }); + } + + layoutBody(size: number): void { + this.extensionsList.style.height = size + 'px'; + this.list.layout(size); + } + + async show(query: string): TPromise> { + const model = await this.query(query); + this.setModel(model); + return model; + } + + select(): void { + this.list.setSelection(this.list.getFocus()); + } + + showPrevious(): void { + this.list.focusPrevious(); + this.list.reveal(this.list.getFocus()[0]); + } + + showPreviousPage(): void { + this.list.focusPreviousPage(); + this.list.reveal(this.list.getFocus()[0]); + } + + showNext(): void { + this.list.focusNext(); + this.list.reveal(this.list.getFocus()[0]); + } + + showNextPage(): void { + this.list.focusNextPage(); + this.list.reveal(this.list.getFocus()[0]); + } + + count(): number { + return this.list.length; + } + + private async query(value: string): TPromise> { + const query = Query.parse(value); + + let options: IQueryOptions = { + sortOrder: SortOrder.Default + }; + + switch (query.sortBy) { + case 'installs': options = assign(options, { sortBy: SortBy.InstallCount }); break; + case 'rating': options = assign(options, { sortBy: SortBy.AverageRating }); break; + case 'name': options = assign(options, { sortBy: SortBy.Title }); break; + } + + if (!value || ExtensionsListView.isInstalledExtensionsQuery(value)) { + // Show installed extensions + value = value ? value.replace(/@installed/g, '').replace(/@sort:(\w+)(-\w*)?/g, '').trim().toLowerCase() : ''; + + let result = await this.extensionsWorkbenchService.queryLocal(); + + switch (options.sortBy) { + case SortBy.InstallCount: + result = result.sort((e1, e2) => e2.installCount - e1.installCount); + break; + case SortBy.AverageRating: + result = result.sort((e1, e2) => e2.rating - e1.rating); + break; + default: + result = result.sort((e1, e2) => e1.displayName.localeCompare(e2.displayName)); + break; + } + + if (options.sortOrder === SortOrder.Descending) { + result = result.reverse(); + } + + result = result + .filter(e => e.type === LocalExtensionType.User && e.name.toLowerCase().indexOf(value) > -1); + + return new PagedModel(result); + } + + if (/@outdated/i.test(value)) { + value = value.replace(/@outdated/g, '').trim().toLowerCase(); + + const local = await this.extensionsWorkbenchService.queryLocal(); + const result = local + .sort((e1, e2) => e1.displayName.localeCompare(e2.displayName)) + .filter(extension => extension.outdated && extension.name.toLowerCase().indexOf(value) > -1); + + return new PagedModel(result); + } + + if (/@disabled/i.test(value)) { + value = value.replace(/@disabled/g, '').trim().toLowerCase(); + + const local = await this.extensionsWorkbenchService.queryLocal(); + const runningExtensions = await this.extensionService.getExtensions(); + + const result = local + .sort((e1, e2) => e1.displayName.localeCompare(e2.displayName)) + .filter(e => runningExtensions.every(r => !areSameExtensions(r, e)) && e.name.toLowerCase().indexOf(value) > -1); + + return new PagedModel(result); + } + + if (ExtensionsListView.isWorkspaceRecommendedExtensionsQuery(query.value)) { + return this.getWorkspaceRecommendationsModel(query, options); + } else if (ExtensionsListView.isKeymapsRecommendedExtensionsQuery(query.value)) { + return this.getKeymapRecommendationsModel(query, options); + } else if (/@recommended:all/i.test(query.value)) { + return this.getAllRecommendationsModel(query, options); + } else if (ExtensionsListView.isRecommendedExtensionsQuery(query.value)) { + return this.getRecommendationsModel(query, options); + } + + const pagerPromises: TPromise>[] = []; + let text = query.value; + const extensionRegex = /\bext:([^\s]+)\b/g; + + if (extensionRegex.test(query.value)) { + let names: string[] = []; + + text = query.value.replace(extensionRegex, (m, ext) => { + names.push(...this.tipsService.getRecommendationsForExtension(ext)); + + // Get curated keywords + const keywords = this.tipsService.getKeywordsForExtension(ext); + + // Get mode name + const modeId = this.modeService.getModeIdByFilenameOrFirstLine(`.${ext}`); + const languageName = modeId && this.modeService.getLanguageName(modeId); + const languageTag = languageName ? ` tag:"${languageName}"` : ''; + + // Construct a rich query + return `tag:"__ext_${ext}"${keywords.map(tag => ` tag:${tag}`)}${languageTag}`; + }); + + if (names.length) { + const namesOptions = assign({}, options, { names }); + pagerPromises.push(this.extensionsWorkbenchService.queryGallery(namesOptions)); + } + } + + if (text) { + options = assign(options, { text: text.substr(0, 350) }); + } + + pagerPromises.push(this.extensionsWorkbenchService.queryGallery(options)); + + const pagers = await TPromise.join(pagerPromises); + const pager = pagers.length === 2 ? mergePagers(pagers[0], pagers[1]) : pagers[0]; + + return new PagedModel(pager); + } + + private getAllRecommendationsModel(query: Query, options: IQueryOptions): TPromise> { + const value = query.value.replace(/@recommended:all/g, '').trim().toLowerCase(); + + return this.extensionsWorkbenchService.queryLocal() + .then(result => result.filter(e => e.type === LocalExtensionType.User)) + .then(local => { + return TPromise.join([TPromise.as(this.tipsService.getRecommendations()), this.tipsService.getWorkspaceRecommendations(), TPromise.as(this.tipsService.getKeymapRecommendations())]) + .then(([recommendations, workspaceRecommendations, keymapsRecommendations]) => { + const names = distinct([...recommendations, ...workspaceRecommendations, ...keymapsRecommendations]) + .filter(name => local.every(ext => `${ext.publisher}.${ext.name}` !== name)) + .filter(name => name.toLowerCase().indexOf(value) > -1); + + if (!names.length) { + return TPromise.as(new PagedModel([])); + } + + return this.extensionsWorkbenchService.queryGallery(assign(options, { names, pageSize: names.length })) + .then(pager => new PagedModel(pager || [])); + }); + }); + } + + private getRecommendationsModel(query: Query, options: IQueryOptions): TPromise> { + const value = query.value.replace(/@recommended/g, '').trim().toLowerCase(); + + return this.extensionsWorkbenchService.queryLocal() + .then(result => result.filter(e => e.type === LocalExtensionType.User)) + .then(local => { + const names = this.tipsService.getRecommendations() + .filter(name => local.every(ext => `${ext.publisher}.${ext.name}` !== name)) + .filter(name => name.toLowerCase().indexOf(value) > -1); + + this.telemetryService.publicLog('extensionRecommendations:open', { count: names.length }); + + if (!names.length) { + return TPromise.as(new PagedModel([])); + } + + return this.extensionsWorkbenchService.queryGallery(assign(options, { names, pageSize: names.length })) + .then(pager => new PagedModel(pager)); + }); + } + + private getWorkspaceRecommendationsModel(query: Query, options: IQueryOptions): TPromise> { + const value = query.value.replace(/@recommended:workspace/g, '').trim().toLowerCase(); + return this.tipsService.getWorkspaceRecommendations() + .then(recommendations => { + const names = recommendations.filter(name => name.toLowerCase().indexOf(value) > -1); + this.telemetryService.publicLog('extensionWorkspaceRecommendations:open', { count: names.length }); + + if (!names.length) { + return TPromise.as(new PagedModel([])); + } + + return this.extensionsWorkbenchService.queryGallery(assign(options, { names, pageSize: names.length })) + .then(pager => new PagedModel(pager)); + }); + } + + private getKeymapRecommendationsModel(query: Query, options: IQueryOptions): TPromise> { + const value = query.value.replace(/@recommended:keymaps/g, '').trim().toLowerCase(); + const names = this.tipsService.getKeymapRecommendations() + .filter(name => name.toLowerCase().indexOf(value) > -1); + this.telemetryService.publicLog('extensionKeymapRecommendations:open', { count: names.length }); + + if (!names.length) { + return TPromise.as(new PagedModel([])); + } + + return this.extensionsWorkbenchService.queryGallery(assign(options, { names, pageSize: names.length })) + .then(result => new PagedModel(result)); + } + + private setModel(model: IPagedModel) { + this.list.model = model; + this.list.scrollTop = 0; + const count = this.count(); + + toggleClass(this.extensionsList, 'hidden', count === 0); + toggleClass(this.messageBox, 'hidden', count > 0); + this.badge.setCount(count); + + if (count === 0 && this.isVisible()) { + this.messageBox.textContent = localize('no extensions found', "No extensions found."); + } else { + this.messageBox.textContent = ''; + } + } + + private openExtension(extension: IExtension): void { + this.extensionsWorkbenchService.open(extension).done(null, err => this.onError(err)); + } + + private pin(): void { + const activeEditor = this.editorService.getActiveEditor(); + const activeEditorInput = this.editorService.getActiveEditorInput(); + + this.editorInputService.pinEditor(activeEditor.position, activeEditorInput); + } + + + private onError(err: any): void { + if (isPromiseCanceledError(err)) { + return; + } + + const message = err && err.message || ''; + + if (/ECONNREFUSED/.test(message)) { + const error = createError(localize('suggestProxyError', "Marketplace returned 'ECONNREFUSED'. Please check the 'http.proxy' setting."), { + actions: [ + this.instantiationService.createInstance(OpenGlobalSettingsAction, OpenGlobalSettingsAction.ID, OpenGlobalSettingsAction.LABEL), + CloseAction + ] + }); + + this.messageService.show(Severity.Error, error); + return; + } + + this.messageService.show(Severity.Error, err); + } + + dispose(): void { + this.disposables = dispose(this.disposables); + super.dispose(); + } + + static isInstalledExtensionsQuery(query: string): boolean { + return /@installed/i.test(query); + } + + static isOutdatedExtensionsQuery(query: string): boolean { + return /@outdated/i.test(query); + } + + static isDisabledExtensionsQuery(query: string): boolean { + return /@disabled/i.test(query); + } + + static isRecommendedExtensionsQuery(query: string): boolean { + return /@recommended/i.test(query); + } + + static isWorkspaceRecommendedExtensionsQuery(query: string): boolean { + return /@recommended:workspace/i.test(query); + } + + static isKeymapsRecommendedExtensionsQuery(query: string): boolean { + return /@recommended:keymaps/i.test(query); + } +} + +export class InstalledExtensionsView extends ExtensionsListView { + + public static isInsalledExtensionsQuery(query: string): boolean { + return ExtensionsListView.isInstalledExtensionsQuery(query) + || ExtensionsListView.isOutdatedExtensionsQuery(query) + || ExtensionsListView.isDisabledExtensionsQuery(query); + } + + async show(query: string): TPromise> { + if (InstalledExtensionsView.isInsalledExtensionsQuery(query)) { + return super.show(query); + } + let searchInstalledQuery = '@installed'; + searchInstalledQuery = query ? searchInstalledQuery + ' ' + query : searchInstalledQuery; + return super.show(searchInstalledQuery); + } + +} + +export class RecommendedExtensionsView extends ExtensionsListView { + + public static isRecommendedExtensionsQuery(query: string): boolean { + return ExtensionsListView.isRecommendedExtensionsQuery(query) + || ExtensionsListView.isWorkspaceRecommendedExtensionsQuery(query) + || ExtensionsListView.isKeymapsRecommendedExtensionsQuery(query); + } + + async show(query: string): TPromise> { + if (RecommendedExtensionsView.isRecommendedExtensionsQuery(query)) { + return super.show(query); + } + let searchInstalledQuery = '@recommended:all'; + searchInstalledQuery = query ? searchInstalledQuery + ' ' + query : searchInstalledQuery; + return super.show(searchInstalledQuery); + } + +} \ No newline at end of file diff --git a/src/vs/workbench/parts/extensions/electron-browser/media/extensionsViewlet.css b/src/vs/workbench/parts/extensions/electron-browser/media/extensionsViewlet.css index 14b5fb4f7a74eccc3508790dd8076f1c3338c02a..081ebc4ee1adabdb3f9b6a2ad73a25aad813e96a 100644 --- a/src/vs/workbench/parts/extensions/electron-browser/media/extensionsViewlet.css +++ b/src/vs/workbench/parts/extensions/electron-browser/media/extensionsViewlet.css @@ -27,13 +27,21 @@ height: calc(100% - 38px); } -.extensions-viewlet > .extensions.hidden, -.extensions-viewlet > .message.hidden { +.extensions-viewlet > .extensions .extensions-list.hidden, +.extensions-viewlet > .extensions .message.hidden { display: none; visibility: hidden; } -.extensions-viewlet > .message { +.extensions-viewlet > .extensions .header { + padding-right: 12px; +} + +.extensions-viewlet > .extensions .header > .title { + flex: 1; +} + +.extensions-viewlet > .extensions .message { padding: 5px 9px 5px 16px; cursor: default; } diff --git a/src/vs/workbench/parts/extensions/node/extensionsWorkbenchService.ts b/src/vs/workbench/parts/extensions/node/extensionsWorkbenchService.ts index 9f4f45594c441b73facf38a2d4033fc0eb5df81f..e5cdd00266b5d0681072c1e67197c794d2d91abe 100644 --- a/src/vs/workbench/parts/extensions/node/extensionsWorkbenchService.ts +++ b/src/vs/workbench/parts/extensions/node/extensionsWorkbenchService.ts @@ -11,7 +11,6 @@ import * as semver from 'semver'; import * as path from 'path'; import Event, { Emitter, chain } from 'vs/base/common/event'; import { index } from 'vs/base/common/arrays'; -import { LinkedMap as Map } from 'vs/base/common/map'; import { assign } from 'vs/base/common/objects'; import { ThrottledDelayer } from 'vs/base/common/async'; import { isPromiseCanceledError } from 'vs/base/common/errors'; @@ -513,9 +512,9 @@ export class ExtensionsWorkbenchService implements IExtensionsWorkbenchService { return this.extensionService.installFromGallery(gallery, promptToInstallDependencies); } - setEnablement(extension: IExtension, enable: boolean, workspace: boolean = false): TPromise { + setEnablement(extension: IExtension, enable: boolean, workspace: boolean = false): TPromise { if (extension.type === LocalExtensionType.System) { - return TPromise.wrap(null); + return TPromise.wrap(void 0); } return this.promptAndSetEnablement(extension, enable, workspace).then(reload => { @@ -806,21 +805,32 @@ export class ExtensionsWorkbenchService implements IExtensionsWorkbenchService { const extensionId = match[1]; this.queryGallery({ names: [extensionId] }) - .done(result => { + .then(result => { if (result.total < 1) { - return; + return TPromise.as(null); } const extension = result.firstPage[0]; - const promises = [this.open(extension)]; - - if (this.local.every(local => local.id !== extension.id)) { - promises.push(this.install(extension)); - } - - TPromise.join(promises) - .done(null, error => this.onError(error)); - }); + return this.open(extension).then(() => { + const message = nls.localize('installConfirmation', "Would you like to install the '{0}' extension?", extension.displayName, extension.publisher); + const options = [ + nls.localize('install', "Install"), + nls.localize('cancel', "Cancel") + ]; + return this.choiceService.choose(Severity.Info, message, options, 2, false) + .then(value => { + if (value === 0) { + const promises: TPromise[] = []; + if (this.local.every(local => local.id !== extension.id)) { + promises.push(this.install(extension)); + } + return TPromise.join(promises); + } + return TPromise.as(null); + }); + }); + }) + .done(undefined, error => this.onError(error)); } dispose(): void { diff --git a/src/vs/workbench/parts/extensions/test/electron-browser/extensionsActions.test.ts b/src/vs/workbench/parts/extensions/test/electron-browser/extensionsActions.test.ts index 0f50eb3a0e55c4ff2c1de47c9d6b668eef938171..405be3a135fd69a8da30df06d8965fa2861d08d0 100644 --- a/src/vs/workbench/parts/extensions/test/electron-browser/extensionsActions.test.ts +++ b/src/vs/workbench/parts/extensions/test/electron-browser/extensionsActions.test.ts @@ -28,8 +28,8 @@ import { IPager } from 'vs/base/common/paging'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { NullTelemetryService } from 'vs/platform/telemetry/common/telemetryUtils'; import { IExtensionService } from 'vs/platform/extensions/common/extensions'; -import { IWorkspaceContextService, WorkspaceContextService } from 'vs/platform/workspace/common/workspace'; -import { TestWorkspace } from 'vs/platform/workspace/test/common/testWorkspace'; +import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; +import { TestContextService } from 'vs/workbench/test/workbenchTestServices'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; suite('ExtensionsActions Test', () => { @@ -52,7 +52,7 @@ suite('ExtensionsActions Test', () => { instantiationService.stub(IURLService, { onOpenURL: new Emitter().event }); instantiationService.stub(ITelemetryService, NullTelemetryService); - instantiationService.set(IWorkspaceContextService, new WorkspaceContextService(TestWorkspace)); + instantiationService.stub(IWorkspaceContextService, new TestContextService()); instantiationService.stub(IConfigurationService, { onDidUpdateConfiguration: () => { }, getConfiguration: () => ({}) }); instantiationService.stub(IExtensionGalleryService, ExtensionGalleryService); diff --git a/src/vs/workbench/parts/extensions/test/electron-browser/extensionsWorkbenchService.test.ts b/src/vs/workbench/parts/extensions/test/electron-browser/extensionsWorkbenchService.test.ts index d42837e340ece39c9f599de93c1a96ee9df984e8..3cfe083cd1690ab696f99299e1b9c354f4076668 100644 --- a/src/vs/workbench/parts/extensions/test/electron-browser/extensionsWorkbenchService.test.ts +++ b/src/vs/workbench/parts/extensions/test/electron-browser/extensionsWorkbenchService.test.ts @@ -28,8 +28,8 @@ import Event, { Emitter } from 'vs/base/common/event'; import { IPager } from 'vs/base/common/paging'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { NullTelemetryService } from 'vs/platform/telemetry/common/telemetryUtils'; -import { IWorkspaceContextService, WorkspaceContextService } from 'vs/platform/workspace/common/workspace'; -import { TestWorkspace } from 'vs/platform/workspace/test/common/testWorkspace'; +import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; +import { TestContextService } from 'vs/workbench/test/workbenchTestServices'; import { IChoiceService } from 'vs/platform/message/common/message'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; @@ -55,7 +55,7 @@ suite('ExtensionsWorkbenchService Test', () => { instantiationService.stub(IExtensionGalleryService, ExtensionGalleryService); - instantiationService.set(IWorkspaceContextService, new WorkspaceContextService(TestWorkspace)); + instantiationService.stub(IWorkspaceContextService, new TestContextService()); instantiationService.stub(IConfigurationService, { onDidUpdateConfiguration: () => { }, getConfiguration: () => ({}) }); instantiationService.stub(IExtensionManagementService, ExtensionManagementService); diff --git a/src/vs/workbench/parts/feedback/electron-browser/feedback.contribution.ts b/src/vs/workbench/parts/feedback/electron-browser/feedback.contribution.ts index 5ae6e8c9f1389d4daebbe4d73ac3186f54ecbc4e..f08f6a01220f14c2d1c4bdb5c0f84aa205bce277 100644 --- a/src/vs/workbench/parts/feedback/electron-browser/feedback.contribution.ts +++ b/src/vs/workbench/parts/feedback/electron-browser/feedback.contribution.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ 'use strict'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { StatusbarAlignment, IStatusbarRegistry, Extensions, StatusbarItemDescriptor } from 'vs/workbench/browser/parts/statusbar/statusbar'; import { FeedbackStatusbarItem } from './feedbackStatusbarItem'; diff --git a/src/vs/workbench/parts/feedback/electron-browser/feedback.ts b/src/vs/workbench/parts/feedback/electron-browser/feedback.ts index 310eb5f0d975b7aa40d9c71e01a0d19a61b4e11f..a3b733644a8c2516cbd23fccb7ece6e8eacead83 100644 --- a/src/vs/workbench/parts/feedback/electron-browser/feedback.ts +++ b/src/vs/workbench/parts/feedback/electron-browser/feedback.ts @@ -17,9 +17,9 @@ import * as dom from 'vs/base/browser/dom'; import { ICommandService } from 'vs/platform/commands/common/commands'; import * as errors from 'vs/base/common/errors'; import { IIntegrityService } from 'vs/platform/integrity/common/integrity'; -import { IThemeService, registerThemingParticipant, ITheme, ICssStyleCollector } from "vs/platform/theme/common/themeService"; -import { attachStylerCallback } from "vs/platform/theme/common/styler"; -import { editorWidgetBackground, widgetShadow, inputBorder, inputForeground, inputBackground, inputActiveOptionBorder, editorBackground, buttonBackground, contrastBorder } from "vs/platform/theme/common/colorRegistry"; +import { IThemeService, registerThemingParticipant, ITheme, ICssStyleCollector } from 'vs/platform/theme/common/themeService'; +import { attachStylerCallback } from 'vs/platform/theme/common/styler'; +import { editorWidgetBackground, widgetShadow, inputBorder, inputForeground, inputBackground, inputActiveOptionBorder, editorBackground, buttonBackground, contrastBorder } from 'vs/platform/theme/common/colorRegistry'; export interface IFeedback { feedback: string; @@ -208,9 +208,11 @@ export class FeedbackDropdown extends Dropdown { $form.style('background-color', colors.editorWidgetBackground); $form.style('box-shadow', colors.widgetShadow ? `0 2px 8px ${colors.widgetShadow}` : null); - this.feedbackDescriptionInput.style.backgroundColor = colors.inputBackground; - this.feedbackDescriptionInput.style.color = colors.inputForeground; - this.feedbackDescriptionInput.style.border = `1px solid ${colors.inputBorder || 'transparent'}`; + if (this.feedbackDescriptionInput) { + this.feedbackDescriptionInput.style.backgroundColor = colors.inputBackground; + this.feedbackDescriptionInput.style.color = colors.inputForeground; + this.feedbackDescriptionInput.style.border = `1px solid ${colors.inputBorder || 'transparent'}`; + } $contactUs.style('background-color', colors.editorBackground); $contactUs.style('border', `1px solid ${colors.contrastBorder || 'transparent'}`); diff --git a/src/vs/workbench/parts/feedback/electron-browser/feedbackStatusbarItem.ts b/src/vs/workbench/parts/feedback/electron-browser/feedbackStatusbarItem.ts index b4763f543e6f674723a3a266af4e82cdee68e64f..b124264626e57ff6ac175887a717c167b81180fe 100644 --- a/src/vs/workbench/parts/feedback/electron-browser/feedbackStatusbarItem.ts +++ b/src/vs/workbench/parts/feedback/electron-browser/feedbackStatusbarItem.ts @@ -13,7 +13,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti import product from 'vs/platform/node/product'; import { Themable, STATUS_BAR_FOREGROUND, STATUS_BAR_NO_FOLDER_FOREGROUND } from 'vs/workbench/common/theme'; import { IThemeService } from 'vs/platform/theme/common/themeService'; -import { IWorkspaceContextService } from "vs/platform/workspace/common/workspace"; +import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; class TwitterFeedbackService implements IFeedbackService { diff --git a/src/vs/workbench/parts/files/browser/editors/textFileEditor.ts b/src/vs/workbench/parts/files/browser/editors/textFileEditor.ts index 3929604de103b94da65dc295b326e089dc9cd98d..cebb5032438f0342d2e94a946f222523f822d171 100644 --- a/src/vs/workbench/parts/files/browser/editors/textFileEditor.ts +++ b/src/vs/workbench/parts/files/browser/editors/textFileEditor.ts @@ -23,7 +23,7 @@ import { IFileOperationResult, FileOperationResult, FileChangesEvent, IFileServi import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { IStorageService } from 'vs/platform/storage/common/storage'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; +import { ITextResourceConfigurationService } from 'vs/editor/common/services/resourceConfiguration'; import { IHistoryService } from 'vs/workbench/services/history/common/history'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { CancelAction } from 'vs/platform/message/common/message'; @@ -47,7 +47,7 @@ export class TextFileEditor extends BaseTextEditor { @IWorkspaceContextService private contextService: IWorkspaceContextService, @IStorageService storageService: IStorageService, @IHistoryService private historyService: IHistoryService, - @IConfigurationService configurationService: IConfigurationService, + @ITextResourceConfigurationService configurationService: ITextResourceConfigurationService, @IWorkbenchEditorService private editorService: IWorkbenchEditorService, @IThemeService themeService: IThemeService, @IEditorGroupService editorGroupService: IEditorGroupService, diff --git a/src/vs/workbench/parts/files/browser/explorerViewlet.ts b/src/vs/workbench/parts/files/browser/explorerViewlet.ts index f0def3cae947272daeedbbfb014301d8c20920d5..544b9e59a6596380dd459512a45b40bc98395bea 100644 --- a/src/vs/workbench/parts/files/browser/explorerViewlet.ts +++ b/src/vs/workbench/parts/files/browser/explorerViewlet.ts @@ -6,20 +6,19 @@ 'use strict'; import 'vs/css!./media/explorerviewlet'; -import { IDisposable } from 'vs/base/common/lifecycle'; -import { IAction, IActionRunner } from 'vs/base/common/actions'; +import { IActionRunner } from 'vs/base/common/actions'; import { TPromise } from 'vs/base/common/winjs.base'; -import { Dimension, Builder } from 'vs/base/browser/builder'; -import { Scope } from 'vs/workbench/common/memento'; -import { VIEWLET_ID, ExplorerViewletVisibleContext, IFilesConfiguration } from 'vs/workbench/parts/files/common/files'; -import { IViewletView, Viewlet } from 'vs/workbench/browser/viewlet'; -import { SplitView } from 'vs/base/browser/ui/splitview/splitview'; +import * as DOM from 'vs/base/browser/dom'; +import { Builder } from 'vs/base/browser/builder'; +import { VIEWLET_ID, ExplorerViewletVisibleContext, IFilesConfiguration, OpenEditorsVisibleContext, OpenEditorsVisibleCondition } from 'vs/workbench/parts/files/common/files'; +import { ComposedViewsViewlet, IView, IViewletViewOptions } from 'vs/workbench/parts/views/browser/views'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; +import { IConfigurationEditingService } from 'vs/workbench/services/configuration/common/configurationEditing'; import { ActionRunner, FileViewletState } from 'vs/workbench/parts/files/browser/views/explorerViewer'; -import { ExplorerView } from 'vs/workbench/parts/files/browser/views/explorerView'; +import { ExplorerView, IExplorerViewOptions } from 'vs/workbench/parts/files/browser/views/explorerView'; import { EmptyView } from 'vs/workbench/parts/files/browser/views/emptyView'; import { OpenEditorsView } from 'vs/workbench/parts/files/browser/views/openEditorsView'; -import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; +import { IStorageService } from 'vs/platform/storage/common/storage'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; @@ -31,221 +30,96 @@ import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/edi import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService'; import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey'; import { IThemeService } from 'vs/platform/theme/common/themeService'; -import { attachHeaderViewStyler } from 'vs/platform/theme/common/styler'; -import { ViewsRegistry, ViewLocation, IViewDescriptor } from 'vs/workbench/parts/views/browser/views'; +import { ViewsRegistry, ViewLocation, IViewDescriptor } from 'vs/workbench/parts/views/browser/viewsRegistry'; +import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; -interface IViewState { - collapsed: boolean; - size: number; -} - -export class ExplorerViewlet extends Viewlet { +export class ExplorerViewlet extends ComposedViewsViewlet { private static EXPLORER_VIEWS_STATE = 'workbench.explorer.views.state'; - private viewletContainer: Builder; - private splitView: SplitView; - private views: IViewletView[]; - - private explorerView: ExplorerView; - private openEditorsView: OpenEditorsView; - private emptyView: EmptyView; - - private openEditorsVisible: boolean; - private lastFocusedView: IViewletView; - private focusListener: IDisposable; - private delayEditorOpeningInOpenedEditors: boolean; - - private viewletSettings: any; private viewletState: FileViewletState; - private dimension: Dimension; - private viewletVisibleContextKey: IContextKey; + private openEditorsVisibleContextKey: IContextKey; constructor( @ITelemetryService telemetryService: ITelemetryService, - @IWorkspaceContextService private contextService: IWorkspaceContextService, - @IStorageService private storageService: IStorageService, + @IWorkspaceContextService protected contextService: IWorkspaceContextService, + @IStorageService protected storageService: IStorageService, @IEditorGroupService private editorGroupService: IEditorGroupService, @IWorkbenchEditorService private editorService: IWorkbenchEditorService, @IConfigurationService private configurationService: IConfigurationService, - @IInstantiationService private instantiationService: IInstantiationService, + @IInstantiationService protected instantiationService: IInstantiationService, @IContextKeyService contextKeyService: IContextKeyService, + @IConfigurationEditingService private configurationEditingService: IConfigurationEditingService, @IThemeService themeService: IThemeService, + @IContextMenuService contextMenuService: IContextMenuService ) { - super(VIEWLET_ID, telemetryService, themeService); - - this.views = []; + super(VIEWLET_ID, ViewLocation.Explorer, ExplorerViewlet.EXPLORER_VIEWS_STATE, telemetryService, storageService, instantiationService, themeService, contextService, contextKeyService, contextMenuService); this.viewletState = new FileViewletState(); this.viewletVisibleContextKey = ExplorerViewletVisibleContext.bindTo(contextKeyService); + this.openEditorsVisibleContextKey = OpenEditorsVisibleContext.bindTo(contextKeyService); - this.viewletSettings = this.getMemento(storageService, Scope.WORKSPACE); - this.configurationService.onDidUpdateConfiguration(e => this.onConfigurationUpdated(e.config)); - ViewsRegistry.onViewsRegistered(viewDescriptors => this.addViews(viewDescriptors.filter(viewDescriptor => ViewLocation.Explorer === viewDescriptor.location))); + this.registerViews(); + this.onConfigurationUpdated(); + this._register(this.configurationService.onDidUpdateConfiguration(e => this.onConfigurationUpdated())); } public create(parent: Builder): TPromise { - super.create(parent); - - this.viewletContainer = parent.div().addClass('explorer-viewlet'); - - return this.render(); - } - - public getActions(): IAction[] { - if (this.views.length === 1) { - return this.views[0].getActions(); - } - return []; + return super.create(parent).then(() => DOM.addClass(this.viewletContainer, 'explorer-viewlet')); } - private render(): TPromise { - const config = this.configurationService.getConfiguration(); - - // No need to delay if preview is disabled - this.delayEditorOpeningInOpenedEditors = !!config.workbench.editor.enablePreview; + private registerViews(): void { + let viewDescriptors = []; - // Open editors view should always be visible in no folder workspace. - this.openEditorsVisible = !this.contextService.hasWorkspace() || config.explorer.openEditors.visible !== 0; + viewDescriptors.push(this.createOpenEditorsViewDescriptor()); - this.views = []; - this.viewletContainer.clearChildren(); - - this.splitView = new SplitView(this.viewletContainer.getHTMLElement()); - - // Track focus - this.focusListener = this.splitView.onFocus((view: IViewletView) => { - this.lastFocusedView = view; - }); - - const customViews = ViewsRegistry.getViews(ViewLocation.Explorer); - - if (this.openEditorsVisible) { - // Open editors view - this.openEditorsView = this.instantiationService.createInstance(OpenEditorsView, this.getActionRunner(), this.viewletSettings); - this.views.push(this.openEditorsView); - } - - const viewsState = JSON.parse(this.storageService.get(ExplorerViewlet.EXPLORER_VIEWS_STATE, this.contextService.hasWorkspace() ? StorageScope.WORKSPACE : StorageScope.GLOBAL, '{}')); - - // Explorer view - this.views.push(this.createExplorerOrEmptyView(viewsState)); - - // custom views - for (const view of customViews) { - this.views.push(this.instantiationService.createInstance(view.ctor, view.id, { - name: view.name, - actionRunner: this.getActionRunner(), - collapsed: viewsState[view.id] ? (viewsState[view.id]).collapsed : true - })); - } - - for (let i = 0; i < this.views.length; i++) { - const view = this.views[i]; - attachHeaderViewStyler(view, this.themeService, { noContrastBorder: i === 0 }); - this.splitView.addView(view, viewsState[view.id] ? (viewsState[view.id]).size : void 0); + if (this.contextService.hasWorkspace()) { + viewDescriptors.push(this.createExplorerViewDescriptor()); + } else { + viewDescriptors.push(this.createEmptyViewDescriptor()); } - this.lastFocusedView = this.explorerView; - - return TPromise.join(this.views.map(view => view.create())).then(() => void 0).then(() => { - if (this.views.length === 1) { - this.views[0].hideHeader(); - - } - if (this.dimension) { - this.layout(this.dimension); - } - - // Update title area since the title actions have changed. - this.updateTitleArea(); - return this.setVisible(this.isVisible()).then(() => this.focus()); // Focus the viewlet since that triggers a rerender. - }); + ViewsRegistry.registerViews(viewDescriptors); } - private updateOpenEditorsView(): void { - if (!this.splitView) { - return; - } - - if (this.openEditorsVisible) { - this.openEditorsView = this.instantiationService.createInstance(OpenEditorsView, this.getActionRunner(), this.viewletSettings); - this.views.unshift(this.openEditorsView); - this.splitView.addView(this.openEditorsView, undefined, 0); - this.openEditorsView.create().then(() => { - if (this.views.length === 2) { - this.views[1].showHeader(); - } - if (this.dimension) { - this.layout(this.dimension); - } - // Update title area since the title actions have changed. - this.updateTitleArea(); - }); - } else { - this.views.shift(); - this.splitView.removeView(this.openEditorsView); - this.openEditorsView.dispose(); - this.openEditorsView = null; - - if (this.views.length === 1) { - this.views[0].hideHeader(); - } - if (this.dimension) { - this.layout(this.dimension); - } - // Update title area since the title actions have changed. - this.updateTitleArea(); - } + private createOpenEditorsViewDescriptor(): IViewDescriptor { + return { + id: OpenEditorsView.ID, + name: OpenEditorsView.NAME, + location: ViewLocation.Explorer, + ctor: OpenEditorsView, + order: 0, + when: OpenEditorsVisibleCondition + }; } - private addViews(viewDescriptors: IViewDescriptor[]): void { - if (!this.splitView || !viewDescriptors.length) { - return; - } - const views = []; - - const viewsState = JSON.parse(this.storageService.get(ExplorerViewlet.EXPLORER_VIEWS_STATE, this.contextService.hasWorkspace() ? StorageScope.WORKSPACE : StorageScope.GLOBAL, '{}')); - for (const viewDescriptor of viewDescriptors) { - const view = this.instantiationService.createInstance(viewDescriptor.ctor, viewDescriptor.id, { - name: viewDescriptor.name, - actionRunner: this.getActionRunner(), - collapsed: viewsState[viewDescriptor.id] ? (viewsState[viewDescriptor.id]).collapsed : true - }); - views.push(view); - this.views.push(view); - attachHeaderViewStyler(view, this.themeService); - this.splitView.addView(view, viewsState[view.id] ? (viewsState[view.id]).size : void 0); - } - - TPromise.join(views.map(view => view.create())).then(() => void 0).then(() => { - this.views[0].showHeader(); - - if (this.dimension) { - this.layout(this.dimension); - } - - // Update title area since the title actions have changed. - this.updateTitleArea(); - }); + private createEmptyViewDescriptor(): IViewDescriptor { + return { + id: EmptyView.ID, + name: EmptyView.NAME, + location: ViewLocation.Explorer, + ctor: EmptyView, + order: 1 + }; } - private onConfigurationUpdated(config: IFilesConfiguration): void { - // Open editors view should always be visible in no folder workspace. - const openEditorsVisible = !this.contextService.hasWorkspace() || config.explorer.openEditors.visible !== 0; - if (this.openEditorsVisible !== openEditorsVisible) { - this.openEditorsVisible = openEditorsVisible; - this.updateOpenEditorsView(); - } + private createExplorerViewDescriptor(): IViewDescriptor { + return { + id: ExplorerView.ID, + name: this.contextService.getWorkspace2().name, + location: ViewLocation.Explorer, + ctor: ExplorerView, + order: 1 + }; } - private createExplorerOrEmptyView(viewsState: any): IViewletView { - let explorerOrEmptyView: ExplorerView | EmptyView; - - // With a Workspace - if (this.contextService.hasWorkspace()) { + private onConfigurationUpdated(): void { + this.openEditorsVisibleContextKey.set(!this.contextService.hasWorkspace() || (this.configurationService.getConfiguration()).explorer.openEditors.visible !== 0); + } + protected createView(viewDescriptor: IViewDescriptor, options: IViewletViewOptions): IView { + if (viewDescriptor.id === ExplorerView.ID) { // Create a delegating editor service for the explorer to be able to delay the refresh in the opened // editors view above. This is a workaround for being able to double click on a file to make it pinned // without causing the animation in the opened editors view to kick in and change scroll position. @@ -253,21 +127,28 @@ export class ExplorerViewlet extends Viewlet { // a new entry in the opened editors view. const delegatingEditorService = this.instantiationService.createInstance(DelegatingWorkbenchEditorService); delegatingEditorService.setEditorOpenHandler((input: EditorInput, options?: EditorOptions, arg3?: any) => { - if (this.openEditorsView) { + let openEditorsView = this.getOpenEditorsView(); + if (openEditorsView) { let delay = 0; - if (this.delayEditorOpeningInOpenedEditors && (arg3 === false /* not side by side */ || typeof arg3 !== 'number' /* no explicit position */)) { + + const config = this.configurationService.getConfiguration(); + // No need to delay if preview is disabled + const delayEditorOpeningInOpenedEditors = !!config.workbench.editor.enablePreview; + + if (delayEditorOpeningInOpenedEditors && (arg3 === false /* not side by side */ || typeof arg3 !== 'number' /* no explicit position */)) { const activeGroup = this.editorGroupService.getStacksModel().activeGroup; if (!activeGroup || !activeGroup.previewEditor) { delay = 250; // a new editor entry is likely because there is either no group or no preview in group } } - this.openEditorsView.setStructuralRefreshDelay(delay); + openEditorsView.setStructuralRefreshDelay(delay); } const onSuccessOrError = (editor?: BaseEditor) => { - if (this.openEditorsView) { - this.openEditorsView.setStructuralRefreshDelay(0); + let openEditorsView = this.getOpenEditorsView(); + if (openEditorsView) { + openEditorsView.setStructuralRefreshDelay(0); } return editor; @@ -277,75 +158,65 @@ export class ExplorerViewlet extends Viewlet { }); const explorerInstantiator = this.instantiationService.createChild(new ServiceCollection([IWorkbenchEditorService, delegatingEditorService])); - this.explorerView = explorerOrEmptyView = explorerInstantiator.createInstance(ExplorerView, this.viewletState, { - collapsed: viewsState[ExplorerView.ID] ? (viewsState[ExplorerView.ID]).collapsed : false, - actionRunner: this.getActionRunner() - }, this.viewletSettings, void 0); - } - - // No workspace - else { - this.emptyView = explorerOrEmptyView = this.instantiationService.createInstance(EmptyView, { - collapsed: viewsState[EmptyView.ID] ? (viewsState[EmptyView.ID]).collapsed : false, - actionRunner: this.getActionRunner() - }); + return explorerInstantiator.createInstance(ExplorerView, { ...options, viewletState: this.viewletState }); } - - return explorerOrEmptyView; + return super.createView(viewDescriptor, options); } public getExplorerView(): ExplorerView { - return this.explorerView; + return this.getView(ExplorerView.ID); } public getOpenEditorsView(): OpenEditorsView { - return this.openEditorsView; + return this.getView(OpenEditorsView.ID); + } + + public getEmptyView(): EmptyView { + return this.getView(EmptyView.ID); } public setVisible(visible: boolean): TPromise { this.viewletVisibleContextKey.set(visible); - - return super.setVisible(visible).then(() => { - return TPromise.join(this.views.map((view) => view.setVisible(visible))).then(() => void 0); - }); + return super.setVisible(visible); } public focus(): void { - super.focus(); - const hasOpenedEditors = !!this.editorGroupService.getStacksModel().activeGroup; + let openEditorsView = this.getOpenEditorsView(); if (this.lastFocusedView && this.lastFocusedView.isExpanded() && this.hasSelectionOrFocus(this.lastFocusedView)) { - if (this.lastFocusedView !== this.openEditorsView || hasOpenedEditors) { + if (this.lastFocusedView !== openEditorsView || hasOpenedEditors) { this.lastFocusedView.focusBody(); return; } } - if (this.hasSelectionOrFocus(this.openEditorsView) && hasOpenedEditors) { - return this.openEditorsView.focusBody(); + if (this.hasSelectionOrFocus(openEditorsView) && hasOpenedEditors) { + return openEditorsView.focusBody(); } - if (this.hasSelectionOrFocus(this.explorerView)) { - return this.explorerView.focusBody(); + let explorerView = this.getExplorerView(); + if (this.hasSelectionOrFocus(explorerView)) { + return explorerView.focusBody(); } - if (this.openEditorsView && this.openEditorsView.isExpanded() && hasOpenedEditors) { - return this.openEditorsView.focusBody(); // we have entries in the opened editors view to focus on + if (openEditorsView && openEditorsView.isExpanded() && hasOpenedEditors) { + return openEditorsView.focusBody(); // we have entries in the opened editors view to focus on } - if (this.explorerView && this.explorerView.isExpanded()) { - return this.explorerView.focusBody(); + if (explorerView && explorerView.isExpanded()) { + return explorerView.focusBody(); } - if (this.emptyView && this.emptyView.isExpanded()) { - return this.emptyView.focusBody(); + let emptyView = this.getEmptyView(); + if (emptyView && emptyView.isExpanded()) { + return emptyView.focusBody(); } - return this.openEditorsView.focus(); + super.focus(); } - private hasSelectionOrFocus(view: IViewletView): boolean { + private hasSelectionOrFocus(view: IView): boolean { if (!view) { return false; } @@ -367,77 +238,14 @@ export class ExplorerViewlet extends Viewlet { return false; } - public layout(dimension: Dimension): void { - this.dimension = dimension; - this.splitView.layout(dimension.height); - } - public getActionRunner(): IActionRunner { if (!this.actionRunner) { this.actionRunner = new ActionRunner(this.viewletState); } - return this.actionRunner; } public getViewletState(): FileViewletState { return this.viewletState; } - - public getOptimalWidth(): number { - const additionalMargin = 16; - const openedEditorsViewWidth = this.openEditorsView ? this.openEditorsView.getOptimalWidth() : 0; - const explorerView = this.getExplorerView(); - const explorerViewWidth = explorerView ? explorerView.getOptimalWidth() : 0; - const optimalWidth = Math.max(openedEditorsViewWidth, explorerViewWidth); - - return optimalWidth + additionalMargin; - } - - public shutdown(): void { - const viewletState = this.views.reduce((result, view) => { - result[view.id] = this.getViewState(view); - return result; - }, {}); - this.storageService.store(ExplorerViewlet.EXPLORER_VIEWS_STATE, JSON.stringify(viewletState), this.contextService.hasWorkspace() ? StorageScope.WORKSPACE : StorageScope.GLOBAL); - - this.views.forEach((view) => view.shutdown()); - - super.shutdown(); - } - - private getViewState(view: IViewletView): IViewState { - return { - collapsed: !view.isExpanded(), - size: view.size > 0 ? view.size : void 0 - }; - } - - public dispose(): void { - - for (const view of this.views) { - view.dispose(); - } - - if (this.splitView) { - this.splitView = null; - } - - if (this.explorerView) { - this.explorerView = null; - } - - if (this.openEditorsView) { - this.openEditorsView = null; - } - - if (this.emptyView) { - this.emptyView = null; - } - - if (this.focusListener) { - this.focusListener.dispose(); - this.focusListener = null; - } - } } \ No newline at end of file diff --git a/src/vs/workbench/parts/files/browser/fileActions.contribution.ts b/src/vs/workbench/parts/files/browser/fileActions.contribution.ts index 7c3bd0125d2d2286542716867d0d209f606b0a37..2762e01c4e9eef73ec6ec508e2e0d2107726258b 100644 --- a/src/vs/workbench/parts/files/browser/fileActions.contribution.ts +++ b/src/vs/workbench/parts/files/browser/fileActions.contribution.ts @@ -5,11 +5,11 @@ 'use strict'; import nls = require('vs/nls'); -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { Action, IAction } from 'vs/base/common/actions'; import { isMacintosh } from 'vs/base/common/platform'; import { ActionItem, BaseActionItem, Separator } from 'vs/base/browser/ui/actionbar/actionbar'; -import { Scope, IActionBarRegistry, Extensions as ActionBarExtensions, ActionBarContributor } from 'vs/workbench/browser/actionBarRegistry'; +import { Scope, IActionBarRegistry, Extensions as ActionBarExtensions, ActionBarContributor } from 'vs/workbench/browser/actions'; import { GlobalNewUntitledFileAction, SaveFileAsAction, OpenFileAction, ShowOpenedFileInNewWindow, CopyPathAction, GlobalCopyPathAction, RevealInOSAction, GlobalRevealInOSAction, pasteIntoFocusedFilesExplorerViewItem, FocusOpenEditorsView, FocusFilesExplorer, GlobalCompareResourcesAction, GlobalNewFileAction, GlobalNewFolderAction, RevertFileAction, SaveFilesAction, SaveAllAction, SaveFileAction, MoveFileToTrashAction, TriggerRenameFileAction, PasteFileAction, CopyFileAction, SelectResourceForCompareAction, CompareResourcesAction, NewFolderAction, NewFileAction, OpenToSideAction, ShowActiveFileInExplorer, CollapseExplorerView, RefreshExplorerView } from 'vs/workbench/parts/files/browser/fileActions'; import { revertLocalChangesCommand, acceptLocalChangesCommand, CONFLICT_RESOLUTION_CONTEXT } from 'vs/workbench/parts/files/browser/saveErrorHandler'; import { SyncActionDescriptor, MenuId, MenuRegistry } from 'vs/platform/actions/common/actions'; @@ -17,13 +17,14 @@ import { IWorkbenchActionRegistry, Extensions as ActionExtensions } from 'vs/wor import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { FileStat } from 'vs/workbench/parts/files/common/explorerViewModel'; +import { FileStat, Model } from 'vs/workbench/parts/files/common/explorerModel'; import { KeyMod, KeyChord, KeyCode } from 'vs/base/common/keyCodes'; -import { OpenFolderAction, OpenFileFolderAction } from 'vs/workbench/browser/actions/fileActions'; +import { OpenFolderAction, OpenFileFolderAction, AddRootFolderAction, RemoveRootFolderAction } from 'vs/workbench/browser/actions/fileActions'; import { copyFocusedFilesExplorerViewItem, revealInOSFocusedFilesExplorerItem, openFocusedExplorerItemSideBySideCommand, copyPathOfFocusedExplorerItem, copyPathCommand, revealInExplorerCommand, revealInOSCommand, openFolderPickerCommand, openWindowCommand, openFileInNewWindowCommand, deleteFocusedFilesExplorerViewItemCommand, moveFocusedFilesExplorerViewItemToTrashCommand, renameFocusedFilesExplorerViewItemCommand } from 'vs/workbench/parts/files/browser/fileCommands'; import { CommandsRegistry, ICommandHandler } from 'vs/platform/commands/common/commands'; import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry'; +import { IEnvironmentService } from "vs/platform/environment/common/environment"; import { explorerItemToFileResource, ExplorerFocusCondition, FilesExplorerFocusCondition } from 'vs/workbench/parts/files/common/files'; class FilesViewerActionContributor extends ActionBarContributor { @@ -31,7 +32,8 @@ class FilesViewerActionContributor extends ActionBarContributor { constructor( @IInstantiationService private instantiationService: IInstantiationService, @IWorkspaceContextService private contextService: IWorkspaceContextService, - @IKeybindingService private keybindingService: IKeybindingService + @IKeybindingService private keybindingService: IKeybindingService, + @IEnvironmentService private environmentService: IEnvironmentService ) { super(); } @@ -40,14 +42,17 @@ class FilesViewerActionContributor extends ActionBarContributor { const element = context.element; // Contribute only on Stat Objects (File Explorer) - return element instanceof FileStat; + return element instanceof FileStat || element instanceof Model; } public getSecondaryActions(context: any): IAction[] { - const stat = (context.element); + const stat = (context.element); const tree = context.viewer; const actions: IAction[] = []; let separateOpen = false; + if (stat instanceof Model) { + return [this.instantiationService.createInstance(AddRootFolderAction, AddRootFolderAction.ID, AddRootFolderAction.LABEL)]; + } // Open side by side if (!stat.isDirectory) { @@ -86,13 +91,20 @@ class FilesViewerActionContributor extends ActionBarContributor { actions.push(new Separator(null, 100)); } - const workspace = this.contextService.getWorkspace(); - const isRoot = workspace && stat.resource.toString() === workspace.resource.toString(); + if (stat.isRoot && this.environmentService.appQuality !== 'stable') { + let action: Action = this.instantiationService.createInstance(AddRootFolderAction, AddRootFolderAction.ID, AddRootFolderAction.LABEL); + action.order = 52; + actions.push(action); + if (this.contextService.getWorkspace2().roots.length > 1) { + action = this.instantiationService.createInstance(RemoveRootFolderAction, stat.resource, RemoveRootFolderAction.ID, RemoveRootFolderAction.LABEL); + action.order = 53; + actions.push(action); + } + actions.push(new Separator(null, 54)); + } // Copy File/Folder - if (!isRoot) { - actions.push(this.instantiationService.createInstance(CopyFileAction, tree, stat)); - } + actions.push(this.instantiationService.createInstance(CopyFileAction, tree, stat)); // Paste File/Folder if (stat.isDirectory) { @@ -100,13 +112,10 @@ class FilesViewerActionContributor extends ActionBarContributor { } // Rename File/Folder - if (!isRoot) { + if (!stat.isRoot) { actions.push(new Separator(null, 150)); actions.push(this.instantiationService.createInstance(TriggerRenameFileAction, tree, stat)); - } - - // Delete File/Folder - if (!isRoot) { + // Delete File/Folder actions.push(this.instantiationService.createInstance(MoveFileToTrashAction, tree, stat)); } @@ -205,7 +214,7 @@ if (isMacintosh) { } // Commands -CommandsRegistry.registerCommand('_files.openFolderPicker', openFolderPickerCommand); +CommandsRegistry.registerCommand('_files.pickFolderAndOpen', openFolderPickerCommand); CommandsRegistry.registerCommand('_files.windowOpen', openWindowCommand); CommandsRegistry.registerCommand('workbench.action.files.openFileInNewWindow', openFileInNewWindowCommand); diff --git a/src/vs/workbench/parts/files/browser/fileActions.ts b/src/vs/workbench/parts/files/browser/fileActions.ts index ede081152305050e476cdd10659952b550bbfc32..75e68ab5c6109b23a3bf94f77c3b26ee19e081c0 100644 --- a/src/vs/workbench/parts/files/browser/fileActions.ts +++ b/src/vs/workbench/parts/files/browser/fileActions.ts @@ -25,9 +25,9 @@ import { dispose, IDisposable } from 'vs/base/common/lifecycle'; import { VIEWLET_ID } from 'vs/workbench/parts/files/common/files'; import labels = require('vs/base/common/labels'); import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; -import { IFileService, IFileStat, isEqual, isEqualOrParent } from 'vs/platform/files/common/files'; +import { IFileService, IFileStat } from 'vs/platform/files/common/files'; import { toResource, IEditorIdentifier, EditorInput } from 'vs/workbench/common/editor'; -import { FileStat, NewStatPlaceholder } from 'vs/workbench/parts/files/common/explorerViewModel'; +import { FileStat, Model, NewStatPlaceholder } from 'vs/workbench/parts/files/common/explorerModel'; import { ExplorerView } from 'vs/workbench/parts/files/browser/views/explorerView'; import { ExplorerViewlet } from 'vs/workbench/parts/files/browser/explorerViewlet'; import { IUntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService'; @@ -285,7 +285,7 @@ class RenameFileAction extends BaseRenameAction { public runAction(newName: string): TPromise { - const dirty = this.textFileService.getDirty().filter(d => isEqualOrParent(d.fsPath, this.element.resource.fsPath, !isLinux /* ignorecase */)); + const dirty = this.textFileService.getDirty().filter(d => paths.isEqualOrParent(d.fsPath, this.element.resource.fsPath, !isLinux /* ignorecase */)); const dirtyRenamed: URI[] = []; return TPromise.join(dirty.map(d => { @@ -293,7 +293,7 @@ class RenameFileAction extends BaseRenameAction { let renamed: URI; // If the dirty file itself got moved, just reparent it to the target folder - if (isEqual(this.element.resource.fsPath, d.fsPath)) { + if (paths.isEqual(this.element.resource.fsPath, d.fsPath)) { renamed = URI.file(targetPath); } @@ -365,13 +365,14 @@ export class BaseNewAction extends BaseFileAction { return TPromise.wrapError('Invalid viewlet state provided to BaseNewAction.'); } - let folder: FileStat = this.presetFolder; + let folder = this.presetFolder; if (!folder) { const focus = this.tree.getFocus(); if (focus) { folder = focus.isDirectory ? focus : focus.parent; } else { - folder = this.tree.getInput(); + const input: FileStat | Model = this.tree.getInput(); + folder = input instanceof Model ? input.roots[0] : input; } } @@ -660,7 +661,7 @@ export class BaseDeleteFileAction extends BaseFileAction { // Handle dirty let revertPromise: TPromise = TPromise.as(null); - const dirty = this.textFileService.getDirty().filter(d => isEqualOrParent(d.fsPath, this.element.resource.fsPath, !isLinux /* ignorecase */)); + const dirty = this.textFileService.getDirty().filter(d => paths.isEqualOrParent(d.fsPath, this.element.resource.fsPath, !isLinux /* ignorecase */)); if (dirty.length) { let message: string; if (this.element.isDirectory) { @@ -698,13 +699,15 @@ export class BaseDeleteFileAction extends BaseFileAction { confirm = { message: this.element.isDirectory ? nls.localize('confirmMoveTrashMessageFolder', "Are you sure you want to delete '{0}' and its contents?", this.element.name) : nls.localize('confirmMoveTrashMessageFile', "Are you sure you want to delete '{0}'?", this.element.name), detail: isWindows ? nls.localize('undoBin', "You can restore from the recycle bin.") : nls.localize('undoTrash', "You can restore from the trash."), - primaryButton + primaryButton, + type: 'question' }; } else { confirm = { message: this.element.isDirectory ? nls.localize('confirmDeleteMessageFolder', "Are you sure you want to permanently delete '{0}' and its contents?", this.element.name) : nls.localize('confirmDeleteMessageFile', "Are you sure you want to permanently delete '{0}'?", this.element.name), detail: nls.localize('irreversible', "This action is irreversible!"), - primaryButton + primaryButton, + type: 'warning' }; } @@ -793,7 +796,8 @@ export class ImportFileAction extends BaseFileAction { if (this.element) { targetElement = this.element; } else { - targetElement = this.tree.getFocus() || this.tree.getInput(); + const input: FileStat | Model = this.tree.getInput(); + targetElement = this.tree.getFocus() || (input instanceof Model ? input.roots[0] : input); } if (!targetElement.isDirectory) { @@ -823,7 +827,8 @@ export class ImportFileAction extends BaseFileAction { const confirm: IConfirmation = { message: nls.localize('confirmOverwrite', "A file or folder with the same name already exists in the destination folder. Do you want to replace it?"), detail: nls.localize('irreversible', "This action is irreversible!"), - primaryButton: nls.localize({ key: 'replaceButtonLabel', comment: ['&& denotes a mnemonic'] }, "&&Replace") + primaryButton: nls.localize({ key: 'replaceButtonLabel', comment: ['&& denotes a mnemonic'] }, "&&Replace"), + type: 'warning' }; overwrite = this.messageService.confirm(confirm); @@ -932,7 +937,11 @@ export class PasteFileAction extends BaseFileAction { super(PasteFileAction.ID, nls.localize('pasteFile', "Paste"), fileService, messageService, textFileService); this.tree = tree; - this.element = element || this.tree.getInput(); + this.element = element; + if (!this.element) { + const input: FileStat | Model = this.tree.getInput(); + this.element = input instanceof Model ? input.roots[0] : input; + } this._updateEnablement(); } @@ -944,7 +953,7 @@ export class PasteFileAction extends BaseFileAction { } // Check if file was deleted or moved meanwhile - const root: FileStat = this.tree.getInput(); + const root: FileStat = this.element.root; const exists = root.find(fileToCopy.resource); if (!exists) { fileToCopy = null; @@ -952,7 +961,7 @@ export class PasteFileAction extends BaseFileAction { } // Check if target is ancestor of pasted folder - if (!isEqual(this.element.resource.fsPath, fileToCopy.resource.fsPath) && isEqualOrParent(this.element.resource.fsPath, fileToCopy.resource.fsPath, !isLinux /* ignorecase */)) { + if (!paths.isEqual(this.element.resource.fsPath, fileToCopy.resource.fsPath) && paths.isEqualOrParent(this.element.resource.fsPath, fileToCopy.resource.fsPath, !isLinux /* ignorecase */)) { return false; } @@ -1038,12 +1047,11 @@ export class DuplicateFileAction extends BaseFileAction { } private findTarget(): URI { - const root: FileStat = this.tree.getInput(); let name = this.element.name; let candidate = URI.file(paths.join(this.target.resource.fsPath, name)); while (true) { - if (!root.find(candidate)) { + if (!this.element.root.find(candidate)) { break; } @@ -1259,13 +1267,15 @@ export class CompareResourcesAction extends Action { // Check if file was deleted or moved meanwhile (explorer only) if (this.tree) { - const root: FileStat = this.tree.getInput(); - if (root instanceof FileStat) { - const exists = root.find(globalResourceToCompare); - if (!exists) { - globalResourceToCompare = null; - return false; - } + const input: FileStat | Model = this.tree.getInput(); + if (input instanceof Model) { + return false; + } + + const exists = input.find(globalResourceToCompare); + if (!exists) { + globalResourceToCompare = null; + return false; } } @@ -1354,7 +1364,7 @@ export abstract class BaseSaveFileAction extends BaseActionWithErrorReporting { if (this.isSaveAs() || source.scheme === 'untitled') { let encodingOfSource: string; if (source.scheme === 'untitled') { - encodingOfSource = this.untitledEditorService.get(source).getEncoding(); + encodingOfSource = this.untitledEditorService.getEncoding(source); } else if (source.scheme === 'file') { const textModel = this.textFileService.models.get(source); encodingOfSource = textModel && textModel.getEncoding(); // text model can be null e.g. if this is a binary file! @@ -1494,18 +1504,33 @@ export abstract class BaseSaveAllAction extends BaseActionWithErrorReporting { // Store some properties per untitled file to restore later after save is completed const mapUntitledToProperties: { [resource: string]: { encoding: string; indexInGroups: number[]; activeInGroups: boolean[] } } = Object.create(null); - this.textFileService.getDirty() - .filter(r => r.scheme === 'untitled') // All untitled resources - .map(r => this.untitledEditorService.get(r)) // Mapped to their inputs - .filter(input => !!input) // If possible :) - .forEach(input => { - mapUntitledToProperties[input.getResource().toString()] = { - encoding: input.getEncoding(), - indexInGroups: stacks.groups.map(g => g.indexOf(input)), - activeInGroups: stacks.groups.map(g => g.isActive(input)) - }; + this.untitledEditorService.getDirty().forEach(resource => { + const activeInGroups: boolean[] = []; + const indexInGroups: number[] = []; + const encoding = this.untitledEditorService.getEncoding(resource); + + // For each group + stacks.groups.forEach((group, groupIndex) => { + + // Find out if editor is active in group + const activeEditor = group.activeEditor; + const activeResource = toResource(activeEditor, { supportSideBySide: true }); + activeInGroups[groupIndex] = (activeResource && activeResource.toString() === resource.toString()); + + // Find index of editor in group + indexInGroups[groupIndex] = -1; + group.getEditors().forEach((editor, editorIndex) => { + const editorResource = toResource(editor, { supportSideBySide: true }); + if (editorResource && editorResource.toString() === resource.toString()) { + indexInGroups[groupIndex] = editorIndex; + return; + } + }); }); + mapUntitledToProperties[resource.toString()] = { encoding, indexInGroups, activeInGroups }; + }); + // Save all return this.textFileService.saveAll(this.getSaveAllArguments(context)).then(results => { @@ -1800,7 +1825,7 @@ export class OpenFileAction extends Action { run(event?: any, data?: ITelemetryData): TPromise { const fileResource = toResource(this.editorService.getActiveEditorInput(), { supportSideBySide: true, filter: 'file' }); - return this.windowService.openFilePicker(false, fileResource ? paths.dirname(fileResource.fsPath) : void 0, data); + return this.windowService.pickFileAndOpen(false, fileResource ? paths.dirname(fileResource.fsPath) : void 0, data); } } diff --git a/src/vs/workbench/parts/files/browser/fileCommands.ts b/src/vs/workbench/parts/files/browser/fileCommands.ts index 5ee9500a35a600c67abbb70af0bf0d3d7651363a..4db2af9e1b4679e14292b190802961d538645ca5 100644 --- a/src/vs/workbench/parts/files/browser/fileCommands.ts +++ b/src/vs/workbench/parts/files/browser/fileCommands.ts @@ -18,7 +18,7 @@ import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { ExplorerViewlet } from 'vs/workbench/parts/files/browser/explorerViewlet'; import { VIEWLET_ID, explorerItemToFileResource } from 'vs/workbench/parts/files/common/files'; -import { FileStat, OpenEditor } from 'vs/workbench/parts/files/common/explorerViewModel'; +import { FileStat, OpenEditor } from 'vs/workbench/parts/files/common/explorerModel'; import errors = require('vs/base/common/errors'); import { ITree } from 'vs/base/parts/tree/browser/tree'; import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; @@ -54,7 +54,7 @@ export const copyPathCommand = (accessor: ServicesAccessor, resource?: URI) => { export const openFolderPickerCommand = (accessor: ServicesAccessor, forceNewWindow: boolean) => { const windowService = accessor.get(IWindowService); - windowService.openFolderPicker(forceNewWindow); + windowService.pickFolderAndOpen(forceNewWindow); }; export const openWindowCommand = (accessor: ServicesAccessor, paths: string[], forceNewWindow: boolean) => { @@ -68,7 +68,7 @@ export const openFileInNewWindowCommand = (accessor: ServicesAccessor) => { const fileResource = toResource(editorService.getActiveEditorInput(), { supportSideBySide: true, filter: 'file' }); - windowService.openFilePicker(true, fileResource ? paths.dirname(fileResource.fsPath) : void 0); + windowService.pickFileAndOpen(true, fileResource ? paths.dirname(fileResource.fsPath) : void 0); }; export const revealInOSCommand = (accessor: ServicesAccessor, resource?: URI) => { @@ -154,7 +154,7 @@ function withVisibleExplorer(accessor: ServicesAccessor): TPromise; }; export function withFocussedFilesExplorerViewItem(accessor: ServicesAccessor): TPromise<{ explorer: ExplorerViewlet, tree: ITree, item: FileStat }> { diff --git a/src/vs/workbench/browser/fileResultsNavigation.ts b/src/vs/workbench/parts/files/browser/fileResultsNavigation.ts similarity index 100% rename from src/vs/workbench/browser/fileResultsNavigation.ts rename to src/vs/workbench/parts/files/browser/fileResultsNavigation.ts diff --git a/src/vs/workbench/parts/files/browser/files.contribution.ts b/src/vs/workbench/parts/files/browser/files.contribution.ts index 3e19dc5ed9d8220575b05b43573f2ff53f724916..74e2a22238ea2f785c9868af1477866a3dc41330 100644 --- a/src/vs/workbench/parts/files/browser/files.contribution.ts +++ b/src/vs/workbench/parts/files/browser/files.contribution.ts @@ -9,12 +9,12 @@ import URI from 'vs/base/common/uri'; import { ViewletRegistry, Extensions as ViewletExtensions, ViewletDescriptor, ToggleViewletAction } from 'vs/workbench/browser/viewlet'; import nls = require('vs/nls'); import { SyncActionDescriptor } from 'vs/platform/actions/common/actions'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { IConfigurationRegistry, Extensions as ConfigurationExtensions } from 'vs/platform/configuration/common/configurationRegistry'; import { IWorkbenchActionRegistry, Extensions as ActionExtensions } from 'vs/workbench/common/actionRegistry'; import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } from 'vs/workbench/common/contributions'; import { IEditorRegistry, Extensions as EditorExtensions, IEditorInputFactory, EditorInput, IFileEditorInput } from 'vs/workbench/common/editor'; -import { AutoSaveConfiguration, HotExitConfiguration, SUPPORTED_ENCODINGS, IFilesConfiguration } from 'vs/platform/files/common/files'; +import { AutoSaveConfiguration, HotExitConfiguration, SUPPORTED_ENCODINGS } from 'vs/platform/files/common/files'; import { EditorDescriptor } from 'vs/workbench/browser/parts/editor/baseEditor'; import { FILE_EDITOR_INPUT_ID, VIEWLET_ID } from 'vs/workbench/parts/files/common/files'; import { FileEditorTracker } from 'vs/workbench/parts/files/common/editors/fileEditorTracker'; @@ -105,28 +105,16 @@ Registry.as(EditorExtensions.Editors).registerFileInputFactory( interface ISerializedFileInput { resource: string; - resourceJSON: any; + resourceJSON: object; encoding?: string; } // Register Editor Input Factory class FileEditorInputFactory implements IEditorInputFactory { - private configuredEncoding: string; constructor( @IWorkspaceConfigurationService private configurationService: IWorkspaceConfigurationService ) { - this.onConfiguration(configurationService.getConfiguration()); - - this.registerListeners(); - } - - private registerListeners(): void { - this.configurationService.onDidUpdateConfiguration(e => this.onConfiguration(e.config)); - } - - private onConfiguration(config: IFilesConfiguration): void { - this.configuredEncoding = config.files && config.files.encoding; } public serialize(editorInput: EditorInput): string { @@ -138,7 +126,7 @@ class FileEditorInputFactory implements IEditorInputFactory { }; const encoding = fileEditorInput.getPreferredEncoding(); - if (encoding && encoding !== this.configuredEncoding) { + if (encoding && encoding !== this.configurationService.lookup('files.encoding', { resource }).value) { fileInput.encoding = encoding; } @@ -271,10 +259,15 @@ configurationRegistry.registerConfiguration({ 'enumDescriptions': [ nls.localize('hotExit.off', 'Disable hot exit.'), nls.localize('hotExit.onExit', 'Hot exit will be triggered when the application is closed, that is when the last window is closed on Windows/Linux or when the workbench.action.quit command is triggered (command palette, keybinding, menu). All windows with backups will be restored upon next launch.'), - nls.localize('hotExit.onExitAndWindowClose', 'Hot exit will be triggered when the application is closed, that is when the last window is closed on Windows/Linux or when the workbench.action.quit command is triggered (command palette, keybinding, menu), and also for any window with a folder opened regardless of whether it\'s the last window. All windows without folders opened will be restored upon next launch. To restore folder windows as they were before shutdown set "window.reopenFolders" to "all".') + nls.localize('hotExit.onExitAndWindowClose', 'Hot exit will be triggered when the application is closed, that is when the last window is closed on Windows/Linux or when the workbench.action.quit command is triggered (command palette, keybinding, menu), and also for any window with a folder opened regardless of whether it\'s the last window. All windows without folders opened will be restored upon next launch. To restore folder windows as they were before shutdown set "window.restoreWindows" to "all".') ], 'description': nls.localize('hotExit', "Controls whether unsaved files are remembered between sessions, allowing the save prompt when exiting the editor to be skipped.", HotExitConfiguration.ON_EXIT, HotExitConfiguration.ON_EXIT_AND_WINDOW_CLOSE) }, + 'files.useExperimentalFileWatcher': { + 'type': 'boolean', + 'default': false, + 'description': nls.localize('useExperimentalFileWatcher', "Use the new experimental file watcher.") + }, 'files.defaultLanguage': { 'type': 'string', 'description': nls.localize('defaultLanguage', "The default language mode that is assigned to new files.") diff --git a/src/vs/workbench/parts/files/browser/saveErrorHandler.ts b/src/vs/workbench/parts/files/browser/saveErrorHandler.ts index dca5ccb26c18678ae6a905fd655f7031133ff6f2..a4e45da21d89d1affac8119807f766f5f8d82eb5 100644 --- a/src/vs/workbench/parts/files/browser/saveErrorHandler.ts +++ b/src/vs/workbench/parts/files/browser/saveErrorHandler.ts @@ -23,7 +23,7 @@ import { IModelService } from 'vs/editor/common/services/modelService'; import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { IWorkbenchContribution } from 'vs/workbench/common/contributions'; import { TextFileEditorModel } from 'vs/workbench/services/textfile/common/textFileEditorModel'; -import { ITextModelResolverService, ITextModelContentProvider } from 'vs/editor/common/services/resolverService'; +import { ITextModelService, ITextModelContentProvider } from 'vs/editor/common/services/resolverService'; import { IModel } from 'vs/editor/common/editorCommon'; import { ResourceMap } from 'vs/base/common/map'; import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService'; @@ -43,7 +43,7 @@ export class SaveErrorHandler implements ISaveErrorHandler, IWorkbenchContributi constructor( @IMessageService private messageService: IMessageService, @ITextFileService private textFileService: ITextFileService, - @ITextModelResolverService private textModelResolverService: ITextModelResolverService, + @ITextModelService private textModelResolverService: ITextModelService, @IModelService private modelService: IModelService, @IModeService private modeService: IModeService, @IInstantiationService private instantiationService: IInstantiationService, @@ -240,7 +240,7 @@ class ResolveSaveConflictMessage implements IMessageWithAction { export const acceptLocalChangesCommand = (accessor: ServicesAccessor, resource: URI) => { const editorService = accessor.get(IWorkbenchEditorService); - const resolverService = accessor.get(ITextModelResolverService); + const resolverService = accessor.get(ITextModelService); const editor = editorService.getActiveEditor(); const input = editor.input; @@ -275,7 +275,7 @@ export const acceptLocalChangesCommand = (accessor: ServicesAccessor, resource: export const revertLocalChangesCommand = (accessor: ServicesAccessor, resource: URI) => { const editorService = accessor.get(IWorkbenchEditorService); - const resolverService = accessor.get(ITextModelResolverService); + const resolverService = accessor.get(ITextModelService); const editor = editorService.getActiveEditor(); const input = editor.input; @@ -298,4 +298,4 @@ export const revertLocalChangesCommand = (accessor: ServicesAccessor, resource: }); }); }); -}; \ No newline at end of file +}; diff --git a/src/vs/workbench/parts/files/browser/views/emptyView.ts b/src/vs/workbench/parts/files/browser/views/emptyView.ts index de505174be18671980ec862f02341a3ca9a8bf20..d12878eeb73614e93275c67c5bac0b4b3383404e 100644 --- a/src/vs/workbench/parts/files/browser/views/emptyView.ts +++ b/src/vs/workbench/parts/files/browser/views/emptyView.ts @@ -9,41 +9,39 @@ import * as errors from 'vs/base/common/errors'; import env = require('vs/base/common/platform'); import DOM = require('vs/base/browser/dom'); import { TPromise } from 'vs/base/common/winjs.base'; -import { IActionRunner, IAction } from 'vs/base/common/actions'; +import { IAction } from 'vs/base/common/actions'; import { Button } from 'vs/base/browser/ui/button/button'; import { $ } from 'vs/base/browser/builder'; import { IActionItem } from 'vs/base/browser/ui/actionbar/actionbar'; -import { CollapsibleView, CollapsibleState } from 'vs/base/browser/ui/splitview/splitview'; +import { CollapsibleView, IViewletViewOptions, IViewOptions } from 'vs/workbench/parts/views/browser/views'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { OpenFolderAction, OpenFileFolderAction } from 'vs/workbench/browser/actions/fileActions'; import { attachButtonStyler } from 'vs/platform/theme/common/styler'; import { IThemeService } from 'vs/platform/theme/common/themeService'; -import { IViewOptions } from 'vs/workbench/parts/views/browser/views'; +import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; +import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; +import { ViewSizing } from 'vs/base/browser/ui/splitview/splitview'; export class EmptyView extends CollapsibleView { public static ID: string = 'workbench.explorer.emptyView'; - - public readonly id: string = EmptyView.ID; + public static NAME = nls.localize('noWorkspace', "No Folder Opened"); private openFolderButton: Button; - private actionRunner: IActionRunner; + constructor( - options: IViewOptions, + options: IViewletViewOptions, @IThemeService private themeService: IThemeService, - @IInstantiationService private instantiationService: IInstantiationService + @IInstantiationService private instantiationService: IInstantiationService, + @IKeybindingService keybindingService: IKeybindingService, + @IContextMenuService contextMenuService: IContextMenuService ) { - super({ - minimumSize: 5 * 22, - ariaHeaderLabel: nls.localize('explorerSection', "Files Explorer Section"), - initialState: options.collapsed ? CollapsibleState.COLLAPSED : CollapsibleState.EXPANDED - }); - this.actionRunner = options.actionRunner; + super({ ...(options as IViewOptions), ariaHeaderLabel: nls.localize('explorerSection', "Files Explorer Section"), sizing: ViewSizing.Flexible }, keybindingService, contextMenuService); } public renderHeader(container: HTMLElement): void { let titleDiv = $('div.title').appendTo(container); - $('span').text(nls.localize('noWorkspace', "No Folder Opened")).appendTo(titleDiv); + $('span').text(this.name).appendTo(titleDiv); } protected renderBody(container: HTMLElement): void { @@ -69,7 +67,7 @@ export class EmptyView extends CollapsibleView { }); } - protected layoutBody(size: number): void { + layoutBody(size: number): void { // no-op } diff --git a/src/vs/workbench/parts/files/browser/views/explorerView.ts b/src/vs/workbench/parts/files/browser/views/explorerView.ts index 5895751dd8b3bc1f96642a15ed328e7768420079..4b1e9ddf71632ecd784e740218d1eeb00661a6b7 100644 --- a/src/vs/workbench/parts/files/browser/views/explorerView.ts +++ b/src/vs/workbench/parts/files/browser/views/explorerView.ts @@ -13,20 +13,21 @@ import errors = require('vs/base/common/errors'); import labels = require('vs/base/common/labels'); import paths = require('vs/base/common/paths'); import { Action, IAction } from 'vs/base/common/actions'; -import { prepareActions } from 'vs/workbench/browser/actionBarRegistry'; +import { prepareActions } from 'vs/workbench/browser/actions'; +import { memoize } from 'vs/base/common/decorators'; import { ITree } from 'vs/base/parts/tree/browser/tree'; import { Tree } from 'vs/base/parts/tree/browser/treeImpl'; import { IFilesConfiguration, ExplorerFolderContext, FilesExplorerFocussedContext, ExplorerFocussedContext } from 'vs/workbench/parts/files/common/files'; -import { FileOperation, FileOperationEvent, IResolveFileOptions, FileChangeType, FileChangesEvent, IFileChange, IFileService, isEqualOrParent } from 'vs/platform/files/common/files'; +import { FileOperation, FileOperationEvent, IResolveFileOptions, FileChangeType, FileChangesEvent, IFileChange, IFileService } from 'vs/platform/files/common/files'; import { RefreshViewExplorerAction, NewFolderAction, NewFileAction } from 'vs/workbench/parts/files/browser/fileActions'; import { FileDragAndDrop, FileFilter, FileSorter, FileController, FileRenderer, FileDataSource, FileViewletState, FileAccessibilityProvider } from 'vs/workbench/parts/files/browser/views/explorerViewer'; import { toResource } from 'vs/workbench/common/editor'; import { DiffEditorInput } from 'vs/workbench/common/editor/diffEditorInput'; -import { UntitledEditorInput } from 'vs/workbench/common/editor/untitledEditorInput'; import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService'; import * as DOM from 'vs/base/browser/dom'; -import { CollapseAction, CollapsibleViewletView } from 'vs/workbench/browser/viewlet'; -import { FileStat } from 'vs/workbench/parts/files/common/explorerViewModel'; +import { CollapseAction } from 'vs/workbench/browser/viewlet'; +import { CollapsibleView, IViewletViewOptions, IViewOptions } from 'vs/workbench/parts/views/browser/views'; +import { FileStat, Model } from 'vs/workbench/parts/files/common/explorerModel'; import { IListService } from 'vs/platform/list/browser/listService'; import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IPartService } from 'vs/workbench/services/part/common/partService'; @@ -43,9 +44,13 @@ import { IWorkbenchThemeService, IFileIconTheme } from 'vs/workbench/services/th import { isLinux } from 'vs/base/common/platform'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import { attachListStyler } from 'vs/platform/theme/common/styler'; -import { IViewOptions } from 'vs/workbench/parts/views/browser/views'; +import { ViewSizing } from 'vs/base/browser/ui/splitview/splitview'; -export class ExplorerView extends CollapsibleViewletView { +export interface IExplorerViewOptions extends IViewletViewOptions { + viewletState: FileViewletState; +} + +export class ExplorerView extends CollapsibleView { public static ID: string = 'workbench.explorer.fileView'; private static EXPLORER_FILE_CHANGES_REACT_DELAY = 500; // delay in ms to react to file changes to give our internal events a chance to react first @@ -79,11 +84,8 @@ export class ExplorerView extends CollapsibleViewletView { private settings: any; constructor( - viewletState: FileViewletState, - options: IViewOptions, - settings: any, - headerSize: number, - @IMessageService messageService: IMessageService, + options: IExplorerViewOptions, + @IMessageService private messageService: IMessageService, @IContextMenuService contextMenuService: IContextMenuService, @IInstantiationService private instantiationService: IInstantiationService, @IEditorGroupService private editorGroupService: IEditorGroupService, @@ -99,10 +101,10 @@ export class ExplorerView extends CollapsibleViewletView { @IWorkbenchThemeService private themeService: IWorkbenchThemeService, @IEnvironmentService private environmentService: IEnvironmentService ) { - super(options.actionRunner, options.collapsed, nls.localize('explorerSection', "Files Explorer Section"), messageService, keybindingService, contextMenuService, headerSize); + super({ ...(options as IViewOptions), ariaHeaderLabel: nls.localize('explorerSection', "Files Explorer Section"), sizing: ViewSizing.Flexible }, keybindingService, contextMenuService); - this.settings = settings; - this.viewletState = viewletState; + this.settings = options.viewletSettings; + this.viewletState = options.viewletState; this.actionRunner = options.actionRunner; this.autoReveal = true; @@ -118,7 +120,14 @@ export class ExplorerView extends CollapsibleViewletView { public renderHeader(container: HTMLElement): void { const titleDiv = $('div.title').appendTo(container); - $('span').text(this.contextService.getWorkspace().name).title(labels.getPathLabel(this.contextService.getWorkspace().resource.fsPath, void 0, this.environmentService)).appendTo(titleDiv); + const titleSpan = $('span').appendTo(titleDiv); + const setHeader = () => { + const roots = this.contextService.getWorkspace2().roots; + const title = roots.map(root => labels.getPathLabel(root.fsPath, void 0, this.environmentService)).join(); + titleSpan.text(roots.length === 1 ? this.name : nls.localize('folders', "Folders")).title(title); + }; + this.toDispose.push(this.contextService.onDidChangeWorkspaceRoots(() => setHeader())); + setHeader(); super.renderHeader(container); } @@ -131,7 +140,7 @@ export class ExplorerView extends CollapsibleViewletView { this.tree = this.createViewer($(this.treeContainer)); if (this.toolBar) { - this.toolBar.setActions(prepareActions(this.getActions()), [])(); + this.toolBar.setActions(prepareActions(this.getActions()), this.getSecondaryActions())(); } const onFileIconThemeChange = (fileIconTheme: IFileIconTheme) => { @@ -139,6 +148,7 @@ export class ExplorerView extends CollapsibleViewletView { }; this.toDispose.push(this.themeService.onDidFileIconThemeChange(onFileIconThemeChange)); + this.toDispose.push(this.contextService.onDidChangeWorkspaceRoots(() => this.refreshFromEvent())); onFileIconThemeChange(this.themeService.getFileIconTheme()); } @@ -172,7 +182,7 @@ export class ExplorerView extends CollapsibleViewletView { this.toDispose.push(this.editorGroupService.onEditorsChanged(() => this.onEditorsChanged())); // Also handle configuration updates - this.toDispose.push(this.configurationService.onDidUpdateConfiguration(e => this.onConfigurationUpdated(e.config, true))); + this.toDispose.push(this.configurationService.onDidUpdateConfiguration(e => this.onConfigurationUpdated(this.configurationService.getConfiguration(), true))); }); } @@ -192,7 +202,7 @@ export class ExplorerView extends CollapsibleViewletView { this.settings[ExplorerView.MEMENTO_LAST_ACTIVE_FILE_RESOURCE] = activeFile.toString(); // Select file if input is inside workspace - if (this.isVisible && this.contextService.isInsideWorkspace(activeFile)) { + if (this.isVisible() && this.contextService.isInsideWorkspace(activeFile)) { const selection = this.hasSelection(activeFile); if (!selection) { this.select(activeFile).done(null, errors.onUnexpectedError); @@ -204,7 +214,7 @@ export class ExplorerView extends CollapsibleViewletView { // Handle closed or untitled file (convince explorer to not reopen any file when getting visible) const activeInput = this.editorService.getActiveEditorInput(); - if (activeInput instanceof UntitledEditorInput || !activeInput) { + if (!activeInput || toResource(activeInput, { supportSideBySide: true, filter: 'untitled' })) { this.settings[ExplorerView.MEMENTO_LAST_ACTIVE_FILE_RESOURCE] = void 0; clearFocus = true; } @@ -229,7 +239,7 @@ export class ExplorerView extends CollapsibleViewletView { // Push down config updates to components of viewer let needsRefresh = false; if (this.filter) { - needsRefresh = this.filter.updateConfiguration(configuration); + needsRefresh = this.filter.updateConfiguration(); } // Refresh viewer as needed @@ -299,7 +309,7 @@ export class ExplorerView extends CollapsibleViewletView { lastActiveFileResource = URI.parse(this.settings[ExplorerView.MEMENTO_LAST_ACTIVE_FILE_RESOURCE]); } - if (lastActiveFileResource && this.root && this.root.find(lastActiveFileResource)) { + if (lastActiveFileResource && this.isCreated && this.model.findFirst(lastActiveFileResource)) { this.editorService.openEditor({ resource: lastActiveFileResource, options: { revealIfVisible: true } }).done(null, errors.onUnexpectedError); return refreshPromise; @@ -333,8 +343,13 @@ export class ExplorerView extends CollapsibleViewletView { return toResource(input, { supportSideBySide: true, filter: 'file' }); } - private get root(): FileStat { - return this.explorerViewer ? (this.explorerViewer.getInput()) : null; + private get isCreated(): boolean { + return !!(this.explorerViewer && this.explorerViewer.getInput()); + } + + @memoize + private get model(): Model { + return this.instantiationService.createInstance(Model); } public createViewer(container: Builder): ITree { @@ -404,36 +419,40 @@ export class ExplorerView extends CollapsibleViewletView { } private onFileOperation(e: FileOperationEvent): void { - if (!this.root) { + if (!this.isCreated) { return; // ignore if not yet created } - let modelElement: FileStat; - let parent: FileStat; - let parentResource: URI; - let parentElement: FileStat; - // Add if (e.operation === FileOperation.CREATE || e.operation === FileOperation.IMPORT || e.operation === FileOperation.COPY) { const addedElement = e.target; - parentResource = URI.file(paths.dirname(addedElement.resource.fsPath)); - parentElement = this.root.find(parentResource); + const parentResource = URI.file(paths.dirname(addedElement.resource.fsPath)); + const parents = this.model.findAll(parentResource); - if (parentElement) { + if (parents.length) { // Add the new file to its parent (Model) - const childElement = FileStat.create(addedElement); - parentElement.removeChild(childElement); // make sure to remove any previous version of the file if any - parentElement.addChild(childElement); - - // Refresh the Parent (View) - this.explorerViewer.refresh(parentElement).then(() => { - return this.reveal(childElement, 0.5).then(() => { - - // Focus new element - this.explorerViewer.setFocus(childElement); + parents.forEach(p => { + // We have to check if the parent is resolved #29177 + (p.isDirectoryResolved ? TPromise.as(null) : this.fileService.resolveFile(p.resource)).then(stat => { + if (stat) { + const modelStat = FileStat.create(stat, p.root); + FileStat.mergeLocalWithDisk(modelStat, p); + } + + const childElement = FileStat.create(addedElement, p.root); + p.removeChild(childElement); // make sure to remove any previous version of the file if any + p.addChild(childElement); + // Refresh the Parent (View) + this.explorerViewer.refresh(p).then(() => { + return this.reveal(childElement, 0.5).then(() => { + + // Focus new element + this.explorerViewer.setFocus(childElement); + }); + }).done(null, errors.onUnexpectedError); }); - }).done(null, errors.onUnexpectedError); + }); } } @@ -454,43 +473,39 @@ export class ExplorerView extends CollapsibleViewletView { // Handle Rename if (oldParentResource && newParentResource && oldParentResource.toString() === newParentResource.toString()) { - modelElement = this.root.find(oldResource); - if (modelElement) { - + const modelElements = this.model.findAll(oldResource); + modelElements.forEach(modelElement => { // Rename File (Model) modelElement.rename(newElement); // Update Parent (View) - parent = modelElement.parent; - if (parent) { - this.explorerViewer.refresh(parent).done(() => { - - // Select in Viewer if set - if (restoreFocus) { - this.explorerViewer.setFocus(modelElement); - } - }, errors.onUnexpectedError); - } - } + this.explorerViewer.refresh(modelElement.parent).done(() => { + + // Select in Viewer if set + if (restoreFocus) { + this.explorerViewer.setFocus(modelElement); + } + }, errors.onUnexpectedError); + }); } // Handle Move else if (oldParentResource && newParentResource) { - const oldParent = this.root.find(oldParentResource); - const newParent = this.root.find(newParentResource); - modelElement = this.root.find(oldResource); + const newParents = this.model.findAll(newParentResource); + const modelElements = this.model.findAll(oldResource); - if (oldParent && newParent && modelElement) { + if (newParents.length && modelElements.length) { // Move in Model - modelElement.move(newParent, (callback: () => void) => { - - // Update old parent - this.explorerViewer.refresh(oldParent, true).done(callback, errors.onUnexpectedError); - }, () => { - - // Update new parent - this.explorerViewer.refresh(newParent, true).done(() => this.explorerViewer.expand(newParent), errors.onUnexpectedError); + modelElements.forEach((modelElement, index) => { + const oldParent = modelElement.parent; + modelElement.move(newParents[index], (callback: () => void) => { + // Update old parent + this.explorerViewer.refresh(oldParent).done(callback, errors.onUnexpectedError); + }, () => { + // Update new parent + this.explorerViewer.refresh(newParents[index], true).done(() => this.explorerViewer.expand(newParents[index]), errors.onUnexpectedError); + }); }); } } @@ -498,23 +513,24 @@ export class ExplorerView extends CollapsibleViewletView { // Delete else if (e.operation === FileOperation.DELETE) { - modelElement = this.root.find(e.resource); - if (modelElement && modelElement.parent) { - parent = modelElement.parent; - - // Remove Element from Parent (Model) - parent.removeChild(modelElement); - - // Refresh Parent (View) - const restoreFocus = this.explorerViewer.isDOMFocused(); - this.explorerViewer.refresh(parent).done(() => { - - // Ensure viewer has keyboard focus if event originates from viewer - if (restoreFocus) { - this.explorerViewer.DOMFocus(); - } - }, errors.onUnexpectedError); - } + const modelElements = this.model.findAll(e.resource); + modelElements.forEach(element => { + if (element.parent) { + const parent = element.parent; + // Remove Element from Parent (Model) + parent.removeChild(element); + + // Refresh Parent (View) + const restoreFocus = this.explorerViewer.isDOMFocused(); + this.explorerViewer.refresh(parent).done(() => { + + // Ensure viewer has keyboard focus if event originates from viewer + if (restoreFocus) { + this.explorerViewer.DOMFocus(); + } + }, errors.onUnexpectedError); + } + }); } } @@ -560,7 +576,7 @@ export class ExplorerView extends CollapsibleViewletView { const added = e.getAdded(); const deleted = e.getDeleted(); - if (!this.root) { + if (!this.isCreated) { return false; } @@ -581,8 +597,8 @@ export class ExplorerView extends CollapsibleViewletView { } // Compute if parent is visible and added file not yet part of it - const parentStat = this.root.find(URI.file(parent)); - if (parentStat && parentStat.isDirectoryResolved && !this.root.find(change.resource)) { + const parentStat = this.model.findFirst(URI.file(parent)); + if (parentStat && parentStat.isDirectoryResolved && !this.model.findFirst(change.resource)) { return true; } @@ -599,7 +615,7 @@ export class ExplorerView extends CollapsibleViewletView { continue; // out of workspace file } - if (this.root.find(del.resource)) { + if (this.model.findFirst(del.resource)) { return true; } } @@ -626,7 +642,7 @@ export class ExplorerView extends CollapsibleViewletView { } private refreshFromEvent(): void { - if (this.isVisible) { + if (this.isVisible()) { this.explorerRefreshDelayer.trigger(() => { if (!this.explorerViewer.getHighlight()) { return this.doRefresh(); @@ -672,7 +688,11 @@ export class ExplorerView extends CollapsibleViewletView { } private doRefresh(): TPromise { - const targetsToResolve: URI[] = []; + const targetsToResolve: { root: FileStat, resource: URI, options: { resolveTo: URI[] } }[] = []; + this.model.roots.forEach(root => { + const rootAndTargets = { root, resource: root.resource, options: { resolveTo: [] } }; + targetsToResolve.push(rootAndTargets); + }); let targetsToExpand: URI[] = []; if (this.settings[ExplorerView.MEMENTO_EXPANDED_FOLDER_RESOURCES]) { @@ -680,51 +700,55 @@ export class ExplorerView extends CollapsibleViewletView { } // First time refresh: Receive target through active editor input or selection and also include settings from previous session - if (!this.root) { + if (!this.isCreated) { const activeFile = this.getActiveFile(); if (activeFile) { - targetsToResolve.push(activeFile); + const root = this.contextService.getRoot(activeFile); + if (root) { + const found = targetsToResolve.filter(t => t.root.resource.toString() === root.toString()).pop(); + found.options.resolveTo.push(activeFile); + } } - if (targetsToExpand.length) { - targetsToResolve.push(...targetsToExpand); - } + targetsToExpand.forEach(toExpand => { + const root = this.contextService.getRoot(toExpand); + if (root) { + const found = targetsToResolve.filter(ttr => ttr.resource.toString() === root.toString()).pop(); + found.options.resolveTo.push(toExpand); + } + }); } // Subsequent refresh: Receive targets through expanded folders in tree else { - this.getResolvedDirectories(this.root, targetsToResolve); + targetsToResolve.forEach(t => { + this.getResolvedDirectories(t.root, t.options.resolveTo); + }); } // Load Root Stat with given target path configured - const options: IResolveFileOptions = { resolveTo: targetsToResolve }; - const promise = this.fileService.resolveFile(this.contextService.getWorkspace().resource, options).then(stat => { - let explorerPromise: TPromise; - + const promise = this.fileService.resolveFiles(targetsToResolve).then(stats => { // Convert to model - const modelStat = FileStat.create(stat, options.resolveTo); - - // First time refresh: The stat becomes the input of the viewer - if (!this.root) { - explorerPromise = this.explorerViewer.setInput(modelStat).then(() => { - - // Make sure to expand all folders that where expanded in the previous session - if (targetsToExpand) { - return this.explorerViewer.expandAll(targetsToExpand.map(expand => this.root.find(expand))); - } + const modelStats = stats.map((stat, index) => FileStat.create(stat, targetsToResolve[index].root, targetsToResolve[index].options.resolveTo)); + // Subsequent refresh: Merge stat into our local model and refresh tree + modelStats.forEach((modelStat, index) => FileStat.mergeLocalWithDisk(modelStat, this.model.roots[index])); - return TPromise.as(null); - }); + const input = this.model.roots.length === 1 ? this.model.roots[0] : this.model; + if (input === this.explorerViewer.getInput()) { + return this.explorerViewer.refresh(); } - // Subsequent refresh: Merge stat into our local model and refresh tree - else { - FileStat.mergeLocalWithDisk(modelStat, this.root); + // First time refresh: The stat becomes the input of the viewer + // Display roots only when there is more than 1 root + return this.explorerViewer.setInput(input).then(() => { - explorerPromise = this.explorerViewer.refresh(this.root); - } + // Make sure to expand all folders that where expanded in the previous session + if (targetsToExpand) { + return this.explorerViewer.expandAll(targetsToExpand.map(expand => this.model.findFirst(expand))); + } - return explorerPromise; + return TPromise.as(null); + }); }, (e: any) => TPromise.wrapError(e)); this.progressService.showWhile(promise, this.partService.isCreated() ? 800 : 3200 /* less ugly initial startup */); @@ -737,12 +761,12 @@ export class ExplorerView extends CollapsibleViewletView { */ private getResolvedDirectories(stat: FileStat, resolvedDirectories: URI[]): void { if (stat.isDirectoryResolved) { - if (stat.resource.toString() !== this.contextService.getWorkspace().resource.toString()) { + if (!stat.isRoot) { // Drop those path which are parents of the current one for (let i = resolvedDirectories.length - 1; i >= 0; i--) { const resource = resolvedDirectories[i]; - if (isEqualOrParent(stat.resource.fsPath, resource.fsPath, !isLinux /* ignorecase */)) { + if (paths.isEqualOrParent(stat.resource.fsPath, resource.fsPath, !isLinux /* ignorecase */)) { resolvedDirectories.splice(i); } } @@ -766,7 +790,7 @@ export class ExplorerView extends CollapsibleViewletView { public select(resource: URI, reveal: boolean = this.autoReveal): TPromise { // Require valid path - if (!resource || resource.toString() === this.contextService.getWorkspace().resource.toString()) { + if (!resource) { return TPromise.as(null); } @@ -777,27 +801,28 @@ export class ExplorerView extends CollapsibleViewletView { } // First try to get the stat object from the input to avoid a roundtrip - if (!this.root) { + if (!this.isCreated) { return TPromise.as(null); } - const fileStat = this.root.find(resource); + const fileStat = this.model.findFirst(resource); if (fileStat) { return this.doSelect(fileStat, reveal); } // Stat needs to be resolved first and then revealed const options: IResolveFileOptions = { resolveTo: [resource] }; - return this.fileService.resolveFile(this.contextService.getWorkspace().resource, options).then(stat => { + const rootUri = this.contextService.getRoot(resource) || this.model.roots[0].resource; + return this.fileService.resolveFile(rootUri, options).then(stat => { // Convert to model - const modelStat = FileStat.create(stat, options.resolveTo); - + const root = this.model.roots.filter(r => r.resource.toString() === rootUri.toString()).pop(); + const modelStat = FileStat.create(stat, root, options.resolveTo); // Update Input with disk Stat - FileStat.mergeLocalWithDisk(modelStat, this.root); + FileStat.mergeLocalWithDisk(modelStat, root); // Select and Reveal - return this.explorerViewer.refresh(this.root).then(() => this.doSelect(this.root.find(resource), reveal)); + return this.explorerViewer.refresh(root).then(() => this.doSelect(root.find(resource), reveal)); }, (e: any) => this.messageService.show(Severity.Error, e)); } @@ -848,12 +873,21 @@ export class ExplorerView extends CollapsibleViewletView { public shutdown(): void { // Keep list of expanded folders to restore on next load - if (this.root) { + if (this.isCreated) { const expanded = this.explorerViewer.getExpandedElements() - .filter((e: FileStat) => e.resource.toString() !== this.contextService.getWorkspace().resource.toString()) + .filter(e => e instanceof FileStat) .map((e: FileStat) => e.resource.toString()); - this.settings[ExplorerView.MEMENTO_EXPANDED_FOLDER_RESOURCES] = expanded; + if (expanded.length) { + this.settings[ExplorerView.MEMENTO_EXPANDED_FOLDER_RESOURCES] = expanded; + } else { + delete this.settings[ExplorerView.MEMENTO_EXPANDED_FOLDER_RESOURCES]; + } + } + + // Clean up last focussed if not set + if (!this.settings[ExplorerView.MEMENTO_LAST_ACTIVE_FILE_RESOURCE]) { + delete this.settings[ExplorerView.MEMENTO_LAST_ACTIVE_FILE_RESOURCE]; } super.shutdown(); diff --git a/src/vs/workbench/parts/files/browser/views/explorerViewer.ts b/src/vs/workbench/parts/files/browser/views/explorerViewer.ts index 4494835dff88f1a34a596c8b52c8d233930aa1c5..d31ba8ec2ff315e63453bec3c47a35826daee4a5 100644 --- a/src/vs/workbench/parts/files/browser/views/explorerViewer.ts +++ b/src/vs/workbench/parts/files/browser/views/explorerViewer.ts @@ -22,18 +22,17 @@ import { isMacintosh, isLinux } from 'vs/base/common/platform'; import glob = require('vs/base/common/glob'); import { FileLabel, IFileLabelOptions } from 'vs/workbench/browser/labels'; import { IDisposable } from 'vs/base/common/lifecycle'; -import { ContributableActionProvider } from 'vs/workbench/browser/actionBarRegistry'; +import { ContributableActionProvider } from 'vs/workbench/browser/actions'; import { IFilesConfiguration } from 'vs/workbench/parts/files/common/files'; import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; -import { IFileOperationResult, FileOperationResult, IFileService, isEqual, isEqualOrParent } from 'vs/platform/files/common/files'; +import { IFileOperationResult, FileOperationResult, IFileService } from 'vs/platform/files/common/files'; import { ResourceMap } from 'vs/base/common/map'; import { DuplicateFileAction, ImportFileAction, IEditableData, IFileViewletState } from 'vs/workbench/parts/files/browser/fileActions'; import { IDataSource, ITree, IAccessibilityProvider, IRenderer, ContextMenuEvent, ISorter, IFilter, IDragAndDrop, IDragAndDropData, IDragOverReaction, DRAG_OVER_ACCEPT_BUBBLE_DOWN, DRAG_OVER_ACCEPT_BUBBLE_DOWN_COPY, DRAG_OVER_ACCEPT_BUBBLE_UP, DRAG_OVER_ACCEPT_BUBBLE_UP_COPY, DRAG_OVER_REJECT } from 'vs/base/parts/tree/browser/tree'; import { DesktopDragAndDropData, ExternalElementsDragAndDropData } from 'vs/base/parts/tree/browser/treeDnd'; import { ClickBehavior, DefaultController } from 'vs/base/parts/tree/browser/treeDefaults'; -import { FileStat, NewStatPlaceholder } from 'vs/workbench/parts/files/common/explorerViewModel'; +import { FileStat, NewStatPlaceholder, Model } from 'vs/workbench/parts/files/common/explorerModel'; import { DragMouseEvent, IMouseEvent } from 'vs/base/browser/mouseEvent'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IPartService } from 'vs/workbench/services/part/common/partService'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; @@ -44,7 +43,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti import { IMessageService, IConfirmation, Severity } from 'vs/platform/message/common/message'; import { IProgressService } from 'vs/platform/progress/common/progress'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { ResolvedKeybinding, KeyCode } from 'vs/base/common/keyCodes'; +import { KeyCode } from 'vs/base/common/keyCodes'; import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent'; import { IMenuService, IMenu, MenuId } from 'vs/platform/actions/common/actions'; import { fillInActions } from 'vs/platform/actions/browser/menuItemActionItem'; @@ -61,15 +60,22 @@ export class FileDataSource implements IDataSource { @IWorkspaceContextService private contextService: IWorkspaceContextService ) { } - public getId(tree: ITree, stat: FileStat): string { - return stat.getId(); + public getId(tree: ITree, stat: FileStat | Model): string { + if (stat instanceof Model) { + return 'model'; + } + + return `${stat.root.resource.toString()}:${stat.getId()}`; } - public hasChildren(tree: ITree, stat: FileStat): boolean { - return stat.isDirectory; + public hasChildren(tree: ITree, stat: FileStat | Model): boolean { + return stat instanceof Model || (stat instanceof FileStat && stat.isDirectory); } - public getChildren(tree: ITree, stat: FileStat): TPromise { + public getChildren(tree: ITree, stat: FileStat | Model): TPromise { + if (stat instanceof Model) { + return TPromise.as(stat.roots); + } // Return early if stat is already resolved if (stat.isDirectoryResolved) { @@ -83,7 +89,7 @@ export class FileDataSource implements IDataSource { const promise = this.fileService.resolveFile(stat.resource, { resolveSingleChildDescendants: true }).then(dirStat => { // Convert to view model - const modelDirStat = FileStat.create(dirStat); + const modelDirStat = FileStat.create(dirStat, stat.root); // Add children to folder for (let i = 0; i < modelDirStat.children.length; i++) { @@ -105,19 +111,18 @@ export class FileDataSource implements IDataSource { } } - public getParent(tree: ITree, stat: FileStat): TPromise { + public getParent(tree: ITree, stat: FileStat | Model): TPromise { if (!stat) { return TPromise.as(null); // can be null if nothing selected in the tree } // Return if root reached - const workspace = this.contextService.getWorkspace(); - if (workspace && stat.resource.toString() === workspace.resource.toString()) { + if (tree.getInput() === stat) { return TPromise.as(null); } // Return if parent already resolved - if (stat.parent) { + if (stat instanceof FileStat && stat.parent) { return TPromise.as(stat.parent); } @@ -153,7 +158,7 @@ export class FileActionProvider extends ContributableActionProvider { return super.getActions(tree, stat); } - public hasSecondaryActions(tree: ITree, stat: FileStat): boolean { + public hasSecondaryActions(tree: ITree, stat: FileStat | Model): boolean { if (stat instanceof NewStatPlaceholder) { return false; } @@ -161,7 +166,7 @@ export class FileActionProvider extends ContributableActionProvider { return super.hasSecondaryActions(tree, stat); } - public getSecondaryActions(tree: ITree, stat: FileStat): TPromise { + public getSecondaryActions(tree: ITree, stat: FileStat | Model): TPromise { if (stat instanceof NewStatPlaceholder) { return TPromise.as([]); } @@ -396,8 +401,7 @@ export class FileController extends DefaultController { @ITelemetryService private telemetryService: ITelemetryService, @IWorkspaceContextService private contextService: IWorkspaceContextService, @IMenuService menuService: IMenuService, - @IContextKeyService contextKeyService: IContextKeyService, - @IKeybindingService private keybindingService: IKeybindingService + @IContextKeyService contextKeyService: IContextKeyService ) { super({ clickBehavior: ClickBehavior.ON_MOUSE_UP /* do not change to not break DND */, keyboardSupport: false /* handled via IListService */ }); @@ -406,7 +410,7 @@ export class FileController extends DefaultController { this.state = state; } - public onLeftClick(tree: ITree, stat: FileStat, event: IMouseEvent, origin: string = 'mouse'): boolean { + public onLeftClick(tree: ITree, stat: FileStat | Model, event: IMouseEvent, origin: string = 'mouse'): boolean { const payload = { origin: origin }; const isDoubleClick = (origin === 'mouse' && event.detail === 2); @@ -423,8 +427,7 @@ export class FileController extends DefaultController { } // Handle root - const workspace = this.contextService.getWorkspace(); - if (workspace && stat.resource.toString() === workspace.resource.toString()) { + if (stat instanceof Model) { tree.clearFocus(payload); tree.clearSelection(payload); @@ -471,7 +474,7 @@ export class FileController extends DefaultController { return true; } - public onContextMenu(tree: ITree, stat: FileStat, event: ContextMenuEvent): boolean { + public onContextMenu(tree: ITree, stat: FileStat | Model, event: ContextMenuEvent): boolean { if (event.target && event.target.tagName && event.target.tagName.toLowerCase() === 'input') { return false; } @@ -490,12 +493,11 @@ export class FileController extends DefaultController { getAnchor: () => anchor, getActions: () => { return this.state.actionProvider.getSecondaryActions(tree, stat).then(actions => { - fillInActions(this.contributedContextMenu, { arg: stat.resource }, actions); + fillInActions(this.contributedContextMenu, stat instanceof FileStat ? { arg: stat.resource } : null, actions); return actions; }); }, getActionItem: this.state.actionProvider.getActionItem.bind(this.state.actionProvider, tree, stat), - getKeyBinding: (a): ResolvedKeybinding => this.keybindingService.lookupKeybinding(a.id), getActionsContext: (event) => { return { viewletState: this.state, @@ -542,6 +544,15 @@ export class FileSorter implements ISorter { return 1; } + // Do not sort roots + if (statA.isRoot) { + return -1; + } + + if (statB.isRoot) { + return 1; + } + return comparers.compareFileNames(statA.name, statB.name); } } @@ -551,17 +562,24 @@ export class FileFilter implements IFilter { private static MAX_SIBLINGS_FILTER_THRESHOLD = 2000; - private hiddenExpression: glob.IExpression; + private hiddenExpressionPerRoot: Map; - constructor( @IWorkspaceContextService private contextService: IWorkspaceContextService) { - this.hiddenExpression = Object.create(null); + constructor( + @IWorkspaceContextService private contextService: IWorkspaceContextService, + @IConfigurationService private configurationService: IConfigurationService + ) { + this.hiddenExpressionPerRoot = new Map(); + this.contextService.onDidChangeWorkspaceRoots(() => this.updateConfiguration()); } - public updateConfiguration(configuration: IFilesConfiguration): boolean { - const excludesConfig = (configuration && configuration.files && configuration.files.exclude) || Object.create(null); - const needsRefresh = !objects.equals(this.hiddenExpression, excludesConfig); - - this.hiddenExpression = objects.clone(excludesConfig); // do not keep the config, as it gets mutated under our hoods + public updateConfiguration(): boolean { + let needsRefresh = false; + this.contextService.getWorkspace2().roots.forEach(root => { + const configuration = this.configurationService.getConfiguration(undefined, { resource: root }); + const excludesConfig = (configuration && configuration.files && configuration.files.exclude) || Object.create(null); + needsRefresh = needsRefresh || !objects.equals(this.hiddenExpressionPerRoot.get(root.toString()), excludesConfig); + this.hiddenExpressionPerRoot.set(root.toString(), objects.clone(excludesConfig)); // do not keep the config, as it gets mutated under our hoods + }); return needsRefresh; } @@ -583,7 +601,8 @@ export class FileFilter implements IFilter { // Hide those that match Hidden Patterns const siblingsFn = () => siblings && siblings.map(c => c.name); - if (glob.match(this.hiddenExpression, this.contextService.toWorkspaceRelativePath(stat.resource, true), siblingsFn)) { + const expression = this.hiddenExpressionPerRoot.get(stat.root.resource.toString()) || Object.create(null); + if (glob.match(expression, paths.normalize(paths.relative(stat.root.resource.fsPath, stat.resource.fsPath)), siblingsFn)) { return false; // hidden through pattern } @@ -614,7 +633,7 @@ export class FileDragAndDrop implements IDragAndDrop { } private registerListeners(): void { - this.toDispose.push(this.configurationService.onDidUpdateConfiguration(e => this.onConfigurationUpdated(e.config))); + this.toDispose.push(this.configurationService.onDidUpdateConfiguration(e => this.onConfigurationUpdated(this.configurationService.getConfiguration()))); } private onConfigurationUpdated(config: IFilesConfiguration): void { @@ -622,6 +641,9 @@ export class FileDragAndDrop implements IDragAndDrop { } public getDragURI(tree: ITree, stat: FileStat): string { + if (this.contextService.getWorkspace2().roots.some(r => r.toString() === stat.resource.toString())) { + return null; // Can not move root folder + } if (stat.isDirectory) { return URI.from({ scheme: 'folder', path: stat.resource.fsPath }).toString(); // indicates that we are dragging a folder } @@ -659,8 +681,8 @@ export class FileDragAndDrop implements IDragAndDrop { } } - public onDragOver(tree: ITree, data: IDragAndDropData, target: FileStat, originalEvent: DragMouseEvent): IDragOverReaction { - if (!this.dropEnabled) { + public onDragOver(tree: ITree, data: IDragAndDropData, target: FileStat | Model, originalEvent: DragMouseEvent): IDragOverReaction { + if (!this.dropEnabled || target instanceof Model) { return DRAG_OVER_REJECT; } @@ -703,11 +725,11 @@ export class FileDragAndDrop implements IDragAndDrop { return true; // Can not move anything onto itself } - if (!isCopy && isEqual(paths.dirname(source.resource.fsPath), target.resource.fsPath)) { + if (!isCopy && paths.isEqual(paths.dirname(source.resource.fsPath), target.resource.fsPath)) { return true; // Can not move a file to the same parent unless we copy } - if (isEqualOrParent(target.resource.fsPath, source.resource.fsPath, !isLinux /* ignorecase */)) { + if (paths.isEqualOrParent(target.resource.fsPath, source.resource.fsPath, !isLinux /* ignorecase */)) { return true; // Can not move a parent folder into one of its children } @@ -722,8 +744,8 @@ export class FileDragAndDrop implements IDragAndDrop { return fromDesktop || isCopy ? DRAG_OVER_ACCEPT_BUBBLE_DOWN_COPY(true) : DRAG_OVER_ACCEPT_BUBBLE_DOWN(true); } - const workspace = this.contextService.getWorkspace(); - if (workspace && target.resource.toString() !== workspace.resource.toString()) { + const workspace = this.contextService.getWorkspace2(); + if (workspace && workspace.roots.every(r => r.toString() !== target.resource.toString())) { return fromDesktop || isCopy ? DRAG_OVER_ACCEPT_BUBBLE_UP_COPY : DRAG_OVER_ACCEPT_BUBBLE_UP; } @@ -769,12 +791,12 @@ export class FileDragAndDrop implements IDragAndDrop { }; // 1. check for dirty files that are being moved and backup to new target - const dirty = this.textFileService.getDirty().filter(d => isEqualOrParent(d.fsPath, source.resource.fsPath, !isLinux /* ignorecase */)); + const dirty = this.textFileService.getDirty().filter(d => paths.isEqualOrParent(d.fsPath, source.resource.fsPath, !isLinux /* ignorecase */)); return TPromise.join(dirty.map(d => { let moved: URI; // If the dirty file itself got moved, just reparent it to the target folder - if (isEqual(source.resource.fsPath, d.fsPath)) { + if (paths.isEqual(source.resource.fsPath, d.fsPath)) { moved = URI.file(paths.join(target.resource.fsPath, source.name)); } @@ -807,12 +829,13 @@ export class FileDragAndDrop implements IDragAndDrop { const confirm: IConfirmation = { message: nls.localize('confirmOverwriteMessage', "'{0}' already exists in the destination folder. Do you want to replace it?", source.name), detail: nls.localize('irreversible', "This action is irreversible!"), - primaryButton: nls.localize({ key: 'replaceButtonLabel', comment: ['&& denotes a mnemonic'] }, "&&Replace") + primaryButton: nls.localize({ key: 'replaceButtonLabel', comment: ['&& denotes a mnemonic'] }, "&&Replace"), + type: 'warning' }; // Move with overwrite if the user confirms if (this.messageService.confirm(confirm)) { - const targetDirty = this.textFileService.getDirty().filter(d => isEqualOrParent(d.fsPath, targetResource.fsPath, !isLinux /* ignorecase */)); + const targetDirty = this.textFileService.getDirty().filter(d => paths.isEqualOrParent(d.fsPath, targetResource.fsPath, !isLinux /* ignorecase */)); // Make sure to revert all dirty in target first to be able to overwrite properly return this.textFileService.revertAll(targetDirty, { soft: true /* do not attempt to load content from disk */ }).then(() => { diff --git a/src/vs/workbench/parts/files/browser/views/openEditorsView.ts b/src/vs/workbench/parts/files/browser/views/openEditorsView.ts index 4b3e4ee277887e4bd963ed8ac6ff61d677ec5091..f79852d17f21200ee264af3f8aa8569f7b8adb4b 100644 --- a/src/vs/workbench/parts/files/browser/views/openEditorsView.ts +++ b/src/vs/workbench/parts/files/browser/views/openEditorsView.ts @@ -7,9 +7,8 @@ import nls = require('vs/nls'); import errors = require('vs/base/common/errors'); import { RunOnceScheduler } from 'vs/base/common/async'; import { TPromise } from 'vs/base/common/winjs.base'; -import { IAction, IActionRunner } from 'vs/base/common/actions'; +import { IAction } from 'vs/base/common/actions'; import dom = require('vs/base/browser/dom'); -import { CollapsibleState } from 'vs/base/browser/ui/splitview/splitview'; import { Tree } from 'vs/base/parts/tree/browser/treeImpl'; import { IItemCollapseEvent } from 'vs/base/parts/tree/browser/treeModel'; import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; @@ -19,11 +18,11 @@ import { IConfigurationService } from 'vs/platform/configuration/common/configur import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { IEditorStacksModel, IStacksModelChangeEvent, IEditorGroup } from 'vs/workbench/common/editor'; import { SaveAllAction } from 'vs/workbench/parts/files/browser/fileActions'; -import { AdaptiveCollapsibleViewletView } from 'vs/workbench/browser/viewlet'; +import { CollapsibleView, IViewletViewOptions, IViewOptions } from 'vs/workbench/parts/views/browser/views'; import { IFilesConfiguration, VIEWLET_ID, OpenEditorsFocussedContext, ExplorerFocussedContext } from 'vs/workbench/parts/files/common/files'; import { ITextFileService, AutoSaveMode } from 'vs/workbench/services/textfile/common/textfiles'; import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; -import { OpenEditor } from 'vs/workbench/parts/files/common/explorerViewModel'; +import { OpenEditor } from 'vs/workbench/parts/files/common/explorerModel'; import { Renderer, DataSource, Controller, AccessibilityProvider, ActionProvider, DragAndDrop } from 'vs/workbench/parts/files/browser/views/openEditorsViewer'; import { IUntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService'; import { CloseAllEditorsAction } from 'vs/workbench/browser/parts/editor/editorActions'; @@ -33,19 +32,18 @@ import { IListService } from 'vs/platform/list/browser/listService'; import { EditorGroup } from 'vs/workbench/common/editor/editorStacksModel'; import { attachListStyler, attachStylerCallback } from 'vs/platform/theme/common/styler'; import { IThemeService } from 'vs/platform/theme/common/themeService'; -import { badgeBackground, badgeForeground, contrastBorder } from "vs/platform/theme/common/colorRegistry"; +import { badgeBackground, badgeForeground, contrastBorder } from 'vs/platform/theme/common/colorRegistry'; +import { ViewSizing } from 'vs/base/browser/ui/splitview/splitview'; const $ = dom.$; -export class OpenEditorsView extends AdaptiveCollapsibleViewletView { +export class OpenEditorsView extends CollapsibleView { - private static MEMENTO_COLLAPSED = 'openEditors.memento.collapsed'; private static DEFAULT_VISIBLE_OPEN_EDITORS = 9; private static DEFAULT_DYNAMIC_HEIGHT = true; + static ID = 'workbench.explorer.openEditorsView'; + static NAME = nls.localize({ key: 'openEditors', comment: ['Open is an adjective'] }, "Open Editors"); - readonly id: string = 'workbench.explorer.openEditorsView'; - - private settings: any; private visibleOpenEditors: number; private dynamicHeight: boolean; @@ -59,7 +57,7 @@ export class OpenEditorsView extends AdaptiveCollapsibleViewletView { private openEditorsFocussedContext: IContextKey; private explorerFocussedContext: IContextKey; - constructor(actionRunner: IActionRunner, settings: any, + constructor(options: IViewletViewOptions, @IInstantiationService private instantiationService: IInstantiationService, @IContextMenuService contextMenuService: IContextMenuService, @ITextFileService private textFileService: ITextFileService, @@ -72,9 +70,13 @@ export class OpenEditorsView extends AdaptiveCollapsibleViewletView { @IViewletService private viewletService: IViewletService, @IThemeService private themeService: IThemeService ) { - super(actionRunner, OpenEditorsView.computeExpandedBodySize(editorGroupService.getStacksModel()), !!settings[OpenEditorsView.MEMENTO_COLLAPSED], nls.localize({ key: 'openEditosrSection', comment: ['Open is an adjective'] }, "Open Editors Section"), keybindingService, contextMenuService); + super({ + ...(options as IViewOptions), + ariaHeaderLabel: nls.localize({ key: 'openEditosrSection', comment: ['Open is an adjective'] }, "Open Editors Section"), + sizing: ViewSizing.Fixed, + initialBodySize: OpenEditorsView.computeExpandedBodySize(editorGroupService.getStacksModel()) + }, keybindingService, contextMenuService); - this.settings = settings; this.model = editorGroupService.getStacksModel(); this.openEditorsFocussedContext = OpenEditorsFocussedContext.bindTo(contextKeyService); @@ -87,7 +89,7 @@ export class OpenEditorsView extends AdaptiveCollapsibleViewletView { public renderHeader(container: HTMLElement): void { const titleDiv = dom.append(container, $('.title')); const titleSpan = dom.append(titleDiv, $('span')); - titleSpan.textContent = nls.localize({ key: 'openEditors', comment: ['Open is an adjective'] }, "Open Editors"); + titleSpan.textContent = this.name; this.dirtyCountElement = dom.append(titleDiv, $('.monaco-count-badge')); @@ -185,7 +187,7 @@ export class OpenEditorsView extends AdaptiveCollapsibleViewletView { this.toDispose.push(this.model.onModelChanged(e => this.onEditorStacksModelChanged(e))); // Also handle configuration updates - this.toDispose.push(this.configurationService.onDidUpdateConfiguration(e => this.onConfigurationUpdated(e.config))); + this.toDispose.push(this.configurationService.onDidUpdateConfiguration(e => this.onConfigurationUpdated(this.configurationService.getConfiguration()))); // Handle dirty counter this.toDispose.push(this.untitledEditorService.onDidChangeDirty(e => this.updateDirtyIndicator())); @@ -205,7 +207,7 @@ export class OpenEditorsView extends AdaptiveCollapsibleViewletView { } private onEditorStacksModelChanged(e: IStacksModelChangeEvent): void { - if (this.isDisposed || !this.isVisible || !this.tree) { + if (this.isDisposed || !this.isVisible() || !this.tree) { return; } @@ -227,7 +229,7 @@ export class OpenEditorsView extends AdaptiveCollapsibleViewletView { private structuralTreeUpdate(): void { // View size - this.expandedBodySize = this.getExpandedBodySize(this.model); + this.setBodySize(this.getExpandedBodySize(this.model)); // Show groups only if there is more than 1 group const treeInput = this.model.groups.length === 1 ? this.model.groups[0] : this.model; // TODO@Isidor temporary workaround due to a partial tree refresh issue @@ -281,7 +283,7 @@ export class OpenEditorsView extends AdaptiveCollapsibleViewletView { } // Adjust expanded body size - this.expandedBodySize = this.getExpandedBodySize(this.model); + this.setBodySize(this.getExpandedBodySize(this.model)); } private updateDirtyIndicator(): void { @@ -326,10 +328,4 @@ export class OpenEditorsView extends AdaptiveCollapsibleViewletView { return dom.getLargestChildWidth(parentNode, childNodes); } - - public shutdown(): void { - this.settings[OpenEditorsView.MEMENTO_COLLAPSED] = (this.state === CollapsibleState.COLLAPSED); - - super.shutdown(); - } } diff --git a/src/vs/workbench/parts/files/browser/views/openEditorsViewer.ts b/src/vs/workbench/parts/files/browser/views/openEditorsViewer.ts index e662f47ce91efece4947ffd27254a7c63469eb48..432e5922ac3c002d1d8ed31dc14455533ddf5d73 100644 --- a/src/vs/workbench/parts/files/browser/views/openEditorsViewer.ts +++ b/src/vs/workbench/parts/files/browser/views/openEditorsViewer.ts @@ -22,15 +22,15 @@ import { IEditorGroupService } from 'vs/workbench/services/group/common/groupSer import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { IEditorGroup, IEditorStacksModel } from 'vs/workbench/common/editor'; -import { OpenEditor } from 'vs/workbench/parts/files/common/explorerViewModel'; -import { ContributableActionProvider } from 'vs/workbench/browser/actionBarRegistry'; +import { OpenEditor } from 'vs/workbench/parts/files/common/explorerModel'; +import { ContributableActionProvider } from 'vs/workbench/browser/actions'; import { explorerItemToFileResource } from 'vs/workbench/parts/files/common/files'; import { ITextFileService, AutoSaveMode } from 'vs/workbench/services/textfile/common/textfiles'; import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; import { EditorStacksModel, EditorGroup } from 'vs/workbench/common/editor/editorStacksModel'; import { SaveFileAction, RevertFileAction, SaveFileAsAction, OpenToSideAction, SelectResourceForCompareAction, CompareResourcesAction, SaveAllInGroupAction } from 'vs/workbench/parts/files/browser/fileActions'; import { IUntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService'; -import { CloseOtherEditorsInGroupAction, CloseEditorAction, CloseEditorsInGroupAction } from 'vs/workbench/browser/parts/editor/editorActions'; +import { CloseOtherEditorsInGroupAction, CloseEditorAction, CloseEditorsInGroupAction, CloseUnmodifiedEditorsInGroupAction } from 'vs/workbench/browser/parts/editor/editorActions'; const $ = dom.$; @@ -170,8 +170,7 @@ export class Controller extends DefaultController { @IWorkbenchEditorService private editorService: IWorkbenchEditorService, @IEditorGroupService private editorGroupService: IEditorGroupService, @IContextMenuService private contextMenuService: IContextMenuService, - @ITelemetryService private telemetryService: ITelemetryService, - @IKeybindingService private keybindingService: IKeybindingService + @ITelemetryService private telemetryService: ITelemetryService ) { super({ clickBehavior: ClickBehavior.ON_MOUSE_DOWN, keyboardSupport: false }); } @@ -261,7 +260,6 @@ export class Controller extends DefaultController { this.contextMenuService.showContextMenu({ getAnchor: () => anchor, getActions: () => this.actionProvider.getSecondaryActions(tree, element), - getKeyBinding: (action) => this.keybindingService.lookupKeybinding(action.id), onHide: (wasCancelled?: boolean) => { if (wasCancelled) { tree.DOMFocus(); @@ -334,6 +332,7 @@ export class ActionProvider extends ContributableActionProvider { return [ saveAllAction, + this.instantiationService.createInstance(CloseUnmodifiedEditorsInGroupAction, CloseUnmodifiedEditorsInGroupAction.ID, CloseUnmodifiedEditorsInGroupAction.LABEL), this.instantiationService.createInstance(CloseEditorsInGroupAction, CloseEditorsInGroupAction.ID, CloseEditorsInGroupAction.LABEL) ]; } @@ -352,6 +351,7 @@ export class ActionProvider extends ContributableActionProvider { result.push(new Separator()); } + result.push(this.instantiationService.createInstance(CloseUnmodifiedEditorsInGroupAction, CloseUnmodifiedEditorsInGroupAction.ID, nls.localize('closeAllUnmodified', "Close Unmodified"))); result.push(this.instantiationService.createInstance(CloseEditorsInGroupAction, CloseEditorsInGroupAction.ID, nls.localize('closeAll', "Close All"))); } else { const openEditor = element; @@ -408,6 +408,7 @@ export class ActionProvider extends ContributableActionProvider { const closeOtherEditorsInGroupAction = this.instantiationService.createInstance(CloseOtherEditorsInGroupAction, CloseOtherEditorsInGroupAction.ID, nls.localize('closeOthers', "Close Others")); closeOtherEditorsInGroupAction.enabled = openEditor.editorGroup.count > 1; result.push(closeOtherEditorsInGroupAction); + result.push(this.instantiationService.createInstance(CloseUnmodifiedEditorsInGroupAction, CloseUnmodifiedEditorsInGroupAction.ID, nls.localize('closeAllUnmodified', "Close Unmodified"))); result.push(this.instantiationService.createInstance(CloseEditorsInGroupAction, CloseEditorsInGroupAction.ID, nls.localize('closeAll', "Close All"))); } diff --git a/src/vs/workbench/parts/files/common/editors/fileEditorInput.ts b/src/vs/workbench/parts/files/common/editors/fileEditorInput.ts index 2409a85a81138a4f341c4ea5e7d41dbbdcc37580..d38198bb83370fc231e66a02a82d5e422762c87e 100644 --- a/src/vs/workbench/parts/files/common/editors/fileEditorInput.ts +++ b/src/vs/workbench/parts/files/common/editors/fileEditorInput.ts @@ -9,7 +9,7 @@ import { TPromise } from 'vs/base/common/winjs.base'; import paths = require('vs/base/common/paths'); import labels = require('vs/base/common/labels'); import URI from 'vs/base/common/uri'; -import { EncodingMode, ConfirmResult, EditorInput, IFileEditorInput } from 'vs/workbench/common/editor'; +import { EncodingMode, ConfirmResult, EditorInput, IFileEditorInput, ITextEditorModel } from 'vs/workbench/common/editor'; import { TextFileEditorModel } from 'vs/workbench/services/textfile/common/textFileEditorModel'; import { BinaryEditorModel } from 'vs/workbench/common/editor/binaryEditorModel'; import { IFileOperationResult, FileOperationResult } from 'vs/platform/files/common/files'; @@ -21,17 +21,15 @@ import { IDisposable, dispose, IReference } from 'vs/base/common/lifecycle'; import { telemetryURIDescriptor } from 'vs/platform/telemetry/common/telemetryUtils'; import { Verbosity } from 'vs/platform/editor/common/editor'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { ITextModelResolverService } from 'vs/editor/common/services/resolverService'; +import { ITextModelService } from 'vs/editor/common/services/resolverService'; /** * A file editor input is the input type for the file editor of file system resources. */ export class FileEditorInput extends EditorInput implements IFileEditorInput { - private resource: URI; - private preferredEncoding: string; private forceOpenAsBinary: boolean; - private textModelReference: TPromise>; + private textModelReference: TPromise>; private name: string; private description: string; @@ -46,21 +44,18 @@ export class FileEditorInput extends EditorInput implements IFileEditorInput { * An editor input who's contents are retrieved from file services. */ constructor( - resource: URI, - preferredEncoding: string, + private resource: URI, + private preferredEncoding: string, @IInstantiationService private instantiationService: IInstantiationService, @IWorkspaceContextService private contextService: IWorkspaceContextService, @ITextFileService private textFileService: ITextFileService, @IEnvironmentService private environmentService: IEnvironmentService, - @ITextModelResolverService private textModelResolverService: ITextModelResolverService + @ITextModelService private textModelResolverService: ITextModelService ) { super(); this.toUnbind = []; - this.resource = resource; - this.preferredEncoding = preferredEncoding; - this.registerListeners(); } @@ -217,7 +212,7 @@ export class FileEditorInput extends EditorInput implements IFileEditorInput { this.textModelReference = this.textModelResolverService.createModelReference(this.resource); } - return this.textModelReference.then(ref => ref.object); + return this.textModelReference.then(ref => ref.object as TextFileEditorModel); }, error => { // In case of an error that indicates that the file is binary or too large, just return with the binary editor model @@ -272,4 +267,4 @@ export class FileEditorInput extends EditorInput implements IFileEditorInput { return false; } -} \ No newline at end of file +} diff --git a/src/vs/workbench/parts/files/common/editors/fileEditorTracker.ts b/src/vs/workbench/parts/files/common/editors/fileEditorTracker.ts index 1ea7c0e74529877bf527ace132b66401d0ae98f7..35e38eb98054283348e2d4421f170de4cc536bac 100644 --- a/src/vs/workbench/parts/files/common/editors/fileEditorTracker.ts +++ b/src/vs/workbench/parts/files/common/editors/fileEditorTracker.ts @@ -13,7 +13,7 @@ import { IEditor, IEditorViewState, isCommonCodeEditor } from 'vs/editor/common/ import { toResource, IEditorStacksModel, SideBySideEditorInput, IEditorGroup, IWorkbenchEditorConfiguration } from 'vs/workbench/common/editor'; import { BINARY_FILE_EDITOR_ID } from 'vs/workbench/parts/files/common/files'; import { ITextFileService, ITextFileEditorModel } from 'vs/workbench/services/textfile/common/textfiles'; -import { FileOperationEvent, FileOperation, IFileService, FileChangeType, FileChangesEvent, isEqual, indexOf, isEqualOrParent } from 'vs/platform/files/common/files'; +import { FileOperationEvent, FileOperation, IFileService, FileChangeType, FileChangesEvent, indexOf } from 'vs/platform/files/common/files'; import { FileEditorInput } from 'vs/workbench/parts/files/common/editors/fileEditorInput'; import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService'; import { ILifecycleService } from 'vs/platform/lifecycle/common/lifecycle'; @@ -62,7 +62,7 @@ export class FileEditorTracker implements IWorkbenchContribution { this.lifecycleService.onShutdown(this.dispose, this); // Configuration - this.toUnbind.push(this.configurationService.onDidUpdateConfiguration(e => this.onConfigurationUpdated(e.config))); + this.toUnbind.push(this.configurationService.onDidUpdateConfiguration(e => this.onConfigurationUpdated(this.configurationService.getConfiguration()))); } private onConfigurationUpdated(configuration: IWorkbenchEditorConfiguration): void { @@ -115,7 +115,7 @@ export class FileEditorTracker implements IWorkbenchContribution { // Do NOT close any opened editor that matches the resource path (either equal or being parent) of the // resource we move to (movedTo). Otherwise we would close a resource that has been renamed to the same // path but different casing. - if (movedTo && isEqualOrParent(resource.fsPath, movedTo.fsPath, !isLinux /* ignorecase */) && resource.fsPath.indexOf(movedTo.fsPath) === 0) { + if (movedTo && paths.isEqualOrParent(resource.fsPath, movedTo.fsPath, !isLinux /* ignorecase */) && resource.fsPath.indexOf(movedTo.fsPath) === 0) { return; } @@ -123,7 +123,7 @@ export class FileEditorTracker implements IWorkbenchContribution { if (arg1 instanceof FileChangesEvent) { matches = arg1.contains(resource, FileChangeType.DELETED); } else { - matches = isEqualOrParent(resource.fsPath, arg1.fsPath, !isLinux /* ignorecase */); + matches = paths.isEqualOrParent(resource.fsPath, arg1.fsPath, !isLinux /* ignorecase */); } if (!matches) { @@ -195,7 +195,7 @@ export class FileEditorTracker implements IWorkbenchContribution { const resource = input.getResource(); // Update Editor if file (or any parent of the input) got renamed or moved - if (isEqualOrParent(resource.fsPath, oldResource.fsPath, !isLinux /* ignorecase */)) { + if (paths.isEqualOrParent(resource.fsPath, oldResource.fsPath, !isLinux /* ignorecase */)) { let reopenFileResource: URI; if (oldResource.toString() === resource.toString()) { reopenFileResource = newResource; // file got moved @@ -229,7 +229,7 @@ export class FileEditorTracker implements IWorkbenchContribution { const editor = editors[i]; if (editor && editor.position === stacks.positionOfGroup(group)) { const resource = toResource(editor.input, { filter: 'file' }); - if (resource && isEqual(resource.fsPath, resource.fsPath)) { + if (resource && paths.isEqual(resource.fsPath, resource.fsPath)) { const control = editor.getControl(); if (isCommonCodeEditor(control)) { return control.saveViewState(); diff --git a/src/vs/workbench/parts/files/common/explorerViewModel.ts b/src/vs/workbench/parts/files/common/explorerModel.ts similarity index 80% rename from src/vs/workbench/parts/files/common/explorerViewModel.ts rename to src/vs/workbench/parts/files/common/explorerModel.ts index 64b3abbe18f7947176b72ff18e2d9b88872e673e..4be39ec993cd451d7c175d8c4cb1360c193e76ea 100644 --- a/src/vs/workbench/parts/files/common/explorerViewModel.ts +++ b/src/vs/workbench/parts/files/common/explorerModel.ts @@ -7,12 +7,12 @@ import URI from 'vs/base/common/uri'; import paths = require('vs/base/common/paths'); -import { IFileStat, isEqual, isParent, isEqualOrParent } from 'vs/platform/files/common/files'; -import { UntitledEditorInput } from 'vs/workbench/common/editor/untitledEditorInput'; -import { IEditorInput } from 'vs/platform/editor/common/editor'; -import { IEditorGroup, toResource } from 'vs/workbench/common/editor'; import { ResourceMap } from 'vs/base/common/map'; import { isLinux } from 'vs/base/common/platform'; +import { IFileStat, isParent } from 'vs/platform/files/common/files'; +import { IEditorInput } from 'vs/platform/editor/common/editor'; +import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; +import { IEditorGroup, toResource } from 'vs/workbench/common/editor'; export enum StatType { FILE, @@ -20,6 +20,41 @@ export enum StatType { ANY } +export class Model { + + private _roots: FileStat[]; + + constructor( @IWorkspaceContextService private contextService: IWorkspaceContextService) { + const setRoots = () => this._roots = this.contextService.getWorkspace2().roots.map(uri => new FileStat(uri, undefined)); + this.contextService.onDidChangeWorkspaceRoots(() => setRoots()); + setRoots(); + } + + public get roots(): FileStat[] { + return this._roots; + } + + /** + * Returns a child stat from this stat that matches with the provided path. + * Starts matching from the first root. + * Will return "null" in case the child does not exist. + */ + public findAll(resource: URI): FileStat[] { + return this.roots.map(root => root.find(resource)).filter(stat => !!stat); + } + + public findFirst(resource: URI): FileStat { + for (let root of this.roots) { + const result = root.find(resource); + if (result) { + return result; + } + } + + return null; + } +} + export class FileStat implements IFileStat { public resource: URI; public name: string; @@ -32,7 +67,7 @@ export class FileStat implements IFileStat { public isDirectoryResolved: boolean; - constructor(resource: URI, isDirectory?: boolean, hasChildren?: boolean, name: string = paths.basename(resource.fsPath), mtime?: number, etag?: string) { + constructor(resource: URI, public root: FileStat, isDirectory?: boolean, hasChildren?: boolean, name: string = paths.basename(resource.fsPath), mtime?: number, etag?: string) { this.resource = resource; this.name = name; this.isDirectory = !!isDirectory; @@ -44,6 +79,9 @@ export class FileStat implements IFileStat { if (this.isDirectory) { this.children = []; } + if (!this.root) { + this.root = this; + } this.isDirectoryResolved = false; } @@ -52,8 +90,12 @@ export class FileStat implements IFileStat { return this.resource.toString(); } - public static create(raw: IFileStat, resolveTo?: URI[]): FileStat { - const stat = new FileStat(raw.resource, raw.isDirectory, raw.hasChildren, raw.name, raw.mtime, raw.etag); + public get isRoot(): boolean { + return this.resource.toString() === this.root.resource.toString(); + } + + public static create(raw: IFileStat, root: FileStat, resolveTo?: URI[]): FileStat { + const stat = new FileStat(raw.resource, root, raw.isDirectory, raw.hasChildren, raw.name, raw.mtime, raw.etag); // Recursively add children if present if (stat.isDirectory) { @@ -62,13 +104,13 @@ export class FileStat implements IFileStat { // the folder is fully resolved if either it has a list of children or the client requested this by using the resolveTo // array of resource path to resolve. stat.isDirectoryResolved = !!raw.children || (!!resolveTo && resolveTo.some((r) => { - return isEqualOrParent(r.fsPath, stat.resource.fsPath, !isLinux /* ignorecase */); + return paths.isEqualOrParent(r.fsPath, stat.resource.fsPath, !isLinux /* ignorecase */); })); // Recurse into children if (raw.children) { for (let i = 0, len = raw.children.length; i < len; i++) { - const child = FileStat.create(raw.children[i], resolveTo); + const child = FileStat.create(raw.children[i], root, resolveTo); child.parent = stat; stat.children.push(child); stat.hasChildren = stat.children.length > 0; @@ -108,9 +150,11 @@ export class FileStat implements IFileStat { // Map resource => stat const oldLocalChildren = new ResourceMap(); - local.children.forEach((localChild: FileStat) => { - oldLocalChildren.set(localChild.resource, localChild); - }); + if (local.children) { + local.children.forEach((localChild: FileStat) => { + oldLocalChildren.set(localChild.resource, localChild); + }); + } // Clear current children local.children = []; @@ -242,7 +286,7 @@ export class FileStat implements IFileStat { public find(resource: URI): FileStat { // Return if path found - if (isEqual(resource.fsPath, this.resource.fsPath, !isLinux /* ignorecase */)) { + if (paths.isEqual(resource.fsPath, this.resource.fsPath, !isLinux /* ignorecase */)) { return this; } @@ -254,7 +298,7 @@ export class FileStat implements IFileStat { for (let i = 0; i < this.children.length; i++) { const child = this.children[i]; - if (isEqual(resource.fsPath, child.resource.fsPath, !isLinux /* ignorecase */)) { + if (paths.isEqual(resource.fsPath, child.resource.fsPath, !isLinux /* ignorecase */)) { return child; } @@ -275,8 +319,8 @@ export class NewStatPlaceholder extends FileStat { private id: number; private directoryPlaceholder: boolean; - constructor(isDirectory: boolean) { - super(URI.file('')); + constructor(isDirectory: boolean, root: FileStat) { + super(URI.file(''), root); this.id = NewStatPlaceholder.ID++; this.isDirectoryResolved = isDirectory; @@ -326,7 +370,7 @@ export class NewStatPlaceholder extends FileStat { } public static addNewStatPlaceholder(parent: FileStat, isDirectory: boolean): NewStatPlaceholder { - const child = new NewStatPlaceholder(isDirectory); + const child = new NewStatPlaceholder(isDirectory, parent.root); // Inherit some parent properties to child child.parent = parent; @@ -361,7 +405,7 @@ export class OpenEditor { } public isUntitled(): boolean { - return this.editor instanceof UntitledEditorInput; + return !!toResource(this.editor, { supportSideBySide: true, filter: 'untitled' }); } public isDirty(): boolean { diff --git a/src/vs/workbench/parts/files/common/files.ts b/src/vs/workbench/parts/files/common/files.ts index dc8cd834b61fc226941bc5b316f467b0030291ba..fdf0c517b2450c4e4c31283ecaf9e58af829fc0e 100644 --- a/src/vs/workbench/parts/files/common/files.ts +++ b/src/vs/workbench/parts/files/common/files.ts @@ -8,7 +8,7 @@ import URI from 'vs/base/common/uri'; import { IEditorOptions } from 'vs/editor/common/config/editorOptions'; import { IWorkbenchEditorConfiguration } from 'vs/workbench/common/editor'; import { IFilesConfiguration } from 'vs/platform/files/common/files'; -import { FileStat, OpenEditor } from 'vs/workbench/parts/files/common/explorerViewModel'; +import { FileStat, OpenEditor } from 'vs/workbench/parts/files/common/explorerModel'; import { ContextKeyExpr, RawContextKey } from 'vs/platform/contextkey/common/contextkey'; /** @@ -21,6 +21,7 @@ export const VIEWLET_ID = 'workbench.view.explorer'; */ const explorerViewletVisibleId = 'explorerViewletVisible'; const filesExplorerFocusId = 'filesExplorerFocus'; +const openEditorsVisibleId = 'openEditorsVisible'; const openEditorsFocusId = 'openEditorsFocus'; const explorerViewletFocusId = 'explorerViewletFocus'; const explorerResourceIsFolderId = 'explorerResourceIsFolder'; @@ -28,9 +29,11 @@ const explorerResourceIsFolderId = 'explorerResourceIsFolder'; export const ExplorerViewletVisibleContext = new RawContextKey(explorerViewletVisibleId, true); export const ExplorerFolderContext = new RawContextKey(explorerResourceIsFolderId, false); export const FilesExplorerFocussedContext = new RawContextKey(filesExplorerFocusId, false); +export const OpenEditorsVisibleContext = new RawContextKey(openEditorsVisibleId, false); export const OpenEditorsFocussedContext = new RawContextKey(openEditorsFocusId, false); export const ExplorerFocussedContext = new RawContextKey(explorerViewletFocusId, false); +export const OpenEditorsVisibleCondition = ContextKeyExpr.has(openEditorsVisibleId); export const FilesExplorerFocusCondition = ContextKeyExpr.and(ContextKeyExpr.has(explorerViewletVisibleId), ContextKeyExpr.has(filesExplorerFocusId)); export const ExplorerFocusCondition = ContextKeyExpr.and(ContextKeyExpr.has(explorerViewletVisibleId), ContextKeyExpr.has(explorerViewletFocusId)); @@ -69,7 +72,7 @@ export interface IFileResource { /** * Helper to get an explorer item from an object. */ -export function explorerItemToFileResource(obj: any): IFileResource { +export function explorerItemToFileResource(obj: FileStat | OpenEditor): IFileResource { if (obj instanceof FileStat) { const stat = obj as FileStat; diff --git a/src/vs/workbench/parts/files/test/browser/explorerViewModel.test.ts b/src/vs/workbench/parts/files/test/browser/explorerModel.test.ts similarity index 95% rename from src/vs/workbench/parts/files/test/browser/explorerViewModel.test.ts rename to src/vs/workbench/parts/files/test/browser/explorerModel.test.ts index 92b2fdd10a302b889aed80249cce2e74545f00f4..51675125eafee743a0165a36fa7ea91779e29a1f 100644 --- a/src/vs/workbench/parts/files/test/browser/explorerViewModel.test.ts +++ b/src/vs/workbench/parts/files/test/browser/explorerModel.test.ts @@ -11,10 +11,10 @@ import { isLinux, isWindows } from 'vs/base/common/platform'; import URI from 'vs/base/common/uri'; import { join } from 'vs/base/common/paths'; import { validateFileName } from 'vs/workbench/parts/files/browser/fileActions'; -import { FileStat } from 'vs/workbench/parts/files/common/explorerViewModel'; +import { FileStat } from 'vs/workbench/parts/files/common/explorerModel'; -function createStat(path, name, isFolder, hasChildren, size, mtime) { - return new FileStat(toResource(path), isFolder, hasChildren, name, mtime); +function createStat(path: string, name: string, isFolder: boolean, hasChildren: boolean, size: number, mtime: number): FileStat { + return new FileStat(toResource(path), undefined, isFolder, hasChildren, name, mtime); } function toResource(path) { @@ -246,20 +246,20 @@ suite('Files - View Model', () => { test('Merge Local with Disk', function () { const d = new Date().toUTCString(); - const merge1 = new FileStat(URI.file(join('C:\\', '/path/to')), true, false, 'to', Date.now(), d); - const merge2 = new FileStat(URI.file(join('C:\\', '/path/to')), true, false, 'to', Date.now(), new Date(0).toUTCString()); + const merge1 = new FileStat(URI.file(join('C:\\', '/path/to')), undefined, true, false, 'to', Date.now(), d); + const merge2 = new FileStat(URI.file(join('C:\\', '/path/to')), undefined, true, false, 'to', Date.now(), new Date(0).toUTCString()); // Merge Properties FileStat.mergeLocalWithDisk(merge2, merge1); assert.strictEqual(merge1.mtime, merge2.mtime); // Merge Child when isDirectoryResolved=false is a no-op - merge2.addChild(new FileStat(URI.file(join('C:\\', '/path/to/foo.html')), true, false, 'foo.html', Date.now(), d)); + merge2.addChild(new FileStat(URI.file(join('C:\\', '/path/to/foo.html')), undefined, true, false, 'foo.html', Date.now(), d)); FileStat.mergeLocalWithDisk(merge2, merge1); assert.strictEqual(merge1.children.length, 0); // Merge Child with isDirectoryResolved=true - const child = new FileStat(URI.file(join('C:\\', '/path/to/foo.html')), true, false, 'foo.html', Date.now(), d); + const child = new FileStat(URI.file(join('C:\\', '/path/to/foo.html')), undefined, true, false, 'foo.html', Date.now(), d); merge2.removeChild(child); merge2.addChild(child); merge2.isDirectoryResolved = true; diff --git a/src/vs/workbench/parts/html/browser/html.contribution.ts b/src/vs/workbench/parts/html/browser/html.contribution.ts index 70120e9682b387669042dc9d78570a017093c254..b2acd94c3f51280b1283a809bf2743d5bd153719 100644 --- a/src/vs/workbench/parts/html/browser/html.contribution.ts +++ b/src/vs/workbench/parts/html/browser/html.contribution.ts @@ -12,14 +12,14 @@ import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/edi import { Position as EditorPosition } from 'vs/platform/editor/common/editor'; import { HtmlInput } from '../common/htmlInput'; import { HtmlPreviewPart } from 'vs/workbench/parts/html/browser/htmlPreviewPart'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { EditorDescriptor } from 'vs/workbench/browser/parts/editor/baseEditor'; import { IEditorRegistry, Extensions as EditorExtensions } from 'vs/workbench/common/editor'; import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService'; import { isCommonCodeEditor, ICommonCodeEditor } from 'vs/editor/common/editorCommon'; import { HtmlZoneController } from './htmlEditorZone'; -import { ITextModelResolverService } from 'vs/editor/common/services/resolverService'; +import { ITextModelService } from 'vs/editor/common/services/resolverService'; // --- Register Editor (Registry.as(EditorExtensions.Editors)).registerEditor(new EditorDescriptor(HtmlPreviewPart.ID, @@ -60,7 +60,7 @@ CommandsRegistry.registerCommand('_workbench.htmlZone', function (accessor: Serv return undefined; } - const textModelResolverService = accessor.get(ITextModelResolverService); + const textModelResolverService = accessor.get(ITextModelService); return textModelResolverService.createModelReference(params.resource).then(ref => { const model = ref.object; diff --git a/src/vs/workbench/parts/html/browser/htmlPreviewPart.ts b/src/vs/workbench/parts/html/browser/htmlPreviewPart.ts index 038c8c4cd991f88bd3bde3fa93865a8664b586c6..67f4b85a1fe7266dc23fe53740180bb5fe270a54 100644 --- a/src/vs/workbench/parts/html/browser/htmlPreviewPart.ts +++ b/src/vs/workbench/parts/html/browser/htmlPreviewPart.ts @@ -6,7 +6,6 @@ 'use strict'; import { localize } from 'vs/nls'; -import URI from 'vs/base/common/uri'; import { TPromise } from 'vs/base/common/winjs.base'; import { IModel } from 'vs/editor/common/editorCommon'; import { Dimension, Builder } from 'vs/base/browser/builder'; @@ -14,12 +13,11 @@ import { empty as EmptyDisposable, IDisposable, dispose, IReference } from 'vs/b import { EditorOptions, EditorInput } from 'vs/workbench/common/editor'; import { Position } from 'vs/platform/editor/common/editor'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { BaseTextEditorModel } from 'vs/workbench/common/editor/textEditorModel'; import { HtmlInput } from 'vs/workbench/parts/html/common/htmlInput'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { IOpenerService } from 'vs/platform/opener/common/opener'; -import { ITextModelResolverService, ITextEditorModel } from 'vs/editor/common/services/resolverService'; +import { ITextModelService, ITextEditorModel } from 'vs/editor/common/services/resolverService'; import { Parts, IPartService } from 'vs/workbench/services/part/common/partService'; import Webview from './webview'; @@ -37,8 +35,6 @@ export class HtmlPreviewPart extends WebviewEditor { private _webviewDisposables: IDisposable[]; private _container: HTMLDivElement; - private _baseUrl: URI; - private _modelRef: IReference; public get model(): IModel { return this._modelRef && this._modelRef.object.textEditorModel; } private _modelChangeSubscription = EmptyDisposable; @@ -48,16 +44,13 @@ export class HtmlPreviewPart extends WebviewEditor { constructor( @ITelemetryService telemetryService: ITelemetryService, - @ITextModelResolverService private textModelResolverService: ITextModelResolverService, + @ITextModelService private textModelResolverService: ITextModelService, @IThemeService themeService: IThemeService, - @IOpenerService private openerService: IOpenerService, - @IWorkspaceContextService contextService: IWorkspaceContextService, + @IOpenerService private readonly openerService: IOpenerService, @IPartService private partService: IPartService, @IStorageService storageService: IStorageService ) { super(HtmlPreviewPart.ID, telemetryService, themeService, storageService); - - this._baseUrl = contextService.toResource('/'); } dispose(): void { @@ -81,12 +74,14 @@ export class HtmlPreviewPart extends WebviewEditor { private get webview(): Webview { if (!this._webview) { - this._webview = new Webview(this._container, this.partService.getContainer(Parts.EDITOR_PART)); - this._webview.baseUrl = this._baseUrl && this._baseUrl.toString(true); + this._webview = new Webview(this._container, this.partService.getContainer(Parts.EDITOR_PART), { enableJavascript: true }); if (this.input && this.input instanceof HtmlInput) { const state = this.loadViewState(this.input.getResource()); this.scrollYPercentage = state ? state.scrollYPercentage : 0; this.webview.initialScrollProgress = this.scrollYPercentage; + + const resourceUri = this.input.getResource(); + this.webview.baseUrl = resourceUri.toString(true); } this._webviewDisposables = [ diff --git a/src/vs/workbench/parts/html/browser/webview-pre.js b/src/vs/workbench/parts/html/browser/webview-pre.js index a371b3f33c0cdc51ae7c19a89988733127f051e7..99f62f62fd4af544cdd73673edeaaec47cec854c 100644 --- a/src/vs/workbench/parts/html/browser/webview-pre.js +++ b/src/vs/workbench/parts/html/browser/webview-pre.js @@ -17,7 +17,7 @@ function styleBody(body) { if (!body) { - return + return; } body.classList.remove('vscode-light', 'vscode-dark', 'vscode-high-contrast'); body.classList.add(initData.activeTheme); @@ -47,7 +47,7 @@ /** @type {any} */ var node = event.target; while (node) { - if (node.tagName === "A" && node.href) { + if (node.tagName && node.tagName.toLowerCase() === 'a' && node.href) { var baseElement = event.view.document.getElementsByTagName("base")[0]; if (node.getAttribute("href") === "#") { event.view.scrollTo(0, 0); @@ -88,7 +88,7 @@ }); } - document.addEventListener('DOMContentLoaded', function (event) { + document.addEventListener('DOMContentLoaded', function () { ipcRenderer.on('baseUrl', function (event, value) { initData.baseUrl = value; }); @@ -98,7 +98,7 @@ initData.activeTheme = activeTheme; // webview - var target = getActiveFrame() + var target = getActiveFrame(); if (!target) { return; } @@ -121,8 +121,9 @@ }); // update iframe-contents - ipcRenderer.on('content', function (_event, value) { - const text = value.join('\n'); + ipcRenderer.on('content', function (_event, data) { + const options = data.options; + const text = data.contents.join('\n'); const newDocument = new DOMParser().parseFromString(text, 'text/html'); // know what happens here @@ -157,25 +158,25 @@ // keep current scrollTop around and use later var setInitialScrollPosition; - if (firstLoad) { + if (firstLoad) { firstLoad = false; setInitialScrollPosition = function (body, window) { body.scrollTop = 0; if (!isNaN(initData.initialScrollProgress)) { window.addEventListener('load', function () { if (body.scrollTop === 0) { - body.scrollTop = body.clientHeight * initData.initialScrollProgress + body.scrollTop = body.clientHeight * initData.initialScrollProgress; } }); } - } + }; } else { const scrollY = frame.contentDocument && frame.contentDocument.body ? frame.contentDocument.body.scrollTop : 0; setInitialScrollPosition = function (body) { if (body.scrollTop === 0) { body.scrollTop = scrollY; } - } + }; } // Clean up old pending frames and set current one as new one @@ -188,13 +189,13 @@ const newFrame = document.createElement('iframe'); newFrame.setAttribute('id', 'pending-frame'); newFrame.setAttribute('frameborder', '0'); - newFrame.setAttribute('sandbox', 'allow-scripts allow-forms allow-same-origin'); + newFrame.setAttribute('sandbox', options.enableJavascript ? 'allow-scripts allow-forms allow-same-origin' : 'allow-same-origin'); newFrame.style.cssText = "margin: 0; overflow: hidden; position: absolute; width: 100%; height: 100%; display: none"; document.body.appendChild(newFrame); // write new content onto iframe newFrame.contentDocument.open('text/html', 'replace'); - newFrame.contentWindow.onbeforeunload = function (e) { + newFrame.contentWindow.onbeforeunload = function () { console.log('prevented webview navigation'); return false; }; diff --git a/src/vs/workbench/parts/html/browser/webview.ts b/src/vs/workbench/parts/html/browser/webview.ts index b8d6922a8447623f8468e0fc53afaf2367707362..6b45dbafd207b9581b521986aba8f298663753bb 100644 --- a/src/vs/workbench/parts/html/browser/webview.ts +++ b/src/vs/workbench/parts/html/browser/webview.ts @@ -21,7 +21,6 @@ declare interface WebviewElement extends HTMLElement { autoSize: 'on'; preload: string; contextIsolation: boolean; - send(channel: string, ...args: any[]); openDevTools(): any; } @@ -44,6 +43,10 @@ MenuRegistry.addCommand({ type ApiThemeClassName = 'vscode-light' | 'vscode-dark' | 'vscode-high-contrast'; +export interface WebviewOptions { + enableJavascript?: boolean; +} + export default class Webview { private _webview: WebviewElement; @@ -56,7 +59,8 @@ export default class Webview { constructor( private parent: HTMLElement, - private _styleElement: Element + private _styleElement: Element, + private options: WebviewOptions = {} ) { this._webview = document.createElement('webview'); @@ -70,6 +74,7 @@ export default class Webview { this._webview.setAttribute('disableblinkfeatures', 'Auxclick'); this._webview.setAttribute('disableguestresize', ''); + this._webview.setAttribute('webpreferences', 'contextIsolation=yes'); this._webview.preload = require.toUrl('./webview-pre.js'); this._webview.src = require.toUrl('./webview.html'); @@ -158,7 +163,10 @@ export default class Webview { } set contents(value: string[]) { - this._send('content', value); + this._send('content', { + contents: value, + options: this.options + }); } set baseUrl(value: string) { diff --git a/src/vs/workbench/parts/markers/browser/markersPanel.ts b/src/vs/workbench/parts/markers/browser/markersPanel.ts index 615851f727f0e438e161ec0deb3ed7c0553cc83a..8df5bac927a9a439b0b3d04232504812fcf3a0d1 100644 --- a/src/vs/workbench/parts/markers/browser/markersPanel.ts +++ b/src/vs/workbench/parts/markers/browser/markersPanel.ts @@ -6,7 +6,6 @@ import 'vs/css!./media/markers'; import * as errors from 'vs/base/common/errors'; -import * as Set from 'vs/base/common/set'; import URI from 'vs/base/common/uri'; import { TPromise } from 'vs/base/common/winjs.base'; import { Delayer } from 'vs/base/common/async'; @@ -32,12 +31,12 @@ import { CollapseAllAction, FilterAction, FilterInputBoxActionItem } from 'vs/wo import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import Messages from 'vs/workbench/parts/markers/common/messages'; import { RangeHighlightDecorations } from 'vs/workbench/common/editor/rangeDecorations'; -import { ContributableActionProvider } from 'vs/workbench/browser/actionBarRegistry'; +import { ContributableActionProvider } from 'vs/workbench/browser/actions'; import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey'; import { IListService } from 'vs/platform/list/browser/listService'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { ICommonCodeEditor } from 'vs/editor/common/editorCommon'; -import FileResultsNavigation from 'vs/workbench/browser/fileResultsNavigation'; +import FileResultsNavigation from 'vs/workbench/parts/files/browser/fileResultsNavigation'; import { debounceEvent } from 'vs/base/common/event'; import { attachListStyler } from 'vs/platform/theme/common/styler'; @@ -53,7 +52,7 @@ export class MarkersPanel extends Panel { private hasToAutoReveal: boolean; private tree: Tree.ITree; - private autoExpanded: Set.ArraySet; + private autoExpanded: Set; private rangeHighlightDecorations: RangeHighlightDecorations; private actions: IAction[]; @@ -81,7 +80,7 @@ export class MarkersPanel extends Panel { super(Constants.MARKERS_PANEL_ID, telemetryService, themeService); this.toDispose = []; this.delayedRefresh = new Delayer(500); - this.autoExpanded = new Set.ArraySet(); + this.autoExpanded = new Set(); this.markerFocusContextKey = Constants.MarkerFocusContextKey.bindTo(contextKeyService); } @@ -188,7 +187,7 @@ export class MarkersPanel extends Panel { public updateFilter(filter: string) { this.markersModel.update(new FilterOptions(filter)); - this.autoExpanded = new Set.ArraySet(); + this.autoExpanded = new Set(); this.refreshPanel(); this.autoReveal(); } @@ -250,7 +249,7 @@ export class MarkersPanel extends Panel { } private createListeners(): void { - this.toDispose.push(this.configurationService.onDidUpdateConfiguration(e => this.onConfigurationsUpdated(e.config))); + this.toDispose.push(this.configurationService.onDidUpdateConfiguration(e => this.onConfigurationsUpdated(this.configurationService.getConfiguration()))); this.toDispose.push(this.markerService.onMarkerChanged(this.onMarkerChanged, this)); this.toDispose.push(this.editorGroupService.onEditorsChanged(this.onEditorsChanged, this)); this.toDispose.push(this.tree.addListener('selection', () => this.onSelected())); @@ -304,7 +303,7 @@ export class MarkersPanel extends Panel { bulkUpdater.done(); for (const resource of resources) { if (!this.markersModel.hasResource(resource)) { - this.autoExpanded.unset(resource.toString()); + this.autoExpanded.delete(resource.toString()); } } } @@ -326,9 +325,9 @@ export class MarkersPanel extends Panel { private autoExpand(): void { for (const resource of this.markersModel.filteredResources) { const resourceUri = resource.uri.toString(); - if (!this.autoExpanded.contains(resourceUri)) { + if (!this.autoExpanded.has(resourceUri)) { this.tree.expand(resource).done(null, errors.onUnexpectedError); - this.autoExpanded.set(resourceUri); + this.autoExpanded.add(resourceUri); } } } diff --git a/src/vs/workbench/parts/markers/browser/markersTreeController.ts b/src/vs/workbench/parts/markers/browser/markersTreeController.ts index 0177d325920983971646bae789fbf6c426db332e..9b420131e3cdc52257eab7fd7074c1f71c9d05e5 100644 --- a/src/vs/workbench/parts/markers/browser/markersTreeController.ts +++ b/src/vs/workbench/parts/markers/browser/markersTreeController.ts @@ -13,7 +13,6 @@ import { IContextMenuService } from 'vs/platform/contextview/browser/contextView import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { IMenuService, IMenu, MenuId } from 'vs/platform/actions/common/actions'; import { IAction } from 'vs/base/common/actions'; -import { ResolvedKeybinding } from 'vs/base/common/keyCodes'; import { ActionItem, Separator } from 'vs/base/browser/ui/actionbar/actionbar'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; @@ -61,17 +60,13 @@ export class Controller extends treedefaults.DefaultController { }, getActionItem: (action) => { - const keybinding = this._keybindingFor(action); + const keybinding = this._keybindingService.lookupKeybinding(action.id); if (keybinding) { return new ActionItem(action, action, { label: true, keybinding: keybinding.getLabel() }); } return null; }, - getKeyBinding: (action): ResolvedKeybinding => { - return this._keybindingFor(action); - }, - onHide: (wasCancelled?: boolean) => { if (wasCancelled) { tree.DOMFocus(); @@ -94,8 +89,4 @@ export class Controller extends treedefaults.DefaultController { result.pop(); // remove last separator return result; } - - private _keybindingFor(action: IAction): ResolvedKeybinding { - return this._keybindingService.lookupKeybinding(action.id); - } } diff --git a/src/vs/workbench/parts/markers/browser/markersTreeViewer.ts b/src/vs/workbench/parts/markers/browser/markersTreeViewer.ts index b0f736e5e5182d4aa509bf298c883b6a1c418205..c78dfb63b687073329c6cdd70b716c7fde87479b 100644 --- a/src/vs/workbench/parts/markers/browser/markersTreeViewer.ts +++ b/src/vs/workbench/parts/markers/browser/markersTreeViewer.ts @@ -18,9 +18,9 @@ import { IMarker } from 'vs/platform/markers/common/markers'; import { MarkersModel, Resource, Marker } from 'vs/workbench/parts/markers/common/markersModel'; import Messages from 'vs/workbench/parts/markers/common/messages'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { attachBadgeStyler } from "vs/platform/theme/common/styler"; -import { IThemeService } from "vs/platform/theme/common/themeService"; -import { IDisposable } from "vs/base/common/lifecycle"; +import { attachBadgeStyler } from 'vs/platform/theme/common/styler'; +import { IThemeService } from 'vs/platform/theme/common/themeService'; +import { IDisposable } from 'vs/base/common/lifecycle'; interface IAnyResourceTemplateData { count: CountBadge; diff --git a/src/vs/workbench/parts/markers/browser/markersWorkbenchContributions.ts b/src/vs/workbench/parts/markers/browser/markersWorkbenchContributions.ts index ed571684fe54711bfcbd59a1f4234501dace0fd0..b57d35ab93813a3d104c253b2e9f1d55c0cd81f9 100644 --- a/src/vs/workbench/parts/markers/browser/markersWorkbenchContributions.ts +++ b/src/vs/workbench/parts/markers/browser/markersWorkbenchContributions.ts @@ -6,7 +6,7 @@ import Messages from 'vs/workbench/parts/markers/common/messages'; import Constants from 'vs/workbench/parts/markers/common/constants'; import { KeyMod, KeyCode } from 'vs/base/common/keyCodes'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { SyncActionDescriptor } from 'vs/platform/actions/common/actions'; import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry'; import { IWorkbenchActionRegistry, Extensions as ActionExtensions } from 'vs/workbench/common/actionRegistry'; diff --git a/src/vs/workbench/parts/markers/common/markersModel.ts b/src/vs/workbench/parts/markers/common/markersModel.ts index e87e6f7906ae4f2e40e17013b4d3e3dc1f107595..be69523c4d220926540a618596afd02122602c72 100644 --- a/src/vs/workbench/parts/markers/common/markersModel.ts +++ b/src/vs/workbench/parts/markers/common/markersModel.ts @@ -6,7 +6,6 @@ import * as paths from 'vs/base/common/paths'; import * as types from 'vs/base/common/types'; -import * as Map from 'vs/base/common/map'; import Severity from 'vs/base/common/severity'; import URI from 'vs/base/common/uri'; import { Range, IRange } from 'vs/editor/common/core/range'; @@ -125,14 +124,14 @@ export class FilterOptions { export class MarkersModel { - private markersByResource: Map.LinkedMap; + private markersByResource: Map; private _filteredResources: Resource[]; private _nonFilteredResources: Resource[]; private _filterOptions: FilterOptions; constructor(markers: IMarker[] = []) { - this.markersByResource = new Map.LinkedMap(); + this.markersByResource = new Map(); this._filterOptions = new FilterOptions(); this.update(markers); } @@ -154,7 +153,7 @@ export class MarkersModel { } public hasResource(resource: URI): boolean { - return this.markersByResource.has(resource); + return this.markersByResource.has(resource.toString()); } public get nonFilteredResources(): Resource[] { @@ -198,48 +197,47 @@ export class MarkersModel { private refreshResources(): void { this._nonFilteredResources = []; this._filteredResources = []; - for (const entry of this.markersByResource.entries()) { - const filteredResource = this.toFilteredResource(entry); + this.markersByResource.forEach((values, uri) => { + const filteredResource = this.toFilteredResource(URI.parse(uri), values); if (filteredResource.markers.length) { this._filteredResources.push(filteredResource); } else { this._nonFilteredResources.push(filteredResource); } - } + }); } private updateResource(resourceUri: URI, markers: IMarker[]) { - if (this.markersByResource.has(resourceUri)) { - this.markersByResource.delete(resourceUri); + if (this.markersByResource.has(resourceUri.toString())) { + this.markersByResource.delete(resourceUri.toString()); } if (markers.length > 0) { - this.markersByResource.set(resourceUri, markers); + this.markersByResource.set(resourceUri.toString(), markers); } } private updateMarkers(markers: IMarker[]) { markers.forEach((marker: IMarker) => { let uri: URI = marker.resource; - let markers: IMarker[] = this.markersByResource.get(uri); + let markers: IMarker[] = this.markersByResource.get(uri.toString()); if (!markers) { markers = []; - this.markersByResource.set(uri, markers); + this.markersByResource.set(uri.toString(), markers); } markers.push(marker); }); } - private toFilteredResource(entry: Map.Entry) { + private toFilteredResource(uri: URI, values: IMarker[]) { let markers: Marker[] = []; - for (let i = 0; i < entry.value.length; i++) { - const m = entry.value[i]; - const uri = entry.key.toString(); - if (entry.key.scheme !== Schemas.walkThrough && entry.key.scheme !== Schemas.walkThroughSnippet && (!this._filterOptions.hasFilters() || this.filterMarker(m))) { - markers.push(this.toMarker(m, i, uri)); + for (let i = 0; i < values.length; i++) { + const m = values[i]; + if (uri.scheme !== Schemas.walkThrough && uri.scheme !== Schemas.walkThroughSnippet && (!this._filterOptions.hasFilters() || this.filterMarker(m))) { + markers.push(this.toMarker(m, i, uri.toString())); } } - const matches = this._filterOptions.hasFilters() ? FilterOptions._filter(this._filterOptions.filter, paths.basename(entry.key.fsPath)) : []; - return new Resource(entry.key, markers, this.getStatistics(entry.value), matches || []); + const matches = this._filterOptions.hasFilters() ? FilterOptions._filter(this._filterOptions.filter, paths.basename(uri.fsPath)) : []; + return new Resource(uri, markers, this.getStatistics(values), matches || []); } private toMarker(marker: IMarker, index: number, uri: string): Marker { diff --git a/src/vs/workbench/parts/output/browser/output.contribution.ts b/src/vs/workbench/parts/output/browser/output.contribution.ts index 63939ccb44e1f9d6955c0198b05e123b4483b64c..5852791b7f74005ab73148d3ba624f00e7e0b826 100644 --- a/src/vs/workbench/parts/output/browser/output.contribution.ts +++ b/src/vs/workbench/parts/output/browser/output.contribution.ts @@ -6,7 +6,7 @@ import nls = require('vs/nls'); import { KeyMod, KeyChord, KeyCode } from 'vs/base/common/keyCodes'; import { ModesRegistry } from 'vs/editor/common/modes/modesRegistry'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { MenuId, MenuRegistry, SyncActionDescriptor } from 'vs/platform/actions/common/actions'; import { KeybindingsRegistry, IKeybindings } from 'vs/platform/keybinding/common/keybindingsRegistry'; import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; diff --git a/src/vs/workbench/parts/output/browser/outputActions.ts b/src/vs/workbench/parts/output/browser/outputActions.ts index b7e0927a94b8e13c8ede23d624431b5e70a44bd6..9664d932ba0a65a495a349a2a647672a00181f5e 100644 --- a/src/vs/workbench/parts/output/browser/outputActions.ts +++ b/src/vs/workbench/parts/output/browser/outputActions.ts @@ -43,7 +43,7 @@ export class ClearOutputAction extends Action { super(id, label, 'output-action clear-output'); } - public run(): TPromise { + public run(): TPromise { this.outputService.getActiveChannel().clear(); this.panelService.getActivePanel().focus(); @@ -64,7 +64,7 @@ export class ToggleOutputScrollLockAction extends Action { this.toDispose.push(this.outputService.onActiveOutputChannel(channel => this.setClass(this.outputService.getActiveChannel().scrollLock))); } - public run(): TPromise { + public run(): TPromise { const activeChannel = this.outputService.getActiveChannel(); if (activeChannel) { activeChannel.scrollLock = !activeChannel.scrollLock; @@ -112,7 +112,10 @@ export class SwitchOutputActionItem extends SelectActionItem { ) { super(null, action, [], 0); - this.toDispose.push(this.outputService.onOutputChannel(() => this.setOptions(this.getOptions(), this.getSelected(undefined)))); + this.toDispose.push(this.outputService.onOutputChannel(() => { + const activeChannelIndex = this.getSelected(this.outputService.getActiveChannel().id); + this.setOptions(this.getOptions(), activeChannelIndex); + })); this.toDispose.push(this.outputService.onActiveOutputChannel(activeChannelId => this.setOptions(this.getOptions(), this.getSelected(activeChannelId)))); this.toDispose.push(attachSelectBoxStyler(this.selectBox, themeService)); diff --git a/src/vs/workbench/parts/output/browser/outputPanel.ts b/src/vs/workbench/parts/output/browser/outputPanel.ts index 217bb1972c6ccbb75c9ded3436e984ceddd6e5b7..42b8505f6349a9ddf6b1fcb987d1c519e197421f 100644 --- a/src/vs/workbench/parts/output/browser/outputPanel.ts +++ b/src/vs/workbench/parts/output/browser/outputPanel.ts @@ -13,7 +13,7 @@ import { IActionItem } from 'vs/base/browser/ui/actionbar/actionbar'; import { IEditorOptions } from 'vs/editor/common/config/editorOptions'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IStorageService } from 'vs/platform/storage/common/storage'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; +import { ITextResourceConfigurationService } from 'vs/editor/common/services/resourceConfiguration'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; @@ -22,7 +22,6 @@ import { TextResourceEditor } from 'vs/workbench/browser/parts/editor/textResour import { OutputEditors, OUTPUT_PANEL_ID, IOutputService, CONTEXT_IN_OUTPUT } from 'vs/workbench/parts/output/common/output'; import { SwitchOutputAction, SwitchOutputActionItem, ClearOutputAction, ToggleOutputScrollLockAction } from 'vs/workbench/parts/output/browser/outputActions'; import { IThemeService } from 'vs/platform/theme/common/themeService'; -import { IUntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService'; import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService'; import { IModeService } from 'vs/editor/common/services/modeService'; import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; @@ -36,16 +35,15 @@ export class OutputPanel extends TextResourceEditor { @ITelemetryService telemetryService: ITelemetryService, @IInstantiationService instantiationService: IInstantiationService, @IStorageService storageService: IStorageService, - @IConfigurationService configurationService: IConfigurationService, + @ITextResourceConfigurationService configurationService: ITextResourceConfigurationService, @IThemeService themeService: IThemeService, @IOutputService private outputService: IOutputService, - @IUntitledEditorService untitledEditorService: IUntitledEditorService, @IContextKeyService private contextKeyService: IContextKeyService, @IEditorGroupService editorGroupService: IEditorGroupService, @IModeService modeService: IModeService, @ITextFileService textFileService: ITextFileService ) { - super(telemetryService, instantiationService, storageService, configurationService, themeService, untitledEditorService, editorGroupService, modeService, textFileService); + super(telemetryService, instantiationService, storageService, configurationService, themeService, editorGroupService, modeService, textFileService); this.scopedInstantiationService = instantiationService; this.toDispose = []; @@ -89,6 +87,12 @@ export class OutputPanel extends TextResourceEditor { options.folding = false; options.scrollBeyondLastLine = false; options.renderLineHighlight = 'none'; + options.minimap = { enabled: false }; + + const outputConfig = this.configurationService.getConfiguration(null, '[Log]'); + if (outputConfig && outputConfig['editor.minimap.enabled']) { + options.minimap = { enabled: true }; + } return options; } diff --git a/src/vs/workbench/parts/output/browser/outputServices.ts b/src/vs/workbench/parts/output/browser/outputServices.ts index bd5efe6484c15634529a902aaccdcfe8e3cb027f..3c096a9ecd195a378ab559f16c64854e8463fe57 100644 --- a/src/vs/workbench/parts/output/browser/outputServices.ts +++ b/src/vs/workbench/parts/output/browser/outputServices.ts @@ -12,7 +12,7 @@ import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { IEditor } from 'vs/platform/editor/common/editor'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { EditorOptions } from 'vs/workbench/common/editor'; import { IOutputChannelIdentifier, OutputEditors, IOutputEvent, IOutputChannel, IOutputService, IOutputDelta, Extensions, OUTPUT_PANEL_ID, IOutputChannelRegistry, MAX_OUTPUT_LENGTH, OUTPUT_SCHEME, OUTPUT_MIME } from 'vs/workbench/parts/output/common/output'; import { OutputPanel } from 'vs/workbench/parts/output/browser/outputPanel'; @@ -20,7 +20,7 @@ import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; import { IModelService } from 'vs/editor/common/services/modelService'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { OutputLinkProvider } from 'vs/workbench/parts/output/common/outputLinkProvider'; -import { ITextModelResolverService, ITextModelContentProvider } from 'vs/editor/common/services/resolverService'; +import { ITextModelService, ITextModelContentProvider } from 'vs/editor/common/services/resolverService'; import { IModel } from 'vs/editor/common/editorCommon'; import { IModeService } from 'vs/editor/common/services/modeService'; import { RunOnceScheduler } from 'vs/base/common/async'; @@ -101,7 +101,7 @@ export class OutputService implements IOutputService { @IPanelService private panelService: IPanelService, @IWorkspaceContextService contextService: IWorkspaceContextService, @IModelService modelService: IModelService, - @ITextModelResolverService textModelResolverService: ITextModelResolverService + @ITextModelService textModelResolverService: ITextModelService ) { this._onOutput = new Emitter(); this._onOutputChannel = new Emitter(); @@ -110,7 +110,7 @@ export class OutputService implements IOutputService { const channels = this.getChannels(); this.activeChannelId = this.storageService.get(OUTPUT_ACTIVE_CHANNEL_KEY, StorageScope.WORKSPACE, channels && channels.length > 0 ? channels[0].id : null); - this._outputLinkDetector = new OutputLinkProvider(contextService, modelService); + this._outputLinkDetector = instantiationService.createInstance(OutputLinkProvider); this._outputContentProvider = instantiationService.createInstance(OutputContentProvider, this); @@ -380,4 +380,4 @@ class OutputContentProvider implements ITextModelContentProvider { public dispose(): void { this.toDispose = dispose(this.toDispose); } -} \ No newline at end of file +} diff --git a/src/vs/workbench/parts/output/common/output.ts b/src/vs/workbench/parts/output/common/output.ts index 2b2a798b09bed14545b82a835ab91c0f0a664034..b4066e6e6bef81b613d955057bc4c39cd2b03913 100644 --- a/src/vs/workbench/parts/output/common/output.ts +++ b/src/vs/workbench/parts/output/common/output.ts @@ -6,7 +6,7 @@ import { TPromise } from 'vs/base/common/winjs.base'; import Event from 'vs/base/common/event'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { createDecorator, IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IEditor } from 'vs/platform/editor/common/editor'; import { RawContextKey } from 'vs/platform/contextkey/common/contextkey'; diff --git a/src/vs/workbench/parts/output/common/outputLinkComputer.ts b/src/vs/workbench/parts/output/common/outputLinkComputer.ts index b1814e60e52da4e77a3cc032d17e79b5086f1b02..e734eef99bb7e58d1adf1b84ffd31f2780ee96dc 100644 --- a/src/vs/workbench/parts/output/common/outputLinkComputer.ts +++ b/src/vs/workbench/parts/output/common/outputLinkComputer.ts @@ -14,87 +14,103 @@ import arrays = require('vs/base/common/arrays'); import { Range } from 'vs/editor/common/core/range'; export interface ICreateData { - workspaceResourceUri: string; + workspaceFolders: string[]; } export interface IResourceCreator { - toResource: (workspaceRelativePath: string) => URI; + toResource: (folderRelativePath: string) => URI; } export class OutputLinkComputer { - - private _ctx: IWorkerContext; - private _patterns: RegExp[]; - private _workspaceResource: URI; + private ctx: IWorkerContext; + private patterns: Map; constructor(ctx: IWorkerContext, createData: ICreateData) { - this._ctx = ctx; - this._workspaceResource = URI.parse(createData.workspaceResourceUri); - this._patterns = OutputLinkComputer.createPatterns(this._workspaceResource); + this.ctx = ctx; + this.patterns = new Map(); + + this.computePatterns(createData); } - private _getModel(uri: string): IMirrorModel { - let models = this._ctx.getMirrorModels(); + private computePatterns(createData: ICreateData): void { + + // Produce patterns for each workspace root we are configured with + // This means that we will be able to detect links for paths that + // contain any of the workspace roots as segments. + const workspaceFolders = createData.workspaceFolders.map(r => URI.parse(r)); + workspaceFolders.forEach(workspaceFolder => { + const patterns = OutputLinkComputer.createPatterns(workspaceFolder); + this.patterns.set(workspaceFolder.fsPath, patterns); + }); + } + + private getModel(uri: string): IMirrorModel { + const models = this.ctx.getMirrorModels(); for (let i = 0; i < models.length; i++) { - let model = models[i]; + const model = models[i]; if (model.uri.toString() === uri) { return model; } } + return null; } public computeLinks(uri: string): TPromise { - let model = this._getModel(uri); + const model = this.getModel(uri); if (!model) { - return undefined; + return void 0; } - let links: ILink[] = []; + const links: ILink[] = []; + const lines = model.getValue().split(/\r\n|\r|\n/); - let resourceCreator: IResourceCreator = { - toResource: (workspaceRelativePath: string): URI => { - if (typeof workspaceRelativePath === 'string') { - return URI.file(paths.join(this._workspaceResource.fsPath, workspaceRelativePath)); + // For each workspace root patterns + this.patterns.forEach((folderPatterns, folderPath) => { + const resourceCreator: IResourceCreator = { + toResource: (folderRelativePath: string): URI => { + if (typeof folderRelativePath === 'string') { + return URI.file(paths.join(folderPath, folderRelativePath)); + } + + return null; } - return null; - } - }; + }; - let lines = model.getValue().split(/\r\n|\r|\n/); - for (let i = 0, len = lines.length; i < len; i++) { - links.push(...OutputLinkComputer.detectLinks(lines[i], i + 1, this._patterns, resourceCreator)); - } + for (let i = 0, len = lines.length; i < len; i++) { + links.push(...OutputLinkComputer.detectLinks(lines[i], i + 1, folderPatterns, resourceCreator)); + } + }); return TPromise.as(links); } - public static createPatterns(workspaceResource: URI): RegExp[] { - let patterns: RegExp[] = []; + public static createPatterns(workspaceFolder: URI): RegExp[] { + const patterns: RegExp[] = []; - let workspaceRootVariants = arrays.distinct([ - paths.normalize(workspaceResource.fsPath, true), - paths.normalize(workspaceResource.fsPath, false) + const workspaceFolderVariants = arrays.distinct([ + paths.normalize(workspaceFolder.fsPath, true), + paths.normalize(workspaceFolder.fsPath, false) ]); - workspaceRootVariants.forEach((workspaceRoot) => { + workspaceFolderVariants.forEach(workspaceFolderVariant => { - // Example: C:\Users\someone\AppData\Local\Temp\_monacodata_9888\workspaces\express\server.js on line 8, column 13 - patterns.push(new RegExp(strings.escapeRegExpCharacters(workspaceRoot) + '(\\S*) on line ((\\d+)(, column (\\d+))?)', 'gi')); + // Example: /workspaces/express/server.js on line 8, column 13 + patterns.push(new RegExp(strings.escapeRegExpCharacters(workspaceFolderVariant) + '(\\S*) on line ((\\d+)(, column (\\d+))?)', 'gi')); - // Example: C:\Users\someone\AppData\Local\Temp\_monacodata_9888\workspaces\express\server.js:line 8, column 13 - patterns.push(new RegExp(strings.escapeRegExpCharacters(workspaceRoot) + '(\\S*):line ((\\d+)(, column (\\d+))?)', 'gi')); + // Example: /workspaces/express/server.js:line 8, column 13 + patterns.push(new RegExp(strings.escapeRegExpCharacters(workspaceFolderVariant) + '(\\S*):line ((\\d+)(, column (\\d+))?)', 'gi')); - // Example: C:\Users\someone\AppData\Local\Temp\_monacodata_9888\workspaces\mankala\Features.ts(45): error - // Example: C:\Users\someone\AppData\Local\Temp\_monacodata_9888\workspaces\mankala\Features.ts (45): error - // Example: C:\Users\someone\AppData\Local\Temp\_monacodata_9888\workspaces\mankala\Features.ts(45,18): error - // Example: C:\Users\someone\AppData\Local\Temp\_monacodata_9888\workspaces\mankala\Features.ts (45,18): error - patterns.push(new RegExp(strings.escapeRegExpCharacters(workspaceRoot) + '([^\\s\\(\\)]*)(\\s?\\((\\d+)(,(\\d+))?)\\)', 'gi')); + // Example: /workspaces/mankala/Features.ts(45): error + // Example: /workspaces/mankala/Features.ts (45): error + // Example: /workspaces/mankala/Features.ts(45,18): error + // Example: /workspaces/mankala/Features.ts (45,18): error + patterns.push(new RegExp(strings.escapeRegExpCharacters(workspaceFolderVariant) + '([^\\s\\(\\)]*)(\\s?\\((\\d+)(,(\\d+))?)\\)', 'gi')); - // Example: at C:\Users\someone\AppData\Local\Temp\_monacodata_9888\workspaces\mankala\Game.ts - // Example: at C:\Users\someone\AppData\Local\Temp\_monacodata_9888\workspaces\mankala\Game.ts:336 - // Example: at C:\Users\someone\AppData\Local\Temp\_monacodata_9888\workspaces\mankala\Game.ts:336:9 - patterns.push(new RegExp(strings.escapeRegExpCharacters(workspaceRoot) + '([^:\\s\\(\\)<>\'\"\\[\\]]*)(:(\\d+))?(:(\\d+))?', 'gi')); + // Example: at /workspaces/mankala/Game.ts + // Example: at /workspaces/mankala/Game.ts:336 + // Example: at /workspaces/mankala/Game.ts:336:9 + patterns.push(new RegExp(strings.escapeRegExpCharacters(workspaceFolderVariant) + '([^:\\s\\(\\)<>\'\"\\[\\]]*)(:(\\d+))?(:(\\d+))?', 'gi')); }); return patterns; @@ -103,10 +119,10 @@ export class OutputLinkComputer { /** * Detect links. Made public static to allow for tests. */ - public static detectLinks(line: string, lineIndex: number, patterns: RegExp[], contextService: IResourceCreator): ILink[] { - let links: ILink[] = []; + public static detectLinks(line: string, lineIndex: number, patterns: RegExp[], resourceCreator: IResourceCreator): ILink[] { + const links: ILink[] = []; - patterns.forEach((pattern) => { + patterns.forEach(pattern => { pattern.lastIndex = 0; // the holy grail of software development let match: RegExpExecArray; @@ -114,39 +130,39 @@ export class OutputLinkComputer { while ((match = pattern.exec(line)) !== null) { // Convert the relative path information to a resource that we can use in links - let workspaceRelativePath = strings.rtrim(match[1], '.').replace(/\\/g, '/'); // remove trailing "." that likely indicate end of sentence + const folderRelativePath = strings.rtrim(match[1], '.').replace(/\\/g, '/'); // remove trailing "." that likely indicate end of sentence let resource: string; try { - resource = contextService.toResource(workspaceRelativePath).toString(); + resource = resourceCreator.toResource(folderRelativePath).toString(); } catch (error) { continue; // we might find an invalid URI and then we dont want to loose all other links } // Append line/col information to URI if matching if (match[3]) { - let lineNumber = match[3]; + const lineNumber = match[3]; if (match[5]) { - let columnNumber = match[5]; + const columnNumber = match[5]; resource = strings.format('{0}#{1},{2}', resource, lineNumber, columnNumber); } else { resource = strings.format('{0}#{1}', resource, lineNumber); } } - let fullMatch = strings.rtrim(match[0], '.'); // remove trailing "." that likely indicate end of sentence + const fullMatch = strings.rtrim(match[0], '.'); // remove trailing "." that likely indicate end of sentence - let index = line.indexOf(fullMatch, offset); + const index = line.indexOf(fullMatch, offset); offset += index + fullMatch.length; - var linkRange = { + const linkRange = { startColumn: index + 1, startLineNumber: lineIndex, endColumn: index + 1 + fullMatch.length, endLineNumber: lineIndex }; - if (links.some((link) => Range.areIntersectingOrTouching(link.range, linkRange))) { + if (links.some(link => Range.areIntersectingOrTouching(link.range, linkRange))) { return; // Do not detect duplicate links } diff --git a/src/vs/workbench/parts/output/common/outputLinkProvider.ts b/src/vs/workbench/parts/output/common/outputLinkProvider.ts index 88915554475c00993bcb4bc36347b5e8ffb0d56b..416e14fd385e43f7ed0ba7476b5416c68c2b387f 100644 --- a/src/vs/workbench/parts/output/common/outputLinkProvider.ts +++ b/src/vs/workbench/parts/output/common/outputLinkProvider.ts @@ -14,63 +14,95 @@ import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace import { OUTPUT_MODE_ID } from 'vs/workbench/parts/output/common/output'; import { MonacoWebWorker, createWebWorker } from 'vs/editor/common/services/webWorker'; import { ICreateData, OutputLinkComputer } from 'vs/workbench/parts/output/common/outputLinkComputer'; +import { IDisposable, dispose } from "vs/base/common/lifecycle"; export class OutputLinkProvider { private static DISPOSE_WORKER_TIME = 3 * 60 * 1000; // dispose worker after 3 minutes of inactivity - private _modelService: IModelService; - private _workspaceResource: URI; - - private _worker: MonacoWebWorker; - private _disposeWorker: RunOnceScheduler; + private worker: MonacoWebWorker; + private disposeWorkerScheduler: RunOnceScheduler; + private linkProviderRegistration: IDisposable; + private workspacesCount: number; constructor( - contextService: IWorkspaceContextService, - modelService: IModelService + @IWorkspaceContextService private contextService: IWorkspaceContextService, + @IModelService private modelService: IModelService ) { - let workspace = contextService.getWorkspace(); + this.workspacesCount = 0; + this.disposeWorkerScheduler = new RunOnceScheduler(() => this.disposeWorker(), OutputLinkProvider.DISPOSE_WORKER_TIME); - // Does not do anything unless there is a workspace... - if (workspace) { - this._modelService = modelService; + this.registerListeners(); + this.updateLinkProviderWorker(); + } - this._workspaceResource = workspace.resource; + private registerListeners(): void { + this.contextService.onDidChangeWorkspaceRoots(() => this.updateLinkProviderWorker()); + } - LinkProviderRegistry.register({ language: OUTPUT_MODE_ID, scheme: '*' }, { - provideLinks: (model, token): Thenable => { - return wireCancellationToken(token, this._provideLinks(model.uri)); - } - }); + private updateLinkProviderWorker(): void { - this._worker = null; - this._disposeWorker = new RunOnceScheduler(() => { - if (this._worker) { - this._worker.dispose(); - this._worker = null; - } - }, OutputLinkProvider.DISPOSE_WORKER_TIME); + // We have a workspace + if (this.contextService.hasWorkspace()) { + + // Register link provider unless done already + if (!this.linkProviderRegistration) { + this.linkProviderRegistration = LinkProviderRegistry.register({ language: OUTPUT_MODE_ID, scheme: '*' }, { + provideLinks: (model, token): Thenable => { + return wireCancellationToken(token, this.provideLinks(model.uri)); + } + }); + } + + // Update link provider worker if workspace roots changed + const newWorkspacesCount = this.contextService.getWorkspace2().roots.length; + if (this.workspacesCount !== newWorkspacesCount) { + this.workspacesCount = newWorkspacesCount; + + // Next computer will trigger recompute + this.disposeWorker(); + this.disposeWorkerScheduler.cancel(); + } + } + + // Dispose link provider when no longer having a workspace + else if (this.linkProviderRegistration) { + this.workspacesCount = 0; + dispose(this.linkProviderRegistration); + this.linkProviderRegistration = void 0; + this.disposeWorker(); + this.disposeWorkerScheduler.cancel(); } } - private _getOrCreateWorker(): MonacoWebWorker { - this._disposeWorker.schedule(); - if (!this._worker) { - let createData: ICreateData = { - workspaceResourceUri: this._workspaceResource.toString() + private getOrCreateWorker(): MonacoWebWorker { + this.disposeWorkerScheduler.schedule(); + + if (!this.worker) { + const createData: ICreateData = { + workspaceFolders: this.contextService.getWorkspace2().roots.map(root => root.toString()) }; - this._worker = createWebWorker(this._modelService, { + + this.worker = createWebWorker(this.modelService, { moduleId: 'vs/workbench/parts/output/common/outputLinkComputer', - createData: createData, + createData, label: 'outputLinkComputer' }); } - return this._worker; + + return this.worker; } - private _provideLinks(modelUri: URI): TPromise { - return this._getOrCreateWorker().withSyncedResources([modelUri]).then((linkComputer) => { + private provideLinks(modelUri: URI): TPromise { + return this.getOrCreateWorker().withSyncedResources([modelUri]).then(linkComputer => { return linkComputer.computeLinks(modelUri.toString()); }); } + + private disposeWorker(): void { + if (this.worker) { + this.worker.dispose(); + this.worker = null; + } + } } diff --git a/src/vs/workbench/parts/output/test/bufferedContent.test.ts b/src/vs/workbench/parts/output/test/bufferedContent.test.ts index f94f61c9cc03624fc2f5fcf04a144e833077efd0..06a00d45b5b5345825ade6b812345bfaff2e24d6 100644 --- a/src/vs/workbench/parts/output/test/bufferedContent.test.ts +++ b/src/vs/workbench/parts/output/test/bufferedContent.test.ts @@ -41,19 +41,19 @@ suite('Workbench - Output Buffered Content', () => { bufferedContent.append('first line'); const firstDelta = bufferedContent.getDelta(); let longString = ''; - for (var i = 0; i < 50000; i++) { + for (var i = 0; i < 5000; i++) { bufferedContent.append(i.toString()); longString += i.toString(); } const secondDelta = bufferedContent.getDelta(firstDelta); assert.equal(secondDelta.append, true); - assert.equal(secondDelta.value.substr(secondDelta.value.length - 5), '49999'); + assert.equal(secondDelta.value.substr(secondDelta.value.length - 4), '4999'); longString = longString + longString + longString + longString; bufferedContent.append(longString); bufferedContent.append(longString); const thirdDelta = bufferedContent.getDelta(firstDelta); - assert.equal(!!thirdDelta.append, false); - assert.equal(thirdDelta.value.substr(thirdDelta.value.length - 5), '49999'); + assert.equal(!!thirdDelta.append, true); + assert.equal(thirdDelta.value.substr(thirdDelta.value.length - 4), '4999'); bufferedContent.clear(); assert.equal(bufferedContent.getDelta().value, ''); diff --git a/src/vs/workbench/parts/performance/electron-browser/performance.contribution.ts b/src/vs/workbench/parts/performance/electron-browser/performance.contribution.ts index 820590107e2e003aa878ce55d823b49625f30b23..e88b9d0abc0e44f85158933658246407229a376b 100644 --- a/src/vs/workbench/parts/performance/electron-browser/performance.contribution.ts +++ b/src/vs/workbench/parts/performance/electron-browser/performance.contribution.ts @@ -10,16 +10,18 @@ import { IEnvironmentService } from 'vs/platform/environment/common/environment' import { IExtensionService } from 'vs/platform/extensions/common/extensions'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IMessageService } from 'vs/platform/message/common/message'; +import { ILifecycleService, LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle'; import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; import { ITimerService } from 'vs/workbench/services/timer/common/timerService'; import { IWindowsService } from 'vs/platform/windows/common/windows'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IWorkbenchContributionsRegistry, IWorkbenchContribution, Extensions } from 'vs/workbench/common/contributions'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { ReportPerformanceIssueAction } from 'vs/workbench/electron-browser/actions'; import { TPromise } from 'vs/base/common/winjs.base'; import { join } from 'path'; import { localize } from 'vs/nls'; +import { toPromise, filterEvent } from 'vs/base/common/event'; import { platform, Platform } from 'vs/base/common/platform'; import { readdir, stat } from 'vs/base/node/pfs'; import { release } from 'os'; @@ -105,7 +107,7 @@ class ProfilingHint implements IWorkbenchContribution { // Ignore virtual machines and only ask users // to profile with a certain propability - if (virtualMachineHint.value() >= .5 || Math.ceil(Math.random() * 50) !== 1) { + if (virtualMachineHint.value() >= .5 || Math.ceil(Math.random() * 1000) !== 1) { return; } @@ -149,10 +151,16 @@ class StartupProfiler implements IWorkbenchContribution { @IMessageService private readonly _messageService: IMessageService, @IEnvironmentService private readonly _environmentService: IEnvironmentService, @IInstantiationService private readonly _instantiationService: IInstantiationService, + @ILifecycleService lifecycleService: ILifecycleService, @IExtensionService extensionService: IExtensionService, ) { - - extensionService.onReady().then(() => this._stopProfiling()); + // wait for everything to be ready + TPromise.join([ + extensionService.onReady(), + toPromise(filterEvent(lifecycleService.onDidChangePhase, phase => phase === LifecyclePhase.Running)), + ]).then(() => { + this._stopProfiling(); + }); } getId(): string { @@ -184,7 +192,7 @@ class StartupProfiler implements IWorkbenchContribution { const action = this._instantiationService.createInstance(ReportPerformanceIssueAction, ReportPerformanceIssueAction.ID, ReportPerformanceIssueAction.LABEL); TPromise.join([ this._windowsService.showItemInFolder(join(profileStartup.dir, files[0])), - action.run(`:warning: Make sure to **attach** these files: :warning:\n${files.map(file => `-\`${join(profileStartup.dir, file)}\``).join('\n')}`) + action.run(`:warning: Make sure to **attach** these files from your *home*-directory: :warning:\n${files.map(file => `-\`${file}\``).join('\n')}`) ]).then(() => { // keep window stable until restart is selected this._messageService.confirm({ diff --git a/src/vs/workbench/parts/preferences/browser/keybindingWidgets.ts b/src/vs/workbench/parts/preferences/browser/keybindingWidgets.ts index 67c6fca57ae3eb6347be264f6f327493f3b9c6b8..65043dc7561177f8c938dbd724c4bca6f25fd71d 100644 --- a/src/vs/workbench/parts/preferences/browser/keybindingWidgets.ts +++ b/src/vs/workbench/parts/preferences/browser/keybindingWidgets.ts @@ -23,7 +23,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti import { ICodeEditor, IOverlayWidget, IOverlayWidgetPosition } from 'vs/editor/browser/editorBrowser'; import { attachInputBoxStyler, attachStylerCallback } from 'vs/platform/theme/common/styler'; import { IThemeService } from 'vs/platform/theme/common/themeService'; -import { editorWidgetBackground, widgetShadow } from "vs/platform/theme/common/colorRegistry"; +import { editorWidgetBackground, widgetShadow } from 'vs/platform/theme/common/colorRegistry'; class KeybindingInputWidget extends Widget { diff --git a/src/vs/workbench/parts/preferences/browser/keybindingsEditor.ts b/src/vs/workbench/parts/preferences/browser/keybindingsEditor.ts index ca94ecd2c2bf4cee543fdecb591d06a52b0d4997..f0aa2694035e5000f10bbd8dfc97167cc5d2a373 100644 --- a/src/vs/workbench/parts/preferences/browser/keybindingsEditor.ts +++ b/src/vs/workbench/parts/preferences/browser/keybindingsEditor.ts @@ -39,7 +39,7 @@ import { IChoiceService, IMessageService, Severity } from 'vs/platform/message/c import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent'; import { KeyCode, ResolvedKeybinding } from 'vs/base/common/keyCodes'; import { attachListStyler } from 'vs/platform/theme/common/styler'; -import { listHighlightForeground } from "vs/platform/theme/common/colorRegistry"; +import { listHighlightForeground } from 'vs/platform/theme/common/colorRegistry'; let $ = DOM.$; @@ -444,8 +444,7 @@ export class KeybindingsEditor extends BaseEditor implements IKeybindingsEditor this.createRemoveAction(e.element), this.createResetAction(e.element), new Separator(), - this.createShowConflictsAction(e.element)]), - getKeyBinding: (action) => this.keybindingsService.lookupKeybinding(action.id) + this.createShowConflictsAction(e.element)]) }); } } diff --git a/src/vs/workbench/parts/preferences/browser/keybindingsEditorContribution.ts b/src/vs/workbench/parts/preferences/browser/keybindingsEditorContribution.ts index d5aaccbae452609cd419945542fdcb1f6a34fc29..ed4b39ebc17a8cfe0817abde2b10acfd0445ce9b 100644 --- a/src/vs/workbench/parts/preferences/browser/keybindingsEditorContribution.ts +++ b/src/vs/workbench/parts/preferences/browser/keybindingsEditorContribution.ts @@ -26,9 +26,9 @@ import { parseTree, Node } from 'vs/base/common/json'; import { KeybindingIO } from 'vs/workbench/services/keybinding/common/keybindingIO'; import { ScanCodeBinding } from 'vs/workbench/services/keybinding/common/scanCode'; import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; +import { WindowsNativeResolvedKeybinding } from 'vs/workbench/services/keybinding/common/windowsKeyboardMapper'; const NLS_LAUNCH_MESSAGE = nls.localize('defineKeybinding.start', "Define Keybinding"); -const NLS_KB_LAYOUT_INFO_MESSAGE = nls.localize('defineKeybinding.kbLayoutInfoMessage', "For your current keyboard layout press "); const NLS_KB_LAYOUT_ERROR_MESSAGE = nls.localize('defineKeybinding.kbLayoutErrorMessage', "You won't be able to produce this key combination under your current keyboard layout."); const INTERESTING_FILE = /keybindings\.json$/; @@ -230,15 +230,22 @@ export class KeybindingEditorDecorationsRenderer extends Disposable { const resolvedKeybindings = this._keybindingService.resolveUserBinding(value.value); if (resolvedKeybindings.length === 0) { - return this._createDecoration(true, null, model, value); + return this._createDecoration(true, null, null, model, value); } const resolvedKeybinding = resolvedKeybindings[0]; + let usLabel: string = null; + if (resolvedKeybinding instanceof WindowsNativeResolvedKeybinding) { + usLabel = resolvedKeybinding.getUSLabel(); + } if (!resolvedKeybinding.isWYSIWYG()) { - return this._createDecoration(false, resolvedKeybinding.getLabel(), model, value); + return this._createDecoration(false, resolvedKeybinding.getLabel(), usLabel, model, value); + } + if (/abnt_|oem_/.test(value.value)) { + return this._createDecoration(false, resolvedKeybinding.getLabel(), usLabel, model, value); } const expectedUserSettingsLabel = resolvedKeybinding.getUserSettingsLabel(); if (!KeybindingEditorDecorationsRenderer._userSettingsFuzzyEquals(value.value, expectedUserSettingsLabel)) { - return this._createDecoration(false, resolvedKeybinding.getLabel(), model, value); + return this._createDecoration(false, resolvedKeybinding.getLabel(), usLabel, model, value); } return null; } @@ -281,7 +288,7 @@ export class KeybindingEditorDecorationsRenderer extends Disposable { return false; } - private _createDecoration(isError: boolean, message: string, model: editorCommon.IModel, keyNode: Node): editorCommon.IModelDeltaDecoration { + private _createDecoration(isError: boolean, uiLabel: string, usLabel: string, model: editorCommon.IModel, keyNode: Node): editorCommon.IModelDeltaDecoration { let msg: MarkedString[]; let className: string; let beforeContentClassName: string; @@ -295,8 +302,27 @@ export class KeybindingEditorDecorationsRenderer extends Disposable { overviewRulerColor = 'rgba(250, 100, 100, 0.6)'; } else { // this is the info case - msg = [NLS_KB_LAYOUT_INFO_MESSAGE]; - msg = msg.concat(message); + if (usLabel && uiLabel !== usLabel) { + msg = [ + nls.localize({ + key: 'defineKeybinding.kbLayoutLocalAndUSMessage', + comment: [ + 'Please translate maintaining the stars (*) around the placeholders such that they will be rendered in bold.', + 'The placeholders will contain a keyboard combination e.g. Ctrl+Shift+/' + ] + }, "**{0}** for your current keyboard layout (**{1}** for US standard).", uiLabel, usLabel) + ]; + } else { + msg = [ + nls.localize({ + key: 'defineKeybinding.kbLayoutLocalMessage', + comment: [ + 'Please translate maintaining the stars (*) around the placeholder such that it will be rendered in bold.', + 'The placeholder will contain a keyboard combination e.g. Ctrl+Shift+/' + ] + }, "**{0}** for your current keyboard layout.", uiLabel) + ]; + } className = 'keybindingInfo'; beforeContentClassName = 'inlineKeybindingInfo'; overviewRulerColor = 'rgba(100, 100, 250, 0.6)'; diff --git a/src/vs/workbench/parts/preferences/browser/media/keybindingsEditor.css b/src/vs/workbench/parts/preferences/browser/media/keybindingsEditor.css index 29b4fe0a8d134b0bb9d6729958dd8920293562d6..94a771ce087addf5e60dd0e1d7f1737be8439bd0 100644 --- a/src/vs/workbench/parts/preferences/browser/media/keybindingsEditor.css +++ b/src/vs/workbench/parts/preferences/browser/media/keybindingsEditor.css @@ -68,20 +68,12 @@ display: flex; } -.keybindings-editor > .keybindings-body .keybindings-list-container .monaco-list-row.keybindings-list-header.focused, -.keybindings-editor > .keybindings-body .keybindings-list-container .monaco-list-row.keybindings-list-header.selected, -.keybindings-editor > .keybindings-body .keybindings-list-container .monaco-list-row.keybindings-list-header:hover, -.keybindings-editor > .keybindings-body > .keybindings-list-container .monaco-list-row.keybindings-list-header, .keybindings-editor > .keybindings-body > .keybindings-list-container .monaco-list-row.even:not(.focused):not(.selected):not(:hover), .keybindings-editor > .keybindings-body > .keybindings-list-container .monaco-list:not(:focus) .monaco-list-row.focused.even:not(.selected):not(:hover), .keybindings-editor > .keybindings-body > .keybindings-list-container .monaco-list:not(.focused) .monaco-list-row.focused.even:not(.selected):not(:hover) { background-color: rgba(130, 130, 130, 0.04); } -.keybindings-editor > .keybindings-body > .keybindings-list-container .monaco-list-row:hover { - background-color: rgba(128, 128, 128, 0.15); -} - .keybindings-editor > .keybindings-body .keybindings-list-container .monaco-list-row > .header { text-align: left; font-weight: bold; diff --git a/src/vs/workbench/parts/preferences/browser/media/preferences.css b/src/vs/workbench/parts/preferences/browser/media/preferences.css index c5dc62f55244aa4c42df42cf7cb3c8adf60e1cd4..52c3e38e32be875e43c01e7ae444ac129662c5b2 100644 --- a/src/vs/workbench/parts/preferences/browser/media/preferences.css +++ b/src/vs/workbench/parts/preferences/browser/media/preferences.css @@ -134,6 +134,32 @@ padding-left:10px; } +.monaco-editor .settings-header-widget .title-container { + padding-left: 12px; + display: flex; +} + +.vs .monaco-editor .settings-header-widget .title-container { + color: #6f6f6f; +} +.vs-dark .monaco-editor .settings-header-widget .title-container { + color: #bbbbbb; +} +.hc-black .monaco-editor .settings-header-widget .title-container { + color: white; +} + +.monaco-editor .settings-header-widget .title-container .title { + font-weight: bold; + white-space: nowrap; + text-transform: uppercase; +} + +.monaco-editor .settings-header-widget .title-container .message { + padding-left: 12px; + white-space: nowrap; +} + .monaco-editor .settings-group-title-widget { z-index: 1; } @@ -144,11 +170,18 @@ font-weight: bold; -webkit-user-select: none; user-select: none; + display: flex; } .vs .monaco-editor .settings-group-title-widget .title-container { color: #6f6f6f; } + +.monaco-editor .settings-group-title-widget .title-container .title { + white-space: nowrap; + overflow: hidden; +} + .vs-dark .monaco-editor .settings-group-title-widget .title-container { color: #bbbbbb; } @@ -173,12 +206,7 @@ .monaco-editor .settings-group-title-widget .title-container .expand-collapse-icon { background: url(expanded.svg) 50% 50% no-repeat; width: 16px; - height: 16px; -} - -.monaco-editor .settings-group-title-widget .title-container > div { - vertical-align: middle; - display: inline-block; + height: 100%; } .monaco-editor.vs-dark .settings-group-title-widget .title-container .expand-collapse-icon, diff --git a/src/vs/workbench/parts/preferences/browser/preferences.contribution.ts b/src/vs/workbench/parts/preferences/browser/preferences.contribution.ts index 1c4f38ca6e9acaa30932dafc2f62494a18457627..d0f2b3db586a78a7521a0cee43ce779de0f408ba 100644 --- a/src/vs/workbench/parts/preferences/browser/preferences.contribution.ts +++ b/src/vs/workbench/parts/preferences/browser/preferences.contribution.ts @@ -6,7 +6,7 @@ import * as nls from 'vs/nls'; import URI from 'vs/base/common/uri'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry'; import { IWorkbenchActionRegistry, Extensions } from 'vs/workbench/common/actionRegistry'; import { EditorInput, IEditorRegistry, Extensions as EditorExtensions, IEditorInputFactory } from 'vs/workbench/common/editor'; @@ -166,7 +166,7 @@ registry.registerWorkbenchAction(new SyncActionDescriptor(OpenGlobalSettingsActi registry.registerWorkbenchAction(new SyncActionDescriptor(OpenWorkspaceSettingsAction, OpenWorkspaceSettingsAction.ID, OpenWorkspaceSettingsAction.LABEL), 'Preferences: Open Workspace Settings', category); registry.registerWorkbenchAction(new SyncActionDescriptor(OpenGlobalKeybindingsAction, OpenGlobalKeybindingsAction.ID, OpenGlobalKeybindingsAction.LABEL, { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_S) }), 'Preferences: Open Keyboard Shortcuts', category); registry.registerWorkbenchAction(new SyncActionDescriptor(OpenGlobalKeybindingsFileAction, OpenGlobalKeybindingsFileAction.ID, OpenGlobalKeybindingsFileAction.LABEL, { primary: null }), 'Preferences: Open Keyboard Shortcuts File', category); -registry.registerWorkbenchAction(new SyncActionDescriptor(ConfigureLanguageBasedSettingsAction, ConfigureLanguageBasedSettingsAction.ID, ConfigureLanguageBasedSettingsAction.LABEL), 'Preferences: Configure Language Specific Settings', category); +registry.registerWorkbenchAction(new SyncActionDescriptor(ConfigureLanguageBasedSettingsAction, ConfigureLanguageBasedSettingsAction.ID, ConfigureLanguageBasedSettingsAction.LABEL), 'Preferences: Configure Language Specific Settings...', category); KeybindingsRegistry.registerCommandAndKeybindingRule({ id: KEYBINDINGS_EDITOR_COMMAND_DEFINE, diff --git a/src/vs/workbench/parts/preferences/browser/preferencesEditor.ts b/src/vs/workbench/parts/preferences/browser/preferencesEditor.ts index 0aae0f5f0ff485740d094c61b2974036aec4bf1c..901a290c2678902953df92bfdcb6dda00c6d93e6 100644 --- a/src/vs/workbench/parts/preferences/browser/preferencesEditor.ts +++ b/src/vs/workbench/parts/preferences/browser/preferencesEditor.ts @@ -9,9 +9,10 @@ import URI from 'vs/base/common/uri'; import * as DOM from 'vs/base/browser/dom'; import { Delayer } from 'vs/base/common/async'; import { Dimension, Builder } from 'vs/base/browser/builder'; +import { ArrayNavigator, INavigator } from 'vs/base/common/iterator'; import { Disposable, IDisposable, dispose } from 'vs/base/common/lifecycle'; import { KeyMod, KeyCode } from 'vs/base/common/keyCodes'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { toResource, SideBySideEditorInput, EditorOptions, EditorInput, IEditorRegistry, Extensions as EditorExtensions } from 'vs/workbench/common/editor'; import { BaseEditor, EditorDescriptor } from 'vs/workbench/browser/parts/editor/baseEditor'; import { ResourceEditorModel } from 'vs/workbench/common/editor/resourceEditorModel'; @@ -36,9 +37,9 @@ import { IThemeService } from 'vs/platform/theme/common/themeService'; import { IModelService } from 'vs/editor/common/services/modelService'; import { IModeService } from 'vs/editor/common/services/modeService'; import { IStorageService } from 'vs/platform/storage/common/storage'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; +import { ITextResourceConfigurationService } from 'vs/editor/common/services/resourceConfiguration'; import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; -import { ITextModelResolverService } from 'vs/editor/common/services/resolverService'; +import { ITextModelService } from 'vs/editor/common/services/resolverService'; import { ConfigurationTarget } from 'vs/workbench/services/configuration/common/configurationEditing'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import { VSash } from 'vs/base/browser/ui/sash/sash'; @@ -53,8 +54,8 @@ import { FindController } from 'vs/editor/contrib/find/browser/find'; import { SelectionHighlighter } from 'vs/editor/contrib/find/common/findController'; import { IEditorOptions } from 'vs/editor/common/config/editorOptions'; import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { attachStylerCallback } from "vs/platform/theme/common/styler"; -import { scrollbarShadow } from "vs/platform/theme/common/colorRegistry"; +import { attachStylerCallback } from 'vs/platform/theme/common/styler'; +import { scrollbarShadow } from 'vs/platform/theme/common/colorRegistry'; export class PreferencesEditorInput extends SideBySideEditorInput { public static ID: string = 'workbench.editorinputs.preferencesEditorInput'; @@ -71,7 +72,7 @@ export class PreferencesEditorInput extends SideBySideEditorInput { export class DefaultPreferencesEditorInput extends ResourceEditorInput { public static ID = 'workbench.editorinputs.defaultpreferences'; constructor(defaultSettingsResource: URI, - @ITextModelResolverService textModelResolverService: ITextModelResolverService + @ITextModelService textModelResolverService: ITextModelService ) { super(nls.localize('settingsEditorName', "Default Settings"), '', defaultSettingsResource, textModelResolverService); } @@ -241,10 +242,44 @@ export class PreferencesEditor extends BaseEditor { } } +class SettingsNavigator implements INavigator { + + private iterator: ArrayNavigator; + + constructor(settings: ISetting[]) { + this.iterator = new ArrayNavigator(settings); + } + + public next(): ISetting { + return this.iterator.next() || this.iterator.first(); + } + + public previous(): ISetting { + return this.iterator.previous() || this.iterator.last(); + } + + public parent(): ISetting { + return this.iterator.parent(); + } + + public first(): ISetting { + return this.iterator.first(); + } + + public last(): ISetting { + return this.iterator.last(); + } + + public current(): ISetting { + return this.iterator.current(); + } +} + class PreferencesRenderers extends Disposable { private _defaultPreferencesRenderer: IPreferencesRenderer; private _editablePreferencesRenderer: IPreferencesRenderer; + private _settingsNavigator: SettingsNavigator; private _disposables: IDisposable[] = []; @@ -268,14 +303,18 @@ class PreferencesRenderers extends Disposable { } public filterPreferences(filter: string): number { - const filterResult = filter ? (this._defaultPreferencesRenderer.preferencesModel).filterSettings(filter) : null; - this._filterPreferences(filterResult, this._defaultPreferencesRenderer); - this._filterPreferences(filterResult, this._editablePreferencesRenderer); - return this._getCount(filterResult ? filterResult.filteredGroups : (this._defaultPreferencesRenderer ? (this._defaultPreferencesRenderer.preferencesModel).settingsGroups : [])); + const defaultPreferencesFilterResult = filter ? (this._defaultPreferencesRenderer.preferencesModel).filterSettings(filter) : null; + const editablePreferencesFilterResult = filter ? (this._editablePreferencesRenderer.preferencesModel).filterSettings(filter) : null; + const consolidatedSettings = this._consolidateSettings(editablePreferencesFilterResult ? editablePreferencesFilterResult.filteredGroups : (this._editablePreferencesRenderer.preferencesModel).settingsGroups, + defaultPreferencesFilterResult ? defaultPreferencesFilterResult.filteredGroups : (this._defaultPreferencesRenderer.preferencesModel).settingsGroups); + this._settingsNavigator = new SettingsNavigator(filter ? consolidatedSettings : []); + this._filterPreferences(defaultPreferencesFilterResult, this._defaultPreferencesRenderer); + this._filterPreferences(editablePreferencesFilterResult, this._editablePreferencesRenderer); + return consolidatedSettings.length; } public focusNextPreference(forward: boolean = true) { - const setting = forward ? this._defaultPreferencesRenderer.iterator.next() : this._defaultPreferencesRenderer.iterator.previous(); + const setting = forward ? this._settingsNavigator.next() : this._settingsNavigator.previous(); this._focusPreference(setting, this._defaultPreferencesRenderer); this._focusPreference(setting, this._editablePreferencesRenderer); } @@ -304,14 +343,20 @@ class PreferencesRenderers extends Disposable { } } - private _getCount(settingsGroups: ISettingsGroup[]): number { - let count = 0; + private _consolidateSettings(editableSettingsGroups: ISettingsGroup[], defaultSettingsGroups: ISettingsGroup[]): ISetting[] { + const editableSettings = this._flatten(editableSettingsGroups); + const defaultSettings = this._flatten(defaultSettingsGroups).filter(secondarySetting => !editableSettings.some(primarySetting => primarySetting.key === secondarySetting.key)); + return [...editableSettings, ...defaultSettings]; + } + + private _flatten(settingsGroups: ISettingsGroup[]): ISetting[] { + const settings: ISetting[] = []; for (const group of settingsGroups) { for (const section of group.sections) { - count += section.settings.length; + settings.push(...section.settings); } } - return count; + return settings; } public dispose(): void { @@ -471,7 +516,7 @@ export class DefaultPreferencesEditor extends BaseTextEditor { @IWorkbenchEditorService private editorService: IWorkbenchEditorService, @IInstantiationService instantiationService: IInstantiationService, @IStorageService storageService: IStorageService, - @IConfigurationService configurationService: IConfigurationService, + @ITextResourceConfigurationService configurationService: ITextResourceConfigurationService, @IThemeService themeService: IThemeService, @IPreferencesService private preferencesService: IPreferencesService, @IModelService private modelService: IModelService, diff --git a/src/vs/workbench/parts/preferences/browser/preferencesRenderers.ts b/src/vs/workbench/parts/preferences/browser/preferencesRenderers.ts index bd29a6a03dff5d0c6de50db8b65844683b12e3ac..76f8884d71af32b1bd6310123c24be728ff3eb90 100644 --- a/src/vs/workbench/parts/preferences/browser/preferencesRenderers.ts +++ b/src/vs/workbench/parts/preferences/browser/preferencesRenderers.ts @@ -7,12 +7,10 @@ import { TPromise } from 'vs/base/common/winjs.base'; import * as nls from 'vs/nls'; import { Delayer } from 'vs/base/common/async'; import { Disposable, IDisposable, dispose } from 'vs/base/common/lifecycle'; -import { flatten, distinct } from 'vs/base/common/arrays'; -import { ArrayNavigator, INavigator } from 'vs/base/common/iterator'; import { IAction } from 'vs/base/common/actions'; import { IJSONSchema } from 'vs/base/common/jsonSchema'; import Event, { Emitter } from 'vs/base/common/event'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import * as editorCommon from 'vs/editor/common/editorCommon'; import { Range, IRange } from 'vs/editor/common/core/range'; import { IConfigurationRegistry, Extensions as ConfigurationExtensions } from 'vs/platform/configuration/common/configurationRegistry'; @@ -21,7 +19,7 @@ import { IPreferencesService, ISettingsGroup, ISetting, IPreferencesEditorModel, import { SettingsEditorModel, DefaultSettingsEditorModel } from 'vs/workbench/parts/preferences/common/preferencesModels'; import { ICodeEditor, IEditorMouseEvent, MouseTargetType } from 'vs/editor/browser/editorBrowser'; import { IContextMenuService, ContextSubMenu } from 'vs/platform/contextview/browser/contextView'; -import { SettingsGroupTitleWidget, EditPreferenceWidget } from 'vs/workbench/parts/preferences/browser/preferencesWidgets'; +import { SettingsGroupTitleWidget, EditPreferenceWidget, SettingsHeaderWidget } from 'vs/workbench/parts/preferences/browser/preferencesWidgets'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { RangeHighlightDecorations } from 'vs/workbench/common/editor/rangeDecorations'; import { IConfigurationEditingService, IConfigurationEditingError, ConfigurationEditingErrorCode, ConfigurationTarget } from 'vs/workbench/services/configuration/common/configurationEditing'; @@ -32,12 +30,11 @@ import { IWorkspaceConfigurationService } from 'vs/workbench/services/configurat import { IMessageService, Severity } from 'vs/platform/message/common/message'; import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; import { ICursorPositionChangedEvent } from 'vs/editor/common/controller/cursorEvents'; -import { ModelDecorationOptions } from "vs/editor/common/model/textModelWithDecorations"; +import { ModelDecorationOptions } from 'vs/editor/common/model/textModelWithDecorations'; export interface IPreferencesRenderer extends IDisposable { preferencesModel: IPreferencesEditorModel; associatedPreferencesModel: IPreferencesEditorModel; - iterator: INavigator; onFocusPreference: Event; onClearFocusPreference: Event; @@ -55,7 +52,7 @@ export class UserSettingsRenderer extends Disposable implements IPreferencesRend private settingHighlighter: SettingHighlighter; private editSettingActionRenderer: EditSettingRenderer; - private highlightPreferencesRenderer: HighlightPreferencesRenderer; + private highlightMatchesRenderer: HighlightMatchesRenderer; private modelChangeDelayer: Delayer = new Delayer(200); private _onFocusPreference: Emitter = new Emitter(); @@ -81,16 +78,12 @@ export class UserSettingsRenderer extends Disposable implements IPreferencesRend this._register(preferencesModel); this._register(associatedPreferencesModel); this.settingHighlighter = this._register(instantiationService.createInstance(SettingHighlighter, editor, this._onFocusPreference, this._onClearFocusPreference)); - this.highlightPreferencesRenderer = this._register(instantiationService.createInstance(HighlightPreferencesRenderer, editor)); + this.highlightMatchesRenderer = this._register(instantiationService.createInstance(HighlightMatchesRenderer, editor)); this.editSettingActionRenderer = this._register(this.instantiationService.createInstance(EditSettingRenderer, this.editor, this.preferencesModel, this.settingHighlighter)); this._register(this.editSettingActionRenderer.onUpdateSetting(({ key, value, source }) => this.updatePreference(key, value, source))); this._register(this.editor.getModel().onDidChangeContent(() => this.modelChangeDelayer.trigger(() => this.onModelChanged()))); } - public get iterator(): INavigator { - return null; - } - public render(): void { this.editSettingActionRenderer.render(this.preferencesModel.settingsGroups, this.associatedPreferencesModel); if (this.filterResult) { @@ -101,7 +94,7 @@ export class UserSettingsRenderer extends Disposable implements IPreferencesRend public updatePreference(key: string, value: any, source: ISetting): void { this.telemetryService.publicLog('defaultSettingsActions.copySetting', { userConfigurationKeys: [key] }); const overrideIdentifier = source.overrideOf ? overrideIdentifierFromKey(source.overrideOf.key) : null; - this.configurationEditingService.writeConfiguration(this.preferencesModel.configurationTarget, { key, value, overrideIdentifier }, { donotSave: this.textFileService.isDirty(this.preferencesModel.uri), donotNotifyError: true }) + this.configurationEditingService.writeConfiguration(this.preferencesModel.configurationTarget, { key, value }, { donotSave: this.textFileService.isDirty(this.preferencesModel.uri), donotNotifyError: true, scopes: { overrideIdentifier } }) .then(() => this.onSettingUpdated(source), error => { this.messageService.show(Severity.Error, this.toErrorMessage(error, this.preferencesModel.configurationTarget)); }); @@ -150,22 +143,8 @@ export class UserSettingsRenderer extends Disposable implements IPreferencesRend public filterPreferences(filterResult: IFilterResult): void { this.filterResult = filterResult; - this.highlightPreferencesRenderer.render([]); this.settingHighlighter.clear(true); - if (this.associatedPreferencesModel && filterResult) { - const settings = distinct(filterResult.filteredGroups.reduce((settings: ISetting[], settingsGroup: ISettingsGroup) => { - for (const section of settingsGroup.sections) { - for (const setting of section.settings) { - const s = this.getSetting(setting); - if (s) { - settings.push(s); - } - } - } - return settings; - }, [])); - this.highlightPreferencesRenderer.render(settings); - } + this.highlightMatchesRenderer.render(filterResult ? filterResult.matches : []); } public focusPreference(setting: ISetting): void { @@ -207,9 +186,9 @@ export class WorkspaceSettingsRenderer extends UserSettingsRenderer implements I export class DefaultSettingsRenderer extends Disposable implements IPreferencesRenderer { private settingHighlighter: SettingHighlighter; + private settingsHeaderRenderer: SettingsHeaderRenderer; private settingsGroupTitleRenderer: SettingsGroupTitleRenderer; private filteredMatchesRenderer: FilteredMatchesRenderer; - private filteredSettingsNavigationRenderer: FilteredSettingsNavigationRenderer; private hiddenAreasRenderer: HiddenAreasRenderer; private editSettingActionRenderer: EditSettingRenderer; @@ -222,6 +201,8 @@ export class DefaultSettingsRenderer extends Disposable implements IPreferencesR private _onClearFocusPreference: Emitter = new Emitter(); public readonly onClearFocusPreference: Event = this._onClearFocusPreference.event; + private filterResult: IFilterResult; + constructor(protected editor: ICodeEditor, public readonly preferencesModel: DefaultSettingsEditorModel, private _associatedPreferencesModel: IPreferencesEditorModel, @IPreferencesService protected preferencesService: IPreferencesService, @IWorkbenchEditorService private editorService: IWorkbenchEditorService, @@ -231,9 +212,9 @@ export class DefaultSettingsRenderer extends Disposable implements IPreferencesR this._register(preferencesModel); this._register(_associatedPreferencesModel); this.settingHighlighter = this._register(instantiationService.createInstance(SettingHighlighter, editor, this._onFocusPreference, this._onClearFocusPreference)); + this.settingsHeaderRenderer = this._register(instantiationService.createInstance(SettingsHeaderRenderer, editor)); this.settingsGroupTitleRenderer = this._register(instantiationService.createInstance(SettingsGroupTitleRenderer, editor)); this.filteredMatchesRenderer = this._register(instantiationService.createInstance(FilteredMatchesRenderer, editor)); - this.filteredSettingsNavigationRenderer = this._register(instantiationService.createInstance(FilteredSettingsNavigationRenderer, editor, this.settingHighlighter)); this.editSettingActionRenderer = this._register(instantiationService.createInstance(EditSettingRenderer, editor, preferencesModel, this.settingHighlighter)); this._register(this.editSettingActionRenderer.onUpdateSetting(e => this._onUpdatePreference.fire(e))); const paranthesisHidingRenderer = this._register(instantiationService.createInstance(StaticContentHidingRenderer, editor, preferencesModel.settingsGroups)); @@ -242,10 +223,6 @@ export class DefaultSettingsRenderer extends Disposable implements IPreferencesR this._register(this.settingsGroupTitleRenderer.onHiddenAreasChanged(() => this.hiddenAreasRenderer.render())); } - public get iterator(): INavigator { - return this.filteredSettingsNavigationRenderer; - } - public get associatedPreferencesModel(): IPreferencesEditorModel { return this._associatedPreferencesModel; } @@ -259,30 +236,66 @@ export class DefaultSettingsRenderer extends Disposable implements IPreferencesR this.settingsGroupTitleRenderer.render(this.preferencesModel.settingsGroups); this.editSettingActionRenderer.render(this.preferencesModel.settingsGroups, this._associatedPreferencesModel); this.hiddenAreasRenderer.render(); - this.filteredSettingsNavigationRenderer.render([]); + this.settingHighlighter.clear(true); this.settingsGroupTitleRenderer.showGroup(1); this.hiddenAreasRenderer.render(); } public filterPreferences(filterResult: IFilterResult): void { + this.filterResult = filterResult; if (!filterResult) { - this.filteredSettingsNavigationRenderer.render([]); + this.settingHighlighter.clear(true); this.filteredMatchesRenderer.render(null); + this.settingsHeaderRenderer.render(this.preferencesModel.settingsGroups); this.settingsGroupTitleRenderer.render(this.preferencesModel.settingsGroups); this.settingsGroupTitleRenderer.showGroup(1); this.editSettingActionRenderer.render(this.preferencesModel.settingsGroups, this._associatedPreferencesModel); } else { this.filteredMatchesRenderer.render(filterResult); + this.settingsHeaderRenderer.render(filterResult.filteredGroups); this.settingsGroupTitleRenderer.render(filterResult.filteredGroups); - this.filteredSettingsNavigationRenderer.render(filterResult.filteredGroups); + this.settingHighlighter.clear(true); this.editSettingActionRenderer.render(filterResult.filteredGroups, this._associatedPreferencesModel); } this.hiddenAreasRenderer.render(); } - public focusPreference(setting: ISetting): void { - this.settingsGroupTitleRenderer.showSetting(setting); - this.settingHighlighter.highlight(setting, true); + public focusPreference(s: ISetting): void { + const setting = this.getSetting(s); + if (setting) { + this.settingsGroupTitleRenderer.showSetting(setting); + this.settingHighlighter.highlight(setting, true); + } else { + this.settingHighlighter.clear(true); + } + } + + private getSetting(setting: ISetting): ISetting { + const { key, overrideOf } = setting; + if (overrideOf) { + const setting = this.getSetting(overrideOf); + for (const override of setting.overrides) { + if (override.key === key) { + return override; + } + } + return null; + } + const settingsGroups = this.filterResult ? this.filterResult.filteredGroups : this.preferencesModel.settingsGroups; + return this.getPreference(key, settingsGroups); + } + + private getPreference(key: string, settingsGroups: ISettingsGroup[]): ISetting { + for (const group of settingsGroups) { + for (const section of group.sections) { + for (const setting of section.settings) { + if (setting.key === key) { + return setting; + } + } + } + } + return null; } public clearFocus(setting: ISetting): void { @@ -334,6 +347,24 @@ export class StaticContentHidingRenderer extends Disposable implements HiddenAre } +class SettingsHeaderRenderer extends Disposable { + + private settingsHeaderWidget: SettingsHeaderWidget; + + constructor(private editor: ICodeEditor) { + super(); + this.settingsHeaderWidget = this._register(new SettingsHeaderWidget(editor, nls.localize('defaultSettingsTitle', "Default Settings"))); + } + + public render(settingsGroups: ISettingsGroup[]) { + if (settingsGroups.length) { + this.settingsHeaderWidget.setMessage(nls.localize('defaultSettingsMessage', "Place your settings in the file to the right to overwrite.")); + } else { + this.settingsHeaderWidget.setMessage(nls.localize('noSettingsFound', "No Settings Found.")); + } + } +} + export class SettingsGroupTitleRenderer extends Disposable implements HiddenAreasProvider { private _onHiddenAreasChanged: Emitter = new Emitter(); @@ -465,7 +496,7 @@ export class FilteredMatchesRenderer extends Disposable implements HiddenAreasPr if (result) { this.hiddenAreas = this.computeHiddenRanges(result.filteredGroups, result.allGroups, model); this.editor.changeDecorations(changeAccessor => { - this.decorationIds = changeAccessor.deltaDecorations(this.decorationIds, flatten(result.matches.values()).map(match => this.createDecoration(match, model))); + this.decorationIds = changeAccessor.deltaDecorations(this.decorationIds, result.matches.map(match => this.createDecoration(match, model))); }); } } @@ -547,7 +578,7 @@ export class FilteredMatchesRenderer extends Disposable implements HiddenAreasPr } } -export class HighlightPreferencesRenderer extends Disposable { +export class HighlightMatchesRenderer extends Disposable { private decorationIds: string[] = []; @@ -557,14 +588,14 @@ export class HighlightPreferencesRenderer extends Disposable { super(); } - public render(settings: ISetting[]): void { + public render(matches: IRange[]): void { const model = this.editor.getModel(); this.editor.changeDecorations(changeAccessor => { this.decorationIds = changeAccessor.deltaDecorations(this.decorationIds, []); }); - if (settings.length) { + if (matches.length) { this.editor.changeDecorations(changeAccessor => { - this.decorationIds = changeAccessor.deltaDecorations(this.decorationIds, settings.map(setting => this.createDecoration(setting.keyRange, model))); + this.decorationIds = changeAccessor.deltaDecorations(this.decorationIds, matches.map(match => this.createDecoration(match, model))); }); } } @@ -577,7 +608,7 @@ export class HighlightPreferencesRenderer extends Disposable { private createDecoration(range: IRange, model: editorCommon.IModel): editorCommon.IModelDeltaDecoration { return { range, - options: HighlightPreferencesRenderer._FIND_MATCH + options: HighlightMatchesRenderer._FIND_MATCH }; } @@ -591,50 +622,6 @@ export class HighlightPreferencesRenderer extends Disposable { } } -class FilteredSettingsNavigationRenderer extends Disposable implements INavigator { - - private iterator: ArrayNavigator; - - constructor(private editor: ICodeEditor, private settingHighlighter: SettingHighlighter) { - super(); - } - - public next(): ISetting { - return this.iterator.next() || this.iterator.first(); - } - - public previous(): ISetting { - return this.iterator.previous() || this.iterator.last(); - } - - public parent(): ISetting { - return this.iterator.parent(); - } - - public first(): ISetting { - return this.iterator.first(); - } - - public last(): ISetting { - return this.iterator.last(); - } - - public current(): ISetting { - return this.iterator.current(); - } - - public render(filteredGroups: ISettingsGroup[]) { - this.settingHighlighter.clear(true); - const settings: ISetting[] = []; - for (const group of filteredGroups) { - for (const section of group.sections) { - settings.push(...section.settings); - } - } - this.iterator = new ArrayNavigator(settings); - } -} - class EditSettingRenderer extends Disposable { private editPreferenceWidgetForCusorPosition: EditPreferenceWidget; diff --git a/src/vs/workbench/parts/preferences/browser/preferencesService.ts b/src/vs/workbench/parts/preferences/browser/preferencesService.ts index 436d010bd463feaccc9d0fb43d86d7b0490e3fad..05b44bc620dbb6296e3cdeaa71087254677c5ca3 100644 --- a/src/vs/workbench/parts/preferences/browser/preferencesService.ts +++ b/src/vs/workbench/parts/preferences/browser/preferencesService.ts @@ -8,7 +8,7 @@ import * as network from 'vs/base/common/network'; import { TPromise } from 'vs/base/common/winjs.base'; import * as nls from 'vs/nls'; import URI from 'vs/base/common/uri'; -import { LinkedMap as Map } from 'vs/base/common/map'; +import { ResourceMap } from 'vs/base/common/map'; import * as labels from 'vs/base/common/labels'; import * as strings from 'vs/base/common/strings'; import { Disposable } from 'vs/base/common/lifecycle'; @@ -31,7 +31,7 @@ import { SettingsEditorModel, DefaultSettingsEditorModel, DefaultKeybindingsEdit import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { DefaultPreferencesEditorInput, PreferencesEditorInput } from 'vs/workbench/parts/preferences/browser/preferencesEditor'; import { KeybindingsEditorInput } from 'vs/workbench/parts/preferences/browser/keybindingsEditor'; -import { ITextModelResolverService } from 'vs/editor/common/services/resolverService'; +import { ITextModelService } from 'vs/editor/common/services/resolverService'; import { getCodeEditor } from 'vs/editor/common/services/codeEditorService'; import { EditOperation } from 'vs/editor/common/core/editOperation'; import { Position, IPosition } from 'vs/editor/common/core/position'; @@ -52,7 +52,7 @@ export class PreferencesService extends Disposable implements IPreferencesServic _serviceBrand: any; // TODO:@sandy merge these models into editor inputs by extending resource editor model - private defaultPreferencesEditorModels: Map>>; + private defaultPreferencesEditorModels: ResourceMap>>; private lastOpenedSettingsInput: PreferencesEditorInput = null; constructor( @@ -67,14 +67,14 @@ export class PreferencesService extends Disposable implements IPreferencesServic @IStorageService private storageService: IStorageService, @IEnvironmentService private environmentService: IEnvironmentService, @ITelemetryService private telemetryService: ITelemetryService, - @ITextModelResolverService private textModelResolverService: ITextModelResolverService, + @ITextModelService private textModelResolverService: ITextModelService, @IConfigurationEditingService private configurationEditingService: IConfigurationEditingService, @IExtensionService private extensionService: IExtensionService, @IKeybindingService keybindingService: IKeybindingService, @IModelService private modelService: IModelService ) { super(); - this.defaultPreferencesEditorModels = new Map>>(); + this.defaultPreferencesEditorModels = new ResourceMap>>(); this.editorGroupService.onEditorsChanged(() => { const activeEditorInput = this.editorService.getActiveEditorInput(); if (activeEditorInput instanceof PreferencesEditorInput) { @@ -229,7 +229,7 @@ export class PreferencesService extends Disposable implements IPreferencesServic const resource = this.getEditableSettingsURI(configurationTarget); const editableSettingsEmptyContent = this.getEmptyEditableSettingsContent(configurationTarget); return this.createIfNotExists(resource, editableSettingsEmptyContent) - .then(() => this.editorService.createInput({ resource })); + .then(() => this.editorService.createInput({ resource })); } private createEditableSettingsEditorModel(configurationTarget: ConfigurationTarget): TPromise { @@ -271,7 +271,7 @@ export class PreferencesService extends Disposable implements IPreferencesServic return this.fileService.resolveContent(resource, { acceptTextOnly: true }).then(null, error => { if ((error).fileOperationResult === FileOperationResult.FILE_NOT_FOUND) { return this.fileService.updateContent(resource, contents).then(null, error => { - return TPromise.wrapError(new Error(nls.localize('fail.createSettings', "Unable to create '{0}' ({1}).", labels.getPathLabel(resource, this.contextService), error))); + return TPromise.wrapError(new Error(nls.localize('fail.createSettings', "Unable to create '{0}' ({1}).", labels.getPathLabel(resource, this.contextService, this.environmentService), error))); }); } @@ -289,15 +289,16 @@ export class PreferencesService extends Disposable implements IPreferencesServic private fetchMostCommonlyUsedSettings(): TPromise { return TPromise.wrap([ - 'editor.fontSize', 'files.autoSave', + 'editor.fontSize', 'editor.fontFamily', 'editor.tabSize', 'editor.renderWhitespace', - 'files.exclude', 'editor.cursorStyle', + 'editor.multiCursorModifier', 'editor.insertSpaces', 'editor.wordWrap', + 'files.exclude', 'files.associations' ]); } @@ -346,4 +347,4 @@ export class PreferencesService extends Disposable implements IPreferencesServic this.defaultPreferencesEditorModels.clear(); super.dispose(); } -} \ No newline at end of file +} diff --git a/src/vs/workbench/parts/preferences/browser/preferencesWidgets.ts b/src/vs/workbench/parts/preferences/browser/preferencesWidgets.ts index 1f802861a3167c360e0f7ad123c6d8e2e8645107..a62a6d31ae8420ed225848bb4fc8d0ec14d3d83c 100644 --- a/src/vs/workbench/parts/preferences/browser/preferencesWidgets.ts +++ b/src/vs/workbench/parts/preferences/browser/preferencesWidgets.ts @@ -27,7 +27,64 @@ import { attachInputBoxStyler, attachStylerCallback } from 'vs/platform/theme/co import { IThemeService } from 'vs/platform/theme/common/themeService'; import { Position } from 'vs/editor/common/core/position'; import { ICursorPositionChangedEvent } from 'vs/editor/common/controller/cursorEvents'; -import { buttonBackground, buttonForeground, badgeForeground, badgeBackground, contrastBorder, errorForeground } from "vs/platform/theme/common/colorRegistry"; +import { buttonBackground, buttonForeground, badgeForeground, badgeBackground, contrastBorder, errorForeground } from 'vs/platform/theme/common/colorRegistry'; + +export class SettingsHeaderWidget extends Widget implements IViewZone { + + private id: number; + private _domNode: HTMLElement; + + private titleContainer: HTMLElement; + private messageElement: HTMLElement; + + constructor(private editor: ICodeEditor, private title: string) { + super(); + this.create(); + this._register(this.editor.onDidChangeConfiguration(() => this.layout())); + this._register(this.editor.onDidLayoutChange(() => this.layout())); + } + + get domNode(): HTMLElement { + return this._domNode; + } + + get heightInLines(): number { + return 1; + } + + get afterLineNumber(): number { + return 0; + } + + private create() { + this._domNode = DOM.$('.settings-header-widget'); + + this.titleContainer = DOM.append(this._domNode, DOM.$('.title-container')); + DOM.append(this.titleContainer, DOM.$('.title')).textContent = this.title; + this.messageElement = DOM.append(this.titleContainer, DOM.$('.message')); + + this.editor.changeViewZones(accessor => { + this.id = accessor.addZone(this); + this.layout(); + }); + } + + public setMessage(message: string): void { + this.messageElement.textContent = message; + } + + private layout(): void { + const configuration = this.editor.getConfiguration(); + this.titleContainer.style.fontSize = configuration.fontInfo.fontSize + 'px'; + } + + public dispose() { + this.editor.changeViewZones(accessor => { + accessor.removeZone(this.id); + }); + super.dispose(); + } +} export class SettingsGroupTitleWidget extends Widget implements IViewZone { @@ -107,15 +164,14 @@ export class SettingsGroupTitleWidget extends Widget implements IViewZone { const layoutInfo = this.editor.getLayoutInfo(); this._domNode.style.width = layoutInfo.contentWidth - layoutInfo.verticalScrollbarWidth + 'px'; this.titleContainer.style.lineHeight = configuration.lineHeight + 3 + 'px'; + this.titleContainer.style.height = configuration.lineHeight + 3 + 'px'; this.titleContainer.style.fontSize = configuration.fontInfo.fontSize + 'px'; - const iconSize = this.getIconSize(); - this.icon.style.height = `${iconSize}px`; - this.icon.style.width = `${iconSize}px`; + this.icon.style.minWidth = `${this.getIconSize(16)}px`; } - private getIconSize(): number { + private getIconSize(minSize: number): number { const fontSize = this.editor.getConfiguration().fontInfo.fontSize; - return fontSize > 8 ? Math.max(fontSize, 16) : 12; + return fontSize > 8 ? Math.max(fontSize, minSize) : 12; } private onKeyDown(keyboardEvent: IKeyboardEvent): void { diff --git a/src/vs/workbench/parts/preferences/common/keybindingsEditorModel.ts b/src/vs/workbench/parts/preferences/common/keybindingsEditorModel.ts index 65379a3689fc2e22a3e8fc0c8438478ce1443aea..d2c0e40834b0fdb45045fbf93a46ec4c3614f4e0 100644 --- a/src/vs/workbench/parts/preferences/common/keybindingsEditorModel.ts +++ b/src/vs/workbench/parts/preferences/common/keybindingsEditorModel.ts @@ -9,9 +9,9 @@ import { distinct } from 'vs/base/common/arrays'; import * as strings from 'vs/base/common/strings'; import { OperatingSystem, language, LANGUAGE_DEFAULT } from 'vs/base/common/platform'; import { IMatch, IFilter, or, matchesContiguousSubString, matchesPrefix, matchesCamelCase, matchesWords } from 'vs/base/common/filters'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { ResolvedKeybinding, ResolvedKeybindingPart } from 'vs/base/common/keyCodes'; -import { AriaLabelProvider, UserSettingsLabelProvider, UILabelProvider, ModifierLabels as ModLabels } from 'vs/platform/keybinding/common/keybindingLabels'; +import { AriaLabelProvider, UserSettingsLabelProvider, UILabelProvider, ModifierLabels as ModLabels } from 'vs/base/common/keybindingLabels'; import { CommonEditorRegistry, EditorAction } from 'vs/editor/common/editorCommonExtensions'; import { MenuRegistry, ILocalizedString, SyncActionDescriptor, ICommandAction } from 'vs/platform/actions/common/actions'; import { IWorkbenchActionRegistry, Extensions as ActionExtensions } from 'vs/workbench/common/actionRegistry'; @@ -288,7 +288,7 @@ class KeybindingItemMatches { } private filterAndSort(matches: IMatch[]): IMatch[] { - return distinct(matches, (a => a.start + '.' + a.end)).filter(match => !matches.some(m => !(m.start === match.start && m.end === match.end) && (m.start <= match.start && m.end >= match.end))).sort((a, b) => a.start - b.start);; + return distinct(matches, (a => a.start + '.' + a.end)).filter(match => !matches.some(m => !(m.start === match.start && m.end === match.end) && (m.start <= match.start && m.end >= match.end))).sort((a, b) => a.start - b.start); } private matchesKeybinding(keybinding: ResolvedKeybinding, searchValue: string, words: string[]): KeybindingMatches { diff --git a/src/vs/workbench/parts/preferences/common/preferences.ts b/src/vs/workbench/parts/preferences/common/preferences.ts index 5465f7241d5b976d52ceec635c2277a0925a9bd3..ce53ec6f80b9d8d8dfb8cea718b8385e5e4a4429 100644 --- a/src/vs/workbench/parts/preferences/common/preferences.ts +++ b/src/vs/workbench/parts/preferences/common/preferences.ts @@ -5,7 +5,6 @@ import URI from 'vs/base/common/uri'; import { TPromise } from 'vs/base/common/winjs.base'; -import { LinkedMap as Map } from 'vs/base/common/map'; import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; import { RawContextKey } from 'vs/platform/contextkey/common/contextkey'; import { IEditor } from 'vs/platform/editor/common/editor'; @@ -41,7 +40,7 @@ export interface ISetting { export interface IFilterResult { filteredGroups: ISettingsGroup[]; allGroups: ISettingsGroup[]; - matches: Map; + matches: IRange[]; } export interface IPreferencesEditorModel { diff --git a/src/vs/workbench/parts/preferences/common/preferencesContentProvider.ts b/src/vs/workbench/parts/preferences/common/preferencesContentProvider.ts index a9c27604d3351fc4ebb0d15ac71bda8bbb54c2fa..6fff0beb5de937e9cd9525c34de847fa67cbb31d 100644 --- a/src/vs/workbench/parts/preferences/common/preferencesContentProvider.ts +++ b/src/vs/workbench/parts/preferences/common/preferencesContentProvider.ts @@ -10,9 +10,9 @@ import URI from 'vs/base/common/uri'; import { TPromise } from 'vs/base/common/winjs.base'; import { IModel } from 'vs/editor/common/editorCommon'; import JSONContributionRegistry = require('vs/platform/jsonschemas/common/jsonContributionRegistry'); -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { IWorkbenchContribution } from 'vs/workbench/common/contributions'; -import { ITextModelResolverService } from 'vs/editor/common/services/resolverService'; +import { ITextModelService } from 'vs/editor/common/services/resolverService'; import { IPreferencesService } from 'vs/workbench/parts/preferences/common/preferences'; const schemaRegistry = Registry.as(JSONContributionRegistry.Extensions.JSONContribution); @@ -21,7 +21,7 @@ export class PreferencesContentProvider implements IWorkbenchContribution { constructor( @IModelService private modelService: IModelService, - @ITextModelResolverService private textModelResolverService: ITextModelResolverService, + @ITextModelService private textModelResolverService: ITextModelService, @IPreferencesService private preferencesService: IPreferencesService, @IModeService private modeService: IModeService ) { @@ -60,4 +60,4 @@ export class PreferencesContentProvider implements IWorkbenchContribution { } }); } -} \ No newline at end of file +} diff --git a/src/vs/workbench/parts/preferences/common/preferencesModels.ts b/src/vs/workbench/parts/preferences/common/preferencesModels.ts index 26a195614447b3bda6901f033e231bd9cf7467cd..aea7dfe8ed825d1fb1dd799856aa0f2a1c0ff5d1 100644 --- a/src/vs/workbench/parts/preferences/common/preferencesModels.ts +++ b/src/vs/workbench/parts/preferences/common/preferencesModels.ts @@ -6,11 +6,10 @@ import * as nls from 'vs/nls'; import * as strings from 'vs/base/common/strings'; import { assign } from 'vs/base/common/objects'; -import { LinkedMap as Map } from 'vs/base/common/map'; import { distinct } from 'vs/base/common/arrays'; import URI from 'vs/base/common/uri'; import { IReference } from 'vs/base/common/lifecycle'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { visit, JSONVisitor } from 'vs/base/common/json'; import { IModel } from 'vs/editor/common/editorCommon'; import { IJSONSchema } from 'vs/base/common/jsonSchema'; @@ -31,7 +30,7 @@ class SettingMatches { public readonly matches: IRange[]; - constructor(searchString: string, setting: ISetting) { + constructor(searchString: string, setting: ISetting, private valuesMatcher: (filter: string, setting: ISetting) => IRange[]) { this.matches = distinct(this._findMatchesInSetting(searchString, setting), (match) => `${match.startLineNumber}_${match.startColumn}_${match.endLineNumber}_${match.endColumn}_`); } @@ -39,7 +38,7 @@ class SettingMatches { const result = this._doFindMatchesInSetting(searchString, setting); if (setting.overrides && setting.overrides.length) { for (const subSetting of setting.overrides) { - const subSettingMatches = new SettingMatches(searchString, subSetting); + const subSettingMatches = new SettingMatches(searchString, subSetting, this.valuesMatcher); let words = searchString.split(' '); const descriptionRanges: IRange[] = this.getRangesForWords(words, this.descriptionMatchingWords, [subSettingMatches.descriptionMatchingWords, subSettingMatches.keyMatchingWords, subSettingMatches.valueMatchingWords]); const keyRanges: IRange[] = this.getRangesForWords(words, this.keyMatchingWords, [subSettingMatches.descriptionMatchingWords, subSettingMatches.keyMatchingWords, subSettingMatches.valueMatchingWords]); @@ -75,7 +74,7 @@ class SettingMatches { const valueMatches = typeof setting.value === 'string' ? matchesContiguousSubString(word, setting.value) : null; if (valueMatches) { this.valueMatchingWords.set(word, valueMatches.map(match => this.toValueRange(setting, match))); - } else if (schema.enum && schema.enum.some(enumValue => typeof enumValue === 'string' && !!matchesContiguousSubString(word, enumValue))) { + } else if (schema && schema.enum && schema.enum.some(enumValue => typeof enumValue === 'string' && !!matchesContiguousSubString(word, enumValue))) { this.valueMatchingWords.set(word, []); } } @@ -96,6 +95,8 @@ class SettingMatches { if (setting.value && typeof setting.value === 'string') { const valueMatches = or(matchesPrefix, matchesContiguousSubString)(searchString, setting.value); valueRanges = valueMatches ? valueMatches.map(match => this.toValueRange(setting, match)) : this.getRangesForWords(words, this.valueMatchingWords, [this.keyMatchingWords, this.descriptionMatchingWords]); + } else { + valueRanges = this.valuesMatcher(searchString, setting); } return [...descriptionRanges, ...keyRanges, ...valueRanges]; @@ -125,9 +126,9 @@ class SettingMatches { private toDescriptionRange(setting: ISetting, match: IMatch, lineIndex: number): IRange { return { - startLineNumber: setting.descriptionRanges[lineIndex].startLineNumber + lineIndex, + startLineNumber: setting.descriptionRanges[lineIndex].startLineNumber, startColumn: setting.descriptionRanges[lineIndex].startColumn + match.start, - endLineNumber: setting.descriptionRanges[lineIndex].startLineNumber + lineIndex, + endLineNumber: setting.descriptionRanges[lineIndex].endLineNumber, endColumn: setting.descriptionRanges[lineIndex].startColumn + match.end }; } @@ -154,7 +155,7 @@ export abstract class AbstractSettingsModel extends EditorModel { return { filteredGroups: allGroups, allGroups, - matches: new Map() + matches: [] }; } @@ -163,11 +164,11 @@ export abstract class AbstractSettingsModel extends EditorModel { return { filteredGroups: [group], allGroups, - matches: new Map() + matches: [] }; } - const matches: Map = new Map(); + const matches: IRange[] = []; const filteredGroups: ISettingsGroup[] = []; const regex = strings.createRegExp(filter, false, { global: true }); for (const group of allGroups) { @@ -176,11 +177,11 @@ export abstract class AbstractSettingsModel extends EditorModel { for (const section of group.sections) { const settings: ISetting[] = []; for (const setting of section.settings) { - const settingMatches = new SettingMatches(filter, setting).matches; + const settingMatches = new SettingMatches(filter, setting, (filter, setting) => this.findValueMatches(filter, setting)).matches; if (groupMatched || settingMatches.length > 0) { settings.push(setting); } - matches.set(group.title + setting.key, settingMatches); + matches.push(...settingMatches); } if (settings.length) { sections.push({ @@ -225,6 +226,8 @@ export abstract class AbstractSettingsModel extends EditorModel { } public abstract settingsGroups: ISettingsGroup[]; + + protected abstract findValueMatches(filter: string, setting: ISetting): IRange[]; } export class SettingsEditorModel extends AbstractSettingsModel implements ISettingsEditorModel { @@ -264,6 +267,10 @@ export class SettingsEditorModel extends AbstractSettingsModel implements ISetti return this.doFilterSettings(filter, this.settingsGroups); } + protected findValueMatches(filter: string, setting: ISetting): IRange[] { + return this.model.findMatches(filter, setting.valueRange, false, false, null, false).map(match => match.range); + } + private parse() { const model = this.model; const settings: ISetting[] = []; @@ -329,7 +336,7 @@ export class SettingsEditorModel extends AbstractSettingsModel implements ISetti key: name, keyRange: { startLineNumber: settingStartPosition.lineNumber, - startColumn: settingStartPosition.column, + startColumn: settingStartPosition.column + 1, endLineNumber: settingStartPosition.lineNumber, endColumn: settingStartPosition.column + length }, @@ -630,10 +637,16 @@ export class DefaultSettingsEditorModel extends AbstractSettingsModel implements section.titleRange = { startLineNumber: sectionTitleStart, startColumn: 1, endLineNumber: this._contentByLines.length, endColumn: this._contentByLines[this._contentByLines.length - 1].length }; } - for (const setting of section.settings) { - this.pushSetting(setting, indent); - lastSetting = setting; + if (section.settings.length) { + for (const setting of section.settings) { + this.pushSetting(setting, indent); + lastSetting = setting; + } + } else { + this._contentByLines.push('// ' + nls.localize('noSettings', "No Settings")); + this._contentByLines.push(''); } + } group.range = { startLineNumber: groupStart, startColumn: 1, endLineNumber: this._contentByLines.length, endColumn: this._contentByLines[this._contentByLines.length - 1].length }; return lastSetting; @@ -694,6 +707,10 @@ export class DefaultSettingsEditorModel extends AbstractSettingsModel implements } } + protected findValueMatches(filter: string, setting: ISetting): IRange[] { + return []; + } + public dispose(): void { // Not disposable } diff --git a/src/vs/workbench/parts/preferences/test/common/keybindingsEditorModel.test.ts b/src/vs/workbench/parts/preferences/test/common/keybindingsEditorModel.test.ts index 5e76be8ea0089386ee35ac72d0171ded88fca123..f4b40dc2ba03c28150a8940788302dbbd4eaaae6 100644 --- a/src/vs/workbench/parts/preferences/test/common/keybindingsEditorModel.test.ts +++ b/src/vs/workbench/parts/preferences/test/common/keybindingsEditorModel.test.ts @@ -7,7 +7,7 @@ import * as assert from 'assert'; import * as uuid from 'vs/base/common/uuid'; import { TPromise } from 'vs/base/common/winjs.base'; import { OS, OperatingSystem } from 'vs/base/common/platform'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { Action } from 'vs/base/common/actions'; import { KeyCode, SimpleKeybinding, ChordKeybinding } from 'vs/base/common/keyCodes'; import { SyncActionDescriptor } from 'vs/platform/actions/common/actions'; diff --git a/src/vs/workbench/parts/quickopen/browser/commandsHandler.ts b/src/vs/workbench/parts/quickopen/browser/commandsHandler.ts index 5435cc3a6988f1c7788aa75a15780597a3de2a0d..3fa19760a420263f1fce87e039adad846370cc50 100644 --- a/src/vs/workbench/parts/quickopen/browser/commandsHandler.ts +++ b/src/vs/workbench/parts/quickopen/browser/commandsHandler.ts @@ -5,21 +5,20 @@ 'use strict'; -import 'vs/css!./media/commandsHandler'; import { TPromise } from 'vs/base/common/winjs.base'; import nls = require('vs/nls'); import arrays = require('vs/base/common/arrays'); import types = require('vs/base/common/types'); import { language, LANGUAGE_DEFAULT } from 'vs/base/common/platform'; -import { IAction, Action } from 'vs/base/common/actions'; +import { Action } from 'vs/base/common/actions'; import { toErrorMessage } from 'vs/base/common/errorMessage'; -import { Mode, IEntryRunContext, IAutoFocus } from 'vs/base/parts/quickopen/common/quickOpen'; -import { QuickOpenEntryGroup, IHighlight, QuickOpenModel } from 'vs/base/parts/quickopen/browser/quickOpenModel'; +import { Mode, IEntryRunContext, IAutoFocus, IModel, IQuickNavigateConfiguration } from 'vs/base/parts/quickopen/common/quickOpen'; +import { QuickOpenEntryGroup, IHighlight, QuickOpenModel, QuickOpenEntry } from 'vs/base/parts/quickopen/browser/quickOpenModel'; import { SyncActionDescriptor, IMenuService, MenuId, MenuItemAction } from 'vs/platform/actions/common/actions'; import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { IWorkbenchActionRegistry, Extensions as ActionExtensions } from 'vs/workbench/common/actionRegistry'; -import { Registry } from 'vs/platform/platform'; -import { QuickOpenHandler, QuickOpenAction } from 'vs/workbench/browser/quickopen'; +import { Registry } from 'vs/platform/registry/common/platform'; +import { QuickOpenHandler, IWorkbenchQuickOpenConfiguration } from 'vs/workbench/browser/quickopen'; import { IEditorAction, IEditor, isCommonCodeEditor, ICommonCodeEditor } from 'vs/editor/common/editorCommon'; import { matchesWords, matchesPrefix, matchesContiguousSubString, or } from 'vs/base/common/filters'; import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; @@ -28,20 +27,150 @@ import { IMessageService, Severity, IMessageWithAction } from 'vs/platform/messa import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { IQuickOpenService } from 'vs/platform/quickOpen/common/quickOpen'; -import { editorAction, EditorAction } from "vs/editor/common/editorCommonExtensions"; +import { editorAction, EditorAction } from 'vs/editor/common/editorCommonExtensions'; +import { IStorageService } from "vs/platform/storage/common/storage"; +import { ILifecycleService } from "vs/platform/lifecycle/common/lifecycle"; +import { once } from "vs/base/common/event"; +import { BoundedMap, ISerializedBoundedLinkedMap } from "vs/base/common/map"; +import { IConfigurationService } from "vs/platform/configuration/common/configuration"; +import { ResolvedKeybinding } from "vs/base/common/keyCodes"; export const ALL_COMMANDS_PREFIX = '>'; -export const EDITOR_COMMANDS_PREFIX = '$'; -const wordFilter = or(matchesPrefix, matchesWords, matchesContiguousSubString); +let lastCommandPaletteInput: string; +let commandHistory: BoundedMap; +let commandCounter = 1; + +function resolveCommandHistory(configurationService: IConfigurationService): number { + const config = configurationService.getConfiguration(); + + let commandHistory = config.workbench && config.workbench.commandPalette && config.workbench.commandPalette.history; + if (typeof commandHistory !== 'number') { + commandHistory = CommandsHistory.DEFAULT_COMMANDS_HISTORY_LENGTH; + } + + return commandHistory; +} + +class CommandsHistory { + + public static readonly DEFAULT_COMMANDS_HISTORY_LENGTH = 50; + + private static readonly PREF_KEY_CACHE = 'commandPalette.mru.cache'; + private static readonly PREF_KEY_COUNTER = 'commandPalette.mru.counter'; + + private commandHistoryLength: number; + + constructor( + @IStorageService private storageService: IStorageService, + @ILifecycleService private lifecycleService: ILifecycleService, + @IConfigurationService private configurationService: IConfigurationService + ) { + this.updateConfiguration(); + this.load(); + + this.registerListeners(); + } + + private updateConfiguration(): void { + this.commandHistoryLength = resolveCommandHistory(this.configurationService); + + if (commandHistory) { + commandHistory.setLimit(this.commandHistoryLength); + } + } + + private load(): void { + const raw = this.storageService.get(CommandsHistory.PREF_KEY_CACHE); + let deserializedCache: ISerializedBoundedLinkedMap; + if (raw) { + try { + deserializedCache = JSON.parse(raw); + } catch (error) { + // invalid data + } + } + + commandHistory = new BoundedMap(this.commandHistoryLength, 1, deserializedCache); + commandCounter = this.storageService.getInteger(CommandsHistory.PREF_KEY_COUNTER, void 0, commandCounter); + } + + private registerListeners(): void { + this.configurationService.onDidUpdateConfiguration(e => this.updateConfiguration()); + once(this.lifecycleService.onShutdown)(reason => this.save()); + } + + private save(): void { + this.storageService.store(CommandsHistory.PREF_KEY_CACHE, JSON.stringify(commandHistory.serialize())); + this.storageService.store(CommandsHistory.PREF_KEY_COUNTER, commandCounter); + } + + public push(commandId: string): void { -export class ShowAllCommandsAction extends QuickOpenAction { + // make MRU by deleting it first + commandHistory.delete(commandId); + + // set counter to command + commandHistory.set(commandId, commandCounter++); + } + + public get(commandId: string): number { + return commandHistory.get(commandId); + } +} + +export class ShowAllCommandsAction extends Action { public static ID = 'workbench.action.showCommands'; public static LABEL = nls.localize('showTriggerActions', "Show All Commands"); - constructor(actionId: string, actionLabel: string, @IQuickOpenService quickOpenService: IQuickOpenService) { - super(actionId, actionLabel, ALL_COMMANDS_PREFIX, quickOpenService); + constructor( + id: string, + label: string, + @IQuickOpenService private quickOpenService: IQuickOpenService, + @IConfigurationService private configurationService: IConfigurationService + ) { + super(id, label); + } + + public run(context?: any): TPromise { + const config = this.configurationService.getConfiguration(); + const restoreInput = config.workbench && config.workbench.commandPalette && config.workbench.commandPalette.preserveInput === true; + + // Show with last command palette input if any and configured + let value = ALL_COMMANDS_PREFIX; + if (restoreInput && lastCommandPaletteInput) { + value = `${value}${lastCommandPaletteInput}`; + } + + this.quickOpenService.show(value, { inputSelection: lastCommandPaletteInput ? { start: 1 /* after prefix */, end: value.length } : void 0 }); + + return TPromise.as(null); + } +} + +export class ClearCommandHistoryAction extends Action { + + public static ID = 'workbench.action.clearCommandHistory'; + public static LABEL = nls.localize('clearCommandHistory', "Clear Command History"); + + constructor( + id: string, + label: string, + @IStorageService private storageService: IStorageService, + @IConfigurationService private configurationService: IConfigurationService + ) { + super(id, label); + } + + public run(context?: any): TPromise { + const commandHistoryLength = resolveCommandHistory(this.configurationService); + if (commandHistoryLength > 0) { + commandHistory = new BoundedMap(commandHistoryLength); + commandCounter = 1; + } + + return TPromise.as(null); } } @@ -69,39 +198,34 @@ class CommandPaletteEditorAction extends EditorAction { } } -class BaseCommandEntry extends QuickOpenEntryGroup { - private commandId: string; - private keyLabel: string; - private keyAriaLabel: string; - private label: string; +abstract class BaseCommandEntry extends QuickOpenEntryGroup { private description: string; private alias: string; + private labelLowercase: string; + private keybindingAriaLabel: string; constructor( - commandId: string, - keyLabel: string, - keyAriaLabel: string, - label: string, + private commandId: string, + private keybinding: ResolvedKeybinding, + private label: string, alias: string, - labelHighlights: IHighlight[], - aliasHighlights: IHighlight[], + highlights: { label: IHighlight[], alias: IHighlight[] }, + private onBeforeRun: (commandId: string) => void, @IMessageService protected messageService: IMessageService, @ITelemetryService protected telemetryService: ITelemetryService ) { super(); - this.commandId = commandId; - this.keyLabel = keyLabel; - this.keyAriaLabel = keyAriaLabel; - this.label = label; + this.labelLowercase = this.label.toLowerCase(); + this.keybindingAriaLabel = keybinding ? keybinding.getAriaLabel() : void 0; - if (label !== alias) { + if (this.label !== alias) { this.alias = alias; } else { - aliasHighlights = null; + highlights.alias = null; } - this.setHighlights(labelHighlights, null, aliasHighlights); + this.setHighlights(highlights.label, null, highlights.alias); } public getCommandId(): string { @@ -112,6 +236,10 @@ class BaseCommandEntry extends QuickOpenEntryGroup { return this.label; } + public getSortLabel(): string { + return this.labelLowercase; + } + public getDescription(): string { return this.description; } @@ -120,22 +248,22 @@ class BaseCommandEntry extends QuickOpenEntryGroup { this.description = description; } + public getKeybinding(): ResolvedKeybinding { + return this.keybinding; + } + public getDetail(): string { return this.alias; } public getAriaLabel(): string { - if (this.keyAriaLabel) { - return nls.localize('entryAriaLabelWithKey', "{0}, {1}, commands", this.getLabel(), this.keyAriaLabel); + if (this.keybindingAriaLabel) { + return nls.localize('entryAriaLabelWithKey', "{0}, {1}, commands", this.getLabel(), this.keybindingAriaLabel); } return nls.localize('entryAriaLabel', "{0}, commands", this.getLabel()); } - public getGroupLabel(): string { - return this.keyLabel; - } - protected onError(error?: Error): void; protected onError(messagesWithAction?: IMessageWithAction): void; protected onError(arg1?: any): void { @@ -147,15 +275,32 @@ class BaseCommandEntry extends QuickOpenEntryGroup { } } - protected runAction(action: IAction): void { + public run(mode: Mode, context: IEntryRunContext): boolean { + if (mode === Mode.OPEN) { + this.runAction(this.getAction()); + + return true; + } + + return false; + } + + protected abstract getAction(): Action | IEditorAction; + + protected runAction(action: Action | IEditorAction): void { + + // Indicate onBeforeRun + this.onBeforeRun(this.commandId); // Use a timeout to give the quick open widget a chance to close itself first TPromise.timeout(50).done(() => { - if (action && action.enabled) { + if (action && (!(action instanceof Action) || action.enabled)) { try { this.telemetryService.publicLog('workbenchActionExecuted', { id: action.id, from: 'quick open' }); (action.run() || TPromise.as(null)).done(() => { - action.dispose(); + if (action instanceof Action) { + action.dispose(); + } }, err => this.onError(err)); } catch (error) { this.onError(error); @@ -168,138 +313,103 @@ class BaseCommandEntry extends QuickOpenEntryGroup { } class CommandEntry extends BaseCommandEntry { - private actionDescriptor: SyncActionDescriptor; constructor( commandId: string, - keyLabel: string, - keyAriaLabel: string, + keybinding: ResolvedKeybinding, label: string, meta: string, - labelHighlights: IHighlight[], - aliasHighlights: IHighlight[], - actionDescriptor: SyncActionDescriptor, + highlights: { label: IHighlight[], alias: IHighlight[] }, + private actionDescriptor: SyncActionDescriptor, + onBeforeRun: (commandId: string) => void, @IInstantiationService private instantiationService: IInstantiationService, @IMessageService messageService: IMessageService, @ITelemetryService telemetryService: ITelemetryService ) { - super(commandId, keyLabel, keyAriaLabel, label, meta, labelHighlights, aliasHighlights, messageService, telemetryService); - - this.actionDescriptor = actionDescriptor; + super(commandId, keybinding, label, meta, highlights, onBeforeRun, messageService, telemetryService); } - public run(mode: Mode, context: IEntryRunContext): boolean { - if (mode === Mode.OPEN) { - const action = this.instantiationService.createInstance(this.actionDescriptor.syncDescriptor); - this.runAction(action); - - return true; - } - - return false; + protected getAction(): Action | IEditorAction { + return this.instantiationService.createInstance(this.actionDescriptor.syncDescriptor); } } class EditorActionCommandEntry extends BaseCommandEntry { - private action: IEditorAction; constructor( commandId: string, - keyLabel: string, - keyAriaLabel: string, + keybinding: ResolvedKeybinding, label: string, meta: string, - labelHighlights: IHighlight[], - aliasHighlights: IHighlight[], - action: IEditorAction, + highlights: { label: IHighlight[], alias: IHighlight[] }, + private action: IEditorAction, + onBeforeRun: (commandId: string) => void, @IMessageService messageService: IMessageService, @ITelemetryService telemetryService: ITelemetryService ) { - super(commandId, keyLabel, keyAriaLabel, label, meta, labelHighlights, aliasHighlights, messageService, telemetryService); - - this.action = action; + super(commandId, keybinding, label, meta, highlights, onBeforeRun, messageService, telemetryService); } - public run(mode: Mode, context: IEntryRunContext): boolean { - if (mode === Mode.OPEN) { - // Use a timeout to give the quick open widget a chance to close itself first - TPromise.timeout(50).done(() => { - if (this.action) { - try { - this.telemetryService.publicLog('workbenchActionExecuted', { id: this.action.id, from: 'quick open' }); - (this.action.run() || TPromise.as(null)).done(null, err => this.onError(err)); - } catch (error) { - this.onError(error); - } - } else { - this.messageService.show(Severity.Info, nls.localize('actionNotEnabled', "Command '{0}' is not enabled in the current context.", this.getLabel())); - } - }, err => this.onError(err)); - - return true; - } - - return false; + protected getAction(): Action | IEditorAction { + return this.action; } } - class ActionCommandEntry extends BaseCommandEntry { - private action: IAction; constructor( commandId: string, - keyLabel: string, - keyAriaLabel: string, + keybinding: ResolvedKeybinding, label: string, alias: string, - labelHighlights: IHighlight[], - aliasHighlights: IHighlight[], - action: IAction, + highlights: { label: IHighlight[], alias: IHighlight[] }, + private action: Action, + onBeforeRun: (commandId: string) => void, @IMessageService messageService: IMessageService, @ITelemetryService telemetryService: ITelemetryService ) { - super(commandId, keyLabel, keyAriaLabel, label, alias, labelHighlights, aliasHighlights, messageService, telemetryService); - - this.action = action; + super(commandId, keybinding, label, alias, highlights, onBeforeRun, messageService, telemetryService); } - public run(mode: Mode, context: IEntryRunContext): boolean { - if (mode === Mode.OPEN) { - this.runAction(this.action); - - return true; - } - - return false; + protected getAction(): Action | IEditorAction { + return this.action; } } +const wordFilter = or(matchesPrefix, matchesWords, matchesContiguousSubString); + export class CommandsHandler extends QuickOpenHandler { + private lastSearchValue: string; + private commandHistoryEnabled: boolean; + private commandsHistory: CommandsHistory; constructor( @IWorkbenchEditorService private editorService: IWorkbenchEditorService, @IInstantiationService private instantiationService: IInstantiationService, @IKeybindingService private keybindingService: IKeybindingService, @IMenuService private menuService: IMenuService, - @IContextKeyService private contextKeyService: IContextKeyService + @IContextKeyService private contextKeyService: IContextKeyService, + @IConfigurationService private configurationService: IConfigurationService ) { super(); + + this.commandsHistory = this.instantiationService.createInstance(CommandsHistory); + + this.configurationService.onDidUpdateConfiguration(e => this.updateConfiguration()); + this.updateConfiguration(); } - protected includeWorkbenchCommands(): boolean { - return true; + private updateConfiguration(): void { + this.commandHistoryEnabled = resolveCommandHistory(this.configurationService) > 0; } public getResults(searchValue: string): TPromise { - searchValue = searchValue.trim(); + this.lastSearchValue = searchValue.trim(); - // Workbench Actions (if prefix asks for all commands) + // Workbench Actions let workbenchEntries: CommandEntry[] = []; - if (this.includeWorkbenchCommands()) { - const workbenchActions = Registry.as(ActionExtensions.WorkbenchActions).getWorkbenchActions(); - workbenchEntries = this.actionDescriptorsToEntries(workbenchActions, searchValue); - } + const workbenchActions = Registry.as(ActionExtensions.WorkbenchActions).getWorkbenchActions(); + workbenchEntries = this.actionDescriptorsToEntries(workbenchActions, searchValue); // Editor Actions const activeEditor = this.editorService.getActiveEditor(); @@ -340,8 +450,41 @@ export class CommandsHandler extends QuickOpenHandler { } }); - // Sort by name - entries = entries.sort((elementA, elementB) => elementA.getLabel().toLowerCase().localeCompare(elementB.getLabel().toLowerCase())); + // Sort by MRU order and fallback to name otherwie + entries = entries.sort((elementA, elementB) => { + const counterA = this.commandsHistory.get(elementA.getCommandId()); + const counterB = this.commandsHistory.get(elementB.getCommandId()); + + if (counterA && counterB) { + return counterA > counterB ? -1 : 1; // use more recently used command before older + } + + if (counterA) { + return -1; // first command was used, so it wins over the non used one + } + + if (counterB) { + return 1; // other command was used so it wins over the command + } + + // both commands were never used, so we sort by name + return elementA.getSortLabel().localeCompare(elementB.getSortLabel()); + }); + + // Introduce group marker border between recently used and others + // only if we have recently used commands in the result set + const firstEntry = entries[0]; + if (firstEntry && this.commandsHistory.get(firstEntry.getCommandId())) { + firstEntry.setGroupLabel(nls.localize('recentlyUsed', "recently used")); + for (let i = 1; i < entries.length; i++) { + const entry = entries[i]; + if (!this.commandsHistory.get(entry.getCommandId())) { + entry.setShowBorder(true); + entry.setGroupLabel(nls.localize('morecCommands', "other commands")); + break; + } + } + } return TPromise.as(new QuickOpenModel(entries)); } @@ -352,10 +495,6 @@ export class CommandsHandler extends QuickOpenHandler { for (let i = 0; i < actionDescriptors.length; i++) { const actionDescriptor = actionDescriptors[i]; - const keybinding = this.keybindingService.lookupKeybinding(actionDescriptor.id); - const keyLabel = keybinding ? keybinding.getLabel() : ''; - const keyAriaLabel = keybinding ? keybinding.getAriaLabel() : ''; - if (actionDescriptor.label) { // Label (with optional category) @@ -369,8 +508,9 @@ export class CommandsHandler extends QuickOpenHandler { const alias = (language !== LANGUAGE_DEFAULT) ? registry.getAlias(actionDescriptor.id) : null; const labelHighlights = wordFilter(searchValue, label); const aliasHighlights = alias ? wordFilter(searchValue, alias) : null; + if (labelHighlights || aliasHighlights) { - entries.push(this.instantiationService.createInstance(CommandEntry, actionDescriptor.id, keyLabel, keyAriaLabel, label, alias, labelHighlights, aliasHighlights, actionDescriptor)); + entries.push(this.instantiationService.createInstance(CommandEntry, actionDescriptor.id, this.keybindingService.lookupKeybinding(actionDescriptor.id), label, alias, { label: labelHighlights, alias: aliasHighlights }, actionDescriptor, id => this.onBeforeRunCommand(id))); } } } @@ -387,19 +527,16 @@ export class CommandsHandler extends QuickOpenHandler { continue; // avoid duplicates } - const keybinding = this.keybindingService.lookupKeybinding(action.id); - const keyLabel = keybinding ? keybinding.getLabel() : ''; - const keyAriaLabel = keybinding ? keybinding.getAriaLabel() : ''; const label = action.label; - if (label) { // Alias for non default languages const alias = (language !== LANGUAGE_DEFAULT) ? action.alias : null; const labelHighlights = wordFilter(searchValue, label); const aliasHighlights = alias ? wordFilter(searchValue, alias) : null; + if (labelHighlights || aliasHighlights) { - entries.push(this.instantiationService.createInstance(EditorActionCommandEntry, action.id, keyLabel, keyAriaLabel, label, alias, labelHighlights, aliasHighlights, action)); + entries.push(this.instantiationService.createInstance(EditorActionCommandEntry, action.id, this.keybindingService.lookupKeybinding(action.id), label, alias, { label: labelHighlights, alias: aliasHighlights }, action, id => this.onBeforeRunCommand(id))); } } } @@ -407,6 +544,15 @@ export class CommandsHandler extends QuickOpenHandler { return entries; } + private onBeforeRunCommand(commandId: string): void { + + // Remember as last command palette input + lastCommandPaletteInput = this.lastSearchValue; + + // Remember in commands history + this.commandsHistory.push(commandId); + } + private menuItemActionsToEntries(actions: MenuItemAction[], searchValue: string): ActionCommandEntry[] { const entries: ActionCommandEntry[] = []; @@ -420,9 +566,7 @@ export class CommandsHandler extends QuickOpenHandler { if (label) { const labelHighlights = wordFilter(searchValue, label); - const keybinding = this.keybindingService.lookupKeybinding(action.item.id); - const keyLabel = keybinding ? keybinding.getLabel() : ''; - const keyAriaLabel = keybinding ? keybinding.getAriaLabel() : ''; + // Add an 'alias' in original language when running in different locale const aliasTitle = (language !== LANGUAGE_DEFAULT && typeof action.item.title !== 'string') ? action.item.title.original : null; const aliasCategory = (language !== LANGUAGE_DEFAULT && category && typeof action.item.category !== 'string') ? action.item.category.original : null; @@ -433,8 +577,9 @@ export class CommandsHandler extends QuickOpenHandler { alias = aliasTitle; } const aliasHighlights = alias ? wordFilter(searchValue, alias) : null; + if (labelHighlights || aliasHighlights) { - entries.push(this.instantiationService.createInstance(ActionCommandEntry, action.id, keyLabel, keyAriaLabel, label, alias, labelHighlights, aliasHighlights, action)); + entries.push(this.instantiationService.createInstance(ActionCommandEntry, action.id, this.keybindingService.lookupKeybinding(action.item.id), label, alias, { label: labelHighlights, alias: aliasHighlights }, action, id => this.onBeforeRunCommand(id))); } } } @@ -442,25 +587,23 @@ export class CommandsHandler extends QuickOpenHandler { return entries; } - public getAutoFocus(searchValue: string): IAutoFocus { + public getAutoFocus(searchValue: string, context: { model: IModel, quickNavigateConfiguration?: IQuickNavigateConfiguration }): IAutoFocus { + let autoFocusPrefixMatch = searchValue.trim(); + + if (autoFocusPrefixMatch && this.commandHistoryEnabled) { + const firstEntry = context.model && context.model.entries[0]; + if (firstEntry instanceof BaseCommandEntry && this.commandsHistory.get(firstEntry.getCommandId())) { + autoFocusPrefixMatch = void 0; // keep focus on MRU element if we have history elements + } + } + return { autoFocusFirstEntry: true, - autoFocusPrefixMatch: searchValue.trim() + autoFocusPrefixMatch }; } - public getClass(): string { - return 'commands-handler'; - } - public getEmptyLabel(searchString: string): string { return nls.localize('noCommandsMatching', "No commands matching"); } -} - -export class EditorCommandsHandler extends CommandsHandler { - - protected includeWorkbenchCommands(): boolean { - return false; - } } \ No newline at end of file diff --git a/src/vs/workbench/parts/quickopen/browser/helpHandler.ts b/src/vs/workbench/parts/quickopen/browser/helpHandler.ts index fc9f6f724a57e45a8a22ee4556ec47ab8175b320..873703bbd7e6fb58cf6a7718692280f065c5588a 100644 --- a/src/vs/workbench/parts/quickopen/browser/helpHandler.ts +++ b/src/vs/workbench/parts/quickopen/browser/helpHandler.ts @@ -7,7 +7,7 @@ import { TPromise } from 'vs/base/common/winjs.base'; import nls = require('vs/nls'); import types = require('vs/base/common/types'); -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { Mode, IEntryRunContext, IAutoFocus } from 'vs/base/parts/quickopen/common/quickOpen'; import { QuickOpenModel, QuickOpenEntryGroup } from 'vs/base/parts/quickopen/browser/quickOpenModel'; import { IQuickOpenRegistry, Extensions, QuickOpenHandler } from 'vs/workbench/browser/quickopen'; diff --git a/src/vs/workbench/parts/quickopen/browser/quickopen.contribution.ts b/src/vs/workbench/parts/quickopen/browser/quickopen.contribution.ts index 154b5eb08c05dd30c0edd1b95d6b00138566f2ec..8d821da78dc15e321fce9ea441458822718c919c 100644 --- a/src/vs/workbench/parts/quickopen/browser/quickopen.contribution.ts +++ b/src/vs/workbench/parts/quickopen/browser/quickopen.contribution.ts @@ -8,18 +8,22 @@ import env = require('vs/base/common/platform'); import nls = require('vs/nls'); import { QuickOpenHandlerDescriptor, IQuickOpenRegistry, Extensions as QuickOpenExtensions } from 'vs/workbench/browser/quickopen'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { SyncActionDescriptor } from 'vs/platform/actions/common/actions'; import { IWorkbenchActionRegistry, Extensions as ActionExtensions } from 'vs/workbench/common/actionRegistry'; import { KeyMod, KeyCode } from 'vs/base/common/keyCodes'; import { GotoSymbolAction, GOTO_SYMBOL_PREFIX, SCOPE_PREFIX } from 'vs/workbench/parts/quickopen/browser/gotoSymbolHandler'; -import { ShowAllCommandsAction, ALL_COMMANDS_PREFIX } from 'vs/workbench/parts/quickopen/browser/commandsHandler'; +import { ShowAllCommandsAction, ALL_COMMANDS_PREFIX, ClearCommandHistoryAction } from 'vs/workbench/parts/quickopen/browser/commandsHandler'; import { GotoLineAction, GOTO_LINE_PREFIX } from 'vs/workbench/parts/quickopen/browser/gotoLineHandler'; import { HELP_PREFIX } from 'vs/workbench/parts/quickopen/browser/helpHandler'; import { VIEW_PICKER_PREFIX, OpenViewPickerAction, QuickOpenViewPickerAction } from 'vs/workbench/parts/quickopen/browser/viewPickerHandler'; +import { inQuickOpenContext, getQuickNavigateHandler } from "vs/workbench/browser/parts/quickopen/quickopen"; +import { ContextKeyExpr } from "vs/platform/contextkey/common/contextkey"; +import { KeybindingsRegistry } from "vs/platform/keybinding/common/keybindingsRegistry"; // Register Actions -let registry = Registry.as(ActionExtensions.WorkbenchActions); +const registry = Registry.as(ActionExtensions.WorkbenchActions); +registry.registerWorkbenchAction(new SyncActionDescriptor(ClearCommandHistoryAction, ClearCommandHistoryAction.ID, ClearCommandHistoryAction.LABEL), 'Clear Command History'); registry.registerWorkbenchAction(new SyncActionDescriptor(ShowAllCommandsAction, ShowAllCommandsAction.ID, ShowAllCommandsAction.LABEL, { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_P, secondary: [KeyCode.F1] @@ -32,12 +36,39 @@ registry.registerWorkbenchAction(new SyncActionDescriptor(GotoLineAction, GotoLi registry.registerWorkbenchAction(new SyncActionDescriptor(GotoSymbolAction, GotoSymbolAction.ID, GotoSymbolAction.LABEL, { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_O -}), 'Go to Symbol...'); +}), 'Go to Symbol in File...'); + +const inViewsPickerContextKey = 'inViewsPicker'; +const inViewsPickerContext = ContextKeyExpr.and(inQuickOpenContext, ContextKeyExpr.has(inViewsPickerContextKey)); + +const viewPickerKeybinding = { primary: KeyMod.CtrlCmd | KeyCode.KEY_Q, mac: { primary: KeyMod.WinCtrl | KeyCode.KEY_Q }, linux: { primary: null } }; registry.registerWorkbenchAction(new SyncActionDescriptor(OpenViewPickerAction, OpenViewPickerAction.ID, OpenViewPickerAction.LABEL), 'Open View'); -registry.registerWorkbenchAction(new SyncActionDescriptor(QuickOpenViewPickerAction, QuickOpenViewPickerAction.ID, QuickOpenViewPickerAction.LABEL, { - primary: KeyMod.CtrlCmd | KeyCode.KEY_Q, mac: { primary: KeyMod.WinCtrl | KeyCode.KEY_Q }, linux: { primary: null } -}), 'Quick Open View'); +registry.registerWorkbenchAction(new SyncActionDescriptor(QuickOpenViewPickerAction, QuickOpenViewPickerAction.ID, QuickOpenViewPickerAction.LABEL, viewPickerKeybinding), 'Quick Open View'); + +const quickOpenNavigateNextInViewPickerId = 'workbench.action.quickOpenNavigateNextInViewPicker'; +KeybindingsRegistry.registerCommandAndKeybindingRule({ + id: quickOpenNavigateNextInViewPickerId, + weight: KeybindingsRegistry.WEIGHT.workbenchContrib(50), + handler: getQuickNavigateHandler(quickOpenNavigateNextInViewPickerId, true), + when: inViewsPickerContext, + primary: viewPickerKeybinding.primary, + linux: viewPickerKeybinding.linux, + mac: viewPickerKeybinding.mac +}); + +const quickOpenNavigatePreviousInViewPickerId = 'workbench.action.quickOpenNavigatePreviousInViewPicker'; +KeybindingsRegistry.registerCommandAndKeybindingRule({ + id: quickOpenNavigatePreviousInViewPickerId, + weight: KeybindingsRegistry.WEIGHT.workbenchContrib(50), + handler: getQuickNavigateHandler(quickOpenNavigatePreviousInViewPickerId, false), + when: inViewsPickerContext, + primary: viewPickerKeybinding.primary | KeyMod.Shift, + linux: viewPickerKeybinding.linux, + mac: { + primary: viewPickerKeybinding.mac.primary | KeyMod.Shift + } +}); // Register Quick Open Handler @@ -46,6 +77,7 @@ Registry.as(QuickOpenExtensions.Quickopen).registerQuickOpen 'vs/workbench/parts/quickopen/browser/commandsHandler', 'CommandsHandler', ALL_COMMANDS_PREFIX, + 'inCommandsPicker', nls.localize('commandsHandlerDescriptionDefault', "Show and Run Commands") ) ); @@ -55,6 +87,7 @@ Registry.as(QuickOpenExtensions.Quickopen).registerQuickOpen 'vs/workbench/parts/quickopen/browser/gotoLineHandler', 'GotoLineHandler', GOTO_LINE_PREFIX, + null, [ { prefix: GOTO_LINE_PREFIX, @@ -70,6 +103,7 @@ Registry.as(QuickOpenExtensions.Quickopen).registerQuickOpen 'vs/workbench/parts/quickopen/browser/gotoSymbolHandler', 'GotoSymbolHandler', GOTO_SYMBOL_PREFIX, + 'inFileSymbolsPicker', [ { prefix: GOTO_SYMBOL_PREFIX, @@ -90,6 +124,7 @@ Registry.as(QuickOpenExtensions.Quickopen).registerQuickOpen 'vs/workbench/parts/quickopen/browser/helpHandler', 'HelpHandler', HELP_PREFIX, + null, nls.localize('helpDescription', "Show Help") ) ); @@ -99,6 +134,7 @@ Registry.as(QuickOpenExtensions.Quickopen).registerQuickOpen 'vs/workbench/parts/quickopen/browser/viewPickerHandler', 'ViewPickerHandler', VIEW_PICKER_PREFIX, + inViewsPickerContextKey, [ { prefix: VIEW_PICKER_PREFIX, diff --git a/src/vs/workbench/parts/quickopen/browser/viewPickerHandler.ts b/src/vs/workbench/parts/quickopen/browser/viewPickerHandler.ts index 084ed409ccbf2f815f0ab1d7f0a812cda10f563b..cf7a4d1841909b2492dcb611dc42b7f1171ceb7b 100644 --- a/src/vs/workbench/parts/quickopen/browser/viewPickerHandler.ts +++ b/src/vs/workbench/parts/quickopen/browser/viewPickerHandler.ts @@ -9,7 +9,7 @@ import nls = require('vs/nls'); import errors = require('vs/base/common/errors'); import strings = require('vs/base/common/strings'); import scorer = require('vs/base/common/scorer'); -import { Mode, IEntryRunContext, IAutoFocus, IQuickNavigateConfiguration } from 'vs/base/parts/quickopen/common/quickOpen'; +import { Mode, IEntryRunContext, IAutoFocus, IQuickNavigateConfiguration, IModel } from 'vs/base/parts/quickopen/common/quickOpen'; import { QuickOpenModel, QuickOpenEntryGroup, QuickOpenEntry } from 'vs/base/parts/quickopen/browser/quickOpenModel'; import { QuickOpenHandler, QuickOpenAction } from 'vs/workbench/browser/quickopen'; import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; @@ -165,9 +165,9 @@ export class ViewPickerHandler extends QuickOpenHandler { return viewEntries; } - public getAutoFocus(searchValue: string, quickNavigateConfiguration: IQuickNavigateConfiguration): IAutoFocus { + public getAutoFocus(searchValue: string, context: { model: IModel, quickNavigateConfiguration?: IQuickNavigateConfiguration }): IAutoFocus { return { - autoFocusFirstEntry: !!searchValue || !!quickNavigateConfiguration + autoFocusFirstEntry: !!searchValue || !!context.quickNavigateConfiguration }; } } @@ -200,7 +200,7 @@ export class QuickOpenViewPickerAction extends Action { super(id, label); } - public run(): TPromise { + public run(): TPromise { const keys = this.keybindingService.lookupKeybindings(this.id); this.quickOpenService.show(VIEW_PICKER_PREFIX, { quickNavigateConfiguration: { keybindings: keys } }); diff --git a/src/vs/workbench/parts/quickopen/common/quickopenActions.ts b/src/vs/workbench/parts/quickopen/common/quickopenActions.ts new file mode 100644 index 0000000000000000000000000000000000000000..9184e7eed50881d70edd0df5551ae51bd31ecd38 --- /dev/null +++ b/src/vs/workbench/parts/quickopen/common/quickopenActions.ts @@ -0,0 +1,54 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +'use strict'; + +import { TPromise } from 'vs/base/common/winjs.base'; +import nls = require('vs/nls'); +import { Action } from 'vs/base/common/actions'; +import { IQuickOpenService } from 'vs/platform/quickOpen/common/quickOpen'; +import { IConfigurationService } from "vs/platform/configuration/common/configuration"; + +export const ALL_COMMANDS_PREFIX = '>'; + +export class ShowTasksAction extends Action { + + public static ID = 'workbench.action.showTasks'; + public static LABEL = nls.localize('showTasks', "Show task menu"); + + constructor( + id: string, + label: string, + @IQuickOpenService private quickOpenService: IQuickOpenService, + @IConfigurationService private configurationService: IConfigurationService + ) { + super(id, label); + } + + public run(context?: any): TPromise { + const value = `${ALL_COMMANDS_PREFIX}tasks`; + this.quickOpenService.show(value); + + return TPromise.as(null); + } +} + +export class ShowTasksDocumentationAction extends Action { + + public static ID = 'workbench.action.showTaskDocumentation'; + public static LABEL = nls.localize('showTaskDocumentation', "Show task documentation"); + + constructor( + id: string, + label: string, + ) { + super(id, label); + } + + public run(context?: any): TPromise { + window.open('https://go.microsoft.com/fwlink/?LinkId=733558'); + return TPromise.as(null); + } +} diff --git a/src/vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.ts b/src/vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.ts index a4a4b1b9f8c008a1821ac3e228bb3df741297394..c869625333eaf0790cab9b0066f2cd7cb2929742 100644 --- a/src/vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.ts +++ b/src/vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.ts @@ -7,14 +7,14 @@ import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { IWorkbenchContributionsRegistry, IWorkbenchContribution, Extensions as WorkbenchExtensions } from 'vs/workbench/common/contributions'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { IMessageService } from 'vs/platform/message/common/message'; import { IPreferencesService } from 'vs/workbench/parts/preferences/common/preferences'; -import { IWindowsService, IWindowService } from 'vs/platform/windows/common/windows'; +import { IWindowsService, IWindowService, IWindowConfiguration } from 'vs/platform/windows/common/windows'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IWindowConfiguration } from "vs/workbench/electron-browser/common"; import { localize } from 'vs/nls'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; +import { IWorkspaceContextService } from "vs/platform/workspace/common/workspace"; interface IConfiguration extends IWindowConfiguration { update: { channel: string; }; @@ -29,6 +29,7 @@ export class SettingsChangeRelauncher implements IWorkbenchContribution { private nativeTabs: boolean; private updateChannel: string; private enableCrashReporter: boolean; + private rootCount: number; constructor( @IWindowsService private windowsService: IWindowsService, @@ -36,15 +37,18 @@ export class SettingsChangeRelauncher implements IWorkbenchContribution { @IConfigurationService private configurationService: IConfigurationService, @IPreferencesService private preferencesService: IPreferencesService, @IEnvironmentService private envService: IEnvironmentService, - @IMessageService private messageService: IMessageService + @IMessageService private messageService: IMessageService, + @IWorkspaceContextService private contextService: IWorkspaceContextService ) { + this.rootCount = this.contextService.hasWorkspace() ? this.contextService.getWorkspace2().roots.length : 0; this.onConfigurationChange(configurationService.getConfiguration(), false); this.registerListeners(); } private registerListeners(): void { - this.toDispose.push(this.configurationService.onDidUpdateConfiguration(e => this.onConfigurationChange(e.config, true))); + this.toDispose.push(this.configurationService.onDidUpdateConfiguration(e => this.onConfigurationChange(this.configurationService.getConfiguration(), true))); + this.toDispose.push(this.contextService.onDidChangeWorkspaceRoots(() => this.onDidChangeWorkspaceRoots())); } private onConfigurationChange(config: IConfiguration, notify: boolean): void { @@ -76,24 +80,55 @@ export class SettingsChangeRelauncher implements IWorkbenchContribution { // Notify only when changed and we are the focused window (avoids notification spam across windows) if (notify && changed) { - this.windowService.isFocused().then(focused => { - if (focused) { - const relaunch = this.messageService.confirm({ - type: 'info', - message: localize('relaunchMessage', "A setting has changed that requires a restart to take effect."), - detail: localize('relaunchDetail', "Press the restart button to restart {0} and enable the setting.", this.envService.appNameLong), - primaryButton: localize('restart', "Restart") - }); - - if (relaunch) { - this.windowsService.relaunch(Object.create(null)); - } - } - }); + this.doConfirm( + localize('relaunchSettingMessage', "A setting has changed that requires a restart to take effect."), + localize('relaunchSettingDetail', "Press the restart button to restart {0} and enable the setting.", this.envService.appNameLong), + localize('restart', "Restart"), + () => this.windowsService.relaunch(Object.create(null)) + ); + } + } + + private onDidChangeWorkspaceRoots(): void { + const newRootCount = this.contextService.hasWorkspace() ? this.contextService.getWorkspace2().roots.length : 0; + + let reload = false; + if (this.rootCount <= 1 && newRootCount > 1) { + reload = true; // transition: from 1 or 0 folders to 2+ + } else if (this.rootCount > 1 && newRootCount <= 1) { + reload = true; // transition: from 2+ folders to 1 or 0 } + + if (reload) { + this.doConfirm( + localize('relaunchWorkspaceMessage', "A workspace folder was added or removed and that requires a reload to take effect."), + localize('relaunchWorkspaceDetail', "Press the restart button to reload the window and enable the changes to the workspace.", this.envService.appNameLong), + localize('reload', "Reload"), + () => this.windowService.reloadWindow() + ); + } else { + this.rootCount = newRootCount; + } + } + + private doConfirm(message: string, detail: string, primaryButton: string, confirmed: () => void): void { + this.windowService.isFocused().then(focused => { + if (focused) { + const confirm = this.messageService.confirm({ + type: 'info', + message, + detail, + primaryButton + }); + + if (confirm) { + confirmed(); + } + } + }); } - getId(): string { + public getId(): string { return 'workbench.relauncher'; } diff --git a/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.ts b/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.ts index eaca7cc45e5e85f03460216e4ca80b343cad215c..32b3d1689d28644e686c899a79149db4ec83c405 100644 --- a/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.ts +++ b/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.ts @@ -15,18 +15,18 @@ import * as widget from 'vs/editor/browser/codeEditor'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IMessageService } from 'vs/platform/message/common/message'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; -import { ITextModelResolverService } from 'vs/editor/common/services/resolverService'; +import { ITextModelService } from 'vs/editor/common/services/resolverService'; import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IModelService } from 'vs/editor/common/services/modelService'; import { IEditorWorkerService } from 'vs/editor/common/services/editorWorkerService'; import URI from 'vs/base/common/uri'; import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService'; import { ISCMService } from 'vs/workbench/services/scm/common/scm'; -import { ModelDecorationOptions } from "vs/editor/common/model/textModelWithDecorations"; -import { registerThemingParticipant, ITheme, ICssStyleCollector } from "vs/platform/theme/common/themeService"; -import { registerColor } from "vs/platform/theme/common/colorRegistry"; -import { localize } from "vs/nls"; -import { Color } from "vs/base/common/color"; +import { ModelDecorationOptions } from 'vs/editor/common/model/textModelWithDecorations'; +import { registerThemingParticipant, ITheme, ICssStyleCollector } from 'vs/platform/theme/common/themeService'; +import { registerColor } from 'vs/platform/theme/common/colorRegistry'; +import { localize } from 'vs/nls'; +import { Color } from 'vs/base/common/color'; class DirtyDiffModelDecorator { @@ -74,7 +74,7 @@ class DirtyDiffModelDecorator { @IEditorWorkerService private editorWorkerService: IEditorWorkerService, @IWorkbenchEditorService private editorService: IWorkbenchEditorService, @IWorkspaceContextService private contextService: IWorkspaceContextService, - @ITextModelResolverService private textModelResolverService: ITextModelResolverService + @ITextModelService private textModelResolverService: ITextModelService ) { this.decorations = []; this.diffDelayer = new ThrottledDelayer(200); @@ -310,4 +310,4 @@ registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => { } `); } -}); \ No newline at end of file +}); diff --git a/src/vs/workbench/parts/scm/electron-browser/scm.contribution.ts b/src/vs/workbench/parts/scm/electron-browser/scm.contribution.ts index e4cedd1923c96e2107f88eff3cd37f6121e9643f..cf3f2c4cac552f39cbd0ae6fa0f61ad06c7784d8 100644 --- a/src/vs/workbench/parts/scm/electron-browser/scm.contribution.ts +++ b/src/vs/workbench/parts/scm/electron-browser/scm.contribution.ts @@ -8,7 +8,7 @@ import { localize } from 'vs/nls'; import { TPromise } from 'vs/base/common/winjs.base'; import { Action } from 'vs/base/common/actions'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } from 'vs/workbench/common/contributions'; import { DirtyDiffDecorator } from './dirtydiffDecorator'; import { IQuickOpenService, IPickOpenEntry } from 'vs/platform/quickOpen/common/quickOpen'; @@ -101,4 +101,4 @@ Registry.as(WorkbenchActionExtensions.WorkbenchActions ); Registry.as(WorkbenchActionExtensions.WorkbenchActions) - .registerWorkbenchAction(new SyncActionDescriptor(SwitchProvider, SwitchProvider.ID, SwitchProvider.LABEL), 'SCM: Switch Provider', 'SCM'); + .registerWorkbenchAction(new SyncActionDescriptor(SwitchProvider, SwitchProvider.ID, SwitchProvider.LABEL), 'SCM: Switch SCM Provider', 'SCM'); diff --git a/src/vs/workbench/parts/search/browser/openAnythingHandler.ts b/src/vs/workbench/parts/search/browser/openAnythingHandler.ts index cc77586caa21f9d92c7265bf2c52b450ef388e53..8c79b5fa0ead1e32dccb4cee49692463c2e432fc 100644 --- a/src/vs/workbench/parts/search/browser/openAnythingHandler.ts +++ b/src/vs/workbench/parts/search/browser/openAnythingHandler.ts @@ -116,7 +116,7 @@ export class OpenAnythingHandler extends QuickOpenHandler { } private registerListeners(): void { - this.configurationService.onDidUpdateConfiguration(e => this.updateHandlers(e.config)); + this.configurationService.onDidUpdateConfiguration(e => this.updateHandlers(this.configurationService.getConfiguration())); } private updateHandlers(configuration: IWorkbenchSearchConfiguration): void { @@ -161,13 +161,12 @@ export class OpenAnythingHandler extends QuickOpenHandler { const resultPromises: TPromise[] = []; // File Results - resultPromises.push(this.openFileHandler.getResults(searchValue, OpenAnythingHandler.MAX_DISPLAYED_RESULTS)); + const filePromise = this.openFileHandler.getResults(searchValue, OpenAnythingHandler.MAX_DISPLAYED_RESULTS); + resultPromises.push(filePromise); // Symbol Results (unless disabled or a range or absolute path is specified) if (this.includeSymbols && !searchWithRange) { resultPromises.push(this.openSymbolHandler.getResults(searchValue)); - } else { - resultPromises.push(TPromise.as(new QuickOpenModel())); // We need this empty promise because we are using the throttler below! } // Join and sort unified @@ -179,8 +178,8 @@ export class OpenAnythingHandler extends QuickOpenHandler { return TPromise.as(new QuickOpenModel()); } - // Combine file results and symbol results (if any) - const mergedResults = [...results[0].entries, ...results[1].entries]; + // Combine results. + const mergedResults = [].concat(...results.map(r => r.entries)); // Sort const unsortedResultTime = Date.now(); @@ -199,25 +198,20 @@ export class OpenAnythingHandler extends QuickOpenHandler { } }); - let fileSearchStats: ISearchStats; - if (results[0] instanceof FileQuickOpenModel) { - fileSearchStats = (results[0]).stats; - } else if (results[1] instanceof FileQuickOpenModel) { - fileSearchStats = (results[1]).stats; - } - const duration = new Date().getTime() - startTime; - const data = this.createTimerEventData(startTime, { - searchLength: searchValue.length, - unsortedResultTime, - sortedResultTime, - resultCount: mergedResults.length, - symbols: { fromCache: false }, - files: fileSearchStats + filePromise.then(fileModel => { + const data = this.createTimerEventData(startTime, { + searchLength: searchValue.length, + unsortedResultTime, + sortedResultTime, + resultCount: mergedResults.length, + symbols: { fromCache: false }, + files: fileModel.stats, + }); + + this.telemetryService.publicLog('openAnything', objects.assign(data, { duration })); }); - this.telemetryService.publicLog('openAnything', objects.assign(data, { duration })); - return TPromise.as(new QuickOpenModel(viewResults)); }, (error: Error) => { this.pendingSearch = null; diff --git a/src/vs/workbench/parts/search/browser/openFileHandler.ts b/src/vs/workbench/parts/search/browser/openFileHandler.ts index 28c61bbc3d44d4084556259ae4b0cd2d00260955..50532409b65adff53db5244d61b8ece81ac78948 100644 --- a/src/vs/workbench/parts/search/browser/openFileHandler.ts +++ b/src/vs/workbench/parts/search/browser/openFileHandler.ts @@ -31,7 +31,7 @@ import { IQueryOptions, ISearchService, ISearchStats, ISearchQuery } from 'vs/pl import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import { IRange } from 'vs/editor/common/core/range'; -import { getOutOfWorkspaceEditorResources } from "vs/workbench/parts/search/common/search"; +import { getOutOfWorkspaceEditorResources } from 'vs/workbench/parts/search/common/search'; export class FileQuickOpenModel extends QuickOpenModel { @@ -147,7 +147,6 @@ export class OpenFileHandler extends QuickOpenHandler { private doFindResults(searchValue: string, cacheKey?: string, maxSortedResults?: number): TPromise { const query: IQueryOptions = { - folderResources: this.contextService.hasWorkspace() ? [this.contextService.getWorkspace().resource] : [], extraFileResources: getOutOfWorkspaceEditorResources(this.editorGroupService, this.contextService), filePattern: searchValue, cacheKey: cacheKey @@ -163,7 +162,8 @@ export class OpenFileHandler extends QuickOpenHandler { iconClass = 'file'; // only use a generic file icon if we are forced to use an icon and have no icon theme set otherwise } - return this.searchService.search(this.queryBuilder.file(query)).then((complete) => { + const folderResources = this.contextService.hasWorkspace() ? this.contextService.getWorkspace2().roots : []; + return this.searchService.search(this.queryBuilder.file(folderResources, query)).then((complete) => { const results: QuickOpenEntry[] = []; for (let i = 0; i < complete.results.length; i++) { const fileMatch = complete.results[i]; @@ -189,7 +189,6 @@ export class OpenFileHandler extends QuickOpenHandler { private cacheQuery(cacheKey: string): ISearchQuery { const options: IQueryOptions = { - folderResources: this.contextService.hasWorkspace() ? [this.contextService.getWorkspace().resource] : [], extraFileResources: getOutOfWorkspaceEditorResources(this.editorGroupService, this.contextService), filePattern: '', cacheKey: cacheKey, @@ -197,7 +196,8 @@ export class OpenFileHandler extends QuickOpenHandler { sortByScore: true }; - const query = this.queryBuilder.file(options); + const folderResources = this.contextService.hasWorkspace() ? this.contextService.getWorkspace2().roots : []; + const query = this.queryBuilder.file(folderResources, options); this.searchService.extendQuery(query); return query; diff --git a/src/vs/workbench/parts/search/browser/replaceContributions.ts b/src/vs/workbench/parts/search/browser/replaceContributions.ts index d203010357bb09d98c896b7bc870f7358a50140e..8dd1c346aa3cff82736801d1d6f32572edd9edeb 100644 --- a/src/vs/workbench/parts/search/browser/replaceContributions.ts +++ b/src/vs/workbench/parts/search/browser/replaceContributions.ts @@ -5,7 +5,7 @@ import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { IReplaceService } from 'vs/workbench/parts/search/common/replace'; import { ReplaceService, ReplacePreviewContentProvider } from 'vs/workbench/parts/search/browser/replaceService'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } from 'vs/workbench/common/contributions'; export function registerContributions(): void { diff --git a/src/vs/workbench/parts/search/browser/replaceService.ts b/src/vs/workbench/parts/search/browser/replaceService.ts index 4fb0b6372c3f2c6cd4fd19481c3d0ad328197ccb..f94c704efdfa4c0e166515655103b928d5a86739 100644 --- a/src/vs/workbench/parts/search/browser/replaceService.ts +++ b/src/vs/workbench/parts/search/browser/replaceService.ts @@ -19,7 +19,7 @@ import { BulkEdit, IResourceEdit, createBulkEdit } from 'vs/editor/common/servic import { IProgressRunner } from 'vs/platform/progress/common/progress'; import { IDiffEditor } from 'vs/editor/browser/editorBrowser'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { ITextModelResolverService, ITextModelContentProvider } from 'vs/editor/common/services/resolverService'; +import { ITextModelService, ITextModelContentProvider } from 'vs/editor/common/services/resolverService'; import { IWorkbenchContribution } from 'vs/workbench/common/contributions'; import { IModel } from 'vs/editor/common/editorCommon'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; @@ -39,7 +39,7 @@ export class ReplacePreviewContentProvider implements ITextModelContentProvider, constructor( @IInstantiationService private instantiationService: IInstantiationService, - @ITextModelResolverService private textModelResolverService: ITextModelResolverService + @ITextModelService private textModelResolverService: ITextModelService ) { this.textModelResolverService.registerTextModelContentProvider(network.Schemas.internal, this); } @@ -60,7 +60,7 @@ class ReplacePreviewModel extends Disposable { constructor( @IModelService private modelService: IModelService, @IModeService private modeService: IModeService, - @ITextModelResolverService private textModelResolverService: ITextModelResolverService, + @ITextModelService private textModelResolverService: ITextModelService, @IReplaceService private replaceService: IReplaceService, @ISearchWorkbenchService private searchWorkbenchService: ISearchWorkbenchService ) { @@ -100,7 +100,7 @@ export class ReplaceService implements IReplaceService { @IFileService private fileService: IFileService, @IEditorService private editorService: IWorkbenchEditorService, @IInstantiationService private instantiationService: IInstantiationService, - @ITextModelResolverService private textModelResolverService: ITextModelResolverService, + @ITextModelService private textModelResolverService: ITextModelService, @ISearchWorkbenchService private searchWorkbenchService: ISearchWorkbenchService ) { } diff --git a/src/vs/workbench/parts/search/browser/search.contribution.ts b/src/vs/workbench/parts/search/browser/search.contribution.ts index 9cede51de89ee8f06842fffbe2ec7582a9396a43..2627a97b70e5c1863cafb744e53e625501050ae9 100644 --- a/src/vs/workbench/parts/search/browser/search.contribution.ts +++ b/src/vs/workbench/parts/search/browser/search.contribution.ts @@ -6,7 +6,7 @@ 'use strict'; import 'vs/css!./media/search.contribution'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { ViewletRegistry, Extensions as ViewletExtensions, ViewletDescriptor } from 'vs/workbench/browser/viewlet'; import { IConfigurationRegistry, Extensions as ConfigurationExtensions } from 'vs/platform/configuration/common/configurationRegistry'; @@ -15,7 +15,7 @@ import { IAction } from 'vs/base/common/actions'; import { explorerItemToFileResource } from 'vs/workbench/parts/files/common/files'; import { SyncActionDescriptor } from 'vs/platform/actions/common/actions'; import { Separator } from 'vs/base/browser/ui/actionbar/actionbar'; -import { Scope, IActionBarRegistry, Extensions as ActionBarExtensions, ActionBarContributor } from 'vs/workbench/browser/actionBarRegistry'; +import { Scope, IActionBarRegistry, Extensions as ActionBarExtensions, ActionBarContributor } from 'vs/workbench/browser/actions'; import { IWorkbenchActionRegistry, Extensions as ActionExtensions } from 'vs/workbench/common/actionRegistry'; import { QuickOpenHandlerDescriptor, IQuickOpenRegistry, Extensions as QuickOpenExtensions, QuickOpenAction } from 'vs/workbench/browser/quickopen'; import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry'; @@ -35,8 +35,8 @@ import { ISearchWorkbenchService, SearchWorkbenchService } from 'vs/workbench/pa import { CommandsRegistry } from 'vs/platform/commands/common/commands'; import { SearchViewlet } from 'vs/workbench/parts/search/browser/searchViewlet'; import { ListFocusContext } from 'vs/platform/list/browser/listService'; - import { IOutputChannelRegistry, Extensions as OutputExt } from 'vs/workbench/parts/output/common/output'; +import { defaultQuickOpenContextKey } from "vs/workbench/browser/parts/quickopen/quickopen"; registerSingleton(ISearchWorkbenchService, SearchWorkbenchService); replaceContributions(); @@ -274,6 +274,7 @@ Registry.as(QuickOpenExtensions.Quickopen).registerDefaultQu 'vs/workbench/parts/search/browser/openAnythingHandler', 'OpenAnythingHandler', '', + defaultQuickOpenContextKey, nls.localize('openAnythingHandlerDescription', "Go to File") ) ); @@ -283,6 +284,7 @@ Registry.as(QuickOpenExtensions.Quickopen).registerQuickOpen 'vs/workbench/parts/search/browser/openAnythingHandler', 'OpenSymbolHandler', ALL_SYMBOLS_PREFIX, + 'inWorkspaceSymbolsPicker', [ { prefix: ALL_SYMBOLS_PREFIX, diff --git a/src/vs/workbench/parts/search/browser/searchActions.ts b/src/vs/workbench/parts/search/browser/searchActions.ts index 46e865e5b8a41c804668e4c98cae5cf40cef18f8..3c6d6a799938bd3eb4faf6f04acbc35ab2cf28d5 100644 --- a/src/vs/workbench/parts/search/browser/searchActions.ts +++ b/src/vs/workbench/parts/search/browser/searchActions.ts @@ -28,8 +28,6 @@ import { toResource } from 'vs/workbench/common/editor'; import { ServicesAccessor, IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IListService } from 'vs/platform/list/browser/listService'; import { explorerItemToFileResource } from 'vs/workbench/parts/files/common/files'; -import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; -import { isEqual } from 'vs/platform/files/common/files'; import { OS } from 'vs/base/common/platform'; export function isSearchViewletFocussed(viewletService: IViewletService): boolean { @@ -263,7 +261,6 @@ export class FindInFolderAction extends Action { export const findInFolderCommand = (accessor: ServicesAccessor, resource?: URI) => { const listService = accessor.get(IListService); const viewletService = accessor.get(IViewletService); - const contextService = accessor.get(IWorkspaceContextService); if (!URI.isUri(resource)) { const focused = listService.getFocused() ? listService.getFocused().getFocus() : void 0; @@ -275,15 +272,9 @@ export const findInFolderCommand = (accessor: ServicesAccessor, resource?: URI) } } - if (!URI.isUri(resource) && contextService.hasWorkspace()) { - resource = contextService.getWorkspace().resource; - } - - if (URI.isUri(resource)) { - viewletService.openViewlet(Constants.VIEWLET_ID, true).then((viewlet: SearchViewlet) => { - viewlet.searchInFolder(resource); - }).done(null, errors.onUnexpectedError); - } + viewletService.openViewlet(Constants.VIEWLET_ID, true).then((viewlet: SearchViewlet) => { + viewlet.searchInFolder(resource); + }).done(null, errors.onUnexpectedError); }; export class RefreshAction extends Action { @@ -525,7 +516,7 @@ export class ReplaceAction extends AbstractSearchAndReplaceAction { private hasToOpenFile(): boolean { const file = toResource(this.editorService.getActiveEditorInput(), { filter: 'file' }); if (file) { - return isEqual(file.fsPath, this.element.parent().resource().fsPath); + return paths.isEqual(file.fsPath, this.element.parent().resource().fsPath); } return false; } diff --git a/src/vs/workbench/parts/search/browser/searchResultsView.ts b/src/vs/workbench/parts/search/browser/searchResultsView.ts index 48452fee61fdadd6433dde443f6c0e8c11f49849..fdda976d12a06e60dbbcb10cdc44eeedf67983ba 100644 --- a/src/vs/workbench/parts/search/browser/searchResultsView.ts +++ b/src/vs/workbench/parts/search/browser/searchResultsView.ts @@ -19,8 +19,9 @@ import { Range } from 'vs/editor/common/core/range'; import { SearchViewlet } from 'vs/workbench/parts/search/browser/searchViewlet'; import { RemoveAction, ReplaceAllAction, ReplaceAction } from 'vs/workbench/parts/search/browser/searchActions'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { attachBadgeStyler } from "vs/platform/theme/common/styler"; -import { IThemeService } from "vs/platform/theme/common/themeService"; +import { attachBadgeStyler } from 'vs/platform/theme/common/styler'; +import { IThemeService } from 'vs/platform/theme/common/themeService'; +import { getPathLabel } from "vs/base/common/labels"; export class SearchDataSource implements IDataSource { @@ -232,7 +233,7 @@ export class SearchAccessibilityProvider implements IAccessibilityProvider { public getAriaLabel(tree: ITree, element: FileMatchOrMatch): string { if (element instanceof FileMatch) { - const path = this.contextService.toWorkspaceRelativePath(element.resource()) || element.resource().fsPath; + const path = getPathLabel(element.resource(), this.contextService) || element.resource().fsPath; return nls.localize('fileMatchAriaLabel', "{0} matches in file {1} of folder {2}, Search result", element.count(), element.name(), paths.dirname(path)); } diff --git a/src/vs/workbench/parts/search/browser/searchViewlet.ts b/src/vs/workbench/parts/search/browser/searchViewlet.ts index ed2a0c9f95356f408bbe66fb2b223b3c8e5cbf5c..8723e84976acbd16a9ee71df3c3a0aadc7523c55 100644 --- a/src/vs/workbench/parts/search/browser/searchViewlet.ts +++ b/src/vs/workbench/parts/search/browser/searchViewlet.ts @@ -9,7 +9,7 @@ import 'vs/css!./media/searchviewlet'; import nls = require('vs/nls'); import { TPromise } from 'vs/base/common/winjs.base'; import { Emitter, debounceEvent } from 'vs/base/common/event'; -import { ICommonCodeEditor, isCommonCodeEditor } from 'vs/editor/common/editorCommon'; +import { ICommonCodeEditor, isCommonCodeEditor, isCommonDiffEditor } from 'vs/editor/common/editorCommon'; import lifecycle = require('vs/base/common/lifecycle'); import errors = require('vs/base/common/errors'); import aria = require('vs/base/browser/ui/aria/aria'); @@ -38,7 +38,7 @@ import { IStorageService, StorageScope } from 'vs/platform/storage/common/storag import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IContextViewService } from 'vs/platform/contextview/browser/contextView'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IMessageService } from 'vs/platform/message/common/message'; +import { IMessageService, IConfirmation } from 'vs/platform/message/common/message'; import { IProgressService } from 'vs/platform/progress/common/progress'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey'; @@ -56,11 +56,11 @@ import * as Constants from 'vs/workbench/parts/search/common/constants'; import { IListService } from 'vs/platform/list/browser/listService'; import { IThemeService, ITheme, ICssStyleCollector, registerThemingParticipant } from 'vs/platform/theme/common/themeService'; import { editorFindMatchHighlight, diffInserted, diffRemoved, diffInsertedOutline, diffRemovedOutline, activeContrastBorder } from 'vs/platform/theme/common/colorRegistry'; -import FileResultsNavigation from 'vs/workbench/browser/fileResultsNavigation'; +import FileResultsNavigation from 'vs/workbench/parts/files/browser/fileResultsNavigation'; import { attachListStyler } from 'vs/platform/theme/common/styler'; import { IOutputService } from 'vs/workbench/parts/output/common/output'; import { Color } from 'vs/base/common/color'; -import { getOutOfWorkspaceEditorResources } from "vs/workbench/parts/search/common/search"; +import { getOutOfWorkspaceEditorResources } from 'vs/workbench/parts/search/common/search'; export class SearchViewlet extends Viewlet { @@ -139,7 +139,7 @@ export class SearchViewlet extends Viewlet { this.toUnbind.push(this.fileService.onFileChanges(e => this.onFilesChanged(e))); this.toUnbind.push(this.untitledEditorService.onDidChangeDirty(e => this.onUntitledDidChangeDirty(e))); - this.toUnbind.push(this.configurationService.onDidUpdateConfiguration(e => this.onConfigurationUpdated(e.config))); + this.toUnbind.push(this.configurationService.onDidUpdateConfiguration(e => this.onConfigurationUpdated())); this.selectCurrentMatchEmitter = new Emitter(); debounceEvent(this.selectCurrentMatchEmitter.event, (l, e) => e, 100, /*leading=*/true) @@ -148,8 +148,13 @@ export class SearchViewlet extends Viewlet { this.delayedRefresh = new Delayer(250); } - private onConfigurationUpdated(configuration: any): void { - this.updateGlobalPatternExclusions(configuration); + private onConfigurationUpdated(): void { + // TODO + // const workspace = this.contextService.getWorkspace2(); + // workspace.roots.forEach(root => { + // const config = this.configurationService.getConfiguration(undefined, { resource: root }); + // }) + // this.updateGlobalPatternExclusions(configuration); } public create(parent: Builder): TPromise { @@ -210,7 +215,7 @@ export class SearchViewlet extends Viewlet { this.onQueryChanged(false); }); - this.inputPatternIncludes.onSubmit(() => this.onQueryChanged(true)); + this.inputPatternIncludes.onSubmit(() => this.onQueryChanged(true, true)); this.trackInputBox(this.inputPatternIncludes.inputFocusTracker); }); @@ -233,7 +238,7 @@ export class SearchViewlet extends Viewlet { this.onQueryChanged(false); }); - this.inputPatternExclusions.onSubmit(() => this.onQueryChanged(true)); + this.inputPatternExclusions.onSubmit(() => this.onQueryChanged(true, true)); this.trackInputBox(this.inputPatternExclusions.inputFocusTracker); }); @@ -334,7 +339,13 @@ export class SearchViewlet extends Viewlet { private onReplaceToggled(): void { this.layout(this.size); - this.storageService.store(SearchViewlet.SHOW_REPLACE_STORAGE_KEY, this.searchAndReplaceWidget.isReplaceShown(), StorageScope.WORKSPACE); + + const isReplaceShown = this.searchAndReplaceWidget.isReplaceShown(); + if (!isReplaceShown) { + this.storageService.store(SearchViewlet.SHOW_REPLACE_STORAGE_KEY, false, StorageScope.WORKSPACE); + } else { + this.storageService.remove(SearchViewlet.SHOW_REPLACE_STORAGE_KEY); + } } private onSearchResultsChanged(event?: IChangeEvent): TPromise { @@ -368,10 +379,11 @@ export class SearchViewlet extends Viewlet { let replaceValue = this.searchWidget.getReplaceValue() || ''; let afterReplaceAllMessage = this.buildAfterReplaceAllMessage(occurrences, fileCount, replaceValue); - let confirmation = { + let confirmation: IConfirmation = { title: nls.localize('replaceAll.confirmation.title', "Replace All"), message: this.buildReplaceAllConfirmationMessage(occurrences, fileCount, replaceValue), - primaryButton: nls.localize('replaceAll.confirm.button', "Replace") + primaryButton: nls.localize('replaceAll.confirm.button', "Replace"), + type: 'question' }; if (this.messageService.confirm(confirmation)) { @@ -498,7 +510,7 @@ export class SearchViewlet extends Viewlet { } })); - this.toUnbind.push(this.tree.addListener('focus', (event: any) => { + this.toUnbind.push(this.tree.onDOMFocus(e => { const focus = this.tree.getFocus(); this.firstMatchFocussed.set(this.tree.getNavigator().first() === this.tree.getFocus()); this.fileMatchOrMatchFocussed.set(true); @@ -797,7 +809,15 @@ export class SearchViewlet extends Viewlet { return null; } - let editorControl: any = this.editorService.getActiveEditor().getControl(); + let editorControl = this.editorService.getActiveEditor().getControl(); + if (isCommonDiffEditor(editorControl)) { + if (editorControl.getOriginalEditor().isFocused()) { + editorControl = editorControl.getOriginalEditor(); + } else { + editorControl = editorControl.getModifiedEditor(); + } + } + if (!isCommonCodeEditor(editorControl)) { return null; } @@ -874,13 +894,9 @@ export class SearchViewlet extends Viewlet { } } - public searchInFolder(resource: URI): void { - const workspace = this.contextService.getWorkspace(); - if (!workspace) { - return; - } - - if (workspace.resource.toString() === resource.toString()) { + public searchInFolder(resource?: URI): void { + const workspaceRelativePath = this.contextService.toWorkspaceRelativePath(resource); + if (!workspaceRelativePath || workspaceRelativePath === '.') { this.inputPatternIncludes.setValue(''); this.searchWidget.focus(); return; @@ -889,12 +905,10 @@ export class SearchViewlet extends Viewlet { if (!this.showsFileTypes()) { this.toggleQueryDetails(true, true); } - const workspaceRelativePath = this.contextService.toWorkspaceRelativePath(resource); - if (workspaceRelativePath) { - this.inputPatternIncludes.setIsGlobPattern(false); - this.inputPatternIncludes.setValue('./' + workspaceRelativePath); - this.searchWidget.focus(false); - } + + this.inputPatternIncludes.setIsGlobPattern(false); + this.inputPatternIncludes.setValue('./' + workspaceRelativePath); + this.searchWidget.focus(false); } public onQueryChanged(rerunQuery: boolean, preserveFocus?: boolean): void { @@ -902,8 +916,8 @@ export class SearchViewlet extends Viewlet { const isWholeWords = this.searchWidget.searchInput.getWholeWords(); const isCaseSensitive = this.searchWidget.searchInput.getCaseSensitive(); const contentPattern = this.searchWidget.searchInput.getValue(); - const patternExcludes = this.inputPatternExclusions.getValue().trim(); - const patternIncludes = this.inputPatternIncludes.getValue().trim(); + const excludePatternText = this.inputPatternExclusions.getValue().trim(); + const includePatternText = this.inputPatternIncludes.getValue().trim(); const useIgnoreFiles = this.inputPatternExclusions.useIgnoreFiles(); const useExcludeSettings = this.inputPatternExclusions.useExcludeSettings(); @@ -941,7 +955,6 @@ export class SearchViewlet extends Viewlet { const { expression: includePattern, searchPaths } = this.inputPatternIncludes.getGlob(); const options: IQueryOptions = { - folderResources: this.contextService.hasWorkspace() ? [this.contextService.getWorkspace().resource] : [], extraFileResources: getOutOfWorkspaceEditorResources(this.editorGroupService, this.contextService), excludePattern, includePattern, @@ -951,14 +964,15 @@ export class SearchViewlet extends Viewlet { searchPaths }; - this.onQueryTriggered(this.queryBuilder.text(content, options), patternExcludes, patternIncludes); + const folderResources = this.contextService.hasWorkspace() ? this.contextService.getWorkspace2().roots : []; + this.onQueryTriggered(this.queryBuilder.text(content, folderResources, options), excludePatternText, includePatternText); if (!preserveFocus) { this.searchWidget.focus(false); // focus back to input field } } - private onQueryTriggered(query: ISearchQuery, excludePattern: string, includePattern: string): void { + private onQueryTriggered(query: ISearchQuery, excludePatternText: string, includePatternText: string): void { this.viewModel.cancelSearch(); // Progress total is 100.0% for more progress bar granularity @@ -1019,18 +1033,18 @@ export class SearchViewlet extends Viewlet { } if (!hasResults) { - let hasExcludes = !!excludePattern; - let hasIncludes = !!includePattern; + let hasExcludes = !!excludePatternText; + let hasIncludes = !!includePatternText; let message: string; if (!completed) { message = nls.localize('searchCanceled', "Search was canceled before any results could be found - "); } else if (hasIncludes && hasExcludes) { - message = nls.localize('noResultsIncludesExcludes', "No results found in '{0}' excluding '{1}' - ", includePattern, excludePattern); + message = nls.localize('noResultsIncludesExcludes', "No results found in '{0}' excluding '{1}' - ", includePatternText, excludePatternText); } else if (hasIncludes) { - message = nls.localize('noResultsIncludes', "No results found in '{0}' - ", includePattern); + message = nls.localize('noResultsIncludes', "No results found in '{0}' - ", includePatternText); } else if (hasExcludes) { - message = nls.localize('noResultsExcludes', "No results found excluding '{0}' - ", excludePattern); + message = nls.localize('noResultsExcludes', "No results found excluding '{0}' - ", excludePatternText); } else { message = nls.localize('noResultsFound', "No results found. Review your settings for configured exclusions - "); } diff --git a/src/vs/workbench/parts/search/common/search.ts b/src/vs/workbench/parts/search/common/search.ts index 19cd463c84690b88312fcd05cbbc40f3b50c0bad..a6f98af6b2243e0cf071f2d9edf41d1a4ed1d32f 100644 --- a/src/vs/workbench/parts/search/common/search.ts +++ b/src/vs/workbench/parts/search/common/search.ts @@ -12,10 +12,10 @@ import { CommonEditorRegistry } from 'vs/editor/common/editorCommonExtensions'; import { ISearchConfiguration } from 'vs/platform/search/common/search'; import glob = require('vs/base/common/glob'); import { SymbolInformation } from 'vs/editor/common/modes'; -import { IEditorGroupService } from "vs/workbench/services/group/common/groupService"; -import { IWorkspaceContextService } from "vs/platform/workspace/common/workspace"; -import URI from "vs/base/common/uri"; -import { toResource } from "vs/workbench/common/editor"; +import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService'; +import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; +import URI from 'vs/base/common/uri'; +import { toResource } from 'vs/workbench/common/editor'; export interface IWorkspaceSymbolProvider { provideWorkspaceSymbols(search: string): TPromise; diff --git a/src/vs/workbench/parts/search/common/searchModel.ts b/src/vs/workbench/parts/search/common/searchModel.ts index 87dae50f90edece019ec74e324d1762a066006c2..48ed4a14de60aefe482cd8057d7fcabd2c57a98a 100644 --- a/src/vs/workbench/parts/search/common/searchModel.ts +++ b/src/vs/workbench/parts/search/common/searchModel.ts @@ -11,8 +11,7 @@ import { RunOnceScheduler } from 'vs/base/common/async'; import { IDisposable, Disposable } from 'vs/base/common/lifecycle'; import { TPromise, PPromise } from 'vs/base/common/winjs.base'; import URI from 'vs/base/common/uri'; -import { LinkedMap } from 'vs/base/common/map'; -import { ArraySet } from 'vs/base/common/set'; +import { values, ResourceMap } from 'vs/base/common/map'; import Event, { Emitter, fromPromise, stopwatch, any } from 'vs/base/common/event'; import { ISearchService, ISearchProgressItem, ISearchComplete, ISearchQuery, IPatternInfo, IFileMatch } from 'vs/platform/search/common/search'; import { ReplacePattern } from 'vs/platform/search/common/replace'; @@ -24,7 +23,7 @@ import { IModelService } from 'vs/editor/common/services/modelService'; import { IReplaceService } from 'vs/workbench/parts/search/common/replace'; import { IProgressRunner } from 'vs/platform/progress/common/progress'; import { RangeHighlightDecorations } from 'vs/workbench/common/editor/rangeDecorations'; -import { ModelDecorationOptions } from "vs/editor/common/model/textModelWithDecorations"; +import { ModelDecorationOptions } from 'vs/editor/common/model/textModelWithDecorations'; export class Match { @@ -126,8 +125,8 @@ export class FileMatch extends Disposable { private _resource: URI; private _model: IModel; private _modelListener: IDisposable; - private _matches: LinkedMap; - private _removedMatches: ArraySet; + private _matches: Map; + private _removedMatches: Set; private _selectedMatch: Match; private _updateScheduler: RunOnceScheduler; @@ -137,8 +136,8 @@ export class FileMatch extends Disposable { @IModelService private modelService: IModelService, @IReplaceService private replaceService: IReplaceService) { super(); this._resource = this.rawMatch.resource; - this._matches = new LinkedMap(); - this._removedMatches = new ArraySet(); + this._matches = new Map(); + this._removedMatches = new Set(); this._updateScheduler = new RunOnceScheduler(this.updateMatchesForModel.bind(this), 250); this.createMatches(); @@ -198,7 +197,7 @@ export class FileMatch extends Disposable { if (!this._model) { return; } - this._matches = new LinkedMap(); + this._matches = new Map(); let matches = this._model .findMatches(this._query.pattern, this._model.getFullModelRange(), this._query.isRegExp, this._query.isCaseSensitive, this._query.isWordMatch ? this._query.wordSeparators : null, false, this._maxResults); @@ -212,7 +211,7 @@ export class FileMatch extends Disposable { endLineNumber: lineNumber, endColumn: this._model.getLineMaxColumn(lineNumber) }; - const oldMatches = this._matches.values().filter(match => match.range().startLineNumber === lineNumber); + const oldMatches = values(this._matches).filter(match => match.range().startLineNumber === lineNumber); oldMatches.forEach(match => this._matches.delete(match.id())); const matches = this._model.findMatches(this._query.pattern, range, this._query.isRegExp, this._query.isCaseSensitive, this._query.isWordMatch ? this._query.wordSeparators : null, false, this._maxResults); @@ -222,7 +221,7 @@ export class FileMatch extends Disposable { private updateMatches(matches: FindMatch[], modelChange: boolean) { matches.forEach(m => { let match = new Match(this, this._model.getLineContent(m.range.startLineNumber), m.range.startLineNumber - 1, m.range.startColumn - 1, m.range.endColumn - m.range.startColumn); - if (!this._removedMatches.contains(match.id())) { + if (!this._removedMatches.has(match.id())) { this.add(match); if (this.isMatchSelected(match)) { this._selectedMatch = match; @@ -258,12 +257,12 @@ export class FileMatch extends Disposable { } public matches(): Match[] { - return this._matches.values(); + return values(this._matches); } public remove(match: Match): void { this.removeMatch(match); - this._removedMatches.set(match.id()); + this._removedMatches.add(match.id()); this._onChange.fire(false); } @@ -340,8 +339,8 @@ export class SearchResult extends Disposable { private _onChange = this._register(new Emitter()); public onChange: Event = this._onChange.event; - private _fileMatches: LinkedMap; - private _unDisposedFileMatches: LinkedMap; + private _fileMatches: ResourceMap; + private _unDisposedFileMatches: ResourceMap; private _query: IPatternInfo = null; private _maxResults: number; private _showHighlights: boolean; @@ -352,8 +351,8 @@ export class SearchResult extends Disposable { constructor(private _searchModel: SearchModel, @IReplaceService private replaceService: IReplaceService, @ITelemetryService private telemetryService: ITelemetryService, @IInstantiationService private instantiationService: IInstantiationService) { super(); - this._fileMatches = new LinkedMap(); - this._unDisposedFileMatches = new LinkedMap(); + this._fileMatches = new ResourceMap(); + this._unDisposedFileMatches = new ResourceMap(); this._rangeHighlightDecorations = this.instantiationService.createInstance(RangeHighlightDecorations); } diff --git a/src/vs/workbench/parts/search/common/searchQuery.ts b/src/vs/workbench/parts/search/common/searchQuery.ts index 05a799b1c39bbb4797048a9b6168d797f183ad94..0c0462f65ef684f6900e4ce9a00c2da8d22a586c 100644 --- a/src/vs/workbench/parts/search/common/searchQuery.ts +++ b/src/vs/workbench/parts/search/common/searchQuery.ts @@ -4,8 +4,10 @@ *--------------------------------------------------------------------------------------------*/ 'use strict'; +import { IExpression } from 'vs/base/common/glob'; import { mixin } from 'vs/base/common/objects'; -import { IPatternInfo, IQueryOptions, ISearchQuery, QueryType, ISearchConfiguration, getExcludes } from 'vs/platform/search/common/search'; +import uri from 'vs/base/common/uri'; +import { IPatternInfo, IQueryOptions, IFolderQueryOptions, ISearchQuery, QueryType, ISearchConfiguration, getExcludes } from 'vs/platform/search/common/search'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; export class QueryBuilder { @@ -13,29 +15,32 @@ export class QueryBuilder { constructor( @IConfigurationService private configurationService: IConfigurationService) { } - public text(contentPattern: IPatternInfo, options?: IQueryOptions): ISearchQuery { - return this.query(QueryType.Text, contentPattern, options); + public text(contentPattern: IPatternInfo, folderResources?: uri[], options?: IQueryOptions): ISearchQuery { + return this.query(QueryType.Text, contentPattern, folderResources, options); } - public file(options?: IQueryOptions): ISearchQuery { - return this.query(QueryType.File, null, options); + public file(folderResources?: uri[], options?: IQueryOptions): ISearchQuery { + return this.query(QueryType.File, null, folderResources, options); } - private query(type: QueryType, contentPattern: IPatternInfo, options: IQueryOptions = {}): ISearchQuery { - const configuration = this.configurationService.getConfiguration(); + private query(type: QueryType, contentPattern: IPatternInfo, folderResources?: uri[], options: IQueryOptions = {}): ISearchQuery { + const folderQueries = folderResources && folderResources.map(folder => { + const folderConfig = this.configurationService.getConfiguration(undefined, { resource: folder }); + return { + folder, + excludePattern: this.getExcludesForFolder(folderConfig, options), + fileEncoding: folderConfig.files.encoding + }; + }); - const settingsExcludePattern = getExcludes(configuration); - if (!options.disregardExcludeSettings) { - if (options.excludePattern) { - mixin(options.excludePattern, settingsExcludePattern, false /* no overwrite */); - } else { - options.excludePattern = settingsExcludePattern; - } - } + const useRipgrep = !folderResources || folderResources.every(folder => { + const folderConfig = this.configurationService.getConfiguration(undefined, { resource: folder }); + return folderConfig.search.useRipgrep; + }); return { - type: type, - folderResources: options.folderResources, + type, + folderQueries, extraFileResources: options.extraFileResources, filePattern: options.filePattern, excludePattern: options.excludePattern, @@ -43,12 +48,23 @@ export class QueryBuilder { maxResults: options.maxResults, sortByScore: options.sortByScore, cacheKey: options.cacheKey, - fileEncoding: options.fileEncoding, contentPattern: contentPattern, - useRipgrep: configuration.search.useRipgrep, + useRipgrep, disregardIgnoreFiles: options.disregardIgnoreFiles, disregardExcludeSettings: options.disregardExcludeSettings, searchPaths: options.searchPaths }; } + + private getExcludesForFolder(folderConfig: ISearchConfiguration, options: IQueryOptions): IExpression | null { + const settingsExcludePattern = getExcludes(folderConfig); + + if (options.disregardExcludeSettings) { + return null; + } else if (options.excludePattern) { + return mixin(options.excludePattern, settingsExcludePattern, false /* no overwrite */); + } else { + return settingsExcludePattern; + } + } } \ No newline at end of file diff --git a/src/vs/workbench/parts/snippets/electron-browser/TMSnippets.ts b/src/vs/workbench/parts/snippets/electron-browser/TMSnippets.ts index ae83175077bc3f5bcc93a4556a898ba0c63020b2..049933b528cfeb148bbcc51434eee8cd431d7824 100644 --- a/src/vs/workbench/parts/snippets/electron-browser/TMSnippets.ts +++ b/src/vs/workbench/parts/snippets/electron-browser/TMSnippets.ts @@ -13,10 +13,10 @@ import { readFile } from 'vs/base/node/pfs'; import { ExtensionMessageCollector, ExtensionsRegistry } from 'vs/platform/extensions/common/extensionsRegistry'; import { ISnippetsService, ISnippet } from 'vs/workbench/parts/snippets/electron-browser/snippetsService'; import { IModeService } from 'vs/editor/common/services/modeService'; -import { languagesExtPoint } from 'vs/editor/common/services/modeServiceImpl'; +import { languagesExtPoint } from "vs/workbench/services/mode/common/workbenchModeService"; import { LanguageIdentifier } from 'vs/editor/common/modes'; import { SnippetParser, Marker, Placeholder, Variable, Text, walk } from 'vs/editor/contrib/snippet/browser/snippetParser'; -import { EditorSnippetVariableResolver } from "vs/editor/contrib/snippet/browser/snippetVariables"; +import { EditorSnippetVariableResolver } from 'vs/editor/contrib/snippet/browser/snippetVariables'; interface ISnippetsExtensionPoint { language: string; @@ -94,6 +94,12 @@ export function readAndRegisterSnippets( return readFile(filePath).then(fileContents => { let snippets = parseSnippetFile(fileContents.toString(), extensionName, collector); snippetService.registerSnippets(languageIdentifier.id, snippets, filePath); + }, err => { + if (err && err.code === 'ENOENT') { + snippetService.registerSnippets(languageIdentifier.id, [], filePath); + } else { + throw err; + } }); } @@ -153,7 +159,7 @@ function parseSnippetFile(snippetFileContent: string, extensionName?: string, co } function _rewriteBogousVariables(snippet: ISnippet): boolean { - const marker = new SnippetParser(true, false).parse(snippet.codeSnippet, false); + const marker = new SnippetParser().parse(snippet.codeSnippet, false); let placeholders = new Map(); let placeholderMax = 0; @@ -169,13 +175,13 @@ function _rewriteBogousVariables(snippet: ISnippet): boolean { return SnippetParser.escape(marker.string); } else if (marker instanceof Placeholder) { - if (marker.defaultValue.length > 0) { - return `\${${marker.index}:${marker.defaultValue.map(fixBogousVariables).join('')}}`; + if (marker.children.length > 0) { + return `\${${marker.index}:${marker.children.map(fixBogousVariables).join('')}}`; } else { return `\$${marker.index}`; } } else if (marker instanceof Variable) { - if (marker.defaultValue.length === 0 && !EditorSnippetVariableResolver.VariableNames[marker.name]) { + if (marker.children.length === 0 && !EditorSnippetVariableResolver.VariableNames[marker.name]) { // a 'variable' without a default value and not being one of our supported // variables is automatically turing into a placeholder. This is to restore // a bug we had before. So `${foo}` becomes `${N:foo}` @@ -183,8 +189,8 @@ function _rewriteBogousVariables(snippet: ISnippet): boolean { placeholders.set(marker.name, index); return `\${${index++}:${marker.name}}`; - } else if (marker.defaultValue.length > 0) { - return `\${${marker.name}:${marker.defaultValue.map(fixBogousVariables).join('')}}`; + } else if (marker.children.length > 0) { + return `\${${marker.name}:${marker.children.map(fixBogousVariables).join('')}}`; } else { return `\$${marker.name}`; } diff --git a/src/vs/workbench/parts/snippets/electron-browser/snippets.contribution.ts b/src/vs/workbench/parts/snippets/electron-browser/snippets.contribution.ts index 10a8b9e074d57e874b2e53f94d2e4fa0b4374ed4..7b2087d0efb9963b8110fcdee2f5c16defbf91fe 100644 --- a/src/vs/workbench/parts/snippets/electron-browser/snippets.contribution.ts +++ b/src/vs/workbench/parts/snippets/electron-browser/snippets.contribution.ts @@ -13,7 +13,7 @@ import winjs = require('vs/base/common/winjs.base'); import { join } from 'path'; import actions = require('vs/base/common/actions'); import { SyncActionDescriptor } from 'vs/platform/actions/common/actions'; -import platform = require('vs/platform/platform'); +import platform = require('vs/platform/registry/common/platform'); import workbenchActionRegistry = require('vs/workbench/common/actionRegistry'); import workbenchContributions = require('vs/workbench/common/contributions'); import snippetsTracker = require('./snippetsTracker'); @@ -118,7 +118,7 @@ function fileExists(path: string): winjs.TPromise { var preferencesCategory = nls.localize('preferences', "Preferences"); var workbenchActionsRegistry = platform.Registry.as(workbenchActionRegistry.Extensions.WorkbenchActions); -workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(OpenSnippetsAction, OpenSnippetsAction.ID, OpenSnippetsAction.LABEL), 'Preferences: Snippets', preferencesCategory); +workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(OpenSnippetsAction, OpenSnippetsAction.ID, OpenSnippetsAction.LABEL), 'Preferences: Open User Snippets', preferencesCategory); (platform.Registry.as(workbenchContributions.Extensions.Workbench)).registerWorkbenchContribution( snippetsTracker.SnippetsTracker @@ -145,7 +145,7 @@ let schema: IJSONSchema = { 'type': 'string' }, 'body': { - 'description': nls.localize('snippetSchema.json.body', 'The snippet content. Use \'${id}\', \'${id:label}\', \'${1:label}\' for variables and \'$0\', \'$1\' for the cursor positions'), + 'description': nls.localize('snippetSchema.json.body', 'The snippet content. Use \'$1\', \'${1:defaultText}\' to define cursor positions, use \'$0\' for the final cursor position. Insert variable values with \'${varName}\' and \'${varName:defaultText}\', e.g \'This is file: $TM_FILENAME\'.'), 'type': ['string', 'array'], 'items': { 'type': 'string' diff --git a/src/vs/workbench/parts/snippets/electron-browser/snippetsService.ts b/src/vs/workbench/parts/snippets/electron-browser/snippetsService.ts index fdb96d9beaa5cb578de321d536079a721233b9e9..717bdbe35418bd82508508e5d824a3d4a41e1c79 100644 --- a/src/vs/workbench/parts/snippets/electron-browser/snippetsService.ts +++ b/src/vs/workbench/parts/snippets/electron-browser/snippetsService.ts @@ -5,14 +5,14 @@ 'use strict'; import { localize } from 'vs/nls'; -import * as strings from 'vs/base/common/strings'; import { IModel } from 'vs/editor/common/editorCommon'; -import { ISuggestion, LanguageId } from 'vs/editor/common/modes'; +import { ISuggestSupport, ISuggestResult, ISuggestion, LanguageId } from 'vs/editor/common/modes'; import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { setSnippetSuggestSupport } from 'vs/editor/contrib/suggest/browser/suggest'; import { IModeService } from 'vs/editor/common/services/modeService'; import { Position } from 'vs/editor/common/core/position'; +import { overlap, compare, startsWith } from 'vs/base/common/strings'; export const ISnippetsService = createDecorator('snippetService'); @@ -22,7 +22,9 @@ export interface ISnippetsService { registerSnippets(languageId: LanguageId, snippets: ISnippet[], owner: string): void; - visitSnippets(languageId: LanguageId, accept: (snippet: ISnippet) => void): void; + visitSnippets(languageId: LanguageId, accept: (snippet: ISnippet) => boolean): void; + + getSnippets(languageId: LanguageId): ISnippet[]; } export interface ISnippet { @@ -33,37 +35,26 @@ export interface ISnippet { extensionName?: string; } -interface ISnippetSuggestion extends ISuggestion { - disambiguateLabel: string; -} - -class SnippetsService implements ISnippetsService { +export class SnippetsService implements ISnippetsService { _serviceBrand: any; - private static _defaultDetail = localize('detail.userSnippet', "User Snippet"); - - private _snippets = new Map>(); + private readonly _snippets = new Map>(); constructor( - @IModeService private _modeService: IModeService + @IModeService modeService: IModeService ) { - setSnippetSuggestSupport({ - provideCompletionItems: (model, position) => { - const suggestions = this._getSnippetCompletions(model, position); - return { suggestions }; - } - }); + setSnippetSuggestSupport(new SnippetSuggestProvider(modeService, this)); } - public registerSnippets(languageId: LanguageId, snippets: ISnippet[], fileName: string): void { + registerSnippets(languageId: LanguageId, snippets: ISnippet[], fileName: string): void { if (!this._snippets.has(languageId)) { this._snippets.set(languageId, new Map()); } this._snippets.get(languageId).set(fileName, snippets); } - public visitSnippets(languageId: LanguageId, accept: (snippet: ISnippet) => boolean): void { + visitSnippets(languageId: LanguageId, accept: (snippet: ISnippet) => boolean): void { const modeSnippets = this._snippets.get(languageId); if (modeSnippets) { modeSnippets.forEach(snippets => { @@ -75,88 +66,117 @@ class SnippetsService implements ISnippetsService { } } - private _getLanguageIdAtPosition(model: IModel, position: Position): LanguageId { - // validate the `languageId` to ensure this is a user - // facing language with a name and the chance to have - // snippets, else fall back to the outer language - model.forceTokenization(position.lineNumber); - let languageId = model.getLanguageIdAtPosition(position.lineNumber, position.column); - let { language } = this._modeService.getLanguageIdentifier(languageId); - if (!this._modeService.getLanguageName(language)) { - languageId = model.getLanguageIdentifier().id; + getSnippets(languageId: LanguageId): ISnippet[] { + const modeSnippets = this._snippets.get(languageId); + const ret: ISnippet[] = []; + if (modeSnippets) { + modeSnippets.forEach(snippets => { + ret.push(...snippets); + }); } - return languageId; + return ret; } +} + +registerSingleton(ISnippetsService, SnippetsService); + +export interface ISimpleModel { + getLineContent(lineNumber: number): string; +} + +interface ISnippetSuggestion { + suggestion: ISuggestion; + snippet: ISnippet; +} - private _getSnippetCompletions(model: IModel, position: Position): ISuggestion[] { - const languageId = this._getLanguageIdAtPosition(model, position); - if (!this._snippets.has(languageId)) { - return undefined; - } - const result: ISnippetSuggestion[] = []; +export class SnippetSuggestProvider implements ISuggestSupport { - const word = model.getWordAtPosition(position); - const currentWord = word ? word.word.substring(0, position.column - word.startColumn).toLowerCase() : ''; - const currentFullWord = getNonWhitespacePrefix(model, position).toLowerCase(); + constructor( + @IModeService private _modeService: IModeService, + @ISnippetsService private _snippets: ISnippetsService + ) { + // + } + + provideCompletionItems(model: IModel, position: Position): ISuggestResult { - this.visitSnippets(languageId, s => { - const prefixLower = s.prefix.toLowerCase(); + const languageId = this._getLanguageIdAtPosition(model, position); + const snippets = this._snippets.getSnippets(languageId); + const items: ISnippetSuggestion[] = []; + + const lowWordUntil = model.getWordUntilPosition(position).word.toLowerCase(); + const lowLineUntil = model.getLineContent(position.lineNumber).substr(Math.max(0, position.column - 100), position.column - 1).toLowerCase(); + for (const snippet of snippets) { + + const lowPrefix = snippet.prefix.toLowerCase(); let overwriteBefore = 0; - if (currentWord.length > 0) { - // there is a word -> the prefix should match that - if (strings.startsWith(prefixLower, currentWord)) { - overwriteBefore = currentWord.length; - } else { - return true; - } + let accetSnippet = true; - } else if (currentFullWord.length > currentWord.length) { - // there is something -> fine if it matches - overwriteBefore = strings.commonPrefixLength(prefixLower, currentFullWord); - } + if (lowWordUntil.length > 0 && startsWith(lowPrefix, lowWordUntil)) { + // cheap match on the (none-empty) current word + overwriteBefore = lowWordUntil.length; + accetSnippet = true; - // store in result - result.push({ - type: 'snippet', - label: s.prefix, - get disambiguateLabel() { return localize('snippetSuggest.longLabel', "{0}, {1}", s.prefix, s.name); }, - detail: s.extensionName || SnippetsService._defaultDetail, - documentation: s.description, - insertText: s.codeSnippet, - sortText: `${s.prefix}-${s.extensionName || ''}`, - noAutoAccept: true, - snippetType: 'textmate', - overwriteBefore - }); + } else if (lowLineUntil.length > 0) { + // compute overlap between snippet and line on text + overwriteBefore = overlap(lowLineUntil, snippet.prefix.toLowerCase()); + accetSnippet = overwriteBefore > 0 && !model.getWordAtPosition(new Position(position.lineNumber, position.column - overwriteBefore)); + } - return true; - }); + if (accetSnippet) { + + items.push({ + snippet, + suggestion: { + type: 'snippet', + label: snippet.prefix, + detail: snippet.extensionName || localize('detail.userSnippet', "User Snippet"), + documentation: snippet.description, + insertText: snippet.codeSnippet, + sortText: `${snippet.prefix}-${snippet.extensionName || ''}`, + noAutoAccept: true, + snippetType: 'textmate', + overwriteBefore + } + }); + } + } // dismbiguate suggestions with same labels - let lastSuggestion: ISnippetSuggestion; - for (const suggestion of result.sort(SnippetsService._compareSuggestionsByLabel)) { - if (lastSuggestion && lastSuggestion.label === suggestion.label) { + const suggestions: ISuggestion[] = []; + let lastItem: ISnippetSuggestion; + for (const item of items.sort(SnippetSuggestProvider._compareSuggestionsByLabel)) { + if (lastItem && lastItem.suggestion.label === item.suggestion.label) { // use the disambiguateLabel instead of the actual label - lastSuggestion.label = lastSuggestion.disambiguateLabel; - suggestion.label = suggestion.disambiguateLabel; + lastItem.suggestion.label = localize('snippetSuggest.longLabel', "{0}, {1}", lastItem.suggestion.label, lastItem.snippet.name); + item.suggestion.label = localize('snippetSuggest.longLabel', "{0}, {1}", item.suggestion.label, item.snippet.name); } - lastSuggestion = suggestion; + lastItem = item; + + suggestions.push(item.suggestion); } - return result; + return { suggestions }; } - private static _compareSuggestionsByLabel(a: ISuggestion, b: ISuggestion): number { - return strings.compare(a.label, b.label); + private _getLanguageIdAtPosition(model: IModel, position: Position): LanguageId { + // validate the `languageId` to ensure this is a user + // facing language with a name and the chance to have + // snippets, else fall back to the outer language + model.forceTokenization(position.lineNumber); + let languageId = model.getLanguageIdAtPosition(position.lineNumber, position.column); + let { language } = this._modeService.getLanguageIdentifier(languageId); + if (!this._modeService.getLanguageName(language)) { + languageId = model.getLanguageIdentifier().id; + } + return languageId; } -} - -registerSingleton(ISnippetsService, SnippetsService); -export interface ISimpleModel { - getLineContent(lineNumber: number): string; + private static _compareSuggestionsByLabel(a: ISnippetSuggestion, b: ISnippetSuggestion): number { + return compare(a.suggestion.label, b.suggestion.label); + } } export function getNonWhitespacePrefix(model: ISimpleModel, position: Position): string { diff --git a/src/vs/workbench/parts/snippets/electron-browser/snippetsTracker.ts b/src/vs/workbench/parts/snippets/electron-browser/snippetsTracker.ts index e143e7258ae0fec3c6bbed7ee4757e9d5065bfa5..2ecbc3150fb5878e1bec1538b6f09e034fa7b501 100644 --- a/src/vs/workbench/parts/snippets/electron-browser/snippetsTracker.ts +++ b/src/vs/workbench/parts/snippets/electron-browser/snippetsTracker.ts @@ -5,114 +5,64 @@ 'use strict'; -import workbenchExt = require('vs/workbench/common/contributions'); +import { IWorkbenchContribution } from 'vs/workbench/common/contributions'; import { join } from 'path'; -import async = require('vs/base/common/async'); -import winjs = require('vs/base/common/winjs.base'); -import { mkdirp, fileExists, readdir } from 'vs/base/node/pfs'; +import { mkdirp, fileExists } from 'vs/base/node/pfs'; import { onUnexpectedError } from 'vs/base/common/errors'; -import lifecycle = require('vs/base/common/lifecycle'); +import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { readAndRegisterSnippets } from './TMSnippets'; import { ISnippetsService } from 'vs/workbench/parts/snippets/electron-browser/snippetsService'; -import { ILifecycleService } from 'vs/platform/lifecycle/common/lifecycle'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import { IExtensionService } from 'vs/platform/extensions/common/extensions'; -import { watch, FSWatcher } from 'fs'; +import { watch } from 'fs'; import { IModeService } from 'vs/editor/common/services/modeService'; -export class SnippetsTracker implements workbenchExt.IWorkbenchContribution { - private static FILE_WATCH_DELAY = 200; +export class SnippetsTracker implements IWorkbenchContribution { - private snippetFolder: string; - private toDispose: lifecycle.IDisposable[]; - private watcher: FSWatcher; - private fileWatchDelayer: async.ThrottledDelayer; + private readonly _snippetFolder: string; + private readonly _toDispose: IDisposable[]; constructor( - @ILifecycleService private lifecycleService: ILifecycleService, - @IModeService private modeService: IModeService, - @ISnippetsService private snippetService: ISnippetsService, + @IModeService modeService: IModeService, + @ISnippetsService snippetService: ISnippetsService, @IEnvironmentService environmentService: IEnvironmentService, @IExtensionService extensionService: IExtensionService ) { - this.snippetFolder = join(environmentService.appSettingsHome, 'snippets'); + this._snippetFolder = join(environmentService.appSettingsHome, 'snippets'); + this._toDispose = []; - this.toDispose = []; - this.fileWatchDelayer = new async.ThrottledDelayer(SnippetsTracker.FILE_WATCH_DELAY); + // Whenever a mode is being created check if a snippet file exists + // and iff so read all snippets from it. + this._toDispose.push(modeService.onDidCreateMode(mode => { + const snippetPath = join(this._snippetFolder, `${mode.getId()}.json`); + fileExists(snippetPath) + .then(exists => exists && readAndRegisterSnippets(snippetService, mode.getLanguageIdentifier(), snippetPath)) + .done(undefined, onUnexpectedError); + })); - extensionService.onReady() - .then(() => mkdirp(this.snippetFolder)) - .then(() => this.scanUserSnippets()) - .then(() => this.registerListeners()) - .done(undefined, onUnexpectedError); - } - - private registerListeners(): void { - var scheduler = new async.RunOnceScheduler(() => { - this.scanUserSnippets(); - }, 500); - this.toDispose.push(scheduler); - - try { - this.watcher = watch(this.snippetFolder); // will be persistent but not recursive - this.watcher.on('change', (eventType: string) => { - if (eventType === 'delete') { - this.unregisterListener(); + // Install a FS watcher on the snippet directory and when an + // event occurs update the snippets for that one snippet. + mkdirp(this._snippetFolder).then(() => { + const watcher = watch(this._snippetFolder); + this._toDispose.push({ dispose: () => watcher.close() }); + watcher.on('change', (type, filename) => { + if (typeof filename !== 'string') { return; } - scheduler.schedule(); + extensionService.onReady().then(() => { + const langName = filename.replace(/\.json$/, '').toLowerCase(); + const langId = modeService.getLanguageIdentifier(langName); + return langId && readAndRegisterSnippets(snippetService, langId, join(this._snippetFolder, filename)); + }, onUnexpectedError); }); - } catch (error) { - // the path might not exist anymore, ignore this error and return - } - - this.lifecycleService.onShutdown(this.dispose, this); - } - - private scanUserSnippets(): winjs.Promise { - return readFilesInDir(this.snippetFolder, /\.json$/).then(snippetFiles => { - return winjs.TPromise.join(snippetFiles.map(snippetFile => { - var modeId = snippetFile.replace(/\.json$/, '').toLowerCase(); - var snippetPath = join(this.snippetFolder, snippetFile); - let languageIdentifier = this.modeService.getLanguageIdentifier(modeId); - if (languageIdentifier) { - return readAndRegisterSnippets(this.snippetService, languageIdentifier, snippetPath); - } - return undefined; - })); }); } - private unregisterListener(): void { - if (this.watcher) { - this.watcher.close(); - this.watcher = null; - } - } - - public getId(): string { + getId(): string { return 'vs.snippets.snippetsTracker'; } - public dispose(): void { - this.unregisterListener(); - this.toDispose = lifecycle.dispose(this.toDispose); + dispose(): void { + dispose(this._toDispose); } } - -function readFilesInDir(dirPath: string, namePattern: RegExp = null): winjs.TPromise { - return readdir(dirPath).then((children) => { - return winjs.TPromise.join( - children.map((child) => { - if (namePattern && !namePattern.test(child)) { - return winjs.TPromise.as(null); - } - return fileExists(join(dirPath, child)).then(isFile => { - return isFile ? child : null; - }); - }) - ).then((subdirs) => { - return subdirs.filter(subdir => (subdir !== null)); - }); - }); -} diff --git a/src/vs/workbench/parts/snippets/electron-browser/tabCompletion.ts b/src/vs/workbench/parts/snippets/electron-browser/tabCompletion.ts index c4a714a0210de6b99b0f33d372cac6c4f7f46d5a..79007e588471906dafadf73d5dcfd04eb1f2e701 100644 --- a/src/vs/workbench/parts/snippets/electron-browser/tabCompletion.ts +++ b/src/vs/workbench/parts/snippets/electron-browser/tabCompletion.ts @@ -10,7 +10,7 @@ import { KeyCode } from 'vs/base/common/keyCodes'; import { RawContextKey, IContextKeyService, ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry'; import { ISnippetsService, getNonWhitespacePrefix, ISnippet } from 'vs/workbench/parts/snippets/electron-browser/snippetsService'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { endsWith } from 'vs/base/common/strings'; import { IDisposable } from 'vs/base/common/lifecycle'; import * as editorCommon from 'vs/editor/common/editorCommon'; diff --git a/src/vs/workbench/parts/snippets/test/electron-browser/snippetsService.test.ts b/src/vs/workbench/parts/snippets/test/electron-browser/snippetsService.test.ts new file mode 100644 index 0000000000000000000000000000000000000000..2cde3b1116d39d87ee65f061b9c61e7a2d5463f1 --- /dev/null +++ b/src/vs/workbench/parts/snippets/test/electron-browser/snippetsService.test.ts @@ -0,0 +1,93 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +'use strict'; + +import * as assert from 'assert'; +import { SnippetsService, ISnippet, SnippetSuggestProvider } from 'vs/workbench/parts/snippets/electron-browser/snippetsService'; +import { Position } from 'vs/editor/common/core/position'; +import { ModesRegistry } from 'vs/editor/common/modes/modesRegistry'; +import { ModeServiceImpl } from 'vs/editor/common/services/modeServiceImpl'; +import { Model } from 'vs/editor/common/model/model'; + +suite('SnippetsService', function () { + + suiteSetup(function () { + ModesRegistry.registerLanguage({ + id: 'fooLang', + extensions: ['.fooLang',] + }); + }); + + let modeService: ModeServiceImpl; + let snippetService: SnippetsService; + + setup(function () { + modeService = new ModeServiceImpl(); + snippetService = new SnippetsService(modeService); + + snippetService.registerSnippets(modeService.getLanguageIdentifier('fooLang').id, [{ + prefix: 'bar', + codeSnippet: 'barCodeSnippet', + name: 'barTest', + description: '' + }, { + prefix: 'bazz', + codeSnippet: 'bazzCodeSnippet', + name: 'bazzTest', + description: '' + }], 'fooFile.json'); + }); + + test('snippet completions - simple', function () { + + const provider = new SnippetSuggestProvider(modeService, snippetService); + const model = Model.createFromString('', undefined, modeService.getLanguageIdentifier('fooLang')); + + const result = provider.provideCompletionItems(model, new Position(1, 1)); + + assert.equal(result.incomplete, undefined); + assert.equal(result.suggestions.length, 2); + }); + + test('snippet completions - with prefix', function () { + + const provider = new SnippetSuggestProvider(modeService, snippetService); + const model = Model.createFromString('bar', undefined, modeService.getLanguageIdentifier('fooLang')); + + const result = provider.provideCompletionItems(model, new Position(1, 4)); + + assert.equal(result.incomplete, undefined); + assert.equal(result.suggestions.length, 1); + assert.equal(result.suggestions[0].label, 'bar'); + assert.equal(result.suggestions[0].insertText, 'barCodeSnippet'); + }); + + test('Cannot use "[{ + prefix: ' { + this.doRun(task); + }); + return true; + } else { + return this.doRun(task); + } + } +} + +export class QuickOpenHandler extends base.QuickOpenHandler { + constructor( + @IQuickOpenService quickOpenService: IQuickOpenService, + @ITaskService taskService: ITaskService + ) { + super(quickOpenService, taskService); + } + + public getAriaLabel(): string { + return nls.localize('tasksAriaLabel', "Type the name of a build task"); + } + + protected getTasks(): TPromise { + return ProblemMatcherRegistry.onReady().then(() => this.taskService.getTasksForGroup(TaskGroup.Build)); + } + + protected createEntry(task: Task, highlights: Model.IHighlight[]): base.TaskEntry { + return new TaskEntry(this.taskService, this.quickOpenService, task, highlights); + } + + public getEmptyLabel(searchString: string): string { + if (searchString.length > 0) { + return nls.localize('noTasksMatching', "No tasks matching"); + } + return nls.localize('noTasksFound', "No build tasks found"); + } +} diff --git a/src/vs/workbench/parts/tasks/browser/quickOpen.ts b/src/vs/workbench/parts/tasks/browser/quickOpen.ts index 743413653aa946605dfb7d11d6f2a63f1afbaad3..cce6efe8d1a681862e3d9da7a316ba8eda84c698 100644 --- a/src/vs/workbench/parts/tasks/browser/quickOpen.ts +++ b/src/vs/workbench/parts/tasks/browser/quickOpen.ts @@ -7,28 +7,79 @@ import nls = require('vs/nls'); import Filters = require('vs/base/common/filters'); import { TPromise } from 'vs/base/common/winjs.base'; +import { Action, IAction } from 'vs/base/common/actions'; +import { IStringDictionary } from 'vs/base/common/collections'; +import * as Objects from 'vs/base/common/objects'; + import Quickopen = require('vs/workbench/browser/quickopen'); import QuickOpen = require('vs/base/parts/quickopen/common/quickOpen'); import Model = require('vs/base/parts/quickopen/browser/quickOpenModel'); -import { IQuickOpenService } from 'vs/platform/quickOpen/common/quickOpen'; +import { IQuickOpenService, IPickOpenEntry } from 'vs/platform/quickOpen/common/quickOpen'; +import { ProblemMatcherRegistry, NamedProblemMatcher } from 'vs/platform/markers/common/problemMatcher'; import { Task, TaskSourceKind } from 'vs/workbench/parts/tasks/common/tasks'; import { ITaskService } from 'vs/workbench/parts/tasks/common/taskService'; +import { ActionBarContributor, ContributableActionProvider } from 'vs/workbench/browser/actions'; + +interface ProblemMatcherPickEntry extends IPickOpenEntry { + matcher: NamedProblemMatcher; +} export class TaskEntry extends Model.QuickOpenEntry { - constructor(protected taskService: ITaskService, protected task: Task, highlights: Model.IHighlight[] = []) { + constructor(protected taskService: ITaskService, protected quickOpenService: IQuickOpenService, protected _task: Task, highlights: Model.IHighlight[] = []) { super(highlights); - this.task = task; } public getLabel(): string { - return this.task.name; + return this.task._label; } public getAriaLabel(): string { return nls.localize('entryAriaLabel', "{0}, tasks", this.getLabel()); } + + public get task(): Task { + return this._task; + } + + protected attachProblemMatcher(task: Task): TPromise { + let entries: ProblemMatcherPickEntry[] = []; + for (let key of ProblemMatcherRegistry.keys()) { + let matcher = ProblemMatcherRegistry.get(key); + if (matcher.name === matcher.label) { + entries.push({ label: matcher.name, matcher: matcher }); + } else { + entries.push({ label: nls.localize('entries', '{0} [${1}]', matcher.label, matcher.name), matcher: matcher }); + } + } + if (entries.length > 0) { + entries.push({ label: 'Continue without scanning the build output', separator: { border: true }, matcher: undefined }); + return this.quickOpenService.pick(entries, { + placeHolder: nls.localize('selectProblemMatcher', 'Select for which kind of errors and warnings to scan the build output') + }).then((selected) => { + if (selected && selected.matcher) { + let newTask = Objects.deepClone(task); + let matcherReference = `$${selected.matcher.name}`; + newTask.problemMatchers = [matcherReference]; + this.taskService.customize(task, { problemMatcher: [matcherReference] }, true); + return newTask; + } else { + return task; + } + }); + } + return TPromise.as(task); + } + + protected doRun(task: Task): boolean { + this.taskService.run(task); + if (task.command.presentation.focus) { + this.quickOpenService.close(); + return false; + } + return true; + } } export class TaskGroupEntry extends Model.QuickOpenEntryGroup { @@ -44,7 +95,7 @@ export abstract class QuickOpenHandler extends Quickopen.QuickOpenHandler { constructor( protected quickOpenService: IQuickOpenService, - protected taskService: ITaskService, + protected taskService: ITaskService ) { super(); @@ -66,50 +117,117 @@ export abstract class QuickOpenHandler extends Quickopen.QuickOpenHandler { if (tasks.length === 0) { return new Model.QuickOpenModel(entries); } - tasks = tasks.sort((a, b) => { - let aKind = a._source.kind; - let bKind = b._source.kind; - if (aKind === bKind) { - return a.name.localeCompare(b.name); - } - if (aKind === TaskSourceKind.Workspace) { - return -1; - } else { - return +1; + let recentlyUsedTasks = this.taskService.getRecentlyUsedTasks(); + let recent: Task[] = []; + let configured: Task[] = []; + let detected: Task[] = []; + let taskMap: IStringDictionary = Object.create(null); + tasks.forEach(task => taskMap[Task.getKey(task)] = task); + recentlyUsedTasks.keys().forEach(key => { + let task = taskMap[key]; + if (task) { + recent.push(task); } }); - let hasWorkspace: boolean = tasks[0]._source.kind === TaskSourceKind.Workspace; - let hasExtension: boolean = tasks[tasks.length - 1]._source.kind === TaskSourceKind.Extension; - let groupWorkspace = hasWorkspace && hasExtension; - let groupExtension = groupWorkspace; - let hadWorkspace = false; for (let task of tasks) { - let highlights = Filters.matchesContiguousSubString(input, task.name); - if (!highlights) { - continue; - } - if (task._source.kind === TaskSourceKind.Workspace && groupWorkspace) { - groupWorkspace = false; - hadWorkspace = true; - entries.push(new TaskGroupEntry(this.createEntry(this.taskService, task, highlights), nls.localize('workspace', 'From Workspace'), false)); - } else if (task._source.kind === TaskSourceKind.Extension && groupExtension) { - groupExtension = false; - entries.push(new TaskGroupEntry(this.createEntry(this.taskService, task, highlights), nls.localize('extension', 'From Extensions'), hadWorkspace)); - } else { - entries.push(this.createEntry(this.taskService, task, highlights)); + if (!recentlyUsedTasks.has(Task.getKey(task))) { + if (task._source.kind === TaskSourceKind.Workspace) { + configured.push(task); + } else { + detected.push(task); + } } } - return new Model.QuickOpenModel(entries); + let hasRecentlyUsed: boolean = recent.length > 0; + this.fillEntries(entries, input, recent, nls.localize('recentlyUsed', 'recently used tasks')); + configured = configured.sort((a, b) => a._label.localeCompare(b._label)); + let hasConfigured = configured.length > 0; + this.fillEntries(entries, input, configured, nls.localize('configured', 'custom tasks'), hasRecentlyUsed); + detected = detected.sort((a, b) => a._label.localeCompare(b._label)); + this.fillEntries(entries, input, detected, nls.localize('detected', 'detected tasks'), hasRecentlyUsed || hasConfigured); + return new Model.QuickOpenModel(entries, new ContributableActionProvider()); }); } + private fillEntries(entries: Model.QuickOpenEntry[], input: string, tasks: Task[], groupLabel: string, withBorder: boolean = false) { + let first = true; + for (let task of tasks) { + let highlights = Filters.matchesContiguousSubString(input, task._label); + if (!highlights) { + continue; + } + if (first) { + first = false; + entries.push(new TaskGroupEntry(this.createEntry(task, highlights), groupLabel, withBorder)); + } else { + entries.push(this.createEntry(task, highlights)); + } + } + } + protected abstract getTasks(): TPromise; - protected abstract createEntry(taskService: ITaskService, task: Task, highlights: Model.IHighlight[]): TaskEntry; + protected abstract createEntry(task: Task, highlights: Model.IHighlight[]): TaskEntry; public getAutoFocus(input: string): QuickOpen.IAutoFocus { return { autoFocusFirstEntry: !!input }; } +} + +class CustomizeTaskAction extends Action { + + private static ID = 'workbench.action.tasks.customizeTask'; + private static LABEL = nls.localize('customizeTask', "Customize Task"); + + constructor(private taskService: ITaskService, private quickOpenService: IQuickOpenService, private task: Task) { + super(CustomizeTaskAction.ID, CustomizeTaskAction.LABEL); + this.updateClass(); + } + + public updateClass(): void { + this.class = 'quick-open-task-configure'; + } + + public run(context: any): TPromise { + return this.taskService.customize(this.task, undefined, true).then(() => { + this.quickOpenService.close(); + }); + } +} + +export class QuickOpenActionContributor extends ActionBarContributor { + + constructor( @ITaskService private taskService: ITaskService, @IQuickOpenService private quickOpenService: IQuickOpenService) { + super(); + } + + public hasActions(context: any): boolean { + let task = this.getTask(context); + + return !!task; + } + + public getActions(context: any): IAction[] { + let actions: Action[] = []; + let task = this.getTask(context); + if (task && task._source.kind === TaskSourceKind.Extension) { + actions.push(new CustomizeTaskAction(this.taskService, this.quickOpenService, task)); + } + return actions; + } + + private getTask(context: any): Task { + if (!context) { + return undefined; + } + let element = context.element; + if (element instanceof TaskEntry) { + return element.task; + } else if (element instanceof TaskGroupEntry) { + return (element.getEntry() as TaskEntry).task; + } + return undefined; + } } \ No newline at end of file diff --git a/src/vs/workbench/parts/tasks/browser/restartQuickOpen.ts b/src/vs/workbench/parts/tasks/browser/restartQuickOpen.ts index 2c78bdac7e86a3da0387bea47add4cbb308160ce..eeda3971243543eb19ab013f4f7c27ff952c3bbe 100644 --- a/src/vs/workbench/parts/tasks/browser/restartQuickOpen.ts +++ b/src/vs/workbench/parts/tasks/browser/restartQuickOpen.ts @@ -16,15 +16,15 @@ import { ITaskService } from 'vs/workbench/parts/tasks/common/taskService'; import * as base from './quickOpen'; class TaskEntry extends base.TaskEntry { - constructor(taskService: ITaskService, task: Task, highlights: Model.IHighlight[] = []) { - super(taskService, task, highlights); + constructor(taskService: ITaskService, quickOpenService: IQuickOpenService, task: Task, highlights: Model.IHighlight[] = []) { + super(taskService, quickOpenService, task, highlights); } public run(mode: QuickOpen.Mode, context: Model.IContext): boolean { if (mode === QuickOpen.Mode.PREVIEW) { return false; } - this.taskService.restart(this.task._id); + this.taskService.restart(this._task._id); return true; } } @@ -45,8 +45,8 @@ export class QuickOpenHandler extends base.QuickOpenHandler { return this.taskService.getActiveTasks(); } - protected createEntry(taskService: ITaskService, task: Task, highlights: Model.IHighlight[]): base.TaskEntry { - return new TaskEntry(taskService, task, highlights); + protected createEntry(task: Task, highlights: Model.IHighlight[]): base.TaskEntry { + return new TaskEntry(this.taskService, this.quickOpenService, task, highlights); } public getEmptyLabel(searchString: string): string { diff --git a/src/vs/workbench/parts/tasks/browser/taskQuickOpen.ts b/src/vs/workbench/parts/tasks/browser/taskQuickOpen.ts index f32f5d199f9fb94f65afe7e023c5fd61b9230b4b..547db2b365ded4cb1c2e2280117da9d42b3d54fd 100644 --- a/src/vs/workbench/parts/tasks/browser/taskQuickOpen.ts +++ b/src/vs/workbench/parts/tasks/browser/taskQuickOpen.ts @@ -10,7 +10,7 @@ import QuickOpen = require('vs/base/parts/quickopen/common/quickOpen'); import Model = require('vs/base/parts/quickopen/browser/quickOpenModel'); import { IQuickOpenService } from 'vs/platform/quickOpen/common/quickOpen'; -import { Task } from 'vs/workbench/parts/tasks/common/tasks'; +import { Task, TaskGroup } from 'vs/workbench/parts/tasks/common/tasks'; import { ITaskService } from 'vs/workbench/parts/tasks/common/taskService'; import { IExtensionService } from 'vs/platform/extensions/common/extensions'; @@ -18,16 +18,21 @@ import { IExtensionService } from 'vs/platform/extensions/common/extensions'; import * as base from './quickOpen'; class TaskEntry extends base.TaskEntry { - constructor(taskService: ITaskService, task: Task, highlights: Model.IHighlight[] = []) { - super(taskService, task, highlights); + constructor(taskService: ITaskService, quickOpenService: IQuickOpenService, task: Task, highlights: Model.IHighlight[] = []) { + super(taskService, quickOpenService, task, highlights); } public run(mode: QuickOpen.Mode, context: Model.IContext): boolean { if (mode === QuickOpen.Mode.PREVIEW) { return false; } - this.taskService.run(this.task); - return true; + let task = this._task; + if (task.group === TaskGroup.Build && ((task.problemMatchers === void 0) || task.problemMatchers.length === 0)) { + this.attachProblemMatcher(task).then(task => this.doRun(task)); + return true; + } else { + return this.doRun(task); + } } } @@ -53,8 +58,8 @@ export class QuickOpenHandler extends base.QuickOpenHandler { }); } - protected createEntry(taskService: ITaskService, task: Task, highlights: Model.IHighlight[]): base.TaskEntry { - return new TaskEntry(taskService, task, highlights); + protected createEntry(task: Task, highlights: Model.IHighlight[]): base.TaskEntry { + return new TaskEntry(this.taskService, this.quickOpenService, task, highlights); } public getEmptyLabel(searchString: string): string { diff --git a/src/vs/workbench/parts/tasks/browser/terminateQuickOpen.ts b/src/vs/workbench/parts/tasks/browser/terminateQuickOpen.ts index 767e872a446fb3a133ecf2d71d670a4ab90c1fba..5317d3789003e30e1a2b1a55df23e4b69b99035a 100644 --- a/src/vs/workbench/parts/tasks/browser/terminateQuickOpen.ts +++ b/src/vs/workbench/parts/tasks/browser/terminateQuickOpen.ts @@ -16,15 +16,15 @@ import { ITaskService } from 'vs/workbench/parts/tasks/common/taskService'; import * as base from './quickOpen'; class TaskEntry extends base.TaskEntry { - constructor(taskService: ITaskService, task: Task, highlights: Model.IHighlight[] = []) { - super(taskService, task, highlights); + constructor(taskService: ITaskService, quickOpenService: IQuickOpenService, task: Task, highlights: Model.IHighlight[] = []) { + super(taskService, quickOpenService, task, highlights); } public run(mode: QuickOpen.Mode, context: Model.IContext): boolean { if (mode === QuickOpen.Mode.PREVIEW) { return false; } - this.taskService.terminate(this.task._id); + this.taskService.terminate(this._task._id); return true; } } @@ -45,8 +45,8 @@ export class QuickOpenHandler extends base.QuickOpenHandler { return this.taskService.getActiveTasks(); } - protected createEntry(taskService: ITaskService, task: Task, highlights: Model.IHighlight[]): base.TaskEntry { - return new TaskEntry(taskService, task, highlights); + protected createEntry(task: Task, highlights: Model.IHighlight[]): base.TaskEntry { + return new TaskEntry(this.taskService, this.quickOpenService, task, highlights); } public getEmptyLabel(searchString: string): string { diff --git a/src/vs/workbench/parts/tasks/browser/testQuickOpen.ts b/src/vs/workbench/parts/tasks/browser/testQuickOpen.ts new file mode 100644 index 0000000000000000000000000000000000000000..4c7f59844b0caca7426d5034d61daab8c7369940 --- /dev/null +++ b/src/vs/workbench/parts/tasks/browser/testQuickOpen.ts @@ -0,0 +1,63 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +'use strict'; + +import nls = require('vs/nls'); +import { TPromise } from 'vs/base/common/winjs.base'; +import QuickOpen = require('vs/base/parts/quickopen/common/quickOpen'); +import Model = require('vs/base/parts/quickopen/browser/quickOpenModel'); +import { IQuickOpenService } from 'vs/platform/quickOpen/common/quickOpen'; + +import { Task, TaskGroup } from 'vs/workbench/parts/tasks/common/tasks'; +import { ITaskService } from 'vs/workbench/parts/tasks/common/taskService'; + +import * as base from './quickOpen'; + +class TaskEntry extends base.TaskEntry { + constructor(taskService: ITaskService, quickOpenService: IQuickOpenService, task: Task, highlights: Model.IHighlight[] = []) { + super(taskService, quickOpenService, task, highlights); + } + + public run(mode: QuickOpen.Mode, context: Model.IContext): boolean { + if (mode === QuickOpen.Mode.PREVIEW) { + return false; + } + let task = this._task; + this.taskService.run(task); + if (task.command.presentation.focus) { + this.quickOpenService.close(); + return false; + } + return true; + } +} + +export class QuickOpenHandler extends base.QuickOpenHandler { + constructor( + @IQuickOpenService quickOpenService: IQuickOpenService, + @ITaskService taskService: ITaskService + ) { + super(quickOpenService, taskService); + } + + public getAriaLabel(): string { + return nls.localize('tasksAriaLabel', "Type the name of a test task"); + } + + protected getTasks(): TPromise { + return this.taskService.getTasksForGroup(TaskGroup.Test); + } + + protected createEntry(task: Task, highlights: Model.IHighlight[]): base.TaskEntry { + return new TaskEntry(this.taskService, this.quickOpenService, task, highlights); + } + + public getEmptyLabel(searchString: string): string { + if (searchString.length > 0) { + return nls.localize('noTasksMatching', "No tasks matching"); + } + return nls.localize('noTasksFound', "No test tasks found"); + } +} diff --git a/src/vs/workbench/parts/tasks/common/backlog.txt b/src/vs/workbench/parts/tasks/common/backlog.txt new file mode 100644 index 0000000000000000000000000000000000000000..44e22c25081d69ac09b6c4e373ebce1d9f9b7293 --- /dev/null +++ b/src/vs/workbench/parts/tasks/common/backlog.txt @@ -0,0 +1,6 @@ +Allow configuring of problem matchers for auto detected build tasks +Run Build > list of build tasks > user selected task with PM > show UI to select problem matcher > open tasks.json +Task Menu only in insider +Telemetry for task + +Polish task menu. \ No newline at end of file diff --git a/src/vs/workbench/parts/tasks/common/task.api.ts b/src/vs/workbench/parts/tasks/common/task.api.ts new file mode 100644 index 0000000000000000000000000000000000000000..212047ae08416b1039266b1711ccaffe86c0f2e5 --- /dev/null +++ b/src/vs/workbench/parts/tasks/common/task.api.ts @@ -0,0 +1,213 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +/** + * Defines a problem pattern + */ +export interface ProblemPattern { + + /** + * The regular expression to find a problem in the console output of an + * executed task. + */ + regexp: RegExp; + + /** + * The match group index of the filename. + * + * Defaults to 1 if omitted. + */ + file?: number; + + /** + * The match group index of the problems's location. Valid location + * patterns are: (line), (line,column) and (startLine,startColumn,endLine,endColumn). + * If omitted the line and colum properties are used. + */ + location?: number; + + /** + * The match group index of the problem's line in the source file. + * + * Defaults to 2 if omitted. + */ + line?: number; + + /** + * The match group index of the problem's character in the source file. + * + * Defaults to 3 if omitted. + */ + character?: number; + + /** + * The match group index of the problem's end line in the source file. + * + * Defaults to undefined. No end line is captured. + */ + endLine?: number; + + /** + * The match group index of the problem's end character in the source file. + * + * Defaults to undefined. No end column is captured. + */ + endCharacter?: number; + + /** + * The match group index of the problem's severity. + * + * Defaults to undefined. In this case the problem matcher's severity + * is used. + */ + severity?: number; + + /** + * The match group index of the problems's code. + * + * Defaults to undefined. No code is captured. + */ + code?: number; + + /** + * The match group index of the message. If omitted it defaults + * to 4 if location is specified. Otherwise it defaults to 5. + */ + message?: number; + + /** + * Specifies if the last pattern in a multi line problem matcher should + * loop as long as it does match a line consequently. Only valid on the + * last problem pattern in a multi line problem matcher. + */ + loop?: boolean; +} + +/** + * A multi line problem pattern. + */ +export type MultiLineProblemPattern = ProblemPattern[]; + +/** + * The way how the file location is interpreted + */ +export enum FileLocationKind { + /** + * VS Code should decide based on whether the file path found in the + * output is absolute or relative. A relative file path will be treated + * relative to the workspace root. + */ + Auto = 1, + + /** + * Always treat the file path relative. + */ + Relative = 2, + + /** + * Always treat the file path absolute. + */ + Absolute = 3 +} + +/** + * Controls to which kind of documents problems are applied. + */ +export enum ApplyToKind { + /** + * Problems are applied to all documents. + */ + AllDocuments = 1, + + /** + * Problems are applied to open documents only. + */ + OpenDocuments = 2, + + + /** + * Problems are applied to closed documents only. + */ + ClosedDocuments = 3 +} + + +/** + * A background monitor pattern + */ +export interface BackgroundPattern { + /** + * The actual regular expression + */ + regexp: RegExp; + + /** + * The match group index of the filename. If provided the expression + * is matched for that file only. + */ + file?: number; +} + +/** + * A description to control the activity of a problem matcher + * watching a background task. + */ +export interface BackgroundMonitor { + /** + * If set to true the monitor is in active mode when the task + * starts. This is equals of issuing a line that matches the + * beginPattern. + */ + activeOnStart?: boolean; + + /** + * If matched in the output the start of a background activity is signaled. + */ + beginsPattern: RegExp | BackgroundPattern; + + /** + * If matched in the output the end of a background activity is signaled. + */ + endsPattern: RegExp | BackgroundPattern; +} + +/** + * Defines a problem matcher + */ +export interface ProblemMatcher { + /** + * The owner of a problem. Defaults to a generated id + * if omitted. + */ + owner?: string; + + /** + * The type of documents problems detected by this matcher + * apply to. Default to `ApplyToKind.AllDocuments` if omitted. + */ + applyTo?: ApplyToKind; + + /** + * How a file location recognized by a matcher should be interpreted. If omitted the file location + * if `FileLocationKind.Auto`. + */ + fileLocation?: FileLocationKind | string; + + /** + * The actual pattern used by the problem matcher. + */ + pattern: ProblemPattern | MultiLineProblemPattern; + + /** + * The default severity of a detected problem in the output. Used + * if the `ProblemPattern` doesn't define a severity match group. + */ + severity?: any; + + /** + * A background monitor for tasks that are running in the background. + */ + backgound?: BackgroundMonitor; +} \ No newline at end of file diff --git a/src/vs/workbench/parts/tasks/common/taskConfiguration.ts b/src/vs/workbench/parts/tasks/common/taskConfiguration.ts deleted file mode 100644 index 87feaedfd38d004907978834bf6fe3af40517fe4..0000000000000000000000000000000000000000 --- a/src/vs/workbench/parts/tasks/common/taskConfiguration.ts +++ /dev/null @@ -1,1082 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -'use strict'; - -import nls = require('vs/nls'); - -import * as Objects from 'vs/base/common/objects'; -import { IStringDictionary } from 'vs/base/common/collections'; -import * as Platform from 'vs/base/common/platform'; -import * as Types from 'vs/base/common/types'; -import * as UUID from 'vs/base/common/uuid'; -import { Config as ProcessConfig } from 'vs/base/common/processes'; - -import { ValidationStatus, IProblemReporter as IProblemReporterBase } from 'vs/base/common/parsers'; -import { - NamedProblemMatcher, ProblemMatcher, ProblemMatcherParser, Config as ProblemMatcherConfig, - isNamedProblemMatcher, ProblemMatcherRegistry -} from 'vs/platform/markers/common/problemMatcher'; - -import * as Tasks from './tasks'; - -/** - * Defines the problem handling strategy - */ -export class ProblemHandling { - /** - * Cleans all problems for the owner defined in the - * error pattern. - */ - public static clean: string = 'cleanMatcherMatchers'; -} - -export interface PlatformTaskDescription { - /** - * The command to be executed. Can be an external program or a shell - * command. - */ - command?: string; - - /** - * Specifies whether the command is a shell command and therefore must - * be executed in a shell interpreter (e.g. cmd.exe, bash, ...). - * - * Defaults to false if omitted. - */ - isShellCommand?: boolean; - - /** - * The command options used when the command is executed. Can be omitted. - */ - options?: ProcessConfig.CommandOptions; - - /** - * The arguments passed to the command or additional arguments passed to the - * command when using a global command. - */ - args?: string[]; -} - -/** - * The description of a task. - */ -export interface TaskDescription extends PlatformTaskDescription { - - /** - * The task's name - */ - taskName: string; - - /** - * A unique optional identifier in case the name - * can't be used as such. - */ - identifier?: string; - - /** - * Windows specific task configuration - */ - windows?: PlatformTaskDescription; - - /** - * Mac specific task configuration - */ - osx?: PlatformTaskDescription; - - /** - * Linux speciif task configuration - */ - linux?: PlatformTaskDescription; - - /** - * @deprecated Use `isBackground` instead. - * Whether the executed command is kept alive and is watching the file system. - */ - isWatching?: boolean; - - /** - * Whether the executed command is kept alive and runs in the background. - */ - isBackground?: boolean; - - /** - * Whether the task should prompt on close for confirmation if running. - */ - promptOnClose?: boolean; - - /** - * Whether this task maps to the default build command. - */ - isBuildCommand?: boolean; - - /** - * Whether this task maps to the default test command. - */ - isTestCommand?: boolean; - - /** - * Controls whether the output view of the running tasks is brought to front or not. - * See BaseTaskRunnerConfiguration#showOutput for details. - */ - showOutput?: string; - - /** - * Controls whether the executed command is printed to the output windows as well. - */ - echoCommand?: boolean; - - /** - * See BaseTaskRunnerConfiguration#suppressTaskName for details. - */ - suppressTaskName?: boolean; - - /** - * The other tasks the task depend on - */ - dependsOn?: string | string[]; - - /** - * The problem matcher(s) to use to capture problems in the tasks - * output. - */ - problemMatcher?: ProblemMatcherConfig.ProblemMatcherType; -} - -/** - * The base task runner configuration - */ -export interface BaseTaskRunnerConfiguration { - - /** - * The command to be executed. Can be an external program or a shell - * command. - */ - command?: string; - - /** - * Specifies whether the command is a shell command and therefore must - * be executed in a shell interpreter (e.g. cmd.exe, bash, ...). - * - * Defaults to false if omitted. - */ - isShellCommand?: boolean; - - /** - * The command options used when the command is executed. Can be omitted. - */ - options?: ProcessConfig.CommandOptions; - - /** - * The arguments passed to the command. Can be omitted. - */ - args?: string[]; - - /** - * Controls whether the output view of the running tasks is brought to front or not. - * Valid values are: - * "always": bring the output window always to front when a task is executed. - * "silent": only bring it to front if no problem matcher is defined for the task executed. - * "never": never bring the output window to front. - * - * If omitted "always" is used. - */ - showOutput?: string; - - /** - * Controls whether the executed command is printed to the output windows as well. - */ - echoCommand?: boolean; - - /** - * If set to false the task name is added as an additional argument to the - * command when executed. If set to true the task name is suppressed. If - * omitted false is used. - */ - suppressTaskName?: boolean; - - /** - * Some commands require that the task argument is highlighted with a special - * prefix (e.g. /t: for msbuild). This property can be used to control such - * a prefix. - */ - taskSelector?: string; - - /** - * The problem matcher(s) to used if a global command is exucuted (e.g. no tasks - * are defined). A tasks.json file can either contain a global problemMatcher - * property or a tasks property but not both. - */ - problemMatcher?: ProblemMatcherConfig.ProblemMatcherType; - - /** - * @deprecated Use `isBackground` instead. - * - * Specifies whether a global command is a watching the filesystem. A task.json - * file can either contain a global isWatching property or a tasks property - * but not both. - */ - isWatching?: boolean; - - /** - * Specifies whether a global command is a background task. - */ - isBackground?: boolean; - - /** - * Whether the task should prompt on close for confirmation if running. - */ - promptOnClose?: boolean; - - /** - * The configuration of the available tasks. A tasks.json file can either - * contain a global problemMatcher property or a tasks property but not both. - */ - tasks?: TaskDescription[]; - - /** - * Problem matcher declarations - */ - declares?: ProblemMatcherConfig.NamedProblemMatcher[]; -} - -/** - * A configuration of an external build system. BuildConfiguration.buildSystem - * must be set to 'program' - */ -export interface ExternalTaskRunnerConfiguration extends BaseTaskRunnerConfiguration { - - _runner?: string; - - /** - * The config's version number - */ - version: string; - - /** - * Windows specific task configuration - */ - windows?: BaseTaskRunnerConfiguration; - - /** - * Mac specific task configuration - */ - osx?: BaseTaskRunnerConfiguration; - - /** - * Linux speciif task configuration - */ - linux?: BaseTaskRunnerConfiguration; -} - -enum ProblemMatcherKind { - Unknown, - String, - ProblemMatcher, - Array -} - -const EMPTY_ARRAY: any[] = []; -Object.freeze(EMPTY_ARRAY); - -function mergeProperty(target: T, source: T, key: K) { - if (source[key] !== void 0) { - target[key] = source[key]; - } -} - -interface ParseContext { - problemReporter: IProblemReporter; - namedProblemMatchers: IStringDictionary; - isTermnial: boolean; -} - -namespace CommandOptions { - export function from(this: void, options: ProcessConfig.CommandOptions, context: ParseContext): Tasks.CommandOptions { - let result: Tasks.CommandOptions = {}; - if (options.cwd !== void 0) { - if (Types.isString(options.cwd)) { - result.cwd = options.cwd; - } else { - context.problemReporter.warn(nls.localize('ConfigurationParser.invalidCWD', 'Warning: options.cwd must be of type string. Ignoring value {0}\n', options.cwd)); - } - } - if (options.env !== void 0) { - result.env = Objects.clone(options.env); - } - return isEmpty(result) ? undefined : result; - } - - export function isEmpty(value: Tasks.CommandOptions): boolean { - return !value || value.cwd === void 0 && value.env === void 0; - } - - export function merge(target: Tasks.CommandOptions, source: Tasks.CommandOptions): Tasks.CommandOptions { - if (isEmpty(source)) { - return target; - } - if (isEmpty(target)) { - return source; - } - mergeProperty(target, source, 'cwd'); - if (target.env === void 0) { - target.env = source.env; - } else if (source.env !== void 0) { - let env: { [key: string]: string; } = Object.create(null); - Object.keys(target.env).forEach(key => env[key] = target.env[key]); - Object.keys(source.env).forEach(key => env[key = source.env[key]]); - target.env = env; - } - return target; - } - - export function fillDefaults(value: Tasks.CommandOptions): Tasks.CommandOptions { - if (value && Object.isFrozen(value)) { - return value; - } - if (value === void 0) { - value = {}; - } - if (value.cwd === void 0) { - value.cwd = '${workspaceRoot}'; - } - return value; - } - - export function freeze(value: Tasks.CommandOptions): void { - Object.freeze(value); - if (value.env) { - Object.freeze(value.env); - } - } -} - -interface ShellConfiguration { - executable: string; - args?: string[]; -} - -namespace ShellConfiguration { - export function is(value: any): value is ShellConfiguration { - let candidate: ShellConfiguration = value; - return candidate && Types.isString(candidate.executable) && (candidate.args === void 0 || Types.isStringArray(candidate.args)); - } - - export function from(this: void, config: ShellConfiguration, context: ParseContext): Tasks.ShellConfiguration { - if (!is(config)) { - return undefined; - } - let result: ShellConfiguration = { executable: config.executable }; - if (config.args !== void 0) { - result.args = config.args.slice(); - } - return result; - } - - export function isEmpty(value: Tasks.ShellConfiguration): boolean { - return !value || value.executable === void 0 && (value.args === void 0 || value.args.length === 0); - } - - export function merge(target: Tasks.ShellConfiguration, source: Tasks.ShellConfiguration): Tasks.ShellConfiguration { - if (isEmpty(source)) { - return target; - } - if (isEmpty(target)) { - return source; - } - mergeProperty(target, source, 'executable'); - mergeProperty(target, source, 'args'); - return target; - } - - export function fillDefaults(value: Tasks.ShellConfiguration): void { - } - - export function freeze(value: Tasks.ShellConfiguration): void { - if (!value) { - return; - } - Object.freeze(value); - } -} - -namespace CommandConfiguration { - interface BaseCommandConfiguationShape { - command?: string; - isShellCommand?: boolean | ShellConfiguration; - args?: string[]; - options?: ProcessConfig.CommandOptions; - echoCommand?: boolean; - taskSelector?: string; - } - - interface CommandConfiguationShape extends BaseCommandConfiguationShape { - windows?: BaseCommandConfiguationShape; - osx?: BaseCommandConfiguationShape; - linux?: BaseCommandConfiguationShape; - } - - export function from(this: void, config: CommandConfiguationShape, context: ParseContext): Tasks.CommandConfiguration { - let result: Tasks.CommandConfiguration = fromBase(config, context); - - let osConfig: Tasks.CommandConfiguration = undefined; - if (config.windows && Platform.platform === Platform.Platform.Windows) { - osConfig = fromBase(config.windows, context); - } else if (config.osx && Platform.platform === Platform.Platform.Mac) { - osConfig = fromBase(config.osx, context); - } else if (config.linux && Platform.platform === Platform.Platform.Linux) { - osConfig = fromBase(config.linux, context); - } - if (osConfig) { - result = merge(result, osConfig); - } - fillDefaults(result); - return isEmpty(result) ? undefined : result; - } - - function fromBase(this: void, config: BaseCommandConfiguationShape, context: ParseContext): Tasks.CommandConfiguration { - let result: Tasks.CommandConfiguration = { - name: undefined, - isShellCommand: undefined, - echo: undefined - }; - if (Types.isString(config.command)) { - result.name = config.command; - } - if (Types.isBoolean(config.isShellCommand)) { - result.isShellCommand = config.isShellCommand; - } else if (ShellConfiguration.is(config.isShellCommand)) { - result.isShellCommand = ShellConfiguration.from(config.isShellCommand, context); - if (!context.isTermnial) { - context.problemReporter.warn(nls.localize('ConfigurationParser.noShell', 'Warning: shell configuration is only supported when executing tasks in the terminal.')); - } - } else if (config.isShellCommand !== void 0) { - result.isShellCommand = !!config.isShellCommand; - } - if (config.args !== void 0) { - if (Types.isStringArray(config.args)) { - result.args = config.args.slice(0); - } else { - context.problemReporter.fatal(nls.localize('ConfigurationParser.noargs', 'Error: command arguments must be an array of strings. Provided value is:\n{0}', config.args ? JSON.stringify(config.args, undefined, 4) : 'undefined')); - } - } - if (config.options !== void 0) { - result.options = CommandOptions.from(config.options, context); - } - if (Types.isBoolean(config.echoCommand)) { - result.echo = config.echoCommand; - } - if (Types.isString(config.taskSelector)) { - result.taskSelector = config.taskSelector; - } - return isEmpty(result) ? undefined : result; - } - - export function isEmpty(value: Tasks.CommandConfiguration): boolean { - return !value || value.name === void 0 && value.isShellCommand === void 0 && value.args === void 0 && CommandOptions.isEmpty(value.options) && value.echo === void 0; - } - - export function onlyEcho(value: Tasks.CommandConfiguration): boolean { - return value && value.echo !== void 0 && value.name === void 0 && value.isShellCommand === void 0 && value.args === void 0 && CommandOptions.isEmpty(value.options); - } - - export function merge(target: Tasks.CommandConfiguration, source: Tasks.CommandConfiguration): Tasks.CommandConfiguration { - if (isEmpty(source)) { - return target; - } - if (isEmpty(target)) { - return source; - } - mergeProperty(target, source, 'name'); - // Merge isShellCommand - if (target.isShellCommand === void 0) { - target.isShellCommand = source.isShellCommand; - } if (Types.isBoolean(target.isShellCommand) && Types.isBoolean(source.isShellCommand)) { - mergeProperty(target, source, 'isShellCommand'); - } else if (ShellConfiguration.is(target.isShellCommand) && ShellConfiguration.is(source.isShellCommand)) { - ShellConfiguration.merge(target.isShellCommand, source.isShellCommand); - } else if (Types.isBoolean(target.isShellCommand) && ShellConfiguration.is(source.isShellCommand)) { - target.isShellCommand = source.isShellCommand; - } - - mergeProperty(target, source, 'echo'); - mergeProperty(target, source, 'taskSelector'); - if (source.args !== void 0) { - if (target.args === void 0) { - target.args = source.args; - } else { - target.args = target.args.concat(source.args); - } - } - target.options = CommandOptions.merge(target.options, source.options); - return target; - } - - export function fillDefaults(value: Tasks.CommandConfiguration): void { - if (!value || Object.isFrozen(value)) { - return; - } - if (value.name !== void 0 && value.isShellCommand === void 0) { - value.isShellCommand = false; - } - if (value.echo === void 0) { - value.echo = false; - } - if (value.args === void 0) { - value.args = EMPTY_ARRAY; - } - if (!isEmpty(value)) { - value.options = CommandOptions.fillDefaults(value.options); - } - } - - export function freeze(value: Tasks.CommandConfiguration): void { - Object.freeze(value); - if (value.args) { - Object.freeze(value.args); - } - if (value.options) { - CommandOptions.freeze(value.options); - } - if (ShellConfiguration.is(value.isShellCommand)) { - ShellConfiguration.freeze(value.isShellCommand); - } - } -} - -namespace ProblemMatcherConverter { - - export function namedFrom(this: void, declares: ProblemMatcherConfig.NamedProblemMatcher[], context: ParseContext): IStringDictionary { - let result: IStringDictionary = Object.create(null); - - if (!Types.isArray(declares)) { - return result; - } - (declares).forEach((value) => { - let namedProblemMatcher = (new ProblemMatcherParser(context.problemReporter)).parse(value); - if (isNamedProblemMatcher(namedProblemMatcher)) { - result[namedProblemMatcher.name] = namedProblemMatcher; - } else { - context.problemReporter.error(nls.localize('ConfigurationParser.noName', 'Error: Problem Matcher in declare scope must have a name:\n{0}\n', JSON.stringify(value, undefined, 4))); - } - }); - return result; - } - - export function from(this: void, config: ProblemMatcherConfig.ProblemMatcherType, context: ParseContext): ProblemMatcher[] { - let result: ProblemMatcher[] = []; - if (config === void 0) { - return result; - } - let kind = getProblemMatcherKind(config); - if (kind === ProblemMatcherKind.Unknown) { - context.problemReporter.warn(nls.localize( - 'ConfigurationParser.unknownMatcherKind', - 'Warning: the defined problem matcher is unknown. Supported types are string | ProblemMatcher | (string | ProblemMatcher)[].\n{0}\n', - JSON.stringify(config, null, 4))); - return result; - } else if (kind === ProblemMatcherKind.String || kind === ProblemMatcherKind.ProblemMatcher) { - let matcher = resolveProblemMatcher(config, context); - if (matcher) { - result.push(matcher); - } - } else if (kind === ProblemMatcherKind.Array) { - let problemMatchers = <(string | ProblemMatcherConfig.ProblemMatcher)[]>config; - problemMatchers.forEach(problemMatcher => { - let matcher = resolveProblemMatcher(problemMatcher, context); - if (matcher) { - result.push(matcher); - } - }); - } - return result; - } - - function getProblemMatcherKind(this: void, value: ProblemMatcherConfig.ProblemMatcherType): ProblemMatcherKind { - if (Types.isString(value)) { - return ProblemMatcherKind.String; - } else if (Types.isArray(value)) { - return ProblemMatcherKind.Array; - } else if (!Types.isUndefined(value)) { - return ProblemMatcherKind.ProblemMatcher; - } else { - return ProblemMatcherKind.Unknown; - } - } - - function resolveProblemMatcher(this: void, value: string | ProblemMatcherConfig.ProblemMatcher, context: ParseContext): ProblemMatcher { - if (Types.isString(value)) { - let variableName = value; - if (variableName.length > 1 && variableName[0] === '$') { - variableName = variableName.substring(1); - let global = ProblemMatcherRegistry.get(variableName); - if (global) { - return Objects.clone(global); - } - let localProblemMatcher = context.namedProblemMatchers[variableName]; - if (localProblemMatcher) { - localProblemMatcher = Objects.clone(localProblemMatcher); - // remove the name - delete localProblemMatcher.name; - return localProblemMatcher; - } - } - context.problemReporter.error(nls.localize('ConfigurationParser.invalidVaraibleReference', 'Error: Invalid problemMatcher reference: {0}\n', value)); - return undefined; - } else { - let json = value; - return new ProblemMatcherParser(context.problemReporter).parse(json); - } - } -} - -interface TaskParseResult { - tasks: Tasks.Task[] | undefined; - annotatingTasks: Tasks.Task[] | undefined; -} - -namespace TaskDescription { - - export let source: Tasks.TaskSource = { - kind: Tasks.TaskSourceKind.Workspace, - detail: '.settins\tasks.json' - }; - - export function from(this: void, tasks: TaskDescription[], globals: Globals, context: ParseContext): TaskParseResult { - if (!tasks) { - return undefined; - } - let parsedTasks: Tasks.Task[] = []; - let annotatingTasks: Tasks.Task[] = []; - let defaultBuildTask: { task: Tasks.Task; rank: number; } = { task: null, rank: -1 }; - let defaultTestTask: { task: Tasks.Task; rank: number; } = { task: null, rank: -1 }; - tasks.forEach((externalTask) => { - let taskName = externalTask.taskName; - if (!taskName) { - context.problemReporter.fatal(nls.localize('ConfigurationParser.noTaskName', 'Error: tasks must provide a taskName property. The task will be ignored.\n{0}\n', JSON.stringify(externalTask, null, 4))); - return; - } - let problemMatchers = ProblemMatcherConverter.from(externalTask.problemMatcher, context); - let command: Tasks.CommandConfiguration = externalTask.command !== void 0 - ? CommandConfiguration.from(externalTask, context) - : externalTask.echoCommand !== void 0 ? { name: undefined, isShellCommand: undefined, echo: !!externalTask.echoCommand } : undefined; - let identifer = Types.isString(externalTask.identifier) ? externalTask.identifier : taskName; - let task: Tasks.Task = { - _id: UUID.generateUuid(), - _source: source, - name: taskName, - identifier: identifer, - command, - showOutput: undefined - }; - if (externalTask.command === void 0 && Types.isStringArray(externalTask.args)) { - task.args = externalTask.args.slice(); - } - if (externalTask.isWatching !== void 0) { - task.isBackground = !!externalTask.isWatching; - } - if (externalTask.isBackground !== void 0) { - task.isBackground = !!externalTask.isBackground; - } - if (externalTask.promptOnClose !== void 0) { - task.promptOnClose = !!externalTask.promptOnClose; - } - if (Types.isString(externalTask.showOutput)) { - task.showOutput = Tasks.ShowOutput.fromString(externalTask.showOutput); - } - if (externalTask.command !== void 0) { - // if the task has its own command then we suppress the - // task name by default. - task.suppressTaskName = true; - } else if (externalTask.suppressTaskName !== void 0) { - task.suppressTaskName = !!externalTask.suppressTaskName; - } - if (externalTask.dependsOn !== void 0) { - if (Types.isString(externalTask.dependsOn)) { - task.dependsOn = [externalTask.dependsOn]; - } else if (Types.isStringArray(externalTask.dependsOn)) { - task.dependsOn = externalTask.dependsOn.slice(); - } - } - if (problemMatchers) { - task.problemMatchers = problemMatchers; - } - mergeGlobals(task, globals); - if (context.isTermnial && isAnnotating(task)) { - annotatingTasks.push(task); - return; - } - fillDefaults(task); - let addTask: boolean = true; - if (context.isTermnial && task.command && task.command.name && task.command.isShellCommand && task.command.args && task.command.args.length > 0) { - if (hasUnescapedSpaces(task.command.name) || task.command.args.some(hasUnescapedSpaces)) { - context.problemReporter.warn(nls.localize('taskConfiguration.shellArgs', 'Warning: the task \'{0}\' is a shell command and either the command name or one of its arguments has unescaped spaces. To ensure correct command line quoting please merge args into the command.', task.name)); - } - } - if (context.isTermnial) { - if ((task.command === void 0 || task.command.name === void 0) && (task.dependsOn === void 0 || task.dependsOn.length === 0)) { - context.problemReporter.error(nls.localize( - 'taskConfiguration.noCommandOrDependsOn', 'Error: the task \'{0}\' neither specifies a command or a dependsOn property. The task will be ignored. Its definition is:\n{1}', - task.name, JSON.stringify(externalTask, undefined, 4) - )); - addTask = false; - } - } else { - if (task.command === void 0 || task.command.name === void 0) { - context.problemReporter.warn(nls.localize( - 'taskConfiguration.noCommand', 'Error: the task \'{0}\' doesn\'t define a command. The task will be ignored. Its definition is:\n{1}', - task.name, JSON.stringify(externalTask, undefined, 4) - )); - addTask = false; - } - } - if (addTask) { - parsedTasks.push(task); - if (!Types.isUndefined(externalTask.isBuildCommand) && externalTask.isBuildCommand && defaultBuildTask.rank < 2) { - defaultBuildTask.task = task; - defaultBuildTask.rank = 2; - } else if (taskName === 'build' && defaultBuildTask.rank < 2) { - defaultBuildTask.task = task; - defaultBuildTask.rank = 1; - } - if (!Types.isUndefined(externalTask.isTestCommand) && externalTask.isTestCommand && defaultTestTask.rank < 2) { - defaultTestTask.task = task; - defaultTestTask.rank = 2; - } else if (taskName === 'test' && defaultTestTask.rank < 2) { - defaultTestTask.task = task; - defaultTestTask.rank = 1; - } - } - }); - if (defaultBuildTask.task) { - defaultBuildTask.task.group = Tasks.TaskGroup.Build; - } - if (defaultTestTask.task) { - defaultTestTask.task.group = Tasks.TaskGroup.Test; - } - return parsedTasks.length === 0 && annotatingTasks.length === 0 ? undefined : { tasks: parsedTasks, annotatingTasks: annotatingTasks }; - } - - export function mergeTasks(target: Tasks.Task[], source: Tasks.Task[]): Tasks.Task[] { - if (source === void 0 || source.length === 0) { - return target; - } - if (target === void 0 || target.length === 0) { - return source; - } - - if (source) { - // Tasks are keyed by ID but we need to merge by name - let map: IStringDictionary = Object.create(null); - target.forEach((task) => { - map[task.name] = task; - }); - - source.forEach((task) => { - map[task.name] = task; - }); - let newTarget: Tasks.Task[] = []; - target.forEach(task => { - newTarget.push(map[task.name]); - delete map[task.name]; - }); - Object.keys(map).forEach(key => newTarget.push(map[key])); - target = newTarget; - } - return target; - } - - export function mergeGlobals(task: Tasks.Task, globals: Globals): void { - // We only merge a command from a global definition if there is no dependsOn - if (task.dependsOn === void 0) { - if (CommandConfiguration.isEmpty(task.command) && !CommandConfiguration.isEmpty(globals.command) && globals.command.name !== void 0) { - task.command = globals.command; - } - if (CommandConfiguration.onlyEcho(task.command)) { - // The globals can have a echo set which would override the local echo - // Saves the need of a additional fill method. But might be necessary - // at some point. - let oldEcho = task.command.echo; - CommandConfiguration.merge(task.command, globals.command); - task.command.echo = oldEcho; - } - } - // promptOnClose is inferred from isBackground if available - if (task.promptOnClose === void 0 && task.isBackground === void 0 && globals.promptOnClose !== void 0) { - task.promptOnClose = globals.promptOnClose; - } - if (task.suppressTaskName === void 0 && globals.suppressTaskName !== void 0) { - task.suppressTaskName = globals.suppressTaskName; - } - if (task.showOutput === void 0 && globals.showOutput !== void 0) { - task.showOutput = globals.showOutput; - } - } - - export function fillDefaults(task: Tasks.Task): void { - CommandConfiguration.fillDefaults(task.command); - if (task.args === void 0 && task.command === void 0) { - task.args = EMPTY_ARRAY; - } - if (task.suppressTaskName === void 0) { - task.suppressTaskName = false; - } - if (task.promptOnClose === void 0) { - task.promptOnClose = task.isBackground !== void 0 ? !task.isBackground : true; - } - if (task.isBackground === void 0) { - task.isBackground = false; - } - if (task.showOutput === void 0) { - task.showOutput = Tasks.ShowOutput.Always; - } - if (task.problemMatchers === void 0) { - task.problemMatchers = EMPTY_ARRAY; - } - } - - function hasUnescapedSpaces(value: string): boolean { - if (Platform.isWindows) { - if (value.length >= 2 && value.charAt(0) === '"' && value.charAt(value.length - 1) === '"') { - return false; - } - return value.indexOf(' ') !== -1; - } else { - if (value.length >= 2 && ((value.charAt(0) === '"' && value.charAt(value.length - 1) === '"') || (value.charAt(0) === '\'' && value.charAt(value.length - 1) === '\''))) { - return false; - } - for (let i = 0; i < value.length; i++) { - let ch = value.charAt(i); - if (ch === ' ') { - if (i === 0 || value.charAt(i) !== '\\') { - return true; - } - } - } - return false; - } - } - - function isAnnotating(task: Tasks.Task): boolean { - return (task.command === void 0 || task.command.name === void 0) && (task.dependsOn === void 0 || task.dependsOn.length === 0); - } - - export function merge(target: Tasks.Task, source: Tasks.Task): Tasks.Task { - if (!target) { - return source; - } - if (!source) { - return target; - } - - mergeProperty(target, source, 'group'); - target.command = CommandConfiguration.merge(target.command, source.command); - mergeProperty(target, source, 'suppressTaskName'); - mergeProperty(target, source, 'args'); - mergeProperty(target, source, 'isBackground'); - mergeProperty(target, source, 'promptOnClose'); - mergeProperty(target, source, 'showOutput'); - mergeProperty(target, source, 'dependsOn'); - mergeProperty(target, source, 'problemMatchers'); - return target; - } -} - -interface Globals { - command?: Tasks.CommandConfiguration; - promptOnClose?: boolean; - suppressTaskName?: boolean; - showOutput?: Tasks.ShowOutput; -} - -namespace Globals { - - export function from(config: ExternalTaskRunnerConfiguration, context: ParseContext): Globals { - let result = fromBase(config, context); - let osGlobals: Globals = undefined; - if (config.windows && Platform.platform === Platform.Platform.Windows) { - osGlobals = fromBase(config.windows, context); - } else if (config.osx && Platform.platform === Platform.Platform.Mac) { - osGlobals = fromBase(config.osx, context); - } else if (config.linux && Platform.platform === Platform.Platform.Linux) { - osGlobals = fromBase(config.linux, context); - } - if (osGlobals) { - result = Globals.merge(result, osGlobals); - } - Globals.fillDefaults(result); - let command = CommandConfiguration.from(config, context); - if (command) { - result.command = command; - } - Globals.freeze(result); - return result; - } - - export function fromBase(this: void, config: BaseTaskRunnerConfiguration, context: ParseContext): Globals { - let result: Globals = {}; - if (Types.isString(config.showOutput)) { - result.showOutput = Tasks.ShowOutput.fromString(config.showOutput); - } - if (config.suppressTaskName !== void 0) { - result.suppressTaskName = !!config.suppressTaskName; - } - if (config.promptOnClose !== void 0) { - result.promptOnClose = !!config.promptOnClose; - } - return result; - } - - export function isEmpty(value: Globals): boolean { - return !value || value.command === void 0 && value.promptOnClose === void 0 && value.showOutput === void 0 && value.suppressTaskName === void 0; - } - - export function merge(target: Globals, source: Globals): Globals { - if (isEmpty(source)) { - return target; - } - if (isEmpty(target)) { - return source; - } - mergeProperty(target, source, 'promptOnClose'); - mergeProperty(target, source, 'suppressTaskName'); - mergeProperty(target, source, 'showOutput'); - return target; - } - - export function fillDefaults(value: Globals): void { - if (!value) { - return; - } - if (value.suppressTaskName === void 0) { - value.suppressTaskName = false; - } - if (value.showOutput === void 0) { - value.showOutput = Tasks.ShowOutput.Always; - } - if (value.promptOnClose === void 0) { - value.promptOnClose = true; - } - } - - export function freeze(value: Globals): void { - Object.freeze(value); - if (value.command) { - CommandConfiguration.freeze(value.command); - } - } -} - -export namespace ExecutionEngine { - - export function from(config: ExternalTaskRunnerConfiguration): Tasks.ExecutionEngine { - return isTerminalConfig(config) - ? Tasks.ExecutionEngine.Terminal - : isRunnerConfig(config) - ? Tasks.ExecutionEngine.Process - : Tasks.ExecutionEngine.Unknown; - } - - function isRunnerConfig(config: ExternalTaskRunnerConfiguration): boolean { - return (!config._runner || config._runner === 'program') && (config.version === '0.1.0' || !config.version); - } - - function isTerminalConfig(config: ExternalTaskRunnerConfiguration): boolean { - return config._runner === 'terminal' || config.version === '2.0.0'; - } -} - -export interface ParseResult { - validationStatus: ValidationStatus; - tasks: Tasks.Task[]; - annotatingTasks: Tasks.Task[]; - engine: Tasks.ExecutionEngine; -} - -export interface IProblemReporter extends IProblemReporterBase { - clearOutput(): void; -} - -class ConfigurationParser { - - private problemReporter: IProblemReporter; - constructor(problemReporter: IProblemReporter) { - this.problemReporter = problemReporter; - } - - public run(fileConfig: ExternalTaskRunnerConfiguration): ParseResult { - let engine = ExecutionEngine.from(fileConfig); - if (engine === Tasks.ExecutionEngine.Terminal) { - this.problemReporter.clearOutput(); - } - let context: ParseContext = { - problemReporter: this.problemReporter, - namedProblemMatchers: undefined, - isTermnial: engine === Tasks.ExecutionEngine.Terminal - }; - let taskParseResult = this.createTaskRunnerConfiguration(fileConfig, context); - return { - validationStatus: this.problemReporter.status, - tasks: taskParseResult.tasks, - annotatingTasks: taskParseResult.annotatingTasks, - engine - }; - } - - private createTaskRunnerConfiguration(fileConfig: ExternalTaskRunnerConfiguration, context: ParseContext): TaskParseResult { - let globals = Globals.from(fileConfig, context); - if (this.problemReporter.status.isFatal()) { - return undefined; - } - context.namedProblemMatchers = ProblemMatcherConverter.namedFrom(fileConfig.declares, context); - let globalTasks: TaskParseResult; - if (fileConfig.windows && Platform.platform === Platform.Platform.Windows) { - globalTasks = TaskDescription.from(fileConfig.windows.tasks, globals, context); - } else if (fileConfig.osx && Platform.platform === Platform.Platform.Mac) { - globalTasks = TaskDescription.from(fileConfig.osx.tasks, globals, context); - } else if (fileConfig.linux && Platform.platform === Platform.Platform.Linux) { - globalTasks = TaskDescription.from(fileConfig.linux.tasks, globals, context); - } - - let result: TaskParseResult = { tasks: undefined, annotatingTasks: undefined }; - if (fileConfig.tasks) { - result = TaskDescription.from(fileConfig.tasks, globals, context); - } - if (globalTasks) { - result.tasks = TaskDescription.mergeTasks(result.tasks, globalTasks.tasks); - result.annotatingTasks = TaskDescription.mergeTasks(result.annotatingTasks, globalTasks.annotatingTasks); - } - - if ((!result.tasks || result.tasks.length === 0) && (globals.command && globals.command.name)) { - let matchers: ProblemMatcher[] = ProblemMatcherConverter.from(fileConfig.problemMatcher, context);; - let isBackground = fileConfig.isBackground ? !!fileConfig.isBackground : fileConfig.isWatching ? !!fileConfig.isWatching : undefined; - let task: Tasks.Task = { - _id: UUID.generateUuid(), - _source: TaskDescription.source, - name: globals.command.name, - identifier: globals.command.name, - group: Tasks.TaskGroup.Build, - command: undefined, - isBackground: isBackground, - showOutput: undefined, - suppressTaskName: true, // this must be true since we infer the task from the global data. - problemMatchers: matchers - }; - TaskDescription.mergeGlobals(task, globals); - TaskDescription.fillDefaults(task); - result.tasks = [task]; - } - result.tasks = result.tasks || []; - result.annotatingTasks = result.annotatingTasks || []; - return result; - } -} - -export function parse(configuration: ExternalTaskRunnerConfiguration, logger: IProblemReporter): ParseResult { - return (new ConfigurationParser(logger)).run(configuration); -} - -export function mergeTasks(target: Tasks.Task, source: Tasks.Task): Tasks.Task { - return TaskDescription.merge(target, source); -} \ No newline at end of file diff --git a/src/vs/workbench/parts/tasks/common/taskSampleConfig.json b/src/vs/workbench/parts/tasks/common/taskSampleConfig.json deleted file mode 100644 index 5fc7fce47f9be03fe33505464228e26126896d2b..0000000000000000000000000000000000000000 --- a/src/vs/workbench/parts/tasks/common/taskSampleConfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - // See https://go.microsoft.com/fwlink/?LinkId=733558 - // for the documentation about the tasks.json format - // Use IntelliSense to insert predefined task snippets - -} \ No newline at end of file diff --git a/src/vs/workbench/parts/tasks/common/taskService.ts b/src/vs/workbench/parts/tasks/common/taskService.ts index 53f92ee18ee8b4a47f124a4657a207f491469bcb..82a5c8bfdca10eb1437930bf90c5c05d7dd3b7ca 100644 --- a/src/vs/workbench/parts/tasks/common/taskService.ts +++ b/src/vs/workbench/parts/tasks/common/taskService.ts @@ -7,12 +7,12 @@ import { TPromise } from 'vs/base/common/winjs.base'; import { Action } from 'vs/base/common/actions'; import { IEventEmitter } from 'vs/base/common/eventEmitter'; -import { TerminateResponse } from 'vs/base/common/processes'; +import { LinkedMap } from 'vs/base/common/map'; import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; import { Task, TaskSet } from 'vs/workbench/parts/tasks/common/tasks'; -import { ITaskSummary, TaskEvent, TaskType } from 'vs/workbench/parts/tasks/common/taskSystem'; +import { ITaskSummary, TaskEvent, TaskType, TaskTerminateResponse } from 'vs/workbench/parts/tasks/common/taskSystem'; -export { ITaskSummary, Task, TaskEvent, TaskType }; +export { ITaskSummary, Task, TaskEvent, TaskType, TaskTerminateResponse }; export const ITaskService = createDecorator('taskService'); @@ -39,9 +39,13 @@ export interface ITaskService extends IEventEmitter { isActive(): TPromise; getActiveTasks(): TPromise; restart(task: string | Task): void; - terminate(task: string | Task): TPromise; - terminateAll(): TPromise; + terminate(task: string | Task): TPromise; + terminateAll(): TPromise; tasks(): TPromise; + getTasksForGroup(group: string): TPromise; + getRecentlyUsedTasks(): LinkedMap; + + customize(task: Task, properties?: { problemMatcher: string | string[] }, openConfig?: boolean): TPromise; registerTaskProvider(handle: number, taskProvider: ITaskProvider): void; unregisterTaskProvider(handle: number): boolean; diff --git a/src/vs/workbench/parts/tasks/common/taskSystem.ts b/src/vs/workbench/parts/tasks/common/taskSystem.ts index cca11d1e6a9d96c8c68cd82e44790da24390371e..434910b2b09c200d4a88ebddf93400c6962c59a3 100644 --- a/src/vs/workbench/parts/tasks/common/taskSystem.ts +++ b/src/vs/workbench/parts/tasks/common/taskSystem.ts @@ -37,6 +37,8 @@ export interface TelemetryEvent { // How the task got trigger. Is either shortcut or command trigger: string; + runner: 'terminal' | 'output'; + // The command triggered command: string; @@ -79,6 +81,7 @@ export interface ITaskExecuteResult { export namespace TaskSystemEvents { export let Active: string = 'active'; export let Inactive: string = 'inactive'; + export let Terminated: string = 'terminated'; } export enum TaskType { @@ -90,18 +93,23 @@ export interface TaskEvent { taskId?: string; taskName?: string; type?: TaskType; + group?: string; } export interface ITaskResolver { resolve(identifier: string): Task; } +export interface TaskTerminateResponse extends TerminateResponse { + task: Task | undefined; +} + export interface ITaskSystem extends IEventEmitter { run(task: Task, resolver: ITaskResolver): ITaskExecuteResult; isActive(): TPromise; isActiveSync(): boolean; getActiveTasks(): Task[]; canAutoTerminate(): boolean; - terminate(id: string): TPromise; - terminateAll(): TPromise; + terminate(id: string): TPromise; + terminateAll(): TPromise; } \ No newline at end of file diff --git a/src/vs/workbench/parts/tasks/common/taskTemplates.ts b/src/vs/workbench/parts/tasks/common/taskTemplates.ts index 01d2b68a0d0eaf1ecd9bba79526a609e27b1629e..ee003a6917329e963cddfad773aeb533f6881922 100644 --- a/src/vs/workbench/parts/tasks/common/taskTemplates.ts +++ b/src/vs/workbench/parts/tasks/common/taskTemplates.ts @@ -14,6 +14,123 @@ export interface TaskEntry extends IPickOpenEntry { content: string; } +const dotnetBuild: TaskEntry = { + id: 'dotnetCore', + label: '.NET Core', + sort: 'NET Core', + autoDetect: false, + description: nls.localize('dotnetCore', 'Executes .NET Core build command'), + content: [ + '{', + '\t// See https://go.microsoft.com/fwlink/?LinkId=733558', + '\t// for the documentation about the tasks.json format', + '\t"version": "2.0.0",', + '\t"tasks": [', + '\t\t{', + '\t\t\t"taskName": "build",', + '\t\t\t"command": "dotnet",', + '\t\t\t"type": "shell",', + '\t\t\t"group": "build",', + '\t\t\t"terminal": {', + '\t\t\t\t"reveal": "silent"', + '\t\t\t},', + '\t\t\t"problemMatcher": "$msCompile"', + '\t\t}', + '\t]', + '}' + ].join('\n') +}; + +const msbuild: TaskEntry = { + id: 'msbuild', + label: 'MSBuild', + autoDetect: false, + description: nls.localize('msbuild', 'Executes the build target'), + content: [ + '{', + '\t// See https://go.microsoft.com/fwlink/?LinkId=733558', + '\t// for the documentation about the tasks.json format', + '\t"version": "2.0.0",', + '\t"tasks": [', + '\t\t{', + '\t\t\t"taskName": "build",', + '\t\t\t"command": "msbuild",', + '\t\t\t"args": [', + '\t\t\t\t// Ask msbuild to generate full paths for file names.', + '\t\t\t\t"/property:GenerateFullPaths=true",', + '\t\t\t\t"/t:build"', + '\t\t\t],', + '\t\t\t"group": "build",', + '\t\t\t"terminal": {', + '\t\t\t\t// Reveal the terminal only if unrecognized errors occur.', + '\t\t\t\t"reveal": "silent"', + '\t\t\t},', + '\t\t\t// Use the standard MS compiler pattern to detect errors, warnings and infos', + '\t\t\t"problemMatcher": "$msCompile"', + '\t\t}', + '\t]', + '}' + ].join('\n') +}; + +const command: TaskEntry = { + id: 'externalCommand', + label: 'Others', + autoDetect: false, + description: nls.localize('externalCommand', 'Example to run an arbitrary external command'), + content: [ + '{', + '\t// See https://go.microsoft.com/fwlink/?LinkId=733558', + '\t// for the documentation about the tasks.json format', + '\t"version": "2.0.0",', + '\t"tasks": [', + '\t\t{', + '\t\t\t"taskName": "echo",', + '\t\t\t"command": "echo Hello",', + '\t\t\t"type": "shell"', + '\t\t}', + '\t]', + '}' + ].join('\n') +}; + +const maven: TaskEntry = { + id: 'maven', + label: 'maven', + sort: 'MVN', + autoDetect: false, + description: nls.localize('Maven', 'Executes common maven commands'), + content: [ + '{', + '\t// See https://go.microsoft.com/fwlink/?LinkId=733558', + '\t// for the documentation about the tasks.json format', + '\t"version": "2.0.0",', + '\t"tasks": [', + '\t\t{', + '\t\t\t"taskName": "verify",', + '\t\t\t"command": "mvn -B verify",', + '\t\t\t"type": "shell",', + '\t\t\t"group": "build"', + '\t\t},', + '\t\t{', + '\t\t\t"taskName": "test",', + '\t\t\t"command": "mvn -B test",', + '\t\t\t"type": "shell",', + '\t\t\t"group": "test"', + '\t\t}', + '\t]', + '}' + ].join('\n') +}; + +export let templates: TaskEntry[] = [dotnetBuild, msbuild, maven].sort((a, b) => { + return (a.sort || a.label).localeCompare(b.sort || b.label); +}); +templates.push(command); + + +/** Version 1.0 templates + * const gulp: TaskEntry = { id: 'gulp', label: 'Gulp', @@ -229,3 +346,4 @@ export let templates: TaskEntry[] = [gulp, grunt, tscConfig, tscWatch, dotnetBui return (a.sort || a.label).localeCompare(b.sort || b.label); }); templates.push(command); +*/ \ No newline at end of file diff --git a/src/vs/workbench/parts/tasks/common/taskTypeRegistry.ts b/src/vs/workbench/parts/tasks/common/taskTypeRegistry.ts new file mode 100644 index 0000000000000000000000000000000000000000..41f888b7f4a894bada40a8dd43b1d5a1b6719af8 --- /dev/null +++ b/src/vs/workbench/parts/tasks/common/taskTypeRegistry.ts @@ -0,0 +1,123 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +'use strict'; + +import * as nls from 'vs/nls'; +import { IJSONSchema, IJSONSchemaMap } from 'vs/base/common/jsonSchema'; +import { IStringDictionary } from 'vs/base/common/collections'; +import { TPromise } from 'vs/base/common/winjs.base'; +import * as Types from 'vs/base/common/types'; +import * as Objects from 'vs/base/common/objects'; + +import { ExtensionsRegistry, ExtensionMessageCollector } from 'vs/platform/extensions/common/extensionsRegistry'; + +import * as Tasks from 'vs/workbench/parts/tasks/common/tasks'; + + +const taskTypeSchema: IJSONSchema = { + type: 'object', + additionalProperties: false, + properties: { + type: { + type: 'string', + description: nls.localize('TaskType.description', 'The actual task type') + }, + properties: { + type: 'object', + description: nls.localize('TaskType.properties', 'Additional properties of the task type'), + additionalProperties: { + $ref: 'http://json-schema.org/draft-04/schema#' + } + } + } +}; + +namespace Configuration { + export interface TaskTypeDescription { + type?: string; + required?: string[]; + properties?: IJSONSchemaMap; + } + + export function from(value: TaskTypeDescription, messageCollector: ExtensionMessageCollector): Tasks.TaskTypeDescription { + if (!value) { + return undefined; + } + let taskType = Types.isString(value.type) ? value.type : undefined; + if (!taskType || taskType.length === 0) { + messageCollector.error(nls.localize('TaskTypeConfiguration.noType', 'The task type configuration is missing the required \'taskType\' property')); + return undefined; + } + let required: string[] = []; + if (Array.isArray(value.required)) { + for (let element of value.required) { + if (Types.isString(element)) { + required.push(element); + } + } + } + return { taskType, required: required.length >= 0 ? required : undefined, properties: value.properties ? Objects.deepClone(value.properties) : undefined }; + } +} + + +const taskTypesExtPoint = ExtensionsRegistry.registerExtensionPoint('taskTypes', [], { + description: nls.localize('TaskTypeExtPoint', 'Contributes task kinds'), + type: 'array', + items: taskTypeSchema +}); + +export interface ITaskTypeRegistry { + onReady(): TPromise; + + exists(key: string): boolean; + get(key: string): Tasks.TaskTypeDescription; + all(): Tasks.TaskTypeDescription[]; +} + +class TaskTypeRegistryImpl implements ITaskTypeRegistry { + + private taskTypes: IStringDictionary; + private readyPromise: TPromise; + + constructor() { + this.taskTypes = Object.create(null); + this.readyPromise = new TPromise((resolve, reject) => { + taskTypesExtPoint.setHandler((extensions) => { + try { + extensions.forEach(extension => { + let taskTypes = extension.value; + for (let taskType of taskTypes) { + let type = Configuration.from(taskType, extension.collector); + if (type) { + this.taskTypes[type.taskType] = type; + } + } + }); + } catch (error) { + } + resolve(undefined); + }); + }); + } + + public onReady(): TPromise { + return this.readyPromise; + } + + public get(key: string): Tasks.TaskTypeDescription { + return this.taskTypes[key]; + } + + public exists(key: string): boolean { + return !!this.taskTypes[key]; + } + + public all(): Tasks.TaskTypeDescription[] { + return Object.keys(this.taskTypes).map(key => this.taskTypes[key]); + } +} + +export const TaskTypeRegistry: ITaskTypeRegistry = new TaskTypeRegistryImpl(); \ No newline at end of file diff --git a/src/vs/workbench/parts/tasks/common/tasks.ts b/src/vs/workbench/parts/tasks/common/tasks.ts index c7b3d4ebf9b72a424e73091cf52e516aec783478..2d6c3dcf1838bd2ecd8ac36aa501d0182ef134aa 100644 --- a/src/vs/workbench/parts/tasks/common/tasks.ts +++ b/src/vs/workbench/parts/tasks/common/tasks.ts @@ -5,11 +5,36 @@ 'use strict'; import * as Types from 'vs/base/common/types'; +import { IJSONSchemaMap } from 'vs/base/common/jsonSchema'; import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; import { ProblemMatcher } from 'vs/platform/markers/common/problemMatcher'; +export interface ShellConfiguration { + /** + * The shell executable. + */ + executable: string; + /** + * The arguments to be passed to the shell executable. + */ + args?: string[]; +} + +export namespace ShellConfiguration { + export function is(value: any): value is ShellConfiguration { + let candidate: ShellConfiguration = value; + return candidate && Types.isString(candidate.executable) && (candidate.args === void 0 || Types.isStringArray(candidate.args)); + } +} + export interface CommandOptions { + + /** + * The shell to use if the task is a shell command. + */ + shell?: ShellConfiguration; + /** * The current working directory of the executed program or shell. * If omitted VSCode's current workspace root is used. @@ -23,34 +48,128 @@ export interface CommandOptions { env?: { [key: string]: string; }; } -export interface ShellConfiguration { +export enum RevealKind { /** - * The shell executable. + * Always brings the terminal to front if the task is executed. */ - executable: string; + Always = 1, + /** - * The arguments to be passed to the shell executable. + * Only brings the terminal to front if a problem is detected executing the task + * (e.g. the task couldn't be started because). */ - args?: string[]; + Silent = 2, + + /** + * The terminal never comes to front when the task is executed. + */ + Never = 3 } -export namespace ShellConfiguration { - export function is(value: any): value is ShellConfiguration { - let candidate: ShellConfiguration = value; - return candidate && Types.isString(candidate.executable) && (candidate.args === void 0 || Types.isStringArray(candidate.args)); +export namespace RevealKind { + export function fromString(value: string): RevealKind { + switch (value.toLowerCase()) { + case 'always': + return RevealKind.Always; + case 'silent': + return RevealKind.Silent; + case 'never': + return RevealKind.Never; + default: + return RevealKind.Always; + } + } +} + +export enum PanelKind { + + /** + * Shares a panel with other tasks. This is the default. + */ + Shared = 1, + + /** + * Uses a dedicated panel for this tasks. The panel is not + * shared with other tasks. + */ + Dedicated = 2, + + /** + * Creates a new panel whenever this task is executed. + */ + New = 3 +} + +export namespace PanelKind { + export function fromString(value: string): PanelKind { + switch (value.toLowerCase()) { + case 'shared': + return PanelKind.Shared; + case 'dedicated': + return PanelKind.Dedicated; + case 'new': + return PanelKind.New; + default: + return PanelKind.Shared; + } + } +} + +export interface PresentationOptions { + /** + * Controls whether the task output is reveal in the user interface. + * Defaults to `RevealKind.Always`. + */ + reveal: RevealKind; + + /** + * Controls whether the command associated with the task is echoed + * in the user interface. + */ + echo: boolean; + + /** + * Controls whether the panel showing the task output is taking focus. + */ + focus: boolean; + + /** + * Controls if the task panel is used for this task only (dedicated), + * shared between tasks (shared) or if a new panel is created on + * every task execution (new). Defaults to `TaskInstanceKind.Shared` + */ + panel: PanelKind; +} + +export enum RuntimeType { + Shell = 1, + Process = 2 +} + +export namespace RuntimeType { + export function fromString(value: string): RuntimeType { + switch (value.toLowerCase()) { + case 'shell': + return RuntimeType.Shell; + case 'process': + return RuntimeType.Process; + default: + return RuntimeType.Process; + } } } export interface CommandConfiguration { + /** - * The command to execute + * The task type */ - name: string; + runtime: RuntimeType; /** - * Whether the command is a shell command or not + * The command to execute */ - isShellCommand: boolean | ShellConfiguration; + name: string; /** * Additional command options. @@ -68,30 +187,15 @@ export interface CommandConfiguration { taskSelector?: string; /** - * Controls whether the executed command is printed to the output windows as well. + * Whether to suppress the task name when merging global args + * */ - echo: boolean; -} - -export enum ShowOutput { - Always = 1, - Silent = 2, - Never = 3 -} + suppressTaskName?: boolean; -export namespace ShowOutput { - export function fromString(value: string): ShowOutput { - value = value.toLowerCase(); - if (value === 'always') { - return ShowOutput.Always; - } else if (value === 'silent') { - return ShowOutput.Silent; - } else if (value === 'never') { - return ShowOutput.Never; - } else { - return undefined; - } - } + /** + * Describes how the task is presented in the UI. + */ + presentation: PresentationOptions; } export namespace TaskGroup { @@ -103,7 +207,7 @@ export namespace TaskGroup { export const Test: 'test' = 'test'; - export function is(value: string): value is TaskGroup { + export function is(value: string): value is string { return value === Clean || value === Build || value === RebuildAll || value === Test; } } @@ -118,89 +222,162 @@ export enum TaskSourceKind { export interface TaskSource { kind: TaskSourceKind; + label: string; detail?: string; } -/** - * A task description - */ -export interface Task { +export interface TaskIdentifier { + _key: string; + type: string; +} + +export interface ConfigurationProperties { /** - * The task's internal id + * The task's name */ - _id: string; + name?: string; /** - * Indicated the source of the task (e.g tasks.json or extension) + * The task's name */ - _source: TaskSource; + identifier?: string; /** - * The task's name + * the task's group; */ - name: string; + group?: string; /** - * The task's identifier. + * The presentation options */ - identifier: string; + presentation?: PresentationOptions; /** - * the task's group; + * Whether the task is a background task or not. */ - group?: TaskGroup; + isBackground?: boolean; /** - * The command configuration + * Whether the task should prompt on close for confirmation if running. */ - command: CommandConfiguration; + promptOnClose?: boolean; /** - * Suppresses the task name when calling the task using the task runner. + * The other tasks this task depends on. */ - suppressTaskName?: boolean; + dependsOn?: string[]; /** - * Additional arguments passed to the command when this target is - * invoked. + * The problem watchers to use for this task */ - args?: string[]; + problemMatchers?: (string | ProblemMatcher)[]; +} + +export interface CommonTask { /** - * Whether the task is a background task or not. + * The task's internal id */ - isBackground?: boolean; + _id: string; /** - * Whether the task should prompt on close for confirmation if running. + * The cached label. */ - promptOnClose?: boolean; + _label: string; /** - * Controls whether the output of the running tasks is shown or not. Default - * value is "always". + * Indicated the source of the task (e.g tasks.json or extension) */ - showOutput: ShowOutput; + _source: TaskSource; + + type: string; +} + +export interface CustomTask extends CommonTask, ConfigurationProperties { + + type: 'custom'; + + name: string; + + identifier: string; /** - * The other tasks this task depends on. + * The command configuration */ - dependsOn?: string[]; + command: CommandConfiguration; +} + +export namespace CustomTask { + export function is(value: any): value is CustomTask { + let candidate: CustomTask = value; + return candidate && candidate.type === 'custom'; + } +} + +export interface ConfiguringTask extends CommonTask, ConfigurationProperties { + + configures: TaskIdentifier; +} + +export namespace ConfiguringTask { + export function is(value: any): value is ConfiguringTask { + let candidate: ConfiguringTask = value; + return candidate && candidate.configures && Types.isString(candidate.configures.type) && value.command === void 0; + } +} + +export interface ContributedTask extends CommonTask, ConfigurationProperties { + + defines: TaskIdentifier; /** - * The problem watchers to use for this task + * The command configuration */ - problemMatchers?: (string | ProblemMatcher)[]; + command: CommandConfiguration; } +export namespace ContributedTask { + export function is(value: any): value is ContributedTask { + let candidate: ContributedTask = value; + return candidate && candidate.defines && Types.isString(candidate.defines.type) && candidate.command !== void 0; + } +} + +export type Task = CustomTask | ContributedTask; + +export namespace Task { + export function getKey(task: Task): string { + if (CustomTask.is(task)) { + return task.identifier; + } else { + return task.defines._key; + } + } +} + + export enum ExecutionEngine { - Unknown = 0, - Terminal = 1, - Process = 2 + Process = 1, + Terminal = 2 +} + +export namespace ExecutionEngine { + export const _default: ExecutionEngine = ExecutionEngine.Terminal; +} + +export enum JsonSchemaVersion { + V0_1_0 = 1, + V2_0_0 = 2 } export interface TaskSet { tasks: Task[]; extension?: IExtensionDescription; +} + +export interface TaskTypeDescription { + taskType: string; + required: string[]; + properties: IJSONSchemaMap; } \ No newline at end of file diff --git a/src/vs/workbench/parts/tasks/electron-browser/jsonSchemaCommon.ts b/src/vs/workbench/parts/tasks/electron-browser/jsonSchemaCommon.ts index 12350a98ac856ca2b7a41b5bc624f2aba67d591e..51b794a250ab8ed27903478c728cf38f9af2d194 100644 --- a/src/vs/workbench/parts/tasks/electron-browser/jsonSchemaCommon.ts +++ b/src/vs/workbench/parts/tasks/electron-browser/jsonSchemaCommon.ts @@ -57,6 +57,7 @@ const schema: IJSONSchema = { shellConfiguration: { type: 'object', additionalProperties: false, + description: nls.localize('JsonSchema.shellConfiguration', 'Configures the shell to be used.'), properties: { executable: { type: 'string', diff --git a/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v1.ts b/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v1.ts index 24441e1eba0825ea5c89841dbca5a85eea3955ac..a82c294c6c70f1c51c1d20a3536996e9f0ed04f8 100644 --- a/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v1.ts +++ b/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v1.ts @@ -8,37 +8,48 @@ import * as nls from 'vs/nls'; import * as Objects from 'vs/base/common/objects'; import { IJSONSchema } from 'vs/base/common/jsonSchema'; +import { ProblemMatcherRegistry } from 'vs/platform/markers/common/problemMatcher'; + import commonSchema from './jsonSchemaCommon'; const schema: IJSONSchema = { oneOf: [ { - 'allOf': [ + allOf: [ { - 'type': 'object', - 'required': ['version'], - 'properties': { - 'version': { - 'type': 'string', - 'enum': ['0.1.0'], - 'description': nls.localize('JsonSchema.version', 'The config\'s version number') + type: 'object', + required: ['version'], + properties: { + version: { + type: 'string', + enum: ['0.1.0'], + description: nls.localize('JsonSchema.version', 'The config\'s version number') + }, + _runner: { + deprecationMessage: nls.localize('JsonSchema._runner', 'The runner has graduated. Use the offical runner property') + }, + runner: { + type: 'string', + enum: ['process', 'terminal'], + default: 'process', + description: nls.localize('JsonSchema.runner', 'Defines whether the task is executed as a process and the output is shown in the output window or inside the terminal.') }, - 'windows': { - '$ref': '#/definitions/taskRunnerConfiguration', - 'description': nls.localize('JsonSchema.windows', 'Windows specific command configuration') + windows: { + $ref: '#/definitions/taskRunnerConfiguration', + description: nls.localize('JsonSchema.windows', 'Windows specific command configuration') }, - 'osx': { - '$ref': '#/definitions/taskRunnerConfiguration', - 'description': nls.localize('JsonSchema.mac', 'Mac specific command configuration') + osx: { + $ref: '#/definitions/taskRunnerConfiguration', + description: nls.localize('JsonSchema.mac', 'Mac specific command configuration') }, - 'linux': { - '$ref': '#/definitions/taskRunnerConfiguration', - 'description': nls.localize('JsonSchema.linux', 'Linux specific command configuration') + linux: { + $ref: '#/definitions/taskRunnerConfiguration', + description: nls.localize('JsonSchema.linux', 'Linux specific command configuration') } } }, { - '$ref': '#/definitions/taskRunnerConfiguration' + $ref: '#/definitions/taskRunnerConfiguration' } ] } @@ -80,4 +91,14 @@ function fixReferences(literal: any) { } fixReferences(schema); +ProblemMatcherRegistry.onReady().then(() => { + try { + let matcherIds = ProblemMatcherRegistry.keys().map(key => '$' + key); + definitions.problemMatcherType1.oneOf[0].enum = matcherIds; + (definitions.problemMatcherType1.oneOf[2].items as IJSONSchema).anyOf[1].enum = matcherIds; + } catch (err) { + console.log('Installing problem matcher ids failed'); + } +}); + export default schema; \ No newline at end of file diff --git a/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.ts b/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.ts index 441507853aabb5afd532f3ff0352980c81251b7a..b245305c24c3cf6bdd13be229670c0d5aa2a0087 100644 --- a/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.ts +++ b/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.ts @@ -10,40 +10,24 @@ import { IJSONSchema } from 'vs/base/common/jsonSchema'; import commonSchema from './jsonSchemaCommon'; -const schema: IJSONSchema = { - oneOf: [ - { - 'allOf': [ - { - 'type': 'object', - 'required': ['version'], - 'properties': { - 'version': { - 'type': 'string', - 'enum': ['2.0.0'], - 'description': nls.localize('JsonSchema.version', 'The config\'s version number') - }, - 'windows': { - '$ref': '#/definitions/taskRunnerConfiguration', - 'description': nls.localize('JsonSchema.windows', 'Windows specific command configuration') - }, - 'osx': { - '$ref': '#/definitions/taskRunnerConfiguration', - 'description': nls.localize('JsonSchema.mac', 'Mac specific command configuration') - }, - 'linux': { - '$ref': '#/definitions/taskRunnerConfiguration', - 'description': nls.localize('JsonSchema.linux', 'Linux specific command configuration') - } - } - }, - { - '$ref': '#/definitions/taskRunnerConfiguration' - } - ] +import { ProblemMatcherRegistry } from 'vs/platform/markers/common/problemMatcher'; +import { TaskTypeRegistry } from '../common/taskTypeRegistry'; + +function fixReferences(literal: any) { + if (Array.isArray(literal)) { + literal.forEach(fixReferences); + } else if (typeof literal === 'object') { + if (literal['$ref']) { + literal['$ref'] = literal['$ref'] + '2'; } - ] -}; + Object.getOwnPropertyNames(literal).forEach(property => { + let value = literal[property]; + if (Array.isArray(value) || typeof value === 'object') { + fixReferences(value); + } + }); + } +} const shellCommand: IJSONSchema = { anyOf: [ @@ -56,6 +40,7 @@ const shellCommand: IJSONSchema = { $ref: '#definitions/shellConfiguration' } ] + // deprecationMessage: nls.localize('JsonSchema.tasks.isShellCommand.deprecated', 'The property isShellCommand is deprecated. Use the type property and the shell property in the options instead.') }; const dependsOn: IJSONSchema = { @@ -75,34 +60,204 @@ const dependsOn: IJSONSchema = { ] }; -schema.definitions = Objects.deepClone(commonSchema.definitions); -let definitions = schema.definitions; -definitions['commandConfiguration']['properties']['isShellCommand'] = Objects.deepClone(shellCommand); -definitions['taskDescription']['properties']['isShellCommand'] = Objects.deepClone(shellCommand); -definitions['taskDescription']['properties']['dependsOn'] = dependsOn; -definitions['taskRunnerConfiguration']['properties']['isShellCommand'] = Objects.deepClone(shellCommand); +const presentation: IJSONSchema = { + type: 'object', + default: { + echo: true, + reveal: 'always', + focus: false, + panel: 'shared' + }, + description: nls.localize('JsonSchema.tasks.presentation', 'Configures the panel that is used to present the task\'s ouput and reads its input.'), + additionalProperties: false, + properties: { + echo: { + type: 'boolean', + default: true, + description: nls.localize('JsonSchema.tasks.presentation.echo', 'Controls whether the executed command is echoed to the panel. Default is true.') + }, + focus: { + type: 'boolean', + default: false, + description: nls.localize('JsonSchema.tasks.presentation.focus', 'Controls whether the panel takes focus. Default is false. If set to true the panel is revealed as well.') + }, + reveal: { + type: 'string', + enum: ['always', 'silent', 'never'], + default: 'always', + description: nls.localize('JsonSchema.tasks.presentation.reveals', 'Controls whether the panel running the task is revealed or not. Default is \"always\".') + }, + panel: { + type: 'string', + enum: ['shared', 'dedicated', 'new'], + default: 'shared', + description: nls.localize('JsonSchema.tasks.presentation.instance', 'Controls if the panel is shared between tasks, dedicated to this task or a new one is created on every run.') + } + } +}; + +const terminal: IJSONSchema = Objects.deepClone(presentation); +terminal.deprecationMessage = nls.localize('JsonSchema.tasks.terminal', 'The terminal property is deprecated. Use presentation instead'); + +const group: IJSONSchema = { + type: 'string', + enum: ['none', 'clean', 'build', 'rebuildAll', 'test'], + default: 'none', + description: nls.localize('JsonSchema.tasks.group', 'Defines to which execution group this task belongs to. If omitted the task belongs to no group.') +}; + +const taskType: IJSONSchema = { + type: 'string', + enum: ['shell', 'process'], + default: 'process', + description: nls.localize('JsonSchema.tasks.type', 'Defines whether the task is run as a process or as a command inside a shell. Default is process.') +}; + +const version: IJSONSchema = { + type: 'string', + enum: ['2.0.0'], + description: nls.localize('JsonSchema.version', 'The config\'s version number.') +}; + +let taskConfiguration: IJSONSchema = { + type: 'object', + additionalProperties: false, + properties: { + label: { + type: 'string', + description: nls.localize('JsonSchema.tasks.taskLabel', "The task's label") + }, + taskName: { + type: 'string', + description: nls.localize('JsonSchema.tasks.taskName', 'The task\'s name'), + deprecationMessage: nls.localize('JsonSchema.tasks.taskName.deprecated', 'The task\'s name property is deprecated. Use the label property instead.') + }, + group: Objects.deepClone(group), + isBackground: { + type: 'boolean', + description: nls.localize('JsonSchema.tasks.background', 'Whether the executed task is kept alive and is running in the background.'), + default: true + }, + promptOnClose: { + type: 'boolean', + description: nls.localize('JsonSchema.tasks.promptOnClose', 'Whether the user is prompted when VS Code closes with a running task.'), + default: false + }, + presentation: Objects.deepClone(presentation), + problemMatcher: { + $ref: '#/definitions/problemMatcherType', + description: nls.localize('JsonSchema.tasks.matchers', 'The problem matcher(s) to use. Can either be a string or a problem matcher definition or an array of strings and problem matchers.') + } + } +}; + +let taskDefinitions: IJSONSchema[] = []; +TaskTypeRegistry.onReady().then(() => { + for (let taskType of TaskTypeRegistry.all()) { + let schema: IJSONSchema = Objects.deepClone(taskConfiguration); + // Since we do this after the schema is assigned we need to patch the refs. + schema.properties.type = { + type: 'string', + description: nls.localize('JsonSchema.customizations.customizes.type', 'The task type to customize'), + enum: [taskType.taskType] + }; + if (taskType.required) { + schema.required = taskType.required.slice(); + } + for (let key of Object.keys(taskType.properties)) { + let property = taskType.properties[key]; + schema.properties[key] = Objects.deepClone(property); + } + fixReferences(schema); + taskDefinitions.push(schema); + } +}); + +let customize = Objects.deepClone(taskConfiguration); +customize.properties.customize = { + type: 'string', + deprecationMessage: nls.localize('JsonSchema.tasks.customize.deprecated', 'The customize property is deprecated. See the 1.14 release notes on how to migrate to the new task customization approach') +}; +taskDefinitions.push(customize); + +let definitions = Objects.deepClone(commonSchema.definitions); +let taskDescription: IJSONSchema = definitions.taskDescription; +taskDescription.properties.isShellCommand = Objects.deepClone(shellCommand); +taskDescription.properties.dependsOn = dependsOn; +// definitions.showOutputType.deprecationMessage = nls.localize('JsonSchema.tasks.showOputput.deprecated', 'The property showOutput is deprecated. Use the terminal property instead.'); +// definitions.taskDescription.properties.echoCommand.deprecationMessage = nls.localize('JsonSchema.tasks.echoCommand.deprecated', 'The property echoCommand is deprecated. Use the terminal property instead.'); +// definitions.taskDescription.properties.isBuildCommand.deprecationMessage = nls.localize('JsonSchema.tasks.isBuildCommand.deprecated', 'The property isBuildCommand is deprecated. Use the group property instead.'); +// definitions.taskDescription.properties.isTestCommand.deprecationMessage = nls.localize('JsonSchema.tasks.isTestCommand.deprecated', 'The property isTestCommand is deprecated. Use the group property instead.'); +taskDescription.properties.type = Objects.deepClone(taskType); +taskDescription.properties.presentation = Objects.deepClone(presentation); +taskDescription.properties.terminal = terminal; +taskDescription.properties.group = group; + +taskDefinitions.push({ + $ref: '#/definitions/taskDescription' +} as IJSONSchema); + +let tasks = definitions.taskRunnerConfiguration.properties.tasks; +tasks.items = { + oneOf: taskDefinitions +}; + +definitions.commandConfiguration.properties.isShellCommand = Objects.deepClone(shellCommand); +definitions.options.properties.shell = { + $ref: '#/definitions/shellConfiguration' +}; +definitions.taskRunnerConfiguration.properties.isShellCommand = Objects.deepClone(shellCommand); +definitions.taskRunnerConfiguration.properties.type = Objects.deepClone(taskType); +definitions.taskRunnerConfiguration.properties.version = Objects.deepClone(version); + +const schema: IJSONSchema = { + oneOf: [ + { + 'allOf': [ + { + type: 'object', + required: ['version'], + properties: { + version: Objects.deepClone(version), + windows: { + '$ref': '#/definitions/taskRunnerConfiguration', + 'description': nls.localize('JsonSchema.windows', 'Windows specific command configuration') + }, + osx: { + '$ref': '#/definitions/taskRunnerConfiguration', + 'description': nls.localize('JsonSchema.mac', 'Mac specific command configuration') + }, + linux: { + '$ref': '#/definitions/taskRunnerConfiguration', + 'description': nls.localize('JsonSchema.linux', 'Linux specific command configuration') + } + } + }, + { + $ref: '#/definitions/taskRunnerConfiguration' + } + ] + } + ] +}; + +schema.definitions = definitions; Object.getOwnPropertyNames(definitions).forEach(key => { let newKey = key + '2'; definitions[newKey] = definitions[key]; delete definitions[key]; }); +fixReferences(schema); -function fixReferences(literal: any) { - if (Array.isArray(literal)) { - literal.forEach(fixReferences); - } else if (typeof literal === 'object') { - if (literal['$ref']) { - literal['$ref'] = literal['$ref'] + '2'; - } - Object.getOwnPropertyNames(literal).forEach(property => { - let value = literal[property]; - if (Array.isArray(value) || typeof value === 'object') { - fixReferences(value); - } - }); +ProblemMatcherRegistry.onReady().then(() => { + try { + let matcherIds = ProblemMatcherRegistry.keys().map(key => '$' + key); + definitions.problemMatcherType2.oneOf[0].enum = matcherIds; + (definitions.problemMatcherType2.oneOf[2].items as IJSONSchema).anyOf[1].enum = matcherIds; + } catch (err) { + console.log('Installing problem matcher ids failed'); } -} -fixReferences(schema); +}); export default schema; \ No newline at end of file diff --git a/src/vs/workbench/parts/tasks/electron-browser/media/configure-inverse.svg b/src/vs/workbench/parts/tasks/electron-browser/media/configure-inverse.svg new file mode 100644 index 0000000000000000000000000000000000000000..61baaea2b8b21ee34356db99c28bb40719643392 --- /dev/null +++ b/src/vs/workbench/parts/tasks/electron-browser/media/configure-inverse.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/vs/workbench/parts/tasks/electron-browser/media/configure.svg b/src/vs/workbench/parts/tasks/electron-browser/media/configure.svg new file mode 100644 index 0000000000000000000000000000000000000000..3dec2ba50fd1a3dfdb241d947dc9a4adb2ded64c --- /dev/null +++ b/src/vs/workbench/parts/tasks/electron-browser/media/configure.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/vs/workbench/parts/tasks/electron-browser/media/task.contribution.css b/src/vs/workbench/parts/tasks/electron-browser/media/task.contribution.css index 6b1d8221b62e16b7b96efe28870cf6a697cf4673..f8b7e9e67e553697524cf4b7bbf95c20c0e65de6 100644 --- a/src/vs/workbench/parts/tasks/electron-browser/media/task.contribution.css +++ b/src/vs/workbench/parts/tasks/electron-browser/media/task.contribution.css @@ -60,4 +60,13 @@ .task-statusbar-item-label > .task-statusbar-item-label-info { -webkit-mask: url('status-info.svg') no-repeat 50% 50%; -webkit-mask-size: 11px; +} + +.monaco-workbench .quick-open-task-configure { + background-image: url('configure.svg'); +} + +.vs-dark .monaco-workbench .quick-open-task-configure, +.hc-black .monaco-workbench .quick-open-task-configure { + background-image: url('configure-inverse.svg'); } \ No newline at end of file diff --git a/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts b/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts index a7f7565389923fcd49b55f0509bc14346e932343..5913516890325db92a6f7767dbf47a58a64ec62c 100644 --- a/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts +++ b/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts @@ -2,13 +2,14 @@ * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ - 'use strict'; import 'vs/css!./media/task.contribution'; import 'vs/workbench/parts/tasks/browser/taskQuickOpen'; import 'vs/workbench/parts/tasks/browser/terminateQuickOpen'; import 'vs/workbench/parts/tasks/browser/restartQuickOpen'; +import 'vs/workbench/parts/tasks/browser/buildQuickOpen'; +import 'vs/workbench/parts/tasks/browser/testQuickOpen'; import * as nls from 'vs/nls'; @@ -23,12 +24,13 @@ import { EventEmitter } from 'vs/base/common/eventEmitter'; import * as Builder from 'vs/base/browser/builder'; import * as Types from 'vs/base/common/types'; import { KeyMod, KeyCode } from 'vs/base/common/keyCodes'; -import { TerminateResponse, TerminateResponseCode } from 'vs/base/common/processes'; +import { TerminateResponseCode } from 'vs/base/common/processes'; import * as strings from 'vs/base/common/strings'; import { ValidationStatus, ValidationState } from 'vs/base/common/parsers'; import * as UUID from 'vs/base/common/uuid'; +import { LinkedMap, Touch } from 'vs/base/common/map'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { ILifecycleService } from 'vs/platform/lifecycle/common/lifecycle'; import { SyncActionDescriptor, MenuRegistry } from 'vs/platform/actions/common/actions'; import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; @@ -43,11 +45,12 @@ import { CommandsRegistry } from 'vs/platform/commands/common/commands'; import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry'; import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; import { ProblemMatcherRegistry } from 'vs/platform/markers/common/problemMatcher'; - +import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; import { IModeService } from 'vs/editor/common/services/modeService'; import { IModelService } from 'vs/editor/common/services/modelService'; + import jsonContributionRegistry = require('vs/platform/jsonschemas/common/jsonContributionRegistry'); import { IJSONSchema } from 'vs/base/common/jsonSchema'; @@ -61,22 +64,25 @@ import Constants from 'vs/workbench/parts/markers/common/constants'; import { IPartService } from 'vs/workbench/services/part/common/partService'; import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IConfigurationResolverService } from 'vs/workbench/services/configurationResolver/common/configurationResolver'; +import { IConfigurationEditingService, ConfigurationTarget } from 'vs/workbench/services/configuration/common/configurationEditing'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; import { IOutputService, IOutputChannelRegistry, Extensions as OutputExt, IOutputChannel } from 'vs/workbench/parts/output/common/output'; +import { Scope, IActionBarRegistry, Extensions as ActionBarExtensions } from 'vs/workbench/browser/actions'; import { ITerminalService } from 'vs/workbench/parts/terminal/common/terminal'; -import { ITaskSystem, ITaskResolver, ITaskSummary, ITaskExecuteResult, TaskExecuteKind, TaskError, TaskErrors, TaskSystemEvents } from 'vs/workbench/parts/tasks/common/taskSystem'; -import { Task, TaskSet, TaskGroup, ExecutionEngine, ShowOutput, TaskSourceKind } from 'vs/workbench/parts/tasks/common/tasks'; -import { ITaskService, TaskServiceEvents, ITaskProvider } from 'vs/workbench/parts/tasks/common/taskService'; +import { ITaskSystem, ITaskResolver, ITaskSummary, ITaskExecuteResult, TaskExecuteKind, TaskError, TaskErrors, TaskSystemEvents, TaskTerminateResponse } from 'vs/workbench/parts/tasks/common/taskSystem'; +import { Task, CustomTask, ConfiguringTask, ContributedTask, TaskSet, TaskGroup, ExecutionEngine, JsonSchemaVersion, TaskSourceKind, TaskIdentifier } from 'vs/workbench/parts/tasks/common/tasks'; +import { ITaskService, TaskServiceEvents, ITaskProvider, TaskEvent } from 'vs/workbench/parts/tasks/common/taskService'; import { templates as taskTemplates } from 'vs/workbench/parts/tasks/common/taskTemplates'; -import * as TaskConfig from 'vs/workbench/parts/tasks/common/taskConfiguration'; +import * as TaskConfig from '../node/taskConfiguration'; import { ProcessTaskSystem } from 'vs/workbench/parts/tasks/node/processTaskSystem'; import { TerminalTaskSystem } from './terminalTaskSystem'; import { ProcessRunnerDetector } from 'vs/workbench/parts/tasks/node/processRunnerDetector'; +import { QuickOpenActionContributor } from '../browser/quickOpen'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; @@ -88,30 +94,17 @@ let tasksCategory = nls.localize('tasksCategory', "Tasks"); abstract class OpenTaskConfigurationAction extends Action { - private configurationService: IConfigurationService; - private fileService: IFileService; - - private editorService: IWorkbenchEditorService; - private contextService: IWorkspaceContextService; - private outputService: IOutputService; - private messageService: IMessageService; - private quickOpenService: IQuickOpenService; - - constructor(id: string, label: string, @IConfigurationService configurationService: IConfigurationService, - @IWorkbenchEditorService editorService: IWorkbenchEditorService, @IFileService fileService: IFileService, - @IWorkspaceContextService contextService: IWorkspaceContextService, @IOutputService outputService: IOutputService, - @IMessageService messageService: IMessageService, @IQuickOpenService quickOpenService: IQuickOpenService, - @IEnvironmentService private environmentService: IEnvironmentService, - @IConfigurationResolverService private configurationResolverService: IConfigurationResolverService) { + constructor(id: string, label: string, + private taskService: ITaskService, + private configurationService: IConfigurationService, + private editorService: IWorkbenchEditorService, private fileService: IFileService, + private contextService: IWorkspaceContextService, private outputService: IOutputService, + private messageService: IMessageService, private quickOpenService: IQuickOpenService, + private environmentService: IEnvironmentService, + private configurationResolverService: IConfigurationResolverService, + private extensionService: IExtensionService) { super(id, label); - this.configurationService = configurationService; - this.editorService = editorService; - this.fileService = fileService; - this.contextService = contextService; - this.outputService = outputService; - this.messageService = messageService; - this.quickOpenService = quickOpenService; } public run(event?: any): TPromise { @@ -174,6 +167,15 @@ abstract class OpenTaskConfigurationAction extends Action { configFileCreated = true; return this.fileService.createFile(this.contextService.toResource('.vscode/tasks.json'), content); }); + /* 2.0 version + let content = selection.content; + let editorConfig = this.configurationService.getConfiguration(); + if (editorConfig.editor.insertSpaces) { + content = content.replace(/(\n)(\t+)/g, (_, s1, s2) => s1 + strings.repeat(' ', s2.length * editorConfig.editor.tabSize)); + } + configFileCreated = true; + return this.fileService.createFile(this.contextService.toResource('.vscode/tasks.json'), content); + */ }); }).then((stat) => { if (!stat) { @@ -197,30 +199,35 @@ class ConfigureTaskRunnerAction extends OpenTaskConfigurationAction { public static ID = 'workbench.action.tasks.configureTaskRunner'; public static TEXT = nls.localize('ConfigureTaskRunnerAction.label', "Configure Task Runner"); - constructor(id: string, label: string, @IConfigurationService configurationService: IConfigurationService, + constructor(id: string, label: string, + @ITaskService taskService, @IConfigurationService configurationService: IConfigurationService, @IWorkbenchEditorService editorService: IWorkbenchEditorService, @IFileService fileService: IFileService, @IWorkspaceContextService contextService: IWorkspaceContextService, @IOutputService outputService: IOutputService, @IMessageService messageService: IMessageService, @IQuickOpenService quickOpenService: IQuickOpenService, @IEnvironmentService environmentService: IEnvironmentService, - @IConfigurationResolverService configurationResolverService: IConfigurationResolverService) { - super(id, label, configurationService, editorService, fileService, contextService, - outputService, messageService, quickOpenService, environmentService, configurationResolverService); + @IConfigurationResolverService configurationResolverService: IConfigurationResolverService, + @IExtensionService extensionService) { + super(id, label, taskService, configurationService, editorService, fileService, contextService, + outputService, messageService, quickOpenService, environmentService, configurationResolverService, + extensionService); } - } class ConfigureBuildTaskAction extends OpenTaskConfigurationAction { public static ID = 'workbench.action.tasks.configureBuildTask'; public static TEXT = nls.localize('ConfigureBuildTaskAction.label', "Configure Build Task"); - constructor(id: string, label: string, @IConfigurationService configurationService: IConfigurationService, + constructor(id: string, label: string, + @ITaskService taskService, @IConfigurationService configurationService: IConfigurationService, @IWorkbenchEditorService editorService: IWorkbenchEditorService, @IFileService fileService: IFileService, @IWorkspaceContextService contextService: IWorkspaceContextService, @IOutputService outputService: IOutputService, @IMessageService messageService: IMessageService, @IQuickOpenService quickOpenService: IQuickOpenService, @IEnvironmentService environmentService: IEnvironmentService, - @IConfigurationResolverService configurationResolverService: IConfigurationResolverService) { - super(id, label, configurationService, editorService, fileService, contextService, - outputService, messageService, quickOpenService, environmentService, configurationResolverService); + @IConfigurationResolverService configurationResolverService: IConfigurationResolverService, + @IExtensionService extensionService) { + super(id, label, taskService, configurationService, editorService, fileService, contextService, + outputService, messageService, quickOpenService, environmentService, configurationResolverService, + extensionService); } } @@ -371,7 +378,10 @@ class StatusBarItem extends Themable implements IStatusbarItem { updateLabel(this.markerService.getStatistics()); }); - callOnDispose.push(this.taskService.addListener(TaskServiceEvents.Active, () => { + callOnDispose.push(this.taskService.addListener(TaskServiceEvents.Active, (event: TaskEvent) => { + if (event.group !== TaskGroup.Build) { + return; + } this.activeCount++; if (this.activeCount === 1) { let index = 1; @@ -388,7 +398,10 @@ class StatusBarItem extends Themable implements IStatusbarItem { } })); - callOnDispose.push(this.taskService.addListener(TaskServiceEvents.Inactive, (data: TaskServiceEventData) => { + callOnDispose.push(this.taskService.addListener(TaskServiceEvents.Inactive, (event: TaskEvent) => { + if (event.group !== TaskGroup.Build) { + return; + } // Since the exiting of the sub process is communicated async we can't order inactive and terminate events. // So try to treat them accordingly. if (this.activeCount > 0) { @@ -403,7 +416,10 @@ class StatusBarItem extends Themable implements IStatusbarItem { } })); - callOnDispose.push(this.taskService.addListener(TaskServiceEvents.Terminated, () => { + callOnDispose.push(this.taskService.addListener(TaskServiceEvents.Terminated, (event: TaskEvent) => { + if (event.group !== TaskGroup.Build) { + return; + } if (this.activeCount !== 0) { $(progress).hide(); if (this.intervalToken) { @@ -449,11 +465,11 @@ class NullTaskSystem extends EventEmitter implements ITaskSystem { public canAutoTerminate(): boolean { return true; } - public terminate(task: string | Task): TPromise { - return TPromise.as({ success: true }); + public terminate(task: string | Task): TPromise { + return TPromise.as({ success: true, task: undefined }); } - public terminateAll(): TPromise { - return TPromise.as({ success: true }); + public terminateAll(): TPromise { + return TPromise.as([]); } } @@ -496,9 +512,8 @@ class ProblemReporter implements TaskConfig.IProblemReporter { interface WorkspaceTaskResult { set: TaskSet; - annotatingTasks: { - byIdentifier: IStringDictionary; - byName: IStringDictionary; + configurations: { + byIdentifier: IStringDictionary; }; hasErrors: boolean; } @@ -511,6 +526,8 @@ interface WorkspaceConfigurationResult { class TaskService extends EventEmitter implements ITaskService { // private static autoDetectTelemetryName: string = 'taskServer.autoDetect'; + private static RecentlyUsedTasks_Key = 'workbench.tasks.recentlyUsedTasks'; + private static RanTaskBefore_Key = 'workbench.tasks.ranTaskBefore'; public _serviceBrand: any; public static SERVICE_ID: string = 'taskService'; @@ -519,6 +536,7 @@ class TaskService extends EventEmitter implements ITaskService { private modeService: IModeService; private configurationService: IConfigurationService; + private configurationEditingService: IConfigurationEditingService; private markerService: IMarkerService; private outputService: IOutputService; private messageService: IMessageService; @@ -538,10 +556,12 @@ class TaskService extends EventEmitter implements ITaskService { private _taskSystem: ITaskSystem; private _taskSystemListeners: IDisposable[]; + private _recentlyUsedTasks: LinkedMap; private _outputChannel: IOutputChannel; constructor( @IModeService modeService: IModeService, @IConfigurationService configurationService: IConfigurationService, + @IConfigurationEditingService configurationEditingService: IConfigurationEditingService, @IMarkerService markerService: IMarkerService, @IOutputService outputService: IOutputService, @IMessageService messageService: IMessageService, @IWorkbenchEditorService editorService: IWorkbenchEditorService, @IFileService fileService: IFileService, @IWorkspaceContextService contextService: IWorkspaceContextService, @@ -552,12 +572,14 @@ class TaskService extends EventEmitter implements ITaskService { @IEnvironmentService private environmentService: IEnvironmentService, @IConfigurationResolverService private configurationResolverService: IConfigurationResolverService, @ITerminalService private terminalService: ITerminalService, - @IWorkbenchEditorService private workbenchEditorService: IWorkbenchEditorService + @IWorkbenchEditorService private workbenchEditorService: IWorkbenchEditorService, + @IStorageService private storageService: IStorageService ) { super(); this.modeService = modeService; this.configurationService = configurationService; + this.configurationEditingService = configurationEditingService; this.markerService = markerService; this.outputService = outputService; this.messageService = messageService; @@ -587,7 +609,7 @@ class TaskService extends EventEmitter implements ITaskService { ? ExecutionEngine.Terminal : this._taskSystem instanceof ProcessTaskSystem ? ExecutionEngine.Process - : ExecutionEngine.Unknown; + : ExecutionEngine._default; if (currentExecutionEngine !== this.getExecutionEngine()) { this.messageService.show(Severity.Info, nls.localize('TaskSystem.noHotSwap', 'Changing the task execution engine requires restarting VS Code. The change is ignored.')); } @@ -620,7 +642,7 @@ class TaskService extends EventEmitter implements ITaskService { if (!this.canRunCommand()) { return; } - this.build(); + this.runBuildCommand(); }); KeybindingsRegistry.registerKeybindingRule({ @@ -634,7 +656,7 @@ class TaskService extends EventEmitter implements ITaskService { if (!this.canRunCommand()) { return; } - this.runTest(); + this.runTestCommand(); }); } @@ -681,6 +703,37 @@ class TaskService extends EventEmitter implements ITaskService { return TPromise.as(this._taskSystem.getActiveTasks()); } + public getRecentlyUsedTasks(): LinkedMap { + if (this._recentlyUsedTasks) { + return this._recentlyUsedTasks; + } + this._recentlyUsedTasks = new LinkedMap(); + let storageValue = this.storageService.get(TaskService.RecentlyUsedTasks_Key, StorageScope.WORKSPACE); + if (storageValue) { + try { + let values: string[] = JSON.parse(storageValue); + if (Array.isArray(values)) { + for (let value of values) { + this._recentlyUsedTasks.set(value, value); + } + } + } catch (error) { + // Ignore. We use the empty result + } + } + return this._recentlyUsedTasks; + } + + private saveRecentlyUsedTasks(): void { + if (!this._recentlyUsedTasks) { + return; + } + let values = this._recentlyUsedTasks.values(); + if (values.length > 30) { + values = values.slice(0, 30); + } + this.storageService.store(TaskService.RecentlyUsedTasks_Key, JSON.stringify(values), StorageScope.WORKSPACE); + } public build(): TPromise { return this.getTaskSets().then((values) => { @@ -726,7 +779,7 @@ class TaskService extends EventEmitter implements ITaskService { toExecute = resolver.resolve(task); } else { requested = task.name; - toExecute = resolver.resolve(task._id); + toExecute = task; } if (!toExecute) { throw new TaskError(Severity.Info, nls.localize('TaskServer.noTask', 'Requested task {0} to execute not found.', requested), TaskErrors.TaskNotFound); @@ -739,78 +792,177 @@ class TaskService extends EventEmitter implements ITaskService { }); } + public getTasksForGroup(group: string): TPromise { + return this.getTaskSets().then((values) => { + let result: Task[] = []; + for (let value of values) { + for (let task of value.tasks) { + if (task.group === group) { + result.push(task); + } + } + } + return result; + }); + } + + private splitTasks(tasks: Task[]): { configured: Task[], detected: Task[] } { + let configured: Task[] = []; + let detected: Task[] = []; + for (let task of tasks) { + if (task._source.kind === TaskSourceKind.Workspace) { + configured.push(task); + } else { + detected.push(task); + } + } + return { configured, detected }; + } + + public customize(task: Task, properties?: { problemMatcher: string | string[] }, openConfig?: boolean): TPromise { + if (!ContributedTask.is(task)) { + return TPromise.as(undefined); + } + let configuration = this.getConfiguration(); + if (configuration.hasParseErrors) { + this.messageService.show(Severity.Warning, nls.localize('customizeParseErrors', 'The current task configuration has errors. Please fix the errors first before customizing a task.')); + return TPromise.as(undefined); + } + let fileConfig = configuration.config; + let customizes: TaskConfig.ConfiguringTask = { + }; + let identifier: TaskConfig.TaskIdentifier = Objects.assign(Object.create(null), task.defines); + delete identifier['_key']; + Object.keys(identifier).forEach(key => customizes[key] = identifier[key]); + + if (properties) { + for (let property of Object.getOwnPropertyNames(properties)) { + let value = properties[property]; + if (value !== void 0 && value !== null) { + customizes[property] = value; + } + } + } else { + if (task.problemMatchers === void 0 || task.problemMatchers.length === 0) { + customizes.problemMatcher = []; + } + } + + if (!fileConfig) { + fileConfig = { + version: '2.0.0', + tasks: [customizes] + }; + } else { + if (Array.isArray(fileConfig.tasks)) { + fileConfig.tasks.push(customizes); + } else { + fileConfig.tasks = [customizes]; + } + }; + return this.configurationEditingService.writeConfiguration(ConfigurationTarget.WORKSPACE, { key: 'tasks', value: fileConfig }).then(() => { + if (openConfig) { + let resource = this.contextService.toResource('.vscode/tasks.json'); + this.editorService.openEditor({ + resource: resource, + options: { + forceOpen: true, + pinned: false + } + }, false); + } + }); + } + private createRunnableTask(sets: TaskSet[], group: TaskGroup): { task: Task; resolver: ITaskResolver } { - let uuidMap: IStringDictionary = Object.create(null); + let idMap: IStringDictionary = Object.create(null); + let labelMap: IStringDictionary = Object.create(null); let identifierMap: IStringDictionary = Object.create(null); - let primaryTasks: Task[] = []; + let workspaceTasks: Task[] = []; + let extensionTasks: Task[] = []; sets.forEach((set) => { set.tasks.forEach((task) => { - uuidMap[task._id] = task; + idMap[task._id] = task; + labelMap[task._label] = task; identifierMap[task.identifier] = task; if (group && task.group === group) { - primaryTasks.push(task); + if (task._source.kind === TaskSourceKind.Workspace) { + workspaceTasks.push(task); + } else { + extensionTasks.push(task); + } } }); }); - if (primaryTasks.length === 0) { - return undefined; - } let resolver: ITaskResolver = { resolve: (id: string) => { - let result = uuidMap[id]; - if (result) { - return result; - } - return identifierMap[id]; + return idMap[id] || labelMap[id] || identifierMap[id]; } }; - if (primaryTasks.length === 1) { - return { task: primaryTasks[0], resolver }; + if (workspaceTasks.length > 0) { + if (workspaceTasks.length > 1) { + this._outputChannel.append(nls.localize('moreThanOneBuildTask', 'There are many build tasks defined in the tasks.json. Executing the first one.\n')); + } + return { task: workspaceTasks[0], resolver }; + } + if (extensionTasks.length === 0) { + return undefined; + } + + // We can only have extension tasks if we are in version 2.0.0. Then we can even run + // multiple build tasks. + if (extensionTasks.length === 1) { + return { task: extensionTasks[0], resolver }; } else { let id: string = UUID.generateUuid(); - let task: Task = { + let task: CustomTask = { _id: id, - _source: { kind: TaskSourceKind.Generic }, + _source: { kind: TaskSourceKind.Generic, label: 'generic' }, + _label: id, + type: 'custom', name: id, identifier: id, - dependsOn: primaryTasks.map(task => task._id), + dependsOn: extensionTasks.map(task => task._id), command: undefined, - showOutput: ShowOutput.Never }; return { task, resolver }; } } private createResolver(sets: TaskSet[]): ITaskResolver { - let uuidMap: IStringDictionary = Object.create(null); + let labelMap: IStringDictionary = Object.create(null); let identifierMap: IStringDictionary = Object.create(null); sets.forEach((set) => { set.tasks.forEach((task) => { - uuidMap[task._id] = task; + labelMap[task._label] = task; identifierMap[task.identifier] = task; }); }); return { resolve: (id: string) => { - let result = uuidMap[id]; - if (result) { - return result; - } - return identifierMap[id]; + return labelMap[id] || identifierMap[id]; } }; } private executeTask(task: Task, resolver: ITaskResolver): TPromise { + if (!this.storageService.get(TaskService.RanTaskBefore_Key, StorageScope.GLOBAL)) { + this.storageService.store(TaskService.RanTaskBefore_Key, true, StorageScope.GLOBAL); + } return ProblemMatcherRegistry.onReady().then(() => { return this.textFileService.saveAll().then((value) => { // make sure all dirty files are saved let executeResult = this.getTaskSystem().run(task, resolver); + this.getRecentlyUsedTasks().set(Task.getKey(task), Task.getKey(task), Touch.First); if (executeResult.kind === TaskExecuteKind.Active) { let active = executeResult.active; - if (active.same && active.background) { - this.messageService.show(Severity.Info, nls.localize('TaskSystem.activeSame', 'The task is already active and in watch mode. To terminate the task use `F1 > terminate task`')); + if (active.same) { + if (active.background) { + this.messageService.show(Severity.Info, nls.localize('TaskSystem.activeSame.background', 'The task is already active and in background mode. To terminate the task use `F1 > terminate task`')); + } else { + this.messageService.show(Severity.Info, nls.localize('TaskSystem.activeSame.noBackground', 'The task is already active. To terminate the task use `F1 > terminate task`')); + } } else { throw new TaskError(Severity.Warning, nls.localize('TaskSystem.active', 'There is already a task running. Terminate it first before executing another task.'), TaskErrors.RunningTask); } @@ -836,27 +988,19 @@ class TaskService extends EventEmitter implements ITaskService { }); } - public terminate(task: string | Task): TPromise { + public terminate(task: string | Task): TPromise { if (!this._taskSystem) { - return TPromise.as({ success: true }); + return TPromise.as({ success: true, task: undefined }); } const id: string = Types.isString(task) ? task : task._id; - return this._taskSystem.terminate(id).then((response) => { - if (response.success) { - this.emit(TaskServiceEvents.Terminated, {}); - } - return response; - }); + return this._taskSystem.terminate(id); } - public terminateAll(): TPromise { + public terminateAll(): TPromise { if (!this._taskSystem) { - return TPromise.as({ success: true }); + return TPromise.as([]); } - return this._taskSystem.terminateAll().then((response) => { - this.emit(TaskServiceEvents.Terminated, {}); - return response; - }); + return this._taskSystem.terminateAll(); } private getTaskSystem(): ITaskSystem { @@ -881,56 +1025,62 @@ class TaskService extends EventEmitter implements ITaskService { } this._taskSystemListeners.push(this._taskSystem.addListener(TaskSystemEvents.Active, (event) => this.emit(TaskServiceEvents.Active, event))); this._taskSystemListeners.push(this._taskSystem.addListener(TaskSystemEvents.Inactive, (event) => this.emit(TaskServiceEvents.Inactive, event))); + this._taskSystemListeners.push(this._taskSystem.addListener(TaskSystemEvents.Terminated, (event) => this.emit(TaskServiceEvents.Terminated, event))); return this._taskSystem; } private getTaskSets(): TPromise { - return new TPromise((resolve, reject) => { - let result: TaskSet[] = []; - let counter: number = 0; - let done = (value: TaskSet) => { - if (value) { - result.push(value); - } - if (--counter === 0) { - resolve(result); - } - }; - let error = () => { - if (--counter === 0) { + return this.extensionService.activateByEvent('onCommand:workbench.action.tasks.runTask').then(() => { + return new TPromise((resolve, reject) => { + let result: TaskSet[] = []; + let counter: number = 0; + let done = (value: TaskSet) => { + if (value) { + result.push(value); + } + if (--counter === 0) { + resolve(result); + } + }; + let error = () => { + if (--counter === 0) { + resolve(result); + } + }; + if (this.getJsonSchemaVersion() === JsonSchemaVersion.V2_0_0 && this._providers.size > 0) { + this._providers.forEach((provider) => { + counter++; + provider.provideTasks().done(done, error); + }); + } else { resolve(result); } - }; - if (this.getExecutionEngine() === ExecutionEngine.Terminal && this._providers.size > 0) { - this._providers.forEach((provider) => { - counter++; - provider.provideTasks().done(done, error); - }); - } else { - resolve(result); - } + }); }).then((result) => { return this.getWorkspaceTasks().then((workspaceTaskResult) => { let workspaceTasksToDelete: Task[] = []; - let annotatingTasks = workspaceTaskResult.annotatingTasks; - let legacyAnnotatingTasks = workspaceTaskResult.set ? this.getLegacyAnnotatingTasks(workspaceTaskResult.set) : undefined; - if (annotatingTasks || legacyAnnotatingTasks) { + let configurations = workspaceTaskResult.configurations; + let legacyTaskConfigurations = workspaceTaskResult.set ? this.getLegacyTaskConfigurations(workspaceTaskResult.set) : undefined; + if (configurations || legacyTaskConfigurations) { for (let set of result) { - for (let task of set.tasks) { - if (annotatingTasks) { - let annotatingTask = annotatingTasks.byIdentifier[task.identifier] || annotatingTasks.byName[task.name]; - if (annotatingTask) { - TaskConfig.mergeTasks(task, annotatingTask); - task._source.kind = TaskSourceKind.Workspace; + for (let i = 0; i < set.tasks.length; i++) { + let task = set.tasks[i]; + if (!ContributedTask.is(task)) { + continue; + } + if (configurations) { + let configuredTask = configurations.byIdentifier[task.defines._key]; + if (configuredTask) { + set.tasks[i] = TaskConfig.createCustomTask(task, configuredTask); continue; } } - if (legacyAnnotatingTasks) { - let legacyAnnotatingTask = legacyAnnotatingTasks[task.identifier]; - if (legacyAnnotatingTask) { - TaskConfig.mergeTasks(task, legacyAnnotatingTask); - task._source.kind = TaskSourceKind.Workspace; - workspaceTasksToDelete.push(legacyAnnotatingTask); + if (legacyTaskConfigurations) { + let configuredTask = legacyTaskConfigurations[task.defines._key]; + if (configuredTask) { + set.tasks[i] = TaskConfig.createCustomTask(task, configuredTask); + workspaceTasksToDelete.push(configuredTask); + set.tasks[i] = configuredTask; continue; } } @@ -962,7 +1112,7 @@ class TaskService extends EventEmitter implements ITaskService { }); } - private getLegacyAnnotatingTasks(workspaceTasks: TaskSet): IStringDictionary { + private getLegacyTaskConfigurations(workspaceTasks: TaskSet): IStringDictionary { let result: IStringDictionary; function getResult() { if (result) { @@ -972,11 +1122,17 @@ class TaskService extends EventEmitter implements ITaskService { return result; } for (let task of workspaceTasks.tasks) { - let commandName = task.command && task.command.name; - // This is for backwards compatibility with the 0.1.0 task annotation code - // if we had a gulp, jake or grunt command a task specification was a annotation - if (commandName === 'gulp' || commandName === 'grunt' || commandName === 'jake') { - getResult()[`${commandName}.${task.name}`] = task; + if (CustomTask.is(task)) { + let commandName = task.command && task.command.name; + // This is for backwards compatibility with the 0.1.0 task annotation code + // if we had a gulp, jake or grunt command a task specification was a annotation + if (commandName === 'gulp' || commandName === 'grunt' || commandName === 'jake') { + let identifier: TaskIdentifier = TaskConfig.getTaskIdentifier({ + type: commandName, + task: task.name + } as TaskConfig.TaskIdentifier); + getResult()[identifier._key] = task; + } } } return result; @@ -1005,47 +1161,56 @@ class TaskService extends EventEmitter implements ITaskService { { let { config, hasParseErrors } = this.getConfiguration(); if (hasParseErrors) { - return TPromise.as({ set: undefined, hasErrors: true }); + return TPromise.as({ set: undefined, hasErrors: true, configurations: undefined }); } + let engine = ExecutionEngine._default; if (config) { - let engine = TaskConfig.ExecutionEngine.from(config); - if (engine === ExecutionEngine.Process && this.hasDetectorSupport(config)) { - configPromise = new ProcessRunnerDetector(this.fileService, this.contextService, this.configurationResolverService, config).detect(true).then((value): WorkspaceConfigurationResult => { - let hasErrors = this.printStderr(value.stderr); - let detectedConfig = value.config; - if (!detectedConfig) { - return { config, hasErrors }; - } - let result: TaskConfig.ExternalTaskRunnerConfiguration = Objects.clone(config); - let configuredTasks: IStringDictionary = Object.create(null); - if (!result.tasks) { - if (detectedConfig.tasks) { - result.tasks = detectedConfig.tasks; + engine = TaskConfig.ExecutionEngine.from(config); + if (engine === ExecutionEngine.Process) { + if (this.hasDetectorSupport(config)) { + configPromise = new ProcessRunnerDetector(this.fileService, this.contextService, this.configurationResolverService, config).detect(true).then((value): WorkspaceConfigurationResult => { + let hasErrors = this.printStderr(value.stderr); + let detectedConfig = value.config; + if (!detectedConfig) { + return { config, hasErrors }; } - } else { - result.tasks.forEach(task => configuredTasks[task.taskName] = task); - detectedConfig.tasks.forEach((task) => { - if (!configuredTasks[task.taskName]) { - result.tasks.push(task); + let result: TaskConfig.ExternalTaskRunnerConfiguration = Objects.clone(config); + let configuredTasks: IStringDictionary = Object.create(null); + if (!result.tasks) { + if (detectedConfig.tasks) { + result.tasks = detectedConfig.tasks; } - }); - } - return { config: result, hasErrors }; - }); + } else { + result.tasks.forEach(task => configuredTasks[task.taskName] = task); + detectedConfig.tasks.forEach((task) => { + if (!configuredTasks[task.taskName]) { + result.tasks.push(task); + } + }); + } + return { config: result, hasErrors }; + }); + } else { + configPromise = TPromise.as({ config, hasErrors: false }); + } } else { configPromise = TPromise.as({ config, hasErrors: false }); } } else { - configPromise = new ProcessRunnerDetector(this.fileService, this.contextService, this.configurationResolverService).detect(true).then((value) => { - let hasErrors = this.printStderr(value.stderr); - return { config: value.config, hasErrors }; - }); + if (engine === ExecutionEngine.Terminal) { + configPromise = TPromise.as({ config, hasErrors: false }); + } else { + configPromise = new ProcessRunnerDetector(this.fileService, this.contextService, this.configurationResolverService).detect(true).then((value) => { + let hasErrors = this.printStderr(value.stderr); + return { config: value.config, hasErrors }; + }); + } } } return configPromise.then((resolved) => { return ProblemMatcherRegistry.onReady().then((): WorkspaceTaskResult => { if (!resolved || !resolved.config) { - return { set: undefined, annotatingTasks: undefined, hasErrors: resolved !== void 0 ? resolved.hasErrors : false }; + return { set: undefined, configurations: undefined, hasErrors: resolved !== void 0 ? resolved.hasErrors : false }; } let problemReporter = new ProblemReporter(this._outputChannel); let parseResult = TaskConfig.parse(resolved.config, problemReporter); @@ -1056,22 +1221,18 @@ class TaskService extends EventEmitter implements ITaskService { } if (problemReporter.status.isFatal()) { problemReporter.fatal(nls.localize('TaskSystem.configurationErrors', 'Error: the provided task configuration has validation errors and can\'t not be used. Please correct the errors first.')); - return { set: undefined, annotatingTasks: undefined, hasErrors }; + return { set: undefined, configurations: undefined, hasErrors }; } - let annotatingTasks: { byIdentifier: IStringDictionary; byName: IStringDictionary; }; - if (parseResult.annotatingTasks && parseResult.annotatingTasks.length > 0) { - annotatingTasks = { - byIdentifier: Object.create(null), - byName: Object.create(null) + let customizedTasks: { byIdentifier: IStringDictionary; }; + if (parseResult.configured && parseResult.configured.length > 0) { + customizedTasks = { + byIdentifier: Object.create(null) }; - for (let task of parseResult.annotatingTasks) { - annotatingTasks.byIdentifier[task.identifier] = task; - if (task.name) { - annotatingTasks.byName[task.name] = task; - } + for (let task of parseResult.configured) { + customizedTasks.byIdentifier[task.configures._key] = task; } } - return { set: { tasks: parseResult.tasks }, annotatingTasks: annotatingTasks, hasErrors }; + return { set: { tasks: parseResult.custom }, configurations: customizedTasks, hasErrors }; }); }); } @@ -1079,11 +1240,19 @@ class TaskService extends EventEmitter implements ITaskService { private getExecutionEngine(): ExecutionEngine { let { config } = this.getConfiguration(); if (!config) { - return ExecutionEngine.Process; + return ExecutionEngine._default; } return TaskConfig.ExecutionEngine.from(config); } + private getJsonSchemaVersion(): JsonSchemaVersion { + let { config } = this.getConfiguration(); + if (!config) { + return JsonSchemaVersion.V2_0_0; + } + return TaskConfig.JsonSchemaVersion.from(config); + } + private getConfiguration(): { config: TaskConfig.ExternalTaskRunnerConfiguration; hasParseErrors: boolean } { let result = this.configurationService.getConfiguration('tasks'); if (!result) { @@ -1120,7 +1289,10 @@ class TaskService extends EventEmitter implements ITaskService { } public inTerminal(): boolean { - return this._taskSystem instanceof TerminalTaskSystem; + if (this._taskSystem) { + return this._taskSystem instanceof TerminalTaskSystem; + } + return this.getExecutionEngine() === ExecutionEngine.Terminal; } private hasDetectorSupport(config: TaskConfig.ExternalTaskRunnerConfiguration): boolean { @@ -1131,44 +1303,67 @@ class TaskService extends EventEmitter implements ITaskService { } public configureAction(): Action { - return new ConfigureTaskRunnerAction(ConfigureTaskRunnerAction.ID, ConfigureTaskRunnerAction.TEXT, + return new ConfigureTaskRunnerAction(ConfigureTaskRunnerAction.ID, ConfigureTaskRunnerAction.TEXT, this, this.configurationService, this.editorService, this.fileService, this.contextService, - this.outputService, this.messageService, this.quickOpenService, this.environmentService, this.configurationResolverService); + this.outputService, this.messageService, this.quickOpenService, this.environmentService, this.configurationResolverService, + this.extensionService); } private configureBuildTask(): Action { - return new ConfigureBuildTaskAction(ConfigureBuildTaskAction.ID, ConfigureBuildTaskAction.TEXT, + return new ConfigureBuildTaskAction(ConfigureBuildTaskAction.ID, ConfigureBuildTaskAction.TEXT, this, this.configurationService, this.editorService, this.fileService, this.contextService, - this.outputService, this.messageService, this.quickOpenService, this.environmentService, this.configurationResolverService); + this.outputService, this.messageService, this.quickOpenService, this.environmentService, this.configurationResolverService, + this.extensionService); } public beforeShutdown(): boolean | TPromise { - if (this._taskSystem && this._taskSystem.isActiveSync()) { - if (this._taskSystem.canAutoTerminate() || this.messageService.confirm({ - message: nls.localize('TaskSystem.runningTask', 'There is a task running. Do you want to terminate it?'), - primaryButton: nls.localize({ key: 'TaskSystem.terminateTask', comment: ['&& denotes a mnemonic'] }, "&&Terminate Task") - })) { - return this._taskSystem.terminateAll().then((response) => { - if (response.success) { - this.emit(TaskServiceEvents.Terminated, {}); - this._taskSystem = null; - this.disposeTaskSystemListeners(); - return false; // no veto - } else if (response.code && response.code === TerminateResponseCode.ProcessNotFound) { - return !this.messageService.confirm({ - message: nls.localize('TaskSystem.noProcess', 'The launched task doesn\'t exist anymore. If the task spawned background processes exiting VS Code might result in orphaned processes. To avoid this start the last background process with a wait flag.'), - primaryButton: nls.localize({ key: 'TaskSystem.exitAnyways', comment: ['&& denotes a mnemonic'] }, "&&Exit Anyways") - }); + if (!this._taskSystem) { + return false; + } + this.saveRecentlyUsedTasks(); + if (!this._taskSystem.isActiveSync()) { + return false; + } + // The terminal service kills all terminal on shutdown. So there + // is nothing we can do to prevent this here. + if (this._taskSystem instanceof TerminalTaskSystem) { + return false; + } + if (this._taskSystem.canAutoTerminate() || this.messageService.confirm({ + message: nls.localize('TaskSystem.runningTask', 'There is a task running. Do you want to terminate it?'), + primaryButton: nls.localize({ key: 'TaskSystem.terminateTask', comment: ['&& denotes a mnemonic'] }, "&&Terminate Task"), + type: 'question' + })) { + return this._taskSystem.terminateAll().then((responses) => { + let success = true; + let code: number = undefined; + for (let response of responses) { + success = success && response.success; + // We only have a code in the old output runner which only has one task + // So we can use the first code. + if (code === void 0 && response.code !== void 0) { + code = response.code; } - return true; // veto - }, (err) => { - return true; // veto - }); - } else { + } + if (success) { + this.emit(TaskServiceEvents.Terminated, {}); + this._taskSystem = null; + this.disposeTaskSystemListeners(); + return false; // no veto + } else if (code && code === TerminateResponseCode.ProcessNotFound) { + return !this.messageService.confirm({ + message: nls.localize('TaskSystem.noProcess', 'The launched task doesn\'t exist anymore. If the task spawned background processes exiting VS Code might result in orphaned processes. To avoid this start the last background process with a wait flag.'), + primaryButton: nls.localize({ key: 'TaskSystem.exitAnyways', comment: ['&& denotes a mnemonic'] }, "&&Exit Anyways"), + type: 'info' + }); + } return true; // veto - } + }, (err) => { + return true; // veto + }); + } else { + return true; // veto } - return false; // Nothing to do here } private getConfigureAction(code: TaskErrors): Action { @@ -1236,6 +1431,41 @@ class TaskService extends EventEmitter implements ITaskService { } } + private runBuildCommand(): void { + if (!this.canRunCommand()) { + return; + } + if (!this.inTerminal()) { + this.build(); + return; + } + this.getTasksForGroup(TaskGroup.Build).then((tasks) => { + if (tasks.length === 0) { + // Show no build task message. + return; + } + this.quickOpenService.show('build task '); + }); + } + + private runTestCommand(): void { + if (!this.canRunCommand()) { + return; + } + if (!this.inTerminal()) { + this.runTest(); + return; + } + this.getTasksForGroup(TaskGroup.Test).then((tasks) => { + let { configured, detected } = this.splitTasks(tasks); + let total = configured.length + detected.length; + if (total === 0) { + return; + } + this.quickOpenService.show('test task '); + }); + } + private runTerminateCommand(): void { if (!this.canRunCommand()) { return; @@ -1254,7 +1484,9 @@ class TaskService extends EventEmitter implements ITaskService { } else { this.isActive().then((active) => { if (active) { - this.terminateAll().then((response) => { + this.terminateAll().then((responses) => { + // the output runner has only one task + let response = responses[0]; if (response.success) { return; } @@ -1298,7 +1530,7 @@ class TaskService extends EventEmitter implements ITaskService { let workbenchActionsRegistry = Registry.as(WorkbenchActionExtensions.WorkbenchActions); -workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(ConfigureTaskRunnerAction, ConfigureTaskRunnerAction.ID, ConfigureTaskRunnerAction.TEXT), 'Configure Task Runner', tasksCategory); +workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(ConfigureTaskRunnerAction, ConfigureTaskRunnerAction.ID, ConfigureTaskRunnerAction.TEXT), 'Tasks: Configure Task Runner', tasksCategory); MenuRegistry.addCommand({ id: 'workbench.action.tasks.showLog', title: { value: nls.localize('ShowLogAction.label', "Show Task Log"), original: 'Show Task Log' }, category: { value: tasksCategory, original: 'Tasks' } }); MenuRegistry.addCommand({ id: 'workbench.action.tasks.runTask', title: { value: nls.localize('RunTaskAction.label', "Run Task"), original: 'Run Task' }, category: { value: tasksCategory, original: 'Tasks' } }); @@ -1314,12 +1546,14 @@ registerSingleton(ITaskService, TaskService); // Register Quick Open const quickOpenRegistry = (Registry.as(QuickOpenExtensions.Quickopen)); +const tasksPickerContextKey = 'inTasksPicker'; quickOpenRegistry.registerQuickOpenHandler( new QuickOpenHandlerDescriptor( 'vs/workbench/parts/tasks/browser/taskQuickOpen', 'QuickOpenHandler', 'task ', + tasksPickerContextKey, nls.localize('quickOpen.task', "Run Task") ) ); @@ -1329,6 +1563,7 @@ quickOpenRegistry.registerQuickOpenHandler( 'vs/workbench/parts/tasks/browser/terminateQuickOpen', 'QuickOpenHandler', 'terminate task ', + tasksPickerContextKey, nls.localize('quickOpen.terminateTask', "Terminate Task") ) ); @@ -1338,10 +1573,34 @@ quickOpenRegistry.registerQuickOpenHandler( 'vs/workbench/parts/tasks/browser/restartQuickOpen', 'QuickOpenHandler', 'restart task ', + tasksPickerContextKey, nls.localize('quickOpen.restartTask', "Restart Task") ) ); +quickOpenRegistry.registerQuickOpenHandler( + new QuickOpenHandlerDescriptor( + 'vs/workbench/parts/tasks/browser/buildQuickOpen', + 'QuickOpenHandler', + 'build task ', + tasksPickerContextKey, + nls.localize('quickOpen.buildTask', "Build Task") + ) +); + +quickOpenRegistry.registerQuickOpenHandler( + new QuickOpenHandlerDescriptor( + 'vs/workbench/parts/tasks/browser/testQuickOpen', + 'QuickOpenHandler', + 'test task ', + tasksPickerContextKey, + nls.localize('quickOpen.testTask', "Test Task") + ) +); + +const actionBarRegistry = Registry.as(ActionBarExtensions.Actionbar); +actionBarRegistry.registerActionBarContributor(Scope.VIEWER, QuickOpenActionContributor); + // Status bar let statusbarRegistry = Registry.as(StatusbarExtensions.Statusbar); statusbarRegistry.registerStatusbarItem(new StatusbarItemDescriptor(StatusBarItem, StatusbarAlignment.LEFT, 50 /* Medium Priority */)); @@ -1385,4 +1644,4 @@ schema.oneOf = [...schemaVersion1.oneOf, ...schemaVersion2.oneOf]; let jsonRegistry = Registry.as(jsonContributionRegistry.Extensions.JSONContribution); -jsonRegistry.registerSchema(schemaId, schema); +jsonRegistry.registerSchema(schemaId, schema); \ No newline at end of file diff --git a/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.ts b/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.ts index 00b2950731fc92fed95b8e2d2a72de4a28ce5705..20e15048e1a074037b7b8c305f0206460eeda409 100644 --- a/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.ts +++ b/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.ts @@ -15,10 +15,10 @@ import * as Platform from 'vs/base/common/platform'; import * as Async from 'vs/base/common/async'; import { TPromise } from 'vs/base/common/winjs.base'; import { IStringDictionary } from 'vs/base/common/collections'; +import { LinkedMap, Touch } from 'vs/base/common/map'; import Severity from 'vs/base/common/severity'; import { EventEmitter } from 'vs/base/common/eventEmitter'; import { IDisposable, dispose } from 'vs/base/common/lifecycle'; -import { TerminateResponse } from 'vs/base/common/processes'; import * as TPath from 'vs/base/common/paths'; // import URI from 'vs/base/common/uri'; @@ -33,10 +33,10 @@ import { IConfigurationResolverService } from 'vs/workbench/services/configurati import { ITerminalService, ITerminalInstance, IShellLaunchConfig } from 'vs/workbench/parts/terminal/common/terminal'; import { IOutputService, IOutputChannel } from 'vs/workbench/parts/output/common/output'; import { StartStopProblemCollector, WatchingProblemCollector, ProblemCollectorEvents } from 'vs/workbench/parts/tasks/common/problemCollectors'; -import { Task, ShowOutput, CommandOptions, ShellConfiguration } from 'vs/workbench/parts/tasks/common/tasks'; +import { Task, RevealKind, CommandOptions, ShellConfiguration, RuntimeType, PanelKind } from 'vs/workbench/parts/tasks/common/tasks'; import { ITaskSystem, ITaskSummary, ITaskExecuteResult, TaskExecuteKind, TaskError, TaskErrors, ITaskResolver, - TelemetryEvent, Triggers, TaskSystemEvents, TaskEvent, TaskType + TelemetryEvent, Triggers, TaskSystemEvents, TaskEvent, TaskType, TaskTerminateResponse } from 'vs/workbench/parts/tasks/common/taskSystem'; class TerminalDecoder { @@ -105,9 +105,9 @@ export class TerminalTaskSystem extends EventEmitter implements ITaskSystem { private outputChannel: IOutputChannel; private activeTasks: IStringDictionary; - private primaryTerminal: PrimaryTerminal; private terminals: IStringDictionary; - private idleTaskTerminals: IStringDictionary; + private idleTaskTerminals: LinkedMap; + private sameTaskTerminals: IStringDictionary; constructor(private terminalService: ITerminalService, private outputService: IOutputService, private markerService: IMarkerService, private modelService: IModelService, @@ -120,7 +120,8 @@ export class TerminalTaskSystem extends EventEmitter implements ITaskSystem { this.outputChannel = this.outputService.getChannel(outputChannelId); this.activeTasks = Object.create(null); this.terminals = Object.create(null); - this.idleTaskTerminals = Object.create(null); + this.idleTaskTerminals = new LinkedMap(); + this.sameTaskTerminals = Object.create(null); } public log(value: string): void { @@ -134,8 +135,11 @@ export class TerminalTaskSystem extends EventEmitter implements ITaskSystem { public run(task: Task, resolver: ITaskResolver, trigger: string = Triggers.command): ITaskExecuteResult { let terminalData = this.activeTasks[task._id]; if (terminalData && terminalData.promise) { - if (task.showOutput === ShowOutput.Always) { - terminalData.terminal.setVisible(true); + let reveal = task.command.presentation.reveal; + let focus = task.command.presentation.focus; + if (reveal === RevealKind.Always || focus) { + this.terminalService.setActiveInstance(terminalData.terminal); + this.terminalService.showPanel(focus); } return { kind: TaskExecuteKind.Active, active: { same: true, background: task.isBackground }, promise: terminalData.promise }; } @@ -171,28 +175,50 @@ export class TerminalTaskSystem extends EventEmitter implements ITaskSystem { return Object.keys(this.activeTasks).map(key => this.activeTasks[key].task); } - public terminate(id: string): TPromise { - let terminalData = this.activeTasks[id]; - if (!terminalData) { - return TPromise.as({ success: false }); + public terminate(id: string): TPromise { + let activeTerminal = this.activeTasks[id]; + if (!activeTerminal) { + return TPromise.as({ success: false, task: undefined }); }; - return new TPromise((resolve, reject) => { - let terminal = terminalData.terminal; + return new TPromise((resolve, reject) => { + let terminal = activeTerminal.terminal; const onExit = terminal.onExit(() => { - onExit.dispose(); - resolve({ success: true }); + let task = activeTerminal.task; + try { + onExit.dispose(); + let event: TaskEvent = { taskId: task._id, taskName: task.name, type: TaskType.SingleRun, group: task.group }; + this.emit(TaskSystemEvents.Terminated, event); + } catch (error) { + // Do nothing. + } + resolve({ success: true, task: task }); }); terminal.dispose(); }); } - public terminateAll(): TPromise { + public terminateAll(): TPromise { + let promises: TPromise[] = []; Object.keys(this.activeTasks).forEach((key) => { - let data = this.activeTasks[key]; - data.terminal.dispose(); + let terminalData = this.activeTasks[key]; + let terminal = terminalData.terminal; + promises.push(new TPromise((resolve, reject) => { + const onExit = terminal.onExit(() => { + let task = terminalData.task; + try { + onExit.dispose(); + let event: TaskEvent = { taskId: task._id, taskName: task.name, type: TaskType.SingleRun, group: task.group }; + this.emit(TaskSystemEvents.Terminated, event); + } catch (error) { + // Do nothing. + } + resolve({ success: true, task: terminalData.task }); + }); + })); + terminal.dispose(); }); this.activeTasks = Object.create(null); - return TPromise.as({ success: true }); + return TPromise.join(promises); } private executeTask(startedTasks: IStringDictionary>, task: Task, resolver: ITaskResolver, trigger: string): TPromise { @@ -212,7 +238,7 @@ export class TerminalTaskSystem extends EventEmitter implements ITaskSystem { } if (task.command) { - return TPromise.join(promises).then((summaries): ITaskSummary => { + return TPromise.join(promises).then((summaries): TPromise | ITaskSummary => { for (let summary of summaries) { if (summary.exitCode !== 0) { return { exitCode: summary.exitCode }; @@ -241,7 +267,7 @@ export class TerminalTaskSystem extends EventEmitter implements ITaskSystem { const problemMatchers = this.resolveMatchers(task.problemMatchers); let watchingProblemMatcher = new WatchingProblemCollector(problemMatchers, this.markerService, this.modelService); let toUnbind: IDisposable[] = []; - let event: TaskEvent = { taskId: task._id, taskName: task.name, type: TaskType.Watching }; + let event: TaskEvent = { taskId: task._id, taskName: task.name, type: TaskType.Watching, group: task.group }; let eventCounter: number = 0; toUnbind.push(watchingProblemMatcher.addListener(ProblemCollectorEvents.WatchingBeginDetected, () => { eventCounter++; @@ -272,10 +298,14 @@ export class TerminalTaskSystem extends EventEmitter implements ITaskSystem { onData.dispose(); onExit.dispose(); delete this.activeTasks[task._id]; - if (this.primaryTerminal && this.primaryTerminal.terminal === terminal) { - this.primaryTerminal.busy = false; + switch (task.command.presentation.panel) { + case PanelKind.Dedicated: + this.sameTaskTerminals[task._id] = terminal.id.toString(); + break; + case PanelKind.Shared: + this.idleTaskTerminals.set(task._id, terminal.id.toString(), Touch.First); + break; } - this.idleTaskTerminals[task._id] = terminal.id.toString(); let remaining = decoder.end(); if (remaining) { watchingProblemMatcher.processLine(remaining); @@ -288,7 +318,8 @@ export class TerminalTaskSystem extends EventEmitter implements ITaskSystem { this.emit(TaskSystemEvents.Inactive, event); } eventCounter = 0; - if (exitCode && exitCode === 1 && watchingProblemMatcher.numberOfMatches === 0 && task.showOutput !== ShowOutput.Never) { + let reveal = task.command.presentation.reveal; + if (exitCode && exitCode === 1 && watchingProblemMatcher.numberOfMatches === 0 && reveal !== RevealKind.Never) { this.terminalService.setActiveInstance(terminal); this.terminalService.showPanel(false); } @@ -298,7 +329,7 @@ export class TerminalTaskSystem extends EventEmitter implements ITaskSystem { } else { promise = new TPromise((resolve, reject) => { [terminal, executedCommand] = this.createTerminal(task); - let event: TaskEvent = { taskId: task._id, taskName: task.name, type: TaskType.SingleRun }; + let event: TaskEvent = { taskId: task._id, taskName: task.name, type: TaskType.SingleRun, group: task.group }; this.emit(TaskSystemEvents.Active, event); let decoder = new TerminalDecoder(); let problemMatchers = this.resolveMatchers(task.problemMatchers); @@ -313,10 +344,14 @@ export class TerminalTaskSystem extends EventEmitter implements ITaskSystem { onData.dispose(); onExit.dispose(); delete this.activeTasks[task._id]; - if (this.primaryTerminal && this.primaryTerminal.terminal === terminal) { - this.primaryTerminal.busy = false; + switch (task.command.presentation.panel) { + case PanelKind.Dedicated: + this.sameTaskTerminals[task._id] = terminal.id.toString(); + break; + case PanelKind.Shared: + this.idleTaskTerminals.set(task._id, terminal.id.toString(), Touch.First); + break; } - this.idleTaskTerminals[task._id] = terminal.id.toString(); let remaining = decoder.end(); if (remaining) { startStopProblemMatcher.processLine(remaining); @@ -330,14 +365,15 @@ export class TerminalTaskSystem extends EventEmitter implements ITaskSystem { }); } this.terminalService.setActiveInstance(terminal); - if (task.showOutput === ShowOutput.Always) { - this.terminalService.showPanel(false); + if (task.command.presentation.reveal === RevealKind.Always || (task.command.presentation.reveal === RevealKind.Silent && task.problemMatchers.length === 0)) { + this.terminalService.showPanel(task.command.presentation.focus); } this.activeTasks[task._id] = { terminal, task, promise }; return promise.then((summary) => { try { let telemetryEvent: TelemetryEvent = { trigger: trigger, + runner: 'terminal', command: this.getSanitizedCommand(executedCommand), success: true, exitCode: summary.exitCode @@ -350,6 +386,7 @@ export class TerminalTaskSystem extends EventEmitter implements ITaskSystem { try { let telemetryEvent: TelemetryEvent = { trigger: trigger, + runner: 'terminal', command: this.getSanitizedCommand(executedCommand), success: false }; @@ -364,19 +401,24 @@ export class TerminalTaskSystem extends EventEmitter implements ITaskSystem { let options = this.resolveOptions(task.command.options); let { command, args } = this.resolveCommandAndArgs(task); let terminalName = nls.localize('TerminalTaskSystem.terminalName', 'Task - {0}', task.name); - let waitOnExit = task.showOutput !== ShowOutput.Never || !task.isBackground; + let waitOnExit: boolean | string = false; + if (task.command.presentation.reveal !== RevealKind.Never || !task.isBackground) { + waitOnExit = nls.localize('reuseTerminal', 'Terminal will be reused by tasks, press any key to close it.'); + }; let shellLaunchConfig: IShellLaunchConfig = undefined; - if (task.command.isShellCommand) { + let isShellCommand = task.command.runtime === RuntimeType.Shell; + if (isShellCommand) { if (Platform.isWindows && ((options.cwd && TPath.isUNC(options.cwd)) || (!options.cwd && TPath.isUNC(process.cwd())))) { throw new TaskError(Severity.Error, nls.localize('TerminalTaskSystem', 'Can\'t execute a shell command on an UNC drive.'), TaskErrors.UnknownError); } shellLaunchConfig = { name: terminalName, executable: null, args: null, waitOnExit }; let shellSpecified: boolean = false; - if (ShellConfiguration.is(task.command.isShellCommand)) { - shellLaunchConfig.executable = task.command.isShellCommand.executable; + let shellOptions: ShellConfiguration = task.command.options && task.command.options.shell; + if (shellOptions && shellOptions.executable) { + shellLaunchConfig.executable = shellOptions.executable; shellSpecified = true; - if (task.command.isShellCommand.args) { - shellLaunchConfig.args = task.command.isShellCommand.args.slice(); + if (shellOptions.args) { + shellLaunchConfig.args = shellOptions.args.slice(); } else { shellLaunchConfig.args = []; } @@ -413,21 +455,21 @@ export class TerminalTaskSystem extends EventEmitter implements ITaskSystem { }); shellArgs.push(commandLine); shellLaunchConfig.args = Platform.isWindows ? shellArgs.join(' ') : shellArgs; - if (task.command.echo) { - shellLaunchConfig.initialText = `> ${commandLine}`; + if (task.command.presentation.echo) { + shellLaunchConfig.initialText = `\x1b[1m> Executing task: ${commandLine} <\x1b[0m\n`; } } else { let cwd = options && options.cwd ? options.cwd : process.cwd(); // On Windows executed process must be described absolute. Since we allowed command without an // absolute path (e.g. "command": "node") we need to find the executable in the CWD or PATH. - let executable = Platform.isWindows && !task.command.isShellCommand ? this.findExecutable(command, cwd) : command; + let executable = Platform.isWindows && !isShellCommand ? this.findExecutable(command, cwd) : command; shellLaunchConfig = { name: terminalName, executable: executable, args, waitOnExit }; - if (task.command.echo) { + if (task.command.presentation.echo) { let getArgsToEcho = (args: string | string[]): string => { if (!args || args.length === 0) { return ''; @@ -437,7 +479,7 @@ export class TerminalTaskSystem extends EventEmitter implements ITaskSystem { } return args.join(' '); }; - shellLaunchConfig.initialText = `> ${shellLaunchConfig.executable} ${getArgsToEcho(shellLaunchConfig.args)}`; + shellLaunchConfig.initialText = `\x1b[1m> Executing task: ${shellLaunchConfig.executable} ${getArgsToEcho(shellLaunchConfig.args)} <\x1b[0m\n`; } } if (options.cwd) { @@ -453,59 +495,44 @@ export class TerminalTaskSystem extends EventEmitter implements ITaskSystem { }); shellLaunchConfig.env = env; } - let terminalId = this.idleTaskTerminals[task._id]; - if (terminalId) { - let taskTerminal = this.terminals[terminalId]; - if (taskTerminal) { - delete this.idleTaskTerminals[task._id]; - taskTerminal.terminal.reuseTerminal(shellLaunchConfig); - return [taskTerminal.terminal, command]; + let prefersSameTerminal = task.command.presentation.panel === PanelKind.Dedicated; + let allowsSharedTerminal = task.command.presentation.panel === PanelKind.Shared; + + let terminalToReuse: TerminalData; + if (prefersSameTerminal) { + let terminalId = this.sameTaskTerminals[task._id]; + if (terminalId) { + terminalToReuse = this.terminals[terminalId]; + delete this.sameTaskTerminals[task._id]; } - } - if (this.primaryTerminal && !this.primaryTerminal.busy) { - // We reuse the primary terminal. Make sure the last running task isn't referenced in the idle terminals - let terminalData = this.terminals[this.primaryTerminal.terminal.id.toString()]; - if (terminalData) { - delete this.idleTaskTerminals[terminalData.lastTask]; + } else if (allowsSharedTerminal) { + let terminalId = this.idleTaskTerminals.remove(task._id) || this.idleTaskTerminals.shift(); + if (terminalId) { + terminalToReuse = this.terminals[terminalId]; } - this.primaryTerminal.terminal.reuseTerminal(shellLaunchConfig); - this.primaryTerminal.busy = true; - return [this.primaryTerminal.terminal, command]; } + if (terminalToReuse) { + terminalToReuse.terminal.reuseTerminal(shellLaunchConfig); + return [terminalToReuse.terminal, command]; + } + const result = this.terminalService.createInstance(shellLaunchConfig); const key = result.id.toString(); result.onDisposed((terminal) => { let terminalData = this.terminals[key]; if (terminalData) { delete this.terminals[key]; - delete this.idleTaskTerminals[terminalData.lastTask]; - } - if (this.primaryTerminal && this.primaryTerminal.terminal === terminal) { - this.primaryTerminal = undefined; + delete this.sameTaskTerminals[terminalData.lastTask]; + this.idleTaskTerminals.delete(terminalData.lastTask); } }); this.terminals[key] = { terminal: result, lastTask: task._id }; - if (!task.isBackground && !this.primaryTerminal) { - this.primaryTerminal = { terminal: result, busy: true }; - } return [result, command]; } private resolveCommandAndArgs(task: Task): { command: string, args: string[] } { // First we need to use the command args: let args: string[] = task.command.args ? task.command.args.slice() : []; - // We need to first pass the task name - if (!task.suppressTaskName) { - if (task.command.taskSelector) { - args.push(task.command.taskSelector + task.name); - } else { - args.push(task.name); - } - } - // And then additional arguments - if (task.args) { - args = args.concat(task.args); - } args = this.resolveVariables(args); let command: string = this.resolveVariable(task.command.name); return { command, args }; @@ -562,7 +589,11 @@ export class TerminalTaskSystem extends EventEmitter implements ITaskSystem { values.forEach((value) => { let matcher: ProblemMatcher; if (Types.isString(value)) { - matcher = ProblemMatcherRegistry.get(value); + if (value[0] === '$') { + matcher = ProblemMatcherRegistry.get(value.substring(1)); + } else { + matcher = ProblemMatcherRegistry.get(value); + } } else { matcher = value; } diff --git a/src/vs/workbench/parts/tasks/node/processRunnerDetector.ts b/src/vs/workbench/parts/tasks/node/processRunnerDetector.ts index 92c7473515ad6facf96d93343c4d244779793ea5..ddab1546e7b87f98063af3a1eaf02772b32bb251 100644 --- a/src/vs/workbench/parts/tasks/node/processRunnerDetector.ts +++ b/src/vs/workbench/parts/tasks/node/processRunnerDetector.ts @@ -20,7 +20,8 @@ import { IConfigurationResolverService } from 'vs/workbench/services/configurati import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; -import * as TaskConfig from '../common/taskConfiguration'; +import * as Tasks from '../common/tasks'; +import * as TaskConfig from './taskConfiguration'; let build: string = 'build'; let test: string = 'test'; @@ -155,8 +156,7 @@ export class ProcessRunnerDetector { this.taskConfiguration = config; this._stderr = []; this._stdout = []; - const workspace = this.contextService.getWorkspace(); - this._cwd = workspace ? Paths.normalize(workspace.resource.fsPath, true) : ''; + this._cwd = this.contextService.hasWorkspace() ? Paths.normalize(this.contextService.getWorkspace().resource.fsPath, true) : ''; } public get stderr(): string[] { @@ -314,8 +314,8 @@ export class ProcessRunnerDetector { }); } - private createTaskDescriptions(tasks: string[], problemMatchers: string[], list: boolean): TaskConfig.TaskDescription[] { - let taskConfigs: TaskConfig.TaskDescription[] = []; + private createTaskDescriptions(tasks: string[], problemMatchers: string[], list: boolean): TaskConfig.CustomTask[] { + let taskConfigs: TaskConfig.CustomTask[] = []; if (list) { tasks.forEach((task) => { taskConfigs.push({ @@ -338,7 +338,7 @@ export class ProcessRunnerDetector { taskConfigs.push({ taskName: name, args: [], - isBuildCommand: true, + group: Tasks.TaskGroup.Build, problemMatcher: problemMatchers }); } @@ -348,7 +348,7 @@ export class ProcessRunnerDetector { taskConfigs.push({ taskName: name, args: [], - isTestCommand: true + group: Tasks.TaskGroup.Test, }); } } diff --git a/src/vs/workbench/parts/tasks/node/processTaskSystem.ts b/src/vs/workbench/parts/tasks/node/processTaskSystem.ts index 9cc26f22205dd60109de7a707b3ab48eed4be0f4..f45236b181be36a70611ce406df72bbfae62b9cd 100644 --- a/src/vs/workbench/parts/tasks/node/processTaskSystem.ts +++ b/src/vs/workbench/parts/tasks/node/processTaskSystem.ts @@ -14,7 +14,7 @@ import Severity from 'vs/base/common/severity'; import * as Strings from 'vs/base/common/strings'; import { EventEmitter } from 'vs/base/common/eventEmitter'; -import { TerminateResponse, SuccessData, ErrorData } from 'vs/base/common/processes'; +import { SuccessData, ErrorData } from 'vs/base/common/processes'; import { LineProcess, LineData } from 'vs/base/node/processes'; import { IOutputService, IOutputChannel } from 'vs/workbench/parts/output/common/output'; @@ -27,9 +27,10 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { StartStopProblemCollector, WatchingProblemCollector, ProblemCollectorEvents } from 'vs/workbench/parts/tasks/common/problemCollectors'; import { - ITaskSystem, ITaskSummary, ITaskExecuteResult, TaskExecuteKind, TaskError, TaskErrors, TelemetryEvent, Triggers, TaskSystemEvents, TaskEvent, TaskType + ITaskSystem, ITaskSummary, ITaskExecuteResult, TaskExecuteKind, TaskError, TaskErrors, TelemetryEvent, Triggers, + TaskSystemEvents, TaskEvent, TaskType, TaskTerminateResponse } from 'vs/workbench/parts/tasks/common/taskSystem'; -import { Task, CommandOptions, ShowOutput, CommandConfiguration } from 'vs/workbench/parts/tasks/common/tasks'; +import { Task, CommandOptions, RevealKind, CommandConfiguration, RuntimeType } from 'vs/workbench/parts/tasks/common/tasks'; import { IDisposable, dispose } from 'vs/base/common/lifecycle'; @@ -103,23 +104,30 @@ export class ProcessTaskSystem extends EventEmitter implements ITaskSystem { return true; } - public terminate(_id: string): TPromise { + public terminate(_id: string): TPromise { if (!this.activeTask || this.activeTask._id !== _id) { - return TPromise.as({ success: false }); + return TPromise.as({ success: false, task: undefined }); } - return this.terminateAll(); + return this.terminateAll()[0]; } - public terminateAll(): TPromise { + public terminateAll(): TPromise { if (this.childProcess) { - return this.childProcess.terminate(); + let task = this.activeTask; + return this.childProcess.terminate().then((response) => { + let result: TaskTerminateResponse = Objects.assign({ task: task }, response); + let event: TaskEvent = { taskId: task._id, taskName: task.name, type: TaskType.SingleRun, group: task.group }; + this.emit(TaskSystemEvents.Terminated, event); + return [result]; + }); } - return TPromise.as({ success: true }); + return TPromise.as([{ success: true, task: undefined }]); } private executeTask(task: Task, trigger: string = Triggers.command): ITaskExecuteResult { let telemetryEvent: TelemetryEvent = { trigger: trigger, + runner: 'output', command: 'other', success: true }; @@ -161,35 +169,24 @@ export class ProcessTaskSystem extends EventEmitter implements ITaskSystem { } let args: string[] = commandConfig.args ? commandConfig.args.slice() : []; - // We need to first pass the task name - if (!task.suppressTaskName) { - if (commandConfig.taskSelector) { - args.push(commandConfig.taskSelector + task.name); - } else { - args.push(task.name); - } - } - // And then additional arguments - if (task.args) { - args = args.concat(task.args); - } args = this.resolveVariables(args); let command: string = this.resolveVariable(commandConfig.name); - this.childProcess = new LineProcess(command, args, !!commandConfig.isShellCommand, this.resolveOptions(commandConfig.options)); + this.childProcess = new LineProcess(command, args, commandConfig.runtime === RuntimeType.Shell, this.resolveOptions(commandConfig.options)); telemetryEvent.command = this.childProcess.getSanitizedCommand(); // we have no problem matchers defined. So show the output log - if (task.showOutput === ShowOutput.Always || (task.showOutput === ShowOutput.Silent && task.problemMatchers.length === 0)) { + let reveal = task.command.presentation.reveal; + if (reveal === RevealKind.Always || (reveal === RevealKind.Silent && task.problemMatchers.length === 0)) { this.showOutput(); } - if (commandConfig.echo) { + if (commandConfig.presentation.echo) { let prompt: string = Platform.isWindows ? '>' : '$'; this.log(`running command${prompt} ${command} ${args.join(' ')}`); } if (task.isBackground) { let watchingProblemMatcher = new WatchingProblemCollector(this.resolveMatchers(task.problemMatchers), this.markerService, this.modelService); let toUnbind: IDisposable[] = []; - let event: TaskEvent = { taskId: task._id, taskName: task.name, type: TaskType.Watching }; + let event: TaskEvent = { taskId: task._id, taskName: task.name, type: TaskType.Watching, group: task.group }; let eventCounter: number = 0; toUnbind.push(watchingProblemMatcher.addListener(ProblemCollectorEvents.WatchingBeginDetected, () => { eventCounter++; @@ -214,7 +211,7 @@ export class ProcessTaskSystem extends EventEmitter implements ITaskSystem { if (!this.checkTerminated(task, success)) { this.log(nls.localize('TaskRunnerSystem.watchingBuildTaskFinished', '\nWatching build tasks has finished.')); } - if (success.cmdCode && success.cmdCode === 1 && watchingProblemMatcher.numberOfMatches === 0 && task.showOutput !== ShowOutput.Never) { + if (success.cmdCode && success.cmdCode === 1 && watchingProblemMatcher.numberOfMatches === 0 && reveal !== RevealKind.Never) { this.showOutput(); } taskSummary.exitCode = success.cmdCode; @@ -248,7 +245,7 @@ export class ProcessTaskSystem extends EventEmitter implements ITaskSystem { : { kind: TaskExecuteKind.Started, started: {}, promise: this.activeTaskPromise }; return result; } else { - let event: TaskEvent = { taskId: task._id, taskName: task.name, type: TaskType.SingleRun }; + let event: TaskEvent = { taskId: task._id, taskName: task.name, type: TaskType.SingleRun, group: task.group }; this.emit(TaskSystemEvents.Active, event); let startStopProblemMatcher = new StartStopProblemCollector(this.resolveMatchers(task.problemMatchers), this.markerService, this.modelService); this.activeTask = task; @@ -258,7 +255,7 @@ export class ProcessTaskSystem extends EventEmitter implements ITaskSystem { startStopProblemMatcher.dispose(); this.checkTerminated(task, success); this.emit(TaskSystemEvents.Inactive, event); - if (success.cmdCode && success.cmdCode === 1 && startStopProblemMatcher.numberOfMatches === 0 && task.showOutput !== ShowOutput.Never) { + if (success.cmdCode && success.cmdCode === 1 && startStopProblemMatcher.numberOfMatches === 0 && reveal !== RevealKind.Never) { this.showOutput(); } taskSummary.exitCode = success.cmdCode; @@ -343,7 +340,11 @@ export class ProcessTaskSystem extends EventEmitter implements ITaskSystem { values.forEach((value) => { let matcher: ProblemMatcher; if (Types.isString(value)) { - matcher = ProblemMatcherRegistry.get(value); + if (value[0] === '$') { + matcher = ProblemMatcherRegistry.get(value.substring(1)); + } else { + matcher = ProblemMatcherRegistry.get(value); + } } else { matcher = value; } diff --git a/src/vs/workbench/parts/tasks/node/taskConfiguration.ts b/src/vs/workbench/parts/tasks/node/taskConfiguration.ts new file mode 100644 index 0000000000000000000000000000000000000000..e2780233d4bfc7007c50e1e7092cd7188225bfb5 --- /dev/null +++ b/src/vs/workbench/parts/tasks/node/taskConfiguration.ts @@ -0,0 +1,1762 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +'use strict'; + +import * as crypto from 'crypto'; + +import nls = require('vs/nls'); + +import * as Objects from 'vs/base/common/objects'; +import { IStringDictionary } from 'vs/base/common/collections'; +import * as Platform from 'vs/base/common/platform'; +import * as Types from 'vs/base/common/types'; +import * as UUID from 'vs/base/common/uuid'; + +import { ValidationStatus, IProblemReporter as IProblemReporterBase } from 'vs/base/common/parsers'; +import { + NamedProblemMatcher, ProblemMatcher, ProblemMatcherParser, Config as ProblemMatcherConfig, + isNamedProblemMatcher, ProblemMatcherRegistry +} from 'vs/platform/markers/common/problemMatcher'; + +import * as Tasks from '../common/tasks'; +import { TaskTypeRegistry } from '../common/taskTypeRegistry'; + +/** + * Defines the problem handling strategy + */ +export class ProblemHandling { + /** + * Cleans all problems for the owner defined in the + * error pattern. + */ + public static clean: string = 'cleanMatcherMatchers'; +} + +export interface ShellConfiguration { + executable: string; + args?: string[]; +} + +export interface CommandOptions { + /** + * The current working directory of the executed program or shell. + * If omitted VSCode's current workspace root is used. + */ + cwd?: string; + + /** + * The additional environment of the executed program or shell. If omitted + * the parent process' environment is used. + */ + env?: IStringDictionary; + + /** + * The shell configuration; + */ + shell?: ShellConfiguration; +} + +export interface PresentationOptions { + /** + * Controls whether the terminal executing a task is brought to front or not. + * Defaults to `RevealKind.Always`. + */ + reveal?: string; + + /** + * Controls whether the executed command is printed to the output window or terminal as well. + */ + echo?: boolean; + + /** + * Controls whether the terminal is focus when this task is executed + */ + focus?: boolean; + + /** + * Controls whether the task runs in a new terminal + */ + panel?: string; +} + +export interface TaskIdentifier { + type?: string; +} + +export interface LegacyTaskProperties { + /** + * @deprecated Use `isBackground` instead. + * Whether the executed command is kept alive and is watching the file system. + */ + isWatching?: boolean; + + /** + * @deprecated Use `group` instead. + * Whether this task maps to the default build command. + */ + isBuildCommand?: boolean; + + /** + * @deprecated Use `group` instead. + * Whether this task maps to the default test command. + */ + isTestCommand?: boolean; +} + +export interface LegacyCommandProperties { + + /** + * Whether this is a shell or process + */ + type?: string; + + /** + * @deprecated Use presentation options + * Controls whether the output view of the running tasks is brought to front or not. + * See BaseTaskRunnerConfiguration#showOutput for details. + */ + showOutput?: string; + + /** + * @deprecated Use presentation options + * Controls whether the executed command is printed to the output windows as well. + */ + echoCommand?: boolean; + + /** + * @deprecated Use presentation instead + */ + terminal?: PresentationOptions; + + /** + * @deprecated Use inline commands. + * See BaseTaskRunnerConfiguration#suppressTaskName for details. + */ + suppressTaskName?: boolean; + + /** + * Some commands require that the task argument is highlighted with a special + * prefix (e.g. /t: for msbuild). This property can be used to control such + * a prefix. + */ + taskSelector?: string; + + /** + * @deprecated use the task type instead. + * Specifies whether the command is a shell command and therefore must + * be executed in a shell interpreter (e.g. cmd.exe, bash, ...). + * + * Defaults to false if omitted. + */ + isShellCommand?: boolean | ShellConfiguration; +} + +export interface BaseCommandProperties { + + /** + * Whether the task is a shell task or a process task. + */ + runtime?: string; + + /** + * The command to be executed. Can be an external program or a shell + * command. + */ + command?: string; + + /** + * The command options used when the command is executed. Can be omitted. + */ + options?: CommandOptions; + + /** + * The arguments passed to the command or additional arguments passed to the + * command when using a global command. + */ + args?: string[]; +} + + +export interface CommandProperties extends BaseCommandProperties { + + /** + * Windows specific command properties + */ + windows?: BaseCommandProperties; + + /** + * OSX specific command properties + */ + osx?: BaseCommandProperties; + + /** + * linux specific command properties + */ + linux?: BaseCommandProperties; +} + +export interface ConfigurationProperties { + /** + * The task's name + */ + taskName?: string; + + /** + * The UI label used for the task. + */ + label?: string; + + /** + * An optional indentifier which can be used to reference a task + * in a dependsOn or other attributes. + */ + identifier?: string; + + /** + * Whether the executed command is kept alive and runs in the background. + */ + isBackground?: boolean; + + /** + * Whether the task should prompt on close for confirmation if running. + */ + promptOnClose?: boolean; + + /** + * Defines the group the task belongs too. + */ + group?: string; + + /** + * The other tasks the task depend on + */ + dependsOn?: string | string[]; + + /** + * Controls the behavior of the used terminal + */ + presentation?: PresentationOptions; + + /** + * The problem matcher(s) to use to capture problems in the tasks + * output. + */ + problemMatcher?: ProblemMatcherConfig.ProblemMatcherType; +} + +export interface CustomTask extends CommandProperties, ConfigurationProperties { + /** + * Custom tasks have the type 'custom' + */ + type?: string; + +} + +export interface ConfiguringTask extends ConfigurationProperties { + /** + * The contributed type of the task + */ + type?: string; +} + +/** + * The base task runner configuration + */ +export interface BaseTaskRunnerConfiguration { + + /** + * The command to be executed. Can be an external program or a shell + * command. + */ + command?: string; + + /** + * Specifies whether the command is a shell command and therefore must + * be executed in a shell interpreter (e.g. cmd.exe, bash, ...). + * + * Defaults to false if omitted. + */ + isShellCommand?: boolean; + + /** + * The command options used when the command is executed. Can be omitted. + */ + options?: CommandOptions; + + /** + * The arguments passed to the command. Can be omitted. + */ + args?: string[]; + + /** + * Controls whether the output view of the running tasks is brought to front or not. + * Valid values are: + * "always": bring the output window always to front when a task is executed. + * "silent": only bring it to front if no problem matcher is defined for the task executed. + * "never": never bring the output window to front. + * + * If omitted "always" is used. + */ + showOutput?: string; + + /** + * Controls whether the executed command is printed to the output windows as well. + */ + echoCommand?: boolean; + + /** + * Controls the behavior of the used terminal + */ + presentation?: PresentationOptions; + + /** + * If set to false the task name is added as an additional argument to the + * command when executed. If set to true the task name is suppressed. If + * omitted false is used. + */ + suppressTaskName?: boolean; + + /** + * Some commands require that the task argument is highlighted with a special + * prefix (e.g. /t: for msbuild). This property can be used to control such + * a prefix. + */ + taskSelector?: string; + + /** + * The problem matcher(s) to used if a global command is exucuted (e.g. no tasks + * are defined). A tasks.json file can either contain a global problemMatcher + * property or a tasks property but not both. + */ + problemMatcher?: ProblemMatcherConfig.ProblemMatcherType; + + /** + * @deprecated Use `isBackground` instead. + * + * Specifies whether a global command is a watching the filesystem. A task.json + * file can either contain a global isWatching property or a tasks property + * but not both. + */ + isWatching?: boolean; + + /** + * Specifies whether a global command is a background task. + */ + isBackground?: boolean; + + /** + * Whether the task should prompt on close for confirmation if running. + */ + promptOnClose?: boolean; + + /** + * The configuration of the available tasks. A tasks.json file can either + * contain a global problemMatcher property or a tasks property but not both. + */ + tasks?: (CustomTask | ConfiguringTask)[]; + + /** + * Problem matcher declarations + */ + declares?: ProblemMatcherConfig.NamedProblemMatcher[]; +} + +/** + * A configuration of an external build system. BuildConfiguration.buildSystem + * must be set to 'program' + */ +export interface ExternalTaskRunnerConfiguration extends BaseTaskRunnerConfiguration { + + _runner?: string; + + /** + * Determines the runner to use + */ + runner?: string; + + /** + * The config's version number + */ + version: string; + + /** + * Windows specific task configuration + */ + windows?: BaseTaskRunnerConfiguration; + + /** + * Mac specific task configuration + */ + osx?: BaseTaskRunnerConfiguration; + + /** + * Linux speciif task configuration + */ + linux?: BaseTaskRunnerConfiguration; +} + +enum ProblemMatcherKind { + Unknown, + String, + ProblemMatcher, + Array +} + +const EMPTY_ARRAY: any[] = []; +Object.freeze(EMPTY_ARRAY); + +function assignProperty(target: T, source: Partial, key: K) { + if (source[key] !== void 0) { + target[key] = source[key]; + } +} + +function fillProperty(target: T, source: Partial, key: K) { + if (target[key] === void 0 && source[key] !== void 0) { + target[key] = source[key]; + } +} + + +interface ParserType { + isEmpty(value: T): boolean; + assignProperties(target: T, source: T): T; + fillProperties(target: T, source: T): T; + fillDefaults(value: T, context: ParseContext): T; + freeze(value: T): Readonly; +} + +interface MetaData { + property: keyof T; + type?: ParserType; +} + + +function _isEmpty(this: void, value: T, properties: MetaData[]): boolean { + if (value === void 0 || value === null) { + return true; + } + for (let meta of properties) { + let property = value[meta.property]; + if (property !== void 0 && property !== null) { + if (meta.type !== void 0 && !meta.type.isEmpty(property)) { + return false; + } else if (!Array.isArray(property) || property.length > 0) { + return false; + } + } + } + return true; +} + +function _assignProperties(this: void, target: T, source: T, properties: MetaData[]): T { + if (_isEmpty(source, properties)) { + return target; + } + if (_isEmpty(target, properties)) { + return source; + } + for (let meta of properties) { + let property = meta.property; + let value: any; + if (meta.type !== void 0) { + value = meta.type.assignProperties(target[property], source[property]); + } else { + value = source[property]; + } + if (value !== void 0 && value !== null) { + target[property] = value; + } + } + return target; +} + +function _fillProperties(this: void, target: T, source: T, properties: MetaData[]): T { + if (_isEmpty(source, properties)) { + return target; + } + if (_isEmpty(target, properties)) { + return source; + } + for (let meta of properties) { + let property = meta.property; + let value: any; + if (meta.type) { + value = meta.type.fillProperties(target[property], source[property]); + } else if (target[property] === void 0) { + value = source[property]; + } + if (value !== void 0 && value !== null) { + target[property] = value; + } + } + return target; +} + +function _fillDefaults(this: void, target: T, defaults: T, properties: MetaData[], context: ParseContext): T { + if (target && Object.isFrozen(target)) { + return target; + } + if (target === void 0 || target === null) { + if (defaults !== void 0 && defaults !== null) { + return Objects.deepClone(defaults); + } else { + return undefined; + } + } + for (let meta of properties) { + let property = meta.property; + if (target[property] !== void 0) { + continue; + } + let value: any; + if (meta.type) { + value = meta.type.fillDefaults(target[property], context); + } else { + value = defaults[property]; + } + + if (value !== void 0 && value !== null) { + target[property] = value; + } + } + return target; +} + +function _freeze(this: void, target: T, properties: MetaData[]): Readonly { + if (target === void 0 || target === null) { + return undefined; + } + if (Object.isFrozen(target)) { + return target; + } + for (let meta of properties) { + if (meta.type) { + let value = target[meta.property]; + if (value) { + meta.type.freeze(value); + } + } + } + Object.freeze(target); + return target; +} + +interface ParseContext { + problemReporter: IProblemReporter; + namedProblemMatchers: IStringDictionary; + uuidMap: UUIDMap; + engine: Tasks.ExecutionEngine; + schemaVersion: Tasks.JsonSchemaVersion; + taskConfigurations: boolean; +} + + +namespace ShellConfiguration { + + const properties: MetaData[] = [{ property: 'executable' }, { property: 'args' }]; + + export function is(value: any): value is ShellConfiguration { + let candidate: ShellConfiguration = value; + return candidate && Types.isString(candidate.executable) && (candidate.args === void 0 || Types.isStringArray(candidate.args)); + } + + export function from(this: void, config: ShellConfiguration, context: ParseContext): Tasks.ShellConfiguration { + if (!is(config)) { + return undefined; + } + let result: ShellConfiguration = { executable: config.executable }; + if (config.args !== void 0) { + result.args = config.args.slice(); + } + return result; + } + + export function isEmpty(this: void, value: Tasks.ShellConfiguration): boolean { + return _isEmpty(value, properties); + } + + export function assignProperties(this: void, target: Tasks.ShellConfiguration, source: Tasks.ShellConfiguration): Tasks.ShellConfiguration { + return _assignProperties(target, source, properties); + } + + export function fillProperties(this: void, target: Tasks.ShellConfiguration, source: Tasks.ShellConfiguration): Tasks.ShellConfiguration { + return _fillProperties(target, source, properties); + } + + export function fillDefaults(this: void, value: Tasks.ShellConfiguration, context: ParseContext): Tasks.ShellConfiguration { + return value; + } + + export function freeze(this: void, value: Tasks.ShellConfiguration): Readonly { + if (!value) { + return undefined; + } + return Object.freeze(value); + } +} + +namespace CommandOptions { + + const properties: MetaData[] = [{ property: 'cwd' }, { property: 'env' }, { property: 'shell', type: ShellConfiguration }]; + const defaults: CommandOptions = { cwd: '${workspaceRoot}' }; + + export function from(this: void, options: CommandOptions, context: ParseContext): Tasks.CommandOptions { + let result: Tasks.CommandOptions = {}; + if (options.cwd !== void 0) { + if (Types.isString(options.cwd)) { + result.cwd = options.cwd; + } else { + context.problemReporter.warn(nls.localize('ConfigurationParser.invalidCWD', 'Warning: options.cwd must be of type string. Ignoring value {0}\n', options.cwd)); + } + } + if (options.env !== void 0) { + result.env = Objects.clone(options.env); + } + result.shell = ShellConfiguration.from(options.shell, context); + return isEmpty(result) ? undefined : result; + } + + export function isEmpty(value: Tasks.CommandOptions): boolean { + return _isEmpty(value, properties); + } + + export function assignProperties(target: Tasks.CommandOptions, source: Tasks.CommandOptions): Tasks.CommandOptions { + if (isEmpty(source)) { + return target; + } + if (isEmpty(target)) { + return source; + } + assignProperty(target, source, 'cwd'); + if (target.env === void 0) { + target.env = source.env; + } else if (source.env !== void 0) { + let env: { [key: string]: string; } = Object.create(null); + Object.keys(target.env).forEach(key => env[key] = target.env[key]); + Object.keys(source.env).forEach(key => env[key] = source.env[key]); + target.env = env; + } + target.shell = ShellConfiguration.assignProperties(target.shell, source.shell); + return target; + } + + export function fillProperties(target: Tasks.CommandOptions, source: Tasks.CommandOptions): Tasks.CommandOptions { + return _fillProperties(target, source, properties); + } + + export function fillDefaults(value: Tasks.CommandOptions, context: ParseContext): Tasks.CommandOptions { + return _fillDefaults(value, defaults, properties, context); + } + + export function freeze(value: Tasks.CommandOptions): Readonly { + return _freeze(value, properties); + } +} + +namespace CommandConfiguration { + + export namespace PresentationOptions { + const properties: MetaData[] = [{ property: 'echo' }, { property: 'reveal' }, { property: 'focus' }, { property: 'panel' }]; + + interface PresentationOptionsShape extends LegacyCommandProperties { + presentation?: PresentationOptions; + } + + export function from(this: void, config: PresentationOptionsShape, context: ParseContext): Tasks.PresentationOptions { + let echo: boolean; + let reveal: Tasks.RevealKind; + let focus: boolean; + let panel: Tasks.PanelKind; + if (Types.isBoolean(config.echoCommand)) { + echo = config.echoCommand; + } + if (Types.isString(config.showOutput)) { + reveal = Tasks.RevealKind.fromString(config.showOutput); + } + let presentation = config.presentation || config.terminal; + if (presentation) { + if (Types.isBoolean(presentation.echo)) { + echo = presentation.echo; + } + if (Types.isString(presentation.reveal)) { + reveal = Tasks.RevealKind.fromString(presentation.reveal); + } + if (Types.isBoolean(presentation.focus)) { + focus = presentation.focus; + } + if (Types.isString(presentation.panel)) { + panel = Tasks.PanelKind.fromString(presentation.panel); + } + } + if (echo === void 0 && reveal === void 0 && focus === void 0 && panel === void 0) { + return undefined; + } + return { echo, reveal, focus, panel }; + } + + export function assignProperties(target: Tasks.PresentationOptions, source: Tasks.PresentationOptions): Tasks.PresentationOptions { + return _assignProperties(target, source, properties); + } + + export function fillProperties(target: Tasks.PresentationOptions, source: Tasks.PresentationOptions): Tasks.PresentationOptions { + return _fillProperties(target, source, properties); + } + + export function fillDefaults(value: Tasks.PresentationOptions, context: ParseContext): Tasks.PresentationOptions { + let defaultEcho = context.engine === Tasks.ExecutionEngine.Terminal ? true : false; + return _fillDefaults(value, { echo: defaultEcho, reveal: Tasks.RevealKind.Always, focus: false, panel: Tasks.PanelKind.Shared }, properties, context); + } + + export function freeze(value: Tasks.PresentationOptions): Readonly { + return _freeze(value, properties); + } + + export function isEmpty(this: void, value: Tasks.PresentationOptions): boolean { + return _isEmpty(value, properties); + } + } + + interface BaseCommandConfiguationShape extends BaseCommandProperties, LegacyCommandProperties { + } + + interface CommandConfiguationShape extends BaseCommandConfiguationShape { + windows?: BaseCommandConfiguationShape; + osx?: BaseCommandConfiguationShape; + linux?: BaseCommandConfiguationShape; + } + + const properties: MetaData[] = [ + { property: 'runtime' }, { property: 'name' }, { property: 'options', type: CommandOptions }, + { property: 'args' }, { property: 'taskSelector' }, { property: 'suppressTaskName' }, + { property: 'presentation', type: PresentationOptions } + ]; + + export function from(this: void, config: CommandConfiguationShape, context: ParseContext): Tasks.CommandConfiguration { + let result: Tasks.CommandConfiguration = fromBase(config, context); + + let osConfig: Tasks.CommandConfiguration = undefined; + if (config.windows && Platform.platform === Platform.Platform.Windows) { + osConfig = fromBase(config.windows, context); + } else if (config.osx && Platform.platform === Platform.Platform.Mac) { + osConfig = fromBase(config.osx, context); + } else if (config.linux && Platform.platform === Platform.Platform.Linux) { + osConfig = fromBase(config.linux, context); + } + if (osConfig) { + result = assignProperties(result, osConfig); + } + return isEmpty(result) ? undefined : result; + } + + function fromBase(this: void, config: BaseCommandConfiguationShape, context: ParseContext): Tasks.CommandConfiguration { + let result: Tasks.CommandConfiguration = { + name: undefined, + runtime: undefined, + presentation: undefined + }; + if (Types.isString(config.command)) { + result.name = config.command; + } + if (Types.isString(config.type)) { + if (config.type === 'shell' || config.type === 'process') { + result.runtime = Tasks.RuntimeType.fromString(config.type); + } + } + let isShellConfiguration = ShellConfiguration.is(config.isShellCommand); + if (Types.isBoolean(config.isShellCommand) || isShellConfiguration) { + result.runtime = Tasks.RuntimeType.Shell; + } else if (config.isShellCommand !== void 0) { + result.runtime = !!config.isShellCommand ? Tasks.RuntimeType.Shell : Tasks.RuntimeType.Process; + } + if (Types.isString(config.runtime)) { + result.runtime = Tasks.RuntimeType.fromString(config.runtime); + } + if (config.args !== void 0) { + if (Types.isStringArray(config.args)) { + result.args = config.args.slice(0); + } else { + context.problemReporter.fatal(nls.localize('ConfigurationParser.noargs', 'Error: command arguments must be an array of strings. Provided value is:\n{0}', config.args ? JSON.stringify(config.args, undefined, 4) : 'undefined')); + } + } + if (config.options !== void 0) { + result.options = CommandOptions.from(config.options, context); + if (result.options && result.options.shell === void 0 && isShellConfiguration) { + result.options.shell = ShellConfiguration.from(config.isShellCommand as ShellConfiguration, context); + if (context.engine !== Tasks.ExecutionEngine.Terminal) { + context.problemReporter.warn(nls.localize('ConfigurationParser.noShell', 'Warning: shell configuration is only supported when executing tasks in the terminal.')); + } + } + } + let panel = PresentationOptions.from(config, context); + if (panel) { + result.presentation = panel; + } + if (Types.isString(config.taskSelector)) { + result.taskSelector = config.taskSelector; + } + if (Types.isBoolean(config.suppressTaskName)) { + result.suppressTaskName = config.suppressTaskName; + } + return isEmpty(result) ? undefined : result; + } + + export function isEmpty(value: Tasks.CommandConfiguration): boolean { + return _isEmpty(value, properties); + } + + export function onlyTerminalBehaviour(value: Tasks.CommandConfiguration): boolean { + return value && + value.presentation && (value.presentation.echo !== void 0 || value.presentation.reveal !== void 0) && + value.name === void 0 && value.runtime === void 0 && value.args === void 0 && CommandOptions.isEmpty(value.options); + } + + export function assignProperties(target: Tasks.CommandConfiguration, source: Tasks.CommandConfiguration): Tasks.CommandConfiguration { + if (isEmpty(source)) { + return target; + } + if (isEmpty(target)) { + return source; + } + assignProperty(target, source, 'name'); + assignProperty(target, source, 'runtime'); + assignProperty(target, source, 'taskSelector'); + assignProperty(target, source, 'suppressTaskName'); + if (source.args !== void 0) { + if (target.args === void 0) { + target.args = source.args; + } else { + target.args = target.args.concat(source.args); + } + } + target.presentation = PresentationOptions.assignProperties(target.presentation, source.presentation); + target.options = CommandOptions.assignProperties(target.options, source.options); + return target; + } + + export function fillProperties(target: Tasks.CommandConfiguration, source: Tasks.CommandConfiguration): Tasks.CommandConfiguration { + return _fillProperties(target, source, properties); + } + + export function fillGlobals(target: Tasks.CommandConfiguration, source: Tasks.CommandConfiguration, taskName: string): Tasks.CommandConfiguration { + if (isEmpty(source)) { + return target; + } + target = target || { + name: undefined, + runtime: undefined, + presentation: undefined + }; + fillProperty(target, source, 'name'); + fillProperty(target, source, 'runtime'); + fillProperty(target, source, 'taskSelector'); + fillProperty(target, source, 'suppressTaskName'); + + target.presentation = PresentationOptions.fillProperties(target.presentation, source.presentation); + target.options = CommandOptions.fillProperties(target.options, source.options); + + let args: string[] = source.args ? source.args.slice() : []; + if (!target.suppressTaskName) { + if (target.taskSelector !== void 0) { + args.push(target.taskSelector + taskName); + } else { + args.push(taskName); + } + } + if (target.args) { + args = args.concat(target.args); + } + target.args = args; + return target; + } + + export function fillDefaults(value: Tasks.CommandConfiguration, context: ParseContext): void { + if (!value || Object.isFrozen(value)) { + return; + } + if (value.name !== void 0 && value.runtime === void 0) { + value.runtime = Tasks.RuntimeType.Process; + } + value.presentation = PresentationOptions.fillDefaults(value.presentation, context); + if (!isEmpty(value)) { + value.options = CommandOptions.fillDefaults(value.options, context); + } + if (value.args === void 0) { + value.args = EMPTY_ARRAY; + } + if (value.suppressTaskName === void 0) { + value.suppressTaskName = false; + } + } + + export function freeze(value: Tasks.CommandConfiguration): Readonly { + return _freeze(value, properties); + } +} + +namespace ProblemMatcherConverter { + + export function namedFrom(this: void, declares: ProblemMatcherConfig.NamedProblemMatcher[], context: ParseContext): IStringDictionary { + let result: IStringDictionary = Object.create(null); + + if (!Types.isArray(declares)) { + return result; + } + (declares).forEach((value) => { + let namedProblemMatcher = (new ProblemMatcherParser(context.problemReporter)).parse(value); + if (isNamedProblemMatcher(namedProblemMatcher)) { + result[namedProblemMatcher.name] = namedProblemMatcher; + } else { + context.problemReporter.error(nls.localize('ConfigurationParser.noName', 'Error: Problem Matcher in declare scope must have a name:\n{0}\n', JSON.stringify(value, undefined, 4))); + } + }); + return result; + } + + export function from(this: void, config: ProblemMatcherConfig.ProblemMatcherType, context: ParseContext): ProblemMatcher[] { + let result: ProblemMatcher[] = []; + if (config === void 0) { + return result; + } + let kind = getProblemMatcherKind(config); + if (kind === ProblemMatcherKind.Unknown) { + context.problemReporter.warn(nls.localize( + 'ConfigurationParser.unknownMatcherKind', + 'Warning: the defined problem matcher is unknown. Supported types are string | ProblemMatcher | (string | ProblemMatcher)[].\n{0}\n', + JSON.stringify(config, null, 4))); + return result; + } else if (kind === ProblemMatcherKind.String || kind === ProblemMatcherKind.ProblemMatcher) { + let matcher = resolveProblemMatcher(config as ProblemMatcherConfig.ProblemMatcher, context); + if (matcher) { + result.push(matcher); + } + } else if (kind === ProblemMatcherKind.Array) { + let problemMatchers = <(string | ProblemMatcherConfig.ProblemMatcher)[]>config; + problemMatchers.forEach(problemMatcher => { + let matcher = resolveProblemMatcher(problemMatcher, context); + if (matcher) { + result.push(matcher); + } + }); + } + return result; + } + + function getProblemMatcherKind(this: void, value: ProblemMatcherConfig.ProblemMatcherType): ProblemMatcherKind { + if (Types.isString(value)) { + return ProblemMatcherKind.String; + } else if (Types.isArray(value)) { + return ProblemMatcherKind.Array; + } else if (!Types.isUndefined(value)) { + return ProblemMatcherKind.ProblemMatcher; + } else { + return ProblemMatcherKind.Unknown; + } + } + + function resolveProblemMatcher(this: void, value: string | ProblemMatcherConfig.ProblemMatcher, context: ParseContext): ProblemMatcher { + if (Types.isString(value)) { + let variableName = value; + if (variableName.length > 1 && variableName[0] === '$') { + variableName = variableName.substring(1); + let global = ProblemMatcherRegistry.get(variableName); + if (global) { + return Objects.clone(global); + } + let localProblemMatcher = context.namedProblemMatchers[variableName]; + if (localProblemMatcher) { + localProblemMatcher = Objects.clone(localProblemMatcher); + // remove the name + delete localProblemMatcher.name; + return localProblemMatcher; + } + } + context.problemReporter.error(nls.localize('ConfigurationParser.invalidVaraibleReference', 'Error: Invalid problemMatcher reference: {0}\n', value)); + return undefined; + } else { + let json = value; + return new ProblemMatcherParser(context.problemReporter).parse(json); + } + } +} + +namespace TaskIdentifier { + export function from(this: void, value: TaskIdentifier): Tasks.TaskIdentifier { + if (!value || !Types.isString(value.type)) { + return undefined; + } + const hash = crypto.createHash('md5'); + hash.update(JSON.stringify(value)); + let key = hash.digest('hex'); + let result: Tasks.TaskIdentifier = { + _key: key, + type: value.type + }; + result = Objects.assign(result, value); + return result; + } +} + +const source: Tasks.TaskSource = { + kind: Tasks.TaskSourceKind.Workspace, + label: 'Workspace', + detail: '.settins\\tasks.json' +}; + +namespace ConfigurationProperties { + + const properties: MetaData[] = [ + { property: 'name' }, { property: 'identifier' }, { property: 'group' }, { property: 'isBackground' }, + { property: 'promptOnClose' }, { property: 'dependsOn' }, + { property: 'presentation', type: CommandConfiguration.PresentationOptions }, { property: 'problemMatchers' } + ]; + + export function from(this: void, external: ConfigurationProperties, context: ParseContext, includePresentation): Tasks.ConfigurationProperties { + if (!external) { + return undefined; + } + let result: Tasks.ConfigurationProperties = {}; + if (Types.isString(external.taskName)) { + result.name = external.taskName; + } + if (Types.isString(external.label) && context.schemaVersion === Tasks.JsonSchemaVersion.V2_0_0) { + result.name = external.label; + } + if (Types.isString(external.identifier)) { + result.identifier = external.identifier; + } + if (external.isBackground !== void 0) { + result.isBackground = !!external.isBackground; + } + if (external.promptOnClose !== void 0) { + result.promptOnClose = !!external.promptOnClose; + } + if (Tasks.TaskGroup.is(external.group)) { + result.group = external.group; + } + if (external.dependsOn !== void 0) { + if (Types.isString(external.dependsOn)) { + result.dependsOn = [external.dependsOn]; + } else if (Types.isStringArray(external.dependsOn)) { + result.dependsOn = external.dependsOn.slice(); + } + } + if (includePresentation && (external.presentation !== void 0 || (external as LegacyCommandProperties).terminal !== void 0)) { + result.presentation = CommandConfiguration.PresentationOptions.from(external, context); + } + if (external.problemMatcher) { + result.problemMatchers = ProblemMatcherConverter.from(external.problemMatcher, context); + } + return isEmpty(result) ? undefined : result; + } + + export function isEmpty(this: void, value: Tasks.ConfigurationProperties): boolean { + return _isEmpty(value, properties); + } +} + +namespace ConfiguringTask { + + const grunt = 'grunt.'; + const jake = 'jake.'; + const gulp = 'gulp.'; + const npm = 'vscode.npm.'; + const typescript = 'vscode.typescript.'; + + interface CustomizeShape { + customize: string; + } + + export function from(this: void, external: ConfiguringTask, context: ParseContext): Tasks.ConfiguringTask { + if (!external) { + return undefined; + } + let type = external.type; + let customize = (external as CustomizeShape).customize; + if (!type && !customize) { + context.problemReporter.fatal(nls.localize('ConfigurationParser.noTaskType', 'Error: tasks configuration must have a type property. The configuration will be ignored.\n{0}\n', JSON.stringify(external, null, 4))); + return undefined; + } + let typeDeclaration = TaskTypeRegistry.get(type); + let identifier: TaskIdentifier; + if (Types.isString(customize)) { + if (customize.indexOf(grunt) === 0) { + identifier = { type: 'grunt', task: customize.substring(grunt.length) } as TaskIdentifier; + } else if (customize.indexOf(jake) === 0) { + identifier = { type: 'jake', task: customize.substring(jake.length) } as TaskIdentifier; + } else if (customize.indexOf(gulp) === 0) { + identifier = { type: 'gulp', task: customize.substring(gulp.length) } as TaskIdentifier; + } else if (customize.indexOf(npm) === 0) { + identifier = { type: 'npm', script: customize.substring(npm.length + 4) } as TaskIdentifier; + } else if (customize.indexOf(typescript) === 0) { + identifier = { type: 'typescript', tsconfig: customize.substring(typescript.length + 6) } as TaskIdentifier; + } + } else { + identifier = { + type + }; + Object.keys(typeDeclaration.properties).forEach((property) => { + let value = external[property]; + if (value !== void 0 && value !== null) { + identifier[property] = value; + } + }); + } + let taskIdentifier = TaskIdentifier.from(identifier); + let result: Tasks.ConfiguringTask = { + type: type, + configures: taskIdentifier, + _id: taskIdentifier._key, + _source: source, + _label: undefined + }; + let configuration = ConfigurationProperties.from(external, context, true); + if (configuration) { + result = Objects.assign(result, configuration); + if (result.name) { + result._label = result.name; + } else { + let label = result.configures.type; + if (typeDeclaration.required && typeDeclaration.required.length > 0) { + for (let required of typeDeclaration.required) { + let value = result.configures[required]; + if (value) { + label = label + ' ' + value; + break; + } + } + } + result._label = label; + } + if (!result.identifier) { + result.identifier = taskIdentifier._key; + } + } + return result; + } +} + +namespace CustomTask { + + export function from(this: void, external: CustomTask, context: ParseContext): Tasks.CustomTask { + if (!external) { + return undefined; + } + let type = external.type; + if (type === void 0 || type === null) { + type = 'custom'; + } + if (type !== 'custom' && type !== 'shell' && type !== 'process') { + context.problemReporter.fatal(nls.localize('ConfigurationParser.notCustom', 'Error: tasks is not declared as a custom task. The configuration will be ignored.\n{0}\n', JSON.stringify(external, null, 4))); + return undefined; + } + let taskName = external.taskName; + if (!taskName) { + context.problemReporter.fatal(nls.localize('ConfigurationParser.noTaskName', 'Error: tasks must provide a taskName property. The task will be ignored.\n{0}\n', JSON.stringify(external, null, 4))); + return undefined; + } + + let result: Tasks.CustomTask = { + type: 'custom', + _id: context.uuidMap.getUUID(taskName), + _source: source, + _label: taskName, + name: taskName, + identifier: taskName, + command: undefined + }; + let configuration = ConfigurationProperties.from(external, context, false); + if (configuration) { + result = Objects.assign(result, configuration); + } + let supportLegacy: boolean = true; //context.schemaVersion === Tasks.JsonSchemaVersion.V2_0_0; + if (supportLegacy) { + let legacy: LegacyTaskProperties = external as LegacyTaskProperties; + if (result.isBackground === void 0 && legacy.isWatching !== void 0) { + result.isBackground = !!legacy.isWatching; + } + if (result.group === void 0) { + if (legacy.isBuildCommand === true) { + result.group = Tasks.TaskGroup.Build; + } else if (legacy.isTestCommand === true) { + result.group = Tasks.TaskGroup.Test; + } + } + } + let command: Tasks.CommandConfiguration = CommandConfiguration.from(external, context); + if (command) { + result.command = command; + } + if (external.command !== void 0) { + // if the task has its own command then we suppress the + // task name by default. + command.suppressTaskName = true; + } + return result; + } + + export function fillGlobals(task: Tasks.CustomTask, globals: Globals): void { + // We only merge a command from a global definition if there is no dependsOn + if (task.dependsOn === void 0) { + task.command = CommandConfiguration.fillGlobals(task.command, globals.command, task.name); + } + // promptOnClose is inferred from isBackground if available + if (task.promptOnClose === void 0 && task.isBackground === void 0 && globals.promptOnClose !== void 0) { + task.promptOnClose = globals.promptOnClose; + } + } + + export function fillDefaults(task: Tasks.CustomTask, context: ParseContext): void { + CommandConfiguration.fillDefaults(task.command, context); + if (task.promptOnClose === void 0) { + task.promptOnClose = task.isBackground !== void 0 ? !task.isBackground : true; + } + if (task.isBackground === void 0) { + task.isBackground = false; + } + if (task.problemMatchers === void 0) { + task.problemMatchers = EMPTY_ARRAY; + } + } + + export function createCustomTask(contributedTask: Tasks.ContributedTask, configuredProps: Tasks.ConfigurationProperties): Tasks.CustomTask { + let result: Tasks.CustomTask = { + _id: contributedTask._id, + _source: source, + _label: configuredProps.name || contributedTask._label, + type: 'custom', + command: contributedTask.command, + name: configuredProps.name || contributedTask.name, + identifier: configuredProps.identifier || contributedTask.identifier + }; + let resultConfigProps: Tasks.ConfigurationProperties = result; + + assignProperty(resultConfigProps, configuredProps, 'group'); + assignProperty(resultConfigProps, configuredProps, 'isBackground'); + assignProperty(resultConfigProps, configuredProps, 'dependsOn'); + assignProperty(resultConfigProps, configuredProps, 'problemMatchers'); + assignProperty(resultConfigProps, configuredProps, 'promptOnClose'); + result.command.presentation = CommandConfiguration.PresentationOptions.assignProperties( + result.command.presentation, configuredProps.presentation); + + let contributedConfigProps: Tasks.ConfigurationProperties = contributedTask; + fillProperty(resultConfigProps, contributedConfigProps, 'group'); + fillProperty(resultConfigProps, contributedConfigProps, 'isBackground'); + fillProperty(resultConfigProps, contributedConfigProps, 'dependsOn'); + fillProperty(resultConfigProps, contributedConfigProps, 'problemMatchers'); + fillProperty(resultConfigProps, contributedConfigProps, 'promptOnClose'); + result.command.presentation = CommandConfiguration.PresentationOptions.fillProperties( + result.command.presentation, contributedConfigProps.presentation); + + return result; + } +} + +interface TaskParseResult { + custom: Tasks.CustomTask[]; + configured: Tasks.ConfiguringTask[]; +} + +namespace TaskParser { + + function isCustomTask(value: CustomTask | ConfiguringTask): value is CustomTask { + let type = value.type; + let customize = (value as any).customize; + return customize === void 0 && (type === void 0 || type === null || type === 'custom' || type === 'shell' || type === 'process'); + } + + export function from(this: void, externals: (CustomTask | ConfiguringTask)[], globals: Globals, context: ParseContext): TaskParseResult { + let result: TaskParseResult = { custom: [], configured: [] }; + if (!externals) { + return result; + } + let defaultBuildTask: { task: Tasks.Task; rank: number; } = { task: undefined, rank: -1 }; + let defaultTestTask: { task: Tasks.Task; rank: number; } = { task: undefined, rank: -1 }; + let schema2_0_0: boolean = context.schemaVersion === Tasks.JsonSchemaVersion.V2_0_0; + + for (let external of externals) { + if (isCustomTask(external)) { + let customTask = CustomTask.from(external, context); + if (customTask) { + CustomTask.fillGlobals(customTask, globals); + CustomTask.fillDefaults(customTask, context); + if (context.engine === Tasks.ExecutionEngine.Terminal && customTask.command && customTask.command.name && customTask.command.runtime === Tasks.RuntimeType.Shell && customTask.command.args && customTask.command.args.length > 0) { + if (hasUnescapedSpaces(customTask.command.name) || customTask.command.args.some(hasUnescapedSpaces)) { + context.problemReporter.warn( + nls.localize( + 'taskConfiguration.shellArgs', + 'Warning: the task \'{0}\' is a shell command and either the command name or one of its arguments has unescaped spaces. To ensure correct command line quoting please merge args into the command.', + customTask.name + ) + ); + } + } + if (schema2_0_0) { + if ((customTask.command === void 0 || customTask.command.name === void 0) && (customTask.dependsOn === void 0 || customTask.dependsOn.length === 0)) { + context.problemReporter.error(nls.localize( + 'taskConfiguration.noCommandOrDependsOn', 'Error: the task \'{0}\' neither specifies a command nor a dependsOn property. The task will be ignored. Its definition is:\n{1}', + customTask.name, JSON.stringify(external, undefined, 4) + )); + continue; + } + } else { + if (customTask.command === void 0 || customTask.command.name === void 0) { + context.problemReporter.warn(nls.localize( + 'taskConfiguration.noCommand', 'Error: the task \'{0}\' doesn\'t define a command. The task will be ignored. Its definition is:\n{1}', + customTask.name, JSON.stringify(external, undefined, 4) + )); + continue; + } + } + if (customTask.group === Tasks.TaskGroup.Build && defaultBuildTask.rank < 2) { + defaultBuildTask.task = customTask; + defaultBuildTask.rank = 2; + } else if (customTask.group === Tasks.TaskGroup.Test && defaultTestTask.rank < 2) { + defaultTestTask.task = customTask; + defaultTestTask.rank = 2; + } else if (customTask.name === 'build' && defaultBuildTask.rank < 1) { + defaultBuildTask.task = customTask; + defaultBuildTask.rank = 1; + } else if (customTask.name === 'test' && defaultTestTask.rank < 1) { + defaultTestTask.task = customTask; + defaultTestTask.rank = 1; + } + result.custom.push(customTask); + } + } else { + let configuredTask = ConfiguringTask.from(external, context); + if (configuredTask) { + result.configured.push(configuredTask); + } + } + } + if (defaultBuildTask.rank > -1 && defaultBuildTask.rank < 2) { + defaultBuildTask.task.group = Tasks.TaskGroup.Build; + } else if (defaultTestTask.rank > -1 && defaultTestTask.rank < 2) { + defaultTestTask.task.group = Tasks.TaskGroup.Test; + } + + return result; + } + + export function assignTasks(target: Tasks.CustomTask[], source: Tasks.CustomTask[]): Tasks.CustomTask[] { + if (source === void 0 || source.length === 0) { + return target; + } + if (target === void 0 || target.length === 0) { + return source; + } + + if (source) { + // Tasks are keyed by ID but we need to merge by name + let map: IStringDictionary = Object.create(null); + target.forEach((task) => { + map[task.name] = task; + }); + + source.forEach((task) => { + map[task.name] = task; + }); + let newTarget: Tasks.CustomTask[] = []; + target.forEach(task => { + newTarget.push(map[task.name]); + delete map[task.name]; + }); + Object.keys(map).forEach(key => newTarget.push(map[key])); + target = newTarget; + } + return target; + } + + function hasUnescapedSpaces(value: string): boolean { + if (Platform.isWindows) { + if (value.length >= 2 && value.charAt(0) === '"' && value.charAt(value.length - 1) === '"') { + return false; + } + return value.indexOf(' ') !== -1; + } else { + if (value.length >= 2 && ((value.charAt(0) === '"' && value.charAt(value.length - 1) === '"') || (value.charAt(0) === '\'' && value.charAt(value.length - 1) === '\''))) { + return false; + } + for (let i = 0; i < value.length; i++) { + let ch = value.charAt(i); + if (ch === ' ') { + if (i === 0 || value.charAt(i - 1) !== '\\') { + return true; + } + } + } + return false; + } + } +} + +interface Globals { + command?: Tasks.CommandConfiguration; + promptOnClose?: boolean; + suppressTaskName?: boolean; +} + +namespace Globals { + + export function from(config: ExternalTaskRunnerConfiguration, context: ParseContext): Globals { + let result = fromBase(config, context); + let osGlobals: Globals = undefined; + if (config.windows && Platform.platform === Platform.Platform.Windows) { + osGlobals = fromBase(config.windows, context); + } else if (config.osx && Platform.platform === Platform.Platform.Mac) { + osGlobals = fromBase(config.osx, context); + } else if (config.linux && Platform.platform === Platform.Platform.Linux) { + osGlobals = fromBase(config.linux, context); + } + if (osGlobals) { + result = Globals.assignProperties(result, osGlobals); + } + let command = CommandConfiguration.from(config, context); + if (command) { + result.command = command; + } + Globals.fillDefaults(result, context); + Globals.freeze(result); + return result; + } + + export function fromBase(this: void, config: BaseTaskRunnerConfiguration, context: ParseContext): Globals { + let result: Globals = {}; + if (config.suppressTaskName !== void 0) { + result.suppressTaskName = !!config.suppressTaskName; + } + if (config.promptOnClose !== void 0) { + result.promptOnClose = !!config.promptOnClose; + } + return result; + } + + export function isEmpty(value: Globals): boolean { + return !value || value.command === void 0 && value.promptOnClose === void 0 && value.suppressTaskName === void 0; + } + + export function assignProperties(target: Globals, source: Globals): Globals { + if (isEmpty(source)) { + return target; + } + if (isEmpty(target)) { + return source; + } + assignProperty(target, source, 'promptOnClose'); + assignProperty(target, source, 'suppressTaskName'); + return target; + } + + export function fillDefaults(value: Globals, context: ParseContext): void { + if (!value) { + return; + } + CommandConfiguration.fillDefaults(value.command, context); + if (value.suppressTaskName === void 0) { + value.suppressTaskName = false; + } + if (value.promptOnClose === void 0) { + value.promptOnClose = true; + } + } + + export function freeze(value: Globals): void { + Object.freeze(value); + if (value.command) { + CommandConfiguration.freeze(value.command); + } + } +} + +export namespace ExecutionEngine { + + export function from(config: ExternalTaskRunnerConfiguration): Tasks.ExecutionEngine { + let runner = config.runner || config._runner; + let result: Tasks.ExecutionEngine; + if (runner) { + switch (runner) { + case 'terminal': + result = Tasks.ExecutionEngine.Terminal; + break; + case 'process': + result = Tasks.ExecutionEngine.Process; + break; + } + } + let schemaVersion = JsonSchemaVersion.from(config); + if (schemaVersion === Tasks.JsonSchemaVersion.V0_1_0) { + return result || Tasks.ExecutionEngine.Process; + } else if (schemaVersion === Tasks.JsonSchemaVersion.V2_0_0) { + return Tasks.ExecutionEngine.Terminal; + } else { + throw new Error('Shouldn\'t happen.'); + } + } +} + +export namespace JsonSchemaVersion { + + const _default: Tasks.JsonSchemaVersion = Tasks.JsonSchemaVersion.V2_0_0; + + export function from(config: ExternalTaskRunnerConfiguration): Tasks.JsonSchemaVersion { + let version = config.version; + if (!version) { + return _default; + } + switch (version) { + case '0.1.0': + return Tasks.JsonSchemaVersion.V0_1_0; + case '2.0.0': + return Tasks.JsonSchemaVersion.V2_0_0; + default: + return _default; + } + } +} + +export interface ParseResult { + validationStatus: ValidationStatus; + custom: Tasks.CustomTask[]; + configured: Tasks.ConfiguringTask[]; + engine: Tasks.ExecutionEngine; +} + +export interface IProblemReporter extends IProblemReporterBase { + clearOutput(): void; +} + +class UUIDMap { + + private last: IStringDictionary; + private current: IStringDictionary; + + constructor() { + this.current = Object.create(null); + } + + public start(): void { + this.last = this.current; + this.current = Object.create(null); + } + + public getUUID(identifier: string): string { + let lastValue = this.last[identifier]; + let result: string; + if (lastValue !== void 0) { + if (Array.isArray(lastValue)) { + result = lastValue.shift(); + if (lastValue.length === 0) { + delete this.last[identifier]; + } + } else { + result = lastValue; + delete this.last[identifier]; + } + } + if (result === void 0) { + result = UUID.generateUuid(); + } + let currentValue = this.current[identifier]; + if (currentValue === void 0) { + this.current[identifier] = result; + } else { + if (Array.isArray(currentValue)) { + currentValue.push(result); + } else { + let arrayValue: string[] = [currentValue]; + arrayValue.push(result); + this.current[identifier] = arrayValue; + } + } + return result; + } + + public finish(): void { + this.last = undefined; + } +} + +class ConfigurationParser { + + private problemReporter: IProblemReporter; + private uuidMap: UUIDMap; + + constructor(problemReporter: IProblemReporter, uuidMap: UUIDMap) { + this.problemReporter = problemReporter; + this.uuidMap = uuidMap; + } + + public run(fileConfig: ExternalTaskRunnerConfiguration): ParseResult { + let engine = ExecutionEngine.from(fileConfig); + let schemaVersion = JsonSchemaVersion.from(fileConfig); + if (engine === Tasks.ExecutionEngine.Terminal) { + this.problemReporter.clearOutput(); + } + let context: ParseContext = { + problemReporter: this.problemReporter, + uuidMap: this.uuidMap, + namedProblemMatchers: undefined, + engine, + schemaVersion, + taskConfigurations: schemaVersion !== Tasks.JsonSchemaVersion.V0_1_0 + }; + let taskParseResult = this.createTaskRunnerConfiguration(fileConfig, context); + return { + validationStatus: this.problemReporter.status, + custom: taskParseResult.custom, + configured: taskParseResult.configured, + engine + }; + } + + private createTaskRunnerConfiguration(fileConfig: ExternalTaskRunnerConfiguration, context: ParseContext): TaskParseResult { + let globals = Globals.from(fileConfig, context); + if (this.problemReporter.status.isFatal()) { + return { custom: [], configured: [] }; + } + context.namedProblemMatchers = ProblemMatcherConverter.namedFrom(fileConfig.declares, context); + let globalTasks: Tasks.CustomTask[]; + if (fileConfig.windows && Platform.platform === Platform.Platform.Windows) { + globalTasks = TaskParser.from(fileConfig.windows.tasks, globals, context).custom; + } else if (fileConfig.osx && Platform.platform === Platform.Platform.Mac) { + globalTasks = TaskParser.from(fileConfig.osx.tasks, globals, context).custom; + } else if (fileConfig.linux && Platform.platform === Platform.Platform.Linux) { + globalTasks = TaskParser.from(fileConfig.linux.tasks, globals, context).custom; + } + + let result: TaskParseResult = { custom: undefined, configured: undefined }; + if (fileConfig.tasks) { + result = TaskParser.from(fileConfig.tasks, globals, context); + } + if (globalTasks) { + result.custom = TaskParser.assignTasks(result.custom, globalTasks); + } + + if ((!result.custom || result.custom.length === 0) && (globals.command && globals.command.name)) { + let matchers: ProblemMatcher[] = ProblemMatcherConverter.from(fileConfig.problemMatcher, context); + let isBackground = fileConfig.isBackground ? !!fileConfig.isBackground : fileConfig.isWatching ? !!fileConfig.isWatching : undefined; + let task: Tasks.CustomTask = { + _id: context.uuidMap.getUUID(globals.command.name), + _source: source, + _label: globals.command.name, + type: 'custom', + name: globals.command.name, + identifier: globals.command.name, + group: Tasks.TaskGroup.Build, + command: { + name: undefined, + runtime: undefined, + presentation: undefined, + suppressTaskName: true + }, + isBackground: isBackground, + problemMatchers: matchers + }; + CustomTask.fillGlobals(task, globals); + CustomTask.fillDefaults(task, context); + result.custom = [task]; + } + result.custom = result.custom || []; + result.configured = result.configured || []; + return result; + } +} + +let uuidMap: UUIDMap = new UUIDMap(); +export function parse(configuration: ExternalTaskRunnerConfiguration, logger: IProblemReporter): ParseResult { + try { + uuidMap.start(); + return (new ConfigurationParser(logger, uuidMap)).run(configuration); + } finally { + uuidMap.finish(); + } +} + +export function createCustomTask(contributedTask: Tasks.ContributedTask, configuredProps: Tasks.ConfigurationProperties): Tasks.CustomTask { + return CustomTask.createCustomTask(contributedTask, configuredProps); +} + +export function getTaskIdentifier(value: TaskIdentifier): Tasks.TaskIdentifier { + return TaskIdentifier.from(value); +} + +/* +class VersionConverter { + constructor(private problemReporter: IProblemReporter) { + } + + public convert(fromConfig: ExternalTaskRunnerConfiguration): ExternalTaskRunnerConfiguration { + let result: ExternalTaskRunnerConfiguration; + result.version = '2.0.0'; + if (Array.isArray(fromConfig.tasks)) { + + } else { + result.tasks = []; + } + + + return result; + } + + private convertGlobalTask(fromConfig: ExternalTaskRunnerConfiguration): TaskDescription { + let command: string = this.getGlobalCommand(fromConfig); + if (!command) { + this.problemReporter.error(nls.localize('Converter.noGlobalName', 'No global command specified. Can\'t convert to 2.0.0 version.')); + return undefined; + } + let result: TaskDescription = { + taskName: command + }; + if (fromConfig.isShellCommand) { + result.type = 'shell'; + } else { + result.type = 'process'; + result.args = fromConfig.args; + } + if (fromConfig.) + + return result; + } + + private getGlobalCommand(fromConfig: ExternalTaskRunnerConfiguration): string { + if (fromConfig.command) { + return fromConfig.command; + } else if (fromConfig.windows && fromConfig.windows.command) { + return fromConfig.windows.command; + } else if (fromConfig.osx && fromConfig.osx.command) { + return fromConfig.osx.command; + } else if (fromConfig.linux && fromConfig.linux.command) { + return fromConfig.linux.command; + } else { + return undefined; + } + } + + private createCommandLine(command: string, args: string[], isWindows: boolean): string { + let result: string[]; + let commandHasSpace = false; + let argHasSpace = false; + if (TaskDescription.hasUnescapedSpaces(command)) { + result.push(`"${command}"`); + commandHasSpace = true; + } else { + result.push(command); + } + if (args) { + for (let arg of args) { + if (TaskDescription.hasUnescapedSpaces(arg)) { + result.push(`"${arg}"`); + argHasSpace= true; + } else { + result.push(arg); + } + } + } + return result.join(' '); + } + +} +*/ \ No newline at end of file diff --git a/src/vs/workbench/parts/tasks/test/node/configuration.test.ts b/src/vs/workbench/parts/tasks/test/electron-browser/configuration.test.ts similarity index 78% rename from src/vs/workbench/parts/tasks/test/node/configuration.test.ts rename to src/vs/workbench/parts/tasks/test/electron-browser/configuration.test.ts index 40ef9ddda1d874fd4bad85b8aa5cbb64abe58da0..c2a4d6826e0c6e99ab59ca76106d4749061753ee 100644 --- a/src/vs/workbench/parts/tasks/test/node/configuration.test.ts +++ b/src/vs/workbench/parts/tasks/test/electron-browser/configuration.test.ts @@ -13,7 +13,7 @@ import { ValidationStatus } from 'vs/base/common/parsers'; import { ProblemMatcher, FileLocationKind, ProblemPattern, ApplyToKind } from 'vs/platform/markers/common/problemMatcher'; import * as Tasks from 'vs/workbench/parts/tasks/common/tasks'; -import { parse, ParseResult, IProblemReporter, ExternalTaskRunnerConfiguration } from 'vs/workbench/parts/tasks/common/taskConfiguration'; +import { parse, ParseResult, IProblemReporter, ExternalTaskRunnerConfiguration, CustomTask } from 'vs/workbench/parts/tasks/node/taskConfiguration'; class ProblemReporter implements IProblemReporter { @@ -56,30 +56,75 @@ class ProblemReporter implements IProblemReporter { class ConfiguationBuilder { public result: Tasks.Task[]; + private builders: CustomTaskBuilder[]; constructor() { this.result = []; + this.builders = []; } - public task(name: string, command: string): TaskBuilder { - let builder = new TaskBuilder(this, name, command); + public task(name: string, command: string): CustomTaskBuilder { + let builder = new CustomTaskBuilder(this, name, command); + this.builders.push(builder); this.result.push(builder.result); return builder; } + + public done(): void { + for (let builder of this.builders) { + builder.done(); + } + } +} + +class PresentationBuilder { + + public result: Tasks.PresentationOptions; + + constructor(public parent: CommandConfigurationBuilder) { + this.result = { echo: false, reveal: Tasks.RevealKind.Always, focus: false, panel: Tasks.PanelKind.Shared }; + } + + public echo(value: boolean): PresentationBuilder { + this.result.echo = value; + return this; + } + + public reveal(value: Tasks.RevealKind): PresentationBuilder { + this.result.reveal = value; + return this; + } + + public focus(value: boolean): PresentationBuilder { + this.result.focus = value; + return this; + } + + public instance(value: Tasks.PanelKind): PresentationBuilder { + this.result.panel = value; + return this; + } + + public done(): void { + } } class CommandConfigurationBuilder { public result: Tasks.CommandConfiguration; - constructor(public parent: TaskBuilder, command: string) { + private presentationBuilder: PresentationBuilder; + + constructor(public parent: CustomTaskBuilder, command: string) { + this.presentationBuilder = new PresentationBuilder(this); this.result = { name: command, - isShellCommand: false, + runtime: Tasks.RuntimeType.Process, args: [], options: { cwd: '${workspaceRoot}' }, - echo: false + presentation: this.presentationBuilder.result, + suppressTaskName: false }; } @@ -88,8 +133,8 @@ class CommandConfigurationBuilder { return this; } - public shell(value: boolean): CommandConfigurationBuilder { - this.result.isShellCommand = value; + public runtime(value: Tasks.RuntimeType): CommandConfigurationBuilder { + this.result.runtime = value; return this; } @@ -103,69 +148,63 @@ class CommandConfigurationBuilder { return this; } - public echo(value: boolean): CommandConfigurationBuilder { - this.result.echo = value; + public taskSelector(value: string): CommandConfigurationBuilder { + this.result.taskSelector = value; return this; } - public taskSelector(value: string): CommandConfigurationBuilder { - this.result.taskSelector = value; + public suppressTaskName(value: boolean): CommandConfigurationBuilder { + this.result.suppressTaskName = value; return this; } + + public presentation(): PresentationBuilder { + return this.presentationBuilder; + } + + public done(taskName: string): void { + this.result.args = this.result.args.map(arg => arg === '$name' ? taskName : arg); + this.presentationBuilder.done(); + } } -class TaskBuilder { +class CustomTaskBuilder { - public result: Tasks.Task; + public result: Tasks.CustomTask; private commandBuilder: CommandConfigurationBuilder; constructor(public parent: ConfiguationBuilder, name: string, command: string) { this.commandBuilder = new CommandConfigurationBuilder(this, command); this.result = { _id: name, - _source: { kind: Tasks.TaskSourceKind.Workspace }, + _source: { kind: Tasks.TaskSourceKind.Workspace, label: 'workspace' }, + _label: name, + type: 'custom', identifier: name, name: name, command: this.commandBuilder.result, - showOutput: Tasks.ShowOutput.Always, - suppressTaskName: false, isBackground: false, promptOnClose: true, problemMatchers: [] }; } - public identifier(value: string): TaskBuilder { + public identifier(value: string): CustomTaskBuilder { this.result.identifier = value; return this; } - public group(value: Tasks.TaskGroup): TaskBuilder { + public group(value: Tasks.TaskGroup): CustomTaskBuilder { this.result.group = value; return this; } - public args(value: string[]): TaskBuilder { - this.result.args = value; - return this; - } - - public showOutput(value: Tasks.ShowOutput): TaskBuilder { - this.result.showOutput = value; - return this; - } - - public suppressTaskName(value: boolean): TaskBuilder { - this.result.suppressTaskName = value; - return this; - } - - public isBackground(value: boolean): TaskBuilder { + public isBackground(value: boolean): CustomTaskBuilder { this.result.isBackground = value; return this; } - public promptOnClose(value: boolean): TaskBuilder { + public promptOnClose(value: boolean): CustomTaskBuilder { this.result.promptOnClose = value; return this; } @@ -179,6 +218,10 @@ class TaskBuilder { public command(): CommandConfigurationBuilder { return this.commandBuilder; } + + public done(): void { + this.commandBuilder.done(this.result.name); + } } class ProblemMatcherBuilder { @@ -187,7 +230,7 @@ class ProblemMatcherBuilder { public result: ProblemMatcher; - constructor(public parent: TaskBuilder) { + constructor(public parent: CustomTaskBuilder) { this.result = { owner: ProblemMatcherBuilder.DEFAULT_UUID, applyTo: ApplyToKind.allDocuments, @@ -300,13 +343,14 @@ function testDefaultProblemMatcher(external: ExternalTaskRunnerConfiguration, re let reporter = new ProblemReporter(); let result = parse(external, reporter); assert.ok(!reporter.receivedMessage); - assert.strictEqual(result.tasks.length, 1); - let task = result.tasks[0]; + assert.strictEqual(result.custom.length, 1); + let task = result.custom[0]; assert.ok(task); assert.strictEqual(task.problemMatchers.length, resolved); } function testConfiguration(external: ExternalTaskRunnerConfiguration, builder: ConfiguationBuilder): void { + builder.done(); let reporter = new ProblemReporter(); let result = parse(external, reporter); if (reporter.receivedMessage) { @@ -358,7 +402,7 @@ class TaskGroupMap { function assertConfiguration(result: ParseResult, expected: Tasks.Task[]): void { assert.ok(result.validationStatus.isOK()); - let actual = result.tasks; + let actual = result.custom; assert.strictEqual(typeof actual, typeof expected); if (!actual) { return; @@ -401,8 +445,6 @@ function assertTask(actual: Tasks.Task, expected: Tasks.Task) { assert.ok(actual._id); assert.strictEqual(actual.name, expected.name, 'name'); assertCommandConfiguration(actual.command, expected.command); - assert.strictEqual(actual.showOutput, expected.showOutput, 'showOutput'); - assert.strictEqual(actual.suppressTaskName, expected.suppressTaskName, 'suppressTaskName'); assert.strictEqual(actual.isBackground, expected.isBackground, 'isBackground'); assert.strictEqual(actual.promptOnClose, expected.promptOnClose, 'promptOnClose'); assert.strictEqual(typeof actual.problemMatchers, typeof expected.problemMatchers); @@ -417,8 +459,11 @@ function assertTask(actual: Tasks.Task, expected: Tasks.Task) { function assertCommandConfiguration(actual: Tasks.CommandConfiguration, expected: Tasks.CommandConfiguration) { assert.strictEqual(typeof actual, typeof expected); if (actual && expected) { + assertPresentation(actual.presentation, expected.presentation); assert.strictEqual(actual.name, expected.name, 'name'); - assert.strictEqual(actual.isShellCommand, expected.isShellCommand, 'isShellCommand'); + assert.strictEqual(actual.runtime, expected.runtime, 'runtime type'); + assert.strictEqual(actual.suppressTaskName, expected.suppressTaskName, 'suppressTaskName'); + assert.strictEqual(actual.taskSelector, expected.taskSelector, 'taskSelector'); assert.deepEqual(actual.args, expected.args, 'args'); assert.strictEqual(typeof actual.options, typeof expected.options); if (actual.options && expected.options) { @@ -428,8 +473,14 @@ function assertCommandConfiguration(actual: Tasks.CommandConfiguration, expected assert.deepEqual(actual.options.env, expected.options.env, 'env'); } } - assert.strictEqual(actual.echo, expected.echo, 'echo'); - assert.strictEqual(actual.taskSelector, expected.taskSelector, 'taskSelector'); + } +} + +function assertPresentation(actual: Tasks.PresentationOptions, expected: Tasks.PresentationOptions) { + assert.strictEqual(typeof actual, typeof expected); + if (actual && expected) { + assert.strictEqual(actual.echo, expected.echo); + assert.strictEqual(actual.reveal, expected.reveal); } } @@ -490,12 +541,12 @@ function assertProblemPattern(actual: ProblemPattern, expected: ProblemPattern) assert.strictEqual(actual.loop, expected.loop); } -suite('Tasks Configuration parsing tests', () => { +suite('Tasks version 0.1.0', () => { test('tasks: all default', () => { let builder = new ConfiguationBuilder(); builder.task('tsc', 'tsc'). group(Tasks.TaskGroup.Build). - suppressTaskName(true); + command().suppressTaskName(true); testConfiguration( { version: '0.1.0', @@ -507,9 +558,8 @@ suite('Tasks Configuration parsing tests', () => { let builder = new ConfiguationBuilder(); builder.task('tsc', 'tsc'). group(Tasks.TaskGroup.Build). - suppressTaskName(true). - command(). - shell(true); + command().suppressTaskName(true). + runtime(Tasks.RuntimeType.Shell); testConfiguration( { version: '0.1.0', @@ -524,8 +574,8 @@ suite('Tasks Configuration parsing tests', () => { builder. task('tsc', 'tsc'). group(Tasks.TaskGroup.Build). - suppressTaskName(true). - showOutput(Tasks.ShowOutput.Silent); + command().suppressTaskName(true). + presentation().reveal(Tasks.RevealKind.Silent); testConfiguration( { version: '0.1.0', @@ -540,7 +590,7 @@ suite('Tasks Configuration parsing tests', () => { let builder = new ConfiguationBuilder(); builder.task('tsc', 'tsc'). group(Tasks.TaskGroup.Build). - suppressTaskName(true); + command().suppressTaskName(true); testConfiguration( { version: '0.1.0', @@ -554,9 +604,9 @@ suite('Tasks Configuration parsing tests', () => { test('tasks: global promptOnClose', () => { let builder = new ConfiguationBuilder(); builder.task('tsc', 'tsc'). - suppressTaskName(true). group(Tasks.TaskGroup.Build). - promptOnClose(false); + promptOnClose(false). + command().suppressTaskName(true); testConfiguration( { version: '0.1.0', @@ -570,10 +620,10 @@ suite('Tasks Configuration parsing tests', () => { test('tasks: global promptOnClose default watching', () => { let builder = new ConfiguationBuilder(); builder.task('tsc', 'tsc'). - suppressTaskName(true). group(Tasks.TaskGroup.Build). isBackground(true). - promptOnClose(false); + promptOnClose(false). + command().suppressTaskName(true); testConfiguration( { version: '0.1.0', @@ -589,8 +639,8 @@ suite('Tasks Configuration parsing tests', () => { builder. task('tsc', 'tsc'). group(Tasks.TaskGroup.Build). - suppressTaskName(true). - showOutput(Tasks.ShowOutput.Never); + command().suppressTaskName(true). + presentation().reveal(Tasks.RevealKind.Never); testConfiguration( { version: '0.1.0', @@ -606,8 +656,8 @@ suite('Tasks Configuration parsing tests', () => { builder. task('tsc', 'tsc'). group(Tasks.TaskGroup.Build). - suppressTaskName(true). - command(). + command().suppressTaskName(true). + presentation(). echo(true); testConfiguration( { @@ -624,8 +674,7 @@ suite('Tasks Configuration parsing tests', () => { builder. task('tsc', 'tsc'). group(Tasks.TaskGroup.Build). - suppressTaskName(true). - command(). + command().suppressTaskName(true). args(['--p']); testConfiguration( { @@ -644,8 +693,7 @@ suite('Tasks Configuration parsing tests', () => { builder. task('tsc', 'tsc'). group(Tasks.TaskGroup.Build). - suppressTaskName(true). - command(). + command().suppressTaskName(true). options({ cwd: 'myPath' }); @@ -666,8 +714,7 @@ suite('Tasks Configuration parsing tests', () => { builder. task('tsc', 'tsc'). group(Tasks.TaskGroup.Build). - suppressTaskName(true). - command(). + command().suppressTaskName(true). options({ cwd: '${workspaceRoot}', env: { key: 'value' } }); testConfiguration( { @@ -689,7 +736,7 @@ suite('Tasks Configuration parsing tests', () => { builder. task(name, name). group(Tasks.TaskGroup.Build). - suppressTaskName(true); + command().suppressTaskName(true); let external: ExternalTaskRunnerConfiguration = { version: '0.1.0', command: 'tsc', @@ -706,9 +753,8 @@ suite('Tasks Configuration parsing tests', () => { builder. task(name, name). group(Tasks.TaskGroup.Build). - suppressTaskName(true). - command(). - shell(true); + command().suppressTaskName(true). + runtime(Tasks.RuntimeType.Shell); let external: ExternalTaskRunnerConfiguration = { version: '0.1.0', command: 'tsc', @@ -726,7 +772,7 @@ suite('Tasks Configuration parsing tests', () => { builder. task(name, name). group(Tasks.TaskGroup.Build). - suppressTaskName(true); + command().suppressTaskName(true); let external: ExternalTaskRunnerConfiguration = { version: '0.1.0', command: 'tsc', @@ -743,7 +789,7 @@ suite('Tasks Configuration parsing tests', () => { builder. task(name, name). group(Tasks.TaskGroup.Build). - suppressTaskName(true); + command().suppressTaskName(true); let external: ExternalTaskRunnerConfiguration = { version: '0.1.0', command: 'tsc', @@ -759,8 +805,8 @@ suite('Tasks Configuration parsing tests', () => { builder. task('tsc', 'tsc'). group(Tasks.TaskGroup.Build). - showOutput(Platform.isWindows ? Tasks.ShowOutput.Always : Tasks.ShowOutput.Never). - suppressTaskName(true); + command().suppressTaskName(true). + presentation().reveal(Platform.isWindows ? Tasks.RevealKind.Always : Tasks.RevealKind.Never); let external: ExternalTaskRunnerConfiguration = { version: '0.1.0', command: 'tsc', @@ -777,8 +823,8 @@ suite('Tasks Configuration parsing tests', () => { builder. task('tsc', 'tsc'). group(Tasks.TaskGroup.Build). - suppressTaskName(true). - command(). + command().suppressTaskName(true). + presentation(). echo(Platform.isWindows ? false : true); let external: ExternalTaskRunnerConfiguration = { version: '0.1.0', @@ -820,7 +866,7 @@ suite('Tasks Configuration parsing tests', () => { ] }; let builder = new ConfiguationBuilder(); - builder.task('taskName', 'tsc'); + builder.task('taskName', 'tsc').command().args(['$name']); testConfiguration(external, builder); }); @@ -832,11 +878,11 @@ suite('Tasks Configuration parsing tests', () => { { taskName: 'taskName', isBuildCommand: true - } + } as CustomTask ] }; let builder = new ConfiguationBuilder(); - builder.task('taskName', 'tsc').group(Tasks.TaskGroup.Build); + builder.task('taskName', 'tsc').group(Tasks.TaskGroup.Build).command().args(['$name']); testConfiguration(external, builder); }); @@ -851,7 +897,7 @@ suite('Tasks Configuration parsing tests', () => { ] }; let builder = new ConfiguationBuilder(); - builder.task('build', 'tsc').group(Tasks.TaskGroup.Build); + builder.task('build', 'tsc').group(Tasks.TaskGroup.Build).command().args(['$name']); testConfiguration(external, builder); }); @@ -863,11 +909,11 @@ suite('Tasks Configuration parsing tests', () => { { taskName: 'taskName', isTestCommand: true - } + } as CustomTask ] }; let builder = new ConfiguationBuilder(); - builder.task('taskName', 'tsc').group(Tasks.TaskGroup.Test); + builder.task('taskName', 'tsc').group(Tasks.TaskGroup.Test).command().args(['$name']); testConfiguration(external, builder); }); @@ -882,7 +928,7 @@ suite('Tasks Configuration parsing tests', () => { ] }; let builder = new ConfiguationBuilder(); - builder.task('test', 'tsc').group(Tasks.TaskGroup.Test); + builder.task('test', 'tsc').group(Tasks.TaskGroup.Test).command().args(['$name']); testConfiguration(external, builder); }); @@ -897,18 +943,17 @@ suite('Tasks Configuration parsing tests', () => { echoCommand: true, args: ['--p'], isWatching: true - } + } as CustomTask ] }; let builder = new ConfiguationBuilder(); builder.task('test', 'tsc'). group(Tasks.TaskGroup.Test). - showOutput(Tasks.ShowOutput.Never). - args(['--p']). isBackground(true). promptOnClose(false). - command(). - echo(true); + command().args(['$name', '--p']). + presentation(). + echo(true).reveal(Tasks.RevealKind.Never); testConfiguration(external, builder); }); @@ -928,9 +973,8 @@ suite('Tasks Configuration parsing tests', () => { let builder = new ConfiguationBuilder(); builder.task('test', 'tsc'). group(Tasks.TaskGroup.Test). - showOutput(Tasks.ShowOutput.Never). - command(). - echo(true); + command().args(['$name']).presentation(). + echo(true).reveal(Tasks.RevealKind.Never); testConfiguration(external, builder); }); @@ -951,7 +995,9 @@ suite('Tasks Configuration parsing tests', () => { ] }; let builder = new ConfiguationBuilder(); - builder.task('taskName', 'tsc').problemMatcher().pattern(/abc/); + builder.task('taskName', 'tsc'). + command().args(['$name']).parent. + problemMatcher().pattern(/abc/); testConfiguration(external, builder); }); @@ -971,7 +1017,9 @@ suite('Tasks Configuration parsing tests', () => { ] }; let builder = new ConfiguationBuilder(); - builder.task('taskName', 'tsc').problemMatcher().pattern(/.*/); + builder.task('taskName', 'tsc'). + command().args(['$name']).parent. + problemMatcher().pattern(/.*/); testConfiguration(external, builder); }); @@ -995,7 +1043,9 @@ suite('Tasks Configuration parsing tests', () => { ] }; let builder = new ConfiguationBuilder(); - builder.task('taskName', 'tsc').problemMatcher(). + builder.task('taskName', 'tsc'). + command().args(['$name']).parent. + problemMatcher(). owner('myOwner'). applyTo(ApplyToKind.closedDocuments). severity(Severity.Warning). @@ -1022,7 +1072,9 @@ suite('Tasks Configuration parsing tests', () => { ] }; let builder = new ConfiguationBuilder(); - builder.task('taskName', 'tsc').problemMatcher(). + builder.task('taskName', 'tsc'). + command().args(['$name']).parent. + problemMatcher(). fileLocation(FileLocationKind.Relative). filePrefix('myPath'). pattern(/abc/); @@ -1050,7 +1102,9 @@ suite('Tasks Configuration parsing tests', () => { ] }; let builder = new ConfiguationBuilder(); - builder.task('taskName', 'tsc').problemMatcher(). + builder.task('taskName', 'tsc'). + command().args(['$name']).parent. + problemMatcher(). pattern(/abc/).file(10).message(11).location(12).severity(13).code(14); testConfiguration(external, builder); }); @@ -1079,7 +1133,9 @@ suite('Tasks Configuration parsing tests', () => { ] }; let builder = new ConfiguationBuilder(); - builder.task('taskName', 'tsc').problemMatcher(). + builder.task('taskName', 'tsc'). + command().args(['$name']).parent. + problemMatcher(). pattern(/abc/).file(10).message(11). line(12).character(13).endLine(14).endCharacter(15). severity(16).code(17); @@ -1097,7 +1153,9 @@ suite('Tasks Configuration parsing tests', () => { ] }; let builder = new ConfiguationBuilder(); - builder.task('taskName', 'tsc').promptOnClose(true); + builder.task('taskName', 'tsc'). + promptOnClose(true). + command().args(['$name']); testConfiguration(external, builder); }); @@ -1109,11 +1167,13 @@ suite('Tasks Configuration parsing tests', () => { { taskName: 'taskName', isWatching: true - } + } as CustomTask ] }; let builder = new ConfiguationBuilder(); - builder.task('taskName', 'tsc').isBackground(true).promptOnClose(false); + builder.task('taskName', 'tsc'). + isBackground(true).promptOnClose(false). + command().args(['$name']); testConfiguration(external, builder); }); @@ -1129,7 +1189,9 @@ suite('Tasks Configuration parsing tests', () => { ] }; let builder = new ConfiguationBuilder(); - builder.task('taskName', 'tsc').promptOnClose(false); + builder.task('taskName', 'tsc'). + promptOnClose(false). + command().args(['$name']); testConfiguration(external, builder); }); @@ -1137,7 +1199,7 @@ suite('Tasks Configuration parsing tests', () => { let external: ExternalTaskRunnerConfiguration = { version: '0.1.0', command: 'tsc', - taskSelector: '/t', + taskSelector: '/t:', tasks: [ { taskName: 'taskName', @@ -1147,7 +1209,8 @@ suite('Tasks Configuration parsing tests', () => { let builder = new ConfiguationBuilder(); builder.task('taskName', 'tsc'). command(). - taskSelector('/t'); + taskSelector('/t:'). + args(['/t:taskName']); testConfiguration(external, builder); }); @@ -1160,16 +1223,16 @@ suite('Tasks Configuration parsing tests', () => { { taskName: 'taskName', suppressTaskName: true - } + } as CustomTask ] }; let builder = new ConfiguationBuilder(); builder.task('taskName', 'tsc'). - suppressTaskName(true); + command().suppressTaskName(true); testConfiguration(external, builder); }); - test('tasks: suppress task name inerit', () => { + test('tasks: suppress task name inherit', () => { let external: ExternalTaskRunnerConfiguration = { version: '0.1.0', command: 'tsc', @@ -1182,7 +1245,7 @@ suite('Tasks Configuration parsing tests', () => { }; let builder = new ConfiguationBuilder(); builder.task('taskName', 'tsc'). - suppressTaskName(true); + command().suppressTaskName(true); testConfiguration(external, builder); }); @@ -1200,8 +1263,10 @@ suite('Tasks Configuration parsing tests', () => { ] }; let builder = new ConfiguationBuilder(); - builder.task('taskNameOne', 'tsc'); - builder.task('taskNameTwo', 'tsc'); + builder.task('taskNameOne', 'tsc'). + command().args(['$name']); + builder.task('taskNameTwo', 'tsc'). + command().args(['$name']); testConfiguration(external, builder); }); @@ -1216,7 +1281,7 @@ suite('Tasks Configuration parsing tests', () => { ] }; let builder = new ConfiguationBuilder(); - builder.task('taskNameOne', 'tsc').suppressTaskName(true); + builder.task('taskNameOne', 'tsc').command().suppressTaskName(true); testConfiguration(external, builder); }); @@ -1235,8 +1300,8 @@ suite('Tasks Configuration parsing tests', () => { ] }; let builder = new ConfiguationBuilder(); - builder.task('taskNameOne', 'tsc').suppressTaskName(true); - builder.task('taskNameTwo', 'dir').suppressTaskName(true); + builder.task('taskNameOne', 'tsc').command().suppressTaskName(true); + builder.task('taskNameTwo', 'dir').command().suppressTaskName(true); testConfiguration(external, builder); }); @@ -1255,12 +1320,12 @@ suite('Tasks Configuration parsing tests', () => { env: 'env' } } - } + } as CustomTask ] }; let builder = new ConfiguationBuilder(); - builder.task('taskNameOne', 'tsc').suppressTaskName(true).command(). - shell(true).args(['arg']).options({ cwd: 'cwd', env: { env: 'env' } }); + builder.task('taskNameOne', 'tsc').command().suppressTaskName(true). + runtime(Tasks.RuntimeType.Shell).args(['arg']).options({ cwd: 'cwd', env: { env: 'env' } }); testConfiguration(external, builder); }); @@ -1279,7 +1344,7 @@ suite('Tasks Configuration parsing tests', () => { ] }; let builder = new ConfiguationBuilder(); - builder.task('taskNameOne', name).suppressTaskName(true); + builder.task('taskNameOne', name).command().suppressTaskName(true); testConfiguration(external, builder); }); @@ -1299,7 +1364,7 @@ suite('Tasks Configuration parsing tests', () => { ] }; let builder = new ConfiguationBuilder(); - builder.task('tsc', 'tsc').suppressTaskName(true).command().args(args); + builder.task('tsc', 'tsc').command().suppressTaskName(true).args(args); testConfiguration(external, builder); }); @@ -1319,7 +1384,7 @@ suite('Tasks Configuration parsing tests', () => { ] }; let builder = new ConfiguationBuilder(); - builder.task('tsc', 'tsc').suppressTaskName(true).command().args(args); + builder.task('tsc', 'tsc').command().suppressTaskName(true).args(args); testConfiguration(external, builder); }); @@ -1331,15 +1396,74 @@ suite('Tasks Configuration parsing tests', () => { { taskName: 'taskNameOne', isShellCommand: true, + } as CustomTask + ] + }; + let builder = new ConfiguationBuilder(); + builder.task('taskNameOne', 'tsc').command().runtime(Tasks.RuntimeType.Shell).args(['$name']); + testConfiguration(external, builder); + }); + + test('tasks: global and tasks args', () => { + let external: ExternalTaskRunnerConfiguration = { + version: '0.1.0', + command: 'tsc', + args: ['global'], + tasks: [ + { + taskName: 'taskNameOne', + args: ['local'] + } + ] + }; + let builder = new ConfiguationBuilder(); + builder.task('taskNameOne', 'tsc').command().args(['global', '$name', 'local']); + testConfiguration(external, builder); + }); + + test('tasks: global and tasks args with task selector', () => { + let external: ExternalTaskRunnerConfiguration = { + version: '0.1.0', + command: 'tsc', + args: ['global'], + taskSelector: '/t:', + tasks: [ + { + taskName: 'taskNameOne', + args: ['local'] } ] }; let builder = new ConfiguationBuilder(); - builder.task('taskNameOne', 'tsc').command().shell(false); + builder.task('taskNameOne', 'tsc').command().taskSelector('/t:').args(['global', '/t:taskNameOne', 'local']); testConfiguration(external, builder); }); }); +suite('Tasks version 2.0.0', () => { + test('Build workspace task', () => { + let external: ExternalTaskRunnerConfiguration = { + version: '2.0.0', + tasks: [ + { + taskName: 'dir', + command: 'dir', + type: 'shell', + group: 'build' + } + ] + }; + let builder = new ConfiguationBuilder(); + builder.task('dir', 'dir'). + group(Tasks.TaskGroup.Build). + command().suppressTaskName(true). + runtime(Tasks.RuntimeType.Shell). + presentation().echo(true); + testConfiguration(external, builder); + }); + +}); + suite('Bugs / regression tests', () => { test('Bug 19548', () => { if (Platform.isLinux) { @@ -1367,7 +1491,7 @@ suite('Bugs / regression tests', () => { isBuildCommand: false, showOutput: 'always', echoCommand: true - } + } as CustomTask ] }, osx: { @@ -1385,22 +1509,24 @@ suite('Bugs / regression tests', () => { ], isBuildCommand: false, showOutput: 'always' - } + } as CustomTask ] } }; let builder = new ConfiguationBuilder(); if (Platform.isWindows) { builder.task('composeForDebug', 'powershell'). - suppressTaskName(true).showOutput(Tasks.ShowOutput.Always). + command().suppressTaskName(true). args(['-ExecutionPolicy', 'RemoteSigned', '.\\dockerTask.ps1', '-ComposeForDebug', '-Environment', 'debug']). - command().echo(true).options({ cwd: '${workspaceRoot}' }); + options({ cwd: '${workspaceRoot}' }). + presentation().echo(true).reveal(Tasks.RevealKind.Always); testConfiguration(external, builder); } else if (Platform.isMacintosh) { builder.task('composeForDebug', '/bin/bash'). - suppressTaskName(true).showOutput(Tasks.ShowOutput.Always). + command().suppressTaskName(true). args(['-c', './dockerTask.sh composeForDebug debug']). - command().options({ cwd: '${workspaceRoot}' }); + options({ cwd: '${workspaceRoot}' }). + presentation().reveal(Tasks.RevealKind.Always); testConfiguration(external, builder); } }); diff --git a/src/vs/workbench/parts/terminal/common/terminal.ts b/src/vs/workbench/parts/terminal/common/terminal.ts index bd7df535e4e9499e6c1d8d96fe50d91b1c53b610..449cf29d2fc4ef83b054200d8d7cbaf30e0d0f96 100644 --- a/src/vs/workbench/parts/terminal/common/terminal.ts +++ b/src/vs/workbench/parts/terminal/common/terminal.ts @@ -27,6 +27,11 @@ export const KEYBINDING_CONTEXT_TERMINAL_TEXT_SELECTED = new RawContextKey('terminalFindWidgetVisible', undefined); +/** A context key that is set when the find widget in integrated terminal is not visible. */ +export const KEYBINDING_CONTEXT_TERMINAL_FIND_WIDGET_NOT_VISIBLE: ContextKeyExpr = KEYBINDING_CONTEXT_TERMINAL_FIND_WIDGET_VISIBLE.toNegated(); + export const IS_WORKSPACE_SHELL_ALLOWED_STORAGE_KEY = 'terminal.integrated.isWorkspaceShellAllowed'; export const NEVER_SUGGEST_SELECT_WINDOWS_SHELL_STORAGE_KEY = 'terminal.integrated.neverSuggestSelectWindowsShell'; @@ -109,8 +114,10 @@ export interface IShellLaunchConfig { * shell is being launched by an extension). */ ignoreConfigurationCwd?: boolean; + /** Whether to wait for a key press before closing the terminal. */ - waitOnExit?: boolean; + waitOnExit?: boolean | string; + /** * A string including ANSI escape sequences that will be written to the terminal emulator * _before_ the terminal process has launched, a trailing \n is added at the end of the string. @@ -145,6 +152,8 @@ export interface ITerminalService { showPanel(focus?: boolean): TPromise; hidePanel(): void; + focusFindWidget(): TPromise; + hideFindWidget(): void; setContainers(panelContainer: HTMLElement, terminalContainer: HTMLElement): void; updateConfig(): void; selectDefaultWindowsShell(): TPromise; @@ -228,6 +237,26 @@ export interface ITerminalInstance { */ clearSelection(): void; + /** + * Select all text in the terminal. + */ + selectAll(): void; + + /** + * Find the next instance of the term + */ + findNext(term: string): boolean; + + /** + * Find the previous instance of the term + */ + findPrevious(term: string): boolean; + + /** + * Notifies the terminal that the find widget's focus state has been changed. + */ + notifyFindWidgetFocusChanged(isFocused: boolean): void; + /** * Focuses the terminal instance. * @@ -323,4 +352,9 @@ export interface ITerminalInstance { * Experimental: Call to enable onData to be passed over IPC to the extension host. */ enableApiOnData(): void; + + /** + * Sets the title of the terminal instance. + */ + setTitle(title: string): void; } diff --git a/src/vs/workbench/parts/terminal/common/terminalService.ts b/src/vs/workbench/parts/terminal/common/terminalService.ts index 7dbb40a3233c7db188f1c3c98407a528c947bc98..5362507941f69b3768ff72bbae2608dce5d16c71 100644 --- a/src/vs/workbench/parts/terminal/common/terminalService.ts +++ b/src/vs/workbench/parts/terminal/common/terminalService.ts @@ -10,7 +10,7 @@ import { ILifecycleService } from 'vs/platform/lifecycle/common/lifecycle'; import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; import { IPartService } from 'vs/workbench/services/part/common/partService'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { ITerminalService, ITerminalInstance, IShellLaunchConfig, ITerminalConfigHelper, KEYBINDING_CONTEXT_TERMINAL_FOCUS, TERMINAL_PANEL_ID } from 'vs/workbench/parts/terminal/common/terminal'; +import { ITerminalService, ITerminalInstance, IShellLaunchConfig, ITerminalConfigHelper, KEYBINDING_CONTEXT_TERMINAL_FOCUS, KEYBINDING_CONTEXT_TERMINAL_FIND_WIDGET_VISIBLE, TERMINAL_PANEL_ID } from 'vs/workbench/parts/terminal/common/terminal'; import { TPromise } from 'vs/base/common/winjs.base'; export abstract class TerminalService implements ITerminalService { @@ -18,6 +18,7 @@ export abstract class TerminalService implements ITerminalService { protected _isShuttingDown: boolean; protected _terminalFocusContextKey: IContextKey; + protected _findWidgetVisible: IContextKey; protected _terminalContainer: HTMLElement; protected _onInstancesChanged: Emitter; protected _onInstanceDisposed: Emitter; @@ -43,7 +44,7 @@ export abstract class TerminalService implements ITerminalService { constructor( @IContextKeyService private _contextKeyService: IContextKeyService, @IConfigurationService private _configurationService: IConfigurationService, - @IPanelService private _panelService: IPanelService, + @IPanelService protected _panelService: IPanelService, @IPartService private _partService: IPartService, @ILifecycleService lifecycleService: ILifecycleService ) { @@ -61,6 +62,7 @@ export abstract class TerminalService implements ITerminalService { this._configurationService.onDidUpdateConfiguration(() => this.updateConfig()); lifecycleService.onWillShutdown(event => event.veto(this._onWillShutdown())); this._terminalFocusContextKey = KEYBINDING_CONTEXT_TERMINAL_FOCUS.bindTo(this._contextKeyService); + this._findWidgetVisible = KEYBINDING_CONTEXT_TERMINAL_FIND_WIDGET_VISIBLE.bindTo(this._contextKeyService); this.onInstanceDisposed((terminalInstance) => { this._removeInstance(terminalInstance); }); } @@ -200,6 +202,9 @@ export abstract class TerminalService implements ITerminalService { } } + public abstract focusFindWidget(): TPromise; + public abstract hideFindWidget(): void; + private _getIndexFromId(terminalId: number): number { let terminalIndex = -1; this.terminalInstances.forEach((terminalInstance, i) => { diff --git a/src/vs/workbench/parts/terminal/electron-browser/media/close-dark.svg b/src/vs/workbench/parts/terminal/electron-browser/media/close-dark.svg new file mode 100644 index 0000000000000000000000000000000000000000..751e89b3b0215f74d84195d1dea54ca0c25f91c3 --- /dev/null +++ b/src/vs/workbench/parts/terminal/electron-browser/media/close-dark.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/vs/workbench/parts/terminal/electron-browser/media/close.svg b/src/vs/workbench/parts/terminal/electron-browser/media/close.svg new file mode 100644 index 0000000000000000000000000000000000000000..fde34404d4eb8537f8bf76eb9f76127872ef68ba --- /dev/null +++ b/src/vs/workbench/parts/terminal/electron-browser/media/close.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/vs/workbench/parts/terminal/electron-browser/media/next-inverse.svg b/src/vs/workbench/parts/terminal/electron-browser/media/next-inverse.svg new file mode 100644 index 0000000000000000000000000000000000000000..7498a498bb652d7ab9001beb4d928c81b1609553 --- /dev/null +++ b/src/vs/workbench/parts/terminal/electron-browser/media/next-inverse.svg @@ -0,0 +1,5 @@ + + + diff --git a/src/vs/workbench/parts/terminal/electron-browser/media/next.svg b/src/vs/workbench/parts/terminal/electron-browser/media/next.svg new file mode 100644 index 0000000000000000000000000000000000000000..4b176879f90afacb58ed0d93545a34758abd4cca --- /dev/null +++ b/src/vs/workbench/parts/terminal/electron-browser/media/next.svg @@ -0,0 +1,5 @@ + + + diff --git a/src/vs/workbench/parts/terminal/electron-browser/media/previous-inverse.svg b/src/vs/workbench/parts/terminal/electron-browser/media/previous-inverse.svg new file mode 100644 index 0000000000000000000000000000000000000000..0aabf393d9c2f40902f796872fb40ae0ea7605a4 --- /dev/null +++ b/src/vs/workbench/parts/terminal/electron-browser/media/previous-inverse.svg @@ -0,0 +1,5 @@ + + + diff --git a/src/vs/workbench/parts/terminal/electron-browser/media/previous.svg b/src/vs/workbench/parts/terminal/electron-browser/media/previous.svg new file mode 100644 index 0000000000000000000000000000000000000000..f7acf0acbd999738a2cca1f69d789759949d4abd --- /dev/null +++ b/src/vs/workbench/parts/terminal/electron-browser/media/previous.svg @@ -0,0 +1,5 @@ + + + diff --git a/src/vs/workbench/parts/terminal/electron-browser/media/terminal.css b/src/vs/workbench/parts/terminal/electron-browser/media/terminal.css index f35dde259bf6f109fb3c8cfb48d3aebe56b8eb1d..0b6570ccef9d36cd6c3348cce122a4b38029a681 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/media/terminal.css +++ b/src/vs/workbench/parts/terminal/electron-browser/media/terminal.css @@ -9,12 +9,9 @@ display: flex; flex-direction: column; background-color: transparent!important; - color: #333; - -webkit-user-select: initial; + user-select: initial; position: relative; } -.vs-dark .monaco-workbench .panel.integrated-terminal { color: #CCC; } -.hc-black .monaco-workbench .panel.integrated-terminal { color: #FFF; } .monaco-workbench .panel.integrated-terminal .terminal-outer-container { height: 100%; @@ -81,3 +78,75 @@ .hc-black .monaco-workbench.mac .panel.integrated-terminal .xterm-rows { cursor: -webkit-image-set(url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAAL0lEQVQoz2NgCD3x//9/BhBYBWdhgFVAiVW4JBFKGIa4AqD0//9D3pt4I4tAdAMAHTQ/j5Zom30AAAAASUVORK5CYII=') 1x, url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAQAAADZc7J/AAAAz0lEQVRIx2NgYGBY/R8I/vx5eelX3n82IJ9FxGf6tksvf/8FiTMQAcAGQMDvSwu09abffY8QYSAScNk45G198eX//yev73/4///701eh//kZSARckrNBRvz//+8+6ZohwCzjGNjdgQxkAg7B9WADeBjIBqtJCbhRA0YNoIkBSNmaPEMoNmA0FkYNoFKhapJ6FGyAH3nauaSmPfwI0v/3OukVi0CIZ+F25KrtYcx/CTIy0e+rC7R1Z4KMICVTQQ14feVXIbR695u14+Ir4gwAAD49E54wc1kWAAAAAElFTkSuQmCC') 2x) 5 8, text; } + +.monaco-workbench .panel.integrated-terminal .find-part { + position: absolute; + top: -40px; + right: 28px; + display: none; + padding: 4px; + align-items: center; + + -webkit-transition: top 200ms linear; + -o-transition: top 200ms linear; + -moz-transition: top 200ms linear; + -ms-transition: top 200ms linear; + transition: top 200ms linear; +} + +.monaco-workbench .panel.integrated-terminal .find-part.visible { + top: 0; + display: flex; +} + +/* Temporarily we don't show match numbers */ +.monaco-workbench .panel.integrated-terminal .find-part .monaco-findInput .controls { + display: none; +} +.monaco-workbench .panel.integrated-terminal .find-part .monaco-findInput .monaco-inputbox .wrapper .input { + width: 100% !important; +} + +.monaco-workbench .panel.integrated-terminal .find-part .button { + min-width: 20px; + width: 20px; + height: 20px; + display: flex; + flex: initial; + margin-left: 3px; + background-position: center center; + background-repeat: no-repeat; + cursor: pointer; +} + +.monaco-workbench .panel.integrated-terminal .find-part .button.previous { + background-image: url('previous.svg'); +} + +.monaco-workbench .panel.integrated-terminal .find-part .button.next { + background-image: url('next.svg'); +} + +.monaco-workbench .panel.integrated-terminal .find-part .button.close-fw { + background-image: url('close.svg'); +} + +.hc-black .monaco-workbench .panel.integrated-terminal .find-part .button.previous, +.vs-dark .monaco-workbench .panel.integrated-terminal .find-part .button.previous { + background-image: url('previous-inverse.svg'); +} + +.hc-black .monaco-workbench .panel.integrated-terminal .find-part .button.next, +.vs-dark .monaco-workbench .panel.integrated-terminal .find-part .button.next { + background-image: url('next-inverse.svg'); +} + +.hc-black .monaco-workbench .panel.integrated-terminal .find-part .button.close-fw, +.vs-dark .monaco-workbench .panel.integrated-terminal .find-part .button.close-fw { + background-image: url('close-dark.svg'); +} + +monaco-workbench .panel.integrated-terminal .find-part .button.disabled { + opacity: 0.3; + cursor: default; +} \ No newline at end of file diff --git a/src/vs/workbench/parts/terminal/electron-browser/media/widgets.css b/src/vs/workbench/parts/terminal/electron-browser/media/widgets.css index 2549ad7016355421281a373d2f8aaae611aa0aab..10751297b59543b35bf0dd3e1ca0a6959208e4b9 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/media/widgets.css +++ b/src/vs/workbench/parts/terminal/electron-browser/media/widgets.css @@ -12,7 +12,7 @@ } .monaco-workbench .terminal-message-widget { - font-family: system-ui, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", "Ubuntu", "Droid Sans", sans-serif; + font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", "Ubuntu", "Droid Sans", sans-serif; font-size: 14px; line-height: 19px; padding: 4px 5px; diff --git a/src/vs/workbench/parts/terminal/electron-browser/media/xterm.css b/src/vs/workbench/parts/terminal/electron-browser/media/xterm.css index 4ee863dbecb2d6c32cb6ec43943bfe8cabb8bc42..ad0175361b742c9f7f21fca1c8fdcf924c2371bd 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/media/xterm.css +++ b/src/vs/workbench/parts/terminal/electron-browser/media/xterm.css @@ -6,6 +6,7 @@ .monaco-workbench .panel.integrated-terminal .xterm { position: relative; height: 100%; + user-select: none; } .monaco-workbench .panel.integrated-terminal .xterm:focus { @@ -55,33 +56,10 @@ text-decoration: none; } -.monaco-workbench .panel.integrated-terminal .xterm:not(.xterm-cursor-style-underline):not(.xterm-cursor-style-bar).focus .reverse-video, -.monaco-workbench .panel.integrated-terminal .xterm:not(.xterm-cursor-style-underline):not(.xterm-cursor-style-bar):focus .reverse-video { color: #CCC; } -.vs-dark .monaco-workbench .panel.integrated-terminal .xterm:not(.xterm-cursor-style-underline):not(.xterm-cursor-style-bar).focus .reverse-video, -.vs-dark .monaco-workbench .panel.integrated-terminal .xterm:not(.xterm-cursor-style-underline):not(.xterm-cursor-style-bar):focus .reverse-video { color: #1e1e1e; } -.hc-black .monaco-workbench .panel.integrated-terminal .xterm:not(.xterm-cursor-style-underline):not(.xterm-cursor-style-bar).focus .reverse-video, -.hc-black .monaco-workbench .panel.integrated-terminal .xterm:not(.xterm-cursor-style-underline):not(.xterm-cursor-style-bar):focus .reverse-video { color: #000; } - -.monaco-workbench .panel.integrated-terminal .xterm:not(.xterm-cursor-style-underline):not(.xterm-cursor-style-bar).focus .terminal-cursor, -.monaco-workbench .panel.integrated-terminal .xterm:not(.xterm-cursor-style-underline):not(.xterm-cursor-style-bar):focus .terminal-cursor { background-color: #333; } -.vs-dark .monaco-workbench .panel.integrated-terminal .xterm:not(.xterm-cursor-style-underline):not(.xterm-cursor-style-bar).focus .terminal-cursor, -.vs-dark .monaco-workbench .panel.integrated-terminal .xterm:not(.xterm-cursor-style-underline):not(.xterm-cursor-style-bar):focus .terminal-cursor { background-color: #CCC; } -.hc-black .monaco-workbench .panel.integrated-terminal .xterm:not(.xterm-cursor-style-underline):not(.xterm-cursor-style-bar).focus .terminal-cursor, -.hc-black .monaco-workbench .panel.integrated-terminal .xterm:not(.xterm-cursor-style-underline):not(.xterm-cursor-style-bar):focus .terminal-cursor { background-color: #FFF; } - .monaco-workbench .panel.integrated-terminal .xterm:not(.focus):not(:focus) .terminal-cursor { background-color: transparent; - outline: 1px solid #333; - outline-offset: -1px; -} -.vs-dark .monaco-workbench .panel.integrated-terminal .xterm:not(.focus):not(:focus) .terminal-cursor { - background-color: transparent; - outline: 1px solid #CCC; - outline-offset: -1px; -} -.hc-black .monaco-workbench .panel.integrated-terminal .xterm:not(.focus):not(:focus) .terminal-cursor { - background-color: transparent; - outline: 1px solid #FFF; + outline-width: 1px; + outline-style: solid; outline-offset: -1px; } @@ -100,15 +78,6 @@ content: ""; display: block; position: absolute; - background-color: #333; -} -.vs-dark .monaco-workbench .panel.integrated-terminal .xterm.xterm-cursor-style-bar .terminal-cursor::before, -.vs-dark .monaco-workbench .panel.integrated-terminal .xterm.xterm-cursor-style-underline .terminal-cursor::before { - background-color: #CCC; -} -.hc-black .monaco-workbench .panel.integrated-terminal .xterm.xterm-cursor-style-bar .terminal-cursor::before, -.hc-black .monaco-workbench .panel.integrated-terminal .xterm.xterm-cursor-style-underline .terminal-cursor::before { - background-color: #fff; } .monaco-workbench .panel.integrated-terminal .xterm.xterm-cursor-style-bar .terminal-cursor::before { top: 0; @@ -126,18 +95,6 @@ .monaco-workbench .panel.integrated-terminal .xterm.xterm-cursor-style-underline.focus.xterm-cursor-blink.xterm-cursor-blink-on .terminal-cursor::before { background-color: transparent !important; } -.monaco-workbench .panel.integrated-terminal .xterm.xterm-cursor-style-bar.focus.xterm-cursor-blink .terminal-cursor::before, -.monaco-workbench .panel.integrated-terminal .xterm.xterm-cursor-style-underline.focus.xterm-cursor-blink .terminal-cursor::before { - background-color: #333; -} -.vs-dark .monaco-workbench .panel.integrated-terminal .xterm.xterm-cursor-style-bar.focus.xterm-cursor-blink .terminal-cursor::before, -.vs-dark .monaco-workbench .panel.integrated-terminal .xterm.xterm-cursor-style-underline.focus.xterm-cursor-blink .terminal-cursor::before { - background-color: #ccc; -} -.hc-black .monaco-workbench .panel.integrated-terminal .xterm.xterm-cursor-style-bar.focus.xterm-cursor-blink .terminal-cursor::before, -.hc-black .monaco-workbench .panel.integrated-terminal .xterm.xterm-cursor-style-underline.focus.xterm-cursor-blink .terminal-cursor::before { - background-color: #fff; -} .monaco-workbench .panel.integrated-terminal .xterm .xterm-viewport { overflow-y: scroll; @@ -170,6 +127,28 @@ left: -9999em; } +.monaco-workbench .panel.integrated-terminal .xterm.enable-mouse-events { + /* When mouse events are enabled (eg. tmux), revert to the standard pointer cursor */ + cursor: default; +} + +.monaco-workbench .panel.integrated-terminal .xterm .xterm-selection { + position: absolute; + left: 0; + bottom: 0; + z-index: 1; + opacity: 0.3; + pointer-events: none; +} + +.monaco-workbench .panel.integrated-terminal .xterm .xterm-selection div { + position: absolute; +} +/* TODO: Remove in favor of theme keys, see #28397*/ +.monaco-workbench .panel.integrated-terminal .xterm .xterm-selection div { background-color: #000; } +.vs-dark .monaco-workbench .panel.integrated-terminal .xterm .xterm-selection div { background-color: #FFF; } +.hc-black .monaco-workbench .panel.integrated-terminal .xterm .xterm-selection div { background-color: #FFF; } + .monaco-workbench .panel.integrated-terminal .xterm .xterm-bold { font-weight: bold; } @@ -201,23 +180,6 @@ display: block; } -/* Base selection colors */ - -.monaco-workbench .panel.integrated-terminal .xterm ::selection { - color: #FFF; - background-color: rgba(51, 51, 51, 0.996); -} - -.vs-dark .monaco-workbench .panel.integrated-terminal .xterm ::selection { - color: #1e1e1e; - background-color: rgba(204, 204, 204, 0.996); -} - -.hc-black .monaco-workbench .panel.integrated-terminal .xterm ::selection { - color: #000; - background-color: rgba(255, 255, 255, 0.996); -} - /* Terminal colors 16-255 */ .monaco-workbench .panel.integrated-terminal .xterm .xterm-color-16 { diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminal.contribution.ts b/src/vs/workbench/parts/terminal/electron-browser/terminal.contribution.ts index 6becf5badb013e8e54f7793205fc822b883e4410..b5938b23eb3c6126d7e438dc622aa609c84e6469 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminal.contribution.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminal.contribution.ts @@ -7,28 +7,29 @@ import 'vs/css!./media/scrollbar'; import 'vs/css!./media/terminal'; import 'vs/css!./media/xterm'; import 'vs/css!./media/widgets'; +import * as debugActions from 'vs/workbench/parts/debug/browser/debugActions'; +import * as nls from 'vs/nls'; import * as panel from 'vs/workbench/browser/panel'; import * as platform from 'vs/base/common/platform'; -import nls = require('vs/nls'); import { Extensions, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry'; -import { GlobalQuickOpenAction } from 'vs/workbench/browser/parts/quickopen/quickopen.contribution'; -import { ITerminalService, KEYBINDING_CONTEXT_TERMINAL_FOCUS, KEYBINDING_CONTEXT_TERMINAL_TEXT_SELECTED, TERMINAL_PANEL_ID, TERMINAL_DEFAULT_RIGHT_CLICK_COPY_PASTE, TerminalCursorStyle } from 'vs/workbench/parts/terminal/common/terminal'; +import { GlobalQuickOpenAction } from 'vs/workbench/browser/parts/quickopen/quickopen'; +import { ITerminalService, KEYBINDING_CONTEXT_TERMINAL_FOCUS, KEYBINDING_CONTEXT_TERMINAL_TEXT_SELECTED, TERMINAL_PANEL_ID, TERMINAL_DEFAULT_RIGHT_CLICK_COPY_PASTE, KEYBINDING_CONTEXT_TERMINAL_FIND_WIDGET_VISIBLE, TerminalCursorStyle } from 'vs/workbench/parts/terminal/common/terminal'; import { TERMINAL_DEFAULT_SHELL_LINUX, TERMINAL_DEFAULT_SHELL_OSX, TERMINAL_DEFAULT_SHELL_WINDOWS } from 'vs/workbench/parts/terminal/electron-browser/terminal'; import { IWorkbenchActionRegistry, Extensions as ActionExtensions } from 'vs/workbench/common/actionRegistry'; import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; -import { KillTerminalAction, CopyTerminalSelectionAction, CreateNewTerminalAction, FocusActiveTerminalAction, FocusNextTerminalAction, FocusPreviousTerminalAction, FocusTerminalAtIndexAction, SelectDefaultShellWindowsTerminalAction, RunSelectedTextInTerminalAction, RunActiveFileInTerminalAction, ScrollDownTerminalAction, ScrollDownPageTerminalAction, ScrollToBottomTerminalAction, ScrollUpTerminalAction, ScrollUpPageTerminalAction, ScrollToTopTerminalAction, TerminalPasteAction, ToggleTerminalAction, ClearTerminalAction, AllowWorkspaceShellTerminalCommand, DisallowWorkspaceShellTerminalCommand } from 'vs/workbench/parts/terminal/electron-browser/terminalActions'; -import { Registry } from 'vs/platform/platform'; +import { KillTerminalAction, CopyTerminalSelectionAction, CreateNewTerminalAction, FocusActiveTerminalAction, FocusNextTerminalAction, FocusPreviousTerminalAction, FocusTerminalAtIndexAction, SelectDefaultShellWindowsTerminalAction, RunSelectedTextInTerminalAction, RunActiveFileInTerminalAction, ScrollDownTerminalAction, ScrollDownPageTerminalAction, ScrollToBottomTerminalAction, ScrollUpTerminalAction, ScrollUpPageTerminalAction, ScrollToTopTerminalAction, TerminalPasteAction, ToggleTerminalAction, ClearTerminalAction, AllowWorkspaceShellTerminalCommand, DisallowWorkspaceShellTerminalCommand, RenameTerminalAction, SelectAllTerminalAction, FocusTerminalFindWidgetAction, HideTerminalFindWidgetAction } from 'vs/workbench/parts/terminal/electron-browser/terminalActions'; +import { Registry } from 'vs/platform/registry/common/platform'; import { ShowAllCommandsAction } from 'vs/workbench/parts/quickopen/browser/commandsHandler'; import { SyncActionDescriptor } from 'vs/platform/actions/common/actions'; import { TerminalService } from 'vs/workbench/parts/terminal/electron-browser/terminalService'; import { ToggleTabFocusModeAction } from 'vs/editor/contrib/toggleTabFocusMode/common/toggleTabFocusMode'; import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; -import debugActions = require('vs/workbench/parts/debug/browser/debugActions'); import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry'; import { OpenNextRecentlyUsedEditorInGroupAction, OpenPreviousRecentlyUsedEditorInGroupAction, FocusActiveGroupAction, FocusFirstGroupAction, FocusSecondGroupAction, FocusThirdGroupAction } from 'vs/workbench/browser/parts/editor/editorActions'; -import { EDITOR_FONT_DEFAULTS } from "vs/editor/common/config/editorOptions"; +import { EDITOR_FONT_DEFAULTS } from 'vs/editor/common/config/editorOptions'; import { registerColors } from './terminalColorRegistry'; +import { NavigateUpAction, NavigateDownAction, NavigateLeftAction, NavigateRightAction } from "vs/workbench/electron-browser/actions"; let configurationRegistry = Registry.as(Extensions.Configuration); configurationRegistry.registerConfiguration({ @@ -185,7 +186,14 @@ configurationRegistry.registerConfiguration({ OpenPreviousRecentlyUsedEditorInGroupAction.ID, FocusFirstGroupAction.ID, FocusSecondGroupAction.ID, - FocusThirdGroupAction.ID + FocusThirdGroupAction.ID, + SelectAllTerminalAction.ID, + FocusTerminalFindWidgetAction.ID, + HideTerminalFindWidgetAction.ID, + NavigateUpAction.ID, + NavigateDownAction.ID, + NavigateRightAction.ID, + NavigateLeftAction.ID ].sort() } } @@ -209,15 +217,13 @@ let actionRegistry = Registry.as(ActionExtensions.Work actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(KillTerminalAction, KillTerminalAction.ID, KillTerminalAction.LABEL), 'Terminal: Kill the Active Terminal Instance', category); actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(CopyTerminalSelectionAction, CopyTerminalSelectionAction.ID, CopyTerminalSelectionAction.LABEL, { primary: KeyMod.CtrlCmd | KeyCode.KEY_C, - linux: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_C }, - // Don't apply to Mac since cmd+c works - mac: { primary: null } + linux: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_C } }, ContextKeyExpr.and(KEYBINDING_CONTEXT_TERMINAL_TEXT_SELECTED, KEYBINDING_CONTEXT_TERMINAL_FOCUS)), 'Terminal: Copy Selection', category); actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(CreateNewTerminalAction, CreateNewTerminalAction.ID, CreateNewTerminalAction.LABEL, { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.US_BACKTICK, mac: { primary: KeyMod.WinCtrl | KeyMod.Shift | KeyCode.US_BACKTICK } }), 'Terminal: Create New Integrated Terminal', category); -actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(FocusActiveTerminalAction, FocusActiveTerminalAction.ID, FocusActiveTerminalAction.LABEL), 'Terminal: Focus Active Terminal', category); +actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(FocusActiveTerminalAction, FocusActiveTerminalAction.ID, FocusActiveTerminalAction.LABEL), 'Terminal: Focus Terminal', category); actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(FocusNextTerminalAction, FocusNextTerminalAction.ID, FocusNextTerminalAction.LABEL), 'Terminal: Focus Next Terminal', category); actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(FocusPreviousTerminalAction, FocusPreviousTerminalAction.ID, FocusPreviousTerminalAction.LABEL), 'Terminal: Focus Previous Terminal', category); for (let i = 1; i < 10; i++) { @@ -229,6 +235,15 @@ actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(TerminalPasteAct // Don't apply to Mac since cmd+v works mac: { primary: null } }, KEYBINDING_CONTEXT_TERMINAL_FOCUS), 'Terminal: Paste into Active Terminal', category); +actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(SelectAllTerminalAction, SelectAllTerminalAction.ID, SelectAllTerminalAction.LABEL, { + // Don't use ctrl+a by default as that would override the common go to start + // of prompt shell binding + primary: null, + // Technically this doesn't need to be here as it will fall back to this + // behavior anyway when handed to xterm.js, having this handled by VS Code + // makes it easier for users to see how it works though. + mac: { primary: KeyMod.CtrlCmd | KeyCode.KEY_A } +}, KEYBINDING_CONTEXT_TERMINAL_FOCUS), 'Terminal: Select All', category); actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(RunSelectedTextInTerminalAction, RunSelectedTextInTerminalAction.ID, RunSelectedTextInTerminalAction.LABEL), 'Terminal: Run Selected Text In Active Terminal', category); actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(RunActiveFileInTerminalAction, RunActiveFileInTerminalAction.ID, RunActiveFileInTerminalAction.LABEL), 'Terminal: Run Active File In Active Terminal', category); actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(ToggleTerminalAction, ToggleTerminalAction.ID, ToggleTerminalAction.LABEL, { @@ -268,5 +283,12 @@ if (platform.isWindows) { } actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(AllowWorkspaceShellTerminalCommand, AllowWorkspaceShellTerminalCommand.ID, AllowWorkspaceShellTerminalCommand.LABEL), 'Terminal: Allow Workspace Shell Configuration', category); actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(DisallowWorkspaceShellTerminalCommand, DisallowWorkspaceShellTerminalCommand.ID, DisallowWorkspaceShellTerminalCommand.LABEL), 'Terminal: Disallow Workspace Shell Configuration', category); - +actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(RenameTerminalAction, RenameTerminalAction.ID, RenameTerminalAction.LABEL), 'Terminal: Rename', category); +actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(FocusTerminalFindWidgetAction, FocusTerminalFindWidgetAction.ID, FocusTerminalFindWidgetAction.LABEL, { + primary: KeyMod.CtrlCmd | KeyCode.KEY_F +}, KEYBINDING_CONTEXT_TERMINAL_FOCUS), 'Terminal: Focus Find Widget', category); +actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(HideTerminalFindWidgetAction, HideTerminalFindWidgetAction.ID, HideTerminalFindWidgetAction.LABEL, { + primary: KeyCode.Escape, + secondary: [KeyCode.Shift | KeyCode.Escape] +}, ContextKeyExpr.and(KEYBINDING_CONTEXT_TERMINAL_FOCUS, KEYBINDING_CONTEXT_TERMINAL_FIND_WIDGET_VISIBLE)), 'Terminal: Focus Find Widget', category); registerColors(); diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalActions.ts b/src/vs/workbench/parts/terminal/electron-browser/terminalActions.ts index 58cd361fd34204c879e3ec403686633c25aa36b8..0d3a3a0b17c491750cbdb11aa91a6051fe404253 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminalActions.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminalActions.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import nls = require('vs/nls'); -import os = require('os'); +import * as nls from 'vs/nls'; +import * as os from 'os'; import { Action, IAction } from 'vs/base/common/actions'; import { EndOfLinePreference } from 'vs/editor/common/editorCommon'; import { ICodeEditorService } from 'vs/editor/common/services/codeEditorService'; @@ -17,6 +17,7 @@ import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; import { IMessageService, Severity } from 'vs/platform/message/common/message'; import { attachSelectBoxStyler } from 'vs/platform/theme/common/styler'; import { IThemeService } from 'vs/platform/theme/common/themeService'; +import { IQuickOpenService } from 'vs/platform/quickOpen/common/quickOpen'; export class ToggleTerminalAction extends TogglePanelAction { @@ -93,6 +94,27 @@ export class CopyTerminalSelectionAction extends Action { } } +export class SelectAllTerminalAction extends Action { + + public static ID = 'workbench.action.terminal.selectAll'; + public static LABEL = nls.localize('workbench.action.terminal.selectAll', "Select All"); + + constructor( + id: string, label: string, + @ITerminalService private terminalService: ITerminalService + ) { + super(id, label); + } + + public run(event?: any): TPromise { + let terminalInstance = this.terminalService.getActiveInstance(); + if (terminalInstance) { + terminalInstance.selectAll(); + } + return TPromise.as(void 0); + } +} + export class CreateNewTerminalAction extends Action { public static ID = 'workbench.action.terminal.new'; @@ -533,3 +555,65 @@ export class DisallowWorkspaceShellTerminalCommand extends Action { return TPromise.as(void 0); } } + +export class RenameTerminalAction extends Action { + + public static ID = 'workbench.action.terminal.rename'; + public static LABEL = nls.localize('workbench.action.terminal.rename', "Rename"); + + constructor( + id: string, label: string, + @IQuickOpenService private quickOpenService: IQuickOpenService, + @ITerminalService private terminalService: ITerminalService + ) { + super(id, label); + } + + public run(): TPromise { + const terminalInstance = this.terminalService.getActiveInstance(); + if (!terminalInstance) { + return TPromise.as(void 0); + } + return this.quickOpenService.input({ + prompt: nls.localize('workbench.action.terminal.rename.prompt', "Enter terminal name"), + }).then(name => { + if (name) { + terminalInstance.setTitle(name); + } + }); + } +} + +export class FocusTerminalFindWidgetAction extends Action { + + public static ID = 'workbench.action.terminal.focusFindWidget'; + public static LABEL = nls.localize('workbench.action.terminal.focusFindWidget', "Focus Find Widget"); + + constructor( + id: string, label: string, + @ITerminalService private terminalService: ITerminalService + ) { + super(id, label); + } + + public run(): TPromise { + return this.terminalService.focusFindWidget(); + } +} + +export class HideTerminalFindWidgetAction extends Action { + + public static ID = 'workbench.action.terminal.hideFindWidget'; + public static LABEL = nls.localize('workbench.action.terminal.hideFindWidget', "Hide Find Widget"); + + constructor( + id: string, label: string, + @ITerminalService private terminalService: ITerminalService + ) { + super(id, label); + } + + public run(): TPromise { + return TPromise.as(this.terminalService.hideFindWidget()); + } +} diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalColorRegistry.ts b/src/vs/workbench/parts/terminal/electron-browser/terminalColorRegistry.ts index 727078be3bcd9f83380744be0f47f04bd21c3637..4386fa8716be1301501b8db4d26d4c4322a0de6b 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminalColorRegistry.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminalColorRegistry.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import nls = require('vs/nls'); +import * as nls from 'vs/nls'; import { registerColor, ColorIdentifier } from 'vs/platform/theme/common/colorRegistry'; @@ -14,7 +14,17 @@ import { registerColor, ColorIdentifier } from 'vs/platform/theme/common/colorRe export const ansiColorIdentifiers: ColorIdentifier[] = []; export const TERMINAL_BACKGROUND_COLOR = registerColor('terminal.background', null, nls.localize('terminal.background', 'The background color of the terminal, this allows coloring the terminal differently to the panel.')); -export const TERMINAL_FOREGROUND_COLOR = registerColor('terminal.foreground', null, nls.localize('terminal.foreground', 'The foreground color of the terminal.')); +export const TERMINAL_FOREGROUND_COLOR = registerColor('terminal.foreground', { + light: '#333333', + dark: '#CCCCCC', + hc: '#FFFFFF' +}, nls.localize('terminal.foreground', 'The foreground color of the terminal.')); +// TODO: Reinstate, see #28397 +// export const TERMINAL_SELECTION_BACKGROUND_COLOR = registerColor('terminal.selectionBackground', { +// light: '#000', +// dark: '#FFF', +// hc: '#FFF' +// }, nls.localize('terminal.selectionBackground', 'The selection background color of the terminal.')); const ansiColorMap = { 'terminal.ansiBlack': { diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalConfigHelper.ts b/src/vs/workbench/parts/terminal/electron-browser/terminalConfigHelper.ts index 236474f73663a4c22c51ca42f4563b6957005e93..f0e2e61828c61b7b2fe9ab543a9820322c7071b8 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminalConfigHelper.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminalConfigHelper.ts @@ -5,14 +5,14 @@ import * as nls from 'vs/nls'; import * as platform from 'vs/base/common/platform'; -import { EDITOR_FONT_DEFAULTS, IEditorOptions } from "vs/editor/common/config/editorOptions"; +import { EDITOR_FONT_DEFAULTS, IEditorOptions } from 'vs/editor/common/config/editorOptions'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IWorkspaceConfigurationService } from 'vs/workbench/services/configuration/common/configuration'; import { IChoiceService } from 'vs/platform/message/common/message'; import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; import { ITerminalConfiguration, ITerminalConfigHelper, ITerminalFont, IShellLaunchConfig, IS_WORKSPACE_SHELL_ALLOWED_STORAGE_KEY } from 'vs/workbench/parts/terminal/common/terminal'; -import { Severity } from 'vs/editor/common/standalone/standaloneBase'; import { TPromise } from 'vs/base/common/winjs.base'; +import Severity from 'vs/base/common/severity'; interface IEditorConfiguration { editor: IEditorOptions; diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalFindWidget.ts b/src/vs/workbench/parts/terminal/electron-browser/terminalFindWidget.ts new file mode 100644 index 0000000000000000000000000000000000000000..40d6f4a31927441dba8f2100c7f3e4365a7ac55f --- /dev/null +++ b/src/vs/workbench/parts/terminal/electron-browser/terminalFindWidget.ts @@ -0,0 +1,228 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import * as nls from 'vs/nls'; +import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent'; +import { Widget } from 'vs/base/browser/ui/widget'; +import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; +import * as dom from 'vs/base/browser/dom'; +import { FindInput } from 'vs/base/browser/ui/findinput/findInput'; +import { IContextViewService } from 'vs/platform/contextview/browser/contextView'; +import { ITerminalService } from 'vs/workbench/parts/terminal/common/terminal'; +import { registerThemingParticipant, ITheme } from 'vs/platform/theme/common/themeService'; +import { inputBackground, inputActiveOptionBorder, inputForeground, inputBorder, inputValidationInfoBackground, inputValidationInfoBorder, inputValidationWarningBackground, inputValidationWarningBorder, inputValidationErrorBackground, inputValidationErrorBorder, editorWidgetBackground, widgetShadow } from 'vs/platform/theme/common/colorRegistry'; + +interface IButtonOpts { + label: string; + className: string; + onTrigger: () => void; + onKeyDown: (e: IKeyboardEvent) => void; +} + +class SimpleButton extends Widget { + + private _opts: IButtonOpts; + private _domNode: HTMLElement; + + constructor(opts: IButtonOpts) { + super(); + this._opts = opts; + + this._domNode = document.createElement('div'); + this._domNode.title = this._opts.label; + this._domNode.tabIndex = 0; + this._domNode.className = 'button ' + this._opts.className; + this._domNode.setAttribute('role', 'button'); + this._domNode.setAttribute('aria-label', this._opts.label); + + this.onclick(this._domNode, (e) => { + this._opts.onTrigger(); + e.preventDefault(); + }); + this.onkeydown(this._domNode, (e) => { + if (e.equals(KeyCode.Space) || e.equals(KeyCode.Enter)) { + this._opts.onTrigger(); + e.preventDefault(); + return; + } + this._opts.onKeyDown(e); + }); + } + + public get domNode(): HTMLElement { + return this._domNode; + } + + public isEnabled(): boolean { + return (this._domNode.tabIndex >= 0); + } + + public focus(): void { + this._domNode.focus(); + } + + public setEnabled(enabled: boolean): void { + dom.toggleClass(this._domNode, 'disabled', !enabled); + this._domNode.setAttribute('aria-disabled', String(!enabled)); + this._domNode.tabIndex = enabled ? 0 : -1; + } + + public toggleClass(className: string, shouldHaveIt: boolean): void { + dom.toggleClass(this._domNode, className, shouldHaveIt); + } +} + +const NLS_FIND_INPUT_LABEL = nls.localize('label.find', "Find"); +const NLS_FIND_INPUT_PLACEHOLDER = nls.localize('placeholder.find', "Find"); +const NLS_PREVIOUS_MATCH_BTN_LABEL = nls.localize('label.previousMatchButton', "Previous match"); +const NLS_NEXT_MATCH_BTN_LABEL = nls.localize('label.nextMatchButton', "Next match"); +const NLS_CLOSE_BTN_LABEL = nls.localize('label.closeButton', "Close"); + +export class TerminalFindWidget extends Widget { + private _findInput: FindInput; + private _domNode: HTMLElement; + private _isVisible: boolean; + private _focusTracker: dom.IFocusTracker; + + constructor( + @IContextViewService private _contextViewService: IContextViewService, + @ITerminalService private _terminalService: ITerminalService + ) { + super(); + this._findInput = this._register(new FindInput(null, this._contextViewService, { + width: 155, + label: NLS_FIND_INPUT_LABEL, + placeholder: NLS_FIND_INPUT_PLACEHOLDER, + })); + this._focusTracker = this._register(dom.trackFocus(this._findInput.inputBox.inputElement)); + this._register(this._focusTracker.addFocusListener(() => this._terminalService.getActiveInstance().notifyFindWidgetFocusChanged(true))); + this._register(this._focusTracker.addBlurListener(() => this._terminalService.getActiveInstance().notifyFindWidgetFocusChanged(false))); + + let find = (previous) => { + let val = this._findInput.getValue(); + let instance = this._terminalService.getActiveInstance(); + if (instance !== null) { + if (previous) { + instance.findPrevious(val); + } else { + instance.findNext(val); + } + } + }; + + this._register(this._findInput.onKeyDown((e) => { + if (e.equals(KeyCode.Enter)) { + find(false); + e.preventDefault(); + return; + } + + if (e.equals(KeyMod.Shift | KeyCode.Enter)) { + find(true); + e.preventDefault(); + return; + } + })); + + let prevBtn = new SimpleButton({ + label: NLS_PREVIOUS_MATCH_BTN_LABEL, + className: 'previous', + onTrigger: () => { + find(true); + }, + onKeyDown: (e) => { } + }); + + let nextBtn = new SimpleButton({ + label: NLS_NEXT_MATCH_BTN_LABEL, + className: 'next', + onTrigger: () => { + find(false); + }, + onKeyDown: (e) => { } + }); + + let closeBtn = new SimpleButton({ + label: NLS_CLOSE_BTN_LABEL, + className: 'close-fw', + onTrigger: () => { + this.hide(); + }, + onKeyDown: (e) => { } + }); + + this._domNode = document.createElement('div'); + this._domNode.className = 'find-part'; + this._domNode.appendChild(this._findInput.domNode); + this._domNode.appendChild(prevBtn.domNode); + this._domNode.appendChild(nextBtn.domNode); + this._domNode.appendChild(closeBtn.domNode); + + this._register(dom.addDisposableListener(this._domNode, 'click', (event) => { + event.stopPropagation(); + })); + } + + public updateTheme(theme?: ITheme): void { + let inputStyles = { + inputActiveOptionBorder: theme.getColor(inputActiveOptionBorder), + inputBackground: theme.getColor(inputBackground), + inputForeground: theme.getColor(inputForeground), + inputBorder: theme.getColor(inputBorder), + inputValidationInfoBackground: theme.getColor(inputValidationInfoBackground), + inputValidationInfoBorder: theme.getColor(inputValidationInfoBorder), + inputValidationWarningBackground: theme.getColor(inputValidationWarningBackground), + inputValidationWarningBorder: theme.getColor(inputValidationWarningBorder), + inputValidationErrorBackground: theme.getColor(inputValidationErrorBackground), + inputValidationErrorBorder: theme.getColor(inputValidationErrorBorder) + }; + this._findInput.style(inputStyles); + } + + public getDomNode(): HTMLElement { + return this._domNode; + } + + public reveal(): void { + if (this._isVisible) { + this._findInput.select(); + return; + } + + this._isVisible = true; + + setTimeout(() => { + dom.addClass(this._domNode, 'visible'); + this._domNode.setAttribute('aria-hidden', 'false'); + dom.addClass(this._domNode, 'noanimation'); + setTimeout(() => { + dom.removeClass(this._domNode, 'noanimation'); + this._findInput.select(); + }, 200); + }, 0); + } + + public hide(): void { + if (this._isVisible) { + this._isVisible = false; + + dom.removeClass(this._domNode, 'visible'); + this._domNode.setAttribute('aria-hidden', 'true'); + } + } +} + +// theming +registerThemingParticipant((theme, collector) => { + const findWidgetBGColor = theme.getColor(editorWidgetBackground); + if (findWidgetBGColor) { + collector.addRule(`.monaco-workbench .panel.integrated-terminal .find-part { background-color: ${findWidgetBGColor} !important; }`); + } + + let widgetShadowColor = theme.getColor(widgetShadow); + if (widgetShadowColor) { + collector.addRule(`.monaco-workbench .panel.integrated-terminal .find-part { box-shadow: 0 2px 8px ${widgetShadowColor}; }`); + } +}); \ No newline at end of file diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts b/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts index 07f8b6b53cb4ae2a87ea7c69dfdba38c24d6164c..0c17bbf1303f610bfe2d94a904234c9576bf451b 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts @@ -3,15 +3,15 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ +import * as cp from 'child_process'; +import * as os from 'os'; import * as path from 'path'; -import DOM = require('vs/base/browser/dom'); +import * as lifecycle from 'vs/base/common/lifecycle'; +import * as nls from 'vs/nls'; +import * as platform from 'vs/base/common/platform'; +import * as dom from 'vs/base/browser/dom'; import Event, { Emitter } from 'vs/base/common/event'; -import URI from 'vs/base/common/uri'; -import cp = require('child_process'); -import lifecycle = require('vs/base/common/lifecycle'); -import nls = require('vs/nls'); -import os = require('os'); -import platform = require('vs/base/common/platform'); +import Uri from 'vs/base/common/uri'; import xterm = require('xterm'); import { Dimension } from 'vs/base/browser/builder'; import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey'; @@ -21,7 +21,7 @@ import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; import { IStringDictionary } from 'vs/base/common/collections'; import { ITerminalInstance, KEYBINDING_CONTEXT_TERMINAL_TEXT_SELECTED, TERMINAL_PANEL_ID, IShellLaunchConfig } from 'vs/workbench/parts/terminal/common/terminal'; import { ITerminalProcessFactory } from 'vs/workbench/parts/terminal/electron-browser/terminal'; -import { IWorkspace, IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; +import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent'; @@ -29,8 +29,11 @@ import { TabFocus } from 'vs/editor/common/config/commonEditorConfig'; import { TerminalConfigHelper } from 'vs/workbench/parts/terminal/electron-browser/terminalConfigHelper'; import { TerminalLinkHandler } from 'vs/workbench/parts/terminal/electron-browser/terminalLinkHandler'; import { TerminalWidgetManager } from 'vs/workbench/parts/terminal/browser/terminalWidgetManager'; -import { registerThemingParticipant, ITheme, ICssStyleCollector } from "vs/platform/theme/common/themeService"; -import { scrollbarSliderBackground, scrollbarSliderHoverBackground, scrollbarSliderActiveBackground } from "vs/platform/theme/common/colorRegistry"; +import { registerThemingParticipant, ITheme, ICssStyleCollector } from 'vs/platform/theme/common/themeService'; +import { scrollbarSliderBackground, scrollbarSliderHoverBackground, scrollbarSliderActiveBackground } from 'vs/platform/theme/common/colorRegistry'; +import { TPromise } from 'vs/base/common/winjs.base'; +import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; +import { IHistoryService } from "vs/workbench/services/history/common/history"; /** The amount of time to consider terminal errors to be related to the launch */ const LAUNCHING_DURATION = 500; @@ -39,7 +42,7 @@ class StandardTerminalProcessFactory implements ITerminalProcessFactory { public create(env: { [key: string]: string }): cp.ChildProcess { return cp.fork('./terminalProcess', [], { env, - cwd: URI.parse(path.dirname(require.toUrl('./terminalProcess'))).fsPath + cwd: Uri.parse(path.dirname(require.toUrl('./terminalProcess'))).fsPath }); } } @@ -56,6 +59,7 @@ export class TerminalInstance implements ITerminalInstance { private _hadFocusOnExit: boolean; private _isLaunching: boolean; private _isVisible: boolean; + private _processReady: TPromise; private _isDisposed: boolean; private _onDisposed: Emitter; private _onDataForApi: Emitter<{ instance: ITerminalInstance, data: string }>; @@ -73,6 +77,7 @@ export class TerminalInstance implements ITerminalInstance { private _terminalHasTextContextKey: IContextKey; private _cols: number; private _rows: number; + private _messageTitleListener: (message: { type: string, content: string }) => void; private _widgetManager: TerminalWidgetManager; private _linkHandler: TerminalLinkHandler; @@ -97,7 +102,9 @@ export class TerminalInstance implements ITerminalInstance { @IPanelService private _panelService: IPanelService, @IWorkspaceContextService private _contextService: IWorkspaceContextService, @IWorkbenchEditorService private _editorService: IWorkbenchEditorService, - @IInstantiationService private _instantiationService: IInstantiationService + @IInstantiationService private _instantiationService: IInstantiationService, + @IClipboardService private _clipboardService: IClipboardService, + @IHistoryService private _historyService: IHistoryService ) { this._instanceDisposables = []; this._processDisposables = []; @@ -115,8 +122,13 @@ export class TerminalInstance implements ITerminalInstance { this._onProcessIdReady = new Emitter(); this._onTitleChanged = new Emitter(); + // Create a promise that resolves when the pty is ready + this._processReady = new TPromise(c => { + this.onProcessIdReady(() => c(void 0)); + }); + this._initDimensions(); - this._createProcess(this._contextService.getWorkspace(), this._shellLaunchConfig); + this._createProcess(this._historyService.getLastActiveWorkspaceRoot(), this._shellLaunchConfig); this._createXterm(); // Only attach xterm.js to the DOM if the terminal panel has been opened before. @@ -153,8 +165,8 @@ export class TerminalInstance implements ITerminalInstance { return null; } const font = this._configHelper.getFont(); - this._cols = Math.floor(dimension.width / font.charWidth); - this._rows = Math.floor(dimension.height / font.charHeight); + this._cols = Math.max(Math.floor(dimension.width / font.charWidth), 1); + this._rows = Math.max(Math.floor(dimension.height / font.charHeight), 1); return dimension.width; } @@ -217,7 +229,7 @@ export class TerminalInstance implements ITerminalInstance { this._container = container; this._wrapperElement = document.createElement('div'); - DOM.addClass(this._wrapperElement, 'terminal-wrapper'); + dom.addClass(this._wrapperElement, 'terminal-wrapper'); this._xtermElement = document.createElement('div'); this._xterm.open(this._xtermElement, false); @@ -242,7 +254,7 @@ export class TerminalInstance implements ITerminalInstance { } return undefined; }); - this._instanceDisposables.push(DOM.addDisposableListener(this._xterm.element, 'mouseup', (event: KeyboardEvent) => { + this._instanceDisposables.push(dom.addDisposableListener(this._xterm.element, 'mouseup', (event: KeyboardEvent) => { // Wait until mouseup has propogated through the DOM before evaluating the new selection // state. setTimeout(() => { @@ -251,7 +263,7 @@ export class TerminalInstance implements ITerminalInstance { })); // xterm.js currently drops selection on keyup as we need to handle this case. - this._instanceDisposables.push(DOM.addDisposableListener(this._xterm.element, 'keyup', (event: KeyboardEvent) => { + this._instanceDisposables.push(dom.addDisposableListener(this._xterm.element, 'keyup', (event: KeyboardEvent) => { // Wait until keyup has propogated through the DOM before evaluating the new selection // state. setTimeout(() => { @@ -262,10 +274,10 @@ export class TerminalInstance implements ITerminalInstance { const xtermHelper: HTMLElement = this._xterm.element.querySelector('.xterm-helpers'); const focusTrap: HTMLElement = document.createElement('div'); focusTrap.setAttribute('tabindex', '0'); - DOM.addClass(focusTrap, 'focus-trap'); - this._instanceDisposables.push(DOM.addDisposableListener(focusTrap, 'focus', (event: FocusEvent) => { + dom.addClass(focusTrap, 'focus-trap'); + this._instanceDisposables.push(dom.addDisposableListener(focusTrap, 'focus', (event: FocusEvent) => { let currentElement = focusTrap; - while (!DOM.hasClass(currentElement, 'part')) { + while (!dom.hasClass(currentElement, 'part')) { currentElement = currentElement.parentElement; } const hidePanelElement = currentElement.querySelector('.hide-panel-action'); @@ -273,17 +285,17 @@ export class TerminalInstance implements ITerminalInstance { })); xtermHelper.insertBefore(focusTrap, this._xterm.textarea); - this._instanceDisposables.push(DOM.addDisposableListener(this._xterm.textarea, 'focus', (event: KeyboardEvent) => { + this._instanceDisposables.push(dom.addDisposableListener(this._xterm.textarea, 'focus', (event: KeyboardEvent) => { this._terminalFocusContextKey.set(true); })); - this._instanceDisposables.push(DOM.addDisposableListener(this._xterm.textarea, 'blur', (event: KeyboardEvent) => { + this._instanceDisposables.push(dom.addDisposableListener(this._xterm.textarea, 'blur', (event: KeyboardEvent) => { this._terminalFocusContextKey.reset(); this._refreshSelectionContextKey(); })); - this._instanceDisposables.push(DOM.addDisposableListener(this._xterm.element, 'focus', (event: KeyboardEvent) => { + this._instanceDisposables.push(dom.addDisposableListener(this._xterm.element, 'focus', (event: KeyboardEvent) => { this._terminalFocusContextKey.set(true); })); - this._instanceDisposables.push(DOM.addDisposableListener(this._xterm.element, 'blur', (event: KeyboardEvent) => { + this._instanceDisposables.push(dom.addDisposableListener(this._xterm.element, 'blur', (event: KeyboardEvent) => { this._terminalFocusContextKey.reset(); this._refreshSelectionContextKey(); })); @@ -316,19 +328,40 @@ export class TerminalInstance implements ITerminalInstance { } public hasSelection(): boolean { - return !document.getSelection().isCollapsed; + return this._xterm.hasSelection(); } public copySelection(): void { - if (document.activeElement.classList.contains('xterm')) { - document.execCommand('copy'); + if (this.hasSelection()) { + this._clipboardService.writeText(this._xterm.getSelection()); } else { - this._messageService.show(Severity.Warning, nls.localize('terminal.integrated.copySelection.noSelection', 'Cannot copy terminal selection when terminal does not have focus')); + this._messageService.show(Severity.Warning, nls.localize('terminal.integrated.copySelection.noSelection', 'The terminal has no selection to copy')); } } public clearSelection(): void { - window.getSelection().empty(); + this._xterm.clearSelection(); + } + + public selectAll(): void { + // Focus here to ensure the terminal context key is set + this._xterm.focus(); + this._xterm.selectAll(); + } + + public findNext(term: string): boolean { + return this._xterm.findNext(term); + } + + public findPrevious(term: string): boolean { + return this._xterm.findPrevious(term); + } + + public notifyFindWidgetFocusChanged(isFocused: boolean): void { + // In order to support escape to close the find widget when the terminal + // is focused terminalFocus needs to be true when either the terminal or + // the find widget are focused. + this._terminalFocusContextKey.set(isFocused || document.activeElement === this._xterm.textarea); } public dispose(): void { @@ -336,7 +369,7 @@ export class TerminalInstance implements ITerminalInstance { this._linkHandler.dispose(); } if (this._xterm && this._xterm.element) { - this._hadFocusOnExit = DOM.hasClass(this._xterm.element, 'focus'); + this._hadFocusOnExit = dom.hasClass(this._xterm.element, 'focus'); } if (this._wrapperElement) { this._container.removeChild(this._wrapperElement); @@ -376,20 +409,22 @@ export class TerminalInstance implements ITerminalInstance { } public sendText(text: string, addNewLine: boolean): void { - text = this._sanitizeInput(text); - if (addNewLine && text.substr(text.length - 1) !== '\r') { - text += '\r'; - } - this._process.send({ - event: 'input', - data: text + this._processReady.then(() => { + text = this._sanitizeInput(text); + if (addNewLine && text.substr(text.length - 1) !== '\r') { + text += '\r'; + } + this._process.send({ + event: 'input', + data: text + }); }); } public setVisible(visible: boolean): void { this._isVisible = visible; if (this._wrapperElement) { - DOM.toggleClass(this._wrapperElement, 'active', visible); + dom.toggleClass(this._wrapperElement, 'active', visible); } if (visible && this._xterm) { // Trigger a manual scroll event which will sync the viewport and scroll bar. This is @@ -430,15 +465,15 @@ export class TerminalInstance implements ITerminalInstance { private _refreshSelectionContextKey() { const activePanel = this._panelService.getActivePanel(); - const isFocused = activePanel && activePanel.getId() === TERMINAL_PANEL_ID; - this._terminalHasTextContextKey.set(isFocused && !window.getSelection().isCollapsed); + const isActive = activePanel && activePanel.getId() === TERMINAL_PANEL_ID; + this._terminalHasTextContextKey.set(isActive && this.hasSelection()); } private _sanitizeInput(data: any) { return typeof data === 'string' ? data.replace(TerminalInstance.WINDOWS_EOL_REGEX, '\r') : data; } - protected _getCwd(shell: IShellLaunchConfig, workspace: IWorkspace): string { + protected _getCwd(shell: IShellLaunchConfig, root: Uri): string { if (shell.cwd) { return shell.cwd; } @@ -452,39 +487,40 @@ export class TerminalInstance implements ITerminalInstance { if (customCwd) { if (path.isAbsolute(customCwd)) { cwd = customCwd; - } else if (workspace) { - cwd = path.normalize(path.join(workspace.resource.fsPath, customCwd)); + } else if (root) { + cwd = path.normalize(path.join(root.fsPath, customCwd)); } } } // If there was no custom cwd or it was relative with no workspace if (!cwd) { - cwd = workspace ? workspace.resource.fsPath : os.homedir(); + cwd = root ? root.fsPath : os.homedir(); } return TerminalInstance._sanitizeCwd(cwd); } - protected _createProcess(workspace: IWorkspace, shell: IShellLaunchConfig): void { + protected _createProcess(root: Uri, shell: IShellLaunchConfig): void { const locale = this._configHelper.config.setLocaleVariables ? platform.locale : undefined; if (!shell.executable) { this._configHelper.mergeDefaultShellPathAndArgs(shell); } - const env = TerminalInstance.createTerminalEnv(process.env, shell, this._getCwd(shell, workspace), locale, this._cols, this._rows); + const env = TerminalInstance.createTerminalEnv(process.env, shell, this._getCwd(shell, root), locale, this._cols, this._rows); this._title = shell.name || ''; - this._process = cp.fork(URI.parse(require.toUrl('bootstrap')).fsPath, ['--type=terminal'], { + this._process = cp.fork(Uri.parse(require.toUrl('bootstrap')).fsPath, ['--type=terminal'], { env, - cwd: URI.parse(path.dirname(require.toUrl('../node/terminalProcess'))).fsPath + cwd: Uri.parse(path.dirname(require.toUrl('../node/terminalProcess'))).fsPath }); if (!shell.name) { // Only listen for process title changes when a name is not provided - this._process.on('message', (message) => { + this._messageTitleListener = (message) => { if (message.type === 'title') { this._title = message.content ? message.content : ''; this._onTitleChanged.fire(this._title); } - }); + }; + this._process.on('message', this._messageTitleListener); } this._process.on('message', (message) => { if (message.type === 'pid') { @@ -516,6 +552,7 @@ export class TerminalInstance implements ITerminalInstance { } this._isExiting = true; + this._process = null; let exitCodeMessage: string; if (exitCode) { exitCodeMessage = nls.localize('terminal.integrated.exitedWithCode', 'The terminal process terminated with exit code: {0}', exitCode); @@ -529,7 +566,12 @@ export class TerminalInstance implements ITerminalInstance { if (exitCode) { this._xterm.writeln(exitCodeMessage); } - this._xterm.writeln(nls.localize('terminal.integrated.waitOnExit', 'Press any key to close the terminal')); + let message = typeof this._shellLaunchConfig.waitOnExit === 'string' + ? this._shellLaunchConfig.waitOnExit + : nls.localize('terminal.integrated.waitOnExit', 'Press any key to close the terminal'); + // Bold the message and add an extra new line to make it stand out from the rest of the output + message = `\n\x1b[1m${message}\x1b[0m`; + this._xterm.writeln(message); // Disable all input if the terminal is exiting and listen for next keypress this._xterm.setOption('disableStdin', true); if (this._xterm.textarea) { @@ -559,7 +601,7 @@ export class TerminalInstance implements ITerminalInstance { } private _attachPressAnyKeyToCloseListener() { - this._processDisposables.push(DOM.addDisposableListener(this._xterm.textarea, 'keypress', (event: KeyboardEvent) => { + this._processDisposables.push(dom.addDisposableListener(this._xterm.textarea, 'keypress', (event: KeyboardEvent) => { this.dispose(); event.preventDefault(); })); @@ -587,7 +629,7 @@ export class TerminalInstance implements ITerminalInstance { // Initialize new process const oldTitle = this._title; - this._createProcess(this._contextService.getWorkspace(), shell); + this._createProcess(this._historyService.getLastActiveWorkspaceRoot(), shell); if (oldTitle !== this._title) { this._onTitleChanged.fire(this._title); } @@ -741,13 +783,23 @@ export class TerminalInstance implements ITerminalInstance { this._xterm.resize(this._cols, this._rows); this._xterm.element.style.width = terminalWidth + 'px'; } - if (this._process.connected) { - this._process.send({ - event: 'resize', - cols: this._cols, - rows: this._rows - }); - } + this._processReady.then(() => { + if (this._process && this._process.connected) { + // The child process could aready be terminated + try { + this._process.send({ + event: 'resize', + cols: this._cols, + rows: this._rows + }); + } catch (error) { + // We tried to write to a closed pipe / channel. + if (error.code !== 'EPIPE' && error.code !== 'ERR_IPC_CHANNEL_CLOSED') { + throw (error); + } + } + } + }); } public enableApiOnData(): void { @@ -758,6 +810,21 @@ export class TerminalInstance implements ITerminalInstance { public static setTerminalProcessFactory(factory: ITerminalProcessFactory): void { this._terminalProcessFactory = factory; } + + public setTitle(title: string): void { + const didTitleChange = title !== this._title; + this._title = title; + if (didTitleChange) { + this._onTitleChanged.fire(title); + } + + // If the title was not set by the API, unregister the handler that + // automatically updates the terminal name + if (this._process && this._messageTitleListener) { + this._process.removeListener('message', this._messageTitleListener); + this._messageTitleListener = null; + } + } } registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => { diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalLinkHandler.ts b/src/vs/workbench/parts/terminal/electron-browser/terminalLinkHandler.ts index 49df15b331ac1e726808254fb7e7b20fa8870105..c4ca9ad2726cdf68596e256c626c0a3e9d38ab75 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminalLinkHandler.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminalLinkHandler.ts @@ -35,7 +35,7 @@ replacing space with nonBreakningSpace or space ASCII code - 32. */ const lineAndColumnClause = [ '((\\S*) on line ((\\d+)(, column (\\d+))?))', // (file path) on line 8, column 13 '((\\S*):line ((\\d+)(, column (\\d+))?))', // (file path):line 8, column 13 - '(([^\\s\\(\\)]*)(\\s?\\((\\d+)(,(\\d+))?)\\))', // (file path)(45), (file path) (45), (file path)(45,18), (file path) (45,18) + '(([^\\s\\(\\)]*)(\\s?[\\(\\[](\\d+)(,(\\d+))?)[\\)\\]])', // (file path)(45), (file path) (45), (file path)(45,18), (file path) (45,18) '(([^:\\s\\(\\)<>\'\"\\[\\]]*)(:(\\d+))?(:(\\d+))?)' // (file path):336, (file path):336:9 ].join('|').replace(/ /g, `[${'\u00A0'} ]`); @@ -71,7 +71,6 @@ export class TerminalLinkHandler { const baseLocalLinkClause = _platform === platform.Platform.Windows ? winLocalLinkClause : unixLocalLinkClause; // Append line and column number regex this._localLinkPattern = new RegExp(`${baseLocalLinkClause}(${lineAndColumnClause})`); - this._xterm.setHypertextLinkHandler(this._wrapLinkHandler(() => true)); this._xterm.setHypertextValidationCallback((uri: string, element: HTMLElement, callback: (isValid: boolean) => void) => { this._validateWebLink(uri, element, callback); @@ -226,12 +225,15 @@ export class TerminalLinkHandler { private _resolvePath(link: string): TPromise { link = this._preprocessPath(link); - if (!link) { return TPromise.as(void 0); } const linkUrl = this.extractLinkUrl(link); + if (!linkUrl) { + return TPromise.as(void 0); + } + // Open an editor if the path exists return pfs.fileExists(linkUrl).then(isFile => { if (!isFile) { @@ -292,6 +294,9 @@ export class TerminalLinkHandler { */ public extractLinkUrl(link: string): string { const matches: string[] = this._localLinkRegex.exec(link); + if (!matches) { + return null; + } return matches[1]; } } diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalPanel.ts b/src/vs/workbench/parts/terminal/electron-browser/terminalPanel.ts index 81ed253bd422423c82040f81ac02aadf09bbba1c..99a241e0c565b6f7794d7da42119a05bf790f5c2 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminalPanel.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminalPanel.ts @@ -3,19 +3,19 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import DOM = require('vs/base/browser/dom'); -import nls = require('vs/nls'); -import platform = require('vs/base/common/platform'); +import * as dom from 'vs/base/browser/dom'; +import * as nls from 'vs/nls'; +import * as platform from 'vs/base/common/platform'; import { Action, IAction } from 'vs/base/common/actions'; import { Builder, Dimension } from 'vs/base/browser/builder'; import { IActionItem, Separator } from 'vs/base/browser/ui/actionbar/actionbar'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; +import { IContextMenuService, IContextViewService } from 'vs/platform/contextview/browser/contextView'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { ITerminalService, ITerminalFont, TERMINAL_PANEL_ID } from 'vs/workbench/parts/terminal/common/terminal'; import { IThemeService, ITheme } from 'vs/platform/theme/common/themeService'; +import { TerminalFindWidget } from './terminalFindWidget'; import { ansiColorIdentifiers, TERMINAL_BACKGROUND_COLOR, TERMINAL_FOREGROUND_COLOR } from './terminalColorRegistry'; import { ColorIdentifier } from 'vs/platform/theme/common/colorRegistry'; import { KillTerminalAction, CreateNewTerminalAction, SwitchTerminalInstanceAction, SwitchTerminalInstanceActionItem, CopyTerminalSelectionAction, TerminalPasteAction, ClearTerminalAction } from 'vs/workbench/parts/terminal/electron-browser/terminalActions'; @@ -35,12 +35,13 @@ export class TerminalPanel extends Panel { private _parentDomElement: HTMLElement; private _terminalContainer: HTMLElement; private _themeStyleElement: HTMLElement; + private _findWidget: TerminalFindWidget; constructor( @IConfigurationService private _configurationService: IConfigurationService, @IContextMenuService private _contextMenuService: IContextMenuService, + @IContextViewService private _contextViewService: IContextViewService, @IInstantiationService private _instantiationService: IInstantiationService, - @IKeybindingService private _keybindingService: IKeybindingService, @ITerminalService private _terminalService: ITerminalService, @IThemeService protected themeService: IThemeService, @ITelemetryService telemetryService: ITelemetryService @@ -51,15 +52,19 @@ export class TerminalPanel extends Panel { public create(parent: Builder): TPromise { super.create(parent); this._parentDomElement = parent.getHTMLElement(); - DOM.addClass(this._parentDomElement, 'integrated-terminal'); + dom.addClass(this._parentDomElement, 'integrated-terminal'); this._themeStyleElement = document.createElement('style'); this._fontStyleElement = document.createElement('style'); this._terminalContainer = document.createElement('div'); - DOM.addClass(this._terminalContainer, 'terminal-outer-container'); + dom.addClass(this._terminalContainer, 'terminal-outer-container'); + + this._findWidget = new TerminalFindWidget(this._contextViewService, this._terminalService); + this._parentDomElement.appendChild(this._themeStyleElement); this._parentDomElement.appendChild(this._fontStyleElement); this._parentDomElement.appendChild(this._terminalContainer); + this._parentDomElement.appendChild(this._findWidget.getDomNode()); this._attachEventListeners(); @@ -132,7 +137,8 @@ export class TerminalPanel extends Panel { this._register(a); }); } - this._copyContextMenuAction.enabled = document.activeElement.classList.contains('xterm') && window.getSelection().toString().length > 0; + const activeInstance = this._terminalService.getActiveInstance(); + this._copyContextMenuAction.enabled = activeInstance && activeInstance.hasSelection(); return this._contextMenuActions; } @@ -151,8 +157,16 @@ export class TerminalPanel extends Panel { } } + public focusFindWidget() { + this._findWidget.reveal(); + } + + public hideFindWidget() { + this._findWidget.hide(); + } + private _attachEventListeners(): void { - this._register(DOM.addDisposableListener(this._parentDomElement, 'mousedown', (event: MouseEvent) => { + this._register(dom.addDisposableListener(this._parentDomElement, 'mousedown', (event: MouseEvent) => { if (this._terminalService.terminalInstances.length === 0) { return; } @@ -183,53 +197,55 @@ export class TerminalPanel extends Panel { } } })); - this._register(DOM.addDisposableListener(this._parentDomElement, 'contextmenu', (event: MouseEvent) => { + this._register(dom.addDisposableListener(this._parentDomElement, 'contextmenu', (event: MouseEvent) => { if (!this._cancelContextMenu) { const standardEvent = new StandardMouseEvent(event); let anchor: { x: number, y: number } = { x: standardEvent.posx, y: standardEvent.posy }; this._contextMenuService.showContextMenu({ getAnchor: () => anchor, getActions: () => TPromise.as(this._getContextMenuActions()), - getActionsContext: () => this._parentDomElement, - getKeyBinding: (action) => this._keybindingService.lookupKeybinding(action.id) + getActionsContext: () => this._parentDomElement }); } this._cancelContextMenu = false; })); - this._register(DOM.addDisposableListener(this._parentDomElement, 'click', (event) => { - if (this._terminalService.terminalInstances.length === 0) { + this._register(dom.addDisposableListener(this._parentDomElement, 'click', (event) => { + if (event.which === 3) { return; } - if (event.which !== 3) { + const instance = this._terminalService.getActiveInstance(); + if (instance) { this._terminalService.getActiveInstance().focus(); } })); - this._register(DOM.addDisposableListener(this._parentDomElement, 'keyup', (event: KeyboardEvent) => { + this._register(dom.addDisposableListener(this._parentDomElement, 'keyup', (event: KeyboardEvent) => { if (event.keyCode === 27) { // Keep terminal open on escape event.stopPropagation(); } })); - this._register(DOM.addDisposableListener(this._parentDomElement, DOM.EventType.DROP, (e: DragEvent) => { - if (e.target === this._parentDomElement || DOM.isAncestor(e.target as HTMLElement, this._parentDomElement)) { + this._register(dom.addDisposableListener(this._parentDomElement, dom.EventType.DROP, (e: DragEvent) => { + if (e.target === this._parentDomElement || dom.isAncestor(e.target as HTMLElement, this._parentDomElement)) { if (!e.dataTransfer) { return; } // Check if the file was dragged from the tree explorer - const url = e.dataTransfer.getData('URL'); - let filePath = URI.parse(url).path; - - // Check if the file was dragged from the filesystem - if (!filePath && e.dataTransfer.files.length > 0) { - filePath = e.dataTransfer.files[0].path; + let uri = e.dataTransfer.getData('URL'); + if (uri) { + uri = URI.parse(uri).path; + } else if (e.dataTransfer.files.length > 0) { + // Check if the file was dragged from the filesystem + uri = URI.file(e.dataTransfer.files[0].path).path; } - if (filePath) { - const terminal = this._terminalService.getActiveInstance(); - terminal.sendText(this._wrapPathInQuotes(filePath), false); + if (!uri) { + return; } + + const terminal = this._terminalService.getActiveInstance(); + terminal.sendText(this._preparePathForTerminal(uri), false); } })); } @@ -243,13 +259,8 @@ export class TerminalPanel extends Panel { ansiColorIdentifiers.forEach((colorId: ColorIdentifier, index: number) => { if (colorId) { // should not happen, all indices should have a color defined. let color = theme.getColor(colorId); - let rgba = color.transparent(0.996); css += `.monaco-workbench .panel.integrated-terminal .xterm .xterm-color-${index} { color: ${color}; }` + - `.monaco-workbench .panel.integrated-terminal .xterm .xterm-color-${index}::selection,` + - `.monaco-workbench .panel.integrated-terminal .xterm .xterm-color-${index} *::selection { background-color: ${rgba}; }` + - `.monaco-workbench .panel.integrated-terminal .xterm .xterm-bg-color-${index} { background-color: ${color}; }` + - `.monaco-workbench .panel.integrated-terminal .xterm .xterm-bg-color-${index}::selection,` + - `.monaco-workbench .panel.integrated-terminal .xterm .xterm-bg-color-${index} *::selection { color: ${color}; }`; + `.monaco-workbench .panel.integrated-terminal .xterm .xterm-bg-color-${index} { background-color: ${color}; }`; } }); const bgColor = theme.getColor(TERMINAL_BACKGROUND_COLOR); @@ -258,10 +269,23 @@ export class TerminalPanel extends Panel { } const fgColor = theme.getColor(TERMINAL_FOREGROUND_COLOR); if (fgColor) { - css += `.monaco-workbench .panel.integrated-terminal .xterm { color: ${fgColor}; }`; + css += `.monaco-workbench .panel.integrated-terminal .xterm { color: ${fgColor}; }` + + `.monaco-workbench .panel.integrated-terminal .xterm:not(.xterm-cursor-style-underline):not(.xterm-cursor-style-bar).focus .terminal-cursor,` + + `.monaco-workbench .panel.integrated-terminal .xterm:not(.xterm-cursor-style-underline):not(.xterm-cursor-style-bar):focus .terminal-cursor { background-color: ${fgColor} }` + + `.monaco-workbench .panel.integrated-terminal .xterm:not(.focus):not(:focus) .terminal-cursor { outline-color: ${fgColor}; }` + + `.monaco-workbench .panel.integrated-terminal .xterm.xterm-cursor-style-bar .terminal-cursor::before,` + + `.monaco-workbench .panel.integrated-terminal .xterm.xterm-cursor-style-underline .terminal-cursor::before { background-color: ${fgColor}; }` + + `.monaco-workbench .panel.integrated-terminal .xterm.xterm-cursor-style-bar.focus.xterm-cursor-blink .terminal-cursor::before,` + + `.monaco-workbench .panel.integrated-terminal .xterm.xterm-cursor-style-underline.focus.xterm-cursor-blink .terminal-cursor::before { background-color: ${fgColor}; }`; } + // TODO: Reinstate, see #28397 + // const selectionColor = theme.getColor(TERMINAL_SELECTION_BACKGROUND_COLOR); + // if (selectionColor) { + // css += `.monaco-workbench .panel.integrated-terminal .xterm .xterm-selection div { background-color: ${selectionColor}; }`; + // } this._themeStyleElement.innerHTML = css; + this._findWidget.updateTheme(theme); } private _updateFont(): void { @@ -269,8 +293,8 @@ export class TerminalPanel extends Panel { return; } let newFont = this._terminalService.configHelper.getFont(); - DOM.toggleClass(this._parentDomElement, 'enable-ligatures', this._terminalService.configHelper.config.fontLigatures); - DOM.toggleClass(this._parentDomElement, 'disable-bold', !this._terminalService.configHelper.config.enableBold); + dom.toggleClass(this._parentDomElement, 'enable-ligatures', this._terminalService.configHelper.config.fontLigatures); + dom.toggleClass(this._parentDomElement, 'disable-bold', !this._terminalService.configHelper.config.enableBold); if (!this._font || this._fontsDiffer(this._font, newFont)) { this._fontStyleElement.innerHTML = '.monaco-workbench .panel.integrated-terminal .xterm {' + `font-family: ${newFont.fontFamily};` + @@ -293,9 +317,23 @@ export class TerminalPanel extends Panel { /** * Adds quotes to a path if it contains whitespaces */ - private _wrapPathInQuotes(path: string) { - if (/\s+/.test(path)) { - return `"${path}"`; + private _preparePathForTerminal(path: string) { + if (platform.isWindows) { + if (/\s+/.test(path)) { + return `"${path}"`; + } + return path; + } + path = path.replace(/(%5C|\\)/g, '\\\\'); + const charsToEscape = [ + ' ', '\'', '"', '?', ':', ';', '!', '*', '(', ')', '{', '}', '[', ']' + ]; + for (let i = 0; i < path.length; i++) { + const indexOfChar = charsToEscape.indexOf(path.charAt(i)); + if (indexOfChar >= 0) { + path = `${path.substring(0, i)}\\${path.charAt(i)}${path.substring(i + 1)}`; + i++; // Skip char due to escape char being added + } } return path; } diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalService.ts b/src/vs/workbench/parts/terminal/electron-browser/terminalService.ts index 5c3a969a73a850a64b66fdd6b4434a2ca8e9e9d1..4cf51da5dac17cfceaaab5f9d6f3c770948dbc8a 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminalService.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminalService.ts @@ -16,19 +16,19 @@ import { IWindowIPCService } from 'vs/workbench/services/window/electron-browser import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IConfigurationEditingService, ConfigurationTarget } from 'vs/workbench/services/configuration/common/configurationEditing'; import { IQuickOpenService, IPickOpenEntry, IPickOptions } from 'vs/platform/quickOpen/common/quickOpen'; -import { ITerminalInstance, ITerminalService, IShellLaunchConfig, ITerminalConfigHelper, NEVER_SUGGEST_SELECT_WINDOWS_SHELL_STORAGE_KEY } from 'vs/workbench/parts/terminal/common/terminal'; +import { ITerminalInstance, ITerminalService, IShellLaunchConfig, ITerminalConfigHelper, NEVER_SUGGEST_SELECT_WINDOWS_SHELL_STORAGE_KEY, TERMINAL_PANEL_ID } from 'vs/workbench/parts/terminal/common/terminal'; import { TerminalService as AbstractTerminalService } from 'vs/workbench/parts/terminal/common/terminalService'; import { TerminalConfigHelper } from 'vs/workbench/parts/terminal/electron-browser/terminalConfigHelper'; import { TerminalInstance } from 'vs/workbench/parts/terminal/electron-browser/terminalInstance'; import { TPromise } from 'vs/base/common/winjs.base'; import { IChoiceService } from 'vs/platform/message/common/message'; -import { Severity } from 'vs/editor/common/standalone/standaloneBase'; +import Severity from 'vs/base/common/severity'; import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; import { TERMINAL_DEFAULT_SHELL_WINDOWS } from "vs/workbench/parts/terminal/electron-browser/terminal"; +import { TerminalPanel } from "vs/workbench/parts/terminal/electron-browser/terminalPanel"; export class TerminalService extends AbstractTerminalService implements ITerminalService { private _configHelper: TerminalConfigHelper; - public get configHelper(): ITerminalConfigHelper { return this._configHelper; }; constructor( @@ -69,6 +69,23 @@ export class TerminalService extends AbstractTerminalService implements ITermina return terminalInstance; } + public focusFindWidget(): TPromise { + return this.showPanel(false).then(() => { + let panel = this._panelService.getActivePanel() as TerminalPanel; + panel.focusFindWidget(); + this._findWidgetVisible.set(true); + }); + } + + public hideFindWidget(): void { + const panel = this._panelService.getActivePanel() as TerminalPanel; + if (panel && panel.getId() === TERMINAL_PANEL_ID) { + panel.hideFindWidget(); + this._findWidgetVisible.reset(); + panel.focus(); + } + } + private _suggestShellChange(wasNewTerminalAction?: boolean): void { // Only suggest on Windows since $SHELL works great for macOS/Linux if (!platform.isWindows) { @@ -178,7 +195,7 @@ export class TerminalService extends AbstractTerminalService implements ITermina } return this._validateShellPaths(label, potentialPaths); } - return [label, current]; + return [label, current] as [string, string]; }); } diff --git a/src/vs/workbench/parts/terminal/test/electron-browser/terminalColorRegistry.test.ts b/src/vs/workbench/parts/terminal/test/electron-browser/terminalColorRegistry.test.ts index f2a9ca2fa5291c2a9563bd035d6d7287a38dd4cd..cc2b29482c7307d496ebbe5a90f420aafdd979bd 100644 --- a/src/vs/workbench/parts/terminal/test/electron-browser/terminalColorRegistry.test.ts +++ b/src/vs/workbench/parts/terminal/test/electron-browser/terminalColorRegistry.test.ts @@ -7,7 +7,7 @@ import * as assert from 'assert'; import { Extensions as ThemeingExtensions, IColorRegistry } from 'vs/platform/theme/common/colorRegistry'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { ansiColorIdentifiers, registerColors } from 'vs/workbench/parts/terminal/electron-browser/terminalColorRegistry'; import { ITheme, ThemeType } from 'vs/platform/theme/common/themeService'; diff --git a/src/vs/workbench/parts/terminal/test/electron-browser/terminalConfigHelper.test.ts b/src/vs/workbench/parts/terminal/test/electron-browser/terminalConfigHelper.test.ts index 285bc9025adb6259e396082301dcea509a5d6cde..c4b3e37919a0a73f814f454f2061bad40418e527 100644 --- a/src/vs/workbench/parts/terminal/test/electron-browser/terminalConfigHelper.test.ts +++ b/src/vs/workbench/parts/terminal/test/electron-browser/terminalConfigHelper.test.ts @@ -6,20 +6,23 @@ 'use strict'; import * as assert from 'assert'; -import { IConfigurationService, getConfigurationValue } from 'vs/platform/configuration/common/configuration'; +import { IConfigurationService, getConfigurationValue, IConfigurationValue, IConfigurationOverrides } from 'vs/platform/configuration/common/configuration'; import { Platform } from 'vs/base/common/platform'; import { TPromise } from 'vs/base/common/winjs.base'; import { TerminalConfigHelper } from 'vs/workbench/parts/terminal/electron-browser/terminalConfigHelper'; -import { EDITOR_FONT_DEFAULTS } from "vs/editor/common/config/editorOptions"; +import { EDITOR_FONT_DEFAULTS } from 'vs/editor/common/config/editorOptions'; class MockConfigurationService implements IConfigurationService { public _serviceBrand: any; + public serviceId = IConfigurationService; public constructor(private configuration: any = {}) { } public reloadConfiguration(section?: string): TPromise { return TPromise.as(this.getConfiguration()); } - public lookup(key: string) { return { value: getConfigurationValue(this.getConfiguration(), key), default: getConfigurationValue(this.getConfiguration(), key), user: getConfigurationValue(this.getConfiguration(), key) }; } + public lookup(key: string, overrides?: IConfigurationOverrides): IConfigurationValue { return { value: getConfigurationValue(this.getConfiguration(), key), default: getConfigurationValue(this.getConfiguration(), key), user: getConfigurationValue(this.getConfiguration(), key), workspace: void 0, folder: void 0 }; } + public keys() { return { default: [], user: [], workspace: [] }; } + public values() { return {}; } public getConfiguration(): any { return this.configuration; } - public keys() { return { default: [], user: [] }; } + public getConfigurationData(): any { return null; } public onDidUpdateConfiguration() { return { dispose() { } }; } } diff --git a/src/vs/workbench/parts/terminal/test/electron-browser/terminalInstance.test.ts b/src/vs/workbench/parts/terminal/test/electron-browser/terminalInstance.test.ts index 0542ce7f90238d4a873a9946867156e2b3b490a0..9e1b0f4d5f7340663d336a25b5b91e3ed603008c 100644 --- a/src/vs/workbench/parts/terminal/test/electron-browser/terminalInstance.test.ts +++ b/src/vs/workbench/parts/terminal/test/electron-browser/terminalInstance.test.ts @@ -10,21 +10,22 @@ import * as os from 'os'; import Uri from 'vs/base/common/uri'; import { IMessageService } from 'vs/platform/message/common/message'; import { IStringDictionary } from 'vs/base/common/collections'; -import { IWorkspace, IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; +import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { TerminalInstance } from 'vs/workbench/parts/terminal/electron-browser/terminalInstance'; import { IShellLaunchConfig } from 'vs/workbench/parts/terminal/common/terminal'; import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; -import { TestMessageService, TestContextService } from 'vs/workbench/test/workbenchTestServices'; +import { TestMessageService, TestContextService, TestHistoryService } from 'vs/workbench/test/workbenchTestServices'; import { MockContextKeyService, MockKeybindingService } from 'vs/platform/keybinding/test/common/mockKeybindingService'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; +import { IHistoryService } from "vs/workbench/services/history/common/history"; class TestTerminalInstance extends TerminalInstance { - public _getCwd(shell: IShellLaunchConfig, workspace: IWorkspace): string { - return super._getCwd(shell, workspace); + public _getCwd(shell: IShellLaunchConfig, root: Uri): string { + return super._getCwd(shell, root); } - protected _createProcess(workspace: IWorkspace, shell: IShellLaunchConfig): void { } + protected _createProcess(root: Uri, shell: IShellLaunchConfig): void { } protected _createXterm(): void { } } @@ -35,6 +36,7 @@ suite('Workbench - TerminalInstance', () => { setup(() => { instantiationService = new TestInstantiationService(); instantiationService.stub(IMessageService, new TestMessageService()); + instantiationService.stub(IHistoryService, new TestHistoryService()); }); test('TerminalInstance - createTerminalEnv', function () { @@ -89,6 +91,7 @@ suite('Workbench - TerminalInstance', () => { instantiationService.stub(IWorkspaceContextService, new TestContextService()); instantiationService.stub(IKeybindingService, keybindingService); instantiationService.stub(IContextKeyService, contextKeyService); + instantiationService.stub(IHistoryService, new TestHistoryService()); configHelper = { config: { cwd: null @@ -107,7 +110,7 @@ suite('Workbench - TerminalInstance', () => { }); test('should use to the workspace if it exists', () => { - assertPathsMatch(instance._getCwd({ executable: null, args: [] }, { resource: Uri.file('/foo') }), '/foo'); + assertPathsMatch(instance._getCwd({ executable: null, args: [] }, Uri.file('/foo')), '/foo'); }); test('should use an absolute custom cwd as is', () => { @@ -117,11 +120,11 @@ suite('Workbench - TerminalInstance', () => { test('should normalize a relative custom cwd against the workspace path', () => { configHelper.config.cwd = 'foo'; - assertPathsMatch(instance._getCwd({ executable: null, args: [] }, { resource: Uri.file('/bar') }), '/bar/foo'); + assertPathsMatch(instance._getCwd({ executable: null, args: [] }, Uri.file('/bar')), '/bar/foo'); configHelper.config.cwd = './foo'; - assertPathsMatch(instance._getCwd({ executable: null, args: [] }, { resource: Uri.file('/bar') }), '/bar/foo'); + assertPathsMatch(instance._getCwd({ executable: null, args: [] }, Uri.file('/bar')), '/bar/foo'); configHelper.config.cwd = '../foo'; - assertPathsMatch(instance._getCwd({ executable: null, args: [] }, { resource: Uri.file('/bar') }, ), '/foo'); + assertPathsMatch(instance._getCwd({ executable: null, args: [] }, Uri.file('/bar'), ), '/foo'); }); test('should fall back for relative a custom cwd that doesn\'t have a workspace', () => { @@ -135,7 +138,7 @@ suite('Workbench - TerminalInstance', () => { test('should ignore custom cwd when told to ignore', () => { configHelper.config.cwd = '/foo'; - assertPathsMatch(instance._getCwd({ executable: null, args: [], ignoreConfigurationCwd: true }, { resource: Uri.file('/bar') }), '/bar'); + assertPathsMatch(instance._getCwd({ executable: null, args: [], ignoreConfigurationCwd: true }, Uri.file('/bar')), '/bar'); }); }); }); \ No newline at end of file diff --git a/src/vs/workbench/parts/terminal/test/electron-browser/terminalLinkHandler.test.ts b/src/vs/workbench/parts/terminal/test/electron-browser/terminalLinkHandler.test.ts index a491d6153d174567d6b83764c3ffb06d079d2921..f01eedf7f5482e28c91330f8c3f041b74ad0c67f 100644 --- a/src/vs/workbench/parts/terminal/test/electron-browser/terminalLinkHandler.test.ts +++ b/src/vs/workbench/parts/terminal/test/electron-browser/terminalLinkHandler.test.ts @@ -8,7 +8,8 @@ import * as assert from 'assert'; import { Platform } from 'vs/base/common/platform'; import { TerminalLinkHandler, LineColumnInfo } from 'vs/workbench/parts/terminal/electron-browser/terminalLinkHandler'; -import { IWorkspace, WorkspaceContextService } from 'vs/platform/workspace/common/workspace'; +import { Workspace } from 'vs/platform/workspace/common/workspace'; +import { TestContextService } from 'vs/workbench/test/workbenchTestServices'; import URI from 'vs/base/common/uri'; import * as strings from 'vs/base/common/strings'; import * as path from 'path'; @@ -44,10 +45,9 @@ interface LinkFormatInfo { column?: string; } -class TestWorkspace implements IWorkspace { - resource: URI; - constructor(basePath: string) { - this.resource = new TestURI(basePath); +class TestWorkspace extends Workspace { + constructor(private basePath: string) { + super(basePath, basePath, [new TestURI(basePath)]); } } @@ -97,7 +97,11 @@ suite('Workbench - TerminalLinkHandler', () => { { urlFormat: '{0}({1},{2})', line: '5', column: '3' }, { urlFormat: '{0} ({1},{2})', line: '5', column: '3' }, { urlFormat: '{0}:{1}', line: '5' }, - { urlFormat: '{0}:{1}:{2}', line: '5', column: '3' } + { urlFormat: '{0}:{1}:{2}', line: '5', column: '3' }, + { urlFormat: '{0}[{1}]', line: '5' }, + { urlFormat: '{0} [{1}]', line: '5' }, + { urlFormat: '{0}[{1},{2}]', line: '5', column: '3' }, + { urlFormat: '{0} [{1},{2}]', line: '5', column: '3' } ]; linkUrls.forEach(linkUrl => { @@ -154,7 +158,11 @@ suite('Workbench - TerminalLinkHandler', () => { { urlFormat: '{0}({1},{2})', line: '5', column: '3' }, { urlFormat: '{0} ({1},{2})', line: '5', column: '3' }, { urlFormat: '{0}:{1}', line: '5' }, - { urlFormat: '{0}:{1}:{2}', line: '5', column: '3' } + { urlFormat: '{0}:{1}:{2}', line: '5', column: '3' }, + { urlFormat: '{0}[{1}]', line: '5' }, + { urlFormat: '{0} [{1}]', line: '5' }, + { urlFormat: '{0}[{1},{2}]', line: '5', column: '3' }, + { urlFormat: '{0} [{1},{2}]', line: '5', column: '3' } ]; linkUrls.forEach(linkUrl => { @@ -176,7 +184,7 @@ suite('Workbench - TerminalLinkHandler', () => { suite('preprocessPath', () => { test('Windows', () => { const linkHandler = new TestTerminalLinkHandler(new TestXterm(), Platform.Windows, null, null, - new WorkspaceContextService(new TestWorkspace('C:\\base'))); + new TestContextService(new TestWorkspace('C:\\base'))); let stub = sinon.stub(path, 'join', function (arg1, arg2) { return arg1 + '\\' + arg2; @@ -190,7 +198,7 @@ suite('Workbench - TerminalLinkHandler', () => { test('Linux', () => { const linkHandler = new TestTerminalLinkHandler(new TestXterm(), Platform.Linux, null, null, - new WorkspaceContextService(new TestWorkspace('/base'))); + new TestContextService(new TestWorkspace('/base'))); let stub = sinon.stub(path, 'join', function (arg1, arg2) { return arg1 + '/' + arg2; @@ -203,7 +211,7 @@ suite('Workbench - TerminalLinkHandler', () => { }); test('No Workspace', () => { - const linkHandler = new TestTerminalLinkHandler(new TestXterm(), Platform.Linux, null, null, new WorkspaceContextService(null)); + const linkHandler = new TestTerminalLinkHandler(new TestXterm(), Platform.Linux, null, null, new TestContextService(null)); assert.equal(linkHandler.preprocessPath('./src/file1'), null); assert.equal(linkHandler.preprocessPath('src/file2'), null); diff --git a/src/vs/workbench/parts/themes/electron-browser/themes.contribution.ts b/src/vs/workbench/parts/themes/electron-browser/themes.contribution.ts index 9dfc911fc9928959efdb7920c161d214bdc75e3d..d2525d73ec1f8222702a3ca4f1dee8bc9dfcb87e 100644 --- a/src/vs/workbench/parts/themes/electron-browser/themes.contribution.ts +++ b/src/vs/workbench/parts/themes/electron-browser/themes.contribution.ts @@ -12,7 +12,7 @@ import { firstIndex } from 'vs/base/common/arrays'; import { KeyMod, KeyChord, KeyCode } from 'vs/base/common/keyCodes'; import { SyncActionDescriptor } from 'vs/platform/actions/common/actions'; import { IMessageService, Severity } from 'vs/platform/message/common/message'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { IWorkbenchActionRegistry, Extensions } from 'vs/workbench/common/actionRegistry'; import { IQuickOpenService, IPickOpenEntry } from 'vs/platform/quickOpen/common/quickOpen'; import { IWorkbenchThemeService, COLOR_THEME_SETTING, ICON_THEME_SETTING } from 'vs/workbench/services/themes/common/workbenchThemeService'; diff --git a/src/vs/workbench/parts/themes/test/electron-browser/themes.test.contribution.ts b/src/vs/workbench/parts/themes/test/electron-browser/themes.test.contribution.ts index ca5fe84f64394a8b17de094005edc9cd0fc95dea..dd158a71fd2a318754e97e920db7a53d0e271946 100644 --- a/src/vs/workbench/parts/themes/test/electron-browser/themes.test.contribution.ts +++ b/src/vs/workbench/parts/themes/test/electron-browser/themes.test.contribution.ts @@ -15,11 +15,11 @@ import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiati import { IWorkbenchThemeService, IColorTheme } from 'vs/workbench/services/themes/common/workbenchThemeService'; import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; import { toResource } from 'vs/workbench/common/editor'; -import { ITextMateService } from 'vs/editor/node/textMate/textMateService'; +import { ITextMateService } from 'vs/workbench/services/textMate/electron-browser/textMateService'; import { IGrammar, StackElement } from 'vscode-textmate'; import { TokenizationRegistry } from 'vs/editor/common/modes'; import { TokenMetadata } from 'vs/editor/common/model/tokensBinaryEncoding'; -import { ThemeRule, findMatchingThemeRule } from 'vs/editor/electron-browser/textMate/TMHelper'; +import { ThemeRule, findMatchingThemeRule } from 'vs/workbench/services/textMate/electron-browser/TMHelper'; import { Color } from 'vs/base/common/color'; interface IToken { diff --git a/src/vs/workbench/parts/trust/electron-browser/unsupportedWorkspaceSettings.contribution.ts b/src/vs/workbench/parts/trust/electron-browser/unsupportedWorkspaceSettings.contribution.ts index 6fd59f476f593c0e86052c7666750e9c89cef3ce..8e68052288c59487141638f665f00b30c3250f2b 100644 --- a/src/vs/workbench/parts/trust/electron-browser/unsupportedWorkspaceSettings.contribution.ts +++ b/src/vs/workbench/parts/trust/electron-browser/unsupportedWorkspaceSettings.contribution.ts @@ -10,7 +10,7 @@ import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { TPromise } from 'vs/base/common/winjs.base'; import { Action } from 'vs/base/common/actions'; import { IWorkbenchContributionsRegistry, IWorkbenchContribution, Extensions as WorkbenchExtensions } from 'vs/workbench/common/contributions'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { ILifecycleService } from 'vs/platform/lifecycle/common/lifecycle'; import { IMessageService, Severity } from 'vs/platform/message/common/message'; import { IPreferencesService } from 'vs/workbench/parts/preferences/common/preferences'; diff --git a/src/vs/workbench/parts/update/electron-browser/media/update.contribution.css b/src/vs/workbench/parts/update/electron-browser/media/update.contribution.css new file mode 100644 index 0000000000000000000000000000000000000000..a12923fce44be538a3fb451b9b9f43a245dacb09 --- /dev/null +++ b/src/vs/workbench/parts/update/electron-browser/media/update.contribution.css @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +.update-activity { + -webkit-mask: url('update.svg') no-repeat 50% 50%; + -webkit-mask-size: 22px; +} \ No newline at end of file diff --git a/src/vs/workbench/parts/update/electron-browser/media/update.svg b/src/vs/workbench/parts/update/electron-browser/media/update.svg new file mode 100644 index 0000000000000000000000000000000000000000..3dec2ba50fd1a3dfdb241d947dc9a4adb2ded64c --- /dev/null +++ b/src/vs/workbench/parts/update/electron-browser/media/update.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/vs/workbench/parts/update/electron-browser/releaseNotesEditor.ts b/src/vs/workbench/parts/update/electron-browser/releaseNotesEditor.ts index 466aa77c62dd54a67ca8142f202f1be5e6a3abda..2e829cd45cc11e6ffab5189fd83a0f049ea130cb 100644 --- a/src/vs/workbench/parts/update/electron-browser/releaseNotesEditor.ts +++ b/src/vs/workbench/parts/update/electron-browser/releaseNotesEditor.ts @@ -20,14 +20,15 @@ import { IModeService } from 'vs/editor/common/services/modeService'; import { tokenizeToString } from 'vs/editor/common/modes/textToHtmlTokenizer'; import { IPartService, Parts } from 'vs/workbench/services/part/common/partService'; import { WebviewEditor } from 'vs/workbench/browser/parts/editor/webviewEditor'; -import { IStorageService } from "vs/platform/storage/common/storage"; +import { IStorageService } from 'vs/platform/storage/common/storage'; function renderBody(body: string): string { return ` + - + ${body} @@ -94,7 +95,6 @@ export class ReleaseNotesEditor extends WebviewEditor { .then(renderBody) .then(body => { this.webview = new WebView(this.content, this.partService.getContainer(Parts.EDITOR_PART)); - this.webview.baseUrl = `https://code.visualstudio.com/raw/`; if (this.input && this.input instanceof ReleaseNotesInput) { const state = this.loadViewState(this.input.version); diff --git a/src/vs/workbench/parts/update/electron-browser/update.contribution.ts b/src/vs/workbench/parts/update/electron-browser/update.contribution.ts index 52f121006f5df94bdc573bba0a053e088d5dd5e1..01653b3902a9bd1fabe8c5b9396693c9e6638857 100644 --- a/src/vs/workbench/parts/update/electron-browser/update.contribution.ts +++ b/src/vs/workbench/parts/update/electron-browser/update.contribution.ts @@ -6,20 +6,31 @@ 'use strict'; import * as nls from 'vs/nls'; -import { Registry } from 'vs/platform/platform'; +import 'vs/css!./media/update.contribution'; +import { Registry } from 'vs/platform/registry/common/platform'; +import product from 'vs/platform/node/product'; import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } from 'vs/workbench/common/contributions'; -import { ShowCurrentReleaseNotesAction, UpdateContribution } from 'vs/workbench/parts/update/electron-browser/update'; import { ReleaseNotesEditor } from 'vs/workbench/parts/update/electron-browser/releaseNotesEditor'; import { ReleaseNotesInput } from 'vs/workbench/parts/update/electron-browser/releaseNotesInput'; import { EditorDescriptor } from 'vs/workbench/browser/parts/editor/baseEditor'; +import { IGlobalActivityRegistry, GlobalActivityExtensions } from 'vs/workbench/browser/activity'; import { IEditorRegistry, Extensions as EditorExtensions } from 'vs/workbench/common/editor'; import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; import { IWorkbenchActionRegistry, Extensions as ActionExtensions } from 'vs/workbench/common/actionRegistry'; import { SyncActionDescriptor } from 'vs/platform/actions/common/actions'; import { IConfigurationRegistry, Extensions as ConfigurationExtensions } from 'vs/platform/configuration/common/configurationRegistry'; +import { ShowCurrentReleaseNotesAction, ProductContribution, UpdateContribution, LightUpdateContribution } from './update'; Registry.as(WorkbenchExtensions.Workbench) - .registerWorkbenchContribution(UpdateContribution); + .registerWorkbenchContribution(ProductContribution); + +if (product.quality !== 'stable') { + Registry.as(GlobalActivityExtensions) + .registerActivity(LightUpdateContribution); +} else { + Registry.as(WorkbenchExtensions.Workbench) + .registerWorkbenchContribution(UpdateContribution); +} // Editor const editorDescriptor = new EditorDescriptor( @@ -33,8 +44,7 @@ Registry.as(EditorExtensions.Editors) .registerEditor(editorDescriptor, [new SyncDescriptor(ReleaseNotesInput)]); Registry.as(ActionExtensions.WorkbenchActions) - .registerWorkbenchAction(new SyncActionDescriptor(ShowCurrentReleaseNotesAction, ShowCurrentReleaseNotesAction.ID, ShowCurrentReleaseNotesAction.LABEL), 'Open Release Notes'); - + .registerWorkbenchAction(new SyncActionDescriptor(ShowCurrentReleaseNotesAction, ShowCurrentReleaseNotesAction.ID, ShowCurrentReleaseNotesAction.LABEL), 'Show Release Notes'); // Configuration: Update const configurationRegistry = Registry.as(ConfigurationExtensions.Configuration); diff --git a/src/vs/workbench/parts/update/electron-browser/update.ts b/src/vs/workbench/parts/update/electron-browser/update.ts index 644f7bd40dfb040113f2fcea91c066bb1f0c7d41..26deadbcb105b9a4f6d4f8773e0adeec02ea1b15 100644 --- a/src/vs/workbench/parts/update/electron-browser/update.ts +++ b/src/vs/workbench/parts/update/electron-browser/update.ts @@ -8,24 +8,28 @@ import nls = require('vs/nls'); import severity from 'vs/base/common/severity'; import { TPromise } from 'vs/base/common/winjs.base'; -import { Action } from 'vs/base/common/actions'; +import { IAction, Action } from 'vs/base/common/actions'; +import { Separator } from 'vs/base/browser/ui/actionbar/actionbar'; import { IMessageService, CloseAction, Severity } from 'vs/platform/message/common/message'; import pkg from 'vs/platform/node/package'; import product from 'vs/platform/node/product'; import URI from 'vs/base/common/uri'; import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; +import { IActivityBarService, NumberBadge } from 'vs/workbench/services/activity/common/activityBarService'; import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; import { ReleaseNotesInput } from 'vs/workbench/parts/update/electron-browser/releaseNotesInput'; +import { IGlobalActivity } from 'vs/workbench/browser/activity'; import { IRequestService } from 'vs/platform/request/node/request'; import { asText } from 'vs/base/node/request'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { KeybindingIO } from 'vs/workbench/services/keybinding/common/keybindingIO'; import { IOpenerService } from 'vs/platform/opener/common/opener'; +import { ICommandService } from 'vs/platform/commands/common/commands'; import { IWorkbenchContribution } from 'vs/workbench/common/contributions'; import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; -import { IUpdateService } from 'vs/platform/update/common/update'; +import { IUpdateService, State as UpdateState } from 'vs/platform/update/common/update'; import * as semver from 'semver'; -import { OS } from 'vs/base/common/platform'; +import { OS, isLinux, isWindows } from 'vs/base/common/platform'; class ApplyUpdateAction extends Action { constructor( @IUpdateService private updateService: IUpdateService) { @@ -189,24 +193,22 @@ const LinkAction = (id: string, message: string, licenseUrl: string) => new Acti () => { window.open(licenseUrl); return TPromise.as(null); } ); -export class UpdateContribution implements IWorkbenchContribution { +export class ProductContribution implements IWorkbenchContribution { private static KEY = 'releaseNotes/lastVersion'; - getId() { return 'vs.update'; } + getId() { return 'vs.product'; } constructor( @IStorageService storageService: IStorageService, @IInstantiationService instantiationService: IInstantiationService, @IMessageService messageService: IMessageService, - @IUpdateService updateService: IUpdateService, @IWorkbenchEditorService editorService: IWorkbenchEditorService ) { - const lastVersion = storageService.get(UpdateContribution.KEY, StorageScope.GLOBAL, ''); + const lastVersion = storageService.get(ProductContribution.KEY, StorageScope.GLOBAL, ''); - // was there an update? + // was there an update? if so, open release notes if (product.releaseNotesUrl && lastVersion && pkg.version !== lastVersion) { - instantiationService.invokeFunction(loadReleaseNotes, pkg.version) - .then( + instantiationService.invokeFunction(loadReleaseNotes, pkg.version).then( text => editorService.openEditor(instantiationService.createInstance(ReleaseNotesInput, pkg.version, text), { pinned: true }), () => { messageService.show(Severity.Info, { @@ -230,8 +232,19 @@ export class UpdateContribution implements IWorkbenchContribution { }); } - storageService.store(UpdateContribution.KEY, pkg.version, StorageScope.GLOBAL); + storageService.store(ProductContribution.KEY, pkg.version, StorageScope.GLOBAL); + } +} + +export class UpdateContribution implements IWorkbenchContribution { + + getId() { return 'vs.update'; } + constructor( + @IInstantiationService instantiationService: IInstantiationService, + @IMessageService messageService: IMessageService, + @IUpdateService updateService: IUpdateService + ) { updateService.onUpdateReady(update => { const applyUpdateAction = instantiationService.createInstance(ApplyUpdateAction); const releaseNotesAction = instantiationService.createInstance(ShowReleaseNotesAction, false, update.version); @@ -262,4 +275,91 @@ export class UpdateContribution implements IWorkbenchContribution { updateService.onError(err => messageService.show(severity.Error, err)); } +} + +export class LightUpdateContribution implements IGlobalActivity { + + private static readonly showCommandsId = 'workbench.action.showCommands'; + private static readonly openSettingsId = 'workbench.action.openGlobalSettings'; + private static readonly openKeybindingsId = 'workbench.action.openGlobalKeybindings'; + private static readonly selectColorThemeId = 'workbench.action.selectTheme'; + private static readonly selectIconThemeId = 'workbench.action.selectIconTheme'; + + get id() { return 'vs.update'; } + get name() { return ''; } + get cssClass() { return 'update-activity'; } + + constructor( + @IStorageService storageService: IStorageService, + @ICommandService private commandService: ICommandService, + @IInstantiationService instantiationService: IInstantiationService, + @IMessageService messageService: IMessageService, + @IUpdateService private updateService: IUpdateService, + @IWorkbenchEditorService editorService: IWorkbenchEditorService, + @IActivityBarService activityBarService: IActivityBarService + ) { + const addBadge = () => { + const badge = new NumberBadge(1, () => nls.localize('updateIsReady', "New update available.")); + activityBarService.showGlobalActivity(this.id, badge); + }; + if (isLinux) { + this.updateService.onUpdateAvailable(() => addBadge()); + } else { + this.updateService.onUpdateReady(() => addBadge()); + } + + this.updateService.onError(err => messageService.show(severity.Error, err)); + + this.updateService.onUpdateNotAvailable(explicit => { + if (!explicit) { + return; + } + + messageService.show(severity.Info, nls.localize('noUpdatesAvailable', "There are no updates currently available.")); + }); + } + + getActions(): IAction[] { + return [ + new Action(LightUpdateContribution.showCommandsId, nls.localize('commandPalette', "Command Palette..."), undefined, true, () => this.commandService.executeCommand(LightUpdateContribution.showCommandsId)), + new Separator(), + new Action(LightUpdateContribution.openSettingsId, nls.localize('settings', "Settings"), null, true, () => this.commandService.executeCommand(LightUpdateContribution.openSettingsId)), + new Action(LightUpdateContribution.openKeybindingsId, nls.localize('keyboardShortcuts', "Keyboard Shortcuts"), null, true, () => this.commandService.executeCommand(LightUpdateContribution.openKeybindingsId)), + new Separator(), + new Action(LightUpdateContribution.selectColorThemeId, nls.localize('selectTheme.label', "Color Theme"), null, true, () => this.commandService.executeCommand(LightUpdateContribution.selectColorThemeId)), + new Action(LightUpdateContribution.selectIconThemeId, nls.localize('themes.selectIconTheme.label', "File Icon Theme"), null, true, () => this.commandService.executeCommand(LightUpdateContribution.selectIconThemeId)), + new Separator(), + this.getUpdateAction() + ]; + } + + private getUpdateAction(): IAction { + switch (this.updateService.state) { + case UpdateState.Uninitialized: + return new Action('update.notavailable', nls.localize('not available', "Updates Not Available"), undefined, false); + + case UpdateState.CheckingForUpdate: + return new Action('update.checking', nls.localize('checkingForUpdates', "Checking For Updates..."), undefined, false); + + case UpdateState.UpdateAvailable: + if (isLinux) { + return new Action('update.linux.available', nls.localize('DownloadUpdate', "Download Available Update"), undefined, true, () => + this.updateService.quitAndInstall()); + } + + const updateAvailableLabel = isWindows + ? nls.localize('DownloadingUpdate', "Downloading Update...") + : nls.localize('InstallingUpdate', "Installing Update..."); + + return new Action('update.available', updateAvailableLabel, undefined, false); + + case UpdateState.UpdateDownloaded: + return new Action('update.restart', nls.localize('restartToUpdate', "Restart To Update..."), undefined, true, () => + this.updateService.quitAndInstall()); + + default: + return new Action('update.check', nls.localize('checkForUpdates', "Check for Updates..."), undefined, this.updateService.state === UpdateState.Idle, () => + this.updateService.checkForUpdates(true)); + } + } } \ No newline at end of file diff --git a/src/vs/workbench/parts/views/browser/treeView.ts b/src/vs/workbench/parts/views/browser/treeView.ts index c3f348254946781b31615eabbdd9b91e0159e1fe..84c376d4bd23ff5917d3ebc236a153fb638ed212 100644 --- a/src/vs/workbench/parts/views/browser/treeView.ts +++ b/src/vs/workbench/parts/views/browser/treeView.ts @@ -6,7 +6,6 @@ import 'vs/css!./media/views'; import Event, { Emitter } from 'vs/base/common/event'; import { IDisposable, dispose, empty as EmptyDisposable, toDisposable } from 'vs/base/common/lifecycle'; -import { CollapsibleViewletView } from 'vs/workbench/browser/viewlet'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { TPromise } from 'vs/base/common/winjs.base'; import * as DOM from 'vs/base/browser/dom'; @@ -25,27 +24,28 @@ import { createActionItem, fillInActions } from 'vs/platform/actions/browser/men import { IProgressService } from 'vs/platform/progress/common/progress'; import { ITree, IDataSource, IRenderer, ContextMenuEvent } from 'vs/base/parts/tree/browser/tree'; import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey'; -import { ResolvedKeybinding } from 'vs/base/common/keyCodes'; import { ActionItem } from 'vs/base/browser/ui/actionbar/actionbar'; -import { ViewsRegistry, ITreeViewDataProvider, IViewOptions, ITreeItem, TreeItemCollapsibleState } from 'vs/workbench/parts/views/browser/views'; +import { ViewsRegistry } from 'vs/workbench/parts/views/browser/viewsRegistry'; +import { ITreeViewDataProvider, ITreeItem, TreeItemCollapsibleState, TreeViewItemHandleArg } from 'vs/workbench/parts/views/common/views'; import { IExtensionService } from 'vs/platform/extensions/common/extensions'; -import { CollapsibleState } from 'vs/base/browser/ui/splitview/splitview'; +import { CollapsibleState, ViewSizing } from 'vs/base/browser/ui/splitview/splitview'; +import { CollapsibleView, IViewletViewOptions, IViewOptions } from 'vs/workbench/parts/views/browser/views'; import { ICommandService } from 'vs/platform/commands/common/commands'; -export class TreeView extends CollapsibleViewletView { +export class TreeView extends CollapsibleView { private menus: Menus; private viewFocusContext: IContextKey; private activated: boolean = false; private treeInputPromise: TPromise; + private dataProviderRegisteredListener: IDisposable; private dataProviderElementChangeListener: IDisposable; private disposables: IDisposable[] = []; constructor( - readonly id: string, - private options: IViewOptions, - @IMessageService messageService: IMessageService, + private options: IViewletViewOptions, + @IMessageService private messageService: IMessageService, @IKeybindingService keybindingService: IKeybindingService, @IContextMenuService contextMenuService: IContextMenuService, @IInstantiationService private instantiationService: IInstantiationService, @@ -55,13 +55,13 @@ export class TreeView extends CollapsibleViewletView { @IExtensionService private extensionService: IExtensionService, @ICommandService private commandService: ICommandService ) { - super(options.actionRunner, options.collapsed, options.name, messageService, keybindingService, contextMenuService); + super({ ...(options as IViewOptions), ariaHeaderLabel: options.name, sizing: ViewSizing.Flexible, collapsed: options.collapsed === void 0 ? true : options.collapsed }, keybindingService, contextMenuService); this.menus = this.instantiationService.createInstance(Menus, this.id); this.viewFocusContext = this.contextKeyService.createKey(this.id, void 0); this.menus.onDidChangeTitle(() => this.updateActions(), this, this.disposables); this.themeService.onThemeChange(() => this.tree.refresh() /* soft refresh */, this, this.disposables); if (!options.collapsed) { - this.triggerActivation(); + this.activate(); } } @@ -76,19 +76,21 @@ export class TreeView extends CollapsibleViewletView { DOM.addClass(this.treeContainer, 'tree-explorer-viewlet-tree-view'); this.tree = this.createViewer($(this.treeContainer)); + this.setInput(); } protected changeState(state: CollapsibleState): void { super.changeState(state); if (state === CollapsibleState.EXPANDED) { - this.triggerActivation(); + this.activate(); } } - private triggerActivation() { + private activate() { if (!this.activated && this.extensionService) { this.extensionService.activateByEvent(`onView:${this.id}`); this.activated = true; + this.setInput(); } } @@ -122,29 +124,30 @@ export class TreeView extends CollapsibleViewletView { return createActionItem(action, this.keybindingService, this.messageService); } - public create(): TPromise { - return this.setInput(); - } - public setVisible(visible: boolean): TPromise { return super.setVisible(visible); } - public setInput(): TPromise { - if (this.listenToDataProvider()) { - this.treeInputPromise = this.tree.setInput(new Root()); + private setInput(): TPromise { + if (this.tree) { + if (!this.treeInputPromise) { + if (this.listenToDataProvider()) { + this.treeInputPromise = this.tree.setInput(new Root()); + } else { + this.treeInputPromise = new TPromise((c, e) => { + this.dataProviderRegisteredListener = ViewsRegistry.onTreeViewDataProviderRegistered(id => { + if (this.id === id) { + if (this.listenToDataProvider()) { + this.tree.setInput(new Root()).then(() => c(null)); + this.dataProviderRegisteredListener.dispose(); + } + } + }); + }); + } + } return this.treeInputPromise; } - this.treeInputPromise = new TPromise((c, e) => { - const disposable = ViewsRegistry.onTreeViewDataProviderRegistered(id => { - if (this.id === id) { - if (this.listenToDataProvider()) { - this.tree.setInput(new Root()).then(() => c(null)); - disposable.dispose(); - } - } - }); - }); return TPromise.as(null); } @@ -170,8 +173,8 @@ export class TreeView extends CollapsibleViewletView { private onSelection(): void { const selection: ITreeItem = this.tree.getSelection()[0]; if (selection) { - if (selection.commandId) { - this.commandService.executeCommand(selection.commandId, { treeViewId: this.id, treeItemHandle: selection.handle }); + if (selection.command) { + this.commandService.executeCommand(selection.command.id, ...(selection.command.arguments || [])); } } } @@ -183,6 +186,13 @@ export class TreeView extends CollapsibleViewletView { } dispose(): void { + if (this.dataProviderRegisteredListener) { + this.dataProviderRegisteredListener.dispose(); + } + dispose(this.disposables); + if (this.dataProviderElementChangeListener) { + this.dataProviderElementChangeListener.dispose(); + } dispose(this.disposables); super.dispose(); } @@ -318,34 +328,26 @@ class TreeController extends DefaultController { }, getActionItem: (action) => { - const keybinding = this._keybindingFor(action); + const keybinding = this._keybindingService.lookupKeybinding(action.id); if (keybinding) { return new ActionItem(action, action, { label: true, keybinding: keybinding.getLabel() }); } return null; }, - getKeyBinding: (action): ResolvedKeybinding => { - return this._keybindingFor(action); - }, - onHide: (wasCancelled?: boolean) => { if (wasCancelled) { tree.DOMFocus(); } }, - getActionsContext: () => ({ treeViewId: this.treeViewId, treeItemHandle: node.handle }), + getActionsContext: () => ({ $treeViewId: this.treeViewId, $treeItemHandle: node.handle }), actionRunner: new MultipleSelectionActionRunner(() => tree.getSelection()) }); return true; } - - private _keybindingFor(action: IAction): ResolvedKeybinding { - return this._keybindingService.lookupKeybinding(action.id); - } } class MultipleSelectionActionRunner extends ActionRunner { @@ -422,7 +424,7 @@ class Menus implements IDisposable { } getResourceContextActions(element: ITreeItem): IAction[] { - return this.getActions(MenuId.ViewItemContext, { key: 'item', value: element.contextValue }).secondary; + return this.getActions(MenuId.ViewItemContext, { key: 'viewItem', value: element.contextValue }).secondary; } private getActions(menuId: MenuId, context: { key: string, value: string }): { primary: IAction[]; secondary: IAction[]; } { diff --git a/src/vs/workbench/parts/views/browser/views.ts b/src/vs/workbench/parts/views/browser/views.ts index 927059f19775738501836cb16e9eed258a45f4b9..bdfe2c442331db0c3afeb240b0d139f8796e85d1 100644 --- a/src/vs/workbench/parts/views/browser/views.ts +++ b/src/vs/workbench/parts/views/browser/views.ts @@ -3,143 +3,644 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ +import * as nls from 'vs/nls'; import { TPromise } from 'vs/base/common/winjs.base'; -import Event, { Emitter } from 'vs/base/common/event'; -import { IActionRunner } from 'vs/base/common/actions'; -import { IViewletView as IView } from 'vs/workbench/browser/viewlet'; +import { IThemable, attachStyler } from 'vs/platform/theme/common/styler'; +import * as errors from 'vs/base/common/errors'; +import * as DOM from 'vs/base/browser/dom'; +import { $, Dimension, Builder } from 'vs/base/browser/builder'; +import { Scope } from 'vs/workbench/common/memento'; +import { dispose, IDisposable } from 'vs/base/common/lifecycle'; +import { IAction, IActionRunner } from 'vs/base/common/actions'; +import { IActionItem, ActionsOrientation, Separator } from 'vs/base/browser/ui/actionbar/actionbar'; +import { Registry } from 'vs/platform/registry/common/platform'; +import { prepareActions } from 'vs/workbench/browser/actions'; +import { Viewlet, ViewletRegistry, Extensions } from 'vs/workbench/browser/viewlet'; +import { ITree } from 'vs/base/parts/tree/browser/tree'; +import { DelayedDragHandler } from 'vs/base/browser/dnd'; +import { ToolBar } from 'vs/base/browser/ui/toolbar/toolbar'; +import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; +import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; +import { AbstractCollapsibleView, CollapsibleState, IView as IBaseView, SplitView, ViewSizing } from 'vs/base/browser/ui/splitview/splitview'; +import { ViewsRegistry, ViewLocation, IViewDescriptor } from 'vs/workbench/parts/views/browser/viewsRegistry'; +import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; +import { IThemeService } from 'vs/platform/theme/common/themeService'; +import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; +import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; +import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; +import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; +import { StandardMouseEvent } from 'vs/base/browser/mouseEvent'; +import { SIDE_BAR_SECTION_HEADER_FOREGROUND, SIDE_BAR_SECTION_HEADER_BACKGROUND } from "vs/workbench/common/theme"; +import { contrastBorder } from "vs/platform/theme/common/colorRegistry"; -export class ViewLocation { +export interface IViewOptions { - static readonly Explorer = new ViewLocation('explorer'); + id: string; - constructor(private _id: string) { - } + name: string; + + actionRunner: IActionRunner; + + collapsed: boolean; - get id(): string { - return this._id; - } } -export enum TreeItemCollapsibleState { - Collapsed = 1, - Expanded = 2 +export interface IViewConstructorSignature { + + new (options: IViewOptions, ...services: { _serviceBrand: any; }[]): IView; + } -export interface IViewOptions { +export interface IView extends IBaseView, IThemable { + + id: string; + name: string; - actionRunner: IActionRunner; - collapsed: boolean; + + create(): TPromise; + + setVisible(visible: boolean): TPromise; + + isVisible(): boolean; + + getActions(): IAction[]; + + getSecondaryActions(): IAction[]; + + getActionItem(action: IAction): IActionItem; + + showHeader(): boolean; + + hideHeader(): boolean; + + focusBody(): void; + + isExpanded(): boolean; + + expand(): void; + + collapse(): void; + + getOptimalWidth(): number; + + shutdown(): void; } -export interface IViewConstructorSignature { +export interface ICollapsibleViewOptions extends IViewOptions { + + ariaHeaderLabel?: string; + + sizing: ViewSizing; - new (id: string, options: IViewOptions, ...services: { _serviceBrand: any; }[]): IView; + initialBodySize?: number; } -export interface IViewDescriptor { +export abstract class CollapsibleView extends AbstractCollapsibleView implements IView { readonly id: string; - readonly name: string; - readonly location: ViewLocation; + protected treeContainer: HTMLElement; + protected tree: ITree; + protected toDispose: IDisposable[]; + protected toolBar: ToolBar; + protected actionRunner: IActionRunner; + protected isDisposed: boolean; + + private _isVisible: boolean; + + private dragHandler: DelayedDragHandler; + + constructor( + options: ICollapsibleViewOptions, + protected keybindingService: IKeybindingService, + protected contextMenuService: IContextMenuService + ) { + super({ + ariaHeaderLabel: options.ariaHeaderLabel, + sizing: options.sizing, + bodySize: options.initialBodySize ? options.initialBodySize : 4 * 22, + initialState: options.collapsed ? CollapsibleState.COLLAPSED : CollapsibleState.EXPANDED, + }); + + this.id = options.id; + this.name = options.name; + this.actionRunner = options.actionRunner; + this.toDispose = []; + } - readonly ctor: IViewConstructorSignature; + protected changeState(state: CollapsibleState): void { + this.updateTreeVisibility(this.tree, state === CollapsibleState.EXPANDED); - readonly order?: number; + super.changeState(state); + } -} + public create(): TPromise { + return TPromise.as(null); + } + + public renderHeader(container: HTMLElement): void { + + // Tool bar + this.toolBar = new ToolBar($('div.actions').appendTo(container).getHTMLElement(), this.contextMenuService, { + orientation: ActionsOrientation.HORIZONTAL, + actionItemProvider: (action) => this.getActionItem(action), + ariaLabel: nls.localize('viewToolbarAriaLabel', "{0} actions", this.name), + getKeyBinding: (action) => this.keybindingService.lookupKeybinding(action.id) + }); + this.toolBar.actionRunner = this.actionRunner; + this.updateActions(); + + // Expand on drag over + this.dragHandler = new DelayedDragHandler(container, () => { + if (!this.isExpanded()) { + this.expand(); + } + }); + } + + protected updateActions(): void { + this.toolBar.setActions(prepareActions(this.getActions()), prepareActions(this.getSecondaryActions()))(); + } -export interface ITreeItem { + protected renderViewTree(container: HTMLElement): HTMLElement { + const treeContainer = document.createElement('div'); + container.appendChild(treeContainer); - handle: number; + return treeContainer; + } - label: string; + public getViewer(): ITree { + return this.tree; + } - icon?: string; + public isVisible(): boolean { + return this._isVisible; + } - iconDark?: string; + public setVisible(visible: boolean): TPromise { + if (this._isVisible !== visible) { + this._isVisible = visible; + this.updateTreeVisibility(this.tree, visible && this.state === CollapsibleState.EXPANDED); + } - contextValue?: string; + return TPromise.as(null); + } - commandId?: string; + public focusBody(): void { + this.focusTree(); + } - children?: ITreeItem[]; + protected reveal(element: any, relativeTop?: number): TPromise { + if (!this.tree) { + return TPromise.as(null); // return early if viewlet has not yet been created + } - collapsibleState?: TreeItemCollapsibleState; -} + return this.tree.reveal(element, relativeTop); + } + + public layoutBody(size: number): void { + if (this.tree) { + this.treeContainer.style.height = size + 'px'; + this.tree.layout(size); + } + } -export interface ITreeViewDataProvider { + public getActions(): IAction[] { + return []; + } - onDidChange: Event; + public getSecondaryActions(): IAction[] { + return []; + } - getElements(): TPromise; + public getActionItem(action: IAction): IActionItem { + return null; + } - getChildren(element: ITreeItem): TPromise; + public shutdown(): void { + // Subclass to implement + } + public getOptimalWidth(): number { + return 0; + } + + public dispose(): void { + this.isDisposed = true; + this.treeContainer = null; + + if (this.tree) { + this.tree.dispose(); + } + + if (this.dragHandler) { + this.dragHandler.dispose(); + } + + this.toDispose = dispose(this.toDispose); + + if (this.toolBar) { + this.toolBar.dispose(); + } + + super.dispose(); + } + + private updateTreeVisibility(tree: ITree, isVisible: boolean): void { + if (!tree) { + return; + } + + if (isVisible) { + $(tree.getHTMLElement()).show(); + } else { + $(tree.getHTMLElement()).hide(); // make sure the tree goes out of the tabindex world by hiding it + } + + if (isVisible) { + tree.onVisible(); + } else { + tree.onHidden(); + } + } + + private focusTree(): void { + if (!this.tree) { + return; // return early if viewlet has not yet been created + } + + // Make sure the current selected element is revealed + const selection = this.tree.getSelection(); + if (selection.length > 0) { + this.reveal(selection[0], 0.5).done(null, errors.onUnexpectedError); + } + + // Pass Focus to Viewer + this.tree.DOMFocus(); + } } -export interface IViewsRegistry { +export interface IViewletViewOptions extends IViewOptions { - readonly onViewsRegistered: Event; + viewletSettings: object; - readonly onTreeViewDataProviderRegistered: Event; +} - registerViews(views: IViewDescriptor[]): void; +interface IViewState { - registerTreeViewDataProvider(id: string, factory: ITreeViewDataProvider): void; + collapsed: boolean; - getViews(loc: ViewLocation): IViewDescriptor[]; + size: number; - getTreeViewDataProvider(id: string): ITreeViewDataProvider; + isHidden: boolean; } -export const ViewsRegistry: IViewsRegistry = new class { +export class ComposedViewsViewlet extends Viewlet { + + protected viewletContainer: HTMLElement; + protected lastFocusedView: IView; + + private splitView: SplitView; + protected views: IView[]; + private dimension: Dimension; + private viewletSettings: object; + + private readonly viewsContextKeys: Set = new Set(); + private readonly viewsStates: Map; + + constructor( + id: string, + private location: ViewLocation, + private viewletStateStorageId: string, + @ITelemetryService telemetryService: ITelemetryService, + @IStorageService protected storageService: IStorageService, + @IInstantiationService protected instantiationService: IInstantiationService, + @IThemeService themeService: IThemeService, + @IWorkspaceContextService protected contextService: IWorkspaceContextService, + @IContextKeyService protected contextKeyService: IContextKeyService, + @IContextMenuService private contextMenuService: IContextMenuService + ) { + super(id, telemetryService, themeService); + + this.views = []; + this.viewletSettings = this.getMemento(storageService, Scope.WORKSPACE); + this.viewsStates = this.loadViewsStates(); + + this._register(ViewsRegistry.onViewsRegistered(() => this.onViewDescriptorsChanged())); + this._register(ViewsRegistry.onViewsDeregistered(() => this.onViewDescriptorsChanged())); + this._register(contextKeyService.onDidChangeContext(keys => this.onContextChanged(keys))); + } - private _onViewsRegistered: Emitter = new Emitter(); - readonly onViewsRegistered: Event = this._onViewsRegistered.event; + public create(parent: Builder): TPromise { + super.create(parent); - private _onTreeViewDataProviderRegistered: Emitter = new Emitter(); - readonly onTreeViewDataProviderRegistered: Event = this._onTreeViewDataProviderRegistered.event; + this.viewletContainer = DOM.append(parent.getHTMLElement(), DOM.$('')); + this.splitView = this._register(new SplitView(this.viewletContainer)); + this._register(this.splitView.onFocus((view: IView) => this.lastFocusedView = view)); + this._register(DOM.addDisposableListener(this.viewletContainer, 'contextmenu', e => this.onContextMenu(new StandardMouseEvent(e)))); - private _views: Map = new Map(); - private _treeViewDataPoviders: Map = new Map(); + return this.onViewDescriptorsChanged() + .then(() => { + this.lastFocusedView = this.views[0]; + this.focus(); + }); + } + + public getTitle(): string { + let title = Registry.as(Extensions.Viewlets).getViewlet(this.getId()).name; + if (this.views.length === 1) { + title += ': ' + this.views[0].name; + } + return title; + } + + public getActions(): IAction[] { + if (this.views.length === 1) { + return this.views[0].getActions(); + } + return []; + } + + public getSecondaryActions(): IAction[] { + let actions = []; + if (this.views.length === 1) { + actions = this.views[0].getSecondaryActions(); + } + + if (actions.length) { + actions.push(new Separator()); + } - registerViews(viewDescriptors: IViewDescriptor[]): void { - if (viewDescriptors.length) { - for (const viewDescriptor of viewDescriptors) { - let views = this._views.get(viewDescriptor.location); - if (!views) { - views = []; - this._views.set(viewDescriptor.location, views); + actions.push(...this.getToggleVisibilityActions(this.getViewDescriptorsFromRegistry())); + + return actions; + } + + public setVisible(visible: boolean): TPromise { + return super.setVisible(visible) + .then(() => TPromise.join(this.views.filter(view => view.isVisible() !== visible) + .map((view) => view.setVisible(visible)))) + .then(() => void 0); + } + + public focus(): void { + super.focus(); + if (this.lastFocusedView) { + this.lastFocusedView.focus(); + } + } + + public layout(dimension: Dimension): void { + this.dimension = dimension; + this.layoutViews(); + } + + public getOptimalWidth(): number { + const additionalMargin = 16; + const optimalWidth = Math.max(...this.views.map(view => view.getOptimalWidth() || 0)); + return optimalWidth + additionalMargin; + } + + public shutdown(): void { + this.saveViewsStates(); + this.views.forEach((view) => view.shutdown()); + super.shutdown(); + } + + private layoutViews(): void { + this.splitView.layout(this.dimension.height); + for (const view of this.views) { + let viewState = this.createViewState(view); + this.viewsStates.set(view.id, viewState); + } + } + + private onContextMenu(event: StandardMouseEvent): void { + let anchor: { x: number, y: number } = { x: event.posx, y: event.posy }; + this.contextMenuService.showContextMenu({ + getAnchor: () => anchor, + getActions: () => TPromise.as(this.getSecondaryActions()), + }); + } + + private getToggleVisibilityActions(viewDescriptors: IViewDescriptor[]): IAction[] { + // return viewDescriptors.map(viewDescriptor => ({ + // id: `${viewDescriptor.id}.toggleVisibility`, + // label: viewDescriptor.name, + // checked: this.isCurrentlyVisible(viewDescriptor), + // enabled: this.contextKeyService.contextMatchesRules(viewDescriptor.when), + // run: () => this.toggleViewVisibility(viewDescriptor) + // })); + return []; + } + + protected toggleViewVisibility(viewDescriptor: IViewDescriptor): void { + const view = this.getView(viewDescriptor.id); + let viewState = this.viewsStates.get(viewDescriptor.id); + if (view) { + viewState = viewState || this.createViewState(view); + viewState.isHidden = true; + } else { + viewState = viewState || { collapsed: true, size: void 0, isHidden: false }; + viewState.isHidden = false; + } + this.viewsStates.set(viewDescriptor.id, viewState); + this.updateViews(); + } + + private onViewDescriptorsChanged(): TPromise { + this.viewsContextKeys.clear(); + for (const viewDescriptor of this.getViewDescriptorsFromRegistry()) { + if (viewDescriptor.when) { + for (const key of viewDescriptor.when.keys()) { + this.viewsContextKeys.add(key); } - views.push(viewDescriptor); } - this._onViewsRegistered.fire(viewDescriptors); } + return this.updateViews(); } - registerTreeViewDataProvider(id: string, factory: ITreeViewDataProvider) { - if (!this.isViewRegistered(id)) { - // TODO: throw error + private onContextChanged(keys: string[]): void { + if (!keys) { + return; + } + + let hasToUpdate: boolean = false; + for (const key of keys) { + if (this.viewsContextKeys.has(key)) { + hasToUpdate = true; + break; + } + } + + if (hasToUpdate) { + this.updateViews(); } - this._treeViewDataPoviders.set(id, factory); - this._onTreeViewDataProviderRegistered.fire(id); } - getViews(loc: ViewLocation): IViewDescriptor[] { - return this._views.get(loc) || []; + protected updateViews(): TPromise { + if (this.splitView) { + + const registeredViews = this.getViewDescriptorsFromRegistry(); + const [visible, toAdd, toRemove] = registeredViews.reduce<[IViewDescriptor[], IViewDescriptor[], IViewDescriptor[]]>((result, viewDescriptor) => { + const isCurrentlyVisible = this.isCurrentlyVisible(viewDescriptor); + const canBeVisible = this.canBeVisible(viewDescriptor); + + if (canBeVisible) { + result[0].push(viewDescriptor); + } + + if (!isCurrentlyVisible && canBeVisible) { + result[1].push(viewDescriptor); + } + + if (isCurrentlyVisible && !canBeVisible) { + result[2].push(viewDescriptor); + } + + return result; + + }, [[], [], []]); + + const toCreate = []; + + if (toAdd.length || toRemove.length) { + for (const view of this.views) { + let viewState = this.viewsStates.get(view.id); + if (!viewState || view.size !== viewState.size || !view.isExpanded() !== viewState.collapsed) { + viewState = { ...this.createViewState(view), isHidden: viewState && viewState.isHidden }; + this.viewsStates.set(view.id, viewState); + this.splitView.updateWeight(view, viewState.size); + } + } + if (toRemove.length) { + for (const viewDescriptor of toRemove) { + let view = this.getView(viewDescriptor.id); + this.views.splice(this.views.indexOf(view), 1); + this.splitView.removeView(view); + if (this.lastFocusedView === view) { + this.lastFocusedView = null; + } + } + } + + for (const viewDescriptor of toAdd) { + let viewState = this.viewsStates.get(viewDescriptor.id); + let index = visible.indexOf(viewDescriptor); + const view = this.createView(viewDescriptor, { + id: viewDescriptor.id, + name: viewDescriptor.name, + actionRunner: this.getActionRunner(), + collapsed: viewState ? viewState.collapsed : void 0, + viewletSettings: this.viewletSettings + }); + toCreate.push(view); + + this.views.splice(index, 0, view); + this.attachHeaderViewStyler(view, this.themeService); + this.splitView.addView(view, viewState && viewState.size ? Math.max(viewState.size, 1) : viewDescriptor.size, index); + } + + return TPromise.join(toCreate.map(view => view.create())) + .then(() => this.onViewsUpdated()); + } + } + return TPromise.as(null); + } + + private attachHeaderViewStyler(widget: IThemable, themeService: IThemeService, options?: { noContrastBorder?: boolean }): IDisposable { + return attachStyler(themeService, { + headerForeground: SIDE_BAR_SECTION_HEADER_FOREGROUND, + headerBackground: SIDE_BAR_SECTION_HEADER_BACKGROUND, + headerHighContrastBorder: (options && options.noContrastBorder) ? null : contrastBorder + }, widget); + } + + private isCurrentlyVisible(viewDescriptor: IViewDescriptor): boolean { + return !!this.getView(viewDescriptor.id); + } + + private canBeVisible(viewDescriptor: IViewDescriptor): boolean { + const viewstate = this.viewsStates.get(viewDescriptor.id); + if (viewstate && viewstate.isHidden) { + return false; + } + return this.contextKeyService.contextMatchesRules(viewDescriptor.when); + } + + private onViewsUpdated(): TPromise { + if (this.views.length === 1) { + this.views[0].hideHeader(); + if (!this.views[0].isExpanded()) { + this.views[0].expand(); + } + } else { + for (const view of this.views) { + view.showHeader(); + } + } + + // Update title area since the title actions have changed. + this.updateTitleArea(); + + if (this.dimension) { + this.layoutViews(); + } + + return this.setVisible(this.isVisible()); + } + + private getViewDescriptorsFromRegistry(): IViewDescriptor[] { + return ViewsRegistry.getViews(this.location) + .sort((a, b) => { + if (b.order === void 0 || b.order === null) { + return -1; + } + if (a.order === void 0 || a.order === null) { + return 1; + } + return a.order - b.order; + }); + } + + private saveViewsStates(): void { + const viewsStates = {}; + this.viewsStates.forEach((viewState, id) => { + const view = this.getView(id); + viewState = view ? this.createViewState(view) : viewState; + viewsStates[id] = { size: viewState.size, collapsed: viewState.collapsed, isHidden: viewState.isHidden }; + }); + + this.storageService.store(this.viewletStateStorageId, JSON.stringify(viewsStates), this.contextService.hasWorkspace() ? StorageScope.WORKSPACE : StorageScope.GLOBAL); + } + + private loadViewsStates(): Map { + const viewsStates = JSON.parse(this.storageService.get(this.viewletStateStorageId, this.contextService.hasWorkspace() ? StorageScope.WORKSPACE : StorageScope.GLOBAL, '{}')); + return Object.keys(viewsStates).reduce((result, id) => { + const viewState = viewsStates[id]; + result.set(id, viewState); + return result; + }, new Map()); + } + + protected createView(viewDescriptor: IViewDescriptor, options: IViewletViewOptions): IView { + return this.instantiationService.createInstance(viewDescriptor.ctor, options); } - getTreeViewDataProvider(id: string): ITreeViewDataProvider { - return this._treeViewDataPoviders.get(id); + protected getView(id: string): IView { + return this.views.filter(view => view.id === id)[0]; } - private isViewRegistered(id: string): boolean { - let registered = false; - this._views.forEach(views => registered = registered || views.some(view => view.id === id)); - return registered; + private createViewState(view: IView): IViewState { + const collapsed = !view.isExpanded(); + const size = collapsed && view instanceof CollapsibleView ? view.previousSize : view.size; + return { + collapsed, + size: size && size > 0 ? size : void 0, + isHidden: false + }; } -}; \ No newline at end of file +} \ No newline at end of file diff --git a/src/vs/workbench/parts/views/browser/viewsExtensionPoint.ts b/src/vs/workbench/parts/views/browser/viewsExtensionPoint.ts index da935449c647ac903a587c94178218ee4993e129..769d2e9326dcea7e7d888cdc450999f28fccfc0d 100644 --- a/src/vs/workbench/parts/views/browser/viewsExtensionPoint.ts +++ b/src/vs/workbench/parts/views/browser/viewsExtensionPoint.ts @@ -8,8 +8,9 @@ import { localize } from 'vs/nls'; import { forEach } from 'vs/base/common/collections'; import { IJSONSchema } from 'vs/base/common/jsonSchema'; import { ExtensionMessageCollector, ExtensionsRegistry } from 'vs/platform/extensions/common/extensionsRegistry'; -import { ViewLocation, ViewsRegistry } from 'vs/workbench/parts/views/browser/views'; +import { ViewLocation, ViewsRegistry } from 'vs/workbench/parts/views/browser/viewsRegistry'; import { TreeView } from 'vs/workbench/parts/views/browser/treeView'; +import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; namespace schema { @@ -18,6 +19,7 @@ namespace schema { export interface IUserFriendlyViewDescriptor { id: string; name: string; + when?: string; } export function parseLocation(value: string): ViewLocation { @@ -39,7 +41,11 @@ namespace schema { return false; } if (typeof descriptor.name !== 'string') { - collector.error(localize('requirestring', "property `{0}` is mandatory and must be of type `string`", 'label')); + collector.error(localize('requirestring', "property `{0}` is mandatory and must be of type `string`", 'name')); + return false; + } + if (descriptor.when && typeof descriptor.when !== 'string') { + collector.error(localize('optstring', "property `{0}` can be omitted or must be of type `string`", 'when')); return false; } } @@ -51,13 +57,17 @@ namespace schema { type: 'object', properties: { id: { - description: localize('vscode.extension.contributes.view.id', 'Identifier of the view. Use the same identifier to register a data provider through API.'), + description: localize('vscode.extension.contributes.view.id', 'Identifier of the view. Use this to register a data provider through `vscode.window.registerTreeDataProviderForView` API. Also to trigger activating your extension by registering `onView:${id}` event to `activationEvents`.'), type: 'string' }, name: { description: localize('vscode.extension.contributes.view.name', 'The human-readable name of the view. Will be shown'), type: 'string' - } + }, + when: { + description: localize('vscode.extension.contributes.view.when', 'Condition which must be true to show this view'), + type: 'string' + }, } }; @@ -66,7 +76,7 @@ namespace schema { type: 'object', properties: { 'explorer': { - description: localize('views.explorer', "Explorer"), + description: localize('views.explorer', "Explorer View"), type: 'array', items: viewDescriptor } @@ -93,7 +103,8 @@ ExtensionsRegistry.registerExtensionPoint<{ [loc: string]: schema.IUserFriendlyV id: item.id, name: item.name, ctor: TreeView, - location + location, + when: ContextKeyExpr.deserialize(item.when) })); ViewsRegistry.registerViews(viewDescriptors); }); diff --git a/src/vs/workbench/parts/views/browser/viewsRegistry.ts b/src/vs/workbench/parts/views/browser/viewsRegistry.ts new file mode 100644 index 0000000000000000000000000000000000000000..bb9f79339d541f3ec9f75728a6a2719410f47423 --- /dev/null +++ b/src/vs/workbench/parts/views/browser/viewsRegistry.ts @@ -0,0 +1,119 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import Event, { Emitter } from 'vs/base/common/event'; +import { IViewConstructorSignature } from 'vs/workbench/parts/views/browser/views'; +import { ITreeViewDataProvider } from 'vs/workbench/parts/views/common/views'; +import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; + +export class ViewLocation { + + static readonly Explorer = new ViewLocation('explorer'); + static readonly Debug = new ViewLocation('debug'); + static readonly Extensions = new ViewLocation('extensions'); + + constructor(private _id: string) { + } + + get id(): string { + return this._id; + } +} + +export interface IViewDescriptor { + + readonly id: string; + + readonly name: string; + + readonly location: ViewLocation; + + readonly ctor: IViewConstructorSignature; + + readonly when?: ContextKeyExpr; + + readonly order?: number; + + readonly size?: number; +} + +export interface IViewsRegistry { + + readonly onViewsRegistered: Event; + + readonly onViewsDeregistered: Event; + + readonly onTreeViewDataProviderRegistered: Event; + + registerViews(views: IViewDescriptor[]): void; + + deregisterViews(ids: string[], location: ViewLocation): void; + + registerTreeViewDataProvider(id: string, factory: ITreeViewDataProvider): void; + + getViews(loc: ViewLocation): IViewDescriptor[]; + + getTreeViewDataProvider(id: string): ITreeViewDataProvider; + +} + +export const ViewsRegistry: IViewsRegistry = new class { + + private _onViewsRegistered: Emitter = new Emitter(); + readonly onViewsRegistered: Event = this._onViewsRegistered.event; + + private _onViewsDeregistered: Emitter = new Emitter(); + readonly onViewsDeregistered: Event = this._onViewsDeregistered.event; + + private _onTreeViewDataProviderRegistered: Emitter = new Emitter(); + readonly onTreeViewDataProviderRegistered: Event = this._onTreeViewDataProviderRegistered.event; + + private _views: Map = new Map(); + private _treeViewDataPoviders: Map = new Map(); + + registerViews(viewDescriptors: IViewDescriptor[]): void { + if (viewDescriptors.length) { + for (const viewDescriptor of viewDescriptors) { + let views = this._views.get(viewDescriptor.location); + if (!views) { + views = []; + this._views.set(viewDescriptor.location, views); + } + views.push(viewDescriptor); + } + this._onViewsRegistered.fire(viewDescriptors); + } + } + + deregisterViews(ids: string[], location: ViewLocation): void { + const viewsToDeregister = this._views.get(location).filter(view => ids.indexOf(view.id) !== -1); + if (viewsToDeregister.length) { + this._views.set(location, this._views.get(location).filter(view => ids.indexOf(view.id) === -1)); + } + this._onViewsDeregistered.fire(viewsToDeregister); + } + + registerTreeViewDataProvider(id: string, factory: ITreeViewDataProvider) { + if (!this.isViewRegistered(id)) { + // TODO: throw error + } + this._treeViewDataPoviders.set(id, factory); + this._onTreeViewDataProviderRegistered.fire(id); + } + + getViews(loc: ViewLocation): IViewDescriptor[] { + return this._views.get(loc) || []; + } + + getTreeViewDataProvider(id: string): ITreeViewDataProvider { + return this._treeViewDataPoviders.get(id); + } + + private isViewRegistered(id: string): boolean { + let registered = false; + this._views.forEach(views => registered = registered || views.some(view => view.id === id)); + return registered; + } +}; \ No newline at end of file diff --git a/src/vs/workbench/parts/views/common/views.ts b/src/vs/workbench/parts/views/common/views.ts new file mode 100644 index 0000000000000000000000000000000000000000..22eac5bfe1bf0bfe2e911c6aa22e42ed4489be72 --- /dev/null +++ b/src/vs/workbench/parts/views/common/views.ts @@ -0,0 +1,48 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { TPromise } from 'vs/base/common/winjs.base'; +import Event from 'vs/base/common/event'; +import { Command } from 'vs/editor/common/modes'; + +export type TreeViewItemHandleArg = { + $treeViewId: string, + $treeItemHandle: number +}; + +export enum TreeItemCollapsibleState { + None = 0, + Collapsed = 1, + Expanded = 2 +} + +export interface ITreeItem { + + handle: number; + + label: string; + + icon?: string; + + iconDark?: string; + + contextValue?: string; + + command?: Command; + + children?: ITreeItem[]; + + collapsibleState?: TreeItemCollapsibleState; +} + +export interface ITreeViewDataProvider { + + onDidChange: Event; + + getElements(): TPromise; + + getChildren(element: ITreeItem): TPromise; + +} \ No newline at end of file diff --git a/src/vs/workbench/parts/watermark/electron-browser/watermark.ts b/src/vs/workbench/parts/watermark/electron-browser/watermark.ts index a6e55adf5c8d41a700e47789c1b2c544f63bd629..a8c4f86330683f19230424b1305e29238bf0246e 100644 --- a/src/vs/workbench/parts/watermark/electron-browser/watermark.ts +++ b/src/vs/workbench/parts/watermark/electron-browser/watermark.ts @@ -11,25 +11,22 @@ import { assign } from 'vs/base/common/objects'; import { isMacintosh } from 'vs/base/common/platform'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import * as nls from 'vs/nls'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IConfigurationRegistry, Extensions as ConfigurationExtensions } from 'vs/platform/configuration/common/configurationRegistry'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { IWorkbenchContribution, IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } from 'vs/workbench/common/contributions'; import { ILifecycleService } from 'vs/platform/lifecycle/common/lifecycle'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { GlobalQuickOpenAction } from 'vs/workbench/browser/parts/quickopen/quickopen.contribution'; -import { KeybindingsReferenceAction, OpenRecentAction } from 'vs/workbench/electron-browser/actions'; -import { ShowRecommendedKeymapExtensionsAction } from 'vs/workbench/parts/extensions/browser/extensionsActions'; +import { GlobalQuickOpenAction } from 'vs/workbench/browser/parts/quickopen/quickopen'; +import { OpenRecentAction } from 'vs/workbench/electron-browser/actions'; import { GlobalNewUntitledFileAction, OpenFileAction } from 'vs/workbench/parts/files/browser/fileActions'; import { OpenFolderAction, OpenFileFolderAction } from 'vs/workbench/browser/actions/fileActions'; import { ShowAllCommandsAction } from 'vs/workbench/parts/quickopen/browser/commandsHandler'; import { Parts, IPartService } from 'vs/workbench/services/part/common/partService'; import { StartAction } from 'vs/workbench/parts/debug/browser/debugActions'; import { FindInFilesActionId } from 'vs/workbench/parts/search/common/constants'; -import { OpenGlobalKeybindingsAction } from 'vs/workbench/parts/preferences/browser/preferencesActions'; import { ToggleTerminalAction } from 'vs/workbench/parts/terminal/electron-browser/terminalActions'; -import { SelectColorThemeAction } from 'vs/workbench/parts/themes/electron-browser/themes.contribution'; interface WatermarkEntry { text: string; @@ -83,32 +80,6 @@ const startDebugging: WatermarkEntry = { ids: [StartAction.ID] }; -const selectTheme: WatermarkEntry = { - text: nls.localize('watermark.selectTheme', "Change Theme"), - ids: [SelectColorThemeAction.ID] -}; -const selectKeymap: WatermarkEntry = { - text: nls.localize('watermark.selectKeymap', "Change Keymap"), - ids: [ShowRecommendedKeymapExtensionsAction.ID] -}; -const keybindingsReference: WatermarkEntry = { - text: nls.localize('watermark.keybindingsReference', "Keyboard Reference"), - ids: [KeybindingsReferenceAction.ID] -}; -const openGlobalKeybindings: WatermarkEntry = { - text: nls.localize('watermark.openGlobalKeybindings', "Keyboard Shortcuts"), - ids: [OpenGlobalKeybindingsAction.ID] -}; - -const newUserEntries = [ - showCommands, - selectTheme, - selectKeymap, - openFolderNonMacOnly, - openFileOrFolderMacOnly, - KeybindingsReferenceAction.AVAILABLE ? keybindingsReference : openGlobalKeybindings -]; - const noFolderEntries = [ showCommands, openFileNonMacOnly, @@ -176,8 +147,7 @@ export class WatermarkContribution implements IWorkbenchContribution { const box = $(this.watermark) .div({ 'class': 'watermark-box' }); const folder = this.contextService.hasWorkspace(); - const newUser = this.telemetryService.getExperiments().showNewUserWatermark; - const selected = (newUser ? newUserEntries : (folder ? folderEntries : noFolderEntries)) + const selected = folder ? folderEntries : noFolderEntries .filter(entry => !('mac' in entry) || entry.mac === isMacintosh); const update = () => { const builder = $(box); diff --git a/src/vs/workbench/parts/welcome/gettingStarted/electron-browser/gettingStarted.contribution.ts b/src/vs/workbench/parts/welcome/gettingStarted/electron-browser/gettingStarted.contribution.ts index b7a3f9e985111384246642046ebe961b8936cb13..26ad4b85ab912b17c57c333c26844e629ae8b971 100644 --- a/src/vs/workbench/parts/welcome/gettingStarted/electron-browser/gettingStarted.contribution.ts +++ b/src/vs/workbench/parts/welcome/gettingStarted/electron-browser/gettingStarted.contribution.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ 'use strict'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { GettingStarted } from './gettingStarted'; import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } from 'vs/workbench/common/contributions'; diff --git a/src/vs/workbench/parts/welcome/overlay/browser/welcomeOverlay.css b/src/vs/workbench/parts/welcome/overlay/browser/welcomeOverlay.css index 6aa8c04e78915284e67e78184fcdcf3a12c38fb7..50cf77eafadbd824d543137477b435c9e873fd68 100644 --- a/src/vs/workbench/parts/welcome/overlay/browser/welcomeOverlay.css +++ b/src/vs/workbench/parts/welcome/overlay/browser/welcomeOverlay.css @@ -10,15 +10,10 @@ height: 100%; width: 100%; z-index: 9999; - background: rgba(0,0,0,0.52); font-size: 10px; transition: font-size .25s; } -.vs .monaco-workbench > .welcomeOverlay { - background: rgba(255,255,255,.52); -} - #workbench\.parts\.editor { transition: filter .25s, opacity .2s; } @@ -40,15 +35,6 @@ font-size: 1.6em; } -.monaco-workbench > .welcomeOverlay > .key { - color: #000; -} - -.vs-dark .monaco-workbench > .welcomeOverlay > .key, -.hc-black .monaco-workbench > .welcomeOverlay > .key { - color: #FFF; -} - .monaco-workbench > .welcomeOverlay > .key > .label { padding: 0 1ex; } @@ -56,7 +42,6 @@ .monaco-workbench > .welcomeOverlay > .key > .shortcut { letter-spacing: 0.15em; font-size: 0.8125em; - color: #d7ba7d; font-family: "Lucida Grande", sans-serif; } diff --git a/src/vs/workbench/parts/welcome/overlay/browser/welcomeOverlay.ts b/src/vs/workbench/parts/welcome/overlay/browser/welcomeOverlay.ts index 8a3bb16246ae804a210c932d0050a7f53d132c7a..3b11cb151e2ad28489a3b2df0e1d81ae876c4e08 100644 --- a/src/vs/workbench/parts/welcome/overlay/browser/welcomeOverlay.ts +++ b/src/vs/workbench/parts/welcome/overlay/browser/welcomeOverlay.ts @@ -7,7 +7,7 @@ import 'vs/css!./welcomeOverlay'; import { $, Builder } from 'vs/base/browser/builder'; import * as dom from 'vs/base/browser/dom'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { ShowAllCommandsAction } from 'vs/workbench/parts/quickopen/browser/commandsHandler'; import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; @@ -22,6 +22,9 @@ import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { RawContextKey, IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { KeyCode } from 'vs/base/common/keyCodes'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; +import { registerThemingParticipant } from 'vs/platform/theme/common/themeService'; +import { textPreformatForeground, foreground } from 'vs/platform/theme/common/colorRegistry'; +import { Color } from 'vs/base/common/color'; interface Key { id: string; @@ -229,7 +232,24 @@ class WelcomeOverlay { } Registry.as(Extensions.WorkbenchActions) - .registerWorkbenchAction(new SyncActionDescriptor(WelcomeOverlayAction, WelcomeOverlayAction.ID, WelcomeOverlayAction.LABEL), 'Help: Show Interface Overview', localize('help', "Help")); + .registerWorkbenchAction(new SyncActionDescriptor(WelcomeOverlayAction, WelcomeOverlayAction.ID, WelcomeOverlayAction.LABEL), 'Help: User Interface Overview', localize('help', "Help")); Registry.as(Extensions.WorkbenchActions) .registerWorkbenchAction(new SyncActionDescriptor(HideWelcomeOverlayAction, HideWelcomeOverlayAction.ID, HideWelcomeOverlayAction.LABEL, { primary: KeyCode.Escape }, OVERLAY_VISIBLE), 'Help: Hide Interface Overview', localize('help', "Help")); + +// theming + +registerThemingParticipant((theme, collector) => { + const key = theme.getColor(foreground); + if (key) { + collector.addRule(`.monaco-workbench > .welcomeOverlay > .key { color: ${key}; }`); + } + const backgroundColor = Color.fromHex(theme.type === 'light' ? '#FFFFFF85' : '#00000085'); + if (backgroundColor) { + collector.addRule(`.monaco-workbench > .welcomeOverlay { background: ${backgroundColor}; }`); + } + const shortcut = theme.getColor(textPreformatForeground); + if (shortcut) { + collector.addRule(`.monaco-workbench > .welcomeOverlay > .key > .shortcut { color: ${shortcut}; }`); + } +}); diff --git a/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.ts b/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.ts index cc27fe4978c770b57bcae9ef93a8465f275aca4c..8897c2302cedbac77b2add830de0041932694625 100644 --- a/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.ts +++ b/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.ts @@ -14,13 +14,13 @@ export default () => `
-

${escape(localize('welcomePage.vscode', "Visual Studio Code"))}

-

${escape(localize('welcomePage.editingEvolved', "Editing evolved"))}

+

${escape(localize('welcomePage.vscode', "Visual Studio Code"))}

+

${escape(localize('welcomePage.editingEvolved', "Editing evolved"))}

-

${escape(localize('welcomePage.start', "Start"))}

+

${escape(localize('welcomePage.start', "Start"))}

-

${escape(localize('welcomePage.recent', "Recent"))}

+

${escape(localize('welcomePage.recent', "Recent"))}

-

${escape(localize('welcomePage.noRecentFolders', "No recent folders"))}

+

${escape(localize('welcomePage.noRecentFolders', "No recent folders"))}

-

+

-

${escape(localize('welcomePage.customize', "Customize"))}

+

${escape(localize('welcomePage.customize', "Customize"))}

    -
  • -
  • -
  • +
-

${escape(localize('welcomePage.learn', "Learn"))}

+

${escape(localize('welcomePage.learn', "Learn"))}

    -
  • -
  • -
  • +
  • +
  • +
-`; \ No newline at end of file +`; diff --git a/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.contribution.ts b/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.contribution.ts index d9be0524ce0756122b6bdd8694bd6c613f2521c9..ad03774e188e45161cd1b94a6657a52492487333 100644 --- a/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.contribution.ts +++ b/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.contribution.ts @@ -6,12 +6,11 @@ import { localize } from 'vs/nls'; import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } from 'vs/workbench/common/contributions'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { WelcomePageContribution, WelcomePageAction } from 'vs/workbench/parts/welcome/page/electron-browser/welcomePage'; -import { IConfigurationRegistry, Extensions as ConfigurationExtensions } from 'vs/platform/configuration/common/configurationRegistry'; import { IWorkbenchActionRegistry, Extensions as ActionExtensions } from 'vs/workbench/common/actionRegistry'; import { SyncActionDescriptor } from 'vs/platform/actions/common/actions'; -import { isWelcomePageEnabled } from 'vs/platform/telemetry/common/telemetryUtils'; +import { IConfigurationRegistry, Extensions as ConfigurationExtensions } from 'vs/platform/configuration/common/configurationRegistry'; Registry.as(ConfigurationExtensions.Configuration) .registerConfiguration({ @@ -21,7 +20,7 @@ Registry.as(ConfigurationExtensions.Configuration) 'properties': { 'workbench.welcome.enabled': { 'type': 'boolean', - 'default': isWelcomePageEnabled(), + 'default': true, 'description': localize('welcomePage.enabled', "When enabled, will show the Welcome page on startup.") }, } diff --git a/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.css b/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.css index 982a72d9d1bfb264c0d0fc11a6f5babb64e66ea5..a87de4ff42152c9cae46b652993f119604e65fad 100644 --- a/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.css +++ b/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.css @@ -16,9 +16,6 @@ max-width: 1200px; font-size: 10px; } -.vs .monaco-workbench > .part.editor > .content .welcomePage { - color: #6C6C6C; -} .monaco-workbench > .part.editor > .content .welcomePage .row { display: flex; @@ -41,66 +38,36 @@ } .monaco-workbench > .part.editor > .content .welcomePage a { - color: #2e70c0; text-decoration: none; } -.vs-dark .monaco-workbench > .part.editor > .content .welcomePage a { - color: #4080D0; -} - .monaco-workbench > .part.editor > .content .welcomePage a:focus { outline: 1px solid -webkit-focus-ring-color; outline-offset: -1px; } -.monaco-workbench > .part.editor > .content .welcomePage a:hover { - color: #6ea0dc; -} - -.hc-black .monaco-workbench > .part.editor > .content .welcomePage a { - color: #0b9eff; -} - -.hc-black .monaco-workbench > .part.editor > .content .welcomePage a:hover { - color: #f38518; -} - .monaco-workbench > .part.editor > .content .welcomePage h1 { padding: 0; margin: 0; border: none; font-weight: normal; - color: rgba(0,0,0,.8); font-size: 3.6em; white-space: nowrap; } -.vs-dark .monaco-workbench > .part.editor > .content .welcomePage h1 { - color: rgba(255,255,255,.76); -} - -.hc-black .monaco-workbench > .part.editor > .content .welcomePage h1 { - color: white; -} - .monaco-workbench > .part.editor > .content .welcomePage .title { margin-top: 1em; margin-bottom: 1em; flex: 1 100%; } + .monaco-workbench > .part.editor > .content .welcomePage .subtitle { margin-top: .8em; font-size: 2.6em; - color: rgba(0,0,0,.53); display: block; } -.vs-dark .monaco-workbench > .part.editor > .content .welcomePage .subtitle { - color: rgba(255,255,255,.46); -} .hc-black .monaco-workbench > .part.editor > .content .welcomePage .subtitle { - color: white; font-weight: 200; } @@ -150,22 +117,6 @@ } .monaco-workbench > .part.editor > .content .welcomePage .splash .recent .path { padding-left: 1em; - color: rgba(255,255,255,.46); -} - -.monaco-workbench > .part.editor > .content .welcomePage .splash .recent .none, -.monaco-workbench > .part.editor > .content .welcomePage .splash .recent .path { - color: rgba(0,0,0,.53); -} - -.vs-dark .monaco-workbench > .part.editor > .content .welcomePage .splash .recent .none, -.vs-dark .monaco-workbench > .part.editor > .content .welcomePage .splash .recent .path { - color: rgba(255,255,255,.46); -} - -.hc-black .monaco-workbench > .part.editor > .content .welcomePage .splash .recent .none, -.hc-black .monaco-workbench > .part.editor > .content .welcomePage .splash .recent .path { - color: white; } .monaco-workbench > .part.editor > .content .welcomePage .splash .title, @@ -185,9 +136,9 @@ margin: 7px 0px; } .monaco-workbench > .part.editor > .content .welcomePage .commands li button { - margin: 0; + margin: 1px; padding: 12px 10px; - width: 100%; + width: calc(100% - 2px); height: 5em; font-size: 1.3em; text-align: left; @@ -207,41 +158,27 @@ margin-bottom: .25em; } -.vs .monaco-workbench > .part.editor > .content .welcomePage .commands li button h3 { - color: #2c2c2c; -} - .monaco-workbench > .part.editor > .content .welcomePage .commands li button { - color: #6c6c6c; border: none; } -.vs-dark .monaco-workbench > .part.editor > .content .welcomePage .commands li button > h3 { - color: #ccc; -} - .hc-black .monaco-workbench > .part.editor > .content .welcomePage .commands li button > h3 { font-weight: bold; } -.vs-dark .monaco-workbench > .part.editor > .content .welcomePage .commands li button { - color: #828282; -} - .monaco-workbench > .part.editor > .content .welcomePage .commands li button:focus { outline-style: solid; outline-width: 1px; } .hc-black .monaco-workbench > .part.editor > .content .welcomePage .commands li button { - color: white; - border-color: #f38518; border-width: 1px; border-style: solid; } .hc-black .monaco-workbench > .part.editor > .content .welcomePage .commands li button:hover { - outline: 1px dashed #f38518; + outline-width: 1px; + outline-style: dashed; outline-offset: -5px; } diff --git a/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.ts b/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.ts index 874bc17d8ddc526343557c76d3a6a9868cf3fcd7..c49f0d522e438f0ea73234e98118ba1825931dd1 100644 --- a/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.ts +++ b/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.ts @@ -35,12 +35,14 @@ import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { tildify } from 'vs/base/common/labels'; import { isLinux } from 'vs/base/common/platform'; import { IThemeService, registerThemingParticipant } from 'vs/platform/theme/common/themeService'; -import { registerColor } from 'vs/platform/theme/common/colorRegistry'; +import { registerColor, focusBorder, textLinkForeground, textLinkActiveForeground, foreground, descriptionForeground, contrastBorder, activeContrastBorder } from 'vs/platform/theme/common/colorRegistry'; import { getExtraColor } from 'vs/workbench/parts/welcome/walkThrough/node/walkThroughUtils'; +import { IExtensionsWorkbenchService } from 'vs/workbench/parts/extensions/common/extensions'; +import { IStorageService } from "vs/platform/storage/common/storage"; used(); -const enabledKey = 'workbench.welcome.enabled'; +const configurationKey = 'workbench.welcome.enabled'; const telemetryFrom = 'welcomePage'; export class WelcomePageContribution implements IWorkbenchContribution { @@ -51,9 +53,10 @@ export class WelcomePageContribution implements IWorkbenchContribution { @IConfigurationService configurationService: IConfigurationService, @IWorkbenchEditorService editorService: IWorkbenchEditorService, @IBackupFileService backupFileService: IBackupFileService, - @ITelemetryService telemetryService: ITelemetryService + @ITelemetryService telemetryService: ITelemetryService, + @IStorageService storageService: IStorageService ) { - const enabled = configurationService.lookup(enabledKey).value; + const enabled = isWelcomePageEnabled(configurationService); if (enabled) { TPromise.join([ backupFileService.hasBackups(), @@ -72,6 +75,10 @@ export class WelcomePageContribution implements IWorkbenchContribution { } } +function isWelcomePageEnabled(configurationService: IConfigurationService) { + return configurationService.lookup(configurationKey).value; +} + export class WelcomePageAction extends Action { public static ID = 'workbench.action.showWelcomePage'; @@ -125,6 +132,7 @@ const keymapExtensions: ExtensionSuggestion[] = [ interface Strings { installEvent: string; installedEvent: string; + detailsEvent: string; alreadyInstalled: string; reloadAfterInstall: string; @@ -135,16 +143,18 @@ interface Strings { const extensionPackStrings: Strings = { installEvent: 'installExtension', installedEvent: 'installedExtension', + detailsEvent: 'detailsExtension', alreadyInstalled: localize('welcomePage.extensionPackAlreadyInstalled', "Support for {0} is already installed."), - reloadAfterInstall: localize('welcomePage.willReloadAfterInstallingExtensionPack', "The window will reload after installing support for {0}."), - installing: localize('welcomePage.installingExtensionPack', "Installing support for {0}..."), + reloadAfterInstall: localize('welcomePage.willReloadAfterInstallingExtensionPack', "The window will reload after installing additional support for {0}."), + installing: localize('welcomePage.installingExtensionPack', "Installing additional support for {0}..."), extensionNotFound: localize('welcomePage.extensionPackNotFound', "Support for {0} with id {1} could not be found."), }; const keymapStrings: Strings = { installEvent: 'installKeymap', installedEvent: 'installedKeymap', + detailsEvent: 'detailsKeymap', alreadyInstalled: localize('welcomePage.keymapAlreadyInstalled', "The {0} keyboard shortcuts are already installed."), reloadAfterInstall: localize('welcomePage.willReloadAfterInstallingKeymap', "The window will reload after installing the {0} keyboard shortcuts."), @@ -170,6 +180,7 @@ class WelcomePage { @IExtensionGalleryService private extensionGalleryService: IExtensionGalleryService, @IExtensionManagementService private extensionManagementService: IExtensionManagementService, @IExtensionTipsService private tipsService: IExtensionTipsService, + @IExtensionsWorkbenchService private extensionsWorkbenchService: IExtensionsWorkbenchService, @ILifecycleService lifecycleService: ILifecycleService, @IThemeService private themeService: IThemeService, @ITelemetryService private telemetryService: ITelemetryService @@ -192,19 +203,19 @@ class WelcomePage { } private onReady(container: HTMLElement, recentlyOpened: TPromise<{ files: string[]; folders: string[]; }>, installedExtensions: TPromise): void { - const enabled = this.configurationService.lookup(enabledKey).value; + const enabled = isWelcomePageEnabled(this.configurationService); const showOnStartup = container.querySelector('#showOnStartup'); if (enabled) { showOnStartup.setAttribute('checked', 'checked'); } showOnStartup.addEventListener('click', e => { - this.configurationEditingService.writeConfiguration(ConfigurationTarget.USER, { key: enabledKey, value: showOnStartup.checked }); + this.configurationEditingService.writeConfiguration(ConfigurationTarget.USER, { key: configurationKey, value: showOnStartup.checked }); }); recentlyOpened.then(({ folders }) => { if (this.contextService.hasWorkspace()) { - const current = this.contextService.getWorkspace().resource.fsPath; - folders = folders.filter(folder => !this.pathEquals(folder, current)); + const currents = this.contextService.getWorkspace2().roots; + folders = folders.filter(folder => !currents.some(current => this.pathEquals(folder, current.fsPath))); } if (!folders.length) { const recent = container.querySelector('.welcomePage') as HTMLElement; @@ -224,8 +235,11 @@ class WelcomePage { name = parentFolder; parentFolder = tmp; } + const tildifiedParentFolder = tildify(parentFolder, this.environmentService.userHome); + a.innerText = name; a.title = folder; + a.setAttribute('aria-label', localize('welcomePage.openFolderWithPath', "Open folder {0} with path {1}", name, tildifiedParentFolder)); a.href = 'javascript:void(0)'; a.addEventListener('click', e => { this.telemetryService.publicLog('workbenchActionExecuted', { @@ -240,7 +254,8 @@ class WelcomePage { const span = document.createElement('span'); span.classList.add('path'); - span.innerText = tildify(parentFolder, this.environmentService.userHome); + span.classList.add('detail'); + span.innerText = tildifiedParentFolder; span.title = folder; li.appendChild(span); @@ -291,6 +306,7 @@ class WelcomePage { const a = document.createElement('a'); a.innerText = extension.name; + a.title = extension.isKeymap ? localize('welcomePage.installKeymap', "Install {0} keymap", extension.name) : localize('welcomePage.installExtensionPack', "Install additional support for {0}", extension.name); a.classList.add('installExtension'); a.setAttribute('data-extension', extension.id); a.href = 'javascript:void(0)'; @@ -302,7 +318,8 @@ class WelcomePage { list.appendChild(a); const span = document.createElement('span'); - span.innerText = localize('welcomePage.installedExtension', "{0} (installed)", extension.name); + span.innerText = extension.name; + span.title = extension.isKeymap ? localize('welcomePage.installedKeymap', "{0} keymap is already installed", extension.name) : localize('welcomePage.installedExtensionPack', "{0} support is already installed", extension.name); span.classList.add('enabledExtension'); span.setAttribute('data-extension', extension.id); list.appendChild(span); @@ -341,7 +358,7 @@ class WelcomePage { if (!extension) { return false; } - return this.extensionManagementService.installFromGallery(extension) + return this.extensionManagementService.installFromGallery(extension, false) .then(() => { // TODO: Do this as part of the install to avoid multiple events. return this.extensionEnablementService.setEnablement(extensionSuggestion.id, false); @@ -397,6 +414,16 @@ class WelcomePage { }); return TPromise.as(true); }), + new Action('details', localize('details', "Details"), null, true, () => { + this.telemetryService.publicLog(strings.detailsEvent, { + from: telemetryFrom, + extensionId: extensionSuggestion.id, + }); + this.extensionsWorkbenchService.queryGallery({ names: [extensionSuggestion.id] }) + .then(result => this.extensionsWorkbenchService.open(result.firstPage[0])) + .then(null, onUnexpectedError); + return TPromise.as(false); + }), new Action('cancel', localize('cancel', "Cancel"), null, true, () => { this.telemetryService.publicLog(strings.installedEvent, { from: telemetryFrom, @@ -446,16 +473,45 @@ class WelcomePage { // theming -const quickLinkBackground = registerColor('welcomePage.quickLinkBackground', { dark: null, light: null, hc: null }, localize('welcomePage.quickLinkBackground', 'Background color for the quick links on the Welcome page.')); -const quickLinkHoverBackground = registerColor('welcomePage.quickLinkHoverBackground', { dark: null, light: null, hc: null }, localize('welcomePage.quickLinkHoverBackground', 'Hover background color for the quick links on the Welcome page.')); +const buttonBackground = registerColor('welcomePage.buttonBackground', { dark: null, light: null, hc: null }, localize('welcomePage.buttonBackground', 'Background color for the buttons on the Welcome page.')); +const buttonHoverBackground = registerColor('welcomePage.buttonHoverBackground', { dark: null, light: null, hc: null }, localize('welcomePage.buttonHoverBackground', 'Hover background color for the buttons on the Welcome page.')); registerThemingParticipant((theme, collector) => { - const color = getExtraColor(theme, quickLinkBackground, { dark: 'rgba(0, 0, 0, .2)', extra_dark: 'rgba(200, 235, 255, .042)', light: 'rgba(0,0,0,.04)', hc: 'black' }); - if (color) { - collector.addRule(`.monaco-workbench > .part.editor > .content .welcomePage .commands li button { background: ${color}; }`); + const foregroundColor = theme.getColor(foreground); + if (foregroundColor) { + collector.addRule(`.monaco-workbench > .part.editor > .content .welcomePage .caption { color: ${foregroundColor}; }`); + } + const descriptionColor = theme.getColor(descriptionForeground); + if (descriptionColor) { + collector.addRule(`.monaco-workbench > .part.editor > .content .welcomePage .detail { color: ${descriptionColor}; }`); + } + const buttonColor = getExtraColor(theme, buttonBackground, { dark: 'rgba(0, 0, 0, .2)', extra_dark: 'rgba(200, 235, 255, .042)', light: 'rgba(0,0,0,.04)', hc: 'black' }); + if (buttonColor) { + collector.addRule(`.monaco-workbench > .part.editor > .content .welcomePage .commands li button { background: ${buttonColor}; }`); + } + const buttonHoverColor = getExtraColor(theme, buttonHoverBackground, { dark: 'rgba(200, 235, 255, .072)', extra_dark: 'rgba(200, 235, 255, .072)', light: 'rgba(0,0,0,.10)', hc: null }); + if (buttonHoverColor) { + collector.addRule(`.monaco-workbench > .part.editor > .content .welcomePage .commands li button:hover { background: ${buttonHoverColor}; }`); + } + const link = theme.getColor(textLinkForeground); + if (link) { + collector.addRule(`.monaco-workbench > .part.editor > .content .welcomePage a { color: ${link}; }`); + } + const activeLink = theme.getColor(textLinkActiveForeground); + if (activeLink) { + collector.addRule(`.monaco-workbench > .part.editor > .content .welcomePage a:hover, + .monaco-workbench > .part.editor > .content .welcomePage a:active { color: ${activeLink}; }`); + } + const focusColor = theme.getColor(focusBorder); + if (focusColor) { + collector.addRule(`.monaco-workbench > .part.editor > .content .welcomePage a:focus { outline-color: ${focusColor}; }`); + } + const border = theme.getColor(contrastBorder); + if (border) { + collector.addRule(`.monaco-workbench > .part.editor > .content .welcomePage .commands li button { border-color: ${border}; }`); } - const hover = getExtraColor(theme, quickLinkHoverBackground, { dark: 'rgba(200, 235, 255, .072)', extra_dark: 'rgba(200, 235, 255, .072)', light: 'rgba(0,0,0,.10)', hc: null }); - if (hover) { - collector.addRule(`.monaco-workbench > .part.editor > .content .welcomePage .commands li button:hover { background: ${hover}; }`); + const activeBorder = theme.getColor(activeContrastBorder); + if (activeBorder) { + collector.addRule(`.monaco-workbench > .part.editor > .content .welcomePage .commands li button:hover { outline-color: ${activeBorder}; }`); } }); diff --git a/src/vs/workbench/parts/welcome/walkThrough/electron-browser/editor/vs_code_editor_walkthrough.md b/src/vs/workbench/parts/welcome/walkThrough/electron-browser/editor/vs_code_editor_walkthrough.md index 6dedb7d9978b78a9441ebf2ca52d809e8847ff19..f154fd91f572a4a1e9f4a62109e1c4f887d2edb6 100644 --- a/src/vs/workbench/parts/welcome/walkThrough/electron-browser/editor/vs_code_editor_walkthrough.md +++ b/src/vs/workbench/parts/welcome/walkThrough/electron-browser/editor/vs_code_editor_walkthrough.md @@ -16,7 +16,7 @@ The core editor in VS Code is packed with features. This page highlights a numb ### Multi-Cursor Editing Using multiple cursors allows you to edit multiple parts of the document at once, greatly improving your productivity. Try the following actions in the code block below: 1. Box Selection - press any combination of kb(cursorColumnSelectDown), kb(cursorColumnSelectRight), kb(cursorColumnSelectUp), kb(cursorColumnSelectLeft) to select a block of text, you can also press `⇧⌥``Shift+Alt` while selecting text with the mouse. -2. Add a cursor - press kb(editor.action.insertCursorAbove) or kb(editor.action.insertCursorBelow) to add a new cursor above or below, you can also use your mouse with `⌥+Click``Alt+Click` to add a cursor anywhere. +2. Add a cursor - press kb(editor.action.insertCursorAbove) or kb(editor.action.insertCursorBelow) to add a new cursor above or below, you can also use your mouse with +Click to add a cursor anywhere. 3. Create cursors on all occurrences of a string - select one instance of a string e.g. `background-color` and press kb(editor.action.selectHighlights). Now you can replace all instances by simply typing. That is the tip of the iceberg for multi-cursor editing have a look at the `selection menu` and our handy [keyboard reference guide](command:workbench.action.keybindingsReference) for additional actions. @@ -155,7 +155,7 @@ ul>li.item$*5 ## Thanks! -Well if you have got this far then you will have touched on some of the editing features in Visual Studio Code. But don't stop now :) We have lots of additional [documentation](https://code.visualstudio.com/docs) and [introductory videos](https://code.visualstudio.com/docs/getstarted/introvideos) for the product that will help you learn how to use it. And while you are here, here are a few additional things you can try: +Well if you have got this far then you will have touched on some of the editing features in Visual Studio Code. But don't stop now :) We have lots of additional [documentation](https://code.visualstudio.com/docs), [introductory videos](https://code.visualstudio.com/docs/getstarted/introvideos) and [tips and tricks](https://go.microsoft.com/fwlink/?linkid=852118) for the product that will help you learn how to use it. And while you are here, here are a few additional things you can try: - Open the Integrated Terminal by pressing kb(workbench.action.terminal.toggleTerminal) then see what's possible by [reviewing the terminal documentation](https://code.visualstudio.com/docs/editor/integrated-terminal) - Work with version control by pressing kb(workbench.view.scm) understand how to stage, commit, change branches, and view diffs and more by reviewing the [version control documentation](https://code.visualstudio.com/docs/editor/versioncontrol) - Browse thousands of extensions in our integrated gallery by pressing with kb(workbench.view.extensions) the [documentation](https://code.visualstudio.com/docs/editor/extension-gallery) will show you how to see the most popular extensions, disable installed ones and more. diff --git a/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThrough.contribution.ts b/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThrough.contribution.ts index 448fec9445cf4721a115773e99b4e6ad8cb584f3..dfcbf8d247d3b6532b1f34a538b765aca0c01423 100644 --- a/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThrough.contribution.ts +++ b/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThrough.contribution.ts @@ -10,7 +10,7 @@ import { WalkThroughPart, WALK_THROUGH_FOCUS } from 'vs/workbench/parts/welcome/ import { WalkThroughArrowUpAction, WalkThroughArrowDownAction, WalkThroughPageUpAction, WalkThroughPageDownAction } from 'vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughActions'; import { WalkThroughContentProvider, WalkThroughSnippetContentProvider } from 'vs/workbench/parts/welcome/walkThrough/node/walkThroughContentProvider'; import { EditorWalkThroughAction } from 'vs/workbench/parts/welcome/walkThrough/electron-browser/editor/editorWalkThrough'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { EditorDescriptor } from 'vs/workbench/browser/parts/editor/baseEditor'; import { IEditorRegistry, Extensions as EditorExtensions } from 'vs/workbench/common/editor'; import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; diff --git a/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.css b/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.css index baaf1f3ceed36a8c38168b5cd5ad795e15df9777..305fece6c6b34589267789a1531d172ca67f3188 100644 --- a/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.css +++ b/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.css @@ -17,7 +17,6 @@ } .monaco-workbench > .part.editor > .content .walkThroughContent a { - color: #4080D0; text-decoration: none; } @@ -69,7 +68,6 @@ } .monaco-workbench > .part.editor > .content .walkThroughContent a:hover { - color: #4080D0; text-decoration: underline; } @@ -106,36 +104,11 @@ line-height: 19px; } -/*.monaco-workbench.mac > .part.editor > .content .walkThroughContent code, -.monaco-workbench.mac > .part.editor > .content .walkThroughContent .shortcut { - font-size: 12px; - line-height: 18px; -}*/ - -.vs .monaco-workbench > .part.editor > .content .walkThroughContent code, -.vs .monaco-workbench > .part.editor > .content .walkThroughContent .shortcut { - color: #A31515; -} - -.vs-dark .monaco-workbench > .part.editor > .content .walkThroughContent code, -.vs-dark .monaco-workbench > .part.editor > .content .walkThroughContent .shortcut { - color: #D7BA7D; -} - .monaco-workbench > .part.editor > .content .walkThroughContent blockquote { margin: 0 7px 0 5px; padding: 0 16px 0 10px; border-left: 5px solid; } -.vs .monaco-workbench > .part.editor > .content .walkThroughContent blockquote, -.vs-dark .monaco-workbench > .part.editor > .content .walkThroughContent blockquote { - background: rgba(127, 127, 127, 0.1); - border-color: rgba(0, 122, 204, 0.5); -} -.hc-black .monaco-workbench > .part.editor > .content .walkThroughContent blockquote { - background: transparent; - border-color: #fff; -} .monaco-workbench > .part.editor > .content .walkThroughContent .monaco-tokenized-source { white-space: pre; @@ -162,5 +135,6 @@ } .hc-black .monaco-workbench > .part.editor > .content .walkThroughContent .monaco-editor { - border: 1px white solid + border-width: 1px; + border-style: solid; } diff --git a/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.ts b/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.ts index 2fcbace413f7e60349d11d7c06ba2002cf91d03a..763338760e9053081f3e4cee4ded077a5fcab100 100644 --- a/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.ts +++ b/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.ts @@ -38,8 +38,10 @@ import { IPartService } from 'vs/workbench/services/part/common/partService'; import { IEditorOptions } from 'vs/editor/common/config/editorOptions'; import { IMessageService, Severity } from 'vs/platform/message/common/message'; import { IThemeService, registerThemingParticipant } from 'vs/platform/theme/common/themeService'; -import { registerColor } from 'vs/platform/theme/common/colorRegistry'; +import { registerColor, focusBorder, textLinkForeground, textLinkActiveForeground, textPreformatForeground, contrastBorder, textBlockQuoteBackground, textBlockQuoteBorder } from 'vs/platform/theme/common/colorRegistry'; import { getExtraColor } from 'vs/workbench/parts/welcome/walkThrough/node/walkThroughUtils'; +import { UILabelProvider } from 'vs/base/common/keybindingLabels'; +import { OS, OperatingSystem } from 'vs/base/common/platform'; export const WALK_THROUGH_FOCUS = new RawContextKey('interactivePlaygroundFocus', false); @@ -119,7 +121,6 @@ export class WalkThroughPart extends BaseEditor { this.content.style.outlineStyle = 'none'; this.scrollbar = new DomScrollableElement(this.content, { - canUseTranslate3d: false, horizontal: ScrollbarVisibility.Auto, vertical: ScrollbarVisibility.Auto }); @@ -406,6 +407,8 @@ export class WalkThroughPart extends BaseEditor { })); }); this.updateSizeClasses(); + this.multiCursorModifier(); + this.contentDisposables.push(this.configurationService.onDidUpdateConfiguration(() => this.multiCursorModifier())); if (input.onReady) { input.onReady(innerContent); } @@ -416,7 +419,7 @@ export class WalkThroughPart extends BaseEditor { } private getEditorOptions(language: string): IEditorOptions { - const config = this.configurationService.getConfiguration({ overrideIdentifier: language, section: 'editor' }); + const config = this.configurationService.getConfiguration('editor', { overrideIdentifier: language }); return { ...isObject(config) ? config : Object.create(null), scrollBeyondLastLine: false, @@ -430,7 +433,7 @@ export class WalkThroughPart extends BaseEditor { overviewRulerLanes: 3, fixedOverflowWidgets: true, lineNumbersMinChars: 1, - minimap: false, + minimap: { enabled: false }, }; } @@ -461,6 +464,19 @@ export class WalkThroughPart extends BaseEditor { }); } + private multiCursorModifier() { + const labels = UILabelProvider.modifierLabels[OS]; + const setting = this.configurationService.lookup('editor.multiCursorModifier'); + const modifier = labels[setting.value === 'ctrlCmd' ? (OS === OperatingSystem.Macintosh ? 'metaKey' : 'ctrlKey') : 'altKey']; + const keys = this.content.querySelectorAll('.multi-cursor-modifier'); + Array.prototype.forEach.call(keys, (key: Element) => { + while (key.firstChild) { + key.removeChild(key.firstChild); + } + key.appendChild(document.createTextNode(modifier)); + }); + } + private saveTextEditorViewState(resource: URI): void { const memento = this.getMemento(this.storageService, Scope.WORKSPACE); let editorViewStateMemento = memento[WALK_THROUGH_EDITOR_VIEW_STATE_PREFERENCE_KEY]; @@ -534,4 +550,34 @@ registerThemingParticipant((theme, collector) => { collector.addRule(`.monaco-workbench > .part.editor > .content .walkThroughContent .monaco-editor-background, .monaco-workbench > .part.editor > .content .walkThroughContent .margin-view-overlays { background: ${color}; }`); } + const link = theme.getColor(textLinkForeground); + if (link) { + collector.addRule(`.monaco-workbench > .part.editor > .content .walkThroughContent a { color: ${link}; }`); + } + const activeLink = theme.getColor(textLinkActiveForeground); + if (activeLink) { + collector.addRule(`.monaco-workbench > .part.editor > .content .walkThroughContent a:hover, + .monaco-workbench > .part.editor > .content .walkThroughContent a:active { color: ${activeLink}; }`); + } + const focusColor = theme.getColor(focusBorder); + if (focusColor) { + collector.addRule(`.monaco-workbench > .part.editor > .content .walkThroughContent a:focus { outline-color: ${focusColor}; }`); + } + const shortcut = theme.getColor(textPreformatForeground); + if (shortcut) { + collector.addRule(`.monaco-workbench > .part.editor > .content .walkThroughContent code, + .monaco-workbench > .part.editor > .content .walkThroughContent .shortcut { color: ${shortcut}; }`); + } + const border = theme.getColor(contrastBorder); + if (border) { + collector.addRule(`.monaco-workbench > .part.editor > .content .walkThroughContent .monaco-editor { border-color: ${border}; }`); + } + const quoteBackground = theme.getColor(textBlockQuoteBackground); + if (quoteBackground) { + collector.addRule(`.monaco-workbench > .part.editor > .content .walkThroughContent blockquote { background: ${quoteBackground}; }`); + } + const quoteBorder = theme.getColor(textBlockQuoteBorder); + if (quoteBorder) { + collector.addRule(`.monaco-workbench > .part.editor > .content .walkThroughContent blockquote { border-color: ${quoteBorder}; }`); + } }); \ No newline at end of file diff --git a/src/vs/workbench/parts/welcome/walkThrough/node/walkThroughContentProvider.ts b/src/vs/workbench/parts/welcome/walkThrough/node/walkThroughContentProvider.ts index 426918e274c899a3a7cff69e50e9a4da8efab27e..2fff2ba3f71608ce8053334f0ca2889cd71ca5f8 100644 --- a/src/vs/workbench/parts/welcome/walkThrough/node/walkThroughContentProvider.ts +++ b/src/vs/workbench/parts/welcome/walkThrough/node/walkThroughContentProvider.ts @@ -7,7 +7,7 @@ import { TPromise } from 'vs/base/common/winjs.base'; import URI from 'vs/base/common/uri'; -import { ITextModelResolverService, ITextModelContentProvider } from 'vs/editor/common/services/resolverService'; +import { ITextModelService, ITextModelContentProvider } from 'vs/editor/common/services/resolverService'; import { IModelService } from 'vs/editor/common/services/modelService'; import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; import { IModel } from 'vs/editor/common/editorCommon'; @@ -20,7 +20,7 @@ import { IRawTextSource } from 'vs/editor/common/model/textSource'; export class WalkThroughContentProvider implements ITextModelContentProvider, IWorkbenchContribution { constructor( - @ITextModelResolverService private textModelResolverService: ITextModelResolverService, + @ITextModelService private textModelResolverService: ITextModelService, @ITextFileService private textFileService: ITextFileService, @IModeService private modeService: IModeService, @IModelService private modelService: IModelService, @@ -59,7 +59,7 @@ export class WalkThroughContentProvider implements ITextModelContentProvider, IW export class WalkThroughSnippetContentProvider implements ITextModelContentProvider, IWorkbenchContribution { constructor( - @ITextModelResolverService private textModelResolverService: ITextModelResolverService, + @ITextModelService private textModelResolverService: ITextModelService, @ITextFileService private textFileService: ITextFileService, @IModeService private modeService: IModeService, @IModelService private modelService: IModelService, @@ -102,4 +102,4 @@ export class WalkThroughSnippetContentProvider implements ITextModelContentProvi public getId(): string { return 'vs.walkThroughSnippetContentProvider'; } -} \ No newline at end of file +} diff --git a/src/vs/workbench/parts/welcome/walkThrough/node/walkThroughInput.ts b/src/vs/workbench/parts/welcome/walkThrough/node/walkThroughInput.ts index 9a86c171ae6ac0238df42b0c55cc4f23cccc361a..889fdc162ed07ee2435a05de0548d943a634b739 100644 --- a/src/vs/workbench/parts/welcome/walkThrough/node/walkThroughInput.ts +++ b/src/vs/workbench/parts/welcome/walkThrough/node/walkThroughInput.ts @@ -10,7 +10,7 @@ import { EditorInput, EditorModel, ITextEditorModel } from 'vs/workbench/common/ import URI from 'vs/base/common/uri'; import { IReference, IDisposable, dispose } from 'vs/base/common/lifecycle'; import { telemetryURIDescriptor } from 'vs/platform/telemetry/common/telemetryUtils'; -import { ITextModelResolverService } from 'vs/editor/common/services/resolverService'; +import { ITextModelService } from 'vs/editor/common/services/resolverService'; import { marked } from 'vs/base/common/marked/marked'; import { Schemas } from 'vs/base/common/network'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; @@ -60,7 +60,7 @@ export class WalkThroughInput extends EditorInput { public readonly onReady: (container: HTMLElement) => void, @ITelemetryService private telemetryService: ITelemetryService, @ILifecycleService lifecycleService: ILifecycleService, - @ITextModelResolverService private textModelResolverService: ITextModelResolverService + @ITextModelService private textModelResolverService: ITextModelService ) { super(); this.disposables.push(lifecycleService.onShutdown(e => this.disposeTelemetry(e))); diff --git a/src/vs/workbench/services/activity/common/activityBarService.ts b/src/vs/workbench/services/activity/common/activityBarService.ts index 810b062b63fe3f1f90e9ac3980968b8f975123ae..5c5b18a2105ed4879b966d1ae4f7e6655ba2acbc 100644 --- a/src/vs/workbench/services/activity/common/activityBarService.ts +++ b/src/vs/workbench/services/activity/common/activityBarService.ts @@ -63,6 +63,11 @@ export const IActivityBarService = createDecorator('activit export interface IActivityBarService { _serviceBrand: any; + /** + * Show activity in the activitybar for the given global activity. + */ + showGlobalActivity(globalActivityId: string, badge: IBadge): IDisposable; + /** * Show activity in the activitybar for the given viewlet. */ diff --git a/src/vs/workbench/services/backup/common/backup.ts b/src/vs/workbench/services/backup/common/backup.ts index f725e45008791cccfc51e3e7d8c5174ce9783f13..c43688b8b486b03a36d35adef92252ee00ad3166 100644 --- a/src/vs/workbench/services/backup/common/backup.ts +++ b/src/vs/workbench/services/backup/common/backup.ts @@ -22,6 +22,11 @@ export const BACKUP_FILE_UPDATE_OPTIONS: IUpdateContentOptions = { encoding: 'ut export interface IBackupFileService { _serviceBrand: any; + /** + * If backups are enabled. + */ + backupEnabled: boolean; + /** * Finds out if there are any backups stored. */ diff --git a/src/vs/workbench/services/backup/node/backupFileService.ts b/src/vs/workbench/services/backup/node/backupFileService.ts index 8b1e2b5cd2365ad3f5cbcceeba2debfbcdeaac2b..b7c27aeca1045aca543e2b0c428dd46cf607b42b 100644 --- a/src/vs/workbench/services/backup/node/backupFileService.ts +++ b/src/vs/workbench/services/backup/node/backupFileService.ts @@ -12,12 +12,9 @@ import pfs = require('vs/base/node/pfs'); import Uri from 'vs/base/common/uri'; import { Queue } from 'vs/base/common/async'; import { IBackupFileService, BACKUP_FILE_UPDATE_OPTIONS } from 'vs/workbench/services/backup/common/backup'; -import { IBackupService } from 'vs/platform/backup/common/backup'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import { IFileService } from 'vs/platform/files/common/files'; import { TPromise } from 'vs/base/common/winjs.base'; import { readToMatchingString } from 'vs/base/node/stream'; -import { IWindowService } from 'vs/platform/windows/common/windows'; import { TextSource, IRawTextSource } from 'vs/editor/common/model/textSource'; import { DefaultEndOfLine } from 'vs/editor/common/editorCommon'; @@ -96,7 +93,6 @@ export class BackupFileService implements IBackupFileService { private static readonly META_MARKER = '\n'; private isShuttingDown: boolean; - private backupWorkspacePath: string; private ready: TPromise; /** * Ensure IO operations on individual files are performed in order, this could otherwise lead @@ -105,32 +101,26 @@ export class BackupFileService implements IBackupFileService { private ioOperationQueues: { [path: string]: Queue }; constructor( - @IEnvironmentService private environmentService: IEnvironmentService, - @IFileService private fileService: IFileService, - @IWindowService windowService: IWindowService, - @IBackupService private backupService: IBackupService + private backupWorkspacePath: string, + @IFileService private fileService: IFileService ) { this.isShuttingDown = false; - this.ready = this.init(windowService.getCurrentWindowId()); this.ioOperationQueues = {}; + this.ready = this.init(); } - private get backupEnabled(): boolean { - return !this.environmentService.isExtensionDevelopment; // Hot exit is disabled when doing extension development + public get backupEnabled(): boolean { + return !!this.backupWorkspacePath; // Hot exit requires a backup path } - private init(windowId: number): TPromise { + private init(): TPromise { const model = new BackupFilesModel(); if (!this.backupEnabled) { return TPromise.as(model); } - return this.backupService.getBackupPath(windowId).then(backupPath => { - this.backupWorkspacePath = backupPath; - - return model.resolve(this.backupWorkspacePath); - }); + return model.resolve(this.backupWorkspacePath); } public hasBackups(): TPromise { diff --git a/src/vs/workbench/services/backup/test/backupFileService.test.ts b/src/vs/workbench/services/backup/test/node/backupFileService.test.ts similarity index 95% rename from src/vs/workbench/services/backup/test/backupFileService.test.ts rename to src/vs/workbench/services/backup/test/node/backupFileService.test.ts index 0c5c56ed14efc6e4bf042d9868664acd10e891c7..2abae9fa93745832899876d46be900f7f9cca3bd 100644 --- a/src/vs/workbench/services/backup/test/backupFileService.test.ts +++ b/src/vs/workbench/services/backup/test/node/backupFileService.test.ts @@ -17,11 +17,11 @@ import Uri from 'vs/base/common/uri'; import { BackupFileService, BackupFilesModel } from 'vs/workbench/services/backup/node/backupFileService'; import { FileService } from 'vs/workbench/services/files/node/fileService'; import { EnvironmentService } from 'vs/platform/environment/node/environmentService'; -import { IBackupService } from 'vs/platform/backup/common/backup'; import { parseArgs } from 'vs/platform/environment/node/argv'; -import { TPromise } from 'vs/base/common/winjs.base'; -import { TestWindowService } from 'vs/workbench/test/workbenchTestServices'; import { RawTextSource } from 'vs/editor/common/model/textSource'; +import { TestContextService } from 'vs/workbench/test/workbenchTestServices'; +import { Workspace } from "vs/platform/workspace/common/workspace"; +import { TestConfigurationService } from "vs/platform/configuration/test/common/testConfigurationService"; class TestEnvironmentService extends EnvironmentService { @@ -50,14 +50,9 @@ const untitledBackupPath = path.join(workspaceBackupPath, 'untitled', crypto.cre class TestBackupFileService extends BackupFileService { constructor(workspace: Uri, backupHome: string, workspacesJsonPath: string) { - const fileService = new FileService(workspace.fsPath, { disableWatcher: true }); - const environmentService = new TestEnvironmentService(backupHome, workspacesJsonPath); - const backupService: IBackupService = { - _serviceBrand: null, - getBackupPath: () => TPromise.as(workspaceBackupPath) - }; - - super(environmentService, fileService, new TestWindowService(), backupService); + const fileService = new FileService(new TestContextService(new Workspace(workspace.fsPath, workspace.fsPath, [workspace])), new TestConfigurationService(), { disableWatcher: true }); + + super(workspaceBackupPath, fileService); } public getBackupResource(resource: Uri, legacyMacWindowsFormat?: boolean): Uri { diff --git a/src/vs/workbench/services/configuration/common/configuration.ts b/src/vs/workbench/services/configuration/common/configuration.ts index 0038822ee902069e919fe520b438fffb7efc15c3..c38ff73b6d6ce11b8f87e4e4f1adec3d26fad638 100644 --- a/src/vs/workbench/services/configuration/common/configuration.ts +++ b/src/vs/workbench/services/configuration/common/configuration.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IConfigurationService, IConfigurationValue, IConfigurationKeys } from 'vs/platform/configuration/common/configuration'; +import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; export const CONFIG_DEFAULT_NAME = 'settings'; @@ -12,8 +12,6 @@ export const WORKSPACE_CONFIG_DEFAULT_PATH = `${WORKSPACE_CONFIG_FOLDER_DEFAULT_ export const IWorkspaceConfigurationService = createDecorator('configurationService'); -export type IWorkspaceConfigurationValues = { [key: string]: IWorkspaceConfigurationValue }; - export interface IWorkspaceConfigurationService extends IConfigurationService { /** @@ -21,28 +19,6 @@ export interface IWorkspaceConfigurationService extends IConfigurationService { */ getUnsupportedWorkspaceKeys(): string[]; - /** - * Override for the IConfigurationService#lookup() method that adds information about workspace settings. - */ - lookup(key: string): IWorkspaceConfigurationValue; - - /** - * Override for the IConfigurationService#keys() method that adds information about workspace settings. - */ - keys(): IWorkspaceConfigurationKeys; - - /** - * Returns the defined values of configurations in the different scopes. - */ - values(): IWorkspaceConfigurationValues; -} - -export interface IWorkspaceConfigurationValue extends IConfigurationValue { - workspace: T; -} - -export interface IWorkspaceConfigurationKeys extends IConfigurationKeys { - workspace: string[]; } export const WORKSPACE_STANDALONE_CONFIGURATIONS = { diff --git a/src/vs/workbench/services/configuration/common/configurationEditing.ts b/src/vs/workbench/services/configuration/common/configurationEditing.ts index d687ee387a3825090c0c8c0b016bdc5a24c95105..df7c2650481876f586f70f09f42476468ff0d150 100644 --- a/src/vs/workbench/services/configuration/common/configurationEditing.ts +++ b/src/vs/workbench/services/configuration/common/configurationEditing.ts @@ -6,6 +6,7 @@ import { TPromise } from 'vs/base/common/winjs.base'; import { createDecorator, ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation'; +import { IConfigurationOverrides } from 'vs/platform/configuration/common/configuration'; export const IConfigurationEditingService = createDecorator('configurationEditingService'); @@ -58,7 +59,6 @@ export enum ConfigurationTarget { export interface IConfigurationValue { key: string; value: any; - overrideIdentifier?: string; } export interface IConfigurationEditingOptions { @@ -70,6 +70,10 @@ export interface IConfigurationEditingOptions { * If `true`, do not notifies the error to user by showing the message box. Default is `false`. */ donotNotifyError?: boolean; + /** + * Scope of configuration to be written into. + */ + scopes?: IConfigurationOverrides; } export interface IConfigurationEditingService { diff --git a/src/vs/workbench/services/configuration/common/configurationModels.ts b/src/vs/workbench/services/configuration/common/configurationModels.ts index 10f1fb17a9d023a6788c5ef200ad5163753c8e8b..ba4eef2daf68272d99e94770fac62347309c9b39 100644 --- a/src/vs/workbench/services/configuration/common/configurationModels.ts +++ b/src/vs/workbench/services/configuration/common/configurationModels.ts @@ -4,12 +4,12 @@ *--------------------------------------------------------------------------------------------*/ 'use strict'; -import { ConfigModel } from 'vs/platform/configuration/common/model'; +import { CustomConfigurationModel } from 'vs/platform/configuration/common/model'; import { WORKSPACE_STANDALONE_CONFIGURATIONS } from 'vs/workbench/services/configuration/common/configuration'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { IConfigurationRegistry, IConfigurationPropertySchema, Extensions } from 'vs/platform/configuration/common/configurationRegistry'; -export class ScopedConfigModel extends ConfigModel { +export class ScopedConfigurationModel extends CustomConfigurationModel { constructor(content: string, name: string, public readonly scope: string) { super(null, name); @@ -25,7 +25,7 @@ export class ScopedConfigModel extends ConfigModel { } -export class WorkspaceSettingsConfigModel extends ConfigModel { +export class FolderSettingsModel extends CustomConfigurationModel { private _raw: T; private _unsupportedKeys: string[]; @@ -62,9 +62,9 @@ export class WorkspaceSettingsConfigModel extends ConfigModel { } } -export class WorkspaceConfigModel extends ConfigModel { +export class FolderConfigurationModel extends CustomConfigurationModel { - constructor(public readonly workspaceSettingsConfig: WorkspaceSettingsConfigModel, private scopedConfigs: ScopedConfigModel[]) { + constructor(public readonly workspaceSettingsConfig: FolderSettingsModel, private scopedConfigs: ScopedConfigurationModel[]) { super(); this.consolidate(); } diff --git a/src/vs/workbench/services/configuration/node/configuration.ts b/src/vs/workbench/services/configuration/node/configuration.ts new file mode 100644 index 0000000000000000000000000000000000000000..a6e057c6a2f0bce0645a83c0e7db3ece978f1771 --- /dev/null +++ b/src/vs/workbench/services/configuration/node/configuration.ts @@ -0,0 +1,645 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +'use strict'; + +import URI from 'vs/base/common/uri'; +import * as paths from 'vs/base/common/paths'; +import { TPromise } from 'vs/base/common/winjs.base'; +import Event, { Emitter } from 'vs/base/common/event'; +import { StrictResourceMap } from 'vs/base/common/map'; +import { distinct, equals } from "vs/base/common/arrays"; +import * as objects from 'vs/base/common/objects'; +import * as errors from 'vs/base/common/errors'; +import * as collections from 'vs/base/common/collections'; +import { Disposable } from "vs/base/common/lifecycle"; +import { Schemas } from "vs/base/common/network"; +import { RunOnceScheduler } from 'vs/base/common/async'; +import { readFile } from 'vs/base/node/pfs'; +import * as extfs from 'vs/base/node/extfs'; +import { IWorkspaceContextService, IWorkspace, Workspace, ILegacyWorkspace, LegacyWorkspace } from "vs/platform/workspace/common/workspace"; +import { FileChangeType, FileChangesEvent } from 'vs/platform/files/common/files'; +import { isLinux } from 'vs/base/common/platform'; +import { IEnvironmentService } from 'vs/platform/environment/common/environment'; +import { CustomConfigurationModel } from 'vs/platform/configuration/common/model'; +import { ScopedConfigurationModel, FolderConfigurationModel, FolderSettingsModel } from 'vs/workbench/services/configuration/common/configurationModels'; +import { IConfigurationServiceEvent, ConfigurationSource, IConfigurationKeys, IConfigurationValue, ConfigurationModel, IConfigurationOverrides, Configuration as BaseConfiguration, IConfigurationValues, IConfigurationData } from 'vs/platform/configuration/common/configuration'; +import { IWorkspaceConfigurationService, WORKSPACE_CONFIG_FOLDER_DEFAULT_NAME, WORKSPACE_STANDALONE_CONFIGURATIONS, WORKSPACE_CONFIG_DEFAULT_PATH } from 'vs/workbench/services/configuration/common/configuration'; +import { ConfigurationService as GlobalConfigurationService } from 'vs/platform/configuration/node/configurationService'; +import { basename } from "path"; +import nls = require('vs/nls'); +import { Registry } from 'vs/platform/registry/common/platform'; +import { ExtensionsRegistry, ExtensionMessageCollector } from 'vs/platform/extensions/common/extensionsRegistry'; +import { IConfigurationNode, IConfigurationRegistry, Extensions, editorConfigurationSchemaId, IDefaultConfigurationExtension, validateProperty } from "vs/platform/configuration/common/configurationRegistry"; + +interface IStat { + resource: URI; + isDirectory?: boolean; + children?: { resource: URI; }[]; +} + +interface IContent { + resource: URI; + value: string; +} + +interface IWorkspaceConfiguration { + workspace: T; + consolidated: any; +} + +type IWorkspaceFoldersConfiguration = { [rootFolder: string]: { folders: string[]; } }; + +const configurationRegistry = Registry.as(Extensions.Configuration); + +// BEGIN VSCode extension point `configuration` +const configurationExtPoint = ExtensionsRegistry.registerExtensionPoint('configuration', [], { + description: nls.localize('vscode.extension.contributes.configuration', 'Contributes configuration settings.'), + type: 'object', + defaultSnippets: [{ body: { title: '', properties: {} } }], + properties: { + title: { + description: nls.localize('vscode.extension.contributes.configuration.title', 'A summary of the settings. This label will be used in the settings file as separating comment.'), + type: 'string' + }, + properties: { + description: nls.localize('vscode.extension.contributes.configuration.properties', 'Description of the configuration properties.'), + type: 'object', + additionalProperties: { + anyOf: [ + { $ref: 'http://json-schema.org/draft-04/schema#' }, + { + type: 'object', + properties: { + isExecutable: { + type: 'boolean' + } + } + } + ] + } + } + } +}); +configurationExtPoint.setHandler(extensions => { + const configurations: IConfigurationNode[] = []; + + + for (let i = 0; i < extensions.length; i++) { + const configuration = objects.clone(extensions[i].value); + const collector = extensions[i].collector; + + if (configuration.type && configuration.type !== 'object') { + collector.warn(nls.localize('invalid.type', "if set, 'configuration.type' must be set to 'object")); + } else { + configuration.type = 'object'; + } + + if (configuration.title && (typeof configuration.title !== 'string')) { + collector.error(nls.localize('invalid.title', "'configuration.title' must be a string")); + } + + validateProperties(configuration, collector); + + configuration.id = extensions[i].description.id; + configurations.push(configuration); + } + + configurationRegistry.registerConfigurations(configurations, false); +}); +// END VSCode extension point `configuration` + +// BEGIN VSCode extension point `configurationDefaults` +const defaultConfigurationExtPoint = ExtensionsRegistry.registerExtensionPoint('configurationDefaults', [], { + description: nls.localize('vscode.extension.contributes.defaultConfiguration', 'Contributes default editor configuration settings by language.'), + type: 'object', + defaultSnippets: [{ body: {} }], + patternProperties: { + '\\[.*\\]$': { + type: 'object', + default: {}, + $ref: editorConfigurationSchemaId, + } + } +}); +defaultConfigurationExtPoint.setHandler(extensions => { + const defaultConfigurations: IDefaultConfigurationExtension[] = extensions.map(extension => { + const id = extension.description.id; + const name = extension.description.name; + const defaults = objects.clone(extension.value); + return { + id, name, defaults + }; + }); + configurationRegistry.registerDefaultConfigurations(defaultConfigurations); +}); +// END VSCode extension point `configurationDefaults` + +function validateProperties(configuration: IConfigurationNode, collector: ExtensionMessageCollector): void { + let properties = configuration.properties; + if (properties) { + if (typeof properties !== 'object') { + collector.error(nls.localize('invalid.properties', "'configuration.properties' must be an object")); + configuration.properties = {}; + } + for (let key in properties) { + const message = validateProperty(key); + if (message) { + collector.warn(message); + delete properties[key]; + } + } + } + let subNodes = configuration.allOf; + if (subNodes) { + for (let node of subNodes) { + validateProperties(node, collector); + } + } +} + +export class WorkspaceConfigurationService extends Disposable implements IWorkspaceContextService, IWorkspaceConfigurationService { + + public _serviceBrand: any; + + private readonly _onDidChangeWorkspaceRoots: Emitter = this._register(new Emitter()); + public readonly onDidChangeWorkspaceRoots: Event = this._onDidChangeWorkspaceRoots.event; + + private readonly _onDidUpdateConfiguration: Emitter = this._register(new Emitter()); + public readonly onDidUpdateConfiguration: Event = this._onDidUpdateConfiguration.event; + + private baseConfigurationService: GlobalConfigurationService; + + private cachedFolderConfigs: StrictResourceMap>; + + private readonly legacyWorkspace: LegacyWorkspace; + + private _configuration: Configuration; + + constructor(private environmentService: IEnvironmentService, private readonly workspace?: Workspace, private workspaceSettingsRootFolder: string = WORKSPACE_CONFIG_FOLDER_DEFAULT_NAME) { + super(); + + this.legacyWorkspace = this.workspace && this.workspace.roots.length ? new LegacyWorkspace(this.workspace.roots[0]) : null; + + this._register(this.onDidUpdateConfiguration(e => this.resolveAdditionalFolders())); + + this.baseConfigurationService = this._register(new GlobalConfigurationService(environmentService)); + this._register(this.baseConfigurationService.onDidUpdateConfiguration(e => this.onBaseConfigurationChanged(e))); + this._register(this.onDidChangeWorkspaceRoots(e => this.onRootsChanged())); + + this.initCaches(); + } + + private resolveAdditionalFolders(): void { + // TODO@Ben multi root + if (!this.workspace || this.environmentService.appQuality === 'stable') { + return; // no additional folders for empty workspaces or in stable + } + + // Resovled configured folders for workspace + let [master] = this.workspace.roots; + let configuredFolders: URI[] = [master]; + const config = this.getConfiguration('workspace'); + if (config) { + const workspaceConfig = config[master.toString()]; + if (workspaceConfig) { + const additionalFolders = workspaceConfig.folders + .map(f => URI.parse(f)) + .filter(r => r.scheme === Schemas.file); // only support files for now + + configuredFolders.push(...additionalFolders); + } + } + + // Remove duplicates + configuredFolders = distinct(configuredFolders, r => r.toString()); + + // Find changes + const changed = !equals(this.workspace.roots, configuredFolders, (r1, r2) => r1.toString() === r2.toString()); + + if (changed) { + + this.workspace.roots = configuredFolders; + this.workspace.name = configuredFolders.map(root => basename(root.fsPath) || root.fsPath).join(', '); + + this._onDidChangeWorkspaceRoots.fire(); + } + } + + public getWorkspace(): ILegacyWorkspace { + return this.legacyWorkspace; + } + + public getWorkspace2(): IWorkspace { + return this.workspace; + } + + public hasWorkspace(): boolean { + return !!this.workspace; + } + + public getRoot(resource: URI): URI { + return this.workspace ? this.workspace.getRoot(resource) : null; + } + + private get workspaceUri(): URI { + return this.workspace ? this.workspace.roots[0] : null; + } + + public isInsideWorkspace(resource: URI): boolean { + return !!this.getRoot(resource); + } + + public toWorkspaceRelativePath(resource: URI, toOSPath?: boolean): string { + return this.workspace ? this.legacyWorkspace.toWorkspaceRelativePath(resource, toOSPath) : null; + } + + public toResource(workspaceRelativePath: string): URI { + return this.workspace ? this.legacyWorkspace.toResource(workspaceRelativePath) : null; + } + + public getConfigurationData(): IConfigurationData { + return this._configuration.toData(); + } + + public get configuration(): BaseConfiguration { + return this._configuration; + } + + public getConfiguration(section?: string, overrides?: IConfigurationOverrides): C { + return this._configuration.getValue(section, overrides); + } + + public lookup(key: string, overrides?: IConfigurationOverrides): IConfigurationValue { + return this._configuration.lookup(key, overrides); + } + + public keys(): IConfigurationKeys { + return this._configuration.keys(); + } + + public values(): IConfigurationValues { + return this._configuration.values(); + } + + public getUnsupportedWorkspaceKeys(): string[] { + return this.workspace ? this._configuration.getFolderConfigurationModel(this.workspace.roots[0]).workspaceSettingsConfig.unsupportedKeys : []; + } + + public reloadConfiguration(section?: string): TPromise { + const current = this._configuration; + + return this.baseConfigurationService.reloadConfiguration() + .then(() => this.initialize(false)) // Reinitialize to ensure we are hitting the disk + .then(() => !this._configuration.equals(current)) // Check if the configuration is changed + .then(changed => changed ? this.trigger(ConfigurationSource.Workspace, ) : void 0) // Trigger event if changed + .then(() => this.getConfiguration(section)); + } + + public handleWorkspaceFileEvents(event: FileChangesEvent): void { + if (this.workspace) { + TPromise.join(this.workspace.roots.map(folder => this.cachedFolderConfigs.get(folder).handleWorkspaceFileEvents(event))) // handle file event for each folder + .then(folderConfigurations => + folderConfigurations.map((configuration, index) => ({ configuration, folder: this.workspace.roots[index] })) + .filter(folderConfiguration => !!folderConfiguration.configuration) // Filter folders which are not impacted by events + .map(folderConfiguration => this._configuration.updateFolderConfiguration(folderConfiguration.folder, folderConfiguration.configuration)) // Update the configuration of impacted folders + .reduce((result, value) => result || value, false)) // Check if the effective configuration of folder is changed + .then(changed => changed ? this.trigger(ConfigurationSource.Workspace) : void 0); // Trigger event if changed + } + } + + public initialize(trigger: boolean = true): TPromise { + this.initCaches(); + return this.doInitialize(this.workspace ? this.workspace.roots : []) + .then(() => { + if (trigger) { + this.trigger(this.workspace ? ConfigurationSource.Workspace : ConfigurationSource.User); + } + }); + } + + private onRootsChanged(): void { + if (!this.workspace) { + return; + } + + let configurationChanged = false; + + // Remove the configurations of deleted folders + for (const key of this.cachedFolderConfigs.keys()) { + if (!this.workspace.roots.filter(folder => folder.toString() === key.toString())[0]) { + this.cachedFolderConfigs.delete(key); + if (this._configuration.deleteFolderConfiguration(key)) { + configurationChanged = true; + } + } + } + + // Initialize the newly added folders + const toInitialize = this.workspace.roots.filter(folder => !this.cachedFolderConfigs.has(folder)); + if (toInitialize.length) { + this.initCachesForFolders(toInitialize); + this.doInitialize(toInitialize) + .then(changed => configurationChanged || changed) + .then(changed => changed ? this.trigger(ConfigurationSource.Workspace) : void 0); + } + } + + private initCaches(): void { + this.cachedFolderConfigs = new StrictResourceMap>(); + this._configuration = new Configuration(this.baseConfigurationService.configuration(), new StrictResourceMap>(), this.workspace); + this.initCachesForFolders(this.workspace ? this.workspace.roots : []); + } + + private initCachesForFolders(folders: URI[]): void { + for (const folder of folders) { + this.cachedFolderConfigs.set(folder, new FolderConfiguration(folder, this.workspaceSettingsRootFolder, this.workspace)); + this._configuration.updateFolderConfiguration(folder, new FolderConfigurationModel(new FolderSettingsModel(null), []), false); + } + } + + private doInitialize(folders: URI[]): TPromise { + return TPromise.join(folders.map(folder => this.cachedFolderConfigs.get(folder).loadConfiguration() + .then(configuration => this._configuration.updateFolderConfiguration(folder, configuration)))) + .then(changed => changed.reduce((result, value) => result || value, false)); + } + + private onBaseConfigurationChanged(event: IConfigurationServiceEvent): void { + if (event.source === ConfigurationSource.Default) { + if (this.workspace) { + this.workspace.roots.forEach(folder => this._configuration.getFolderConfigurationModel(folder).update()); + } + } + + if (this._configuration.updateBaseConfiguration(this.baseConfigurationService.configuration())) { + this.trigger(event.source, event.sourceConfig); + } + } + + private trigger(source: ConfigurationSource, sourceConfig?: any): void { + if (!sourceConfig) { + sourceConfig = this.workspace ? this._configuration.getFolderConfigurationModel(this.workspace.roots[0]).contents : this._configuration.user.contents; + } + this._onDidUpdateConfiguration.fire({ source, sourceConfig }); + } +} + +class FolderConfiguration extends Disposable { + + private static RELOAD_CONFIGURATION_DELAY = 50; + + private bulkFetchFromWorkspacePromise: TPromise; + private workspaceFilePathToConfiguration: { [relativeWorkspacePath: string]: TPromise> }; + + private reloadConfigurationScheduler: RunOnceScheduler; + private reloadConfigurationEventEmitter: Emitter> = new Emitter>(); + + constructor(private folder: URI, private configFolderRelativePath: string, private workspace: Workspace) { + super(); + + this.workspaceFilePathToConfiguration = Object.create(null); + this.reloadConfigurationScheduler = this._register(new RunOnceScheduler(() => this.loadConfiguration().then(configuration => this.reloadConfigurationEventEmitter.fire(configuration), errors.onUnexpectedError), FolderConfiguration.RELOAD_CONFIGURATION_DELAY)); + } + + loadConfiguration(): TPromise> { + if (!this.workspace) { + return TPromise.wrap(new FolderConfigurationModel(new FolderSettingsModel(null), [])); + } + + // Load workspace locals + return this.loadWorkspaceConfigFiles().then(workspaceConfigFiles => { + // Consolidate (support *.json files in the workspace settings folder) + const workspaceSettingsConfig = >workspaceConfigFiles[WORKSPACE_CONFIG_DEFAULT_PATH] || new FolderSettingsModel(null); + const otherConfigModels = Object.keys(workspaceConfigFiles).filter(key => key !== WORKSPACE_CONFIG_DEFAULT_PATH).map(key => >workspaceConfigFiles[key]); + return new FolderConfigurationModel(workspaceSettingsConfig, otherConfigModels); + }); + } + + private loadWorkspaceConfigFiles(): TPromise<{ [relativeWorkspacePath: string]: ConfigurationModel }> { + // once: when invoked for the first time we fetch json files that contribute settings + if (!this.bulkFetchFromWorkspacePromise) { + this.bulkFetchFromWorkspacePromise = resolveStat(this.toResource(this.configFolderRelativePath)).then(stat => { + if (!stat.isDirectory) { + return TPromise.as([]); + } + + return resolveContents(stat.children.filter(stat => { + const isJson = paths.extname(stat.resource.fsPath) === '.json'; + if (!isJson) { + return false; // only JSON files + } + + return this.isWorkspaceConfigurationFile(this.toFolderRelativePath(stat.resource)); // only workspace config files + }).map(stat => stat.resource)); + }, err => [] /* never fail this call */) + .then((contents: IContent[]) => { + contents.forEach(content => this.workspaceFilePathToConfiguration[this.toFolderRelativePath(content.resource)] = TPromise.as(this.createConfigModel(content))); + }, errors.onUnexpectedError); + } + + // on change: join on *all* configuration file promises so that we can merge them into a single configuration object. this + // happens whenever a config file changes, is deleted, or added + return this.bulkFetchFromWorkspacePromise.then(() => TPromise.join(this.workspaceFilePathToConfiguration)); + } + + public handleWorkspaceFileEvents(event: FileChangesEvent): TPromise> { + if (!this.workspace) { + return TPromise.wrap(null); + } + + const events = event.changes; + let affectedByChanges = false; + + // Find changes that affect workspace configuration files + for (let i = 0, len = events.length; i < len; i++) { + const resource = events[i].resource; + const isJson = paths.extname(resource.fsPath) === '.json'; + const isDeletedSettingsFolder = (events[i].type === FileChangeType.DELETED && paths.isEqual(paths.basename(resource.fsPath), this.configFolderRelativePath)); + if (!isJson && !isDeletedSettingsFolder) { + continue; // only JSON files or the actual settings folder + } + + const workspacePath = this.toFolderRelativePath(resource); + if (!workspacePath) { + continue; // event is not inside workspace + } + + // Handle case where ".vscode" got deleted + if (workspacePath === this.configFolderRelativePath && events[i].type === FileChangeType.DELETED) { + this.workspaceFilePathToConfiguration = Object.create(null); + affectedByChanges = true; + } + + // only valid workspace config files + if (!this.isWorkspaceConfigurationFile(workspacePath)) { + continue; + } + + // insert 'fetch-promises' for add and update events and + // remove promises for delete events + switch (events[i].type) { + case FileChangeType.DELETED: + affectedByChanges = collections.remove(this.workspaceFilePathToConfiguration, workspacePath); + break; + case FileChangeType.UPDATED: + case FileChangeType.ADDED: + this.workspaceFilePathToConfiguration[workspacePath] = resolveContent(resource).then(content => this.createConfigModel(content), errors.onUnexpectedError); + affectedByChanges = true; + } + } + + if (!affectedByChanges) { + return TPromise.as(null); + } + + return new TPromise((c, e) => { + let disposable = this.reloadConfigurationEventEmitter.event(configuration => { + disposable.dispose(); + c(configuration); + }); + // trigger reload of the configuration if we are affected by changes + if (!this.reloadConfigurationScheduler.isScheduled()) { + this.reloadConfigurationScheduler.schedule(); + } + }); + } + + private createConfigModel(content: IContent): ConfigurationModel { + const path = this.toFolderRelativePath(content.resource); + if (path === WORKSPACE_CONFIG_DEFAULT_PATH) { + return new FolderSettingsModel(content.value, content.resource.toString()); + } else { + const matches = /\/([^\.]*)*\.json/.exec(path); + if (matches && matches[1]) { + return new ScopedConfigurationModel(content.value, content.resource.toString(), matches[1]); + } + } + + return new CustomConfigurationModel(null); + } + + private isWorkspaceConfigurationFile(folderRelativePath: string): boolean { + return [WORKSPACE_CONFIG_DEFAULT_PATH, WORKSPACE_STANDALONE_CONFIGURATIONS.launch, WORKSPACE_STANDALONE_CONFIGURATIONS.tasks].some(p => p === folderRelativePath); + } + + private toResource(folderRelativePath: string): URI { + if (typeof folderRelativePath === 'string') { + return URI.file(paths.join(this.folder.fsPath, folderRelativePath)); + } + + return null; + } + + private toFolderRelativePath(resource: URI, toOSPath?: boolean): string { + if (this.contains(resource)) { + return paths.normalize(paths.relative(this.folder.fsPath, resource.fsPath), toOSPath); + } + + return null; + } + + private contains(resource: URI): boolean { + if (resource) { + return paths.isEqualOrParent(resource.fsPath, this.folder.fsPath, !isLinux /* ignorecase */); + } + + return false; + } +} + +// node.hs helper functions + +function resolveContents(resources: URI[]): TPromise { + const contents: IContent[] = []; + + return TPromise.join(resources.map(resource => { + return resolveContent(resource).then(content => { + contents.push(content); + }); + })).then(() => contents); +} + +function resolveContent(resource: URI): TPromise { + return readFile(resource.fsPath).then(contents => ({ resource, value: contents.toString() })); +} + +function resolveStat(resource: URI): TPromise { + return new TPromise((c, e) => { + extfs.readdir(resource.fsPath, (error, children) => { + if (error) { + if ((error).code === 'ENOTDIR') { + c({ resource }); + } else { + e(error); + } + } else { + c({ + resource, + isDirectory: true, + children: children.map(child => { return { resource: URI.file(paths.join(resource.fsPath, child)) }; }) + }); + } + }); + }); +} + +class Configuration extends BaseConfiguration { + + constructor(private _baseConfiguration: Configuration, protected folders: StrictResourceMap>, workspace: Workspace) { + super(_baseConfiguration.defaults, _baseConfiguration.user, folders, workspace); + } + + updateBaseConfiguration(baseConfiguration: Configuration): boolean { + const current = new Configuration(this._baseConfiguration, this.folders, this._workspace); + + this._defaults = baseConfiguration.defaults; + this._user = baseConfiguration.user; + this.merge(); + + return !this.equals(current); + } + + updateFolderConfiguration(resource: URI, configuration: FolderConfigurationModel, compare: boolean = true): boolean { + this.folders.set(resource, configuration); + const current = this.getValue(null, { resource }); + this.mergeFolder(resource); + return compare && !objects.equals(current, this.getValue(null, { resource })); + } + + deleteFolderConfiguration(folder: URI): boolean { + if (this.workspaceUri && this.workspaceUri.fsPath === folder.fsPath) { + // Do not remove workspace configuration + return false; + } + + this.folders.delete(folder); + return this._foldersConsolidatedConfigurations.delete(folder); + } + + getFolderConfigurationModel(folder: URI): FolderConfigurationModel { + return >this.folders.get(folder); + } + + equals(other: any): boolean { + if (!other || !(other instanceof Configuration)) { + return false; + } + + if (!objects.equals(this.getValue(), other.getValue())) { + return false; + } + + if (this._foldersConsolidatedConfigurations.size !== other._foldersConsolidatedConfigurations.size) { + return false; + } + + for (const resource of this._foldersConsolidatedConfigurations.keys()) { + if (!objects.equals(this.getValue(null, { resource }), other.getValue(null, { resource }))) { + return false; + } + } + + return true; + } +} diff --git a/src/vs/workbench/services/configuration/node/configurationEditingService.ts b/src/vs/workbench/services/configuration/node/configurationEditingService.ts index a2ace0b1b2cf64ea48a4cad932a19abf3661f022..19c41e19c88d2a15ee3410c6c40a1c9f26b35e05 100644 --- a/src/vs/workbench/services/configuration/node/configurationEditingService.ts +++ b/src/vs/workbench/services/configuration/node/configurationEditingService.ts @@ -7,6 +7,7 @@ import nls = require('vs/nls'); import { TPromise } from 'vs/base/common/winjs.base'; +import * as paths from 'vs/base/common/paths'; import URI from 'vs/base/common/uri'; import * as json from 'vs/base/common/json'; import * as encoding from 'vs/base/node/encoding'; @@ -22,12 +23,12 @@ import { Selection } from 'vs/editor/common/core/selection'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; +import { IConfigurationService, IConfigurationOverrides } from 'vs/platform/configuration/common/configuration'; import { keyFromOverrideIdentifier } from 'vs/platform/configuration/common/model'; import { WORKSPACE_CONFIG_DEFAULT_PATH, WORKSPACE_STANDALONE_CONFIGURATIONS } from 'vs/workbench/services/configuration/common/configuration'; import { IFileService } from 'vs/platform/files/common/files'; import { IConfigurationEditingService, ConfigurationEditingErrorCode, IConfigurationEditingError, ConfigurationTarget, IConfigurationValue, IConfigurationEditingOptions } from 'vs/workbench/services/configuration/common/configurationEditing'; -import { ITextModelResolverService, ITextEditorModel } from 'vs/editor/common/services/resolverService'; +import { ITextModelService, ITextEditorModel } from 'vs/editor/common/services/resolverService'; import { OVERRIDE_PROPERTY_PATTERN } from 'vs/platform/configuration/common/configurationRegistry'; import { IChoiceService, IMessageService, Severity } from 'vs/platform/message/common/message'; import { ICommandService } from 'vs/platform/commands/common/commands'; @@ -35,6 +36,7 @@ import { ICommandService } from 'vs/platform/commands/common/commands'; interface IConfigurationEditOperation extends IConfigurationValue { resource: URI; isWorkspaceStandalone?: boolean; + overrideIdentifier?: string; } interface IValidationResult { @@ -57,7 +59,7 @@ export class ConfigurationEditingService implements IConfigurationEditingService @IWorkspaceContextService private contextService: IWorkspaceContextService, @IEnvironmentService private environmentService: IEnvironmentService, @IFileService private fileService: IFileService, - @ITextModelResolverService private textModelResolverService: ITextModelResolverService, + @ITextModelService private textModelResolverService: ITextModelService, @ITextFileService private textFileService: ITextFileService, @IChoiceService private choiceService: IChoiceService, @IMessageService private messageService: IMessageService, @@ -70,12 +72,12 @@ export class ConfigurationEditingService implements IConfigurationEditingService return this.queue.queue(() => this.doWriteConfiguration(target, value, options) // queue up writes to prevent race conditions .then(() => null, error => { - return options.donotNotifyError ? TPromise.wrapError(error) : this.onError(error, target, value); + return options.donotNotifyError ? TPromise.wrapError(error) : this.onError(error, target, value, options.scopes); })); } private doWriteConfiguration(target: ConfigurationTarget, value: IConfigurationValue, options: ConfigurationEditingOptions): TPromise { - const operation = this.getConfigurationEditOperation(target, value); + const operation = this.getConfigurationEditOperation(target, value, options.scopes || {}); const checkDirtyConfiguration = !(options.force || options.donotSave); const saveConfiguration = options.force || !options.donotSave; @@ -106,13 +108,13 @@ export class ConfigurationEditingService implements IConfigurationEditingService return false; } - private onError(error: IConfigurationEditingError, target: ConfigurationTarget, value: IConfigurationValue): TPromise { + private onError(error: IConfigurationEditingError, target: ConfigurationTarget, value: IConfigurationValue, scopes: IConfigurationOverrides): TPromise { switch (error.code) { case ConfigurationEditingErrorCode.ERROR_INVALID_CONFIGURATION: this.onInvalidConfigurationError(error, target); break; case ConfigurationEditingErrorCode.ERROR_CONFIGURATION_FILE_DIRTY: - this.onConfigurationFileDirtyError(error, target, value); + this.onConfigurationFileDirtyError(error, target, value, scopes); break; default: this.messageService.show(Severity.Error, error.message); @@ -130,12 +132,12 @@ export class ConfigurationEditingService implements IConfigurationEditingService }); } - private onConfigurationFileDirtyError(error: IConfigurationEditingError, target: ConfigurationTarget, value: IConfigurationValue): void { + private onConfigurationFileDirtyError(error: IConfigurationEditingError, target: ConfigurationTarget, value: IConfigurationValue, scopes: IConfigurationOverrides): void { this.choiceService.choose(Severity.Error, error.message, [nls.localize('saveAndRetry', "Save Settings and Retry"), nls.localize('open', "Open Settings"), nls.localize('close', "Close")], 2) .then(option => { switch (option) { case 0: - this.writeConfiguration(target, value, { force: true }); + this.writeConfiguration(target, value, { force: true, scopes }); break; case 1: this.openSettings(target); @@ -257,7 +259,7 @@ export class ConfigurationEditingService implements IConfigurationEditingService }); } - private getConfigurationEditOperation(target: ConfigurationTarget, config: IConfigurationValue): IConfigurationEditOperation { + private getConfigurationEditOperation(target: ConfigurationTarget, config: IConfigurationValue, overrides: IConfigurationOverrides): IConfigurationEditOperation { // Check for standalone workspace configurations if (config.key) { @@ -280,9 +282,27 @@ export class ConfigurationEditingService implements IConfigurationEditingService } if (target === ConfigurationTarget.USER) { - return { key: config.key, value: config.value, overrideIdentifier: config.overrideIdentifier, resource: URI.file(this.environmentService.appSettingsPath) }; + return { key: config.key, value: config.value, overrideIdentifier: overrides.overrideIdentifier, resource: URI.file(this.environmentService.appSettingsPath) }; } - return { key: config.key, value: config.value, overrideIdentifier: config.overrideIdentifier, resource: this.contextService.toResource(WORKSPACE_CONFIG_DEFAULT_PATH) }; + return { key: config.key, value: config.value, overrideIdentifier: overrides.overrideIdentifier, resource: this.getConfigurationFileResource(overrides.resource) }; } -} \ No newline at end of file + + private getConfigurationFileResource(resource: URI): URI { + const workspace = this.contextService.getWorkspace2(); + if (workspace) { + if (resource) { + const root = this.contextService.getRoot(resource); + if (root) { + return this.toResource(WORKSPACE_CONFIG_DEFAULT_PATH, root); + } + } + return this.toResource(WORKSPACE_CONFIG_DEFAULT_PATH, workspace.roots[0]); + } + return null; + } + + private toResource(relativePath: string, root: URI): URI { + return URI.file(paths.join(root.fsPath, relativePath)); + } +} diff --git a/src/vs/workbench/services/configuration/node/configurationService.ts b/src/vs/workbench/services/configuration/node/configurationService.ts deleted file mode 100644 index b0537b9a12ce2fbdba9c3eab3a71623e49c0703c..0000000000000000000000000000000000000000 --- a/src/vs/workbench/services/configuration/node/configurationService.ts +++ /dev/null @@ -1,353 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -'use strict'; - -import { TPromise } from 'vs/base/common/winjs.base'; -import uri from 'vs/base/common/uri'; -import paths = require('vs/base/common/paths'); -import extfs = require('vs/base/node/extfs'); -import objects = require('vs/base/common/objects'); -import { RunOnceScheduler } from 'vs/base/common/async'; -import collections = require('vs/base/common/collections'); -import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; -import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { IDisposable, Disposable } from 'vs/base/common/lifecycle'; -import { readFile } from 'vs/base/node/pfs'; -import errors = require('vs/base/common/errors'); -import { ScopedConfigModel, WorkspaceConfigModel, WorkspaceSettingsConfigModel } from 'vs/workbench/services/configuration/common/configurationModels'; -import { IConfigurationServiceEvent, ConfigurationSource, getConfigurationValue, IConfigModel, IConfigurationOptions } from 'vs/platform/configuration/common/configuration'; -import { ConfigModel } from 'vs/platform/configuration/common/model'; -import { ConfigurationService as BaseConfigurationService } from 'vs/platform/configuration/node/configurationService'; -import { IWorkspaceConfigurationValues, IWorkspaceConfigurationService, IWorkspaceConfigurationValue, WORKSPACE_CONFIG_FOLDER_DEFAULT_NAME, WORKSPACE_STANDALONE_CONFIGURATIONS, WORKSPACE_CONFIG_DEFAULT_PATH } from 'vs/workbench/services/configuration/common/configuration'; -import { FileChangeType, FileChangesEvent, isEqual } from 'vs/platform/files/common/files'; -import Event, { Emitter } from 'vs/base/common/event'; - - -interface IStat { - resource: uri; - isDirectory?: boolean; - children?: { resource: uri; }[]; -} - -interface IContent { - resource: uri; - value: string; -} - -interface IWorkspaceConfiguration { - workspace: T; - consolidated: any; -} - -/** - * Wraps around the basic configuration service and adds knowledge about workspace settings. - */ -export class WorkspaceConfigurationService extends Disposable implements IWorkspaceConfigurationService, IDisposable { - - public _serviceBrand: any; - - private static RELOAD_CONFIGURATION_DELAY = 50; - - private _onDidUpdateConfiguration: Emitter; - private baseConfigurationService: BaseConfigurationService; - - private cachedConfig: ConfigModel; - private cachedWorkspaceConfig: WorkspaceConfigModel; - - private bulkFetchFromWorkspacePromise: TPromise; - private workspaceFilePathToConfiguration: { [relativeWorkspacePath: string]: TPromise> }; - private reloadConfigurationScheduler: RunOnceScheduler; - - constructor( - @IWorkspaceContextService private contextService: IWorkspaceContextService, - @IEnvironmentService environmentService: IEnvironmentService, - private workspaceSettingsRootFolder: string = WORKSPACE_CONFIG_FOLDER_DEFAULT_NAME - ) { - super(); - this.workspaceFilePathToConfiguration = Object.create(null); - - this.cachedConfig = new ConfigModel(null); - this.cachedWorkspaceConfig = new WorkspaceConfigModel(new WorkspaceSettingsConfigModel(null), []); - - this._onDidUpdateConfiguration = this._register(new Emitter()); - - this.baseConfigurationService = this._register(new BaseConfigurationService(environmentService)); - - this.reloadConfigurationScheduler = this._register(new RunOnceScheduler(() => this.doLoadConfiguration() - .then(config => this._onDidUpdateConfiguration.fire({ - config: config.consolidated, - source: ConfigurationSource.Workspace, - sourceConfig: config.workspace - })) - .done(null, errors.onUnexpectedError), WorkspaceConfigurationService.RELOAD_CONFIGURATION_DELAY)); - - this._register(this.baseConfigurationService.onDidUpdateConfiguration(e => this.onBaseConfigurationChanged(e))); - } - - get onDidUpdateConfiguration(): Event { - return this._onDidUpdateConfiguration.event; - } - - private onBaseConfigurationChanged(event: IConfigurationServiceEvent): void { - if (event.source === ConfigurationSource.Default) { - this.cachedWorkspaceConfig.update(); - } - - // update cached config when base config changes - const configModel = >this.baseConfigurationService.getCache().consolidated // global/default values (do NOT modify) - .merge(this.cachedWorkspaceConfig); // workspace configured values - - // emit this as update to listeners if changed - if (!objects.equals(this.cachedConfig.contents, configModel.contents)) { - this.cachedConfig = configModel; - this._onDidUpdateConfiguration.fire({ - config: this.cachedConfig.contents, - source: event.source, - sourceConfig: event.sourceConfig - }); - } - } - - public initialize(): TPromise { - return this.doLoadConfiguration().then(() => null); - } - - public getConfiguration(section?: string): C - public getConfiguration(options?: IConfigurationOptions): C - public getConfiguration(arg?: any): C { - const options = this.toOptions(arg); - const configModel = options.overrideIdentifier ? this.cachedConfig.configWithOverrides(options.overrideIdentifier) : this.cachedConfig; - return options.section ? configModel.getContentsFor(options.section) : configModel.contents; - } - - public lookup(key: string, overrideIdentifier?: string): IWorkspaceConfigurationValue { - const configurationValue = this.baseConfigurationService.lookup(key, overrideIdentifier); - return { - default: configurationValue.default, - user: configurationValue.user, - workspace: objects.clone(getConfigurationValue(overrideIdentifier ? this.cachedWorkspaceConfig.configWithOverrides(overrideIdentifier).contents : this.cachedWorkspaceConfig.contents, key)), - value: objects.clone(getConfigurationValue(overrideIdentifier ? this.cachedConfig.configWithOverrides(overrideIdentifier).contents : this.cachedConfig.contents, key)) - }; - } - - public keys() { - const keys = this.baseConfigurationService.keys(); - - return { - default: keys.default, - user: keys.user, - workspace: this.cachedWorkspaceConfig.keys - }; - } - - public values(): IWorkspaceConfigurationValues { - const result: IWorkspaceConfigurationValues = Object.create(null); - const keyset = this.keys(); - const keys = [...keyset.workspace, ...keyset.user, ...keyset.default].sort(); - - let lastKey: string; - for (const key of keys) { - if (key !== lastKey) { - lastKey = key; - result[key] = this.lookup(key); - } - } - - return result; - } - - public reloadConfiguration(section?: string): TPromise { - - // Reset caches to ensure we are hitting the disk - this.bulkFetchFromWorkspacePromise = null; - this.workspaceFilePathToConfiguration = Object.create(null); - - // Load configuration - return this.baseConfigurationService.reloadConfiguration().then(() => { - const current = this.cachedConfig; - return this.doLoadConfiguration().then(configuration => { - // emit this as update to listeners if changed - if (!objects.equals(current, this.cachedConfig)) { - this._onDidUpdateConfiguration.fire({ - config: configuration.consolidated, - source: ConfigurationSource.Workspace, - sourceConfig: configuration.workspace - }); - } - return section ? configuration.consolidated[section] : configuration.consolidated; - }); - }); - } - - private toOptions(arg: any): IConfigurationOptions { - if (typeof arg === 'string') { - return { section: arg }; - } - if (typeof arg === 'object') { - return arg; - } - return {}; - } - - private doLoadConfiguration(): TPromise> { - - // Load workspace locals - return this.loadWorkspaceConfigFiles().then(workspaceConfigFiles => { - - // Consolidate (support *.json files in the workspace settings folder) - const workspaceSettingsConfig = >workspaceConfigFiles[WORKSPACE_CONFIG_DEFAULT_PATH] || new WorkspaceSettingsConfigModel(null); - const otherConfigModels = Object.keys(workspaceConfigFiles).filter(key => key !== WORKSPACE_CONFIG_DEFAULT_PATH).map(key => >workspaceConfigFiles[key]); - this.cachedWorkspaceConfig = new WorkspaceConfigModel(workspaceSettingsConfig, otherConfigModels); - - // Override base (global < user) with workspace locals (global < user < workspace) - this.cachedConfig = >this.baseConfigurationService.getCache().consolidated // global/default values (do NOT modify) - .merge(this.cachedWorkspaceConfig); // workspace configured values - - return { - consolidated: this.cachedConfig.contents, - workspace: this.cachedWorkspaceConfig.contents - }; - }); - } - - private loadWorkspaceConfigFiles(): TPromise<{ [relativeWorkspacePath: string]: IConfigModel }> { - - // Return early if we don't have a workspace - if (!this.contextService.hasWorkspace()) { - return TPromise.as(Object.create(null)); - } - - // once: when invoked for the first time we fetch json files that contribute settings - if (!this.bulkFetchFromWorkspacePromise) { - this.bulkFetchFromWorkspacePromise = resolveStat(this.contextService.toResource(this.workspaceSettingsRootFolder)).then(stat => { - if (!stat.isDirectory) { - return TPromise.as([]); - } - - return resolveContents(stat.children.filter(stat => { - const isJson = paths.extname(stat.resource.fsPath) === '.json'; - if (!isJson) { - return false; // only JSON files - } - - return this.isWorkspaceConfigurationFile(this.contextService.toWorkspaceRelativePath(stat.resource)); // only workspace config files - }).map(stat => stat.resource)); - }, err => [] /* never fail this call */) - .then((contents: IContent[]) => { - contents.forEach(content => this.workspaceFilePathToConfiguration[this.contextService.toWorkspaceRelativePath(content.resource)] = TPromise.as(this.createConfigModel(content))); - }, errors.onUnexpectedError); - } - - // on change: join on *all* configuration file promises so that we can merge them into a single configuration object. this - // happens whenever a config file changes, is deleted, or added - return this.bulkFetchFromWorkspacePromise.then(() => TPromise.join(this.workspaceFilePathToConfiguration)); - } - - public handleWorkspaceFileEvents(event: FileChangesEvent): void { - const events = event.changes; - let affectedByChanges = false; - - // Find changes that affect workspace configuration files - for (let i = 0, len = events.length; i < len; i++) { - const resource = events[i].resource; - const isJson = paths.extname(resource.fsPath) === '.json'; - const isDeletedSettingsFolder = (events[i].type === FileChangeType.DELETED && isEqual(paths.basename(resource.fsPath), this.workspaceSettingsRootFolder)); - if (!isJson && !isDeletedSettingsFolder) { - continue; // only JSON files or the actual settings folder - } - - const workspacePath = this.contextService.toWorkspaceRelativePath(resource); - if (!workspacePath) { - continue; // event is not inside workspace - } - - // Handle case where ".vscode" got deleted - if (workspacePath === this.workspaceSettingsRootFolder && events[i].type === FileChangeType.DELETED) { - this.workspaceFilePathToConfiguration = Object.create(null); - affectedByChanges = true; - } - - // only valid workspace config files - if (!this.isWorkspaceConfigurationFile(workspacePath)) { - continue; - } - - // insert 'fetch-promises' for add and update events and - // remove promises for delete events - switch (events[i].type) { - case FileChangeType.DELETED: - affectedByChanges = collections.remove(this.workspaceFilePathToConfiguration, workspacePath); - break; - case FileChangeType.UPDATED: - case FileChangeType.ADDED: - this.workspaceFilePathToConfiguration[workspacePath] = resolveContent(resource).then(content => this.createConfigModel(content), errors.onUnexpectedError); - affectedByChanges = true; - } - } - - // trigger reload of the configuration if we are affected by changes - if (affectedByChanges && !this.reloadConfigurationScheduler.isScheduled()) { - this.reloadConfigurationScheduler.schedule(); - } - } - - private createConfigModel(content: IContent): IConfigModel { - const path = this.contextService.toWorkspaceRelativePath(content.resource); - if (path === WORKSPACE_CONFIG_DEFAULT_PATH) { - return new WorkspaceSettingsConfigModel(content.value, content.resource.toString()); - } else { - const matches = /\/([^\.]*)*\.json/.exec(path); - if (matches && matches[1]) { - return new ScopedConfigModel(content.value, content.resource.toString(), matches[1]); - } - } - return new ConfigModel(null); - } - - private isWorkspaceConfigurationFile(workspaceRelativePath: string): boolean { - return [WORKSPACE_CONFIG_DEFAULT_PATH, WORKSPACE_STANDALONE_CONFIGURATIONS.launch, WORKSPACE_STANDALONE_CONFIGURATIONS.tasks].some(p => p === workspaceRelativePath); - } - - public getUnsupportedWorkspaceKeys(): string[] { - return this.cachedWorkspaceConfig.workspaceSettingsConfig.unsupportedKeys; - } -} - -// node.hs helper functions - -function resolveContents(resources: uri[]): TPromise { - const contents: IContent[] = []; - - return TPromise.join(resources.map(resource => { - return resolveContent(resource).then(content => { - contents.push(content); - }); - })).then(() => contents); -} - -function resolveContent(resource: uri): TPromise { - return readFile(resource.fsPath).then(contents => ({ resource, value: contents.toString() })); -} - -function resolveStat(resource: uri): TPromise { - return new TPromise((c, e) => { - extfs.readdir(resource.fsPath, (error, children) => { - if (error) { - if ((error).code === 'ENOTDIR') { - c({ resource }); - } else { - e(error); - } - } else { - c({ - resource, - isDirectory: true, - children: children.map(child => { return { resource: uri.file(paths.join(resource.fsPath, child)) }; }) - }); - } - }); - }); -} \ No newline at end of file diff --git a/src/vs/workbench/services/configuration/test/common/configurationModels.test.ts b/src/vs/workbench/services/configuration/test/common/configurationModels.test.ts index 4e6ff132c7ec91616147cab7af8ab11d3eb14b77..2609ca32cef5e00ba8f6c91ee3a8d0218f9ca802 100644 --- a/src/vs/workbench/services/configuration/test/common/configurationModels.test.ts +++ b/src/vs/workbench/services/configuration/test/common/configurationModels.test.ts @@ -5,26 +5,26 @@ 'use strict'; import * as assert from 'assert'; -import { WorkspaceConfigModel, ScopedConfigModel, WorkspaceSettingsConfigModel } from 'vs/workbench/services/configuration/common/configurationModels'; +import { FolderConfigurationModel, ScopedConfigurationModel, FolderSettingsModel } from 'vs/workbench/services/configuration/common/configurationModels'; suite('ConfigurationService - Model', () => { test('Test scoped configs are undefined', () => { - const settingsConfig = new WorkspaceSettingsConfigModel(JSON.stringify({ + const settingsConfig = new FolderSettingsModel(JSON.stringify({ awesome: true })); - const testObject = new WorkspaceConfigModel(settingsConfig, []); + const testObject = new FolderConfigurationModel(settingsConfig, []); assert.equal(testObject.getContentsFor('task'), undefined); }); test('Test consolidate (settings and tasks)', () => { - const settingsConfig = new WorkspaceSettingsConfigModel(JSON.stringify({ + const settingsConfig = new FolderSettingsModel(JSON.stringify({ awesome: true })); - const tasksConfig = new ScopedConfigModel(JSON.stringify({ + const tasksConfig = new ScopedConfigurationModel(JSON.stringify({ awesome: false }), '', 'tasks'); @@ -35,15 +35,15 @@ suite('ConfigurationService - Model', () => { } }; - assert.deepEqual(new WorkspaceConfigModel(settingsConfig, [tasksConfig]).contents, expected); + assert.deepEqual(new FolderConfigurationModel(settingsConfig, [tasksConfig]).contents, expected); }); test('Test consolidate (settings and launch)', () => { - const settingsConfig = new WorkspaceSettingsConfigModel(JSON.stringify({ + const settingsConfig = new FolderSettingsModel(JSON.stringify({ awesome: true })); - const launchConfig = new ScopedConfigModel(JSON.stringify({ + const launchConfig = new ScopedConfigurationModel(JSON.stringify({ awesome: false }), '', 'launch'); @@ -54,11 +54,11 @@ suite('ConfigurationService - Model', () => { } }; - assert.deepEqual(new WorkspaceConfigModel(settingsConfig, [launchConfig]).contents, expected); + assert.deepEqual(new FolderConfigurationModel(settingsConfig, [launchConfig]).contents, expected); }); test('Test consolidate (settings and launch and tasks) - launch/tasks wins over settings file', () => { - const settingsConfig = new WorkspaceSettingsConfigModel(JSON.stringify({ + const settingsConfig = new FolderSettingsModel(JSON.stringify({ awesome: true, launch: { launchConfig: 'defined', @@ -70,11 +70,11 @@ suite('ConfigurationService - Model', () => { } })); - const tasksConfig = new ScopedConfigModel(JSON.stringify({ + const tasksConfig = new ScopedConfigurationModel(JSON.stringify({ taskConfig: 'overwritten', }), '', 'tasks'); - const launchConfig = new ScopedConfigModel(JSON.stringify({ + const launchConfig = new ScopedConfigurationModel(JSON.stringify({ launchConfig: 'overwritten', }), '', 'launch'); @@ -90,7 +90,7 @@ suite('ConfigurationService - Model', () => { } }; - assert.deepEqual(new WorkspaceConfigModel(settingsConfig, [launchConfig, tasksConfig]).contents, expected); - assert.deepEqual(new WorkspaceConfigModel(settingsConfig, [tasksConfig, launchConfig]).contents, expected); + assert.deepEqual(new FolderConfigurationModel(settingsConfig, [launchConfig, tasksConfig]).contents, expected); + assert.deepEqual(new FolderConfigurationModel(settingsConfig, [tasksConfig, launchConfig]).contents, expected); }); }); \ No newline at end of file diff --git a/src/vs/workbench/services/configuration/test/node/configurationService.test.ts b/src/vs/workbench/services/configuration/test/node/configuration.test.ts similarity index 92% rename from src/vs/workbench/services/configuration/test/node/configurationService.test.ts rename to src/vs/workbench/services/configuration/test/node/configuration.test.ts index 3d202425b4ad7d55b6aee6b3df6329cf0535d5a3..fadc195a84690997fe11d48f6cf53025be91be01 100644 --- a/src/vs/workbench/services/configuration/test/node/configurationService.test.ts +++ b/src/vs/workbench/services/configuration/test/node/configuration.test.ts @@ -11,15 +11,15 @@ import path = require('path'); import fs = require('fs'); import * as sinon from 'sinon'; import { TPromise } from 'vs/base/common/winjs.base'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { ParsedArgs } from 'vs/platform/environment/common/environment'; -import { WorkspaceContextService } from 'vs/platform/workspace/common/workspace'; +import { Workspace } from 'vs/platform/workspace/common/workspace'; import { EnvironmentService } from 'vs/platform/environment/node/environmentService'; import { parseArgs } from 'vs/platform/environment/node/argv'; import extfs = require('vs/base/node/extfs'); import uuid = require('vs/base/common/uuid'); import { IConfigurationRegistry, Extensions as ConfigurationExtensions } from 'vs/platform/configuration/common/configurationRegistry'; -import { WorkspaceConfigurationService } from 'vs/workbench/services/configuration/node/configurationService'; +import { WorkspaceConfigurationService } from 'vs/workbench/services/configuration/node/configuration'; import URI from 'vs/base/common/uri'; import { FileChangeType, FileChangesEvent } from 'vs/platform/files/common/files'; @@ -47,9 +47,8 @@ suite('WorkspaceConfigurationService - Node', () => { } function createService(workspaceDir: string, globalSettingsFile: string): TPromise { - const workspaceContextService = new WorkspaceContextService({ resource: URI.file(workspaceDir) }); const environmentService = new SettingsTestEnvironmentService(parseArgs(process.argv), process.execPath, globalSettingsFile); - const service = new WorkspaceConfigurationService(workspaceContextService, environmentService); + const service = new WorkspaceConfigurationService(environmentService, new Workspace(workspaceDir, workspaceDir, [URI.file(workspaceDir)])); return service.initialize().then(() => service); } @@ -204,15 +203,14 @@ suite('WorkspaceConfigurationService - Node', () => { test('workspace change triggers event', (done: () => void) => { createWorkspace((workspaceDir, globalSettingsFile, cleanUp) => { - const workspaceContextService = new WorkspaceContextService({ resource: URI.file(workspaceDir) }); const environmentService = new SettingsTestEnvironmentService(parseArgs(process.argv), process.execPath, globalSettingsFile); - const service = new WorkspaceConfigurationService(workspaceContextService, environmentService); + const service = new WorkspaceConfigurationService(environmentService, new Workspace(workspaceDir, workspaceDir, [URI.file(workspaceDir)])); return service.initialize().then(() => { service.onDidUpdateConfiguration(event => { const config = service.getConfiguration<{ testworkbench: { editor: { icons: boolean } } }>(); assert.equal(config.testworkbench.editor.icons, true); - assert.equal(event.config.testworkbench.editor.icons, true); + assert.equal(service.getConfiguration().testworkbench.editor.icons, true); service.dispose(); @@ -230,9 +228,8 @@ suite('WorkspaceConfigurationService - Node', () => { test('workspace reload should triggers event if content changed', (done: () => void) => { createWorkspace((workspaceDir, globalSettingsFile, cleanUp) => { - const workspaceContextService = new WorkspaceContextService({ resource: URI.file(workspaceDir) }); const environmentService = new SettingsTestEnvironmentService(parseArgs(process.argv), process.execPath, globalSettingsFile); - const service = new WorkspaceConfigurationService(workspaceContextService, environmentService); + const service = new WorkspaceConfigurationService(environmentService, new Workspace(workspaceDir, workspaceDir, [URI.file(workspaceDir)])); return service.initialize().then(() => { const settingsFile = path.join(workspaceDir, '.vscode', 'settings.json'); @@ -255,9 +252,8 @@ suite('WorkspaceConfigurationService - Node', () => { test('workspace reload should not trigger event if nothing changed', (done: () => void) => { createWorkspace((workspaceDir, globalSettingsFile, cleanUp) => { - const workspaceContextService = new WorkspaceContextService({ resource: URI.file(workspaceDir) }); const environmentService = new SettingsTestEnvironmentService(parseArgs(process.argv), process.execPath, globalSettingsFile); - const service = new WorkspaceConfigurationService(workspaceContextService, environmentService); + const service = new WorkspaceConfigurationService(environmentService, new Workspace(workspaceDir, workspaceDir, [URI.file(workspaceDir)])); return service.initialize().then(() => { const settingsFile = path.join(workspaceDir, '.vscode', 'settings.json'); @@ -280,9 +276,8 @@ suite('WorkspaceConfigurationService - Node', () => { test('workspace reload should not trigger event if there is no model', (done: () => void) => { createWorkspace((workspaceDir, globalSettingsFile, cleanUp) => { - const workspaceContextService = new WorkspaceContextService({ resource: URI.file(workspaceDir) }); const environmentService = new SettingsTestEnvironmentService(parseArgs(process.argv), process.execPath, globalSettingsFile); - const service = new WorkspaceConfigurationService(workspaceContextService, environmentService); + const service = new WorkspaceConfigurationService(environmentService, new Workspace(workspaceDir, workspaceDir, [URI.file(workspaceDir)])); return service.initialize().then(() => { const target = sinon.stub(); diff --git a/src/vs/workbench/services/configuration/test/node/configurationEditingService.test.ts b/src/vs/workbench/services/configuration/test/node/configurationEditingService.test.ts index a444ccfb9cfcada53ef12120c8e9c18c4303c278..d7db5a91f86b935ea06dcb2c3f5c019100cebec6 100644 --- a/src/vs/workbench/services/configuration/test/node/configurationEditingService.test.ts +++ b/src/vs/workbench/services/configuration/test/node/configurationEditingService.test.ts @@ -12,16 +12,16 @@ import path = require('path'); import fs = require('fs'); import * as json from 'vs/base/common/json'; import { TPromise } from 'vs/base/common/winjs.base'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { ParsedArgs, IEnvironmentService } from 'vs/platform/environment/common/environment'; import { parseArgs } from 'vs/platform/environment/node/argv'; -import { WorkspaceContextService, IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; +import { IWorkspaceContextService, Workspace } from 'vs/platform/workspace/common/workspace'; import { EnvironmentService } from 'vs/platform/environment/node/environmentService'; import extfs = require('vs/base/node/extfs'); -import { TestTextFileService, TestEditorGroupService, TestLifecycleService, TestBackupFileService } from 'vs/workbench/test/workbenchTestServices'; +import { TestTextFileService, TestEditorGroupService, TestLifecycleService, TestBackupFileService, TestStorageService } from 'vs/workbench/test/workbenchTestServices'; import uuid = require('vs/base/common/uuid'); import { IConfigurationRegistry, Extensions as ConfigurationExtensions } from 'vs/platform/configuration/common/configurationRegistry'; -import { WorkspaceConfigurationService } from 'vs/workbench/services/configuration/node/configurationService'; +import { WorkspaceConfigurationService } from 'vs/workbench/services/configuration/node/configuration'; import URI from 'vs/base/common/uri'; import { FileService } from 'vs/workbench/services/files/node/fileService'; import { ConfigurationEditingService } from 'vs/workbench/services/configuration/node/configurationEditingService'; @@ -37,13 +37,15 @@ import { IBackupFileService } from 'vs/workbench/services/backup/common/backup'; import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService'; import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; -import { ITextModelResolverService } from 'vs/editor/common/services/resolverService'; +import { ITextModelService } from 'vs/editor/common/services/resolverService'; import { TextModelResolverService } from 'vs/workbench/services/textmodelResolver/common/textModelResolverService'; import { IModeService } from 'vs/editor/common/services/modeService'; import { ModeServiceImpl } from 'vs/editor/common/services/modeServiceImpl'; import { IModelService } from 'vs/editor/common/services/modelService'; import { ModelServiceImpl } from 'vs/editor/common/services/modelServiceImpl'; import { IChoiceService, IMessageService } from 'vs/platform/message/common/message'; +import { IStorageService } from 'vs/platform/storage/common/storage'; +import { TestConfigurationService } from "vs/platform/configuration/test/common/testConfigurationService"; class SettingsTestEnvironmentService extends EnvironmentService { @@ -113,20 +115,27 @@ suite('ConfigurationEditingService', () => { clearServices(); instantiationService = new TestInstantiationService(); - instantiationService.stub(IEnvironmentService, new SettingsTestEnvironmentService(parseArgs(process.argv), process.execPath, globalSettingsFile)); - instantiationService.stub(IWorkspaceContextService, new WorkspaceContextService(noWorkspace ? null : { resource: URI.file(workspaceDir) })); - const configurationService = instantiationService.createInstance(WorkspaceConfigurationService); - instantiationService.stub(IConfigurationService, configurationService); + const environmentService = new SettingsTestEnvironmentService(parseArgs(process.argv), process.execPath, globalSettingsFile); + instantiationService.stub(IEnvironmentService, environmentService); + const workspace = noWorkspace ? null : new Workspace(workspaceDir, workspaceDir, [URI.file(workspaceDir)]); + const workspaceService = new WorkspaceConfigurationService(environmentService, workspace); + instantiationService.stub(IWorkspaceContextService, workspaceService); + instantiationService.stub(IConfigurationService, workspaceService); instantiationService.stub(ILifecycleService, new TestLifecycleService()); instantiationService.stub(IEditorGroupService, new TestEditorGroupService()); instantiationService.stub(ITelemetryService, NullTelemetryService); instantiationService.stub(IModeService, ModeServiceImpl); instantiationService.stub(IModelService, instantiationService.createInstance(ModelServiceImpl)); - instantiationService.stub(IFileService, new FileService(workspaceDir, { disableWatcher: true })); + instantiationService.stub(IFileService, new FileService(workspaceService, new TestConfigurationService(), { disableWatcher: true })); instantiationService.stub(IUntitledEditorService, instantiationService.createInstance(UntitledEditorService)); - + instantiationService.stub(IStorageService, new TestStorageService()); + instantiationService.stub(IChoiceService, { + choose: (severity, message, options, cancelId): TPromise => { + return TPromise.as(cancelId); + } + }); instantiationService.stub(ITextFileService, instantiationService.createInstance(TestTextFileService)); - instantiationService.stub(ITextModelResolverService, instantiationService.createInstance(TextModelResolverService)); + instantiationService.stub(ITextModelService, instantiationService.createInstance(TextModelResolverService)); instantiationService.stub(IBackupFileService, new TestBackupFileService()); choiceService = instantiationService.stub(IChoiceService, { choose: (severity, message, options, cancelId): TPromise => { @@ -138,7 +147,7 @@ suite('ConfigurationEditingService', () => { }); testObject = instantiationService.createInstance(ConfigurationEditingService); - return configurationService.initialize(); + return workspaceService.initialize(); } teardown(() => { @@ -309,4 +318,4 @@ suite('ConfigurationEditingService', () => { assert.equal(parsed['tasks'][0]['taskName'], 'myTask'); }); }); -}); \ No newline at end of file +}); diff --git a/src/vs/workbench/services/configurationResolver/node/configurationResolverService.ts b/src/vs/workbench/services/configurationResolver/node/configurationResolverService.ts index 3caa6312379fd1c05f3c828247fabc12202f9075..7dcd63979b09271826388f61c0e1b435b76f52b9 100644 --- a/src/vs/workbench/services/configurationResolver/node/configurationResolverService.ts +++ b/src/vs/workbench/services/configurationResolver/node/configurationResolverService.ts @@ -214,7 +214,7 @@ export class ConfigurationResolverService implements IConfigurationResolverServi } // We need a map from interactive variables to keys because we only want to trigger an command once per key - - // even though it might occure multiple times in configuration #7026. + // even though it might occur multiple times in configuration #7026. const interactiveVariablesToSubstitutes: { [interactiveVariable: string]: { object: any, key: string }[] } = {}; const findInteractiveVariables = (object: any) => { Object.keys(object).forEach(key => { diff --git a/src/vs/workbench/services/configurationResolver/test/node/configurationResolverService.test.ts b/src/vs/workbench/services/configurationResolver/test/node/configurationResolverService.test.ts index 2bf018a34736f41ee2afa110b22ea34a6d7b383e..36f9742b19a42da049649427db815188c31570a8 100644 --- a/src/vs/workbench/services/configurationResolver/test/node/configurationResolverService.test.ts +++ b/src/vs/workbench/services/configurationResolver/test/node/configurationResolverService.test.ts @@ -7,7 +7,7 @@ import assert = require('assert'); import uri from 'vs/base/common/uri'; import platform = require('vs/base/common/platform'); import { TPromise } from 'vs/base/common/winjs.base'; -import { IConfigurationService, getConfigurationValue } from 'vs/platform/configuration/common/configuration'; +import { IConfigurationService, getConfigurationValue, IConfigurationOverrides, IConfigurationValue } from 'vs/platform/configuration/common/configuration'; import { ICommandService } from 'vs/platform/commands/common/commands'; import { IConfigurationResolverService } from 'vs/workbench/services/configurationResolver/common/configurationResolver'; import { ConfigurationResolverService } from 'vs/workbench/services/configurationResolver/node/configurationResolverService'; @@ -340,9 +340,11 @@ class MockConfigurationService implements IConfigurationService { public serviceId = IConfigurationService; public constructor(private configuration: any = {}) { } public reloadConfiguration(section?: string): TPromise { return TPromise.as(this.getConfiguration()); } - public lookup(key: string) { return { value: getConfigurationValue(this.getConfiguration(), key), default: getConfigurationValue(this.getConfiguration(), key), user: getConfigurationValue(this.getConfiguration(), key) }; } - public keys() { return { default: [], user: [] }; } + public lookup(key: string, overrides?: IConfigurationOverrides): IConfigurationValue { return { value: getConfigurationValue(this.getConfiguration(), key), default: getConfigurationValue(this.getConfiguration(), key), user: getConfigurationValue(this.getConfiguration(), key), workspace: void 0, folder: void 0 }; } + public keys() { return { default: [], user: [], workspace: [] }; } + public values() { return {}; } public getConfiguration(): any { return this.configuration; } + public getConfigurationData(): any { return null; } public onDidUpdateConfiguration() { return { dispose() { } }; } } diff --git a/src/vs/workbench/services/contextview/electron-browser/contextmenuService.ts b/src/vs/workbench/services/contextview/electron-browser/contextmenuService.ts index 0815aae6e33593b1694f9bc83e1354d499a6c631..50e56ffac45c4f2a258c5e94b4ddfa385fc17317 100644 --- a/src/vs/workbench/services/contextview/electron-browser/contextmenuService.ts +++ b/src/vs/workbench/services/contextview/electron-browser/contextmenuService.ts @@ -87,7 +87,7 @@ export class ContextMenuService implements IContextMenuService { } }; - const keybinding = !!delegate.getKeyBinding ? delegate.getKeyBinding(e) : undefined; + const keybinding = !!delegate.getKeyBinding ? delegate.getKeyBinding(e) : this.keybindingService.lookupKeybinding(e.id); if (keybinding) { const electronAccelerator = keybinding.getElectronAccelerator(); if (electronAccelerator) { diff --git a/src/vs/workbench/services/crashReporter/common/crashReporterService.ts b/src/vs/workbench/services/crashReporter/common/crashReporterService.ts new file mode 100644 index 0000000000000000000000000000000000000000..4ee9d234d9d5c1d2a9aea97246587d4bd95306c4 --- /dev/null +++ b/src/vs/workbench/services/crashReporter/common/crashReporterService.ts @@ -0,0 +1,43 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +'use strict'; + +import nls = require('vs/nls'); +import { IConfigurationRegistry, Extensions } from 'vs/platform/configuration/common/configurationRegistry'; +import { Registry } from 'vs/platform/registry/common/platform'; +import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; + +export const ICrashReporterService = createDecorator('crashReporterService'); + +export const TELEMETRY_SECTION_ID = 'telemetry'; + +export interface ICrashReporterConfig { + enableCrashReporter: boolean; +} + +const configurationRegistry = Registry.as(Extensions.Configuration); +configurationRegistry.registerConfiguration({ + 'id': TELEMETRY_SECTION_ID, + 'order': 110, + title: nls.localize('telemetryConfigurationTitle', "Telemetry"), + 'type': 'object', + 'properties': { + 'telemetry.enableCrashReporter': { + 'type': 'boolean', + 'description': nls.localize('telemetry.enableCrashReporting', "Enable crash reports to be sent to Microsoft.\nThis option requires restart to take effect."), + 'default': true + } + } +}); + +export interface ICrashReporterService { + _serviceBrand: any; + getChildProcessStartOptions(processName: string): Electron.CrashReporterStartOptions; +} + +export const NullCrashReporterService: ICrashReporterService = { + _serviceBrand: undefined, + getChildProcessStartOptions(processName: string) { return undefined; } +}; \ No newline at end of file diff --git a/src/vs/workbench/services/crashReporter/electron-browser/crashReporterService.ts b/src/vs/workbench/services/crashReporter/electron-browser/crashReporterService.ts new file mode 100644 index 0000000000000000000000000000000000000000..096c578d77ffc82e09ad5e78786199d79eecdc8a --- /dev/null +++ b/src/vs/workbench/services/crashReporter/electron-browser/crashReporterService.ts @@ -0,0 +1,95 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +'use strict'; + +import { onUnexpectedError } from 'vs/base/common/errors'; +import { assign, clone } from 'vs/base/common/objects'; +import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; +import { IWindowsService } from 'vs/platform/windows/common/windows'; +import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; +import { crashReporter } from 'electron'; +import product from 'vs/platform/node/product'; +import pkg from 'vs/platform/node/package'; +import * as os from 'os'; +import { ICrashReporterService, TELEMETRY_SECTION_ID, ICrashReporterConfig } from 'vs/workbench/services/crashReporter/common/crashReporterService'; +import { isWindows, isMacintosh, isLinux } from 'vs/base/common/platform'; + +export class CrashReporterService implements ICrashReporterService { + + public _serviceBrand: any; + + private options: Electron.CrashReporterStartOptions; + private isEnabled: boolean; + + constructor( + @ITelemetryService private telemetryService: ITelemetryService, + @IWindowsService private windowsService: IWindowsService, + @IConfigurationService configurationService: IConfigurationService + ) { + const config = configurationService.getConfiguration(TELEMETRY_SECTION_ID); + this.isEnabled = !!config.enableCrashReporter; + + if (this.isEnabled) { + this.startCrashReporter(); + } + } + + private startCrashReporter(): void { + + // base options with product info + this.options = { + companyName: product.crashReporter.companyName, + productName: product.crashReporter.productName, + submitURL: this.getSubmitURL(), + extra: { + vscode_version: pkg.version, + vscode_commit: product.commit + } + }; + + // mixin telemetry info + this.telemetryService.getTelemetryInfo() + .then(info => { + assign(this.options.extra, { + vscode_sessionId: info.sessionId, + vscode_machineId: info.machineId + }); + + // start crash reporter right here + crashReporter.start(clone(this.options)); + + // start crash reporter in the main process + return this.windowsService.startCrashReporter(this.options); + }) + .done(null, onUnexpectedError); + } + + private getSubmitURL(): string { + let submitURL: string; + if (isWindows) { + submitURL = product.hockeyApp[`win32-${process.arch}`]; + } else if (isMacintosh) { + submitURL = product.hockeyApp.darwin; + } else if (isLinux) { + submitURL = product.hockeyApp[`linux-${process.arch}`]; + } + + return submitURL; + } + + public getChildProcessStartOptions(name: string): Electron.CrashReporterStartOptions { + + // Experimental crash reporting support for child processes on Mac only for now + if (this.isEnabled && isMacintosh) { + const childProcessOptions = clone(this.options); + childProcessOptions.extra.processName = name; + childProcessOptions.crashesDirectory = os.tmpdir(); + + return childProcessOptions; + } + + return void 0; + } +} \ No newline at end of file diff --git a/src/vs/workbench/services/editor/browser/editorService.ts b/src/vs/workbench/services/editor/browser/editorService.ts index b7257dd4119bac9cea60cad0faa4879cb895e5b7..f2ac5bbf146e6b53460448d7a4f3fd7a2ff1f4f2 100644 --- a/src/vs/workbench/services/editor/browser/editorService.ts +++ b/src/vs/workbench/services/editor/browser/editorService.ts @@ -7,20 +7,19 @@ import { TPromise } from 'vs/base/common/winjs.base'; import URI from 'vs/base/common/uri'; import network = require('vs/base/common/network'); -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { basename, dirname } from 'vs/base/common/paths'; import { BaseEditor } from 'vs/workbench/browser/parts/editor/baseEditor'; import { EditorInput, EditorOptions, TextEditorOptions, IEditorRegistry, Extensions, SideBySideEditorInput, IFileEditorInput, IFileInputFactory } from 'vs/workbench/common/editor'; import { ResourceEditorInput } from 'vs/workbench/common/editor/resourceEditorInput'; -import { UntitledEditorInput } from 'vs/workbench/common/editor/untitledEditorInput'; -import { IUntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService'; +import { IUntitledEditorService, UNTITLED_SCHEMA } from 'vs/workbench/services/untitled/common/untitledEditorService'; import { IWorkbenchEditorService, IResourceInputType } from 'vs/workbench/services/editor/common/editorService'; import { IEditorInput, IEditorOptions, ITextEditorOptions, Position, Direction, IEditor, IResourceInput, IResourceDiffInput, IResourceSideBySideInput, IUntitledResourceInput } from 'vs/platform/editor/common/editor'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { DiffEditorInput } from 'vs/workbench/common/editor/diffEditorInput'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import nls = require('vs/nls'); -import { getPathLabel, IWorkspaceProvider } from 'vs/base/common/labels'; +import { getPathLabel } from 'vs/base/common/labels'; import { ResourceMap } from 'vs/base/common/map'; import { once } from 'vs/base/common/event'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; @@ -31,7 +30,7 @@ export interface IEditorPart { openEditors(editors: { input: IEditorInput, position: Position, options?: IEditorOptions | ITextEditorOptions }[]): TPromise; replaceEditors(editors: { toReplace: IEditorInput, replaceWith: IEditorInput, options?: IEditorOptions | ITextEditorOptions }[], position?: Position): TPromise; closeEditor(position: Position, input: IEditorInput): TPromise; - closeEditors(position: Position, except?: IEditorInput, direction?: Direction): TPromise; + closeEditors(position: Position, filter?: { except?: IEditorInput, direction?: Direction, unmodifiedOnly?: boolean }): TPromise; closeAllEditors(except?: Position): TPromise; getActiveEditor(): BaseEditor; getVisibleEditors(): IEditor[]; @@ -130,17 +129,17 @@ export class WorkbenchEditorService implements IWorkbenchEditorService { return TPromise.as(null); } - private toOptions(arg1?: any): EditorOptions { - if (!arg1 || arg1 instanceof EditorOptions) { - return arg1; + private toOptions(options?: IEditorOptions | EditorOptions): EditorOptions { + if (!options || options instanceof EditorOptions) { + return options as EditorOptions; } - const textOptions: ITextEditorOptions = arg1; + const textOptions: ITextEditorOptions = options; if (!!textOptions.selection) { - return TextEditorOptions.create(arg1); + return TextEditorOptions.create(options); } - return EditorOptions.create(arg1); + return EditorOptions.create(options); } /** @@ -169,9 +168,9 @@ export class WorkbenchEditorService implements IWorkbenchEditorService { return this.editorPart.openEditors(typedInputs); } - public replaceEditors(editors: { toReplace: IResourceInputType, replaceWith: IResourceInputType }[], position?: Position): TPromise; - public replaceEditors(editors: { toReplace: IEditorInput, replaceWith: IEditorInput, options?: IEditorOptions }[], position?: Position): TPromise; - public replaceEditors(editors: any[], position?: Position): TPromise { + public replaceEditors(editors: { toReplace: IResourceInputType, replaceWith: IResourceInputType }[], position?: Position): TPromise; + public replaceEditors(editors: { toReplace: IEditorInput, replaceWith: IEditorInput, options?: IEditorOptions }[], position?: Position): TPromise; + public replaceEditors(editors: any[], position?: Position): TPromise { const toReplaceInputs = editors.map(editor => this.createInput(editor.toReplace)); const replaceWithInputs = editors.map(editor => this.createInput(editor.replaceWith)); const typedReplacements: { toReplace: IEditorInput, replaceWith: IEditorInput, options?: EditorOptions }[] = editors.map((editor, index) => { @@ -195,8 +194,8 @@ export class WorkbenchEditorService implements IWorkbenchEditorService { return this.editorPart.closeEditor(position, input); } - public closeEditors(position: Position, except?: IEditorInput, direction?: Direction): TPromise { - return this.editorPart.closeEditors(position, except, direction); + public closeEditors(position: Position, filter?: { except?: IEditorInput, direction?: Direction, unmodifiedOnly?: boolean }): TPromise { + return this.editorPart.closeEditors(position, filter); } public closeAllEditors(except?: Position): TPromise { @@ -233,8 +232,8 @@ export class WorkbenchEditorService implements IWorkbenchEditorService { // Untitled file support const untitledInput = input; - if (!untitledInput.resource || typeof untitledInput.filePath === 'string' || (untitledInput.resource instanceof URI && untitledInput.resource.scheme === UntitledEditorInput.SCHEMA)) { - return this.untitledEditorService.createOrGet(untitledInput.filePath ? URI.file(untitledInput.filePath) : untitledInput.resource, untitledInput.language, untitledInput.contents); + if (!untitledInput.resource || typeof untitledInput.filePath === 'string' || (untitledInput.resource instanceof URI && untitledInput.resource.scheme === UNTITLED_SCHEMA)) { + return this.untitledEditorService.createOrGet(untitledInput.filePath ? URI.file(untitledInput.filePath) : untitledInput.resource, untitledInput.language, untitledInput.contents, untitledInput.encoding); } const resourceInput = input; @@ -288,7 +287,7 @@ export class WorkbenchEditorService implements IWorkbenchEditorService { return input; } - private toDiffLabel(res1: URI, res2: URI, context: IWorkspaceProvider, environment: IEnvironmentService): string { + private toDiffLabel(res1: URI, res2: URI, context: IWorkspaceContextService, environment: IEnvironmentService): string { const leftName = getPathLabel(res1.fsPath, context, environment); const rightName = getPathLabel(res2.fsPath, context, environment); diff --git a/src/vs/workbench/services/editor/common/editorService.ts b/src/vs/workbench/services/editor/common/editorService.ts index abedce481a0325bf0f6ce665db92516b6fe48901..5381c9de4e7933afbb49a45a9025cc40620b9613 100644 --- a/src/vs/workbench/services/editor/common/editorService.ts +++ b/src/vs/workbench/services/editor/common/editorService.ts @@ -80,7 +80,7 @@ export interface IWorkbenchEditorService extends IEditorService { * will not be closed. The direction can be used in that case to control if all other editors should get closed, * or towards a specific direction. */ - closeEditors(position: Position, except?: IEditorInput, direction?: Direction): TPromise; + closeEditors(position: Position, filter?: { except?: IEditorInput, direction?: Direction, unmodifiedOnly?: boolean }): TPromise; /** * Closes all editors across all groups. The optional position allows to keep one group alive. diff --git a/src/vs/workbench/services/editor/test/browser/editorService.test.ts b/src/vs/workbench/services/editor/test/browser/editorService.test.ts index e1f4057853ffc28c1b9f33bb5bbbe55e6c319e55..2bfc00650be14fc42025913c9d4c789ff1e18924 100644 --- a/src/vs/workbench/services/editor/test/browser/editorService.test.ts +++ b/src/vs/workbench/services/editor/test/browser/editorService.test.ts @@ -13,10 +13,11 @@ import URI from 'vs/base/common/uri'; import { BaseEditor } from 'vs/workbench/browser/parts/editor/baseEditor'; import { EditorInput, EditorOptions, TextEditorOptions } from 'vs/workbench/common/editor'; import { FileEditorInput } from 'vs/workbench/parts/files/common/editors/fileEditorInput'; -import { workbenchInstantiationService, TestThemeService } from 'vs/workbench/test/workbenchTestServices'; +import { workbenchInstantiationService } from 'vs/workbench/test/workbenchTestServices'; import { DelegatingWorkbenchEditorService, WorkbenchEditorService, IEditorPart } from 'vs/workbench/services/editor/browser/editorService'; import { UntitledEditorInput } from 'vs/workbench/common/editor/untitledEditorInput'; -import { ResourceEditorInput } from "vs/workbench/common/editor/resourceEditorInput"; +import { ResourceEditorInput } from 'vs/workbench/common/editor/resourceEditorInput'; +import { TestThemeService } from "vs/platform/theme/test/common/testThemeService"; let activeEditor: BaseEditor = { getSelection: function () { @@ -51,7 +52,7 @@ class TestEditorPart implements IEditorPart { return TPromise.as([]); } - public closeEditors(position: Position, except?: EditorInput, direction?: Direction): TPromise { + public closeEditors(position: Position, filter?: { except?: EditorInput, direction?: Direction, unmodifiedOnly?: boolean }): TPromise { return TPromise.as(null); } @@ -259,7 +260,7 @@ suite('WorkbenchEditorService', () => { } let ed = instantiationService.createInstance(MyEditor, 'my.editor'); - let inp = instantiationService.createInstance(ResourceEditorInput, 'name', 'description', URI.from('my://resource')); + let inp = instantiationService.createInstance(ResourceEditorInput, 'name', 'description', URI.parse('my://resource')); let delegate = instantiationService.createInstance(DelegatingWorkbenchEditorService); delegate.setEditorOpenHandler((input, options?) => { assert.strictEqual(input, inp); diff --git a/src/vs/workbench/services/files/electron-browser/fileService.ts b/src/vs/workbench/services/files/electron-browser/fileService.ts index 0fba07f5e29efe9c58f2d30784183105af07db02..a0a398e785512a69c63e6f8e7776cc56b3803c5e 100644 --- a/src/vs/workbench/services/files/electron-browser/fileService.ts +++ b/src/vs/workbench/services/files/electron-browser/fileService.ts @@ -48,7 +48,7 @@ export class FileService implements IFileService { @IConfigurationService private configurationService: IConfigurationService, @IWorkspaceContextService private contextService: IWorkspaceContextService, @IWorkbenchEditorService private editorService: IWorkbenchEditorService, - @IEnvironmentService environmentService: IEnvironmentService, + @IEnvironmentService private environmentService: IEnvironmentService, @IEditorGroupService private editorGroupService: IEditorGroupService, @ILifecycleService private lifecycleService: ILifecycleService, @IMessageService private messageService: IMessageService, @@ -65,13 +65,6 @@ export class FileService implements IFileService { const configuration = this.configurationService.getConfiguration(); - // adjust encodings - const encodingOverride: IEncodingOverride[] = []; - encodingOverride.push({ resource: uri.file(environmentService.appSettingsHome), encoding: encoding.UTF8 }); - if (this.contextService.hasWorkspace()) { - encodingOverride.push({ resource: uri.file(paths.join(this.contextService.getWorkspace().resource.fsPath, '.vscode')), encoding: encoding.UTF8 }); - } - let watcherIgnoredPatterns: string[] = []; if (configuration.files && configuration.files.watcherExclude) { watcherIgnoredPatterns = Object.keys(configuration.files.watcherExclude).filter(k => !!configuration.files.watcherExclude[k]); @@ -80,16 +73,14 @@ export class FileService implements IFileService { // build config const fileServiceConfig: IFileServiceOptions = { errorLogger: (msg: string) => this.onFileServiceError(msg), - encoding: configuration.files && configuration.files.encoding, - autoGuessEncoding: configuration.files && configuration.files.autoGuessEncoding, - encodingOverride, + encodingOverride: this.getEncodingOverrides(), watcherIgnoredPatterns, verboseLogging: environmentService.verbose, + useExperimentalFileWatcher: configuration.files.useExperimentalFileWatcher }; // create service - const workspace = this.contextService.getWorkspace(); - this.raw = new NodeFileService(workspace ? workspace.resource.fsPath : void 0, fileServiceConfig); + this.raw = new NodeFileService(contextService, configurationService, fileServiceConfig); // Listeners this.registerListeners(); @@ -103,7 +94,7 @@ export class FileService implements IFileService { return this._onAfterOperation.event; } - private onFileServiceError(msg: any): void { + private onFileServiceError(msg: string): void { errors.onUnexpectedError(msg); // Detect if we run < .NET Framework 4.5 @@ -134,15 +125,34 @@ export class FileService implements IFileService { this.toUnbind.push(this.raw.onAfterOperation(e => this._onAfterOperation.fire(e))); // Config changes - this.toUnbind.push(this.configurationService.onDidUpdateConfiguration(e => this.onConfigurationChange(e.config))); + this.toUnbind.push(this.configurationService.onDidUpdateConfiguration(e => this.onConfigurationChange(this.configurationService.getConfiguration()))); // Editor changing this.toUnbind.push(this.editorGroupService.onEditorsChanged(() => this.onEditorsChanged())); + // Root changes + this.toUnbind.push(this.contextService.onDidChangeWorkspaceRoots(() => this.onDidChangeWorkspaceRoots())); + // Lifecycle this.lifecycleService.onShutdown(this.dispose, this); } + private onDidChangeWorkspaceRoots(): void { + this.updateOptions({ encodingOverride: this.getEncodingOverrides() }); + } + + private getEncodingOverrides(): IEncodingOverride[] { + const encodingOverride: IEncodingOverride[] = []; + encodingOverride.push({ resource: uri.file(this.environmentService.appSettingsHome), encoding: encoding.UTF8 }); + if (this.contextService.hasWorkspace()) { + this.contextService.getWorkspace2().roots.forEach(root => { + encodingOverride.push({ resource: uri.file(paths.join(root.fsPath, '.vscode')), encoding: encoding.UTF8 }); + }); + } + + return encodingOverride; + } + private onEditorsChanged(): void { this.handleOutOfWorkspaceWatchers(); } @@ -178,7 +188,7 @@ export class FileService implements IFileService { this.updateOptions(configuration.files); } - public updateOptions(options: any): void { + public updateOptions(options: object): void { this.raw.updateOptions(options); } @@ -186,6 +196,10 @@ export class FileService implements IFileService { return this.raw.resolveFile(resource, options); } + public resolveFiles(toResolve: { resource: uri, options?: IResolveFileOptions }[]): TPromise { + return this.raw.resolveFiles(toResolve); + } + public existsFile(resource: uri): TPromise { return this.raw.existsFile(resource); } @@ -239,11 +253,6 @@ export class FileService implements IFileService { } private doMoveItemToTrash(resource: uri): TPromise { - const workspace = this.contextService.getWorkspace(); - if (!workspace) { - return TPromise.wrapError('Need a workspace to use this'); - } - const absolutePath = resource.fsPath; const result = shell.moveItemToTrash(absolutePath); if (!result) { diff --git a/src/vs/workbench/services/files/node/fileService.ts b/src/vs/workbench/services/files/node/fileService.ts index a00926d40bb52971720498221d62f4e1f3d947f6..de5ef1f63bd565f453fa593b4d7239925a97057b 100644 --- a/src/vs/workbench/services/files/node/fileService.ts +++ b/src/vs/workbench/services/files/node/fileService.ts @@ -11,8 +11,8 @@ import os = require('os'); import crypto = require('crypto'); import assert = require('assert'); -import { isParent, FileOperation, FileOperationEvent, IContent, IFileService, IResolveFileOptions, IResolveContentOptions, IFileStat, IStreamContent, IFileOperationResult, FileOperationResult, IUpdateContentOptions, FileChangeType, IImportResult, MAX_FILE_SIZE, FileChangesEvent, isEqualOrParent } from 'vs/platform/files/common/files'; -import strings = require('vs/base/common/strings'); +import { isParent, FileOperation, FileOperationEvent, IContent, IFileService, IResolveFileOptions, IResolveContentOptions, IFileStat, IStreamContent, IFileOperationResult, FileOperationResult, IUpdateContentOptions, FileChangeType, IImportResult, MAX_FILE_SIZE, FileChangesEvent, IFilesConfiguration } from 'vs/platform/files/common/files'; +import { isEqualOrParent } from 'vs/base/common/paths'; import { ResourceMap } from 'vs/base/common/map'; import arrays = require('vs/base/common/arrays'); import baseMime = require('vs/base/common/mime'); @@ -25,6 +25,7 @@ import uri from 'vs/base/common/uri'; import nls = require('vs/nls'); import { isWindows, isLinux } from 'vs/base/common/platform'; import { dispose, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; +import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import pfs = require('vs/base/node/pfs'); import encoding = require('vs/base/node/encoding'); @@ -34,6 +35,8 @@ import { FileWatcher as UnixWatcherService } from 'vs/workbench/services/files/n import { FileWatcher as WindowsWatcherService } from 'vs/workbench/services/files/node/watcher/win32/watcherService'; import { toFileChangesEvent, normalize, IRawFileChange } from 'vs/workbench/services/files/node/watcher/common'; import Event, { Emitter } from 'vs/base/common/event'; +import { FileWatcher as NsfwWatcherService } from 'vs/workbench/services/files/node/watcher/nsfw/watcherService'; +import { IConfigurationService } from "vs/platform/configuration/common/configuration"; export interface IEncodingOverride { resource: uri; @@ -43,13 +46,11 @@ export interface IEncodingOverride { export interface IFileServiceOptions { tmpDir?: string; errorLogger?: (msg: string) => void; - encoding?: string; - autoGuessEncoding?: boolean; - bom?: string; encodingOverride?: IEncodingOverride[]; watcherIgnoredPatterns?: string[]; disableWatcher?: boolean; verboseLogging?: boolean; + useExperimentalFileWatcher?: boolean; } function etag(stat: fs.Stats): string; @@ -76,7 +77,6 @@ export class FileService implements IFileService { private static FS_REWATCH_DELAY = 300; // delay to rewatch a file that was renamed or deleted (in ms) private static MAX_DEGREE_OF_PARALLEL_FS_OPS = 10; // degree of parallel fs calls that we accept at the same time - private basePath: string; private tmpPath: string; private options: IFileServiceOptions; @@ -89,22 +89,12 @@ export class FileService implements IFileService { private fileChangesWatchDelayer: ThrottledDelayer; private undeliveredRawFileChangesEvents: IRawFileChange[]; - constructor(basePath: string, options: IFileServiceOptions) { + constructor( + private contextService: IWorkspaceContextService, + private configurationService: IConfigurationService, + options: IFileServiceOptions, + ) { this.toDispose = []; - this.basePath = basePath ? paths.normalize(basePath) : void 0; - - if (this.basePath && this.basePath.indexOf('\\\\') === 0 && strings.endsWith(this.basePath, paths.sep)) { - // for some weird reason, node adds a trailing slash to UNC paths - // we never ever want trailing slashes as our base path unless - // someone opens root ("/"). - // See also https://github.com/nodejs/io.js/issues/1765 - this.basePath = strings.rtrim(this.basePath, paths.sep); - } - - if (this.basePath && !paths.isAbsolute(basePath)) { - throw new Error('basePath has to be an absolute path'); - } - this.options = options || Object.create(null); this.tmpPath = this.options.tmpDir || os.tmpdir(); @@ -118,11 +108,20 @@ export class FileService implements IFileService { this.options.errorLogger = console.error; } - if (this.basePath && !this.options.disableWatcher) { - if (isWindows) { - this.setupWin32WorkspaceWatching(); - } else { - this.setupUnixWorkspaceWatching(); + if (contextService.hasWorkspace() && !this.options.disableWatcher) { + + // new watcher: use it if setting tells us so or we run in multi-root environment + if (this.options.useExperimentalFileWatcher || contextService.getWorkspace2().roots.length > 1) { + this.setupNsfwWorkspceWatching(); + } + + // old watcher + else { + if (isWindows) { + this.setupWin32WorkspaceWatching(); + } else { + this.setupUnixWorkspaceWatching(); + } } } @@ -146,17 +145,25 @@ export class FileService implements IFileService { } private setupWin32WorkspaceWatching(): void { - this.toDispose.push(toDisposable(new WindowsWatcherService(this.basePath, this.options.watcherIgnoredPatterns, e => this._onFileChanges.fire(e), this.options.errorLogger, this.options.verboseLogging).startWatching())); + this.toDispose.push(toDisposable(new WindowsWatcherService(this.contextService, this.options.watcherIgnoredPatterns, e => this._onFileChanges.fire(e), this.options.errorLogger, this.options.verboseLogging).startWatching())); } private setupUnixWorkspaceWatching(): void { - this.toDispose.push(toDisposable(new UnixWatcherService(this.basePath, this.options.watcherIgnoredPatterns, e => this._onFileChanges.fire(e), this.options.errorLogger, this.options.verboseLogging).startWatching())); + this.toDispose.push(toDisposable(new UnixWatcherService(this.contextService, this.options.watcherIgnoredPatterns, e => this._onFileChanges.fire(e), this.options.errorLogger, this.options.verboseLogging).startWatching())); + } + + private setupNsfwWorkspceWatching(): void { + this.toDispose.push(toDisposable(new NsfwWatcherService(this.contextService, this.configurationService, e => this._onFileChanges.fire(e), this.options.errorLogger, this.options.verboseLogging).startWatching())); } public resolveFile(resource: uri, options?: IResolveFileOptions): TPromise { return this.resolve(resource, options); } + public resolveFiles(toResolve: { resource: uri, options?: IResolveFileOptions }[]): TPromise { + return TPromise.join(toResolve.map(resourceAndOptions => this.resolve(resourceAndOptions.resource, resourceAndOptions.options))); + } + public existsFile(resource: uri): TPromise { return this.resolveFile(resource).then(() => true, () => false); } @@ -206,7 +213,7 @@ export class FileService implements IFileService { } // 2.) detect mimes - const autoGuessEncoding = (options && options.autoGuessEncoding) || (this.options && this.options.autoGuessEncoding); + const autoGuessEncoding = (options && options.autoGuessEncoding) || this.configuredAutoGuessEncoding(resource); return detectMimesFromFile(absolutePath, { autoGuessEncoding }).then((detected: IMimeAndEncoding) => { const isText = detected.mimes.indexOf(baseMime.MIME_BINARY) === -1; @@ -231,7 +238,7 @@ export class FileService implements IFileService { } else { preferredEncoding = detected.encoding; } - } else if (this.options.encoding === encoding.UTF8_with_bom) { + } else if (this.configuredEncoding(resource) === encoding.UTF8_with_bom) { preferredEncoding = encoding.UTF8; // if we did not detect UTF 8 BOM before, this can only be UTF 8 then } @@ -584,7 +591,7 @@ export class FileService implements IFileService { } else if (preferredEncoding) { fileEncoding = preferredEncoding; } else { - fileEncoding = this.options.encoding; + fileEncoding = this.configuredEncoding(resource); } if (!fileEncoding || !encoding.encodingExists(fileEncoding)) { @@ -594,6 +601,18 @@ export class FileService implements IFileService { return fileEncoding; } + private configuredAutoGuessEncoding(resource: uri): boolean { + const config = this.configurationService.getConfiguration(void 0, { resource }) as IFilesConfiguration; + + return config && config.files && config.files.autoGuessEncoding === true; + } + + private configuredEncoding(resource: uri): string { + const config = this.configurationService.getConfiguration(void 0, { resource }) as IFilesConfiguration; + + return config && config.files && config.files.encoding; + } + private getEncodingOverride(resource: uri): string { if (resource && this.options.encodingOverride && this.options.encodingOverride.length) { for (let i = 0; i < this.options.encodingOverride.length; i++) { diff --git a/src/vs/workbench/services/files/node/watcher/nsfw/nsfwWatcherService.ts b/src/vs/workbench/services/files/node/watcher/nsfw/nsfwWatcherService.ts new file mode 100644 index 0000000000000000000000000000000000000000..dd1ce8bd2418e271090211c8861eb7b8d7b6f729 --- /dev/null +++ b/src/vs/workbench/services/files/node/watcher/nsfw/nsfwWatcherService.ts @@ -0,0 +1,168 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import * as glob from 'vs/base/common/glob'; +import * as path from 'path'; +import * as watcher from 'vs/workbench/services/files/node/watcher/common'; +import * as nsfw from 'nsfw'; +import { IWatcherService, IWatcherRequest } from 'vs/workbench/services/files/node/watcher/nsfw/watcher'; +import { TPromise, ProgressCallback, TValueCallback } from 'vs/base/common/winjs.base'; +import { ThrottledDelayer } from 'vs/base/common/async'; +import { FileChangeType } from 'vs/platform/files/common/files'; + +const nsfwActionToRawChangeType: { [key: number]: number } = []; +nsfwActionToRawChangeType[nsfw.actions.CREATED] = FileChangeType.ADDED; +nsfwActionToRawChangeType[nsfw.actions.MODIFIED] = FileChangeType.UPDATED; +nsfwActionToRawChangeType[nsfw.actions.DELETED] = FileChangeType.DELETED; + +interface IWatcherObjet { + start(): any; + stop(): any; +} + +interface IPathWatcher { + ready: TPromise; + watcher?: IWatcherObjet; + ignored: string[]; +} + +export class NsfwWatcherService implements IWatcherService { + private static FS_EVENT_DELAY = 50; // aggregate and only emit events when changes have stopped for this duration (in ms) + + private _pathWatchers: { [watchPath: string]: IPathWatcher } = {}; + private _watcherPromise: TPromise; + private _progressCallback: ProgressCallback; + private _verboseLogging: boolean; + + + public initialize(verboseLogging: boolean): TPromise { + this._verboseLogging = verboseLogging; + this._watcherPromise = new TPromise((c, e, p) => { + this._progressCallback = p; + }); + return this._watcherPromise; + } + + private _watch(request: IWatcherRequest): void { + let undeliveredFileEvents: watcher.IRawFileChange[] = []; + const fileEventDelayer = new ThrottledDelayer(NsfwWatcherService.FS_EVENT_DELAY); + + let readyPromiseCallback: TValueCallback; + this._pathWatchers[request.basePath] = { + ready: new TPromise(c => readyPromiseCallback = c), + ignored: request.ignored + }; + + nsfw(request.basePath, events => { + for (let i = 0; i < events.length; i++) { + const e = events[i]; + + // Logging + if (this._verboseLogging) { + const logPath = e.action === nsfw.actions.RENAMED ? path.join(e.directory, e.oldFile) + ' -> ' + e.newFile : path.join(e.directory, e.file); + console.log(e.action === nsfw.actions.CREATED ? '[CREATED]' : e.action === nsfw.actions.DELETED ? '[DELETED]' : e.action === nsfw.actions.MODIFIED ? '[CHANGED]' : '[RENAMED]', logPath); + } + + // Convert nsfw event to IRawFileChange and add to queue + let absolutePath: string; + if (e.action === nsfw.actions.RENAMED) { + // Rename fires when a file's name changes within a single directory + absolutePath = path.join(e.directory, e.oldFile); + if (!this._isPathIgnored(absolutePath, this._pathWatchers[request.basePath].ignored)) { + undeliveredFileEvents.push({ type: FileChangeType.DELETED, path: absolutePath }); + } + absolutePath = path.join(e.directory, e.newFile); + if (!this._isPathIgnored(absolutePath, this._pathWatchers[request.basePath].ignored)) { + undeliveredFileEvents.push({ type: FileChangeType.ADDED, path: absolutePath }); + } + } else { + absolutePath = path.join(e.directory, e.file); + if (!this._isPathIgnored(absolutePath, this._pathWatchers[request.basePath].ignored)) { + undeliveredFileEvents.push({ + type: nsfwActionToRawChangeType[e.action], + path: absolutePath + }); + } + } + } + + // Delay and send buffer + fileEventDelayer.trigger(() => { + const events = undeliveredFileEvents; + undeliveredFileEvents = []; + + // Broadcast to clients normalized + const res = watcher.normalize(events); + this._progressCallback(res); + + // Logging + if (this._verboseLogging) { + res.forEach(r => { + console.log(' >> normalized', r.type === FileChangeType.ADDED ? '[ADDED]' : r.type === FileChangeType.DELETED ? '[DELETED]' : '[CHANGED]', r.path); + }); + } + + return TPromise.as(null); + }); + }).then(watcher => { + this._pathWatchers[request.basePath].watcher = watcher; + const startPromise = watcher.start(); + startPromise.then(() => readyPromiseCallback(watcher)); + return startPromise; + }); + } + + public setRoots(roots: IWatcherRequest[]): TPromise { + const promises: TPromise[] = []; + const normalizedRoots = this._normalizeRoots(roots); + + // Gather roots that are not currently being watched + const rootsToStartWatching = normalizedRoots.filter(r => { + return !(r.basePath in this._pathWatchers); + }); + + // Gather current roots that don't exist in the new roots array + const rootsToStopWatching = Object.keys(this._pathWatchers).filter(r => { + return normalizedRoots.every(normalizedRoot => normalizedRoot.basePath !== r); + }); + + // Logging + if (this._verboseLogging) { + console.log(`Start watching: [${rootsToStartWatching.map(r => r.basePath).join(',')}]\nStop watching: [${rootsToStopWatching.join(',')}]`); + } + + // Stop watching some roots + rootsToStopWatching.forEach(root => { + this._pathWatchers[root].ready.then(watcher => watcher.stop()); + delete this._pathWatchers[root]; + }); + + // Start watching some roots + rootsToStartWatching.forEach(root => this._watch(root)); + + // Refresh ignored arrays in case they changed + roots.forEach(root => { + if (root.basePath in this._pathWatchers) { + this._pathWatchers[root.basePath].ignored = root.ignored; + } + }); + + return TPromise.join(promises).then(() => void 0); + } + + /** + * Normalizes a set of root paths by removing any root paths that are + * sub-paths of other roots. + */ + protected _normalizeRoots(roots: IWatcherRequest[]): IWatcherRequest[] { + return roots.filter(r => roots.every(other => { + return !(r.basePath.length > other.basePath.length && r.basePath.indexOf(other.basePath) === 0); + })); + } + + private _isPathIgnored(absolutePath: string, ignored: string[]): boolean { + return ignored && ignored.some(ignore => glob.match(ignore, absolutePath)); + } +} diff --git a/src/vs/workbench/services/files/node/watcher/nsfw/test/nsfwWatcherService.test.ts b/src/vs/workbench/services/files/node/watcher/nsfw/test/nsfwWatcherService.test.ts new file mode 100644 index 0000000000000000000000000000000000000000..caca4e25996aa9b04334da9a5f0df20f8ae95fcd --- /dev/null +++ b/src/vs/workbench/services/files/node/watcher/nsfw/test/nsfwWatcherService.test.ts @@ -0,0 +1,39 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +'use strict'; + +import assert = require('assert'); +import { NsfwWatcherService } from 'vs/workbench/services/files/node/watcher/nsfw/nsfwWatcherService'; +import { IWatcherRequest } from "vs/workbench/services/files/node/watcher/nsfw/watcher"; + +class TestNsfwWatcherService extends NsfwWatcherService { + public normalizeRoots(roots: string[]): string[] { + // Work with strings as paths to simplify testing + const requests: IWatcherRequest[] = roots.map(r => { + return { basePath: r, ignored: [] }; + }); + return this._normalizeRoots(requests).map(r => r.basePath); + } +} + +suite('NSFW Watcher Service', () => { + suite('_normalizeRoots', () => { + test('should not impacts roots that don\'t overlap', () => { + const service = new TestNsfwWatcherService(); + assert.deepEqual(service.normalizeRoots(['/a']), ['/a']); + assert.deepEqual(service.normalizeRoots(['/a', '/b']), ['/a', '/b']); + assert.deepEqual(service.normalizeRoots(['/a', '/b', '/c/d/e']), ['/a', '/b', '/c/d/e']); + }); + + test('should remove sub-folders of other roots', () => { + const service = new TestNsfwWatcherService(); + assert.deepEqual(service.normalizeRoots(['/a', '/a/b']), ['/a']); + assert.deepEqual(service.normalizeRoots(['/a', '/b', '/a/b']), ['/a', '/b']); + assert.deepEqual(service.normalizeRoots(['/b/a', '/a', '/b', '/a/b']), ['/a', '/b']); + assert.deepEqual(service.normalizeRoots(['/a', '/a/b', '/a/c/d']), ['/a']); + }); + }); +}); diff --git a/src/vs/workbench/services/files/node/watcher/nsfw/watcher.ts b/src/vs/workbench/services/files/node/watcher/nsfw/watcher.ts new file mode 100644 index 0000000000000000000000000000000000000000..0e87df28f8b42321109220774f13871270e28ea7 --- /dev/null +++ b/src/vs/workbench/services/files/node/watcher/nsfw/watcher.ts @@ -0,0 +1,23 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +'use strict'; + +import { TPromise } from 'vs/base/common/winjs.base'; + +export interface IWatcherRequest { + basePath: string; + ignored: string[]; +} + +export interface IWatcherService { + initialize(verboseLogging: boolean): TPromise; + setRoots(roots: IWatcherRequest[]): TPromise; +} + +export interface IFileWatcher { + startWatching(): () => void; + addFolder(folder: string): void; +} \ No newline at end of file diff --git a/src/vs/workbench/services/files/node/watcher/nsfw/watcherApp.ts b/src/vs/workbench/services/files/node/watcher/nsfw/watcherApp.ts new file mode 100644 index 0000000000000000000000000000000000000000..61b892cc45d632352b2597d11fb5b6ba039f307c --- /dev/null +++ b/src/vs/workbench/services/files/node/watcher/nsfw/watcherApp.ts @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +'use strict'; + +import { Server } from 'vs/base/parts/ipc/node/ipc.cp'; +import { WatcherChannel } from 'vs/workbench/services/files/node/watcher/nsfw/watcherIpc'; +import { NsfwWatcherService } from 'vs/workbench/services/files/node/watcher/nsfw/nsfwWatcherService'; + +const server = new Server(); +const service = new NsfwWatcherService(); +const channel = new WatcherChannel(service); +server.registerChannel('watcher', channel); \ No newline at end of file diff --git a/src/vs/workbench/services/files/node/watcher/nsfw/watcherIpc.ts b/src/vs/workbench/services/files/node/watcher/nsfw/watcherIpc.ts new file mode 100644 index 0000000000000000000000000000000000000000..88ebc3d19dad84ae87e533699751def70fb16aa2 --- /dev/null +++ b/src/vs/workbench/services/files/node/watcher/nsfw/watcherIpc.ts @@ -0,0 +1,42 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +'use strict'; + +import { TPromise } from 'vs/base/common/winjs.base'; +import { IChannel } from 'vs/base/parts/ipc/common/ipc'; +import { IWatcherRequest, IWatcherService } from './watcher'; + +export interface IWatcherChannel extends IChannel { + call(command: 'initialize', verboseLogging: boolean): TPromise; + call(command: 'setRoots', request: IWatcherRequest[]): TPromise; + call(command: string, arg: any): TPromise; +} + +export class WatcherChannel implements IWatcherChannel { + + constructor(private service: IWatcherService) { } + + call(command: string, arg: any): TPromise { + switch (command) { + case 'initialize': return this.service.initialize(arg); + case 'setRoots': return this.service.setRoots(arg); + } + return undefined; + } +} + +export class WatcherChannelClient implements IWatcherService { + + constructor(private channel: IWatcherChannel) { } + + initialize(verboseLogging: boolean): TPromise { + return this.channel.call('initialize', verboseLogging); + } + + setRoots(roots: IWatcherRequest[]): TPromise { + return this.channel.call('setRoots', roots); + } +} \ No newline at end of file diff --git a/src/vs/workbench/services/files/node/watcher/nsfw/watcherService.ts b/src/vs/workbench/services/files/node/watcher/nsfw/watcherService.ts new file mode 100644 index 0000000000000000000000000000000000000000..37ed0cb6c38b2de09a37760af448a1585048bf06 --- /dev/null +++ b/src/vs/workbench/services/files/node/watcher/nsfw/watcherService.ts @@ -0,0 +1,110 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +'use strict'; + +import { TPromise } from 'vs/base/common/winjs.base'; +import { getNextTickChannel } from 'vs/base/parts/ipc/common/ipc'; +import { Client } from 'vs/base/parts/ipc/node/ipc.cp'; +import uri from 'vs/base/common/uri'; +import { toFileChangesEvent, IRawFileChange } from 'vs/workbench/services/files/node/watcher/common'; +import { IWatcherChannel, WatcherChannelClient } from 'vs/workbench/services/files/node/watcher/nsfw/watcherIpc'; +import { FileChangesEvent, IFilesConfiguration } from 'vs/platform/files/common/files'; +import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; +import { IConfigurationService } from "vs/platform/configuration/common/configuration"; + +export class FileWatcher { + private static MAX_RESTARTS = 5; + + private service: WatcherChannelClient; + private isDisposed: boolean; + private restartCounter: number; + + constructor( + private contextService: IWorkspaceContextService, + private configurationService: IConfigurationService, + private onFileChanges: (changes: FileChangesEvent) => void, + private errorLogger: (msg: string) => void, + private verboseLogging: boolean, + ) { + this.isDisposed = false; + this.restartCounter = 0; + } + + public startWatching(): () => void { + const args = ['--type=watcherService']; + + const client = new Client( + uri.parse(require.toUrl('bootstrap')).fsPath, + { + serverName: 'Watcher', + args, + env: { + AMD_ENTRYPOINT: 'vs/workbench/services/files/node/watcher/nsfw/watcherApp', + PIPE_LOGGING: 'true', + VERBOSE_LOGGING: this.verboseLogging + } + } + ); + + // Initialize watcher + const channel = getNextTickChannel(client.getChannel('watcher')); + this.service = new WatcherChannelClient(channel); + this.service.initialize(this.verboseLogging).then(null, (err) => { + if (!(err instanceof Error && err.name === 'Canceled' && err.message === 'Canceled')) { + return TPromise.wrapError(err); // the service lib uses the promise cancel error to indicate the process died, we do not want to bubble this up + } + return undefined; + }, (events: IRawFileChange[]) => this.onRawFileEvents(events)).done(() => { + + // our watcher app should never be completed because it keeps on watching. being in here indicates + // that the watcher process died and we want to restart it here. we only do it a max number of times + if (!this.isDisposed) { + if (this.restartCounter <= FileWatcher.MAX_RESTARTS) { + this.errorLogger('[FileWatcher] terminated unexpectedly and is restarted again...'); + this.restartCounter++; + this.startWatching(); + } else { + this.errorLogger('[FileWatcher] failed to start after retrying for some time, giving up. Please report this as a bug report!'); + } + } + }, this.errorLogger); + + // Start watching + this.updateRoots(); + this.contextService.onDidChangeWorkspaceRoots(() => this.updateRoots()); + this.configurationService.onDidUpdateConfiguration(() => this.updateRoots()); + + return () => { + client.dispose(); + this.isDisposed = true; + }; + } + + private updateRoots() { + const roots = this.contextService.getWorkspace2().roots; + this.service.setRoots(roots.map(root => { + // Fetch the root's watcherExclude setting and return it + const configuration = this.configurationService.getConfiguration(undefined, { + resource: root + }); + let ignored: string[] = []; + if (configuration.files && configuration.files.watcherExclude) { + ignored = Object.keys(configuration.files.watcherExclude).filter(k => !!configuration.files.watcherExclude[k]); + } + return { + basePath: root.fsPath, + ignored + }; + })); + } + + private onRawFileEvents(events: IRawFileChange[]): void { + // Emit through broadcast service + if (events.length > 0) { + this.onFileChanges(toFileChangesEvent(events)); + } + } +} \ No newline at end of file diff --git a/src/vs/workbench/services/files/node/watcher/unix/chokidarWatcherService.ts b/src/vs/workbench/services/files/node/watcher/unix/chokidarWatcherService.ts index 63a17ea995d4e9ed2038a16d35c0a22019dad95e..3dc0a747c60fee2a00feb21b0a4d4b48f370b201 100644 --- a/src/vs/workbench/services/files/node/watcher/unix/chokidarWatcherService.ts +++ b/src/vs/workbench/services/files/node/watcher/unix/chokidarWatcherService.ts @@ -15,7 +15,7 @@ import { TPromise } from 'vs/base/common/winjs.base'; import { FileChangeType } from 'vs/platform/files/common/files'; import { ThrottledDelayer } from 'vs/base/common/async'; import strings = require('vs/base/common/strings'); -import { realpathSync } from 'vs/base/node/extfs'; +import { realcaseSync } from 'vs/base/node/extfs'; import { isMacintosh } from 'vs/base/common/platform'; import watcher = require('vs/workbench/services/files/node/watcher/common'); import { IWatcherRequest, IWatcherService } from './watcher'; @@ -43,7 +43,7 @@ export class ChokidarWatcherService implements IWatcherService { // so we have to find the real casing of the path and do some path massaging to fix this // see https://github.com/paulmillr/chokidar/issues/418 const originalBasePath = request.basePath; - const realBasePath = isMacintosh ? (realpathSync(originalBasePath) || originalBasePath) : originalBasePath; + const realBasePath = isMacintosh ? (realcaseSync(originalBasePath) || originalBasePath) : originalBasePath; const realBasePathLength = realBasePath.length; const realBasePathDiffers = (originalBasePath !== realBasePath); diff --git a/src/vs/workbench/services/files/node/watcher/unix/watcherService.ts b/src/vs/workbench/services/files/node/watcher/unix/watcherService.ts index 1854bcde469392da86bd6d39710d04ebbbbe7ee0..bee660a8777672c89b09e1f6999e3e0abff26f3a 100644 --- a/src/vs/workbench/services/files/node/watcher/unix/watcherService.ts +++ b/src/vs/workbench/services/files/node/watcher/unix/watcherService.ts @@ -12,6 +12,8 @@ import uri from 'vs/base/common/uri'; import { toFileChangesEvent, IRawFileChange } from 'vs/workbench/services/files/node/watcher/common'; import { IWatcherChannel, WatcherChannelClient } from 'vs/workbench/services/files/node/watcher/unix/watcherIpc'; import { FileChangesEvent } from 'vs/platform/files/common/files'; +import { IWorkspaceContextService } from "vs/platform/workspace/common/workspace"; +import { normalize } from "path"; export class FileWatcher { private static MAX_RESTARTS = 5; @@ -20,7 +22,7 @@ export class FileWatcher { private restartCounter: number; constructor( - private basePath: string, + private contextService: IWorkspaceContextService, private ignored: string[], private onFileChanges: (changes: FileChangesEvent) => void, private errorLogger: (msg: string) => void, @@ -50,7 +52,8 @@ export class FileWatcher { const service = new WatcherChannelClient(channel); // Start watching - service.watch({ basePath: this.basePath, ignored: this.ignored, verboseLogging: this.verboseLogging }).then(null, (err) => { + const basePath: string = normalize(this.contextService.getWorkspace2().roots[0].fsPath); + service.watch({ basePath: basePath, ignored: this.ignored, verboseLogging: this.verboseLogging }).then(null, (err) => { if (!(err instanceof Error && err.name === 'Canceled' && err.message === 'Canceled')) { return TPromise.wrapError(err); // the service lib uses the promise cancel error to indicate the process died, we do not want to bubble this up } diff --git a/src/vs/workbench/services/files/node/watcher/win32/csharpWatcherService.ts b/src/vs/workbench/services/files/node/watcher/win32/csharpWatcherService.ts index 6c1cfbc06112fe6426de3112e3f1a9c20cfdb620..d10e87c45ec0df65f965ab110a79d002d3b9f159 100644 --- a/src/vs/workbench/services/files/node/watcher/win32/csharpWatcherService.ts +++ b/src/vs/workbench/services/files/node/watcher/win32/csharpWatcherService.ts @@ -89,14 +89,14 @@ export class OutOfProcessWin32FolderWatcher { this.handle.stderr.on('data', (data: NodeBuffer) => this.onError(data)); // Exit - this.handle.on('exit', (code: any, signal: any) => this.onExit(code, signal)); + this.handle.on('exit', (code: number, signal: string) => this.onExit(code, signal)); } private onError(error: Error | NodeBuffer): void { this.errorCallback('[FileWatcher] process error: ' + error.toString()); } - private onExit(code: any, signal: any): void { + private onExit(code: number, signal: string): void { if (this.handle) { // exit while not yet being disposed is unexpected! this.errorCallback(`[FileWatcher] terminated unexpectedly (code: ${code}, signal: ${signal})`); diff --git a/src/vs/workbench/services/files/node/watcher/win32/watcherService.ts b/src/vs/workbench/services/files/node/watcher/win32/watcherService.ts index 50cbf234661ea84ac1e6c13da127e28510156e69..379a08b06d46ba1ad43632110340849fbb26651b 100644 --- a/src/vs/workbench/services/files/node/watcher/win32/watcherService.ts +++ b/src/vs/workbench/services/files/node/watcher/win32/watcherService.ts @@ -8,11 +8,15 @@ import { IRawFileChange, toFileChangesEvent } from 'vs/workbench/services/files/node/watcher/common'; import { OutOfProcessWin32FolderWatcher } from 'vs/workbench/services/files/node/watcher/win32/csharpWatcherService'; import { FileChangesEvent } from 'vs/platform/files/common/files'; +import { IWorkspaceContextService } from "vs/platform/workspace/common/workspace"; +import { normalize } from "path"; +import { rtrim, endsWith } from "vs/base/common/strings"; +import { sep } from "vs/base/common/paths"; export class FileWatcher { constructor( - private basePath: string, + private contextService: IWorkspaceContextService, private ignored: string[], private onFileChanges: (changes: FileChangesEvent) => void, private errorLogger: (msg: string) => void, @@ -21,8 +25,18 @@ export class FileWatcher { } public startWatching(): () => void { - let watcher = new OutOfProcessWin32FolderWatcher( - this.basePath, + let basePath: string = normalize(this.contextService.getWorkspace2().roots[0].fsPath); + + if (basePath && basePath.indexOf('\\\\') === 0 && endsWith(basePath, sep)) { + // for some weird reason, node adds a trailing slash to UNC paths + // we never ever want trailing slashes as our base path unless + // someone opens root ("/"). + // See also https://github.com/nodejs/io.js/issues/1765 + basePath = rtrim(basePath, sep); + } + + const watcher = new OutOfProcessWin32FolderWatcher( + basePath, this.ignored, (events) => this.onRawFileEvents(events), (error) => this.onError(error), diff --git a/src/vs/workbench/services/files/test/node/fileService.test.ts b/src/vs/workbench/services/files/test/node/fileService.test.ts index 846d09bda8dfc81487bb5a4bd80e533aa6fa8a52..aa98674ec561981a41c37d1b842a19786d48cfdc 100644 --- a/src/vs/workbench/services/files/test/node/fileService.test.ts +++ b/src/vs/workbench/services/files/test/node/fileService.test.ts @@ -19,6 +19,9 @@ import extfs = require('vs/base/node/extfs'); import encodingLib = require('vs/base/node/encoding'); import utils = require('vs/workbench/services/files/test/node/utils'); import { onError } from 'vs/base/test/common/utils'; +import { TestContextService } from "vs/workbench/test/workbenchTestServices"; +import { Workspace } from "vs/platform/workspace/common/workspace"; +import { TestConfigurationService } from "vs/platform/configuration/test/common/testConfigurationService"; suite('FileService', () => { let service: FileService; @@ -35,7 +38,7 @@ suite('FileService', () => { return onError(error, done); } - service = new FileService(testDir, { disableWatcher: true }); + service = new FileService(new TestContextService(new Workspace(testDir, testDir, [uri.file(testDir)])), new TestConfigurationService(), { disableWatcher: true }); done(); }); }); @@ -505,6 +508,26 @@ suite('FileService', () => { }, error => onError(error, done)); }); + test('resolveFiles', function (done: () => void) { + service.resolveFiles([ + { resource: uri.file(testDir), options: { resolveTo: [uri.file(path.join(testDir, 'deep'))] } }, + { resource: uri.file(path.join(testDir, 'deep')) } + ]).then(res => { + const r1 = res[0]; + + assert.equal(r1.children.length, 6); + + let deep = utils.getByName(r1, 'deep'); + assert.equal(deep.children.length, 4); + + const r2 = res[1]; + assert.equal(r2.children.length, 4); + assert.equal(r2.name, 'deep'); + + done(); + }, error => onError(error, done)); + }); + test('existsFile', function (done: () => void) { service.existsFile(uri.file(testDir)).then((exists) => { assert.equal(exists, true); @@ -731,9 +754,11 @@ suite('FileService', () => { encoding: 'utf16le' }); - let _service = new FileService(_testDir, { - encoding: 'windows1252', - encodingOverride: encodingOverride, + let configurationService = new TestConfigurationService(); + configurationService.setUserConfiguration('files', { encoding: 'windows1252' }); + + let _service = new FileService(new TestContextService(new Workspace(_testDir, _testDir, [uri.file(_testDir)])), configurationService, { + encodingOverride, disableWatcher: true }); @@ -759,7 +784,7 @@ suite('FileService', () => { let _sourceDir = require.toUrl('./fixtures/service'); let resource = uri.file(path.join(testDir, 'index.html')); - let _service = new FileService(_testDir, { + let _service = new FileService(new TestContextService(new Workspace(_testDir, _testDir, [uri.file(_testDir)])), new TestConfigurationService(), { disableWatcher: true }); diff --git a/src/vs/workbench/services/history/browser/history.ts b/src/vs/workbench/services/history/browser/history.ts index c0b7e914c736f87fc9eadb241317b8f1d4db4657..c662208cee9166777339a1c57cdbd14f0a24cee2 100644 --- a/src/vs/workbench/services/history/browser/history.ts +++ b/src/vs/workbench/services/history/browser/history.ts @@ -20,7 +20,7 @@ import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; import { ILifecycleService } from 'vs/platform/lifecycle/common/lifecycle'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { once } from 'vs/base/common/event'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService'; @@ -74,7 +74,7 @@ export class EditorState { interface ISerializedFileHistoryEntry { resource?: string; - resourceJSON: any; + resourceJSON: object; } export abstract class BaseHistoryService { @@ -696,4 +696,27 @@ export class HistoryService extends BaseHistoryService implements IHistoryServic return void 0; }).filter(input => !!input); } + + public getLastActiveWorkspaceRoot(): URI { + if (!this.contextService.hasWorkspace()) { + return void 0; + } + + const history = this.getHistory(); + for (let i = 0; i < history.length; i++) { + const input = history[i]; + if (input instanceof EditorInput) { + continue; + } + + const resourceInput = input as IResourceInput; + const resourceWorkspace = this.contextService.getRoot(resourceInput.resource); + if (resourceWorkspace) { + return resourceWorkspace; + } + } + + // fallback to first workspace + return this.contextService.getWorkspace2().roots[0]; + } } diff --git a/src/vs/workbench/services/history/common/history.ts b/src/vs/workbench/services/history/common/history.ts index fde4c51dccbb82c9ce7469162408f3aa78707d80..25a127b3e085c55967e71dcf9e083c7d0d4c1b68 100644 --- a/src/vs/workbench/services/history/common/history.ts +++ b/src/vs/workbench/services/history/common/history.ts @@ -6,6 +6,7 @@ import { createDecorator, ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation'; import { IEditorInput, ITextEditorOptions, IResourceInput } from 'vs/platform/editor/common/editor'; +import URI from "vs/base/common/uri"; export const IHistoryService = createDecorator('historyService'); @@ -53,4 +54,10 @@ export interface IHistoryService { * Get the entire history of opened editors. */ getHistory(): (IEditorInput | IResourceInput)[]; + + /** + * Looking at the editor history, returns the workspace root of the last file that was + * inside the workspace and part of the editor history. + */ + getLastActiveWorkspaceRoot(): URI; } \ No newline at end of file diff --git a/src/vs/workbench/services/keybinding/common/keybindingEditing.ts b/src/vs/workbench/services/keybinding/common/keybindingEditing.ts index 6e0ad503e6bc06ebeb6b2152a87fc4b818e412fd..c9793ddfb0148bf5ef2db63aab40bb933970bc3e 100644 --- a/src/vs/workbench/services/keybinding/common/keybindingEditing.ts +++ b/src/vs/workbench/services/keybinding/common/keybindingEditing.ts @@ -20,7 +20,7 @@ import { Range } from 'vs/editor/common/core/range'; import { Selection } from 'vs/editor/common/core/selection'; import { IUserFriendlyKeybinding } from 'vs/platform/keybinding/common/keybinding'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { ITextModelResolverService, ITextEditorModel } from 'vs/editor/common/services/resolverService'; +import { ITextModelService, ITextEditorModel } from 'vs/editor/common/services/resolverService'; import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; import { IFileService } from 'vs/platform/files/common/files'; import { createDecorator, ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation'; @@ -48,7 +48,7 @@ export class KeybindingsEditingService extends Disposable implements IKeybinding private resource: URI = URI.file(this.environmentService.appKeybindingsPath); constructor( - @ITextModelResolverService private textModelResolverService: ITextModelResolverService, + @ITextModelService private textModelResolverService: ITextModelService, @ITextFileService private textFileService: ITextFileService, @IFileService private fileService: IFileService, @IConfigurationService private configurationService: IConfigurationService, @@ -215,7 +215,7 @@ export class KeybindingsEditingService extends Disposable implements IKeybinding private resolveModelReference(): TPromise> { return this.fileService.existsFile(this.resource) .then(exists => { - const EOL = this.configurationService.getConfiguration({ section: 'files', overrideIdentifier: 'json' })['eol']; + const EOL = this.configurationService.getConfiguration('files', { overrideIdentifier: 'json' })['eol']; const result = exists ? TPromise.as(null) : this.fileService.updateContent(this.resource, this.getEmptyContent(EOL), { encoding: 'utf8' }); return result.then(() => this.textModelResolverService.createModelReference(this.resource)); }); @@ -262,4 +262,4 @@ export class KeybindingsEditingService extends Disposable implements IKeybinding private getEmptyContent(EOL: string): string { return '// ' + localize('emptyKeybindingsHeader', "Place your key bindings in this file to overwrite the defaults") + EOL + '[]'; } -} \ No newline at end of file +} diff --git a/src/vs/workbench/services/keybinding/common/macLinuxKeyboardMapper.ts b/src/vs/workbench/services/keybinding/common/macLinuxKeyboardMapper.ts index bf911f28c139dfd4a802c04abc121b239714cdab..a7790298f3718511c6a0afc18596b5d02250f04c 100644 --- a/src/vs/workbench/services/keybinding/common/macLinuxKeyboardMapper.ts +++ b/src/vs/workbench/services/keybinding/common/macLinuxKeyboardMapper.ts @@ -9,7 +9,7 @@ import { OperatingSystem } from 'vs/base/common/platform'; import { KeyCode, ResolvedKeybinding, KeyCodeUtils, SimpleKeybinding, Keybinding, KeybindingType, ResolvedKeybindingPart } from 'vs/base/common/keyCodes'; import { ScanCode, ScanCodeUtils, IMMUTABLE_CODE_TO_KEY_CODE, IMMUTABLE_KEY_CODE_TO_CODE, ScanCodeBinding } from 'vs/workbench/services/keybinding/common/scanCode'; import { CharCode } from 'vs/base/common/charCode'; -import { UILabelProvider, AriaLabelProvider, UserSettingsLabelProvider, ElectronAcceleratorLabelProvider } from 'vs/platform/keybinding/common/keybindingLabels'; +import { UILabelProvider, AriaLabelProvider, UserSettingsLabelProvider, ElectronAcceleratorLabelProvider } from 'vs/base/common/keybindingLabels'; import { IKeyboardMapper } from 'vs/workbench/services/keybinding/common/keyboardMapper'; import { IKeyboardEvent } from 'vs/platform/keybinding/common/keybinding'; diff --git a/src/vs/workbench/services/keybinding/common/windowsKeyboardMapper.ts b/src/vs/workbench/services/keybinding/common/windowsKeyboardMapper.ts index 3772cc723fbdda2c7b1e682737e3c543cc180b2c..02c1dac816cc36aa096eca176917719dde0ee62d 100644 --- a/src/vs/workbench/services/keybinding/common/windowsKeyboardMapper.ts +++ b/src/vs/workbench/services/keybinding/common/windowsKeyboardMapper.ts @@ -8,7 +8,7 @@ import { KeyCode, KeyCodeUtils, ResolvedKeybinding, Keybinding, SimpleKeybinding, KeybindingType, ResolvedKeybindingPart } from 'vs/base/common/keyCodes'; import { ScanCode, ScanCodeUtils, IMMUTABLE_CODE_TO_KEY_CODE, ScanCodeBinding } from 'vs/workbench/services/keybinding/common/scanCode'; import { CharCode } from 'vs/base/common/charCode'; -import { UILabelProvider, AriaLabelProvider, ElectronAcceleratorLabelProvider, UserSettingsLabelProvider } from 'vs/platform/keybinding/common/keybindingLabels'; +import { UILabelProvider, AriaLabelProvider, ElectronAcceleratorLabelProvider, UserSettingsLabelProvider } from 'vs/base/common/keybindingLabels'; import { OperatingSystem } from 'vs/base/common/platform'; import { IKeyboardMapper } from 'vs/workbench/services/keybinding/common/keyboardMapper'; import { IKeyboardEvent } from 'vs/platform/keybinding/common/keybinding'; @@ -107,6 +107,22 @@ export class WindowsNativeResolvedKeybinding extends ResolvedKeybinding { return UILabelProvider.toLabel(this._firstPart, firstPart, this._chordPart, chordPart, OperatingSystem.Windows); } + private _getUSLabelForKeybinding(keybinding: SimpleKeybinding): string { + if (!keybinding) { + return null; + } + if (keybinding.isDuplicateModifierCase()) { + return ''; + } + return KeyCodeUtils.toString(keybinding.keyCode); + } + + public getUSLabel(): string { + let firstPart = this._getUSLabelForKeybinding(this._firstPart); + let chordPart = this._getUSLabelForKeybinding(this._chordPart); + return UILabelProvider.toLabel(this._firstPart, firstPart, this._chordPart, chordPart, OperatingSystem.Windows); + } + private _getAriaLabelForKeybinding(keybinding: SimpleKeybinding): string { if (!keybinding) { return null; diff --git a/src/vs/workbench/services/keybinding/electron-browser/keybindingService.ts b/src/vs/workbench/services/keybinding/electron-browser/keybindingService.ts index 9e6f12e696c9e911cb0e6e0abe62c4dc7d31e16b..bbe796b6a2f1fd82213862056a6d141341e531bc 100644 --- a/src/vs/workbench/services/keybinding/electron-browser/keybindingService.ts +++ b/src/vs/workbench/services/keybinding/electron-browser/keybindingService.ts @@ -18,7 +18,7 @@ import { ICommandService } from 'vs/platform/commands/common/commands'; import { IKeybindingEvent, IUserFriendlyKeybinding, KeybindingSource, IKeyboardEvent } from 'vs/platform/keybinding/common/keybinding'; import { ContextKeyExpr, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { IKeybindingItem, KeybindingsRegistry, IKeybindingRule2 } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { keybindingsTelemetry } from 'vs/platform/telemetry/common/telemetryUtils'; import { IMessageService } from 'vs/platform/message/common/message'; @@ -210,7 +210,7 @@ let keybindingType: IJSONSchema = { type: 'string' }, key: { - description: nls.localize('vscode.extension.contributes.keybindings.key', 'Key or key sequence (separate keys with plus-sign and sequences with space, e.g Ctrl+O and Ctrl+L L for a chord'), + description: nls.localize('vscode.extension.contributes.keybindings.key', 'Key or key sequence (separate keys with plus-sign and sequences with space, e.g Ctrl+O and Ctrl+L L for a chord).'), type: 'string' }, mac: { diff --git a/src/vs/workbench/services/keybinding/test/keyboardMapperTestUtils.ts b/src/vs/workbench/services/keybinding/test/keyboardMapperTestUtils.ts index d79895b63f017006b15b52a46f82774dc15aa636..6f4655d98c8648829dc739d1b8713fba9c49975a 100644 --- a/src/vs/workbench/services/keybinding/test/keyboardMapperTestUtils.ts +++ b/src/vs/workbench/services/keybinding/test/keyboardMapperTestUtils.ts @@ -6,12 +6,10 @@ 'use strict'; import * as assert from 'assert'; -import { IHTMLContentElement } from 'vs/base/common/htmlContent'; import { IKeyboardMapper } from 'vs/workbench/services/keybinding/common/keyboardMapper'; import { Keybinding, ResolvedKeybinding, SimpleKeybinding } from 'vs/base/common/keyCodes'; import { TPromise } from 'vs/base/common/winjs.base'; import { readFile, writeFile } from 'vs/base/node/pfs'; -import { OperatingSystem } from 'vs/base/common/platform'; import { IKeyboardEvent } from 'vs/platform/keybinding/common/keybinding'; import { ScanCodeBinding } from 'vs/workbench/services/keybinding/common/scanCode'; @@ -52,37 +50,6 @@ export function assertResolveUserBinding(mapper: IKeyboardMapper, firstPart: Sim assert.deepEqual(actual, expected); } -function _htmlPieces(pieces: string[], OS: OperatingSystem): IHTMLContentElement[] { - let children: IHTMLContentElement[] = []; - for (let i = 0, len = pieces.length; i < len; i++) { - if (i !== 0 && OS !== OperatingSystem.Macintosh) { - children.push({ tagName: 'span', text: '+' }); - } - children.push({ tagName: 'span', className: 'monaco-kbkey', text: pieces[i] }); - } - return children; -} - -export function simpleHTMLLabel(pieces: string[], OS: OperatingSystem): IHTMLContentElement { - return { - tagName: 'span', - className: 'monaco-kb', - children: _htmlPieces(pieces, OS) - }; -} - -export function chordHTMLLabel(firstPart: string[], chordPart: string[], OS: OperatingSystem): IHTMLContentElement { - return { - tagName: 'span', - className: 'monaco-kb', - children: [].concat( - _htmlPieces(firstPart, OS), - [{ tagName: 'span', text: ' ' }], - _htmlPieces(chordPart, OS) - ) - }; -} - export function readRawMapping(file: string): TPromise { return readFile(require.toUrl(`vs/workbench/services/keybinding/test/${file}.js`)).then((buff) => { let contents = buff.toString(); diff --git a/src/vs/workbench/services/keybinding/test/macLinuxKeyboardMapper.test.ts b/src/vs/workbench/services/keybinding/test/macLinuxKeyboardMapper.test.ts index f168b02ef2f40486a1f9b83e0391c097ead7ef5d..cc84bdadccec8cccd98ac0f7672e2d88bd7c4cbd 100644 --- a/src/vs/workbench/services/keybinding/test/macLinuxKeyboardMapper.test.ts +++ b/src/vs/workbench/services/keybinding/test/macLinuxKeyboardMapper.test.ts @@ -9,7 +9,7 @@ import * as assert from 'assert'; import { KeyMod, KeyCode, createKeybinding, SimpleKeybinding, KeyChord } from 'vs/base/common/keyCodes'; import { MacLinuxKeyboardMapper, IMacLinuxKeyboardMapping } from 'vs/workbench/services/keybinding/common/macLinuxKeyboardMapper'; import { OperatingSystem } from 'vs/base/common/platform'; -import { UserSettingsLabelProvider } from 'vs/platform/keybinding/common/keybindingLabels'; +import { UserSettingsLabelProvider } from 'vs/base/common/keybindingLabels'; import { USLayoutResolvedKeybinding } from 'vs/platform/keybinding/common/usLayoutResolvedKeybinding'; import { ScanCodeUtils, ScanCodeBinding, ScanCode } from 'vs/workbench/services/keybinding/common/scanCode'; import { TPromise } from 'vs/base/common/winjs.base'; diff --git a/src/vs/workbench/services/keybinding/test/keybindingEditing.test.ts b/src/vs/workbench/services/keybinding/test/node/keybindingEditing.test.ts similarity index 91% rename from src/vs/workbench/services/keybinding/test/keybindingEditing.test.ts rename to src/vs/workbench/services/keybinding/test/node/keybindingEditing.test.ts index cc4495e14e945a22349987b952fe5b5b4f574227..4cd52b254320e0377fff41b27d7bbaff2309a8b5 100644 --- a/src/vs/workbench/services/keybinding/test/keybindingEditing.test.ts +++ b/src/vs/workbench/services/keybinding/test/node/keybindingEditing.test.ts @@ -9,6 +9,7 @@ import assert = require('assert'); import os = require('os'); import path = require('path'); import fs = require('fs'); +import uri from 'vs/base/common/uri'; import * as json from 'vs/base/common/json'; import { OS } from 'vs/base/common/platform'; import { USLayoutResolvedKeybinding } from 'vs/platform/keybinding/common/usLayoutResolvedKeybinding'; @@ -16,8 +17,8 @@ import { TPromise } from 'vs/base/common/winjs.base'; import { KeyCode, SimpleKeybinding, ChordKeybinding } from 'vs/base/common/keyCodes'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import extfs = require('vs/base/node/extfs'); -import { TestTextFileService, TestEditorGroupService, TestLifecycleService, TestBackupFileService, TestContextService } from 'vs/workbench/test/workbenchTestServices'; -import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; +import { TestTextFileService, TestEditorGroupService, TestLifecycleService, TestBackupFileService, TestContextService, TestStorageService } from 'vs/workbench/test/workbenchTestServices'; +import { IWorkspaceContextService, Workspace } from 'vs/platform/workspace/common/workspace'; import uuid = require('vs/base/common/uuid'); import { ConfigurationService } from 'vs/platform/configuration/node/configurationService'; import { FileService } from 'vs/workbench/services/files/node/fileService'; @@ -31,7 +32,7 @@ import { IBackupFileService } from 'vs/workbench/services/backup/common/backup'; import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService'; import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; -import { ITextModelResolverService } from 'vs/editor/common/services/resolverService'; +import { ITextModelService } from 'vs/editor/common/services/resolverService'; import { TextModelResolverService } from 'vs/workbench/services/textmodelResolver/common/textModelResolverService'; import { IModeService } from 'vs/editor/common/services/modeService'; import { ModeServiceImpl } from 'vs/editor/common/services/modeServiceImpl'; @@ -41,6 +42,9 @@ import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; import { KeybindingsEditingService } from 'vs/workbench/services/keybinding/common/keybindingEditing'; import { IUserFriendlyKeybinding } from 'vs/platform/keybinding/common/keybinding'; import { ResolvedKeybindingItem } from 'vs/platform/keybinding/common/resolvedKeybindingItem'; +import { IChoiceService } from 'vs/platform/message/common/message'; +import { IStorageService } from 'vs/platform/storage/common/storage'; +import { TestConfigurationService } from "vs/platform/configuration/test/common/testConfigurationService"; interface Modifiers { metaKey?: boolean; @@ -53,7 +57,7 @@ suite('Keybindings Editing', () => { let instantiationService: TestInstantiationService; let testObject: KeybindingsEditingService; - let testDir; + let testDir: string; let keybindingsFile; setup(() => { @@ -66,17 +70,22 @@ suite('Keybindings Editing', () => { instantiationService.stub(IConfigurationService, ConfigurationService); instantiationService.stub(IConfigurationService, 'getConfiguration', { 'eol': '\n' }); instantiationService.stub(IConfigurationService, 'onDidUpdateConfiguration', () => { }); - + instantiationService.stub(IStorageService, new TestStorageService()); + instantiationService.stub(IChoiceService, { + choose: (severity, message, options, cancelId): TPromise => { + return TPromise.as(cancelId); + } + }); instantiationService.stub(IWorkspaceContextService, new TestContextService()); instantiationService.stub(ILifecycleService, new TestLifecycleService()); instantiationService.stub(IEditorGroupService, new TestEditorGroupService()); instantiationService.stub(ITelemetryService, NullTelemetryService); instantiationService.stub(IModeService, ModeServiceImpl); instantiationService.stub(IModelService, instantiationService.createInstance(ModelServiceImpl)); - instantiationService.stub(IFileService, new FileService(testDir, { disableWatcher: true })); + instantiationService.stub(IFileService, new FileService(new TestContextService(new Workspace(testDir, testDir, [uri.file(testDir)])), new TestConfigurationService(), { disableWatcher: true })); instantiationService.stub(IUntitledEditorService, instantiationService.createInstance(UntitledEditorService)); instantiationService.stub(ITextFileService, instantiationService.createInstance(TestTextFileService)); - instantiationService.stub(ITextModelResolverService, instantiationService.createInstance(TextModelResolverService)); + instantiationService.stub(ITextModelService, instantiationService.createInstance(TextModelResolverService)); instantiationService.stub(IBackupFileService, new TestBackupFileService()); testObject = instantiationService.createInstance(KeybindingsEditingService); @@ -226,4 +235,4 @@ suite('Keybindings Editing', () => { return new ResolvedKeybindingItem(keybinding ? new USLayoutResolvedKeybinding(keybinding, OS) : null, command || 'some command', null, when ? ContextKeyExpr.deserialize(when) : null, isDefault === void 0 ? true : isDefault); } -}); \ No newline at end of file +}); diff --git a/src/vs/workbench/services/lifecycle/electron-browser/lifecycleService.ts b/src/vs/workbench/services/lifecycle/electron-browser/lifecycleService.ts index 3cf631de01a3d57f3309335d5e76071c6a58fee1..42230c25b94776066a910c0a73b8f78ddf48e11b 100644 --- a/src/vs/workbench/services/lifecycle/electron-browser/lifecycleService.ts +++ b/src/vs/workbench/services/lifecycle/electron-browser/lifecycleService.ts @@ -7,7 +7,7 @@ import { TPromise } from 'vs/base/common/winjs.base'; import Severity from 'vs/base/common/severity'; import { toErrorMessage } from 'vs/base/common/errorMessage'; -import { ILifecycleService, ShutdownEvent, ShutdownReason, StartupKind } from 'vs/platform/lifecycle/common/lifecycle'; +import { ILifecycleService, ShutdownEvent, ShutdownReason, StartupKind, LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle'; import { IMessageService } from 'vs/platform/message/common/message'; import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; import { IWindowIPCService } from 'vs/workbench/services/window/electron-browser/windowService'; @@ -20,11 +20,12 @@ export class LifecycleService implements ILifecycleService { public _serviceBrand: any; + private readonly _onDidChangePhase = new Emitter(); private readonly _onWillShutdown = new Emitter(); private readonly _onShutdown = new Emitter(); private readonly _startupKind: StartupKind; - private _willShutdown: boolean; + private _phase: LifecyclePhase = LifecyclePhase.Starting; constructor( @IMessageService private _messageService: IMessageService, @@ -44,12 +45,23 @@ export class LifecycleService implements ILifecycleService { } } + public get phase(): LifecyclePhase { + return this._phase; + } + + public set phase(value: LifecyclePhase) { + if (this._phase !== value) { + this._phase = value; + this._onDidChangePhase.fire(value); + } + } + public get startupKind(): StartupKind { return this._startupKind; } - public get willShutdown(): boolean { - return this._willShutdown; + public get onDidChangePhase(): Event { + return this._onDidChangePhase.event; } public get onWillShutdown(): Event { @@ -65,14 +77,14 @@ export class LifecycleService implements ILifecycleService { // Main side indicates that window is about to unload, check for vetos ipc.on('vscode:beforeUnload', (event, reply: { okChannel: string, cancelChannel: string, reason: ShutdownReason }) => { - this._willShutdown = true; + this.phase = LifecyclePhase.ShuttingDown; this._storageService.store(LifecycleService._lastShutdownReasonKey, JSON.stringify(reply.reason), StorageScope.WORKSPACE); // trigger onWillShutdown events and veto collecting this.onBeforeUnload(reply.reason).done(veto => { if (veto) { this._storageService.remove(LifecycleService._lastShutdownReasonKey, StorageScope.WORKSPACE); - this._willShutdown = false; // reset this flag since the shutdown has been vetoed! + this.phase = LifecyclePhase.Running; // reset this flag since the shutdown has been vetoed! ipc.send(reply.cancelChannel, windowId); } else { this._onShutdown.fire(reply.reason); diff --git a/src/vs/workbench/services/message/browser/messageList.ts b/src/vs/workbench/services/message/browser/messageList.ts index 0afb355a590cd49e8aef1a2efb0fdabb0c57b1f1..c17e752c19e95727266bbf068d8cebd172e2d240 100644 --- a/src/vs/workbench/services/message/browser/messageList.ts +++ b/src/vs/workbench/services/message/browser/messageList.ts @@ -19,10 +19,10 @@ import { Action } from 'vs/base/common/actions'; import htmlRenderer = require('vs/base/browser/htmlContentRenderer'); import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent'; import { KeyCode } from 'vs/base/common/keyCodes'; -import { NOTIFICATIONS_FOREGROUND, NOTIFICATIONS_BACKGROUND } from 'vs/workbench/common/theme'; +import { NOTIFICATIONS_FOREGROUND, NOTIFICATIONS_BACKGROUND, NOTIFICATIONS_BUTTON_BACKGROUND, NOTIFICATIONS_BUTTON_HOVER_BACKGROUND, NOTIFICATIONS_BUTTON_FOREGROUND, NOTIFICATIONS_INFO_BACKGROUND, NOTIFICATIONS_WARNING_BACKGROUND, NOTIFICATIONS_ERROR_BACKGROUND, NOTIFICATIONS_INFO_FOREGROUND, NOTIFICATIONS_WARNING_FOREGROUND, NOTIFICATIONS_ERROR_FOREGROUND } from 'vs/workbench/common/theme'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { registerThemingParticipant } from 'vs/platform/theme/common/themeService'; -import { contrastBorder, buttonBackground, buttonHoverBackground, widgetShadow, inputValidationErrorBorder, inputValidationWarningBorder, inputValidationInfoBorder } from 'vs/platform/theme/common/colorRegistry'; +import { contrastBorder, widgetShadow } from 'vs/platform/theme/common/colorRegistry'; import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { Color } from 'vs/base/common/color'; @@ -77,9 +77,13 @@ export class MessageList { private widgetShadow = Color.fromHex('#000000'); private outlineBorder: Color; private buttonBackground = Color.fromHex('#0E639C'); + private buttonForeground = this.foreground; private infoBackground = Color.fromHex('#007ACC'); + private infoForeground = this.foreground; private warningBackground = Color.fromHex('#B89500'); + private warningForeground = this.foreground; private errorBackground = Color.fromHex('#BE1100'); + private errorForeground = this.foreground; constructor( container: HTMLElement, @@ -106,12 +110,19 @@ export class MessageList { this.foreground = theme.getColor(NOTIFICATIONS_FOREGROUND); this.widgetShadow = theme.getColor(widgetShadow); this.outlineBorder = theme.getColor(contrastBorder); - this.buttonBackground = theme.getColor(buttonBackground); - this.infoBackground = theme.getColor(inputValidationInfoBorder); - this.warningBackground = theme.getColor(inputValidationWarningBorder); - this.errorBackground = theme.getColor(inputValidationErrorBorder); - - collector.addRule(`.global-message-list li.message-list-entry .actions-container .message-action .action-button:hover { background-color: ${theme.getColor(buttonHoverBackground)} !important; }`); + this.buttonBackground = theme.getColor(NOTIFICATIONS_BUTTON_BACKGROUND); + this.buttonForeground = theme.getColor(NOTIFICATIONS_BUTTON_FOREGROUND); + this.infoBackground = theme.getColor(NOTIFICATIONS_INFO_BACKGROUND); + this.infoForeground = theme.getColor(NOTIFICATIONS_INFO_FOREGROUND); + this.warningBackground = theme.getColor(NOTIFICATIONS_WARNING_BACKGROUND); + this.warningForeground = theme.getColor(NOTIFICATIONS_WARNING_FOREGROUND); + this.errorBackground = theme.getColor(NOTIFICATIONS_ERROR_BACKGROUND); + this.errorForeground = theme.getColor(NOTIFICATIONS_ERROR_FOREGROUND); + + const buttonHoverBackgroundColor = theme.getColor(NOTIFICATIONS_BUTTON_HOVER_BACKGROUND); + if (buttonHoverBackgroundColor) { + collector.addRule(`.global-message-list li.message-list-entry .actions-container .message-action .action-button:hover { background-color: ${buttonHoverBackgroundColor} !important; }`); + } this.updateStyles(); })); @@ -278,6 +289,7 @@ export class MessageList { div.a({ class: 'action-button', tabindex: '0', role: 'button' }) .style('border-color', this.outlineBorder ? this.outlineBorder.toString() : null) .style('background-color', this.buttonBackground ? this.buttonBackground.toString() : null) + .style('color', this.buttonForeground ? this.buttonForeground.toString() : null) .text(action.label) .on([DOM.EventType.CLICK, DOM.EventType.KEY_DOWN], e => { if (e instanceof KeyboardEvent) { @@ -314,16 +326,17 @@ export class MessageList { const sev = message.severity; const label = (sev === Severity.Error) ? nls.localize('error', "Error") : (sev === Severity.Warning) ? nls.localize('warning', "Warn") : nls.localize('info', "Info"); const color = (sev === Severity.Error) ? this.errorBackground : (sev === Severity.Warning) ? this.warningBackground : this.infoBackground; + const foregroundColor = (sev === Severity.Error) ? this.errorForeground : (sev === Severity.Warning) ? this.warningForeground : this.infoForeground; const sevLabel = $().span({ class: `message-left-side severity ${sev === Severity.Error ? 'app-error' : sev === Severity.Warning ? 'app-warning' : 'app-info'}`, text: label }); sevLabel.style('border-color', this.outlineBorder ? this.outlineBorder.toString() : null); sevLabel.style('background-color', color ? color.toString() : null); + sevLabel.style('color', foregroundColor ? foregroundColor.toString() : null); sevLabel.appendTo(div); // Error message - const messageContentElement = htmlRenderer.renderHtml({ - tagName: 'span', + const messageContentElement = htmlRenderer.renderFormattedText(text, { + inline: true, className: 'message-left-side', - formattedText: text }); $(messageContentElement as HTMLElement).title(messageContentElement.textContent).appendTo(div); @@ -466,4 +479,4 @@ export class MessageList { public dispose(): void { this.toDispose = dispose(this.toDispose); } -} \ No newline at end of file +} diff --git a/src/vs/workbench/services/mode/common/workbenchModeService.ts b/src/vs/workbench/services/mode/common/workbenchModeService.ts index fc65de33c9190eeab159b0300cdd35a3c1e55c86..7b59087af60ea74f5eb83345c714825083bca20b 100644 --- a/src/vs/workbench/services/mode/common/workbenchModeService.ts +++ b/src/vs/workbench/services/mode/common/workbenchModeService.ts @@ -11,11 +11,71 @@ import { TPromise } from 'vs/base/common/winjs.base'; import mime = require('vs/base/common/mime'); import { IFilesConfiguration } from 'vs/platform/files/common/files'; import { IExtensionService } from 'vs/platform/extensions/common/extensions'; -import { IExtensionPointUser, ExtensionMessageCollector } from 'vs/platform/extensions/common/extensionsRegistry'; +import { IExtensionPointUser, ExtensionMessageCollector, IExtensionPoint, ExtensionsRegistry } from 'vs/platform/extensions/common/extensionsRegistry'; import { ModesRegistry } from 'vs/editor/common/modes/modesRegistry'; import { ILanguageExtensionPoint, IValidLanguageExtensionPoint } from 'vs/editor/common/services/modeService'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { languagesExtPoint, ModeServiceImpl } from 'vs/editor/common/services/modeServiceImpl'; +import { ModeServiceImpl } from 'vs/editor/common/services/modeServiceImpl'; + +export const languagesExtPoint: IExtensionPoint = ExtensionsRegistry.registerExtensionPoint('languages', [], { + description: nls.localize('vscode.extension.contributes.languages', 'Contributes language declarations.'), + type: 'array', + items: { + type: 'object', + defaultSnippets: [{ body: { id: '${1:languageId}', aliases: ['${2:label}'], extensions: ['${3:extension}'], configuration: './language-configuration.json' } }], + properties: { + id: { + description: nls.localize('vscode.extension.contributes.languages.id', 'ID of the language.'), + type: 'string' + }, + aliases: { + description: nls.localize('vscode.extension.contributes.languages.aliases', 'Name aliases for the language.'), + type: 'array', + items: { + type: 'string' + } + }, + extensions: { + description: nls.localize('vscode.extension.contributes.languages.extensions', 'File extensions associated to the language.'), + default: ['.foo'], + type: 'array', + items: { + type: 'string' + } + }, + filenames: { + description: nls.localize('vscode.extension.contributes.languages.filenames', 'File names associated to the language.'), + type: 'array', + items: { + type: 'string' + } + }, + filenamePatterns: { + description: nls.localize('vscode.extension.contributes.languages.filenamePatterns', 'File name glob patterns associated to the language.'), + type: 'array', + items: { + type: 'string' + } + }, + mimetypes: { + description: nls.localize('vscode.extension.contributes.languages.mimetypes', 'Mime types associated to the language.'), + type: 'array', + items: { + type: 'string' + } + }, + firstLine: { + description: nls.localize('vscode.extension.contributes.languages.firstLine', 'A regular expression matching the first line of a file of the language.'), + type: 'string' + }, + configuration: { + description: nls.localize('vscode.extension.contributes.languages.configuration', 'A relative path to a file containing configuration options for the language.'), + type: 'string', + default: './language-configuration.json' + } + } + } +}); export class WorkbenchModeServiceImpl extends ModeServiceImpl { private _configurationService: IConfigurationService; @@ -63,7 +123,7 @@ export class WorkbenchModeServiceImpl extends ModeServiceImpl { }); - this._configurationService.onDidUpdateConfiguration(e => this.onConfigurationChange(e.config)); + this._configurationService.onDidUpdateConfiguration(e => this.onConfigurationChange(this._configurationService.getConfiguration())); this.onDidCreateMode((mode) => { this._extensionService.activateByEvent(`onLanguage:${mode.getId()}`).done(null, onUnexpectedError); diff --git a/src/vs/workbench/services/progress/browser/progressService2.ts b/src/vs/workbench/services/progress/browser/progressService2.ts index 583d16c913d490bfce00ac35117cfd7f5ef9c9fc..05ca282c1bfb5732f4a40e787e720ed67707ba5a 100644 --- a/src/vs/workbench/services/progress/browser/progressService2.ts +++ b/src/vs/workbench/services/progress/browser/progressService2.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ 'use strict'; -import 'vs/css!vs/workbench/services/progress/browser/media/progressService2'; +import 'vs/css!./media/progressService2'; import * as dom from 'vs/base/browser/dom'; import { localize } from 'vs/nls'; import { IActivityBarService, ProgressBadge } from 'vs/workbench/services/activity/common/activityBarService'; @@ -12,7 +12,7 @@ import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { IProgressService2, IProgressOptions, ProgressLocation, IProgress, IProgressStep, Progress, emptyProgress } from 'vs/platform/progress/common/progress'; import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; import { OcticonLabel } from 'vs/base/browser/ui/octiconLabel/octiconLabel'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { StatusbarAlignment, IStatusbarRegistry, StatusbarItemDescriptor, Extensions, IStatusbarItem } from 'vs/workbench/browser/parts/statusbar/statusbar'; import { TPromise } from 'vs/base/common/winjs.base'; import { always } from 'vs/base/common/async'; @@ -129,7 +129,7 @@ export class ProgressService2 implements IProgressService2 { } } - private _withViewletProgress(viewletId: string, task: (progress: IProgress) => TPromise): void { + private _withViewletProgress(viewletId: string, task: (progress: IProgress<{ message?: string, percentage?: number }>) => TPromise): void { const promise = task(emptyProgress); diff --git a/src/vs/workbench/services/search/node/fileSearch.ts b/src/vs/workbench/services/search/node/fileSearch.ts index 4ca120aab0d1960950b1c1c9d771409703a04a32..efcdab59c0177176faa5d4d372f8212a7f440aed 100644 --- a/src/vs/workbench/services/search/node/fileSearch.ts +++ b/src/vs/workbench/services/search/node/fileSearch.ts @@ -13,6 +13,7 @@ import paths = require('path'); import { Readable } from 'stream'; import scorer = require('vs/base/common/scorer'); +import objects = require('vs/base/common/objects'); import arrays = require('vs/base/common/arrays'); import platform = require('vs/base/common/platform'); import strings = require('vs/base/common/strings'); @@ -22,7 +23,7 @@ import { IProgress, IUncachedSearchStats } from 'vs/platform/search/common/searc import extfs = require('vs/base/node/extfs'); import flow = require('vs/base/node/flow'); -import { IRawFileMatch, ISerializedSearchComplete, IRawSearch, ISearchEngine } from './search'; +import { IRawFileMatch, ISerializedSearchComplete, IRawSearch, ISearchEngine, IFolderSearch } from './search'; enum Traversal { Node = 1, @@ -46,7 +47,6 @@ export class FileWalker { private config: IRawSearch; private filePattern: string; private normalizedFilePatternLowercase: string; - private excludePattern: glob.ParsedExpression; private includePattern: glob.ParsedExpression; private maxResults: number; private maxFilesize: number; @@ -62,12 +62,14 @@ export class FileWalker { private cmdForkResultTime: number; private cmdResultCount: number; + private folderExcludePatterns: Map; + private globalExcludePattern: glob.ParsedExpression; + private walkedPaths: { [path: string]: boolean; }; constructor(config: IRawSearch) { this.config = config; this.filePattern = config.filePattern; - this.excludePattern = glob.parse(config.excludePattern, { trimForExclusions: true }); this.includePattern = config.includePattern && glob.parse(config.includePattern); this.maxResults = config.maxResults || null; this.maxFilesize = config.maxFilesize || null; @@ -82,13 +84,30 @@ export class FileWalker { if (this.filePattern) { this.normalizedFilePatternLowercase = strings.stripWildcards(this.filePattern).toLowerCase(); } + + this.globalExcludePattern = config.excludePattern && glob.parse(config.excludePattern); + this.folderExcludePatterns = new Map(); + + config.folderQueries.forEach(folderQuery => { + const folderExcludeExpression: glob.IExpression = objects.assign({}, this.config.excludePattern || {}, folderQuery.excludePattern || {}); + + // Add excludes for other root folders + config.folderQueries + .map(rootFolderQuery => rootFolderQuery.folder) + .filter(rootFolder => rootFolder !== folderQuery.folder) + .forEach(rootFolder => { + folderExcludeExpression[paths.join(rootFolder, '**/*')] = true; + }); + + this.folderExcludePatterns.set(folderQuery.folder, glob.parse(folderExcludeExpression)); + }); } public cancel(): void { this.isCanceled = true; } - public walk(rootFolders: string[], extraFiles: string[], onResult: (result: IRawFileMatch) => void, done: (error: Error, isLimitHit: boolean) => void): void { + public walk(folderQueries: IFolderSearch[], extraFiles: string[], onResult: (result: IRawFileMatch) => void, done: (error: Error, isLimitHit: boolean) => void): void { this.fileWalkStartTime = Date.now(); // Support that the file pattern is a full path to a file that exists @@ -116,7 +135,7 @@ export class FileWalker { if (extraFiles) { extraFiles.forEach(extraFilePath => { const basename = paths.basename(extraFilePath); - if (this.excludePattern(extraFilePath, basename)) { + if (this.globalExcludePattern && this.globalExcludePattern(extraFilePath, basename)) { return; // excluded } @@ -146,20 +165,20 @@ export class FileWalker { } // For each root folder - flow.parallel(rootFolders, (rootFolder: string, rootFolderDone: (err?: Error) => void) => { - this.call(traverse, this, rootFolder, onResult, (err?: Error) => { + flow.parallel(folderQueries, (folderQuery: IFolderSearch, rootFolderDone: (err: Error, result: void) => void) => { + this.call(traverse, this, folderQuery, onResult, (err?: Error) => { if (err) { if (isNodeTraversal) { - rootFolderDone(err); + rootFolderDone(err, undefined); } else { // fallback const errorMessage = toErrorMessage(err); console.error(errorMessage); this.errors.push(errorMessage); - this.nodeJSTraversal(rootFolder, onResult, rootFolderDone); + this.nodeJSTraversal(folderQuery, onResult, err => rootFolderDone(err, undefined)); } } else { - rootFolderDone(); + rootFolderDone(undefined, undefined); } }); }, (err, result) => { @@ -176,7 +195,8 @@ export class FileWalker { } } - private findTraversal(rootFolder: string, onResult: (result: IRawFileMatch) => void, cb: (err?: Error) => void): void { + private findTraversal(folderQuery: IFolderSearch, onResult: (result: IRawFileMatch) => void, cb: (err?: Error) => void): void { + const rootFolder = folderQuery.folder; const isMac = platform.isMacintosh; let done = (err?: Error) => { done = () => { }; @@ -185,7 +205,7 @@ export class FileWalker { let leftover = ''; let first = true; const tree = this.initDirectoryTree(); - const cmd = this.spawnFindCmd(rootFolder, this.excludePattern); + const cmd = this.spawnFindCmd(folderQuery); this.collectStdout(cmd, 'utf8', (err: Error, stdout?: string, last?: boolean) => { if (err) { done(err); @@ -254,17 +274,19 @@ export class FileWalker { /** * Public for testing. */ - public spawnFindCmd(rootFolder: string, excludePattern: glob.ParsedExpression) { + public spawnFindCmd(folderQuery: IFolderSearch) { + // Does this actually work for absolute paths for other roots? + const excludePattern = this.folderExcludePatterns.get(folderQuery.folder); const basenames = glob.getBasenameTerms(excludePattern); - const paths = glob.getPathTerms(excludePattern); + const pathTerms = glob.getPathTerms(excludePattern); let args = ['-L', '.']; - if (basenames.length || paths.length) { + if (basenames.length || pathTerms.length) { args.push('-not', '(', '('); for (const basename of basenames) { args.push('-name', basename); args.push('-o'); } - for (const path of paths) { + for (const path of pathTerms) { args.push('-path', path); args.push('-o'); } @@ -272,7 +294,7 @@ export class FileWalker { args.push(')', '-prune', ')'); } args.push('-type', 'f'); - return childProcess.spawn('find', args, { cwd: rootFolder }); + return childProcess.spawn('find', args, { cwd: folderQuery.folder }); } /** @@ -376,7 +398,7 @@ export class FileWalker { private matchDirectoryTree({ rootEntries, pathToEntries }: IDirectoryTree, rootFolder: string, onResult: (result: IRawFileMatch) => void) { const self = this; - const excludePattern = this.excludePattern; + const excludePattern = this.folderExcludePatterns.get(rootFolder); const filePattern = this.filePattern; function matchDirectory(entries: IDirectoryEntry[]) { self.directoriesWalked++; @@ -408,15 +430,15 @@ export class FileWalker { matchDirectory(rootEntries); } - private nodeJSTraversal(rootFolder: string, onResult: (result: IRawFileMatch) => void, done: (err?: Error) => void): void { + private nodeJSTraversal(folderQuery: IFolderSearch, onResult: (result: IRawFileMatch) => void, done: (err?: Error) => void): void { this.directoriesWalked++; - extfs.readdir(rootFolder, (error: Error, files: string[]) => { + extfs.readdir(folderQuery.folder, (error: Error, files: string[]) => { if (error || this.isCanceled || this.isLimitHit) { return done(); } // Support relative paths to files from a root resource (ignores excludes) - return this.checkFilePatternRelativeMatch(rootFolder, (match, size) => { + return this.checkFilePatternRelativeMatch(folderQuery.folder, (match, size) => { if (this.isCanceled || this.isLimitHit) { return done(); } @@ -425,14 +447,14 @@ export class FileWalker { if (match) { this.resultCount++; onResult({ - base: rootFolder, + base: folderQuery.folder, relativePath: this.filePattern, basename: paths.basename(this.filePattern), size }); } - return this.doWalk(rootFolder, '', files, onResult, done); + return this.doWalk(folderQuery, '', files, onResult, done); }); }); } @@ -475,14 +497,15 @@ export class FileWalker { }); } - private doWalk(rootFolder: string, relativeParentPath: string, files: string[], onResult: (result: IRawFileMatch) => void, done: (error: Error) => void): void { + private doWalk(folderQuery: IFolderSearch, relativeParentPath: string, files: string[], onResult: (result: IRawFileMatch) => void, done: (error: Error) => void): void { + const rootFolder = folderQuery.folder; // Execute tasks on each file in parallel to optimize throughput - flow.parallel(files, (file: string, clb: (error: Error) => void): void => { + flow.parallel(files, (file: string, clb: (error: Error, result: {}) => void): void => { // Check canceled if (this.isCanceled || this.isLimitHit) { - return clb(null); + return clb(null, undefined); } // If the user searches for the exact file name, we adjust the glob matching @@ -495,15 +518,15 @@ export class FileWalker { // Check exclude pattern let currentRelativePath = relativeParentPath ? [relativeParentPath, file].join(paths.sep) : file; - if (this.excludePattern(currentRelativePath, file, () => siblings)) { - return clb(null); + if (this.folderExcludePatterns.get(folderQuery.folder)(currentRelativePath, file, () => siblings)) { + return clb(null, undefined); } // Use lstat to detect links let currentAbsolutePath = [rootFolder, currentRelativePath].join(paths.sep); fs.lstat(currentAbsolutePath, (error, lstat) => { if (error || this.isCanceled || this.isLimitHit) { - return clb(null); + return clb(null, undefined); } // If the path is a link, we must instead use fs.stat() to find out if the @@ -511,7 +534,7 @@ export class FileWalker { // the link which is always a file. this.statLinkIfNeeded(currentAbsolutePath, lstat, (error, stat) => { if (error || this.isCanceled || this.isLimitHit) { - return clb(null); + return clb(null, undefined); } // Directory: Follow directories @@ -521,11 +544,11 @@ export class FileWalker { // to really prevent loops with links we need to resolve the real path of them return this.realPathIfNeeded(currentAbsolutePath, lstat, (error, realpath) => { if (error || this.isCanceled || this.isLimitHit) { - return clb(null); + return clb(null, undefined); } if (this.walkedPaths[realpath]) { - return clb(null); // escape when there are cycles (can happen with symlinks) + return clb(null, undefined); // escape when there are cycles (can happen with symlinks) } this.walkedPaths[realpath] = true; // remember as walked @@ -533,10 +556,10 @@ export class FileWalker { // Continue walking return extfs.readdir(currentAbsolutePath, (error: Error, children: string[]): void => { if (error || this.isCanceled || this.isLimitHit) { - return clb(null); + return clb(null, undefined); } - this.doWalk(rootFolder, currentRelativePath, children, onResult, clb); + this.doWalk(folderQuery, currentRelativePath, children, onResult, err => clb(err, undefined)); }); }); } @@ -545,18 +568,18 @@ export class FileWalker { else { this.filesWalked++; if (currentRelativePath === this.filePattern) { - return clb(null); // ignore file if its path matches with the file pattern because checkFilePatternRelativeMatch() takes care of those + return clb(null, undefined); // ignore file if its path matches with the file pattern because checkFilePatternRelativeMatch() takes care of those } if (this.maxFilesize && types.isNumber(stat.size) && stat.size > this.maxFilesize) { - return clb(null); // ignore file if max file size is hit + return clb(null, undefined); // ignore file if max file size is hit } this.matchFile(onResult, { base: rootFolder, relativePath: currentRelativePath, basename: file, size: stat.size }); } // Unwind - return clb(null); + return clb(null, undefined); }); }); }, (error: Error[]): void => { @@ -621,19 +644,19 @@ export class FileWalker { } export class Engine implements ISearchEngine { - private rootFolders: string[]; + private folderQueries: IFolderSearch[]; private extraFiles: string[]; private walker: FileWalker; constructor(config: IRawSearch) { - this.rootFolders = config.rootFolders; + this.folderQueries = config.folderQueries; this.extraFiles = config.extraFiles; this.walker = new FileWalker(config); } public search(onResult: (result: IRawFileMatch) => void, onProgress: (progress: IProgress) => void, done: (error: Error, complete: ISerializedSearchComplete) => void): void { - this.walker.walk(this.rootFolders, this.extraFiles, onResult, (err: Error, isLimitHit: boolean) => { + this.walker.walk(this.folderQueries, this.extraFiles, onResult, (err: Error, isLimitHit: boolean) => { done(err, { limitHit: isLimitHit, stats: this.walker.getStats() diff --git a/src/vs/workbench/services/search/node/rawSearchService.ts b/src/vs/workbench/services/search/node/rawSearchService.ts index 1ae38214c9ad27a11715c3a012fba44b107ee16d..c0f397260085f3e973c2ac7f052dd8a7a25c0c91 100644 --- a/src/vs/workbench/services/search/node/rawSearchService.ts +++ b/src/vs/workbench/services/search/node/rawSearchService.ts @@ -22,11 +22,9 @@ import { MAX_FILE_SIZE } from 'vs/platform/files/common/files'; import { RipgrepEngine } from 'vs/workbench/services/search/node/ripgrepTextSearch'; import { Engine as TextSearchEngine } from 'vs/workbench/services/search/node/textSearch'; import { TextSearchWorkerProvider } from 'vs/workbench/services/search/node/textSearchWorkerProvider'; -import { IRawSearchService, IRawSearch, IRawFileMatch, ISerializedFileMatch, ISerializedSearchProgressItem, ISerializedSearchComplete, ISearchEngine } from './search'; +import { IRawSearchService, IRawSearch, IRawFileMatch, ISerializedFileMatch, ISerializedSearchProgressItem, ISerializedSearchComplete, ISearchEngine, IFileSearchProgressItem } from './search'; import { ICachedSearchStats, IProgress } from 'vs/platform/search/common/search'; -export type IRawProgressItem = T | T[] | IProgress; - export class SearchService implements IRawSearchService { private static BATCH_SIZE = 512; @@ -49,7 +47,7 @@ export class SearchService implements IRawSearchService { config.maxFilesize = MAX_FILE_SIZE; let engine = new RipgrepEngine(config); - return new PPromise>((c, e, p) => { + return new PPromise((c, e, p) => { // Use BatchedCollector to get new results to the frontend every 2s at least, until 50 results have been returned const collector = new BatchedCollector(SearchService.BATCH_SIZE, p); engine.search((match) => { @@ -78,7 +76,7 @@ export class SearchService implements IRawSearchService { let engine = new TextSearchEngine( config, new FileWalker({ - rootFolders: config.rootFolders, + folderQueries: config.folderQueries, extraFiles: config.extraFiles, includePattern: config.includePattern, excludePattern: config.excludePattern, @@ -113,7 +111,7 @@ export class SearchService implements IRawSearchService { }); } - let searchPromise: PPromise>; + let searchPromise: PPromise; return new PPromise((c, e, p) => { const engine = new EngineClass(config); searchPromise = this.doSearch(engine, batchSize) @@ -123,7 +121,7 @@ export class SearchService implements IRawSearchService { } else if ((progress).relativePath) { p(this.rawMatchToSearchItem(progress)); } else { - p(progress); + p(progress); } }); }, () => { @@ -136,8 +134,8 @@ export class SearchService implements IRawSearchService { } private doSortedSearch(engine: ISearchEngine, config: IRawSearch): PPromise<[ISerializedSearchComplete, IRawFileMatch[]], IProgress> { - let searchPromise: PPromise>; - let allResultsPromise = new PPromise<[ISerializedSearchComplete, IRawFileMatch[]], IProgress>((c, e, p) => { + let searchPromise: PPromise; + let allResultsPromise = new PPromise<[ISerializedSearchComplete, IRawFileMatch[]], IFileSearchProgressItem>((c, e, p) => { let results: IRawFileMatch[] = []; searchPromise = this.doSearch(engine, -1) .then(result => { @@ -260,7 +258,7 @@ export class SearchService implements IRawSearchService { // Find cache entries by prefix of search value const hasPathSep = searchValue.indexOf(sep) >= 0; - let cached: PPromise<[ISerializedSearchComplete, IRawFileMatch[]], IProgress>; + let cached: PPromise<[ISerializedSearchComplete, IRawFileMatch[]], IFileSearchProgressItem>; let wasResolved: boolean; for (let previousSearch in cache.resultsToSearchCache) { @@ -311,8 +309,8 @@ export class SearchService implements IRawSearchService { }); } - private doTextSearch(engine: TextSearchEngine, batchSize: number): PPromise> { - return new PPromise>((c, e, p) => { + private doTextSearch(engine: TextSearchEngine, batchSize: number): PPromise { + return new PPromise((c, e, p) => { // Use BatchedCollector to get new results to the frontend every 2s at least, until 50 results have been returned const collector = new BatchedCollector(batchSize, p); engine.search((matches) => { @@ -334,9 +332,9 @@ export class SearchService implements IRawSearchService { }); } - private doSearch(engine: ISearchEngine, batchSize?: number): PPromise> { - return new PPromise>((c, e, p) => { - let batch: T[] = []; + private doSearch(engine: ISearchEngine, batchSize?: number): PPromise { + return new PPromise((c, e, p) => { + let batch: IRawFileMatch[] = []; engine.search((match) => { if (match) { if (batchSize) { @@ -385,7 +383,7 @@ export class SearchService implements IRawSearchService { class Cache { - public resultsToSearchCache: { [searchValue: string]: PPromise<[ISerializedSearchComplete, IRawFileMatch[]], IProgress>; } = Object.create(null); + public resultsToSearchCache: { [searchValue: string]: PPromise<[ISerializedSearchComplete, IRawFileMatch[]], IFileSearchProgressItem>; } = Object.create(null); public scorerCache: ScorerCache = Object.create(null); } diff --git a/src/vs/workbench/services/search/node/ripgrepTextSearch.ts b/src/vs/workbench/services/search/node/ripgrepTextSearch.ts index 829406f52fef60ba919f79af455c9edfa7fd70ef..63ead1b1f9be8b7d12d4aab449307f89dfc3b463 100644 --- a/src/vs/workbench/services/search/node/ripgrepTextSearch.ts +++ b/src/vs/workbench/services/search/node/ripgrepTextSearch.ts @@ -6,10 +6,12 @@ import { EventEmitter } from 'events'; import * as path from 'path'; +import { StringDecoder, NodeStringDecoder } from 'string_decoder'; import * as cp from 'child_process'; import { rgPath } from 'vscode-ripgrep'; +import objects = require('vs/base/common/objects'); import * as strings from 'vs/base/common/strings'; import * as extfs from 'vs/base/node/extfs'; import * as encoding from 'vs/base/node/encoding'; @@ -17,7 +19,7 @@ import * as glob from 'vs/base/common/glob'; import { ILineMatch, ISearchLog } from 'vs/platform/search/common/search'; import { TPromise } from 'vs/base/common/winjs.base'; -import { ISerializedFileMatch, ISerializedSearchComplete, IRawSearch } from './search'; +import { ISerializedFileMatch, ISerializedSearchComplete, IRawSearch, IFolderSearch } from './search'; export class RipgrepEngine { private isDone = false; @@ -39,40 +41,37 @@ export class RipgrepEngine { // TODO@Rob - make promise-based once the old search is gone, and I don't need them to have matching interfaces anymore search(onResult: (match: ISerializedFileMatch) => void, onMessage: (message: ISearchLog) => void, done: (error: Error, complete: ISerializedSearchComplete) => void): void { - if (this.config.rootFolders.length) { - this.searchFolder(this.config.rootFolders[0], onResult, onMessage, done); - } else { + if (!this.config.folderQueries.length) { done(null, { limitHit: false, stats: null }); + return; } - } - private searchFolder(rootFolder: string, onResult: (match: ISerializedFileMatch) => void, onMessage: (message: ISearchLog) => void, done: (error: Error, complete: ISerializedSearchComplete) => void): void { const rgArgs = getRgArgs(this.config); if (rgArgs.siblingClauses) { this.postProcessExclusions = glob.parseToAsync(rgArgs.siblingClauses, { trimForExclusions: true }); } process.nextTick(() => { - const escapedArgs = rgArgs.args + const escapedArgs = rgArgs.globArgs .map(arg => arg.match(/^-/) ? arg : `'${arg}'`) .join(' '); // Allow caller to register progress callback - const rgCmd = `rg ${escapedArgs}\n - cwd: ${rootFolder}\n`; + const rgCmd = `rg ${escapedArgs}\n - cwd: /\n`; onMessage({ message: rgCmd }); if (rgArgs.siblingClauses) { onMessage({ message: ` - Sibling clauses: ${JSON.stringify(rgArgs.siblingClauses)}\n` }); } }); - this.rgProc = cp.spawn(rgPath, rgArgs.args, { cwd: rootFolder }); + this.rgProc = cp.spawn(rgPath, rgArgs.globArgs, { cwd: '/' }); - this.ripgrepParser = new RipgrepParser(this.config.maxResults, rootFolder); + this.ripgrepParser = new RipgrepParser(this.config.maxResults, '/'); this.ripgrepParser.on('result', (match: ISerializedFileMatch) => { if (this.postProcessExclusions) { - const relativePath = path.relative(rootFolder, match.path); + const relativePath = path.relative('/', match.path); const handleResultP = (>this.postProcessExclusions(relativePath, undefined, () => getSiblings(match.path))) .then(globMatch => { if (!globMatch) { @@ -174,11 +173,13 @@ export class RipgrepParser extends EventEmitter { private fileMatch: FileMatch; private remainder: string; private isDone: boolean; + private stringDecoder: NodeStringDecoder; private numResults = 0; constructor(private maxResults: number, private rootFolder: string) { super(); + this.stringDecoder = new StringDecoder(); } public cancel(): void { @@ -186,16 +187,23 @@ export class RipgrepParser extends EventEmitter { } public flush(): void { + this.handleDecodedData(this.stringDecoder.end()); + if (this.fileMatch) { this.onResult(); } } - public handleData(data: string | Buffer): void { + public handleData(data: Buffer | string): void { + const dataStr = typeof data === 'string' ? data : this.stringDecoder.write(data); + this.handleDecodedData(dataStr); + } + + private handleDecodedData(decodedData: string): void { // If the previous data chunk didn't end in a newline, prepend it to this chunk const dataStr = this.remainder ? - this.remainder + data.toString() : - data.toString(); + this.remainder + decodedData : + decodedData; const dataLines: string[] = dataStr.split(/\r\n|\n/); this.remainder = dataLines[dataLines.length - 1] ? dataLines.pop() : null; @@ -225,7 +233,7 @@ export class RipgrepParser extends EventEmitter { this.onResult(); } - this.fileMatch = new FileMatch(path.resolve(this.rootFolder, r[1])); + this.fileMatch = new FileMatch(path.isAbsolute(r[1]) ? r[1] : path.join(this.rootFolder, r[1])); } else { // Line is empty (or malformed) } @@ -367,18 +375,45 @@ export class LineMatch implements ILineMatch { } } -function globExprsToRgGlobs(patterns: glob.IExpression): { globArgs: string[], siblingClauses: glob.IExpression } { +interface IRgGlobResult { + globArgs: string[]; + siblingClauses: glob.IExpression; +} + +function foldersToRgExcludeGlobs(folderQueries: IFolderSearch[], globalExclude: glob.IExpression): IRgGlobResult { + const globArgs: string[] = []; + let siblingClauses: glob.IExpression = {}; + folderQueries.forEach(folderQuery => { + const totalExcludePattern = objects.assign({}, globalExclude || {}, folderQuery.excludePattern || {}); + const result = globExprsToRgGlobs(totalExcludePattern, folderQuery.folder); + globArgs.push(...result.globArgs); + if (result.siblingClauses) { + siblingClauses = objects.assign(siblingClauses, result.siblingClauses); + } + }); + + return { globArgs, siblingClauses }; +} + +function foldersToIncludeGlobs(folderQueries: IFolderSearch[], globalInclude: glob.IExpression): string[] { + const globArgs: string[] = []; + folderQueries.forEach(folderQuery => { + const result = globExprsToRgGlobs(globalInclude, folderQuery.folder); + globArgs.push(...result.globArgs); + }); + + return globArgs; +} + +function globExprsToRgGlobs(patterns: glob.IExpression, folder: string): IRgGlobResult { const globArgs: string[] = []; let siblingClauses: glob.IExpression = null; Object.keys(patterns) .forEach(key => { const value = patterns[key]; - if (typeof value === 'boolean' && value) { - // globs added to ripgrep don't match from the root by default, so add a / - if (key.charAt(0) !== '*') { - key = '/' + key; - } + key = path.join(folder, key); + if (typeof value === 'boolean' && value) { globArgs.push(key); } else if (value && value.when) { if (!siblingClauses) { @@ -392,24 +427,22 @@ function globExprsToRgGlobs(patterns: glob.IExpression): { globArgs: string[], s return { globArgs, siblingClauses }; } -function getRgArgs(config: IRawSearch): { args: string[], siblingClauses: glob.IExpression } { +function getRgArgs(config: IRawSearch): IRgGlobResult { const args = ['--hidden', '--heading', '--line-number', '--color', 'ansi', '--colors', 'path:none', '--colors', 'line:none', '--colors', 'match:fg:red', '--colors', 'match:style:nobold']; args.push(config.contentPattern.isCaseSensitive ? '--case-sensitive' : '--ignore-case'); if (config.includePattern) { // I don't think includePattern can have siblingClauses - globExprsToRgGlobs(config.includePattern).globArgs.forEach(globArg => { + foldersToIncludeGlobs(config.folderQueries, config.includePattern).forEach(globArg => { args.push('-g', globArg); }); } let siblingClauses: glob.IExpression; - if (config.excludePattern) { - const rgGlobs = globExprsToRgGlobs(config.excludePattern); - rgGlobs.globArgs - .forEach(rgGlob => args.push('-g', `!${rgGlob}`)); - siblingClauses = rgGlobs.siblingClauses; - } + const rgGlobs = foldersToRgExcludeGlobs(config.folderQueries, config.excludePattern); + rgGlobs.globArgs + .forEach(rgGlob => args.push('-g', `!${rgGlob}`)); + siblingClauses = rgGlobs.siblingClauses; if (config.maxFilesize) { args.push('--max-filesize', config.maxFilesize + ''); @@ -423,9 +456,9 @@ function getRgArgs(config: IRawSearch): { args: string[], siblingClauses: glob.I // Follow symlinks args.push('--follow'); - // Set default encoding - if (config.fileEncoding && config.fileEncoding !== 'utf8') { - args.push('--encoding', encoding.toCanonicalName(config.fileEncoding)); + // Set default encoding if only one folder is opened + if (config.folderQueries.length === 1 && config.folderQueries[0].fileEncoding && config.folderQueries[0].fileEncoding !== 'utf8') { + args.push('--encoding', encoding.toCanonicalName(config.folderQueries[0].fileEncoding)); } // Ripgrep handles -- as a -- arg separator. Only --. @@ -458,12 +491,12 @@ function getRgArgs(config: IRawSearch): { args: string[], siblingClauses: glob.I if (config.searchPaths && config.searchPaths.length) { args.push(...config.searchPaths); } else { - args.push('./'); + args.push(...config.folderQueries.map(q => q.folder)); } args.push(...config.extraFiles); - return { args, siblingClauses }; + return { globArgs: args, siblingClauses }; } function getSiblings(file: string): TPromise { diff --git a/src/vs/workbench/services/search/node/search.ts b/src/vs/workbench/services/search/node/search.ts index 2ac46545e5b54a4c63b79029045a458ee1463155..4e949b425bcb336c16f4f03d6b9f5ef425374d12 100644 --- a/src/vs/workbench/services/search/node/search.ts +++ b/src/vs/workbench/services/search/node/search.ts @@ -7,10 +7,16 @@ import { PPromise, TPromise } from 'vs/base/common/winjs.base'; import { IExpression } from 'vs/base/common/glob'; -import { IProgress, ILineMatch, IPatternInfo, ISearchStats } from 'vs/platform/search/common/search'; +import { IProgress, ILineMatch, IPatternInfo, ISearchStats, ISearchLog } from 'vs/platform/search/common/search'; + +export interface IFolderSearch { + folder: string; + excludePattern?: IExpression; + fileEncoding?: string; +} export interface IRawSearch { - rootFolders: string[]; + folderQueries: IFolderSearch[]; extraFiles?: string[]; filePattern?: string; excludePattern?: IExpression; @@ -20,7 +26,6 @@ export interface IRawSearch { sortByScore?: boolean; cacheKey?: string; maxFilesize?: number; - fileEncoding?: string; useRipgrep?: boolean; disregardIgnoreFiles?: boolean; searchPaths?: string[]; @@ -56,4 +61,5 @@ export interface ISerializedFileMatch { } // Type of the possible values for progress calls from the engine -export type ISerializedSearchProgressItem = ISerializedFileMatch | ISerializedFileMatch[] | IProgress; +export type ISerializedSearchProgressItem = ISerializedFileMatch | ISerializedFileMatch[] | IProgress | ISearchLog; +export type IFileSearchProgressItem = IRawFileMatch | IRawFileMatch[] | IProgress; \ No newline at end of file diff --git a/src/vs/workbench/services/search/node/searchService.ts b/src/vs/workbench/services/search/node/searchService.ts index b1317d6b7cca6939dcc67d15eaaaab3621059518..766be55ed14284b7745959f6954836cb9e1a7ce5 100644 --- a/src/vs/workbench/services/search/node/searchService.ts +++ b/src/vs/workbench/services/search/node/searchService.ts @@ -120,7 +120,7 @@ export class SearchService implements ISearchService { // Support untitled files if (resource.scheme === 'untitled') { - if (!this.untitledEditorService.get(resource)) { + if (!this.untitledEditorService.exists(resource)) { return; } } @@ -144,7 +144,7 @@ export class SearchService implements ISearchService { fileMatch.lineMatches.push(new LineMatch(model.getLineContent(match.range.startLineNumber), match.range.startLineNumber - 1, [[match.range.startColumn - 1, match.range.endColumn - match.range.startColumn]])); }); } else { - localResults.set(resource, false); + localResults.set(resource, null); } }); } @@ -200,13 +200,18 @@ export class DiskSearch { private raw: IRawSearchService; - constructor(verboseLogging: boolean) { + constructor(verboseLogging: boolean, timeout: number = 60 * 60 * 1000) { const client = new Client( uri.parse(require.toUrl('bootstrap')).fsPath, { serverName: 'Search', - timeout: 60 * 60 * 1000, + timeout: timeout, args: ['--type=searchService'], + // See https://github.com/Microsoft/vscode/issues/27665 + // Pass in fresh execArgv to the forked process such that it doesn't inherit them from `process.execArgv`. + // e.g. Launching the extension host process with `--debug-brk=xxx` and then forking a process from the extension host + // results in the forked process inheriting `--debug-brk=xxx`. + freshExecArgv: true, env: { AMD_ENTRYPOINT: 'vs/workbench/services/search/node/searchApp', PIPE_LOGGING: 'true', @@ -223,7 +228,13 @@ export class DiskSearch { let request: PPromise; let rawSearch: IRawSearch = { - rootFolders: query.folderResources ? query.folderResources.map(r => r.fsPath) : [], + folderQueries: query.folderQueries ? query.folderQueries.map(q => { + return { + excludePattern: q.excludePattern, + fileEncoding: q.fileEncoding, + folder: q.folder.fsPath + }; + }) : [], extraFiles: query.extraFileResources ? query.extraFileResources.map(r => r.fsPath) : [], filePattern: query.filePattern, excludePattern: query.excludePattern, @@ -238,7 +249,6 @@ export class DiskSearch { if (query.type === QueryType.Text) { rawSearch.contentPattern = query.contentPattern; - rawSearch.fileEncoding = query.fileEncoding; } if (query.type === QueryType.File) { diff --git a/src/vs/workbench/services/search/node/textSearch.ts b/src/vs/workbench/services/search/node/textSearch.ts index cb30c2224661b5327438340b5af49f2b7be98aab..341b100b5aa78dee37d860e55f53128269fd3a40 100644 --- a/src/vs/workbench/services/search/node/textSearch.ts +++ b/src/vs/workbench/services/search/node/textSearch.ts @@ -64,6 +64,10 @@ export class Engine implements ISearchEngine { this.workers = this.workerProvider.getWorkers(); this.initializeWorkers(); + const fileEncoding = this.config.folderQueries.length === 1 ? + this.config.folderQueries[0].fileEncoding || 'utf8' : + 'utf8'; + const progress = () => { if (++this.progressed % Engine.PROGRESS_FLUSH_CHUNK_SIZE === 0) { onProgress({ total: this.totalBytes, worked: this.processedBytes }); // buffer progress in chunks to reduce pressure @@ -93,7 +97,7 @@ export class Engine implements ISearchEngine { this.nextWorker = (this.nextWorker + 1) % this.workers.length; const maxResults = this.config.maxResults && (this.config.maxResults - this.numResults); - const searchArgs = { absolutePaths: batch, maxResults, pattern: this.config.contentPattern, fileEncoding: this.config.fileEncoding }; + const searchArgs = { absolutePaths: batch, maxResults, pattern: this.config.contentPattern, fileEncoding }; worker.search(searchArgs).then(result => { if (!result || this.limitReached || this.isCanceled) { return unwind(batchBytes); @@ -122,7 +126,7 @@ export class Engine implements ISearchEngine { let nextBatch: string[] = []; let nextBatchBytes = 0; const batchFlushBytes = 2 ** 20; // 1MB - this.walker.walk(this.config.rootFolders, this.config.extraFiles, result => { + this.walker.walk(this.config.folderQueries, this.config.extraFiles, result => { let bytes = result.size || 1; this.totalBytes += bytes; diff --git a/src/vs/workbench/services/search/test/node/ripgrepTextSearch.test.ts b/src/vs/workbench/services/search/test/node/ripgrepTextSearch.test.ts index 2f377d82d27be6212e1d6c3692aa83fb76a0d562..87a27629eafbd5ddd48fc74b3d2b1bde9e465f9e 100644 --- a/src/vs/workbench/services/search/test/node/ripgrepTextSearch.test.ts +++ b/src/vs/workbench/services/search/test/node/ripgrepTextSearch.test.ts @@ -33,7 +33,11 @@ suite('RipgrepParser', () => { return matchLine; } - function parseInput(inputChunks: string[]): ISerializedFileMatch[] { + function parseInputStrings(inputChunks: string[]): ISerializedFileMatch[] { + return parseInput(inputChunks.map(chunk => new Buffer(chunk))); + } + + function parseInput(inputChunks: Buffer[]): ISerializedFileMatch[] { const matches: ISerializedFileMatch[] = []; const rgp = new RipgrepParser(1e6, rootFolder); rgp.on('result', (match: ISerializedFileMatch) => { @@ -65,7 +69,7 @@ suite('RipgrepParser', () => { [getFileLine('a.txt'), getMatchLine(1, ['before', 'match', 'after']), getMatchLine(2, ['before', 'match', 'after']), fileSectionEnd].join('\n') ]; - const results = parseInput(input); + const results = parseInputStrings(input); assert.equal(results.length, 1); assert.deepEqual(results[0], { @@ -93,7 +97,7 @@ suite('RipgrepParser', () => { [getFileLine('c.txt'), getMatchLine(1, ['before', 'match', 'after']), getMatchLine(2, ['before', 'match', 'after']), fileSectionEnd].join('\n') ]; - const results = parseInput(input); + const results = parseInputStrings(input); assert.equal(results.length, 3); results.forEach(fileResult => assert.equal(fileResult.numMatches, 2)); }); @@ -116,7 +120,7 @@ suite('RipgrepParser', () => { test('Parses multiple chunks broken at each line', () => { const input = singleLineChunks.map(chunk => chunk + '\n'); - const results = parseInput(input); + const results = parseInputStrings(input); assert.equal(results.length, 3); results.forEach(fileResult => assert.equal(fileResult.numMatches, 2)); }); @@ -126,7 +130,7 @@ suite('RipgrepParser', () => { .map(chunk => chunk + '\n') .map(halve)); - const results = parseInput(input); + const results = parseInputStrings(input); assert.equal(results.length, 3); results.forEach(fileResult => assert.equal(fileResult.numMatches, 2)); }); @@ -136,7 +140,7 @@ suite('RipgrepParser', () => { .map(chunk => chunk + '\n') .map(arrayOfChars)); - const results = parseInput(input); + const results = parseInputStrings(input); assert.equal(results.length, 3); results.forEach(fileResult => assert.equal(fileResult.numMatches, 2)); }); @@ -145,8 +149,26 @@ suite('RipgrepParser', () => { const input = singleLineChunks .map(chunk => '\n' + chunk); - const results = parseInput(input); + const results = parseInputStrings(input); assert.equal(results.length, 3); results.forEach(fileResult => assert.equal(fileResult.numMatches, 2)); }); + + test('Parses chunks broken in the middle of a multibyte character', () => { + const multibyteStr = '漢'; + const multibyteBuf = new Buffer(multibyteStr); + const text = getFileLine('foo/bar') + '\n' + getMatchLine(0, ['before', 'match', 'after']) + '\n'; + + // Split the multibyte char into two pieces and divide between the two buffers + const beforeIndex = 24; + const inputBufs = [ + Buffer.concat([new Buffer(text.substr(0, beforeIndex)), multibyteBuf.slice(0, 2)]), + Buffer.concat([multibyteBuf.slice(2), new Buffer(text.substr(beforeIndex))]) + ]; + + const results = parseInput(inputBufs); + assert.equal(results.length, 1); + assert.equal(results[0].lineMatches.length, 1); + assert.deepEqual(results[0].lineMatches[0].offsetAndLengths, [[7, 5]]); + }); }); \ No newline at end of file diff --git a/src/vs/workbench/services/search/test/node/search.test.ts b/src/vs/workbench/services/search/test/node/search.test.ts index ae7f8a9c60f4d82bd04ef3c94cf5035e0f0da505..308f482f8b63faa2386af4552958437190b27305 100644 --- a/src/vs/workbench/services/search/test/node/search.test.ts +++ b/src/vs/workbench/services/search/test/node/search.test.ts @@ -8,22 +8,25 @@ import path = require('path'); import assert = require('assert'); -import * as glob from 'vs/base/common/glob'; import { join, normalize } from 'vs/base/common/paths'; import * as platform from 'vs/base/common/platform'; import { FileWalker, Engine as FileSearchEngine } from 'vs/workbench/services/search/node/fileSearch'; -import { IRawFileMatch } from 'vs/workbench/services/search/node/search'; - -function rootfolders() { - return [path.normalize(require.toUrl('./fixtures'))]; +import { IRawFileMatch, IFolderSearch } from 'vs/workbench/services/search/node/search'; + +const TEST_FIXTURES = path.normalize(require.toUrl('./fixtures')); +const TEST_ROOT_FOLDER: IFolderSearch = { folder: TEST_FIXTURES }; +function rootFolderQueries(): IFolderSearch[] { + return [ + TEST_ROOT_FOLDER + ]; } suite('Search', () => { test('Files: *.js', function (done: () => void) { let engine = new FileSearchEngine({ - rootFolders: rootfolders(), + folderQueries: rootFolderQueries(), filePattern: '*.js' }); @@ -41,7 +44,7 @@ suite('Search', () => { test('Files: examples/com*', function (done: () => void) { let engine = new FileSearchEngine({ - rootFolders: rootfolders(), + folderQueries: rootFolderQueries(), filePattern: normalize(join('examples', 'com*'), true) }); @@ -59,7 +62,7 @@ suite('Search', () => { test('Files: examples (fuzzy)', function (done: () => void) { let engine = new FileSearchEngine({ - rootFolders: rootfolders(), + folderQueries: rootFolderQueries(), filePattern: 'xl' }); @@ -77,7 +80,7 @@ suite('Search', () => { test('Files: NPE (CamelCase)', function (done: () => void) { let engine = new FileSearchEngine({ - rootFolders: rootfolders(), + folderQueries: rootFolderQueries(), filePattern: 'NullPE' }); @@ -95,7 +98,7 @@ suite('Search', () => { test('Files: *.*', function (done: () => void) { let engine = new FileSearchEngine({ - rootFolders: rootfolders(), + folderQueries: rootFolderQueries(), filePattern: '*.*' }); @@ -113,7 +116,7 @@ suite('Search', () => { test('Files: *.as', function (done: () => void) { let engine = new FileSearchEngine({ - rootFolders: rootfolders(), + folderQueries: rootFolderQueries(), filePattern: '*.as' }); @@ -131,7 +134,7 @@ suite('Search', () => { test('Files: *.* without derived', function (done: () => void) { let engine = new FileSearchEngine({ - rootFolders: rootfolders(), + folderQueries: rootFolderQueries(), filePattern: 'site.*', excludePattern: { '**/*.css': { 'when': '$(basename).less' } } }); @@ -153,7 +156,7 @@ suite('Search', () => { test('Files: *.* exclude folder without wildcard', function (done: () => void) { let engine = new FileSearchEngine({ - rootFolders: rootfolders(), + folderQueries: rootFolderQueries(), filePattern: '*.*', excludePattern: { 'examples': true } }); @@ -172,7 +175,7 @@ suite('Search', () => { test('Files: *.* exclude folder with leading wildcard', function (done: () => void) { let engine = new FileSearchEngine({ - rootFolders: rootfolders(), + folderQueries: rootFolderQueries(), filePattern: '*.*', excludePattern: { '**/examples': true } }); @@ -191,7 +194,7 @@ suite('Search', () => { test('Files: *.* exclude folder with trailing wildcard', function (done: () => void) { let engine = new FileSearchEngine({ - rootFolders: rootfolders(), + folderQueries: rootFolderQueries(), filePattern: '*.*', excludePattern: { 'examples/**': true } }); @@ -210,7 +213,7 @@ suite('Search', () => { test('Files: *.* exclude with unicode', function (done: () => void) { let engine = new FileSearchEngine({ - rootFolders: rootfolders(), + folderQueries: rootFolderQueries(), filePattern: '*.*', excludePattern: { '**/üm laut汉语': true } }); @@ -229,7 +232,7 @@ suite('Search', () => { test('Files: Unicode and Spaces', function (done: () => void) { let engine = new FileSearchEngine({ - rootFolders: rootfolders(), + folderQueries: rootFolderQueries(), filePattern: '汉语' }); @@ -250,7 +253,7 @@ suite('Search', () => { test('Files: no results', function (done: () => void) { let engine = new FileSearchEngine({ - rootFolders: rootfolders(), + folderQueries: rootFolderQueries(), filePattern: 'nofilematch' }); @@ -268,7 +271,7 @@ suite('Search', () => { test('Files: absolute path to file ignores excludes', function (done: () => void) { let engine = new FileSearchEngine({ - rootFolders: rootfolders(), + folderQueries: rootFolderQueries(), filePattern: path.normalize(path.join(require.toUrl('./fixtures'), 'site.css')), excludePattern: { '**/*.css': true } }); @@ -290,7 +293,7 @@ suite('Search', () => { test('Files: relative path matched once', function (done: () => void) { let engine = new FileSearchEngine({ - rootFolders: rootfolders(), + folderQueries: rootFolderQueries(), filePattern: path.normalize(path.join('examples', 'company.js')) }); @@ -311,7 +314,7 @@ suite('Search', () => { test('Files: relative path to file ignores excludes', function (done: () => void) { let engine = new FileSearchEngine({ - rootFolders: rootfolders(), + folderQueries: rootFolderQueries(), filePattern: path.normalize(path.join('examples', 'company.js')), excludePattern: { '**/*.js': true } }); @@ -333,7 +336,7 @@ suite('Search', () => { test('Files: Include pattern, single files', function (done: () => void) { let engine = new FileSearchEngine({ - rootFolders: rootfolders(), + folderQueries: rootFolderQueries(), includePattern: { 'site.css': true, 'examples/company.js': true, @@ -356,7 +359,7 @@ suite('Search', () => { test('Files: extraFiles only', function (done: () => void) { let engine = new FileSearchEngine({ - rootFolders: [], + folderQueries: [], extraFiles: [ path.normalize(path.join(require.toUrl('./fixtures'), 'site.css')), path.normalize(path.join(require.toUrl('./fixtures'), 'examples', 'company.js')), @@ -382,7 +385,7 @@ suite('Search', () => { test('Files: extraFiles only (with include)', function (done: () => void) { let engine = new FileSearchEngine({ - rootFolders: [], + folderQueries: [], extraFiles: [ path.normalize(path.join(require.toUrl('./fixtures'), 'site.css')), path.normalize(path.join(require.toUrl('./fixtures'), 'examples', 'company.js')), @@ -409,7 +412,7 @@ suite('Search', () => { test('Files: extraFiles only (with exclude)', function (done: () => void) { let engine = new FileSearchEngine({ - rootFolders: [], + folderQueries: [], extraFiles: [ path.normalize(path.join(require.toUrl('./fixtures'), 'site.css')), path.normalize(path.join(require.toUrl('./fixtures'), 'examples', 'company.js')), @@ -437,17 +440,18 @@ suite('Search', () => { return; } - const walker = new FileWalker({ rootFolders: rootfolders() }); const file0 = './more/file.txt'; const file1 = './examples/subfolder/subfile.txt'; - const cmd1 = walker.spawnFindCmd(rootfolders()[0], glob.parse({ '**/something': true })); + const walker = new FileWalker({ folderQueries: rootFolderQueries(), excludePattern: { '**/something': true } }); + const cmd1 = walker.spawnFindCmd(TEST_ROOT_FOLDER); walker.readStdout(cmd1, 'utf8', (err1, stdout1) => { assert.equal(err1, null); assert.notStrictEqual(stdout1.split('\n').indexOf(file0), -1, stdout1); assert.notStrictEqual(stdout1.split('\n').indexOf(file1), -1, stdout1); - const cmd2 = walker.spawnFindCmd(rootfolders()[0], glob.parse({ '**/subfolder': true })); + const walker = new FileWalker({ folderQueries: rootFolderQueries(), excludePattern: { '**/subfolder': true } }); + const cmd2 = walker.spawnFindCmd(TEST_ROOT_FOLDER); walker.readStdout(cmd2, 'utf8', (err2, stdout2) => { assert.equal(err2, null); assert.notStrictEqual(stdout1.split('\n').indexOf(file0), -1, stdout1); @@ -463,19 +467,20 @@ suite('Search', () => { return; } - const walker = new FileWalker({ rootFolders: rootfolders() }); const file0 = './index.html'; const file1 = './examples/small.js'; const file2 = './more/file.txt'; - const cmd1 = walker.spawnFindCmd(rootfolders()[0], glob.parse({ '**/something': true })); + const walker = new FileWalker({ folderQueries: rootFolderQueries(), excludePattern: { '**/something': true } }); + const cmd1 = walker.spawnFindCmd(TEST_ROOT_FOLDER); walker.readStdout(cmd1, 'utf8', (err1, stdout1) => { assert.equal(err1, null); assert.notStrictEqual(stdout1.split('\n').indexOf(file0), -1, stdout1); assert.notStrictEqual(stdout1.split('\n').indexOf(file1), -1, stdout1); assert.notStrictEqual(stdout1.split('\n').indexOf(file2), -1, stdout1); - const cmd2 = walker.spawnFindCmd(rootfolders()[0], glob.parse({ '{**/examples,**/more}': true })); + const walker = new FileWalker({ folderQueries: rootFolderQueries(), excludePattern: { '{**/examples,**/more}': true } }); + const cmd2 = walker.spawnFindCmd(TEST_ROOT_FOLDER); walker.readStdout(cmd2, 'utf8', (err2, stdout2) => { assert.equal(err2, null); assert.notStrictEqual(stdout1.split('\n').indexOf(file0), -1, stdout1); @@ -492,17 +497,18 @@ suite('Search', () => { return; } - const walker = new FileWalker({ rootFolders: rootfolders() }); const file0 = './examples/company.js'; const file1 = './examples/subfolder/subfile.txt'; - const cmd1 = walker.spawnFindCmd(rootfolders()[0], glob.parse({ '**/examples/something': true })); + const walker = new FileWalker({ folderQueries: rootFolderQueries(), excludePattern: { '**/examples/something': true } }); + const cmd1 = walker.spawnFindCmd(TEST_ROOT_FOLDER); walker.readStdout(cmd1, 'utf8', (err1, stdout1) => { assert.equal(err1, null); assert.notStrictEqual(stdout1.split('\n').indexOf(file0), -1, stdout1); assert.notStrictEqual(stdout1.split('\n').indexOf(file1), -1, stdout1); - const cmd2 = walker.spawnFindCmd(rootfolders()[0], glob.parse({ '**/examples/subfolder': true })); + const walker = new FileWalker({ folderQueries: rootFolderQueries(), excludePattern: { '**/examples/subfolder': true } }); + const cmd2 = walker.spawnFindCmd(TEST_ROOT_FOLDER); walker.readStdout(cmd2, 'utf8', (err2, stdout2) => { assert.equal(err2, null); assert.notStrictEqual(stdout1.split('\n').indexOf(file0), -1, stdout1); @@ -518,17 +524,18 @@ suite('Search', () => { return; } - const walker = new FileWalker({ rootFolders: rootfolders() }); const file0 = './examples/subfolder/subfile.txt'; const file1 = './examples/subfolder/anotherfolder/anotherfile.txt'; - const cmd1 = walker.spawnFindCmd(rootfolders()[0], glob.parse({ '**/subfolder/something': true })); + const walker = new FileWalker({ folderQueries: rootFolderQueries(), excludePattern: { '**/subfolder/something': true } }); + const cmd1 = walker.spawnFindCmd(TEST_ROOT_FOLDER); walker.readStdout(cmd1, 'utf8', (err1, stdout1) => { assert.equal(err1, null); assert.notStrictEqual(stdout1.split('\n').indexOf(file0), -1, stdout1); assert.notStrictEqual(stdout1.split('\n').indexOf(file1), -1, stdout1); - const cmd2 = walker.spawnFindCmd(rootfolders()[0], glob.parse({ '**/subfolder/anotherfolder': true })); + const walker = new FileWalker({ folderQueries: rootFolderQueries(), excludePattern: { '**/subfolder/anotherfolder': true } }); + const cmd2 = walker.spawnFindCmd(TEST_ROOT_FOLDER); walker.readStdout(cmd2, 'utf8', (err2, stdout2) => { assert.equal(err2, null); assert.notStrictEqual(stdout1.split('\n').indexOf(file0), -1, stdout1); @@ -544,17 +551,18 @@ suite('Search', () => { return; } - const walker = new FileWalker({ rootFolders: rootfolders() }); const file0 = './examples/company.js'; const file1 = './examples/subfolder/subfile.txt'; - const cmd1 = walker.spawnFindCmd(rootfolders()[0], glob.parse({ 'examples/something': true })); + const walker = new FileWalker({ folderQueries: rootFolderQueries(), excludePattern: { 'examples/something': true } }); + const cmd1 = walker.spawnFindCmd(TEST_ROOT_FOLDER); walker.readStdout(cmd1, 'utf8', (err1, stdout1) => { assert.equal(err1, null); assert.notStrictEqual(stdout1.split('\n').indexOf(file0), -1, stdout1); assert.notStrictEqual(stdout1.split('\n').indexOf(file1), -1, stdout1); - const cmd2 = walker.spawnFindCmd(rootfolders()[0], glob.parse({ 'examples/subfolder': true })); + const walker = new FileWalker({ folderQueries: rootFolderQueries(), excludePattern: { 'examples/subfolder': true } }); + const cmd2 = walker.spawnFindCmd(TEST_ROOT_FOLDER); walker.readStdout(cmd2, 'utf8', (err2, stdout2) => { assert.equal(err2, null); assert.notStrictEqual(stdout1.split('\n').indexOf(file0), -1, stdout1); @@ -570,7 +578,6 @@ suite('Search', () => { return; } - const walker = new FileWalker({ rootFolders: rootfolders() }); const filesIn = [ './examples/subfolder/subfile.txt', './examples/company.js', @@ -581,12 +588,16 @@ suite('Search', () => { './more/file.txt' ]; - const cmd1 = walker.spawnFindCmd(rootfolders()[0], glob.parse({ - '**/subfolder/anotherfolder': true, - '**/something/else': true, - '**/more': true, - '**/andmore': true - })); + const walker = new FileWalker({ + folderQueries: rootFolderQueries(), + excludePattern: { + '**/subfolder/anotherfolder': true, + '**/something/else': true, + '**/more': true, + '**/andmore': true + } + }); + const cmd1 = walker.spawnFindCmd(TEST_ROOT_FOLDER); walker.readStdout(cmd1, 'utf8', (err1, stdout1) => { assert.equal(err1, null); for (const fileIn of filesIn) { diff --git a/src/vs/workbench/services/search/test/node/searchService.test.ts b/src/vs/workbench/services/search/test/node/searchService.test.ts index d2aef7f670e2ed35cd80f21e18ddd1e4df9bedda..36935227c657ab75d9db2485f6e0a96849cd8bee 100644 --- a/src/vs/workbench/services/search/test/node/searchService.test.ts +++ b/src/vs/workbench/services/search/test/node/searchService.test.ts @@ -13,6 +13,9 @@ import { ISearchEngine, IRawSearch, IRawFileMatch, ISerializedFileMatch, ISerial import { SearchService as RawSearchService } from 'vs/workbench/services/search/node/rawSearchService'; import { DiskSearch } from 'vs/workbench/services/search/node/searchService'; +const TEST_FOLDER_QUERIES = [ + { folder: normalize('/some/where') } +]; const stats: IUncachedSearchStats = { fromCache: false, @@ -68,7 +71,7 @@ class TestSearchEngine implements ISearchEngine { suite('SearchService', () => { const rawSearch: IRawSearch = { - rootFolders: [normalize('/some/where')], + folderQueries: TEST_FOLDER_QUERIES, filePattern: 'a' }; @@ -153,7 +156,7 @@ suite('SearchService', () => { const results = []; return service.doFileSearch(Engine, { - rootFolders: [normalize('/some/where')], + folderQueries: TEST_FOLDER_QUERIES, filePattern: 'bb', sortByScore: true, maxResults: 2 @@ -176,7 +179,7 @@ suite('SearchService', () => { const results = []; return service.doFileSearch(Engine, { - rootFolders: [normalize('/some/where')], + folderQueries: TEST_FOLDER_QUERIES, filePattern: 'a', sortByScore: true, maxResults: 23 @@ -208,7 +211,7 @@ suite('SearchService', () => { const results = []; return service.doFileSearch(Engine, { - rootFolders: [normalize('/some/where')], + folderQueries: TEST_FOLDER_QUERIES, filePattern: 'b', sortByScore: true, cacheKey: 'x' @@ -224,7 +227,7 @@ suite('SearchService', () => { }).then(() => { const results = []; return service.doFileSearch(Engine, { - rootFolders: [normalize('/some/where')], + folderQueries: TEST_FOLDER_QUERIES, filePattern: 'bc', sortByScore: true, cacheKey: 'x' @@ -249,7 +252,7 @@ suite('SearchService', () => { }); const results = []; return service.doFileSearch(Engine, { - rootFolders: [normalize('/some/where')], + folderQueries: TEST_FOLDER_QUERIES, filePattern: 'bc', sortByScore: true, cacheKey: 'x' diff --git a/src/vs/workbench/services/search/test/node/textSearch.integrationTest.ts b/src/vs/workbench/services/search/test/node/textSearch.integrationTest.ts index c5946648d15f6f287b5c86f4a31db13a54dc2d0a..e95e8930f8c1deb528009a1c739e0ee77fbfbdda 100644 --- a/src/vs/workbench/services/search/test/node/textSearch.integrationTest.ts +++ b/src/vs/workbench/services/search/test/node/textSearch.integrationTest.ts @@ -10,7 +10,7 @@ import assert = require('assert'); import { TPromise } from 'vs/base/common/winjs.base'; import { FileWalker } from 'vs/workbench/services/search/node/fileSearch'; -import { ISerializedFileMatch, IRawSearch } from 'vs/workbench/services/search/node/search'; +import { ISerializedFileMatch, IRawSearch, IFolderSearch } from 'vs/workbench/services/search/node/search'; import { Engine as TextSearchEngine } from 'vs/workbench/services/search/node/textSearch'; import { RipgrepEngine } from 'vs/workbench/services/search/node/ripgrepTextSearch'; import { TextSearchWorkerProvider } from 'vs/workbench/services/search/node/textSearchWorkerProvider'; @@ -19,8 +19,11 @@ function countAll(matches: ISerializedFileMatch[]): number { return matches.reduce((acc, m) => acc + m.numMatches, 0); } -function rootfolders() { - return [path.normalize(require.toUrl('./fixtures'))]; +const TEST_ROOT_FOLDER = path.normalize(require.toUrl('./fixtures')); +function rootFolderQueries(): IFolderSearch[] { + return [ + { folder: TEST_ROOT_FOLDER } + ]; } const textSearchWorkerProvider = new TextSearchWorkerProvider(); @@ -85,8 +88,10 @@ function doSearchTest(config: IRawSearch, expectedResultCount: number, done) { suite('Search-integration', () => { test('Text: GameOfLife', function (done: () => void) { + this.timeout(1000 * 60); // increase timeout for this one test + let config = { - rootFolders: rootfolders(), + folderQueries: rootFolderQueries(), filePattern: '*.js', contentPattern: { pattern: 'GameOfLife', modifiers: 'i' }, }; @@ -95,8 +100,10 @@ suite('Search-integration', () => { }); test('Text: GameOfLife (RegExp)', function (done: () => void) { + this.timeout(1000 * 60); // increase timeout for this one test + let config = { - rootFolders: rootfolders(), + folderQueries: rootFolderQueries(), filePattern: '*.js', contentPattern: { pattern: 'Game.?fL\\w?fe', isRegExp: true } }; @@ -105,8 +112,10 @@ suite('Search-integration', () => { }); test('Text: GameOfLife (RegExp to EOL)', function (done: () => void) { + this.timeout(1000 * 60); // increase timeout for this one test + let config = { - rootFolders: rootfolders(), + folderQueries: rootFolderQueries(), filePattern: '*.js', contentPattern: { pattern: 'GameOfLife.*', isRegExp: true } }; @@ -115,8 +124,10 @@ suite('Search-integration', () => { }); test('Text: GameOfLife (Word Match, Case Sensitive)', function (done: () => void) { + this.timeout(1000 * 60); // increase timeout for this one test + let config = { - rootFolders: rootfolders(), + folderQueries: rootFolderQueries(), filePattern: '*.js', contentPattern: { pattern: 'GameOfLife', isWordMatch: true, isCaseSensitive: true } }; @@ -125,8 +136,10 @@ suite('Search-integration', () => { }); test('Text: GameOfLife (Word Match, Spaces)', function (done: () => void) { + this.timeout(1000 * 60); // increase timeout for this one test + let config = { - rootFolders: rootfolders(), + folderQueries: rootFolderQueries(), filePattern: '*.js', contentPattern: { pattern: ' GameOfLife ', isWordMatch: true } }; @@ -135,8 +148,10 @@ suite('Search-integration', () => { }); test('Text: GameOfLife (Word Match, Punctuation and Spaces)', function (done: () => void) { + this.timeout(1000 * 60); // increase timeout for this one test + let config = { - rootFolders: rootfolders(), + folderQueries: rootFolderQueries(), filePattern: '*.js', contentPattern: { pattern: ', as =', isWordMatch: true } }; @@ -145,8 +160,10 @@ suite('Search-integration', () => { }); test('Text: Helvetica (UTF 16)', function (done: () => void) { + this.timeout(1000 * 60); // increase timeout for this one test + let config = { - rootFolders: rootfolders(), + folderQueries: rootFolderQueries(), filePattern: '*.css', contentPattern: { pattern: 'Helvetica', modifiers: 'i' } }; @@ -155,8 +172,10 @@ suite('Search-integration', () => { }); test('Text: e', function (done: () => void) { + this.timeout(1000 * 60); // increase timeout for this one test + let config = { - rootFolders: rootfolders(), + folderQueries: rootFolderQueries(), filePattern: '*.*', contentPattern: { pattern: 'e', modifiers: 'i' } }; @@ -165,8 +184,10 @@ suite('Search-integration', () => { }); test('Text: e (with excludes)', function (done: () => void) { + this.timeout(1000 * 60); // increase timeout for this one test + let config: any = { - rootFolders: rootfolders(), + folderQueries: rootFolderQueries(), filePattern: '*.*', contentPattern: { pattern: 'e', modifiers: 'i' }, excludePattern: { '**/examples': true } @@ -176,8 +197,10 @@ suite('Search-integration', () => { }); test('Text: e (with includes)', function (done: () => void) { + this.timeout(1000 * 60); // increase timeout for this one test + let config: any = { - rootFolders: rootfolders(), + folderQueries: rootFolderQueries(), filePattern: '*.*', contentPattern: { pattern: 'e', modifiers: 'i' }, includePattern: { '**/examples/**': true } @@ -187,8 +210,10 @@ suite('Search-integration', () => { }); test('Text: e (with includes and exclude)', function (done: () => void) { + this.timeout(1000 * 60); // increase timeout for this one test + let config: any = { - rootFolders: rootfolders(), + folderQueries: rootFolderQueries(), filePattern: '*.*', contentPattern: { pattern: 'e', modifiers: 'i' }, includePattern: { '**/examples/**': true }, @@ -199,9 +224,11 @@ suite('Search-integration', () => { }); test('Text: a (capped)', function (done: () => void) { + this.timeout(1000 * 60); // increase timeout for this one test + const maxResults = 520; let config = { - rootFolders: rootfolders(), + folderQueries: rootFolderQueries(), filePattern: '*.*', contentPattern: { pattern: 'a', modifiers: 'i' }, maxResults @@ -215,8 +242,10 @@ suite('Search-integration', () => { }); test('Text: a (no results)', function (done: () => void) { + this.timeout(1000 * 60); // increase timeout for this one test + let config = { - rootFolders: rootfolders(), + folderQueries: rootFolderQueries(), filePattern: '*.*', contentPattern: { pattern: 'ahsogehtdas', modifiers: 'i' } }; @@ -225,8 +254,10 @@ suite('Search-integration', () => { }); test('Text: -size', function (done: () => void) { + this.timeout(1000 * 60); // increase timeout for this one test + let config = { - rootFolders: rootfolders(), + folderQueries: rootFolderQueries(), filePattern: '*.css', contentPattern: { pattern: '-size', modifiers: 'i' } }; diff --git a/src/vs/workbench/services/telemetry/common/workspaceStats.ts b/src/vs/workbench/services/telemetry/common/workspaceStats.ts index 725b76e72ad01f7a790cfadc6c12b46f21d9b808..7f8f4d6035f2b74c2cb3e14937a81e4c646f9ee1 100644 --- a/src/vs/workbench/services/telemetry/common/workspaceStats.ts +++ b/src/vs/workbench/services/telemetry/common/workspaceStats.ts @@ -8,7 +8,6 @@ import winjs = require('vs/base/common/winjs.base'); import errors = require('vs/base/common/errors'); import URI from 'vs/base/common/uri'; -import { ArraySet } from 'vs/base/common/set'; import { IFileService } from 'vs/platform/files/common/files'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; @@ -60,12 +59,12 @@ function extractDomain(url: string): string { } export function getDomainsOfRemotes(text: string, whitelist: string[]): string[] { - let domains = new ArraySet(); + let domains = new Set(); let match: RegExpExecArray; while (match = RemoteMatcher.exec(text)) { let domain = extractDomain(match[1]); if (domain) { - domains.set(domain); + domains.add(domain); } } @@ -74,7 +73,10 @@ export function getDomainsOfRemotes(text: string, whitelist: string[]): string[] return map; }, Object.create(null)); - return domains.elements + const elements: string[] = []; + domains.forEach(e => elements.push(e)); + + return elements .map(key => whitemap[key] ? key : key.replace(AnyButDot, 'a')); } @@ -99,10 +101,11 @@ export class WorkspaceStats { tags['workbench.filesToCreate'] = filesToCreate && filesToCreate.length || undefined; tags['workbench.filesToDiff'] = filesToDiff && filesToDiff.length || undefined; - const workspace = this.contextService.getWorkspace(); + const workspace = this.contextService.getWorkspace2(); + tags['workspace.roots'] = workspace ? workspace.roots.length : 0; tags['workspace.empty'] = !workspace; - const folder = workspace ? workspace.resource : this.environmentService.appQuality !== 'stable' && this.findFolder(workbenchOptions); + const folder = workspace ? workspace.roots[0] /* TODO@Christof https://github.com/Microsoft/vscode/issues/29085 */ : this.environmentService.appQuality !== 'stable' && this.findFolder(workbenchOptions); if (folder && this.fileService) { return this.fileService.resolveFile(folder).then(stats => { let names = (stats.children || []).map(c => c.name); @@ -259,8 +262,8 @@ export class WorkspaceStats { } public reportCloudStats(): void { - const workspace = this.contextService.getWorkspace(); - let uri = workspace ? workspace.resource : null; + const workspace = this.contextService.getWorkspace2(); + let uri = workspace ? workspace.roots[0] : null; // TODO@Christof https://github.com/Microsoft/vscode/issues/29085 if (uri && this.fileService) { this.reportRemotes(uri); this.reportAzure(uri); diff --git a/src/vs/editor/node/textMate/OSSREADME.json b/src/vs/workbench/services/textMate/electron-browser/OSSREADME.json similarity index 100% rename from src/vs/editor/node/textMate/OSSREADME.json rename to src/vs/workbench/services/textMate/electron-browser/OSSREADME.json diff --git a/src/vs/editor/node/textMate/TMGrammars.ts b/src/vs/workbench/services/textMate/electron-browser/TMGrammars.ts similarity index 96% rename from src/vs/editor/node/textMate/TMGrammars.ts rename to src/vs/workbench/services/textMate/electron-browser/TMGrammars.ts index f3b06e948623602556dbc53f83cc1b8f919bc3a2..aeed6e2f3c48c0f4589f634d70dc3a244522fc9f 100644 --- a/src/vs/editor/node/textMate/TMGrammars.ts +++ b/src/vs/workbench/services/textMate/electron-browser/TMGrammars.ts @@ -6,7 +6,7 @@ import * as nls from 'vs/nls'; import { IExtensionPoint, ExtensionsRegistry } from 'vs/platform/extensions/common/extensionsRegistry'; -import { languagesExtPoint } from 'vs/editor/common/services/modeServiceImpl'; +import { languagesExtPoint } from "vs/workbench/services/mode/common/workbenchModeService"; export interface IEmbeddedLanguagesMap { [scopeName: string]: string; diff --git a/src/vs/editor/electron-browser/textMate/TMHelper.ts b/src/vs/workbench/services/textMate/electron-browser/TMHelper.ts similarity index 100% rename from src/vs/editor/electron-browser/textMate/TMHelper.ts rename to src/vs/workbench/services/textMate/electron-browser/TMHelper.ts diff --git a/src/vs/editor/electron-browser/textMate/TMSyntax.ts b/src/vs/workbench/services/textMate/electron-browser/TMSyntax.ts similarity index 97% rename from src/vs/editor/electron-browser/textMate/TMSyntax.ts rename to src/vs/workbench/services/textMate/electron-browser/TMSyntax.ts index 036fc7063c2f24e6c855ce9b1488bba733f27a3a..7833bde278ca941de7ec9cd56836255b7c1947bb 100644 --- a/src/vs/editor/electron-browser/textMate/TMSyntax.ts +++ b/src/vs/workbench/services/textMate/electron-browser/TMSyntax.ts @@ -16,8 +16,8 @@ import { ITokenizationSupport, TokenizationRegistry, IState, LanguageId } from ' import { IModeService } from 'vs/editor/common/services/modeService'; import { INITIAL, StackElement, IGrammar, Registry, IEmbeddedLanguagesMap as IEmbeddedLanguagesMap2 } from 'vscode-textmate'; import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService'; -import { ITextMateService } from 'vs/editor/node/textMate/textMateService'; -import { grammarsExtPoint, IEmbeddedLanguagesMap, ITMSyntaxExtensionPoint } from 'vs/editor/node/textMate/TMGrammars'; +import { ITextMateService } from 'vs/workbench/services/textMate/electron-browser/textMateService'; +import { grammarsExtPoint, IEmbeddedLanguagesMap, ITMSyntaxExtensionPoint } from 'vs/workbench/services/textMate/electron-browser/TMGrammars'; import { TokenizationResult, TokenizationResult2 } from 'vs/editor/common/core/token'; import { TokenMetadata } from 'vs/editor/common/model/tokensBinaryEncoding'; import { nullTokenize2 } from 'vs/editor/common/modes/nullMode'; @@ -97,7 +97,7 @@ interface ICreateGrammarResult { containsEmbeddedLanguages: boolean; } -export class MainProcessTextMateSyntax implements ITextMateService { +export class TextMateService implements ITextMateService { public _serviceBrand: any; private _grammarRegistry: Registry; @@ -162,7 +162,7 @@ export class MainProcessTextMateSyntax implements ITextMateService { private _updateTheme(): void { let colorTheme = this._themeService.getColorTheme(); this._grammarRegistry.setTheme({ name: colorTheme.label, settings: colorTheme.tokenColors }); - let colorMap = MainProcessTextMateSyntax._toColorMap(this._grammarRegistry.getColorMap()); + let colorMap = TextMateService._toColorMap(this._grammarRegistry.getColorMap()); let cssRules = generateTokensCSSForColorMap(colorMap); this._styleElement.innerHTML = cssRules; TokenizationRegistry.setColorMap(colorMap); diff --git a/src/vs/editor/node/textMate/textMateService.ts b/src/vs/workbench/services/textMate/electron-browser/textMateService.ts similarity index 100% rename from src/vs/editor/node/textMate/textMateService.ts rename to src/vs/workbench/services/textMate/electron-browser/textMateService.ts diff --git a/src/vs/workbench/services/textfile/common/textFileEditorModel.ts b/src/vs/workbench/services/textfile/common/textFileEditorModel.ts index eb3a76b87b1b6d23b01367a17230587af5f0957f..fd47f1fa1407a698e2e26003d508a056e1c4d216 100644 --- a/src/vs/workbench/services/textfile/common/textFileEditorModel.ts +++ b/src/vs/workbench/services/textfile/common/textFileEditorModel.ts @@ -4,6 +4,7 @@ *--------------------------------------------------------------------------------------------*/ 'use strict'; +import * as path from 'vs/base/common/paths'; import nls = require('vs/nls'); import Event, { Emitter } from 'vs/base/common/event'; import { TPromise, TValueCallback, ErrorCallback } from 'vs/base/common/winjs.base'; @@ -17,23 +18,29 @@ import paths = require('vs/base/common/paths'); import diagnostics = require('vs/base/common/diagnostics'); import types = require('vs/base/common/types'); import { IMode } from 'vs/editor/common/modes'; -import { ILifecycleService } from 'vs/platform/lifecycle/common/lifecycle'; +import { ILifecycleService, LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import { ITextFileService, IAutoSaveConfiguration, ModelState, ITextFileEditorModel, IModelSaveOptions, ISaveErrorHandler, ISaveParticipant, StateChange, SaveReason, IRawTextContent } from 'vs/workbench/services/textfile/common/textfiles'; -import { EncodingMode, EditorModel } from 'vs/workbench/common/editor'; +import { EncodingMode } from 'vs/workbench/common/editor'; import { BaseTextEditorModel } from 'vs/workbench/common/editor/textEditorModel'; import { IBackupFileService, BACKUP_FILE_RESOLVE_OPTIONS } from 'vs/workbench/services/backup/common/backup'; -import { IFileService, IFileStat, IFileOperationResult, FileOperationResult, IContent, CONTENT_CHANGE_EVENT_BUFFER_DELAY, FileChangesEvent, FileChangeType, isEqualOrParent } from 'vs/platform/files/common/files'; +import { IFileService, IFileStat, IFileOperationResult, FileOperationResult, IContent, CONTENT_CHANGE_EVENT_BUFFER_DELAY, FileChangesEvent, FileChangeType } from 'vs/platform/files/common/files'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IMessageService, Severity } from 'vs/platform/message/common/message'; +import { IMessageService, Severity, IChoiceService } from 'vs/platform/message/common/message'; import { IModeService } from 'vs/editor/common/services/modeService'; import { IModelService } from 'vs/editor/common/services/modelService'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { anonymize } from 'vs/platform/telemetry/common/telemetryUtils'; import { RunOnceScheduler } from 'vs/base/common/async'; import { IRawTextSource } from 'vs/editor/common/model/textSource'; +import { StorageScope, IStorageService } from 'vs/platform/storage/common/storage'; +import { localize } from 'vs/nls'; +import { Action } from 'vs/base/common/actions'; +// TODO@Rob layer breaker +// tslint:disable-next-line:import-patterns +import { ShowTasksAction, ShowTasksDocumentationAction } from 'vs/workbench/parts/quickopen/common/quickopenActions'; /** * The text file editor model listens to changes to its underlying code editor model and saves these changes through the file service back to the disk. */ @@ -85,7 +92,9 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil @ITextFileService private textFileService: ITextFileService, @IBackupFileService private backupFileService: IBackupFileService, @IEnvironmentService private environmentService: IEnvironmentService, - @IWorkspaceContextService private contextService: IWorkspaceContextService + @IWorkspaceContextService private contextService: IWorkspaceContextService, + @IChoiceService private choiceService: IChoiceService, + @IStorageService private storageService: IStorageService ) { super(modelService, modeService); @@ -238,7 +247,7 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil // Unset flags const undo = this.setDirty(false); - let loadPromise: TPromise; + let loadPromise: TPromise; if (soft) { loadPromise = TPromise.as(this); } else { @@ -258,7 +267,7 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil }); } - public load(force?: boolean /* bypass any caches and really go to disk */): TPromise { + public load(force?: boolean /* bypass any caches and really go to disk */): TPromise { diag('load() - enter', this.resource, new Date()); // It is very important to not reload the model when the model is dirty. We only want to reload the model from the disk @@ -279,7 +288,7 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil return this.loadFromFile(force); } - private loadWithBackup(force: boolean): TPromise { + private loadWithBackup(force: boolean): TPromise { return this.backupFileService.loadBackupResource(this.resource).then(backup => { // Make sure meanwhile someone else did not suceed or start loading @@ -306,7 +315,7 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil }); } - private loadFromFile(force: boolean): TPromise { + private loadFromFile(force: boolean): TPromise { // Decide on etag let etag: string; @@ -319,10 +328,61 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil // Resolve Content return this.textFileService .resolveTextContent(this.resource, { acceptTextOnly: true, etag, encoding: this.preferredEncoding }) - .then(content => this.handleLoadSuccess(content), error => this.handleLoadError(error)); + .then(content => this.handleLoadSuccess(content), error => this.handleLoadError(error)) + .then((result) => { + this.showTaskNotification(); + return result; + }); + } + + private showTaskNotification(): void { + const storageKey = 'workbench.tasks.ranTaskBefore'; + const ignoreKey = 'workbench.tasks.ignoreTaskNotification'; + if (!this.storageService.get(ignoreKey) && !this.storageService.get(storageKey) && this.contextService.getWorkspace2() + && this.contextService.getWorkspace2().roots && this.contextService.getWorkspace2().roots.length > 0) { + const fileName = path.relative(this.contextService.getWorkspace2().roots[0].toString(), this.resource.toString()); + if (fileName.match(/^gruntfile\.js$/i) || fileName.match(/^gulpfile\.js$/i) || fileName.match(/^tsconfig\.json$/i)) { + const message = localize('taskFileOpened', `Run your {0} in VS Code. Get started here.`, fileName.split('.')[0]); + let action: Action; + let messageTest: string; + const showDocumentation = this.telemetryService.getExperiments().showTaskDocumentation; + if (showDocumentation) { + action = this.instantiationService.createInstance(ShowTasksDocumentationAction, ShowTasksDocumentationAction.ID, localize('showTaskDocumentation', "Show task Documentation")); + messageTest = ShowTasksDocumentationAction.LABEL; + } else { + action = this.instantiationService.createInstance(ShowTasksAction, ShowTasksAction.ID, localize('showTasks', "Show tasks")); + messageTest = ShowTasksAction.LABEL; + } + const options = [ + messageTest, + localize('neverShowAgain', "Don't show again"), + localize('close', "Close") + ]; + + this.choiceService.choose(Severity.Info, message, options, 2).done(choice => { + switch (choice) { + case 0: { + this.telemetryService.publicLog('taskNotificationOptionChoice', + { choice: 0, test: showDocumentation }); + return action.run(); + } + case 1: { + this.telemetryService.publicLog('taskNotificationOptionChoice', + { choice: 1, test: showDocumentation }); + return this.storageService.store(ignoreKey, true, StorageScope.GLOBAL); + } + case 2: { + this.telemetryService.publicLog('taskNotificationOptionChoice', + { choice: 2, test: showDocumentation }); + return; + } + } + }); + } + } } - private handleLoadSuccess(content: IRawTextContent): TPromise { + private handleLoadSuccess(content: IRawTextContent): TPromise { // Clear orphaned state when load was successful this.setOrphaned(false); @@ -330,7 +390,7 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil return this.loadWithContent(content); } - private handleLoadError(error: IFileOperationResult): TPromise { + private handleLoadError(error: IFileOperationResult): TPromise { const result = error.fileOperationResult; // Apply orphaned state based on error code @@ -340,21 +400,21 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil if (result === FileOperationResult.FILE_NOT_MODIFIED_SINCE) { this.setDirty(false); // Ensure we are not tracking a stale state - return TPromise.as(this); + return TPromise.as(this); } // Ignore when a model has been resolved once and the file was deleted meanwhile. Since // we already have the model loaded, we can return to this state and update the orphaned // flag to indicate that this model has no version on disk anymore. if (this.isResolved() && result === FileOperationResult.FILE_NOT_FOUND) { - return TPromise.as(this); + return TPromise.as(this); } // Otherwise bubble up the error - return TPromise.wrapError(error); + return TPromise.wrapError(error); } - private loadWithContent(content: IRawTextContent | IContent, backup?: URI): TPromise { + private loadWithContent(content: IRawTextContent | IContent, backup?: URI): TPromise { diag('load() - resolved content', this.resource, new Date()); // Telemetry @@ -399,7 +459,7 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil return this.doCreateTextModel(content.resource, content.value, backup); } - private doUpdateTextModel(value: string | IRawTextSource): TPromise { + private doUpdateTextModel(value: string | IRawTextSource): TPromise { diag('load() - updated text editor model', this.resource, new Date()); this.setDirty(false); // Ensure we are not tracking a stale state @@ -411,10 +471,10 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil this.blockModelContentChange = false; } - return TPromise.as(this); + return TPromise.as(this); } - private doCreateTextModel(resource: URI, value: string | IRawTextSource, backup: URI): TPromise { + private doCreateTextModel(resource: URI, value: string | IRawTextSource, backup: URI): TPromise { diag('load() - created text editor model', this.resource, new Date()); this.createTextEditorModelPromise = this.doLoadBackup(backup).then(backupContent => { @@ -623,7 +683,7 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil // We DO NOT run any save participant if we are in the shutdown phase and files are being // saved as a result of that. let saveParticipantPromise = TPromise.as(versionId); - if (TextFileEditorModel.saveParticipant && !this.lifecycleService.willShutdown) { + if (TextFileEditorModel.saveParticipant && this.lifecycleService.phase !== LifecyclePhase.ShuttingDown) { const onCompleteOrError = () => { this.blockModelContentChange = false; @@ -669,10 +729,8 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil diag(`doSave(${versionId}) - after updateContent()`, this.resource, new Date()); // Telemetry - if ((this.contextService.getWorkspace() && isEqualOrParent(this.resource.fsPath, this.contextService.toResource('.vscode').fsPath)) || - this.resource.fsPath === this.environmentService.appSettingsPath) { - // Do not log write to user settings.json and .vscode folder as a filePUT event as it ruins our JSON usage data - this.telemetryService.publicLog('settingsWritten'); + if (this.isSettingsFile()) { + this.telemetryService.publicLog('settingsWritten'); // Do not log write to user settings.json and .vscode folder as a filePUT event as it ruins our JSON usage data } else { this.telemetryService.publicLog('filePUT', { mimeType: guessMimeTypes(this.resource.fsPath).join(', '), ext: paths.extname(this.lastResolvedDiskStat.resource.fsPath) }); } @@ -713,6 +771,23 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil })); } + private isSettingsFile(): boolean { + + // Check for global settings file + if (this.resource.fsPath === this.environmentService.appSettingsPath) { + return true; + } + + // Check for workspace settings file + if (this.contextService.hasWorkspace()) { + return this.contextService.getWorkspace2().roots.some(root => { + return paths.isEqualOrParent(this.resource.fsPath, path.join(root.fsPath, '.vscode')); + }); + } + + return false; + } + private doTouch(): TPromise { return this.fileService.touchFile(this.resource).then(stat => { diff --git a/src/vs/workbench/services/textfile/common/textFileService.ts b/src/vs/workbench/services/textfile/common/textFileService.ts index 96626c1b4d8b744b441bcac815cb05edd480b177..3732c84748a5218adc368301214574f6b04c190c 100644 --- a/src/vs/workbench/services/textfile/common/textFileService.ts +++ b/src/vs/workbench/services/textfile/common/textFileService.ts @@ -16,7 +16,6 @@ import { IWindowsService } from 'vs/platform/windows/common/windows'; import { IBackupFileService } from 'vs/workbench/services/backup/common/backup'; import { IRevertOptions, IResult, ITextFileOperationResult, ITextFileService, IRawTextContent, IAutoSaveConfiguration, AutoSaveMode, SaveReason, ITextFileEditorModelManager, ITextFileEditorModel, ISaveOptions, ModelState } from 'vs/workbench/services/textfile/common/textfiles'; import { ConfirmResult } from 'vs/workbench/common/editor'; -import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService'; import { ILifecycleService, ShutdownReason } from 'vs/platform/lifecycle/common/lifecycle'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { IFileService, IResolveContentOptions, IFilesConfiguration, IFileOperationResult, FileOperationResult, AutoSaveConfiguration, HotExitConfiguration } from 'vs/platform/files/common/files'; @@ -24,12 +23,14 @@ import { IConfigurationService } from 'vs/platform/configuration/common/configur import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { IUntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService'; +import { IUntitledEditorService, UNTITLED_SCHEMA } from 'vs/workbench/services/untitled/common/untitledEditorService'; import { UntitledEditorModel } from 'vs/workbench/common/editor/untitledEditorModel'; import { TextFileEditorModelManager } from 'vs/workbench/services/textfile/common/textFileEditorModelManager'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IMessageService, Severity } from 'vs/platform/message/common/message'; import { ResourceMap } from 'vs/base/common/map'; +import { Schemas } from "vs/base/common/network"; +import { IHistoryService } from "vs/workbench/services/history/common/history"; export interface IBackupResult { didBackup: boolean; @@ -58,18 +59,18 @@ export abstract class TextFileService implements ITextFileService { private configuredHotExit: string; constructor( - @ILifecycleService private lifecycleService: ILifecycleService, - @IWorkspaceContextService private contextService: IWorkspaceContextService, - @IConfigurationService private configurationService: IConfigurationService, - @ITelemetryService private telemetryService: ITelemetryService, - @IFileService protected fileService: IFileService, - @IUntitledEditorService private untitledEditorService: IUntitledEditorService, - @IInstantiationService private instantiationService: IInstantiationService, - @IMessageService private messageService: IMessageService, - @IEnvironmentService protected environmentService: IEnvironmentService, - @IBackupFileService private backupFileService: IBackupFileService, - @IEditorGroupService private editorGroupService: IEditorGroupService, - @IWindowsService private windowsService: IWindowsService + private lifecycleService: ILifecycleService, + private contextService: IWorkspaceContextService, + private configurationService: IConfigurationService, + private telemetryService: ITelemetryService, + protected fileService: IFileService, + private untitledEditorService: IUntitledEditorService, + private instantiationService: IInstantiationService, + private messageService: IMessageService, + protected environmentService: IEnvironmentService, + private backupFileService: IBackupFileService, + private windowsService: IWindowsService, + private historyService: IHistoryService ) { this.toUnbind = []; @@ -116,7 +117,7 @@ export abstract class TextFileService implements ITextFileService { this.lifecycleService.onShutdown(this.dispose, this); // Configuration changes - this.toUnbind.push(this.configurationService.onDidUpdateConfiguration(e => this.onConfigurationChange(e.config))); + this.toUnbind.push(this.configurationService.onDidUpdateConfiguration(e => this.onConfigurationChange(this.configurationService.getConfiguration()))); } private beforeShutdown(reason: ShutdownReason): boolean | TPromise { @@ -222,9 +223,9 @@ export abstract class TextFileService implements ITextFileService { const filesToBackup: ITextFileEditorModel[] = []; const untitledToBackup: URI[] = []; dirtyToBackup.forEach(s => { - if (s.scheme === 'file') { + if (s.scheme === Schemas.file) { filesToBackup.push(textFileEditorModelManager.get(s)); - } else if (s.scheme === 'untitled') { + } else if (s.scheme === UNTITLED_SCHEMA) { untitledToBackup.push(s); } }); @@ -238,9 +239,9 @@ export abstract class TextFileService implements ITextFileService { return TPromise.join(dirtyFileModels.map(model => this.backupFileService.backupResource(model.getResource(), model.getValue(), model.getVersionId()))).then(results => { // Handle untitled resources - const untitledModelPromises = untitledResources.map(untitledResource => this.untitledEditorService.get(untitledResource)) - .filter(untitled => !!untitled) - .map(untitled => untitled.resolve()); + const untitledModelPromises = untitledResources + .filter(untitled => this.untitledEditorService.exists(untitled)) + .map(untitled => this.untitledEditorService.loadOrCreate({ resource: untitled })); return TPromise.join(untitledModelPromises).then(untitledModels => { const untitledBackupPromises = untitledModels.map(model => { @@ -341,14 +342,11 @@ export abstract class TextFileService implements ITextFileService { } // Hot exit - const hotExitMode = configuration && configuration.files ? configuration.files.hotExit : HotExitConfiguration.OFF; - // Handle the legacy case where hot exit was a boolean - if (hotExitMode === false) { - this.configuredHotExit = HotExitConfiguration.OFF; - } else if (hotExitMode === true) { - this.configuredHotExit = HotExitConfiguration.ON_EXIT; - } else { + const hotExitMode = configuration && configuration.files && configuration.files.hotExit; + if (hotExitMode === HotExitConfiguration.OFF || hotExitMode === HotExitConfiguration.ON_EXIT_AND_WINDOW_CLOSE) { this.configuredHotExit = hotExitMode; + } else { + this.configuredHotExit = HotExitConfiguration.ON_EXIT; } } @@ -358,12 +356,7 @@ export abstract class TextFileService implements ITextFileService { const dirty = this.getDirtyFileModels(resources).map(m => m.getResource()); // Add untitled ones - if (!resources) { - dirty.push(...this.untitledEditorService.getDirty()); - } else { - const dirtyUntitled = resources.map(r => this.untitledEditorService.get(r)).filter(u => u && u.isDirty()).map(u => u.getResource()); - dirty.push(...dirtyUntitled); - } + dirty.push(...this.untitledEditorService.getDirty(resources)); return dirty; } @@ -382,7 +375,7 @@ export abstract class TextFileService implements ITextFileService { public save(resource: URI, options?: ISaveOptions): TPromise { // Run a forced save if we detect the file is not dirty so that save participants can still run - if (options && options.force && resource.scheme === 'file' && !this.isDirty(resource)) { + if (options && options.force && resource.scheme === Schemas.file && !this.isDirty(resource)) { const model = this._models.get(resource); if (model) { model.save({ force: true, reason: SaveReason.EXPLICIT }).then(() => !model.isDirty()); @@ -408,9 +401,9 @@ export abstract class TextFileService implements ITextFileService { const filesToSave: URI[] = []; const untitledToSave: URI[] = []; toSave.forEach(s => { - if (s.scheme === 'file') { + if (s.scheme === Schemas.file) { filesToSave.push(s); - } else if ((Array.isArray(arg1) || arg1 === true /* includeUntitled */) && s.scheme === 'untitled') { + } else if ((Array.isArray(arg1) || arg1 === true /* includeUntitled */) && s.scheme === UNTITLED_SCHEMA) { untitledToSave.push(s); } }); @@ -426,18 +419,18 @@ export abstract class TextFileService implements ITextFileService { // Preflight for untitled to handle cancellation from the dialog const targetsForUntitled: URI[] = []; for (let i = 0; i < untitledResources.length; i++) { - const untitled = this.untitledEditorService.get(untitledResources[i]); - if (untitled) { + const untitled = untitledResources[i]; + if (this.untitledEditorService.exists(untitled)) { let targetPath: string; // Untitled with associated file path don't need to prompt - if (this.untitledEditorService.hasAssociatedFilePath(untitled.getResource())) { - targetPath = untitled.getResource().fsPath; + if (this.untitledEditorService.hasAssociatedFilePath(untitled)) { + targetPath = untitled.fsPath; } // Otherwise ask user else { - targetPath = this.promptForPath(this.suggestFileName(untitledResources[i])); + targetPath = this.promptForPath(this.suggestFileName(untitled)); if (!targetPath) { return TPromise.as({ results: [...fileResources, ...untitledResources].map(r => { @@ -473,8 +466,8 @@ export abstract class TextFileService implements ITextFileService { }); } - private doSaveAllFiles(arg1?: any /* URI[] */, reason?: SaveReason): TPromise { - const dirtyFileModels = this.getDirtyFileModels(Array.isArray(arg1) ? arg1 : void 0 /* Save All */) + private doSaveAllFiles(resources?: URI[], reason?: SaveReason): TPromise { + const dirtyFileModels = this.getDirtyFileModels(Array.isArray(resources) ? resources : void 0 /* Save All */) .filter(model => { if (model.hasState(ModelState.CONFLICT) && (reason === SaveReason.AUTO || reason === SaveReason.FOCUS_CHANGE || reason === SaveReason.WINDOW_CHANGE)) { return false; // if model is in save conflict, do not save unless save reason is explicit or not provided at all @@ -529,7 +522,7 @@ export abstract class TextFileService implements ITextFileService { // Get to target resource if (!target) { let dialogPath = resource.fsPath; - if (resource.scheme === 'untitled') { + if (resource.scheme === UNTITLED_SCHEMA) { dialogPath = this.suggestFileName(resource); } @@ -556,13 +549,10 @@ export abstract class TextFileService implements ITextFileService { // Retrieve text model from provided resource if any let modelPromise: TPromise = TPromise.as(null); - if (resource.scheme === 'file') { + if (resource.scheme === Schemas.file) { modelPromise = TPromise.as(this._models.get(resource)); - } else if (resource.scheme === 'untitled') { - const untitled = this.untitledEditorService.get(resource); - if (untitled) { - modelPromise = untitled.resolve(); - } + } else if (resource.scheme === UNTITLED_SCHEMA && this.untitledEditorService.exists(resource)) { + modelPromise = this.untitledEditorService.loadOrCreate({ resource }); } return modelPromise.then(model => { @@ -621,12 +611,12 @@ export abstract class TextFileService implements ITextFileService { } private suggestFileName(untitledResource: URI): string { - const workspace = this.contextService.getWorkspace(); - if (workspace) { - return URI.file(paths.join(workspace.resource.fsPath, this.untitledEditorService.get(untitledResource).suggestFileName())).fsPath; + const root = this.historyService.getLastActiveWorkspaceRoot(); + if (root) { + return URI.file(paths.join(root.fsPath, this.untitledEditorService.suggestFileName(untitledResource))).fsPath; } - return this.untitledEditorService.get(untitledResource).suggestFileName(); + return this.untitledEditorService.suggestFileName(untitledResource); } public revert(resource: URI, options?: IRevertOptions): TPromise { diff --git a/src/vs/workbench/services/textfile/common/textfiles.ts b/src/vs/workbench/services/textfile/common/textfiles.ts index d84df51fe0b3998ecab5e21fb77e223326a6a3e1..3b60292f8a9463f22463b326c76ba443f02bc1cd 100644 --- a/src/vs/workbench/services/textfile/common/textfiles.ts +++ b/src/vs/workbench/services/textfile/common/textfiles.ts @@ -22,7 +22,7 @@ export interface ISaveErrorHandler { /** * Called whenever a save fails. */ - onSaveError(error: any, model: ITextFileEditorModel): void; + onSaveError(error: Error, model: ITextFileEditorModel): void; } export interface ISaveParticipant { @@ -30,7 +30,7 @@ export interface ISaveParticipant { /** * Participate in a save of a model. Allows to change the model before it is being saved to disk. */ - participate(model: ITextFileEditorModel, env: { reason: SaveReason }): TPromise; + participate(model: ITextFileEditorModel, env: { reason: SaveReason }): void; } /** @@ -167,7 +167,7 @@ export interface ITextFileEditorModelManager { getAll(resource?: URI): ITextFileEditorModel[]; - loadOrCreate(resource: URI, options?: IModelLoadOrCreateOptions): TPromise; + loadOrCreate(resource: URI, options?: IModelLoadOrCreateOptions): TPromise; disposeModel(model: ITextFileEditorModel): void; } @@ -196,6 +196,8 @@ export interface ITextFileEditorModel extends ITextEditorModel, IEncodingSupport save(options?: IModelSaveOptions): TPromise; + load(): TPromise; + revert(soft?: boolean): TPromise; getValue(): string; diff --git a/src/vs/editor/node/model/modelBuilder.ts b/src/vs/workbench/services/textfile/electron-browser/modelBuilder.ts similarity index 100% rename from src/vs/editor/node/model/modelBuilder.ts rename to src/vs/workbench/services/textfile/electron-browser/modelBuilder.ts diff --git a/src/vs/workbench/services/textfile/electron-browser/textFileService.ts b/src/vs/workbench/services/textfile/electron-browser/textFileService.ts index 257c71e76f9a3c09043707524456bd51792c49c4..0ef2a0f2c532bab6ecf36dd56b414ba9f40b58b8 100644 --- a/src/vs/workbench/services/textfile/electron-browser/textFileService.ts +++ b/src/vs/workbench/services/textfile/electron-browser/textFileService.ts @@ -22,14 +22,14 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IModeService } from 'vs/editor/common/services/modeService'; import { IWindowIPCService } from 'vs/workbench/services/window/electron-browser/windowService'; -import { ModelBuilder } from 'vs/editor/node/model/modelBuilder'; -import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService'; +import { ModelBuilder } from 'vs/workbench/services/textfile/electron-browser/modelBuilder'; import product from 'vs/platform/node/product'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IMessageService } from 'vs/platform/message/common/message'; import { IBackupFileService } from 'vs/workbench/services/backup/common/backup'; import { IWindowsService } from 'vs/platform/windows/common/windows'; +import { IHistoryService } from "vs/workbench/services/history/common/history"; export class TextFileService extends AbstractTextFileService { @@ -49,9 +49,9 @@ export class TextFileService extends AbstractTextFileService { @IMessageService messageService: IMessageService, @IBackupFileService backupFileService: IBackupFileService, @IWindowsService windowsService: IWindowsService, - @IEditorGroupService editorGroupService: IEditorGroupService + @IHistoryService historyService: IHistoryService ) { - super(lifecycleService, contextService, configurationService, telemetryService, fileService, untitledEditorService, instantiationService, messageService, environmentService, backupFileService, editorGroupService, windowsService); + super(lifecycleService, contextService, configurationService, telemetryService, fileService, untitledEditorService, instantiationService, messageService, environmentService, backupFileService, windowsService, historyService); } public resolveTextContent(resource: URI, options?: IResolveContentOptions): TPromise { diff --git a/src/vs/editor/test/node/model/modelBuilder.test.ts b/src/vs/workbench/services/textfile/test/modelBuilder.test.ts similarity index 97% rename from src/vs/editor/test/node/model/modelBuilder.test.ts rename to src/vs/workbench/services/textfile/test/modelBuilder.test.ts index 1914887e04bec637ee2cb96cc09edaf01a714ba4..283a3ce480383e77d89f48edbf4150e8ce5032a0 100644 --- a/src/vs/editor/test/node/model/modelBuilder.test.ts +++ b/src/vs/workbench/services/textfile/test/modelBuilder.test.ts @@ -5,7 +5,7 @@ 'use strict'; import * as assert from 'assert'; -import { ModelBuilder, computeHash } from 'vs/editor/node/model/modelBuilder'; +import { ModelBuilder, computeHash } from 'vs/workbench/services/textfile/electron-browser/modelBuilder'; import { ITextModelCreationOptions } from 'vs/editor/common/editorCommon'; import { TextModel } from 'vs/editor/common/model/textModel'; import * as strings from 'vs/base/common/strings'; diff --git a/src/vs/editor/test/node/model/modelBuilderAuto.test.ts b/src/vs/workbench/services/textfile/test/modelBuilderAuto.test.ts similarity index 97% rename from src/vs/editor/test/node/model/modelBuilderAuto.test.ts rename to src/vs/workbench/services/textfile/test/modelBuilderAuto.test.ts index cda822c1c4201436feaacbb698e0c5f9bb71e916..5d5dfb8790030c0e0d41659c47be129fc51ffe15 100644 --- a/src/vs/editor/test/node/model/modelBuilderAuto.test.ts +++ b/src/vs/workbench/services/textfile/test/modelBuilderAuto.test.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ 'use strict'; -import { testModelBuilder, testDifferentHash } from 'vs/editor/test/node/model/modelBuilder.test'; +import { testModelBuilder, testDifferentHash } from './modelBuilder.test'; import { CharCode } from 'vs/base/common/charCode'; const GENERATE_TESTS = false; diff --git a/src/vs/workbench/services/textfile/test/textFileService.test.ts b/src/vs/workbench/services/textfile/test/textFileService.test.ts index bace0563bba2b8c087d855048882b2daba81bf66..777b42a5b7185d1e231efaac66a1935125d054de 100644 --- a/src/vs/workbench/services/textfile/test/textFileService.test.ts +++ b/src/vs/workbench/services/textfile/test/textFileService.test.ts @@ -98,12 +98,13 @@ suite('Files - TextFileService', () => { }, error => onError(error, done)); }); - test('confirm onWillShutdown - no veto and backups cleaned up if user does not want to save', function (done) { + test('confirm onWillShutdown - no veto and backups cleaned up if user does not want to save (hot.exit: off)', function (done) { model = instantiationService.createInstance(TextFileEditorModel, toResource.call(this, '/path/file.txt'), 'utf8'); (accessor.textFileService.models).add(model.getResource(), model); const service = accessor.textFileService; service.setConfirmResult(ConfirmResult.DONT_SAVE); + service.onConfigurationChange({ files: { hotExit: 'off' } }); model.load().done(() => { model.textEditorModel.setValue('foo'); @@ -130,12 +131,13 @@ suite('Files - TextFileService', () => { }, error => onError(error, done)); }); - test('confirm onWillShutdown - save', function (done) { + test('confirm onWillShutdown - save (hot.exit: off)', function (done) { model = instantiationService.createInstance(TextFileEditorModel, toResource.call(this, '/path/file.txt'), 'utf8'); (accessor.textFileService.models).add(model.getResource(), model); const service = accessor.textFileService; service.setConfirmResult(ConfirmResult.SAVE); + service.onConfigurationChange({ files: { hotExit: 'off' } }); model.load().done(() => { model.textEditorModel.setValue('foo'); diff --git a/src/vs/workbench/services/textmodelResolver/common/textModelResolverService.ts b/src/vs/workbench/services/textmodelResolver/common/textModelResolverService.ts index c04739698dc89376f1eef5b12d537bda87830b83..f8f999792122529d1e800ed486efb2be444be90c 100644 --- a/src/vs/workbench/services/textmodelResolver/common/textModelResolverService.ts +++ b/src/vs/workbench/services/textmodelResolver/common/textModelResolverService.ts @@ -14,9 +14,8 @@ import { IModelService } from 'vs/editor/common/services/modelService'; import { ResourceEditorModel } from 'vs/workbench/common/editor/resourceEditorModel'; import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; import network = require('vs/base/common/network'); -import { ITextModelResolverService, ITextModelContentProvider, ITextEditorModel } from 'vs/editor/common/services/resolverService'; -import { IUntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService'; -import { UntitledEditorInput } from 'vs/workbench/common/editor/untitledEditorInput'; +import { ITextModelService, ITextModelContentProvider, ITextEditorModel } from 'vs/editor/common/services/resolverService'; +import { IUntitledEditorService, UNTITLED_SCHEMA } from 'vs/workbench/services/untitled/common/untitledEditorService'; import { TextFileEditorModel } from 'vs/workbench/services/textfile/common/textFileEditorModel'; class ResourceModelCollection extends ReferenceCollection> { @@ -93,7 +92,7 @@ class ResourceModelCollection extends ReferenceCollection new ImmortalReference(model)); + if (resource.scheme === UNTITLED_SCHEMA) { + return this.untitledEditorService.loadOrCreate({ resource }).then(model => new ImmortalReference(model)); } // InMemory Schema: go through model service cache @@ -148,4 +146,4 @@ export class TextModelResolverService implements ITextModelResolverService { public registerTextModelContentProvider(scheme: string, provider: ITextModelContentProvider): IDisposable { return this.resourceModelCollection.registerTextModelContentProvider(scheme, provider); } -} \ No newline at end of file +} diff --git a/src/vs/workbench/services/textmodelResolver/test/textModelResolverService.test.ts b/src/vs/workbench/services/textmodelResolver/test/textModelResolverService.test.ts index da8d74b976b5d0ea5ade9f2bd76d54e1cdf95520..9ae8a6fd4ba2dc2e0b263bd636b1ddf667ebdb59 100644 --- a/src/vs/workbench/services/textmodelResolver/test/textModelResolverService.test.ts +++ b/src/vs/workbench/services/textmodelResolver/test/textModelResolverService.test.ts @@ -14,7 +14,7 @@ import { ResourceEditorModel } from 'vs/workbench/common/editor/resourceEditorMo import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { workbenchInstantiationService, TestTextFileService } from 'vs/workbench/test/workbenchTestServices'; import { toResource } from 'vs/base/test/common/utils'; -import { ITextModelResolverService } from 'vs/editor/common/services/resolverService'; +import { ITextModelService } from 'vs/editor/common/services/resolverService'; import { IModelService } from 'vs/editor/common/services/modelService'; import { IModeService } from 'vs/editor/common/services/modeService'; import { TextFileEditorModel } from 'vs/workbench/services/textfile/common/textFileEditorModel'; @@ -25,7 +25,7 @@ import { once } from 'vs/base/common/event'; class ServiceAccessor { constructor( - @ITextModelResolverService public textModelResolverService: ITextModelResolverService, + @ITextModelService public textModelResolverService: ITextModelService, @IModelService public modelService: IModelService, @IModeService public modeService: IModeService, @ITextFileService public textFileService: TestTextFileService, @@ -166,4 +166,4 @@ suite('Workbench - TextModelResolverService', () => { disposable.dispose(); }); -}); \ No newline at end of file +}); diff --git a/src/vs/workbench/services/themes/common/colorThemeSchema.ts b/src/vs/workbench/services/themes/common/colorThemeSchema.ts index f2773d8644b23463082f50cad0a15aa54f64bf4d..b1b3403cc842101b75029c0993b018f13af7557c 100644 --- a/src/vs/workbench/services/themes/common/colorThemeSchema.ts +++ b/src/vs/workbench/services/themes/common/colorThemeSchema.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import nls = require('vs/nls'); -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { Extensions as JSONExtensions, IJSONContributionRegistry } from 'vs/platform/jsonschemas/common/jsonContributionRegistry'; import { IJSONSchema } from 'vs/base/common/jsonSchema'; diff --git a/src/vs/workbench/services/themes/common/fileIconThemeSchema.ts b/src/vs/workbench/services/themes/common/fileIconThemeSchema.ts index a18388e9af912b178795afa8e2f2630e9307a473..8233a577d9e71343fd2b9ad43f04b182481ee61b 100644 --- a/src/vs/workbench/services/themes/common/fileIconThemeSchema.ts +++ b/src/vs/workbench/services/themes/common/fileIconThemeSchema.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import nls = require('vs/nls'); -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { Extensions as JSONExtensions, IJSONContributionRegistry } from 'vs/platform/jsonschemas/common/jsonContributionRegistry'; import { IJSONSchema } from 'vs/base/common/jsonSchema'; diff --git a/src/vs/workbench/services/themes/electron-browser/colorThemeData.ts b/src/vs/workbench/services/themes/electron-browser/colorThemeData.ts index aa101644f89b69cb2110b7dc9249fed1251a84b1..b02b08e692767d368d439dc6d6ce9e52badec244 100644 --- a/src/vs/workbench/services/themes/electron-browser/colorThemeData.ts +++ b/src/vs/workbench/services/themes/electron-browser/colorThemeData.ts @@ -18,9 +18,9 @@ import pfs = require('vs/base/node/pfs'); import { Extensions, IColorRegistry, ColorIdentifier, editorBackground, editorForeground } from 'vs/platform/theme/common/colorRegistry'; import { ThemeType } from 'vs/platform/theme/common/themeService'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { WorkbenchThemeService, IColorCustomizations } from "vs/workbench/services/themes/electron-browser/workbenchThemeService"; -import { getParseErrorMessage } from "vs/base/common/jsonErrorMessages"; +import { getParseErrorMessage } from 'vs/base/common/jsonErrorMessages'; let colorRegistry = Registry.as(Extensions.ColorContribution); @@ -131,6 +131,16 @@ export class ColorThemeData implements IColorTheme { } } +export function createUnloadedTheme(id: string): ColorThemeData { + let themeData = new ColorThemeData(); + themeData.id = id; + themeData.label = ''; + themeData.settingsId = null; + themeData.isLoaded = false; + themeData.tokenColors = [{ settings: {} }]; + return themeData; +} + export function fromStorageData(input: string): ColorThemeData { try { let data = JSON.parse(input); diff --git a/src/vs/workbench/services/themes/electron-browser/themeCompatibility.ts b/src/vs/workbench/services/themes/electron-browser/themeCompatibility.ts index 519c2797b97ad90a696ed71f413776467975fc35..eece1c5c8081a0d98f92cffc00e4f42569942904 100644 --- a/src/vs/workbench/services/themes/electron-browser/themeCompatibility.ts +++ b/src/vs/workbench/services/themes/electron-browser/themeCompatibility.ts @@ -9,9 +9,12 @@ import * as colorRegistry from 'vs/platform/theme/common/colorRegistry'; import * as editorColorRegistry from 'vs/editor/common/view/editorColorRegistry'; import * as wordHighlighter from 'vs/editor/contrib/wordHighlighter/common/wordHighlighter'; -import { ansiColorIdentifiers } from 'vs/workbench/parts/terminal/electron-browser/terminalColorRegistry'; import { peekViewEditorMatchHighlight, peekViewResultsMatchHighlight } from 'vs/editor/contrib/referenceSearch/browser/referencesWidget'; +// TODO@Martin layer breaker +// tslint:disable-next-line:import-patterns +import { ansiColorIdentifiers } from 'vs/workbench/parts/terminal/electron-browser/terminalColorRegistry'; + const settingToColorIdMapping: { [settingId: string]: string[] } = {}; function addSettingMapping(settingId: string, colorId: string) { let colorIds = settingToColorIdMapping[settingId]; @@ -50,7 +53,7 @@ export function convertSettings(oldSettings: ITokenColorizationRule[], resultRul addSettingMapping('background', colorRegistry.editorBackground); addSettingMapping('foreground', colorRegistry.editorForeground); -addSettingMapping('selection', colorRegistry.editorSelection); +addSettingMapping('selection', colorRegistry.editorSelectionBackground); addSettingMapping('inactiveSelection', colorRegistry.editorInactiveSelection); addSettingMapping('selectionHighlightColor', colorRegistry.editorSelectionHighlight); addSettingMapping('findMatchHighlight', colorRegistry.editorFindMatchHighlight); diff --git a/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.ts b/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.ts index 72ad60ffe23dd40da625acf372953003f4a0ae33..062575d13a08189a8e22f3e61ac1b09b5c2deeff 100644 --- a/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.ts +++ b/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.ts @@ -17,7 +17,7 @@ import { IWorkbenchThemeService, IColorTheme, IFileIconTheme, ExtensionData, ITh import { IWindowIPCService } from 'vs/workbench/services/window/electron-browser/windowService'; import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { IJSONSchema } from 'vs/base/common/jsonSchema'; import errors = require('vs/base/common/errors'); import { IConfigurationEditingService, ConfigurationTarget } from 'vs/workbench/services/configuration/common/configurationEditing'; @@ -27,7 +27,7 @@ import { IEnvironmentService } from 'vs/platform/environment/common/environment' import { IMessageService } from 'vs/platform/message/common/message'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import Severity from 'vs/base/common/severity'; -import { ColorThemeData, fromStorageData, fromExtensionTheme } from './colorThemeData'; +import { ColorThemeData, fromStorageData, fromExtensionTheme, createUnloadedTheme } from './colorThemeData'; import { ITheme, Extensions as ThemingExtensions, IThemingRegistry } from 'vs/platform/theme/common/themeService'; import { editorBackground } from 'vs/platform/theme/common/colorRegistry'; @@ -39,7 +39,7 @@ import pfs = require('vs/base/node/pfs'); import colorThemeSchema = require('vs/workbench/services/themes/common/colorThemeSchema'); import fileIconThemeSchema = require('vs/workbench/services/themes/common/fileIconThemeSchema'); import { IDisposable } from 'vs/base/common/lifecycle'; -import { getParseErrorMessage } from "vs/base/common/jsonErrorMessages"; +import { getParseErrorMessage } from 'vs/base/common/jsonErrorMessages'; // implementation @@ -51,6 +51,7 @@ const PERSISTED_THEME_STORAGE_KEY = 'colorThemeData'; const defaultThemeExtensionId = 'vscode-theme-defaults'; const oldDefaultThemeExtensionId = 'vscode-theme-colorful-defaults'; +const DEFAULT_ICON_THEME_SETTING_VALUE = 'vs-seti'; const fileIconsEnabledClass = 'file-icons-enabled'; const themingRegistry = Registry.as(ThemingExtensions.ThemingContribution); @@ -228,30 +229,21 @@ export class WorkbenchThemeService implements IWorkbenchThemeService { this.updateColorCustomizations(false); + // In order to avoid paint flashing for tokens, because + // themes are loaded asynchronously, we need to initialize + // a color theme document with good defaults until the theme is loaded let themeData = null; let persistedThemeData = this.storageService.get(PERSISTED_THEME_STORAGE_KEY); if (persistedThemeData) { themeData = fromStorageData(persistedThemeData); } - if (themeData !== null) { - themeData.setCustomColors(this.colorCustomizations); - this.updateDynamicCSSRules(themeData); - this.applyTheme(themeData, null, true); - } else { - // In order to avoid paint flashing for tokens, because - // themes are loaded asynchronously, we need to initialize - // a color theme document with good defaults until the theme is loaded + if (!themeData) { let isLightTheme = (Array.prototype.indexOf.call(document.body.classList, 'vs') >= 0); - - let initialTheme = new ColorThemeData(); - initialTheme.id = isLightTheme ? VS_LIGHT_THEME : VS_DARK_THEME; - initialTheme.label = ''; - initialTheme.settingsId = null; - initialTheme.isLoaded = false; - initialTheme.tokenColors = [{ settings: {} }]; - initialTheme.setCustomColors(this.colorCustomizations); - this.currentColorTheme = initialTheme; + themeData = createUnloadedTheme(isLightTheme ? VS_LIGHT_THEME : VS_DARK_THEME); } + themeData.setCustomColors(this.colorCustomizations); + this.updateDynamicCSSRules(themeData); + this.applyTheme(themeData, null, true); themesExtPoint.setHandler((extensions) => { for (let ext of extensions) { @@ -309,7 +301,7 @@ export class WorkbenchThemeService implements IWorkbenchThemeService { }); } - private migrate(): TPromise { + private migrate(): TPromise { let legacyColorThemeId = this.storageService.get('workbench.theme', StorageScope.GLOBAL, void 0); let legacyIconThemeId = this.storageService.get('workbench.iconTheme', StorageScope.GLOBAL, void 0); if (types.isUndefined(legacyColorThemeId) && types.isUndefined(legacyIconThemeId)) { @@ -343,7 +335,7 @@ export class WorkbenchThemeService implements IWorkbenchThemeService { }); } - private initialize(): TPromise { + private initialize(): TPromise { this.updateColorCustomizations(false); @@ -929,7 +921,7 @@ class ConfigurationWriter { constructor( @IConfigurationService private configurationService: IConfigurationService, @IConfigurationEditingService private configurationEditingService: IConfigurationEditingService) { } - public writeConfiguration(key: string, value: any, settingsTarget: ConfigurationTarget): TPromise { + public writeConfiguration(key: string, value: any, settingsTarget: ConfigurationTarget): TPromise { let settings = this.configurationService.lookup(key); if (settingsTarget === ConfigurationTarget.USER) { if (value === settings.user) { @@ -962,8 +954,8 @@ const colorThemeSettingSchema: IJSONSchema = { }; const iconThemeSettingSchema: IJSONSchema = { type: ['string', 'null'], - default: null, - description: nls.localize('iconTheme', "Specifies the icon theme used in the workbench."), + default: DEFAULT_ICON_THEME_SETTING_VALUE, + description: nls.localize('iconTheme', "Specifies the icon theme used in the workbench or 'null' to not show any file icons."), enum: [null], enumDescriptions: [nls.localize('noIconThemeDesc', 'No file icons')], errorMessage: nls.localize('iconThemeError', "File icon theme is unknown or not installed.") diff --git a/src/vs/workbench/services/untitled/common/untitledEditorService.ts b/src/vs/workbench/services/untitled/common/untitledEditorService.ts index e1d7d25bbe658f08ce33dc290b7e7557681f4831..89d3f6f43051b7656c530f02e5286be3ccb88ef3 100644 --- a/src/vs/workbench/services/untitled/common/untitledEditorService.ts +++ b/src/vs/workbench/services/untitled/common/untitledEditorService.ts @@ -12,9 +12,21 @@ import { IFilesConfiguration } from 'vs/platform/files/common/files'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import Event, { Emitter, once } from 'vs/base/common/event'; import { ResourceMap } from 'vs/base/common/map'; +import { TPromise } from "vs/base/common/winjs.base"; +import { UntitledEditorModel } from "vs/workbench/common/editor/untitledEditorModel"; +import { Schemas } from "vs/base/common/network"; export const IUntitledEditorService = createDecorator('untitledEditorService'); +export const UNTITLED_SCHEMA = 'untitled'; + +export interface IModelLoadOrCreateOptions { + resource?: URI; + modeId?: string; + initialValue?: string; + encoding?: string; +} + export interface IUntitledEditorService { _serviceBrand: any; @@ -40,19 +52,14 @@ export interface IUntitledEditorService { onDidDisposeModel: Event; /** - * Returns the untitled editor input matching the provided resource. + * Returns if an untitled resource with the given URI exists. */ - get(resource: URI): UntitledEditorInput; - - /** - * Returns all untitled editor inputs. - */ - getAll(resources?: URI[]): UntitledEditorInput[]; + exists(resource: URI): boolean; /** * Returns dirty untitled editors as resource URIs. */ - getDirty(): URI[]; + getDirty(resources?: URI[]): URI[]; /** * Returns true iff the provided resource is dirty. @@ -71,20 +78,39 @@ export interface IUntitledEditorService { * It is valid to pass in a file resource. In that case the path will be used as identifier. * The use case is to be able to create a new file with a specific path with VSCode. */ - createOrGet(resource?: URI, modeId?: string, initialValue?: string): UntitledEditorInput; + createOrGet(resource?: URI, modeId?: string, initialValue?: string, encoding?: string): UntitledEditorInput; + + /** + * Creates a new untitled model with the optional resource URI or returns an existing one + * if the provided resource exists already as untitled model. + * + * It is valid to pass in a file resource. In that case the path will be used as identifier. + * The use case is to be able to create a new file with a specific path with VSCode. + */ + loadOrCreate(options: IModelLoadOrCreateOptions): TPromise; /** * A check to find out if a untitled resource has a file path associated or not. */ hasAssociatedFilePath(resource: URI): boolean; + + /** + * Suggests a filename for the given untitled resource if it is known. + */ + suggestFileName(resource: URI): string; + + /** + * Get the configured encoding for the given untitled resource if any. + */ + getEncoding(resource: URI): string; } export class UntitledEditorService implements IUntitledEditorService { public _serviceBrand: any; - private static CACHE: ResourceMap = new ResourceMap(); - private static KNOWN_ASSOCIATED_FILE_PATHS: ResourceMap = new ResourceMap(); + private mapResourceToInput = new ResourceMap(); + private mapResourceToAssociatedFilePath = new ResourceMap(); private _onDidChangeContent: Emitter; private _onDidChangeDirty: Emitter; @@ -117,16 +143,20 @@ export class UntitledEditorService implements IUntitledEditorService { return this._onDidChangeEncoding.event; } - public get(resource: URI): UntitledEditorInput { - return UntitledEditorService.CACHE.get(resource); + protected get(resource: URI): UntitledEditorInput { + return this.mapResourceToInput.get(resource); } - public getAll(resources?: URI[]): UntitledEditorInput[] { + protected getAll(resources?: URI[]): UntitledEditorInput[] { if (resources) { return arrays.coalesce(resources.map(r => this.get(r))); } - return UntitledEditorService.CACHE.values(); + return this.mapResourceToInput.values(); + } + + public exists(resource: URI): boolean { + return this.mapResourceToInput.has(resource); } public revertAll(resources?: URI[], force?: boolean): URI[] { @@ -151,41 +181,54 @@ export class UntitledEditorService implements IUntitledEditorService { return input && input.isDirty(); } - public getDirty(): URI[] { - return UntitledEditorService.CACHE.values() + public getDirty(resources?: URI[]): URI[] { + let inputs: UntitledEditorInput[]; + if (resources) { + inputs = resources.map(r => this.get(r)).filter(i => !!i); + } else { + inputs = this.mapResourceToInput.values(); + } + + return inputs .filter(i => i.isDirty()) .map(i => i.getResource()); } - public createOrGet(resource?: URI, modeId?: string, initialValue?: string): UntitledEditorInput { + public loadOrCreate(options: IModelLoadOrCreateOptions = Object.create(null)): TPromise { + return this.createOrGet(options.resource, options.modeId, options.initialValue, options.encoding).resolve(); + } + + public createOrGet(resource?: URI, modeId?: string, initialValue?: string, encoding?: string): UntitledEditorInput { + + // Massage resource if it comes with a file:// scheme let hasAssociatedFilePath = false; if (resource) { - hasAssociatedFilePath = (resource.scheme === 'file'); - resource = resource.with({ scheme: UntitledEditorInput.SCHEMA }); // ensure we have the right scheme + hasAssociatedFilePath = (resource.scheme === Schemas.file); + resource = resource.with({ scheme: UNTITLED_SCHEMA }); // ensure we have the right scheme if (hasAssociatedFilePath) { - UntitledEditorService.KNOWN_ASSOCIATED_FILE_PATHS.set(resource, true); // remember for future lookups + this.mapResourceToAssociatedFilePath.set(resource, true); // remember for future lookups } } // Return existing instance if asked for it - if (resource && UntitledEditorService.CACHE.has(resource)) { - return UntitledEditorService.CACHE.get(resource); + if (resource && this.mapResourceToInput.has(resource)) { + return this.mapResourceToInput.get(resource); } // Create new otherwise - return this.doCreate(resource, hasAssociatedFilePath, modeId, initialValue); + return this.doCreate(resource, hasAssociatedFilePath, modeId, initialValue, encoding); } - private doCreate(resource?: URI, hasAssociatedFilePath?: boolean, modeId?: string, initialValue?: string): UntitledEditorInput { + private doCreate(resource?: URI, hasAssociatedFilePath?: boolean, modeId?: string, initialValue?: string, encoding?: string): UntitledEditorInput { if (!resource) { // Create new taking a resource URI that is not already taken - let counter = UntitledEditorService.CACHE.size + 1; + let counter = this.mapResourceToInput.size + 1; do { - resource = URI.from({ scheme: UntitledEditorInput.SCHEMA, path: `Untitled-${counter}` }); + resource = URI.from({ scheme: UNTITLED_SCHEMA, path: `Untitled-${counter}` }); counter++; - } while (UntitledEditorService.CACHE.has(resource)); + } while (this.mapResourceToInput.has(resource)); } // Look up default language from settings if any @@ -196,7 +239,7 @@ export class UntitledEditorService implements IUntitledEditorService { } } - const input = this.instantiationService.createInstance(UntitledEditorInput, resource, hasAssociatedFilePath, modeId, initialValue); + const input = this.instantiationService.createInstance(UntitledEditorInput, resource, hasAssociatedFilePath, modeId, initialValue, encoding); const contentListener = input.onDidModelChangeContent(() => { this._onDidChangeContent.fire(resource); @@ -217,8 +260,8 @@ export class UntitledEditorService implements IUntitledEditorService { // Remove from cache on dispose const onceDispose = once(input.onDispose); onceDispose(() => { - UntitledEditorService.CACHE.delete(input.getResource()); - UntitledEditorService.KNOWN_ASSOCIATED_FILE_PATHS.delete(input.getResource()); + this.mapResourceToInput.delete(input.getResource()); + this.mapResourceToAssociatedFilePath.delete(input.getResource()); contentListener.dispose(); dirtyListener.dispose(); encodingListener.dispose(); @@ -226,13 +269,25 @@ export class UntitledEditorService implements IUntitledEditorService { }); // Add to cache - UntitledEditorService.CACHE.set(resource, input); + this.mapResourceToInput.set(resource, input); return input; } public hasAssociatedFilePath(resource: URI): boolean { - return UntitledEditorService.KNOWN_ASSOCIATED_FILE_PATHS.has(resource); + return this.mapResourceToAssociatedFilePath.has(resource); + } + + public suggestFileName(resource: URI): string { + const input = this.get(resource); + + return input ? input.suggestFileName() : void 0; + } + + public getEncoding(resource: URI): string { + const input = this.get(resource); + + return input ? input.getEncoding() : void 0; } public dispose(): void { diff --git a/src/vs/workbench/services/viewlet/browser/viewletService.ts b/src/vs/workbench/services/viewlet/browser/viewletService.ts index c155b36e972e439a5dafda61e30cd362152e08ba..3af0a697b6fedf380fabc539e90c832a700b13bd 100644 --- a/src/vs/workbench/services/viewlet/browser/viewletService.ts +++ b/src/vs/workbench/services/viewlet/browser/viewletService.ts @@ -9,7 +9,7 @@ import { IViewlet } from 'vs/workbench/common/viewlet'; import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; import Event from 'vs/base/common/event'; import { SidebarPart } from 'vs/workbench/browser/parts/sidebar/sidebarPart'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { ViewletDescriptor, ViewletRegistry, Extensions as ViewletExtensions } from 'vs/workbench/browser/viewlet'; import { IExtensionService } from 'vs/platform/extensions/common/extensions'; import { IProgressService } from 'vs/platform/progress/common/progress'; diff --git a/src/vs/workbench/services/workspace/common/workspaceEditing.ts b/src/vs/workbench/services/workspace/common/workspaceEditing.ts new file mode 100644 index 0000000000000000000000000000000000000000..9053085527feab32e0c1f5911a40acca6cb8ca72 --- /dev/null +++ b/src/vs/workbench/services/workspace/common/workspaceEditing.ts @@ -0,0 +1,20 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +'use strict'; + +import { TPromise } from 'vs/base/common/winjs.base'; +import { createDecorator, ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation'; +import URI from "vs/base/common/uri"; + +export const IWorkspaceEditingService = createDecorator('workspaceEditingService'); + +export interface IWorkspaceEditingService { + + _serviceBrand: ServiceIdentifier; + + addRoots(roots: URI[]): TPromise; + + removeRoots(roots: URI[]): TPromise; +} \ No newline at end of file diff --git a/src/vs/workbench/services/workspace/node/workspaceEditingService.ts b/src/vs/workbench/services/workspace/node/workspaceEditingService.ts new file mode 100644 index 0000000000000000000000000000000000000000..9efa97b6fc62a9dc092240e459547ebe4375769a --- /dev/null +++ b/src/vs/workbench/services/workspace/node/workspaceEditingService.ts @@ -0,0 +1,107 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +'use strict'; + +import { IWorkspaceEditingService } from "vs/workbench/services/workspace/common/workspaceEditing"; +import URI from "vs/base/common/uri"; +import { equals, distinct } from "vs/base/common/arrays"; +import { TPromise } from "vs/base/common/winjs.base"; +import { IWorkspaceContextService } from "vs/platform/workspace/common/workspace"; +import { IConfigurationEditingService, ConfigurationTarget } from "vs/workbench/services/configuration/common/configurationEditing"; +import { IConfigurationService } from "vs/platform/configuration/common/configuration"; +import { IEnvironmentService } from "vs/platform/environment/common/environment"; + +interface IWorkspaceConfiguration { + [master: string]: { + folders: string[]; + }; +} + +const workspaceConfigKey = 'workspace'; + +export class WorkspaceEditingService implements IWorkspaceEditingService { + + public _serviceBrand: any; + + constructor( + @IConfigurationEditingService private configurationEditingService: IConfigurationEditingService, + @IConfigurationService private configurationService: IConfigurationService, + @IWorkspaceContextService private contextService: IWorkspaceContextService, + @IEnvironmentService private environmentService: IEnvironmentService + ) { + } + + private supported(): boolean { + if (!this.contextService.hasWorkspace()) { + return false; // we need a workspace to begin with + } + + // TODO@Ben multi root + return this.environmentService.appQuality !== 'stable'; // not yet enabled in stable + } + + public addRoots(rootsToAdd: URI[]): TPromise { + if (!this.supported) { + return TPromise.as(void 0); // we need a workspace to begin with + } + + const roots = this.contextService.getWorkspace2().roots; + + return this.doSetRoots([...roots, ...rootsToAdd]); + } + + public removeRoots(rootsToRemove: URI[]): TPromise { + if (!this.supported) { + return TPromise.as(void 0); // we need a workspace to begin with + } + + const roots = this.contextService.getWorkspace2().roots; + const rootsToRemoveRaw = rootsToRemove.map(root => root.toString()); + + return this.doSetRoots(roots.filter(root => rootsToRemoveRaw.indexOf(root.toString()) === -1)); + } + + private doSetRoots(newRoots: URI[]): TPromise { + const workspaceUserConfig = this.configurationService.lookup(workspaceConfigKey).user as IWorkspaceConfiguration || Object.create(null); + const master = this.contextService.getWorkspace2().roots[0]; + + const currentWorkspaceRoots = this.validateRoots(master, workspaceUserConfig[master.toString()] && workspaceUserConfig[master.toString()].folders); + const newWorkspaceRoots = this.validateRoots(master, newRoots); + + // See if there are any changes + if (equals(currentWorkspaceRoots, newWorkspaceRoots)) { + return TPromise.as(void 0); + } + + // Apply to config + if (newWorkspaceRoots.length) { + workspaceUserConfig[master.toString()] = { + folders: newWorkspaceRoots + }; + } else { + delete workspaceUserConfig[master.toString()]; + } + + return this.configurationEditingService.writeConfiguration(ConfigurationTarget.USER, { key: workspaceConfigKey, value: workspaceUserConfig }).then(() => void 0); + } + + private validateRoots(master: URI, roots: URI[]): string[] { + if (!roots) { + return []; + } + + // Prevent duplicates + const validatedRoots = distinct(roots.map(root => root.toString())); + + // Make sure we do not set the master folder as root + const masterIndex = validatedRoots.indexOf(master.toString()); + if (masterIndex >= 0) { + validatedRoots.splice(masterIndex, 1); + } + + return validatedRoots; + } +} \ No newline at end of file diff --git a/src/vs/workbench/test/browser/actionRegistry.test.ts b/src/vs/workbench/test/browser/actionRegistry.test.ts index 8fe4f7c8dd82d92b1c434d25c8f6b9b89a2516d1..47ab80aa92420adf2b82f7d6c6199cd6cf5e239b 100644 --- a/src/vs/workbench/test/browser/actionRegistry.test.ts +++ b/src/vs/workbench/test/browser/actionRegistry.test.ts @@ -6,11 +6,11 @@ 'use strict'; import * as assert from 'assert'; -import * as Platform from 'vs/platform/platform'; +import * as Platform from 'vs/platform/registry/common/platform'; import { SyncActionDescriptor } from 'vs/platform/actions/common/actions'; import { Separator } from 'vs/base/browser/ui/actionbar/actionbar'; import { Extensions, IWorkbenchActionRegistry } from 'vs/workbench/common/actionRegistry'; -import { prepareActions } from 'vs/workbench/browser/actionBarRegistry'; +import { prepareActions } from 'vs/workbench/browser/actions'; import { Action } from 'vs/base/common/actions'; diff --git a/src/vs/workbench/test/browser/editorStacksModel.test.ts b/src/vs/workbench/test/browser/editorStacksModel.test.ts index 8d96c2e5c807e03c84e9b83745305ef290e81e56..81b2ad1f95ee16a168f727ee6680cef2df712e2c 100644 --- a/src/vs/workbench/test/browser/editorStacksModel.test.ts +++ b/src/vs/workbench/test/browser/editorStacksModel.test.ts @@ -16,7 +16,7 @@ import { IConfigurationService } from 'vs/platform/configuration/common/configur import { IStorageService } from 'vs/platform/storage/common/storage'; import { ILifecycleService } from 'vs/platform/lifecycle/common/lifecycle'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { Position, Direction } from 'vs/platform/editor/common/editor'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; @@ -1764,6 +1764,24 @@ suite('Editor Stacks Model', () => { assert.equal(input1.isDisposed(), false); }); + test('Stack - Multiple Editors - Editor Not Disposed after Closing when opening Modified side (Diff Editor)', function () { + const model = create(); + + const group1 = model.openGroup('group1'); + + const input1 = input(); + const input2 = input(); + + const diffInput = new DiffEditorInput('name', 'description', input1, input2); + + group1.openEditor(diffInput, { pinned: false, active: true }); + group1.openEditor(input1, { pinned: false, active: true }); + + assert.equal(diffInput.isDisposed(), true); + assert.equal(input2.isDisposed(), true); + assert.equal(input1.isDisposed(), false); + }); + test('Stack - Multiple Editors - Editor Disposed on Close (same input, files)', function () { const model = create(); diff --git a/src/vs/workbench/test/browser/part.test.ts b/src/vs/workbench/test/browser/part.test.ts index a8a317906349343937ef198cb1ceb2f0e312011e..ab78553845bbed4b1f160a5e57d9992bccb61044 100644 --- a/src/vs/workbench/test/browser/part.test.ts +++ b/src/vs/workbench/test/browser/part.test.ts @@ -9,11 +9,10 @@ import * as assert from 'assert'; import { Build, Builder } from 'vs/base/browser/builder'; import { Part } from 'vs/workbench/browser/part'; import * as Types from 'vs/base/common/types'; -import { IWorkspaceContextService, WorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { IStorageService } from 'vs/platform/storage/common/storage'; import { StorageService, InMemoryLocalStorage } from 'vs/platform/storage/common/storageService'; +import { TestThemeService } from "vs/platform/theme/test/common/testThemeService"; import { TestWorkspace } from 'vs/platform/workspace/test/common/testWorkspace'; -import { TestThemeService } from 'vs/workbench/test/workbenchTestServices'; class MyPart extends Part { @@ -84,15 +83,13 @@ class MyPart3 extends Part { suite('Workbench Part', () => { let fixture: HTMLElement; let fixtureId = 'workbench-part-fixture'; - let context: IWorkspaceContextService; let storage: IStorageService; setup(() => { fixture = document.createElement('div'); fixture.id = fixtureId; document.body.appendChild(fixture); - context = new WorkspaceContextService(TestWorkspace); - storage = new StorageService(new InMemoryLocalStorage(), null, context); + storage = new StorageService(new InMemoryLocalStorage(), null, TestWorkspace); }); teardown(() => { diff --git a/src/vs/workbench/test/browser/parts/editor/baseEditor.test.ts b/src/vs/workbench/test/browser/parts/editor/baseEditor.test.ts index cbdc51394623903e2226d72526ab997710867b42..367222c9df81abb969be0a658a6b311307ed1b6b 100644 --- a/src/vs/workbench/test/browser/parts/editor/baseEditor.test.ts +++ b/src/vs/workbench/test/browser/parts/editor/baseEditor.test.ts @@ -10,13 +10,14 @@ import { BaseEditor, EditorDescriptor } from 'vs/workbench/browser/parts/editor/ import { EditorInput, EditorOptions, Extensions, IEditorRegistry, IEditorInputFactory } from 'vs/workbench/common/editor'; import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import * as Platform from 'vs/platform/platform'; +import * as Platform from 'vs/platform/registry/common/platform'; import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { NullTelemetryService } from 'vs/platform/telemetry/common/telemetryUtils'; import { PLAINTEXT_MODE_ID } from 'vs/editor/common/modes/modesRegistry'; -import { workbenchInstantiationService, TestThemeService } from 'vs/workbench/test/workbenchTestServices'; -import { ResourceEditorInput } from "vs/workbench/common/editor/resourceEditorInput"; +import { workbenchInstantiationService } from 'vs/workbench/test/workbenchTestServices'; +import { ResourceEditorInput } from 'vs/workbench/common/editor/resourceEditorInput'; +import { TestThemeService } from "vs/platform/theme/test/common/testThemeService"; const NullThemeService = new TestThemeService(); diff --git a/src/vs/workbench/test/browser/quickopen.test.ts b/src/vs/workbench/test/browser/quickopen.test.ts index caee483e75ece09ceba6e79c0df7787f69cf40ca..f960396bed26549a16704b56bbbc10c0a584f58c 100644 --- a/src/vs/workbench/test/browser/quickopen.test.ts +++ b/src/vs/workbench/test/browser/quickopen.test.ts @@ -10,7 +10,7 @@ import 'vs/workbench/browser/parts/editor/editor.contribution'; // make sure to import { Promise, TPromise } from 'vs/base/common/winjs.base'; import Event from 'vs/base/common/event'; import { IQuickOpenService } from 'vs/platform/quickOpen/common/quickOpen'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { QuickOpenHandlerDescriptor, IQuickOpenRegistry, Extensions as QuickOpenExtensions, QuickOpenAction } from 'vs/workbench/browser/quickopen'; export class TestQuickOpenService implements IQuickOpenService { @@ -67,7 +67,8 @@ suite('Workbench QuickOpen', () => { 'test', 'TestHandler', ',', - 'Handler' + 'Handler', + null ); registry.registerQuickOpenHandler(handler); diff --git a/src/vs/workbench/test/browser/viewlet.test.ts b/src/vs/workbench/test/browser/viewlet.test.ts index 67e3a93d89fbf94f9bd009d0fcef93c929002cb1..34888c9557520256b8913b93704c7231f4f767ee 100644 --- a/src/vs/workbench/test/browser/viewlet.test.ts +++ b/src/vs/workbench/test/browser/viewlet.test.ts @@ -6,7 +6,7 @@ 'use strict'; import * as assert from 'assert'; -import * as Platform from 'vs/platform/platform'; +import * as Platform from 'vs/platform/registry/common/platform'; import { ViewletDescriptor, Extensions } from 'vs/workbench/browser/viewlet'; import * as Types from 'vs/base/common/types'; diff --git a/src/vs/workbench/test/common/editor/editorDiffModel.test.ts b/src/vs/workbench/test/common/editor/editorDiffModel.test.ts index 2f5901c6e880fd83241a38c2e0482d00c148f821..b2e26b3ec576a94b3ee8ab8a61f49e7f80f719a8 100644 --- a/src/vs/workbench/test/common/editor/editorDiffModel.test.ts +++ b/src/vs/workbench/test/common/editor/editorDiffModel.test.ts @@ -12,26 +12,24 @@ import { TextDiffEditorModel } from 'vs/workbench/common/editor/textDiffEditorMo import { DiffEditorInput } from 'vs/workbench/common/editor/diffEditorInput'; import { IModelService } from 'vs/editor/common/services/modelService'; import { IModeService } from 'vs/editor/common/services/modeService'; -import { ResourceEditorInput } from "vs/workbench/common/editor/resourceEditorInput"; -import URI from "vs/base/common/uri"; -import { ITextModelResolverService } from "vs/editor/common/services/resolverService"; -import { ITextFileService } from "vs/workbench/services/textfile/common/textfiles"; -import { IUntitledEditorService } from "vs/workbench/services/untitled/common/untitledEditorService"; -import { TestTextFileService, workbenchInstantiationService } from "vs/workbench/test/workbenchTestServices"; +import { ResourceEditorInput } from 'vs/workbench/common/editor/resourceEditorInput'; +import URI from 'vs/base/common/uri'; +import { ITextModelService } from 'vs/editor/common/services/resolverService'; +import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; +import { TestTextFileService, workbenchInstantiationService } from 'vs/workbench/test/workbenchTestServices'; import { TPromise } from "vs/base/common/winjs.base"; -import { IModel } from "vs/editor/common/editorCommon"; -import { IInstantiationService } from "vs/platform/instantiation/common/instantiation"; +import { IModel } from 'vs/editor/common/editorCommon'; +import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; class MyEditorModel extends EditorModel { } class MyTextEditorModel extends BaseTextEditorModel { } class ServiceAccessor { constructor( - @ITextModelResolverService public textModelResolverService: ITextModelResolverService, + @ITextModelService public textModelResolverService: ITextModelService, @IModelService public modelService: IModelService, @IModeService public modeService: IModeService, - @ITextFileService public textFileService: TestTextFileService, - @IUntitledEditorService public untitledEditorService: IUntitledEditorService + @ITextFileService public textFileService: TestTextFileService ) { } } @@ -83,4 +81,4 @@ suite('Workbench - EditorModel', () => { done(); }); }); -}); \ No newline at end of file +}); diff --git a/src/vs/workbench/test/common/editor/untitledEditor.test.ts b/src/vs/workbench/test/common/editor/untitledEditor.test.ts index c02f5c19483a1c2b2f377b6f4318557b789e78ff..d7ba2043f807da6af1bcdf78e5032dfaeb76b689 100644 --- a/src/vs/workbench/test/common/editor/untitledEditor.test.ts +++ b/src/vs/workbench/test/common/editor/untitledEditor.test.ts @@ -16,10 +16,22 @@ import { workbenchInstantiationService } from 'vs/workbench/test/workbenchTestSe import { UntitledEditorModel } from 'vs/workbench/common/editor/untitledEditorModel'; import { IModeService } from 'vs/editor/common/services/modeService'; import { ModeServiceImpl } from 'vs/editor/common/services/modeServiceImpl'; +import { UntitledEditorInput } from "vs/workbench/common/editor/untitledEditorInput"; + +export class TestUntitledEditorService extends UntitledEditorService { + + public get(resource: URI): UntitledEditorInput { + return super.get(resource); + } + + public getAll(resources?: URI[]): UntitledEditorInput[] { + return super.getAll(resources); + } +} class ServiceAccessor { constructor( - @IUntitledEditorService public untitledEditorService: UntitledEditorService, + @IUntitledEditorService public untitledEditorService: TestUntitledEditorService, @IModeService public modeService: ModeServiceImpl, @IConfigurationService public testConfigurationService: TestConfigurationService) { } @@ -47,6 +59,9 @@ suite('Workbench - Untitled Editor', () => { const input1 = service.createOrGet(); assert.equal(input1, service.createOrGet(input1.getResource())); + assert.ok(service.exists(input1.getResource())); + assert.ok(!service.exists(URI.file('testing'))); + const input2 = service.createOrGet(); // get() / getAll() @@ -70,6 +85,8 @@ suite('Workbench - Untitled Editor', () => { assert.ok(service.isDirty(input2.getResource())); assert.equal(service.getDirty()[0].toString(), input2.getResource().toString()); + assert.equal(service.getDirty([input2.getResource()])[0].toString(), input2.getResource().toString()); + assert.equal(service.getDirty([input1.getResource()]).length, 0); service.revertAll(); assert.equal(service.getAll().length, 0); @@ -78,6 +95,8 @@ suite('Workbench - Untitled Editor', () => { input2.dispose(); + assert.ok(!service.exists(input2.getResource())); + done(); }); @@ -113,6 +132,48 @@ suite('Workbench - Untitled Editor', () => { }); }); + test('Untitled via loadOrCreate', function (done) { + const service = accessor.untitledEditorService; + service.loadOrCreate().then(model1 => { + model1.textEditorModel.setValue('foo bar'); + assert.ok(model1.isDirty()); + + model1.textEditorModel.setValue(''); + assert.ok(!model1.isDirty()); + + return service.loadOrCreate({ initialValue: 'Hello World' }).then(model2 => { + assert.equal(model2.getValue(), 'Hello World'); + + const input = service.createOrGet(); + + return service.loadOrCreate({ resource: input.getResource() }).then(model3 => { + assert.equal(model3.getResource().toString(), input.getResource().toString()); + + const file = URI.file(join('C:\\', '/foo/file44.txt')); + return service.loadOrCreate({ resource: file }).then(model4 => { + assert.ok(service.hasAssociatedFilePath(model4.getResource())); + assert.ok(model4.isDirty()); + + model1.dispose(); + model2.dispose(); + model3.dispose(); + model4.dispose(); + input.dispose(); + + done(); + }); + }); + }); + }); + }); + + test('Untitled suggest name', function () { + const service = accessor.untitledEditorService; + const input = service.createOrGet(); + + assert.ok(service.suggestFileName(input.getResource())); + }); + test('Untitled with associated path remains dirty when content gets empty', function (done) { const service = accessor.untitledEditorService; const file = URI.file(join('C:\\', '/foo/file.txt')); diff --git a/src/vs/workbench/test/common/memento.test.ts b/src/vs/workbench/test/common/memento.test.ts index 796ef72d8dd93f7d4fddc998b929982cdc1d32df..4c5ecf1182cfc27af53ff83839425a9f36f9fd38 100644 --- a/src/vs/workbench/test/common/memento.test.ts +++ b/src/vs/workbench/test/common/memento.test.ts @@ -6,26 +6,25 @@ 'use strict'; import * as assert from 'assert'; -import { WorkspaceContextService } from 'vs/platform/workspace/common/workspace'; + import { StorageScope } from 'vs/platform/storage/common/storage'; -import { TestWorkspace } from 'vs/platform/workspace/test/common/testWorkspace'; import { Memento, Scope } from 'vs/workbench/common/memento'; import { StorageService, InMemoryLocalStorage } from 'vs/platform/storage/common/storageService'; +import { TestWorkspace } from 'vs/platform/workspace/test/common/testWorkspace'; suite('Workbench Memento', () => { let context; let storage; setup(() => { - context = new WorkspaceContextService(TestWorkspace); - storage = new StorageService(new InMemoryLocalStorage(), null, context); + storage = new StorageService(new InMemoryLocalStorage(), null, TestWorkspace); }); test('Loading and Saving Memento with Scopes', () => { let myMemento = new Memento('memento.test'); // Global - let memento = myMemento.getMemento(storage); + let memento: any = myMemento.getMemento(storage); memento.foo = [1, 2, 3]; let globalMemento = myMemento.getMemento(storage, Scope.GLOBAL); assert.deepEqual(globalMemento, memento); @@ -80,7 +79,7 @@ suite('Workbench Memento', () => { let myMemento = new Memento('memento.test'); // Global - let memento = myMemento.getMemento(storage, context); + let memento: any = myMemento.getMemento(storage, context); memento.foo = [1, 2, 3]; // Workspace @@ -145,7 +144,7 @@ suite('Workbench Memento', () => { let myMemento2 = new Memento('memento.test'); // Global - let memento = myMemento.getMemento(storage, context); + let memento: any = myMemento.getMemento(storage, context); memento.foo = [1, 2, 3]; memento = myMemento2.getMemento(storage, context); diff --git a/src/vs/workbench/test/electron-browser/api/extHostCommands.test.ts b/src/vs/workbench/test/electron-browser/api/extHostCommands.test.ts index 447581c40b033ed6debbf93b35ed3e6e679d9d22..9e4fb57d0191c2c0313da33c50eff733219c7dfe 100644 --- a/src/vs/workbench/test/electron-browser/api/extHostCommands.test.ts +++ b/src/vs/workbench/test/electron-browser/api/extHostCommands.test.ts @@ -29,7 +29,7 @@ suite('ExtHostCommands', function () { }; const commands = new ExtHostCommands(OneGetThreadService(shape), undefined); - commands.registerCommand('foo', () => { }).dispose(); + commands.registerCommand('foo', (): any => { }).dispose(); assert.equal(lastUnregister, 'foo'); assert.equal(CommandsRegistry.getCommand('foo'), undefined); @@ -50,7 +50,7 @@ suite('ExtHostCommands', function () { }; const commands = new ExtHostCommands(OneGetThreadService(shape), undefined); - const reg = commands.registerCommand('foo', () => { }); + const reg = commands.registerCommand('foo', (): any => { }); reg.dispose(); reg.dispose(); reg.dispose(); diff --git a/src/vs/workbench/test/electron-browser/api/extHostConfiguration.test.ts b/src/vs/workbench/test/electron-browser/api/extHostConfiguration.test.ts index ff48c39246677ecb6f2ac688063ed6b119cf6e3e..04d6ba4badb6575db8036a7699f98b723b492621 100644 --- a/src/vs/workbench/test/electron-browser/api/extHostConfiguration.test.ts +++ b/src/vs/workbench/test/electron-browser/api/extHostConfiguration.test.ts @@ -6,11 +6,14 @@ 'use strict'; import * as assert from 'assert'; +import URI from 'vs/base/common/uri'; +import { ExtHostWorkspace } from 'vs/workbench/api/node/extHostWorkspace'; import { ExtHostConfiguration } from 'vs/workbench/api/node/extHostConfiguration'; import { MainThreadConfigurationShape } from 'vs/workbench/api/node/extHost.protocol'; import { TPromise } from 'vs/base/common/winjs.base'; import { ConfigurationTarget, ConfigurationEditingErrorCode, IConfigurationEditingError } from 'vs/workbench/services/configuration/common/configurationEditing'; -import { IWorkspaceConfigurationValues, IWorkspaceConfigurationValue } from 'vs/workbench/services/configuration/common/configuration'; +import { ConfigurationModel } from 'vs/platform/configuration/common/configuration'; +import { TestThreadService } from './testThreadService'; suite('ExtHostConfiguration', function () { @@ -22,25 +25,24 @@ suite('ExtHostConfiguration', function () { } }; - function createExtHostConfiguration(data: IWorkspaceConfigurationValues = Object.create(null), shape?: MainThreadConfigurationShape) { + function createExtHostConfiguration(contents: any = Object.create(null), shape?: MainThreadConfigurationShape) { if (!shape) { shape = new class extends MainThreadConfigurationShape { }; } - return new ExtHostConfiguration(shape, data); - } - - function createConfigurationValue(value: T): IWorkspaceConfigurationValue { - return { - value, - default: value, - user: undefined, - workspace: undefined - }; + return new ExtHostConfiguration(shape, new ExtHostWorkspace(new TestThreadService(), null), { + defaults: new ConfigurationModel(contents), + user: new ConfigurationModel(contents), + folders: Object.create(null) + }); } test('getConfiguration fails regression test 1.7.1 -> 1.8 #15552', function () { const extHostConfig = createExtHostConfiguration({ - ['search.exclude']: createConfigurationValue({ '**/node_modules': true }) + 'search': { + 'exclude': { + '**/node_modules': true + } + } }); assert.equal(extHostConfig.getConfiguration('search.exclude')['**/node_modules'], true); @@ -54,10 +56,14 @@ suite('ExtHostConfiguration', function () { test('has/get', function () { const all = createExtHostConfiguration({ - ['farboo.config0']: createConfigurationValue(true), - ['farboo.nested.config1']: createConfigurationValue(42), - ['farboo.nested.config2']: createConfigurationValue('Das Pferd frisst kein Reis.'), - ['farboo.config4']: createConfigurationValue('') + 'farboo': { + 'config0': true, + 'nested': { + 'config1': 42, + 'config2': 'Das Pferd frisst kein Reis.' + }, + 'config4': '' + } }); const config = all.getConfiguration('farboo'); @@ -77,11 +83,49 @@ suite('ExtHostConfiguration', function () { assert.deepEqual(config.get('nested'), { config1: 42, config2: 'Das Pferd frisst kein Reis.' }); }); + test('inspect', function () { + const workspaceUri = URI.file('foo'); + const folders = Object.create(null); + folders[workspaceUri.toString()] = new ConfigurationModel({ + 'editor': { + 'wordWrap': 'bounded' + } + }, ['editor.wordWrap']); + const testObject = new ExtHostConfiguration( + new class extends MainThreadConfigurationShape { }, + new ExtHostWorkspace(new TestThreadService(), { + 'id': 'foo', + 'roots': [URI.file('foo')], + 'name': 'foo' + }), + { + defaults: new ConfigurationModel({ + 'editor': { + 'wordWrap': 'off' + } + }, ['editor.wordWrap']), + user: new ConfigurationModel({ + 'editor': { + 'wordWrap': 'on' + } + }, ['editor.wordWrap']), + folders + } + ); + + const actual = testObject.getConfiguration().inspect('editor.wordWrap'); + assert.equal(actual.defaultValue, 'off'); + assert.equal(actual.globalValue, 'on'); + assert.equal(actual.workspaceValue, 'bounded'); + }); + test('getConfiguration vs get', function () { const all = createExtHostConfiguration({ - ['farboo.config0']: createConfigurationValue(true), - ['farboo.config4']: createConfigurationValue(38) + 'farboo': { + 'config0': true, + 'config4': 38 + } }); let config = all.getConfiguration('farboo.config0'); @@ -96,8 +140,10 @@ suite('ExtHostConfiguration', function () { test('getConfiguration vs get', function () { const all = createExtHostConfiguration({ - ['farboo.config0']: createConfigurationValue(true), - ['farboo.config4']: createConfigurationValue(38) + 'farboo': { + 'config0': true, + 'config4': 38 + } }); let config = all.getConfiguration('farboo.config0'); @@ -111,7 +157,9 @@ suite('ExtHostConfiguration', function () { test('name vs property', function () { const all = createExtHostConfiguration({ - ['farboo.get']: createConfigurationValue('get-prop') + 'farboo': { + 'get': 'get-prop' + } }); const config = all.getConfiguration('farboo'); @@ -125,8 +173,10 @@ suite('ExtHostConfiguration', function () { const shape = new RecordingShape(); const allConfig = createExtHostConfiguration({ - ['foo.bar']: createConfigurationValue(1), - ['foo.far']: createConfigurationValue(1) + 'foo': { + 'bar': 1, + 'far': 1 + } }, shape); let config = allConfig.getConfiguration('foo'); @@ -146,7 +196,9 @@ suite('ExtHostConfiguration', function () { test('update, what is #15834', function () { const shape = new RecordingShape(); const allConfig = createExtHostConfiguration({ - ['editor.formatOnSave']: createConfigurationValue(true) + 'editor': { + 'formatOnSave': true + } }, shape); allConfig.getConfiguration('editor').update('formatOnSave', { extensions: ['ts'] }); @@ -154,29 +206,6 @@ suite('ExtHostConfiguration', function () { assert.deepEqual(shape.lastArgs[2], { extensions: ['ts'] }); }); - test('bogous data, #15834', function () { - let oldLogger = console.error; - let errorLogged = false; - - // workaround until we have a proper logging story - console.error = (message, args) => { - errorLogged = true; - }; - let allConfig; - try { - const shape = new RecordingShape(); - allConfig = createExtHostConfiguration({ - ['editor.formatOnSave']: createConfigurationValue(true), - ['editor.formatOnSave.extensions']: createConfigurationValue(['ts']) - }, shape); - } finally { - console.error = oldLogger; - } - assert.ok(errorLogged); - assert.ok(allConfig.getConfiguration('').has('editor.formatOnSave')); - assert.ok(!allConfig.getConfiguration('').has('editor.formatOnSave.extensions')); - }); - test('update/error-state not OK', function () { const shape = new class extends MainThreadConfigurationShape { diff --git a/src/vs/workbench/test/electron-browser/api/extHostDocumentsAndEditors.test.ts b/src/vs/workbench/test/electron-browser/api/extHostDocumentsAndEditors.test.ts new file mode 100644 index 0000000000000000000000000000000000000000..fc14d9e5382aa105f2e5fad75d5c91b7d584f598 --- /dev/null +++ b/src/vs/workbench/test/electron-browser/api/extHostDocumentsAndEditors.test.ts @@ -0,0 +1,63 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +'use strict'; + +import * as assert from 'assert'; +import URI from 'vs/base/common/uri'; +import { ExtHostDocumentsAndEditors } from 'vs/workbench/api/node/extHostDocumentsAndEditors'; +import { TPromise } from 'vs/base/common/winjs.base'; + + +suite('ExtHostDocumentsAndEditors', () => { + + let editors: ExtHostDocumentsAndEditors; + + setup(function () { + editors = new ExtHostDocumentsAndEditors({ + _serviceBrand: undefined, + get() { return undefined; }, + set() { } + }); + }); + + test('The value of TextDocument.isClosed is incorrect when a text document is closed, #27949', () => { + + editors.$acceptDocumentsAndEditorsDelta({ + addedDocuments: [{ + EOL: '\n', + isDirty: true, + modeId: 'fooLang', + url: URI.parse('foo:bar'), + versionId: 1, + lines: [ + 'first', + 'second' + ] + }] + }); + + return new TPromise((resolve, reject) => { + + editors.onDidRemoveDocuments(e => { + try { + + for (const data of e) { + assert.equal(data.document.isClosed, true); + } + resolve(undefined); + } catch (e) { + reject(e); + } + }); + + editors.$acceptDocumentsAndEditorsDelta({ + removedDocuments: ['foo:bar'] + }); + + }); + }); + +}); diff --git a/src/vs/workbench/test/electron-browser/api/extHostLanguageFeatures.test.ts b/src/vs/workbench/test/electron-browser/api/extHostLanguageFeatures.test.ts index e34efcb9297f261d8ba1780e00548a0e9d08df82..3cfcedbac4b3be8b3e2a59fb7f3dce31c3377d9c 100644 --- a/src/vs/workbench/test/electron-browser/api/extHostLanguageFeatures.test.ts +++ b/src/vs/workbench/test/electron-browser/api/extHostLanguageFeatures.test.ts @@ -27,7 +27,7 @@ import { ExtHostDocuments } from 'vs/workbench/api/node/extHostDocuments'; import { ExtHostDocumentsAndEditors } from 'vs/workbench/api/node/extHostDocumentsAndEditors'; import { getDocumentSymbols } from 'vs/editor/contrib/quickOpen/common/quickOpen'; import { DocumentSymbolProviderRegistry, DocumentHighlightKind } from 'vs/editor/common/modes'; -import { getCodeLensData } from 'vs/editor/contrib/codelens/common/codelens'; +import { getCodeLensData } from 'vs/editor/contrib/codelens/browser/codelens'; import { getDefinitionsAtPosition, getImplementationsAtPosition, getTypeDefinitionsAtPosition } from 'vs/editor/contrib/goToDeclaration/browser/goToDeclaration'; import { getHover } from 'vs/editor/contrib/hover/common/hover'; import { getOccurrencesAtPosition } from 'vs/editor/contrib/wordHighlighter/common/wordHighlighter'; diff --git a/src/vs/workbench/test/electron-browser/api/extHostWorkspace.test.ts b/src/vs/workbench/test/electron-browser/api/extHostWorkspace.test.ts index a6aee8f4070ef773a0ca711ba3193ec732dd576d..25843062cc7472214786fb3c319386a4daceb24d 100644 --- a/src/vs/workbench/test/electron-browser/api/extHostWorkspace.test.ts +++ b/src/vs/workbench/test/electron-browser/api/extHostWorkspace.test.ts @@ -6,6 +6,7 @@ 'use strict'; import * as assert from 'assert'; +import URI from 'vs/base/common/uri'; import { ExtHostWorkspace } from 'vs/workbench/api/node/extHostWorkspace'; import { TestThreadService } from './testThreadService'; @@ -13,7 +14,7 @@ suite('ExtHostWorkspace', function () { test('asRelativePath', function () { - const ws = new ExtHostWorkspace(new TestThreadService(), '/Coding/Applications/NewsWoWBot'); + const ws = new ExtHostWorkspace(new TestThreadService(), { id: 'foo', roots: [URI.file('/Coding/Applications/NewsWoWBot')], name: 'Test' }); assert.equal(ws.getRelativePath('/Coding/Applications/NewsWoWBot/bernd/das/brot'), 'bernd/das/brot'); assert.equal(ws.getRelativePath('/Apps/DartPubCache/hosted/pub.dartlang.org/convert-2.0.1/lib/src/hex.dart'), @@ -21,17 +22,47 @@ suite('ExtHostWorkspace', function () { assert.equal(ws.getRelativePath(''), ''); assert.equal(ws.getRelativePath('/foo/bar'), '/foo/bar'); + assert.equal(ws.getRelativePath('in/out'), 'in/out'); }); test('asRelativePath, same paths, #11402', function () { const root = '/home/aeschli/workspaces/samples/docker'; const input = '/home/aeschli/workspaces/samples/docker'; - const ws = new ExtHostWorkspace(new TestThreadService(), root); + const ws = new ExtHostWorkspace(new TestThreadService(), { id: 'foo', roots: [URI.file(root)], name: 'Test' }); assert.equal(ws.getRelativePath(input), input); const input2 = '/home/aeschli/workspaces/samples/docker/a.file'; assert.equal(ws.getRelativePath(input2), 'a.file'); + }); + + test('asRelativePath, no workspace', function () { + const ws = new ExtHostWorkspace(new TestThreadService(), null); + assert.equal(ws.getRelativePath(''), ''); + assert.equal(ws.getRelativePath('/foo/bar'), '/foo/bar'); + }); + + test('asRelativePath, multiple folders', function () { + const ws = new ExtHostWorkspace(new TestThreadService(), { id: 'foo', roots: [URI.file('/Coding/One'), URI.file('/Coding/Two')], name: 'Test' }); + assert.equal(ws.getRelativePath('/Coding/One/file.txt'), 'file.txt'); + assert.equal(ws.getRelativePath('/Coding/Two/files/out.txt'), 'files/out.txt'); + assert.equal(ws.getRelativePath('/Coding/Two2/files/out.txt'), '/Coding/Two2/files/out.txt'); + }); + + test('getPath, legacy', function () { + let ws = new ExtHostWorkspace(new TestThreadService(), { id: 'foo', name: 'Test', roots: [] }); + assert.equal(ws.getPath(), undefined); + + ws = new ExtHostWorkspace(new TestThreadService(), null); + assert.equal(ws.getPath(), undefined); + + ws = new ExtHostWorkspace(new TestThreadService(), undefined); + assert.equal(ws.getPath(), undefined); + + // ws = new ExtHostWorkspace(new TestThreadService(), { id: 'foo', name: 'Test', roots: [URI.file('Folder'), URI.file('Another/Folder')] }); + // assert.equal(ws.getPath(), undefined); + ws = new ExtHostWorkspace(new TestThreadService(), { id: 'foo', name: 'Test', roots: [URI.file('/Folder')] }); + assert.equal(ws.getPath().replace(/\\/g, '/'), '/Folder'); }); }); diff --git a/src/vs/workbench/test/electron-browser/quickopen.perf.integrationTest.ts b/src/vs/workbench/test/electron-browser/quickopen.perf.integrationTest.ts index ad4fdee36f5f3c5086c1f996e125ee6d6c53df72..cbaf130bec5af1859fbf31b585def3cef7a4c1fe 100644 --- a/src/vs/workbench/test/electron-browser/quickopen.perf.integrationTest.ts +++ b/src/vs/workbench/test/electron-browser/quickopen.perf.integrationTest.ts @@ -7,7 +7,7 @@ import 'vs/workbench/parts/search/browser/search.contribution'; // load contributions import * as assert from 'assert'; -import { WorkspaceContextService, IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; +import { IWorkspaceContextService, LegacyWorkspace } from 'vs/platform/workspace/common/workspace'; import { createSyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService'; import { ISearchService } from 'vs/platform/search/common/search'; @@ -18,20 +18,19 @@ import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/edi import * as minimist from 'minimist'; import * as path from 'path'; import { QuickOpenHandler, IQuickOpenRegistry, Extensions } from 'vs/workbench/browser/quickopen'; -import { Registry } from 'vs/platform/platform'; +import { Registry } from 'vs/platform/registry/common/platform'; import { SearchService } from 'vs/workbench/services/search/node/searchService'; import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; -import { TestEnvironmentService, TestEditorService, TestEditorGroupService } from 'vs/workbench/test/workbenchTestServices'; +import { TestEnvironmentService, TestEditorService, TestEditorGroupService, TestContextService } from 'vs/workbench/test/workbenchTestServices'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import { TPromise } from 'vs/base/common/winjs.base'; import URI from 'vs/base/common/uri'; import { InstantiationService } from 'vs/platform/instantiation/common/instantiationService'; -import { SimpleConfigurationService } from 'vs/editor/browser/standalone/simpleServices'; +import { SimpleConfigurationService } from 'vs/editor/standalone/browser/simpleServices'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { ModelServiceImpl } from 'vs/editor/common/services/modelServiceImpl'; import { IModelService } from 'vs/editor/common/services/modelService'; - namespace Timer { export interface ITimerEvent { id: number; @@ -71,9 +70,9 @@ suite('QuickOpen performance (integration)', () => { const configurationService = new SimpleConfigurationService(); const instantiationService = new InstantiationService(new ServiceCollection( [ITelemetryService, telemetryService], - [IConfigurationService, new SimpleConfigurationService()], + [IConfigurationService, configurationService], [IModelService, new ModelServiceImpl(null, configurationService)], - [IWorkspaceContextService, new WorkspaceContextService({ resource: URI.file(testWorkspacePath) })], + [IWorkspaceContextService, new TestContextService(new LegacyWorkspace(URI.file(testWorkspacePath)))], [IWorkbenchEditorService, new TestEditorService()], [IEditorGroupService, new TestEditorGroupService()], [IEnvironmentService, TestEnvironmentService], diff --git a/src/vs/workbench/test/electron-browser/textsearch.perf.integrationTest.ts b/src/vs/workbench/test/electron-browser/textsearch.perf.integrationTest.ts index 861ff47567753825e910c28225d59f2ccd7b701d..ffe598e89aedbf7f92da8b3c6324e34de6517aa6 100644 --- a/src/vs/workbench/test/electron-browser/textsearch.perf.integrationTest.ts +++ b/src/vs/workbench/test/electron-browser/textsearch.perf.integrationTest.ts @@ -8,7 +8,7 @@ import 'vs/workbench/parts/search/browser/search.contribution'; // load contributions import * as assert from 'assert'; import * as fs from 'fs'; -import { WorkspaceContextService, IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; +import { IWorkspaceContextService, LegacyWorkspace } from 'vs/platform/workspace/common/workspace'; import { createSyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService'; import { ISearchService, IQueryOptions } from 'vs/platform/search/common/search'; @@ -20,12 +20,12 @@ import * as minimist from 'minimist'; import * as path from 'path'; import { SearchService } from 'vs/workbench/services/search/node/searchService'; import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; -import { TestEnvironmentService, TestEditorService, TestEditorGroupService } from 'vs/workbench/test/workbenchTestServices'; +import { TestEnvironmentService, TestEditorService, TestEditorGroupService, TestContextService } from 'vs/workbench/test/workbenchTestServices'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import { TPromise } from 'vs/base/common/winjs.base'; import URI from 'vs/base/common/uri'; import { InstantiationService } from 'vs/platform/instantiation/common/instantiationService'; -import { SimpleConfigurationService } from 'vs/editor/browser/standalone/simpleServices'; +import { SimpleConfigurationService } from 'vs/editor/standalone/browser/simpleServices'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { ModelServiceImpl } from 'vs/editor/common/services/modelServiceImpl'; import { IModelService } from 'vs/editor/common/services/modelService'; @@ -60,9 +60,9 @@ suite('TextSearch performance (integration)', () => { const configurationService = new SimpleConfigurationService(); const instantiationService = new InstantiationService(new ServiceCollection( [ITelemetryService, telemetryService], - [IConfigurationService, new SimpleConfigurationService()], + [IConfigurationService, configurationService], [IModelService, new ModelServiceImpl(null, configurationService)], - [IWorkspaceContextService, new WorkspaceContextService({ resource: URI.file(testWorkspacePath) })], + [IWorkspaceContextService, new TestContextService(new LegacyWorkspace(URI.file(testWorkspacePath)))], [IWorkbenchEditorService, new TestEditorService()], [IEditorGroupService, new TestEditorGroupService()], [IEnvironmentService, TestEnvironmentService], @@ -70,15 +70,14 @@ suite('TextSearch performance (integration)', () => { [ISearchService, createSyncDescriptor(SearchService)] )); - let queryOptions: IQueryOptions = { - folderResources: [URI.file(testWorkspacePath)], + const queryOptions: IQueryOptions = { maxResults: 2048 }; const searchModel: SearchModel = instantiationService.createInstance(SearchModel); function runSearch(): TPromise { const queryBuilder: QueryBuilder = instantiationService.createInstance(QueryBuilder); - const query = queryBuilder.text({ pattern: 'static_library(' }, queryOptions); + const query = queryBuilder.text({ pattern: 'static_library(' }, [URI.file(testWorkspacePath)], queryOptions); // Wait for the 'searchResultsFinished' event, which is fired after the search() promise is resolved const onSearchResultsFinished = event.filterEvent(telemetryService.eventLogged, e => e.name === 'searchResultsFinished'); diff --git a/src/vs/workbench/test/workbenchTestServices.ts b/src/vs/workbench/test/workbenchTestServices.ts index 899b03112be581297514e7c293785ae691d8df8d..7fc9a0f31c3aa5579738047075c948ff7ca5a75b 100644 --- a/src/vs/workbench/test/workbenchTestServices.ts +++ b/src/vs/workbench/test/workbenchTestServices.ts @@ -23,18 +23,18 @@ import { IConfigurationService } from 'vs/platform/configuration/common/configur import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; import { IPartService, Parts } from 'vs/workbench/services/part/common/partService'; import { TextModelResolverService } from 'vs/workbench/services/textmodelResolver/common/textModelResolverService'; -import { ITextModelResolverService } from 'vs/editor/common/services/resolverService'; -import { IEditorInput, IEditorOptions, Position, Direction, IEditor, IResourceInput } from 'vs/platform/editor/common/editor'; +import { ITextModelService } from 'vs/editor/common/services/resolverService'; +import { IEditorInput, IEditorOptions, Position, Direction, IEditor, IResourceInput, ITextEditorOptions } from 'vs/platform/editor/common/editor'; import { IUntitledEditorService, UntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService'; -import { IMessageService, IConfirmation } from 'vs/platform/message/common/message'; -import { IWorkspace, IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; -import { ILifecycleService, ShutdownEvent, ShutdownReason, StartupKind } from 'vs/platform/lifecycle/common/lifecycle'; +import { IChoiceService, IMessageService, IConfirmation } from 'vs/platform/message/common/message'; +import { ILegacyWorkspace, IWorkspaceContextService, IWorkspace } from 'vs/platform/workspace/common/workspace'; +import { ILifecycleService, ShutdownEvent, ShutdownReason, StartupKind, LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle'; import { EditorStacksModel } from 'vs/workbench/common/editor/editorStacksModel'; import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; import { InstantiationService } from 'vs/platform/instantiation/common/instantiationService'; import { IEditorGroupService, GroupArrangement, GroupOrientation, ITabOptions, IMoveOptions } from 'vs/workbench/services/group/common/groupService'; import { TextFileService } from 'vs/workbench/services/textfile/common/textFileService'; -import { FileOperationEvent, IFileService, IResolveContentOptions, IFileOperationResult, IFileStat, IImportResult, FileChangesEvent, IResolveFileOptions, IContent, IUpdateContentOptions, IStreamContent, isEqualOrParent } from 'vs/platform/files/common/files'; +import { FileOperationEvent, IFileService, IResolveContentOptions, IFileOperationResult, IFileStat, IImportResult, FileChangesEvent, IResolveFileOptions, IContent, IUpdateContentOptions, IStreamContent } from 'vs/platform/files/common/files'; import { IModelService } from 'vs/editor/common/services/modelService'; import { ModeServiceImpl } from 'vs/editor/common/services/modeServiceImpl'; import { ModelServiceImpl } from 'vs/editor/common/services/modelServiceImpl'; @@ -50,9 +50,10 @@ import { IWindowsService, IWindowService } from 'vs/platform/windows/common/wind import { TestWorkspace } from 'vs/platform/workspace/test/common/testWorkspace'; import { RawTextSource, IRawTextSource } from 'vs/editor/common/model/textSource'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { IThemeService, ITheme, DARK } from 'vs/platform/theme/common/themeService'; -import { Color } from 'vs/base/common/color'; +import { IThemeService } from 'vs/platform/theme/common/themeService'; import { isLinux } from 'vs/base/common/platform'; +import { generateUuid } from "vs/base/common/uuid"; +import { TestThemeService } from "vs/platform/theme/test/common/testThemeService"; export function createFileInput(instantiationService: IInstantiationService, resource: URI): FileEditorInput { return instantiationService.createInstance(FileEditorInput, resource, void 0); @@ -63,22 +64,43 @@ export const TestEnvironmentService = new EnvironmentService(parseArgs(process.a export class TestContextService implements IWorkspaceContextService { public _serviceBrand: any; - private workspace: any; + private workspace: IWorkspace; + private id: string; private options: any; + private _onDidChangeWorkspaceRoots: Emitter; + constructor(workspace: any = TestWorkspace, options: any = null) { this.workspace = workspace; + this.id = generateUuid(); this.options = options || Object.create(null); + this._onDidChangeWorkspaceRoots = new Emitter(); + } + + public get onDidChangeWorkspaceRoots(): Event { + return this._onDidChangeWorkspaceRoots.event; + } + + public getFolders(): URI[] { + return this.workspace ? this.workspace.roots : []; } public hasWorkspace(): boolean { return !!this.workspace; } - public getWorkspace(): IWorkspace { + public getWorkspace(): ILegacyWorkspace { + return this.workspace ? { resource: this.workspace.roots[0] } : void 0; + } + + public getWorkspace2(): IWorkspace { return this.workspace; } + public getRoot(resource: URI): URI { + return this.isInsideWorkspace(resource) ? this.workspace.roots[0] : null; + } + public setWorkspace(workspace: any): void { this.workspace = workspace; } @@ -93,7 +115,7 @@ export class TestContextService implements IWorkspaceContextService { public isInsideWorkspace(resource: URI): boolean { if (resource && this.workspace) { - return isEqualOrParent(resource.fsPath, this.workspace.resource.fsPath, !isLinux /* ignorecase */); + return paths.isEqualOrParent(resource.fsPath, this.workspace.roots[0].fsPath, !isLinux /* ignorecase */); } return false; @@ -135,9 +157,9 @@ export class TestTextFileService extends TextFileService { @IMessageService messageService: IMessageService, @IBackupFileService backupFileService: IBackupFileService, @IWindowsService windowsService: IWindowsService, - @IEditorGroupService editorGroupService: IEditorGroupService + @IHistoryService historyService: IHistoryService ) { - super(lifecycleService, contextService, configurationService, telemetryService, fileService, untitledEditorService, instantiationService, messageService, TestEnvironmentService, backupFileService, editorGroupService, windowsService); + super(lifecycleService, contextService, configurationService, telemetryService, fileService, untitledEditorService, instantiationService, messageService, TestEnvironmentService, backupFileService, windowsService, historyService); } public setPromptPath(path: string): void { @@ -202,8 +224,7 @@ export function workbenchInstantiationService(): IInstantiationService { instantiationService.stub(IPartService, new TestPartService()); instantiationService.stub(IEditorGroupService, new TestEditorGroupService()); instantiationService.stub(IModeService, ModeServiceImpl); - instantiationService.stub(IHistoryService, {}); - instantiationService.stub(IHistoryService, 'getHistory', []); + instantiationService.stub(IHistoryService, new TestHistoryService()); instantiationService.stub(IModelService, instantiationService.createInstance(ModelServiceImpl)); instantiationService.stub(IFileService, new TestFileService()); instantiationService.stub(IBackupFileService, new TestBackupFileService()); @@ -212,13 +233,52 @@ export function workbenchInstantiationService(): IInstantiationService { instantiationService.stub(IUntitledEditorService, instantiationService.createInstance(UntitledEditorService)); instantiationService.stub(IWindowsService, new TestWindowsService()); instantiationService.stub(ITextFileService, instantiationService.createInstance(TestTextFileService)); - instantiationService.stub(ITextModelResolverService, instantiationService.createInstance(TextModelResolverService)); + instantiationService.stub(ITextModelService, instantiationService.createInstance(TextModelResolverService)); instantiationService.stub(IEnvironmentService, TestEnvironmentService); instantiationService.stub(IThemeService, new TestThemeService()); + instantiationService.stub(IChoiceService, { + choose: (severity, message, options, cancelId): TPromise => { + return TPromise.as(cancelId); + } + }); return instantiationService; } +export class TestHistoryService implements IHistoryService { + + public _serviceBrand: any; + + constructor(private root?: URI) { + } + + public reopenLastClosedEditor(): void { + } + + public add(input: IEditorInput, options?: ITextEditorOptions): void { + } + + public forward(acrossEditors?: boolean): void { + } + + public back(acrossEditors?: boolean): void { + } + + public remove(input: IEditorInput | IResourceInput): void { + } + + public clear(): void { + } + + public getHistory(): (IEditorInput | IResourceInput)[] { + return []; + } + + public getLastActiveWorkspaceRoot(): URI { + return this.root; + } +} + export class TestMessageService implements IMessageService { public _serviceBrand: any; @@ -342,7 +402,7 @@ export class TestStorageService extends EventEmitter implements IStorageService super(); let context = new TestContextService(); - this.storage = new StorageService(new InMemoryLocalStorage(), null, context); + this.storage = new StorageService(new InMemoryLocalStorage(), null, context.getWorkspace2()); } store(key: string, value: any, scope: StorageScope = StorageScope.GLOBAL): void { @@ -507,7 +567,7 @@ export class TestEditorService implements IWorkbenchEditorService { return TPromise.as([]); } - public closeEditors(position: Position, except?: IEditorInput, direction?: Direction): TPromise { + public closeEditors(position: Position, filter?: { except?: IEditorInput, direction?: Direction, unmodifiedOnly?: boolean }): TPromise { return TPromise.as(null); } @@ -610,6 +670,10 @@ export class TestFileService implements IFileService { }); } + resolveFiles(toResolve: { resource: URI, options?: IResolveFileOptions }[]): TPromise { + return TPromise.join(toResolve.map(resourceAndOption => this.resolveFile(resourceAndOption.resource, resourceAndOption.options))); + } + existsFile(resource: URI): TPromise { return TPromise.as(null); } @@ -717,6 +781,8 @@ export class TestFileService implements IFileService { export class TestBackupFileService implements IBackupFileService { public _serviceBrand: any; + public backupEnabled: boolean; + public hasBackups(): TPromise { return TPromise.as(false); } @@ -780,18 +846,22 @@ export class TestWindowService implements IWindowService { return 0; } - openFileFolderPicker(forceNewWindow?: boolean): TPromise { + pickFileFolderAndOpen(forceNewWindow?: boolean): TPromise { return TPromise.as(void 0); } - openFilePicker(forceNewWindow?: boolean, path?: string): TPromise { + pickFileAndOpen(forceNewWindow?: boolean, path?: string): TPromise { return TPromise.as(void 0); } - openFolderPicker(forceNewWindow?: boolean): TPromise { + pickFolderAndOpen(forceNewWindow?: boolean): TPromise { return TPromise.as(void 0); } + pickFolder(options?: { buttonLabel: string; title: string; }): TPromise { + return TPromise.as([]); + } + reloadWindow(): TPromise { return TPromise.as(void 0); } @@ -847,20 +917,23 @@ export class TestWindowService implements IWindowService { unmaximizeWindow(): TPromise { return TPromise.as(void 0); } + + onWindowTitleDoubleClick(): TPromise { + return TPromise.as(void 0); + } } export class TestLifecycleService implements ILifecycleService { public _serviceBrand: any; - public willShutdown: boolean; + public phase: LifecyclePhase; public startupKind: StartupKind; + private _onDidChangePhase = new Emitter(); private _onWillShutdown = new Emitter(); private _onShutdown = new Emitter(); - constructor() { - } public fireShutdown(reason = ShutdownReason.QUIT): void { this._onShutdown.fire(reason); @@ -870,6 +943,10 @@ export class TestLifecycleService implements ILifecycleService { this._onWillShutdown.fire(event); } + public get onDidChangePhase(): Event { + return this._onDidChangePhase.event; + } + public get onWillShutdown(): Event { return this._onWillShutdown.event; } @@ -892,96 +969,133 @@ export class TestWindowsService implements IWindowsService { return TPromise.as(false); } - openFileFolderPicker(windowId: number, forceNewWindow?: boolean): TPromise { + pickFileFolderAndOpen(windowId: number, forceNewWindow?: boolean): TPromise { return TPromise.as(void 0); } - openFilePicker(windowId: number, forceNewWindow?: boolean, path?: string): TPromise { + + pickFileAndOpen(windowId: number, forceNewWindow?: boolean, path?: string): TPromise { return TPromise.as(void 0); } - openFolderPicker(windowId: number, forceNewWindow?: boolean): TPromise { + + pickFolderAndOpen(windowId: number, forceNewWindow?: boolean): TPromise { return TPromise.as(void 0); } + + pickFolder(options?: { buttonLabel: string; title: string; }): TPromise { + return TPromise.as([]); + } + reloadWindow(windowId: number): TPromise { return TPromise.as(void 0); } + openDevTools(windowId: number): TPromise { return TPromise.as(void 0); } + toggleDevTools(windowId: number): TPromise { return TPromise.as(void 0); } + // TODO@joao: rename, shouldn't this be closeWindow? closeFolder(windowId: number): TPromise { return TPromise.as(void 0); } + toggleFullScreen(windowId: number): TPromise { return TPromise.as(void 0); } + setRepresentedFilename(windowId: number, fileName: string): TPromise { return TPromise.as(void 0); } + addToRecentlyOpen(paths: { path: string, isFile?: boolean }[]): TPromise { return TPromise.as(void 0); } + removeFromRecentlyOpen(paths: string[]): TPromise { return TPromise.as(void 0); } + clearRecentPathsList(): TPromise { return TPromise.as(void 0); } + getRecentlyOpen(windowId: number): TPromise<{ files: string[]; folders: string[]; }> { return TPromise.as(void 0); } + focusWindow(windowId: number): TPromise { return TPromise.as(void 0); } + isMaximized(windowId: number): TPromise { return TPromise.as(void 0); } + maximizeWindow(windowId: number): TPromise { return TPromise.as(void 0); } + unmaximizeWindow(windowId: number): TPromise { return TPromise.as(void 0); } + + onWindowTitleDoubleClick(windowId: number): TPromise { + return TPromise.as(void 0); + } + setDocumentEdited(windowId: number, flag: boolean): TPromise { return TPromise.as(void 0); } + quit(): TPromise { return TPromise.as(void 0); } + relaunch(options: { addArgs?: string[], removeArgs?: string[] }): TPromise { return TPromise.as(void 0); } + whenSharedProcessReady(): TPromise { return TPromise.as(void 0); } + toggleSharedProcess(): TPromise { return TPromise.as(void 0); } + // Global methods openWindow(paths: string[], options?: { forceNewWindow?: boolean, forceReuseWindow?: boolean }): TPromise { return TPromise.as(void 0); } + openNewWindow(): TPromise { return TPromise.as(void 0); } + showWindow(windowId: number): TPromise { return TPromise.as(void 0); } + getWindows(): TPromise<{ id: number; path: string; title: string; }[]> { return TPromise.as(void 0); } + getWindowCount(): TPromise { return TPromise.as(this.windowCount); } + log(severity: string, ...messages: string[]): TPromise { return TPromise.as(void 0); } + // TODO@joao: what? - closeExtensionHostWindow(extensionDevelopmentPath: string): TPromise { + closeExtensionHostWindow(extensionDevelopmentPaths: string[]): TPromise { return TPromise.as(void 0); } + showItemInFolder(path: string): TPromise { return TPromise.as(void 0); } @@ -998,48 +1112,3 @@ export class TestWindowsService implements IWindowsService { } } -export class TestTheme implements ITheme { - - constructor(private colors: { [id: string]: string; } = {}, public type = DARK) { - } - - getColor(color: string, useDefault?: boolean): Color { - let value = this.colors[color]; - if (value) { - return Color.fromHex(value); - } - return void 0; - } - - defines(color: string): boolean { - throw new Error('Method not implemented.'); - } -} - -export class TestThemeService implements IThemeService { - - _serviceBrand: any; - _theme: ITheme; - _onThemeChange = new Emitter(); - - constructor(theme = new TestTheme()) { - this._theme = theme; - } - - getTheme(): ITheme { - return this._theme; - } - - setTheme(theme: ITheme) { - this._theme = theme; - this.fireThemeChange(); - } - - fireThemeChange() { - this._onThemeChange.fire(this._theme); - } - - public get onThemeChange(): Event { - return this._onThemeChange.event; - } -} diff --git a/test/electron/renderer.js b/test/electron/renderer.js index 2142403485169a47efd8f24cf28c62f6fc1331c7..93fb1472aa9b2c48cf45d23f0fe61876298dc61d 100644 --- a/test/electron/renderer.js +++ b/test/electron/renderer.js @@ -243,11 +243,19 @@ function runTests(opts) { mocha.reporter(IPCReporter); } - mocha.run(() => { + const runner = mocha.run(() => { createCoverageReport(opts).then(() => { ipcRenderer.send('all done'); }); }); + + if (opts.debug) { + runner.on('fail', (test, err) => { + + console.error(test.fullTitle()); + console.error(err.stack); + }); + } }); } diff --git a/test/smoke/.gitignore b/test/smoke/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..532798d3ea949506d37a5e0e8b864705758a008c --- /dev/null +++ b/test/smoke/.gitignore @@ -0,0 +1,7 @@ +.DS_Store +npm-debug.log +Thumbs.db +node_modules/ +out/ +keybindings.*.json +test_data/ \ No newline at end of file diff --git a/test/smoke/README.md b/test/smoke/README.md new file mode 100644 index 0000000000000000000000000000000000000000..1c9df539b8e401410b339a445c8d28f00f04cb71 --- /dev/null +++ b/test/smoke/README.md @@ -0,0 +1,42 @@ +# VS Code Smoke Testing +The following command is used to run the tests: `npm test -- --latest "path/to/binary"`. + +If you want to include 'Data Migration' area tests use `npm test -- --latest path/to/binary --stable path/to/currentStable` respectively. + +# Architecture +* `main.js` is used to prepare all smoke test dependencies (fetching key bindings and 'Express' repository, running `npm install` there). +* `mocha-runner.js` launches Mocha programmatically. It is spawned in Node environment from main.js to ensure that it is possible to listen on `stderr`s (primary `process.stderr` is not readable otherwise). This is accomplished because WebDriverIO command deprecation warnings need to be redirected to a separate log. Those warnings are coming from WebDriverIO because ChromeDriver has not migrated from JsonWire to W3C WebDriver protocol. +* `test.ts` contains the main smoke test suite calling the tests that are bundled in areas and defined in `./tests/`. It includes all tests separated into mocha `describe()` groups that represent each of the areas of [Smoke Test document](https://github.com/Microsoft/vscode/wiki/Smoke-Test). + +* `./areas/` folder contains a `.ts` file per each area of the document. E.g. `'Search'` area goes under `'search.ts'`. Every area file contains a list of methods with the name that represents the action that can be performed in the corresponding test. This reduces the amount of test suite code and means that if the UI changes, the fix need only be applied in one place. The name of the method reflects the action the tester would do if he would perform the test manually. See [Selenium Page Objects Wiki](https://github.com/SeleniumHQ/selenium/wiki/PageObjects) and [Selenium Bot Style Tests Wiki](https://github.com/SeleniumHQ/selenium/wiki/Bot-Style-Tests) for a good explanation of the implementation. Every smoke test area contains methods that are used in a bot-style approach in `main.ts`. +* `./spectron/` wraps the Spectron, with WebDriverIO API wrapped in `client.ts` and instance of Spectron Application is wrapped in `application.ts`. + +* `./test_data/` folder contains temporary data used by smoke test (cloned express repository, temporary user-data-dir/extensions-dir). +* `./test_data/screenshots` has action screenshots captured by a smoke test when performing actions during runtime. Screenshots are split in folders per each test. + +# Adding new area +To contribute a new smoke test area, add `${area}.ts` file under `./areas/`. All related tests to the area should go to the alike named file under `./tests/${area}.ts`. This has to follow the bot-style approach described in the links mentioned above. Methods should be calling WebDriverIO API through `SpectronClient` class. If there is no existing WebDriverIO method, add it to the class. + +# Adding new test +To add new test, `./test/${area}.ts` should be updated. The same instruction-style principle needs to be followed with the called area method names that reflect manual tester's actions. + +# Debugging +1. Add the following configuration to launch.json, specifying binaries in `args`: +```json +{ + "type": "node", + "request": "launch", + "name": "Launch Smoke Test", + "program": "${workspaceRoot}/test/smoke/src/main.js", + "cwd": "${workspaceRoot}/test/smoke", + "port": 9999, + "args": [ + "-l", + "path/to/Code.exe" + ], + "outFiles": [ + "${cwd}/out/**/*.js" + ] +}, +``` +2. In main.js add `--debug-brk=9999` argument to the place where `src/mocha-runner.js` is spawned. diff --git a/test/smoke/package.json b/test/smoke/package.json new file mode 100644 index 0000000000000000000000000000000000000000..c8b869205d46269ab3cc3534ed0c7e686e09db46 --- /dev/null +++ b/test/smoke/package.json @@ -0,0 +1,26 @@ +{ + "name": "code-oss-dev-smoke-test", + "version": "0.1.0", + "main": "./src/main.js", + "scripts": { + "compile": "tsc", + "pretest": "tsc", + "test": "node src/main.js" + }, + "devDependencies": { + "@types/mocha": "^2.2.41", + "@types/node": "^6.0.70", + "@types/webdriverio": "^4.6.1", + "@types/electron": "~1.4.37", + "@types/rimraf": "^0.0.28", + "@types/htmlparser2": "^3.7.29", + "mocha": "^3.2.0", + "spectron": "~3.6.4", + "typescript": "^2.2.2", + "rimraf": "^2.6.1", + "commander": "^2.9.0", + "simple-git": "^1.73.0", + "strip-json-comments": "^2.0.1", + "htmlparser2": "^3.9.2" + } +} diff --git a/test/smoke/src/areas/common.ts b/test/smoke/src/areas/common.ts new file mode 100644 index 0000000000000000000000000000000000000000..26ab79be52979f76887def90e733a31c4aa30ee3 --- /dev/null +++ b/test/smoke/src/areas/common.ts @@ -0,0 +1,179 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { SpectronApplication } from "../spectron/application"; +import { Util } from '../helpers/utilities'; + +/** + * Contains methods that are commonly used across test areas. + */ +export class CommonActions { + private util: Util; + + constructor(private spectron: SpectronApplication) { + this.util = new Util(); + } + + public async getWindowTitle(): Promise { + return this.spectron.client.getTitle(); + } + + public enter(): Promise { + return this.spectron.client.keys(['Enter', 'NULL']); + } + + public async addSetting(setting: string, value: string): Promise { + await this.spectron.command('workbench.action.openGlobalSettings'); + await this.spectron.wait(); + try { + await this.spectron.client.leftClick('.editable-preferences-editor-container .view-lines', 1, 1, false); + } catch (e) { + return Promise.reject('Failed to select settings editor to add a setting.'); + } + await this.spectron.client.keys(['ArrowDown', 'NULL', 'ArrowDown', 'NULL'], false); + await this.spectron.wait(); + await this.spectron.client.keys(`"${setting}": "${value}"`); + await this.spectron.wait(); + return this.saveOpenedFile(); + } + + public async newUntitledFile(): Promise { + await this.spectron.command('workbench.action.files.newUntitledFile'); + return this.spectron.wait(); + } + + public closeTab(): Promise { + return this.spectron.client.keys(['Control', 'w', 'NULL']); + } + + public async getTab(tabName: string, active?: boolean): Promise { + await this.closeCurrentNotification(); // close any notification messages that could overlap tabs + + let tabSelector = active ? '.tab.active' : 'div'; + let el = await this.spectron.client.element(`.tabs-container ${tabSelector}[aria-label="${tabName}, tab"]`); + if (el.status === 0) { + return el; + } + + return undefined; + } + + public async selectTab(tabName: string): Promise { + await this.closeCurrentNotification(); // close any notification messages that could overlap tabs + return this.spectron.client.click(`.tabs-container div[aria-label="${tabName}, tab"]`); + } + + public async openFirstMatchFile(fileName: string): Promise { + await this.openQuickOpen(); + await this.type(fileName); + await this.spectron.wait(); + await this.enter(); + return this.spectron.wait(); + } + + public saveOpenedFile(): Promise { + return this.spectron.command('workbench.action.files.save'); + } + + public type(text: string): Promise { + let spectron = this.spectron; + + return new Promise(function (res) { + let textSplit = text.split(' '); + + async function type(i: number) { + if (!textSplit[i] || textSplit[i].length <= 0) { + return res(); + } + + const toType = textSplit[i + 1] ? `${textSplit[i]} ` : textSplit[i]; + await spectron.client.keys(toType, false); + await spectron.client.keys(['NULL']); + await type(i + 1); + } + + return type(0); + }); + } + + public showCommands(): Promise { + return this.spectron.command('workbench.action.showCommands'); + } + + public openQuickOpen(): Promise { + return this.spectron.command('workbench.action.quickOpen'); + } + + public closeQuickOpen(): Promise { + return this.spectron.command('workbench.action.closeQuickOpen'); + } + + public selectNextQuickOpenElement(): Promise { + return this.spectron.client.keys(['ArrowDown', 'NULL']); + } + + public async getQuickOpenElements(): Promise { + const elements = await this.spectron.waitFor(this.spectron.client.elements, 'div[aria-label="Quick Picker"] .monaco-tree-rows.show-twisties .monaco-tree-row'); + return elements.value.length; + } + + public async openFile(fileName: string, explorer?: boolean): Promise { + let selector = `div[class="monaco-icon-label file-icon ${fileName}-name-file-icon ${this.getExtensionSelector(fileName)}`; + if (explorer) { + selector += ' explorer-item'; + } + selector += '"]'; + + try { + await this.spectron.waitFor(this.spectron.client.doubleClick, selector); + } catch (e) { + return Promise.reject(`Cannot fine ${fileName} in a viewlet.`); + } + + return this.spectron.wait(); + } + + public getExtensionSelector(fileName: string): string { + const extension = fileName.split('.')[1]; + if (extension === 'js') { + return 'js-ext-file-icon javascript-lang-file-icon'; + } else if (extension === 'json') { + return 'json-ext-file-icon json-lang-file-icon'; + } else if (extension === 'md') { + return 'md-ext-file-icon markdown-lang-file-icon'; + } + + throw new Error('No class defined for this file extension'); + } + + public async getEditorFirstLinePlainText(): Promise { + try { + const span = await this.spectron.client.getText('.view-lines span span'); + if (Array.isArray(span)) { + return span[0]; + } + + return span; + } catch (e) { + return undefined; + } + } + + public removeFile(filePath: string): void { + this.util.removeFile(filePath); + } + + public removeDirectory(directory: string): Promise { + try { + return this.util.rimraf(directory); + } catch (e) { + throw new Error(`Failed to remove ${directory} with an error: ${e}`); + } + } + + private closeCurrentNotification(): Promise { + return this.spectron.command('workbench.action.closeMessages'); + } +} \ No newline at end of file diff --git a/test/smoke/src/areas/configuration-views.ts b/test/smoke/src/areas/configuration-views.ts new file mode 100644 index 0000000000000000000000000000000000000000..b1bd33e62173dcd05d20a46c41c3b207918ea168 --- /dev/null +++ b/test/smoke/src/areas/configuration-views.ts @@ -0,0 +1,64 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { SpectronApplication } from '../spectron/application'; + +export enum ActivityBarPosition { + LEFT = 0, + RIGHT = 1 +}; + +export class ConfigurationView { + // Stores key binding defined for the toggle of activity bar position + private keybinding: string[]; + + constructor(private spectron: SpectronApplication) { + // noop + } + + public async getEditorLineNumbers(): Promise { + const lineNumbers = await this.spectron.client.elements('.line-numbers'); + + return lineNumbers.value.length; + } + + public enterKeybindingsView(): any { + return this.spectron.command('workbench.action.openGlobalKeybindings'); + } + + public selectFirstKeybindingsMatch(): any { + return this.spectron.waitFor(this.spectron.client.click, 'div[aria-label="Keybindings"] .monaco-list-row.keybinding-item'); + } + + public changeKeybinding(): any { + return this.spectron.command('editor.action.defineKeybinding'); + } + + public enterBinding(keys: string[]): any { + this.keybinding = keys; + return this.spectron.client.keys(keys); + } + + public toggleActivityBarPosition(): any { + return this.spectron.client.keys(this.keybinding); + } + + public async getActivityBar(position: ActivityBarPosition) { + let positionClass: string; + + if (position === ActivityBarPosition.LEFT) { + positionClass = 'left'; + } else if (position === ActivityBarPosition.RIGHT) { + positionClass = 'right'; + } else { + throw new Error('No such position for activity bar defined.'); + } + try { + return await this.spectron.waitFor(this.spectron.client.getHTML, `.part.activitybar.${positionClass}`); + } catch (e) { + return undefined; + }; + } +} \ No newline at end of file diff --git a/test/smoke/src/areas/css.ts b/test/smoke/src/areas/css.ts new file mode 100644 index 0000000000000000000000000000000000000000..3388ab4e465ffca2621eed93fdafbdeebf7101dd --- /dev/null +++ b/test/smoke/src/areas/css.ts @@ -0,0 +1,62 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { SpectronApplication } from '../spectron/application'; + +export enum CSSProblem { + WARNING = 0, + ERROR = 1 +}; + +export class CSS { + + constructor(private spectron: SpectronApplication) { + // noop + } + + public openQuickOutline(): any { + return this.spectron.command('workbench.action.gotoSymbol'); + } + + public toggleProblemsView(): any { + return this.spectron.command('workbench.actions.view.problems'); + } + + public async getEditorProblem(problemType: CSSProblem): Promise { + let selector; + if (problemType === CSSProblem.WARNING) { + selector = 'greensquiggly'; + } else if (problemType === CSSProblem.ERROR) { + selector = 'redsquiggly'; + } else { + throw new Error('No such problem type defined.'); + } + + let el = await this.spectron.client.element(`.view-overlays .cdr.${selector}`); + if (el.status === 0) { + return el; + } + + return undefined; + } + + public async getProblemsViewsProblem(problemType: CSSProblem): Promise { + let selector; + if (problemType === CSSProblem.WARNING) { + selector = 'warning'; + } else if (problemType === CSSProblem.ERROR) { + selector = 'error'; + } else { + throw new Error('No such problem type defined.'); + } + + let el = await this.spectron.client.element(`div[aria-label="Problems grouped by files"] .icon.${selector}`); + if (el.status === 0) { + return el; + } + + return undefined; + } +} \ No newline at end of file diff --git a/test/smoke/src/areas/data-loss.ts b/test/smoke/src/areas/data-loss.ts new file mode 100644 index 0000000000000000000000000000000000000000..dc1ecf93730e4ab8072e79048c88ab5bffdc4d09 --- /dev/null +++ b/test/smoke/src/areas/data-loss.ts @@ -0,0 +1,26 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { SpectronApplication } from "../spectron/application"; + +export class DataLoss { + + constructor(private spectron: SpectronApplication) { + } + + public openExplorerViewlet(): Promise { + return this.spectron.command('workbench.view.explorer'); + } + + public async verifyTabIsDirty(tabName: string, active?: boolean): Promise { + let activeSelector = active ? '.active' : ''; + let el = await this.spectron.client.element(`.tabs-container .tab.dirty${activeSelector}[aria-label="${tabName}, tab"]`); + if (el.status === 0) { + return el; + } + + return undefined; + } +} \ No newline at end of file diff --git a/test/smoke/src/areas/extensions.ts b/test/smoke/src/areas/extensions.ts new file mode 100644 index 0000000000000000000000000000000000000000..ce42300f78ded38ce50b8b8e450dafd45ad816b0 --- /dev/null +++ b/test/smoke/src/areas/extensions.ts @@ -0,0 +1,112 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { SpectronApplication } from '../spectron/application'; +import { CommonActions } from "./common"; + +var htmlparser = require('htmlparser2'); + +export class Extensions { + + private readonly extensionsViewletSelector = 'div[id="workbench.view.extensions"]'; + private viewletExtensionIndex: number; + + constructor(private spectron: SpectronApplication, private common: CommonActions) { + } + + public async openExtensionsViewlet(): Promise { + await this.spectron.command('workbench.view.extensions'); + return this.spectron.wait(); + } + + public async searchForExtension(name: string): Promise { + const searchBoxSelector = `${this.extensionsViewletSelector} .search-box`; + + await this.spectron.client.clearElement(searchBoxSelector); + try { + await this.spectron.client.click(searchBoxSelector, false); + } catch (e) { + return Promise.reject('Failed to click on search box in extensions viewlet.'); + } + await this.spectron.client.keys(name); + + return this.spectron.client.keys(['NULL', 'Enter', 'NULL']); + } + + public async installExtension(name: string): Promise { + const extensionListSelector = `${this.extensionsViewletSelector} .monaco-list-rows`; + this.viewletExtensionIndex = await this.getExtensionIndex(name, extensionListSelector); + + try { + return this.spectron.client.click(`${extensionListSelector}>:nth-child(${this.viewletExtensionIndex}) .extension .extension-action.install`); + } catch (e) { + return Promise.reject('Failed to click on install button for selected extension.'); + } + } + + public getExtensionReloadText(): Promise { + try { + return this.spectron.waitFor(this.spectron.client.getText, `${this.extensionsViewletSelector} .monaco-list-rows>:nth-child(${this.viewletExtensionIndex}) .extension .extension-action.reload`); + } catch (e) { + return Promise.reject('Reload was not prompted for an installed extension.'); + } + } + + public async selectMinimalIconsTheme(): Promise { + await this.common.showCommands(); + await this.common.type('File Icon Theme'); + await this.spectron.wait(); + await this.common.enter(); + return this.spectron.client.keys(['ArrowDown', 'NULL', 'Enter', 'NULL']); + } + + public async verifyFolderIconAppearance(): Promise { + try { + return this.spectron.waitFor(this.spectron.client.getHTML, 'style[class="contributedIconTheme"]'); + } catch (e) { + return Promise.reject('Failed to validate extension contribution.'); + } + } + + private getExtensionIndex(name: string, extensionListSelector: string): Promise { + return new Promise(async (res, rej) => { + const html = await this.spectron.waitFor(this.spectron.client.getHTML, extensionListSelector); + let extensionIndex: number = 0; + let extension: boolean; + let tags: string[] = []; + let parser = new htmlparser.Parser({ + onopentag: function (name, attribs) { + if (name === 'div' && attribs.class === 'extension') { + extensionIndex++; + extension = true; + } + if (extension) { + tags.push(name); + } + }, + ontext: function (text) { + if (extension && text === name) { + parser.end(); + } + }, + onclosetag: function (name) { + if (extension) { + tags.pop(); + } + if (extension && tags.length === 0) { + extension = false; + } + }, + onend: function () { + if (extensionIndex === 0) { + return rej(`${name} extension was not found.`); + } + return res(extensionIndex); + } + }); + parser.write(html); + }); + } +} \ No newline at end of file diff --git a/test/smoke/src/areas/first-experience.ts b/test/smoke/src/areas/first-experience.ts new file mode 100644 index 0000000000000000000000000000000000000000..e9141bda899aaf2ca6d541733a3b7638885f244d --- /dev/null +++ b/test/smoke/src/areas/first-experience.ts @@ -0,0 +1,21 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { SpectronApplication } from "../spectron/application"; + +export class FirstExperience { + constructor(private spectron: SpectronApplication) { + // noop + } + + public async getWelcomeTab(): Promise { + let el = await this.spectron.client.element('.vs_code_welcome_page-name-file-icon'); + if (el.status === 0) { + return el; + } + + return undefined; + } +} \ No newline at end of file diff --git a/test/smoke/src/areas/git.ts b/test/smoke/src/areas/git.ts new file mode 100644 index 0000000000000000000000000000000000000000..226dd98720976443935b2e06ec534365b5f7c352 --- /dev/null +++ b/test/smoke/src/areas/git.ts @@ -0,0 +1,166 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { SpectronApplication } from '../spectron/application'; +import { CommonActions } from "./common"; + +var htmlparser = require('htmlparser2'); + +export class Git { + private editorChangeIndex: number; + + constructor(private spectron: SpectronApplication, private commonActions: CommonActions) { + // noop + } + + public openGitViewlet(): Promise { + return this.spectron.command('workbench.view.scm'); + } + + public getScmIconChanges(): Promise { + return this.spectron.waitFor(this.spectron.client.getText, 'div[id="workbench.parts.activitybar"] .badge.scm-viewlet-label .badge-content'); + } + + public async verifyScmChange(fileName: string): Promise { + let el; + try { + el = await this.spectron.client.element(`div[class="monaco-icon-label file-icon ${fileName}-name-file-icon ${this.commonActions.getExtensionSelector(fileName)}"]`); + } catch (e) { + return Promise.reject(`${fileName} change is not present in SCM viewlet.`); + } + + if (el.status === 0) { + return el; + } + + return undefined; + } + + public async getOriginalAppJsBodyVarName(): Promise { + this.editorChangeIndex = await this.getFirstChangeIndex('cdr line-delete', '.editor.original .view-overlays'); + return this.spectron.waitFor(this.spectron.client.getText, `.editor.original .view-lines>:nth-child(${this.editorChangeIndex}) .mtk11`); + } + + public getModifiedAppJsBodyVarName(): Promise { + return this.spectron.waitFor(this.spectron.client.getText, `.editor.modified .view-lines>:nth-child(${this.editorChangeIndex}) .mtk11`); + } + + public async stageFile(fileName: string): Promise { + try { + await this.spectron.client.moveToObject(`div[class="monaco-icon-label file-icon ${fileName}-name-file-icon ${this.commonActions.getExtensionSelector(fileName)}"`); + } catch (e) { + return Promise.reject(`${fileName} was not found in SCM viewlet`); + } + + await this.spectron.wait(); + + try { + await this.spectron.client.click('.action-label.icon.contrib-cmd-icon-4'); + } catch (e) { + return Promise.reject('Stage button was not found'); + } + return this.spectron.wait(); + } + + public async unstageFile(fileName: string): Promise { + try { + await this.spectron.client.moveToObject(`div[class="monaco-icon-label file-icon ${fileName}-name-file-icon ${this.commonActions.getExtensionSelector(fileName)}"`); + } catch (e) { + return Promise.reject(`${fileName} was not found in SCM viewlet`); + } + + try { + await this.spectron.client.click('.action-label.icon.contrib-cmd-icon-6'); + } catch (e) { + return Promise.reject('Unstage button was not found.'); + } + return this.spectron.wait(); + } + + public async getStagedCount(): Promise { + let scmHeaders: Array; + try { + scmHeaders = await this.spectron.waitFor(this.spectron.client.getText, '.scm-status.show-file-icons .monaco-list-rows .name'); // get all headers + } + catch (e) { + return Promise.reject('No row names in SCM viewlet were found.'); + } + + const stagedTitle = scmHeaders.find((val) => { + return val.match(/staged/i) ? true : false; + }); + + if (!stagedTitle) { + return Promise.reject(`No 'Staged' header title found in SCM viewlet`); + } + + const monacoRowIndex = scmHeaders.indexOf(stagedTitle); + try { + return this.spectron.waitFor(this.spectron.client.getText, `.scm-status.show-file-icons .monaco-list-rows>:nth-child(${monacoRowIndex + 1}) .monaco-count-badge`); + } catch (e) { + return Promise.reject('Stage count badge cannot be found'); + } + } + + public focusOnCommitBox(): Promise { + try { + return this.spectron.client.click('div[id="workbench.view.scm"] textarea'); + } catch (e) { + return Promise.reject('Failed to focus on commit box: ' + e); + } + } + + public async pressCommit(): Promise { + try { + await this.spectron.client.click('.action-label.icon.contrib-cmd-icon-10'); + } catch (e) { + return Promise.reject('Failed to press commit: ' + e); + } + + return this.spectron.wait(); + } + + public getOutgoingChanges(): Promise { + try { + return this.spectron.client.getText('a[title="Synchronize Changes"]'); + } catch (e) { + return Promise.reject(`Failed to obtain 'synchronize changes' title value from the status bar.`); + } + } + + private getFirstChangeIndex(changeClass: string, selector: string): Promise { + return new Promise(async (res, rej) => { + const html = await this.spectron.waitFor(this.spectron.client.getHTML, selector); + let lineIndex: number = 0; + let changeFound: boolean; + let tags: string[] = []; + let parser = new htmlparser.Parser({ + onopentag: function (name: string, attribs: any) { + tags.push(name); + if (name === 'div' && !attribs.class) { + lineIndex++; + } else if (name === 'div' && attribs.class === changeClass) { + changeFound = true; + parser.end(); + } + }, + onclosetag: function (name) { + // Terminate once last tag is closed + tags.pop(); + if (!changeFound && tags.length === 0) { + parser.end(); + } + }, + onend: function () { + if (!changeFound) { + return rej(`No changes in the diff found.`); + } + return res(lineIndex); + } + }); + parser.write(html); + }); + } +} \ No newline at end of file diff --git a/test/smoke/src/areas/integrated-terminal.ts b/test/smoke/src/areas/integrated-terminal.ts new file mode 100644 index 0000000000000000000000000000000000000000..0e7d8abda7b860ed0704e8c07ca0747458cb042c --- /dev/null +++ b/test/smoke/src/areas/integrated-terminal.ts @@ -0,0 +1,44 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { SpectronApplication } from '../spectron/application'; +import { CommonActions } from "./common"; + +export class IntegratedTerminal { + + constructor(private spectron: SpectronApplication) { + // noop + } + + public async openTerminal(commonActions: CommonActions): Promise { + // Backquote dispatching does not work in OS X + if (process.platform === 'darwin') { + await commonActions.showCommands(); + await commonActions.type('Toggle Integrated Terminal'); + return commonActions.enter(); + } + + return this.spectron.command('workbench.action.terminal.toggleTerminal'); + } + + public async commandOutputHas(result: string): Promise { + const selector = 'div[id="workbench.panel.terminal"] .xterm-rows'; + + const rows = await this.spectron.client.elements(`${selector} div`); + for (let i = 0; i < rows.value.length; i++) { + let rowText; + try { + rowText = await this.spectron.client.getText(`${selector}>:nth-child(${i + 1})`); + } catch (e) { + return Promise.reject(`Failed to obtain text from line ${i + 1} from the terminal.`); + } + if (rowText.trim() === result) { + return true; + } + } + + return false; + } +} \ No newline at end of file diff --git a/test/smoke/src/areas/javascript-debug.ts b/test/smoke/src/areas/javascript-debug.ts new file mode 100644 index 0000000000000000000000000000000000000000..4e95f716d53d01731727474d8d13074f815ff991 --- /dev/null +++ b/test/smoke/src/areas/javascript-debug.ts @@ -0,0 +1,53 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { SpectronApplication } from '../spectron/application'; +var stripJsonComments = require('strip-json-comments'); + +export class JavaScriptDebug { + private readonly sidebarSelector = '.margin-view-overlays'; + + constructor(private spectron: SpectronApplication) { + // noop + } + + public openDebugViewlet(): Promise { + return this.spectron.command('workbench.view.debug'); + } + + public async pressConfigureLaunchJson(): Promise { + try { + await this.spectron.waitFor(this.spectron.client.click, 'ul[aria-label="Debug actions"] .action-label.icon.debug-action.configure'); + } catch (e) { + return Promise.reject('Clicking on debug configuration gear failed.'); + } + await this.spectron.wait(); + await this.spectron.client.keys(['ArrowDown', 'NULL', 'Enter']); + return this.spectron.wait(); + } + + public async getProgramConfigValue(): Promise { + const lines = stripJsonComments(await this.spectron.client.getText('.view-lines')); + const json = JSON.parse(lines); + return json.configurations[0].program; + } + + public setBreakpointOnLine(lineNumber: number): Promise { + try { + return this.spectron.client.leftClick(`${this.sidebarSelector}>:nth-child(${lineNumber})`, 5, 5); + } catch (e) { + return Promise.reject('Setting breakpoint failed: ' + e); + } + } + + public async verifyBreakpointOnLine(lineNumber: number): Promise { + let el = await this.spectron.client.element(`${this.sidebarSelector}>:nth-child(${lineNumber}) .cgmr.debug-breakpoint-glyph`); + if (el.status === 0) { + return el; + } + + return undefined; + } +} \ No newline at end of file diff --git a/test/smoke/src/areas/javascript.ts b/test/smoke/src/areas/javascript.ts new file mode 100644 index 0000000000000000000000000000000000000000..c4a9f88578efc8eea5496d491a64a0da7a2b4aa2 --- /dev/null +++ b/test/smoke/src/areas/javascript.ts @@ -0,0 +1,184 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { SpectronApplication } from '../spectron/application'; + +var htmlparser = require('htmlparser2'); + +export class JavaScript { + private appVarSelector: string; + private expressVarSelector: string; + + private foldSelector: string; + private foldLine: number; + + constructor(private spectron: SpectronApplication) { + // noop + } + + public openQuickOutline(): Promise { + return this.spectron.command('workbench.action.gotoSymbol'); + } + + public async findAppReferences(): Promise { + await this.setAppVarSelector(); + try { + await this.spectron.client.click(this.appVarSelector, false); + } catch (e) { + return Promise.reject(`Failed to select 'app' variable.`); + } + + return this.spectron.command('editor.action.referenceSearch.trigger'); + } + + public async getTitleReferencesCount(): Promise { + const meta = await this.spectron.client.getText('.reference-zone-widget.results-loaded .peekview-title .meta'); + + return meta.match(/\d+/)[0]; + } + + public async getTreeReferencesCount(): Promise { + const treeElems = await this.spectron.client.elements('.reference-zone-widget.results-loaded .ref-tree.inline .show-twisties .monaco-tree-row'); + + return treeElems.value.length; + } + + public async renameApp(newValue: string): Promise { + await this.setAppVarSelector(); + + try { + await this.spectron.client.click(this.appVarSelector); + } catch (e) { + return Promise.reject(`Failed to select 'app' variable.`); + } + await this.spectron.command('editor.action.rename'); + await this.spectron.wait(); + return this.spectron.client.keys(newValue, false); + } + + public async getNewAppName(): Promise { + return this.spectron.client.getText(this.appVarSelector); + } + + public async toggleFirstCommentFold(): Promise { + this.foldLine = await this.getLineIndexOfFirstFoldableElement(`.margin-view-overlays`); + this.foldSelector = `.margin-view-overlays>:nth-child(${this.foldLine})`; + + try { + return this.spectron.client.click(`${this.foldSelector} .cldr.folding`); + } catch (e) { + return Promise.reject('Clicking on fold element failed ' + e); + } + } + + public async getFirstCommentFoldedIcon(): Promise { + if (!this.foldSelector) { + return Promise.reject('No code folding happened to be able to check for a folded icon.'); + } + + return this.spectron.client.getHTML(`${this.foldSelector} .cldr.folding.collapsed`); + } + + public async getNextLineNumberAfterFold(): Promise { + if (!this.foldLine) { + return Promise.reject('Folded line was not set, most likely because fold was not toggled initially.'); + } + + return this.spectron.client.getText(`.margin-view-overlays>:nth-child(${this.foldLine + 1}) .line-numbers`); + } + + public async goToExpressDefinition(): Promise { + await this.setExpressVarSelector(); + try { + await this.spectron.client.click(this.expressVarSelector); + } catch (e) { + return Promise.reject(`Clicking on express variable failed: ` + e); + } + + return this.spectron.command('editor.action.goToDeclaration'); + } + + public async peekExpressDefinition(): Promise { + await this.setExpressVarSelector(); + try { + await this.spectron.client.click(this.expressVarSelector); + } catch (e) { + return Promise.reject('Clicking on express variable failed: ' + e); + } + + return this.spectron.command('editor.action.previewDeclaration'); + } + + public async getPeekExpressResultName(): Promise { + return this.spectron.client.getText('.reference-zone-widget.results-loaded .filename'); + } + + private async setAppVarSelector(): Promise { + if (!this.appVarSelector) { + const lineIndex = await this.getLineIndexOfFirst('app', '.view-lines'); + this.appVarSelector = `.view-lines>:nth-child(${lineIndex}) .mtk11`; + } + } + + private async setExpressVarSelector(): Promise { + if (!this.expressVarSelector) { + const lineIndex = await this.getLineIndexOfFirst('express', '.view-lines'); + this.expressVarSelector = `.view-lines>:nth-child(${lineIndex}) .mtk10`; + } + } + + private getLineIndexOfFirst(string: string, selector: string): Promise { + return new Promise(async (res, rej) => { + const html = await this.spectron.waitFor(this.spectron.client.getHTML, selector); + let lineIndex: number = 0; + let stringFound: boolean; + let parser = new htmlparser.Parser({ + onopentag: function (name: string, attribs: any) { + if (name === 'div' && attribs.class === 'view-line') { + lineIndex++; + } + }, + ontext: function (text) { + if (!stringFound && text === string) { + stringFound = true; + parser.end(); + } + }, + onend: function () { + if (!stringFound) { + return rej(`No ${string} in editor found.`); + } + return res(lineIndex); + } + }); + parser.write(html); + }); + } + + private getLineIndexOfFirstFoldableElement(selector: string): Promise { + return new Promise(async (res, rej) => { + const html = await this.spectron.waitFor(this.spectron.client.getHTML, selector); + let lineIndex: number = 0; + let foldFound: boolean; + let parser = new htmlparser.Parser({ + onopentag: function (name: string, attribs: any) { + if (name === 'div' && !attribs.class) { + lineIndex++; + } else if (name === 'div' && attribs.class.indexOf('cldr folding') !== -1) { + foldFound = true; + parser.end(); + } + }, + onend: function () { + if (!foldFound) { + return rej(`No foldable elements found.`); + } + return res(lineIndex); + } + }); + parser.write(html); + }); + } +} \ No newline at end of file diff --git a/test/smoke/src/areas/localization.ts b/test/smoke/src/areas/localization.ts new file mode 100644 index 0000000000000000000000000000000000000000..d06b6c8bad675879d632a70292a51544b2bcd6e2 --- /dev/null +++ b/test/smoke/src/areas/localization.ts @@ -0,0 +1,69 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { SpectronApplication } from '../spectron/application'; + +export enum ViewletType { + SEARCH = 0, + SCM = 1, + DEBUG = 2, + EXTENSIONS = 3 +} + +export class Localization { + + constructor(private spectron: SpectronApplication) { + // noop + } + + public async getOpenEditorsText(): Promise { + let explorerTitles; + try { + explorerTitles = await this.spectron.client.getText('div[id="workbench.view.explorer"] .title span'); + } catch (e) { + return Promise.reject('Failed to get span of title in explorer viewlet.'); + } + + return explorerTitles[0]; + } + + public openViewlet(type: ViewletType): Promise { + let command; + + switch (type) { + case ViewletType.SEARCH: + command = 'workbench.view.search'; + break; + case ViewletType.SCM: + command = 'workbench.view.scm'; + break; + case ViewletType.DEBUG: + command = 'workbench.view.debug'; + break; + case ViewletType.EXTENSIONS: + command = 'workbench.view.extensions'; + break; + } + + return this.spectron.command(command, false); + } + + public getOpenedViewletTitle(): Promise { + try { + return this.spectron.client.getText('div[id="workbench.parts.sidebar"] .title-label span'); + } catch (e) { + return Promise.reject('Failed to get span of title label in explorer viewlet.'); + } + } + + public getExtensionsSearchPlaceholder(): Promise { + try { + return this.spectron.client.getAttribute('div[id="workbench.view.extensions"] .search-box', 'placeholder'); + } catch (e) { + return Promise.reject('Failed to add attribute for extensi'); + } + } + +} \ No newline at end of file diff --git a/test/smoke/src/areas/search.ts b/test/smoke/src/areas/search.ts new file mode 100644 index 0000000000000000000000000000000000000000..4247171c5d92a15d5ecd3aa78be8ff714e32f6db --- /dev/null +++ b/test/smoke/src/areas/search.ts @@ -0,0 +1,74 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { SpectronApplication } from '../spectron/application'; + +export class Search { + + constructor(private spectron: SpectronApplication) { + // noop + } + + public openSearchViewlet(): Promise { + return this.spectron.command('workbench.view.search'); + } + + public async searchFor(text: string): Promise { + await this.spectron.client.keys(text); + return this.spectron.client.keys(['NULL', 'Enter', 'NULL'], false); + } + + public setReplaceText(text: string): any { + try { + return this.spectron.client.setValue('.viewlet .input[title="Replace"]', text); + } catch (e) { + return Promise.reject('Cannot set replace input in the viewlet: ' + e); + } + } + + public replaceFirstMatch(): any { + try { + return this.spectron.client.click('.monaco-tree-rows.show-twisties .action-label.icon.action-replace-all'); + } catch (e) { + return Promise.reject('Cannot replace the search first match: ' + e); + } + } + + public getResultText(): any { + return this.spectron.waitFor(this.spectron.client.getText, '.search-viewlet .message>p'); + } + + public toggleSearchDetails(): any { + try { + return this.spectron.client.click('.query-details .more'); + } catch (e) { + return Promise.reject('Toggling search details failed: ' + e); + } + } + + public toggleReplace(): any { + try { + return this.spectron.client.click('.monaco-button.toggle-replace-button.collapse'); + } catch (e) { + return Promise.reject('Toggling replace failed: ' + e); + } + } + + public hoverOverResultCount(): any { + try { + return this.spectron.waitFor(this.spectron.client.moveToObject, '.monaco-count-badge'); + } catch (e) { + return Promise.reject('Hovering over result count failed: ' + e); + } + } + + public dismissResult(): any { + try { + return this.spectron.client.click('.action-label.icon.action-remove'); + } catch (e) { + return Promise.reject('Clicking on dismissing result failed: ' + e); + } + } +} \ No newline at end of file diff --git a/test/smoke/src/areas/statusbar.ts b/test/smoke/src/areas/statusbar.ts new file mode 100644 index 0000000000000000000000000000000000000000..95e6d3556bf975ac8f379928a30a93d6738ee95d --- /dev/null +++ b/test/smoke/src/areas/statusbar.ts @@ -0,0 +1,103 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { SpectronApplication } from '../spectron/application'; + +export enum StatusBarElement { + BRANCH_STATUS = 0, + SYNC_STATUS = 1, + PROBLEMS_STATUS = 2, + SELECTION_STATUS = 3, + INDENTATION_STATUS = 4, + ENCODING_STATUS = 5, + EOL_STATUS = 6, + LANGUAGE_STATUS = 7, + FEEDBACK_ICON = 8 +} + +export class StatusBar { + + private selectorsMap: Map; + private readonly mainSelector = 'div[id="workbench.parts.statusbar"]'; + + constructor(private spectron: SpectronApplication) { + this.populateSelectorsMap(); + } + + public async isVisible(element: StatusBarElement): Promise { + const selector = this.selectorsMap.get(element); + if (!selector) { + throw new Error('No such element in the status bar defined.'); + } + + return this.spectron.client.isVisible(selector); + } + + public async clickOn(element: StatusBarElement): Promise { + const selector = this.selectorsMap.get(element); + if (!selector) { + throw new Error('No such element in the status bar defined.'); + } + + try { + return this.spectron.client.click(selector); + } catch (e) { + return Promise.reject(`Clicking on status bar element ${selector} failed.`); + } + } + + public async getProblemsView(): Promise { + let el = await this.spectron.client.element('div[id="workbench.panel.markers"]'); + if (el.status === 0) { + return el; + } + + return undefined; + } + + public async getFeedbackView(): Promise { + let el = await this.spectron.client.element('.feedback-form'); + if (el.status === 0) { + return el; + } + + return undefined; + } + + public isQuickOpenWidgetVisible(): Promise { + return this.spectron.client.isVisible('.quick-open-widget'); + } + + public async getEditorHighlightedLine(lineNumber: number): Promise { + let el = await this.spectron.client.element(`.monaco-editor .view-overlays>:nth-child(${lineNumber}) .current-line`); + if (el.status === 0) { + return el; + } + + return undefined; + } + + public async getEOLMode(): Promise { + const selector = this.selectorsMap.get(StatusBarElement.EOL_STATUS); + if (!selector) { + throw new Error('No such element in the status bar defined.'); + } + + return this.spectron.client.getText(selector); + } + + private populateSelectorsMap(): void { + this.selectorsMap = new Map(); + this.selectorsMap.set(StatusBarElement.BRANCH_STATUS, `${this.mainSelector} .octicon.octicon-git-branch`); + this.selectorsMap.set(StatusBarElement.SYNC_STATUS, `${this.mainSelector} .octicon.octicon-sync`); + this.selectorsMap.set(StatusBarElement.PROBLEMS_STATUS, `${this.mainSelector} .task-statusbar-item[title="Problems"]`); + this.selectorsMap.set(StatusBarElement.SELECTION_STATUS, `${this.mainSelector} .editor-status-selection`); + this.selectorsMap.set(StatusBarElement.INDENTATION_STATUS, `${this.mainSelector} .editor-status-indentation`); + this.selectorsMap.set(StatusBarElement.ENCODING_STATUS, `${this.mainSelector} .editor-status-encoding`); + this.selectorsMap.set(StatusBarElement.EOL_STATUS, `${this.mainSelector} .editor-status-eol`); + this.selectorsMap.set(StatusBarElement.LANGUAGE_STATUS, `${this.mainSelector} .editor-status-mode`); + this.selectorsMap.set(StatusBarElement.FEEDBACK_ICON, `${this.mainSelector} .dropdown.send-feedback`); + } +} \ No newline at end of file diff --git a/test/smoke/src/areas/tasks.ts b/test/smoke/src/areas/tasks.ts new file mode 100644 index 0000000000000000000000000000000000000000..b5b14dad81de37edc4941162d05d883054f5ff7a --- /dev/null +++ b/test/smoke/src/areas/tasks.ts @@ -0,0 +1,64 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { SpectronApplication } from '../spectron/application'; + +export class Tasks { + + private readonly outputViewSelector = 'div[id="workbench.panel.output"] .view-lines'; + private readonly workbenchPanelSelector = 'div[id="workbench.parts.panel"]'; + private readonly problemsViewSelector = 'div[id="workbench.panel.markers"] .monaco-tree-row.expanded'; + + constructor(private spectron: SpectronApplication) { + // noop + } + + public async build(): Promise { + await this.spectron.command('workbench.action.tasks.build'); + return this.spectron.wait(); // wait for build to finish + } + + public openProblemsView(): Promise { + return this.spectron.command('workbench.actions.view.problems'); + } + + public async outputContains(string: string): Promise { + const output: string = await this.spectron.waitFor(this.spectron.client.getText, this.outputViewSelector); + + if (output.indexOf(string) !== -1) { + return true; + } + + return false; + } + + public selectOutputViewType(type: string): Promise { + try { + return this.spectron.client.selectByValue(`${this.workbenchPanelSelector} .select-box`, type); + } catch (e) { + return Promise.reject(`Failed to select ${type} as workbench panel output.`); + } + } + + public getOutputViewType(): Promise { + return this.spectron.client.getValue(`${this.workbenchPanelSelector} .select-box`); + } + + public getProblemsViewFirstElementName(): Promise { + try { + return this.spectron.waitFor(this.spectron.client.getText, `${this.problemsViewSelector} .label-name`); + } catch (e) { + return Promise.reject('Failed to get problem label from Problems view: ' + e); + } + } + + public getProblemsViewFirstElementCount(): Promise { + try { + return this.spectron.waitFor(this.spectron.client.getText, `${this.problemsViewSelector} .monaco-count-badge`); + } catch (e) { + return Promise.reject('Failed to get problem count from Problems view: ' + e); + } + } +} \ No newline at end of file diff --git a/test/smoke/src/helpers/screenshot.ts b/test/smoke/src/helpers/screenshot.ts new file mode 100644 index 0000000000000000000000000000000000000000..774268da7c5974ee7cf8edea5e587fcfbc0f644d --- /dev/null +++ b/test/smoke/src/helpers/screenshot.ts @@ -0,0 +1,48 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { SpectronApplication } from "../spectron/application"; +var fs = require('fs'); + +const __testTime = new Date().toISOString(); + +export class Screenshot { + private index: number = 0; + private testPath: string; + + constructor(private spectron: SpectronApplication, testName: string, testRetry: number) { + const testTime = this.sanitizeFolderName(__testTime); + testName = this.sanitizeFolderName(testName); + + this.testPath = `test_data/screenshots/${testTime}/${testName}/${testRetry}`; + this.createFolder(this.testPath); + } + + public async capture(): Promise { + return new Promise(async (res, rej) => { + const image: Electron.NativeImage = await this.spectron.app.browserWindow.capturePage(); + fs.writeFile(`${this.testPath}/${this.index}.png`, image, (err) => { + if (err) { + rej(err); + } + this.index++; + res(); + }); + }); + } + + private createFolder(name: string): void { + name.split('/').forEach((folderName, i, fullPath) => { + const folder = fullPath.slice(0, i + 1).join('/'); + if (!fs.existsSync(folder)) { + fs.mkdirSync(folder); + } + }); + } + + private sanitizeFolderName(name: string): string { + return name.replace(/[&*:\/]/g, ''); + } +} \ No newline at end of file diff --git a/test/smoke/src/helpers/utilities.ts b/test/smoke/src/helpers/utilities.ts new file mode 100644 index 0000000000000000000000000000000000000000..2a52a4fe7dfd2e7c3c350f457020ef52e9ed18d2 --- /dev/null +++ b/test/smoke/src/helpers/utilities.ts @@ -0,0 +1,37 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +var fs = require('fs'); +var rimraf = require('rimraf'); + +/** + * Contains methods that are commonly used across test areas. + */ +export class Util { + constructor() { + // noop + } + + public removeFile(filePath: string): void { + try { + fs.unlinkSync(`${filePath}`); + } catch (e) { + if (e.code !== 'ENOENT') { + throw e; + } + } + } + + public rimraf(directory: string): Promise { + return new Promise((res, rej) => { + rimraf(directory, (err) => { + if (err) { + rej(err); + } + res(); + }); + }); + } +} \ No newline at end of file diff --git a/test/smoke/src/main.js b/test/smoke/src/main.js new file mode 100644 index 0000000000000000000000000000000000000000..acf9db502d2136f96d74cd26786e1ba5b334a7a1 --- /dev/null +++ b/test/smoke/src/main.js @@ -0,0 +1,170 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +var fs = require('fs'); +var https = require('https'); +var program = require('commander'); +var git = require('simple-git')(); +var child_process = require('child_process'); +var path = require('path'); + +var tempFolder = 'test_data'; +var testRepoUrl = 'https://github.com/Microsoft/vscode-smoketest-express'; +var testRepoLocalDir = path.join(process.cwd(), `${tempFolder}/vscode-smoketest-express`); +var keybindingsUrl = 'https://raw.githubusercontent.com/Microsoft/vscode-docs/master/scripts/keybindings'; + +program + .option('-l, --latest ', 'path to the latest VS Code to test') + .option('-s, --stable [file path]', 'path to the stable VS Code to be used in data migration tests'); + +program.on('--help', () => { + console.log(' Examples:'); + console.log(''); + console.log(' $ npm test -- --latest path/to/binary'); + console.log(' $ npm test -- -l path/to/binary'); + console.log(''); + console.log(' $ npm test -- --latest path/to/latest/binary --stable path/to/stable/binary'); + console.log(' $ npm test -- -l path/to/latest/binary -s path/to/stable/binary'); + console.log(''); +}); +program.parse(process.argv); + +if (!program.latest) { + fail('You must specify the binary to run the smoke test against'); +} +if (!binaryExists(program.latest) || (program.stable && !binaryExists(program.stable))) { + fail('The file path to electron binary does not exist or permissions do not allow to execute it. Please check the path provided.'); +} +if (parseInt(process.version.substr(1)) < 6) { + fail('Please update your Node version to greater than 6 to run the smoke test.'); +} + +// Setting up environment variables +process.env.VSCODE_LATEST_PATH = program.latest; +if (program.stable) process.env.VSCODE_STABLE_PATH = program.stable; +process.env.SMOKETEST_REPO = testRepoLocalDir; +if (program.stable && program.stable.toLowerCase().startsWith('insiders')) process.env.VSCODE_EDITION = 'insiders'; + +// Setting up 'vscode-smoketest-express' project +var os = process.platform; +if (os === 'darwin') os = 'osx'; +else if (os === 'win32') os = 'win'; +var promises = []; + +try { + promises.push(getKeybindings(`${keybindingsUrl}/doc.keybindings.${os}.json`, `${tempFolder}/keybindings.json`)); + promises.push(cleanOrClone(testRepoUrl, testRepoLocalDir)); + + Promise.all(promises).then(() => { execute('npm install', testRepoLocalDir).then(() => runTests()); }); +} catch (e) { + throw new Error('Error caught running the smoke test: ' + e); +} + +function fail(errorMessage) { + console.error(errorMessage); + process.exit(1); +} + +function runTests() { + console.log('Running tests...') + const spawn = require('child_process').spawn; + var proc = spawn(process.execPath, [ + 'out/mocha-runner.js' + ]); + proc.stdout.on('data', data => { + console.log(data.toString()); + }); + proc.stderr.on('data', data => { + var date = new Date().toLocaleString(); + fs.appendFile(`${tempFolder}/errors.log`, `${date}: ${data.toString()}`, (err) => { + if (err) throw new Error(`Could not write stderr to errors.log with the following error: ${err}`); + }); + }); + proc.on('exit', (code) => { + process.exit(code); + }); +} + +function cleanOrClone(repo, dir) { + console.log('Cleaning or cloning test project repository...'); + return new Promise((res, rej) => { + if (!folderExists(dir)) { + git.clone(repo, dir, () => { + console.log('Test repository successfully cloned.'); + res(); + }); + } else { + git.cwd(dir); + git.fetch((err) => { + if (err) rej(err); + resetAndClean(); + }); + } + + var resetAndClean = () => { + git.reset(['FETCH_HEAD', '--hard'], (err) => { + if (err) rej(err); + + git.clean('f', ['-d'], (err) => { + if (err) rej(err); + console.log('Test project was successfully reset to initial state.'); + res(); + }); + }); + } + }); +} + +function execute(cmd, dir) { + return new Promise((res, rej) => { + console.log(`Running ${cmd}...`); + child_process.exec(cmd, { cwd: dir, stdio: [0, 1, 2] }, (error, stdout, stderr) => { + if (error) rej(error); + if (stderr) console.error(stderr); + console.log(stdout); + res(); + }); + }); +} + +function getKeybindings(url, location) { + console.log(`Fetching keybindings from ${url}...`); + return new Promise((resolve, reject) => { + https.get(url, (res) => { + if (res.statusCode != 200) { + reject(`Failed to obtain key bindings with response code: ${res.statusCode}`); + } + + var buffer = []; + res.on('data', (chunk) => buffer.push(chunk)); + res.on('end', () => { + fs.writeFile(location, Buffer.concat(buffer), 'utf8', () => { + console.log('Keybindings were successfully fetched.'); + resolve(); + }); + }); + }).on('error', (e) => { + reject(`Failed to obtain key bindings with an error: ${e}`); + }); + }); +} + +function folderExists(folder) { + try { + fs.accessSync(folder, 'rw'); + return true; + } catch (e) { + return false; + } +} + +function binaryExists(filePath) { + try { + fs.accessSync(filePath, 'x'); + return true; + } catch (e) { + return false; + } +} \ No newline at end of file diff --git a/src/vs/workbench/parts/quickopen/browser/media/commandsHandler.css b/test/smoke/src/mocha-runner.ts similarity index 55% rename from src/vs/workbench/parts/quickopen/browser/media/commandsHandler.css rename to test/smoke/src/mocha-runner.ts index 9d1bfd29f025fca48e5766138b02b0bdbe7628db..62171a6dbc24d3455d26dd20b5ce0b154751ec0a 100644 --- a/src/vs/workbench/parts/quickopen/browser/media/commandsHandler.css +++ b/test/smoke/src/mocha-runner.ts @@ -3,12 +3,17 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -.quick-open-widget.commands-handler .quick-open-tree .results-group { - opacity: 1; - font-size: 12px; - color: inherit; -} +const MochaTest = require('mocha'); +const path = require('path'); -.vs-dark .quick-open-widget.commands-handler .quick-open-tree .results-group { - color: inherit; -} \ No newline at end of file +const mochaTest = new MochaTest({ + timeout: 360000, + retries: 2, + slow: 50000, + useColors: true +}); + +mochaTest.addFile(path.join(process.cwd(), 'out/test.js')); +mochaTest.run((failures) => { + process.exit(failures); +}); \ No newline at end of file diff --git a/test/smoke/src/spectron/application.ts b/test/smoke/src/spectron/application.ts new file mode 100644 index 0000000000000000000000000000000000000000..af1962da3d36eb8b49fe290cfbe142f7fa9de7c5 --- /dev/null +++ b/test/smoke/src/spectron/application.ts @@ -0,0 +1,175 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { Application } from 'spectron'; +import { SpectronClient } from './client'; +import { Screenshot } from "../helpers/screenshot"; +var fs = require('fs'); +var path = require('path'); + +export const LATEST_PATH = process.env.VSCODE_LATEST_PATH; +export const STABLE_PATH = process.env.VSCODE_STABLE_PATH; +export const WORKSPACE_PATH = process.env.SMOKETEST_REPO; +export const USER_DIR = 'test_data/temp_user_dir'; +export const EXTENSIONS_DIR = 'test_data/temp_extensions_dir'; + +/** + * Wraps Spectron's Application instance with its used methods. + */ +export class SpectronApplication { + public client: SpectronClient; + + private spectron: Application; + private keybindings: any[]; + private screenshot: Screenshot; + + private readonly sampleExtensionsDir: string = 'test_data/sample_extensions_dir'; + private readonly pollTrials = 5; + private readonly pollTimeout = 3; // in secs + + constructor(electronPath: string, testName: string, private testRetry: number, args?: string[], chromeDriverArgs?: string[]) { + if (!args) { + args = []; + } + + // Prevent 'Getting Started' web page from opening on clean user-data-dir + args.push('--skip-getting-started'); + + // Ensure that running over custom extensions directory, rather than picking up the one that was used by a tester previously + let extensionDirIsSet = false; + for (let arg of args) { + if (arg.startsWith('--extensions-dir')) { + extensionDirIsSet = true; + break; + } + } + if (!extensionDirIsSet) { + args.push(`--extensions-dir=${this.sampleExtensionsDir}`); + } + + this.spectron = new Application({ + path: electronPath, + args: args, + chromeDriverArgs: chromeDriverArgs + }); + this.testRetry += 1; // avoid multiplication by 0 for wait times + this.screenshot = new Screenshot(this, testName, testRetry); + this.client = new SpectronClient(this.spectron, this.screenshot); + this.retrieveKeybindings(); + } + + public get app(): Application { + return this.spectron; + } + + public async start(): Promise { + try { + await this.spectron.start(); + await this.focusOnWindow(1); // focuses on main renderer window + return this.checkWindowReady(); + } catch (err) { + throw err; + } + } + + public async stop(): Promise { + if (this.spectron && this.spectron.isRunning()) { + return await this.spectron.stop(); + } + } + + public waitFor(func: (...args: any[]) => any, args: any): Promise { + return this.callClientAPI(func, args); + } + + public wait(): Promise { + return new Promise(resolve => setTimeout(resolve, this.testRetry * this.pollTimeout * 1000)); + } + + public focusOnWindow(index: number): Promise { + return this.client.windowByIndex(index); + } + + private checkWindowReady(): Promise { + return this.waitFor(this.spectron.client.getHTML, '[id="workbench.main.container"]'); + } + + private retrieveKeybindings() { + fs.readFile(path.join(process.cwd(), `test_data/keybindings.json`), 'utf8', (err, data) => { + if (err) { + throw err; + } + try { + this.keybindings = JSON.parse(data); + } catch (e) { + throw new Error(`Error parsing keybindings JSON: ${e}`); + } + }); + } + + private callClientAPI(func: (...args: any[]) => Promise, args: any): Promise { + let trial = 1; + return new Promise(async (res, rej) => { + while (true) { + if (trial > this.pollTrials) { + rej(`Could not retrieve the element in ${this.testRetry * this.pollTrials * this.pollTimeout} seconds.`); + break; + } + + let result; + try { + result = await func.call(this.client, args); + } catch (e) { } + + if (result && result !== '') { + await this.screenshot.capture(); + res(result); + break; + } + + await this.wait(); + trial++; + } + }); + } + + /** + * Retrieves the command from keybindings file and executes it with WebdriverIO client API + * @param command command (e.g. 'workbench.action.files.newUntitledFile') + */ + public command(command: string, capture?: boolean): Promise { + const binding = this.keybindings.find(x => x['command'] === command); + if (!binding) { + return Promise.reject(`Key binding for ${command} was not found.`); + } + + const keys: string = binding.key; + let keysToPress: string[] = []; + + const chords = keys.split(' '); + chords.forEach((chord) => { + const keys = chord.split('+'); + keys.forEach((key) => keysToPress.push(this.transliterate(key))); + keysToPress.push('NULL'); + }); + + return this.client.keys(keysToPress, capture); + } + + /** + * Transliterates key names from keybindings file to WebdriverIO keyboard actions defined in: + * https://w3c.github.io/webdriver/webdriver-spec.html#keyboard-actions + */ + private transliterate(key: string): string { + switch (key) { + case 'ctrl': + return 'Control'; + case 'cmd': + return 'Meta'; + default: + return key.length === 1 ? key : key.charAt(0).toUpperCase() + key.slice(1); + }; + } +} diff --git a/test/smoke/src/spectron/client.ts b/test/smoke/src/spectron/client.ts new file mode 100644 index 0000000000000000000000000000000000000000..93a4ef8deea3bac36ca387b0507f1d646d7d5896 --- /dev/null +++ b/test/smoke/src/spectron/client.ts @@ -0,0 +1,127 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { Application } from 'spectron'; +import { Screenshot } from '../helpers/screenshot'; + +/** + * Abstracts the Spectron's WebdriverIO managed client property on the created Application instances. + */ +export class SpectronClient { + + constructor(private spectron: Application, private shot: Screenshot) { + // noop + } + + public windowByIndex(index: number): Promise { + return this.spectron.client.windowByIndex(index); + } + + public async keys(keys: string[] | string, capture: boolean = true): Promise { + await this.screenshot(capture); + return this.spectron.client.keys(keys); + } + + public async getText(selector: string, capture: boolean = true): Promise { + await this.screenshot(capture); + return this.spectron.client.getText(selector); + } + + public async getHTML(selector: string, capture: boolean = true): Promise { + await this.screenshot(capture); + return this.spectron.client.getHTML(selector); + } + + public async click(selector: string, capture: boolean = true): Promise { + await this.screenshot(capture); + return this.spectron.client.click(selector); + } + + public async doubleClick(selector: string, capture: boolean = true): Promise { + await this.screenshot(capture); + return this.spectron.client.doubleClick(selector); + } + + public async leftClick(selector: string, xoffset: number, yoffset: number, capture: boolean = true): Promise { + await this.screenshot(capture); + return this.spectron.client.leftClick(selector, xoffset, yoffset); + } + + public async rightClick(selector: string, capture: boolean = true): Promise { + await this.screenshot(capture); + return this.spectron.client.rightClick(selector); + } + + public async moveToObject(selector: string, capture: boolean = true): Promise { + await this.screenshot(capture); + return this.spectron.client.moveToObject(selector); + } + + public async setValue(selector: string, text: string, capture: boolean = true): Promise { + await this.screenshot(capture); + return this.spectron.client.setValue(selector, text); + } + + public async elements(selector: string, capture: boolean = true): Promise { + await this.screenshot(capture); + return this.spectron.client.elements(selector); + } + + public async element(selector: string, capture: boolean = true): Promise { + await this.screenshot(capture); + return this.spectron.client.element(selector); + } + + public async dragAndDrop(sourceElem: string, destinationElem: string, capture: boolean = true): Promise { + await this.screenshot(capture); + return this.spectron.client.dragAndDrop(sourceElem, destinationElem); + } + + public async selectByValue(selector: string, value: string, capture: boolean = true): Promise { + await this.screenshot(capture); + return this.spectron.client.selectByValue(selector, value); + } + + public async getValue(selector: string, capture: boolean = true): Promise { + await this.screenshot(capture); + return this.spectron.client.getValue(selector); + } + + public async getAttribute(selector: string, attribute: string, capture: boolean = true): Promise { + await this.screenshot(capture); + return Promise.resolve(this.spectron.client.getAttribute(selector, attribute)); + } + + public clearElement(selector: string): any { + return this.spectron.client.clearElement(selector); + } + + public buttonDown(): any { + return this.spectron.client.buttonDown(); + } + + public buttonUp(): any { + return this.spectron.client.buttonUp(); + } + + public async isVisible(selector: string, capture: boolean = true): Promise { + await this.screenshot(capture); + return this.spectron.client.isVisible(selector); + } + + public getTitle(): string { + return this.spectron.client.getTitle(); + } + + private async screenshot(capture: boolean): Promise { + if (capture) { + try { + await this.shot.capture(); + } catch (e) { + throw new Error(`Screenshot could not be captured: ${e}`); + } + } + } +} \ No newline at end of file diff --git a/test/smoke/src/test.ts b/test/smoke/src/test.ts new file mode 100644 index 0000000000000000000000000000000000000000..998616c02979f4c7a94bae1ea57e784a4d76942b --- /dev/null +++ b/test/smoke/src/test.ts @@ -0,0 +1,36 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { testDataLoss } from "./tests/data-loss"; +import { testDataMigration } from "./tests/data-migration"; +import { testExplorer } from "./tests/explorer"; +import { testConfigViews } from "./tests/configuration-views"; +import { testSearch } from "./tests/search"; +import { testCSS } from "./tests/css"; +import { testJavaScript } from "./tests/javascript"; +import { testJavaScriptDebug } from "./tests/javascript-debug"; +import { testGit } from "./tests/git"; +import { testIntegratedTerminal } from "./tests/integrated-terminal"; +import { testStatusbar } from "./tests/statusbar"; +import { testTasks } from "./tests/tasks"; +import { testExtensions } from "./tests/extensions"; +import { testLocalization } from "./tests/localization"; + +describe('Smoke Test Suite', () => { + testDataMigration(); + testDataLoss(); + testExplorer(); + testConfigViews(); + testSearch(); + testCSS(); + testJavaScript(); + testJavaScriptDebug(); + testGit(); + testIntegratedTerminal(); + testStatusbar(); + testTasks(); + testExtensions(); + testLocalization(); +}); \ No newline at end of file diff --git a/test/smoke/src/tests/configuration-views.ts b/test/smoke/src/tests/configuration-views.ts new file mode 100644 index 0000000000000000000000000000000000000000..ff810dd37d485b859f3ca5b95f647912ddae529a --- /dev/null +++ b/test/smoke/src/tests/configuration-views.ts @@ -0,0 +1,57 @@ +/*--------------------------------------------------------------------------------------------- + * 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 { SpectronApplication, LATEST_PATH, WORKSPACE_PATH } from "../spectron/application"; +import { CommonActions } from '../areas/common'; +import { ConfigurationView, ActivityBarPosition } from "../areas/configuration-views"; + +let app: SpectronApplication; +let common: CommonActions; + +export function testConfigViews() { + context('Configuration and views', () => { + let configView: ConfigurationView; + + beforeEach(async function () { + app = new SpectronApplication(LATEST_PATH, this.currentTest.fullTitle(), (this.currentTest as any).currentRetry(), [WORKSPACE_PATH]); + common = new CommonActions(app); + configView = new ConfigurationView(app); + + return await app.start(); + }); + afterEach(async function () { + return await app.stop(); + }); + + it('turns off editor line numbers and verifies the live change', async function () { + await common.newUntitledFile(); + await app.wait(); + let elementsCount = await configView.getEditorLineNumbers(); + assert.equal(elementsCount, 1, 'Line numbers are not present in the editor before disabling them.'); + await common.addSetting('editor.lineNumbers', 'off'); + await app.wait(); + elementsCount = await configView.getEditorLineNumbers(); + assert.equal(elementsCount, 0, 'Line numbers are still present in the editor after disabling them.'); + }); + + it(`changes 'workbench.action.toggleSidebarPosition' command key binding and verifies it`, async function () { + await configView.enterKeybindingsView(); + await common.type('workbench.action.toggleSidebarPosition'); + await app.wait(); + await configView.selectFirstKeybindingsMatch(); + await configView.changeKeybinding(); + await configView.enterBinding(['Control', 'u', 'NULL']); + await common.enter(); + let html = await configView.getActivityBar(ActivityBarPosition.RIGHT); + assert.equal(html, undefined, 'Activity bar is positioned on the right, whereas should not be.'); + await app.wait(); + await configView.toggleActivityBarPosition(); + html = await configView.getActivityBar(ActivityBarPosition.RIGHT); + assert.ok(html, 'Activity bar was not moved to right after toggling its position.'); + }); + }); +} \ No newline at end of file diff --git a/test/smoke/src/tests/css.ts b/test/smoke/src/tests/css.ts new file mode 100644 index 0000000000000000000000000000000000000000..52fcf60335f721aa2b66f3c1dbc9256111eb6aa6 --- /dev/null +++ b/test/smoke/src/tests/css.ts @@ -0,0 +1,61 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import * as assert from 'assert'; + +import { SpectronApplication, LATEST_PATH, WORKSPACE_PATH } from "../spectron/application"; +import { CommonActions } from '../areas/common'; +import { CSS, CSSProblem } from '../areas/css'; + +let app: SpectronApplication; +let common: CommonActions; + +export function testCSS() { + context('CSS', () => { + let css: CSS; + + beforeEach(async function () { + app = new SpectronApplication(LATEST_PATH, this.currentTest.fullTitle(), (this.currentTest as any).currentRetry(), [WORKSPACE_PATH]); + common = new CommonActions(app); + css = new CSS(app); + + return await app.start(); + }); + afterEach(async function () { + return await app.stop(); + }); + + it('verifies quick outline', async function () { + await common.openFirstMatchFile('style.css'); + await css.openQuickOutline(); + await app.wait(); + const count = await common.getQuickOpenElements(); + assert.equal(count, 2, 'Quick outline symbol count is wrong.'); + }); + + it('verifies warnings for the empty rule', async function () { + await common.openFirstMatchFile('style.css'); + await common.type('.foo{}'); + await app.wait(); + let warning = await css.getEditorProblem(CSSProblem.WARNING); + assert.ok(warning, `Warning squiggle is not shown in 'style.css'.`); + await css.toggleProblemsView(); + warning = await css.getProblemsViewsProblem(CSSProblem.WARNING); + assert.ok(warning, 'Warning does not appear in Problems view.'); + }); + + it('verifies that warning becomes an error once setting changed', async function () { + await common.addSetting('css.lint.emptyRules', 'error'); + await common.openFirstMatchFile('style.css'); + await common.type('.foo{}'); + await app.wait(); + let error = await css.getEditorProblem(CSSProblem.ERROR); + assert.ok(error, `Error squiggle is not shown in 'style.css'.`); + await css.toggleProblemsView(); + error = await css.getProblemsViewsProblem(CSSProblem.ERROR); + assert.ok(error, `Error does not appear in Problems view`); + }); + }); +} \ No newline at end of file diff --git a/test/smoke/src/tests/data-loss.ts b/test/smoke/src/tests/data-loss.ts new file mode 100644 index 0000000000000000000000000000000000000000..be7304c7b6f11598194759f55b2d016a91ba8ccc --- /dev/null +++ b/test/smoke/src/tests/data-loss.ts @@ -0,0 +1,74 @@ +/*--------------------------------------------------------------------------------------------- + * 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 { SpectronApplication, USER_DIR, LATEST_PATH, WORKSPACE_PATH } from "../spectron/application"; +import { CommonActions } from '../areas/common'; +import { DataLoss } from "../areas/data-loss"; + +let app: SpectronApplication; +let common: CommonActions; +let dl: DataLoss; + +export function testDataLoss() { + context('Data Loss', () => { + + beforeEach(async function () { + app = new SpectronApplication(LATEST_PATH, this.currentTest.fullTitle(), (this.currentTest as any).currentRetry(), [WORKSPACE_PATH], [`--user-data-dir=${USER_DIR}`]); + common = new CommonActions(app); + dl = new DataLoss(app); + await common.removeDirectory(USER_DIR); + + return await app.start(); + }); + afterEach(async function () { + return await app.stop(); + }); + + it(`verifies that 'hot exit' works for dirty files`, async function () { + const textToType = 'Hello, Code!', fileName = 'readme.md', untitled = 'Untitled-1'; + await common.newUntitledFile(); + await common.type(textToType); + await dl.openExplorerViewlet(); + await common.openFile(fileName, true); + await common.type(textToType); + + await app.stop(); + await app.start(); + + // check tab presence + assert.ok(await common.getTab(untitled), `${untitled} tab is not present after reopening.`); + assert.ok(await common.getTab(fileName, true), `${fileName} tab is not present or is not active after reopening.`); + // check if they marked as dirty (icon) and active tab is the last opened + assert.ok(await dl.verifyTabIsDirty(untitled), `${untitled} tab is not dirty after reopening.`); + assert.ok(await dl.verifyTabIsDirty(fileName, true), `${fileName} tab is not dirty after reopening.`); + }); + + it(`verifies that contents of the dirty files are restored after 'hot exit'`, async function () { + // make one dirty file, + // create one untitled file + const textToType = 'Hello, Code!'; + + // create one untitled file + await common.newUntitledFile(); + await common.type(textToType); + + // make one dirty file, + await common.openFile('readme.md', true); + await common.type(textToType); + + await app.stop(); + await app.start(); + + // check their contents + let fileDirt = await common.getEditorFirstLinePlainText(); + assert.equal(fileDirt, 'Hello, Code', 'Active file contents are different after restore.'); // ignore '!' as it is a separate , first part is enough + await common.selectTab('Untitled-1'); + fileDirt = await common.getEditorFirstLinePlainText(); + assert.equal(fileDirt, textToType, 'Untitled file edit are different after restore.'); + }); + }); +} \ No newline at end of file diff --git a/test/smoke/src/tests/data-migration.ts b/test/smoke/src/tests/data-migration.ts new file mode 100644 index 0000000000000000000000000000000000000000..4c9ac38334d442d2c67149dd520801bd01f456dd --- /dev/null +++ b/test/smoke/src/tests/data-migration.ts @@ -0,0 +1,105 @@ +/*--------------------------------------------------------------------------------------------- + * 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 { SpectronApplication, USER_DIR, STABLE_PATH, LATEST_PATH, WORKSPACE_PATH, EXTENSIONS_DIR } from "../spectron/application"; +import { CommonActions } from '../areas/common'; + +let app: SpectronApplication; +let common: CommonActions; + +export function testDataMigration() { + if (!STABLE_PATH) { + return; + } + + context('Data Migration', () => { + + afterEach(async function () { + await app.stop(); + await common.removeDirectory(USER_DIR); + return await common.removeDirectory(EXTENSIONS_DIR); + }); + + function setupSpectron(context: Mocha.ITestCallbackContext, appPath: string, args?: string[]): void { + if (!args) { + args = []; + } + args.push(`--extensions-dir=${EXTENSIONS_DIR}`); + + app = new SpectronApplication(appPath, context.test.fullTitle(), context.test.currentRetry(), args, [`--user-data-dir=${USER_DIR}`]); + common = new CommonActions(app); + } + + it('checks if the Untitled file is restored migrating from stable to latest', async function () { + const textToType = 'Very dirty file'; + + // Setting up stable version + setupSpectron(this, STABLE_PATH); + await app.start(); + + await common.newUntitledFile(); + await common.type(textToType); + await app.stop(); + + await app.wait(); // wait until all resources are released (e.g. locked local storage) + + // Checking latest version for the restored state + setupSpectron(this, LATEST_PATH); + await app.start(); + + assert.ok(await common.getTab('Untitled-1'), 'Untitled-1 tab was not restored after migration.'); + await common.selectTab('Untitled-1'); + const editorText = await common.getEditorFirstLinePlainText(); + assert.equal(editorText, textToType, 'Typed editor text does not match to the one after migration.'); + }); + + it('checks if the newly created dirty file is restored migrating from stable to latest', async function () { + const fileName = 'test_data/plainFile', + firstTextPart = 'This is going to be an unsaved file', secondTextPart = '_that is dirty.'; + + // Setting up stable version + setupSpectron(this, STABLE_PATH, [fileName]); + await common.removeFile(`${fileName}`); + await app.start(); + + await common.type(firstTextPart); + await common.saveOpenedFile(); + await app.wait(); + await common.type(secondTextPart); + + await app.stop(); + await app.wait(); // wait until all resources are released (e.g. locked local storage) + + // Checking latest version for the restored state + setupSpectron(this, LATEST_PATH); + await app.start(); + assert.ok(await common.getTab(fileName.split('/')[1]), `${fileName} was not restored after migration.`); + await common.selectTab(fileName.split('/')[1]); + const editorText = await common.getEditorFirstLinePlainText(); + assert.equal(editorText, firstTextPart.concat(secondTextPart), 'Entered text was not correctly restored after migration.'); + + // Cleanup + await common.removeFile(`${fileName}`); + }); + + it('cheks if opened tabs are restored migrating from stable to latest', async function () { + const fileName1 = 'app.js', fileName2 = 'jsconfig.json', fileName3 = 'readme.md'; + setupSpectron(this, STABLE_PATH, [WORKSPACE_PATH]); + await app.start(); + await common.openFile(fileName1, true); + await common.openFile(fileName2, true); + await common.openFile(fileName3, true); + await app.stop(); + + setupSpectron(this, LATEST_PATH, [WORKSPACE_PATH]); + await app.start(); + assert.ok(await common.getTab(fileName1), `${fileName1} tab was not restored after migration.`); + assert.ok(await common.getTab(fileName2), `${fileName2} tab was not restored after migration.`); + assert.ok(await common.getTab(fileName3), `${fileName3} tab was not restored after migration.`); + }); + }); +} \ No newline at end of file diff --git a/test/smoke/src/tests/explorer.ts b/test/smoke/src/tests/explorer.ts new file mode 100644 index 0000000000000000000000000000000000000000..d1a4570f003cd0e17f73e5a3bf892540006f644a --- /dev/null +++ b/test/smoke/src/tests/explorer.ts @@ -0,0 +1,43 @@ +/*--------------------------------------------------------------------------------------------- + * 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 { SpectronApplication, LATEST_PATH, WORKSPACE_PATH } from "../spectron/application"; +import { CommonActions } from '../areas/common'; + +let app: SpectronApplication; +let common: CommonActions; + +export function testExplorer() { + context('Explorer', () => { + + beforeEach(async function () { + app = new SpectronApplication(LATEST_PATH, this.currentTest.fullTitle(), (this.currentTest as any).currentRetry(), [WORKSPACE_PATH]); + common = new CommonActions(app); + + return await app.start(); + }); + afterEach(async function () { + return await app.stop(); + }); + + it('quick open search produces correct result', async function () { + await common.openQuickOpen(); + await common.type('.js'); + await app.wait(); + const elCount = await common.getQuickOpenElements(); + assert.equal(elCount, 7); + }); + + it('quick open respects fuzzy matching', async function () { + await common.openQuickOpen(); + await common.type('a.s'); + await app.wait(); + const elCount = await common.getQuickOpenElements(); + assert.equal(elCount, 3); + }); + }); +} \ No newline at end of file diff --git a/test/smoke/src/tests/extensions.ts b/test/smoke/src/tests/extensions.ts new file mode 100644 index 0000000000000000000000000000000000000000..37890208d6c33f2f409cb3977d54d8af20d58802 --- /dev/null +++ b/test/smoke/src/tests/extensions.ts @@ -0,0 +1,75 @@ +/*--------------------------------------------------------------------------------------------- + * 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 { SpectronApplication, LATEST_PATH, WORKSPACE_PATH, EXTENSIONS_DIR } from "../spectron/application"; +import { CommonActions } from '../areas/common'; +import { Extensions } from "../areas/extensions"; + +var dns = require('dns'); + +let app: SpectronApplication; +let common: CommonActions; + +export function testExtensions() { + + context('Extensions', () => { + let extensions: Extensions; + + beforeEach(async function () { + const network = await networkAttached(); + if (!network) { + return Promise.reject('There is no network connection for testing extensions.'); + } + + app = new SpectronApplication(LATEST_PATH, this.currentTest.fullTitle(), (this.currentTest as any).currentRetry(), [WORKSPACE_PATH, `--extensions-dir=${EXTENSIONS_DIR}`]); + common = new CommonActions(app); + extensions = new Extensions(app, common); + await common.removeDirectory(EXTENSIONS_DIR); + + return await app.start(); + }); + afterEach(async function () { + await app.stop(); + return await common.removeDirectory(EXTENSIONS_DIR); + }); + + it(`installs 'vscode-icons' extension and verifies reload is prompted`, async function () { + const name = 'vscode-icons'; + await extensions.openExtensionsViewlet(); + await extensions.searchForExtension(name); + await app.wait(); + await extensions.installExtension(name); + await app.wait(); + assert.ok(await extensions.getExtensionReloadText(), 'Reload was not prompted after extension installation.'); + }); + + it(`installs an extension and checks if it works on restart`, async function () { + const name = 'vscode-icons'; + await extensions.openExtensionsViewlet(); + await extensions.searchForExtension(name); + await app.wait(); + await extensions.installExtension(name); + await app.wait(); + await extensions.getExtensionReloadText(); + + await app.stop(); + await app.wait(); // wait until all resources are released (e.g. locked local storage) + await app.start(); + await extensions.selectMinimalIconsTheme(); + const x = await extensions.verifyFolderIconAppearance(); + assert.ok(x); + }); + }); +} + +function networkAttached(): Promise { + return new Promise((res, rej) => { + dns.resolve('marketplace.visualstudio.com', (err) => { + err ? res(false) : res(true); + }); + }); +} \ No newline at end of file diff --git a/test/smoke/src/tests/git.ts b/test/smoke/src/tests/git.ts new file mode 100644 index 0000000000000000000000000000000000000000..98f2c761aa524d1f23ee9639db8cb3068dbe4f1a --- /dev/null +++ b/test/smoke/src/tests/git.ts @@ -0,0 +1,69 @@ +/*--------------------------------------------------------------------------------------------- + * 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 { SpectronApplication, LATEST_PATH, WORKSPACE_PATH } from "../spectron/application"; +import { CommonActions } from '../areas/common'; +import { Git } from "../areas/git"; + +let app: SpectronApplication; +let common: CommonActions; + +export function testGit() { + context('Git', () => { + let git: Git; + + beforeEach(async function () { + app = new SpectronApplication(LATEST_PATH, this.currentTest.fullTitle(), (this.currentTest as any).currentRetry(), [WORKSPACE_PATH]); + common = new CommonActions(app); + git = new Git(app, common); + + return await app.start(); + }); + afterEach(async function () { + return await app.stop(); + }); + + it('verifies current changes are picked up by Git viewlet', async function () { + const changesCount = await git.getScmIconChanges(); + assert.equal(changesCount, 2); + await git.openGitViewlet(); + assert.ok(await git.verifyScmChange('app.js'), 'app.js change does not appear in SCM viewlet.'); + assert.ok(await git.verifyScmChange('launch.json'), 'launch.json change does not appear in SCM viewlet.'); + }); + + it(`verifies 'app.js' diff viewer changes`, async function () { + await git.openGitViewlet(); + await common.openFile('app.js'); + const original = await git.getOriginalAppJsBodyVarName(); + assert.equal(original, 'bodyParser', 'Original value from diff view is wrong.'); + const modified = await git.getModifiedAppJsBodyVarName(); + assert.equal(modified, 'ydobParser', 'Modified value from diff view is wrong.'); + }); + + it(`stages 'app.js' changes and checks stage count`, async function () { + await git.openGitViewlet(); + await app.wait(); + await git.stageFile('app.js'); + const stagedCount = await git.getStagedCount(); + assert.equal(stagedCount, 1); + + // Return back to unstaged state + await git.unstageFile('app.js'); + }); + + it(`stages, commits change to 'app.js' locally and verifies outgoing change`, async function () { + await git.openGitViewlet(); + await app.wait(); + await git.stageFile('app.js'); + await git.focusOnCommitBox(); + await common.type('Test commit'); + await git.pressCommit(); + const changes = await git.getOutgoingChanges(); + assert.equal(changes, ' 0↓ 1↑', 'Changes indicator is wrong in a status bar.'); + }); + }); +} \ No newline at end of file diff --git a/test/smoke/src/tests/integrated-terminal.ts b/test/smoke/src/tests/integrated-terminal.ts new file mode 100644 index 0000000000000000000000000000000000000000..57ec1d42d09c086f56d3a6a9be662151c7d7c748 --- /dev/null +++ b/test/smoke/src/tests/integrated-terminal.ts @@ -0,0 +1,40 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import * as assert from 'assert'; + +import { SpectronApplication, LATEST_PATH, WORKSPACE_PATH } from "../spectron/application"; +import { CommonActions } from '../areas/common'; +import { IntegratedTerminal } from "../areas/integrated-terminal"; + +let app: SpectronApplication; +let common: CommonActions; + +export function testIntegratedTerminal() { + context('Integrated Terminal', () => { + let terminal: IntegratedTerminal; + + beforeEach(async function () { + app = new SpectronApplication(LATEST_PATH, this.currentTest.fullTitle(), (this.currentTest as any).currentRetry(), [WORKSPACE_PATH]); + common = new CommonActions(app); + terminal = new IntegratedTerminal(app); + + return await app.start(); + }); + afterEach(async function () { + return await app.stop(); + }); + + it(`opens terminal, runs 'echo' and verifies the output`, async function () { + const command = 'echo test'; + await terminal.openTerminal(common); + await app.wait(); + await common.type(command); + await common.enter(); + await app.wait(); + assert.ok(await terminal.commandOutputHas('test'), 'Terminal output does not contain echo.'); + }); + }); +} \ No newline at end of file diff --git a/test/smoke/src/tests/javascript-debug.ts b/test/smoke/src/tests/javascript-debug.ts new file mode 100644 index 0000000000000000000000000000000000000000..970fa6edabf4f1f9fd6d5838bced2060be8eeef8 --- /dev/null +++ b/test/smoke/src/tests/javascript-debug.ts @@ -0,0 +1,44 @@ +/*--------------------------------------------------------------------------------------------- + * 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 { SpectronApplication, LATEST_PATH, WORKSPACE_PATH } from "../spectron/application"; +import { CommonActions } from '../areas/common'; +import { JavaScriptDebug } from "../areas/javascript-debug"; + +let app: SpectronApplication; +let common: CommonActions; + +export function testJavaScriptDebug() { + context('Debugging JavaScript', () => { + let jsDebug: JavaScriptDebug; + + beforeEach(async function () { + app = new SpectronApplication(LATEST_PATH, this.currentTest.fullTitle(), (this.currentTest as any).currentRetry(), [WORKSPACE_PATH]); + common = new CommonActions(app); + jsDebug = new JavaScriptDebug(app); + + return await app.start(); + }); + afterEach(async function () { + return await app.stop(); + }); + + it('autodetects program attribute for launch.json', async function () { + await jsDebug.openDebugViewlet(); + await jsDebug.pressConfigureLaunchJson(); + const value = await jsDebug.getProgramConfigValue(); + process.platform === 'win32' ? assert.equal(value, '${workspaceRoot}\\bin\\www') : assert.equal(value, '${workspaceRoot}/bin/www'); + }); + + it(`can set a breakpoint and verify if it's set`, async function () { + await common.openFirstMatchFile('index.js'); + await jsDebug.setBreakpointOnLine(6); + const breakpoint = await jsDebug.verifyBreakpointOnLine(6); + assert.ok(breakpoint, 'Breakpoint was not found on line 6.'); + }); + }); +} \ No newline at end of file diff --git a/test/smoke/src/tests/javascript.ts b/test/smoke/src/tests/javascript.ts new file mode 100644 index 0000000000000000000000000000000000000000..b522ce5c66f9f40bcad7846b31bbf412c07ea888 --- /dev/null +++ b/test/smoke/src/tests/javascript.ts @@ -0,0 +1,87 @@ +/*--------------------------------------------------------------------------------------------- + * 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 { SpectronApplication, LATEST_PATH, WORKSPACE_PATH } from "../spectron/application"; +import { CommonActions } from '../areas/common'; +import { JavaScript } from "../areas/javascript"; + +let app: SpectronApplication; +let common: CommonActions; + +export function testJavaScript() { + context('JavaScript', () => { + let js: JavaScript; + + beforeEach(async function () { + app = new SpectronApplication(LATEST_PATH, this.currentTest.fullTitle(), (this.currentTest as any).currentRetry(), [WORKSPACE_PATH]); + common = new CommonActions(app); + js = new JavaScript(app); + + return await app.start(); + }); + afterEach(async function () { + return await app.stop(); + }); + + it('shows correct quick outline', async function () { + await common.openFirstMatchFile('bin/www'); + await js.openQuickOutline(); + await app.wait(); + const symbols = await common.getQuickOpenElements(); + assert.equal(symbols, 12, 'Quick outline elements count does not match to expected.'); + }); + + it(`finds 'All References' to 'app'`, async function () { + await common.openFirstMatchFile('bin/www'); + await js.findAppReferences(); + await app.wait(); + const titleCount = await js.getTitleReferencesCount(); + assert.equal(titleCount, 3, 'References count in widget title is not as expected.'); + const treeCount = await js.getTreeReferencesCount(); + assert.equal(treeCount, 3, 'References count in tree is not as expected.'); + }); + + it(`renames local 'app' variable`, async function () { + await common.openFirstMatchFile('bin/www'); + + const newVarName = 'newApp'; + await js.renameApp(newVarName); + await common.enter(); + const newName = await js.getNewAppName(); + assert.equal(newName, newVarName); + }); + + it('folds/unfolds the code correctly', async function () { + await common.openFirstMatchFile('bin/www'); + // Fold + await js.toggleFirstCommentFold(); + const foldedIcon = await js.getFirstCommentFoldedIcon(); + assert.ok(foldedIcon, 'Folded icon was not found in the margin.'); + let nextLineNumber = await js.getNextLineNumberAfterFold(); + assert.equal(nextLineNumber, 7, 'Line number after folded code is wrong.'); + // Unfold + await js.toggleFirstCommentFold(); + nextLineNumber = await js.getNextLineNumberAfterFold(); + assert.equal(nextLineNumber, 4, 'Line number with unfolded code is wrong.'); + }); + + it(`verifies that 'Go To Definition' works`, async function () { + await common.openFirstMatchFile('app.js'); + await js.goToExpressDefinition(); + await app.wait(); + assert.ok(await common.getTab('index.d.ts'), 'Tab opened when navigating to definition is not as expected.'); + }); + + it(`verifies that 'Peek Definition' works`, async function () { + await common.openFirstMatchFile('app.js'); + await js.peekExpressDefinition(); + await app.wait(); + const definitionFilename = await js.getPeekExpressResultName(); + assert.equal(definitionFilename, 'index.d.ts', 'Peek result is not as expected.'); + }); + }); +} \ No newline at end of file diff --git a/test/smoke/src/tests/localization.ts b/test/smoke/src/tests/localization.ts new file mode 100644 index 0000000000000000000000000000000000000000..3ac81ae2f75533c1fbf391c081c687be95c887a3 --- /dev/null +++ b/test/smoke/src/tests/localization.ts @@ -0,0 +1,49 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import * as assert from 'assert'; + +import { SpectronApplication, LATEST_PATH, WORKSPACE_PATH, USER_DIR } from "../spectron/application"; +import { CommonActions } from '../areas/common'; +import { Localization, ViewletType } from "../areas/localization"; + +let app: SpectronApplication; +let common: CommonActions; + +export function testLocalization() { + context('Localization', () => { + afterEach(async function () { + return await app.stop(); + }); + + it(`starts with 'DE' locale and verifies title and viewlets text is in German`, async function () { + app = new SpectronApplication(LATEST_PATH, this.test.fullTitle(), this.test.currentRetry(), [WORKSPACE_PATH, '--locale=DE'], [`--user-data-dir=${USER_DIR}`]); + common = new CommonActions(app); + const locale = new Localization(app); + common.removeDirectory(USER_DIR); + + await app.start(); + + let text = await locale.getOpenEditorsText(); + assert.equal(text.toLowerCase(), 'geöffnete editoren'); + + await locale.openViewlet(ViewletType.SEARCH); + text = await locale.getOpenedViewletTitle(); + assert.equal(text.toLowerCase(), 'suchen'); + + await locale.openViewlet(ViewletType.SCM); + text = await locale.getOpenedViewletTitle(); + assert.equal(text.toLowerCase(), 'quellcodeverwaltung: git'); + + await locale.openViewlet(ViewletType.DEBUG); + text = await locale.getOpenedViewletTitle(); + assert.equal(text.toLowerCase(), 'debuggen'); + + await locale.openViewlet(ViewletType.EXTENSIONS); + text = await locale.getExtensionsSearchPlaceholder(); + assert.equal(text.toLowerCase(), 'nach erweiterungen im marketplace suchen'); + }); + }); +} \ No newline at end of file diff --git a/test/smoke/src/tests/search.ts b/test/smoke/src/tests/search.ts new file mode 100644 index 0000000000000000000000000000000000000000..35ea09e7e46114cc91935a58d55f6223e2957e0e --- /dev/null +++ b/test/smoke/src/tests/search.ts @@ -0,0 +1,73 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import * as assert from 'assert'; + +import { SpectronApplication, LATEST_PATH, WORKSPACE_PATH } from "../spectron/application"; +import { CommonActions } from '../areas/common'; +import { Search } from "../areas/search"; + +let app: SpectronApplication; +let common: CommonActions; + +export function testSearch() { + context('Search', () => { + let search: Search; + + beforeEach(async function () { + app = new SpectronApplication(LATEST_PATH, this.currentTest.fullTitle(), (this.currentTest as any).currentRetry(), [WORKSPACE_PATH]); + common = new CommonActions(app); + search = new Search(app); + + return await app.start(); + }); + afterEach(async function () { + return await app.stop(); + }); + + it('searches for body & checks for correct result number', async function () { + const s = search; + await s.openSearchViewlet(); + await s.searchFor('body'); + const result = await s.getResultText(); + assert.equal(result, '7 results in 4 files'); + }); + + it('searches only for *.js files & checks for correct result number', async function () { + const s = search; + await s.openSearchViewlet(); + await s.searchFor('body'); + await s.toggleSearchDetails(); + await s.searchFor('*.js'); + const results = await s.getResultText(); + assert.equal(results, '4 results in 1 file'); + }); + + it('dismisses result & checks for correct result number', async function () { + const s = search; + await s.openSearchViewlet(); + await s.searchFor('body'); + await s.hoverOverResultCount(); + await s.dismissResult(); + await app.wait(); + const result = await s.getResultText(); + assert.equal(result, '3 results in 3 files', 'Result number after dismissal does not match to expected.'); + }); + + it('replaces first search result with a replace term', async function () { + const s = search; + await s.openSearchViewlet(); + await s.searchFor('body'); + await s.toggleReplace(); + await s.setReplaceText('ydob'); + await s.hoverOverResultCount(); + await s.replaceFirstMatch(); + await app.wait(); + await common.saveOpenedFile(); + const result = await s.getResultText(); + assert.equal(result, '3 results in 3 files', 'Result number after replacemenet does not match to expected.'); + }); + }); +} \ No newline at end of file diff --git a/test/smoke/src/tests/statusbar.ts b/test/smoke/src/tests/statusbar.ts new file mode 100644 index 0000000000000000000000000000000000000000..9038266b3343339cb584adf806a363d549820fc1 --- /dev/null +++ b/test/smoke/src/tests/statusbar.ts @@ -0,0 +1,94 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import * as assert from 'assert'; + +import { SpectronApplication, LATEST_PATH, WORKSPACE_PATH } from "../spectron/application"; +import { CommonActions } from '../areas/common'; +import { StatusBarElement, StatusBar } from "../areas/statusbar"; + +let app: SpectronApplication; +let common: CommonActions; + +export function testStatusbar() { + context('Status Bar', () => { + let statusBar: StatusBar; + + beforeEach(async function () { + app = new SpectronApplication(LATEST_PATH, this.currentTest.fullTitle(), (this.currentTest as any).currentRetry(), [WORKSPACE_PATH]); + common = new CommonActions(app); + statusBar = new StatusBar(app); + + return await app.start(); + }); + afterEach(async function () { + return await app.stop(); + }); + + it('verifies presence of all default status bar elements', async function () { + await app.wait(); + assert.ok(await statusBar.isVisible(StatusBarElement.BRANCH_STATUS), 'Branch indicator is not visible.'); + assert.ok(await statusBar.isVisible(StatusBarElement.FEEDBACK_ICON), 'Feedback icon is not visible.'); + assert.ok(await statusBar.isVisible(StatusBarElement.SYNC_STATUS), 'Sync indicator is not visible.'); + assert.ok(await statusBar.isVisible(StatusBarElement.PROBLEMS_STATUS), 'Problems indicator is not visible.'); + + await common.openFirstMatchFile('app.js'); + assert.ok(await statusBar.isVisible(StatusBarElement.ENCODING_STATUS), 'Encoding indicator is not visible.'); + assert.ok(await statusBar.isVisible(StatusBarElement.EOL_STATUS), 'EOL indicator is not visible.'); + assert.ok(await statusBar.isVisible(StatusBarElement.INDENTATION_STATUS), 'Indentation indicator is not visible.'); + assert.ok(await statusBar.isVisible(StatusBarElement.LANGUAGE_STATUS), 'Language indicator is not visible.'); + assert.ok(await statusBar.isVisible(StatusBarElement.SELECTION_STATUS), 'Selection indicator is not visible.'); + }); + + it(`verifies that 'quick open' opens when clicking on status bar elements`, async function () { + await app.wait(); + await statusBar.clickOn(StatusBarElement.BRANCH_STATUS); + assert.ok(await statusBar.isQuickOpenWidgetVisible(), 'Quick open is not opened for branch indicator.'); + await common.closeQuickOpen(); + + await common.openFirstMatchFile('app.js'); + await statusBar.clickOn(StatusBarElement.INDENTATION_STATUS); + assert.ok(await statusBar.isQuickOpenWidgetVisible(), 'Quick open is not opened for indentation indicator.'); + await common.closeQuickOpen(); + await statusBar.clickOn(StatusBarElement.ENCODING_STATUS); + assert.ok(await statusBar.isQuickOpenWidgetVisible(), 'Quick open is not opened for encoding indicator.'); + await common.closeQuickOpen(); + await statusBar.clickOn(StatusBarElement.EOL_STATUS); + assert.ok(await statusBar.isQuickOpenWidgetVisible(), 'Quick open is not opened for EOL indicator.'); + await common.closeQuickOpen(); + await statusBar.clickOn(StatusBarElement.LANGUAGE_STATUS); + assert.ok(await statusBar.isQuickOpenWidgetVisible(), 'Quick open is not opened for language indicator.'); + await common.closeQuickOpen(); + }); + + it(`verifies that 'Problems View' appears when clicking on 'Problems' status element`, async function () { + await statusBar.clickOn(StatusBarElement.PROBLEMS_STATUS); + assert.ok(await statusBar.getProblemsView()); + }); + + it(`verifies that 'Tweet us feedback' pop-up appears when clicking on 'Feedback' icon`, async function () { + await statusBar.clickOn(StatusBarElement.FEEDBACK_ICON); + assert.ok(await statusBar.getFeedbackView()); + }); + + it(`checks if 'Go to Line' works if called from the status bar`, async function () { + await common.openFirstMatchFile('app.js'); + await statusBar.clickOn(StatusBarElement.SELECTION_STATUS); + const lineNumber = 15; + await common.type(lineNumber.toString()); + await common.enter(); + assert.ok(await statusBar.getEditorHighlightedLine(lineNumber), 'Editor does not highlight the line.'); + }); + + it(`verifies if changing EOL is reflected in the status bar`, async function () { + await common.openFirstMatchFile('app.js'); + await statusBar.clickOn(StatusBarElement.EOL_STATUS); + await common.selectNextQuickOpenElement(); + await common.enter(); + const currentEOL = await statusBar.getEOLMode(); + assert.equal(currentEOL, 'CRLF'); + }); + }); +} \ No newline at end of file diff --git a/test/smoke/src/tests/tasks.ts b/test/smoke/src/tests/tasks.ts new file mode 100644 index 0000000000000000000000000000000000000000..f653d9dd07f870acc8ad9b4794a5cbd17255197e --- /dev/null +++ b/test/smoke/src/tests/tasks.ts @@ -0,0 +1,56 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import * as assert from 'assert'; + +import { SpectronApplication, LATEST_PATH, WORKSPACE_PATH } from "../spectron/application"; +import { Tasks } from "../areas/tasks"; + +let app: SpectronApplication; + +export function testTasks() { + context('Tasks', () => { + let tasks: Tasks; + + beforeEach(async function () { + app = new SpectronApplication(LATEST_PATH, this.currentTest.fullTitle(), (this.currentTest as any).currentRetry(), [WORKSPACE_PATH]); + tasks = new Tasks(app); + + return await app.start(); + }); + afterEach(async function () { + return await app.stop(); + }); + + it('verifies that eslint task results in 1 problem', async function () { + const expectedOutput = '1 problem (0 errors, 1 warning)'; + await tasks.build(); + const actualOutput = await tasks.outputContains(expectedOutput); + assert.ok(actualOutput, `Output does not contain the following string: '${expectedOutput}'`); + }); + + it(`is able to select 'Git' output`, async function () { + await tasks.build(); + await app.wait(); + await tasks.selectOutputViewType('Git'); + const viewType = await tasks.getOutputViewType(); + assert.equal(viewType, 'Git'); + }); + + it('ensures that build task produces error in index.js', async function () { + await tasks.build(); + assert.ok(await tasks.outputContains('index.js'), `Output does not contain error in index.js`); + }); + + it(`verifies build error is reflected in 'Problems View'`, async function () { + await tasks.build(); + await tasks.openProblemsView(); + const problemName = await tasks.getProblemsViewFirstElementName(); + assert.equal(problemName, 'index.js', `'index.js' is not a build error.`); + const problemsCount = await tasks.getProblemsViewFirstElementCount(); + assert.equal(problemsCount, '1', `Problem count is different to expected.`); + }); + }); +} \ No newline at end of file diff --git a/test/smoke/tsconfig.json b/test/smoke/tsconfig.json new file mode 100644 index 0000000000000000000000000000000000000000..733c1107e8353b420eb1c6f08069f2bb73a866fb --- /dev/null +++ b/test/smoke/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "module": "commonjs", + "noImplicitAny": false, + "removeComments": false, + "preserveConstEnums": true, + "target": "es2016", + "strictNullChecks": true, + "noUnusedParameters": false, + "noUnusedLocals": true, + "outDir": "out", + "sourceMap": true, + "lib": [ + "es2016", + "dom" + ] + }, + "exclude": [ + "node_modules" + ] +} diff --git a/tslint.json b/tslint.json index 9c0f132b77e5f62a007a623bb84b59ed93a629bb..c4cf2ab4630a00b4637712dcfcb1a36d46c90b7b 100644 --- a/tslint.json +++ b/tslint.json @@ -46,10 +46,338 @@ ], "import-patterns": [ true, + // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + // !!! Do not relax these rules !!! + // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + { + // vs/base/common cannot depend on anything else + "target": "**/vs/base/common/**", + "restrictions": [ + "vs/nls", + "**/vs/base/common/**" + ] + }, + { + // vs/base/test/common contains tests for vs/base/common + "target": "**/vs/base/test/common/**", + "restrictions": [ + "assert", + "vs/nls", + "**/vs/base/common/**", + "**/vs/base/test/common/**" + ] + }, + { + // vs/base/browser can only depend on vs/base/common + "target": "**/vs/base/browser/**", + "restrictions": [ + "vs/nls", + "vs/css!./**/*", + "**/vs/base/{common,browser}/**" + ] + }, + { + // vs/base/test/browser contains tests for vs/base/browser + "target": "**/vs/base/test/browser/**", + "restrictions": [ + "assert", + "vs/nls", + "**/vs/base/{common,browser}/**", + "**/vs/base/test/{common,browser}/**" + ] + }, + { + "target": "**/vs/base/parts/*/common/**", + "restrictions": [ + "vs/nls", + "**/vs/base/common/**", + "**/vs/base/parts/*/common/**" + ] + }, + { + "target": "**/vs/base/parts/*/browser/**", + "restrictions": [ + "vs/nls", + "vs/css!./**/*", + "**/vs/base/{common,browser}/**", + "**/vs/base/parts/*/{common,browser}/**" + ] + }, + { + "target": "**/vs/platform/*/common/**", + "restrictions": [ + "vs/nls", + "**/vs/base/common/**", + "**/vs/base/parts/*/common/**", + "**/vs/platform/*/common/**" + ] + }, + { + "target": "**/vs/platform/*/test/common/**", + "restrictions": [ + "assert", + "vs/nls", + "**/vs/base/common/**", + "**/vs/platform/*/common/**", + "**/vs/platform/*/test/common/**" + ] + }, + { + "target": "**/vs/platform/*/browser/**", + "restrictions": [ + "vs/nls", + "vs/css!./**/*", + "**/vs/base/{common,browser}/**", + "**/vs/base/parts/*/{common,browser}/**", + "**/vs/platform/*/{common,browser}/**" + ] + }, + { + "target": "**/vs/platform/*/test/browser/**", + "restrictions": [ + "assert", + "vs/nls", + "**/vs/base/{common,browser}/**", + "**/vs/platform/*/{common,browser}/**", + "**/vs/platform/*/test/{common,browser}/**" + ] + }, + { + "target": "**/vs/editor/common/**", + "restrictions": [ + "vs/nls", + "**/vs/base/common/**", + "**/vs/base/worker/**", + "**/vs/platform/*/common/**", + "**/vs/editor/common/**" + ] + }, + { + "target": "**/vs/editor/test/common/**", + "restrictions": [ + "assert", + "vs/nls", + "**/vs/base/common/**", + "**/vs/platform/*/common/**", + "**/vs/platform/*/test/common/**", + "**/vs/editor/common/**", + "**/vs/editor/test/common/**" + ] + }, + { + "target": "**/vs/editor/browser/**", + "restrictions": [ + "vs/nls", + "vs/css!./**/*", + "**/vs/base/{common,browser}/**", + "**/vs/platform/*/{common,browser}/**", + "**/vs/editor/{common,browser}/**" + ] + }, + { + "target": "**/vs/editor/test/browser/**", + "restrictions": [ + "assert", + "vs/nls", + "**/vs/base/{common,browser}/**", + "**/vs/platform/*/{common,browser}/**", + "**/vs/platform/*/test/{common,browser}/**", + "**/vs/editor/{common,browser}/**", + "**/vs/editor/test/{common,browser}/**" + ] + }, + { + "target": "**/vs/editor/standalone/common/**", + "restrictions": [ + "vs/nls", + "**/vs/base/common/**", + "**/vs/platform/*/common/**", + "**/vs/editor/common/**", + "**/vs/editor/standalone/common/**" + ] + }, + { + "target": "**/vs/editor/standalone/test/common/**", + "restrictions": [ + "assert", + "vs/nls", + "**/vs/base/common/**", + "**/vs/platform/*/common/**", + "**/vs/platform/*/test/common/**", + "**/vs/editor/common/**", + "**/vs/editor/test/common/**" + ] + }, + { + "target": "**/vs/editor/standalone/browser/**", + "restrictions": [ + "vs/nls", + "vs/css!./**/*", + "**/vs/base/{common,browser}/**", + "**/vs/base/parts/*/{common,browser}/**", + "**/vs/platform/*/{common,browser}/**", + "**/vs/editor/{common,browser}/**", + "**/vs/editor/contrib/**", + "**/vs/editor/standalone/{common,browser}/**" + ] + }, + { + "target": "**/vs/editor/standalone/test/browser/**", + "restrictions": [ + "assert", + "vs/nls", + "**/vs/base/{common,browser}/**", + "**/vs/platform/*/{common,browser}/**", + "**/vs/platform/*/test/{common,browser}/**", + "**/vs/editor/{common,browser}/**", + "**/vs/editor/standalone/{common,browser}/**", + "**/vs/editor/test/{common,browser}/**" + ] + }, + { + "target": "**/vs/editor/contrib/*/test/**", + "restrictions": [ + "assert", + "vs/nls", + "**/vs/base/{common,browser}/**", + "**/vs/base/test/{common,browser}/**", + "**/vs/base/parts/*/{common,browser}/**", + "**/vs/platform/*/{common,browser}/**", + "**/vs/platform/*/test/{common,browser}/**", + "**/vs/editor/{common,browser}/**", + "**/vs/editor/test/{common,browser}/**", + "**/vs/editor/contrib/**" + ] + }, + { + "target": "**/vs/editor/contrib/**", + "restrictions": [ + "vs/nls", + "vs/css!./**/*", + "**/vs/base/{common,browser}/**", + "**/vs/base/parts/*/{common,browser}/**", + "**/vs/platform/*/{common,browser}/**", + "**/vs/editor/{common,browser}/**", + "**/vs/editor/contrib/**" + ] + }, + { + "target": "**/vs/workbench/common/**", + "restrictions": [ + "vs/nls", + "vs/css!./**/*", + "**/vs/base/common/**", + "**/vs/base/parts/*/common/**", + "**/vs/platform/*/common/**", + "**/vs/editor/common/**", + "**/vs/editor/contrib/*/common/**", + "**/vs/workbench/common/**", + "**/vs/workbench/services/*/common/**", + "assert" + ] + }, + { + "target": "**/vs/workbench/browser/**", + "restrictions": [ + "vs/nls", + "vs/css!./**/*", + "**/vs/base/{common,browser}/**", + "**/vs/base/parts/*/{common,browser}/**", + "**/vs/platform/*/{common,browser}/**", + "**/vs/editor/{common,browser}/**", + "**/vs/editor/contrib/*/{common,browser}/**", + "**/vs/workbench/{common,browser}/**", + "**/vs/workbench/services/*/{common,browser}/**", + "assert" + ] + }, + { + "target": "**/vs/workbench/electron-browser/workbench.main.ts", + "restrictions": [ + "**" + ] + }, + { + "target": "**/vs/workbench/electron-browser/**", + "restrictions": [ + "vs/nls", + "vs/css!./**/*", + "**/vs/base/{common,browser,node,electron-browser}/**", + "**/vs/base/parts/*/{common,browser,node,electron-browser}/**", + "**/vs/platform/node/**", + "**/vs/platform/*/{common,browser,node,electron-browser}/**", + "**/vs/editor/{common,browser,node,electron-browser}/**", + "**/vs/editor/contrib/*/{common,browser,node,electron-browser}/**", + "**/vs/workbench/{common,browser,node,electron-browser,api}/**", + "**/vs/workbench/services/*/{common,browser,node,electron-browser}/**", + "*" // node modules + ] + }, + { + "target": "**/vs/workbench/node/**", + "restrictions": [ + "vs/nls", + "vs/css!./**/*", + "**/vs/base/{common,node}/**", + "**/vs/base/parts/*/{common,node}/**", + "**/vs/platform/node/**", + "**/vs/platform/*/{common,node}/**", + "**/vs/editor/{common,node}/**", + "**/vs/editor/contrib/*/{common,node}/**", + "**/vs/workbench/{common,node,api}/**", + "**/vs/workbench/services/*/{common,node}/**", + "*" // node modules + ] + }, + { + "target": "**/vs/workbench/services/**/test/**", + "restrictions": [ + "vs/nls", + "vs/css!./**/*", + "**/vs/base/**", + "**/vs/platform/**", + "**/vs/editor/**", + "**/vs/workbench/{common,browser,node,api,electron-browser}/**", + "vs/workbench/parts/files/common/editors/fileEditorInput", + "**/vs/workbench/services/**", + "**/vs/workbench/test/**", + "*" // node modules + ] + }, + { + "target": "**/vs/workbench/services/**", + "restrictions": [ + "vs/nls", + "vs/css!./**/*", + "**/vs/base/**", + "**/vs/platform/**", + "**/vs/editor/**", + "**/vs/workbench/{common,browser,node,api,electron-browser}/**", + "**/vs/workbench/services/**", + "*" // node modules + ] + }, + { + "target": "**/vs/code/**", + "restrictions": [ + "vs/nls", + "**/vs/base/**", + "**/vs/platform/**", + "**/vs/code/**", + "*" // node modules + ] + }, { "target": "**/{node,electron-browser,electron-main,extensions}/**", "restrictions": "**/*" }, + { + "target": "**/test/smoke/**", + "restrictions": [ + "**/test/smoke/**", + "*" + ] + }, { "target": "{**/**.test.ts,**/test/**}", "restrictions": "{**/vs/**,assert,sinon}" @@ -66,8 +394,10 @@ "node", "electron-main", "electron-browser", - "extensions" + "extensions", + "smoke" ] - ] + ], + "translation-remind": true } } \ No newline at end of file

", - "t": "text.html.php meta.embedded.block.php source.php string.quoted.double.php meta.string-contents.quoted.double.php", + "t": "text.html.php meta.embedded.block.php source.php meta.function-call.php string.quoted.double.php", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -2432,7 +2542,7 @@ }, { "c": "\"", - "t": "text.html.php meta.embedded.block.php source.php string.quoted.double.php punctuation.definition.string.end.php", + "t": "text.html.php meta.embedded.block.php source.php meta.function-call.php string.quoted.double.php punctuation.definition.string.end.php", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -2443,7 +2553,7 @@ }, { "c": ")", - "t": "text.html.php meta.embedded.block.php source.php", + "t": "text.html.php meta.embedded.block.php source.php meta.function-call.php punctuation.definition.arguments.end.bracket.round.php", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2519,7 +2629,7 @@ } }, { - "c": " (", + "c": " ", "t": "text.html.php meta.embedded.block.php source.php", "r": { "dark_plus": "default: #D4D4D4", @@ -2529,6 +2639,17 @@ "hc_black": "default: #FFFFFF" } }, + { + "c": "(", + "t": "text.html.php meta.embedded.block.php source.php punctuation.definition.begin.bracket.round.php", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, { "c": "$", "t": "text.html.php meta.embedded.block.php source.php variable.other.php punctuation.definition.variable.php", @@ -2739,7 +2860,18 @@ } }, { - "c": ") ", + "c": ")", + "t": "text.html.php meta.embedded.block.php source.php punctuation.definition.end.bracket.round.php", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": " ", "t": "text.html.php meta.embedded.block.php source.php", "r": { "dark_plus": "default: #D4D4D4", @@ -2783,7 +2915,7 @@ } }, { - "c": " (", + "c": " ", "t": "text.html.php meta.embedded.block.php source.php", "r": { "dark_plus": "default: #D4D4D4", @@ -2793,6 +2925,17 @@ "hc_black": "default: #FFFFFF" } }, + { + "c": "(", + "t": "text.html.php meta.embedded.block.php source.php punctuation.definition.begin.bracket.round.php", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, { "c": "$", "t": "text.html.php meta.embedded.block.php source.php variable.other.php punctuation.definition.variable.php", @@ -2860,7 +3003,18 @@ } }, { - "c": ") ", + "c": ")", + "t": "text.html.php meta.embedded.block.php source.php punctuation.definition.end.bracket.round.php", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": " ", "t": "text.html.php meta.embedded.block.php source.php", "r": { "dark_plus": "default: #D4D4D4", @@ -3004,7 +3158,7 @@ }, { "c": "print", - "t": "text.html.php meta.embedded.block.php source.php support.function.construct.output.php", + "t": "text.html.php meta.embedded.block.php source.php meta.function-call.php support.function.construct.output.php", "r": { "dark_plus": "support.function: #DCDCAA", "light_plus": "support.function: #795E26", @@ -3015,7 +3169,7 @@ }, { "c": "(", - "t": "text.html.php meta.embedded.block.php source.php", + "t": "text.html.php meta.embedded.block.php source.php meta.function-call.php punctuation.definition.arguments.begin.bracket.round.php", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -3026,7 +3180,7 @@ }, { "c": "\"", - "t": "text.html.php meta.embedded.block.php source.php string.quoted.double.php punctuation.definition.string.begin.php", + "t": "text.html.php meta.embedded.block.php source.php meta.function-call.php string.quoted.double.php punctuation.definition.string.begin.php", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -3037,7 +3191,7 @@ }, { "c": "Uncut Point: ", - "t": "text.html.php meta.embedded.block.php source.php string.quoted.double.php meta.string-contents.quoted.double.php", + "t": "text.html.php meta.embedded.block.php source.php meta.function-call.php string.quoted.double.php", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -3048,7 +3202,7 @@ }, { "c": "$", - "t": "text.html.php meta.embedded.block.php source.php string.quoted.double.php meta.string-contents.quoted.double.php variable.other.php punctuation.definition.variable.php", + "t": "text.html.php meta.embedded.block.php source.php meta.function-call.php string.quoted.double.php variable.other.php punctuation.definition.variable.php", "r": { "dark_plus": "variable: #9CDCFE", "light_plus": "variable: #001080", @@ -3059,7 +3213,7 @@ }, { "c": "deck", - "t": "text.html.php meta.embedded.block.php source.php string.quoted.double.php meta.string-contents.quoted.double.php variable.other.php", + "t": "text.html.php meta.embedded.block.php source.php meta.function-call.php string.quoted.double.php variable.other.php", "r": { "dark_plus": "variable: #9CDCFE", "light_plus": "variable: #001080", @@ -3070,7 +3224,7 @@ }, { "c": "[", - "t": "text.html.php meta.embedded.block.php source.php string.quoted.double.php meta.string-contents.quoted.double.php punctuation.section.array.begin.php", + "t": "text.html.php meta.embedded.block.php source.php meta.function-call.php string.quoted.double.php punctuation.section.array.begin.php", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -3081,7 +3235,7 @@ }, { "c": "$", - "t": "text.html.php meta.embedded.block.php source.php string.quoted.double.php meta.string-contents.quoted.double.php variable.other.index.php punctuation.definition.variable.php", + "t": "text.html.php meta.embedded.block.php source.php meta.function-call.php string.quoted.double.php variable.other.index.php punctuation.definition.variable.php", "r": { "dark_plus": "variable: #9CDCFE", "light_plus": "variable: #001080", @@ -3092,7 +3246,7 @@ }, { "c": "index", - "t": "text.html.php meta.embedded.block.php source.php string.quoted.double.php meta.string-contents.quoted.double.php variable.other.index.php", + "t": "text.html.php meta.embedded.block.php source.php meta.function-call.php string.quoted.double.php variable.other.index.php", "r": { "dark_plus": "variable: #9CDCFE", "light_plus": "variable: #001080", @@ -3103,7 +3257,7 @@ }, { "c": "]", - "t": "text.html.php meta.embedded.block.php source.php string.quoted.double.php meta.string-contents.quoted.double.php punctuation.section.array.end.php", + "t": "text.html.php meta.embedded.block.php source.php meta.function-call.php string.quoted.double.php punctuation.section.array.end.php", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -3114,7 +3268,7 @@ }, { "c": " ", - "t": "text.html.php meta.embedded.block.php source.php string.quoted.double.php meta.string-contents.quoted.double.php", + "t": "text.html.php meta.embedded.block.php source.php meta.function-call.php string.quoted.double.php", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -3125,7 +3279,7 @@ }, { "c": "\"", - "t": "text.html.php meta.embedded.block.php source.php string.quoted.double.php punctuation.definition.string.end.php", + "t": "text.html.php meta.embedded.block.php source.php meta.function-call.php string.quoted.double.php punctuation.definition.string.end.php", "r": { "dark_plus": "string: #CE9178", "light_plus": "string: #A31515", @@ -3136,7 +3290,7 @@ }, { "c": ")", - "t": "text.html.php meta.embedded.block.php source.php", + "t": "text.html.php meta.embedded.block.php source.php meta.function-call.php punctuation.definition.arguments.end.bracket.round.php", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -3235,7 +3389,7 @@ }, { "c": "\t", - "t": "text.html.php meta.embedded.block.php source.php meta.function.php", + "t": "text.html.php meta.embedded.block.php source.php", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -3279,7 +3433,7 @@ }, { "c": "(", - "t": "text.html.php meta.embedded.block.php source.php meta.function.php punctuation.definition.parameters.begin.php", + "t": "text.html.php meta.embedded.block.php source.php meta.function.php punctuation.definition.parameters.begin.bracket.round.php", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -3290,7 +3444,7 @@ }, { "c": ")", - "t": "text.html.php meta.embedded.block.php source.php meta.function.php punctuation.definition.parameters.end.php", + "t": "text.html.php meta.embedded.block.php source.php meta.function.php punctuation.definition.parameters.end.bracket.round.php", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -3409,4 +3563,4 @@ "hc_black": "punctuation.definition.tag: #808080" } } -] +] \ No newline at end of file diff --git a/extensions/powershell/.vscodeignore b/extensions/powershell/.vscodeignore new file mode 100644 index 0000000000000000000000000000000000000000..77ab386fc7df4fa2461a8f1ac8457a1e6c9e808a --- /dev/null +++ b/extensions/powershell/.vscodeignore @@ -0,0 +1 @@ +test/** \ No newline at end of file diff --git a/extensions/pug/.vscodeignore b/extensions/pug/.vscodeignore new file mode 100644 index 0000000000000000000000000000000000000000..77ab386fc7df4fa2461a8f1ac8457a1e6c9e808a --- /dev/null +++ b/extensions/pug/.vscodeignore @@ -0,0 +1 @@ +test/** \ No newline at end of file diff --git a/extensions/pug/syntaxes/pug.tmLanguage.json b/extensions/pug/syntaxes/pug.tmLanguage.json index 808be9e6db8c253c0e740bcdc5cb5bd15aa552b3..8a3d17a81dc2c7f72e57c5e4cce68b6da13717d6 100644 --- a/extensions/pug/syntaxes/pug.tmLanguage.json +++ b/extensions/pug/syntaxes/pug.tmLanguage.json @@ -1,4 +1,9 @@ { + "information_for_contributors": [ + "This file has been converted from https://github.com/davidrios/jade-tmbundle/blob/master/Syntaxes/Jade.tmLanguage", + "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." + ], "fileTypes": [ "jade" ], @@ -981,6 +986,5 @@ } }, "scopeName": "text.jade", - "uuid": "eee6ba25-6ac2-4f7e-9c70-cddf2bd3448b", - "version": "https://github.com/davidrios/jade-tmbundle/commit/f311a516bb29296fcebfdc7da8149b1c79dfb0a1" + "uuid": "eee6ba25-6ac2-4f7e-9c70-cddf2bd3448b" } \ No newline at end of file diff --git a/extensions/python/.vscodeignore b/extensions/python/.vscodeignore index 47cf365a0785e36c20eb55314ee0c06016fea193..ebab1d50b9ba0d8ac1a07d188a7fc624af042f6c 100644 --- a/extensions/python/.vscodeignore +++ b/extensions/python/.vscodeignore @@ -1 +1,3 @@ test/** +src/** +tsconfig.json \ No newline at end of file diff --git a/extensions/python/syntaxes/MagicPython.tmLanguage.json b/extensions/python/syntaxes/MagicPython.tmLanguage.json index f9d673e6273612098f68b3d74004d3ed768cb609..29e51b920fac4b4c480f7dab72f6b1990d387b67 100644 --- a/extensions/python/syntaxes/MagicPython.tmLanguage.json +++ b/extensions/python/syntaxes/MagicPython.tmLanguage.json @@ -1,4 +1,9 @@ { + "information_for_contributors": [ + "This file has been converted from https://github.com/MagicStack/MagicPython/blob/master/grammars/MagicPython.tmLanguage", + "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." + ], "name": "MagicPython", "scopeName": "source.python", "fileTypes": [ @@ -5230,6 +5235,5 @@ } ] } - }, - "version": "https://github.com/MagicStack/MagicPython/commit/976e59dcb78cb577e79c8f2117216c06718337e0" + } } \ No newline at end of file diff --git a/extensions/python/syntaxes/MagicRegExp.tmLanguage.json b/extensions/python/syntaxes/MagicRegExp.tmLanguage.json index b5795a7b89f3d854a9603335403fea6e74546cee..34d1a973578a4fa8a39c67c387c8a63777ea6b06 100644 --- a/extensions/python/syntaxes/MagicRegExp.tmLanguage.json +++ b/extensions/python/syntaxes/MagicRegExp.tmLanguage.json @@ -1,4 +1,9 @@ { + "information_for_contributors": [ + "This file has been converted from https://github.com/MagicStack/MagicPython/blob/master/grammars/MagicRegExp.tmLanguage", + "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." + ], "name": "MagicRegExp", "scopeName": "source.regexp.python", "fileTypes": [ @@ -460,6 +465,5 @@ } ] } - }, - "version": "https://github.com/MagicStack/MagicPython/commit/df5bb18c64252f2e7b1aa87e2ed124666d314f1d" + } } \ No newline at end of file diff --git a/extensions/r/.vscodeignore b/extensions/r/.vscodeignore new file mode 100644 index 0000000000000000000000000000000000000000..77ab386fc7df4fa2461a8f1ac8457a1e6c9e808a --- /dev/null +++ b/extensions/r/.vscodeignore @@ -0,0 +1 @@ +test/** \ No newline at end of file diff --git a/extensions/r/syntaxes/r.tmLanguage.json b/extensions/r/syntaxes/r.tmLanguage.json index 829be8d0d2b1576c8c469ae650215f50eeb8d8cc..025877c7ab4e1883d352fca9e3c766f62af24a7e 100644 --- a/extensions/r/syntaxes/r.tmLanguage.json +++ b/extensions/r/syntaxes/r.tmLanguage.json @@ -1,4 +1,9 @@ { + "information_for_contributors": [ + "This file has been converted from https://github.com/textmate/r.tmbundle/blob/master/Syntaxes/R.plist", + "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." + ], "fileTypes": [ "R", "r", @@ -199,6 +204,5 @@ } ], "scopeName": "source.r", - "uuid": "B2E6B78D-6E70-11D9-A369-000D93B3A10E", - "version": "https://github.com/textmate/r.tmbundle/commit/6b04ff3424f3f1cdfe64a9cfb71d8765959be250" + "uuid": "B2E6B78D-6E70-11D9-A369-000D93B3A10E" } \ No newline at end of file diff --git a/extensions/razor/.vscodeignore b/extensions/razor/.vscodeignore new file mode 100644 index 0000000000000000000000000000000000000000..77ab386fc7df4fa2461a8f1ac8457a1e6c9e808a --- /dev/null +++ b/extensions/razor/.vscodeignore @@ -0,0 +1 @@ +test/** \ No newline at end of file diff --git a/extensions/razor/syntaxes/cshtml.json b/extensions/razor/syntaxes/cshtml.json index 402915e8c9fc00c03e17a0f74d719b4f5c53e23c..180ad0e68dd234ed1f77e6e73144f8b3fa140179 100644 --- a/extensions/razor/syntaxes/cshtml.json +++ b/extensions/razor/syntaxes/cshtml.json @@ -1,4 +1,9 @@ { + "information_for_contributors": [ + "This file has been converted from https://github.com/demyte/language-cshtml/blob/master/grammars/cshtml.cson", + "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." + ], "name": "ASP.NET Razor", "scopeName": "text.html.cshtml", "fileTypes": [ @@ -148,6 +153,5 @@ "end": "\\*@", "name": "comment.block.cshtml" } - }, - "version": "https://github.com/demyte/language-cshtml/commit/a49735dc7aef56ae772a3bcfd8e42c89895dcff4" + } } \ No newline at end of file diff --git a/extensions/ruby/.vscodeignore b/extensions/ruby/.vscodeignore new file mode 100644 index 0000000000000000000000000000000000000000..77ab386fc7df4fa2461a8f1ac8457a1e6c9e808a --- /dev/null +++ b/extensions/ruby/.vscodeignore @@ -0,0 +1 @@ +test/** \ No newline at end of file diff --git a/extensions/ruby/language-configuration.json b/extensions/ruby/language-configuration.json index b508561c89747481089a8121201f4c4f4ae4c11a..fe8a5e9e2ac69d9e441245ddc1a09e911f656cfa 100644 --- a/extensions/ruby/language-configuration.json +++ b/extensions/ruby/language-configuration.json @@ -21,5 +21,9 @@ ["(", ")"], ["\"", "\""], ["'", "'"] - ] + ], + "indentationRules": { + "increaseIndentPattern": "^\\s*((begin|class|def|else|elsif|ensure|for|if|module|rescue|unless|until|when|while)|(.*\\sdo\\b))\\b[^\\{;]*$", + "decreaseIndentPattern": "^\\s*([}\\]]([,)]?\\s*(#|$)|\\.[a-zA-Z_]\\w*\\b)|(end|rescue|ensure|else|elsif|when)\\b)" + } } \ No newline at end of file diff --git a/extensions/ruby/package.json b/extensions/ruby/package.json index 0599300ca04fff78e823349b42b12239b5355012..827722f1683fd53f39d49d81d2d1e79cd6f70aa0 100644 --- a/extensions/ruby/package.json +++ b/extensions/ruby/package.json @@ -1,10 +1,8 @@ { "name": "ruby", - "version": "0.2.0", + "version": "0.2.1", "publisher": "vscode", "engines": { "vscode": "*" }, - "activationEvents": ["onLanguage:ruby"], - "main": "./out/rubyMain", "contributes": { "languages": [{ "id": "ruby", @@ -19,10 +17,5 @@ "scopeName": "source.ruby", "path": "./syntaxes/ruby.tmLanguage.json" }] - }, - "scripts": { - "compile": "gulp compile-extension:ruby", - "watch": "gulp watch-extension:ruby", - "update-grammar": "node ../../build/npm/update-grammar.js textmate/ruby.tmbundle Syntaxes/Ruby.plist ./syntaxes/ruby.tmLanguage.json" } } diff --git a/extensions/ruby/src/rubyMain.ts b/extensions/ruby/src/rubyMain.ts deleted file mode 100644 index fd899f545e3b0634dd81d84da11a8a8d35115e81..0000000000000000000000000000000000000000 --- a/extensions/ruby/src/rubyMain.ts +++ /dev/null @@ -1,15 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -'use strict'; -import { ExtensionContext, languages } from 'vscode'; - -export function activate(context: ExtensionContext): any { - languages.setLanguageConfiguration('ruby', { - indentationRules: { - increaseIndentPattern: /^\s*((begin|class|def|else|elsif|ensure|for|if|module|rescue|unless|until|when|while)|(.*\sdo\b))\b[^\{;]*$/, - decreaseIndentPattern: /^\s*([}\]]([,)]?\s*(#|$)|\.[a-zA-Z_]\w*\b)|(end|rescue|ensure|else|elsif|when)\b)/ - } - }); -} diff --git a/extensions/ruby/syntaxes/ruby.tmLanguage.json b/extensions/ruby/syntaxes/ruby.tmLanguage.json index dce58f758b1cfef9ca7a08b23ecd6e8dfdc33f9a..a6e0c01b7b9fa964ac5b3a26e214ec7fcd81f19d 100644 --- a/extensions/ruby/syntaxes/ruby.tmLanguage.json +++ b/extensions/ruby/syntaxes/ruby.tmLanguage.json @@ -1,4 +1,9 @@ { + "information_for_contributors": [ + "This file has been converted from https://github.com/textmate/ruby.tmbundle/blob/master/Syntaxes/Ruby.plist", + "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." + ], "comment": "\n\tTODO: unresolved issues\n\n\ttext:\n\t\"p <=0.0.6 <0.0.7", - "resolved": "https://registry.npmjs.org/vscode-extension-telemetry/-/vscode-extension-telemetry-0.0.6.tgz" + "version": "0.0.7", + "from": "vscode-extension-telemetry@>=0.0.7 <0.0.8", + "resolved": "https://registry.npmjs.org/vscode-extension-telemetry/-/vscode-extension-telemetry-0.0.7.tgz" }, "vscode-nls": { "version": "2.0.1", diff --git a/extensions/typescript/package.json b/extensions/typescript/package.json index a24c0c1051906aa6439f5d256acc17a95e6127a9..d70825157bd62fc141a4b2c91af87fa7e3ad104d 100644 --- a/extensions/typescript/package.json +++ b/extensions/typescript/package.json @@ -10,10 +10,11 @@ "engines": { "vscode": "*" }, + "enableProposedApi": true, "dependencies": { "semver": "4.3.6", - "vscode-extension-telemetry": "^0.0.7", - "vscode-nls": "^2.0.1" + "vscode-extension-telemetry": "0.0.7", + "vscode-nls": "2.0.1" }, "devDependencies": { "@types/node": "^7.0.4", @@ -21,7 +22,7 @@ }, "scripts": { "vscode:prepublish": "node ../../node_modules/gulp/bin/gulp.js --gulpfile ../../build/gulpfile.extensions.js compile-extension:typescript ./tsconfig.json", - "update-grammars": "node ./build/update-grammars.js" + "update-grammar": "node ./build/update-grammars.js" }, "activationEvents": [ "onLanguage:javascript", @@ -34,7 +35,8 @@ "onCommand:typescript.selectTypeScriptVersion", "onCommand:javascript.goToProjectConfig", "onCommand:typescript.goToProjectConfig", - "onCommand:typescript.openTsServerLog" + "onCommand:typescript.openTsServerLog", + "onCommand:workbench.action.tasks.runTask" ], "main": "./out/typescriptMain", "contributes": { @@ -102,6 +104,15 @@ "default": true, "description": "%typescript.check.tscVersion%" }, + "typescript.npm": { + "type": [ + "string", + "null" + ], + "default": null, + "description": "%typescript.npm%", + "isExecutable": true + }, "typescript.check.npmIsInstalled": { "type": "boolean", "default": true, @@ -114,7 +125,7 @@ }, "typescript.referencesCodeLens.enabled": { "type": "boolean", - "default": true, + "default": false, "description": "%typescript.referencesCodeLens.enabled%" }, "typescript.implementationsCodeLens.enabled": { @@ -163,6 +174,11 @@ "default": true, "description": "%format.insertSpaceAfterCommaDelimiter%" }, + "typescript.format.insertSpaceAfterConstructor": { + "type": "boolean", + "default": false, + "description": "%format.insertSpaceAfterConstructor%" + }, "typescript.format.insertSpaceAfterSemicolonInForStatements": { "type": "boolean", "default": true, @@ -238,6 +254,11 @@ "default": true, "description": "%format.insertSpaceAfterCommaDelimiter%" }, + "javascript.format.insertSpaceAfterConstructor": { + "type": "boolean", + "default": false, + "description": "%format.insertSpaceAfterConstructor%" + }, "javascript.format.insertSpaceAfterSemicolonInForStatements": { "type": "boolean", "default": true, @@ -312,6 +333,15 @@ "type": "boolean", "default": true, "description": "%javascript.nameSuggestions%" + }, + "typescript.tsc.autoDetect": { + "type": "string", + "default": "on", + "enum": [ + "on", + "off" + ], + "description": "%typescript.tsc.autoDetect%" } } }, @@ -428,6 +458,18 @@ "url": "http://json.schemastore.org/typings" } ], + "taskTypes": [ + { + "type": "typescript", + "required": ["tsconfig"], + "properties": { + "tsconfig": { + "type": "string", + "description": "The tsconfig file that defines the TS build" + } + } + } + ], "problemPatterns": [ { "name": "tsc", @@ -442,6 +484,7 @@ "problemMatchers": [ { "name": "tsc", + "label": "%typescript.problemMatchers.tsc.label%", "owner": "typescript", "applyTo": "closedDocuments", "fileLocation": [ @@ -452,6 +495,7 @@ }, { "name": "tsc-watch", + "label": "%typescript.problemMatchers.tscWatch.label%", "owner": "typescript", "applyTo": "closedDocuments", "fileLocation": [ @@ -459,7 +503,7 @@ "${cwd}" ], "pattern": "$tsc", - "watching": { + "background": { "activeOnStart": true, "beginsPattern": { "regexp": "^\\s*(?:message TS6032:|\\d{1,2}:\\d{1,2}:\\d{1,2}(?: AM| PM)? -) File change detected\\. Starting incremental compilation\\.\\.\\." diff --git a/extensions/typescript/package.nls.json b/extensions/typescript/package.nls.json index 821257b38a130d32a176b7c725d341ed4aeb68a1..890ac8e8ef6d6f8f3d206590d8900ce8398cc250 100644 --- a/extensions/typescript/package.nls.json +++ b/extensions/typescript/package.nls.json @@ -8,11 +8,11 @@ "typescript.check.tscVersion": "Check if a global install TypeScript compiler (e.g. tsc) differs from the used TypeScript language service.", "typescript.tsserver.log": "Enables logging of the TS server to a file. This log can be used to diagnose TS Server issues. The log may contain file paths, source code, and other potentially sensitive information from your project.", "typescript.tsserver.trace": "Enables tracing of messages sent to the TS server. This trace can be used to diagnose TS Server issues. The trace may contain file paths, source code, and other potentially sensitive information from your project.", - "typescript.tsserver.experimentalAutoBuild": "Enables experimental auto build. Requires 1.9 dev or 2.x tsserver version and a restart of VS Code after changing it.", "typescript.validate.enable": "Enable/disable TypeScript validation.", "typescript.format.enable": "Enable/disable default TypeScript formatter.", "javascript.format.enable": "Enable/disable default JavaScript formatter.", "format.insertSpaceAfterCommaDelimiter": "Defines space handling after a comma delimiter.", + "format.insertSpaceAfterConstructor": "Defines space handling after the constructor keyword. Requires TypeScript >= 2.3.0.", "format.insertSpaceAfterSemicolonInForStatements": " Defines space handling after a semicolon in a for statement.", "format.insertSpaceBeforeAndAfterBinaryOperators": "Defines space handling after a binary operator.", "format.insertSpaceAfterKeywordsInControlFlowStatements": "Defines space handling after keywords in a control flow statement.", @@ -36,6 +36,10 @@ "typescript.selectTypeScriptVersion.title": "Select TypeScript Version", "jsDocCompletion.enabled": "Enable/disable auto JSDoc comments", "javascript.implicitProjectConfig.checkJs": "Enable/disable semantic checking of JavaScript files. Existing jsconfig.json or tsconfig.json files override this setting. Requires TypeScript >=2.3.1.", - "typescript.check.npmIsInstalled": "Check if NPM is installed for automatic typings acquisition", - "javascript.nameSuggestions": "Enable/disable including unique names from the file in JavaScript suggestion lists." + "typescript.npm": "Specifies the path to the NPM executable used for Automatic Type Acquisition. Requires TypeScript >= 2.3.4.", + "typescript.check.npmIsInstalled": "Check if NPM is installed for Automatic Type Acquisition.", + "javascript.nameSuggestions": "Enable/disable including unique names from the file in JavaScript suggestion lists.", + "typescript.tsc.autoDetect": "Controls whether auto detection of tsc tasks is on or off.", + "typescript.problemMatchers.tsc.label": "TypeScript problems", + "typescript.problemMatchers.tscWatch.label": "TypeScript problems (watch mode)" } diff --git a/extensions/typescript/src/features/baseCodeLensProvider.ts b/extensions/typescript/src/features/baseCodeLensProvider.ts index 20952150c4b57dab1ade61c52ba54c6c88c32eb8..84ba69a0a96f299481ea764f0d96c6d39e8835a0 100644 --- a/extensions/typescript/src/features/baseCodeLensProvider.ts +++ b/extensions/typescript/src/features/baseCodeLensProvider.ts @@ -56,8 +56,7 @@ export abstract class TypeScriptBaseCodeLensProvider implements CodeLensProvider tree.childItems.forEach(item => this.walkNavTree(document, item, null, referenceableSpans)); } return referenceableSpans.map(span => new ReferencesCodeLens(document.uri, filepath, span)); - }, (err: any) => { - this.client.error(`'navtree' request failed with error.`, err); + }, () => { return []; }); } diff --git a/extensions/typescript/src/features/bufferSyncSupport.ts b/extensions/typescript/src/features/bufferSyncSupport.ts index f2b11faebefeae0afd256aae0f1d9ad8999e6c70..0fc4ab3eb2399e95eb098750bf61f2828acc6a54 100644 --- a/extensions/typescript/src/features/bufferSyncSupport.ts +++ b/extensions/typescript/src/features/bufferSyncSupport.ts @@ -50,8 +50,11 @@ class SyncedBuffer { } } - if (workspace.rootPath && this.client.apiVersion.has230Features()) { - args.projectRootPath = workspace.rootPath; + if (this.client.apiVersion.has230Features()) { + const root = this.client.getWorkspaceRootForResource(this.document.uri); + if (root) { + args.projectRootPath = root; + } } this.client.execute('open', args, false); @@ -104,9 +107,9 @@ export default class BufferSyncSupport { private readonly modeIds: Set; private readonly diagnostics: Diagnostics; private readonly disposables: Disposable[] = []; - private readonly syncedBuffers: ObjectMap; + private readonly syncedBuffers: Map; - private pendingDiagnostics: { [key: string]: number; }; + private pendingDiagnostics = new Map(); private readonly diagnosticDelayer: Delayer; private checkGlobalTSCVersion: boolean; @@ -116,10 +119,9 @@ export default class BufferSyncSupport { this.diagnostics = diagnostics; this._validate = validate; - this.pendingDiagnostics = Object.create(null); this.diagnosticDelayer = new Delayer(300); - this.syncedBuffers = Object.create(null); + this.syncedBuffers = new Map(); const tsConfig = workspace.getConfiguration('typescript'); this.checkGlobalTSCVersion = client.checkGlobalTSCVersion && this.modeIds.has('typescript') && tsConfig.get(checkTscVersionSettingKey, true); @@ -129,7 +131,6 @@ export default class BufferSyncSupport { workspace.onDidOpenTextDocument(this.onDidOpenTextDocument, this, this.disposables); workspace.onDidCloseTextDocument(this.onDidCloseTextDocument, this, this.disposables); workspace.onDidChangeTextDocument(this.onDidChangeTextDocument, this, this.disposables); - workspace.onDidSaveTextDocument(this.onDidSaveTextDocument, this, this.disposables); workspace.textDocuments.forEach(this.onDidOpenTextDocument, this); } @@ -142,13 +143,13 @@ export default class BufferSyncSupport { } public handles(file: string): boolean { - return !!this.syncedBuffers[file]; + return this.syncedBuffers.has(file); } public reOpenDocuments(): void { - Object.keys(this.syncedBuffers).forEach(key => { - this.syncedBuffers[key].open(); - }); + for (const buffer of this.syncedBuffers.values()) { + buffer.open(); + } } public dispose(): void { @@ -164,13 +165,13 @@ export default class BufferSyncSupport { if (!this.modeIds.has(document.languageId)) { return; } - let resource = document.uri; - let filepath = this.client.normalizePath(resource); + const resource = document.uri; + const filepath = this.client.normalizePath(resource); if (!filepath) { return; } - let syncedBuffer = new SyncedBuffer(document, filepath, this, this.client); - this.syncedBuffers[filepath] = syncedBuffer; + const syncedBuffer = new SyncedBuffer(document, filepath, this, this.client); + this.syncedBuffers.set(filepath, syncedBuffer); syncedBuffer.open(); this.requestDiagnostic(filepath); if (document.languageId === 'typescript' || document.languageId === 'typescriptreact') { @@ -183,12 +184,12 @@ export default class BufferSyncSupport { if (!filepath) { return; } - let syncedBuffer = this.syncedBuffers[filepath]; + const syncedBuffer = this.syncedBuffers.get(filepath); if (!syncedBuffer) { return; } this.diagnostics.delete(filepath); - delete this.syncedBuffers[filepath]; + this.syncedBuffers.delete(filepath); syncedBuffer.close(); if (!fs.existsSync(filepath)) { this.requestAllDiagnostics(); @@ -200,41 +201,32 @@ export default class BufferSyncSupport { if (!filepath) { return; } - let syncedBuffer = this.syncedBuffers[filepath]; + let syncedBuffer = this.syncedBuffers.get(filepath); if (!syncedBuffer) { return; } syncedBuffer.onContentChanged(e.contentChanges); } - private onDidSaveTextDocument(document: TextDocument): void { - let filepath = this.client.normalizePath(document.uri); - if (!filepath) { - return; - } - let syncedBuffer = this.syncedBuffers[filepath]; - if (!syncedBuffer) { - return; - } - } - public requestAllDiagnostics() { if (!this._validate) { return; } - Object.keys(this.syncedBuffers).forEach(filePath => this.pendingDiagnostics[filePath] = Date.now()); + for (const filePath of this.syncedBuffers.keys()) { + this.pendingDiagnostics.set(filePath, Date.now()); + } this.diagnosticDelayer.trigger(() => { this.sendPendingDiagnostics(); }, 200); } public requestDiagnostic(file: string): void { - if (!this._validate || this.client.experimentalAutoBuild) { + if (!this._validate) { return; } - this.pendingDiagnostics[file] = Date.now(); - let buffer = this.syncedBuffers[file]; + this.pendingDiagnostics.set(file, Date.now()); + const buffer = this.syncedBuffers.get(file); let delay = 300; if (buffer) { let lineCount = buffer.lineCount; @@ -249,10 +241,10 @@ export default class BufferSyncSupport { if (!this._validate) { return; } - let files = Object.keys(this.pendingDiagnostics).map((key) => { + let files = Array.from(this.pendingDiagnostics.entries()).map(([key, value]) => { return { file: key, - time: this.pendingDiagnostics[key] + time: value }; }).sort((a, b) => { return a.time - b.time; @@ -261,18 +253,20 @@ export default class BufferSyncSupport { }); // Add all open TS buffers to the geterr request. They might be visible - Object.keys(this.syncedBuffers).forEach((file) => { - if (!this.pendingDiagnostics[file]) { + for (const file of this.syncedBuffers.keys()) { + if (!this.pendingDiagnostics.get(file)) { files.push(file); } - }); + } - let args: Proto.GeterrRequestArgs = { - delay: 0, - files: files - }; - this.client.execute('geterr', args, false); - this.pendingDiagnostics = Object.create(null); + if (files.length) { + const args: Proto.GeterrRequestArgs = { + delay: 0, + files: files + }; + this.client.execute('geterr', args, false); + } + this.pendingDiagnostics.clear(); } private checkTSCVersion() { @@ -298,7 +292,7 @@ export default class BufferSyncSupport { } if (tscVersion && tscVersion !== this.client.apiVersion.versionString) { window.showInformationMessage( - localize('versionMismatch', 'Version mismatch! global tsc ({0}) != VS Code\'s language service ({1}). Inconsistent compile errors might occur', tscVersion, this.client.apiVersion.versionString), + localize('versionMismatch', 'Using TypeScript ({1}) for editor features. TypeScript ({0}) is installed globally on your machine. Errors in VS Code may differ from TSC errors', tscVersion, this.client.apiVersion.versionString), { title: localize('moreInformation', 'More Information'), id: 1 diff --git a/extensions/typescript/src/features/completionItemProvider.ts b/extensions/typescript/src/features/completionItemProvider.ts index 5f0740be10ccfe0c552b3d93a122a3ecb695a672..90a3f56b30ebb920329bf85ff71fadb72435161d 100644 --- a/extensions/typescript/src/features/completionItemProvider.ts +++ b/extensions/typescript/src/features/completionItemProvider.ts @@ -223,8 +223,7 @@ export default class TypeScriptCompletionItemProvider implements CompletionItemP } return completionItems; - }, (err) => { - this.client.error(`'completions' request failed with error.`, err); + }, () => { return []; }); } @@ -264,8 +263,7 @@ export default class TypeScriptCompletionItemProvider implements CompletionItemP } return item; - }, (err) => { - this.client.error(`'completionEntryDetails' request failed with error.`, err); + }, () => { return item; }); } diff --git a/extensions/typescript/src/features/definitionProviderBase.ts b/extensions/typescript/src/features/definitionProviderBase.ts index b405d28fbaf1f1b823ab8a2e2b5dcfdb99675475..78768df2fee89efe70e52ff0ca7a3aaa358afeed 100644 --- a/extensions/typescript/src/features/definitionProviderBase.ts +++ b/extensions/typescript/src/features/definitionProviderBase.ts @@ -40,8 +40,7 @@ export default class TypeScriptDefinitionProviderBase { return new Location(resource, new Range(location.start.line - 1, location.start.offset - 1, location.end.line - 1, location.end.offset - 1)); } }).filter(x => x !== null) as Location[]; - }, (error) => { - this.client.error(`'${definitionType}' request failed with error.`, error); + }, () => { return []; }); } diff --git a/extensions/typescript/src/features/documentHighlightProvider.ts b/extensions/typescript/src/features/documentHighlightProvider.ts index f0140953d923c45ff860bba51ce0dbfa1571561f..15224ca2c2e43f531888c4a102da1b84e14a3186 100644 --- a/extensions/typescript/src/features/documentHighlightProvider.ts +++ b/extensions/typescript/src/features/documentHighlightProvider.ts @@ -43,8 +43,7 @@ export default class TypeScriptDocumentHighlightProvider implements DocumentHigh }); } return []; - }, (err) => { - this.client.error(`'occurrences' request failed with error.`, err); + }, () => { return []; }); } diff --git a/extensions/typescript/src/features/documentSymbolProvider.ts b/extensions/typescript/src/features/documentSymbolProvider.ts index aa6a4e5ab7f641aaacc8ceb50a28a58f1d4e003f..9fbaf64fc8055478344e588d855dc18a710c8fb7 100644 --- a/extensions/typescript/src/features/documentSymbolProvider.ts +++ b/extensions/typescript/src/features/documentSymbolProvider.ts @@ -33,18 +33,19 @@ export default class TypeScriptDocumentSymbolProvider implements DocumentSymbolP public constructor( private client: ITypescriptServiceClient) { } - public provideDocumentSymbols(resource: TextDocument, token: CancellationToken): Promise { + public async provideDocumentSymbols(resource: TextDocument, token: CancellationToken): Promise { const filepath = this.client.normalizePath(resource.uri); if (!filepath) { - return Promise.resolve([]); + return []; } const args: Proto.FileRequestArgs = { file: filepath }; - if (this.client.apiVersion.has206Features()) { - return this.client.execute('navtree', args, token).then((response) => { - const result: SymbolInformation[] = []; + try { + const result: SymbolInformation[] = []; + if (this.client.apiVersion.has206Features()) { + const response = await this.client.execute('navtree', args, token); if (response.body) { // The root represents the file. Ignore this when showing in the UI let tree = response.body; @@ -52,25 +53,17 @@ export default class TypeScriptDocumentSymbolProvider implements DocumentSymbolP tree.childItems.forEach(item => TypeScriptDocumentSymbolProvider.convertNavTree(resource.uri, result, item)); } } - return result; - }, (err) => { - this.client.error(`'navtree' request failed with error.`, err); - return []; - }); - } else { - return this.client.execute('navbar', args, token).then((response) => { - const result: SymbolInformation[] = []; + } else { + const response = await this.client.execute('navbar', args, token); if (response.body) { let foldingMap: ObjectMap = Object.create(null); response.body.forEach(item => TypeScriptDocumentSymbolProvider.convertNavBar(resource.uri, 0, foldingMap, result, item)); } - return result; - }, (err) => { - this.client.error(`'navbar' request failed with error.`, err); - return []; - }); + } + return result; + } catch (e) { + return []; } - } private static convertNavBar(resource: Uri, indent: number, foldingMap: ObjectMap, bucket: SymbolInformation[], item: Proto.NavigationBarItem, containerLabel?: string): void { diff --git a/extensions/typescript/src/features/formattingProvider.ts b/extensions/typescript/src/features/formattingProvider.ts index 40b5522d0fa19d86d1c39fee77a2a3a72756f700..2687d317b2b4468faa9fb796c5ee66424f5ff8e3 100644 --- a/extensions/typescript/src/features/formattingProvider.ts +++ b/extensions/typescript/src/features/formattingProvider.ts @@ -11,6 +11,7 @@ import { ITypescriptServiceClient } from '../typescriptService'; interface Configuration { enable: boolean; insertSpaceAfterCommaDelimiter: boolean; + insertSpaceAfterConstructor: boolean; insertSpaceAfterSemicolonInForStatements: boolean; insertSpaceBeforeAndAfterBinaryOperators: boolean; insertSpaceAfterKeywordsInControlFlowStatements: boolean; @@ -23,30 +24,29 @@ interface Configuration { insertSpaceBeforeFunctionParenthesis: boolean; placeOpenBraceOnNewLineForFunctions: boolean; placeOpenBraceOnNewLineForControlBlocks: boolean; - - [key: string]: boolean; } namespace Configuration { - export const insertSpaceAfterCommaDelimiter: string = 'insertSpaceAfterCommaDelimiter'; - export const insertSpaceAfterSemicolonInForStatements: string = 'insertSpaceAfterSemicolonInForStatements'; - export const insertSpaceBeforeAndAfterBinaryOperators: string = 'insertSpaceBeforeAndAfterBinaryOperators'; - export const insertSpaceAfterKeywordsInControlFlowStatements: string = 'insertSpaceAfterKeywordsInControlFlowStatements'; - export const insertSpaceAfterFunctionKeywordForAnonymousFunctions: string = 'insertSpaceAfterFunctionKeywordForAnonymousFunctions'; - export const insertSpaceBeforeFunctionParenthesis: string = 'insertSpaceBeforeFunctionParenthesis'; - export const insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: string = 'insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis'; - export const insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets: string = 'insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets'; - export const insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces: string = 'insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces'; - export const insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces: string = 'insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces'; - export const insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces: string = 'insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces'; - export const placeOpenBraceOnNewLineForFunctions: string = 'placeOpenBraceOnNewLineForFunctions'; - export const placeOpenBraceOnNewLineForControlBlocks: string = 'placeOpenBraceOnNewLineForControlBlocks'; + export const insertSpaceAfterCommaDelimiter = 'insertSpaceAfterCommaDelimiter'; + export const insertSpaceAfterConstructor = 'insertSpaceAfterConstructor'; + export const insertSpaceAfterSemicolonInForStatements = 'insertSpaceAfterSemicolonInForStatements'; + export const insertSpaceBeforeAndAfterBinaryOperators = 'insertSpaceBeforeAndAfterBinaryOperators'; + export const insertSpaceAfterKeywordsInControlFlowStatements = 'insertSpaceAfterKeywordsInControlFlowStatements'; + export const insertSpaceAfterFunctionKeywordForAnonymousFunctions = 'insertSpaceAfterFunctionKeywordForAnonymousFunctions'; + export const insertSpaceBeforeFunctionParenthesis = 'insertSpaceBeforeFunctionParenthesis'; + export const insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis = 'insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis'; + export const insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets = 'insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets'; + export const insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces = 'insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces'; + export const insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces = 'insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces'; + export const insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces = 'insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces'; + export const placeOpenBraceOnNewLineForFunctions = 'placeOpenBraceOnNewLineForFunctions'; + export const placeOpenBraceOnNewLineForControlBlocks = 'placeOpenBraceOnNewLineForControlBlocks'; export function equals(a: Configuration, b: Configuration): boolean { let keys = Object.keys(a); for (let i = 0; i < keys.length; i++) { let key = keys[i]; - if (a[key] !== b[key]) { + if ((a as any)[key] !== (b as any)[key]) { return false; } } @@ -57,6 +57,7 @@ namespace Configuration { let result: Configuration = Object.create(null); result.enable = true; result.insertSpaceAfterCommaDelimiter = true; + result.insertSpaceAfterConstructor = false; result.insertSpaceAfterSemicolonInForStatements = true; result.insertSpaceBeforeAndAfterBinaryOperators = true; result.insertSpaceAfterKeywordsInControlFlowStatements = true; @@ -136,8 +137,7 @@ export default class TypeScriptFormattingProvider implements DocumentRangeFormat } else { return []; } - }, (err: any) => { - this.client.error(`'format' request failed with error.`, err); + }, () => { return []; }); }); @@ -195,8 +195,7 @@ export default class TypeScriptFormattingProvider implements DocumentRangeFormat } } return result; - }, (err: any) => { - this.client.error(`'formatonkey' request failed with error.`, err); + }, () => { return []; }); }); @@ -215,6 +214,7 @@ export default class TypeScriptFormattingProvider implements DocumentRangeFormat // We can use \n here since the editor normalizes later on to its line endings. newLineCharacter: '\n', insertSpaceAfterCommaDelimiter: this.config.insertSpaceAfterCommaDelimiter, + insertSpaceAfterConstructor: this.config.insertSpaceAfterConstructor, insertSpaceAfterSemicolonInForStatements: this.config.insertSpaceAfterSemicolonInForStatements, insertSpaceBeforeAndAfterBinaryOperators: this.config.insertSpaceBeforeAndAfterBinaryOperators, insertSpaceAfterKeywordsInControlFlowStatements: this.config.insertSpaceAfterKeywordsInControlFlowStatements, @@ -226,7 +226,8 @@ export default class TypeScriptFormattingProvider implements DocumentRangeFormat insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces: this.config.insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces, insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces: this.config.insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces, placeOpenBraceOnNewLineForFunctions: this.config.placeOpenBraceOnNewLineForFunctions, - placeOpenBraceOnNewLineForControlBlocks: this.config.placeOpenBraceOnNewLineForControlBlocks + placeOpenBraceOnNewLineForControlBlocks: this.config.placeOpenBraceOnNewLineForControlBlocks, + }; } } diff --git a/extensions/typescript/src/features/hoverProvider.ts b/extensions/typescript/src/features/hoverProvider.ts index e726ff1dc347826868d71f24876b101229913b9c..a0914aa17306ee6796ed39db9f340d48e830630b 100644 --- a/extensions/typescript/src/features/hoverProvider.ts +++ b/extensions/typescript/src/features/hoverProvider.ts @@ -32,8 +32,7 @@ export default class TypeScriptHoverProvider implements HoverProvider { new Range(data.start.line - 1, data.start.offset - 1, data.end.line - 1, data.end.offset - 1)); } return undefined; - }, (err) => { - this.client.error(`'quickinfo' request failed with error.`, err); + }, () => { return null; }); } diff --git a/extensions/typescript/src/features/jsDocCompletionProvider.ts b/extensions/typescript/src/features/jsDocCompletionProvider.ts index da02e942bfc3c1c0cb8612331a06f03e29ce9e7e..502cf89c42c71f6f95389e573b325d480ed1341c 100644 --- a/extensions/typescript/src/features/jsDocCompletionProvider.ts +++ b/extensions/typescript/src/features/jsDocCompletionProvider.ts @@ -88,7 +88,7 @@ export class TryCompleteJsDocCommand { static COMMAND_NAME = '_typeScript.tryCompleteJsDoc'; constructor( - private client: ITypescriptServiceClient + private lazyClient: () => ITypescriptServiceClient ) { } /** @@ -96,7 +96,7 @@ export class TryCompleteJsDocCommand { * if possible, otherwise falling back to a default comment format. */ public tryCompleteJsDoc(resource: Uri, start: Position, shouldGetJSDocFromTSServer: boolean): Thenable { - const file = this.client.normalizePath(resource); + const file = this.lazyClient().normalizePath(resource); if (!file) { return Promise.resolve(false); } @@ -126,7 +126,7 @@ export class TryCompleteJsDocCommand { offset: position.character + 1 }; return Promise.race([ - this.client.execute('docCommentTemplate', args), + this.lazyClient().execute('docCommentTemplate', args), new Promise((_, reject) => setTimeout(reject, 250)) ]).then((res: DocCommandTemplateResponse) => { if (!res || !res.body) { diff --git a/extensions/typescript/src/features/previewer.ts b/extensions/typescript/src/features/previewer.ts index c418e92d59ab7580424f5031e70c972c8905e6de..5865b560d2b0a34b5d65f087c584dbe0bdd89cf9 100644 --- a/extensions/typescript/src/features/previewer.ts +++ b/extensions/typescript/src/features/previewer.ts @@ -37,6 +37,7 @@ function tagsPlainPreview(tags: Proto.JSDocTagInfo[]): string { } export function plainDocumentation(documentation: Proto.SymbolDisplayPart[], tags: Proto.JSDocTagInfo[]): string { - const parts = [plain(documentation), tagsPlainPreview(tags)]; + const processedDocumentation = plain(documentation).replace(/\n([ \t]*\n)?/gm, (x) => x.length >= 2 ? '\n\n' : ' '); + const parts = [processedDocumentation, tagsPlainPreview(tags)]; return parts.filter(x => x).join('\n\n'); } \ No newline at end of file diff --git a/extensions/typescript/src/features/refactorProvider.ts b/extensions/typescript/src/features/refactorProvider.ts new file mode 100644 index 0000000000000000000000000000000000000000..4e930e09d8065514e5bd0573109c468e51e55ede --- /dev/null +++ b/extensions/typescript/src/features/refactorProvider.ts @@ -0,0 +1,128 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +'use strict'; + +import { CodeActionProvider, TextDocument, Range, CancellationToken, CodeActionContext, Command, commands, workspace, WorkspaceEdit, window, QuickPickItem } from 'vscode'; + +import * as Proto from '../protocol'; +import { ITypescriptServiceClient } from '../typescriptService'; + + +export default class TypeScriptRefactorProvider implements CodeActionProvider { + private doRefactorCommandId: string; + private selectRefactorCommandId: string; + + constructor( + private readonly client: ITypescriptServiceClient, + mode: string + ) { + this.doRefactorCommandId = `_typescript.applyRefactoring.${mode}`; + this.selectRefactorCommandId = `_typescript.selectRefactoring.${mode}`; + + commands.registerCommand(this.doRefactorCommandId, this.doRefactoring, this); + commands.registerCommand(this.selectRefactorCommandId, this.selectRefactoring, this); + + } + + public async provideCodeActions( + document: TextDocument, + range: Range, + _context: CodeActionContext, + token: CancellationToken + ): Promise { + if (!this.client.apiVersion.has240Features()) { + return []; + } + + const file = this.client.normalizePath(document.uri); + if (!file) { + return []; + } + + const args: Proto.GetApplicableRefactorsRequestArgs = { + file: file, + startLine: range.start.line + 1, + startOffset: range.start.character + 1, + endLine: range.end.line + 1, + endOffset: range.end.character + 1 + }; + + try { + const response = await this.client.execute('getApplicableRefactors', args, token); + if (!response || !response.body) { + return []; + } + + const actions: Command[] = []; + for (const info of response.body) { + if (info.inlineable === false) { + actions.push({ + title: info.description, + command: this.selectRefactorCommandId, + arguments: [file, info, range] + }); + } else { + for (const action of info.actions) { + actions.push({ + title: action.description, + command: this.doRefactorCommandId, + arguments: [file, info.name, action.name, range] + }); + } + } + } + return actions; + } catch (err) { + return []; + } + } + + private toWorkspaceEdit(edits: Proto.FileCodeEdits[]): WorkspaceEdit { + const workspaceEdit = new WorkspaceEdit(); + for (const edit of edits) { + for (const textChange of edit.textChanges) { + workspaceEdit.replace(this.client.asUrl(edit.fileName), + new Range( + textChange.start.line - 1, textChange.start.offset - 1, + textChange.end.line - 1, textChange.end.offset - 1), + textChange.newText); + } + } + return workspaceEdit; + } + + private async selectRefactoring(file: string, info: Proto.ApplicableRefactorInfo, range: Range): Promise { + return window.showQuickPick(info.actions.map((action): QuickPickItem => ({ + label: action.name, + description: action.description + }))).then(selected => { + if (!selected) { + return false; + } + return this.doRefactoring(file, info.name, selected.label, range); + }); + } + + private async doRefactoring(file: string, refactor: string, action: string, range: Range): Promise { + const args: Proto.GetEditsForRefactorRequestArgs = { + file, + refactor, + action, + startLine: range.start.line + 1, + startOffset: range.start.character + 1, + endLine: range.end.line + 1, + endOffset: range.end.character + 1 + }; + + const response = await this.client.execute('getEditsForRefactor', args); + if (!response || !response.body || !response.body.edits.length) { + return false; + } + + const edit = this.toWorkspaceEdit(response.body.edits); + return workspace.applyEdit(edit); + } +} \ No newline at end of file diff --git a/extensions/typescript/src/features/referenceProvider.ts b/extensions/typescript/src/features/referenceProvider.ts index 47921d128ea8c83603ad54f751725be4c1e5eea1..9f7ccf9f49ae156d13af3befc54680de84ee111e 100644 --- a/extensions/typescript/src/features/referenceProvider.ts +++ b/extensions/typescript/src/features/referenceProvider.ts @@ -41,8 +41,7 @@ export default class TypeScriptReferenceSupport implements ReferenceProvider { result.push(location); } return result; - }, (err) => { - this.client.error(`'references' request failed with error.`, err); + }, () => { return []; }); } diff --git a/extensions/typescript/src/features/renameProvider.ts b/extensions/typescript/src/features/renameProvider.ts index 39c85f307a736baadea38abdc5871ff1616890e3..450523b4ade597ab498ee0adb03c110c16dbe3b8 100644 --- a/extensions/typescript/src/features/renameProvider.ts +++ b/extensions/typescript/src/features/renameProvider.ts @@ -49,8 +49,7 @@ export default class TypeScriptRenameProvider implements RenameProvider { }); }); return result; - }, (err) => { - this.client.error(`'rename' request failed with error.`, err); + }, () => { return null; }); } diff --git a/extensions/typescript/src/features/signatureHelpProvider.ts b/extensions/typescript/src/features/signatureHelpProvider.ts index 0a7948786241588098cf7876559cde4af0a8b15d..c3f6c86e001865aef830a022a70622e0ff85f51a 100644 --- a/extensions/typescript/src/features/signatureHelpProvider.ts +++ b/extensions/typescript/src/features/signatureHelpProvider.ts @@ -64,8 +64,7 @@ export default class TypeScriptSignatureHelpProvider implements SignatureHelpPro }); return result; - }, (err: any) => { - this.client.error(`'signatureHelp' request failed with error.`, err); + }, () => { return null; }); } diff --git a/extensions/typescript/src/features/taskProvider.ts b/extensions/typescript/src/features/taskProvider.ts new file mode 100644 index 0000000000000000000000000000000000000000..0fa5afd19000d8517223d2d9ca616592e2625838 --- /dev/null +++ b/extensions/typescript/src/features/taskProvider.ts @@ -0,0 +1,168 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +'use strict'; + +import * as fs from 'fs'; +import * as path from 'path'; +import * as vscode from 'vscode'; + +import * as Proto from '../protocol'; +import TypeScriptServiceClient from '../typescriptServiceClient'; +import TsConfigProvider from '../utils/tsconfigProvider'; +import { isImplicitProjectConfigFile } from '../utils/tsconfig'; + +const exists = (file: string): Promise => + new Promise((resolve, _reject) => { + fs.exists(file, (value: boolean) => { + resolve(value); + }); + }); + + +interface TypeScriptTaskIdentifier extends vscode.TaskKind { + tsconfig: string; +} + +/** + * Provides tasks for building `tsconfig.json` files in a project. + */ +class TscTaskProvider implements vscode.TaskProvider { + private readonly tsconfigProvider: TsConfigProvider; + + public constructor( + private readonly lazyClient: () => TypeScriptServiceClient + ) { + this.tsconfigProvider = new TsConfigProvider(); + } + + dispose() { + this.tsconfigProvider.dispose(); + } + + public async provideTasks(token: vscode.CancellationToken): Promise { + const rootPath = vscode.workspace.rootPath; + if (!rootPath) { + return []; + } + + const command = await this.getCommand(); + const projects = await this.getAllTsConfigs(token); + + return projects.map(configFile => { + const configFileName = path.relative(rootPath, configFile); + const identifier: TypeScriptTaskIdentifier = { type: 'typescript', tsconfig: configFileName }; + const buildTask = new vscode.Task(identifier, `build ${configFileName}`, new vscode.ShellExecution(`${command} -p "${configFile}"`), '$tsc'); + buildTask.source = 'tsc'; + buildTask.group = vscode.TaskGroup.Build; + return buildTask; + }); + } + + public resolveTask(_task: vscode.Task): vscode.Task | undefined { + return undefined; + } + + private async getAllTsConfigs(token: vscode.CancellationToken): Promise { + const out = new Set(); + const configs = (await this.getTsConfigForActiveFile(token)).concat(await this.getTsConfigsInWorkspace()); + for (const config of configs) { + if (await exists(config)) { + out.add(config); + } + } + return Array.from(out); + } + + private async getTsConfigForActiveFile(token: vscode.CancellationToken): Promise { + const editor = vscode.window.activeTextEditor; + if (editor) { + if (path.basename(editor.document.fileName).match(/^tsconfig\.(.\.)?json$/)) { + return [editor.document.fileName]; + } + } + + const file = this.getActiveTypeScriptFile(); + if (!file) { + return []; + } + + const res: Proto.ProjectInfoResponse = await this.lazyClient().execute( + 'projectInfo', + { file, needFileNameList: false } as protocol.ProjectInfoRequestArgs, + token); + + if (!res || !res.body) { + return []; + } + + const { configFileName } = res.body; + if (configFileName && !isImplicitProjectConfigFile(configFileName)) { + return [configFileName]; + } + return []; + } + + private async getTsConfigsInWorkspace(): Promise { + return Array.from(await this.tsconfigProvider.getConfigsForWorkspace()); + } + + private async getCommand(): Promise { + const platform = process.platform; + if (platform === 'win32' && await exists(path.join(vscode.workspace.rootPath!, 'node_modules', '.bin', 'tsc.cmd'))) { + return path.join('.', 'node_modules', '.bin', 'tsc.cmd'); + } else if ((platform === 'linux' || platform === 'darwin') && await exists(path.join(vscode.workspace.rootPath!, 'node_modules', '.bin', 'tsc'))) { + return path.join('.', 'node_modules', '.bin', 'tsc'); + } else { + return 'tsc'; + } + } + + private getActiveTypeScriptFile(): string | null { + const editor = vscode.window.activeTextEditor; + if (editor) { + const document = editor.document; + if (document && (document.languageId === 'typescript' || document.languageId === 'typescriptreact')) { + return this.lazyClient().normalizePath(document.uri); + } + } + return null; + } +} + +type AutoDetect = 'on' | 'off'; + +/** + * Manages registrations of TypeScript task provides with VScode. + */ +export default class TypeScriptTaskProviderManager { + private taskProviderSub: vscode.Disposable | undefined = undefined; + private readonly disposables: vscode.Disposable[] = []; + + constructor( + private readonly lazyClient: () => TypeScriptServiceClient + ) { + vscode.workspace.onDidChangeConfiguration(this.onConfigurationChanged, this, this.disposables); + this.onConfigurationChanged(); + } + + dispose() { + if (this.taskProviderSub) { + this.taskProviderSub.dispose(); + this.taskProviderSub = undefined; + } + this.disposables.forEach(x => x.dispose()); + } + + private onConfigurationChanged() { + let autoDetect = vscode.workspace.getConfiguration('typescript.tsc').get('autoDetect'); + if (this.taskProviderSub && autoDetect === 'off') { + this.taskProviderSub.dispose(); + this.taskProviderSub = undefined; + } else if (!this.taskProviderSub && autoDetect === 'on') { + this.taskProviderSub = vscode.workspace.registerTaskProvider('typescript', new TscTaskProvider(this.lazyClient)); + } + } +} \ No newline at end of file diff --git a/extensions/typescript/src/features/workspaceSymbolProvider.ts b/extensions/typescript/src/features/workspaceSymbolProvider.ts index 016ac8726b342ea91936c9504734ff5513cf6dbb..fa78077164502d05b82f2fde7e795c0da6f537dd 100644 --- a/extensions/typescript/src/features/workspaceSymbolProvider.ts +++ b/extensions/typescript/src/features/workspaceSymbolProvider.ts @@ -77,8 +77,7 @@ export default class TypeScriptWorkspaceSymbolProvider implements WorkspaceSymbo } } return result; - }, (err) => { - this.client.error(`'navto' request failed with error.`, err); + }, () => { return []; }); } diff --git a/extensions/typescript/src/typescriptMain.ts b/extensions/typescript/src/typescriptMain.ts index 9949d0db9d2fb1ba88e3c8bf8983a8f6036a78bb..a8b37e67a8899fe5c6c53374c57cf9d49639b016 100644 --- a/extensions/typescript/src/typescriptMain.ts +++ b/extensions/typescript/src/typescriptMain.ts @@ -8,7 +8,7 @@ * https://github.com/Microsoft/TypeScript-Sublime-Plugin/blob/master/TypeScript%20Indent.tmPreferences * ------------------------------------------------------------------------------------------ */ -import { env, languages, commands, workspace, window, ExtensionContext, Memento, IndentAction, Diagnostic, DiagnosticCollection, Range, Disposable, Uri, MessageItem, TextEditor, DiagnosticSeverity, TextDocument, SnippetString } from 'vscode'; +import { env, languages, commands, workspace, window, ExtensionContext, Memento, IndentAction, Diagnostic, DiagnosticCollection, Range, Disposable, Uri, MessageItem, TextEditor, DiagnosticSeverity, TextDocument } from 'vscode'; // This must be the first statement otherwise modules might got loaded with // the wrong locale. @@ -38,17 +38,18 @@ import BufferSyncSupport from './features/bufferSyncSupport'; import CompletionItemProvider from './features/completionItemProvider'; import WorkspaceSymbolProvider from './features/workspaceSymbolProvider'; import CodeActionProvider from './features/codeActionProvider'; +import RefactorProvider from './features/refactorProvider'; import ReferenceCodeLensProvider from './features/referencesCodeLensProvider'; import { JsDocCompletionProvider, TryCompleteJsDocCommand } from './features/jsDocCompletionProvider'; import { DirectiveCommentCompletionProvider } from './features/directiveCommentCompletionProvider'; - +import TypeScriptTaskProviderManager from './features/taskProvider'; import ImplementationCodeLensProvider from './features/implementationsCodeLensProvider'; -import * as BuildStatus from './utils/buildStatus'; import * as ProjectStatus from './utils/projectStatus'; import TypingsStatus, { AtaProgressReporter } from './utils/typingsStatus'; -import * as VersionStatus from './utils/versionStatus'; -import { getContributedTypeScriptServerPlugins, TypeScriptServerPlugin } from "./utils/plugins"; +import VersionStatus from './utils/versionStatus'; +import { getContributedTypeScriptServerPlugins, TypeScriptServerPlugin } from './utils/plugins'; +import { openOrCreateConfigFile, isImplicitProjectConfigFile } from './utils/tsconfig'; interface LanguageDescription { id: string; @@ -67,79 +68,106 @@ interface ProjectConfigMessageItem extends MessageItem { id: ProjectConfigAction; } +const MODE_ID_TS = 'typescript'; +const MODE_ID_TSX = 'typescriptreact'; +const MODE_ID_JS = 'javascript'; +const MODE_ID_JSX = 'javascriptreact'; + +const standardLanguageDescriptions: LanguageDescription[] = [ + { + id: 'typescript', + diagnosticSource: 'ts', + modeIds: [MODE_ID_TS, MODE_ID_TSX], + configFile: 'tsconfig.json' + }, { + id: 'javascript', + diagnosticSource: 'js', + modeIds: [MODE_ID_JS, MODE_ID_JSX], + configFile: 'jsconfig.json' + } +]; export function activate(context: ExtensionContext): void { - const MODE_ID_TS = 'typescript'; - const MODE_ID_TSX = 'typescriptreact'; - const MODE_ID_JS = 'javascript'; - const MODE_ID_JSX = 'javascriptreact'; - const plugins = getContributedTypeScriptServerPlugins(); - const clientHost = new TypeScriptServiceClientHost([ - { - id: 'typescript', - diagnosticSource: 'ts', - modeIds: [MODE_ID_TS, MODE_ID_TSX], - configFile: 'tsconfig.json' - }, - { - id: 'javascript', - diagnosticSource: 'js', - modeIds: [MODE_ID_JS, MODE_ID_JSX], - configFile: 'jsconfig.json' - } - ], context.storagePath, context.globalState, context.workspaceState, plugins); - context.subscriptions.push(clientHost); - const client = clientHost.serviceClient; + const lazyClientHost = (() => { + let clientHost: TypeScriptServiceClientHost | undefined; + return () => { + if (!clientHost) { + clientHost = new TypeScriptServiceClientHost(standardLanguageDescriptions, context.workspaceState, plugins); + context.subscriptions.push(clientHost); + + const host = clientHost; + clientHost.serviceClient.onReady().then(() => { + context.subscriptions.push(ProjectStatus.create(host.serviceClient, + path => new Promise(resolve => setTimeout(() => resolve(host.handles(path)), 750)), + context.workspaceState)); + }, () => { + // Nothing to do here. The client did show a message; + }); + } + return clientHost; + }; + })(); + context.subscriptions.push(commands.registerCommand('typescript.reloadProjects', () => { - clientHost.reloadProjects(); + lazyClientHost().reloadProjects(); })); context.subscriptions.push(commands.registerCommand('javascript.reloadProjects', () => { - clientHost.reloadProjects(); + lazyClientHost().reloadProjects(); })); context.subscriptions.push(commands.registerCommand('typescript.selectTypeScriptVersion', () => { - client.onVersionStatusClicked(); + lazyClientHost().serviceClient.onVersionStatusClicked(); })); context.subscriptions.push(commands.registerCommand('typescript.openTsServerLog', () => { - client.openTsServerLogFile(); + lazyClientHost().serviceClient.openTsServerLogFile(); })); context.subscriptions.push(commands.registerCommand('typescript.restartTsServer', () => { - client.restartTsServer(); + lazyClientHost().serviceClient.restartTsServer(); })); + context.subscriptions.push(new TypeScriptTaskProviderManager(() => lazyClientHost().serviceClient)); + const goToProjectConfig = (isTypeScript: boolean) => { const editor = window.activeTextEditor; if (editor) { - clientHost.goToProjectConfig(isTypeScript, editor.document.uri); + lazyClientHost().goToProjectConfig(isTypeScript, editor.document.uri); } }; context.subscriptions.push(commands.registerCommand('typescript.goToProjectConfig', goToProjectConfig.bind(null, true))); context.subscriptions.push(commands.registerCommand('javascript.goToProjectConfig', goToProjectConfig.bind(null, false))); - const jsDocCompletionCommand = new TryCompleteJsDocCommand(client); + const jsDocCompletionCommand = new TryCompleteJsDocCommand(() => lazyClientHost().serviceClient); context.subscriptions.push(commands.registerCommand(TryCompleteJsDocCommand.COMMAND_NAME, jsDocCompletionCommand.tryCompleteJsDoc, jsDocCompletionCommand)); - window.onDidChangeActiveTextEditor(VersionStatus.showHideStatus, null, context.subscriptions); - client.onReady().then(() => { - context.subscriptions.push(ProjectStatus.create(client, - path => new Promise(resolve => setTimeout(() => resolve(clientHost.handles(path)), 750)), - context.workspaceState)); - }, () => { - // Nothing to do here. The client did show a message; - }); - BuildStatus.update({ queueLength: 0 }); + const supportedLanguage = [].concat.apply([], standardLanguageDescriptions.map(x => x.modeIds).concat(plugins.map(x => x.languages))); + function didOpenTextDocument(textDocument: TextDocument): boolean { + if (supportedLanguage.indexOf(textDocument.languageId) >= 0) { + openListener.dispose(); + // Force activation + void lazyClientHost(); + return true; + } + return false; + }; + const openListener = workspace.onDidOpenTextDocument(didOpenTextDocument); + for (let textDocument of workspace.textDocuments) { + if (didOpenTextDocument(textDocument)) { + break; + } + } } const validateSetting = 'validate.enable'; class LanguageProvider { + private syntaxDiagnostics: ObjectMap; private readonly currentDiagnostics: DiagnosticCollection; private readonly bufferSyncSupport: BufferSyncSupport; @@ -236,7 +264,7 @@ class LanguageProvider { this.disposables.push(languages.registerRenameProvider(selector, new RenameProvider(client))); this.disposables.push(languages.registerCodeActionsProvider(selector, new CodeActionProvider(client, this.description.id))); - + this.disposables.push(languages.registerCodeActionsProvider(selector, new RefactorProvider(client, this.description.id))); this.registerVersionDependentProviders(); this.description.modeIds.forEach(modeId => { @@ -256,9 +284,10 @@ class LanguageProvider { this.disposables.push(languages.setLanguageConfiguration(modeId, { indentationRules: { // ^(.*\*/)?\s*\}.*$ - decreaseIndentPattern: /^(.*\*\/)?\s*\}.*$/, + decreaseIndentPattern: /^(.*\*\/)?\s*[\}|\]|\)].*$/, // ^.*\{[^}"']*$ - increaseIndentPattern: /^.*\{[^}"'`]*$/ + increaseIndentPattern: /^.*(\{[^}"'`]*|\([^)"'`]*|\[[^\]"'`]*)$/, + indentNextLinePattern: /^\s*(for|while|if|else)\b(?!.*[;{}]\s*(\/\/.*|\/[*].*[*]\/\s*)?$)/ }, wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g, onEnterRules: [ @@ -421,13 +450,12 @@ class LanguageProvider { class TypeScriptServiceClientHost implements ITypescriptServiceClientHost { private client: TypeScriptServiceClient; private languages: LanguageProvider[] = []; - private languagePerId: ObjectMap; + private languagePerId: Map; private readonly disposables: Disposable[] = []; + private readonly versionStatus: VersionStatus; constructor( descriptions: LanguageDescription[], - storagePath: string | undefined, - globalState: Memento, workspaceState: Memento, plugins: TypeScriptServerPlugin[] ) { @@ -446,13 +474,16 @@ class TypeScriptServiceClientHost implements ITypescriptServiceClientHost { configFileWatcher.onDidDelete(handleProjectCreateOrDelete, this, this.disposables); configFileWatcher.onDidChange(handleProjectChange, this, this.disposables); - this.client = new TypeScriptServiceClient(this, storagePath, globalState, workspaceState, plugins, this.disposables); - this.languagePerId = Object.create(null); + this.versionStatus = new VersionStatus(); + this.disposables.push(this.versionStatus); + + this.client = new TypeScriptServiceClient(this, workspaceState, this.versionStatus, plugins, this.disposables); + this.languagePerId = new Map(); for (const description of descriptions) { const manager = new LanguageProvider(this.client, description); this.languages.push(manager); this.disposables.push(manager); - this.languagePerId[description.id] = manager; + this.languagePerId.set(description.id, manager); } this.client.onReady().then(() => { @@ -475,9 +506,13 @@ class TypeScriptServiceClientHost implements ITypescriptServiceClientHost { const manager = new LanguageProvider(this.client, description); this.languages.push(manager); this.disposables.push(manager); - this.languagePerId[description.id] = manager; + this.languagePerId.set(description.id, manager); } }); + + this.client.onTsServerStarted(() => { + this.triggerAllDiagnostics(); + }); } public dispose(): void { @@ -506,7 +541,7 @@ class TypeScriptServiceClientHost implements ITypescriptServiceClientHost { isTypeScriptProject: boolean, resource: Uri ): Thenable | undefined { - const rootPath = workspace.rootPath; + const rootPath = this.client.getWorkspaceRootForResource(resource); if (!rootPath) { window.showInformationMessage( localize( @@ -532,7 +567,7 @@ class TypeScriptServiceClientHost implements ITypescriptServiceClientHost { } const { configFileName } = res.body; - if (configFileName && configFileName.indexOf('/dev/null/') !== 0) { + if (configFileName && !isImplicitProjectConfigFile(configFileName)) { return workspace.openTextDocument(configFileName) .then(doc => window.showTextDocument(doc, window.activeTextEditor ? window.activeTextEditor.viewColumn : undefined)); @@ -553,16 +588,7 @@ class TypeScriptServiceClientHost implements ITypescriptServiceClientHost { }).then(selected => { switch (selected && selected.id) { case ProjectConfigAction.CreateConfig: - const configFile = Uri.file(path.join(rootPath, isTypeScriptProject ? 'tsconfig.json' : 'jsconfig.json')); - const col = window.activeTextEditor ? window.activeTextEditor.viewColumn : undefined; - return workspace.openTextDocument(configFile) - .then(doc => { - return window.showTextDocument(doc, col); - }, _ => { - return workspace.openTextDocument(configFile.with({ scheme: 'untitled' })) - .then(doc => window.showTextDocument(doc, col)) - .then(editor => editor.insertSnippet(new SnippetString('{\n\t$0\n}'))); - }); + return openOrCreateConfigFile(isTypeScriptProject, rootPath); case ProjectConfigAction.LearnMore: if (isTypeScriptProject) { @@ -580,7 +606,7 @@ class TypeScriptServiceClientHost implements ITypescriptServiceClientHost { } private findLanguage(file: string): Thenable { - return workspace.openTextDocument(file).then((doc: TextDocument) => { + return workspace.openTextDocument(this.client.asUrl(file)).then((doc: TextDocument) => { for (const language of this.languages) { if (language.handles(file, doc)) { return language; @@ -591,13 +617,17 @@ class TypeScriptServiceClientHost implements ITypescriptServiceClientHost { } private triggerAllDiagnostics() { - Object.keys(this.languagePerId).forEach(key => this.languagePerId[key].triggerAllDiagnostics()); + for (const language of this.languagePerId.values()) { + language.triggerAllDiagnostics(); + } } /* internal */ populateService(): void { // See https://github.com/Microsoft/TypeScript/issues/5530 - workspace.saveAll(false).then(_ => { - Object.keys(this.languagePerId).forEach(key => this.languagePerId[key].reInitialize()); + workspace.saveAll(false).then(() => { + for (const language of this.languagePerId.values()) { + language.reInitialize(); + } }); } @@ -621,11 +651,6 @@ class TypeScriptServiceClientHost implements ITypescriptServiceClientHost { } }); } - /* - if (Is.defined(body.queueLength)) { - BuildStatus.update({ queueLength: body.queueLength }); - } - */ } /* internal */ configFileDiagnosticsReceived(event: Proto.ConfigFileDiagnosticEvent): void { diff --git a/extensions/typescript/src/typescriptService.ts b/extensions/typescript/src/typescriptService.ts index 8b15cc79f7bc0a7891a2011e9766489cceaf3d25..ffab7e955a71d246f35a34627c18ccdf7cbc60cb 100644 --- a/extensions/typescript/src/typescriptService.ts +++ b/extensions/typescript/src/typescriptService.ts @@ -64,15 +64,23 @@ export class API { public has230Features(): boolean { return semver.gte(this._version, '2.3.0'); } + + public has234Features(): boolean { + return semver.gte(this._version, '2.3.4'); + } + public has240Features(): boolean { + return semver.gte(this._version, '2.4.0'); + } } export interface ITypescriptServiceClient { normalizePath(resource: Uri): string | null; asUrl(filepath: string): Uri; + getWorkspaceRootForResource(resource: Uri): string | undefined; - info(message: string, data?: any): void; warn(message: string, data?: any): void; - error(message: string, data?: any): void; + + onTsServerStarted: Event; onProjectLanguageServiceStateChanged: Event; onDidBeginInstallTypings: Event; @@ -81,7 +89,6 @@ export interface ITypescriptServiceClient { logTelemetry(eventName: string, properties?: { [prop: string]: string }): void; - experimentalAutoBuild: boolean; apiVersion: API; checkGlobalTSCVersion: boolean; @@ -112,6 +119,8 @@ export interface ITypescriptServiceClient { execute(command: 'getCodeFixes', args: Proto.CodeFixRequestArgs, token?: CancellationToken): Promise; execute(command: 'getSupportedCodeFixes', args: null, token?: CancellationToken): Promise; execute(command: 'docCommentTemplate', args: Proto.FileLocationRequestArgs, token?: CancellationToken): Promise; + execute(command: 'getApplicableRefactors', args: Proto.GetApplicableRefactorsRequestArgs, token?: CancellationToken): Promise; + execute(command: 'getEditsForRefactor', args: Proto.GetEditsForRefactorRequestArgs, token?: CancellationToken): Promise; // execute(command: 'compileOnSaveAffectedFileList', args: Proto.CompileOnSaveEmitFileRequestArgs, token?: CancellationToken): Promise; // execute(command: 'compileOnSaveEmitFile', args: Proto.CompileOnSaveEmitFileRequestArgs, token?: CancellationToken): Promise; execute(command: string, args: any, expectedResult: boolean | CancellationToken, token?: CancellationToken): Promise; diff --git a/extensions/typescript/src/typescriptServiceClient.ts b/extensions/typescript/src/typescriptServiceClient.ts index cf2b7c3be6fd881e9e7933bf482168bbc55c25d9..e5e4f4fa30a836c2f12ea5f427999ed19f54dd99 100644 --- a/extensions/typescript/src/typescriptServiceClient.ts +++ b/extensions/typescript/src/typescriptServiceClient.ts @@ -18,12 +18,12 @@ import { ITypescriptServiceClient, ITypescriptServiceClientHost, API } from './t import { TypeScriptServerPlugin } from './utils/plugins'; import Logger from './utils/logger'; -import * as VersionStatus from './utils/versionStatus'; +import VersionStatus from './utils/versionStatus'; import * as is from './utils/is'; +import TelemetryReporter from './utils/telemetry'; +import Tracer from './utils/tracer'; import * as nls from 'vscode-nls'; -import TelemetryReporter from "./utils/telemetry"; -import Tracer from "./utils/tracer"; const localize = nls.loadMessageBundle(); interface CallbackItem { @@ -32,8 +32,34 @@ interface CallbackItem { start: number; } -interface CallbackMap { - [key: number]: CallbackItem; +class CallbackMap { + private callbacks: Map = new Map(); + public pendingResponses: number = 0; + + public destroy(e: any): void { + for (const callback of this.callbacks.values()) { + callback.e(e); + } + this.callbacks = new Map(); + this.pendingResponses = 0; + } + + public add(seq: number, callback: CallbackItem) { + this.callbacks.set(seq, callback); + ++this.pendingResponses; + } + + public fetch(seq: number): CallbackItem | undefined { + const callback = this.callbacks.get(seq); + this.delete(seq); + return callback; + } + + private delete(seq: number) { + if (this.callbacks.delete(seq)) { + --this.pendingResponses; + } + } } interface RequestItem { @@ -94,6 +120,104 @@ interface MyMessageItem extends MessageItem { id: MessageAction; } +class TypeScriptServiceConfiguration { + public readonly globalTsdk: string | null; + public readonly localTsdk: string | null; + public readonly npmLocation: string | null; + public readonly tsServerLogLevel: TsServerLogLevel = TsServerLogLevel.Off; + public readonly checkJs: boolean; + + public static loadFromWorkspace(): TypeScriptServiceConfiguration { + return new TypeScriptServiceConfiguration(); + } + + private constructor() { + const configuration = workspace.getConfiguration(); + + this.globalTsdk = TypeScriptServiceConfiguration.extractGlobalTsdk(configuration); + this.localTsdk = TypeScriptServiceConfiguration.extractLocalTsdk(configuration); + this.npmLocation = TypeScriptServiceConfiguration.readNpmLocation(configuration); + this.tsServerLogLevel = TypeScriptServiceConfiguration.readTsServerLogLevel(configuration); + this.checkJs = TypeScriptServiceConfiguration.readCheckJs(configuration); + } + + public isEqualTo(other: TypeScriptServiceConfiguration): boolean { + return this.globalTsdk === other.globalTsdk + && this.localTsdk === other.localTsdk + && this.npmLocation === other.npmLocation + && this.tsServerLogLevel === other.tsServerLogLevel + && this.checkJs === other.checkJs; + } + + private static extractGlobalTsdk(configuration: WorkspaceConfiguration): string | null { + let inspect = configuration.inspect('typescript.tsdk'); + if (inspect && inspect.globalValue && 'string' === typeof inspect.globalValue) { + return inspect.globalValue; + } + if (inspect && inspect.defaultValue && 'string' === typeof inspect.defaultValue) { + return inspect.defaultValue; + } + return null; + } + + private static extractLocalTsdk(configuration: WorkspaceConfiguration): string | null { + let inspect = configuration.inspect('typescript.tsdk'); + if (inspect && inspect.workspaceValue && 'string' === typeof inspect.workspaceValue) { + return inspect.workspaceValue; + } + return null; + } + + private static readTsServerLogLevel(configuration: WorkspaceConfiguration): TsServerLogLevel { + const setting = configuration.get('typescript.tsserver.log', 'off'); + return TsServerLogLevel.fromString(setting); + } + + private static readCheckJs(configuration: WorkspaceConfiguration): boolean { + return configuration.get('javascript.implicitProjectConfig.checkJs', false); + } + + private static readNpmLocation(configuration: WorkspaceConfiguration): string | null { + return configuration.get('typescript.npm', null); + } +} + +class RequestQueue { + private queue: RequestItem[] = []; + private sequenceNumber: number = 0; + + public get length(): number { + return this.queue.length; + } + + public push(item: RequestItem): void { + this.queue.push(item); + } + + public shift(): RequestItem | undefined { + return this.queue.shift(); + } + + public tryCancelPendingRequest(seq: number): boolean { + for (let i = 0; i < this.queue.length; i++) { + if (this.queue[i].request.seq === seq) { + this.queue.splice(i, 1); + return true; + } + } + return false; + } + + public createRequest(command: string, args: any): Proto.Request { + return { + seq: this.sequenceNumber++, + type: 'request', + command: command, + arguments: args + }; + } +} + export default class TypeScriptServiceClient implements ITypescriptServiceClient { private static useWorkspaceTsdkStorageKey = 'typescript.useWorkspaceTsdk'; private static tsdkMigratedStorageKey = 'typescript.tsdkMigrated'; @@ -101,53 +225,44 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient private static readonly WALK_THROUGH_SNIPPET_SCHEME = 'walkThroughSnippet'; private static readonly WALK_THROUGH_SNIPPET_SCHEME_COLON = `${TypeScriptServiceClient.WALK_THROUGH_SNIPPET_SCHEME}:`; - private host: ITypescriptServiceClientHost; - private storagePath: string | undefined; - private globalState: Memento; private pathSeparator: string; private modulePath: string | undefined; private _onReady: { promise: Promise; resolve: () => void; reject: () => void; }; - private globalTsdk: string | null; - private localTsdk: string | null; + private configuration: TypeScriptServiceConfiguration; private _checkGlobalTSCVersion: boolean; - private _experimentalAutoBuild: boolean; private tracer: Tracer; private readonly logger: Logger = new Logger(); private tsServerLogFile: string | null = null; - private tsServerLogLevel: TsServerLogLevel = TsServerLogLevel.Off; private servicePromise: Thenable | null; private lastError: Error | null; private reader: Reader; - private sequenceNumber: number; private firstStart: number; private lastStart: number; private numberRestarts: number; + private isRestarting: boolean = false; + private cancellationPipeName: string | null = null; - private requestQueue: RequestItem[]; - private pendingResponses: number; + private requestQueue: RequestQueue; private callbacks: CallbackMap; - private _onProjectLanguageServiceStateChanged = new EventEmitter(); - private _onDidBeginInstallTypings = new EventEmitter(); - private _onDidEndInstallTypings = new EventEmitter(); - private _onTypesInstallerInitializationFailed = new EventEmitter(); + + private readonly _onTsServerStarted = new EventEmitter(); + private readonly _onProjectLanguageServiceStateChanged = new EventEmitter(); + private readonly _onDidBeginInstallTypings = new EventEmitter(); + private readonly _onDidEndInstallTypings = new EventEmitter(); + private readonly _onTypesInstallerInitializationFailed = new EventEmitter(); private _apiVersion: API; private telemetryReporter: TelemetryReporter; - private checkJs: boolean; constructor( - host: ITypescriptServiceClientHost, - storagePath: string | undefined, - globalState: Memento, - private workspaceState: Memento, - private plugins: TypeScriptServerPlugin[], + private readonly host: ITypescriptServiceClientHost, + private readonly workspaceState: Memento, + private readonly versionStatus: VersionStatus, + private readonly plugins: TypeScriptServerPlugin[], disposables: Disposable[] ) { - this.host = host; - this.storagePath = storagePath; - this.globalState = globalState; this.pathSeparator = path.sep; this.lastStart = Date.now(); @@ -158,46 +273,31 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient this.servicePromise = null; this.lastError = null; - this.sequenceNumber = 0; this.firstStart = Date.now(); this.numberRestarts = 0; - this.requestQueue = []; - this.pendingResponses = 0; - this.callbacks = Object.create(null); - const configuration = workspace.getConfiguration(); - this.globalTsdk = this.extractGlobalTsdk(configuration); - this.localTsdk = this.extractLocalTsdk(configuration); + this.requestQueue = new RequestQueue(); + this.callbacks = new CallbackMap(); + this.configuration = TypeScriptServiceConfiguration.loadFromWorkspace(); - this._experimentalAutoBuild = false; // configuration.get('typescript.tsserver.experimentalAutoBuild', false); this._apiVersion = new API('1.0.0'); this._checkGlobalTSCVersion = true; this.tracer = new Tracer(this.logger); - this.tsServerLogLevel = this.readTsServerLogLevel(); - this.checkJs = this.readCheckJs(); disposables.push(workspace.onDidChangeConfiguration(() => { - let oldLoggingLevel = this.tsServerLogLevel; - let oldglobalTsdk = this.globalTsdk; - let oldLocalTsdk = this.localTsdk; - let oldCheckJs = this.checkJs; + const oldConfiguration = this.configuration; + this.configuration = TypeScriptServiceConfiguration.loadFromWorkspace(); this.tracer.updateConfiguration(); - this.tsServerLogLevel = this.readTsServerLogLevel(); - - const configuration = workspace.getConfiguration(); - this.globalTsdk = this.extractGlobalTsdk(configuration); - this.localTsdk = this.extractLocalTsdk(configuration); - this.checkJs = this.readCheckJs(); - if (this.servicePromise && oldCheckJs !== this.checkJs) { - this.setCompilerOptionsForInferredProjects(); - } + if (this.servicePromise) { + if (this.configuration.checkJs !== oldConfiguration.checkJs) { + this.setCompilerOptionsForInferredProjects(); + } - if (this.servicePromise === null && (oldglobalTsdk !== this.globalTsdk || oldLocalTsdk !== this.localTsdk)) { - this.startService(); - } else if (this.servicePromise !== null && (this.tsServerLogLevel !== oldLoggingLevel || oldglobalTsdk !== this.globalTsdk || oldLocalTsdk !== this.localTsdk)) { - this.restartTsServer(); + if (!this.configuration.isEqualTo(oldConfiguration)) { + this.restartTsServer(); + } } })); this.telemetryReporter = new TelemetryReporter(); @@ -207,14 +307,14 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient public restartTsServer(): void { const start = () => { - this.tsServerLogLevel = this.readTsServerLogLevel(); - this.servicePromise = this.startService(); + this.servicePromise = this.startService(true); return this.servicePromise; }; - if (this.servicePromise !== null) { + if (this.servicePromise) { this.servicePromise = this.servicePromise.then(cp => { if (cp) { + this.isRestarting = true; cp.kill(); } }).then(start); @@ -223,24 +323,8 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient } } - - private extractGlobalTsdk(configuration: WorkspaceConfiguration): string | null { - let inspect = configuration.inspect('typescript.tsdk'); - if (inspect && inspect.globalValue && 'string' === typeof inspect.globalValue) { - return inspect.globalValue; - } - if (inspect && inspect.defaultValue && 'string' === typeof inspect.defaultValue) { - return inspect.defaultValue; - } - return null; - } - - private extractLocalTsdk(configuration: WorkspaceConfiguration): string | null { - let inspect = configuration.inspect('typescript.tsdk'); - if (inspect && inspect.workspaceValue && 'string' === typeof inspect.workspaceValue) { - return inspect.workspaceValue; - } - return null; + get onTsServerStarted(): Event { + return this._onTsServerStarted.event; } get onProjectLanguageServiceStateChanged(): Event { @@ -259,19 +343,6 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient return this._onTypesInstallerInitializationFailed.event; } - private readTsServerLogLevel(): TsServerLogLevel { - const setting = workspace.getConfiguration().get('typescript.tsserver.log', 'off'); - return TsServerLogLevel.fromString(setting); - } - - private readCheckJs(): boolean { - return workspace.getConfiguration().get('javascript.implicitProjectConfig.checkJs', false); - } - - public get experimentalAutoBuild(): boolean { - return this._experimentalAutoBuild; - } - public get checkGlobalTSCVersion(): boolean { return this._checkGlobalTSCVersion; } @@ -284,7 +355,7 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient return this._onReady.promise; } - public info(message: string, data?: any): void { + private info(message: string, data?: any): void { this.logger.info(message, data); } @@ -292,7 +363,7 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient this.logger.warn(message, data); } - public error(message: string, data?: any): void { + private error(message: string, data?: any): void { this.logger.error(message, data); } @@ -323,19 +394,20 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient } private get localTypeScriptPath(): string | null { - if (!workspace.rootPath) { + const rootPath = this.mainWorkspaceRootPath; + if (!rootPath) { return null; } - if (this.localTsdk) { + if (this.configuration.localTsdk) { this._checkGlobalTSCVersion = false; - if ((path).isAbsolute(this.localTsdk)) { - return path.join(this.localTsdk, 'tsserver.js'); + if ((path).isAbsolute(this.configuration.localTsdk)) { + return path.join(this.configuration.localTsdk, 'tsserver.js'); } - return path.join(workspace.rootPath, this.localTsdk, 'tsserver.js'); + return path.join(rootPath, this.configuration.localTsdk, 'tsserver.js'); } - const localModulePath = path.join(workspace.rootPath, 'node_modules', 'typescript', 'lib', 'tsserver.js'); + const localModulePath = path.join(rootPath, 'node_modules', 'typescript', 'lib', 'tsserver.js'); if (fs.existsSync(localModulePath) && this.getTypeScriptVersion(localModulePath)) { return localModulePath; } @@ -343,12 +415,12 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient } private get globalTypescriptPath(): string { - if (this.globalTsdk) { + if (this.configuration.globalTsdk) { this._checkGlobalTSCVersion = false; - if ((path).isAbsolute(this.globalTsdk)) { - return path.join(this.globalTsdk, 'tsserver.js'); - } else if (workspace.rootPath) { - return path.join(workspace.rootPath, this.globalTsdk, 'tsserver.js'); + if ((path).isAbsolute(this.configuration.globalTsdk)) { + return path.join(this.configuration.globalTsdk, 'tsserver.js'); + } else if (this.mainWorkspaceRootPath) { + return path.join(this.mainWorkspaceRootPath, this.configuration.globalTsdk, 'tsserver.js'); } } @@ -356,7 +428,7 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient } private hasWorkspaceTsdkSetting(): boolean { - return !!this.localTsdk; + return !!this.configuration.localTsdk; } private startService(resendModels: boolean = false): Thenable { @@ -364,14 +436,14 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient if (!this.workspaceState.get(TypeScriptServiceClient.tsdkMigratedStorageKey, false)) { this.workspaceState.update(TypeScriptServiceClient.tsdkMigratedStorageKey, true); - if (workspace.rootPath && this.hasWorkspaceTsdkSetting()) { + if (this.mainWorkspaceRootPath && this.hasWorkspaceTsdkSetting()) { modulePath = this.showVersionPicker(true); } } return modulePath.then(modulePath => { if (this.workspaceState.get(TypeScriptServiceClient.useWorkspaceTsdkStorageKey, false)) { - if (workspace.rootPath) { + if (this.mainWorkspaceRootPath) { // TODO: check if we need better error handling return this.localTypeScriptPath || modulePath; } @@ -381,8 +453,6 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient return this.getDebugPort().then(debugPort => ({ modulePath, debugPort })); }).then(({ modulePath, debugPort }) => { return this.servicePromise = new Promise((resolve, reject) => { - const tsConfig = workspace.getConfiguration('typescript'); - this.info(`Using tsserver from: ${modulePath}`); if (!fs.existsSync(modulePath)) { window.showWarningMessage(localize('noServerFound', 'The path {0} doesn\'t point to a valid tsserver install. Falling back to bundled TypeScript version.', modulePath ? path.dirname(modulePath) : '')); @@ -404,30 +474,20 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient const label = version || localize('versionNumber.custom', 'custom'); const tooltip = modulePath; this.modulePath = modulePath; - VersionStatus.showHideStatus(); - VersionStatus.setInfo(label, tooltip); - - // This is backwards compatibility code to move the setting from the local - // store into the workspace setting file. - const doGlobalVersionCheckKey: string = 'doGlobalVersionCheck'; - const globalStateValue = this.globalState.get(doGlobalVersionCheckKey, true); - const checkTscVersion = 'check.tscVersion'; - if (!globalStateValue) { - tsConfig.update(checkTscVersion, false, true); - this.globalState.update(doGlobalVersionCheckKey, true); - } + this.versionStatus.showHideStatus(); + this.versionStatus.setInfo(label, tooltip); + - this.sequenceNumber = 0; - this.requestQueue = []; - this.pendingResponses = 0; + this.requestQueue = new RequestQueue(); + this.callbacks = new CallbackMap(); this.lastError = null; try { const options: electron.IForkOptions = { execArgv: [] // [`--debug-brk=5859`] }; - if (workspace.rootPath) { - options.cwd = workspace.rootPath; + if (this.mainWorkspaceRootPath) { + options.cwd = this.mainWorkspaceRootPath; } if (debugPort && !isNaN(debugPort)) { @@ -446,12 +506,12 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient args.push('--enableTelemetry'); } if (this.apiVersion.has222Features()) { - this.cancellationPipeName = electron.getPipeName(`tscancellation-${electron.makeRandomHexString(20)}`); + this.cancellationPipeName = electron.getTempFile(`tscancellation-${electron.makeRandomHexString(20)}`); args.push('--cancellationPipeName', this.cancellationPipeName + '*'); } if (this.apiVersion.has222Features()) { - if (this.tsServerLogLevel !== TsServerLogLevel.Off) { + if (this.configuration.tsServerLogLevel !== TsServerLogLevel.Off) { try { const logDir = fs.mkdtempSync(path.join(os.tmpdir(), `vscode-tsserver-log-`)); this.tsServerLogFile = path.join(logDir, `tsserver.log`); @@ -461,7 +521,7 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient } if (this.tsServerLogFile) { - args.push('--logVerbosity', TsServerLogLevel.toString(this.tsServerLogLevel)); + args.push('--logVerbosity', TsServerLogLevel.toString(this.configuration.tsServerLogLevel)); args.push('--logFile', this.tsServerLogFile); } } @@ -476,6 +536,12 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient } } + if (this.apiVersion.has234Features()) { + if (this.configuration.npmLocation) { + args.push('--npmLocation', `"${this.configuration.npmLocation}"`); + } + } + electron.fork(modulePath, args, options, this.logger, (err: any, childProcess: cp.ChildProcess) => { if (err) { this.lastError = err; @@ -505,7 +571,8 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient if (this.tsServerLogFile) { this.info(`TSServer log file: ${this.tsServerLogFile}`); } - this.serviceExited(true); + this.serviceExited(!this.isRestarting); + this.isRestarting = false; }); this.reader = new Reader( @@ -515,6 +582,8 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient this._onReady.resolve(); resolve(childProcess); + this._onTsServerStarted.fire(); + this.serviceStarted(resendModels); }); } catch (error) { @@ -554,7 +623,7 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient private showVersionPicker(firstRun: boolean): Thenable { const modulePath = this.modulePath || this.globalTypescriptPath; - if (!workspace.rootPath || !modulePath) { + if (!this.mainWorkspaceRootPath || !modulePath) { return Promise.resolve(modulePath); } @@ -637,7 +706,7 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient .then(() => false); } - if (this.tsServerLogLevel === TsServerLogLevel.Off) { + if (this.configuration.tsServerLogLevel === TsServerLogLevel.Off) { return window.showErrorMessage( localize( 'typescript.openTsServerLog.loggingNotEnabled', @@ -677,13 +746,6 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient let configureOptions: Proto.ConfigureRequestArguments = { hostInfo: 'vscode' }; - if (this._experimentalAutoBuild && this.storagePath) { - try { - fs.mkdirSync(this.storagePath); - } catch (error) { - } - // configureOptions.autoDiagnostics = true; - } this.execute('configure', configureOptions); this.setCompilerOptionsForInferredProjects(); if (resendModels) { @@ -748,10 +810,8 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient private serviceExited(restart: boolean): void { this.servicePromise = null; this.tsServerLogFile = null; - Object.keys(this.callbacks).forEach((key) => { - this.callbacks[parseInt(key)].e(new Error('Service died.')); - }); - this.callbacks = Object.create(null); + this.callbacks.destroy(new Error('Service died.')); + this.callbacks = new CallbackMap(); if (restart) { const diff = Date.now() - this.lastStart; this.numberRestarts++; @@ -824,6 +884,34 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient return Uri.file(filepath); } + private get mainWorkspaceRootPath(): string | undefined { + if (workspace.rootPath) { + return workspace.rootPath; + } + + if (workspace.workspaceFolders && workspace.workspaceFolders.length) { + return workspace.workspaceFolders[0].fsPath; + } + + return undefined; + } + + public getWorkspaceRootForResource(resource: Uri): string | undefined { + if (workspace.rootPath) { + return workspace.rootPath; + } + + if (workspace.workspaceFolders && workspace.workspaceFolders.length) { + if (resource.scheme === 'file') { + const found = workspace.workspaceFolders.find(root => resource.fsPath.startsWith(root.fsPath)); + return found ? found.fsPath : found; + } + return workspace.workspaceFolders[0].fsPath; + } + + return undefined; + } + public execute(command: string, args: any, expectsResultOrToken?: boolean | CancellationToken): Promise { let token: CancellationToken | undefined = undefined; let expectsResult = true; @@ -833,12 +921,7 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient token = expectsResultOrToken; } - const request: Proto.Request = { - seq: this.sequenceNumber++, - type: 'request', - command: command, - arguments: args - }; + const request = this.requestQueue.createRequest(command, args); const requestInfo: RequestItem = { request: request, promise: null, @@ -846,14 +929,20 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient }; let result: Promise = Promise.resolve(null); if (expectsResult) { + let wasCancelled = false; result = new Promise((resolve, reject) => { requestInfo.callbacks = { c: resolve, e: reject, start: Date.now() }; if (token) { token.onCancellationRequested(() => { + wasCancelled = true; this.tryCancelRequest(request.seq); - resolve(undefined); }); } + }).catch((err: any) => { + if (!wasCancelled) { + this.error(`'${command}' request failed with error.`, err); + } + throw err; }); } requestInfo.promise = result; @@ -864,7 +953,7 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient } private sendNextRequests(): void { - while (this.pendingResponses === 0 && this.requestQueue.length > 0) { + while (this.callbacks.pendingResponses === 0 && this.requestQueue.length > 0) { const item = this.requestQueue.shift(); if (item) { this.sendRequest(item); @@ -873,64 +962,57 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient } private sendRequest(requestItem: RequestItem): void { - let serverRequest = requestItem.request; + const serverRequest = requestItem.request; this.tracer.traceRequest(serverRequest, !!requestItem.callbacks, this.requestQueue.length); if (requestItem.callbacks) { - this.callbacks[serverRequest.seq] = requestItem.callbacks; - this.pendingResponses++; + this.callbacks.add(serverRequest.seq, requestItem.callbacks); } this.service() .then((childProcess) => { childProcess.stdin.write(JSON.stringify(serverRequest) + '\r\n', 'utf8'); - }).then(undefined, err => { - let callback = this.callbacks[serverRequest.seq]; + }) + .then(undefined, err => { + const callback = this.callbacks.fetch(serverRequest.seq); if (callback) { callback.e(err); - delete this.callbacks[serverRequest.seq]; - this.pendingResponses--; } }); } private tryCancelRequest(seq: number): boolean { - for (let i = 0; i < this.requestQueue.length; i++) { - if (this.requestQueue[i].request.seq === seq) { - this.requestQueue.splice(i, 1); + try { + if (this.requestQueue.tryCancelPendingRequest(seq)) { this.tracer.logTrace(`TypeScript Service: canceled request with sequence number ${seq}`); return true; } - } - if (this.apiVersion.has222Features() && this.cancellationPipeName) { - this.tracer.logTrace(`TypeScript Service: trying to cancel ongoing request with sequence number ${seq}`); - try { - fs.writeFileSync(this.cancellationPipeName + seq, ''); - return true; - } catch (e) { - // noop - } finally { - const p = this.callbacks[seq]; - if (p) { - delete this.callbacks[seq]; - this.pendingResponses--; - p.e(new Error(`Cancelled Request ${seq}`)); + if (this.apiVersion.has222Features() && this.cancellationPipeName) { + this.tracer.logTrace(`TypeScript Service: trying to cancel ongoing request with sequence number ${seq}`); + try { + fs.writeFileSync(this.cancellationPipeName + seq, ''); + } catch (e) { + // noop } + return true; } - } - this.tracer.logTrace(`TypeScript Service: tried to cancel request with sequence number ${seq}. But request got already delivered.`); - return false; + this.tracer.logTrace(`TypeScript Service: tried to cancel request with sequence number ${seq}. But request got already delivered.`); + return false; + } finally { + const p = this.callbacks.fetch(seq); + if (p) { + p.e(new Error(`Cancelled Request ${seq}`)); + } + } } private dispatchMessage(message: Proto.Message): void { try { if (message.type === 'response') { const response: Proto.Response = message as Proto.Response; - const p = this.callbacks[response.request_seq]; + const p = this.callbacks.fetch(response.request_seq); if (p) { this.tracer.traceResponse(response, p.start); - delete this.callbacks[response.request_seq]; - this.pendingResponses--; if (response.success) { p.c(response); } else { @@ -940,60 +1022,7 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient } else if (message.type === 'event') { const event: Proto.Event = message; this.tracer.traceEvent(event); - if (event.event === 'syntaxDiag') { - this.host.syntaxDiagnosticsReceived(event as Proto.DiagnosticEvent); - } else if (event.event === 'semanticDiag') { - this.host.semanticDiagnosticsReceived(event as Proto.DiagnosticEvent); - } else if (event.event === 'configFileDiag') { - this.host.configFileDiagnosticsReceived(event as Proto.ConfigFileDiagnosticEvent); - } else if (event.event === 'telemetry') { - let telemetryData = (event as Proto.TelemetryEvent).body; - let properties: ObjectMap = Object.create(null); - switch (telemetryData.telemetryEventName) { - case 'typingsInstalled': - let typingsInstalledPayload: Proto.TypingsInstalledTelemetryEventPayload = (telemetryData.payload as Proto.TypingsInstalledTelemetryEventPayload); - properties['installedPackages'] = typingsInstalledPayload.installedPackages; - - if (is.defined(typingsInstalledPayload.installSuccess)) { - properties['installSuccess'] = typingsInstalledPayload.installSuccess.toString(); - } - if (is.string(typingsInstalledPayload.typingsInstallerVersion)) { - properties['typingsInstallerVersion'] = typingsInstalledPayload.typingsInstallerVersion; - } - break; - default: - let payload = telemetryData.payload; - if (payload) { - Object.keys(payload).forEach((key) => { - if (payload.hasOwnProperty(key) && is.string(payload[key])) { - properties[key] = payload[key]; - } - }); - } - break; - } - this.logTelemetry(telemetryData.telemetryEventName, properties); - } else if (event.event === 'projectLanguageServiceState') { - const data = (event as Proto.ProjectLanguageServiceStateEvent).body; - if (data) { - this._onProjectLanguageServiceStateChanged.fire(data); - } - } else if (event.event === 'beginInstallTypes') { - const data = (event as Proto.BeginInstallTypesEvent).body; - if (data) { - this._onDidBeginInstallTypings.fire(data); - } - } else if (event.event === 'endInstallTypes') { - const data = (event as Proto.EndInstallTypesEvent).body; - if (data) { - this._onDidEndInstallTypings.fire(data); - } - } else if (event.event === 'typesInstallerInitializationFailed') { - const data = (event as Proto.TypesInstallerInitializationFailedEvent).body; - if (data) { - this._onTypesInstallerInitializationFailed.fire(data); - } - } + this.dispatchEvent(event); } else { throw new Error('Unknown message type ' + message.type + ' recevied'); } @@ -1001,4 +1030,70 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient this.sendNextRequests(); } } + + private dispatchEvent(event: Proto.Event) { + if (event.event === 'syntaxDiag') { + this.host.syntaxDiagnosticsReceived(event as Proto.DiagnosticEvent); + } else if (event.event === 'semanticDiag') { + this.host.semanticDiagnosticsReceived(event as Proto.DiagnosticEvent); + } else if (event.event === 'configFileDiag') { + this.host.configFileDiagnosticsReceived(event as Proto.ConfigFileDiagnosticEvent); + } else if (event.event === 'telemetry') { + const telemetryData = (event as Proto.TelemetryEvent).body; + this.dispatchTelemetryEvent(telemetryData); + } else if (event.event === 'projectLanguageServiceState') { + const data = (event as Proto.ProjectLanguageServiceStateEvent).body; + if (data) { + this._onProjectLanguageServiceStateChanged.fire(data); + } + } else if (event.event === 'beginInstallTypes') { + const data = (event as Proto.BeginInstallTypesEvent).body; + if (data) { + this._onDidBeginInstallTypings.fire(data); + } + } else if (event.event === 'endInstallTypes') { + const data = (event as Proto.EndInstallTypesEvent).body; + if (data) { + this._onDidEndInstallTypings.fire(data); + } + } else if (event.event === 'typesInstallerInitializationFailed') { + const data = (event as Proto.TypesInstallerInitializationFailedEvent).body; + if (data) { + this._onTypesInstallerInitializationFailed.fire(data); + } + } + } + + private dispatchTelemetryEvent(telemetryData: Proto.TelemetryEventBody): void { + const properties: ObjectMap = Object.create(null); + switch (telemetryData.telemetryEventName) { + case 'typingsInstalled': + const typingsInstalledPayload: Proto.TypingsInstalledTelemetryEventPayload = (telemetryData.payload as Proto.TypingsInstalledTelemetryEventPayload); + properties['installedPackages'] = typingsInstalledPayload.installedPackages; + + if (is.defined(typingsInstalledPayload.installSuccess)) { + properties['installSuccess'] = typingsInstalledPayload.installSuccess.toString(); + } + if (is.string(typingsInstalledPayload.typingsInstallerVersion)) { + properties['typingsInstallerVersion'] = typingsInstalledPayload.typingsInstallerVersion; + } + break; + + default: + const payload = telemetryData.payload; + if (payload) { + Object.keys(payload).forEach((key) => { + try { + if (payload.hasOwnProperty(key)) { + properties[key] = is.string(payload[key]) ? payload[key] : JSON.stringify(payload[key]); + } + } catch (e) { + // noop + } + }); + } + break; + } + this.logTelemetry(telemetryData.telemetryEventName, properties); + } } \ No newline at end of file diff --git a/extensions/typescript/src/typings/ref.d.ts b/extensions/typescript/src/typings/ref.d.ts index bc057c55878395a9f4efb944714cf5c187c5e140..954bab971e334e14fa8f34ff84e325dac3bafc40 100644 --- a/extensions/typescript/src/typings/ref.d.ts +++ b/extensions/typescript/src/typings/ref.d.ts @@ -4,4 +4,5 @@ *--------------------------------------------------------------------------------------------*/ /// +/// /// diff --git a/extensions/typescript/src/utils/buildStatus.ts b/extensions/typescript/src/utils/buildStatus.ts deleted file mode 100644 index ced56fd43b900855e5d9566f1cbfd74881d57648..0000000000000000000000000000000000000000 --- a/extensions/typescript/src/utils/buildStatus.ts +++ /dev/null @@ -1,21 +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 vscode = require('vscode'); - -const statusItem: vscode.StatusBarItem = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left, Number.MIN_VALUE); - -export interface BuildInfo { - queueLength: number; -} - -export function update(info: BuildInfo): void { - if (info.queueLength === 0) { - statusItem.hide(); - return; - } - statusItem.text = info.queueLength.toString(); - statusItem.show(); -} \ No newline at end of file diff --git a/extensions/typescript/src/utils/electron.ts b/extensions/typescript/src/utils/electron.ts index 4418ca51dbd36fb62f992a2b6638dbca1100adf3..46ad56c464abb49ccd8601e4a48397f4d56c95cb 100644 --- a/extensions/typescript/src/utils/electron.ts +++ b/extensions/typescript/src/utils/electron.ts @@ -27,8 +27,7 @@ export function makeRandomHexString(length: number): string { function generatePipeName(): string { return getPipeName(makeRandomHexString(40)); } - -export function getPipeName(name: string): string { +function getPipeName(name: string): string { const fullName = 'vscode-' + name; if (process.platform === 'win32') { return '\\\\.\\pipe\\' + fullName + '-sock'; @@ -38,6 +37,11 @@ export function getPipeName(name: string): string { return path.join(os.tmpdir(), fullName + '.sock'); } +export function getTempFile(name: string): string { + const fullName = 'vscode-' + name; + return path.join(os.tmpdir(), fullName + '.sock'); +} + function generatePatchedEnv(env: any, stdInPipeName: string, stdOutPipeName: string, stdErrPipeName: string): any { // Set the two unique pipe names and the electron flag as process env diff --git a/extensions/typescript/src/utils/logger.ts b/extensions/typescript/src/utils/logger.ts index 7f82fb28c96dc9b5432a91acd4abafbf2bc0ac60..8e31d66d8581aded821b2c6e12ea665a685f26a9 100644 --- a/extensions/typescript/src/utils/logger.ts +++ b/extensions/typescript/src/utils/logger.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { OutputChannel, window } from "vscode"; +import { OutputChannel, window } from 'vscode'; import * as is from './is'; import * as nls from 'vscode-nls'; diff --git a/extensions/typescript/src/utils/plugins.ts b/extensions/typescript/src/utils/plugins.ts index 49f0d93b4b6c02bbca1b39a99172d89a766e86d8..23342cc8b3183107815d4f3f4f301154a0a0094e 100644 --- a/extensions/typescript/src/utils/plugins.ts +++ b/extensions/typescript/src/utils/plugins.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { extensions } from "vscode"; +import { extensions } from 'vscode'; export interface TypeScriptServerPlugin { diff --git a/extensions/typescript/src/utils/projectStatus.ts b/extensions/typescript/src/utils/projectStatus.ts index 8c9911531eb644109685d11f2c450467d4d89b88..278d7155b25b35e68f26889c3de5a2aa9d220a39 100644 --- a/extensions/typescript/src/utils/projectStatus.ts +++ b/extensions/typescript/src/utils/projectStatus.ts @@ -6,18 +6,15 @@ import * as vscode from 'vscode'; import { ITypescriptServiceClient } from '../typescriptService'; import { loadMessageBundle } from 'vscode-nls'; -import { dirname, join } from 'path'; +import { dirname } from 'path'; +import { openOrCreateConfigFile, isImplicitProjectConfigFile } from './tsconfig'; const localize = loadMessageBundle(); const selector = ['javascript', 'javascriptreact']; -interface Option extends vscode.MessageItem { - execute(): void; -} interface Hint { message: string; - options: Option[]; } interface ProjectHintedMap { @@ -45,29 +42,11 @@ class ExcludeHintItem { this._item.hide(); } - public show(configFileName: string, largeRoots: string, onExecute: () => void) { + public show(largeRoots?: string) { this._currentHint = { - message: largeRoots.length > 0 + message: largeRoots ? localize('hintExclude', "To enable project-wide JavaScript/TypeScript language features, exclude folders with many files, like: {0}", largeRoots) - : localize('hintExclude.generic', "To enable project-wide JavaScript/TypeScript language features, exclude large folders with source files that you do not work on."), - options: [{ - title: localize('open', "Configure Excludes"), - execute: () => { - this._client.logTelemetry('js.hintProjectExcludes.accepted'); - onExecute(); - this._item.hide(); - - let configFileUri: vscode.Uri; - if (vscode.workspace.rootPath && dirname(configFileName).indexOf(vscode.workspace.rootPath) === 0) { - configFileUri = vscode.Uri.file(configFileName); - } else { - configFileUri = vscode.Uri.parse('untitled://' + join(vscode.workspace.rootPath || '', 'jsconfig.json')); - } - - return vscode.workspace.openTextDocument(configFileName) - .then(vscode.window.showTextDocument); - } - }] + : localize('hintExclude.generic', "To enable project-wide JavaScript/TypeScript language features, exclude large folders with source files that you do not work on.") }; this._item.tooltip = this._currentHint.message; this._item.text = localize('large.label', "Configure Excludes"); @@ -120,9 +99,8 @@ function createLargeProjectMonitorForProject(item: ExcludeHintItem, client: ITyp if (fileNames.length > fileLimit || res.body.languageServiceDisabled) { let largeRoots = computeLargeRoots(configFileName, fileNames).map(f => `'/${f}/'`).join(', '); - item.show(configFileName, largeRoots, () => { - projectHinted[configFileName] = true; - }); + item.show(largeRoots); + projectHinted[configFileName] = true; } else { item.hide(); } @@ -143,11 +121,39 @@ function createLargeProjectMonitorForProject(item: ExcludeHintItem, client: ITyp } function createLargeProjectMonitorFromTypeScript(item: ExcludeHintItem, client: ITypescriptServiceClient): vscode.Disposable { + + interface LargeProjectMessageItem extends vscode.MessageItem { + index: number; + } + return client.onProjectLanguageServiceStateChanged(body => { if (body.languageServiceEnabled) { item.hide(); } else { - item.show(body.projectName, '', () => { }); + item.show(); + const configFileName = body.projectName; + if (configFileName) { + vscode.window.showWarningMessage(item.getCurrentHint().message, + { + title: localize('large.label', "Configure Excludes"), + index: 0 + }).then(selected => { + if (!selected || selected.index !== 0) { + return; + } + if (!isImplicitProjectConfigFile(configFileName)) { + vscode.workspace.openTextDocument(configFileName) + .then(vscode.window.showTextDocument); + } else { + const root = client.getWorkspaceRootForResource(vscode.Uri.file(configFileName)); + if (root) { + openOrCreateConfigFile( + configFileName.match(/tsconfig\.?.*\.json/) !== null, + root); + } + } + }); + } } }); } @@ -157,12 +163,8 @@ export function create(client: ITypescriptServiceClient, isOpen: (path: string) let item = new ExcludeHintItem(client); toDispose.push(vscode.commands.registerCommand('js.projectStatus.command', () => { - let { message, options } = item.getCurrentHint(); - return vscode.window.showInformationMessage(message, ...options).then(selection => { - if (selection) { - return selection.execute(); - } - }); + let { message } = item.getCurrentHint(); + return vscode.window.showInformationMessage(message); })); if (client.apiVersion.has213Features()) { diff --git a/extensions/typescript/src/utils/telemetry.ts b/extensions/typescript/src/utils/telemetry.ts index 5162a0c24d5e282450357236f5e166d520620f33..b687b11b4ac601b4c912fdaf688867dcc16f22ea 100644 --- a/extensions/typescript/src/utils/telemetry.ts +++ b/extensions/typescript/src/utils/telemetry.ts @@ -5,7 +5,7 @@ import * as path from 'path'; import VsCodeTelemetryReporter from 'vscode-extension-telemetry'; -import { Disposable } from "vscode"; +import { Disposable } from 'vscode'; interface IPackageInfo { diff --git a/extensions/typescript/src/utils/tsconfig.ts b/extensions/typescript/src/utils/tsconfig.ts new file mode 100644 index 0000000000000000000000000000000000000000..2cdd311ace4bd2da08049a051981c574927391de --- /dev/null +++ b/extensions/typescript/src/utils/tsconfig.ts @@ -0,0 +1,33 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import * as vscode from 'vscode'; +import * as path from 'path'; + +export function isImplicitProjectConfigFile(configFileName: string) { + return configFileName.indexOf('/dev/null/') === 0; +} + +export function openOrCreateConfigFile( + isTypeScriptProject: boolean, + rootPath: string +): Thenable { + const configFile = vscode.Uri.file(path.join(rootPath, isTypeScriptProject ? 'tsconfig.json' : 'jsconfig.json')); + const col = vscode.window.activeTextEditor ? vscode.window.activeTextEditor.viewColumn : undefined; + return vscode.workspace.openTextDocument(configFile) + .then(doc => { + return vscode.window.showTextDocument(doc, col); + }, _ => { + return vscode.workspace.openTextDocument(configFile.with({ scheme: 'untitled' })) + .then(doc => vscode.window.showTextDocument(doc, col)) + .then(editor => { + if (editor.document.getText().length === 0) { + return editor.insertSnippet(new vscode.SnippetString('{\n\t$0\n}')) + .then(_ => editor); + } + return editor; + }); + }); +} \ No newline at end of file diff --git a/extensions/typescript/src/utils/tsconfigProvider.ts b/extensions/typescript/src/utils/tsconfigProvider.ts new file mode 100644 index 0000000000000000000000000000000000000000..4c9db2c033a5dfae458e4035ef701ec5b8069446 --- /dev/null +++ b/extensions/typescript/src/utils/tsconfigProvider.ts @@ -0,0 +1,58 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +import * as vscode from 'vscode'; + +export default class TsConfigProvider extends vscode.Disposable { + private readonly tsconfigs = new Set(); + + private activated: boolean = false; + private disposables: vscode.Disposable[] = []; + + constructor() { + super(() => this.dispose()); + } + + dispose(): void { + this.disposables.forEach(d => d.dispose()); + } + + public async getConfigsForWorkspace(): Promise> { + if (!vscode.workspace.rootPath && !vscode.workspace.workspaceFolders) { + return []; + } + await this.ensureActivated(); + return this.tsconfigs; + } + + private async ensureActivated() { + if (this.activated) { + return this; + } + this.activated = true; + + for (const config of await TsConfigProvider.loadWorkspaceTsconfigs()) { + this.tsconfigs.add(config.fsPath); + } + + const configFileWatcher = vscode.workspace.createFileSystemWatcher('**/tsconfig*.json'); + this.disposables.push(configFileWatcher); + configFileWatcher.onDidCreate(this.handleProjectCreate, this, this.disposables); + configFileWatcher.onDidDelete(this.handleProjectDelete, this, this.disposables); + + return this; + } + + private static loadWorkspaceTsconfigs() { + return vscode.workspace.findFiles('**/tsconfig*.json', '**/node_modules/**'); + } + + private handleProjectCreate(e: vscode.Uri) { + this.tsconfigs.add(e.fsPath); + } + + private handleProjectDelete(e: vscode.Uri) { + this.tsconfigs.delete(e.fsPath); + } +} diff --git a/extensions/typescript/src/utils/typingsStatus.ts b/extensions/typescript/src/utils/typingsStatus.ts index 44f90ec15c1a98583a61f2eec8bb8b5f951fd1d1..33c4a85c7d663061938af61bf3520a59873911ea 100644 --- a/extensions/typescript/src/utils/typingsStatus.ts +++ b/extensions/typescript/src/utils/typingsStatus.ts @@ -106,7 +106,7 @@ export class AtaProgressReporter { window.showWarningMessage( localize( 'typesInstallerInitializationFailed.title', - "Could not install typings files for JavaScript language features. Please ensure that NPM is installed and is in your PATH" + "Could not install typings files for JavaScript language features. Please ensure that NPM is installed or configure 'typescript.npm' in your user settings" ), { title: localize('typesInstallerInitializationFailed.moreInformation', "More Information"), id: 1 diff --git a/extensions/typescript/src/utils/versionStatus.ts b/extensions/typescript/src/utils/versionStatus.ts index e92b87d0f248b24c9cfbf90875f9ef755dec0be7..21f3a1c34f18f33b25728c3119c1c1858f4efc55 100644 --- a/extensions/typescript/src/utils/versionStatus.ts +++ b/extensions/typescript/src/utils/versionStatus.ts @@ -3,42 +3,53 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import vscode = require('vscode'); +import * as vscode from 'vscode'; -const versionBarEntry = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Right, Number.MIN_VALUE); -export function showHideStatus() { - if (!versionBarEntry) { - return; - } - if (!vscode.window.activeTextEditor) { - versionBarEntry.hide(); - return; - } +export default class VersionStatus extends vscode.Disposable { + onChangeEditorSub: any; + private versionBarEntry: vscode.StatusBarItem; - let doc = vscode.window.activeTextEditor.document; - if (vscode.languages.match('typescript', doc) || vscode.languages.match('typescriptreact', doc)) { - versionBarEntry.show(); - return; - } + constructor() { + super(() => this.dispose()); + + this.versionBarEntry = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Right, Number.MIN_VALUE); - if (!vscode.window.activeTextEditor.viewColumn) { - // viewColumn is undefined for the debug/output panel, but we still want - // to show the version info - return; + this.onChangeEditorSub = vscode.window.onDidChangeActiveTextEditor(this.showHideStatus, this); } - versionBarEntry.hide(); -} + dispose() { + this.versionBarEntry.dispose(); + this.onChangeEditorSub.dispose(); + } -export function disposeStatus() { - if (versionBarEntry) { - versionBarEntry.dispose(); + showHideStatus() { + if (!this.versionBarEntry) { + return; + } + if (!vscode.window.activeTextEditor) { + this.versionBarEntry.hide(); + return; + } + + let doc = vscode.window.activeTextEditor.document; + if (vscode.languages.match('typescript', doc) || vscode.languages.match('typescriptreact', doc)) { + this.versionBarEntry.show(); + return; + } + + if (!vscode.window.activeTextEditor.viewColumn) { + // viewColumn is undefined for the debug/output panel, but we still want + // to show the version info + return; + } + + this.versionBarEntry.hide(); } -} -export function setInfo(message: string, tooltip: string) { - versionBarEntry.text = message; - versionBarEntry.tooltip = tooltip; - versionBarEntry.command = 'typescript.selectTypeScriptVersion'; + public setInfo(message: string, tooltip: string) { + this.versionBarEntry.text = message; + this.versionBarEntry.tooltip = tooltip; + this.versionBarEntry.command = 'typescript.selectTypeScriptVersion'; + } } diff --git a/extensions/typescript/src/utils/wireProtocol.ts b/extensions/typescript/src/utils/wireProtocol.ts index ad5d464304d3569df1ef93e50ad90a0a517e5bc1..799ec78da5239f52db8bcadd665d9a49602bd43d 100644 --- a/extensions/typescript/src/utils/wireProtocol.ts +++ b/extensions/typescript/src/utils/wireProtocol.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import stream = require('stream'); +import * as stream from 'stream'; const DefaultSize: number = 8192; const ContentLength: string = 'Content-Length: '; diff --git a/extensions/typescript/syntaxes/TypeScript.tmLanguage.json b/extensions/typescript/syntaxes/TypeScript.tmLanguage.json index b80d24f1c23b0e3ef7cb59fd1d8a60647d4cd182..6e16d697d52f35d7ad030d4148b051c3c3d29bea 100644 --- a/extensions/typescript/syntaxes/TypeScript.tmLanguage.json +++ b/extensions/typescript/syntaxes/TypeScript.tmLanguage.json @@ -1,4 +1,10 @@ { + "information_for_contributors": [ + "This file has been converted from https://github.com/Microsoft/TypeScript-TmLanguage/blob/master/TypeScript.tmLanguage", + "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/9be58bc51f179fd4119dbd5caaa7693a381a13b5", "name": "TypeScript", "scopeName": "source.ts", "fileTypes": [ @@ -71,7 +77,7 @@ "name": "storage.type.ts" } }, - "end": "(?=$|;|}|(\\s+(of|in)\\s+))", + "end": "(?=$|^|;|}|(\\s+(of|in)\\s+))", "patterns": [ { "include": "#destructuring-variable" @@ -100,7 +106,7 @@ "name": "meta.definition.variable.ts entity.name.function.ts" } }, - "end": "(?=$|[;,=}]|(\\s+(of|in)\\s+))", + "end": "(?=$|^|[;,=}]|(\\s+(of|in)\\s+))", "patterns": [ { "include": "#var-single-variable-type-annotation" @@ -115,7 +121,7 @@ "name": "meta.definition.variable.ts variable.other.constant.ts" } }, - "end": "(?=$|[;,=}]|(\\s+(of|in)\\s+))", + "end": "(?=$|^|[;,=}]|(\\s+(of|in)\\s+))", "patterns": [ { "include": "#var-single-variable-type-annotation" @@ -130,7 +136,7 @@ "name": "meta.definition.variable.ts variable.other.readwrite.ts" } }, - "end": "(?=$|[;,=}]|(\\s+(of|in)\\s+))", + "end": "(?=$|^|[;,=}]|(\\s+(of|in)\\s+))", "patterns": [ { "include": "#var-single-variable-type-annotation" @@ -157,7 +163,7 @@ { "name": "meta.object-binding-pattern-variable.ts", "begin": "(?)\n )) |\n ((async\\s*)?(\n ([(]\\s*(([)]\\s*:)|([_$[:alpha:]][_$[:alnum:]]*\\s*:)|(\\.\\.\\.) )) |\n ([<]\\s*[_$[:alpha:]][_$[:alnum:]]*((\\s+extends\\s*[^=>])|(\\s*[,]))) |\n ((<([^<>=]|=[^<]|\\<([^=<>]|=[^<])+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)\n ))\n )) |\n (:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n ))\n)", + "match": "(?x)(?:\\s*\\b(public|private|protected|readonly)\\s+)?(\\.\\.\\.)?\\s*(?)\n )) |\n ((async\\s*)?(\n ([(]\\s*(([)]\\s*:)|([_$[:alpha:]][_$[:alnum:]]*\\s*:)|(\\.\\.\\.) )) |\n ([<]\\s*[_$[:alpha:]][_$[:alnum:]]*((\\s+extends\\s*[^=>])|(\\s*[,]))) |\n ((<([^<>=]|=[^<]|\\<([^=<>]|=[^<])+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)\n ))\n )) |\n (:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n ))\n)", "captures": { "1": { "name": "storage.modifier.ts" @@ -1515,15 +1564,18 @@ "name": "keyword.operator.rest.ts" }, "3": { - "name": "entity.name.function.ts" + "name": "entity.name.function.ts variable.language.this.ts" }, "4": { + "name": "entity.name.function.ts" + }, + "5": { "name": "keyword.operator.optional.ts" } } }, { - "match": "(?:\\s*\\b(public|private|protected|readonly)\\s+)?(\\.\\.\\.)?\\s*(?])|(?<=[\\}>\\]\\)]|[_$[:alpha:]])\\s*(?=\\{)", "patterns": [ { - "include": "#comment" + "name": "meta.type.annotation.ts", + "begin": "(:)(?=\\s*\\S)", + "beginCaptures": { + "1": { + "name": "keyword.operator.type.annotation.ts" + } + }, + "end": "(?])|((?<=[\\}>\\]\\)]|[_$[:alpha:]])\\s*(?=\\{)))", + "patterns": [ + { + "include": "#type" + } + ] }, { - "include": "#type" + "name": "meta.type.annotation.ts", + "begin": "(:)", + "beginCaptures": { + "1": { + "name": "keyword.operator.type.annotation.ts" + } + }, + "end": "(?])|(?=^\\s*$)|((?<=\\S)(?=\\s*$))|((?<=[\\}>\\]\\)]|[_$[:alpha:]])\\s*(?=\\{)))", + "patterns": [ + { + "include": "#type" + } + ] } ] }, @@ -1934,14 +2031,40 @@ ] }, "type-function-return-type": { - "name": "meta.type.function.return.ts", - "begin": "=>", - "beginCaptures": { - "0": { - "name": "storage.type.function.arrow.ts" + "patterns": [ + { + "name": "meta.type.function.return.ts", + "begin": "(=>)(?=\\s*\\S)", + "beginCaptures": { + "1": { + "name": "storage.type.function.arrow.ts" + } + }, + "end": "(?)(?]|//|$)", + "patterns": [ + { + "include": "#type-function-return-type-core" + } + ] + }, + { + "name": "meta.type.function.return.ts", + "begin": "=>", + "beginCaptures": { + "0": { + "name": "storage.type.function.arrow.ts" + } + }, + "end": "(?)(?]|//|^\\s*$)|((?<=\\S)(?=\\s*$)))", + "patterns": [ + { + "include": "#type-function-return-type-core" + } + ] } - }, - "end": "(?)(?]|//|$)", + ] + }, + "type-function-return-type-core": { "patterns": [ { "include": "#comment" @@ -2013,7 +2136,7 @@ "name": "punctuation.definition.typeparameters.begin.ts" } }, - "end": "(?=$)|(>)", + "end": "(>)", "endCaptures": { "1": { "name": "punctuation.definition.typeparameters.end.ts" @@ -2048,7 +2171,7 @@ "name": "keyword.operator.assignment.ts" } }, - "end": "(?=$|[,);}\\]])", + "end": "(?=$|^|[,);}\\]])", "patterns": [ { "include": "#expression" @@ -2062,7 +2185,7 @@ "name": "keyword.operator.assignment.ts" } }, - "end": "(?=[,);}\\]])|(?=^\\s*$)", + "end": "(?=[,);}\\]])|(?=^\\s*$)|(?<=\\S)(?*]))\\s*(<)(?!*?]))\\s*(<)(?!", + "end": "(\\>)\\s*", "endCaptures": { - "0": { + "1": { "name": "meta.brace.angle.ts" } }, @@ -2513,9 +2640,9 @@ "name": "meta.brace.angle.ts" } }, - "end": "\\>", + "end": "(\\>)\\s*", "endCaptures": { - "0": { + "1": { "name": "meta.brace.angle.ts" } }, @@ -2558,12 +2685,12 @@ }, { "name": "meta.object.member.ts", - "begin": "(?=(?:(?:\\'[^']*\\')|(?:\\\"[^\"]*\\\")|(?:\\[([^\\[\\]]|\\[[^\\[\\]]*\\])+\\]))\\s*:)", + "begin": "(?=(?:(?:\\'.*\\')|(?:\\\".*\\\")|(?:\\[([^\\[\\]]|\\[[^\\[\\]]*\\])+\\]))\\s*:)", "end": "(?=,|\\})", "patterns": [ { "name": "meta.object-literal.key.ts", - "begin": "(?=(?:(?:\\'[^']*\\')|(?:\\\"[^\"]*\\\")|(?:\\[([^\\[\\]]|\\[[^\\[\\]]*\\])+\\]))\\s*:)", + "begin": "(?=(?:(?:\\'.*\\')|(?:\\\".*\\\")|(?:\\[([^\\[\\]]|\\[[^\\[\\]]*\\])+\\]))\\s*:)", "end": ":", "endCaptures": { "0": { @@ -2724,7 +2851,7 @@ "name": "keyword.control.as.ts" } }, - "end": "(?=$|[;,:})\\]])", + "end": "(?=$|^|[;,:})\\]])", "patterns": [ { "include": "#type" @@ -2809,7 +2936,7 @@ }, { "name": "meta.arrow.ts", - "begin": "(?x) (?:\n (? is on new line\n (\n [(]\\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*)? # typeparameters\n \\(([^()]|\\([^()]*\\))*\\) # parameteres\n (\\s*:\\s*(.)*)? # return type\n \\s*=> # arrow operator\n )\n )\n)", + "begin": "(?x) (?:\n (? is on new line\n (\n [(]\\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*)? # typeparameters\n \\(([^()]|\\([^()]*\\))*\\) # parameteres\n (\\s*:\\s*(.)*)? # return type\n \\s*=> # arrow operator\n )\n )\n)", "beginCaptures": { "1": { "name": "storage.modifier.async.ts" @@ -2839,7 +2966,7 @@ "name": "storage.type.function.arrow.ts" } }, - "end": "(?<=\\})|((?!\\{)(?=\\S))", + "end": "(?<=\\}|\\S)(?)|((?!\\{)(?=\\S))", "patterns": [ { "include": "#decl-block" @@ -3389,37 +3516,29 @@ } }, { - "begin": "(^[ \\t]+)?(?=//)", + "begin": "(^[ \\t]+)?(//)", "beginCaptures": { "1": { "name": "punctuation.whitespace.comment.leading.ts" + }, + "2": { + "name": "comment.line.double-slash.ts punctuation.definition.comment.ts" } }, - "end": "(?=$)", - "patterns": [ - { - "name": "comment.line.double-slash.ts", - "begin": "//", - "beginCaptures": { - "0": { - "name": "punctuation.definition.comment.ts" - } - }, - "end": "(?=$)" - } - ] + "end": "(?=^)", + "contentName": "comment.line.double-slash.ts" } ] }, "directives": { "name": "comment.line.triple-slash.directive.ts", - "begin": "^(///)\\s*(?=<(reference|amd-dependency|amd-module)(\\s+(path|types|no-default-lib|name)\\s*=\\s*((\\'[^']*\\')|(\\\"[^\"]*\\\")))+\\s*/>\\s*$)", + "begin": "^(///)\\s*(?=<(reference|amd-dependency|amd-module)(\\s+(path|types|no-default-lib|name)\\s*=\\s*((\\'.*\\')|(\\\".*\\\")))+\\s*/>\\s*$)", "beginCaptures": { "1": { "name": "punctuation.definition.comment.ts" } }, - "end": "(?=$)", + "end": "(?=^)", "patterns": [ { "name": "meta.tag.ts", @@ -3922,6 +4041,5 @@ } ] } - }, - "version": "https://github.com/Microsoft/TypeScript-TmLanguage/commit/9f6676aa2ddb75cb5a9dbe1f59024069e839d986" + } } \ No newline at end of file diff --git a/extensions/typescript/syntaxes/TypeScriptReact.tmLanguage.json b/extensions/typescript/syntaxes/TypeScriptReact.tmLanguage.json index c20889881a13e804b3bdbed210c0437dc11ba659..e8423e02c966a3a3f01b6b9824a13c8110323dcd 100644 --- a/extensions/typescript/syntaxes/TypeScriptReact.tmLanguage.json +++ b/extensions/typescript/syntaxes/TypeScriptReact.tmLanguage.json @@ -1,4 +1,10 @@ { + "information_for_contributors": [ + "This file has been converted from https://github.com/Microsoft/TypeScript-TmLanguage/blob/master/TypeScriptReact.tmLanguage", + "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/9be58bc51f179fd4119dbd5caaa7693a381a13b5", "name": "TypeScriptReact", "scopeName": "source.tsx", "fileTypes": [ @@ -71,7 +77,7 @@ "name": "storage.type.tsx" } }, - "end": "(?=$|;|}|(\\s+(of|in)\\s+))", + "end": "(?=$|^|;|}|(\\s+(of|in)\\s+))", "patterns": [ { "include": "#destructuring-variable" @@ -100,7 +106,7 @@ "name": "meta.definition.variable.tsx entity.name.function.tsx" } }, - "end": "(?=$|[;,=}]|(\\s+(of|in)\\s+))", + "end": "(?=$|^|[;,=}]|(\\s+(of|in)\\s+))", "patterns": [ { "include": "#var-single-variable-type-annotation" @@ -115,7 +121,7 @@ "name": "meta.definition.variable.tsx variable.other.constant.tsx" } }, - "end": "(?=$|[;,=}]|(\\s+(of|in)\\s+))", + "end": "(?=$|^|[;,=}]|(\\s+(of|in)\\s+))", "patterns": [ { "include": "#var-single-variable-type-annotation" @@ -130,7 +136,7 @@ "name": "meta.definition.variable.tsx variable.other.readwrite.tsx" } }, - "end": "(?=$|[;,=}]|(\\s+(of|in)\\s+))", + "end": "(?=$|^|[;,=}]|(\\s+(of|in)\\s+))", "patterns": [ { "include": "#var-single-variable-type-annotation" @@ -157,7 +163,7 @@ { "name": "meta.object-binding-pattern-variable.tsx", "begin": "(?)\n )) |\n ((async\\s*)?(\n ([(]\\s*(([)]\\s*:)|([_$[:alpha:]][_$[:alnum:]]*\\s*:)|(\\.\\.\\.) )) |\n ([<]\\s*[_$[:alpha:]][_$[:alnum:]]*((\\s+extends\\s*[^=>])|(\\s*[,]))) |\n ((<([^<>=]|=[^<]|\\<([^=<>]|=[^<])+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)\n ))\n )) |\n (:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n ))\n)", + "match": "(?x)(?:\\s*\\b(public|private|protected|readonly)\\s+)?(\\.\\.\\.)?\\s*(?)\n )) |\n ((async\\s*)?(\n ([(]\\s*(([)]\\s*:)|([_$[:alpha:]][_$[:alnum:]]*\\s*:)|(\\.\\.\\.) )) |\n ([<]\\s*[_$[:alpha:]][_$[:alnum:]]*((\\s+extends\\s*[^=>])|(\\s*[,]))) |\n ((<([^<>=]|=[^<]|\\<([^=<>]|=[^<])+\\>)+>\\s*)?\\(([^()]|\\([^()]*\\))*\\)(\\s*:\\s*(.)*)?\\s*=>)\n ))\n )) |\n (:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n ))\n)", "captures": { "1": { "name": "storage.modifier.tsx" @@ -1518,15 +1567,18 @@ "name": "keyword.operator.rest.tsx" }, "3": { - "name": "entity.name.function.tsx" + "name": "entity.name.function.tsx variable.language.this.tsx" }, "4": { + "name": "entity.name.function.tsx" + }, + "5": { "name": "keyword.operator.optional.tsx" } } }, { - "match": "(?:\\s*\\b(public|private|protected|readonly)\\s+)?(\\.\\.\\.)?\\s*(?])|(?<=[\\}>\\]\\)]|[_$[:alpha:]])\\s*(?=\\{)", "patterns": [ { - "include": "#comment" + "name": "meta.type.annotation.tsx", + "begin": "(:)(?=\\s*\\S)", + "beginCaptures": { + "1": { + "name": "keyword.operator.type.annotation.tsx" + } + }, + "end": "(?])|((?<=[\\}>\\]\\)]|[_$[:alpha:]])\\s*(?=\\{)))", + "patterns": [ + { + "include": "#type" + } + ] }, { - "include": "#type" + "name": "meta.type.annotation.tsx", + "begin": "(:)", + "beginCaptures": { + "1": { + "name": "keyword.operator.type.annotation.tsx" + } + }, + "end": "(?])|(?=^\\s*$)|((?<=\\S)(?=\\s*$))|((?<=[\\}>\\]\\)]|[_$[:alpha:]])\\s*(?=\\{)))", + "patterns": [ + { + "include": "#type" + } + ] } ] }, @@ -1937,14 +2034,40 @@ ] }, "type-function-return-type": { - "name": "meta.type.function.return.tsx", - "begin": "=>", - "beginCaptures": { - "0": { - "name": "storage.type.function.arrow.tsx" + "patterns": [ + { + "name": "meta.type.function.return.tsx", + "begin": "(=>)(?=\\s*\\S)", + "beginCaptures": { + "1": { + "name": "storage.type.function.arrow.tsx" + } + }, + "end": "(?)(?]|//|$)", + "patterns": [ + { + "include": "#type-function-return-type-core" + } + ] + }, + { + "name": "meta.type.function.return.tsx", + "begin": "=>", + "beginCaptures": { + "0": { + "name": "storage.type.function.arrow.tsx" + } + }, + "end": "(?)(?]|//|^\\s*$)|((?<=\\S)(?=\\s*$)))", + "patterns": [ + { + "include": "#type-function-return-type-core" + } + ] } - }, - "end": "(?)(?]|//|$)", + ] + }, + "type-function-return-type-core": { "patterns": [ { "include": "#comment" @@ -2016,7 +2139,7 @@ "name": "punctuation.definition.typeparameters.begin.tsx" } }, - "end": "(?=$)|(>)", + "end": "(>)", "endCaptures": { "1": { "name": "punctuation.definition.typeparameters.end.tsx" @@ -2051,7 +2174,7 @@ "name": "keyword.operator.assignment.tsx" } }, - "end": "(?=$|[,);}\\]])", + "end": "(?=$|^|[,);}\\]])", "patterns": [ { "include": "#expression" @@ -2065,7 +2188,7 @@ "name": "keyword.operator.assignment.tsx" } }, - "end": "(?=[,);}\\]])|(?=^\\s*$)", + "end": "(?=[,);}\\]])|(?=^\\s*$)|(?<=\\S)(? is on new line\n (\n [(]\\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*)? # typeparameters\n \\(([^()]|\\([^()]*\\))*\\) # parameteres\n (\\s*:\\s*(.)*)? # return type\n \\s*=> # arrow operator\n )\n )\n)", + "begin": "(?x) (?:\n (? is on new line\n (\n [(]\\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*)? # typeparameters\n \\(([^()]|\\([^()]*\\))*\\) # parameteres\n (\\s*:\\s*(.)*)? # return type\n \\s*=> # arrow operator\n )\n )\n)", "beginCaptures": { "1": { "name": "storage.modifier.async.tsx" @@ -2805,7 +2932,7 @@ "name": "storage.type.function.arrow.tsx" } }, - "end": "(?<=\\})|((?!\\{)(?=\\S))", + "end": "(?<=\\}|\\S)(?)|((?!\\{)(?=\\S))", "patterns": [ { "include": "#decl-block" @@ -3355,37 +3482,29 @@ } }, { - "begin": "(^[ \\t]+)?(?=//)", + "begin": "(^[ \\t]+)?(//)", "beginCaptures": { "1": { "name": "punctuation.whitespace.comment.leading.tsx" + }, + "2": { + "name": "comment.line.double-slash.tsx punctuation.definition.comment.tsx" } }, - "end": "(?=$)", - "patterns": [ - { - "name": "comment.line.double-slash.tsx", - "begin": "//", - "beginCaptures": { - "0": { - "name": "punctuation.definition.comment.tsx" - } - }, - "end": "(?=$)" - } - ] + "end": "(?=^)", + "contentName": "comment.line.double-slash.tsx" } ] }, "directives": { "name": "comment.line.triple-slash.directive.tsx", - "begin": "^(///)\\s*(?=<(reference|amd-dependency|amd-module)(\\s+(path|types|no-default-lib|name)\\s*=\\s*((\\'[^']*\\')|(\\\"[^\"]*\\\")))+\\s*/>\\s*$)", + "begin": "^(///)\\s*(?=<(reference|amd-dependency|amd-module)(\\s+(path|types|no-default-lib|name)\\s*=\\s*((\\'.*\\')|(\\\".*\\\")))+\\s*/>\\s*$)", "beginCaptures": { "1": { "name": "punctuation.definition.comment.tsx" } }, - "end": "(?=$)", + "end": "(?=^)", "patterns": [ { "name": "meta.tag.tsx", @@ -4184,6 +4303,5 @@ } ] } - }, - "version": "https://github.com/Microsoft/TypeScript-TmLanguage/commit/cb1af7953db224204607cbe22d3a45aa0f77a4c1" + } } \ No newline at end of file diff --git a/extensions/vb/.vscodeignore b/extensions/vb/.vscodeignore new file mode 100644 index 0000000000000000000000000000000000000000..77ab386fc7df4fa2461a8f1ac8457a1e6c9e808a --- /dev/null +++ b/extensions/vb/.vscodeignore @@ -0,0 +1 @@ +test/** \ No newline at end of file diff --git a/extensions/vb/syntaxes/asp-vb-net.tmlanguage.json b/extensions/vb/syntaxes/asp-vb-net.tmlanguage.json index f1d697c499a4565e0885871ffc03c459b40bfb07..1df56b22df87f69a997318a2c669378dedc4a6c3 100644 --- a/extensions/vb/syntaxes/asp-vb-net.tmlanguage.json +++ b/extensions/vb/syntaxes/asp-vb-net.tmlanguage.json @@ -1,4 +1,9 @@ { + "information_for_contributors": [ + "This file has been converted from https://github.com/textmate/asp.vb.net.tmbundle/blob/master/Syntaxes/ASP%20VB.net.plist", + "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." + ], "comment": "Modified from the original ASP bundle. Originally modified by Thomas Aylott subtleGradient.com", "fileTypes": [ "vb" @@ -233,6 +238,5 @@ } }, "scopeName": "source.asp.vb.net", - "uuid": "7F9C9343-D48E-4E7D-BFE8-F680714DCD3E", - "version": "https://github.com/textmate/asp.vb.net.tmbundle/commit/72d44550b3286d0382d7be0624140cf97857ff69" + "uuid": "7F9C9343-D48E-4E7D-BFE8-F680714DCD3E" } \ No newline at end of file diff --git a/extensions/vscode-api-tests/src/editor.test.ts b/extensions/vscode-api-tests/src/editor.test.ts index f39a736a967625dee3e00d742902beb41024c26c..a5d597b4bc0db8444dd2432b5cc5bc8c2111046d 100644 --- a/extensions/vscode-api-tests/src/editor.test.ts +++ b/extensions/vscode-api-tests/src/editor.test.ts @@ -7,11 +7,11 @@ import * as assert from 'assert'; import { workspace, window, Position, Range, commands, TextEditor, TextDocument, TextEditorCursorStyle, TextEditorLineNumbersStyle, SnippetString, Selection } from 'vscode'; -import { createRandomFile, deleteFile, cleanUp } from './utils'; +import { createRandomFile, deleteFile, closeAllEditors } from './utils'; suite('editor tests', () => { - teardown(cleanUp); + teardown(closeAllEditors); function withRandomFileEditor(initialContents: string, run: (editor: TextEditor, doc: TextDocument) => Thenable): Thenable { return createRandomFile(initialContents).then(file => { @@ -194,7 +194,7 @@ suite('editor tests', () => { (err) => { assert.ok(true, 'edit with overlapping ranges should fail'); } - ); + ); }); }); }); diff --git a/extensions/vscode-api-tests/src/languages.test.ts b/extensions/vscode-api-tests/src/languages.test.ts index d4a0c80130ef1e4eadf7c0fb2884050ea57bd11d..321b1b772f234f7df83d9fcd82315d5db7433384 100644 --- a/extensions/vscode-api-tests/src/languages.test.ts +++ b/extensions/vscode-api-tests/src/languages.test.ts @@ -14,7 +14,7 @@ import { suite('languages namespace tests', () => { - test('diagnostics & CodeActionProvider', function (done) { + test('diagnostics & CodeActionProvider', function () { class D2 extends Diagnostic { customProp = { complex() { } }; @@ -54,20 +54,15 @@ suite('languages namespace tests', () => { let r4 = languages.createDiagnosticCollection(); r4.set(uri, [diag2]); - workspace.openTextDocument(uri).then(doc => { + return workspace.openTextDocument(uri).then(doc => { return commands.executeCommand('vscode.executeCodeActionProvider', uri, new Range(0, 0, 0, 10)); }).then(commands => { - try { - assert.ok(ran); - Disposable.from(r1, r2, r3, r4).dispose(); - done(); - } catch (e) { - done(e); - } - }, done); + assert.ok(ran); + Disposable.from(r1, r2, r3, r4).dispose(); + }); }); - test('completions with document filters', function (done) { + test('completions with document filters', function () { let ran = false; let uri = Uri.file(join(workspace.rootPath || '', './bower.json')); @@ -82,17 +77,13 @@ suite('languages namespace tests', () => { } }); - workspace.openTextDocument(uri).then(doc => { + return workspace.openTextDocument(uri).then(doc => { return commands.executeCommand('vscode.executeCompletionItemProvider', uri, new Position(1, 0)); }).then((result: CompletionList) => { - try { - assert.equal(result.items[0].label, 'foo'); - assert.ok(ran); - Disposable.from(r1).dispose(); - done(); - } catch (e) { - done(e); - } - }, done); + r1.dispose(); + assert.ok(ran); + console.log(result.items); + assert.equal(result.items[0].label, 'foo'); + }); }); }); diff --git a/extensions/vscode-api-tests/src/utils.ts b/extensions/vscode-api-tests/src/utils.ts index d22baa8d55a5caead61c69dd8bba745672b23492..0d869ed787df77e2c5135b2a5437bb30dab6402a 100644 --- a/extensions/vscode-api-tests/src/utils.ts +++ b/extensions/vscode-api-tests/src/utils.ts @@ -5,7 +5,6 @@ 'use strict'; -import * as assert from 'assert'; import * as vscode from 'vscode'; import * as fs from 'fs'; import * as os from 'os'; @@ -49,31 +48,7 @@ export function deleteFile(file: vscode.Uri): Thenable { }); } -export function cleanUp(): Thenable { - return new Promise((resolve, reject) => { - if (vscode.window.visibleTextEditors.length === 0) { - return resolve(); - } - - const reg = vscode.window.onDidChangeVisibleTextEditors(editors => { - if (editors.length === 0) { - resolve(); - reg.dispose(); - } - }); +export function closeAllEditors(): Thenable { + return vscode.commands.executeCommand('workbench.action.closeAllEditors'); - vscode.commands.executeCommand('workbench.action.closeAllEditors').then(undefined, reject); - - }).then(() => { - assert.equal(vscode.window.visibleTextEditors.length, 0); - assert(!vscode.window.activeTextEditor); - - // TODO: we can't yet make this assertion because when - // the phost creates a document and makes no changes to it, - // the main side doesn't know about it and the phost side - // assumes it exists. Calling closeAllFiles will not - // remove it from textDocuments array. :( - - // assert.equal(vscode.workspace.textDocuments.length, 0); - }); } diff --git a/extensions/vscode-api-tests/src/window.test.ts b/extensions/vscode-api-tests/src/window.test.ts index cb14027e666b6e408a74b47eee6e54d89a9b3652..cf4c0f653e5a36acf0cb7b670dcfbfd1d2500883 100644 --- a/extensions/vscode-api-tests/src/window.test.ts +++ b/extensions/vscode-api-tests/src/window.test.ts @@ -8,11 +8,11 @@ import * as assert from 'assert'; import { workspace, window, commands, ViewColumn, TextEditorViewColumnChangeEvent, Uri, Selection, Position, CancellationTokenSource, TextEditorSelectionChangeKind } from 'vscode'; import { join } from 'path'; -import { cleanUp, pathEquals, createRandomFile } from './utils'; +import { closeAllEditors, pathEquals, createRandomFile } from './utils'; suite('window namespace tests', () => { - teardown(cleanUp); + teardown(closeAllEditors); test('editor, active text editor', () => { return workspace.openTextDocument(join(workspace.rootPath || '', './far.js')).then(doc => { @@ -24,10 +24,10 @@ suite('window namespace tests', () => { }); }); - test('editor, UN-active text editor', () => { - assert.equal(window.visibleTextEditors.length, 0); - assert.ok(window.activeTextEditor === undefined); - }); + // test('editor, UN-active text editor', () => { + // assert.equal(window.visibleTextEditors.length, 0); + // assert.ok(window.activeTextEditor === undefined); + // }); test('editor, assign and check view columns', () => { diff --git a/extensions/vscode-api-tests/src/workspace.test.ts b/extensions/vscode-api-tests/src/workspace.test.ts index 54aaa0f7962931ce40db4df538feeb7b7e12bb22..f55270629353b42958912fcc796f7b307ec13852 100644 --- a/extensions/vscode-api-tests/src/workspace.test.ts +++ b/extensions/vscode-api-tests/src/workspace.test.ts @@ -7,13 +7,13 @@ import * as assert from 'assert'; import * as vscode from 'vscode'; -import { createRandomFile, deleteFile, cleanUp, pathEquals } from './utils'; +import { createRandomFile, deleteFile, closeAllEditors, pathEquals } from './utils'; import { join, basename } from 'path'; import * as fs from 'fs'; suite('workspace-namespace', () => { - teardown(cleanUp); + teardown(closeAllEditors); test('textDocuments', () => { @@ -455,7 +455,7 @@ suite('workspace-namespace', () => { assert.equal(res.length, 1); assert.equal(basename(vscode.workspace.asRelativePath(res[0])), 'far.js'); }); - }); + }).timeout(60 * 1000); // Increase timeout for search-based test // TODO@Joh this test fails randomly // test('findFiles, cancellation', () => { diff --git a/extensions/xml/.vscodeignore b/extensions/xml/.vscodeignore new file mode 100644 index 0000000000000000000000000000000000000000..77ab386fc7df4fa2461a8f1ac8457a1e6c9e808a --- /dev/null +++ b/extensions/xml/.vscodeignore @@ -0,0 +1 @@ +test/** \ No newline at end of file diff --git a/extensions/xml/syntaxes/xml.json b/extensions/xml/syntaxes/xml.json index fb780f0f611a937db3600a340bd241f548007b0c..a2006a0d265346b06ecd7f27346c965ab4741e77 100644 --- a/extensions/xml/syntaxes/xml.json +++ b/extensions/xml/syntaxes/xml.json @@ -1,4 +1,9 @@ { + "information_for_contributors": [ + "This file has been converted from https://github.com/atom/language-xml/blob/master/grammars/xml.cson", + "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." + ], "scopeName": "text.xml", "name": "XML", "fileTypes": [ @@ -433,6 +438,5 @@ "end": "--%?>", "name": "comment.block.xml" } - }, - "version": "https://github.com/atom/language-xml/commit/ac6bc8ef6a9c79ac3c7e31615bc18436b0c815ab" + } } \ No newline at end of file diff --git a/extensions/xml/syntaxes/xsl.json b/extensions/xml/syntaxes/xsl.json index 8b715b599f94ec7c4994c6dd96111bd3113eadc4..2193c1a9570ab76aa095a879fc44219d2bebe8eb 100644 --- a/extensions/xml/syntaxes/xsl.json +++ b/extensions/xml/syntaxes/xsl.json @@ -1,4 +1,9 @@ { + "information_for_contributors": [ + "This file has been converted from https://github.com/atom/language-xml/blob/master/grammars/xsl.cson", + "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." + ], "scopeName": "text.xml.xsl", "name": "XSL", "fileTypes": [ @@ -88,6 +93,5 @@ }, "name": "string.quoted.single.xml" } - }, - "version": "https://github.com/atom/language-xml/commit/507de2ee7daca60cf02e9e21fbeb92bbae73e280" + } } \ No newline at end of file diff --git a/extensions/yaml/.vscodeignore b/extensions/yaml/.vscodeignore new file mode 100644 index 0000000000000000000000000000000000000000..77ab386fc7df4fa2461a8f1ac8457a1e6c9e808a --- /dev/null +++ b/extensions/yaml/.vscodeignore @@ -0,0 +1 @@ +test/** \ No newline at end of file diff --git a/extensions/yaml/syntaxes/yaml.json b/extensions/yaml/syntaxes/yaml.json index 55939b86d8d9a238bcba2cf535564f945900ea2b..82cd7d840dbee04b72ac6146a213e6cca96b62a0 100644 --- a/extensions/yaml/syntaxes/yaml.json +++ b/extensions/yaml/syntaxes/yaml.json @@ -1,4 +1,9 @@ { + "information_for_contributors": [ + "This file has been converted from https://github.com/textmate/yaml.tmbundle/blob/master/Syntaxes/YAML.tmLanguage", + "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." + ], "fileTypes": [ "yaml", "yml", @@ -624,6 +629,5 @@ } }, "scopeName": "source.yaml", - "uuid": "686AD6AE-33F3-4493-9512-9E9FC1D5417F", - "version": "https://github.com/textmate/yaml.tmbundle/commit/efc96efafe5e48480cf55a2ed124b388cbea4440" + "uuid": "686AD6AE-33F3-4493-9512-9E9FC1D5417F" } \ No newline at end of file diff --git a/i18n/chs/extensions/configuration-editing/out/settingsDocumentHelper.i18n.json b/i18n/chs/extensions/configuration-editing/out/settingsDocumentHelper.i18n.json index 6ad910135a07c34f8d5097e149891143b4763a84..f40aa81fa488b5ffb07c6872dd3f24a4939cdc84 100644 --- a/i18n/chs/extensions/configuration-editing/out/settingsDocumentHelper.i18n.json +++ b/i18n/chs/extensions/configuration-editing/out/settingsDocumentHelper.i18n.json @@ -5,7 +5,7 @@ // Do not edit this file. It is machine generated. { "activeEditorShort": "例如 myFile.txt", - "activeEditorMedium": "e.g. myFolder/myFile.txt", + "activeEditorMedium": "例如 myFolder/myFile.txt", "activeEditorLong": "例如 /Users/Development/myProject/myFolder/myFile.txt", "rootName": "例如 myProject", "rootPath": "例如 /Users/Development/myProject", diff --git a/i18n/chs/extensions/git/out/commands.i18n.json b/i18n/chs/extensions/git/out/commands.i18n.json index 3a000b987738e57c82ff85c6787925da9b06040f..ceede002e08b3379e4723a69fe9b5631f484f543 100644 --- a/i18n/chs/extensions/git/out/commands.i18n.json +++ b/i18n/chs/extensions/git/out/commands.i18n.json @@ -26,6 +26,9 @@ "provide commit message": "请提供提交消息", "branch name": "分支名称", "provide branch name": "请提供分支名称", + "select branch to delete": "选择要删除的分支", + "confirm force delete branch": "“{0}”分支未被完全合并。是否仍要删除?", + "delete branch": "删除分支", "no remotes to pull": "存储库未配置任何从其中进行拉取的远程存储库。", "no remotes to push": "存储库未配置任何要推送到的远程存储库。", "nobranch": "请签出一个分支以推送到远程。", diff --git a/i18n/chs/extensions/git/package.i18n.json b/i18n/chs/extensions/git/package.i18n.json index bed9f4de89c90eae9c614bcea1665cad4dfc5fbc..996b8a4173c670af5363ab2f4f08bd5cd321c99f 100644 --- a/i18n/chs/extensions/git/package.i18n.json +++ b/i18n/chs/extensions/git/package.i18n.json @@ -26,12 +26,13 @@ "command.undoCommit": "撤消上次提交", "command.checkout": "签出到...", "command.branch": "创建分支...", + "command.deleteBranch": "删除分支...", "command.pull": "拉取", "command.pullRebase": "拉取(变基)", "command.push": "推送", "command.pushTo": "推送到...", "command.sync": "同步", - "command.publish": "发布", + "command.publish": "发布分支", "command.showOutput": "显示 GIT 输出", "config.enabled": "是否已启用 GIT", "config.path": "Git 可执行文件路径", diff --git a/i18n/chs/extensions/gulp/out/main.i18n.json b/i18n/chs/extensions/gulp/out/main.i18n.json index 500082cf82f2776c40accb7a6a235d1ceb714e83..bda8a250c2541e5665252e4b7fb901a65274dfdf 100644 --- a/i18n/chs/extensions/gulp/out/main.i18n.json +++ b/i18n/chs/extensions/gulp/out/main.i18n.json @@ -4,5 +4,5 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "execFailed": "自动检测 gulp 失败,错误为: {0}" + "execFailed": "自动检测 gulp 失败,错误:{0}" } \ No newline at end of file diff --git a/i18n/chs/extensions/jake/out/main.i18n.json b/i18n/chs/extensions/jake/out/main.i18n.json index 8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a..d2f56bdda986c2116dd272325a94aae3e68082df 100644 --- a/i18n/chs/extensions/jake/out/main.i18n.json +++ b/i18n/chs/extensions/jake/out/main.i18n.json @@ -3,4 +3,6 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. -{} \ No newline at end of file +{ + "execFailed": "自动检测 Jake 失败,错误:{0}" +} \ No newline at end of file diff --git a/i18n/chs/extensions/jake/package.i18n.json b/i18n/chs/extensions/jake/package.i18n.json index 8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a..46f020cf890fd6c09309124975e4690f9ad4781b 100644 --- a/i18n/chs/extensions/jake/package.i18n.json +++ b/i18n/chs/extensions/jake/package.i18n.json @@ -3,4 +3,6 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. -{} \ No newline at end of file +{ + "config.jake.autoDetect": "控制自动检测 Jake 任务是否打开。默认开启。" +} \ No newline at end of file diff --git a/i18n/chs/extensions/markdown/out/extension.i18n.json b/i18n/chs/extensions/markdown/out/extension.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..111330fed75d94d0f66fb5aaba2b3a71e57d322d --- /dev/null +++ b/i18n/chs/extensions/markdown/out/extension.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "onPreviewStyleLoadError": "无法加载“markdown.styles”:{0}" +} \ No newline at end of file diff --git a/i18n/chs/extensions/merge-conflict/out/codelensProvider.i18n.json b/i18n/chs/extensions/merge-conflict/out/codelensProvider.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..91a343efd7d87aee55f8dcb59d3b938a4a479568 --- /dev/null +++ b/i18n/chs/extensions/merge-conflict/out/codelensProvider.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "acceptCurrentChange": "采用当前更改", + "acceptIncomingChange": "采用传入的更改", + "acceptBothChanges": "保留双方更改", + "compareChanges": "比较变更" +} \ No newline at end of file diff --git a/i18n/chs/extensions/merge-conflict/out/commandHandler.i18n.json b/i18n/chs/extensions/merge-conflict/out/commandHandler.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..836475b99dc33982663f6d16601dac0d82368ce4 --- /dev/null +++ b/i18n/chs/extensions/merge-conflict/out/commandHandler.i18n.json @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "cursorNotInConflict": "编辑器光标不在合并冲突内", + "compareChangesTitle": "{0}:当前更改 ⟷ 传入的更改", + "cursorOnCommonAncestorsRange": "编辑器光标在共同来源块上,请将其移动至“当前”或“传入”区域中", + "cursorOnSplitterRange": "编辑器光标在合并冲突分割线上,请将其移动至“当前”或“传入”区域中", + "noConflicts": "没有在此文件中找到合并冲突", + "noOtherConflictsInThisFile": "此文件中没有其他合并冲突了" +} \ No newline at end of file diff --git a/i18n/chs/extensions/merge-conflict/out/mergeDecorator.i18n.json b/i18n/chs/extensions/merge-conflict/out/mergeDecorator.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..6fb9fc93479d3235826572f1c24bd4b11e52e10c --- /dev/null +++ b/i18n/chs/extensions/merge-conflict/out/mergeDecorator.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "currentChange": "(当前更改)", + "incomingChange": "(传入的更改)" +} \ No newline at end of file diff --git a/i18n/chs/extensions/merge-conflict/package.i18n.json b/i18n/chs/extensions/merge-conflict/package.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..ae0c9b417049099be9085fa857fe4624b764342b --- /dev/null +++ b/i18n/chs/extensions/merge-conflict/package.i18n.json @@ -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. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "command.category": "合并冲突", + "command.accept.all-incoming": "全部采用传入版本", + "command.accept.all-both": "全部保留两者", + "command.accept.current": "采用当前内容", + "command.accept.incoming": "采用传入内容", + "command.accept.selection": "采用选中版本", + "command.accept.both": "保留两者", + "command.next": "下一个冲突", + "command.previous": "上一个冲突", + "command.compare": "比较当前冲突", + "config.title": "合并冲突", + "config.codeLensEnabled": "启用/禁用编辑器内合并冲突区域的 CodeLens", + "config.decoratorsEnabled": "启用/禁用编辑器内的合并冲突修饰器" +} \ No newline at end of file diff --git a/i18n/chs/extensions/npm/package.i18n.json b/i18n/chs/extensions/npm/package.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..6130b12cc0571bbcdac2069907b3a95e580d09ed --- /dev/null +++ b/i18n/chs/extensions/npm/package.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "config.npm.autoDetect": "控制自动检测 npm 脚本是否打开。默认开启。" +} \ No newline at end of file diff --git a/i18n/chs/extensions/typescript/out/features/bufferSyncSupport.i18n.json b/i18n/chs/extensions/typescript/out/features/bufferSyncSupport.i18n.json index c885212097a21638fd0176b43192e74b7c98a64a..2b32badbce55a97425dd99adbc6d78bb5e4f793c 100644 --- a/i18n/chs/extensions/typescript/out/features/bufferSyncSupport.i18n.json +++ b/i18n/chs/extensions/typescript/out/features/bufferSyncSupport.i18n.json @@ -4,9 +4,9 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "versionMismatch": "版本不匹配! 全局 tsc ({0}) != VS Code 的语言服务({1})。可能出现不一致的编译错误", + "versionMismatch": "正在使用 TypeScript ({1}) 实现的编辑器功能。TypeScript ({0}) 已经全局安装在你的电脑上。VS Code 中发生的错误可能会与 TCS 中不同", "moreInformation": "详细信息", - "doNotCheckAgain": "不要再次检查", + "doNotCheckAgain": "不再检查", "close": "关闭", "updateTscCheck": "已将用户设置 \"typescript.check.tscVersion\" 更新为 false" } \ No newline at end of file diff --git a/i18n/chs/extensions/typescript/out/utils/projectStatus.i18n.json b/i18n/chs/extensions/typescript/out/utils/projectStatus.i18n.json index 801a0e687c6baf71f474791ffa6870f60888aa45..cd5d5f3a2ff0184a47ddd144a1ad60c7cd236e14 100644 --- a/i18n/chs/extensions/typescript/out/utils/projectStatus.i18n.json +++ b/i18n/chs/extensions/typescript/out/utils/projectStatus.i18n.json @@ -6,7 +6,6 @@ { "hintExclude": "若要启用项目范围内的 JavaScript/TypeScript 语言功能,请排除包含多个文件的文件夹,例如: {0}", "hintExclude.generic": "若要启用项目范围内的 JavaScript/TypeScript 语言功能,请排除包含不需要处理的源文件的大型文件夹。", - "open": "配置排除", "large.label": "配置排除", "hintExclude.tooltip": "若要启用项目范围内的 JavaScript/TypeScript 语言功能,请排除包含不需要处理的源文件的大型文件夹。" } \ No newline at end of file diff --git a/i18n/chs/extensions/typescript/out/utils/typingsStatus.i18n.json b/i18n/chs/extensions/typescript/out/utils/typingsStatus.i18n.json index 01709f2e6d3d3c0194988634cdbbacc3f8a47752..276914045d0beb7fd6c6def220df3d9fe6c3a0ac 100644 --- a/i18n/chs/extensions/typescript/out/utils/typingsStatus.i18n.json +++ b/i18n/chs/extensions/typescript/out/utils/typingsStatus.i18n.json @@ -5,7 +5,7 @@ // Do not edit this file. It is machine generated. { "installingPackages": "提取数据以实现更好的 TypeScript IntelliSense", - "typesInstallerInitializationFailed.title": "无法为 JavaScript 语言功能安装 typings 文件。请确认 NPM 已经安装且位于 PATH 中", + "typesInstallerInitializationFailed.title": "无法为 JavaScript 语言功能安装 typings 文件。请确认 NPM 已经安装或者在你的用户设置中配置“typescript.npm”", "typesInstallerInitializationFailed.moreInformation": "详细信息", "typesInstallerInitializationFailed.doNotCheckAgain": "不要再次检查", "typesInstallerInitializationFailed.close": "关闭" diff --git a/i18n/chs/extensions/typescript/package.i18n.json b/i18n/chs/extensions/typescript/package.i18n.json index 7d185d9e36eedf4ccf9683e42f253a10f330dc4a..8f30f33dedaf0f6023c4b2ff515c5f3ed3a03440 100644 --- a/i18n/chs/extensions/typescript/package.i18n.json +++ b/i18n/chs/extensions/typescript/package.i18n.json @@ -13,11 +13,11 @@ "typescript.check.tscVersion": "检查全局安装的 TypeScript 编译器(例如 tsc )是否不同于使用的 TypeScript 语言服务。", "typescript.tsserver.log": "将 TS 服务器的日志保存到一个文件。此日志可用于诊断 TS 服务器问题。日志可能包含你的项目中的文件路径、源代码和其他可能敏感的信息。", "typescript.tsserver.trace": "对发送到 TS 服务器的消息启用跟踪。此跟踪信息可用于诊断 TS 服务器问题。 跟踪信息可能包含你的项目中的文件路径、源代码和其他可能敏感的信息。", - "typescript.tsserver.experimentalAutoBuild": "启用实验性自动生成。要求安装 1.9 dev 或 2.x tsserver 版本并在更改后重启 VS Code。", "typescript.validate.enable": "启用/禁用 TypeScript 验证。", "typescript.format.enable": "启用/禁用默认 TypeScript 格式化程序。", "javascript.format.enable": "启用/禁用 JavaScript 格式化程序。", "format.insertSpaceAfterCommaDelimiter": "定义逗号分隔符后面的空格处理。", + "format.insertSpaceAfterConstructor": "定义构造器关键字后的空格处理。要求 TypeScript >= 2.3.0。", "format.insertSpaceAfterSemicolonInForStatements": "在 For 语句中,定义分号后面的空格处理。", "format.insertSpaceBeforeAndAfterBinaryOperators": "定义二进制运算符后面的空格处理", "format.insertSpaceAfterKeywordsInControlFlowStatements": "定义控制流语句中关键字后面的空格处理。", @@ -37,9 +37,12 @@ "typescript.referencesCodeLens.enabled": "启用/禁用在 TypeScript 文件中引用 CodeLens。要求 TypeScript >= 2.0.6。", "typescript.implementationsCodeLens.enabled": "启用/禁用实现 CodeLens。要求 TypeScript >= 2.2.0。", "typescript.openTsServerLog.title": "打开 TS 服务器日志", + "typescript.restartTsServer": "重启 TS 服务器", "typescript.selectTypeScriptVersion.title": "选择 TypeScript 版本", "jsDocCompletion.enabled": "启用/禁用自动 JSDoc 注释", "javascript.implicitProjectConfig.checkJs": "启用/禁用 JavaScript 文件的语义检查。现有的 jsconfig.json 或\n tsconfig.json 文件会覆盖此设置。要求 TypeScript >=2.3.1。", - "typescript.check.npmIsInstalled": "检查是否安装了 NPM 以进行自动 typings 获取", - "javascript.nameSuggestions": "启用/禁用在 JavaScript 建议列表中包含文件中的唯一名称。" + "typescript.npm": "指定用于自动获取类型的 NPM 可执行文件的路径。要求 TypeScript >= 2.3.4。", + "typescript.check.npmIsInstalled": "检查是否安装了 NPM 以自动获取类型。", + "javascript.nameSuggestions": "启用/禁用在 JavaScript 建议列表中包含文件中的唯一名称。", + "typescript.tsc.autoDetect": "控制自动检测 tsc 任务是否打开。" } \ No newline at end of file diff --git a/i18n/chs/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json b/i18n/chs/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json index 7b395b9c15a7965e60704da3623a617747e2e84c..883b4c5cbca44028d788f37bf292674cde3e20cc 100644 --- a/i18n/chs/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json +++ b/i18n/chs/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json @@ -6,8 +6,7 @@ { "imgMeta": "{0}x{1} {2}", "largeImageError": "图像太大,无法在编辑器中显示。 ", - "resourceOpenExternalButton": "打开图片", - "resourceOpenExternalText": " 是否使用外部程序?", + "resourceOpenExternalButton": "使用外部程序打开图片?", "nativeBinaryError": "文件将不在编辑器中显示,因为它是二进制文件、非常大或使用不支持的文本编码。", "sizeB": "{0} B", "sizeKB": "{0} KB", diff --git a/i18n/chs/src/vs/base/common/errorMessage.i18n.json b/i18n/chs/src/vs/base/common/errorMessage.i18n.json index 8dd95907e516341549769cbf43e8d24e86297baf..8e1a689b214be98c5df78f58017f066a0cf5ef7d 100644 --- a/i18n/chs/src/vs/base/common/errorMessage.i18n.json +++ b/i18n/chs/src/vs/base/common/errorMessage.i18n.json @@ -13,6 +13,5 @@ "error.connection.unknown": "出现未知连接错误。您的 Internet 连接已断开,或者您连接的服务器已脱机。", "stackTrace.format": "{0}: {1}", "error.defaultMessage": "出现未知错误。有关详细信息,请参阅日志。", - "nodeExceptionMessage": "发生了系统错误({0})", "error.moreErrors": "{0} 个(共 {1} 个错误)" } \ No newline at end of file diff --git a/extensions/ruby/src/typings/ref.d.ts b/i18n/chs/src/vs/base/common/keybindingLabels.i18n.json similarity index 86% rename from extensions/ruby/src/typings/ref.d.ts rename to i18n/chs/src/vs/base/common/keybindingLabels.i18n.json index 531d3c037dde7ea328b97274eb0a08864c14fc3d..8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a 100644 --- a/extensions/ruby/src/typings/ref.d.ts +++ b/i18n/chs/src/vs/base/common/keybindingLabels.i18n.json @@ -2,5 +2,5 @@ * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ - -/// \ No newline at end of file +// Do not edit this file. It is machine generated. +{} \ No newline at end of file diff --git a/i18n/chs/src/vs/code/electron-main/menus.i18n.json b/i18n/chs/src/vs/code/electron-main/menus.i18n.json index 16b5dc1479acacc6021d8e37868080df6bfbc361..8e60bd1b82aa01adfedb2260fd60a3063151cf32 100644 --- a/i18n/chs/src/vs/code/electron-main/menus.i18n.json +++ b/i18n/chs/src/vs/code/electron-main/menus.i18n.json @@ -12,6 +12,7 @@ "mDebug": "调试(&&D)", "mWindow": "窗口", "mHelp": "帮助(&&H)", + "mTask": "任务(&&T)", "miNewWindow": "新建窗口(&&W)", "mAbout": "关于 {0}", "mServices": "服务", @@ -41,6 +42,7 @@ "miSelectIconTheme": "文件图标主题(&&I)", "miPreferences": "首选项(&&P)", "miReopenClosedEditor": "重新打开已关闭的编辑器(&&R)", + "miMore": "更多(&&M)...", "miClearRecentOpen": "清除最近使用的文件(&&C)", "miUndo": "撤消(&&U)", "miRedo": "恢复(&&R)", @@ -55,6 +57,9 @@ "miShowEmmetCommands": "Emmet(&&M)...", "miToggleLineComment": "切换行注释(&&T)", "miToggleBlockComment": "切换块注释(&&B)", + "miMultiCursorAlt": "使用Alt+单击进行多光标功能", + "miMultiCursorCmd": "使用Cmd+单击进行多光标功能", + "miMultiCursorCtrl": "使用Ctrl+单击进行多光标功能", "miInsertCursorAbove": "在上面添加光标(&&A)", "miInsertCursorBelow": "在下面添加光标(&&D)", "miInsertCursorAtEndOfEachLineSelected": "在行尾添加光标(&&U)", @@ -102,7 +107,7 @@ "miForward": "前进(&&F)", "miNextEditor": "下一个编辑器(&&N)", "miPreviousEditor": "上一个编辑器(&&P)", - "miNextEditorInGroup": "组中上一个使用过的编辑器(&&P)", + "miNextEditorInGroup": "组中下一个使用过的编辑器(&&N)", "miPreviousEditorInGroup": "组中上一个使用过的编辑器(&&P)", "miSwitchEditor": "切换编辑器(&&E)", "miFocusFirstGroup": "第一组(&&F)", @@ -133,12 +138,14 @@ "miColumnBreakpoint": "列断点(&&O)", "miFunctionBreakpoint": "函数断点(&&F)...", "miNewBreakpoint": "新建断点(&&N)", + "miEnableAllBreakpoints": "启用所有断点", "miDisableAllBreakpoints": "禁用所有断点(&&L)", "miRemoveAllBreakpoints": "删除所有断点(&&R)", "miInstallAdditionalDebuggers": "安装其他调试器(&&I)...", "mMinimize": "最小化", - "mClose": "关闭", + "mZoom": "缩放", "mBringToFront": "全部置于顶层", + "miSwitchWindow": "切换窗口(&&W)...", "miToggleDevTools": "切换开发人员工具(&&T)", "miAccessibilityOptions": "辅助功能选项(&&O)", "miReportIssues": "报告问题(&&I)", @@ -146,19 +153,26 @@ "miInteractivePlayground": "交互式演练场(&&I)", "miDocumentation": "文档(&&D)", "miReleaseNotes": "发行说明(&&R)", - "miKeyboardShortcuts": "键盘快捷方式参考(&&K)", + "miKeyboardShortcuts": "快捷键参考(&&K)", "miIntroductoryVideos": "介绍性视频(&&V)", "miTwitter": "在 Twitter 上加入我们(&&J)", "miUserVoice": "搜索功能请求(&&S)", "miLicense": "查看许可证(&&L)", "miPrivacyStatement": "隐私声明(&&P)", "miAbout": "关于(&&A)", + "miRunTask": "运行任务(&&R)...", + "miRestartTask": "重启任务(&&E)", + "miTerminateTask": "终止任务(&&T)", + "miBuildTask": "生成任务(&&B)", + "miTestTask": "测试任务(&&A)", + "miShowTaskLog": "显示任务日志(&&S)", + "accessibilityOptionsWindowTitle": "辅助功能选项", "miRestartToUpdate": "重启以更新...", "miCheckingForUpdates": "正在检查更新...", "miDownloadUpdate": "下载可用更新", "miDownloadingUpdate": "正在下载更新...", "miInstallingUpdate": "正在安装更新...", "miCheckForUpdates": "检查更新...", - "aboutDetail": "\n版本 {0}\n提交 {1}\n日期 {2}\nShell {3}\n呈现器 {4}\nNode {5}", + "aboutDetail": "\n版本 {0}\n提交 {1}\n日期 {2}\nShell {3}\n渲染器 {4}\nNode {5}", "okButton": "确定" } \ No newline at end of file diff --git a/i18n/chs/src/vs/code/electron-main/windows.i18n.json b/i18n/chs/src/vs/code/electron-main/windows.i18n.json index 6982cf6190cbd8a52ce7ce283db1ac4f5c1b3f02..c07ddb7e29d2d840174ebafe1d28e4adca6749ee 100644 --- a/i18n/chs/src/vs/code/electron-main/windows.i18n.json +++ b/i18n/chs/src/vs/code/electron-main/windows.i18n.json @@ -7,16 +7,11 @@ "ok": "确定", "pathNotExistTitle": "路径不存在", "pathNotExistDetail": "磁盘上似乎不再存在路径“{0}”。", - "accessibilityOptionsWindowTitle": "辅助功能选项", "reopen": "重新打开", "wait": "保持等待", "close": "关闭", "appStalled": "窗口不再响应", "appStalledDetail": "可以重新打开或关闭窗,或者保持等待。", "appCrashed": "窗口出现故障", - "appCrashedDetail": "我们对此引起的不便表示抱歉! 请重启该窗口从上次停止的位置继续。", - "newWindow": "新建窗口", - "newWindowDesc": "打开一个新窗口", - "recentFolders": "最近的文件夹", - "folderDesc": "{0} {1}" + "appCrashedDetail": "我们对此引起的不便表示抱歉! 请重启该窗口从上次停止的位置继续。" } \ No newline at end of file diff --git a/i18n/chs/src/vs/editor/common/config/commonEditorConfig.i18n.json b/i18n/chs/src/vs/editor/common/config/commonEditorConfig.i18n.json index ad55e59f4eb4f7737836dabfb9b57004ff3f293d..ec542efe0a076e20a689e457196cbbc6e2e89dff 100644 --- a/i18n/chs/src/vs/editor/common/config/commonEditorConfig.i18n.json +++ b/i18n/chs/src/vs/editor/common/config/commonEditorConfig.i18n.json @@ -14,7 +14,7 @@ "rulers": "显示垂直标尺的列", "wordSeparators": "执行文字相关的导航或操作时将用作文字分隔符的字符", "tabSize": "一个制表符等于的空格数。该设置在 `editor.detectIndentation` 启用时根据文件内容进行重写。", - "tabSize.errorMessage": "应为 \\\\\"number\\\\\"。注意,值\\\\\"auto\\\\\"已由 \\\\\"editor.detectIndentation\\\\\" 设置替换。", + "tabSize.errorMessage": "应为“number”。注意,值“auto”已由“editor.detectIndentation”设置替换。", "insertSpaces": "按 \"Tab\" 时插入空格。该设置在 `editor.detectIndentation` 启用时根据文件内容进行重写。", "insertSpaces.errorMessage": "应为 \"boolean\"。注意,值 \"auto\" 已由 \"editor.detectIndentation\" 设置替换。", "detectIndentation": "当打开文件时,将基于文件内容检测 \"editor.tabSize\" 和 \"editor.insertSpaces\"。", @@ -23,25 +23,30 @@ "minimap.enabled": "控制是否显示 minimap", "minimap.renderCharacters": "呈现某行上的实际字符(与颜色块相反)", "minimap.maxColumn": "限制最小映射的宽度,尽量多地呈现特定数量的列", + "find.seedSearchStringFromSelection": "控制是否将编辑器的选中内容作为搜索词填入到查找组件", + "find.autoFindInSelection": "控制当编辑器中选中多个字符或多行文字时是否开启“在选定内容中查找”选项 ", "wordWrap.off": "永不换行。", "wordWrap.on": "将在视区宽度处换行。", "wordWrap.wordWrapColumn": "将在 \"editor.wordWrapColumn\" 处换行。", "wordWrap.bounded": "将在最小视区和 \"editor.wordWrapColumn\" 处换行。", "wordWrap": "控制折行方式。可以选择: - “off” (禁用折行), - “on” (视区折行), - “wordWrapColumn”(在“editor.wordWrapColumn”处折行)或 - “bounded”(在视区与“editor.wordWrapColumn”两者的较小者处折行)。", "wordWrapColumn": "在 \"editor.wordWrap\" 为 \"wordWrapColumn\" 或 \"bounded\" 时控制编辑器列的换行。", - "wrappingIndent": "控制换行的行的缩进。可以是\\\\\"none\\\\\"、 \\\\\"same\\\\\" 或 \\\\\"indent\\\\\"。", + "wrappingIndent": "控制折行的缩进。可以是“none”、“same”或“indent”。", "mouseWheelScrollSensitivity": "要对鼠标滚轮滚动事件的 \"deltaX\" 和 \"deltaY\" 使用的乘数 ", + "multiCursorModifier.ctrlCmd": "映射到“Control”(Windows 和 Linux)或“Command”(OSX)。", + "multiCursorModifier.alt": "映射到“Alt”(Windows 和 Linux)或“Option”(OSX)。", + "multiCursorModifier": "用鼠标添加多个光标时使用的修改键。“ctrlCmd”映射为“Control”(Windows 和 Linux)或“Command”(OSX)。“转到定义”和“打开链接”功能的鼠标手势将会相应调整,不与多光标修改键冲突。", "quickSuggestions.strings": "在字符串内启用快速建议。", "quickSuggestions.comments": "在注释内启用快速建议。", "quickSuggestions.other": "在字符串和注释外启用快速建议。", "quickSuggestions": "控制键入时是否应自动显示建议", "quickSuggestionsDelay": "控制延迟多少毫秒后将显示快速建议", - "parameterHints": "启用参数提示", + "parameterHints": "启用在输入时显示含有参数文档和类型信息的小面板", "autoClosingBrackets": "控制编辑器是否应该在左括号后自动插入右括号", "formatOnType": "控制编辑器是否应在键入后自动设置行的格式", "formatOnPaste": "控制编辑器是否应自动设置粘贴内容的格式。格式化程序必须可用并且能设置文档中某一范围的格式。", "suggestOnTriggerCharacters": "控制键入触发器字符时是否应自动显示建议", - "acceptSuggestionOnEnter": "控制除了 \"Tab\" 键以外,是否还应在遇到 \"Enter\" 键时接受建议。帮助避免“插入新行”或“接受建议”之间出现歧义。", + "acceptSuggestionOnEnter": "控制按“Enter”键是否像按“Tab”键一样接受建议。这能帮助避免“插入新行”和“接受建议”之间的歧义。值为“smart”时表示,仅当文字改变时,按“Enter”键才能接受建议", "acceptSuggestionOnCommitCharacter": "控制是否应在遇到提交字符时接受建议。例如,在 JavaScript 中,分号(\";\")可以为提交字符,可接受建议并键入该字符。", "snippetSuggestions": "控制是否将代码段与其他建议一起显示以及它们的排序方式。", "emptySelectionClipboard": "控制没有选择内容的复制是否复制当前行。", @@ -63,12 +68,17 @@ "renderLineHighlight": "控制编辑器应如何呈现当前行突出显示,可能为“无”、“装订线”、“线”和“全部”。", "codeLens": "控制编辑器是否显示代码滤镜", "folding": "控制编辑器是否启用代码折叠功能", + "showFoldingControls": "控制是否自动隐藏导航线上的折叠控件。", "matchBrackets": "当选择其中一项时,将突出显示匹配的括号。", "glyphMargin": "控制编辑器是否应呈现垂直字形边距。字形边距最常用于调试。", "useTabStops": "在制表位后插入和删除空格", "trimAutoWhitespace": "删除尾随自动插入的空格", "stablePeek": "即使在双击编辑器内容或按 Esc 键时,也要保持速览编辑器的打开状态。", "dragAndDrop": "控制编辑器是否应该允许通过拖放移动所选项。", + "accessibilitySupport.auto": "编辑器将使用平台 API 以检测是否附加了屏幕阅读器。", + "accessibilitySupport.on": "编辑器将对屏幕阅读器的使用进行永久优化。", + "accessibilitySupport.off": "编辑器将不再对屏幕阅读器的使用进行优化。", + "accessibilitySupport": "控制编辑器是否应运行在对屏幕阅读器进行优化的模式。", "sideBySide": "控制 Diff 编辑器以并排或内联形式显示差异", "ignoreTrimWhitespace": "控制差异编辑器是否将对前导空格或尾随空格的更改显示为差异", "renderIndicators": "控制差异编辑器是否为已添加/删除的更改显示 +/- 指示符号", diff --git a/i18n/chs/src/vs/editor/common/config/editorOptions.i18n.json b/i18n/chs/src/vs/editor/common/config/editorOptions.i18n.json index 9d5691d3e42a4e3e9660c8ca810c825edaf96740..fa32e6dd25278afe4230f66e65310ffb84850eb2 100644 --- a/i18n/chs/src/vs/editor/common/config/editorOptions.i18n.json +++ b/i18n/chs/src/vs/editor/common/config/editorOptions.i18n.json @@ -4,5 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "accessibilityOffAriaLabel": "现在无法访问编辑器。按 Alt+F1 显示选项。", "editorViewAccessibleLabel": "编辑器内容" } \ No newline at end of file diff --git a/i18n/chs/src/vs/editor/common/view/editorColorRegistry.i18n.json b/i18n/chs/src/vs/editor/common/view/editorColorRegistry.i18n.json index dc0edc0650c544651d03717e0dca30fe957da2eb..26da122b2d8553cbfc6e298913ac501599666c7c 100644 --- a/i18n/chs/src/vs/editor/common/view/editorColorRegistry.i18n.json +++ b/i18n/chs/src/vs/editor/common/view/editorColorRegistry.i18n.json @@ -16,5 +16,9 @@ "editorBracketMatchBackground": "匹配括号的背景色", "editorBracketMatchBorder": "匹配括号外框颜色", "editorOverviewRulerBorder": "概览标尺边框的颜色。", - "editorGutter": "编辑器导航线的背景色。导航线包括边缘符号和行号。" + "editorGutter": "编辑器导航线的背景色。导航线包括边缘符号和行号。", + "errorForeground": "编辑器中错误波浪线的前景色。", + "errorBorder": "编辑器中错误波浪线的边框颜色。", + "warningForeground": "编辑器中警告波浪线的前景色。", + "warningBorder": "编辑器中警告波浪线的边框颜色。" } \ No newline at end of file diff --git a/i18n/chs/src/vs/editor/contrib/accessibility/browser/accessibility.i18n.json b/i18n/chs/src/vs/editor/contrib/accessibility/browser/accessibility.i18n.json index 714861ecdf6eb04cd668bf4e700809efd6625f27..94299c46f7be8deb451e935db48a9c36fb417143 100644 --- a/i18n/chs/src/vs/editor/contrib/accessibility/browser/accessibility.i18n.json +++ b/i18n/chs/src/vs/editor/contrib/accessibility/browser/accessibility.i18n.json @@ -6,10 +6,10 @@ { "introMsg": "感谢试用 VS Code 的辅助功能选项。", "status": "状态:", - "tabFocusModeOnMsg": "在当前编辑器中按 Tab 会将焦点移动到下一个可聚焦的元素。通过按 {0} 切换此行为。", + "tabFocusModeOnMsg": "在当前编辑器中按 Tab 会将焦点移动到下一个可聚焦的元素。按 {0} 来切换此行为。", "tabFocusModeOnMsgNoKb": "在当前编辑器中按 Tab 会将焦点移动到下一个可聚焦的元素。当前无法通过键绑定触发命令 {0}。", - "tabFocusModeOffMsg": "在当前编辑器中按 Tab 将插入制表符。通过按 {0} 切换此行为。", + "tabFocusModeOffMsg": "在当前编辑器中按 Tab 将插入制表符。按 {0} 来切换此行为。", "tabFocusModeOffMsgNoKb": "在当前编辑器中按 Tab 会插入制表符。当前无法通过键绑定触发命令 {0}。", - "outroMsg": "可以通过按 Esc 消除此工具提示并返回到编辑器。", + "outroMsg": "你可以按 Esc 键来消除此提示并返回到编辑器。", "ShowAccessibilityHelpAction": "显示辅助功能帮助" } \ No newline at end of file diff --git a/i18n/chs/src/vs/editor/contrib/caretOperations/common/caretOperations.i18n.json b/i18n/chs/src/vs/editor/contrib/caretOperations/common/caretOperations.i18n.json index 11871e98a8070b95b5102931a5b9882dcd0c478c..3e7623177668854e31fb6e47ea03576eb20f3678 100644 --- a/i18n/chs/src/vs/editor/contrib/caretOperations/common/caretOperations.i18n.json +++ b/i18n/chs/src/vs/editor/contrib/caretOperations/common/caretOperations.i18n.json @@ -4,6 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "caret.moveLeft": "将脱字号向左移", - "caret.moveRight": "将脱字号向右移" + "caret.moveLeft": "将插入点左移", + "caret.moveRight": "将插入点右移" } \ No newline at end of file diff --git a/i18n/chs/src/vs/editor/contrib/find/common/findController.i18n.json b/i18n/chs/src/vs/editor/contrib/find/common/findController.i18n.json index 0ae6f9d406d904b5f0a9780f3a3314ee39c7b32a..1125fe32bcd65b3a503ca1b9512bc7ce72fea8bd 100644 --- a/i18n/chs/src/vs/editor/contrib/find/common/findController.i18n.json +++ b/i18n/chs/src/vs/editor/contrib/find/common/findController.i18n.json @@ -14,6 +14,5 @@ "addSelectionToPreviousFindMatch": "将选择内容添加到上一查找匹配项", "moveSelectionToNextFindMatch": "将上次选择移动到下一个查找匹配项", "moveSelectionToPreviousFindMatch": "将上个选择内容移动到上一查找匹配项", - "selectAllOccurencesOfFindMatch": "选择所有找到的查找匹配项", "changeAll.label": "更改所有匹配项" } \ No newline at end of file diff --git a/i18n/chs/src/vs/editor/contrib/format/browser/formatActions.i18n.json b/i18n/chs/src/vs/editor/contrib/format/browser/formatActions.i18n.json index d1fd1741e7486efe93df0a756a4d5c7d923f1068..7a87ba778044ce4231c709a06df593ad173190d9 100644 --- a/i18n/chs/src/vs/editor/contrib/format/browser/formatActions.i18n.json +++ b/i18n/chs/src/vs/editor/contrib/format/browser/formatActions.i18n.json @@ -4,10 +4,10 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "hint11": "Made 1 formatting edit on line {0}", - "hintn1": "Made {0} formatting edits on line {1}", - "hint1n": "Made 1 formatting edit between lines {0} and {1}", - "hintnn": "Made {0} formatting edits between lines {1} and {2}", - "formatDocument.label": "Format Document", - "formatSelection.label": "Format Selection" + "hint11": "在第 {0} 行进行了 1 次格式编辑", + "hintn1": "在第 {1} 行进行了 {0} 次格式编辑", + "hint1n": "第 {0} 行到第 {1} 行间进行了 1 次格式编辑", + "hintnn": "第 {1} 行到第 {2} 行间进行了 {0} 次格式编辑", + "formatDocument.label": "格式化文件", + "formatSelection.label": "格式化选定代码" } \ No newline at end of file diff --git a/i18n/chs/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.i18n.json b/i18n/chs/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..e788771d2f25aef8c77ea38151e14bf8b057ec95 --- /dev/null +++ b/i18n/chs/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.i18n.json @@ -0,0 +1,23 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "noResultWord": "未找到“{0}”的任何定义", + "generic.noResults": "找不到定义", + "meta.title": " – {0} 定义", + "actions.goToDecl.label": "转到定义", + "actions.goToDeclToSide.label": "打开侧边的定义", + "actions.previewDecl.label": "查看定义", + "goToImplementation.noResultWord": "未找到“{0}”的实现", + "goToImplementation.generic.noResults": "未找到实现", + "meta.implementations.title": "– {0} 个实现", + "actions.goToImplementation.label": "转到实现", + "actions.peekImplementation.label": "速览实现", + "goToTypeDefinition.noResultWord": "未找到“{0}”的类型定义", + "goToTypeDefinition.generic.noResults": "未找到类型定义", + "meta.typeDefinitions.title": " – {0} 个类型定义", + "actions.goToTypeDefinition.label": "转到类型定义", + "actions.peekTypeDefinition.label": "快速查看类型定义" +} \ No newline at end of file diff --git a/i18n/chs/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.i18n.json b/i18n/chs/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..ab0b4761cf9a4519c8934a53a740f097074f7e7e --- /dev/null +++ b/i18n/chs/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "multipleResults": "单击显示 {0} 个定义。" +} \ No newline at end of file diff --git a/i18n/chs/src/vs/editor/contrib/indentation/common/indentation.i18n.json b/i18n/chs/src/vs/editor/contrib/indentation/common/indentation.i18n.json index 76fa4543d539d735f0d3d4e8e7438c669297ea0b..5bd5906da321cce12d57888b501a2864e5d1f608 100644 --- a/i18n/chs/src/vs/editor/contrib/indentation/common/indentation.i18n.json +++ b/i18n/chs/src/vs/editor/contrib/indentation/common/indentation.i18n.json @@ -8,7 +8,7 @@ "indentationToTabs": "将缩进转换为制表符", "configuredTabSize": "已配置制表符大小", "selectTabWidth": "选择当前文件的制表符大小", - "indentUsingTabs": "使用 \\\\\"Tab\\\\\" 缩进", + "indentUsingTabs": "使用“Tab”缩进", "indentUsingSpaces": "使用空格缩进", "detectIndentation": "检查内容中的缩进", "editor.reindentlines": "重新缩进行" diff --git a/i18n/chs/src/vs/editor/contrib/linesOperations/common/linesOperations.i18n.json b/i18n/chs/src/vs/editor/contrib/linesOperations/common/linesOperations.i18n.json index 59c62abf01c5ba19f2a42f16cce8724609b7782d..346d11b6706168f9c0450578f3fdc14a33080aa6 100644 --- a/i18n/chs/src/vs/editor/contrib/linesOperations/common/linesOperations.i18n.json +++ b/i18n/chs/src/vs/editor/contrib/linesOperations/common/linesOperations.i18n.json @@ -18,7 +18,7 @@ "lines.insertAfter": "在下面插入行", "lines.deleteAllLeft": "删除左侧所有内容", "lines.deleteAllRight": "删除右侧所有内容", - "lines.joinLines": "联接行", + "lines.joinLines": "合并行", "editor.transpose": "转置游标处的字符", "editor.transformToUppercase": "转换为大写", "editor.transformToLowercase": "转换为小写" diff --git a/i18n/chs/src/vs/editor/contrib/links/browser/links.i18n.json b/i18n/chs/src/vs/editor/contrib/links/browser/links.i18n.json index 345d85ddefa86e258d25a0d34669d61893ed4062..9e17ff5092c6a6a2886c905a5383f3a68b69c437 100644 --- a/i18n/chs/src/vs/editor/contrib/links/browser/links.i18n.json +++ b/i18n/chs/src/vs/editor/contrib/links/browser/links.i18n.json @@ -6,6 +6,7 @@ { "links.navigate.mac": "Cmd + 单击以跟踪链接", "links.navigate": "Ctrl + 单击以跟踪链接", + "links.navigate.al": "Alt + 单击以访问链接", "invalid.url": "抱歉,无法打开此链接,因为其格式不正确: {0}", "missing.url": "抱歉,无法打开此链接,因为其目标丢失。", "label": "打开链接" diff --git a/i18n/chs/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json b/i18n/chs/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json index 26bf7a51ac5af10498eb012937e052b1278dc944..710eeeefcfc875a0b49c8a6c8faf7482f3f54f8d 100644 --- a/i18n/chs/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json +++ b/i18n/chs/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json @@ -5,8 +5,8 @@ // Do not edit this file. It is machine generated. { "aria.oneReference": "在文件 {0} 的 {1} 行 {2} 列的符号", - "aria.fileReferences.1": "{0} 中有 1 个符号", - "aria.fileReferences.N": "{1} 中有 {0} 个符号", + "aria.fileReferences.1": "{0} 中有 1 个符号,完整路径:{1}", + "aria.fileReferences.N": "{1} 中有 {0} 个符号,完整路径:{2}", "aria.result.0": "未找到结果", "aria.result.1": "在 {0} 中找到 1 个符号", "aria.result.n1": "在 {1} 中找到 {0} 个符号", diff --git a/i18n/chs/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json b/i18n/chs/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json index 4e1a0a30e42b629ba36dde9f466ebdfda4b02ca8..ec34ba659f112c53f7ab3dbd4d7398166eedbe6c 100644 --- a/i18n/chs/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json +++ b/i18n/chs/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json @@ -9,7 +9,7 @@ "editorSuggestWidgetForeground": "建议小组件的前景颜色。", "editorSuggestWidgetSelectedBackground": "建议小组件中被选择条目的背景颜色。", "editorSuggestWidgetHighlightForeground": "建议小组件中匹配内容的高亮颜色。", - "readMore": "阅读更多...{0}", + "readMore": "阅读详细信息...{0}", "suggestionWithDetailsAriaLabel": "{0}(建议)具有详细信息", "suggestionAriaLabel": "{0},建议", "readLess": "阅读简略信息...{0}", diff --git a/i18n/chs/src/vs/editor/contrib/toggleTabFocusMode/common/toggleTabFocusMode.i18n.json b/i18n/chs/src/vs/editor/contrib/toggleTabFocusMode/common/toggleTabFocusMode.i18n.json index a64a607ad878c3b81b3adf666529248d18c6baad..897e74dff44a2e9a15f76af13b9ef0acef2b6b32 100644 --- a/i18n/chs/src/vs/editor/contrib/toggleTabFocusMode/common/toggleTabFocusMode.i18n.json +++ b/i18n/chs/src/vs/editor/contrib/toggleTabFocusMode/common/toggleTabFocusMode.i18n.json @@ -4,5 +4,5 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "toggle.tabMovesFocus": "切换 Tab 键移动焦点" + "toggle.tabMovesFocus": "切换 Tab 键是否移动焦点" } \ No newline at end of file diff --git a/i18n/chs/src/vs/platform/actions/electron-browser/menusExtensionPoint.i18n.json b/i18n/chs/src/vs/platform/actions/electron-browser/menusExtensionPoint.i18n.json index 806db0f074865296df025fb3b4d541f18a0aabae..2e644c790f6215ba1aad142a63e5b0c2a88afccd 100644 --- a/i18n/chs/src/vs/platform/actions/electron-browser/menusExtensionPoint.i18n.json +++ b/i18n/chs/src/vs/platform/actions/electron-browser/menusExtensionPoint.i18n.json @@ -21,6 +21,8 @@ "menus.scmTitle": "源代码管理标题菜单", "menus.resourceGroupContext": "源代码管理资源组上下文菜单", "menus.resourceStateContext": "源代码管理资源状态上下文菜单", + "view.viewTitle": "提供的视图的标题菜单", + "view.itemContext": "提供的视图中的项目的上下文菜单", "nonempty": "应为非空值。", "opticon": "可以省略属性“图标”或者它必须是一个字符串或类似“{dark, light}”的文本", "requireStringOrObject": "属性“{0}”为必需且其类型必须为“字符串”或“对象”", diff --git a/i18n/chs/src/vs/platform/configuration/common/configurationRegistry.i18n.json b/i18n/chs/src/vs/platform/configuration/common/configurationRegistry.i18n.json index ea616506b8e2c0553dc65c7fcd46dc51e866e22c..781727fae4d8d109af9dcbfdb3b24f6bfa8ecc99 100644 --- a/i18n/chs/src/vs/platform/configuration/common/configurationRegistry.i18n.json +++ b/i18n/chs/src/vs/platform/configuration/common/configurationRegistry.i18n.json @@ -10,7 +10,7 @@ "vscode.extension.contributes.configuration": "用于配置字符串。", "vscode.extension.contributes.configuration.title": "设置摘要。此标签将在设置文件中用作分隔注释。", "vscode.extension.contributes.configuration.properties": "配置属性的描述。", - "config.property.languageDefault": "无法注册“{0}”。这符合属性模式 \"\\\\[.*\\\\]$\",可用于描述特定语言编辑器设置。请使用 \"configurationDefaults\"。", + "config.property.languageDefault": "无法注册“{0}”。其符合描述特定语言编辑器设置的表达式 \"\\\\[.*\\\\]$\"。请使用 \"configurationDefaults\"。", "config.property.duplicate": "无法注册“{0}”。此属性已注册。", "invalid.properties": "configuration.properties 必须是对象", "invalid.type": "如果进行设置,\"configuration.type\" 必须设置为对象", diff --git a/i18n/chs/src/vs/platform/extensions/common/extensionsRegistry.i18n.json b/i18n/chs/src/vs/platform/extensions/common/extensionsRegistry.i18n.json index 2c8ade8f369fea95cfcbe813432db11f2212fcf7..feafccf34519c08dfe113d2a3d8d1c0e63bf868c 100644 --- a/i18n/chs/src/vs/platform/extensions/common/extensionsRegistry.i18n.json +++ b/i18n/chs/src/vs/platform/extensions/common/extensionsRegistry.i18n.json @@ -14,6 +14,12 @@ "vscode.extension.contributes": "由此包表示的 VS Code 扩展的所有贡献。", "vscode.extension.preview": "在 Marketplace 中设置扩展,将其标记为“预览”。", "vscode.extension.activationEvents": "VS Code 扩展的激活事件。", + "vscode.extension.activationEvents.onLanguage": "在打开被解析为指定语言的文件时发出的激活事件。", + "vscode.extension.activationEvents.onCommand": "在调用指定命令时发出的激活事件。", + "vscode.extension.activationEvents.onDebug": "在指定类型的调试会话开始时发出的激活事件。", + "vscode.extension.activationEvents.workspaceContains": "在打开至少包含一个匹配指定 glob 模式的文件的文件夹时发出的激活事件。", + "vscode.extension.activationEvents.onView": "在指定视图被展开时发出的激活事件。", + "vscode.extension.activationEvents.star": "在 VS Code 启动时发出的激活事件。为确保良好的最终用户体验,请仅在其他激活事件组合不适用于你的情况时,才在扩展中使用此事件。", "vscode.extension.badges": "在 Marketplace 的扩展页边栏中显示的徽章数组。", "vscode.extension.badges.url": "徽章图像 URL。", "vscode.extension.badges.href": "徽章链接。", diff --git a/i18n/chs/src/vs/platform/extensions/node/extensionValidator.i18n.json b/i18n/chs/src/vs/platform/extensions/node/extensionValidator.i18n.json index 58daf0e1a24417f264ace30b7ad46804ccf5ccfb..73890b4a095af378955bb11246cb667d016f9e3f 100644 --- a/i18n/chs/src/vs/platform/extensions/node/extensionValidator.i18n.json +++ b/i18n/chs/src/vs/platform/extensions/node/extensionValidator.i18n.json @@ -9,15 +9,15 @@ "versionSpecificity2": "\"engines.vscode\" ({0}) 中指定的版本不够具体。对于 1.0.0 之后的 vscode 版本,请至少定义主要想要的版本。例如: ^1.10.0、1.10.x、1.x.x、2.x.x 等。", "versionMismatch": "扩展与 Code {0} 不兼容。扩展需要: {1}。", "extensionDescription.empty": "已获得空扩展说明", - "extensionDescription.publisher": "属性“{0}”是必需的,其类型必须是“字符串”", - "extensionDescription.name": "属性“{0}”是必需的,其类型必须是“字符串”", - "extensionDescription.version": "属性“{0}”是必需的,其类型必须是“字符串”", - "extensionDescription.engines": "属性“{0}”为必需且其类型必须为 \"object\"", - "extensionDescription.engines.vscode": "属性“{0}”是必需的,其类型必须是“字符串”", - "extensionDescription.extensionDependencies": "属性“{0}”可以省略或其类型必须是 \"string[]\"", - "extensionDescription.activationEvents1": "属性“{0}”可以省略或其类型必须是 \"string[]\"", + "extensionDescription.publisher": "属性“{0}”是必要属性,其类型必须是 \"string\"", + "extensionDescription.name": "属性“{0}”是必要属性,其类型必须是 \"string\"", + "extensionDescription.version": "属性“{0}”是必要属性,其类型必须是 \"string\"", + "extensionDescription.engines": "属性“{0}”是必要属性,其类型必须是 \"object\"", + "extensionDescription.engines.vscode": "属性“{0}”是必要属性,其类型必须是 \"string\"", + "extensionDescription.extensionDependencies": "属性“{0}”可以省略,否则其类型必须是 \"string[]\"", + "extensionDescription.activationEvents1": "属性“{0}”可以省略,否则其类型必须是 \"string[]\"", "extensionDescription.activationEvents2": "必须同时指定或同时省略属性”{0}“和”{1}“", - "extensionDescription.main1": "属性“{0}”可以省略,或者其类型必须是“字符串”", + "extensionDescription.main1": "属性“{0}”可以省略,否则其类型必须是 \"string\"", "extensionDescription.main2": "应在扩展文件夹({1})中包含 \"main\" ({0})。这可能会使扩展不可移植。", "extensionDescription.main3": "必须同时指定或同时省略属性”{0}“和”{1}“", "notSemver": "扩展版本与 semver 不兼容。" diff --git a/i18n/chs/src/vs/platform/history/electron-main/historyMainService.i18n.json b/i18n/chs/src/vs/platform/history/electron-main/historyMainService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..61b499c3553c1f30c38109549abbf5f038f52717 --- /dev/null +++ b/i18n/chs/src/vs/platform/history/electron-main/historyMainService.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "newWindow": "新建窗口", + "newWindowDesc": "打开一个新窗口", + "recentFolders": "最近的文件夹", + "folderDesc": "{0} {1}" +} \ No newline at end of file diff --git a/i18n/chs/src/vs/platform/keybinding/common/keybindingLabels.i18n.json b/i18n/chs/src/vs/platform/keybinding/common/keybindingLabels.i18n.json index 8fa747b0b99bd45bd8024ae2f9dc6982c133bb53..0e97d8b37c30104569cfbb85a2b268d1dda05a2c 100644 --- a/i18n/chs/src/vs/platform/keybinding/common/keybindingLabels.i18n.json +++ b/i18n/chs/src/vs/platform/keybinding/common/keybindingLabels.i18n.json @@ -8,9 +8,9 @@ "shiftKey": "Shift", "altKey": "Alt", "windowsKey": "Windows", - "ctrlKey.long": "控件", + "ctrlKey.long": "Control", "shiftKey.long": "Shift", "altKey.long": "Alt", - "cmdKey.long": "命令", + "cmdKey.long": "Command", "windowsKey.long": "Windows" } \ No newline at end of file diff --git a/i18n/chs/src/vs/platform/markers/common/problemMatcher.i18n.json b/i18n/chs/src/vs/platform/markers/common/problemMatcher.i18n.json index 7dc0d66e0aa6e3aef7e7ba3d142385a6d4d8115f..53f5b8e472afea9a95eba44b4b26c013927b5db3 100644 --- a/i18n/chs/src/vs/platform/markers/common/problemMatcher.i18n.json +++ b/i18n/chs/src/vs/platform/markers/common/problemMatcher.i18n.json @@ -29,11 +29,12 @@ "ProblemMatcherParser.noOwner": "错误: 描述未定义所有者:\n{0}\n", "ProblemMatcherParser.noFileLocation": "错误: 描述未定义文件位置:\n{0}\n", "ProblemMatcherParser.unknownSeverity": "信息:未知严重性 {0}。有效值为“error”、“warning”和“info”。\n", - "ProblemMatcherParser.noDefinedPatter": "错误: 含标识符 {0} 的模式不存在。", + "ProblemMatcherParser.noDefinedPatter": "错误: 标识符为 {0} 的模式不存在。", "ProblemMatcherParser.noIdentifier": "错误: 模式属性引用空标识符。", "ProblemMatcherParser.noValidIdentifier": "错误: 模式属性 {0} 是无效的模式变量名。", "ProblemMatcherParser.problemPattern.watchingMatcher": "问题匹配程序必须定义监视的开始模式和结束模式。", "ProblemMatcherParser.invalidRegexp": "错误: 字符串 {0} 不是有效的正则表达式。\n", + "WatchingPatternSchema.regexp": "用于检测后台任务开始或结束的正则表达式。", "WatchingPatternSchema.file": "文件名的匹配组索引。可以省略。", "PatternTypeSchema.name": "所提供或预定义模式的名称", "PatternTypeSchema.description": "问题模式或者所提供或预定义问题模式的名称。如果已指定基准,则可以省略。", @@ -42,6 +43,12 @@ "ProblemMatcherSchema.severity": "捕获问题的默认严重性。如果模式未定义严重性的匹配组,则使用。", "ProblemMatcherSchema.applyTo": "控制文本文档上报告的问题是否仅应用于打开、关闭或所有文档。", "ProblemMatcherSchema.fileLocation": "定义应如何解释问题模式中报告的文件名。", + "ProblemMatcherSchema.background": "用于跟踪在后台任务上激活的匹配程序的开始和结束的模式。", + "ProblemMatcherSchema.background.activeOnStart": "如果设置为 true,则会在任务开始时激活后台监控。这相当于发出与 beginPattern 匹配的行。", + "ProblemMatcherSchema.background.beginsPattern": "如果在输出内匹配,则会发出后台任务开始的信号。", + "ProblemMatcherSchema.background.endsPattern": "如果在输出内匹配,则会发出后台任务结束的信号。", + "ProblemMatcherSchema.watching.deprecated": "“watching”属性已被弃用。请改用“background”。", + "ProblemMatcherSchema.watching": "用于跟踪监视匹配程序开始和结束的模式。", "ProblemMatcherSchema.watching.activeOnStart": "如果设置为 true,则当任务开始时观察程序处于活动模式。这相当于发出与 beginPattern 匹配的行。", "ProblemMatcherSchema.watching.beginsPattern": "如果在输出内匹配,则在监视任务开始时会发出信号。", "ProblemMatcherSchema.watching.endsPattern": "如果在输出内匹配,则在监视任务结束时会发出信号。", diff --git a/i18n/chs/src/vs/platform/theme/common/colorRegistry.i18n.json b/i18n/chs/src/vs/platform/theme/common/colorRegistry.i18n.json index 0af4fc2114c68764c2d4306dadbb613d6fb1d62e..2b6fb78afe8239f5b9b82595ea4177bf49f241ef 100644 --- a/i18n/chs/src/vs/platform/theme/common/colorRegistry.i18n.json +++ b/i18n/chs/src/vs/platform/theme/common/colorRegistry.i18n.json @@ -12,7 +12,7 @@ "focusBorder": "焦点元素的整体边框颜色。此颜色仅在不被其他组件覆盖时适用。", "contrastBorder": "在元素周围额外的一层边框,用来提高对比度从而区别其他元素。", "activeContrastBorder": "在活动元素周围额外的一层边框,用来提高对比度从而区别其他元素。", - "selectionBackground": "工作台所选文本的背景颜色(例如输入字段或文本区域)。注意,本设置不适用于编辑器和终端。", + "selectionBackground": "工作台所选文本的背景颜色(例如输入字段或文本区域)。注意,本设置不适用于编辑器。", "textSeparatorForeground": "文字分隔符的颜色。", "textLinkForeground": "文本中链接的前景色。", "textLinkActiveForeground": "文本中活动链接的前景色。", @@ -60,7 +60,7 @@ "editorBackground": "编辑器背景颜色。", "editorForeground": "编辑器默认前景色。", "editorWidgetBackground": "编辑器组件(如查找/替换)背景颜色。", - "editorWidgetBorder": "编辑器小组件的边框颜色。", + "editorWidgetBorder": "编辑器小部件的边框颜色。此颜色仅在小部件有边框且不被小部件重写时适用。", "editorSelection": "编辑器所选内容的颜色。", "editorInactiveSelection": "非活动编辑器中所选内容的颜色。", "editorSelectionHighlight": "与所选内容具有相同内容的区域颜色。", @@ -69,10 +69,20 @@ "findRangeHighlight": "限制搜索的范围的颜色。", "hoverHighlight": "悬停提示显示时文本底下的高亮颜色。", "hoverBackground": "编辑器悬停提示的背景颜色。", - "hoverBorder": "编辑器软键盘边框颜色。", + "hoverBorder": "光标悬停时编辑器的边框颜色。", "activeLinkForeground": "活动链接颜色。", "diffEditorInserted": "已插入文本的背景颜色。", "diffEditorRemoved": "被删除文本的背景颜色。", "diffEditorInsertedOutline": "插入的文本的轮廓颜色。", - "diffEditorRemovedOutline": "被删除文本的轮廓颜色。" + "diffEditorRemovedOutline": "被删除文本的轮廓颜色。", + "mergeCurrentHeaderBackground": "内联合并冲突中当前版本区域的标头背景色。", + "mergeCurrentContentBackground": "内联合并冲突中当前版本区域的内容背景色。", + "mergeIncomingHeaderBackground": "内联合并冲突中传入的版本区域的标头背景色。", + "mergeIncomingContentBackground": "内联合并冲突中传入的版本区域的内容背景色。", + "mergeCommonHeaderBackground": "内联合并冲突中共同祖先区域的标头背景色。", + "mergeCommonContentBackground": "内联合并冲突中共同祖先区域的内容背景色。", + "mergeBorder": "内联合并冲突中标头和分割线的边框颜色。", + "overviewRulerCurrentContentForeground": "内联合并冲突中当前版本区域的概览标尺前景色。", + "overviewRulerIncomingContentForeground": "内联合并冲突中传入的版本区域的概览标尺前景色。", + "overviewRulerCommonContentForeground": "内联合并冲突中共同祖先区域的概览标尺前景色。" } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/api/node/extHostTask.i18n.json b/i18n/chs/src/vs/workbench/api/node/extHostTask.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..4b90a12aaf247b4a1af0e887542958471d8df5e5 --- /dev/null +++ b/i18n/chs/src/vs/workbench/api/node/extHostTask.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "task.label": "{0}: {1}" +} \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/api/node/extHostTreeViews.i18n.json b/i18n/chs/src/vs/workbench/api/node/extHostTreeViews.i18n.json index 8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a..7bfb0b886ded6448e92465cb63ab0ee172a110f9 100644 --- a/i18n/chs/src/vs/workbench/api/node/extHostTreeViews.i18n.json +++ b/i18n/chs/src/vs/workbench/api/node/extHostTreeViews.i18n.json @@ -3,4 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. -{} \ No newline at end of file +{ + "treeView.notRegistered": "没有注册 ID 为“{0}”的树形图。", + "treeItem.notFound": "没有在树中找到 ID 为“{0}”的项目。", + "treeView.duplicateElement": "已注册元素 {0}。" +} \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/browser/parts/activitybar/activitybarPart.i18n.json b/i18n/chs/src/vs/workbench/browser/parts/activitybar/activitybarPart.i18n.json index 29e014471dace10bf672798f828ff4b265791b83..9b17b8e6572582ac186c3a37ecdc39a8082eee34 100644 --- a/i18n/chs/src/vs/workbench/browser/parts/activitybar/activitybarPart.i18n.json +++ b/i18n/chs/src/vs/workbench/browser/parts/activitybar/activitybarPart.i18n.json @@ -5,5 +5,6 @@ // Do not edit this file. It is machine generated. { "hideActivitBar": "隐藏活动栏", - "activityBarAriaLabel": "活动视图切换器" + "activityBarAriaLabel": "活动视图切换器", + "globalActions": "全局动作" } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/browser/parts/editor/editorActions.i18n.json b/i18n/chs/src/vs/workbench/browser/parts/editor/editorActions.i18n.json index dc267856d02f8c6352f54fd6fa1a68b79c51fd8f..bc03cc6b1af21b9f1ac2954bb45c646a5a01faa7 100644 --- a/i18n/chs/src/vs/workbench/browser/parts/editor/editorActions.i18n.json +++ b/i18n/chs/src/vs/workbench/browser/parts/editor/editorActions.i18n.json @@ -19,6 +19,7 @@ "closeEditorsToTheLeft": "关闭左侧编辑器", "closeEditorsToTheRight": "关闭右侧编辑器", "closeAllEditors": "关闭所有编辑器", + "closeUnmodifiedEditors": "关闭组中未作更改的编辑器", "closeEditorsInOtherGroups": "关闭其他组中的编辑器", "closeOtherEditorsInGroup": "关闭其他编辑器", "closeEditorsInGroup": "关闭组中的所有编辑器", diff --git a/i18n/chs/src/vs/workbench/browser/parts/editor/editorStatus.i18n.json b/i18n/chs/src/vs/workbench/browser/parts/editor/editorStatus.i18n.json index 7f7594d784a0a4bd9001706b5d42d05d2f2b3353..0b7d6bc441e3bf2947ac503b8237774cd4651618 100644 --- a/i18n/chs/src/vs/workbench/browser/parts/editor/editorStatus.i18n.json +++ b/i18n/chs/src/vs/workbench/browser/parts/editor/editorStatus.i18n.json @@ -11,6 +11,8 @@ "endOfLineLineFeed": "LF", "endOfLineCarriageReturnLineFeed": "CRLF", "tabFocusModeEnabled": "按 Tab 移动焦点", + "screenReaderDetected": "检测到屏幕阅读器", + "screenReaderDetectedExtra": "如果你没有使用屏幕阅读器,请将设置中的“editor.accessibilitySupport”改为“off”。", "disableTabMode": "禁用辅助功能模式", "gotoLine": "转到行", "indentation": "缩进", diff --git a/i18n/chs/src/vs/workbench/browser/parts/editor/titleControl.i18n.json b/i18n/chs/src/vs/workbench/browser/parts/editor/titleControl.i18n.json index 33c78c3b91123837c61606a8832058e86f5a5934..63726f327651d89a4b60228bb98abd6539c681ac 100644 --- a/i18n/chs/src/vs/workbench/browser/parts/editor/titleControl.i18n.json +++ b/i18n/chs/src/vs/workbench/browser/parts/editor/titleControl.i18n.json @@ -8,6 +8,7 @@ "closeOthers": "关闭其他", "closeRight": "关闭到右侧", "closeAll": "全部关闭", + "closeAllUnmodified": "关闭未更改的", "keepOpen": "保持打开状态", "showOpenedEditors": "显示打开的编辑器", "araLabelEditorActions": "编辑器操作" diff --git a/i18n/chs/src/vs/workbench/browser/parts/quickopen/quickopen.i18n.json b/i18n/chs/src/vs/workbench/browser/parts/quickopen/quickopen.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..04188ac2f79209ad829dba97bb4e514767911b02 --- /dev/null +++ b/i18n/chs/src/vs/workbench/browser/parts/quickopen/quickopen.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "quickOpen": "转到文件...", + "quickNavigateNext": "在 Quick Open 中导航到下一个", + "quickNavigatePrevious": "在 Quick Open 中导航到上一个", + "quickSelectNext": "在 Quick Open 中选择“下一步”", + "quickSelectPrevious": "在 Quick Open 中选择“上一步”" +} \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/browser/quickopen.i18n.json b/i18n/chs/src/vs/workbench/browser/quickopen.i18n.json index 5df82e1051da1fff172b87941e054d720bc5b3ac..949f6468fc28c7b015de8eff5dfc30ee14ced861 100644 --- a/i18n/chs/src/vs/workbench/browser/quickopen.i18n.json +++ b/i18n/chs/src/vs/workbench/browser/quickopen.i18n.json @@ -6,6 +6,5 @@ { "noResultsMatching": "没有匹配的结果", "noResultsFound2": "未找到结果", - "entryAriaLabel": "{0},命令", - "noCommands": "没有匹配的命令" + "entryAriaLabel": "{0},命令" } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/browser/viewlet.i18n.json b/i18n/chs/src/vs/workbench/browser/viewlet.i18n.json index 9f0c295e5f27e121d095503bd7ed25fa9c5f8685..6f2dfb7174db7eb9a356d9ccb70796908e770c2b 100644 --- a/i18n/chs/src/vs/workbench/browser/viewlet.i18n.json +++ b/i18n/chs/src/vs/workbench/browser/viewlet.i18n.json @@ -4,6 +4,5 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "collapse": "全部折叠", - "viewToolbarAriaLabel": "{0} 操作" + "collapse": "全部折叠" } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/common/theme.i18n.json b/i18n/chs/src/vs/workbench/common/theme.i18n.json index 64c51b8e74c093a9eff7a2cefad19e639e41bf25..7f9baabd3e4a57168a1de632deed48396a047156 100644 --- a/i18n/chs/src/vs/workbench/common/theme.i18n.json +++ b/i18n/chs/src/vs/workbench/common/theme.i18n.json @@ -7,10 +7,13 @@ "tabActiveBackground": "活动选项卡的背景色。在编辑器区域,选项卡是编辑器的容器。可在一个编辑器组中打开多个选项卡。可以有多个编辑器组。", "tabInactiveBackground": "非活动选项卡的背景色。在编辑器区域,选项卡是编辑器的容器。可在一个编辑器组中打开多个选项卡。可以有多个编辑器组。", "tabBorder": "用于将选项卡彼此分隔开的边框。选项卡是编辑器区域中编辑器的容器。可在一个编辑器组中打开多个选项卡。可以存在多个编辑器组。", - "tabActiveEditorGroupActiveForeground": "活动组中活动选项卡的前景色。在编辑器区域,选项卡是编辑器的容器。可在一个编辑器组中打开多个选项卡。可以有多个编辑器组。", - "tabInactiveEditorGroupActiveForeground": "活动组中非活动选项卡的前景色。在编辑器区域,选项卡是编辑器的容器。可在一个编辑器组中打开多个选项卡。可以有多个编辑器组。", + "tabActiveForeground": "活动组中活动选项卡的前景色。在编辑器区域,选项卡是编辑器的容器。可在一个编辑器组中打开多个选项卡。可以有多个编辑器组。", + "tabInactiveForeground": "活动组中非活动选项卡的前景色。在编辑器区域,选项卡是编辑器的容器。可在一个编辑器组中打开多个选项卡。可以有多个编辑器组。", + "tabUnfocusedActiveForeground": "非活动组中活动选项卡的前景色。在编辑器区域,选项卡是编辑器的容器。可在一个编辑器组中打开多个选项卡。可以有多个编辑器组。", + "tabUnfocusedInactiveForeground": "非活动组中非活动选项卡的前景色。在编辑器区域,选项卡是编辑器的容器。可在一个编辑器组中打开多个选项卡。可以有多个编辑器组。", "editorGroupBackground": "编辑器组的背景颜色。编辑器组是编辑器的容器。此颜色在拖动编辑器组时显示。", "tabsContainerBackground": "启用选项卡时编辑器组标题的背景颜色。编辑器组是编辑器的容器。", + "tabsContainerBorder": "选项卡启用时编辑器组标题的边框颜色。编辑器组是编辑器的容器。", "editorGroupHeaderBackground": "禁用选项卡时编辑器组标题的背景颜色。编辑器组是编辑器的容器。", "editorGroupBorder": "将多个编辑器组彼此分隔开的颜色。编辑器组是编辑器的容器。", "editorDragAndDropBackground": "拖动编辑器时的背景颜色。此颜色应有透明度,以便编辑器内容能透过背景。", @@ -21,23 +24,33 @@ "panelActiveTitleBorder": "活动面板的边框颜色。面板显示在编辑器区域下方,包含输出和集成终端等视图。", "statusBarForeground": "状态栏前景色。状态栏显示在窗口底部。", "statusBarBackground": "标准状态栏背景色。状态栏显示在窗口底部。", + "statusBarBorder": "状态栏分隔侧边栏和编辑器的边框颜色。状态栏显示在窗口底部。", "statusBarNoFolderBackground": "没有打开文件夹时状态栏的背景色。状态栏显示在窗口底部。", + "statusBarNoFolderForeground": "没有打开文件夹时状态栏的前景色。状态栏显示在窗口底部。", "statusBarItemActiveBackground": "单击时的状态栏项背景色。状态栏显示在窗口底部。", "statusBarItemHoverBackground": "悬停时的状态栏项背景色。状态栏显示在窗口底部。", "statusBarProminentItemBackground": "状态栏突出显示项的背景颜色。突出显示项比状态栏中的其他条目更显眼,表明其重要性更高。状态栏显示在窗口底部。", "statusBarProminentItemHoverBackground": "状态栏突出显示项在悬停时的背景颜色。突出显示项比状态栏中的其他条目更显眼,表明其重要性更高。状态栏显示在窗口底部。", "activityBarBackground": "活动栏背景色。活动栏显示在最左侧或最右侧,并允许在侧边栏的视图间切换。", "activityBarForeground": "活动栏前景色(例如用于图标)。活动栏显示在最左侧或最右侧,并允许在侧边栏的视图间切换。", + "activityBarBorder": "活动栏分隔侧边栏的边框颜色。活动栏显示在最左侧或最右侧,并可以切换侧边栏的视图。", "activityBarDragAndDropBackground": "活动栏项在被拖放时的反馈颜色。此颜色应有透明度,以便活动栏条目能透过此颜色。活动栏显示在最左侧或最右侧,并允许在侧边栏视图之间切换。", "activityBarBadgeBackground": "活动通知徽章背景色。活动栏显示在最左侧或最右侧,并允许在侧边栏的视图间切换。", "activityBarBadgeForeground": "活动通知徽章前景色。活动栏显示在最左侧或最右侧,并允许在侧边栏的视图间切换。", "sideBarBackground": "侧边栏背景色。侧边栏是资源管理器和搜索等视图的容器。", + "sideBarForeground": "侧边栏前景色。侧边栏是资源管理器和搜索等视图的容器。", + "sideBarBorder": "侧边栏分隔编辑器的边框颜色。侧边栏包含资源管理器、搜索等视图。", "sideBarTitleForeground": "侧边栏标题前景色。侧边栏是资源管理器和搜索等视图的容器。", "sideBarSectionHeaderBackground": "侧边栏节标题的背景颜色。侧边栏是资源管理器和搜索等视图的容器。", + "sideBarSectionHeaderForeground": "侧边栏节标题的前景色。侧边栏包括资源管理器、搜索等视图。", "titleBarActiveForeground": "窗口处于活动状态时的标题栏前景色。请注意,该颜色当前仅在 macOS 上受支持。", "titleBarInactiveForeground": "窗口处于非活动状态时的标题栏前景色。请注意,该颜色当前仅在 macOS 上受支持。", "titleBarActiveBackground": "窗口处于活动状态时的标题栏背景色。请注意,该颜色当前仅在 macOS 上受支持。", "titleBarInactiveBackground": "窗口处于非活动状态时的标题栏背景色。请注意,该颜色当前仅在 macOS 上受支持。", "notificationsForeground": "通知前景色。通知从窗口顶部滑入。", - "notificationsBackground": "通知背颜色。通知从窗口顶部滑入。" + "notificationsBackground": "通知背颜色。通知从窗口顶部滑入。", + "notificationsButtonForeground": "通知按钮前景色。通知从窗口顶部滑入。", + "notificationsInfoForeground": "消息通知前景色。通知从窗口顶部滑入。", + "notificationsWarningForeground": "警告通知前景色。通知从窗口顶部滑入。", + "notificationsErrorForeground": "错误通知前景色。通知从窗口顶部滑入。" } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/electron-browser/actions.i18n.json b/i18n/chs/src/vs/workbench/electron-browser/actions.i18n.json index 7ee775d592ca3071236c67fef5516536f00c4ad7..0663a15d8b68945197aa0a4c14f2df825264ba26 100644 --- a/i18n/chs/src/vs/workbench/electron-browser/actions.i18n.json +++ b/i18n/chs/src/vs/workbench/electron-browser/actions.i18n.json @@ -6,9 +6,6 @@ { "closeActiveEditor": "关闭编辑器", "closeWindow": "关闭窗口", - "switchWindow": "切换窗口", - "switchWindowPlaceHolder": "选择窗口", - "current": "当前窗口", "closeFolder": "关闭文件夹", "noFolderOpened": "此实例中没有要关闭的已打开文件夹。", "newWindow": "新建窗口", @@ -20,11 +17,16 @@ "zoomReset": "重置缩放", "appPerf": "启动性能", "reloadWindow": "重新加载窗口", - "openRecent": "打开最近的文件", + "switchWindowPlaceHolder": "选择切换的窗口", + "current": "当前窗口", + "switchWindow": "切换窗口...", + "quickSwitchWindow": "快速切换窗口...", "folders": "文件夹", "files": "文件", "openRecentPlaceHolderMac": "选择路径(在新窗口中按住 Cmd 键打开)", "openRecentPlaceHolder": "选择要打开的路径(在新窗口中按住 Ctrl 键打开)", + "openRecent": "打开最近的文件…", + "quickOpenRecent": "快速打开最近的文件…", "closeMessages": "关闭通知消息", "reportIssues": "报告问题", "reportPerformanceIssue": "报告性能问题", @@ -32,10 +34,10 @@ "openDocumentationUrl": "文档", "openIntroductoryVideosUrl": "入门视频", "toggleSharedProcess": "切换共享进程", - "navigateLeft": "移动到左侧的视图部分", - "navigateRight": "移动到右侧的视图部分", - "navigateUp": "移动到上方的视图部分", - "navigateDown": "移动到下方的视图部分", + "navigateLeft": "导航到左侧视图", + "navigateRight": "导航到右侧视图", + "navigateUp": "导航到上方视图", + "navigateDown": "导航到下方视图", "increaseViewSize": "增加当前视图大小", "decreaseViewSize": "减小当前视图大小" } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/electron-browser/main.contribution.i18n.json b/i18n/chs/src/vs/workbench/electron-browser/main.contribution.i18n.json index 375f183373b0960b905890583122ec8310a5c754..01e2a1e7dff715043936eb1de50cdfa618c04648 100644 --- a/i18n/chs/src/vs/workbench/electron-browser/main.contribution.i18n.json +++ b/i18n/chs/src/vs/workbench/electron-browser/main.contribution.i18n.json @@ -7,6 +7,7 @@ "view": "查看", "help": "帮助", "file": "文件", + "developer": "开发者", "showEditorTabs": "控制打开的编辑器是否显示在选项卡中。", "editorTabCloseButton": "控制编辑器的选项卡关闭按钮的位置,或当设置为 \"off\" 时禁用关闭它们。", "showIcons": "控制打开的编辑器是否随图标一起显示。这还需启用图标主题。", @@ -30,10 +31,11 @@ "window.openFoldersInNewWindow.off": "文件夹将替换上一个活动窗口", "window.openFoldersInNewWindow.default": "文件夹在新窗口中打开,除非从应用程序内选取一个文件夹(例如,通过“文件”菜单)", "openFoldersInNewWindow": "控制文件夹应在新窗口中打开还是替换上一活动窗口。\n- default: 文件夹将在新窗口中打开,除非文件是从应用程序内选取的(例如通过“文件”菜单)\n- on: 文件夹将在新窗口中打开\n- off: 文件夹将替换上一活动窗口\n注意,可能仍会存在忽略此设置的情况(例如当使用 -new-window 或 -reuse-window 命令行选项时)。", - "window.reopenFolders.none": "永不重新打开文件夹。", - "window.reopenFolders.one": "重新打开上一个活动文件夹。", - "window.reopenFolders.all": "重新打开上一个会话的所有文件夹。", - "reopenFolders": "控制重启后重新打开文件夹的方式。选择“none”表示永不重新打开文件夹,选择“one”表示重新打开最后使用的一个文件夹,或选择“all”表示打开上次会话的所有文件夹。", + "window.reopenFolders.all": "重新打开所有窗口。", + "window.reopenFolders.folders": "重新打开所有文件夹。空窗口将不会被恢复。", + "window.reopenFolders.one": "重新打开上一个活动窗口。", + "window.reopenFolders.none": "永远不重新打开窗口。总是以一个空窗口启动。", + "restoreWindows": "控制重启后重新打开窗口的方式。选择“none”则永远在启动时打开一个空窗口;选择“one”则重新打开最后使用的窗口;选择“folders”则重新打开所有你曾打开的文件夹;或选择“all”则重新打开上次会话的所有窗口。", "restoreFullscreen": "如果窗口已退出全屏模式,控制其是否应还原为全屏模式。", "zoomLevel": "调整窗口的缩放级别。原始大小是 0,每次递增(例如 1)或递减(例如 -1)表示放大或缩小 20%。也可以输入小数以便以更精细的粒度调整缩放级别。", "title": "基于活动编辑器控制窗口标题。基于上下文替换变量:\n${activeEditorShort}: 例如 myFile.txt\n${activeEditorMedium}:例如 myFolder/myFile.txt\n${activeEditorLong}: 例如 /Users/Development/myProject/myFolder/myFile.txt\n${rootName}: 例如 myProject\n${rootPath}: 例如 /Users/Development/myProject\n${appName}: 例如 VS Code\n${dirty}: 一个更新指示器,指示活动编辑器是否更新\n${separator}: 一个条件分隔符(\"-\"),仅在左右是具有值的变量时才显示", @@ -57,5 +59,8 @@ "zenMode.hideTabs": "控制打开 Zen 模式是否也会隐藏工作台选项卡。", "zenMode.hideStatusBar": "控制打开 Zen 模式是否也会隐藏工作台底部的状态栏。", "zenMode.hideActivityBar": "控制打开 Zen 模式是否也会隐藏工作台左侧的活动栏。", - "zenMode.restore": "控制如果某窗口已退出 zen 模式,是否应还原到 zen 模式。" + "zenMode.restore": "控制如果某窗口已退出 zen 模式,是否应还原到 zen 模式。", + "workspaceConfigurationTitle": "工作区", + "files.exclude.boolean": "匹配文件路径所依据的 glob 模式。设置为 true 或 false 可启用或禁用该模式。", + "workspaces.additionalFolders": "工作区中的文件夹" } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/electron-browser/workbench.i18n.json b/i18n/chs/src/vs/workbench/electron-browser/workbench.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..b7d445f6a6a3e4737ff69c7a2d6bfa100f910e0d --- /dev/null +++ b/i18n/chs/src/vs/workbench/electron-browser/workbench.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "developer": "开发者", + "file": "文件" +} \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/codeEditor/electron-browser/accessibility.i18n.json b/i18n/chs/src/vs/workbench/parts/codeEditor/electron-browser/accessibility.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..9085c5357712251cdcd464357d1428e409dc5ccc --- /dev/null +++ b/i18n/chs/src/vs/workbench/parts/codeEditor/electron-browser/accessibility.i18n.json @@ -0,0 +1,26 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "emergencyConfOn": "正在更改“editor.accessibilitySupport”设置为“on”。", + "openingDocs": "正在打开 VS Code 辅助功能文档页面。", + "introMsg": "感谢试用 VS Code 的辅助功能选项。", + "status": "状态:", + "changeConfigToOnMac": "要配置编辑器对屏幕阅读器进行永久优化,请按 Command+E。", + "changeConfigToOnWinLinux": "要配置编辑器对屏幕阅读器进行永久优化,请按 Ctrl+E。", + "auto_unknown": "编辑器被配置为使用平台 API 以检测是否附加了屏幕阅读器,但当前运行时不支持此功能。", + "auto_on": "编辑器自动检测到已附加屏幕阅读器。", + "auto_off": "编辑器被配置为自动检测是否附加了屏幕阅读器,当前未检测到。", + "configuredOn": "编辑器被配置为对屏幕阅读器的使用进行永久优化 — 你可以编辑设置中的“editor.accessibilitySupport”以改变此行为。", + "configuredOff": "编辑器被配置为不对屏幕阅读器的使用进行优化。", + "tabFocusModeOnMsg": "在当前编辑器中按 Tab 会将焦点移动到下一个可聚焦的元素。按 {0} 来切换此行为。", + "tabFocusModeOnMsgNoKb": "在当前编辑器中按 Tab 会将焦点移动到下一个可聚焦的元素。当前无法通过键绑定触发命令 {0}。", + "tabFocusModeOffMsg": "在当前编辑器中按 Tab 将插入制表符。按 {0} 来切换此行为。", + "tabFocusModeOffMsgNoKb": "在当前编辑器中按 Tab 会插入制表符。当前无法通过键绑定触发命令 {0}。", + "openDocMac": "按 Command+H 以打开浏览器窗口,其中包含更多有关 VS Code 辅助功能的信息。", + "openDocWinLinux": "按 Ctrl+H 以打开浏览器窗口,其中包含更多有关 VS Code 辅助功能的信息。", + "outroMsg": "你可以按 Esc 或 Shift+Esc 消除此工具提示并返回到编辑器。", + "ShowAccessibilityHelpAction": "显示辅助功能帮助" +} \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/codeEditor/electron-browser/inspectKeybindings.i18n.json b/i18n/chs/src/vs/workbench/parts/codeEditor/electron-browser/inspectKeybindings.i18n.json index a188f9c1e90a09cf382c7e9b49be1d66949bc27d..b163a2de99e328139adb36f1c9a8e6c044befbd4 100644 --- a/i18n/chs/src/vs/workbench/parts/codeEditor/electron-browser/inspectKeybindings.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/codeEditor/electron-browser/inspectKeybindings.i18n.json @@ -4,5 +4,5 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "workbench.action.inspectKeyMap": "开发者:检查键映射" + "workbench.action.inspectKeyMap": "开发者: 检查键映射" } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/codeEditor/electron-browser/inspectTMScopes.i18n.json b/i18n/chs/src/vs/workbench/parts/codeEditor/electron-browser/inspectTMScopes.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a --- /dev/null +++ b/i18n/chs/src/vs/workbench/parts/codeEditor/electron-browser/inspectTMScopes.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{} \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/codeEditor/electron-browser/toggleMultiCursorModifier.i18n.json b/i18n/chs/src/vs/workbench/parts/codeEditor/electron-browser/toggleMultiCursorModifier.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..90e803801d33521b12bcb9d26e9f80b6e5fc4c53 --- /dev/null +++ b/i18n/chs/src/vs/workbench/parts/codeEditor/electron-browser/toggleMultiCursorModifier.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "toggleLocation": "切换多行修改键" +} \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/codeEditor/electron-browser/toggleWordWrap.i18n.json b/i18n/chs/src/vs/workbench/parts/codeEditor/electron-browser/toggleWordWrap.i18n.json index 8d541bedfe0b5816c760f239ffa2d74962d6409a..a7b3e519e7d334234660ca798bf1694911328fcf 100644 --- a/i18n/chs/src/vs/workbench/parts/codeEditor/electron-browser/toggleWordWrap.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/codeEditor/electron-browser/toggleWordWrap.i18n.json @@ -6,6 +6,6 @@ { "toggle.wordwrap": "查看: 切换自动换行", "wordWrap.notInDiffEditor": "不能在差异编辑器中切换自动换行。", - "unwrapMinified": "为此文件禁用换行", + "unwrapMinified": "为此文件禁用折行", "wrapMinified": "为此文件启用换行" } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/debug/electron-browser/debugService.i18n.json b/i18n/chs/src/vs/workbench/parts/debug/electron-browser/debugService.i18n.json index f29ac67da10fe00a761b62893c9a6c59e934035b..31765f90ced5bb50bfc0b10ef5e6c5999c54fe8b 100644 --- a/i18n/chs/src/vs/workbench/parts/debug/electron-browser/debugService.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/debug/electron-browser/debugService.i18n.json @@ -5,8 +5,8 @@ // Do not edit this file. It is machine generated. { "snapshotObj": "仅显示了此对象的基元值。", - "debuggingStarted": "已开始调试。", "debuggingPaused": "已暂停调试,原因 {0},{1} {2}", + "debuggingStarted": "已开始调试。", "debuggingStopped": "已停止调试。", "breakpointAdded": "已添加断点,行 {0}, 文件 {1}", "breakpointRemoved": "已删除断点,行 {0},文件 {1}", diff --git a/i18n/chs/src/vs/workbench/parts/debug/electron-browser/debugViews.i18n.json b/i18n/chs/src/vs/workbench/parts/debug/electron-browser/debugViews.i18n.json index b47d705e0f32b8ee5f8823c76251aa805355b600..230f0bd8f03a730b2ec54217651085a079d23b49 100644 --- a/i18n/chs/src/vs/workbench/parts/debug/electron-browser/debugViews.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/debug/electron-browser/debugViews.i18n.json @@ -5,16 +5,12 @@ // Do not edit this file. It is machine generated. { "variablesSection": "变量部分", - "variables": "变量", "variablesAriaTreeLabel": "调试变量", "expressionsSection": "表达式部分", - "watch": "监视", "watchAriaTreeLabel": "调试监视表达式", "callstackSection": "调用堆栈部分", "debugStopped": "因 {0} 已暂停", - "callStack": "调用堆栈", "callStackAriaLabel": "调试调用堆栈", "breakpointsSection": "断点部分", - "breakpoints": "断点", "breakpointsAriaTreeLabel": "调试断点" } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/debug/electron-browser/statusbarColorProvider.i18n.json b/i18n/chs/src/vs/workbench/parts/debug/electron-browser/statusbarColorProvider.i18n.json index 6e5b8b4125520766c287529911ecdb85353feaaf..f5089c0197a26c4bbd1c666ddf37ce03370a74a2 100644 --- a/i18n/chs/src/vs/workbench/parts/debug/electron-browser/statusbarColorProvider.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/debug/electron-browser/statusbarColorProvider.i18n.json @@ -4,5 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "statusBarDebuggingBackground": "调试程序时状态栏的背景色。状态栏显示在窗口底部" + "statusBarDebuggingBackground": "调试程序时状态栏的背景色。状态栏显示在窗口底部", + "statusBarDebuggingForeground": "调试程序时状态栏的前景色。状态栏显示在窗口底部" } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json b/i18n/chs/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json index c322b5a660a56c0724261f33ff56bde741214c3d..54243f83ce3239615e33ed0d75bbaf3a87f86baa 100644 --- a/i18n/chs/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json @@ -7,6 +7,7 @@ "debugAdapterBinNotFound": "调试适配器可执行的“{0}”不存在。", "debugAdapterCannotDetermineExecutable": "无法确定调试适配器“{0}”的可执行文件。", "debugType": "配置类型。", + "debugTypeNotRecognised": "无法识别此调试类型。确保已经安装并启用相应的调试扩展。", "node2NotSupported": "不再支持 \"node2\",改用 \"node\",并将 \"protocol\" 属性设为 \"inspector\"。", "debugName": "配置名称;在启动配置下拉菜单中显示。", "debugRequest": "请求配置类型。可以是“启动”或“附加”。", diff --git a/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json b/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json index 87fec1a103c22dd5b3c6131d2e1152dcb69f2f31..fbb9c2b2cd2d469dcc79a7048a2470d9ab609ba2 100644 --- a/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json @@ -4,6 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "previousEditPoint": "Emmet: 上一编辑点", - "nextEditPoint": "Emmet: 下一编辑点" + "previousEditPoint": "Emmet: 转到上一编辑点", + "nextEditPoint": "Emmet: 转到下一编辑点" } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/evaluateMath.i18n.json b/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/evaluateMath.i18n.json index 0598c67b46ee4420fae0efc5de7a16b735def477..f4159d50b0ea6576c23e465169b8657ada0faf26 100644 --- a/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/evaluateMath.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/evaluateMath.i18n.json @@ -4,5 +4,5 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "evaluateMathExpression": "Emmet: 评估数学表达式" + "evaluateMathExpression": "Emmet: 求数学表达式的值" } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/incrementDecrement.i18n.json b/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/incrementDecrement.i18n.json index 403f855e5eba58ffde01c3da51b0f4b47934e946..81f7dcfcab119564c8cbae17ece23ba6716e7703 100644 --- a/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/incrementDecrement.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/incrementDecrement.i18n.json @@ -4,10 +4,10 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "incrementNumberByOneTenth": "Emmet: 以 0.1 为增量", - "incrementNumberByOne": "Emmet: 以 1 为增量", - "incrementNumberByTen": "Emmet: 以 10 为增量", - "decrementNumberByOneTenth": "Emmet: 以 0.1 为减量", - "decrementNumberByOne": "Emmet: 以 1 为减量", - "decrementNumberByTen": "Emmet: 以 10 为减量" + "incrementNumberByOneTenth": "Emmet: 增加 0.1", + "incrementNumberByOne": "Emmet: 增加 1", + "incrementNumberByTen": "Emmet: 增加 10", + "decrementNumberByOneTenth": "Emmet: 减少 0.1", + "decrementNumberByOne": "Emmet: 减少 1", + "decrementNumberByTen": "Emmet: 减少 10" } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/removeTag.i18n.json b/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/removeTag.i18n.json index b58d42bcafefbbdc54f34eb818dd2d9df49b8be5..545f1c107e703b3625605f99b4b20a2c33b8acc3 100644 --- a/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/removeTag.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/removeTag.i18n.json @@ -4,5 +4,5 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "removeTag": "Emmet: 删除标记" + "removeTag": "Emmet: 删除标签" } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/splitJoinTag.i18n.json b/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/splitJoinTag.i18n.json index 5796a0dcab8c5e7ca91f7c21598f3132549d0e5a..53e4eaafbd99372bd8092d81c763c8b91b23105a 100644 --- a/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/splitJoinTag.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/splitJoinTag.i18n.json @@ -4,5 +4,5 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "splitJoinTag": "Emmet: 分离/联接标记" + "splitJoinTag": "Emmet: 分离/联接标签" } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/updateImageSize.i18n.json b/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/updateImageSize.i18n.json index c5d6fd7b350dbdf7a153f4f9769f5fabd636d9f7..d68725525c80956aeba81b51144688c98f494136 100644 --- a/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/updateImageSize.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/updateImageSize.i18n.json @@ -4,5 +4,5 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "updateImageSize": "Emmet: 更新映像大小" + "updateImageSize": "Emmet: 更新图像大小" } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/updateTag.i18n.json b/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/updateTag.i18n.json index 486e5397c4bc5d1d8e4d010d2276004e27914abb..8bf2821c1205f4054f4c8b360db820fbf217cd02 100644 --- a/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/updateTag.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/updateTag.i18n.json @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "updateTag": "Emmet: 更新标记", - "enterTag": "输入标记", - "tag": "标记" + "updateTag": "Emmet: 更新标签", + "enterTag": "输入标签", + "tag": "标签" } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/wrapWithAbbreviation.i18n.json b/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/wrapWithAbbreviation.i18n.json index dbca7bf9016be8944138baecf4dd2d27137ff668..21f0c06d36383c3357d50f696b081b9229edd893 100644 --- a/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/wrapWithAbbreviation.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/actions/wrapWithAbbreviation.i18n.json @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "wrapWithAbbreviationAction": "Emmet: 使用缩写进行包装", + "wrapWithAbbreviationAction": "Emmet: 使用缩写进行包围", "enterAbbreviation": "输入缩写", "abbreviation": "缩写" } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json b/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json index 6a402e79e1e6b19da56098fdc4c769fd46dd9d87..2d8b8d26d448dbb8d7f1ca1db37ee6a0c274933f 100644 --- a/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json @@ -6,8 +6,9 @@ { "emmetConfigurationTitle": "Emmet", "triggerExpansionOnTab": "启用后,按 TAB 键时,将展开 Emmet 缩写。", - "emmetPreferences": "用于修改 Emmet 的某些操作和解决程序的首选项。", + "emmetPreferences": "用于修改 Emmet 某些操作和解析程序的行为的首选项。", "emmetSyntaxProfiles": "为指定的语法定义配置文件或使用带有特定规则的配置文件。", - "emmetExclude": "emmet 缩写不应在其中展开的语言数组。", - "emmetExtensionsPath": "转至包含 Emmet 配置文件、片段和首选项的文件的路径" + "emmetExclude": "不应展开 Emmet 缩写的语言数组。", + "emmetExtensionsPath": "包含 Emmet 配置文件、代码段和首选项的文件夹路径", + "useNewEmmet": "试用新版 Emmet 模块(最终会替换旧版单一 Emmet 库)体验所有 Emmet 功能。" } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/explorers/browser/treeExplorer.contribution.i18n.json b/i18n/chs/src/vs/workbench/parts/explorers/browser/treeExplorer.contribution.i18n.json index 5d52f90d6278b90424c456c7ff253bef49faf02f..076eadb1e72acdf682844dac46b67e64307fc0c8 100644 --- a/i18n/chs/src/vs/workbench/parts/explorers/browser/treeExplorer.contribution.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/explorers/browser/treeExplorer.contribution.i18n.json @@ -4,11 +4,11 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "vscode.extension.contributes.view": "贡献自定义视图", + "vscode.extension.contributes.view": "添加自定义视图", "vscode.extension.contributes.view.id": "用于标识通过 vscode.workspace.createTreeView 创建的视图的唯一 ID", "vscode.extension.contributes.view.label": "用于呈现视图的人类可读的字符串", "vscode.extension.contributes.view.icon": "视图图标的路径", - "vscode.extension.contributes.views": "贡献自定义视图", + "vscode.extension.contributes.views": "添加自定义视图", "showViewlet": "显示 {0}", "view": "查看" } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/extensions/browser/extensionEditor.i18n.json b/i18n/chs/src/vs/workbench/parts/extensions/browser/extensionEditor.i18n.json index 5e357e17480ed75c6322fc73881bbcb5e0bb8cb8..f8c655a1a89077a113476d0338d517722b20fb47 100644 --- a/i18n/chs/src/vs/workbench/parts/extensions/browser/extensionEditor.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/extensions/browser/extensionEditor.i18n.json @@ -24,6 +24,10 @@ "default": "默认", "debuggers": "调试程序({0})", "debugger name": "名称", + "views": "视图 ({0})", + "view id": "ID", + "view name": "名称", + "view location": "位置", "themes": "主题({0})", "JSON Validation": "JSON 验证({0})", "commands": "命令({0})", diff --git a/i18n/chs/src/vs/workbench/parts/extensions/browser/extensionsActions.i18n.json b/i18n/chs/src/vs/workbench/parts/extensions/browser/extensionsActions.i18n.json index af246476905c3fe68c18b92acc67bed3276654d8..38c86c25f8b5cef8f051963ff667ca6cb620f0ef 100644 --- a/i18n/chs/src/vs/workbench/parts/extensions/browser/extensionsActions.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/extensions/browser/extensionsActions.i18n.json @@ -22,6 +22,8 @@ "disableGloballyAction": "始终", "disableAction": "禁用", "checkForUpdates": "检查更新", + "enableAutoUpdate": "启用自动更新扩展", + "disableAutoUpdate": "禁用自动更新扩展", "updateAll": "更新所有扩展", "reloadAction": "重新加载", "postUpdateTooltip": "重载以更新", @@ -44,6 +46,8 @@ "showWorkspaceRecommendedExtensions": "显示工作区建议的扩展名", "showRecommendedKeymapExtensions": "显示推荐键映射", "showRecommendedKeymapExtensionsShort": "键映射", + "showLanguageExtensions": "显示语言扩展", + "showLanguageExtensionsShort": "语言扩展", "configureWorkspaceRecommendedExtensions": "配置建议的扩展(工作区)", "ConfigureWorkspaceRecommendations.noWorkspace": "建议仅在工作区文件夹上可用。", "OpenExtensionsFile.failed": "无法在 \".vscode\" 文件夹({0})内创建 \"extensions.json\" 文件。", @@ -51,5 +55,8 @@ "disableAll": "禁用所有已安装的扩展", "disableAllWorkspace": "禁用此工作区的所有已安装的扩展", "enableAll": "启用所有已安装的扩展", - "enableAllWorkspace": "启用此工作区的所有已安装的扩展" + "enableAllWorkspace": "启用此工作区的所有已安装的扩展", + "extensionButtonProminentBackground": "扩展中突出操作的按钮背景色(比如 安装按钮)。", + "extensionButtonProminentForeground": "扩展中突出操作的按钮前景色(比如 安装按钮)。", + "extensionButtonProminentHoverBackground": "扩展中突出操作的按钮被悬停时的颜色(比如 安装按钮)。" } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json b/i18n/chs/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json index 8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a..518bee02115f82d50e7a56a72fea995dd1e9b145 100644 --- a/i18n/chs/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json @@ -3,4 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. -{} \ No newline at end of file +{ + "disableOtherKeymapsConfirmation": "禁用其他键映射 ({0}) 以避免键绑定之间的冲突?", + "yes": "是", + "no": "否", + "betterMergeDisabled": "现已内置 Better Merge 扩展。此扩展已被安装并禁用,且能被卸载。", + "uninstall": "卸载", + "later": "稍后" +} \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/files/browser/files.contribution.i18n.json b/i18n/chs/src/vs/workbench/parts/files/browser/files.contribution.i18n.json index ba343731820b79c4364111faebae90691331c1ea..50c0b174efacabaedc82b4b21981e80bccb28f4e 100644 --- a/i18n/chs/src/vs/workbench/parts/files/browser/files.contribution.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/files/browser/files.contribution.i18n.json @@ -16,7 +16,7 @@ "associations": "配置语言的文件关联(如: \"*.extension\": \"html\")。这些关联的优先级高于已安装语言的默认关联。", "encoding": "读取和编写文件时将使用的默认字符集编码。", "autoGuessEncoding": "启用时,会在打开文件时尝试猜测字符集编码", - "eol": "默认行尾字符。", + "eol": "默认行尾字符。使用 \\n 表示 LF,\\r\\n 表示 CRLF。", "trimTrailingWhitespace": "启用后,将在保存文件时剪裁尾随空格。", "insertFinalNewline": "启用后,保存文件时在文件末尾插入一个最终新行。", "files.autoSave.off": "永不自动保存更新后的文件。", @@ -28,7 +28,6 @@ "watcherExclude": "配置文件路径的 glob 模式以从文件监视排除。更改此设置要求重启。如果在启动时遇到 Code 消耗大量 CPU 时间,则可以排除大型文件夹以减少初始加载。", "hotExit.off": "禁用热退出。", "hotExit.onExit": "应用程序关闭时将触发热退出。在 Windows/Linux 上关闭最后一个窗口或触发 workbench.action.quit 命令(命令托盘、键绑定、菜单)会引起应用程序关闭。下次启动时将还原所有已备份的窗口。", - "hotExit.onExitAndWindowClose": "应用程序关闭时将触发热退出。在 Windows/Linux 上关闭最后一个窗口、触发 workbench.action.quit 命令(命令托盘、键绑定、菜单)会引起应用程序关闭。对于任何有文件夹打开的窗口,则不论该窗口是否是最后一个窗口。下次启动时将还原所有未打开文件夹的窗口。若要还原打开有文件夹的窗口,请将“window.reopenFolders”设置为“all”。", "hotExit": "控制是否在会话间记住未保存的文件,以允许在退出编辑器时跳过保存提示。", "defaultLanguage": "分配给新文件的默认语言模式。", "editorConfigurationTitle": "编辑器", diff --git a/i18n/chs/src/vs/workbench/parts/files/browser/views/emptyView.i18n.json b/i18n/chs/src/vs/workbench/parts/files/browser/views/emptyView.i18n.json index 4d442c51a66c6bc5b539c9429f108d1efba1129b..f98b4a8c0071b13009e11ff2c129308370623474 100644 --- a/i18n/chs/src/vs/workbench/parts/files/browser/views/emptyView.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/files/browser/views/emptyView.i18n.json @@ -5,7 +5,5 @@ // Do not edit this file. It is machine generated. { "explorerSection": "文件资源管理器部分", - "noWorkspace": "无打开的文件夹", - "noWorkspaceHelp": "尚未打开文件夹。", "openFolder": "打开文件夹" } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/files/browser/views/openEditorsView.i18n.json b/i18n/chs/src/vs/workbench/parts/files/browser/views/openEditorsView.i18n.json index 33cc7fda987c0ac1106780011864c8cdd38ab824..1639569b1103d0c893631a94f1d8c84f96c8a27b 100644 --- a/i18n/chs/src/vs/workbench/parts/files/browser/views/openEditorsView.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/files/browser/views/openEditorsView.i18n.json @@ -4,8 +4,8 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "openEditosrSection": "打开的编辑器部分", "openEditors": "打开的编辑器", + "openEditosrSection": "打开的编辑器部分", "treeAriaLabel": "打开的编辑器: 活动文件列表", "dirtyCounter": "{0} 个未保存" } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/files/common/editors/fileEditorInput.i18n.json b/i18n/chs/src/vs/workbench/parts/files/common/editors/fileEditorInput.i18n.json index f4fa6caa5bcb3e0008ad4318cddaa0ffbd643101..9745dba45381eb7a086425b75988568d9ecbcd5a 100644 --- a/i18n/chs/src/vs/workbench/parts/files/common/editors/fileEditorInput.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/files/common/editors/fileEditorInput.i18n.json @@ -4,5 +4,5 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "orphanedFile": "{0} (deleted from disk)" + "orphanedFile": "{0} (磁盘上已删除)" } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json b/i18n/chs/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json index dbd6be98f3e07a01c9c4823bd524ad2a21ecde4b..bb7e4ea7afa068b112394f061726feac0db6b5bd 100644 --- a/i18n/chs/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json @@ -5,5 +5,11 @@ // Do not edit this file. It is machine generated. { "slow": "检测到启动缓慢", - "slow.detail": "抱歉,出现了启动缓慢的情况。请重启“{0}”并启用分析,将分析文件与我们共享,我们会努力提高启动速度。" + "slow.detail": "抱歉,出现了启动缓慢的情况。请重启“{0}”并启用分析,将分析文件与我们共享,我们会努力提高启动速度。", + "prof.message": "已成功创建描述文件。", + "prof.detail": "请创建问题并手动附加以下文件:\n{0}", + "prof.restartAndFileIssue": "创建问题并重启", + "prof.restart": "重启", + "prof.thanks": "感谢您的帮助。", + "prof.detail.restart": "需要重新启动才能继续使用“{0}”。再次感谢您的贡献。" } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/preferences/browser/keybindingWidgets.i18n.json b/i18n/chs/src/vs/workbench/parts/preferences/browser/keybindingWidgets.i18n.json index 99d48068a9a9f532c233d368bded1a9bee917d2a..1c5aca86231a6a6e3bd63ffe2ded0b11757b46ed 100644 --- a/i18n/chs/src/vs/workbench/parts/preferences/browser/keybindingWidgets.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/preferences/browser/keybindingWidgets.i18n.json @@ -5,5 +5,5 @@ // Do not edit this file. It is machine generated. { "defineKeybinding.initial": "按所需的键组合,然后按 Enter。按 Esc 可取消。", - "defineKeybinding.chordsTo": "弦形" + "defineKeybinding.chordsTo": "加上" } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/preferences/browser/keybindingsEditor.i18n.json b/i18n/chs/src/vs/workbench/parts/preferences/browser/keybindingsEditor.i18n.json index d4d305eba54aaa0b5eb82b405dc1f6a1cb54b939..3461ec0a523e9389c96f16e5ec99e36773f257ca 100644 --- a/i18n/chs/src/vs/workbench/parts/preferences/browser/keybindingsEditor.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/preferences/browser/keybindingsEditor.i18n.json @@ -4,11 +4,11 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "keybindingsInputName": "键盘快捷键", + "keybindingsInputName": "键盘快捷方式", "SearchKeybindings.AriaLabel": "搜索键绑定", "SearchKeybindings.Placeholder": "搜索键绑定", "sortByPrecedene": "按优先级排序", - "header-message": "用于高级自定义打开和编辑", + "header-message": "高级自定义请打开和编辑", "keybindings-file-name": "keybindings.json", "keybindingsLabel": "键绑定", "changeLabel": "更改键绑定", diff --git a/i18n/chs/src/vs/workbench/parts/preferences/browser/keybindingsEditorContribution.i18n.json b/i18n/chs/src/vs/workbench/parts/preferences/browser/keybindingsEditorContribution.i18n.json index 3db635ddc246b7705dc6042e6f4550f7b16f4473..574f03fcc125dc8af44797a332639fdca4fda0e8 100644 --- a/i18n/chs/src/vs/workbench/parts/preferences/browser/keybindingsEditorContribution.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/preferences/browser/keybindingsEditorContribution.i18n.json @@ -5,6 +5,7 @@ // Do not edit this file. It is machine generated. { "defineKeybinding.start": "定义键绑定", - "defineKeybinding.kbLayoutInfoMessage": "对于当前键盘布局,按 ", - "defineKeybinding.kbLayoutErrorMessage": "在当前键盘布局下无法生成此组合键。" + "defineKeybinding.kbLayoutErrorMessage": "在当前键盘布局下无法生成此组合键。", + "defineKeybinding.kbLayoutLocalAndUSMessage": "在你的键盘布局上为 **{0}**(美国标准布局上为 **{1}**)。", + "defineKeybinding.kbLayoutLocalMessage": "在你的键盘布局上为 **{0}**。" } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/preferences/browser/preferencesActions.i18n.json b/i18n/chs/src/vs/workbench/parts/preferences/browser/preferencesActions.i18n.json index 058e01cd6bf6553784203b90d00adb0ad61db06b..72a81c0af681da525f4d0bcd7413da61295d7781 100644 --- a/i18n/chs/src/vs/workbench/parts/preferences/browser/preferencesActions.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/preferences/browser/preferencesActions.i18n.json @@ -6,7 +6,7 @@ { "openGlobalSettings": "打开用户设置", "openGlobalKeybindings": "打开键盘快捷方式", - "openGlobalKeybindingsFile": "打开键盘快捷键文件", + "openGlobalKeybindingsFile": "打开键盘快捷方式文件", "openWorkspaceSettings": "打开工作区设置", "configureLanguageBasedSettings": "配置语言特定的设置...", "languageDescriptionConfigured": "({0})", diff --git a/i18n/chs/src/vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.i18n.json b/i18n/chs/src/vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..f3d350d60583bb57f499618efb63b966a1cc75be --- /dev/null +++ b/i18n/chs/src/vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "relaunchMessage": "设置已更改,需要重启才能生效。", + "relaunchDetail": "按下“重启”按钮以重新启动 {0} 并启用该设置。", + "restart": "重启" +} \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.i18n.json b/i18n/chs/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..bc3bae9c0e521199aaf6d5d1503bf4c737ba17b1 --- /dev/null +++ b/i18n/chs/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "editorGutterModifiedBackground": "编辑器导航线中被修改行的背景颜色。", + "editorGutterAddedBackground": "编辑器导航线中已插入行的背景颜色。", + "editorGutterDeletedBackground": "编辑器导航线中被删除行的背景颜色。" +} \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/scm/electron-browser/scm.contribution.i18n.json b/i18n/chs/src/vs/workbench/parts/scm/electron-browser/scm.contribution.i18n.json index ab4166d5cd73be3839385dd4fd6790b3d1753c9e..8ea8ff4f96e85ebc583e3131193ba7487f37d89d 100644 --- a/i18n/chs/src/vs/workbench/parts/scm/electron-browser/scm.contribution.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/scm/electron-browser/scm.contribution.i18n.json @@ -4,7 +4,8 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "toggleGitViewlet": "显示 GIT", + "toggleGitViewlet": "显示 Git", + "installAdditionalSCMProviders": "安装其他 SCM 提供程序...", "source control": "源代码管理", "toggleSCMViewlet": "显示 SCM", "view": "查看" diff --git a/i18n/chs/src/vs/workbench/parts/scm/electron-browser/scmMenus.i18n.json b/i18n/chs/src/vs/workbench/parts/scm/electron-browser/scmMenus.i18n.json index f03d74e8c9daf4db83d15c2c8385a34be0e07df3..89c41c7a05bad973983cbe6711ab63046395427d 100644 --- a/i18n/chs/src/vs/workbench/parts/scm/electron-browser/scmMenus.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/scm/electron-browser/scmMenus.i18n.json @@ -4,5 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "switch provider": "切换 SCM 提供程序..." + "installAdditionalSCMProviders": "安装其他 SCM 提供程序...", + "switch provider": "切换源代码管理系统..." } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/snippets/electron-browser/TMSnippets.i18n.json b/i18n/chs/src/vs/workbench/parts/snippets/electron-browser/TMSnippets.i18n.json index 0c4154de4e50a50f712081fca8259991b0348800..a667d902bfed10abfc830be44b5c48d303f4a131 100644 --- a/i18n/chs/src/vs/workbench/parts/snippets/electron-browser/TMSnippets.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/snippets/electron-browser/TMSnippets.i18n.json @@ -4,10 +4,11 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "vscode.extension.contributes.snippets": "贡献代码段。", + "vscode.extension.contributes.snippets": "添加代码段。", "vscode.extension.contributes.snippets-language": "此代码片段参与的语言标识符。", "vscode.extension.contributes.snippets-path": "代码片段文件的路径。该路径相对于扩展文件夹,通常以 \"./snippets/\" 开头。", "invalid.language": "“contributes.{0}.language”中存在未知的语言。提供的值: {1}", "invalid.path.0": "“contributes.{0}.path”中应为字符串。提供的值: {1}", - "invalid.path.1": "“contributes.{0}.path”({1})应包含在扩展的文件夹({2})内。这可能会使扩展不可移植。" + "invalid.path.1": "“contributes.{0}.path”({1})应包含在扩展的文件夹({2})内。这可能会使扩展不可移植。", + "badVariableUse": "“{0}”代码片段很可能混淆了片段变量和片段占位符。有关详细信息,请访问 https://code.visualstudio.com/docs/editor/userdefinedsnippets#_snippet-syntax。" } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/snippets/electron-browser/snippets.contribution.i18n.json b/i18n/chs/src/vs/workbench/parts/snippets/electron-browser/snippets.contribution.i18n.json index 40b1258792202e87b7485f474df00689fbe5f7ac..5a84e47f5dbcf70780f70be1db4990f02d0c731b 100644 --- a/i18n/chs/src/vs/workbench/parts/snippets/electron-browser/snippets.contribution.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/snippets/electron-browser/snippets.contribution.i18n.json @@ -11,6 +11,6 @@ "snippetSchema.json.default": "空代码片段", "snippetSchema.json": "用户代码片段配置", "snippetSchema.json.prefix": "在 Intellisense 中选择代码片段时将使用的前缀", - "snippetSchema.json.body": "代码片段内容。使用“${id}”、“${id:label}”、“${1:label}”作为变量,使用 \"$0\" 和 \"$1\" 作为光标位置", + "snippetSchema.json.body": "代码片段的内容。使用“$1”和“${1:defaultText}”定义光标位置,使用“$0”定义最终光标位置。使用“${varName}”和“${varName:defaultText}”插入变量值,例如“这是文件:$TM_FILENAME”。", "snippetSchema.json.description": "代码片段描述。" } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/surveys/electron-browser/languageSurveys.contribution.i18n.json b/i18n/chs/src/vs/workbench/parts/surveys/electron-browser/languageSurveys.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..52ab1590ed236e827ff4b9592920b9c14473e85a --- /dev/null +++ b/i18n/chs/src/vs/workbench/parts/surveys/electron-browser/languageSurveys.contribution.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "helpUs": "帮助我们改善对 {0} 的支持", + "takeShortSurvey": "参与小调查", + "remindLater": "稍后提醒", + "neverAgain": "不再显示" +} \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/surveys/electron-browser/nps.contribution.i18n.json b/i18n/chs/src/vs/workbench/parts/surveys/electron-browser/nps.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..36e84d84fb11baf739d7d8ec847bfd623162ebd2 --- /dev/null +++ b/i18n/chs/src/vs/workbench/parts/surveys/electron-browser/nps.contribution.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "surveyQuestion": "您愿意参与一次简短的反馈调查吗?", + "takeSurvey": "参与调查", + "remindLater": "稍后提醒", + "neverAgain": "不再显示" +} \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/tasks/browser/buildQuickOpen.i18n.json b/i18n/chs/src/vs/workbench/parts/tasks/browser/buildQuickOpen.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..4ec9c9da6252952fbc8cde84fa40d8623981d8de --- /dev/null +++ b/i18n/chs/src/vs/workbench/parts/tasks/browser/buildQuickOpen.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "noTasksMatching": "没有匹配的任务" +} \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/tasks/browser/quickOpen.i18n.json b/i18n/chs/src/vs/workbench/parts/tasks/browser/quickOpen.i18n.json index bf5eec2631c96b2aa06d2a2bd1f90d18a5848a7f..8c2a202c0e158c3491dd4b6953822ebefd1b8319 100644 --- a/i18n/chs/src/vs/workbench/parts/tasks/browser/quickOpen.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/tasks/browser/quickOpen.i18n.json @@ -4,5 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "entryAriaLabel": "{0},任务" + "entryAriaLabel": "{0},任务", + "customizeTask": "自定义任务" } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/tasks/browser/testQuickOpen.i18n.json b/i18n/chs/src/vs/workbench/parts/tasks/browser/testQuickOpen.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..5c6969c70d790d7391074722a195ed9f6e68228c --- /dev/null +++ b/i18n/chs/src/vs/workbench/parts/tasks/browser/testQuickOpen.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "noTasksMatching": "没有匹配的任务", + "noTasksFound": "没有找到测试任务" +} \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/tasks/common/taskConfiguration.i18n.json b/i18n/chs/src/vs/workbench/parts/tasks/common/taskConfiguration.i18n.json index 8490e6b190ad6f1c71de0b04813d4e42acadbb30..29d782900adbc9bc8d4a9169d931fcccb125a347 100644 --- a/i18n/chs/src/vs/workbench/parts/tasks/common/taskConfiguration.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/tasks/common/taskConfiguration.i18n.json @@ -5,13 +5,13 @@ // Do not edit this file. It is machine generated. { "ConfigurationParser.invalidCWD": "警告: options.cwd 必须属于字符串类型。正在忽略值 {0}\n", - "ConfigurationParser.noShell": "警告: 仅当在终端中执行任务时支持 shell 配置。", "ConfigurationParser.noargs": "错误: 命令参数必须是字符串数组。提供的值为:\n{0}", + "ConfigurationParser.noShell": "警告: 仅当在终端中执行任务时支持 shell 配置。", "ConfigurationParser.noName": "错误: 声明范围内的问题匹配程序必须具有名称:\n{0}\n", "ConfigurationParser.unknownMatcherKind": "警告: 已定义的问题匹配程序未知。受支持的类型为 string | ProblemMatcher | (string | ProblemMatcher)[]。\n{0}\n", "ConfigurationParser.invalidVaraibleReference": "错误: 无效的 problemMatcher 引用: {0}\n", "ConfigurationParser.noTaskName": "错误: 任务必须提供 taskName 属性。将忽略该任务。\n{0}\n", "taskConfiguration.shellArgs": "警告: 任务“{0}”是 shell 命令,该命令的名称或其中一个参数具有非转义空格。若要确保命令行引用正确,请将参数合并到该命令。", - "taskConfiguration.noCommandOrDependsOn": "错误: 任务“{0}”既不指定命令,也不指定 dependsOn 属性。将忽略该任务。其定义为:\n{1}", + "taskConfiguration.noCommandOrDependsOn": "错误:任务“{0}”既不指定命令,也不指定 dependsOn 属性。将忽略该任务。其定义为:\n{1}", "taskConfiguration.noCommand": "错误: 任务“{0}”未定义命令。将忽略该任务。其定义为:\n{1}" } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/tasks/electron-browser/jsonSchemaCommon.i18n.json b/i18n/chs/src/vs/workbench/parts/tasks/electron-browser/jsonSchemaCommon.i18n.json index 46ce4264dea7ab45bdf14c6850edf17a32d3d386..022342352e6b3b51a025cadd9de35aa852c5c1f5 100644 --- a/i18n/chs/src/vs/workbench/parts/tasks/electron-browser/jsonSchemaCommon.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/tasks/electron-browser/jsonSchemaCommon.i18n.json @@ -7,6 +7,7 @@ "JsonSchema.options": "其他命令选项", "JsonSchema.options.cwd": "已执行程序或脚本的当前工作目录。如果省略,则使用代码的当前工作区根。", "JsonSchema.options.env": "已执行程序或 shell 的环境。如果省略,则使用父进程的环境。", + "JsonSchema.shellConfiguration": "配置使用的 shell。", "JsonSchema.shell.executable": "待使用的 shell。", "JsonSchema.shell.args": "shell 参数。", "JsonSchema.command": "要执行的命令。可以是外部程序或 shell 命令。", diff --git a/i18n/chs/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v1.i18n.json b/i18n/chs/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v1.i18n.json index 739af6ee7d5044079b960f0db1cb6b5be5325c9d..f4f41e4b5fc90ba88177742d99a3e8faa66b47e4 100644 --- a/i18n/chs/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v1.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v1.i18n.json @@ -5,6 +5,8 @@ // Do not edit this file. It is machine generated. { "JsonSchema.version": "配置的版本号", + "JsonSchema._runner": "此 runner 已完成使命。请使用官方 runner 属性", + "JsonSchema.runner": "定义任务是否作为进程执行,输出显示在输出窗口还是在终端内。", "JsonSchema.windows": "Windows 特定的命令配置", "JsonSchema.mac": "Mac 特定的命令配置", "JsonSchema.linux": "Linux 特定的命令配置", diff --git a/i18n/chs/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.i18n.json b/i18n/chs/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.i18n.json index 4106097a93e42d791a4ac07a025dcb7c69deaf2d..17f745a96983632b32e132695a1f16c7d6fa8343 100644 --- a/i18n/chs/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.i18n.json @@ -4,11 +4,14 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "JsonSchema.version": "配置的版本号", - "JsonSchema.windows": "Windows 特定的命令配置", - "JsonSchema.mac": "Mac 特定的命令配置", - "JsonSchema.linux": "Linux 特定的命令配置", "JsonSchema.shell": "指定命令是 shell 命令还是外部程序。如果省略,默认值是 false。", "JsonSchema.tasks.dependsOn.string": "此任务依赖的另一任务。", - "JsonSchema.tasks.dependsOn.array": "此任务依赖的其他任务。" + "JsonSchema.tasks.dependsOn.array": "此任务依赖的其他任务。", + "JsonSchema.tasks.group": "定义此任务属于的执行组。如被省略,则此任务不属于任何组。", + "JsonSchema.tasks.type": "定义任务是被作为进程运行还是在 shell 中作为命令运行。默认作为进程运行。", + "JsonSchema.version": "配置的版本号。", + "JsonSchema.tasks.customize": "要自定义的提供的视图。", + "JsonSchema.windows": "Windows 特定的命令配置", + "JsonSchema.mac": "Mac 特定的命令配置", + "JsonSchema.linux": "Linux 特定的命令配置" } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json b/i18n/chs/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json index e8ff5a94c0b10eea7ba8804fe44905526ae4a8e7..5fc4616ea4757fa362e81398a0f864565eb5fe97 100644 --- a/i18n/chs/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json @@ -22,7 +22,8 @@ "TaskService.noBuildTask": "未定义任何生成任务。使用 \"isBuildCommand\" 在 tasks.json 文件中标记任务。", "TaskService.noTestTask": "未定义任何测试任务。使用 \"isTestCommand\" 在 tasks.json 文件中标记任务。", "TaskServer.noTask": "未找到要执行的请求任务 {0}。", - "TaskSystem.activeSame": "任务已处于活动状态并处于监视模式。若要终止任务,请使用 \"F1\" >“终止任务”", + "customizeParseErrors": "当前任务配置存在错误。请先更正错误,再自定义任务。", + "moreThanOneBuildTask": "当前 tasks.json 中定义了多个生成任务。正在执行第一个。\n", "TaskSystem.active": "当前已有任务正在运行。请先终止它,然后再执行另一项任务。", "TaskSystem.restartFailed": "未能终止并重启任务 {0}", "TaskSystem.configurationErrors": "错误: 提供的任务配置具有验证错误,无法使用。请首先改正错误。", @@ -43,5 +44,7 @@ "TestAction.label": "运行测试任务", "quickOpen.task": "运行任务", "quickOpen.terminateTask": "终止任务(&&T)", - "quickOpen.restartTask": "重启任务" + "quickOpen.restartTask": "重启任务", + "quickOpen.buildTask": "生成任务", + "quickOpen.testTask": "测试任务" } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.i18n.json b/i18n/chs/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.i18n.json index 2132313f0b6841bd3771bb6702e4373321e2f324..007d5c51e4a65772780f126b0eb8c5d058490c27 100644 --- a/i18n/chs/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.i18n.json @@ -6,5 +6,7 @@ { "TerminalTaskSystem.unknownError": "在执行任务时发生未知错误。请参见任务输出日志了解详细信息。", "TerminalTaskSystem.terminalName": "任务 - {0}", - "TerminalTaskSystem": "无法对 UNC 驱动器执行 shell 命令。" + "reuseTerminal": "终端将被任务重用,按任意键关闭。", + "TerminalTaskSystem": "无法对 UNC 驱动器执行 shell 命令。", + "unkownProblemMatcher": "无法解析问题匹配程序 {0}。此匹配程序将被忽略" } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/tasks/node/processTaskSystem.i18n.json b/i18n/chs/src/vs/workbench/parts/tasks/node/processTaskSystem.i18n.json index aa659de1014f065dc399a49d246968aee5bb701e..5b8a86d9c21b1ea41cb32d8f6ead7da259b7d943 100644 --- a/i18n/chs/src/vs/workbench/parts/tasks/node/processTaskSystem.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/tasks/node/processTaskSystem.i18n.json @@ -7,5 +7,6 @@ "TaskRunnerSystem.unknownError": "在执行任务时发生未知错误。请参见任务输出日志了解详细信息。", "TaskRunnerSystem.watchingBuildTaskFinished": "\n监视生成任务已完成", "TaskRunnerSystem.childProcessError": "Failed to launch external program {0} {1}.", - "TaskRunnerSystem.cancelRequested": "\n已根据用户请求终止了任务'{0}' " + "TaskRunnerSystem.cancelRequested": "\n已根据用户请求终止了任务'{0}' ", + "unkownProblemMatcher": "无法解析问题匹配程序 {0}。此匹配程序将被忽略" } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/terminal/electron-browser/terminalActions.i18n.json b/i18n/chs/src/vs/workbench/parts/terminal/electron-browser/terminalActions.i18n.json index 3b09b277be3c4d4b77ee744b7466ba212c35a60b..c8746db7afb2f9dede27bb908bf2db91ff4b46aa 100644 --- a/i18n/chs/src/vs/workbench/parts/terminal/electron-browser/terminalActions.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/terminal/electron-browser/terminalActions.i18n.json @@ -8,6 +8,7 @@ "workbench.action.terminal.kill": "终止活动终端实例", "workbench.action.terminal.kill.short": "终止终端", "workbench.action.terminal.copySelection": "复制所选内容", + "workbench.action.terminal.selectAll": "全选", "workbench.action.terminal.new": "新建集成终端", "workbench.action.terminal.new.short": "新的终端", "workbench.action.terminal.focus": "聚焦于终端", @@ -28,5 +29,9 @@ "workbench.action.terminal.scrollToTop": "滚动到顶部", "workbench.action.terminal.clear": "清除", "workbench.action.terminal.allowWorkspaceShell": "允许配置工作区 Shell", - "workbench.action.terminal.disallowWorkspaceShell": "禁止配置工作区 Shell" + "workbench.action.terminal.disallowWorkspaceShell": "禁止配置工作区 Shell", + "workbench.action.terminal.rename": "重命名", + "workbench.action.terminal.rename.prompt": "输入终端名称", + "workbench.action.terminal.focusFindWidget": "聚焦于查找小组件", + "workbench.action.terminal.hideFindWidget": "隐藏查找小组件" } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/terminal/electron-browser/terminalFindWidget.i18n.json b/i18n/chs/src/vs/workbench/parts/terminal/electron-browser/terminalFindWidget.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..d650d2c5ce6539a9f4234c9535cf2f2e5150a00a --- /dev/null +++ b/i18n/chs/src/vs/workbench/parts/terminal/electron-browser/terminalFindWidget.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "label.find": "查找", + "placeholder.find": "查找", + "label.previousMatchButton": "上一个匹配", + "label.nextMatchButton": "下一个匹配", + "label.closeButton": "关闭" +} \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.i18n.json b/i18n/chs/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.i18n.json index 968bdf8f6a5bfc1501e937c73ec3305ba79cd8ee..c6e31e6ba8bdc49bf3196b4e59f697043634b367 100644 --- a/i18n/chs/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.i18n.json @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "terminal.integrated.copySelection.noSelection": "当终端没有位于焦点时无法复制终端选定内容", "terminal.integrated.exitedWithCode": "通过退出代码 {0} 终止的终端进程", "terminal.integrated.waitOnExit": "按任意键以关闭终端", "terminal.integrated.launchFailed": "终端进程命令“{0} {1}”无法启动(退出代码: {2})" diff --git a/i18n/chs/src/vs/workbench/parts/update/electron-browser/update.i18n.json b/i18n/chs/src/vs/workbench/parts/update/electron-browser/update.i18n.json index 458a66e47a2066eaeccf2b7f70ff304343f20ab8..254f11cdeffabc477abcc785ef99db017fa2b683 100644 --- a/i18n/chs/src/vs/workbench/parts/update/electron-browser/update.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/update/electron-browser/update.i18n.json @@ -15,5 +15,18 @@ "license": "读取许可证", "updateAvailable": "{0} 将在重启后更新。", "thereIsUpdateAvailable": "存在可用更新。", - "noUpdatesAvailable": "当前没有可用的更新。" + "noUpdatesAvailable": "当前没有可用的更新。", + "updateIsReady": "有新更新可用。", + "commandPalette": "命令面板...", + "settings": "设置", + "keyboardShortcuts": "键盘快捷方式", + "selectTheme.label": "颜色主题", + "themes.selectIconTheme.label": "文件图标主题", + "not available": "更新不可用", + "checkingForUpdates": "正在检查更新...", + "DownloadUpdate": "下载可用更新", + "DownloadingUpdate": "正在下载更新...", + "InstallingUpdate": "正在安装更新...", + "restartToUpdate": "重启以更新...", + "checkForUpdates": "检查更新..." } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/views/browser/views.i18n.json b/i18n/chs/src/vs/workbench/parts/views/browser/views.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..08ebcb29e969b48f11198f1a91bc18128a416ba3 --- /dev/null +++ b/i18n/chs/src/vs/workbench/parts/views/browser/views.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "viewToolbarAriaLabel": "{0} 操作" +} \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/views/browser/viewsExtensionPoint.i18n.json b/i18n/chs/src/vs/workbench/parts/views/browser/viewsExtensionPoint.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..c013ce2e6be284abc393a51f50c86f384adb3994 --- /dev/null +++ b/i18n/chs/src/vs/workbench/parts/views/browser/viewsExtensionPoint.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "requirearray": "视图必须为数组", + "requirestring": "属性“{0}”是必需的,其类型必须是“string”", + "optstring": "属性“{0}”可以省略,否则其类型必须是 \"string\"", + "vscode.extension.contributes.view.id": "视图的标识符。使用标识符通过“vscode.window.registerTreeDataProviderForView” API 注册数据提供程序。同时将“onView:${id}”事件注册到“activationEvents”以激活你的扩展。", + "vscode.extension.contributes.view.name": "人类可读的视图名称。将会被显示", + "vscode.extension.contributes.views": "向编辑器提供视图", + "views.explorer": "资源管理器视图", + "locationId.invalid": "“{0}”为无效视图位置" +} \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/watermark/electron-browser/watermark.i18n.json b/i18n/chs/src/vs/workbench/parts/watermark/electron-browser/watermark.i18n.json index 082e49f08bc47177c745e04f1172c28d60b3e77e..076dd52ebbba19b1a2c7e6bc37369a0968ce5b37 100644 --- a/i18n/chs/src/vs/workbench/parts/watermark/electron-browser/watermark.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/watermark/electron-browser/watermark.i18n.json @@ -17,7 +17,7 @@ "watermark.selectTheme": "更改主题", "watermark.selectKeymap": "更改键映射", "watermark.keybindingsReference": "键盘参考", - "watermark.openGlobalKeybindings": "键盘快捷键", + "watermark.openGlobalKeybindings": "键盘快捷方式(&&K)", "watermark.unboundCommand": "未绑定", "workbenchConfigurationTitle": "工作台", "tips.enabled": "启用后,当没有打开编辑器时将显示水印提示。" diff --git a/i18n/chs/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json b/i18n/chs/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json index 3b9d1ffa9caa854f31867a9db1da4e25afcb6efe..efc4346e6342a64ced15d8048b7485c55969e211 100644 --- a/i18n/chs/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json @@ -9,24 +9,28 @@ "welcomePage.start": "开始", "welcomePage.newFile": "新建文件", "welcomePage.openFolder": "打开文件夹...", - "welcomePage.cloneGitRepository": "克隆 GIT 存储库...", + "welcomePage.cloneGitRepository": "克隆 Git 存储库...", "welcomePage.recent": "最近", "welcomePage.moreRecent": "更多...", "welcomePage.noRecentFolders": "无最近使用文件夹", "welcomePage.help": "帮助", + "welcomePage.keybindingsCheatsheet": "可打印的键盘速查表", "welcomePage.introductoryVideos": "入门视频", "welcomePage.productDocumentation": "产品文档", "welcomePage.gitHubRepository": "GitHub 存储库", "welcomePage.stackOverflow": "Stack Overflow", "welcomePage.showOnStartup": "启动时显示欢迎页", "welcomePage.customize": "自定义", + "welcomePage.installExtensionPacks": "工具和语言", + "welcomePage.installExtensionPacksDescription": "安装对 {0} 和 {1} 的支持", + "welcomePage.moreExtensions": "更多", "welcomePage.installKeymapDescription": "安装键盘快捷方式", + "welcomePage.installKeymapExtension": "安装 {0} 和 {1} 的键盘快捷方式", "welcomePage.others": "其他", "welcomePage.colorTheme": "颜色主题", "welcomePage.colorThemeDescription": "使编辑器和代码呈现你喜欢的外观", "welcomePage.learn": "学习", "welcomePage.showCommands": "查找并运行所有命令", - "welcomePage.showCommandsDescription": "从控制面板快速访问并搜索命令({0})", "welcomePage.interfaceOverview": "界面概述", "welcomePage.interfaceOverviewDescription": "查看突出显示主要 UI 组件的叠加图", "welcomePage.interactivePlayground": "交互式演练场", diff --git a/i18n/chs/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.contribution.i18n.json b/i18n/chs/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.contribution.i18n.json index 9df0fba85871c0bd9fccab3f27effa12d01d3cbe..f98f5d0208ef4ef9c5976ead883602dcf4c6b2f4 100644 --- a/i18n/chs/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.contribution.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.contribution.i18n.json @@ -4,7 +4,5 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "workbenchConfigurationTitle": "工作台", - "welcomePage.enabled": "启用后,将在启动时显示欢迎页。", "help": "帮助" } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json b/i18n/chs/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json index de7e3aa24d5770843d6c917791b9f4537e68e380..6180f4d0d5bdde6701906fdc531287521ddf92bb 100644 --- a/i18n/chs/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json +++ b/i18n/chs/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json @@ -4,14 +4,35 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "workbenchConfigurationTitle": "工作台", + "welcomePage.enabled": "启用后,将在启动时显示欢迎页。", "welcomePage": "欢迎使用", + "welcomePage.javaScript": "JavaScript", + "welcomePage.typeScript": "TypeScript", + "welcomePage.python": "Python", + "welcomePage.php": "PHP", + "welcomePage.docker": "Docker", + "welcomePage.vim": "Vim", + "welcomePage.sublime": "Sublime", + "welcomePage.atom": "Atom", + "welcomePage.extensionPackAlreadyInstalled": "已安装对 {0} 的支持。", + "welcomePage.willReloadAfterInstallingExtensionPack": "安装对 {0} 的额外支持后,将重载窗口。", + "welcomePage.installingExtensionPack": "正在安装对 {0} 的额外支持...", + "welcomePage.extensionPackNotFound": "找不到对 {0} (ID: {1}) 的支持。", "welcomePage.keymapAlreadyInstalled": "已安装 {0} 键盘快捷方式。", "welcomePage.willReloadAfterInstallingKeymap": "安装 {0} 键盘快捷方式后,将重载窗口。", "welcomePage.installingKeymap": "正在安装 {0} 键盘快捷方式...", "welcomePage.keymapNotFound": "找不到 ID 为 {1} 的 {0} 键盘快捷方式。", "welcome.title": "欢迎使用", + "welcomePage.openFolderWithPath": "打开路径为 {1} 的文件夹 {0}", + "welcomePage.extensionListSeparator": "、", + "welcomePage.installKeymap": "安装 {0} 键映射", + "welcomePage.installExtensionPack": "安装对 {0} 的额外支持", + "welcomePage.installedKeymap": "已安装 {0} 键映射", + "welcomePage.installedExtensionPack": "已安装 {0} 支持", "ok": "确定", + "details": "详细信息", "cancel": "取消", - "welcomePage.quickLinkBackground": "欢迎页快速链接的背景颜色。", - "welcomePage.quickLinkHoverBackground": "欢迎页快速链接被悬停时的背景颜色。" + "welcomePage.buttonBackground": "欢迎页按钮的背景色。", + "welcomePage.buttonHoverBackground": "欢迎页按钮被悬停时的背景色。" } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/services/crashReporter/common/crashReporterService.i18n.json b/i18n/chs/src/vs/workbench/services/crashReporter/common/crashReporterService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..0581515bc92d8a826c1301f626865d3b1fdea2f2 --- /dev/null +++ b/i18n/chs/src/vs/workbench/services/crashReporter/common/crashReporterService.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "telemetryConfigurationTitle": "遥测", + "telemetry.enableCrashReporting": "启用要发送给 Microsoft 的故障报表。\n此选项需重启才可生效。" +} \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/services/keybinding/electron-browser/keybindingService.i18n.json b/i18n/chs/src/vs/workbench/services/keybinding/electron-browser/keybindingService.i18n.json index 162baf8c31f901d1e194979944123b3fbd6cdf1c..4d434e9c4c96181b6b1c719bdbe163be7a4df6f4 100644 --- a/i18n/chs/src/vs/workbench/services/keybinding/electron-browser/keybindingService.i18n.json +++ b/i18n/chs/src/vs/workbench/services/keybinding/electron-browser/keybindingService.i18n.json @@ -22,5 +22,5 @@ "keybindings.json.when": "键处于活动状态时的条件。", "keybindings.json.args": "要传递给命令以执行的参数。", "keyboardConfigurationTitle": "键盘", - "dispatch": "控制按键的分派逻辑以使用 \"keydown.code\" (推荐)或 \"eydown.keyCode\"。" + "dispatch": "控制按键的调度逻辑以使用“keydown.code”(推荐) 或“keydown.keyCode”。" } \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/services/progress/browser/progressService2.i18n.json b/i18n/chs/src/vs/workbench/services/progress/browser/progressService2.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..6db7d6aae514a031afce5ac346abfd84bb8ee1cc --- /dev/null +++ b/i18n/chs/src/vs/workbench/services/progress/browser/progressService2.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "progress.text": "{0} - {1}", + "progress.title": "{0}: {1}" +} \ No newline at end of file diff --git a/i18n/chs/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.i18n.json b/i18n/chs/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.i18n.json index 69e35ac02d6351bd7cc51085394583e657d3e816..4abe2dbd4b81aee60e18dae08b602093376a0576 100644 --- a/i18n/chs/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.i18n.json +++ b/i18n/chs/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.i18n.json @@ -14,18 +14,18 @@ "vscode.extension.contributes.iconThemes.label": "UI 中显示的图标主题的标签。", "vscode.extension.contributes.iconThemes.path": "图标主题定义文件的路径。该路径相对于扩展文件夹,通常是 \"./icons/awesome-icon-theme.json\"。", "migration.completed": "已向用户设置添加了新的主题设置。{0} 中可备份。", - "error.cannotloadtheme": "Unable to load {0}: {1}", - "reqarray": "Extension point `{0}` must be an array.", + "error.cannotloadtheme": "无法加载 {0}: {1}", + "reqarray": "扩展点“{0}”必须是一个数组。", "reqpath": "“contributes.{0}.path”中应为字符串。提供的值: {1}", "invalid.path.1": "“contributes.{0}.path”({1})应包含在扩展的文件夹({2})内。这可能会使扩展不可移植。", "reqid": "“contributes.{0}.id”中应为字符串。提供的值: {1}", "error.cannotloadicontheme": "Unable to load {0}", "error.cannotparseicontheme": "Problems parsing file icons file: {0}", - "colorTheme": "Specifies the color theme used in the workbench.", - "colorThemeError": "Theme is unknown or not installed.", - "iconTheme": "Specifies the icon theme used in the workbench.", + "colorTheme": "指定工作台中使用的颜色主题。", + "colorThemeError": "主题未知或未安装。", + "iconTheme": "指定在工作台中使用的图标主题。", "noIconThemeDesc": "No file icons", - "iconThemeError": "File icon theme is unknown or not installed.", + "iconThemeError": "文件图标主题未知或未安装。", "workbenchColors": "覆盖当前所选颜色主题的颜色。", "workbenchColors.deprecated": "该设置不再是实验性设置,并已重命名为“workbench.colorCustomizations”", "workbenchColors.deprecatedDescription": "改用“workbench.colorCustomizations”" diff --git a/i18n/cht/extensions/git/out/commands.i18n.json b/i18n/cht/extensions/git/out/commands.i18n.json index 849277aa8fe490e7ed8ac72bbbefda4c2393520e..ccc4f6c757a6dcf1b770b0de7f4c579ea0f4a5e5 100644 --- a/i18n/cht/extensions/git/out/commands.i18n.json +++ b/i18n/cht/extensions/git/out/commands.i18n.json @@ -26,6 +26,9 @@ "provide commit message": "請提供認可訊息", "branch name": "分支名稱", "provide branch name": "請提供分支名稱", + "select branch to delete": "選擇分支進行刪除", + "confirm force delete branch": "分支 '{0}' 尚未完整合併. 確定刪除嗎?", + "delete branch": "刪除分支", "no remotes to pull": "您的存放庫未設定要提取的來源遠端。", "no remotes to push": "您的存放庫未設定要推送的目標遠端。", "nobranch": "請簽出分支以推送到遠端。", diff --git a/i18n/cht/extensions/git/out/scmProvider.i18n.json b/i18n/cht/extensions/git/out/scmProvider.i18n.json index 7fded37328a95360b0ac60f4e287a4fdbfcaa1ea..e71dab52f4e97c8f176d112fd03d922435f096f2 100644 --- a/i18n/cht/extensions/git/out/scmProvider.i18n.json +++ b/i18n/cht/extensions/git/out/scmProvider.i18n.json @@ -4,5 +4,5 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "commit": "Commit" + "commit": "認可" } \ No newline at end of file diff --git a/i18n/cht/extensions/git/package.i18n.json b/i18n/cht/extensions/git/package.i18n.json index 63f725ec18367042eadb3fa45b5f5fc3f1cb7c03..725f33d871ad3141f711602161ce9c2f898a359e 100644 --- a/i18n/cht/extensions/git/package.i18n.json +++ b/i18n/cht/extensions/git/package.i18n.json @@ -26,12 +26,13 @@ "command.undoCommit": "復原上次認可", "command.checkout": "簽出至...", "command.branch": "建立分支...", + "command.deleteBranch": "刪除分支...", "command.pull": "提取", "command.pullRebase": "提取 (重訂基底)", "command.push": "推送", "command.pushTo": "推送至...", "command.sync": "同步處理", - "command.publish": "發行", + "command.publish": "發行分支", "command.showOutput": "顯示 Git 輸出", "config.enabled": "是否啟用 GIT", "config.path": "Git 可執行檔的路徑", diff --git a/i18n/cht/extensions/jake/out/main.i18n.json b/i18n/cht/extensions/jake/out/main.i18n.json index 8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a..f85adc82182e7f2cbb52070844d975f9f0a15761 100644 --- a/i18n/cht/extensions/jake/out/main.i18n.json +++ b/i18n/cht/extensions/jake/out/main.i18n.json @@ -3,4 +3,6 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. -{} \ No newline at end of file +{ + "execFailed": "Jake 的自動偵測失敗。錯誤: {0}" +} \ No newline at end of file diff --git a/i18n/cht/extensions/jake/package.i18n.json b/i18n/cht/extensions/jake/package.i18n.json index 8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a..ee533577d07134cf72ce644b56b7772b23122359 100644 --- a/i18n/cht/extensions/jake/package.i18n.json +++ b/i18n/cht/extensions/jake/package.i18n.json @@ -3,4 +3,6 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. -{} \ No newline at end of file +{ + "config.jake.autoDetect": "控制 Jake 工作的自動偵測為開啟或關閉。預設為開。" +} \ No newline at end of file diff --git a/i18n/cht/extensions/markdown/out/extension.i18n.json b/i18n/cht/extensions/markdown/out/extension.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..f8b580fc8f0708dfffeb51ab35e950f4fa65e222 --- /dev/null +++ b/i18n/cht/extensions/markdown/out/extension.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "onPreviewStyleLoadError": "無法載入 ‘markdown.style' 樣式:{0}" +} \ No newline at end of file diff --git a/i18n/cht/extensions/merge-conflict/out/codelensProvider.i18n.json b/i18n/cht/extensions/merge-conflict/out/codelensProvider.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..fd3fc4ee5125c234529dbf7fd4b2c78f214c2f35 --- /dev/null +++ b/i18n/cht/extensions/merge-conflict/out/codelensProvider.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "acceptCurrentChange": "接受當前變更", + "acceptIncomingChange": "接受來源變更", + "acceptBothChanges": "接受兩者變更", + "compareChanges": "比較變更" +} \ No newline at end of file diff --git a/i18n/cht/extensions/merge-conflict/out/commandHandler.i18n.json b/i18n/cht/extensions/merge-conflict/out/commandHandler.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..a82efe04f8a999e846f790c94ed9901778357238 --- /dev/null +++ b/i18n/cht/extensions/merge-conflict/out/commandHandler.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "cursorNotInConflict": "編輯器游標不在衝突合併範圍之內", + "compareChangesTitle": "{0}: 當前變更⟷來源變更", + "cursorOnSplitterRange": "編輯器游標在衝突合併工具範圍內,請移動至\"當前項目\"或來源項目\"區塊", + "noConflicts": "檔案內找不到需要合併衝突項目", + "noOtherConflictsInThisFile": "此檔案內沒有其他的衝突合併項目" +} \ No newline at end of file diff --git a/i18n/cht/extensions/merge-conflict/out/mergeDecorator.i18n.json b/i18n/cht/extensions/merge-conflict/out/mergeDecorator.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..1282a1b3de3affe6411103e2bcaaf329bb07e345 --- /dev/null +++ b/i18n/cht/extensions/merge-conflict/out/mergeDecorator.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "currentChange": "(目前變更)", + "incomingChange": "(來源變更)" +} \ No newline at end of file diff --git a/i18n/cht/extensions/merge-conflict/package.i18n.json b/i18n/cht/extensions/merge-conflict/package.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..21711a0ff32115fc4fb8daba791304411b135a15 --- /dev/null +++ b/i18n/cht/extensions/merge-conflict/package.i18n.json @@ -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. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "command.category": "合併衝突", + "command.accept.all-incoming": "接受所有來源", + "command.accept.all-both": "接受兩者所有項目", + "command.accept.current": "接受當前項目", + "command.accept.incoming": "接受來源項目", + "command.accept.selection": "接受選取項目", + "command.accept.both": "接受兩者", + "command.next": "下一個衝突", + "command.previous": "前一個衝突", + "command.compare": "比較目前衝突", + "config.title": "合併衝突", + "config.codeLensEnabled": "啟用/停用 編輯器CodeLens衝突合併 ", + "config.decoratorsEnabled": "啟用/停用 編輯器衝突合併色彩裝飾" +} \ No newline at end of file diff --git a/i18n/cht/extensions/npm/package.i18n.json b/i18n/cht/extensions/npm/package.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..74cbc6cffe4b82151105822fcca16e895e57e623 --- /dev/null +++ b/i18n/cht/extensions/npm/package.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "config.npm.autoDetect": "控制是否自動檢測npm腳本.預設為開啟." +} \ No newline at end of file diff --git a/i18n/cht/extensions/typescript/out/features/bufferSyncSupport.i18n.json b/i18n/cht/extensions/typescript/out/features/bufferSyncSupport.i18n.json index 94c3eb2b5b915e2fd97c9a72d2ea328507a1dd11..8d73858cf4f5e9c1a50e7174961e685e679df2d9 100644 --- a/i18n/cht/extensions/typescript/out/features/bufferSyncSupport.i18n.json +++ b/i18n/cht/extensions/typescript/out/features/bufferSyncSupport.i18n.json @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "versionMismatch": "版本不符! 全域 TSC ({0}) != VS Code 的語言服務 ({1})。可能會發生編譯不一致的錯誤", "moreInformation": "詳細資訊", "doNotCheckAgain": "不要再檢查", "close": "關閉", diff --git a/i18n/cht/extensions/typescript/out/features/directiveCommentCompletionProvider.i18n.json b/i18n/cht/extensions/typescript/out/features/directiveCommentCompletionProvider.i18n.json index 8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a..19b6338186e4b7f1502869a526760a56c6650084 100644 --- a/i18n/cht/extensions/typescript/out/features/directiveCommentCompletionProvider.i18n.json +++ b/i18n/cht/extensions/typescript/out/features/directiveCommentCompletionProvider.i18n.json @@ -3,4 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. -{} \ No newline at end of file +{ + "ts-check": "啟用 JavaScript 檔案的語意檢查。必須在檔案的最上面。", + "ts-nocheck": "停用 JavaScript 檔案的語意檢查。必須在檔案的最上面。", + "ts-ignore": "隱藏下一行@ts-check 的錯誤警告。" +} \ No newline at end of file diff --git a/i18n/cht/extensions/typescript/out/utils/projectStatus.i18n.json b/i18n/cht/extensions/typescript/out/utils/projectStatus.i18n.json index bfe9d8300ece657f5343fdc0f025627dee24f202..3c39220ae532e2cdcd9d4e12f6ac41c885ff9d31 100644 --- a/i18n/cht/extensions/typescript/out/utils/projectStatus.i18n.json +++ b/i18n/cht/extensions/typescript/out/utils/projectStatus.i18n.json @@ -6,7 +6,6 @@ { "hintExclude": "若要讓整個專案都能使用 JavaScript/TypeScript 語言功能,請排除內含許多檔案的資料夾,例如: {0}", "hintExclude.generic": "若要讓整個專案都能使用 JavaScript/TypeScript 語言功能,請排除內含您未使用之來源檔案的大型資料夾。", - "open": "設定排除項目", "large.label": "設定排除項目", "hintExclude.tooltip": "若要讓整個專案都能使用 JavaScript/TypeScript 語言功能,請排除內含您未使用之來源檔案的大型資料夾。" } \ No newline at end of file diff --git a/i18n/cht/extensions/typescript/out/utils/typingsStatus.i18n.json b/i18n/cht/extensions/typescript/out/utils/typingsStatus.i18n.json index 1c4d07bd74611c61815adcf53a1f18b9441efc1b..d487fd639bc0869ece371d3a1f5e8deba634504c 100644 --- a/i18n/cht/extensions/typescript/out/utils/typingsStatus.i18n.json +++ b/i18n/cht/extensions/typescript/out/utils/typingsStatus.i18n.json @@ -5,7 +5,7 @@ // Do not edit this file. It is machine generated. { "installingPackages": "正在擷取資料以改善 TypeScript IntelliSense", - "typesInstallerInitializationFailed.title": "無法安裝鍵入檔案以取得 JavaScript 語言功能。請確認 NPM 已安裝,且位於您的 PATH", + "typesInstallerInitializationFailed.title": "無法安裝typings檔案Javascript語言功能,請確認NPM是否已安裝且配置'typescript.npm'", "typesInstallerInitializationFailed.moreInformation": "詳細資訊", "typesInstallerInitializationFailed.doNotCheckAgain": "不要再檢查", "typesInstallerInitializationFailed.close": "關閉" diff --git a/i18n/cht/extensions/typescript/package.i18n.json b/i18n/cht/extensions/typescript/package.i18n.json index 316f057d5a8b1d27187204e338c007f9f3be8289..349b5b0321526a01dbc7cfc5529367aea4f2b3b0 100644 --- a/i18n/cht/extensions/typescript/package.i18n.json +++ b/i18n/cht/extensions/typescript/package.i18n.json @@ -13,7 +13,6 @@ "typescript.check.tscVersion": "請檢查全域安裝 TypeScript 編譯器 (例如 tsc) 是否不同於使用的 TypeScript 語言服務。", "typescript.tsserver.log": "允許 TS 伺服器記錄到檔案。此記錄可用來診斷 TS 伺服器問題。記錄可能包含檔案路徑、原始程式碼及您專案中可能具有敏感性的其他資訊。", "typescript.tsserver.trace": "允許將訊息追蹤傳送到 TS 伺服器。此追蹤可用來診斷 TS 伺服器問題。追蹤可能包含檔案路徑、原始程式碼及您專案中可能具有敏感性的其他資訊。", - "typescript.tsserver.experimentalAutoBuild": "啟用實驗性自動建置。需要 1.9 dev 或 2.x tsserver 版本,且在變更後必須重新啟動 VS Code。", "typescript.validate.enable": "啟用/停用 TypeScript 驗證。", "typescript.format.enable": "啟用/停用預設 TypeScript 格式器。", "javascript.format.enable": "啟用/停用預設 JavaScript 格式器。", @@ -33,10 +32,16 @@ "javascript.validate.enable": "啟用/停用 JavaScript 驗證。", "typescript.goToProjectConfig.title": "移至專案組態", "javascript.goToProjectConfig.title": "移至專案組態", + "javascript.referencesCodeLens.enabled": "在JavaScript檔案啟用/停用 參考CodeLens ", + "typescript.referencesCodeLens.enabled": "在TypeScript檔案啟用/停用CodeLens參考。需要TypeScript>=2.0.6。", "typescript.implementationsCodeLens.enabled": "啟用/停用實作 CodeLens。需要 TypeScript >= 2.2.0。", "typescript.openTsServerLog.title": "開啟 TS 伺服器記錄", + "typescript.restartTsServer": "重新啟動TS伺服器", "typescript.selectTypeScriptVersion.title": "選取 TypeScript 版本", "jsDocCompletion.enabled": "啟用/停用自動 JSDoc 註解", "javascript.implicitProjectConfig.checkJs": "啟用/停用 JavaScript 檔案的語意檢查。現有的 jsconfig.json 或 tsconfig.json 檔案會覆寫此設定。需要 TypeScript >=2.3.1。", - "typescript.check.npmIsInstalled": "檢查是否已安裝 NPM,以取得自動鍵入" + "typescript.npm": "指定用於自動類型取得的 NPM 可執行檔路徑。TypeScript 必須 >= 2.3.4.", + "typescript.check.npmIsInstalled": "檢查是否已安裝NPM用以取得自動類型擷取.", + "javascript.nameSuggestions": "從JavaScript推薦表檔案中啟用/停用包含唯一檔名", + "typescript.tsc.autoDetect": "控制 tsc 工作的自動偵測為開啟或關閉。" } \ No newline at end of file diff --git a/i18n/cht/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json b/i18n/cht/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json index da6b8c6d2c009e57e88c77a766fbf0909cee8869..a88561eebdeaffebb9b71c10a1acb9282bee765a 100644 --- a/i18n/cht/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json +++ b/i18n/cht/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json @@ -6,8 +6,7 @@ { "imgMeta": "{0}x{1} {2}", "largeImageError": "因為影像太大,所以無法在編輯器中顯示。", - "resourceOpenExternalButton": "開啟影像", - "resourceOpenExternalText": " 要使用外部程式嗎?", + "resourceOpenExternalButton": "要使用外部程式打開影像嗎?", "nativeBinaryError": "檔案為二進位檔、非常大或使用不支援的文字編碼,因此將不會顯示於編輯器中。", "sizeB": "{0}B", "sizeKB": "{0}KB", diff --git a/i18n/cht/src/vs/base/common/errorMessage.i18n.json b/i18n/cht/src/vs/base/common/errorMessage.i18n.json index 0ff1888b74e0cc8bb9d7c71aa5732326e9236095..693f35b5cc0ce57fa9c72909793dbca7115288fc 100644 --- a/i18n/cht/src/vs/base/common/errorMessage.i18n.json +++ b/i18n/cht/src/vs/base/common/errorMessage.i18n.json @@ -13,6 +13,5 @@ "error.connection.unknown": "發生未知的連接錯誤。可能是您已經沒有連線到網際網路,或是您連接的伺服器已離線。", "stackTrace.format": "{0}: {1}", "error.defaultMessage": "發生未知的錯誤。如需詳細資訊,請參閱記錄檔。", - "nodeExceptionMessage": "發生系統錯誤 ({0})", "error.moreErrors": "{0} (總計 {1} 個錯誤)" } \ No newline at end of file diff --git a/i18n/cht/src/vs/base/common/jsonErrorMessages.i18n.json b/i18n/cht/src/vs/base/common/jsonErrorMessages.i18n.json index a131a45e657ffffabee314ca0ae3edc79022de19..5259c9207ad87de788aba456b9aee874430534ed 100644 --- a/i18n/cht/src/vs/base/common/jsonErrorMessages.i18n.json +++ b/i18n/cht/src/vs/base/common/jsonErrorMessages.i18n.json @@ -4,13 +4,13 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "error.invalidSymbol": "符號無效", - "error.invalidNumberFormat": "數字格式無效", - "error.propertyNameExpected": "必須有屬性名稱", + "error.invalidSymbol": "無效符號", + "error.invalidNumberFormat": "無效的數字格式", + "error.propertyNameExpected": "須有屬性名稱", "error.valueExpected": "必須有值", - "error.colonExpected": "必須為冒號", - "error.commaExpected": "必須為逗號", + "error.colonExpected": "必須有冒號", + "error.commaExpected": "必須有逗號", "error.closeBraceExpected": "必須為右大括號", "error.closeBracketExpected": "必須為右中括號", - "error.endOfFileExpected": "必須為檔案結尾" + "error.endOfFileExpected": "必須有檔案結尾" } \ No newline at end of file diff --git a/i18n/cht/src/vs/base/common/keybindingLabels.i18n.json b/i18n/cht/src/vs/base/common/keybindingLabels.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a --- /dev/null +++ b/i18n/cht/src/vs/base/common/keybindingLabels.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{} \ No newline at end of file diff --git a/i18n/cht/src/vs/code/electron-main/menus.i18n.json b/i18n/cht/src/vs/code/electron-main/menus.i18n.json index a1fa3f356ddeb5a5bc3a7a8f8c8ee4f181d73db9..097fbdb72500962212cea075c3077459bd50589d 100644 --- a/i18n/cht/src/vs/code/electron-main/menus.i18n.json +++ b/i18n/cht/src/vs/code/electron-main/menus.i18n.json @@ -14,6 +14,7 @@ "mHelp": "說明 (&&H)", "miNewWindow": "開新視窗(&&W)", "mAbout": "關於 {0}", + "mServices": "服務", "mHide": "隱藏 {0}", "mHideOthers": "隱藏其他", "mShowAll": "全部顯示", @@ -54,6 +55,9 @@ "miShowEmmetCommands": "Emmet(&&M)...", "miToggleLineComment": "切換行註解(&&T)", "miToggleBlockComment": "切換區塊註解(&&B)", + "miMultiCursorAlt": "透過 Alt+ 按一下啟用多重游標", + "miMultiCursorCmd": "透過 Cmdt+ 按一下啟用多重游標", + "miMultiCursorCtrl": "透過 Ctrl+ 按一下啟用多重游標", "miInsertCursorAbove": "在上方新增游標(&&A)", "miInsertCursorBelow": "在下方新增游標(&&D)", "miInsertCursorAtEndOfEachLineSelected": "在行尾新增游標(&&U)", @@ -69,6 +73,7 @@ "miSmartSelectShrink": "壓縮選取範圍(&&S)", "miViewExplorer": "檔案總管(&&E)", "miViewSearch": "搜尋(&&S)", + "miViewSCM": "SCM", "miViewDebug": "偵錯 (&&D)", "miViewExtensions": "擴充功能(&&X)", "miToggleOutput": "輸出(&&O)", @@ -113,6 +118,8 @@ "miGotoSymbolInFile": "前往檔案中的符號(&&S)...", "miGotoSymbolInWorkspace": "前往工作區中的符號(&&W)...", "miGotoDefinition": "移至定義(&&D)", + "miGotoTypeDefinition": "移至類型定義(&&T)", + "miGotoImplementation": "前往實作(&&I)", "miGotoLine": "移至行(&&L)...", "miStartDebugging": "啟動偵錯(&&S)", "miStartWithoutDebugging": "只啟動但不偵錯(&&W)", @@ -129,16 +136,17 @@ "miColumnBreakpoint": "資料行中斷點(&&O)", "miFunctionBreakpoint": "函式中斷點(&&F}...", "miNewBreakpoint": "新增中斷點(&&N)", + "miEnableAllBreakpoints": "啟用所有中斷點", "miDisableAllBreakpoints": "停用所有中斷點(&&L)", "miRemoveAllBreakpoints": "移除所有中斷點(&&R)", "miInstallAdditionalDebuggers": "安裝其他偵錯工具(&&I)...", "mMinimize": "最小化", - "mClose": "關閉", "mBringToFront": "全部提到最上層", "miToggleDevTools": "切換開發人員工具(&&T)", "miAccessibilityOptions": "協助工具選項(&&O)", "miReportIssues": "回報問題(&&I)", "miWelcome": "歡迎使用(&&W)", + "miInteractivePlayground": "Interactive Playground(&&I)", "miDocumentation": "文件(&&D)", "miReleaseNotes": "版本資訊(&&R)", "miKeyboardShortcuts": "鍵盤快速鍵參考(&&K)", @@ -148,12 +156,14 @@ "miLicense": "檢視授權(&&L)", "miPrivacyStatement": "隱私權聲明(&&P)", "miAbout": "關於(&&A)", + "miTerminateTask": "終止工作(&&T)", + "accessibilityOptionsWindowTitle": "協助工具選項", "miRestartToUpdate": "重新啟動以更新...", "miCheckingForUpdates": "正在查看是否有更新...", "miDownloadUpdate": "下載可用更新", "miDownloadingUpdate": "正在下載更新...", "miInstallingUpdate": "正在安裝更新...", - "miCheckForUpdates": "查看是否有更新...", + "miCheckForUpdates": "查看是否有更新", "aboutDetail": "\n版本 {0}\n認可 {1}\n日期 {2}\nShell {3}\n轉譯器 {4}\nNode {5}", "okButton": "確定" } \ No newline at end of file diff --git a/i18n/cht/src/vs/code/electron-main/windows.i18n.json b/i18n/cht/src/vs/code/electron-main/windows.i18n.json index 1a51baff5db5cbb4b6594dcacdc8e1866702f90c..fe29d0fb035ae7d700a446e092daffcc62be3335 100644 --- a/i18n/cht/src/vs/code/electron-main/windows.i18n.json +++ b/i18n/cht/src/vs/code/electron-main/windows.i18n.json @@ -7,16 +7,11 @@ "ok": "確定", "pathNotExistTitle": "路徑不存在", "pathNotExistDetail": "磁碟上似乎已沒有路徑 '{0}'。", - "accessibilityOptionsWindowTitle": "協助工具選項", "reopen": "重新開啟", "wait": "繼續等候", "close": "關閉", "appStalled": "視窗已沒有回應", "appStalledDetail": "您可以重新開啟或關閉視窗,或是繼續等候。", "appCrashed": "視窗已損毀", - "appCrashedDetail": "很抱歉造成您的不便! 您可以重新開啟視窗,從您離開的地方繼續進行。", - "newWindow": "開新視窗", - "newWindowDesc": "開啟新視窗", - "recentFolders": "最近使用的資料夾", - "folderDesc": "{0} {1}" + "appCrashedDetail": "很抱歉造成您的不便! 您可以重新開啟視窗,從您離開的地方繼續進行。" } \ No newline at end of file diff --git a/i18n/cht/src/vs/editor/common/config/commonEditorConfig.i18n.json b/i18n/cht/src/vs/editor/common/config/commonEditorConfig.i18n.json index ec8f05fe3403e008de868daacca4b9296aaa894b..23812d4eed80ed07041ee0adecdd75539b13f424 100644 --- a/i18n/cht/src/vs/editor/common/config/commonEditorConfig.i18n.json +++ b/i18n/cht/src/vs/editor/common/config/commonEditorConfig.i18n.json @@ -9,6 +9,7 @@ "fontWeight": "控制字型寬度。", "fontSize": "控制字型大小 (以像素為單位)。", "lineHeight": "控制行高。使用 0 會從 fontSize 計算 lineHeight。", + "letterSpacing": "控制字元間距 (以像素為單位)", "lineNumbers": "控制行號顯示。可能的值有 'on'、'off' 及 'relative'。'relative' 會從目前的資料指標位置顯示行數。", "rulers": "要在其中顯示垂直尺規的資料行", "wordSeparators": "執行文字相關導覽或作業時將作為文字分隔符號的字元", @@ -22,6 +23,8 @@ "minimap.enabled": "控制是否會顯示迷你地圖", "minimap.renderCharacters": "呈現行內的實際字元 (而不是彩色區塊)", "minimap.maxColumn": "限制迷你地圖的寬度,以呈現最多的資料行", + "find.seedSearchStringFromSelection": "控制編譯器選取範圍是否預設為尋找工具的搜尋字串", + "find.autoFindInSelection": "控制編譯器內選取多字元或多行內文是否開啟選取範圍尋找功能", "wordWrap.off": "一律不換行。", "wordWrap.on": "依檢視區寬度換行。", "wordWrap.wordWrapColumn": "於 'editor.wordWrapColumn' 換行。", @@ -30,17 +33,19 @@ "wordWrapColumn": "當 `editor.wordWrap` 為 [wordWrapColumn] 或 [bounded] 時,控制編輯器中的資料行換行。", "wrappingIndent": "控制換行的縮排。可以是 [無]、[相同] 或 [縮排]。", "mouseWheelScrollSensitivity": "滑鼠滾輪捲動事件的 'deltaX' 與 'deltaY' 所使用的乘數", + "multiCursorModifier.ctrlCmd": "對應Windows和Linux的'Control'與對應OSX的'Command'", + "multiCursorModifier.alt": "對應Windows和Linux的'Alt'與對應OSX的'Option'", + "multiCursorModifier": "用於新增多個滑鼠游標的修改程式。`ctrlCmd` 會對應到 Windows 及 Linux 上的 `Control` 以及 OSX 上的 `Command`。[移至定義] 及 [開啟連結] 滑鼠手勢將會適應以避免和 multicursor 修改程式衝突。", "quickSuggestions.strings": "允許在字串內顯示即時建議。", "quickSuggestions.comments": "允許在註解中顯示即時建議。", "quickSuggestions.other": "允許在字串與註解以外之處顯示即時建議。", "quickSuggestions": "控制是否應在輸入時自動顯示建議", "quickSuggestionsDelay": "控制延遲顯示快速建議的毫秒數", - "parameterHints": "啟用參數提示", "autoClosingBrackets": "控制編輯器是否應在左括號後自動插入右括號", "formatOnType": "控制編輯器是否應在輸入一行後自動格式化", "formatOnPaste": "控制編輯器是否應自動設定貼上的內容格式。格式器必須可供使用,而且格式器應該能夠設定文件中一個範圍的格式。", "suggestOnTriggerCharacters": "控制輸入觸發字元時,是否應自動顯示建議", - "acceptSuggestionOnEnter": "控制除了 'Tab' 外,是否也藉由按下 'Enter' 接受建議。如此可避免混淆要插入新行或接受建議。", + "acceptSuggestionOnEnter": "控制除了 'Tab' 外,是否也藉由按下 'Enter' 接受建議。如此可避免混淆要插入新行或接受建議。設定值'smart'表示在文字變更同時,只透過Enter接受建議。", "acceptSuggestionOnCommitCharacter": "控制認可字元是否應接受建議。例如在 JavaScript 中,分號 (';') 可以是接受建議並鍵入該字元的認可字元。", "snippetSuggestions": "控制程式碼片段是否隨其他建議顯示,以及其排序方式。", "emptySelectionClipboard": "控制複製時不選取任何項目是否會複製目前程式行。", @@ -62,12 +67,17 @@ "renderLineHighlight": "控制編輯器應如何轉譯目前反白的行,可能的值有 'none'、'gutter'、'line' 和 'all'。", "codeLens": "控制編輯器是否顯示程式碼濾鏡", "folding": "控制編輯器是否已啟用程式碼摺疊功能", + "showFoldingControls": "自動隱藏摺疊控制向", "matchBrackets": "當選取某側的括號時,強調顯示另一側的配對括號。", "glyphMargin": "控制編輯器是否應轉譯垂直字符邊界。字符邊界最常用來進行偵錯。", "useTabStops": "插入和刪除接在定位停駐點後的空白字元", "trimAutoWhitespace": "移除尾端自動插入的空白字元", "stablePeek": "讓預覽編輯器在使用者按兩下其內容或點擊 Escape 時保持開啟。", "dragAndDrop": "控制編輯器是否允許透過拖放動作移動選取範圍。", + "accessibilitySupport.auto": "編輯器將使用平台 API 以偵測螢幕助讀程式附加。", + "accessibilitySupport.on": "編輯器將會為螢幕助讀程式的使用方式永久地最佳化。", + "accessibilitySupport.off": "編輯器不會為螢幕助讀程式的使用方式進行最佳化。", + "accessibilitySupport": "控制編輯器是否應於已為螢幕助讀程式最佳化的模式中執行。", "sideBySide": "控制 Diff 編輯器要並排或內嵌顯示差異", "ignoreTrimWhitespace": "控制 Diff 編輯器是否將開頭或尾端空白字元的變更顯示為差異", "renderIndicators": "控制 Diff 編輯器是否要為新增的/移除的變更顯示 +/- 標記", diff --git a/i18n/cht/src/vs/editor/common/config/editorOptions.i18n.json b/i18n/cht/src/vs/editor/common/config/editorOptions.i18n.json index f48289922ad715e815f69e82e1980970aeccd783..7d0a6fdde24db29cae034551a468f65fe6d81acf 100644 --- a/i18n/cht/src/vs/editor/common/config/editorOptions.i18n.json +++ b/i18n/cht/src/vs/editor/common/config/editorOptions.i18n.json @@ -4,5 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "accessibilityOffAriaLabel": "編輯器現在無法存取。按Alt+F1尋求選項", "editorViewAccessibleLabel": "編輯器內容" } \ No newline at end of file diff --git a/i18n/cht/src/vs/editor/common/view/editorColorRegistry.i18n.json b/i18n/cht/src/vs/editor/common/view/editorColorRegistry.i18n.json index 7b011979df90cdf0efae980f3c32a189c053768d..a64950d25e3b81d295ef533625681bc43b219652 100644 --- a/i18n/cht/src/vs/editor/common/view/editorColorRegistry.i18n.json +++ b/i18n/cht/src/vs/editor/common/view/editorColorRegistry.i18n.json @@ -7,11 +7,18 @@ "lineHighlight": "目前游標位置行的反白顯示背景色彩。", "lineHighlightBorderBox": "目前游標位置行之周圍框線的背景色彩。", "rangeHighlight": "反白顯示範圍的背景色彩,例如 Quick Open 與尋找功能。", + "caret": "編輯器游標的色彩。", + "editorWhitespaces": "編輯器中空白字元的色彩。", + "editorIndentGuides": "編輯器縮排輔助線的色彩。", "editorLineNumbers": "編輯器行號的色彩。", "editorRuler": "編輯器尺規的色彩", "editorCodeLensForeground": "編輯器程式碼濾鏡的前景色彩", "editorBracketMatchBackground": "成對括號背景色彩", "editorBracketMatchBorder": "成對括號邊框色彩", "editorOverviewRulerBorder": "預覽檢視編輯器尺規的邊框色彩.", - "editorGutter": "編輯器邊框的背景顏色,包含行號與字形圖示的邊框." + "editorGutter": "編輯器邊框的背景顏色,包含行號與字形圖示的邊框.", + "errorForeground": "編輯器內錯誤提示線的前景色彩.", + "errorBorder": "編輯器內錯誤提示線的邊框色彩.", + "warningForeground": "編輯器內警告提示線的前景色彩.", + "warningBorder": "編輯器內警告提示線的邊框色彩." } \ No newline at end of file diff --git a/i18n/cht/src/vs/editor/contrib/find/common/findController.i18n.json b/i18n/cht/src/vs/editor/contrib/find/common/findController.i18n.json index 29657be9ff8c07b57fc2e9ca45c56ca4db8beab7..515b39749628bb5b722f9bd0f0bf5ab73278241e 100644 --- a/i18n/cht/src/vs/editor/contrib/find/common/findController.i18n.json +++ b/i18n/cht/src/vs/editor/contrib/find/common/findController.i18n.json @@ -14,6 +14,5 @@ "addSelectionToPreviousFindMatch": "將選取項目加入前一個找到的相符項中", "moveSelectionToNextFindMatch": "將最後一個選擇項目移至下一個找到的相符項", "moveSelectionToPreviousFindMatch": "將最後一個選擇項目移至前一個找到的相符項", - "selectAllOccurencesOfFindMatch": "選取所有找到的相符項目", "changeAll.label": "變更所有發生次數" } \ No newline at end of file diff --git a/i18n/cht/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.i18n.json b/i18n/cht/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..26ea0a1761cf64e40ac2f212e771cf3e9f965e85 --- /dev/null +++ b/i18n/cht/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.i18n.json @@ -0,0 +1,23 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "noResultWord": "找不到 '{0}' 的定義", + "generic.noResults": "找不到任何定義", + "meta.title": " - {0} 個定義", + "actions.goToDecl.label": "移至定義", + "actions.goToDeclToSide.label": "在一側開啟定義", + "actions.previewDecl.label": "預覽定義", + "goToImplementation.noResultWord": "找不到 '{0}' 的任何實作", + "goToImplementation.generic.noResults": "找不到任何實作", + "meta.implementations.title": " – {0} 個實作", + "actions.goToImplementation.label": "前往實作", + "actions.peekImplementation.label": "預覽實作", + "goToTypeDefinition.noResultWord": "找不到 '{0}' 的任何類型定義", + "goToTypeDefinition.generic.noResults": "找不到任何類型定義", + "meta.typeDefinitions.title": " – {0} 個定義", + "actions.goToTypeDefinition.label": "移至類型定義", + "actions.peekTypeDefinition.label": "預覽類型定義" +} \ No newline at end of file diff --git a/i18n/cht/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.i18n.json b/i18n/cht/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..24cf4f7503fe89d1b02439d49859c78ca8058486 --- /dev/null +++ b/i18n/cht/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "multipleResults": "按一下以顯示 {0} 項定義。" +} \ No newline at end of file diff --git a/i18n/cht/src/vs/editor/contrib/links/browser/links.i18n.json b/i18n/cht/src/vs/editor/contrib/links/browser/links.i18n.json index 405dbdb09b9608e46dd3f3543ebf80cd520a8dae..6f5daa0aa3cf1731d3f127b7943cf03fb138566e 100644 --- a/i18n/cht/src/vs/editor/contrib/links/browser/links.i18n.json +++ b/i18n/cht/src/vs/editor/contrib/links/browser/links.i18n.json @@ -6,6 +6,7 @@ { "links.navigate.mac": "按住 Cmd 並按一下按鍵以追蹤連結", "links.navigate": "按住 Ctrl 並按一下滑鼠按鈕可連入連結", + "links.navigate.al": "按住Alt並點擊以追蹤連結", "invalid.url": "抱歉,因為此連結的語式不正確,所以無法加以開啟: {0}", "missing.url": "抱歉,因為此連結遺失目標,所以無法加以開啟。", "label": "開啟連結" diff --git a/i18n/cht/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json b/i18n/cht/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json index 5ee6d0db8a7ea118da9810d94d36f84c0f9e0f72..b3f68973521df15c5e13388ff290d187c99bdccb 100644 --- a/i18n/cht/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json +++ b/i18n/cht/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json @@ -5,8 +5,6 @@ // Do not edit this file. It is machine generated. { "aria.oneReference": "個符號位於 {0} 中的第 {1} 行第 {2} 欄", - "aria.fileReferences.1": "1 個符號位於 {0}", - "aria.fileReferences.N": "{0} 個符號位於 {1}", "aria.result.0": "找不到結果", "aria.result.1": "在 {0} 中找到 1 個符號", "aria.result.n1": "在 {1} 中找到 {0} 個符號", diff --git a/i18n/cht/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json b/i18n/cht/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json index 28f57ee6a5fc1b849726cc1e3eb530fc100d8f23..beb2f4690fc302fb8f49fd5cb56104b13717a306 100644 --- a/i18n/cht/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json +++ b/i18n/cht/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json @@ -12,6 +12,7 @@ "readMore": "進一步了解...{0}", "suggestionWithDetailsAriaLabel": "{0},建議,有詳細資料", "suggestionAriaLabel": "{0},建議", + "readLess": "簡易說明...{0}", "suggestWidget.loading": "正在載入...", "suggestWidget.noSuggestions": "無建議。", "suggestionAriaAccepted": "{0},接受", diff --git a/i18n/cht/src/vs/editor/node/languageConfigurationExtensionPoint.i18n.json b/i18n/cht/src/vs/editor/node/languageConfigurationExtensionPoint.i18n.json index 13c0c141c50a62930a60d66e0d26312bf23d6cd9..bf2bf87414cc409edf1b07cbed913ceddac6ef9d 100644 --- a/i18n/cht/src/vs/editor/node/languageConfigurationExtensionPoint.i18n.json +++ b/i18n/cht/src/vs/editor/node/languageConfigurationExtensionPoint.i18n.json @@ -16,5 +16,8 @@ "schema.autoClosingPairs": "定義成對括弧。輸入左括弧時,即自動插入右括弧。", "schema.autoClosingPairs.notIn": "定義停用自動配對的範圍清單。", "schema.surroundingPairs": "定義可用以括住所選字串的成對括弧。", + "schema.wordPattern": "定義語言的文字", + "schema.wordPattern.pattern": "使用正規表示式進行文字比對", + "schema.wordPattern.flags": "使用正規表示式標記進行文字比對", "schema.wordPattern.flags.errorMessage": "必須符合樣式 `/^([gimuy]+)$/`" } \ No newline at end of file diff --git a/i18n/cht/src/vs/platform/actions/electron-browser/menusExtensionPoint.i18n.json b/i18n/cht/src/vs/platform/actions/electron-browser/menusExtensionPoint.i18n.json index 993d9fa74a6a0e1dcc0f1d46c3b9f2fac0447777..8a8133f764f81aefffdcdcb28f31800549b2ec82 100644 --- a/i18n/cht/src/vs/platform/actions/electron-browser/menusExtensionPoint.i18n.json +++ b/i18n/cht/src/vs/platform/actions/electron-browser/menusExtensionPoint.i18n.json @@ -21,6 +21,8 @@ "menus.scmTitle": "原始檔控制標題功能表", "menus.resourceGroupContext": "原始檔控制資源群組操作功能表", "menus.resourceStateContext": "原始檔控制資源群組狀態操作功能表", + "view.viewTitle": "這有助於查看標題功能表", + "view.itemContext": "這有助於查看項目內容功能表", "nonempty": "必須是非空白值。", "opticon": "屬性 `icon` 可以省略,否則必須為字串或類似 `{dark, light}` 的常值", "requireStringOrObject": "'{0}' 為必要屬性,且其類型必須是 'string' 或 'object'", diff --git a/i18n/cht/src/vs/platform/extensions/common/extensionsRegistry.i18n.json b/i18n/cht/src/vs/platform/extensions/common/extensionsRegistry.i18n.json index f1ba5247c95d7c7002803a2884178131f4cb93f0..8586f1686ce6686922c0ccaf6176df596f315e09 100644 --- a/i18n/cht/src/vs/platform/extensions/common/extensionsRegistry.i18n.json +++ b/i18n/cht/src/vs/platform/extensions/common/extensionsRegistry.i18n.json @@ -14,6 +14,12 @@ "vscode.extension.contributes": "此封裝所代表的所有 VS Code 擴充功能比重。", "vscode.extension.preview": "將延伸模組設為在 Marketplace 中標幟為 [預覽]。", "vscode.extension.activationEvents": "VS Code 擴充功能的啟動事件。", + "vscode.extension.activationEvents.onLanguage": "當指定語言檔案開啟時激發該事件", + "vscode.extension.activationEvents.onCommand": "當指定的命令被調用時激發該事件", + "vscode.extension.activationEvents.onDebug": "當指定的工作偵錯階段開始時激發該事件", + "vscode.extension.activationEvents.workspaceContains": "當開啟指定的文件夾包含glob模式匹配的文件時激發該事件", + "vscode.extension.activationEvents.onView": "當指定的檢視被擴展時激發該事件", + "vscode.extension.activationEvents.star": "當VS Code啟動時激發該事件,為了確保最好的使用者體驗,當您的擴充功能沒有其他組合作業時,請激活此事件.", "vscode.extension.badges": "要顯示於 Marketplace 擴充頁面資訊看板的徽章陣列。", "vscode.extension.badges.url": "徽章映像 URL。", "vscode.extension.badges.href": "徽章連結。", diff --git a/i18n/cht/src/vs/platform/history/electron-main/historyMainService.i18n.json b/i18n/cht/src/vs/platform/history/electron-main/historyMainService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..72828dcc85cd2dd9160566687ae5b82fda170820 --- /dev/null +++ b/i18n/cht/src/vs/platform/history/electron-main/historyMainService.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "newWindow": "開新視窗", + "newWindowDesc": "開啟新視窗", + "recentFolders": "最近使用的資料夾", + "folderDesc": "{0} {1}" +} \ No newline at end of file diff --git a/i18n/cht/src/vs/platform/markers/common/problemMatcher.i18n.json b/i18n/cht/src/vs/platform/markers/common/problemMatcher.i18n.json index cd3b3aa69fec935a62ee06fbfbdeba9f1a3adb99..a4b2c6583ccd69536c59f65b19ed5906711141de 100644 --- a/i18n/cht/src/vs/platform/markers/common/problemMatcher.i18n.json +++ b/i18n/cht/src/vs/platform/markers/common/problemMatcher.i18n.json @@ -34,6 +34,7 @@ "ProblemMatcherParser.noValidIdentifier": "錯誤: 樣式屬性 {0} 不是有效的樣式變數名稱。", "ProblemMatcherParser.problemPattern.watchingMatcher": "問題比對器必須同時定義監控的開始模式和結束模式。", "ProblemMatcherParser.invalidRegexp": "錯誤: 字串 {0} 不是有效的規則運算式。\n", + "WatchingPatternSchema.regexp": "用來查看偵測背景工作開始或結束的正規表達式.", "WatchingPatternSchema.file": "檔案名稱的符合群組索引。可以省略。", "PatternTypeSchema.name": "所提供或預先定義之模式的名稱", "PatternTypeSchema.description": "問題模式或所提供或預先定義之問題模式的名稱。如有指定基底,即可發出。", @@ -42,6 +43,12 @@ "ProblemMatcherSchema.severity": "擷取項目問題的預設嚴重性。如果模式未定義嚴重性的符合群組,就會加以使用。", "ProblemMatcherSchema.applyTo": "控制文字文件上所回報的問題僅會套用至開啟的文件、關閉的文件或所有文件。", "ProblemMatcherSchema.fileLocation": "定義問題模式中所回報檔案名稱的解譯方式。", + "ProblemMatcherSchema.background": "偵測後台任務中匹配程序模式的開始與結束.", + "ProblemMatcherSchema.background.activeOnStart": "如果設置為 True,背景監控程式在工作啟動時處於主動模式。這相當於符合起始樣式的行。", + "ProblemMatcherSchema.background.beginsPattern": "如果於輸出中相符,則會指示背景程式開始。", + "ProblemMatcherSchema.background.endsPattern": "如果於輸出中相符,則會指示背景程式結束。", + "ProblemMatcherSchema.watching.deprecated": "關注屬性已被淘汰,請改用背景取代。", + "ProblemMatcherSchema.watching": "追蹤匹配程序的開始與結束。", "ProblemMatcherSchema.watching.activeOnStart": "如果設定為 True,監控程式在工作啟動時處於主動模式。這相當於發出符合 beginPattern 的行", "ProblemMatcherSchema.watching.beginsPattern": "如果在輸出中相符,則會指示監看工作開始。", "ProblemMatcherSchema.watching.endsPattern": "如果在輸出中相符,則會指示監看工作結束。", diff --git a/i18n/cht/src/vs/platform/theme/common/colorRegistry.i18n.json b/i18n/cht/src/vs/platform/theme/common/colorRegistry.i18n.json index 85fdbbbbdf2c975ea6d0faf14ac1d29b4895904f..f1a9772aec3611625a15b8e200795b31f3f91f8f 100644 --- a/i18n/cht/src/vs/platform/theme/common/colorRegistry.i18n.json +++ b/i18n/cht/src/vs/platform/theme/common/colorRegistry.i18n.json @@ -9,14 +9,14 @@ "foreground": "整體的前景色彩。僅當未被任何元件覆疊時,才會使用此色彩。", "errorForeground": "整體錯誤訊息的前景色彩。僅當未被任何元件覆蓋時,才會使用此色彩。", "descriptionForeground": "提供附加訊息的前景顏色,例如標籤", - "focusBorder": "焦點項目的整體邊界色彩。只在沒有任何元件覆寫此色彩時,才會加以使用。", - "contrastBorder": "項目周圍的額外邊界,可將項目從其他項目中區隔出來以提高對比。", + "focusBorder": "焦點項目的整體框線色彩。只在沒有任何元件覆寫此色彩時,才會加以使用。", + "contrastBorder": "項目周圍的額外框線,可將項目從其他項目中區隔出來以提高對比。", "activeContrastBorder": "使用中項目周圍的額外邊界,可將項目從其他項目中區隔出來以提高對比。", - "selectionBackground": "作業區域選取的背景顏色(例如輸入或文字區域)。請注意,這不適用於編輯器與終端機中的選取。", "textSeparatorForeground": "文字分隔符號的顏色。", "textLinkForeground": "內文連結的前景色彩", "textLinkActiveForeground": "內文使用連結的前景色彩", "textPreformatForeground": "提示及建議文字的前景色彩。", + "textBlockQuoteBackground": "文內引用區塊背景色彩。", "textBlockQuoteBorder": "引用文字的框線顏色。", "textCodeBlockBackground": "文字區塊的背景顏色。", "widgetShadow": "小工具的陰影色彩,例如編輯器中的尋找/取代。", @@ -35,11 +35,13 @@ "dropdownForeground": "下拉式清單的前景。", "dropdownBorder": "下拉式清單的框線。", "listFocusBackground": "當清單/樹狀為使用中狀態時,焦點項目的清單/樹狀背景色彩。使用中的清單/樹狀有鍵盤焦點,非使用中者則沒有。", + "listFocusForeground": "當清單/樹狀為使用中狀態時,焦點項目的清單/樹狀前景色彩。使用中的清單/樹狀有鍵盤焦點,非使用中者則沒有。", "listActiveSelectionBackground": "當清單/樹狀為使用中狀態時,所選項目的清單/樹狀背景色彩。使用中的清單/樹狀有鍵盤焦點,非使用中者則沒有。", "listActiveSelectionForeground": "當清單/樹狀為使用中狀態時,所選項目的清單/樹狀前景色彩。使用中的清單/樹狀有鍵盤焦點,非使用中者則沒有。", "listInactiveSelectionBackground": "當清單/樹狀為非使用中狀態時,所選項目的清單/樹狀背景色彩。使用中的清單/樹狀有鍵盤焦點,非使用中者則沒有。", "listInactiveSelectionForeground": "當清單/樹狀為使用中狀態時,所選項目的清單/樹狀前景色彩。使用中的清單/樹狀有鍵盤焦點,非使用中則沒有。", "listHoverBackground": "使用滑鼠暫留在項目時的清單/樹狀背景。", + "listHoverForeground": "滑鼠暫留在項目時的清單/樹狀前景。", "listDropBackground": "使用滑鼠四處移動項目時的清單/樹狀拖放背景。", "highlight": "在清單/樹狀內搜尋時,相符醒目提示的清單/樹狀前景色彩。", "pickerGroupForeground": "分組標籤的快速選擇器色彩。", @@ -57,6 +59,7 @@ "editorBackground": "編輯器的背景色彩。", "editorForeground": "編輯器的預設前景色彩。", "editorWidgetBackground": "編輯器小工具的背景色彩,例如尋找/取代。", + "editorWidgetBorder": "編輯器小工具的邊界色彩。小工具選擇擁有邊界或色彩未被小工具覆寫時,才會使用色彩。", "editorSelection": "編輯器選取範圍的色彩。", "editorInactiveSelection": "非使用中之編輯器選取範圍的色彩。", "editorSelectionHighlight": "選取時,內容相同之區域的色彩。", @@ -70,5 +73,12 @@ "diffEditorInserted": "插入文字的背景色彩。", "diffEditorRemoved": "移除文字的背景色彩。", "diffEditorInsertedOutline": "插入的文字外框色彩。", - "diffEditorRemovedOutline": "移除的文字外框色彩。" + "diffEditorRemovedOutline": "移除的文字外框色彩。", + "mergeCurrentHeaderBackground": "目前內嵌合併衝突中的深色標題背景。", + "mergeCurrentContentBackground": "目前內嵌合併衝突中的內容背景。", + "mergeIncomingHeaderBackground": "傳入內嵌合併衝突中的深色標題背景。", + "mergeIncomingContentBackground": "傳入內嵌合併衝突中的內容背景。", + "mergeBorder": "內嵌合併衝突中標頭及分隔器的邊界色彩。", + "overviewRulerCurrentContentForeground": "目前內嵌合併衝突的概觀尺規前景。", + "overviewRulerIncomingContentForeground": "傳入內嵌合併衝突的概觀尺規前景。" } \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/api/node/extHostTask.i18n.json b/i18n/cht/src/vs/workbench/api/node/extHostTask.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..4b90a12aaf247b4a1af0e887542958471d8df5e5 --- /dev/null +++ b/i18n/cht/src/vs/workbench/api/node/extHostTask.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "task.label": "{0}: {1}" +} \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/api/node/extHostTreeViews.i18n.json b/i18n/cht/src/vs/workbench/api/node/extHostTreeViews.i18n.json index 8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a..edc32bace6e95d2cbba253f02f7ddcd5e5ed3e24 100644 --- a/i18n/cht/src/vs/workbench/api/node/extHostTreeViews.i18n.json +++ b/i18n/cht/src/vs/workbench/api/node/extHostTreeViews.i18n.json @@ -3,4 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. -{} \ No newline at end of file +{ + "treeView.notRegistered": "未註冊識別碼為 '{0}' 的樹狀檢視。", + "treeItem.notFound": "找不到識別碼為 '{0}' 的樹狀檢視。", + "treeView.duplicateElement": "元件{0}已被註冊" +} \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/browser/parts/activitybar/activitybarPart.i18n.json b/i18n/cht/src/vs/workbench/browser/parts/activitybar/activitybarPart.i18n.json index f5d3fe58b62195a447aaac2da6b12587d6c67e61..e2c33864cd6df1d10b6e460aa6364be10fec7bb2 100644 --- a/i18n/cht/src/vs/workbench/browser/parts/activitybar/activitybarPart.i18n.json +++ b/i18n/cht/src/vs/workbench/browser/parts/activitybar/activitybarPart.i18n.json @@ -5,5 +5,6 @@ // Do not edit this file. It is machine generated. { "hideActivitBar": "隱藏活動列", - "activityBarAriaLabel": "即時檢視切換器" + "activityBarAriaLabel": "即時檢視切換器", + "globalActions": "全域動作" } \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/browser/parts/editor/editorStatus.i18n.json b/i18n/cht/src/vs/workbench/browser/parts/editor/editorStatus.i18n.json index 3ee2576e0d3598f26417416ba1d1144673ac1a93..54beb87e59b5fa6465aa550361ac317ffc6c1def 100644 --- a/i18n/cht/src/vs/workbench/browser/parts/editor/editorStatus.i18n.json +++ b/i18n/cht/src/vs/workbench/browser/parts/editor/editorStatus.i18n.json @@ -10,7 +10,7 @@ "multiSelection": "{0} 個選取項目", "endOfLineLineFeed": "LF", "endOfLineCarriageReturnLineFeed": "CRLF", - "tabFocusModeEnabled": "用 Tab 鍵移動焦點", + "screenReaderDetectedExtra": "若您不打算使用螢幕助讀程式,請將設定 `editor.accessibilitySupport` 變更為 \"off\"。", "disableTabMode": "停用協助工具模式", "gotoLine": "移至行", "indentation": "縮排", diff --git a/i18n/cht/src/vs/workbench/browser/parts/quickopen/quickopen.i18n.json b/i18n/cht/src/vs/workbench/browser/parts/quickopen/quickopen.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..4e288801642483f8b9cdcf1351a9bc156ccb224b --- /dev/null +++ b/i18n/cht/src/vs/workbench/browser/parts/quickopen/quickopen.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "quickOpen": "移至檔案...", + "quickNavigateNext": "在 Quick Open 中導覽至下一項", + "quickNavigatePrevious": "在 Quick Open 中導覽至上一項", + "quickSelectNext": "在 Quick Open 中選取下一個", + "quickSelectPrevious": "在 Quick Open 中選取上一個" +} \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/browser/quickopen.i18n.json b/i18n/cht/src/vs/workbench/browser/quickopen.i18n.json index c47858a81d205a4a7ac9c40446f95766a5ff534a..cab0a05a7b4a392bce6a6e22996b738ea7124dd8 100644 --- a/i18n/cht/src/vs/workbench/browser/quickopen.i18n.json +++ b/i18n/cht/src/vs/workbench/browser/quickopen.i18n.json @@ -6,6 +6,5 @@ { "noResultsMatching": "沒有相符的結果", "noResultsFound2": "找不到結果", - "entryAriaLabel": "{0},命令", - "noCommands": "沒有相符的命令" + "entryAriaLabel": "{0},命令" } \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/browser/viewlet.i18n.json b/i18n/cht/src/vs/workbench/browser/viewlet.i18n.json index 26801a4aefd57333aff63684d03aa029326a57a4..690069abe96677b8748440b5773f25da5eeea001 100644 --- a/i18n/cht/src/vs/workbench/browser/viewlet.i18n.json +++ b/i18n/cht/src/vs/workbench/browser/viewlet.i18n.json @@ -4,6 +4,5 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "collapse": "全部摺疊", - "viewToolbarAriaLabel": "{0} 個動作" + "collapse": "全部摺疊" } \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/common/theme.i18n.json b/i18n/cht/src/vs/workbench/common/theme.i18n.json index 2d8bce1a6366ac1c3700fe485a4462a6c337c309..938086e4262e6171502252a096e7fd9d80800916 100644 --- a/i18n/cht/src/vs/workbench/common/theme.i18n.json +++ b/i18n/cht/src/vs/workbench/common/theme.i18n.json @@ -7,11 +7,16 @@ "tabActiveBackground": "使用中之索引標籤的背景色彩。索引標籤是編輯器在編輯器區域中的容器。同一個編輯器群組中的多個索引標籤可以同時開啟。可能會有多個編輯器群組。", "tabInactiveBackground": "非使用中之索引標籤的背景色彩。索引標籤是編輯器在編輯器區域中的容器。同一個編輯器群組中的多個索引標籤可以同時開啟。可能會有多個編輯器群組。", "tabBorder": "用以分隔索引標籤彼此的框線。索引標籤是編輯器在編輯器區域中的容器。同一個編輯器群組中的多個索引標籤可以同時開啟。可能會有多個編輯器群組。", - "tabActiveEditorGroupActiveForeground": "使用中的群組內,使用中之索引標籤的前景色彩。索引標籤是編輯器在編輯器區域中的容器。同一個編輯器群組中的多個索引標籤可以同時開啟。可能會有多個編輯器群組。", - "tabInactiveEditorGroupActiveForeground": "使用中的群組內,非使用中之索引標籤的前景色彩。索引標籤是編輯器在編輯器區域中的容器。同一個編輯器群組中的多個索引標籤可以同時開啟。可能會有多個編輯器群組。", + "tabActiveForeground": "使用中的群組內,使用中之索引標籤的前景色彩。索引標籤是編輯器在編輯器區域中的容器。同一個編輯器群組中的多個索引標籤可以同時開啟。可能會有多個編輯器群組。", + "tabInactiveForeground": "使用中的群組內,非使用中之索引標籤的前景色彩。索引標籤是編輯器在編輯器區域中的容器。同一個編輯器群組中的多個索引標籤可以同時開啟。可能會有多個編輯器群組。", + "tabUnfocusedActiveForeground": "非使用中的群組內,使用中之索引標籤的前景色彩。索引標籤是編輯器在編輯器區域中的容器。同一個編輯器群組中的多個索引標籤可以同時開啟。可能會有多個編輯器群組。", + "tabUnfocusedInactiveForeground": "非使用中的群組內,非使用中之索引標籤的前景色彩。索引標籤是編輯器在編輯器區域中的容器。同一個編輯器群組中的多個索引標籤可以同時開啟。可能會有多個編輯器群組。", "editorGroupBackground": "編輯器群組的背景色彩。編輯器群組是編輯器的容器。當拖曳編輯器群組時會顯示背景色彩。", + "tabsContainerBackground": "當索引標籤啟用的時候編輯器群組標題的背景色彩。編輯器群組是編輯器的容器。", + "tabsContainerBorder": "當索引標籤啟用時,編輯器群組標題的框線色彩。編輯器群組是編輯器的容器。", "editorGroupHeaderBackground": "當索引標籤禁用的時候編輯器群組標題的背景顏色。編輯器群組是編輯器的容器。", "editorGroupBorder": "用以分隔多個編輯器群組彼此的色彩。編輯器群組是編輯器的容器。", + "editorDragAndDropBackground": "拖拉編輯器時的背景顏色,可設置透明度讓內容穿透顯示.", "panelBackground": "面板的前景色彩。面板會顯示在編輯器區域的下方,其中包含諸如輸出與整合式終端機等檢視。", "panelBorder": "面板頂端用以分隔編輯器的邊框色彩。面板會顯示在編輯器區域的下方,其中包含諸如輸出與整合式終端機等檢視。", "panelActiveTitleForeground": "使用中之面板標題的標題色彩。面板會顯示在編輯器區域的下方,其中包含諸如輸出與整合式終端機等檢視。", @@ -19,18 +24,25 @@ "panelActiveTitleBorder": "使用中之面板標題的框線色彩。面板會顯示在編輯器區域的下方,其中包含諸如輸出與整合式終端機等檢視。", "statusBarForeground": "狀態列的前景色彩。狀態列會顯示在視窗的底部。", "statusBarBackground": "標準狀態列的背景色彩。狀態列會顯示在視窗的底部。", + "statusBarBorder": "用以分隔資訊看板與編輯器的狀態列框線色彩。狀態列會顯示在視窗的底部。", "statusBarNoFolderBackground": "當未開啟任何資料夾時,狀態列的背景色彩。狀態列會顯示在視窗的底部。", + "statusBarNoFolderForeground": "當未開啟任何資料夾時,狀態列的前景色彩。狀態列會顯示在視窗的底部。", "statusBarItemActiveBackground": "按下滑鼠按鈕時,狀態列項目的背景色彩。狀態列會顯示在視窗的底部。", "statusBarItemHoverBackground": "動態顯示時,狀態列項目的背景色彩。狀態列會顯示在視窗的底部。", "statusBarProminentItemBackground": "狀態列突出項目的背景顏色。突出項目比狀態列的其他項目更顯眼,用於表示重要性更高。狀態列會顯示在視窗的底部。", "statusBarProminentItemHoverBackground": "狀態列突出項目暫留時的背景顏色。突出項目比狀態列的其他項目更顯眼,用於表示重要性更高。狀態列會顯示在視窗的底部。", "activityBarBackground": "活動列背景的色彩。活動列會顯示在最左側或最右側,並可切換不同的提要欄位檢視。", "activityBarForeground": "活動列的前背景色彩(例如用於圖示)。此活動列會顯示在最左側或最右側,讓您可以切換提要欄位的不同檢視。", + "activityBarBorder": "用以分隔提要欄位的活動列框線色彩。此活動列會顯示在最左側或最右側,讓您可以切換提要欄位的不同檢視。", + "activityBarDragAndDropBackground": "拖拉活動徽章項目時的色彩.顏色可設置透明度讓原活動徽章可穿透顯示.活動徽章列表會出現在最左側或最右側並允許切換不同的檢視.", "activityBarBadgeBackground": "活動通知徽章的背景色彩。此活動列會顯示在最左側或最右側,讓您可以切換提要欄位的不同檢視。", "activityBarBadgeForeground": "活動通知徽章的前背景色彩。此活動列會顯示在最左側或最右側,讓您可以切換提要欄位的不同檢視。", "sideBarBackground": "提要欄位的背景色彩。提要欄位是檢視 (例如 Explorer 與搜尋) 的容器。", + "sideBarForeground": "側欄的前景顏色.側欄包含Explorer與搜尋.", + "sideBarBorder": "用以分隔編輯器的側邊提要欄位框線色彩。該提要欄位是檢視 (例如 Explorer 及搜尋) 的容器。", "sideBarTitleForeground": "提要欄位標題的前景色彩。提要欄位是檢視 (例如 Explorer 與搜尋) 的容器。", "sideBarSectionHeaderBackground": "提要欄位區段標頭的背景色彩。提要欄位是檢視 (例如 Explorer 與搜尋) 的容器。", + "sideBarSectionHeaderForeground": "提要欄位區段標頭的前景色彩。提要欄位是檢視 (例如 Explorer 與搜尋) 的容器。", "titleBarActiveForeground": "作用中視窗之標題列的前景。請注意,目前只有 macOS 支援此色彩。", "titleBarInactiveForeground": "非作用中視窗之標題列的前景。請注意,目前只有 macOS 支援此色彩。", "titleBarActiveBackground": "作用中視窗之標題列的背景。請注意,目前只有 macOS 支援此色彩。", diff --git a/i18n/cht/src/vs/workbench/electron-browser/actions.i18n.json b/i18n/cht/src/vs/workbench/electron-browser/actions.i18n.json index 5268fd64574f195eed931fd132a98bf13b96b89e..4bb693a3d1f98dc8eb76af3b24acc349e5836542 100644 --- a/i18n/cht/src/vs/workbench/electron-browser/actions.i18n.json +++ b/i18n/cht/src/vs/workbench/electron-browser/actions.i18n.json @@ -6,9 +6,6 @@ { "closeActiveEditor": "關閉編輯器", "closeWindow": "關閉視窗", - "switchWindow": "切換視窗", - "switchWindowPlaceHolder": "選取視窗", - "current": "目前視窗", "closeFolder": "關閉資料夾", "noFolderOpened": "此執行個體中目前沒有開啟的資料夾可以關閉。", "newWindow": "開新視窗", @@ -20,7 +17,7 @@ "zoomReset": "重設縮放", "appPerf": "啟動效能", "reloadWindow": "重新載入視窗", - "openRecent": "開啟最近使用的檔案", + "current": "目前視窗", "folders": "資料夾", "files": "檔案", "openRecentPlaceHolderMac": "選取路徑 (按住 Cmd 鍵以在新視窗開啟)", @@ -32,10 +29,6 @@ "openDocumentationUrl": "文件", "openIntroductoryVideosUrl": "簡介影片", "toggleSharedProcess": "切換共用處理序", - "navigateLeft": "移至 [檢視左側]", - "navigateRight": "移至 [檢視右側]", - "navigateUp": "移至 [檢視上方]", - "navigateDown": "移至 [檢視下方]", "increaseViewSize": "增加目前的檢視大小", "decreaseViewSize": "縮小目前的檢視大小" } \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/electron-browser/main.contribution.i18n.json b/i18n/cht/src/vs/workbench/electron-browser/main.contribution.i18n.json index c1874024aee5c2c01aa15669279ff62309835803..7fcb8f4533b2ebddb69bace816b0d6e893c1bfd0 100644 --- a/i18n/cht/src/vs/workbench/electron-browser/main.contribution.i18n.json +++ b/i18n/cht/src/vs/workbench/electron-browser/main.contribution.i18n.json @@ -7,6 +7,7 @@ "view": "檢視", "help": "說明", "file": "檔案", + "developer": "開發人員", "showEditorTabs": "控制已開啟的編輯器是否應顯示在索引標籤中。", "editorTabCloseButton": "控制編輯器的索引標籤關閉按鈕位置,或在設為 'off' 時將其停用。", "showIcons": "控制開啟的編輯器是否搭配圖示顯示。這需要同時啟用圖示佈景主題。", @@ -30,10 +31,6 @@ "window.openFoldersInNewWindow.off": "資料夾會取代上一個使用中的視窗", "window.openFoldersInNewWindow.default": "除非已從應用程式內挑選了資料夾 (例如透過 [檔案] 功能表),否則資料夾會在新視窗中開啟", "openFoldersInNewWindow": "控制資料夾應在新視窗中開啟或取代上一個使用中的視窗。\n- default: 除非已從應用程式內挑選資料夾 (例如,透過 [檔案] 功能表),否則會在新視窗開啟\n- on: 資料夾會在新視窗開啟\n- off: 資料夾會取代上一個使用中視窗\n請注意,在某些情況下會略過此設定 (例如,使用了 -new-window 或 -reuse-window 命令列選項時)。", - "window.reopenFolders.none": "一律不重新開啟資料夾。", - "window.reopenFolders.one": "重新開啟上一個使用中的資料夾。", - "window.reopenFolders.all": "重新開啟上一個工作階段的所有資料夾。", - "reopenFolders": "控制重新啟動後重新開啟資料夾的方式。選取 [none] 永不重新開啟資料夾,選取 [one] 重新開啟最近一個使用的資料夾,或選取 [all] 重新開啟上一個工作階段的所有資料夾。", "restoreFullscreen": "控制當視窗在全螢幕模式下結束後,下次是否仍以全螢幕模式開啟。", "zoomLevel": "調整視窗的縮放比例。原始大小為 0,而且每個向上增量 (例如 1) 或向下增量 (例如 -1) 代表放大或縮小 20%。您也可以輸入小數,更細微地調整縮放比例。", "title": "控制使用中之編輯器上的視窗標題。變數會依內容替換: \n${activeEditorShort}: 例如 myFile.txt\n${activeEditorMedium}: 例如 myFolder/myFile.txt\n${activeEditorLong}: 例如 /Users/Development/myProject/myFolder/myFile.txt\n${rootName}: 例如 myProject\n${rootPath}: 例如 /Users/Development/myProject\n${appName}: 例如 VS Code\n${dirty}: 若使用中的編輯器已變更,即為已變更的指標\n${separator}: 條件式分隔符號 (\" - \"),只會在前後有包含值的變數時顯示", @@ -41,11 +38,13 @@ "window.newWindowDimensions.inherit": "以相同於上一個使用中之視窗的維度開啟新視窗。", "window.newWindowDimensions.maximized": "開啟並最大化新視窗。", "window.newWindowDimensions.fullscreen": "在全螢幕模式下開啟新視窗。", + "newWindowDimensions": "控制當至少一個視窗已打開的情況下開啟新視窗的維度。根據預設,新視窗會以小型維度在畫面中央開啟。設為 'inherit' 時,視窗的維度會和最後開啟的視窗相同。設為 'maximized' 時,視窗會開到最大,若設為 'fullscreen' 則全螢幕開啟。", "window.menuBarVisibility.default": "只在全螢幕模式時隱藏功能表。", "window.menuBarVisibility.visible": "一律顯示功能表,即使在全螢幕模式時亦然。", "window.menuBarVisibility.toggle": "隱藏功能表,但可經由 Alt 鍵加以顯示。", "window.menuBarVisibility.hidden": "一律隱藏功能表。", "menuBarVisibility": "控制功能表列的可見度。[切換] 設定表示會隱藏功能表列,按一下 Alt 鍵則會顯示。除非視窗是全螢幕,否則預設會顯示功能表列。", + "enableMenuBarMnemonics": "啟用後可以利用Alt快捷鍵打開主選單.關閉記憶選單將Alt快捷鍵綁定至替代的命令區塊.", "autoDetectHighContrast": "若啟用,如果 Windows 使用高對比佈景主題,就會自動變更為高對比佈景主題,切換掉 Windows 高對比佈景主題時則變更為深色佈景主題。", "titleBarStyle": "調整視窗標題列的外觀。變更需要完整重新啟動才會套用。", "window.nativeTabs": "啟用 macOS Sierra 視窗索引標籤。請注意需要完全重新啟動才能套用變更,並且完成設定後原始索引標籤將會停用自訂標題列樣式。", @@ -55,5 +54,7 @@ "zenMode.hideTabs": "控制開啟 Zen Mode 是否也會隱藏 Workbench 索引標籤。", "zenMode.hideStatusBar": "控制開啟 Zen Mode 是否也會隱藏 Workbench 底部的狀態列。", "zenMode.hideActivityBar": "控制開啟 Zen Mode 是否也會隱藏 Workbench 左方的活動列。", - "zenMode.restore": "控制視窗如果在 Zen Mode 下結束,是否應還原為 Zen Mode。" + "zenMode.restore": "控制視窗如果在 Zen Mode 下結束,是否應還原為 Zen Mode。", + "workspaceConfigurationTitle": "工作區", + "files.exclude.boolean": "要符合檔案路徑的 Glob 模式。設為 True 或 False 可啟用或停用模式。" } \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/electron-browser/workbench.i18n.json b/i18n/cht/src/vs/workbench/electron-browser/workbench.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..2375ce9a84fc6f05c6e91a9074ba046d40ac8bfd --- /dev/null +++ b/i18n/cht/src/vs/workbench/electron-browser/workbench.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "developer": "開發人員", + "file": "檔案" +} \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/codeEditor/electron-browser/accessibility.i18n.json b/i18n/cht/src/vs/workbench/parts/codeEditor/electron-browser/accessibility.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..9e13a86b296f43e94fe4f5f81e9edea69c71d04e --- /dev/null +++ b/i18n/cht/src/vs/workbench/parts/codeEditor/electron-browser/accessibility.i18n.json @@ -0,0 +1,26 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "emergencyConfOn": "現在請將設定 `editor.accessibilitySupport` 變更為 'on'。", + "openingDocs": "現在請開啟 VS Code 協助工具文件頁面。", + "introMsg": "感謝您試用 VS Code 的協助工具選項。", + "status": "狀態:", + "changeConfigToOnMac": "若要將編輯器為螢幕助讀程式的使用方式設定為永久地最佳化,現在請按 Command+E。", + "changeConfigToOnWinLinux": "若要將編輯器為螢幕助讀程式的使用方式設定為永久地最佳化,現在請按 Control+E。", + "auto_unknown": "編輯器已設定為使用平台 API 以偵測螢幕助讀程式附加,但是目前的執行階段不支援。", + "auto_on": "編輯器已自動偵測到螢幕助讀程式附加。", + "auto_off": "編輯器已設定為自動偵測螢幕助讀程式附加,但目前的實際狀況卻不是如此。", + "configuredOn": "編輯器已為螢幕助讀程式的使用方式設定為永久地更新 - 您可以藉由編輯設定 `editor.accessibilitySupport` 以變更這項設定。", + "configuredOff": "編輯器已設定為不會為螢幕助讀程式的使用方式進行最佳化。", + "tabFocusModeOnMsg": "在目前的編輯器中按 Tab 鍵會將焦點移至下一個可設定焦點的元素。按 {0} 可切換此行為。", + "tabFocusModeOnMsgNoKb": "在目前的編輯器中按 Tab 鍵會將焦點移至下一個可設定焦點的元素。命令 {0} 目前無法由按鍵繫結關係觸發。", + "tabFocusModeOffMsg": "在目前的編輯器中按 Tab 鍵會插入定位字元。按 {0} 可切換此行為。", + "tabFocusModeOffMsgNoKb": "在目前的編輯器中按 Tab 鍵會插入定位字元。命令 {0} 目前無法由按鍵繫結關係觸發。", + "openDocMac": "現在請按 Command+H 以開啟具有更多與協助工具相關 VS Code 資訊的瀏覽器視窗。", + "openDocWinLinux": "現在請按 Control+H 以開啟具有更多與協助工具相關 VS Code 資訊的瀏覽器視窗。", + "outroMsg": "您可以按 Esc 鍵或 Shift+Esc 鍵來解除此工具提示並返回編輯器。", + "ShowAccessibilityHelpAction": "顯示協助工具說明" +} \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/codeEditor/electron-browser/inspectTMScopes.i18n.json b/i18n/cht/src/vs/workbench/parts/codeEditor/electron-browser/inspectTMScopes.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a --- /dev/null +++ b/i18n/cht/src/vs/workbench/parts/codeEditor/electron-browser/inspectTMScopes.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{} \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/codeEditor/electron-browser/toggleMultiCursorModifier.i18n.json b/i18n/cht/src/vs/workbench/parts/codeEditor/electron-browser/toggleMultiCursorModifier.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..fef7fe532f8f2de6975c5c3ec813a091590345f4 --- /dev/null +++ b/i18n/cht/src/vs/workbench/parts/codeEditor/electron-browser/toggleMultiCursorModifier.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "toggleLocation": "切換至多游標修改程式" +} \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/debug/browser/debugActions.i18n.json b/i18n/cht/src/vs/workbench/parts/debug/browser/debugActions.i18n.json index c2ab22390ca55497e4ef5f23f50b2abb64b59f23..b1e2ccbfec45764d057d1d7e87e1987e050fd823 100644 --- a/i18n/cht/src/vs/workbench/parts/debug/browser/debugActions.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/debug/browser/debugActions.i18n.json @@ -6,6 +6,7 @@ { "openLaunchJson": "開啟 {0}", "launchJsonNeedsConfigurtion": "設定或修正 'launch.json'", + "noFolderDebugConfig": "請先打開一個資料夾以便設定進階偵錯組態。", "startDebug": "開始偵錯", "startWithoutDebugging": "開始但不偵錯", "selectAndStartDebugging": "選取並開始偵錯", diff --git a/i18n/cht/src/vs/workbench/parts/debug/electron-browser/debugCommands.i18n.json b/i18n/cht/src/vs/workbench/parts/debug/electron-browser/debugCommands.i18n.json index 8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a..b5bfc8d474b3046f670f32591cbbbf9da95e31e0 100644 --- a/i18n/cht/src/vs/workbench/parts/debug/electron-browser/debugCommands.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/debug/electron-browser/debugCommands.i18n.json @@ -3,4 +3,6 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. -{} \ No newline at end of file +{ + "noFolderDebugConfig": "請先打開一個資料夾以便設定進階偵錯組態。" +} \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/debug/electron-browser/debugService.i18n.json b/i18n/cht/src/vs/workbench/parts/debug/electron-browser/debugService.i18n.json index c3db57caac68046aa78f79d86171ac595393060f..4ff9fe0b2b99b45d5b658004c287005095368702 100644 --- a/i18n/cht/src/vs/workbench/parts/debug/electron-browser/debugService.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/debug/electron-browser/debugService.i18n.json @@ -5,8 +5,8 @@ // Do not edit this file. It is machine generated. { "snapshotObj": "只會顯示此物件的基本值。", - "debuggingStarted": "偵錯已開始。", "debuggingPaused": "偵錯已暫停,原因 {0},{1} {2}", + "debuggingStarted": "偵錯已開始。", "debuggingStopped": "偵錯已停止。", "breakpointAdded": "已新增中斷點,行 {0},檔案 {1}", "breakpointRemoved": "已移除中斷點,行 {0},檔案 {1}", diff --git a/i18n/cht/src/vs/workbench/parts/debug/electron-browser/debugViews.i18n.json b/i18n/cht/src/vs/workbench/parts/debug/electron-browser/debugViews.i18n.json index e199cca67755496d1cb245fa2f458845b5276768..e6e2542dc0a73aba473b10aa4e7119d78691538c 100644 --- a/i18n/cht/src/vs/workbench/parts/debug/electron-browser/debugViews.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/debug/electron-browser/debugViews.i18n.json @@ -5,16 +5,12 @@ // Do not edit this file. It is machine generated. { "variablesSection": "變數區段", - "variables": "變數", "variablesAriaTreeLabel": "偵錯變數", "expressionsSection": "運算式區段", - "watch": "監看", "watchAriaTreeLabel": "對監看運算式執行偵錯", "callstackSection": "呼叫堆疊區段", "debugStopped": "於 {0} 暫停", - "callStack": "呼叫堆疊", "callStackAriaLabel": "偵錯呼叫堆疊", "breakpointsSection": "中斷點區段", - "breakpoints": "中斷點", "breakpointsAriaTreeLabel": "偵錯中斷點" } \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/debug/electron-browser/electronDebugActions.i18n.json b/i18n/cht/src/vs/workbench/parts/debug/electron-browser/electronDebugActions.i18n.json index ae46ae65a607f32b260201fe64fa6ac9bf8a5b76..d77b4677ceadc543d9215812a0b2680ccd93e9e6 100644 --- a/i18n/cht/src/vs/workbench/parts/debug/electron-browser/electronDebugActions.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/debug/electron-browser/electronDebugActions.i18n.json @@ -6,5 +6,6 @@ { "copyValue": "複製值", "copy": "複製", + "copyAll": "全部複製", "copyStackTrace": "複製呼叫堆疊" } \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/debug/electron-browser/statusbarColorProvider.i18n.json b/i18n/cht/src/vs/workbench/parts/debug/electron-browser/statusbarColorProvider.i18n.json index 259df04a8b178f2c9b39a52b325b358c0b2275e5..81362151ea4a175110376f52ab771f5c622cdde6 100644 --- a/i18n/cht/src/vs/workbench/parts/debug/electron-browser/statusbarColorProvider.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/debug/electron-browser/statusbarColorProvider.i18n.json @@ -4,5 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "statusBarDebuggingBackground": "對程式執行偵錯時狀態列的背景色彩。狀態列會顯示在視窗的底部" + "statusBarDebuggingBackground": "對程式執行偵錯時狀態列的背景色彩。狀態列會顯示在視窗的底部", + "statusBarDebuggingForeground": "對程式執行偵錯時狀態列的前景色彩。狀態列會顯示在視窗的底部" } \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json b/i18n/cht/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json index fbd7d7b23df6e06a0543917f04ae8da482a8ab14..246786aab6cf29703ad19b0dda2cc7be852af878 100644 --- a/i18n/cht/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json @@ -7,6 +7,7 @@ "debugAdapterBinNotFound": "偵錯配接器可執行檔 '{0}' 不存在。", "debugAdapterCannotDetermineExecutable": "無法判斷偵錯配接器 '{0}' 的可執行檔。", "debugType": "組態的類型。", + "debugTypeNotRecognised": "無法辨識此偵錯類型.請確認已有安裝並啟用相對應的偵錯擴充功能.", "node2NotSupported": "\"node2\" 已不再支援,請改用 \"node\",並將 \"protocol\" 屬性設為 \"inspector\"。", "debugName": "組態的名稱; 出現在啟動組態下拉式功能表中。", "debugRequest": "要求組態的類型。可以是 [啟動] 或 [附加]。", diff --git a/i18n/cht/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json b/i18n/cht/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json index 9c79dedc0ca60e8bbe655140caf9a1f2f58409b0..cc8a2f386207799b979332f125c8c036b8ca4b2c 100644 --- a/i18n/cht/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json @@ -4,6 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "previousEditPoint": "Emmet: 上一個編輯端點", - "nextEditPoint": "Emmet: 下一個編輯端點" + "previousEditPoint": "Emmet: 前往上一個編輯端點", + "nextEditPoint": "Emmet: 前往下一個編輯端點" } \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json b/i18n/cht/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json index fa22b35c419d0b8e0fcb0fbb0f5c547f81b549d8..0766d1cdedb1067f3d6b6881b983a14da3a357a6 100644 --- a/i18n/cht/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json @@ -9,5 +9,6 @@ "emmetPreferences": "喜好設定,用以修改某些動作的行為及 Emmet 的解析程式。", "emmetSyntaxProfiles": "為指定的語法定義設定檔,或透過特定規則使用自己的設定檔。", "emmetExclude": "不應展開 Emmet 縮寫的語言陣列。", - "emmetExtensionsPath": "包含 Emmet 設定檔、程式碼片段及參考的資料夾路徑" + "emmetExtensionsPath": "包含 Emmet 設定檔、程式碼片段及參考的資料夾路徑", + "useNewEmmet": "試試所有 Emmet 功能的新 Emmet 模組 (最終會取代舊的單一 Emmet 程式庫)。" } \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/extensions/browser/extensionEditor.i18n.json b/i18n/cht/src/vs/workbench/parts/extensions/browser/extensionEditor.i18n.json index 2badec430e0fd827ec1e2757eb45396ffdd155cc..3d0e6b6a5b66e86c2f3ebccef5be4d0b31da0cf2 100644 --- a/i18n/cht/src/vs/workbench/parts/extensions/browser/extensionEditor.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/extensions/browser/extensionEditor.i18n.json @@ -24,6 +24,10 @@ "default": "預設", "debuggers": "偵錯工具 ({0})", "debugger name": "名稱", + "views": "瀏覽次數 ({0})", + "view id": "識別碼", + "view name": "名稱", + "view location": "位置", "themes": "佈景主題 ({0})", "JSON Validation": "JSON 驗證 ({0})", "commands": "命令 ({0})", diff --git a/i18n/cht/src/vs/workbench/parts/extensions/browser/extensionsActions.i18n.json b/i18n/cht/src/vs/workbench/parts/extensions/browser/extensionsActions.i18n.json index 7e0eff0f087ce32548241f91e2bcdca627404b75..dce745aeaf805e8ac5d98b1e660b3e8f6b607a17 100644 --- a/i18n/cht/src/vs/workbench/parts/extensions/browser/extensionsActions.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/extensions/browser/extensionsActions.i18n.json @@ -22,6 +22,8 @@ "disableGloballyAction": "永遠", "disableAction": "停用", "checkForUpdates": "查看是否有更新", + "enableAutoUpdate": "啟用自動更新延伸模組", + "disableAutoUpdate": "停用自動更新延伸模組", "updateAll": "更新所有延伸模組", "reloadAction": "重新載入", "postUpdateTooltip": "重新載入以更新", @@ -44,6 +46,8 @@ "showWorkspaceRecommendedExtensions": "顯示工作區的建議擴充功能", "showRecommendedKeymapExtensions": "顯示建議的按鍵對應", "showRecommendedKeymapExtensionsShort": "按鍵對應", + "showLanguageExtensions": "顯示語言擴充功能", + "showLanguageExtensionsShort": "語言擴充功能", "configureWorkspaceRecommendedExtensions": "設定建議的延伸模組 (工作區)", "ConfigureWorkspaceRecommendations.noWorkspace": "只有在工作區資料夾中才能使用建議。", "OpenExtensionsFile.failed": "無法在 '.vscode' 資料夾 ({0}) 中建立 'extensions.json' 檔案。", @@ -51,5 +55,8 @@ "disableAll": "停用所有已安裝的延伸模組", "disableAllWorkspace": "停用此工作區的所有已安裝延伸模組", "enableAll": "啟用所有已安裝的延伸模組", - "enableAllWorkspace": "啟用此工作區的所有已安裝延伸模組" + "enableAllWorkspace": "啟用此工作區的所有已安裝延伸模組", + "extensionButtonProminentBackground": "突出的動作延伸模組按鈕背景色彩 (例如,[安裝] 按鈕)。", + "extensionButtonProminentForeground": "突出的動作延伸模組按鈕前景色彩 (例如,[安裝] 按鈕)。", + "extensionButtonProminentHoverBackground": "突出的動作延伸模組按鈕背景暫留色彩 (例如,[安裝] 按鈕)。" } \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.i18n.json b/i18n/cht/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.i18n.json index 7855f3a13f51b4cb3fa1c39ddd93cdcd978a7c9c..9e97614cd5ee4db5e1657440f89bb7097c59fbb6 100644 --- a/i18n/cht/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.i18n.json @@ -9,6 +9,8 @@ "neverShowAgain": "不要再顯示", "close": "關閉", "workspaceRecommended": "此工作區具有擴充功能建議。", + "ignoreExtensionRecommendations": "是否略過所有建議的擴充功能?", + "ignoreAll": "是,略過全部", "no": "否", "cancel": "取消" } \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.i18n.json b/i18n/cht/src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.i18n.json index ee54fc14d14f070b205e3fafe14d0936dacd8690..c0f0b8275588ffde84e4cb44c846608bf2e8e48c 100644 --- a/i18n/cht/src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.i18n.json @@ -10,5 +10,6 @@ "extensions": "擴充功能", "view": "檢視", "extensionsConfigurationTitle": "擴充功能", - "extensionsAutoUpdate": "自動更新擴充功能" + "extensionsAutoUpdate": "自動更新擴充功能", + "extensionsIgnoreRecommendations": "忽略延伸模組建議" } \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json b/i18n/cht/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json index 8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a..8c853f39a830391e79e6b53a909dcb9ecc0d31f9 100644 --- a/i18n/cht/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json @@ -3,4 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. -{} \ No newline at end of file +{ + "disableOtherKeymapsConfirmation": "要停用其他按鍵對應 ({0}),以避免按鍵繫結關係間的衝突嗎?", + "yes": "是", + "no": "否", + "betterMergeDisabled": "目前已內建 Better Merge 延伸模組,安裝的延伸模組已停用並且可以移除。", + "uninstall": "解除安裝", + "later": "稍後" +} \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/files/browser/files.contribution.i18n.json b/i18n/cht/src/vs/workbench/parts/files/browser/files.contribution.i18n.json index 07e8bfd5963195281e7622279805887dedcad4bc..777013462f05b2e99e781043a10f41077e8cf7dd 100644 --- a/i18n/cht/src/vs/workbench/parts/files/browser/files.contribution.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/files/browser/files.contribution.i18n.json @@ -16,7 +16,7 @@ "associations": "將檔案關聯設定為語言 (例如 \"*.extension\": \"html\")。這些語言優先於已安裝語言的預設關聯。", "encoding": "讀取與寫入檔案時要使用的預設字元集編碼。", "autoGuessEncoding": "如有啟用,將會在開啟檔案時,嘗試猜測字元集編碼", - "eol": "預設行尾字元。", + "eol": "預設結尾斷行字元.LF使用 \\n , CRLF使用\\r\\n ", "trimTrailingWhitespace": "若啟用,將在儲存檔案時修剪尾端空白。", "insertFinalNewline": "啟用時,請在儲存檔案時在其結尾插入最後一個新行。", "files.autoSave.off": "已變更的檔案一律不會自動儲存。", @@ -27,6 +27,7 @@ "autoSaveDelay": "控制要自動儲存已變更之檔案前必須經過的延遲時間 (毫秒)。僅當 'files.autoSave' 設為 \"{0}\" 時才適用。", "watcherExclude": "將檔案路徑的 Glob 模式設定為從檔案監控排除。需要重新啟動才能變更此設定。當您發現 Code 在啟動時使用大量 CPU 時間時,可以排除較大的資料夾以降低初始負載。", "hotExit.off": "停用 Hot Exit。", + "hotExit.onExit": "Hot Exit 將會在關閉應用程式時觸發,也就是在 Windows/Linux 上關閉上一個視窗,或是觸發 workbench.action.quit 命令 (命令選擇區、按鍵繫結關係、功能表) 時觸發。具有備份的所有視窗都會在下次啟動時還原。", "hotExit": "控制是否讓不同工作階段記住未儲存的檔案,並允許在結束編輯器時跳過儲存提示。", "defaultLanguage": "指派給新檔案的預設語言模式。", "editorConfigurationTitle": "編輯器", diff --git a/i18n/cht/src/vs/workbench/parts/files/browser/views/emptyView.i18n.json b/i18n/cht/src/vs/workbench/parts/files/browser/views/emptyView.i18n.json index daa9489ee2bcc8d7660eef5f077e543d71fd97b8..6083b4139ccd84aefb73fc93b89d5b972b243c82 100644 --- a/i18n/cht/src/vs/workbench/parts/files/browser/views/emptyView.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/files/browser/views/emptyView.i18n.json @@ -5,7 +5,5 @@ // Do not edit this file. It is machine generated. { "explorerSection": "檔案總管區段", - "noWorkspace": "沒有開啟的資料夾", - "noWorkspaceHelp": "您尚未開啟資料夾。", "openFolder": "開啟資料夾" } \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/files/browser/views/openEditorsView.i18n.json b/i18n/cht/src/vs/workbench/parts/files/browser/views/openEditorsView.i18n.json index bb6c9f7b0a8fd03dbd3e53673691fa83884b862b..4279cc7e911c6fdea9e92fea4ae8118eeaa44eeb 100644 --- a/i18n/cht/src/vs/workbench/parts/files/browser/views/openEditorsView.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/files/browser/views/openEditorsView.i18n.json @@ -4,8 +4,8 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "openEditosrSection": "開放式編輯器區段", "openEditors": "已開啟的編輯器", + "openEditosrSection": "開放式編輯器區段", "treeAriaLabel": "開啟的編輯器: 使用中檔案的清單", "dirtyCounter": "{0} 未儲存" } \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json b/i18n/cht/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json index 1c615781faa3290bd1e2dbb74ff6f9ddbe58d3f3..2699d76ae09609d292f7c503ca55ae14fac7022d 100644 --- a/i18n/cht/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json @@ -5,5 +5,11 @@ // Do not edit this file. It is machine generated. { "slow": "偵測到啟動速度慢", - "slow.detail": "抱歉! 先前的啟動速度過慢。請重新啟動 '{0}' 並啟用剖析功能,同時將設定檔提供給我們,我們將努力提升啟動的品質。" + "slow.detail": "抱歉! 先前的啟動速度過慢。請重新啟動 '{0}' 並啟用剖析功能,同時將設定檔提供給我們,我們將努力提升啟動的品質。", + "prof.message": "已成功建立設定檔。", + "prof.detail": "請建立問題,並手動附加下列檔案:\n{0}", + "prof.restartAndFileIssue": "建立問題並重新啟動", + "prof.restart": "重新啟動", + "prof.thanks": "感謝您的協助", + "prof.detail.restart": "需要重新啟動才能夠繼續使用'{0}‘.再次感謝您的回饋." } \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/preferences/browser/keybindingsEditorContribution.i18n.json b/i18n/cht/src/vs/workbench/parts/preferences/browser/keybindingsEditorContribution.i18n.json index 0d448edf6a5eef7b3e6bcb14a8eaae8974726e52..96477e8cd2891536f4b5ada0a864266b56a369c1 100644 --- a/i18n/cht/src/vs/workbench/parts/preferences/browser/keybindingsEditorContribution.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/preferences/browser/keybindingsEditorContribution.i18n.json @@ -5,6 +5,7 @@ // Do not edit this file. It is machine generated. { "defineKeybinding.start": "定義按鍵繫結關係", - "defineKeybinding.kbLayoutInfoMessage": "針對您目前的鍵盤配置,請按 ", - "defineKeybinding.kbLayoutErrorMessage": "您無法在目前的鍵盤配置下產生此按鍵組合。" + "defineKeybinding.kbLayoutErrorMessage": "您無法在目前的鍵盤配置下產生此按鍵組合。", + "defineKeybinding.kbLayoutLocalAndUSMessage": "**{0}**針對您目前的按鍵配置(**{1}**為美國標準)", + "defineKeybinding.kbLayoutLocalMessage": "**{0}**針對您目前的鍵盤配置" } \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/preferences/browser/preferencesRenderers.i18n.json b/i18n/cht/src/vs/workbench/parts/preferences/browser/preferencesRenderers.i18n.json index d55154b3d429297b2c68acaf9aa9ac3c17473c0d..7179fe0d56b701c2e19b796ab920d73f884e1e94 100644 --- a/i18n/cht/src/vs/workbench/parts/preferences/browser/preferencesRenderers.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/preferences/browser/preferencesRenderers.i18n.json @@ -4,6 +4,7 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "errorInvalidConfiguration": "無法寫入設定.請開啟使用者設定並修正檔案中的錯誤/警告後再試一次.", "editTtile": "編輯", "replaceDefaultValue": "在設定中取代", "copyDefaultValue": "複製到設定", diff --git a/i18n/cht/src/vs/workbench/parts/quickopen/browser/commandsHandler.i18n.json b/i18n/cht/src/vs/workbench/parts/quickopen/browser/commandsHandler.i18n.json index 57c6be161054c66bb32ce40fc56ecea06d8a896f..6f93d38ba4b15446dc7b9ab47c10aa31c907db45 100644 --- a/i18n/cht/src/vs/workbench/parts/quickopen/browser/commandsHandler.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/quickopen/browser/commandsHandler.i18n.json @@ -5,6 +5,7 @@ // Do not edit this file. It is machine generated. { "showTriggerActions": "顯示所有命令", + "showCommands.label": "命令選擇區...", "entryAriaLabelWithKey": "{0}、{1}、命令", "entryAriaLabel": "{0},命令", "canNotRun": "無法從這裡執行命令 '{0}'。", diff --git a/i18n/cht/src/vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.i18n.json b/i18n/cht/src/vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..c58e0321baca9ddf2ac2ff6a1dbb8971d8931981 --- /dev/null +++ b/i18n/cht/src/vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "relaunchMessage": "設定已經變更,必須重新啟動才會生效。", + "relaunchDetail": "請按 [重新啟動] 按鈕以重新啟動 {0} 並啟用設定。", + "restart": "重新啟動" +} \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.i18n.json b/i18n/cht/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..eea295d40666232065682419a101ed665e4ee83a --- /dev/null +++ b/i18n/cht/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "editorGutterModifiedBackground": "修改中的行於編輯器邊框的背景色彩", + "editorGutterAddedBackground": "新增後的行於編輯器邊框的背景色彩", + "editorGutterDeletedBackground": "刪除後的行於編輯器邊框的背景色彩" +} \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/scm/electron-browser/scm.contribution.i18n.json b/i18n/cht/src/vs/workbench/parts/scm/electron-browser/scm.contribution.i18n.json index c0bccd6864ce28dcfdecff56da124d7a48f07b0b..cafed393010587027957cfdaecd51c162e07dfc7 100644 --- a/i18n/cht/src/vs/workbench/parts/scm/electron-browser/scm.contribution.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/scm/electron-browser/scm.contribution.i18n.json @@ -5,6 +5,7 @@ // Do not edit this file. It is machine generated. { "toggleGitViewlet": "顯示 Git", + "installAdditionalSCMProviders": "安裝額外SCM提供者...", "source control": "原始檔控制", "toggleSCMViewlet": "顯示 SCM", "view": "檢視" diff --git a/i18n/cht/src/vs/workbench/parts/scm/electron-browser/scmMenus.i18n.json b/i18n/cht/src/vs/workbench/parts/scm/electron-browser/scmMenus.i18n.json index d1872f571b1c6e43f775635b59ab435d4a9ba4a3..5450727934af6e5bfc10fefda30cf5412c89783e 100644 --- a/i18n/cht/src/vs/workbench/parts/scm/electron-browser/scmMenus.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/scm/electron-browser/scmMenus.i18n.json @@ -4,5 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "installAdditionalSCMProviders": "安裝額外SCM提供者...", "switch provider": "切換 SCM 提供者..." } \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json b/i18n/cht/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json index 0dacece483983ac64f12b6ea87b7b9b196d70b70..0780f0f62bdbe796cdc92508546c85c8df3f208f 100644 --- a/i18n/cht/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json @@ -6,5 +6,7 @@ { "searchMatches": "找到 {0} 個相符", "searchMatch": "找到 {0} 個相符", - "fileMatchAriaLabel": "資料夾 {2} 的檔案 {1} 中有 {0} 個相符,搜尋結果" + "fileMatchAriaLabel": "資料夾 {2} 的檔案 {1} 中有 {0} 個相符,搜尋結果", + "replacePreviewResultAria": "根據文字({3})在({2})欄位列表中將({1})替代為文字{{0}}", + "searchResultAria": "根據文字({2})並在({1})欄位列表中找到符合({0})的項目" } \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/snippets/electron-browser/TMSnippets.i18n.json b/i18n/cht/src/vs/workbench/parts/snippets/electron-browser/TMSnippets.i18n.json index 4cb9c1367eea46c18c93f9576aee66f35b2943af..2789a5e845e9d12a28cdf49f04ae44d20b75dea7 100644 --- a/i18n/cht/src/vs/workbench/parts/snippets/electron-browser/TMSnippets.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/snippets/electron-browser/TMSnippets.i18n.json @@ -9,5 +9,6 @@ "vscode.extension.contributes.snippets-path": "程式碼片段檔案的路徑。此路徑是擴充功能資料夾的相對路徑,而且一般會以 './snippets/' 開頭。", "invalid.language": "`contributes.{0}.language` 中的不明語言。提供的值: {1}", "invalid.path.0": "`contributes.{0}.path` 中的預期字串。提供的值: {1}", - "invalid.path.1": "要包含在擴充功能資料夾 ({2}) 中的預期 `contributes.{0}.path` ({1})。這可能會使擴充功能無法移植。" + "invalid.path.1": "要包含在擴充功能資料夾 ({2}) 中的預期 `contributes.{0}.path` ({1})。這可能會使擴充功能無法移植。", + "badVariableUse": "程式碼片段 \"{0}\" 很可能會混淆 snippet-variables 及 snippet-placeholders。如需詳細資料,請參閱 https://code.visualstudio.com/docs/editor/userdefinedsnippets#_snippet-syntax。" } \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/snippets/electron-browser/snippets.contribution.i18n.json b/i18n/cht/src/vs/workbench/parts/snippets/electron-browser/snippets.contribution.i18n.json index 79eb6e8c71ce9e8a8a8853afdccc1eca2a7bd7b2..8db84c0d3ebbe27137336bb436a1572214953e2c 100644 --- a/i18n/cht/src/vs/workbench/parts/snippets/electron-browser/snippets.contribution.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/snippets/electron-browser/snippets.contribution.i18n.json @@ -11,6 +11,6 @@ "snippetSchema.json.default": "空白程式碼片段", "snippetSchema.json": "使用者程式碼片段組態", "snippetSchema.json.prefix": "在 Intellisense 中選取程式碼片段時要使用的前置詞", - "snippetSchema.json.body": "程式碼片段內容。請針對變數使用 '${id}'、'${id:label}'、'${1:label}',並針對游標位置使用 '$0'、'$1'", + "snippetSchema.json.body": "程式碼片段內容。請使用 '$1', '${1:defaultText}' 以定義游標位置,並使用 '$0' 定義最終游標位置。將 '${varName}' and '${varName:defaultText}' 插入變數值,例如 'This is file: $TM_FILENAME'。", "snippetSchema.json.description": "程式碼片段描述。" } \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/surveys/electron-browser/languageSurveys.contribution.i18n.json b/i18n/cht/src/vs/workbench/parts/surveys/electron-browser/languageSurveys.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..a74cdd763fc618892fd3cc34d94745141a9f4bcd --- /dev/null +++ b/i18n/cht/src/vs/workbench/parts/surveys/electron-browser/languageSurveys.contribution.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "helpUs": "協助我們改善{0}", + "takeShortSurvey": "填寫簡短調查問卷", + "remindLater": "稍後再提醒我", + "neverAgain": "不要再顯示" +} \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/surveys/electron-browser/nps.contribution.i18n.json b/i18n/cht/src/vs/workbench/parts/surveys/electron-browser/nps.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..260deed4c1d2691af223f83c7504ee74fb5d3df4 --- /dev/null +++ b/i18n/cht/src/vs/workbench/parts/surveys/electron-browser/nps.contribution.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "surveyQuestion": "您願意填寫簡短的意見反應問卷嗎?", + "takeSurvey": "填寫問卷", + "remindLater": "稍後再提醒我", + "neverAgain": "不要再顯示" +} \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/tasks/browser/buildQuickOpen.i18n.json b/i18n/cht/src/vs/workbench/parts/tasks/browser/buildQuickOpen.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..8ccb1a3828491f1ab603092c1cc240d1c033fb41 --- /dev/null +++ b/i18n/cht/src/vs/workbench/parts/tasks/browser/buildQuickOpen.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "noTasksMatching": "沒有工作相符" +} \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/tasks/browser/quickOpen.i18n.json b/i18n/cht/src/vs/workbench/parts/tasks/browser/quickOpen.i18n.json index e35a088465013f7b4e22a76b1b9bfb04c21ad4a8..6a8c26e1e146801733cd4984eb60f95231ddcc1f 100644 --- a/i18n/cht/src/vs/workbench/parts/tasks/browser/quickOpen.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/tasks/browser/quickOpen.i18n.json @@ -4,5 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "entryAriaLabel": "{0},工作" + "entryAriaLabel": "{0},工作", + "customizeTask": "自訂任務" } \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/tasks/browser/testQuickOpen.i18n.json b/i18n/cht/src/vs/workbench/parts/tasks/browser/testQuickOpen.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..8ccb1a3828491f1ab603092c1cc240d1c033fb41 --- /dev/null +++ b/i18n/cht/src/vs/workbench/parts/tasks/browser/testQuickOpen.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "noTasksMatching": "沒有工作相符" +} \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/tasks/common/taskConfiguration.i18n.json b/i18n/cht/src/vs/workbench/parts/tasks/common/taskConfiguration.i18n.json index 8da7ffbc6c4133060f517eb488757d0428c86d50..9320c66c86fb029dafc89c6c822982c429885272 100644 --- a/i18n/cht/src/vs/workbench/parts/tasks/common/taskConfiguration.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/tasks/common/taskConfiguration.i18n.json @@ -5,13 +5,13 @@ // Do not edit this file. It is machine generated. { "ConfigurationParser.invalidCWD": "警告: options.cwd 必須屬於字串類型。即將忽略值 {0}。", - "ConfigurationParser.noShell": "警告: 只有在終端機中執行工作時才支援殼層組態。", "ConfigurationParser.noargs": "錯誤: 命令引數必須是字串陣列。提供的值為:\n{0}", + "ConfigurationParser.noShell": "警告: 只有在終端機中執行工作時才支援殼層組態。", "ConfigurationParser.noName": "錯誤: 宣告範圍中的問題比對器必須有名稱:\n{0}\n", "ConfigurationParser.unknownMatcherKind": "警告: 定義的問題比對器未知。支援的類型為 string | ProblemMatcher | (string | ProblemMatcher)[]。\n{0}\n", "ConfigurationParser.invalidVaraibleReference": "錯誤: problemMatcher 參考無效: {0}\n", "ConfigurationParser.noTaskName": "錯誤: 工作必須提供 taskName 屬性。即將忽略此工作。\n{0}\n", "taskConfiguration.shellArgs": "警告: 工作 '{0}' 是殼層命令,但命令名稱或其中一個引數有的未逸出的空格。若要確保命令列正確引述,請將引數合併到命令中。", - "taskConfiguration.noCommandOrDependsOn": "錯誤: 工作 '{0}' 未指定命令或 dependsOn 屬性。即將略過該工作。其定義為:\n{1}", + "taskConfiguration.noCommandOrDependsOn": "錯誤: 工作 '{0}' 未指定命令與 dependsOn 屬性。將會略過該工作。其定義為: \n{1}", "taskConfiguration.noCommand": "錯誤: 工作 '{0}' 未定義命令。即將略過該工作。其定義為:\n{1}" } \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/tasks/electron-browser/jsonSchemaCommon.i18n.json b/i18n/cht/src/vs/workbench/parts/tasks/electron-browser/jsonSchemaCommon.i18n.json index a08f7bd95bc776793a7137a3e95a00af931b6bdf..44fe783df838d746da02601637d6b5610864df44 100644 --- a/i18n/cht/src/vs/workbench/parts/tasks/electron-browser/jsonSchemaCommon.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/tasks/electron-browser/jsonSchemaCommon.i18n.json @@ -7,6 +7,7 @@ "JsonSchema.options": "其他命令選項", "JsonSchema.options.cwd": "所執行程式或指令碼的目前工作目錄。如果省略,則會使用 Code 的目前工作區根目錄。", "JsonSchema.options.env": "所執行程式或殼層的環境。如果省略,則會使用父處理序的環境。", + "JsonSchema.shellConfiguration": "設定要使用的殼層。", "JsonSchema.shell.executable": "要使用的殼層。", "JsonSchema.shell.args": "殼層引數。", "JsonSchema.command": "要執行的命令。可以是外部程式或殼層命令。", diff --git a/i18n/cht/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v1.i18n.json b/i18n/cht/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v1.i18n.json index b729447e9796282a3da86e2f4269a24b35311834..fa2e875a18e108729595c916460007b89b3ade8b 100644 --- a/i18n/cht/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v1.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v1.i18n.json @@ -5,6 +5,8 @@ // Do not edit this file. It is machine generated. { "JsonSchema.version": "組態的版本號碼", + "JsonSchema._runner": "執行器已結束支援.請參考官方執行器屬性", + "JsonSchema.runner": "定義工作是否作為處理序執行,以及輸出會顯示在輸出視窗或終端機內。", "JsonSchema.windows": "Windows 特定命令組態", "JsonSchema.mac": "Mac 特定命令組態", "JsonSchema.linux": "Linux 特定命令組態", diff --git a/i18n/cht/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.i18n.json b/i18n/cht/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.i18n.json index 91d93e19374ef0fbda04a1057f9710b10ec56bfa..ad9741c08b95ed9c48da219442aae7df7c3b25cb 100644 --- a/i18n/cht/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.i18n.json @@ -4,11 +4,14 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "JsonSchema.version": "組態的版本號碼", - "JsonSchema.windows": "Windows 特定命令組態", - "JsonSchema.mac": "Mac 特定命令組態", - "JsonSchema.linux": "Linux 特定命令組態", "JsonSchema.shell": "指定此命令是殼層命令或外部程式。如果省略,預設為 False。", "JsonSchema.tasks.dependsOn.string": "此工作相依的另一個工作。", - "JsonSchema.tasks.dependsOn.array": "此工作相依的其他工作。" + "JsonSchema.tasks.dependsOn.array": "此工作相依的其他工作。", + "JsonSchema.tasks.group": "請定義此工作所屬的執行群組。若是省略此步驟,工作會屬於沒有群組。", + "JsonSchema.tasks.type": "定義工作是作為處理序或殼層中的命令執行。預設為處理序。", + "JsonSchema.version": "組態版本號碼", + "JsonSchema.tasks.customize": "要自訂的已提供工作。", + "JsonSchema.windows": "Windows 特定命令組態", + "JsonSchema.mac": "Mac 特定命令組態", + "JsonSchema.linux": "Linux 特定命令組態" } \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json b/i18n/cht/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json index f73c9b1e8a6dde342399597cad495cdca34ec271..9604a31ff96e253d04507f614dfd542eeeafa29c 100644 --- a/i18n/cht/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json @@ -18,10 +18,12 @@ "problems": "問題", "manyMarkers": "99+", "tasks": "工作", + "TaskSystem.noHotSwap": "變更工作執行引擎需要重新啟動 VS Code。已略過變更。", "TaskService.noBuildTask": "未定義任何建置工作。請使用 'isBuildCommand' 標記 tasks.json 檔案中的工作。", "TaskService.noTestTask": "未定義任何建置工作。請使用 'isTestCommand' 標記 tasks.json 檔案中的工作。", "TaskServer.noTask": "找不到所要求要執行的工作 {0}。", - "TaskSystem.activeSame": "工作已在使用中並處於監看模式。若要終止工作,請使用 F1 > [終止工作]", + "customizeParseErrors": "當前的工作組態存在錯誤.請更正錯誤再執行工作.", + "moreThanOneBuildTask": "定義了很多建置工作於tasks.json.執行第一個.", "TaskSystem.active": "已有工作在執行。請先終止該工作,然後再執行其他工作。", "TaskSystem.restartFailed": "無法終止再重新啟動工作 {0}", "TaskSystem.configurationErrors": "錯誤: 提供的工作組態具有驗證錯誤而無法使用。請先更正這些錯誤。", diff --git a/i18n/cht/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.i18n.json b/i18n/cht/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.i18n.json index 6fbf828e69e8975cf9bf220a09d38e36ce1f8de8..871f4fbea5ab1828cdbd17875aaf70ca5d8086d3 100644 --- a/i18n/cht/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.i18n.json @@ -6,5 +6,7 @@ { "TerminalTaskSystem.unknownError": "執行工作時發生不明錯誤。如需詳細資訊,請參閱工作輸出記錄檔。", "TerminalTaskSystem.terminalName": "工作 - {0}", - "TerminalTaskSystem": "無法在 UNC 磁碟機上執行殼層命令。" + "reuseTerminal": "工作將被重新啟用.按任意鍵關閉.", + "TerminalTaskSystem": "無法在 UNC 磁碟機上執行殼層命令。", + "unkownProblemMatcher": "問題比對器 {0} 無法解析,比對器將予忽略。" } \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/tasks/node/processTaskSystem.i18n.json b/i18n/cht/src/vs/workbench/parts/tasks/node/processTaskSystem.i18n.json index 14a1145483abf989b84e81e14ee339340eeeba49..a61b95cb117710d6bc7982e4564f04dc2b9495bb 100644 --- a/i18n/cht/src/vs/workbench/parts/tasks/node/processTaskSystem.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/tasks/node/processTaskSystem.i18n.json @@ -7,5 +7,6 @@ "TaskRunnerSystem.unknownError": "執行工作時發生不明錯誤。如需詳細資訊,請參閱工作輸出記錄檔。", "TaskRunnerSystem.watchingBuildTaskFinished": "\n監看建置工作已完成。", "TaskRunnerSystem.childProcessError": "Failed to launch external program {0} {1}.", - "TaskRunnerSystem.cancelRequested": "\n根據使用者要求已終止工作 '{0}'。" + "TaskRunnerSystem.cancelRequested": "\n根據使用者要求已終止工作 '{0}'。", + "unkownProblemMatcher": "問題比對器 {0} 無法解析,比對器將予忽略。" } \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/terminal/electron-browser/terminalActions.i18n.json b/i18n/cht/src/vs/workbench/parts/terminal/electron-browser/terminalActions.i18n.json index 1e92f6894ee396e204446a1f632ebc7544482530..88c335275098c26733605e6c12e953456b6cc0b4 100644 --- a/i18n/cht/src/vs/workbench/parts/terminal/electron-browser/terminalActions.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/terminal/electron-browser/terminalActions.i18n.json @@ -8,6 +8,7 @@ "workbench.action.terminal.kill": "終止使用中的終端機執行個體", "workbench.action.terminal.kill.short": "終止終端機", "workbench.action.terminal.copySelection": "複製選取項目", + "workbench.action.terminal.selectAll": "全選", "workbench.action.terminal.new": "建立新的整合式終端機", "workbench.action.terminal.new.short": "新增終端機", "workbench.action.terminal.focus": "聚焦終端機", @@ -26,5 +27,8 @@ "workbench.action.terminal.scrollUp": "向上捲動 (行)", "workbench.action.terminal.scrollUpPage": "向上捲動 (頁)", "workbench.action.terminal.scrollToTop": "捲動至頂端", - "workbench.action.terminal.clear": "清除" + "workbench.action.terminal.clear": "清除", + "workbench.action.terminal.allowWorkspaceShell": "允許工作區外觀配置", + "workbench.action.terminal.disallowWorkspaceShell": "不允許工作區外觀設置", + "workbench.action.terminal.rename": "重新命名" } \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/terminal/electron-browser/terminalColorRegistry.i18n.json b/i18n/cht/src/vs/workbench/parts/terminal/electron-browser/terminalColorRegistry.i18n.json index d6c50f67f6886031b16953b62527d5bc604117ac..6016a0077c1c8dbfb26f20abd3dccb8a03b464cc 100644 --- a/i18n/cht/src/vs/workbench/parts/terminal/electron-browser/terminalColorRegistry.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/terminal/electron-browser/terminalColorRegistry.i18n.json @@ -4,5 +4,7 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "terminal.background": "終端機的背景色彩,允許終端機和面板的色彩不同。", + "terminal.foreground": "終端機的前景色彩。", "terminal.ansiColor": "終端機中的 '{0}' ANSI 色彩。" } \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/terminal/electron-browser/terminalFindWidget.i18n.json b/i18n/cht/src/vs/workbench/parts/terminal/electron-browser/terminalFindWidget.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..f2ff92bce07066751c2ea053a011842481d67f7e --- /dev/null +++ b/i18n/cht/src/vs/workbench/parts/terminal/electron-browser/terminalFindWidget.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "label.find": "尋找", + "placeholder.find": "尋找", + "label.previousMatchButton": "上一個符合項", + "label.nextMatchButton": "下一個相符項", + "label.closeButton": "關閉" +} \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.i18n.json b/i18n/cht/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.i18n.json index d0d02ca0fc55dcfd7eb6d6a05906c3a5828ce035..6ac7e3480a4a2a14f1ffa408bc59f57ae4ae1821 100644 --- a/i18n/cht/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.i18n.json @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "terminal.integrated.copySelection.noSelection": "無法在終端機沒有焦點時複製終端機選取範圍", "terminal.integrated.exitedWithCode": "終端機處理序已終止,結束代碼為: {0}", "terminal.integrated.waitOnExit": "按任意鍵關閉終端機", "terminal.integrated.launchFailed": "無法啟動終端機處理序命令 `{0}{1}` (結束代碼: {2})" diff --git a/i18n/cht/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json b/i18n/cht/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json index 877f81d59fdd3100047c45e705eb9fa5f4635641..ae636e706790babb6c55936b356f22b7dbd0d3d6 100644 --- a/i18n/cht/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json @@ -6,6 +6,7 @@ { "selectTheme.label": "色彩佈景主題", "installColorThemes": "安裝其他的色彩佈景主題...", + "themes.selectTheme": "選取色彩主題(上/下鍵預覽)", "selectIconTheme.label": "檔案圖示佈景主題", "installIconThemes": "安裝其他的檔案圖示主題...", "noIconThemeLabel": "無", diff --git a/i18n/cht/src/vs/workbench/parts/update/electron-browser/update.i18n.json b/i18n/cht/src/vs/workbench/parts/update/electron-browser/update.i18n.json index 942ed9430c3a7cc60bc78311e78daf1238cf02da..763f5b45d61dd48596008ac09f24a463311fee17 100644 --- a/i18n/cht/src/vs/workbench/parts/update/electron-browser/update.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/update/electron-browser/update.i18n.json @@ -15,5 +15,18 @@ "license": "閱讀授權", "updateAvailable": "{0} 重新啟動後將會更新。", "thereIsUpdateAvailable": "已有更新可用。", - "noUpdatesAvailable": "目前沒有可用的更新。" + "noUpdatesAvailable": "目前沒有可用的更新。", + "updateIsReady": "可用的更新", + "commandPalette": "命令選擇區...", + "settings": "設定", + "keyboardShortcuts": "鍵盤快速鍵(&&K)", + "selectTheme.label": "色彩佈景主題", + "themes.selectIconTheme.label": "檔案圖示佈景主題", + "not available": "無可用更新", + "checkingForUpdates": "正在查看是否有更新...", + "DownloadUpdate": "下載可用更新", + "DownloadingUpdate": "正在下載更新...", + "InstallingUpdate": "正在安裝更新...", + "restartToUpdate": "重新啟動以更新...", + "checkForUpdates": "查看是否有更新..." } \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/views/browser/views.i18n.json b/i18n/cht/src/vs/workbench/parts/views/browser/views.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..6894078d8f2b50adeacb0e33227d7ca29e242151 --- /dev/null +++ b/i18n/cht/src/vs/workbench/parts/views/browser/views.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "viewToolbarAriaLabel": "{0} 個動作" +} \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/views/browser/viewsExtensionPoint.i18n.json b/i18n/cht/src/vs/workbench/parts/views/browser/viewsExtensionPoint.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..fcc72299d87a21518f86118f7400b3ca549bf5af --- /dev/null +++ b/i18n/cht/src/vs/workbench/parts/views/browser/viewsExtensionPoint.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "requirearray": "項目必須為陣列", + "requirestring": "屬性 '{0}' 為強制項目且必須屬於 `string` 類型", + "optstring": "屬性 `{0}` 可以省略或必須屬於 `string` 類型", + "vscode.extension.contributes.view.id": "檢視的識別碼。請使用此識別碼透過 `vscode.window.registerTreeDataProviderForView` API 登錄資料提供者。並藉由將 `onView:${id}` 事件登錄至 `activationEvents` 以觸發啟用您的延伸模組。", + "vscode.extension.contributes.view.name": "使用人性化顯示名稱.", + "vscode.extension.contributes.views": "提供意見給編輯者", + "views.explorer": "檔案總管檢視", + "locationId.invalid": "`{0}`不是有效的識別位置" +} \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json b/i18n/cht/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json index 00a45ea1dc0cb9cb7831bd79c32b4ac71f84bae1..440dfaba679eec5793ac3806f8735d5e958f0241 100644 --- a/i18n/cht/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json @@ -11,20 +11,26 @@ "welcomePage.openFolder": "開啟資料夾...", "welcomePage.cloneGitRepository": "複製 Git 存放庫...", "welcomePage.recent": "最近使用", + "welcomePage.moreRecent": "更多...", "welcomePage.noRecentFolders": "沒有最近使用的資料夾", "welcomePage.help": "說明", + "welcomePage.keybindingsCheatsheet": "閱覽鍵盤快速鍵", "welcomePage.introductoryVideos": "簡介影片", "welcomePage.productDocumentation": "產品文件", "welcomePage.gitHubRepository": "GitHub 存放庫", "welcomePage.stackOverflow": "Stack Overflow", "welcomePage.showOnStartup": "啟動時顯示歡迎頁面", "welcomePage.customize": "自訂", + "welcomePage.installExtensionPacks": "工具與語言", + "welcomePage.installExtensionPacksDescription": "安裝{0}與{1}的支援功能。", + "welcomePage.moreExtensions": "更多", "welcomePage.installKeymapDescription": "安裝鍵盤快速鍵", + "welcomePage.installKeymapExtension": "安裝鍵盤快速鍵{0}與{1}", "welcomePage.others": "其他", "welcomePage.colorTheme": "彩色佈景主題", "welcomePage.colorThemeDescription": "將編輯器及您的程式碼設定成您喜愛的外觀", + "welcomePage.learn": "深入了解", "welcomePage.showCommands": "尋找及執行所有命令", - "welcomePage.showCommandsDescription": "從控制台快速存取及搜尋命令 ({0})", "welcomePage.interfaceOverview": "介面概觀", "welcomePage.interfaceOverviewDescription": "使用視覺覆疊效果強調顯示 UI 的主要元件", "welcomePage.interactivePlayground": "Interactive Playground", diff --git a/i18n/cht/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.contribution.i18n.json b/i18n/cht/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.contribution.i18n.json index 2e0c06390e3ecc536ba34c2fa09ef39ff7d61c61..0b34cedf5f5b0e01deefecac341e0799db72bac7 100644 --- a/i18n/cht/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.contribution.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.contribution.i18n.json @@ -4,7 +4,5 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "workbenchConfigurationTitle": "工作台", - "welcomePage.enabled": "若啟用,會在啟動時顯示歡迎頁面。", "help": "說明" } \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json b/i18n/cht/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json index 02eb36873b6a11327a7695006179f0434ce9506a..815a7653f57cbf1ad78acb977d49e32042923486 100644 --- a/i18n/cht/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json @@ -4,12 +4,35 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "workbenchConfigurationTitle": "工作台", + "welcomePage.enabled": "若啟用,會在啟動時顯示歡迎頁面。", "welcomePage": "歡迎使用", + "welcomePage.javaScript": "JavaScript", + "welcomePage.typeScript": "TypeScript", + "welcomePage.python": "Python", + "welcomePage.php": "PHP", + "welcomePage.docker": "Docker", + "welcomePage.vim": "活力", + "welcomePage.sublime": "壯麗", + "welcomePage.atom": "Atom", + "welcomePage.extensionPackAlreadyInstalled": "支援功能{0}已被安裝。", + "welcomePage.willReloadAfterInstallingExtensionPack": "{0} 的其他支援安裝完成後,將會重新載入此視窗。", + "welcomePage.installingExtensionPack": "正在安裝 {0} 的其他支援...", + "welcomePage.extensionPackNotFound": "找不到ID為{1}的{0}支援功能.", "welcomePage.keymapAlreadyInstalled": "已安裝 {0} 鍵盤快速鍵。", "welcomePage.willReloadAfterInstallingKeymap": "{0} 鍵盤快速鍵安裝完成後,將會重新載入此視窗。", "welcomePage.installingKeymap": "正在安裝 {0} 鍵盤快速鍵...", "welcomePage.keymapNotFound": "找不到識別碼為 {1} 的 {0} 鍵盤快速鍵。", "welcome.title": "歡迎使用", + "welcomePage.openFolderWithPath": "透過路徑 {1} 開啟資料夾 {0}", + "welcomePage.extensionListSeparator": ",", + "welcomePage.installKeymap": "安裝 {0} 按鍵對應", + "welcomePage.installExtensionPack": "安裝 {0} 的其他支援", + "welcomePage.installedKeymap": "已安裝 {0} 按鍵對應", + "welcomePage.installedExtensionPack": "已安裝 {0} 支援", "ok": "確定", - "cancel": "取消" + "details": "詳細資料", + "cancel": "取消", + "welcomePage.buttonBackground": "起始頁面按鈕的背景色彩.", + "welcomePage.buttonHoverBackground": "起始頁面暫留於按鈕的背景色彩" } \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json b/i18n/cht/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json index 62ddb9869c6e7959a19cf312916146579096d606..920973ad063031dbf345a0f4b623615c6e7d41e9 100644 --- a/i18n/cht/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json +++ b/i18n/cht/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json @@ -5,5 +5,6 @@ // Do not edit this file. It is machine generated. { "walkThrough.unboundCommand": "未繫結", - "walkThrough.gitNotFound": "您的系統上似乎未安裝 Git。" + "walkThrough.gitNotFound": "您的系統上似乎未安裝 Git。", + "walkThrough.embeddedEditorBackground": "編輯器互動區塊的背景色彩." } \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json b/i18n/cht/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json index 66d7f136affb3b1bc7cac32373ebc6d6a2ce7639..0121512656e19c5651c52209ed201dd47434d364 100644 --- a/i18n/cht/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json +++ b/i18n/cht/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json @@ -6,6 +6,12 @@ { "open": "開啟設定", "close": "關閉", + "saveAndRetry": "儲存設定並重啟", "errorUnknownKey": "無法寫入組態檔 (不明的按鍵)", - "errorInvalidTarget": "無法寫入組態檔 (目標無效)" + "errorInvalidTarget": "無法寫入組態檔 (目標無效)", + "errorNoWorkspaceOpened": "無法寫入設定,因為沒有開啟資料夾,請開啟資料夾後再試一次.", + "errorInvalidConfiguration": "無法寫入設定.請開啟**使用者設定**並修正錯誤/警告後再試一次.", + "errorInvalidConfigurationWorkspace": "無法寫入設定.請開啟**工作區設定**並修正檔案中的錯誤/警告後再試一次.", + "errorConfigurationFileDirty": "無法寫入設定,因為檔案已變更.請儲存**使用者設定**後再試一次", + "errorConfigurationFileDirtyWorkspace": "無法寫入設定,因檔案已變更.請儲存**工作區設定**後再試一次." } \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/services/crashReporter/common/crashReporterService.i18n.json b/i18n/cht/src/vs/workbench/services/crashReporter/common/crashReporterService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..e3e021a425489cf10c5f59137bcb6add2faf216a --- /dev/null +++ b/i18n/cht/src/vs/workbench/services/crashReporter/common/crashReporterService.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "telemetryConfigurationTitle": "遙測", + "telemetry.enableCrashReporting": "允許將損毀報告傳送給 Microsoft。\n此選項需要重新啟動才會生效。" +} \ No newline at end of file diff --git a/i18n/cht/src/vs/workbench/services/progress/browser/progressService2.i18n.json b/i18n/cht/src/vs/workbench/services/progress/browser/progressService2.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..6db7d6aae514a031afce5ac346abfd84bb8ee1cc --- /dev/null +++ b/i18n/cht/src/vs/workbench/services/progress/browser/progressService2.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "progress.text": "{0} - {1}", + "progress.title": "{0}: {1}" +} \ No newline at end of file diff --git a/i18n/deu/extensions/git/out/commands.i18n.json b/i18n/deu/extensions/git/out/commands.i18n.json index 1a8943807b8ea219064428542d4d84f0ada3f96e..b3f20ad87c7784c0d6fab2e5bea0e4352f04df06 100644 --- a/i18n/deu/extensions/git/out/commands.i18n.json +++ b/i18n/deu/extensions/git/out/commands.i18n.json @@ -26,6 +26,9 @@ "provide commit message": "Geben Sie eine Commit-Nachrichte ein.", "branch name": "Branchname", "provide branch name": "Geben Sie einen Branchnamen an.", + "select branch to delete": "Wählen Sie einen Branch zum Löschen aus", + "confirm force delete branch": "Der Branch '{0}' ist noch nicht vollständig zusammengeführt. Trotzdem löschen?", + "delete branch": "Branch löschen", "no remotes to pull": "In Ihrem Repository wurden keine Remoteelemente für den Pull konfiguriert.", "no remotes to push": "In Ihrem Repository wurden keine Remoteelemente für den Push konfiguriert.", "nobranch": "Wählen Sie ein Branch für den Push zu einem Remoteelement aus.", diff --git a/i18n/deu/extensions/git/out/main.i18n.json b/i18n/deu/extensions/git/out/main.i18n.json index 6cf07d1824f423befb8299890db8f3b54a7a0ec7..58ab0b365d001bbe96368f12294f08f318d3a0c8 100644 --- a/i18n/deu/extensions/git/out/main.i18n.json +++ b/i18n/deu/extensions/git/out/main.i18n.json @@ -7,5 +7,5 @@ "using git": "Verwenden von Git {0} von {1}", "updateGit": "Git aktualisieren", "neverShowAgain": "Nicht mehr anzeigen", - "git20": "Sie haben anscheinend Git {0} installiert. Der Code funktioniert am besten mit Git 2 oder älter" + "git20": "Sie haben anscheinend Git {0} installiert. Code funktioniert am besten mit Git 2 oder neuer" } \ No newline at end of file diff --git a/i18n/deu/extensions/git/package.i18n.json b/i18n/deu/extensions/git/package.i18n.json index 26ab785ffbf184e187ce01889a634df62ee939d8..1fe0fda130cff769ac44207d18892c0489ba8ac8 100644 --- a/i18n/deu/extensions/git/package.i18n.json +++ b/i18n/deu/extensions/git/package.i18n.json @@ -22,16 +22,17 @@ "command.commitStaged": "Commit bereitgestellt", "command.commitStagedSigned": "Bereitgestelltes committen (unterzeichnet)", "command.commitAll": "Commit für alle ausführen", - "command.commitAllSigned": "Alle committen (abgemeldet)", + "command.commitAllSigned": "Alle committen (unterzeichnet)", "command.undoCommit": "Letzten Commit rückgängig machen", "command.checkout": "Auschecken an...", "command.branch": "Branch erstellen...", + "command.deleteBranch": "Branch löschen...", "command.pull": "Pull", "command.pullRebase": "Pull (Rebase)", "command.push": "Push", "command.pushTo": "Push zu...", "command.sync": "Synchronisierung", - "command.publish": "Veröffentlichen", + "command.publish": "Branch veröffentlichen", "command.showOutput": "Git-Ausgabe anzeigen", "config.enabled": "Gibt an, ob Git aktiviert ist.", "config.path": "Der Pfad zur ausführbaren Git-Datei.", @@ -43,5 +44,6 @@ "config.checkoutType": "Steuert, welcher Branchtyp beim Ausführen von \"Auschecken an...\" aufgelistet wird. \"Alle\" zeigt alle Verweise an, \"Lokal\" nur die lokalen Branches, \"Tags\" zeigt nur Tags an, und \"Remote\" zeigt nur Remotebranches an.", "config.ignoreLegacyWarning": "Ignoriert die Legacy-Git-Warnung.", "config.ignoreLimitWarning": "Ignoriert Warnung bei zu hoher Anzahl von Änderungen in einem Repository", + "config.defaultCloneDirectory": "Das Standard-Verzeichnis für einen Klon eines Git-Repositorys", "config.enableSmartCommit": "Alle Änderungen committen, wenn keine Änderungen bereitgestellt sind." } \ No newline at end of file diff --git a/i18n/deu/extensions/jake/out/main.i18n.json b/i18n/deu/extensions/jake/out/main.i18n.json index 8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a..83268c000718157867d0f1180b5b76f40389ca6b 100644 --- a/i18n/deu/extensions/jake/out/main.i18n.json +++ b/i18n/deu/extensions/jake/out/main.i18n.json @@ -3,4 +3,6 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. -{} \ No newline at end of file +{ + "execFailed": "Fehler bei der automatischen Jake-Erkennung. Fehlermeldung: {0}" +} \ No newline at end of file diff --git a/i18n/deu/extensions/jake/package.i18n.json b/i18n/deu/extensions/jake/package.i18n.json index 8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a..6ca3a5549ddf9a5063136b40a426e3fbf8385b23 100644 --- a/i18n/deu/extensions/jake/package.i18n.json +++ b/i18n/deu/extensions/jake/package.i18n.json @@ -3,4 +3,6 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. -{} \ No newline at end of file +{ + "config.jake.autoDetect": "Steuert, ob die automatische Erkennung von Jake-Tasks aktiviert oder deaktiviert ist. Standardmäßig ist die Funktion aktiviert." +} \ No newline at end of file diff --git a/i18n/deu/extensions/markdown/out/extension.i18n.json b/i18n/deu/extensions/markdown/out/extension.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..490139dcf55e6d8e809ed5ce648dd181a2d1e216 --- /dev/null +++ b/i18n/deu/extensions/markdown/out/extension.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "onPreviewStyleLoadError": "'markdown.styles' konnte nicht geladen werden: {0}" +} \ No newline at end of file diff --git a/i18n/deu/extensions/merge-conflict/out/codelensProvider.i18n.json b/i18n/deu/extensions/merge-conflict/out/codelensProvider.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..278e924d5a5804e5010a3013f7d181b46da135ef --- /dev/null +++ b/i18n/deu/extensions/merge-conflict/out/codelensProvider.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "acceptCurrentChange": "Aktuelle Änderung akzeptieren", + "acceptIncomingChange": "Eingehende Änderung akzeptieren", + "acceptBothChanges": "Beide Änderungen akzeptieren", + "compareChanges": "Änderungen vergleichen" +} \ No newline at end of file diff --git a/i18n/deu/extensions/merge-conflict/out/commandHandler.i18n.json b/i18n/deu/extensions/merge-conflict/out/commandHandler.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..c33f0f8ae6c8d95a20ba2728b3962db28f0b3ccb --- /dev/null +++ b/i18n/deu/extensions/merge-conflict/out/commandHandler.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "cursorNotInConflict": "Der Editor-Cursor ist nicht innerhalb eines Mergingkonflikts", + "compareChangesTitle": "{0}: Aktuelle Änderungen ⟷ Eingehende Änderungen", + "cursorOnSplitterRange": "Der Editor-Cursor ist innerhalb der Mergingkonfliktaufteilung, verschieben Sie ihn entweder in den Block \"aktuell\" oder \"eingehend\".", + "noConflicts": "Keine Merge-Konflikte in dieser Datei gefunden", + "noOtherConflictsInThisFile": "Keine weiteren Merge-Konflikte in dieser Datei" +} \ No newline at end of file diff --git a/i18n/deu/extensions/merge-conflict/out/mergeDecorator.i18n.json b/i18n/deu/extensions/merge-conflict/out/mergeDecorator.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..5ef895aeb90fe6ece24717c7280d41471070849a --- /dev/null +++ b/i18n/deu/extensions/merge-conflict/out/mergeDecorator.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "currentChange": "(Aktuelle Änderung)", + "incomingChange": "(Eingehende Änderung)" +} \ No newline at end of file diff --git a/i18n/deu/extensions/merge-conflict/package.i18n.json b/i18n/deu/extensions/merge-conflict/package.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..5bbe54989dcf36134bac3a5c43adb4dceae4000a --- /dev/null +++ b/i18n/deu/extensions/merge-conflict/package.i18n.json @@ -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. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "command.category": "Merge-Konflikt", + "command.accept.all-incoming": "Alle eingehenden akzeptieren", + "command.accept.all-both": "Alle beide akzeptieren", + "command.accept.current": "Aktuelles akzeptieren", + "command.accept.incoming": "Eingehendes akzeptieren", + "command.accept.selection": "Auswahl akzeptieren", + "command.accept.both": "Beides akzeptieren", + "command.next": "Nächster Konflikt", + "command.previous": "Vorheriger Konflikt", + "command.compare": "Aktuellen Konflikt vergleichen", + "config.title": "Merge-Konflikt", + "config.codeLensEnabled": "CodeLens-Mergingkonfliktblock im Editor aktivieren/deaktivieren", + "config.decoratorsEnabled": "Mergingkonflikt-Decorators im Editor aktivieren/deaktivieren" +} \ No newline at end of file diff --git a/i18n/deu/extensions/npm/package.i18n.json b/i18n/deu/extensions/npm/package.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..df3491b4c052583c360e279bc895be6608fb2c57 --- /dev/null +++ b/i18n/deu/extensions/npm/package.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "config.npm.autoDetect": "Steuert, ob die automatische Erkennung von NPM-Skripts aktiviert oder deaktiviert ist. Standardmäßig ist die Funktion aktiviert." +} \ No newline at end of file diff --git a/i18n/deu/extensions/typescript/out/features/bufferSyncSupport.i18n.json b/i18n/deu/extensions/typescript/out/features/bufferSyncSupport.i18n.json index 055c93e97a340f108cc93ad04b8c951935933399..b8f60f73f8ba58031117ff1870e3dc3d6c88f6e7 100644 --- a/i18n/deu/extensions/typescript/out/features/bufferSyncSupport.i18n.json +++ b/i18n/deu/extensions/typescript/out/features/bufferSyncSupport.i18n.json @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "versionMismatch": "Versionskonflikt zwischen dem globalen TSC ({0}) und dem Sprachdienst von VS Code ({1}). Dies kann zu Kompilierungsfehlern aufgrund von Inkonsistenzen führen.", "moreInformation": "Weitere Informationen", "doNotCheckAgain": "Nicht erneut überprüfen", "close": "Schließen", diff --git a/i18n/deu/extensions/typescript/out/features/directiveCommentCompletionProvider.i18n.json b/i18n/deu/extensions/typescript/out/features/directiveCommentCompletionProvider.i18n.json index 8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a..171e5c786affacbb661809a8d8fab2ead8de19b3 100644 --- a/i18n/deu/extensions/typescript/out/features/directiveCommentCompletionProvider.i18n.json +++ b/i18n/deu/extensions/typescript/out/features/directiveCommentCompletionProvider.i18n.json @@ -3,4 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. -{} \ No newline at end of file +{ + "ts-check": "Aktiviert die Semantiküberprüfung in einer JavaScript-Datei. Muss sich oben in einer Datei befinden.", + "ts-nocheck": "Deaktiviert die Semantiküberprüfung in einer JavaScript-Datei. Muss sich oben in einer Datei befinden.", + "ts-ignore": "Unterdrückt @ts-check-Fehler in der nächsten Zeile einer Datei." +} \ No newline at end of file diff --git a/i18n/deu/extensions/typescript/out/utils/projectStatus.i18n.json b/i18n/deu/extensions/typescript/out/utils/projectStatus.i18n.json index 2ec9b6aab9aa8c6bb839f4f7a9f2a2449242075c..22d044da6195ed1bb5dae46e3430a13edfd79139 100644 --- a/i18n/deu/extensions/typescript/out/utils/projectStatus.i18n.json +++ b/i18n/deu/extensions/typescript/out/utils/projectStatus.i18n.json @@ -6,7 +6,6 @@ { "hintExclude": "Um die JavaScript/TypeScript-Sprachfunktionen für das gesamte Projekt zu aktivieren, schließen Sie Ordner mit vielen Dateien aus. Beispiel: {0}", "hintExclude.generic": "Um JavaScript/TypeScript-Sprachfunktionen für das gesamte Projekt zu aktivieren, schließen Sie große Ordner mit Quelldateien aus, an denen Sie nicht arbeiten.", - "open": "Auszuschließende Elemente konfigurieren", "large.label": "Auszuschließende Elemente konfigurieren", "hintExclude.tooltip": "Um JavaScript/TypeScript-Sprachfunktionen für das gesamte Projekt zu aktivieren, schließen Sie große Ordner mit Quelldateien aus, an denen Sie nicht arbeiten." } \ No newline at end of file diff --git a/i18n/deu/extensions/typescript/out/utils/typingsStatus.i18n.json b/i18n/deu/extensions/typescript/out/utils/typingsStatus.i18n.json index abc0ee901f85f8c5c45bbd5cf3e4451b76d430bd..1f64e53eff2dbe406138eeee5bdccef3e495cbff 100644 --- a/i18n/deu/extensions/typescript/out/utils/typingsStatus.i18n.json +++ b/i18n/deu/extensions/typescript/out/utils/typingsStatus.i18n.json @@ -5,7 +5,7 @@ // Do not edit this file. It is machine generated. { "installingPackages": "Daten werden zum Optimieren von TypeScript IntelliSense abgerufen", - "typesInstallerInitializationFailed.title": "Typisierungsdateien für JavaScript-Sprachfunktionen konnten nicht installiert werden. Stellen Sie sicher, das NPM installiert ist und sich in Ihrem PFAD befindet.", + "typesInstallerInitializationFailed.title": "Typisierungsdateien für JavaScript-Sprachfunktionen konnten nicht installiert werden. Stellen Sie sicher, das NPM installiert ist, oder konfigurieren Sie \"typescript.npm\" in Ihren Benutzereinstellungen.", "typesInstallerInitializationFailed.moreInformation": "Weitere Informationen", "typesInstallerInitializationFailed.doNotCheckAgain": "Nicht erneut überprüfen", "typesInstallerInitializationFailed.close": "Schließen" diff --git a/i18n/deu/extensions/typescript/package.i18n.json b/i18n/deu/extensions/typescript/package.i18n.json index d48740fd4d30794de7df6ecb6829115aabf23e24..86ef4eb0ea43bd3606e5f3460d82237abfb69acc 100644 --- a/i18n/deu/extensions/typescript/package.i18n.json +++ b/i18n/deu/extensions/typescript/package.i18n.json @@ -13,7 +13,6 @@ "typescript.check.tscVersion": "Überprüfen, ob sich ein global installierter TypeScript-Compiler (z. B. tsc) vom verwendeten TypeScript-Sprachdienst unterscheidet.", "typescript.tsserver.log": "Aktiviert die Protokollierung des TS-Servers in eine Datei. Mithilfe der Protokolldatei lassen sich Probleme beim TS-Server diagnostizieren. Die Protokolldatei kann Dateipfade, Quellcode und weitere potenziell sensible Informationen aus Ihrem Projekt enthalten.", "typescript.tsserver.trace": "Aktiviert die Ablaufverfolgung von an den TS-Server gesendeten Nachrichten. Mithilfe der Ablaufverfolgung lassen sich Probleme beim TS-Server diagnostizieren. Die Ablaufverfolgung kann Dateipfade, Quellcode und weitere potenziell sensible Informationen aus Ihrem Projekt enthalten.", - "typescript.tsserver.experimentalAutoBuild": "Ermöglicht experimentelle automatische Buildvorgänge. Erfordert Version 1.9 dev oder 2.x tsserver sowie einen Neustart von VS Code nach der Änderung.", "typescript.validate.enable": "TypeScript-Überprüfung aktivieren/deaktivieren.", "typescript.format.enable": "Standardmäßigen TypeScript-Formatierer aktivieren/deaktivieren.", "javascript.format.enable": "Standardmäßigen JavaScript-Formatierer aktivieren/deaktivieren.", @@ -33,9 +32,16 @@ "javascript.validate.enable": "JavaScript-Überprüfung aktivieren/deaktivieren.", "typescript.goToProjectConfig.title": "Zur Projektkonfiguration wechseln", "javascript.goToProjectConfig.title": "Zur Projektkonfiguration wechseln", + "javascript.referencesCodeLens.enabled": "Aktiviert oder deaktiviert CodeLens-Verweise in JavaScript Dateien. Erfordert TypeScript 2.0.6 oder höher.", + "typescript.referencesCodeLens.enabled": "Aktiviert oder deaktiviert CodeLens-Verweise in TypeScript Dateien. Erfordert TypeScript 2.0.6 oder höher.", "typescript.implementationsCodeLens.enabled": "Aktiviert oder deaktiviert CodeLens-Implementierungen. Erfordert TypeScript 2.2.0 oder höher.", + "typescript.openTsServerLog.title": "TS Server-Protokolldatei öffnen", + "typescript.restartTsServer": "TS Server neu starten", "typescript.selectTypeScriptVersion.title": "TypeScript-Version wählen", "jsDocCompletion.enabled": "Automatische JSDoc-Kommentare aktivieren/deaktivieren", "javascript.implicitProjectConfig.checkJs": "Aktiviert/deaktiviert die Semantikprüfung bei JavaScript-Dateien. Diese Einstellung wird von vorhandenen \"jsconfig.json\"- oder \"tsconfig.json\"-Dateien außer Kraft gesetzt. Erfordert TypeScript 2.3.1 oder höher.", - "typescript.check.npmIsInstalled": "Überprüfen, ob NPM für automatische Typerfassung installiert ist" + "typescript.npm": "Gibt den Pfad zur ausführbaren NPM-Datei an, die für die automatische Typerfassung verwendet wird. Hierfür ist TypeScript 2.3.4 oder höher erforderlich.", + "typescript.check.npmIsInstalled": "Überprüfen Sie, ob NPM für die automatische Typerfassung installiert ist.", + "javascript.nameSuggestions": "Das Einbeziehen eindeutiger Namen von der Datei in der JavaScript-Vorschlagsliste aktivieren/deaktivieren.", + "typescript.tsc.autoDetect": "Steuert, ob die automatische Erkennung von tsc-Tasks aktiviert oder deaktiviert ist.\n" } \ No newline at end of file diff --git a/i18n/deu/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json b/i18n/deu/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json index a2b0a61e0fa19a7e81da3a0ddc85c4d29d49ccf8..9b3e7fa3e6ebbeae25e65bdc5a83447971bd6a5c 100644 --- a/i18n/deu/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json +++ b/i18n/deu/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json @@ -6,8 +6,7 @@ { "imgMeta": "{0}x{1} {2}", "largeImageError": "Das Bild ist zu groß für den Editor. ", - "resourceOpenExternalButton": "Bild öffnen", - "resourceOpenExternalText": " mit externem Programm?", + "resourceOpenExternalButton": "Bild mit externem Programm öffnen?", "nativeBinaryError": "Die Datei wird nicht im Editor angezeigt, weil sie binär oder sehr groß ist oder eine nicht unterstützte Textcodierung verwendet.", "sizeB": "{0} B", "sizeKB": "{0} KB", diff --git a/i18n/deu/src/vs/base/common/errorMessage.i18n.json b/i18n/deu/src/vs/base/common/errorMessage.i18n.json index 4bda5bf72a26850da27e8877eaa7cb4371b47e6c..70a2d54842570c48a748e0bd65c2675aa2626203 100644 --- a/i18n/deu/src/vs/base/common/errorMessage.i18n.json +++ b/i18n/deu/src/vs/base/common/errorMessage.i18n.json @@ -13,6 +13,5 @@ "error.connection.unknown": "Es ist ein unbekannter Verbindungsfehler aufgetreten. Entweder besteht keine Internetverbindung mehr, oder der verbundene Server ist offline.", "stackTrace.format": "{0}: {1}", "error.defaultMessage": "Ein unbekannter Fehler ist aufgetreten. Weitere Details dazu finden Sie im Protokoll.", - "nodeExceptionMessage": "Systemfehler ({0})", "error.moreErrors": "{0} ({1} Fehler gesamt)" } \ No newline at end of file diff --git a/i18n/deu/src/vs/base/common/keybindingLabels.i18n.json b/i18n/deu/src/vs/base/common/keybindingLabels.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a --- /dev/null +++ b/i18n/deu/src/vs/base/common/keybindingLabels.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{} \ No newline at end of file diff --git a/i18n/deu/src/vs/code/electron-main/menus.i18n.json b/i18n/deu/src/vs/code/electron-main/menus.i18n.json index 2a26af07f79de9314baeb6df038f0dde85641bd6..40280594bf95e641bddcca22d149e96ac37d882a 100644 --- a/i18n/deu/src/vs/code/electron-main/menus.i18n.json +++ b/i18n/deu/src/vs/code/electron-main/menus.i18n.json @@ -14,6 +14,7 @@ "mHelp": "&&Hilfe", "miNewWindow": "Neues &&Fenster", "mAbout": "Informationen zu {0}", + "mServices": "Dienste", "mHide": "{0} ausblenden", "mHideOthers": "Andere ausblenden", "mShowAll": "Alle anzeigen", @@ -54,6 +55,9 @@ "miShowEmmetCommands": "E&&mmet...", "miToggleLineComment": "Zeilenkommen&&tar umschalten", "miToggleBlockComment": "&&Blockkommentar umschalten", + "miMultiCursorAlt": "Verwenden Sie Alt+Mausklick für Multi-Cursor", + "miMultiCursorCmd": "Verwenden Sie Befehlstaste+Mausklick für Multi-Cursor", + "miMultiCursorCtrl": "Verwenden Sie STRG+Mausklick für Multi-Cursor", "miInsertCursorAbove": "Cursor oberh&&alb hinzufügen", "miInsertCursorBelow": "Cursor unterhal&&b hinzufügen", "miInsertCursorAtEndOfEachLineSelected": "C&&ursor an Zeilenenden hinzufügen", @@ -69,6 +73,7 @@ "miSmartSelectShrink": "Au&&swahl verkleinern", "miViewExplorer": "&&Explorer", "miViewSearch": "&&Suchen", + "miViewSCM": "S&&CM", "miViewDebug": "&&Debuggen", "miViewExtensions": "E&&xtensions", "miToggleOutput": "&&Ausgabe", @@ -113,6 +118,8 @@ "miGotoSymbolInFile": "Gehe zu &&Symbol in Datei...", "miGotoSymbolInWorkspace": "Zu Symbol im &&Arbeitsbereich wechseln...", "miGotoDefinition": "Gehe &&zu Definition", + "miGotoTypeDefinition": "Wechsle zu &&Typdefinition", + "miGotoImplementation": "Wechsle zur &&Implementierung", "miGotoLine": "Gehe zu &&Zeile...", "miStartDebugging": "&&Debugging starten", "miStartWithoutDebugging": "&&Ohne Debugging starten", @@ -129,16 +136,17 @@ "miColumnBreakpoint": "S&&paltenhaltepunkt", "miFunctionBreakpoint": "&&Funktionshaltepunkt...", "miNewBreakpoint": "&&Neuer Haltepunkt", + "miEnableAllBreakpoints": "Alle Haltepunkte aktivieren", "miDisableAllBreakpoints": "A&&lle Haltepunkte deaktivieren", "miRemoveAllBreakpoints": "&&Alle Haltepunkte entfernen", "miInstallAdditionalDebuggers": "&&Zusätzliche Debugger installieren...", "mMinimize": "Minimieren", - "mClose": "Schließen", "mBringToFront": "Alle in den Vordergrund", "miToggleDevTools": "&&Entwicklungertools umschalten", "miAccessibilityOptions": "&&Optionen für erleichterte Bedienung", "miReportIssues": "&&Probleme melden", "miWelcome": "&&Willkommen", + "miInteractivePlayground": "&&Interactive Spielwiese", "miDocumentation": "&&Dokumentation", "miReleaseNotes": "&&Anmerkungen zu dieser Version", "miKeyboardShortcuts": "&&Referenz für Tastenkombinationen", @@ -148,12 +156,14 @@ "miLicense": "&&Lizenz anzeigen", "miPrivacyStatement": "&&Datenschutzerklärung", "miAbout": "&&Info", + "miTerminateTask": "&&Task beenden", + "accessibilityOptionsWindowTitle": "Optionen für erleichterte Bedienung", "miRestartToUpdate": "Für Update neu starten...", "miCheckingForUpdates": "Überprüfen auf Updates...", "miDownloadUpdate": "Verfügbares Update herunterladen", "miDownloadingUpdate": "Das Update wird heruntergeladen...", "miInstallingUpdate": "Update wird installiert...", - "miCheckForUpdates": "Auf Updates überprüfen...", + "miCheckForUpdates": "Nach Aktualisierungen suchen...", "aboutDetail": "\nVersion {0}\nCommit {1}\nDatum {2}\nShell {3}\nRenderer {4}\nNode {5}", "okButton": "OK" } \ No newline at end of file diff --git a/i18n/deu/src/vs/code/electron-main/windows.i18n.json b/i18n/deu/src/vs/code/electron-main/windows.i18n.json index 19ea01ffe2beaf75caa270ab936ca55e2c3aec26..28895782363852e53ea0159f08b7434005e4ab98 100644 --- a/i18n/deu/src/vs/code/electron-main/windows.i18n.json +++ b/i18n/deu/src/vs/code/electron-main/windows.i18n.json @@ -7,16 +7,11 @@ "ok": "OK", "pathNotExistTitle": "Der Pfad ist nicht vorhanden.", "pathNotExistDetail": "Der Pfad \"{0}\" scheint auf dem Datenträger nicht mehr vorhanden zu sein.", - "accessibilityOptionsWindowTitle": "Optionen für erleichterte Bedienung", "reopen": "Erneut öffnen", "wait": "Bitte warten.", "close": "Schließen", "appStalled": "Das Fenster reagiert nicht mehr.", "appStalledDetail": "Sie können das Fenster erneut öffnen oder schließen oder weiterhin warten.", "appCrashed": "Das Fenster ist abgestürzt.", - "appCrashedDetail": "Bitte entschuldigen Sie die Unannehmlichkeiten. Sie können das Fenster erneut öffnen und dort weitermachen, wo Sie aufgehört haben.", - "newWindow": "Neues Fenster", - "newWindowDesc": "Öffnet ein neues Fenster.", - "recentFolders": "Zuletzt verwendete Ordner", - "folderDesc": "{0} {1}" + "appCrashedDetail": "Bitte entschuldigen Sie die Unannehmlichkeiten. Sie können das Fenster erneut öffnen und dort weitermachen, wo Sie aufgehört haben." } \ No newline at end of file diff --git a/i18n/deu/src/vs/editor/common/config/commonEditorConfig.i18n.json b/i18n/deu/src/vs/editor/common/config/commonEditorConfig.i18n.json index 2fe70e62eed2e914da22647100d3e92abd580b4a..78d7ebc307eb8118afd11d593faec4c1a969ab39 100644 --- a/i18n/deu/src/vs/editor/common/config/commonEditorConfig.i18n.json +++ b/i18n/deu/src/vs/editor/common/config/commonEditorConfig.i18n.json @@ -9,6 +9,7 @@ "fontWeight": "Steuert die Schriftbreite.", "fontSize": "Steuert den Schriftgrad in Pixeln.", "lineHeight": "Steuert die Zeilenhöhe. Verwenden Sie 0, um LineHeight aus der FontSize-Angabe zu berechnen.", + "letterSpacing": "Steuert den Zeichenabstand in Pixeln.", "lineNumbers": "Steuert die Anzeige von Zeilennummern. Mögliche Werte sind \"Ein\", \"Aus\" und \"Relativ\". \"Relativ\" zeigt die Zeilenanzahl ab der aktuellen Cursorposition.", "rulers": "Spalten, an denen vertikale Lineale angezeigt werden sollen", "wordSeparators": "Zeichen, die als Worttrennzeichen verwendet werden, wenn wortbezogene Navigationen oder Vorgänge ausgeführt werden.", @@ -22,6 +23,8 @@ "minimap.enabled": "Steuert, ob die Minikarte angezeigt wird", "minimap.renderCharacters": "Die tatsächlichen Zeichen in einer Zeile rendern (im Gegensatz zu Farbblöcken)", "minimap.maxColumn": "Breite der Minikarte beschränken, um höchstens eine bestimmte Anzahl von Spalten zu rendern", + "find.seedSearchStringFromSelection": "Steuert, ob wir für die Suchzeichenfolge im Suchwidget aus der Editorauswahl ein Seeding ausführen.", + "find.autoFindInSelection": "Steuert, ob die Kennzeichnung \"In Auswahl suchen\" aktiviert ist, wenn mehrere Zeichen oder Textzeilen im Editor ausgewählt wurden.", "wordWrap.off": "Zeilenumbrüche erfolgen nie.", "wordWrap.on": "Der Zeilenumbruch erfolgt an der Breite des Anzeigebereichs.", "wordWrap.wordWrapColumn": "Der Zeilenbereich erfolgt bei \"editor.wordWrapColumn\".", @@ -30,17 +33,19 @@ "wordWrapColumn": "Steuert die Umbruchspalte des Editors, wenn für \"editor.wordWrap\" die Option \"wordWrapColumn\" oder \"bounded\" festgelegt ist.", "wrappingIndent": "Steuert den Einzug der umbrochenen Zeilen. Der Wert kann \"none\", \"same\" oder \"indent\" sein.", "mouseWheelScrollSensitivity": "Ein Multiplikator, der für die Mausrad-Bildlaufereignisse \"deltaX\" und \"deltaY\" verwendet werden soll.", + "multiCursorModifier.ctrlCmd": "Ist unter Windows und Linux der Taste \"STRG\" und unter OSX der Befehlstaste zugeordnet.", + "multiCursorModifier.alt": "Ist unter Windows und Linux der Taste \"Alt\" und unter OSX der Wahltaste zugeordnet. ", + "multiCursorModifier": "Der Modifizierer, der zum Hinzufügen mehrerer Cursor mit der Maus verwendet wird. \"ctrlCmd\" wird unter Windows und Linux der Taste \"STRG\" und unter OSX der Befehlstaste zugeordnet. Die Mausbewegungen \"Gehe zu Definition\" und \"Link öffnen\" werden so angepasst, dass kein Konflikt mit dem Multi-Cursor-Modifizierer entsteht.", "quickSuggestions.strings": "Schnellvorschläge innerhalb von Zeichenfolgen aktivieren.", "quickSuggestions.comments": "Schnellvorschläge innerhalb von Kommentaren aktivieren.", "quickSuggestions.other": "Schnellvorschläge außerhalb von Zeichenfolgen und Kommentaren aktivieren.", "quickSuggestions": "Steuert, ob Vorschläge während der Eingabe automatisch angezeigt werden sollen.", "quickSuggestionsDelay": "Steuert die Verzögerung in ms für die Anzeige der Schnellvorschläge.", - "parameterHints": "Aktiviert Parameterhinweise.", "autoClosingBrackets": "Steuert, ob der Editor Klammern automatisch nach dem Öffnen schließt.", "formatOnType": "Steuert, ob der Editor Zeilen automatisch nach der Eingabe formatiert.", "formatOnPaste": "Steuert, ob der Editor den eingefügten Inhalt automatisch formatiert.", "suggestOnTriggerCharacters": "Steuert, ob Vorschläge automatisch bei der Eingabe von Triggerzeichen angezeigt werden.", - "acceptSuggestionOnEnter": "Steuert, ob Vorschläge über die Eingabetaste (zusätzlich zur TAB-Taste) angenommen werden sollen. Vermeidet Mehrdeutigkeit zwischen dem Einfügen neuer Zeilen oder dem Annehmen von Vorschlägen.", + "acceptSuggestionOnEnter": "Steuert, ob Vorschläge über die Eingabetaste (zusätzlich zur TAB-Taste) angenommen werden sollen. Vermeidet Mehrdeutigkeit zwischen dem Einfügen neuer Zeilen oder dem Annehmen von Vorschlägen. Der Wert \"smart\" bedeutet, dass ein Vorschlag nur über die Eingabetaste akzeptiert wird, wenn eine Textänderung vorgenommen wird.", "acceptSuggestionOnCommitCharacter": "Steuert, ob Vorschläge über Commitzeichen angenommen werden sollen. In JavaScript kann ein Semikolon (\";\") beispielsweise ein Commitzeichen sein, das einen Vorschlag annimmt und dieses Zeichen eingibt.", "snippetSuggestions": "Steuert, ob Codeausschnitte mit anderen Vorschlägen angezeigt und wie diese sortiert werden.", "emptySelectionClipboard": "Steuert, ob ein Kopiervorgang ohne Auswahl die aktuelle Zeile kopiert.", @@ -62,12 +67,17 @@ "renderLineHighlight": "Steuert, wie der Editor die aktuelle Zeilenhervorhebung rendern soll. Mögliche Werte sind \"none\", \"gutter\", \"line\" und \"all\".", "codeLens": "Steuert, ob der Editor CodeLenses anzeigt.", "folding": "Steuert, ob für den Editor Codefaltung aktiviert ist.", + "showFoldingControls": "Steuert, ob die Falt-Steuerelemente an der Leiste automatisch ausgeblendet werden.", "matchBrackets": "Übereinstimmende Klammern hervorheben, wenn eine davon ausgewählt wird.", "glyphMargin": "Steuert, ob der Editor den vertikalen Glyphenrand rendert. Der Glyphenrand wird hauptsächlich zum Debuggen verwendet.", "useTabStops": "Das Einfügen und Löschen von Leerzeichen folgt auf Tabstopps.", "trimAutoWhitespace": "Nachfolgendes automatisch eingefügtes Leerzeichen entfernen", "stablePeek": "Peek-Editoren geöffnet lassen, auch wenn auf ihren Inhalt doppelgeklickt oder die ESC-TASTE gedrückt wird.", "dragAndDrop": "Steuert, ob der Editor das Verschieben einer Auswahl per Drag and Drop zulässt.", + "accessibilitySupport.auto": "Der Editor verwendet Plattform-APIs, um zu erkennen, wenn eine Sprachausgabe angefügt wird.", + "accessibilitySupport.on": "Der Editor wird durchgehend für die Verwendung mit einer Sprachausgabe optimiert.", + "accessibilitySupport.off": "Der Editor wird nie für die Verwendung mit einer Sprachausgabe optimiert. ", + "accessibilitySupport": "Steuert, ob der Editor in einem Modus ausgeführt werden soll, in dem er für die Sprachausgabe optimiert wird.", "sideBySide": "Steuert, ob der Diff-Editor das Diff nebeneinander oder inline anzeigt.", "ignoreTrimWhitespace": "Steuert, ob der Diff-Editor Änderungen in führenden oder nachgestellten Leerzeichen als Diffs anzeigt.", "renderIndicators": "Steuert, ob der Diff-Editor die Indikatoren \"+\" und \"-\" für hinzugefügte/entfernte Änderungen anzeigt.", diff --git a/i18n/deu/src/vs/editor/common/config/editorOptions.i18n.json b/i18n/deu/src/vs/editor/common/config/editorOptions.i18n.json index 2e06d6b808ae3d2aa09d9c1dfc3bcd14cc2d49ba..b892d619fd6caf95203961f3e88c00cb3f00a673 100644 --- a/i18n/deu/src/vs/editor/common/config/editorOptions.i18n.json +++ b/i18n/deu/src/vs/editor/common/config/editorOptions.i18n.json @@ -4,5 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "accessibilityOffAriaLabel": "Der Editor ist zurzeit nicht verfügbar. Drücken Sie Alt+F1 für Optionen.", "editorViewAccessibleLabel": "Editor-Inhalt" } \ No newline at end of file diff --git a/i18n/deu/src/vs/editor/common/view/editorColorRegistry.i18n.json b/i18n/deu/src/vs/editor/common/view/editorColorRegistry.i18n.json index de766791c879678cbd5c8701a0f3497c3d941df6..56e0924a36c8f29bc1b45ad635d4feda8d334958 100644 --- a/i18n/deu/src/vs/editor/common/view/editorColorRegistry.i18n.json +++ b/i18n/deu/src/vs/editor/common/view/editorColorRegistry.i18n.json @@ -11,6 +11,14 @@ "editorWhitespaces": "Farbe der Leerzeichen im Editor.", "editorIndentGuides": "Farbe der Führungslinien für Einzüge im Editor.", "editorLineNumbers": "Zeilennummernfarbe im Editor.", + "editorRuler": "Farbe des Editor-Lineals.", "editorCodeLensForeground": "Vordergrundfarbe der CodeLens-Links im Editor", - "editorBracketMatchBackground": "Hintergrundfarbe für zusammengehörige Klammern" + "editorBracketMatchBackground": "Hintergrundfarbe für zusammengehörige Klammern", + "editorBracketMatchBorder": "Farbe für zusammengehörige Klammern", + "editorOverviewRulerBorder": "Farbe des Rahmens für das Übersicht-Lineal.", + "editorGutter": "Hintergrundfarbe der Editorleiste. Die Leiste enthält die Glyphenränder und die Zeilennummern.", + "errorForeground": "Vordergrundfarbe von Fehlerunterstreichungen im Editor.", + "errorBorder": "Rahmenfarbe von Fehlerunterstreichungen im Editor.", + "warningForeground": "Vordergrundfarbe von Warnungsunterstreichungen im Editor.", + "warningBorder": "Rahmenfarbe von Warnungsunterstreichungen im Editor." } \ No newline at end of file diff --git a/i18n/deu/src/vs/editor/contrib/find/common/findController.i18n.json b/i18n/deu/src/vs/editor/contrib/find/common/findController.i18n.json index e4d42f465d1858e1f54aaf0405811881d7e308d5..56e65f90b2e03debfcfcb10b41b9d4b8f124e1bc 100644 --- a/i18n/deu/src/vs/editor/contrib/find/common/findController.i18n.json +++ b/i18n/deu/src/vs/editor/contrib/find/common/findController.i18n.json @@ -14,6 +14,5 @@ "addSelectionToPreviousFindMatch": "Letzte Auswahl zu vorheriger Übereinstimmungssuche hinzufügen", "moveSelectionToNextFindMatch": "Letzte Auswahl in nächste Übereinstimmungssuche verschieben", "moveSelectionToPreviousFindMatch": "Letzte Auswahl in vorherige Übereinstimmungssuche verschieben", - "selectAllOccurencesOfFindMatch": "Alle Vorkommen auswählen und Übereinstimmung suchen", "changeAll.label": "Alle Vorkommen ändern" } \ No newline at end of file diff --git a/i18n/deu/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.i18n.json b/i18n/deu/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..ffee2c2fa36db23f7242d84e7e74135e1c6af175 --- /dev/null +++ b/i18n/deu/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.i18n.json @@ -0,0 +1,23 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "noResultWord": "Keine Definition gefunden für \"{0}\".", + "generic.noResults": "Keine Definition gefunden", + "meta.title": " – {0} Definitionen", + "actions.goToDecl.label": "Gehe zu Definition", + "actions.goToDeclToSide.label": "Definition an der Seite öffnen", + "actions.previewDecl.label": "Peek-Definition", + "goToImplementation.noResultWord": "Keine Implementierung gefunden für \"{0}\"", + "goToImplementation.generic.noResults": "Keine Implementierung gefunden", + "meta.implementations.title": "{0} Implementierungen", + "actions.goToImplementation.label": "Zur Implementierung wechseln", + "actions.peekImplementation.label": "Vorschau der Implementierung anzeigen", + "goToTypeDefinition.noResultWord": "Keine Typendefinition gefunden für \"{0}\"", + "goToTypeDefinition.generic.noResults": "Keine Typendefinition gefunden", + "meta.typeDefinitions.title": "{0} Typdefinitionen", + "actions.goToTypeDefinition.label": "Zur Typdefinition wechseln", + "actions.peekTypeDefinition.label": "Vorschau der Typdefinition anzeigen" +} \ No newline at end of file diff --git a/i18n/deu/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.i18n.json b/i18n/deu/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..2d5f00609a890440519b03a996f9e0e7bdefe0a2 --- /dev/null +++ b/i18n/deu/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "multipleResults": "Klicken Sie, um {0} Definitionen anzuzeigen." +} \ No newline at end of file diff --git a/i18n/deu/src/vs/editor/contrib/links/browser/links.i18n.json b/i18n/deu/src/vs/editor/contrib/links/browser/links.i18n.json index 84459913349866b4c3ff5e810e65d55b689dcd3e..3c582ab348dc5604ca30eb69084a46956bb9dbb1 100644 --- a/i18n/deu/src/vs/editor/contrib/links/browser/links.i18n.json +++ b/i18n/deu/src/vs/editor/contrib/links/browser/links.i18n.json @@ -6,6 +6,7 @@ { "links.navigate.mac": "BEFEHLSTASTE + Mausklick zum Aufrufen des Links", "links.navigate": "STRG + Mausklick zum Aufrufen des Links", + "links.navigate.al": "ALT + Mausklick zum Aufrufen des Links", "invalid.url": "Fehler beim Öffnen dieses Links, weil er nicht wohlgeformt ist: {0}", "missing.url": "Fehler beim Öffnen dieses Links, weil das Ziel fehlt.", "label": "Link öffnen" diff --git a/i18n/deu/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json b/i18n/deu/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json index ff88046159d0fb71041f324ace85cd68a74b7c15..5db5e40ca1e20e1bcd9574df6c9bd61a971a1a88 100644 --- a/i18n/deu/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json +++ b/i18n/deu/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json @@ -5,8 +5,6 @@ // Do not edit this file. It is machine generated. { "aria.oneReference": "Symbol in {0} in Zeile {1}, Spalte {2}", - "aria.fileReferences.1": "1 Symbol in {0}", - "aria.fileReferences.N": "{0} Symbole in {1}", "aria.result.0": "Es wurden keine Ergebnisse gefunden.", "aria.result.1": "1 Symbol in {0} gefunden", "aria.result.n1": "{0} Symbole in {1} gefunden", diff --git a/i18n/deu/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.i18n.json b/i18n/deu/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.i18n.json index d115a4e214a9e1e59eb47b7bf708fa68737becea..358b448e65f6bf80af81ea14a67ad27d698242cc 100644 --- a/i18n/deu/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.i18n.json +++ b/i18n/deu/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.i18n.json @@ -16,9 +16,12 @@ "peekViewTitleInfoForeground": "Farbe der Titelinformationen in der Peek-Ansicht.", "peekViewBorder": "Farbe der Peek-Ansichtsränder und des Pfeils.", "peekViewResultsBackground": "Hintergrundfarbe der Ergebnisliste in der Peek-Ansicht.", + "peekViewResultsMatchForeground": "Vordergrundfarbe für Zeilenknoten in der Ergebnisliste der Peek-Ansicht.", + "peekViewResultsFileForeground": "Vordergrundfarbe für Dateiknoten in der Ergebnisliste der Peek-Ansicht.", "peekViewResultsSelectionBackground": "Hintergrundfarbe des ausgewählten Eintrags in der Ergebnisliste der Peek-Ansicht.", "peekViewResultsSelectionForeground": "Vordergrundfarbe des ausgewählten Eintrags in der Ergebnisliste der Peek-Ansicht.", "peekViewEditorBackground": "Hintergrundfarbe des Peek-Editors.", + "peekViewEditorGutterBackground": "Hintergrundfarbe der Leiste im Peek-Editor.", "peekViewResultsMatchHighlight": "Farbe für Übereinstimmungsmarkierungen in der Ergebnisliste der Peek-Ansicht.", "peekViewEditorMatchHighlight": "Farbe für Übereinstimmungsmarkierungen im Peek-Editor." } \ No newline at end of file diff --git a/i18n/deu/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json b/i18n/deu/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json index 73686f1e29534a7e0785d439a520bede99fd2677..df507c729f97288f3037cba75417849cfde6da9f 100644 --- a/i18n/deu/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json +++ b/i18n/deu/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json @@ -12,6 +12,7 @@ "readMore": "Mehr anzeigen...{0}", "suggestionWithDetailsAriaLabel": "{0}, Vorschlag, hat Details", "suggestionAriaLabel": "{0}, Vorschlag", + "readLess": "Weniger anzeigen...{0}", "suggestWidget.loading": "Wird geladen...", "suggestWidget.noSuggestions": "Keine Vorschläge.", "suggestionAriaAccepted": "{0}, angenommen", diff --git a/i18n/deu/src/vs/editor/node/languageConfigurationExtensionPoint.i18n.json b/i18n/deu/src/vs/editor/node/languageConfigurationExtensionPoint.i18n.json index 0dd09877b283bbee6cfcaa746f6661f3e7707b31..91b2f0a1b1a386894350a4e23a8665c8aa193b61 100644 --- a/i18n/deu/src/vs/editor/node/languageConfigurationExtensionPoint.i18n.json +++ b/i18n/deu/src/vs/editor/node/languageConfigurationExtensionPoint.i18n.json @@ -15,5 +15,9 @@ "schema.brackets": "Definiert die Klammersymbole, die den Einzug vergrößern oder verkleinern.", "schema.autoClosingPairs": "Definiert die Klammerpaare. Wenn eine öffnende Klammer eingegeben wird, wird die schließende Klammer automatisch eingefügt.", "schema.autoClosingPairs.notIn": "Definiert eine Liste von Bereichen, in denen die automatischen Paare deaktiviert sind.", - "schema.surroundingPairs": "Definiert die Klammerpaare, in die eine ausgewählte Zeichenfolge eingeschlossen werden kann." + "schema.surroundingPairs": "Definiert die Klammerpaare, in die eine ausgewählte Zeichenfolge eingeschlossen werden kann.", + "schema.wordPattern": "Die Worddefinition für die Sprache.", + "schema.wordPattern.pattern": "RegExp Muster für Wortübereinstimmungen.", + "schema.wordPattern.flags": "RegExp Kennzeichen für Wortübereinstimmungen", + "schema.wordPattern.flags.errorMessage": "Muss mit dem Muster `/^([gimuy]+)$/` übereinstimmen." } \ No newline at end of file diff --git a/i18n/deu/src/vs/platform/actions/electron-browser/menusExtensionPoint.i18n.json b/i18n/deu/src/vs/platform/actions/electron-browser/menusExtensionPoint.i18n.json index e82addc678451fab2337774be83a3eb361f1b21e..e957466c8a6bdaad106bab92d42c6ecd4cc861d9 100644 --- a/i18n/deu/src/vs/platform/actions/electron-browser/menusExtensionPoint.i18n.json +++ b/i18n/deu/src/vs/platform/actions/electron-browser/menusExtensionPoint.i18n.json @@ -21,6 +21,8 @@ "menus.scmTitle": "Das Titelmenü der Quellcodeverwaltung", "menus.resourceGroupContext": "Das Ressourcengruppen-Kontextmenü der Quellcodeverwaltung", "menus.resourceStateContext": "Das Ressourcenstatus-Kontextmenü der Quellcodeverwaltung", + "view.viewTitle": "Das beigetragene Editor-Titelmenü.", + "view.itemContext": "Das beigetragene Anzeigeelement-Kontextmenü.", "nonempty": "Es wurde ein nicht leerer Wert erwartet.", "opticon": "Die Eigenschaft \"icon\" kann ausgelassen werden oder muss eine Zeichenfolge oder ein Literal wie \"{dark, light}\" sein.", "requireStringOrObject": "Die Eigenschaft \"{0}\" ist obligatorisch und muss vom Typ \"Zeichenfolge\" oder \"Objekt\" sein.", diff --git a/i18n/deu/src/vs/platform/extensions/common/extensionsRegistry.i18n.json b/i18n/deu/src/vs/platform/extensions/common/extensionsRegistry.i18n.json index d6cbe93d2b63366260c416af62c9c7ca5c3add88..2a33dae4abf0ad366067e5aee3f35ce6efad890a 100644 --- a/i18n/deu/src/vs/platform/extensions/common/extensionsRegistry.i18n.json +++ b/i18n/deu/src/vs/platform/extensions/common/extensionsRegistry.i18n.json @@ -14,6 +14,12 @@ "vscode.extension.contributes": "Alle Beiträge der VS Code-Extension, die durch dieses Paket dargestellt werden.", "vscode.extension.preview": "Legt die Erweiterung fest, die im Marketplace als Vorschau gekennzeichnet werden soll.", "vscode.extension.activationEvents": "Aktivierungsereignisse für die VS Code-Extension.", + "vscode.extension.activationEvents.onLanguage": "Ein Aktivierungsereignis wird beim Öffnen einer Datei ausgegeben, die in die angegebene Sprache aufgelöst wird.", + "vscode.extension.activationEvents.onCommand": "Ein Aktivierungsereignis wird beim Aufrufen des angegebenen Befehls ausgegeben.", + "vscode.extension.activationEvents.onDebug": "Ein Aktivierungsereignis wird beim Starten einer Debugsitzung des angegebenen Typs ausgegeben.", + "vscode.extension.activationEvents.workspaceContains": "Ein Aktivierungsereignis wird beim Öffnen eines Ordners ausgegeben, der mindestens eine Datei enthält, die mit dem angegebenen Globmuster übereinstimmt.", + "vscode.extension.activationEvents.onView": "Ein Aktivierungsereignis wird beim Erweitern der angegebenen Ansicht ausgegeben.", + "vscode.extension.activationEvents.star": "Ein Aktivierungsereignis wird beim Start von VS Code ausgegeben. Damit für die Endbenutzer eine bestmögliche Benutzerfreundlichkeit sichergestellt ist, verwenden Sie dieses Aktivierungsereignis in Ihrer Erweiterung nur dann, wenn in Ihrem Anwendungsfall keine andere Kombination an Aktivierungsereignissen funktioniert.", "vscode.extension.badges": "Array aus Badges, die im Marketplace in der Seitenleiste auf der Seite mit den Erweiterungen angezeigt werden.", "vscode.extension.badges.url": "Die Bild-URL für den Badge.", "vscode.extension.badges.href": "Der Link für den Badge.", diff --git a/i18n/deu/src/vs/platform/history/electron-main/historyMainService.i18n.json b/i18n/deu/src/vs/platform/history/electron-main/historyMainService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..88004b1c71eca073d0da66b94c975f28bc33f1ff --- /dev/null +++ b/i18n/deu/src/vs/platform/history/electron-main/historyMainService.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "newWindow": "Neues Fenster", + "newWindowDesc": "Öffnet ein neues Fenster.", + "recentFolders": "Zuletzt verwendete Ordner", + "folderDesc": "{0} {1}" +} \ No newline at end of file diff --git a/i18n/deu/src/vs/platform/markers/common/problemMatcher.i18n.json b/i18n/deu/src/vs/platform/markers/common/problemMatcher.i18n.json index 565c50e40d10f7538029109f584d34e62b0c869e..d6bda033f73309844dbbbe472b81a9e9f42632fe 100644 --- a/i18n/deu/src/vs/platform/markers/common/problemMatcher.i18n.json +++ b/i18n/deu/src/vs/platform/markers/common/problemMatcher.i18n.json @@ -34,6 +34,7 @@ "ProblemMatcherParser.noValidIdentifier": "Fehler: Die Mustereigenschaft {0} ist kein gültiger Name für eine Mustervariable.", "ProblemMatcherParser.problemPattern.watchingMatcher": "Ein Problemmatcher muss ein Anfangsmuster und ein Endmuster für die Überwachung definieren.", "ProblemMatcherParser.invalidRegexp": "Fehler: Die Zeichenfolge {0} ist kein gültiger regulärer Ausdruck.\n", + "WatchingPatternSchema.regexp": "Der reguläre Ausdruck zum Erkennen des Anfangs oder Endes eines Hintergrundtasks.", "WatchingPatternSchema.file": "Der Übereinstimmungsgruppenindex des Dateinamens. Kann ausgelassen werden.", "PatternTypeSchema.name": "Der Name eines beigetragenen oder vordefinierten Musters", "PatternTypeSchema.description": "Ein Problemmuster oder der Name eines beigetragenen oder vordefinierten Problemmusters. Kann ausgelassen werden, wenn die Basis angegeben ist.", @@ -42,6 +43,12 @@ "ProblemMatcherSchema.severity": "Der Standardschweregrad für Erfassungsprobleme. Dieser wird verwendet, wenn das Muster keine Übereinstimmungsgruppe für den Schweregrad definiert.", "ProblemMatcherSchema.applyTo": "Steuert, ob ein für ein Textdokument gemeldetes Problem nur auf geöffnete, geschlossene oder alle Dokumente angewendet wird.", "ProblemMatcherSchema.fileLocation": "Definiert, wie Dateinamen interpretiert werden sollen, die in einem Problemmuster gemeldet werden.", + "ProblemMatcherSchema.background": "Muster zum Nachverfolgen des Beginns und Endes eines Abgleichers, der für eine Hintergrundaufgabe aktiv ist.", + "ProblemMatcherSchema.background.activeOnStart": "Wenn dieser Wert auf \"true\" festgelegt wird, befindet sich die Hintergrundüberwachung im aktiven Modus, wenn die Aufgabe gestartet wird. Dies entspricht dem Ausgeben einer Zeile, die mit dem \"beginPattern\" übereinstimmt.", + "ProblemMatcherSchema.background.beginsPattern": "Wenn eine Übereinstimmung mit der Ausgabe vorliegt, wird der Start einer Hintergrundaufgabe signalisiert.", + "ProblemMatcherSchema.background.endsPattern": "Wenn eine Übereinstimmung mit der Ausgabe vorliegt, wird das Ende einer Hintergrundaufgabe signalisiert.", + "ProblemMatcherSchema.watching.deprecated": "Die Überwachungseigenschaft ist veraltet. Verwenden Sie stattdessen den Hintergrund.", + "ProblemMatcherSchema.watching": "Muster zum Nachverfolgen des Beginns und Endes eines Problemabgleicher.", "ProblemMatcherSchema.watching.activeOnStart": "Wenn dieser Wert auf \"true\" festgelegt wird, befindet sich die Überwachung im aktiven Modus, wenn der Task gestartet wird. Dies entspricht dem Ausgeben einer Zeile, die mit dem \"beginPattern\" übereinstimmt.", "ProblemMatcherSchema.watching.beginsPattern": "Wenn eine Übereinstimmung mit der Ausgabe vorliegt, wird der Start eines Überwachungstasks signalisiert.", "ProblemMatcherSchema.watching.endsPattern": "Wenn eine Übereinstimmung mit der Ausgabe vorliegt, wird das Ende eines Überwachungstasks signalisiert.", diff --git a/i18n/deu/src/vs/platform/theme/common/colorRegistry.i18n.json b/i18n/deu/src/vs/platform/theme/common/colorRegistry.i18n.json index e8bca8886d1bf4e59a88f8a6dfcb5de68c41c5f1..ccf32b580980162fec11691e06d46be1b26340e0 100644 --- a/i18n/deu/src/vs/platform/theme/common/colorRegistry.i18n.json +++ b/i18n/deu/src/vs/platform/theme/common/colorRegistry.i18n.json @@ -35,11 +35,13 @@ "dropdownForeground": "Vordergrund für Dropdown.", "dropdownBorder": "Rahmen für Dropdown.", "listFocusBackground": "Hintergrundfarbe der Liste/Struktur für das fokussierte Element, wenn die Liste/Struktur aktiv ist. Eine aktive Liste/Struktur hat Tastaturfokus, eine inaktive hingegen nicht.", + "listFocusForeground": "Vordergrundfarbe der Liste/Struktur für das fokussierte Element, wenn die Liste/Struktur aktiv ist. Eine aktive Liste/Struktur hat Tastaturfokus, eine inaktive hingegen nicht.", "listActiveSelectionBackground": "Hintergrundfarbe der Liste/Struktur für das ausgewählte Element, wenn die Liste/Struktur aktiv ist. Eine aktive Liste/Struktur hat Tastaturfokus, eine inaktive hingegen nicht.", "listActiveSelectionForeground": "Vordergrundfarbe der Liste/Struktur für das ausgewählte Element, wenn die Liste/Struktur aktiv ist. Eine aktive Liste/Struktur hat Tastaturfokus, eine inaktive hingegen nicht.", "listInactiveSelectionBackground": "Hintergrundfarbe der Liste/Struktur für das ausgewählte Element, wenn die Liste/Struktur inaktiv ist. Eine aktive Liste/Struktur hat Tastaturfokus, eine inaktive hingegen nicht.", "listInactiveSelectionForeground": "Liste/Baumstruktur - Vordergrundfarbe für das ausgewählte Element, wenn die Liste/Baumstruktur inaktiv ist. Eine aktive Liste/Baumstruktur hat Tastaturfokus, eine inaktive hingegen nicht.", "listHoverBackground": "Hintergrund der Liste/Struktur, wenn mit der Maus auf Elemente gezeigt wird.", + "listHoverForeground": "Vordergrund der Liste/Struktur, wenn mit der Maus auf Elemente gezeigt wird.", "listDropBackground": "Drag & Drop-Hintergrund der Liste/Struktur, wenn Elemente mithilfe der Maus verschoben werden.", "highlight": "Vordergrundfarbe der Liste/Struktur zur Trefferhervorhebung beim Suchen innerhalb der Liste/Struktur.", "pickerGroupForeground": "Schnellauswahlfarbe für das Gruppieren von Bezeichnungen.", @@ -53,9 +55,11 @@ "scrollbarSliderBackground": "Hintergrundfarbe des Schiebereglers.", "scrollbarSliderHoverBackground": "Hintergrundfarbe des Schiebereglers, wenn darauf gezeigt wird.", "scrollbarSliderActiveBackground": "Hintergrundfarbe des Schiebereglers, wenn dieser aktiv ist.", + "progressBarBackground": "Hintergrundfarbe des Fortschrittbalkens, der für lang ausgeführte Vorgänge angezeigt werden kann.", "editorBackground": "Hintergrundfarbe des Editors.", "editorForeground": "Standardvordergrundfarbe des Editors.", "editorWidgetBackground": "Hintergrundfarbe von Editor-Widgets wie zum Beispiel Suchen/Ersetzen.", + "editorWidgetBorder": "Rahmenfarbe von Editorwigdets. Die Farbe wird nur verwendet, wenn für das Widget ein Rahmen verwendet wird und die Farbe nicht von einem Widget überschrieben wird.", "editorSelection": "Farbe der Editor-Auswahl.", "editorInactiveSelection": "Farbe der Auswahl in einem inaktiven Editor.", "editorSelectionHighlight": "Farbe für Bereiche, deren Inhalt der Auswahl entspricht.", @@ -69,5 +73,12 @@ "diffEditorInserted": "Hintergrundfarbe für eingefügten Text.", "diffEditorRemoved": "Hintergrundfarbe für entfernten Text.", "diffEditorInsertedOutline": "Konturfarbe für eingefügten Text.", - "diffEditorRemovedOutline": "Konturfarbe für entfernten Text." + "diffEditorRemovedOutline": "Konturfarbe für entfernten Text.", + "mergeCurrentHeaderBackground": "Aktueller Kopfzeilenhintergrund in Inline-Mergingkonflikten.", + "mergeCurrentContentBackground": "Aktueller Inhaltshintergrund in Inline-Mergingkonflikten.", + "mergeIncomingHeaderBackground": "Eingehender Kopfzeilenhintergrund in Inline-Mergingkonflikten. ", + "mergeIncomingContentBackground": "Eingehender Inhaltshintergrund in Inline-Mergingkonflikten.", + "mergeBorder": "Rahmenfarbe für Kopfzeilen und die Aufteilung in Inline-Mergingkonflikten.", + "overviewRulerCurrentContentForeground": "Aktueller Übersichtslineal-Vordergrund für Inline-Mergingkonflikte.", + "overviewRulerIncomingContentForeground": "Eingehender Übersichtslineal-Vordergrund für Inline-Mergingkonflikte. " } \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/api/node/extHostTask.i18n.json b/i18n/deu/src/vs/workbench/api/node/extHostTask.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..4b90a12aaf247b4a1af0e887542958471d8df5e5 --- /dev/null +++ b/i18n/deu/src/vs/workbench/api/node/extHostTask.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "task.label": "{0}: {1}" +} \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/api/node/extHostTreeViews.i18n.json b/i18n/deu/src/vs/workbench/api/node/extHostTreeViews.i18n.json index 8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a..76a366889135ebe861e46bed9044b6cbf74a402c 100644 --- a/i18n/deu/src/vs/workbench/api/node/extHostTreeViews.i18n.json +++ b/i18n/deu/src/vs/workbench/api/node/extHostTreeViews.i18n.json @@ -3,4 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. -{} \ No newline at end of file +{ + "treeView.notRegistered": "Kein Treeviw mit der id '{0}' registriert.", + "treeItem.notFound": "Kein Tree-Eintrag mit der id '{0}' gefunden.", + "treeView.duplicateElement": "Element {0} ist bereit registriert." +} \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/browser/actions/configureLocale.i18n.json b/i18n/deu/src/vs/workbench/browser/actions/configureLocale.i18n.json index a6835e15a6da572b0a0ae32ba7ae02dcc37b8a96..f17cc2cd8aa4be2d1d96025526d89951707e3af6 100644 --- a/i18n/deu/src/vs/workbench/browser/actions/configureLocale.i18n.json +++ b/i18n/deu/src/vs/workbench/browser/actions/configureLocale.i18n.json @@ -7,6 +7,7 @@ "configureLocale": "Sprache konfigurieren", "displayLanguage": "Definiert die Anzeigesprache von VSCode.", "doc": "Unter {0} finden Sie eine Liste der unterstützten Sprachen.", + "restart": "Das Ändern dieses Wertes erfordert einen Neustart von VSCode.", "fail.createSettings": "{0} ({1}) kann nicht erstellt werden.", "JsonSchema.locale": "Die zu verwendende Sprache der Benutzeroberfläche." } \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/browser/parts/activitybar/activitybarPart.i18n.json b/i18n/deu/src/vs/workbench/browser/parts/activitybar/activitybarPart.i18n.json index ab66bc16e2e56b51515339092325eabac095718d..419bdb09927d77b957f131824b7bb22554069475 100644 --- a/i18n/deu/src/vs/workbench/browser/parts/activitybar/activitybarPart.i18n.json +++ b/i18n/deu/src/vs/workbench/browser/parts/activitybar/activitybarPart.i18n.json @@ -5,5 +5,6 @@ // Do not edit this file. It is machine generated. { "hideActivitBar": "Aktivitätsleiste ausblenden", - "activityBarAriaLabel": "Umschaltung der aktiven Ansicht" + "activityBarAriaLabel": "Umschaltung der aktiven Ansicht", + "globalActions": "Globale Aktionen" } \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/browser/parts/editor/editorStatus.i18n.json b/i18n/deu/src/vs/workbench/browser/parts/editor/editorStatus.i18n.json index 27e4ef85e7a0426a047cbdeea2cbe6a9c6cb4b10..3bfcbf3c5241d845dfe02a4a9a1d14e18e4b534f 100644 --- a/i18n/deu/src/vs/workbench/browser/parts/editor/editorStatus.i18n.json +++ b/i18n/deu/src/vs/workbench/browser/parts/editor/editorStatus.i18n.json @@ -10,7 +10,7 @@ "multiSelection": "{0} Auswahlen", "endOfLineLineFeed": "LF", "endOfLineCarriageReturnLineFeed": "CRLF", - "tabFocusModeEnabled": "TAB-TASTE verschiebt Fokus", + "screenReaderDetectedExtra": "Wenn Sie keine Sprachausgabe verwenden, ändern Sie die Einstellung \"editor.accessibilitySupport\" in \"Aus\".", "disableTabMode": "Barrierefreiheitsmodus deaktivieren", "gotoLine": "Gehe zu Zeile", "indentation": "Einzug", diff --git a/i18n/deu/src/vs/workbench/browser/parts/quickopen/quickopen.i18n.json b/i18n/deu/src/vs/workbench/browser/parts/quickopen/quickopen.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..51845025d412856a7af153a0ffbe582de5f31020 --- /dev/null +++ b/i18n/deu/src/vs/workbench/browser/parts/quickopen/quickopen.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "quickOpen": "Gehe zu Datei...", + "quickNavigateNext": "Zum nächsten Element in Quick Open navigieren", + "quickNavigatePrevious": "Zum vorherigen Element in Quick Open navigieren", + "quickSelectNext": "Nächstes Element in Quick Open auswählen", + "quickSelectPrevious": "Vorheriges Element in Quick Open auswählen" +} \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/browser/quickopen.i18n.json b/i18n/deu/src/vs/workbench/browser/quickopen.i18n.json index 4283ec57cb32a57ca41e7274814bdfdf2af43af3..89a7706d48243c072d97f32fb5132870dfda0d24 100644 --- a/i18n/deu/src/vs/workbench/browser/quickopen.i18n.json +++ b/i18n/deu/src/vs/workbench/browser/quickopen.i18n.json @@ -6,6 +6,5 @@ { "noResultsMatching": "Keine übereinstimmenden Ergebnisse.", "noResultsFound2": "Es wurden keine Ergebnisse gefunden.", - "entryAriaLabel": "{0}, Befehl", - "noCommands": "Keine übereinstimmenden Befehle." + "entryAriaLabel": "{0}, Befehl" } \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/browser/viewlet.i18n.json b/i18n/deu/src/vs/workbench/browser/viewlet.i18n.json index 14a9eb167211ba701d3e132c4ef8912ffda57dfa..97b755d5fd67fcb509bbc3ff98630a7d6d2397ff 100644 --- a/i18n/deu/src/vs/workbench/browser/viewlet.i18n.json +++ b/i18n/deu/src/vs/workbench/browser/viewlet.i18n.json @@ -4,6 +4,5 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "collapse": "Alle zuklappen", - "viewToolbarAriaLabel": "{0}-Aktionen" + "collapse": "Alle zuklappen" } \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/common/theme.i18n.json b/i18n/deu/src/vs/workbench/common/theme.i18n.json index 825c4c4c377699175c86fd26ce255de42289836c..01779434428e5e6da109a08810969d7dd467c44e 100644 --- a/i18n/deu/src/vs/workbench/common/theme.i18n.json +++ b/i18n/deu/src/vs/workbench/common/theme.i18n.json @@ -7,11 +7,16 @@ "tabActiveBackground": "Hintergrundfarbe der aktiven Registerkarte. Registerkarten sind die Container für Editors im Editorbereich. In einer Editorgruppe können mehrere Registerkarten geöffnet werden. Mehrere Editorgruppen können vorhanden sein.", "tabInactiveBackground": "Hintergrundfarbe der inaktiven Registerkarte. Registerkarten sind die Container für Editors im Editorbereich. In einer Editorgruppe können mehrere Registerkarten geöffnet werden. Mehrere Editorgruppen können vorhanden sein.", "tabBorder": "Rahmen zum Trennen von Registerkarten. Registerkarten sind die Container für Editoren im Editor-Bereich. In einer Editor-Gruppe können mehrere Registerkarten geöffnet werden. Mehrere Editor-Gruppen sind möglich.", - "tabActiveEditorGroupActiveForeground": "Vordergrundfarbe der aktiven Registerkarte in einer aktiven Gruppe. Registerkarten sind die Container für Editors im Editorbereich. In einer Editorgruppe können mehrere Registerkarten geöffnet werden. Mehrere Editorgruppen können vorhanden sein.", - "tabInactiveEditorGroupActiveForeground": "Vordergrundfarbe der inaktiven Registerkarte in einer aktiven Gruppe. Registerkarten sind die Container für Editors im Editorbereich. In einer Editorgruppe können mehrere Registerkarten geöffnet werden. Mehrere Editorgruppen können vorhanden sein.", + "tabActiveForeground": "Vordergrundfarbe der aktiven Registerkarte in einer aktiven Gruppe. Registerkarten sind die Container für Editors im Editorbereich. In einer Editorgruppe können mehrere Registerkarten geöffnet werden. Mehrere Editorgruppen können vorhanden sein.", + "tabInactiveForeground": "Vordergrundfarbe der inaktiven Registerkarte in einer aktiven Gruppe. Registerkarten sind die Container für Editors im Editorbereich. In einer Editorgruppe können mehrere Registerkarten geöffnet werden. Mehrere Editorgruppen können vorhanden sein.", + "tabUnfocusedActiveForeground": "Vordergrundfarbe der aktiven Registerkarte in einer inaktiven Gruppe. Registerkarten sind die Container für Editors im Editorbereich. In einer Editorgruppe können mehrere Registerkarten geöffnet werden. Mehrere Editorgruppen können vorhanden sein.", + "tabUnfocusedInactiveForeground": "Vordergrundfarbe der inaktiven Registerkarte in einer inaktiven Gruppe. Registerkarten sind die Container für Editors im Editorbereich. In einer Editorgruppe können mehrere Registerkarten geöffnet werden. Mehrere Editorgruppen können vorhanden sein.", "editorGroupBackground": "Hintergrundfarbe einer Editor-Gruppe. Editor-Gruppen sind die Container der Editoren. Die Hintergrundfarbe wird beim Ziehen von Editoren angezeigt.", + "tabsContainerBackground": "Hintergrundfarbe der Titelüberschrift der Editor-Gruppe, wenn die Registerkarten deaktiviert sind. Editor-Gruppen sind die Container der Editoren.", + "tabsContainerBorder": "Rahmenfarbe der Titelüberschrift der Editor-Gruppe, wenn die Registerkarten deaktiviert sind. Editor-Gruppen sind die Container der Editoren.", "editorGroupHeaderBackground": "Hintergrundfarbe der Titelüberschrift des Editors, wenn die Registerkarten deaktiviert sind. Editor-Gruppen sind die Container der Editoren.", "editorGroupBorder": "Farbe zum Trennen mehrerer Editor-Gruppen. Editor-Gruppen sind die Container der Editoren.", + "editorDragAndDropBackground": " Hintergrundfarbe beim Ziehen von Editoren. Die Farbe muss transparent sein, damit der Editor-Inhalt noch sichtbar sind.", "panelBackground": "Hintergrundfarbe des Panels. Panels werden unter dem Editorbereich angezeigt und enthalten Ansichten wie die Ausgabe und das integrierte Terminal.", "panelBorder": "Farbe des oberen Panelrahmens, der das Panel vom Editor abtrennt. Panels werden unter dem Editorbereich angezeigt und enthalten Ansichten wie die Ausgabe und das integrierten Terminal.", "panelActiveTitleForeground": "Titelfarbe für den aktiven Bereich. Bereiche werden unter dem Editorbereich angezeigt und enthalten Ansichten wie Ausgabe und integriertes Terminal.", @@ -19,18 +24,25 @@ "panelActiveTitleBorder": "Rahmenfarbe für den Titel des aktiven Bereichs. Bereiche werden unter dem Editorbereich angezeigt und enthalten Ansichten wie Ausgabe und integriertes Terminal.", "statusBarForeground": "Vordergrundfarbe der Statusleiste. Die Statusleiste wird unten im Fenster angezeigt.", "statusBarBackground": "Standardhintergrundfarbe der Statusleiste. Die Statusleiste wird unten im Fenster angezeigt.", + "statusBarBorder": "Rahmenfarbe der Statusleiste für die Abtrennung von der Seitenleiste und dem Editor. Die Statusleiste wird unten im Fenster angezeigt.", "statusBarNoFolderBackground": "Hintergrundfarbe der Statusleiste, wenn kein Ordner geöffnet ist. Die Statusleiste wird unten im Fenster angezeigt.", + "statusBarNoFolderForeground": "Vordergrundfarbe der Statusleiste, wenn kein Ordner geöffnet ist. Die Statusleiste wird unten im Fenster angezeigt.", "statusBarItemActiveBackground": "Hintergrundfarbe für Statusleistenelemente beim Klicken. Die Statusleiste wird am unteren Rand des Fensters angezeigt.", "statusBarItemHoverBackground": "Hintergrundfarbe der Statusleistenelemente beim Daraufzeigen. Die Statusleiste wird am unteren Seitenrand angezeigt.", "statusBarProminentItemBackground": "Hintergrundfarbe für markante Elemente der Statusleiste. Markante Elemente sind im Vergleich zu anderen Statusleisteneinträgen hervorgehoben, um auf ihre Bedeutung hinzuweisen. Die Statusleiste wird unten im Fenster angezeigt.", "statusBarProminentItemHoverBackground": "Hintergrundfarbe für markante Elemente der Statusleiste, wenn auf diese gezeigt wird. Markante Elemente sind im Vergleich zu anderen Statusleisteneinträgen hervorgehoben, um auf ihre Bedeutung hinzuweisen. Die Statusleiste wird unten im Fenster angezeigt.", "activityBarBackground": "Hintergrundfarbe der Aktivitätsleiste. Die Aktivitätsleiste wird ganz links oder rechts angezeigt und ermöglicht das Wechseln zwischen verschiedenen Ansichten der Seitenleiste.", "activityBarForeground": "Vordergrundfarbe der Aktivitätsleiste (z. B. für Symbole). Die Aktivitätsleiste wird ganz links oder rechts angezeigt und ermöglicht das Wechseln zwischen verschiedenen Ansichten der Seitenleiste.", + "activityBarBorder": "Rahmenfarbe der Aktivitätsleiste für die Abtrennung von der Seitenleiste. Die Aktivitätsleiste wird ganz links oder rechts angezeigt und ermöglicht das Wechseln zwischen verschiedenen Ansichten der Seitenleiste.", + "activityBarDragAndDropBackground": "Drag & Drop-Feedbackfarbe für Elemente der Aktivitätsleiste. Die Farbe muss transparent sein, damit die Einträge der Aktivitätsleiste noch sichtbar sind. Die Aktivitätsleiste wird ganz links oder ganz rechts angezeigt und ermöglicht den Wechsel zwischen Ansichten der Seitenleiste.", "activityBarBadgeBackground": "Hintergrundfarbe für Aktivitätsinfobadge. Die Aktivitätsleiste wird ganz links oder ganz rechts angezeigt und ermöglicht den Wechsel zwischen Ansichten der Seitenleiste.", "activityBarBadgeForeground": "Vordergrundfarbe für Aktivitätsinfobadge. Die Aktivitätsleiste wird ganz links oder ganz rechts angezeigt und ermöglicht den Wechsel zwischen Ansichten der Seitenleiste.", "sideBarBackground": "Hintergrundfarbe der Seitenleiste. Die Seitenleiste ist der Container für Ansichten wie den Explorer und die Suche.", + "sideBarForeground": "Vordergrundfarbe der Seitenleiste. Die Seitenleiste ist der Container für Ansichten wie den Explorer und die Suche.", + "sideBarBorder": "Rahmenfarbe der Seitenleiste zum Abtrennen an der Seite zum Editor. Die Seitenleiste ist der Container für Ansichten wie den Explorer und die Suche.", "sideBarTitleForeground": "Vordergrundfarbe der Seitenleiste. Die Seitenleiste ist der Container für Ansichten wie den Explorer und die Suche.", "sideBarSectionHeaderBackground": "Hintergrundfarbe der Abschnittsüberschrift der Seitenleiste. Die Seitenleiste ist der Container für Ansichten wie den Explorer und die Suche.", + "sideBarSectionHeaderForeground": "Vordergrundfarbe der Abschnittsüberschrift der Seitenleiste. Die Seitenleiste ist der Container für Ansichten wie den Explorer und die Suche.", "titleBarActiveForeground": "Vordergrund der Titelleiste, wenn das Fenster aktiv ist. Diese Farbe wird derzeit nur von MacOS unterstützt.", "titleBarInactiveForeground": "Vordergrund der Titelleiste, wenn das Fenster inaktiv ist. Diese Farbe wird derzeit nur von MacOS unterstützt.", "titleBarActiveBackground": "Hintergrund der Titelleiste, wenn das Fenster aktiv ist. Diese Farbe wird derzeit nur von MacOS unterstützt.", diff --git a/i18n/deu/src/vs/workbench/electron-browser/actions.i18n.json b/i18n/deu/src/vs/workbench/electron-browser/actions.i18n.json index 92dabcb0496145a69f6d0ce2cbd858926830c228..70ead81b19e0c47b4da5f8711951387e8e02e429 100644 --- a/i18n/deu/src/vs/workbench/electron-browser/actions.i18n.json +++ b/i18n/deu/src/vs/workbench/electron-browser/actions.i18n.json @@ -6,9 +6,6 @@ { "closeActiveEditor": "Editor schließen", "closeWindow": "Fenster schließen", - "switchWindow": "Fenster wechseln", - "switchWindowPlaceHolder": "Fenster auswählen", - "current": "Aktuelles Fenster", "closeFolder": "Ordner schließen", "noFolderOpened": "Zurzeit ist kein Ordner in dieser Instanz geöffnet, der geschlossen werden kann.", "newWindow": "Neues Fenster", @@ -20,7 +17,7 @@ "zoomReset": "Zoom zurücksetzen", "appPerf": "Startleistung", "reloadWindow": "Fenster erneut laden", - "openRecent": "Zuletzt verwendete öffnen", + "current": "Aktuelles Fenster", "folders": "Ordner", "files": "Dateien", "openRecentPlaceHolderMac": "Wählen Sie einen Pfad aus (halten Sie die BEFEHLSTASTE gedrückt, um ein neues Fenster zu öffnen).", @@ -32,10 +29,6 @@ "openDocumentationUrl": "Dokumentation", "openIntroductoryVideosUrl": "Einführungsvideos", "toggleSharedProcess": "Freigegebenen Prozess umschalten", - "navigateLeft": "Zum Ansichtsteil links verschieben", - "navigateRight": "Zum Ansichtsteil rechts verschieben", - "navigateUp": "Zum Ansichtsteil darüber verschieben", - "navigateDown": "Zum Ansichtsteil darunter verschieben", "increaseViewSize": "Aktuelle Ansicht vergrößern", "decreaseViewSize": "Aktuelle Ansicht verkleinern" } \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/electron-browser/main.contribution.i18n.json b/i18n/deu/src/vs/workbench/electron-browser/main.contribution.i18n.json index e519ed643e29c5131c54457566600cc2885ce3bf..40552bf6b2a1ae97470729c974bc9e5d0b109e63 100644 --- a/i18n/deu/src/vs/workbench/electron-browser/main.contribution.i18n.json +++ b/i18n/deu/src/vs/workbench/electron-browser/main.contribution.i18n.json @@ -7,6 +7,7 @@ "view": "Anzeigen", "help": "Hilfe", "file": "Datei", + "developer": "Entwickler", "showEditorTabs": "Steuert, ob geöffnete Editoren auf Registerkarten angezeigt werden sollen.", "editorTabCloseButton": "Steuert die Position der Schließen-Schaltflächen der Editor-Registerkarten oder deaktiviert sie bei der Einstellung \"off\".", "showIcons": "Steuert, ob geöffnete Editoren mit einem Symbol angezeigt werden sollen. Hierzu muss auch ein Symboldesign aktiviert werden.", @@ -30,10 +31,6 @@ "window.openFoldersInNewWindow.off": "Ordner ersetzen das letzte aktive Fenster.", "window.openFoldersInNewWindow.default": "Ordner werden in einem neuen Fenster geöffnet, sofern kein Ordner innerhalb der Anwendung ausgewählt wird (z. B. über das Dateimenü).", "openFoldersInNewWindow": "Steuert, ob Ordner in einem neuen Fenster geöffnet werden oder das letzte aktive Fenster ersetzen.\n- default: Die Ordner werden in einem neuen Fenster geöffnet, sofern kein Ordner innerhalb der Anwendung ausgewählt wird (z. B. über das Dateimenü).\n- on: Die Ordner werden in einem neuen Fenster geöffnet.\n- off: Die Ordner ersetzen das letzte aktive Fenster.\nIn einigen Fällen wird diese Einstellung unter Umständen ignoriert (z. B. bei der Befehlszeilenoption \"-new-window\" oder \"-reuse-window\").", - "window.reopenFolders.none": "Ordner nie erneut öffnen.", - "window.reopenFolders.one": "Den letzten aktiven Ordner erneut öffnen.", - "window.reopenFolders.all": "Alle Ordner der letzten Sitzung erneut öffnen.", - "reopenFolders": "Steuert, wie Ordner nach einem Neustart erneut geöffnet werden. Wählen Sie \"none\" aus, um Ordner nie erneut zu öffnen, \"one\", um den zuletzt bearbeiteten Ordner erneut zu öffnen, oder \"all\", um alle Ordner der letzten Sitzung erneut zu öffnen.", "restoreFullscreen": "Steuert, ob ein Fenster im Vollbildmodus wiederhergestellt wird, wenn es im Vollbildmodus beendet wurde.", "zoomLevel": "Passen Sie den Zoomfaktor des Fensters an. Die ursprüngliche Größe ist 0. Jede Inkrementierung nach oben (z. B. 1) oder unten (z. B. -1) stellt eine Vergrößerung bzw. Verkleinerung um 20 % dar. Sie können auch Dezimalwerte eingeben, um den Zoomfaktor genauer anzupassen.", "title": "Steuert den Fenstertitel abhängig vom aktiven Editor. Variablen werden abhängig vom Kontext ersetzt:\n${activeEditorShort}: z. B. myFile.txt\n${activeEditorMedium}: z. B. myFolder/myFile.txt\n${activeEditorLong}: z. B. /Users/Development/myProject/myFolder/myFile.txt\n${rootName}: z. B. myProject\n${rootPath}: z. B. /Users/Development/myProject\n${appName}: z. B. VS Code\n${dirty}: ein geänderter Indikator, wenn der aktive Editor geändert wurde\n${separator}: ein bedingtes Trennzeichen (\" - \"), das nur in der Umgebung von Variablen mit Werten angezeigt wird", @@ -41,11 +38,13 @@ "window.newWindowDimensions.inherit": "Öffnet neue Fenster mit den gleichen Abmessungen wie das letzte aktive Fenster.", "window.newWindowDimensions.maximized": "Öffnet neue Fenster maximiert.", "window.newWindowDimensions.fullscreen": "Öffnet neue Fenster im Vollbildmodus.", + "newWindowDimensions": "Steuert die Abmessungen beim Öffnen eines neuen Fensters. Standardmäßig wird in der Mitte des Bildschirms ein neues Fenster mit kleinen Abmessungen geöffnet. Bei der Einstellung \"inherit\" erhält das Fenster die gleichen Abmessungen wie das letzte aktive Fenster. Bei der Einstellung \"maximized\" wird das Fenster maximiert geöffnet, und bei \"fullscreen\" wird es im Vollbildmodus geöffnet. Die Einstellung hat keine Auswirkungen auf das zuerst geöffnete Fenster. Größe und Position des ersten Fensters werden immer so wiederhergestellt, wie sie vor dem Schließen waren.", "window.menuBarVisibility.default": "Das Menü ist nur im Vollbildmodus ausgeblendet.", "window.menuBarVisibility.visible": "Das Menu wird immer angezeigt, auch im Vollbildmodus.", "window.menuBarVisibility.toggle": "Das Menu ist ausgeblendet, kann aber mit der Alt-Taste angezeigt werden.", "window.menuBarVisibility.hidden": "Das Menü ist immer ausgeblendet.", "menuBarVisibility": "Steuert die Sichtbarkeit der Menüleiste. Die Einstellung \"Umschalten\" bedeutet, dass die Menüleiste durch einfaches Betätigen der ALT-Taste angezeigt und ausgeblendet wird. Die Menüleite wird standardmäßig angezeigt, sofern sich das Fenster nicht im Vollbildmodus befindet.", + "enableMenuBarMnemonics": "Ist dies aktiviert, können die Hauptmenüs mithilfe von Tastenkombinationen mit der Alt-Taste geöffnet werden. Wenn mnemonische Zeichen deaktiviert werden, können diese Tastenkombinationen mit der Alt-Taste stattdessen an Editor-Befehle gebunden werden.", "autoDetectHighContrast": "Ist diese Option aktiviert, erfolgt automatisch ein Wechsel zu einem Design mit hohem Kontrast, wenn Windows ein Design mit hohem Kontrast verwendet, und zu einem dunklen Design, wenn Sie für Windows kein Design mit hohem Kontrast mehr verwenden.", "titleBarStyle": "Passt das Aussehen der Titelleiste des Fensters an. Zum Anwenden der Änderungen ist ein vollständiger Neustart erforderlich.", "window.nativeTabs": "Aktiviert MacOS Sierra-Fensterregisterkarten. Beachten Sie, dass zum Übernehmen von Änderungen ein vollständiger Neustart erforderlich ist und durch ggf. konfigurierte native Registerkarten ein benutzerdefinierter Titelleistenstil deaktiviert wird.", @@ -55,5 +54,7 @@ "zenMode.hideTabs": "Steuert, ob die Workbench-Registerkarten durch Aktivieren des Zen-Modus ebenfalls ausgeblendet werden.", "zenMode.hideStatusBar": "Steuert, ob die Statusleiste im unteren Bereich der Workbench durch Aktivieren des Zen-Modus ebenfalls ausgeblendet wird.", "zenMode.hideActivityBar": "Steuert, ob die Aktivitätsleiste im linken Bereich der Workbench durch Aktivieren des Zen-Modus ebenfalls ausgeblendet wird.", - "zenMode.restore": "Steuert, ob ein Fenster im Zen-Modus wiederhergestellt werden soll, wenn es im Zen-Modus beendet wurde." + "zenMode.restore": "Steuert, ob ein Fenster im Zen-Modus wiederhergestellt werden soll, wenn es im Zen-Modus beendet wurde.", + "workspaceConfigurationTitle": "Arbeitsbereich", + "files.exclude.boolean": "Das Globmuster, mit dem Dateipfade verglichen werden sollen. Legen Sie diesen Wert auf \"true\" oder \"false\" fest, um das Muster zu aktivieren bzw. zu deaktivieren." } \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/electron-browser/workbench.i18n.json b/i18n/deu/src/vs/workbench/electron-browser/workbench.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..db7c9434c92a28460ddc3348a4544a086a91e53e --- /dev/null +++ b/i18n/deu/src/vs/workbench/electron-browser/workbench.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "developer": "Entwickler", + "file": "Datei" +} \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/codeEditor/electron-browser/accessibility.i18n.json b/i18n/deu/src/vs/workbench/parts/codeEditor/electron-browser/accessibility.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..f802905959f40488398fe3a6907db897738d58ca --- /dev/null +++ b/i18n/deu/src/vs/workbench/parts/codeEditor/electron-browser/accessibility.i18n.json @@ -0,0 +1,26 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "emergencyConfOn": "Die Einstellung \"editor.accessibilitySupport\" wird in \"Ein\" geändert.", + "openingDocs": "Die Dokumentationsseite zur Barrierefreiheit von VS Code wird jetzt geöffnet.", + "introMsg": "Vielen Dank, dass Sie die Optionen für Barrierefreiheit von VS Code testen.", + "status": "Status:", + "changeConfigToOnMac": "Betätigen Sie jetzt die Befehlstaste+E, um den Editor zu konfigurieren, sodass er permanent für die Verwendung mit einer Sprachausgabe optimiert wird.", + "changeConfigToOnWinLinux": "Betätigen Sie jetzt die Befehlstaste+E, um den Editor zu konfigurieren, sodass er permanent für die Verwendung mit einer Sprachausgabe optimiert wird.", + "auto_unknown": "Der Editor ist für die Verwendung von Plattform-APIs konfiguriert, um zu erkennen, wenn eine Sprachausgabe angefügt wird, die aktuelle Laufzeit unterstützt dies jedoch nicht.", + "auto_on": "Der Editor hat automatisch erkannt, dass eine Sprachausgabe angefügt wurde.", + "auto_off": "Der Editor ist so konfiguriert, dass er automatisch erkennt, wenn eine Sprachausgabe angefügt wird, was momentan nicht der Fall ist.", + "configuredOn": "Der Editor ist so konfiguriert, dass er für die Verwendung mit einer Sprachausgabe durchgehend optimiert wird – Sie können dies ändern, indem Sie die Einstellung \"editor.accessibilitySupport\" bearbeiten.", + "configuredOff": "Der Editor ist so konfiguriert, dass er für die Verwendung mit einer Sprachausgabe nie optimiert wird.", + "tabFocusModeOnMsg": "Durch Drücken der TAB-TASTE im aktuellen Editor wird der Fokus in das nächste Element verschoben, das den Fokus erhalten kann. Schalten Sie dieses Verhalten um, indem Sie {0} drücken.", + "tabFocusModeOnMsgNoKb": "Durch Drücken der TAB-TASTE im aktuellen Editor wird der Fokus in das nächste Element verschoben, das den Fokus erhalten kann. Der {0}-Befehl kann zurzeit nicht durch eine Tastenzuordnung ausgelöst werden.", + "tabFocusModeOffMsg": "Durch Drücken der TAB-TASTE im aktuellen Editor wird das Tabstoppzeichen eingefügt. Schalten Sie dieses Verhalten um, indem Sie {0} drücken.", + "tabFocusModeOffMsgNoKb": "Durch Drücken der TAB-TASTE im aktuellen Editor wird das Tabstoppzeichen eingefügt. Der {0}-Befehl kann zurzeit nicht durch eine Tastenzuordnung ausgelöst werden.", + "openDocMac": "Drücken Sie die Befehlstaste+H, um ein Browserfenster mit zusätzlichen VS Code-Informationen zur Barrierefreiheit zu öffnen.", + "openDocWinLinux": "Drücken Sie STRG+H, um ein Browserfenster mit zusätzlichen VS Code-Informationen zur Barrierefreiheit zu öffnen.", + "outroMsg": "Sie können diese QuickInfo schließen und durch Drücken von ESC oder UMSCHALT+ESC zum Editor zurückkehren.", + "ShowAccessibilityHelpAction": "Hilfe zur Barrierefreiheit anzeigen" +} \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/codeEditor/electron-browser/inspectTMScopes.i18n.json b/i18n/deu/src/vs/workbench/parts/codeEditor/electron-browser/inspectTMScopes.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a --- /dev/null +++ b/i18n/deu/src/vs/workbench/parts/codeEditor/electron-browser/inspectTMScopes.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{} \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/codeEditor/electron-browser/toggleMultiCursorModifier.i18n.json b/i18n/deu/src/vs/workbench/parts/codeEditor/electron-browser/toggleMultiCursorModifier.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..0ca859efe95f52014dab16b9c0b6e26ecd4b82b1 --- /dev/null +++ b/i18n/deu/src/vs/workbench/parts/codeEditor/electron-browser/toggleMultiCursorModifier.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "toggleLocation": "Multi-Curosor-Modifizierer umschalten" +} \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/debug/browser/debugActions.i18n.json b/i18n/deu/src/vs/workbench/parts/debug/browser/debugActions.i18n.json index 11b3d69c656dceaf13e5cb1d2b7682b27eed5a12..a294a18039b785e86756977bccb72d925e133e6a 100644 --- a/i18n/deu/src/vs/workbench/parts/debug/browser/debugActions.i18n.json +++ b/i18n/deu/src/vs/workbench/parts/debug/browser/debugActions.i18n.json @@ -6,6 +6,7 @@ { "openLaunchJson": "{0} öffnen", "launchJsonNeedsConfigurtion": "Konfigurieren oder reparieren Sie \"launch.json\".", + "noFolderDebugConfig": "Öffnen Sie bitte einen Ordner, um erweitertes Debuggen zu konfigurieren.", "startDebug": "Debuggen starten", "startWithoutDebugging": "Ohne Debuggen starten", "selectAndStartDebugging": "Debugging auswählen und starten", diff --git a/i18n/deu/src/vs/workbench/parts/debug/electron-browser/debugCommands.i18n.json b/i18n/deu/src/vs/workbench/parts/debug/electron-browser/debugCommands.i18n.json index 8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a..09e90db77c7ea4fd37e158d48fa45d4ce1f5e1d5 100644 --- a/i18n/deu/src/vs/workbench/parts/debug/electron-browser/debugCommands.i18n.json +++ b/i18n/deu/src/vs/workbench/parts/debug/electron-browser/debugCommands.i18n.json @@ -3,4 +3,6 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. -{} \ No newline at end of file +{ + "noFolderDebugConfig": "Öffnen Sie bitte einen Ordner, um erweitertes Debuggen zu konfigurieren." +} \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/debug/electron-browser/debugService.i18n.json b/i18n/deu/src/vs/workbench/parts/debug/electron-browser/debugService.i18n.json index 68430d77560465801a0eace0b7c385e4ea28fd7c..7c044c0e5808612b20064f70628ce4d17967e28f 100644 --- a/i18n/deu/src/vs/workbench/parts/debug/electron-browser/debugService.i18n.json +++ b/i18n/deu/src/vs/workbench/parts/debug/electron-browser/debugService.i18n.json @@ -5,8 +5,8 @@ // Do not edit this file. It is machine generated. { "snapshotObj": "Nur primitive Werte werden für dieses Objekt angezeigt.", - "debuggingStarted": "Das Debuggen wurde gestartet.", "debuggingPaused": "Das Debuggen wurde angehalten. Ursache {0}, {1}{2}", + "debuggingStarted": "Das Debuggen wurde gestartet.", "debuggingStopped": "Das Debuggen wurde beendet.", "breakpointAdded": "Der Haltepunkt wurde hinzugefügt. Zeile {0}, Datei \"{1}\".", "breakpointRemoved": "Der Haltepunkt wurde entfernt. Zeile {0}, Datei \"{1}\".", diff --git a/i18n/deu/src/vs/workbench/parts/debug/electron-browser/debugViews.i18n.json b/i18n/deu/src/vs/workbench/parts/debug/electron-browser/debugViews.i18n.json index 785ccd9e411d7d0a9b75083ba9c01eee2e3196bf..55c6c83a6c04232734bf9e167af0f4fb7b691ee0 100644 --- a/i18n/deu/src/vs/workbench/parts/debug/electron-browser/debugViews.i18n.json +++ b/i18n/deu/src/vs/workbench/parts/debug/electron-browser/debugViews.i18n.json @@ -5,16 +5,12 @@ // Do not edit this file. It is machine generated. { "variablesSection": "Variablenabschnitt", - "variables": "Variablen", "variablesAriaTreeLabel": "Variablen debuggen", "expressionsSection": "Ausdrucksabschnitt", - "watch": "Überwachen", "watchAriaTreeLabel": "Überwachungsausdrücke debuggen", "callstackSection": "Aufruflistenabschnitt", "debugStopped": "Angehalten bei {0}", - "callStack": "Aufrufliste", "callStackAriaLabel": "Aufrufliste debuggen", "breakpointsSection": "Haltepunkteabschnitt", - "breakpoints": "Haltepunkte", "breakpointsAriaTreeLabel": "Haltepunkte debuggen" } \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/debug/electron-browser/electronDebugActions.i18n.json b/i18n/deu/src/vs/workbench/parts/debug/electron-browser/electronDebugActions.i18n.json index 77b8513319c99c56aa25ddf11f23659892b9deca..bef42d1efed704455a8925caf53198ffa4a1998d 100644 --- a/i18n/deu/src/vs/workbench/parts/debug/electron-browser/electronDebugActions.i18n.json +++ b/i18n/deu/src/vs/workbench/parts/debug/electron-browser/electronDebugActions.i18n.json @@ -6,5 +6,6 @@ { "copyValue": "Wert kopieren", "copy": "Kopieren", + "copyAll": "Alles kopieren", "copyStackTrace": "Aufrufliste kopieren" } \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/debug/electron-browser/statusbarColorProvider.i18n.json b/i18n/deu/src/vs/workbench/parts/debug/electron-browser/statusbarColorProvider.i18n.json index 83ecbf1d9c05fb9c522207d68ec9bb3e37d437f9..57d2b6200423f3560ec630b7fb173184d283237d 100644 --- a/i18n/deu/src/vs/workbench/parts/debug/electron-browser/statusbarColorProvider.i18n.json +++ b/i18n/deu/src/vs/workbench/parts/debug/electron-browser/statusbarColorProvider.i18n.json @@ -4,5 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "statusBarDebuggingBackground": "Hintergrundfarbe der Statusleiste beim Debuggen eines Programms. Die Statusleiste wird unten im Fenster angezeigt." + "statusBarDebuggingBackground": "Hintergrundfarbe der Statusleiste beim Debuggen eines Programms. Die Statusleiste wird unten im Fenster angezeigt.", + "statusBarDebuggingForeground": "Vordergrundfarbe der Statusleiste beim Debuggen eines Programms. Die Statusleiste wird unten im Fenster angezeigt." } \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json b/i18n/deu/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json index 094d1188c24e2d20df9f14c065d541c7aa088dba..1bcee0dbf6e04302caa1169b7b59e62c1f2e5f40 100644 --- a/i18n/deu/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json +++ b/i18n/deu/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json @@ -7,6 +7,7 @@ "debugAdapterBinNotFound": "Die ausführbare Datei \"{0}\" des Debugadapters ist nicht vorhanden.", "debugAdapterCannotDetermineExecutable": "Die ausführbare Datei \"{0}\" des Debugadapters kann nicht bestimmt werden.", "debugType": "Der Typ der Konfiguration.", + "debugTypeNotRecognised": "Dieser Debugging-Typ wurde nicht erkannt. Bitte installieren und aktivieren Sie die dazugehörige Debugging-Erweiterung.", "node2NotSupported": "\"node2\" wird nicht mehr unterstützt, verwenden Sie stattdessen \"node\", und legen Sie das Attribut \"protocol\" auf \"inspector\" fest.", "debugName": "Der Name der Konfiguration. Er wird im Dropdownmenü der Startkonfiguration angezeigt.", "debugRequest": "Der Anforderungstyp der Konfiguration. Der Wert kann \"launch\" oder \"attach\" sein.", diff --git a/i18n/deu/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json b/i18n/deu/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json index 35ffc123f143a0448de4fd71594264b363834dad..de81c8b774353bb1eca605f3344206e09326bf83 100644 --- a/i18n/deu/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json +++ b/i18n/deu/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json @@ -4,6 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "previousEditPoint": "Emmet: Vorheriger Bearbeitungspunkt", - "nextEditPoint": "Emmet: Nächster Bearbeitungspunkt" + "previousEditPoint": "Emmet: Zum vorherigen Bearbeitungspunkt wechseln", + "nextEditPoint": "Emmet: Zum nächsten Bearbeitungspunkt wechseln" } \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json b/i18n/deu/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json index 5beaa142e9f13dd589b6f327852dcde3d10efd19..71dbf73cb59ff39dcb8e5d74fb552b491ccc8f0c 100644 --- a/i18n/deu/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json +++ b/i18n/deu/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json @@ -9,5 +9,6 @@ "emmetPreferences": "Einstellungen, die zum Ändern des Verhaltens einiger Aktionen und Konfliktlöser von Emmet verwendet werden.", "emmetSyntaxProfiles": "Definieren Sie das Profil für die angegebene Syntax, oder verwenden Sie Ihr eigenes Profil mit bestimmten Regeln.", "emmetExclude": "Ein Array von Sprachen, in dem Emmet-Abkürzungen nicht erweitert werden sollen.", - "emmetExtensionsPath": "Pfad zu einem Ordner mit Emmet-Profilen, Ausschnitten und Voreinstellungen" + "emmetExtensionsPath": "Pfad zu einem Ordner mit Emmet-Profilen, Ausschnitten und Voreinstellungen", + "useNewEmmet": "Testen Sie die neuen Emmet-Module (die letztendlich die alte einzelne Emmet-Bibliothek ersetzen) für alle Emmet-Funktionen." } \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/extensions/browser/extensionEditor.i18n.json b/i18n/deu/src/vs/workbench/parts/extensions/browser/extensionEditor.i18n.json index c893534d59cb7501980e756b6500f47a56392633..80ecb27720f60c25eafbdbb481aa508bbea71e36 100644 --- a/i18n/deu/src/vs/workbench/parts/extensions/browser/extensionEditor.i18n.json +++ b/i18n/deu/src/vs/workbench/parts/extensions/browser/extensionEditor.i18n.json @@ -24,6 +24,10 @@ "default": "Standard", "debuggers": "Debugger ({0})", "debugger name": "Name", + "views": "Ansichten ({0})", + "view id": "ID", + "view name": "Name", + "view location": "Wo", "themes": "Designs ({0})", "JSON Validation": "JSON-Validierung ({0})", "commands": "Befehle ({0})", diff --git a/i18n/deu/src/vs/workbench/parts/extensions/browser/extensionsActions.i18n.json b/i18n/deu/src/vs/workbench/parts/extensions/browser/extensionsActions.i18n.json index 3fc196fe64ee68ce021df69dce19a19ca8866bfc..0e32d73283c0620025905bbab284e509d3d2515b 100644 --- a/i18n/deu/src/vs/workbench/parts/extensions/browser/extensionsActions.i18n.json +++ b/i18n/deu/src/vs/workbench/parts/extensions/browser/extensionsActions.i18n.json @@ -22,6 +22,8 @@ "disableGloballyAction": "Immer", "disableAction": "Deaktivieren", "checkForUpdates": "Nach Updates suchen", + "enableAutoUpdate": "Aktivere die automatische Aktualisierung von Erweiterungen", + "disableAutoUpdate": "Deaktivere die automatische Aktualisierung von Erweiterungen", "updateAll": "Alle Erweiterungen aktualisieren", "reloadAction": "Neu starten", "postUpdateTooltip": "Zum Aktualisieren erneut laden", @@ -44,6 +46,8 @@ "showWorkspaceRecommendedExtensions": "Für den Arbeitsbereich empfohlene Erweiterungen anzeigen", "showRecommendedKeymapExtensions": "Empfohlene Tastenzuordnungen anzeigen", "showRecommendedKeymapExtensionsShort": "Tastenzuordnungen", + "showLanguageExtensions": "Spracherweiterungen anzeigen", + "showLanguageExtensionsShort": "Spracherweiterungen", "configureWorkspaceRecommendedExtensions": "Empfohlene Erweiterungen konfigurieren (Arbeitsbereich)", "ConfigureWorkspaceRecommendations.noWorkspace": "Empfehlungen sind nur für einen Arbeitsbereichsordner verfügbar.", "OpenExtensionsFile.failed": "Die Datei \"extensions.json\" kann nicht im Ordner \".vscode\" erstellt werden ({0}).", @@ -51,5 +55,8 @@ "disableAll": "Alle installierten Erweiterungen löschen", "disableAllWorkspace": "Alle installierten Erweiterungen für diesen Arbeitsbereich deaktivieren", "enableAll": "Alle installierten Erweiterungen aktivieren", - "enableAllWorkspace": "Alle installierten Erweiterungen für diesen Arbeitsbereich aktivieren" + "enableAllWorkspace": "Alle installierten Erweiterungen für diesen Arbeitsbereich aktivieren", + "extensionButtonProminentBackground": "Hintergrundfarbe für markante Aktionenerweiterungen (z. B. die Schaltfläche zum Installieren).", + "extensionButtonProminentForeground": "Vordergrundfarbe für markante Aktionenerweiterungen (z. B. die Schaltfläche zum Installieren).", + "extensionButtonProminentHoverBackground": "Hoverhintergrundfarbe für markante Aktionenerweiterungen (z. B. die Schaltfläche zum Installieren)." } \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json b/i18n/deu/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json index 8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a..48aabfdf0bfe853395b9f32c98b0d5048598e2dc 100644 --- a/i18n/deu/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json +++ b/i18n/deu/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json @@ -3,4 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. -{} \ No newline at end of file +{ + "disableOtherKeymapsConfirmation": "Deaktivere Tastenzuordnungen ({0}) um Konfilkte mit anderen zu vermeiden?", + "yes": "Ja", + "no": "Nein", + "betterMergeDisabled": "Die \"Better Merge\" Erweiterung ist jetzt integriert, die alte Erweiterung wurde deaktiviert und kann deinstalliert werden.", + "uninstall": "Deinstallieren", + "later": "Später" +} \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/files/browser/files.contribution.i18n.json b/i18n/deu/src/vs/workbench/parts/files/browser/files.contribution.i18n.json index 8880b15033b99386378f274bb29b88f1055cf9d7..3a26505523df9733a0b9134cc61cfed0e16cb1ed 100644 --- a/i18n/deu/src/vs/workbench/parts/files/browser/files.contribution.i18n.json +++ b/i18n/deu/src/vs/workbench/parts/files/browser/files.contribution.i18n.json @@ -16,7 +16,7 @@ "associations": "Konfigurieren Sie Dateizuordnungen zu Sprachen (beispielsweise \"*.extension\": \"html\"). Diese besitzen Vorrang vor den Standardzuordnungen der installierten Sprachen.", "encoding": "Die Standardzeichensatz-Codierung, die beim Lesen und Schreiben von Dateien verwendet werden soll.", "autoGuessEncoding": "Ist diese Option aktiviert, wird beim Öffnen von Dateien versucht, die Zeichensatzcodierung automatisch zu ermitteln.", - "eol": "Das Zeilenende-Standardzeichen.", + "eol": "Das Zeilenende-Standardzeichen. Verwenden Sie \\n für LF und \\r\\n für CRLF.", "trimTrailingWhitespace": "Bei Aktivierung werden nachgestellte Leerzeichen beim Speichern einer Datei gekürzt.", "insertFinalNewline": "Bei Aktivierung wird beim Speichern einer Datei eine abschließende neue Zeile am Dateiende eingefügt.", "files.autoSave.off": "Eine geänderte Datei wird nie automatisch gespeichert.", @@ -27,6 +27,7 @@ "autoSaveDelay": "Steuert die Verzögerung in Millisekunden, nach der eine geänderte Datei automatisch gespeichert wird. Nur gültig, wenn \"files.autoSave\" auf \"{0}\" festgelegt ist.", "watcherExclude": "Konfigurieren Sie Globmuster von Dateipfaden, die aus der Dateiüberwachung ausgeschlossen werden sollen. Das Ändern dieser Einstellung erfordert einen Neustart. Wenn Ihr Code beim Starten viel CPU-Zeit benötigt, können Sie große Ordner ausschließen, um die Anfangslast zu verringern.", "hotExit.off": "Hot Exit deaktivieren.", + "hotExit.onExit": "Hot Exit wird beim Schließen der Anwendung ausgelöst, d. h. wenn unter Windows/Linux das letzte Fenster geschlossen wird oder wenn der Befehl \"workbench.action.quit\" ausgelöst wird (Befehlspalette, Tastenzuordnung, Menü). Alle Fenster mit Sicherungen werden beim nächsten Start wiederhergestellt.", "hotExit": "Steuert, ob nicht gespeicherten Dateien zwischen den Sitzungen beibehlten werden, die Aufforderung zum Speichern wird beim Beenden des Editors übersprungen.", "defaultLanguage": "Der Standardsprachmodus, der neuen Dateien zugewiesen wird.", "editorConfigurationTitle": "Editor", diff --git a/i18n/deu/src/vs/workbench/parts/files/browser/views/emptyView.i18n.json b/i18n/deu/src/vs/workbench/parts/files/browser/views/emptyView.i18n.json index 0402d68c71d794b66cf38a1a0b4880caa1471608..ed93c437e872595108162083fd430a811e2d205b 100644 --- a/i18n/deu/src/vs/workbench/parts/files/browser/views/emptyView.i18n.json +++ b/i18n/deu/src/vs/workbench/parts/files/browser/views/emptyView.i18n.json @@ -5,7 +5,5 @@ // Do not edit this file. It is machine generated. { "explorerSection": "Datei-Explorer-Abschnitt", - "noWorkspace": "Es ist kein Ordner geöffnet.", - "noWorkspaceHelp": "Sie haben noch keinen Ordner geöffnet.", "openFolder": "Ordner öffnen" } \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/files/browser/views/openEditorsView.i18n.json b/i18n/deu/src/vs/workbench/parts/files/browser/views/openEditorsView.i18n.json index 02b807c765760f083d14553e00fbea19212ee7ca..ac1fd2f5acbc6d0692be10798d6eff9b1daf0984 100644 --- a/i18n/deu/src/vs/workbench/parts/files/browser/views/openEditorsView.i18n.json +++ b/i18n/deu/src/vs/workbench/parts/files/browser/views/openEditorsView.i18n.json @@ -4,8 +4,8 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "openEditosrSection": "Abschnitt \"Geöffnete Editoren\"", "openEditors": "Geöffnete Editoren", + "openEditosrSection": "Abschnitt \"Geöffnete Editoren\"", "treeAriaLabel": "Geöffnete Editoren: Liste der aktiven Dateien", "dirtyCounter": "{0} nicht gespeichert" } \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json b/i18n/deu/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json index 96d83227f6771c4c3cd60632317163273655eeb8..7fb4c04c827ae0992bb1d3220f95808c8f27dc6a 100644 --- a/i18n/deu/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json +++ b/i18n/deu/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json @@ -5,5 +5,11 @@ // Do not edit this file. It is machine generated. { "slow": "Langsamer Start erkannt", - "slow.detail": "Es tut uns leid, dass Ihr Start so langsam war. Starten Sie \"{0}\" mit aktivierter Profilerstellung neu, geben Sie die Profile für uns frei, und wir tun unser Bestes, damit der Start bald wieder perfekt funktioniert." + "slow.detail": "Es tut uns leid, dass Ihr Start so langsam war. Starten Sie \"{0}\" mit aktivierter Profilerstellung neu, geben Sie die Profile für uns frei, und wir tun unser Bestes, damit der Start bald wieder perfekt funktioniert.", + "prof.message": "Profile wurden erfolgreich erstellt.", + "prof.detail": "Erstellen Sie ein Problem, und fügen Sie die folgenden Dateien manuell an:\n{0}", + "prof.restartAndFileIssue": "Problem erstellen und neu starten", + "prof.restart": "Neu starten", + "prof.thanks": "Danke für Ihre Hilfe.", + "prof.detail.restart": "Ein abschließender Neustart ist erforderlich um '{0}' nutzen zu können. Danke für Ihre Hilfe." } \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/preferences/browser/keybindingsEditorContribution.i18n.json b/i18n/deu/src/vs/workbench/parts/preferences/browser/keybindingsEditorContribution.i18n.json index 9a66f7f69c7ac49e11ea53398b1972cbd0896699..959f4d64674dae09d64561725cef5ba1c83757cf 100644 --- a/i18n/deu/src/vs/workbench/parts/preferences/browser/keybindingsEditorContribution.i18n.json +++ b/i18n/deu/src/vs/workbench/parts/preferences/browser/keybindingsEditorContribution.i18n.json @@ -5,6 +5,7 @@ // Do not edit this file. It is machine generated. { "defineKeybinding.start": "Tastenbindung definieren", - "defineKeybinding.kbLayoutInfoMessage": "Drücken Sie für Ihr aktuelles Tastaturlayout ", - "defineKeybinding.kbLayoutErrorMessage": "Sie können diese Tastenkombination mit Ihrem aktuellen Tastaturlayout nicht generieren." + "defineKeybinding.kbLayoutErrorMessage": "Sie können diese Tastenkombination mit Ihrem aktuellen Tastaturlayout nicht generieren.", + "defineKeybinding.kbLayoutLocalAndUSMessage": "**{0}** für Ihr aktuelles Tastaturlayout (**{1}** für USA, Standard).", + "defineKeybinding.kbLayoutLocalMessage": "**{0}** für Ihr aktuelles Tastaturlayout." } \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/preferences/browser/preferencesRenderers.i18n.json b/i18n/deu/src/vs/workbench/parts/preferences/browser/preferencesRenderers.i18n.json index 701fa77e7a58fdcd3ec568ea587403d174a531c1..409e4b05ee12172ae057d5c298176fce2f8e5a19 100644 --- a/i18n/deu/src/vs/workbench/parts/preferences/browser/preferencesRenderers.i18n.json +++ b/i18n/deu/src/vs/workbench/parts/preferences/browser/preferencesRenderers.i18n.json @@ -4,6 +4,7 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "errorInvalidConfiguration": "Einstellungen können nicht geschrieben werden. Öffnen Sie die Datei, um Fehler/Warnungen in der Datei zu korrigieren. Versuchen Sie es anschließend noch mal.", "editTtile": "Bearbeiten", "replaceDefaultValue": "In Einstellungen ersetzen", "copyDefaultValue": "In Einstellungen kopieren", diff --git a/i18n/deu/src/vs/workbench/parts/quickopen/browser/commandsHandler.i18n.json b/i18n/deu/src/vs/workbench/parts/quickopen/browser/commandsHandler.i18n.json index 9d86b8f7244109906d0a68637f1ef254872ab2f8..37e4e48936217a592706f3e43853107f79ba1196 100644 --- a/i18n/deu/src/vs/workbench/parts/quickopen/browser/commandsHandler.i18n.json +++ b/i18n/deu/src/vs/workbench/parts/quickopen/browser/commandsHandler.i18n.json @@ -5,6 +5,7 @@ // Do not edit this file. It is machine generated. { "showTriggerActions": "Alle Befehle anzeigen", + "showCommands.label": "Befehlspalette...", "entryAriaLabelWithKey": "{0}, {1}, Befehle", "entryAriaLabel": "{0}, Befehle", "canNotRun": "Der Befehl '{0}' kann nicht an dieser Stelle ausgeführt werden.", diff --git a/i18n/deu/src/vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.i18n.json b/i18n/deu/src/vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..8595fd7f9f7f34863345be1870b9c60ba7c093db --- /dev/null +++ b/i18n/deu/src/vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "relaunchMessage": "Eine Einstellung wurde geändert, welche einen Neustart benötigt.", + "relaunchDetail": "Drücke den Neu starten-Button, um {0} neuzustarten und die Einstellung zu aktivieren.", + "restart": "Neu starten" +} \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.i18n.json b/i18n/deu/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..3a19632777036d35cc87c500cb65b5e29f550b09 --- /dev/null +++ b/i18n/deu/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "editorGutterModifiedBackground": "Hintergrundfarbe für die Editor-Leiste für Zeilen, die geändert wurden.", + "editorGutterAddedBackground": "Hintergrundfarbe für die Editor-Leiste für Zeilen, die hinzugefügt wurden.", + "editorGutterDeletedBackground": "Hintergrundfarbe für die Editor-Leiste für Zeilen, die gelöscht wurden." +} \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/scm/electron-browser/scm.contribution.i18n.json b/i18n/deu/src/vs/workbench/parts/scm/electron-browser/scm.contribution.i18n.json index cfb59dde79057dfcf687c79f87274defaa585187..11d322e71292a85251c812f32586547ebe7d0b56 100644 --- a/i18n/deu/src/vs/workbench/parts/scm/electron-browser/scm.contribution.i18n.json +++ b/i18n/deu/src/vs/workbench/parts/scm/electron-browser/scm.contribution.i18n.json @@ -5,6 +5,7 @@ // Do not edit this file. It is machine generated. { "toggleGitViewlet": "Git anzeigen", + "installAdditionalSCMProviders": "Installiere weiter SCM Provider...", "source control": "Quellcodeverwaltung", "toggleSCMViewlet": "SCM anzeigen", "view": "Anzeigen" diff --git a/i18n/deu/src/vs/workbench/parts/scm/electron-browser/scmMenus.i18n.json b/i18n/deu/src/vs/workbench/parts/scm/electron-browser/scmMenus.i18n.json index 07930885971ebff4741f0f95d298b37efd06b2ae..d2a2095a234b2b19d980d2b1f37cad550b296ec5 100644 --- a/i18n/deu/src/vs/workbench/parts/scm/electron-browser/scmMenus.i18n.json +++ b/i18n/deu/src/vs/workbench/parts/scm/electron-browser/scmMenus.i18n.json @@ -4,5 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "installAdditionalSCMProviders": "Installiere weiter SCM Provider...", "switch provider": "SCM-Anbieter wechseln..." } \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json b/i18n/deu/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json index e7724dc5035c54c9ea22b04e57564ac009ed209c..8ec0049b3b37ba259c8ad15829388e11fff001cb 100644 --- a/i18n/deu/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json +++ b/i18n/deu/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json @@ -6,5 +6,7 @@ { "searchMatches": "{0} Übereinstimmungen gefunden", "searchMatch": "{0} Übereinstimmung gefunden", - "fileMatchAriaLabel": "{0} Übereinstimmungen in der Datei \"{1}\" des Ordners \"{2}\", Suchergebnis" + "fileMatchAriaLabel": "{0} Übereinstimmungen in der Datei \"{1}\" des Ordners \"{2}\", Suchergebnis", + "replacePreviewResultAria": "Ersetze Term {0} mit {1} an Spaltenposition {2} in Zeile mit Text {3}", + "searchResultAria": "Term {0} an Spaltenposition {1} in Zeile mit Text {2} gefunden" } \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/snippets/electron-browser/TMSnippets.i18n.json b/i18n/deu/src/vs/workbench/parts/snippets/electron-browser/TMSnippets.i18n.json index 60f40269ae400e54a5bb9f18ad691c4d92098299..b0d6510181e2e95caa7ac670d11975cedf8ed3d1 100644 --- a/i18n/deu/src/vs/workbench/parts/snippets/electron-browser/TMSnippets.i18n.json +++ b/i18n/deu/src/vs/workbench/parts/snippets/electron-browser/TMSnippets.i18n.json @@ -9,5 +9,6 @@ "vscode.extension.contributes.snippets-path": "Der Pfad der Codeausschnittdatei. Der Pfad ist relativ zum Extensionordner und beginnt normalerweise mit \". /snippets/\".", "invalid.language": "Unbekannte Sprache in \"contributes.{0}.language\". Bereitgestellter Wert: {1}", "invalid.path.0": "In \"contributes.{0}.path\" wurde eine Zeichenfolge erwartet. Bereitgestellter Wert: {1}", - "invalid.path.1": "Es wurde erwartet, dass \"contributes.{0}.path\" ({1}) im Ordner ({2}) der Extension enthalten ist. Dies führt ggf. dazu, dass die Extension nicht portierbar ist." + "invalid.path.1": "Es wurde erwartet, dass \"contributes.{0}.path\" ({1}) im Ordner ({2}) der Extension enthalten ist. Dies führt ggf. dazu, dass die Extension nicht portierbar ist.", + "badVariableUse": "Das \"{0}\"-Snippet verwirrt wahrscheinlich Snippet-Variablen und Snippet-Paltzhalter. Schaue https://code.visualstudio.com/docs/editor/userdefinedsnippets#_snippet-syntax für weitere Informationen." } \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/snippets/electron-browser/snippets.contribution.i18n.json b/i18n/deu/src/vs/workbench/parts/snippets/electron-browser/snippets.contribution.i18n.json index 086f7561431e47b6b2482dfe07050966997688df..ff4eb3dd4ad301104bfe3324d9ebdb963d12cef5 100644 --- a/i18n/deu/src/vs/workbench/parts/snippets/electron-browser/snippets.contribution.i18n.json +++ b/i18n/deu/src/vs/workbench/parts/snippets/electron-browser/snippets.contribution.i18n.json @@ -11,6 +11,6 @@ "snippetSchema.json.default": "Leerer Codeausschnitt", "snippetSchema.json": "Benutzerkonfiguration des Codeausschnitts", "snippetSchema.json.prefix": "Das Präfix, das beim Auswählen des Codeausschnitts in IntelliSense verwendet werden soll.", - "snippetSchema.json.body": "Der Inhalt des Codeausschnitts. Verwenden Sie \"${id}\", \"${id:label}\", \"${1:label}\" für Variablen und \"$0\", \"$1\" für die Cursorpositionen.", + "snippetSchema.json.body": "Der Inhalt des Codeausschnitts. Verwenden Sie \"$1\", \"${1:defaultText}\", um Cursorpositionen zu definieren, und \"$0\" für die finale Cursorposition. Fügen Sie mit \"${varName}\" und \"${varName:defaultText}\" Variablenwerte ein, z. B. \"This is file: $TM_FILENAME\".", "snippetSchema.json.description": "Die Beschreibung des Codeausschnitts." } \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/surveys/electron-browser/languageSurveys.contribution.i18n.json b/i18n/deu/src/vs/workbench/parts/surveys/electron-browser/languageSurveys.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..b04bf830fa17efd065109f8fae41e95f31ed2a0a --- /dev/null +++ b/i18n/deu/src/vs/workbench/parts/surveys/electron-browser/languageSurveys.contribution.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "helpUs": "Helfen Sie uns die Unterstützung für {0} zu verbessern", + "takeShortSurvey": "An kurzer Umfrage teilnehmen", + "remindLater": "Später erinnern", + "neverAgain": "Nicht mehr anzeigen" +} \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/surveys/electron-browser/nps.contribution.i18n.json b/i18n/deu/src/vs/workbench/parts/surveys/electron-browser/nps.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..5082c06fc4a4f2734661211f639710153afecf65 --- /dev/null +++ b/i18n/deu/src/vs/workbench/parts/surveys/electron-browser/nps.contribution.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "surveyQuestion": "Wir würden uns freuen, wenn Sie an einer schnellen Umfrage teilnehmen.", + "takeSurvey": "An Umfrage teilnehmen", + "remindLater": "Später erinnern", + "neverAgain": "Nicht mehr anzeigen" +} \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/tasks/browser/buildQuickOpen.i18n.json b/i18n/deu/src/vs/workbench/parts/tasks/browser/buildQuickOpen.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..b8a1db0f78fd4a1a6b73d3f0fa7d30990ac2c2ae --- /dev/null +++ b/i18n/deu/src/vs/workbench/parts/tasks/browser/buildQuickOpen.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "noTasksMatching": "Keine übereinstimmenden Aufgaben" +} \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/tasks/browser/quickOpen.i18n.json b/i18n/deu/src/vs/workbench/parts/tasks/browser/quickOpen.i18n.json index c0432625724e130ef22a389a594c6fac63748493..b588e15359bd596aab3e59570ae06d668763b53c 100644 --- a/i18n/deu/src/vs/workbench/parts/tasks/browser/quickOpen.i18n.json +++ b/i18n/deu/src/vs/workbench/parts/tasks/browser/quickOpen.i18n.json @@ -4,5 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "entryAriaLabel": "{0}, tasks" + "entryAriaLabel": "{0}, tasks", + "customizeTask": "Aufgabe anpassen" } \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/tasks/browser/testQuickOpen.i18n.json b/i18n/deu/src/vs/workbench/parts/tasks/browser/testQuickOpen.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..b8a1db0f78fd4a1a6b73d3f0fa7d30990ac2c2ae --- /dev/null +++ b/i18n/deu/src/vs/workbench/parts/tasks/browser/testQuickOpen.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "noTasksMatching": "Keine übereinstimmenden Aufgaben" +} \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/tasks/common/taskConfiguration.i18n.json b/i18n/deu/src/vs/workbench/parts/tasks/common/taskConfiguration.i18n.json index a72e1281b77a6db47fcb9da3abf3a3fc8862355a..b78817aed4ca27c9a6a1a0f02e0643f463365ad8 100644 --- a/i18n/deu/src/vs/workbench/parts/tasks/common/taskConfiguration.i18n.json +++ b/i18n/deu/src/vs/workbench/parts/tasks/common/taskConfiguration.i18n.json @@ -5,8 +5,8 @@ // Do not edit this file. It is machine generated. { "ConfigurationParser.invalidCWD": "Warnung: \"options.cwd\" muss vom Typ \"string\" sein. Der Wert {0} wird ignoriert.\n", - "ConfigurationParser.noShell": "Warnung: Die Shell-Konfiguration wird nur beim Ausführen von Tasks im Terminal unterstützt.", "ConfigurationParser.noargs": "Fehler: Befehlsargumente müssen ein Array aus Zeichenfolgen sein. Angegebener Wert:\n{0}", + "ConfigurationParser.noShell": "Warnung: Die Shell-Konfiguration wird nur beim Ausführen von Tasks im Terminal unterstützt.", "ConfigurationParser.noName": "Fehler: Der Problemabgleich im Deklarationsbereich muss einen Namen besitzen:\n{0}\n", "ConfigurationParser.unknownMatcherKind": "Warnung: Der definierte Problemabgleich ist unbekannt. Die folgenden Typen werden unterstützt: string | ProblemMatcher | (string | ProblemMatcher)[].\n{0}\n", "ConfigurationParser.invalidVaraibleReference": "Fehler: Ungültiger ProblemMatcher-Verweis: {0}\n", diff --git a/i18n/deu/src/vs/workbench/parts/tasks/electron-browser/jsonSchemaCommon.i18n.json b/i18n/deu/src/vs/workbench/parts/tasks/electron-browser/jsonSchemaCommon.i18n.json index 386f8b115b1ed7fd388c1819397fe50ecbcb95e8..0570db2cdce1bf212c221bfd81714606825b8469 100644 --- a/i18n/deu/src/vs/workbench/parts/tasks/electron-browser/jsonSchemaCommon.i18n.json +++ b/i18n/deu/src/vs/workbench/parts/tasks/electron-browser/jsonSchemaCommon.i18n.json @@ -7,6 +7,7 @@ "JsonSchema.options": "Weitere Befehlsoptionen", "JsonSchema.options.cwd": "Das aktuelle Arbeitsverzeichnis des ausgeführten Programms oder Skripts. Wenn keine Angabe erfolgt, wird das aktuelle Arbeitsbereich-Stammverzeichnis des Codes verwendet.", "JsonSchema.options.env": "Die Umgebung des ausgeführten Programms oder der Shell. Wenn keine Angabe erfolgt, wird Umgebung des übergeordneten Prozesses verwendet.", + "JsonSchema.shellConfiguration": "Konfiguriert die zu verwendende Shell.", "JsonSchema.shell.executable": "Die zu verwendende Shell.", "JsonSchema.shell.args": "Die Shell-Argumente.", "JsonSchema.command": "Der auszuführende Befehl. Es kann sich um ein externes Programm oder einen Shellbefehl handeln.", diff --git a/i18n/deu/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v1.i18n.json b/i18n/deu/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v1.i18n.json index ce023819c120aa31d1f21d232aef9ca8fd547c05..1bfe4d70cd96dbc351ad2ed657f3381f9c5955a7 100644 --- a/i18n/deu/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v1.i18n.json +++ b/i18n/deu/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v1.i18n.json @@ -5,6 +5,8 @@ // Do not edit this file. It is machine generated. { "JsonSchema.version": "Die Versionsnummer der Konfiguration.", + "JsonSchema._runner": "Die Ausführung ist abgestuft. Verwenden Sie die offizielle Ausführungseigenschaft.", + "JsonSchema.runner": "Definiert, ob die Aufgabe als Prozess ausgeführt wird, und die Ausgabe wird im Ausgabefenster oder innerhalb des Terminals angezeigt.", "JsonSchema.windows": "Windows-spezifische Befehlskonfiguration", "JsonSchema.mac": "Mac-spezifische Befehlskonfiguration", "JsonSchema.linux": "Linux-spezifische Befehlskonfiguration", diff --git a/i18n/deu/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.i18n.json b/i18n/deu/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.i18n.json index e52c61e82c75ae88e34df8b2ca1bb0e9acc6633e..433a15c4e8fe3f36b65802795fd56f50c4e1a79a 100644 --- a/i18n/deu/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.i18n.json +++ b/i18n/deu/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.i18n.json @@ -4,11 +4,14 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "JsonSchema.shell": "Gibt an, ob der Befehl ein Shellbefehl oder ein externes Programm ist. Wenn keine Angabe erfolgt, ist der Standardwert \"false\".", + "JsonSchema.tasks.dependsOn.string": "Eine weitere Aufgabe, von der diese Aufgabe abhängt.", + "JsonSchema.tasks.dependsOn.array": "Die anderen Aufgaben, von denen diese Aufgabe abhängt.", + "JsonSchema.tasks.group": "Definiert die Ausführungsgruppe, der diese Aufgabe angehört. Wird dies ausgelassen, gehört die Aufgabe keiner Gruppe an.", + "JsonSchema.tasks.type": "Definiert, ob die Aufgabe als Prozess oder als Befehl innerhalb einer Shell ausgeführt wird. Standardmäßig wird sie als Prozess ausgeführt.", "JsonSchema.version": "Die Versionsnummer der Konfiguration.", + "JsonSchema.tasks.customize": "Die anzupassende beigetragene Aufgabe.", "JsonSchema.windows": "Windows-spezifische Befehlskonfiguration", "JsonSchema.mac": "Mac-spezifische Befehlskonfiguration", - "JsonSchema.linux": "Linux-spezifische Befehlskonfiguration", - "JsonSchema.shell": "Gibt an, ob der Befehl ein Shellbefehl oder ein externes Programm ist. Wenn keine Angabe erfolgt, ist der Standardwert \"false\".", - "JsonSchema.tasks.dependsOn.string": "Eine weitere Aufgabe, von der diese Aufgabe abhängt.", - "JsonSchema.tasks.dependsOn.array": "Die anderen Aufgaben, von denen diese Aufgabe abhängt." + "JsonSchema.linux": "Linux-spezifische Befehlskonfiguration" } \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json b/i18n/deu/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json index aedbe077c16f72e14ef1a536f838fc2b7630ea61..d4db76035e55034eb7c43c1aed3f7afee4da56df 100644 --- a/i18n/deu/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json +++ b/i18n/deu/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json @@ -18,10 +18,12 @@ "problems": "Probleme", "manyMarkers": "mehr als 99", "tasks": "Aufgaben", + "TaskSystem.noHotSwap": "Zum Ändern des Aufgabenausführungsmoduls muss VS Code neu gestartet werden. Die Änderung wird ignoriert.", "TaskService.noBuildTask": "Keine Buildaufgabe definiert. Markieren Sie eine Aufgabe mit 'isBuildCommand' in der tasks.json-Datei.", "TaskService.noTestTask": "Keine Testaufgabe definiert. Markieren Sie eine Aufgabe mit 'isTestCommand' in der tasks.json-Datei.", "TaskServer.noTask": "Die angeforderte auszuführende Aufgabe {0} wurde nicht gefunden.", - "TaskSystem.activeSame": "Der Task ist bereits aktiv und im Überwachungsmodus. Um den Task zu beenden, verwenden Sie \"F1 > Task beenden\".", + "customizeParseErrors": "Die aktuelle Aufgabenkonfiguration weist Fehler auf. Beheben Sie die Fehler, bevor Sie eine Aufgabe anpassen.", + "moreThanOneBuildTask": "In \"tasks.json\" sind mehrere Buildaufgaben definiert. Die erste wird ausgeführt.\n", "TaskSystem.active": "Eine aktive Aufgabe wird bereits ausgeführt. Beenden Sie diese, bevor Sie eine andere Aufgabe ausführen.", "TaskSystem.restartFailed": "Fehler beim Beenden und Neustarten der Aufgabe \"{0}\".", "TaskSystem.configurationErrors": "Fehler: Die angegebene Aufgabenkonfiguration weist Validierungsfehler auf und kann nicht verwendet werden. Beheben Sie zuerst die Fehler.", diff --git a/i18n/deu/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.i18n.json b/i18n/deu/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.i18n.json index a619f8880ba7b0b9b3c4ed08989d65cbcfed3268..0ad146b37850f7cc4307bc3a37c36444c9693b8d 100644 --- a/i18n/deu/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.i18n.json +++ b/i18n/deu/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.i18n.json @@ -6,5 +6,7 @@ { "TerminalTaskSystem.unknownError": "Unbekannter Fehler beim Ausführen eines Tasks. Details finden Sie im Taskausgabeprotokoll.", "TerminalTaskSystem.terminalName": "Aufgabe - {0}", - "TerminalTaskSystem": "Ein Shell-Befehl kann nicht auf einem UNC-Laufwerk ausgeführt werden." + "reuseTerminal": "Das Terminal wird von Aufgaben wiederverwendet, drücken Sie zum Schließen eine beliebige Taste.", + "TerminalTaskSystem": "Ein Shell-Befehl kann nicht auf einem UNC-Laufwerk ausgeführt werden.", + "unkownProblemMatcher": "Der Problemabgleicher {0} kann nicht aufgelöst werden. Der Abgleicher wird ignoriert." } \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/tasks/node/processTaskSystem.i18n.json b/i18n/deu/src/vs/workbench/parts/tasks/node/processTaskSystem.i18n.json index 8a66033683fd745340f6c43efe67192658ee78bc..b6c2bea0eab6b63dbf569f68da30e7ee932263cf 100644 --- a/i18n/deu/src/vs/workbench/parts/tasks/node/processTaskSystem.i18n.json +++ b/i18n/deu/src/vs/workbench/parts/tasks/node/processTaskSystem.i18n.json @@ -7,5 +7,6 @@ "TaskRunnerSystem.unknownError": "Unbekannter Fehler beim Ausführen eines Tasks. Details finden Sie im Taskausgabeprotokoll.", "TaskRunnerSystem.watchingBuildTaskFinished": "\nDie Überwachung der Buildtasks wurde beendet.", "TaskRunnerSystem.childProcessError": "Failed to launch external program {0} {1}.", - "TaskRunnerSystem.cancelRequested": "\nDer Task \"{0}\" wurde durch eine Benutzeranforderung beendet." + "TaskRunnerSystem.cancelRequested": "\nDer Task \"{0}\" wurde durch eine Benutzeranforderung beendet.", + "unkownProblemMatcher": "Der Problemabgleicher {0} kann nicht aufgelöst werden. Der Abgleicher wird ignoriert." } \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/terminal/electron-browser/terminalActions.i18n.json b/i18n/deu/src/vs/workbench/parts/terminal/electron-browser/terminalActions.i18n.json index 2b0635fb08d60176c66997b7a75f61e46ee1aa66..2bbcb5a8073ba29493de524042a0ac219d3e8266 100644 --- a/i18n/deu/src/vs/workbench/parts/terminal/electron-browser/terminalActions.i18n.json +++ b/i18n/deu/src/vs/workbench/parts/terminal/electron-browser/terminalActions.i18n.json @@ -8,6 +8,7 @@ "workbench.action.terminal.kill": "Aktive Terminalinstanz beenden", "workbench.action.terminal.kill.short": "Terminal beenden", "workbench.action.terminal.copySelection": "Auswahl kopieren", + "workbench.action.terminal.selectAll": "Alles auswählen", "workbench.action.terminal.new": "Neues integriertes Terminal erstellen", "workbench.action.terminal.new.short": "Neues Terminal", "workbench.action.terminal.focus": "Fokus im Terminal", @@ -26,5 +27,8 @@ "workbench.action.terminal.scrollUp": "Nach oben scrollen (Zeile)", "workbench.action.terminal.scrollUpPage": "Nach oben scrollen (Seite)", "workbench.action.terminal.scrollToTop": "Bildlauf nach oben", - "workbench.action.terminal.clear": "Löschen" + "workbench.action.terminal.clear": "Löschen", + "workbench.action.terminal.allowWorkspaceShell": "Shell-Konfiguration des Arbeitsbereichs zulassen", + "workbench.action.terminal.disallowWorkspaceShell": "Verbiete Workspace Shell Konfiguration", + "workbench.action.terminal.rename": "Umbenennen" } \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/terminal/electron-browser/terminalColorRegistry.i18n.json b/i18n/deu/src/vs/workbench/parts/terminal/electron-browser/terminalColorRegistry.i18n.json index 209097e71ed3165310ca5868bd232f7e84c6e302..9d4810761f24371631240b96e6b04a543431877e 100644 --- a/i18n/deu/src/vs/workbench/parts/terminal/electron-browser/terminalColorRegistry.i18n.json +++ b/i18n/deu/src/vs/workbench/parts/terminal/electron-browser/terminalColorRegistry.i18n.json @@ -4,5 +4,7 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "terminal.background": "Die Hintergrundfarbe des Terminals, dies ermöglicht eine unterschiedliche Färbung des Terminals im Panel.", + "terminal.foreground": "Die Vordergrundfarbe des Terminal.", "terminal.ansiColor": "\"{0}\": ANSI-Farbe im Terminal" } \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/terminal/electron-browser/terminalFindWidget.i18n.json b/i18n/deu/src/vs/workbench/parts/terminal/electron-browser/terminalFindWidget.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..32db8ee0bd6e91be8e1cd6e55c5dbbb1efb4a7bf --- /dev/null +++ b/i18n/deu/src/vs/workbench/parts/terminal/electron-browser/terminalFindWidget.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "label.find": "Suchen", + "placeholder.find": "Suchen", + "label.previousMatchButton": "Vorherige Übereinstimmung", + "label.nextMatchButton": "Nächste Übereinstimmung", + "label.closeButton": "Schließen" +} \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.i18n.json b/i18n/deu/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.i18n.json index 656e6a048aeef3f80f55ea21864481c24e221d85..ed2d8c3d2122c110c8f717180c68f75f0d1f3726 100644 --- a/i18n/deu/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.i18n.json +++ b/i18n/deu/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.i18n.json @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "terminal.integrated.copySelection.noSelection": "Die Terminalauswahl kann nicht kopiert werden, wenn das Terminal nicht den Fokus besitzt.", "terminal.integrated.exitedWithCode": "Der Terminalprozess wurde mit folgendem Exitcode beendet: {0}", "terminal.integrated.waitOnExit": "Betätigen Sie eine beliebige Taste, um das Terminal zu schließen.", "terminal.integrated.launchFailed": "Fehler beim Starten des Terminalprozessbefehls \"{0}{1}\" (Exitcode: {2})." diff --git a/i18n/deu/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json b/i18n/deu/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json index cc616e88ee27e30dfe8c2c689e5be5c4a0b6018c..5b38193cdecf0c74e7cb6025e0b1016660a99bda 100644 --- a/i18n/deu/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json +++ b/i18n/deu/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json @@ -6,6 +6,7 @@ { "selectTheme.label": "Farbdesign", "installColorThemes": "Zusätzliche Farbschemas installieren...", + "themes.selectTheme": "Farbdesign auswählen (eine Vorschau wird mit den Tasten NACH OBEN/NACH UNTEN angezeigt)", "selectIconTheme.label": "Dateisymboldesign", "installIconThemes": "Zusätzliche Dateisymbolschemas installieren...", "noIconThemeLabel": "Keine", diff --git a/i18n/deu/src/vs/workbench/parts/update/electron-browser/update.i18n.json b/i18n/deu/src/vs/workbench/parts/update/electron-browser/update.i18n.json index 22510793b9c98dfc49d88d5942441b545680b176..80d0e1e4ecf47c528b678d16c9727181e29fcf37 100644 --- a/i18n/deu/src/vs/workbench/parts/update/electron-browser/update.i18n.json +++ b/i18n/deu/src/vs/workbench/parts/update/electron-browser/update.i18n.json @@ -15,5 +15,18 @@ "license": "Lizenz lesen", "updateAvailable": "{0} wird nach dem Neustart aktualisiert.", "thereIsUpdateAvailable": "Ein Update ist verfügbar.", - "noUpdatesAvailable": "Zurzeit sind keine Updates verfügbar." + "noUpdatesAvailable": "Zurzeit sind keine Updates verfügbar.", + "updateIsReady": "Neue Aktualisierung verfügbar.", + "commandPalette": "Befehlspalette...", + "settings": "Einstellungen", + "keyboardShortcuts": "Tastenkombinationen", + "selectTheme.label": "Farbdesign", + "themes.selectIconTheme.label": "Dateisymboldesign", + "not available": "Aktualisierungen nicht verfügbar", + "checkingForUpdates": "Überprüfen auf Updates...", + "DownloadUpdate": "Verfügbares Update herunterladen", + "DownloadingUpdate": "Das Update wird heruntergeladen...", + "InstallingUpdate": "Update wird installiert...", + "restartToUpdate": "Für Update neu starten...", + "checkForUpdates": "Nach Aktualisierungen suchen..." } \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/views/browser/views.i18n.json b/i18n/deu/src/vs/workbench/parts/views/browser/views.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..b7eb39e941ebe8231e75695c6a51ff43817ba50b --- /dev/null +++ b/i18n/deu/src/vs/workbench/parts/views/browser/views.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "viewToolbarAriaLabel": "{0}-Aktionen" +} \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/views/browser/viewsExtensionPoint.i18n.json b/i18n/deu/src/vs/workbench/parts/views/browser/viewsExtensionPoint.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..69d939fd7d16c929d915fd29bf53596e99b317a0 --- /dev/null +++ b/i18n/deu/src/vs/workbench/parts/views/browser/viewsExtensionPoint.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "requirearray": "Ansichten müssen ein Array sein.", + "requirestring": "Die Eigenschaft \"{0}\" ist erforderlich. Sie muss vom Typ \"string\" sein.", + "optstring": "Die Eigenschaft \"{0}\" kann ausgelassen werden oder muss vom Typ \"string\" sein.", + "vscode.extension.contributes.view.id": "Bezeichner der Ansicht. Damit können Sie einen Datenanbieter über die API \"vscode.window.registerTreeDataProviderForView\" registrieren. Er dient auch zum Aktivieren Ihrer Erweiterung, indem Sie das Ereignis \"onView:${id}\" für \"activationEvents\" registrieren.", + "vscode.extension.contributes.view.name": "Der visuell lesbare Name der Ansicht. Wird angezeigt", + "vscode.extension.contributes.views": "Trägt Ansichten zum Editor bei.", + "views.explorer": "Explorer-Ansicht", + "locationId.invalid": "{0}\" ist kein gültiger Ansichtenspeicherort" +} \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json b/i18n/deu/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json index b167d91d677c3233138834cde9a0f9ea1cc6f40d..89fcf6e01edf28ea0df507dbeca94d81d92bdf66 100644 --- a/i18n/deu/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json +++ b/i18n/deu/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json @@ -11,20 +11,26 @@ "welcomePage.openFolder": "Ordner öffnen...", "welcomePage.cloneGitRepository": "Git-Repository klonen...", "welcomePage.recent": "Zuletzt verwendet", + "welcomePage.moreRecent": "Weitere Informationen...", "welcomePage.noRecentFolders": "Keine kürzlich verwendeten Ordner", "welcomePage.help": "Hilfe", + "welcomePage.keybindingsCheatsheet": "Druckbare Tastaturübersicht", "welcomePage.introductoryVideos": "Einführungsvideos", "welcomePage.productDocumentation": "Produktdokumentation", "welcomePage.gitHubRepository": "GitHub-Repository", "welcomePage.stackOverflow": "Stack Overflow", "welcomePage.showOnStartup": "Willkommensseite beim Start anzeigen", "welcomePage.customize": "Anpassen", + "welcomePage.installExtensionPacks": "Tools und Sprachen", + "welcomePage.installExtensionPacksDescription": "Unterstützung für {0} und {1} installieren", + "welcomePage.moreExtensions": "mehr", "welcomePage.installKeymapDescription": "Tastenkombinationen installieren", + "welcomePage.installKeymapExtension": "Installieren Sie die Tastenkombinationen von {0} und {1}.", "welcomePage.others": "Andere", "welcomePage.colorTheme": "Farbdesign", "welcomePage.colorThemeDescription": "Passen Sie das Aussehen des Editors und Ihres Codes an Ihre Wünsche an.", + "welcomePage.learn": "Lernen", "welcomePage.showCommands": "Alle Befehle suchen und ausführen", - "welcomePage.showCommandsDescription": "Über die Einstellungen ({0}) können Sie Befehle schnell suchen und darauf zugreifen.", "welcomePage.interfaceOverview": "Überblick über die Schnittstelle", "welcomePage.interfaceOverviewDescription": "Erhalten Sie eine visuelle Überlagerung, die die wichtigsten Komponenten der Benutzeroberfläche hervorhebt.", "welcomePage.interactivePlayground": "Interaktiver Playground", diff --git a/i18n/deu/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.contribution.i18n.json b/i18n/deu/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.contribution.i18n.json index f83bfd761c7868e80361957459dc66539f549575..399910772cea534be382faf55902f92c18c658e4 100644 --- a/i18n/deu/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.contribution.i18n.json +++ b/i18n/deu/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.contribution.i18n.json @@ -4,7 +4,5 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "workbenchConfigurationTitle": "Workbench", - "welcomePage.enabled": "Wenn diese Option aktiviert ist, wird die Willkommensseite beim Start angezeigt.", "help": "Hilfe" } \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json b/i18n/deu/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json index 1bc333472229e37df95139710efe3c4c76807f36..bd211db7d59d969a35f8ec9044f3d56ee077eeb5 100644 --- a/i18n/deu/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json +++ b/i18n/deu/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json @@ -4,12 +4,35 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "workbenchConfigurationTitle": "Workbench", + "welcomePage.enabled": "Wenn diese Option aktiviert ist, wird die Willkommensseite beim Start angezeigt.", "welcomePage": "Willkommen", + "welcomePage.javaScript": "JavaScript", + "welcomePage.typeScript": "TypeScript", + "welcomePage.python": "Python", + "welcomePage.php": "PHP", + "welcomePage.docker": "Docker", + "welcomePage.vim": "Vim", + "welcomePage.sublime": "Sublime", + "welcomePage.atom": "Atom", + "welcomePage.extensionPackAlreadyInstalled": "Unterstützung für {0} ist bereits installiert.", + "welcomePage.willReloadAfterInstallingExtensionPack": "Nach dem Installieren zusätzlicher Unterstützung für {0} wird das Fenster neu geladen.", + "welcomePage.installingExtensionPack": "Zusätzliche Unterstützung für {0} wird installiert...", + "welcomePage.extensionPackNotFound": "Unterstützung für {0} mit der ID {1} wurde nicht gefunden.", "welcomePage.keymapAlreadyInstalled": "Die {0} Tastenkombinationen sind bereits installiert.", "welcomePage.willReloadAfterInstallingKeymap": "Das Fenster wird nach der Installation der {0}-Tastaturbefehle neu geladen.", "welcomePage.installingKeymap": "Die {0}-Tastenkombinationen werden installiert...", "welcomePage.keymapNotFound": "Die {0} Tastenkombinationen mit der ID {1} wurden nicht gefunden.", "welcome.title": "Willkommen", + "welcomePage.openFolderWithPath": "Ordner {0} mit Pfad {1} öffnen", + "welcomePage.extensionListSeparator": ",", + "welcomePage.installKeymap": "Tastenzuordnung {0} öffnen", + "welcomePage.installExtensionPack": "Zusätzliche Unterstützung für {0} installieren", + "welcomePage.installedKeymap": "Die Tastaturzuordnung {0} ist bereits installiert.", + "welcomePage.installedExtensionPack": "Unterstützung für {0} ist bereits installiert.", "ok": "OK", - "cancel": "Abbrechen" + "details": "Details", + "cancel": "Abbrechen", + "welcomePage.buttonBackground": "Hintergrundfarbe für die Schaltflächen auf der Willkommensseite.", + "welcomePage.buttonHoverBackground": "Hoverhintergrundfarbe für die Schaltflächen auf der Willkommensseite." } \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json b/i18n/deu/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json index 197be5e3800c36fd065d45a6b3f42311eff338a6..f8c9526c03a234871e974f0f4e415a9188374f81 100644 --- a/i18n/deu/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json +++ b/i18n/deu/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json @@ -5,5 +5,6 @@ // Do not edit this file. It is machine generated. { "walkThrough.unboundCommand": "Ungebunden", - "walkThrough.gitNotFound": "Git scheint auf Ihrem System nicht installiert zu sein." + "walkThrough.gitNotFound": "Git scheint auf Ihrem System nicht installiert zu sein.", + "walkThrough.embeddedEditorBackground": "Hintergrundfarbe für die eingebetteten Editoren im Interaktiven Playground." } \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json b/i18n/deu/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json index 0c8e653b4e5f4b58cbcf6007b1772152f5244a6b..8f33c300c01e8b3a5ffd38bac17a0a9ba9339b7f 100644 --- a/i18n/deu/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json +++ b/i18n/deu/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json @@ -6,6 +6,12 @@ { "open": "Einstellungen öffnen", "close": "Schließen", + "saveAndRetry": "Änderungen Speichern und Wiederholen", "errorUnknownKey": "Die Konfigurationsdatei kann nicht geschrieben werden (unbekannter Schlüssel).", - "errorInvalidTarget": "In die Konfigurationsdatei kann nicht geschrieben werden (ungültiges Ziel)." + "errorInvalidTarget": "In die Konfigurationsdatei kann nicht geschrieben werden (ungültiges Ziel).", + "errorNoWorkspaceOpened": "In die Einstellungen kann nicht geschrieben werden, weil kein Ordner geöffnet ist. Öffnen Sie zuerst einen Ordner, und versuchen Sie es noch mal.", + "errorInvalidConfiguration": "In die Einstellungen kann nicht geschrieben werden. Öffnen Sie **Benutzereinstellungen**, um Fehler/Warnungen in der Datei zu korrigieren, und versuchen Sie es noch mal.", + "errorInvalidConfigurationWorkspace": "In die Einstellungen kann nicht geschrieben werden. Öffnen Sie die **Arbeitsbereichseinstellungen**, um Fehler/Warnungen in der Datei zu korrigieren, und versuchen Sie es noch mal.", + "errorConfigurationFileDirty": "In die Einstellungen kann nicht geschrieben werden, weil die Datei geändert wurde. Speichern Sie die Datei **Benutzereinstellungen**, und versuchen Sie es noch mal.", + "errorConfigurationFileDirtyWorkspace": "In die Einstellungen kann nicht geschrieben werden, weil die Datei geändert wurde. Speichern Sie die Datei **Arbeitsbereichseinstellungen**, und versuchen Sie es noch mal." } \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/services/crashReporter/common/crashReporterService.i18n.json b/i18n/deu/src/vs/workbench/services/crashReporter/common/crashReporterService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..f7a2d1f0c3ff47d2cd45b56ab70e0b6a8ef81e7d --- /dev/null +++ b/i18n/deu/src/vs/workbench/services/crashReporter/common/crashReporterService.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "telemetryConfigurationTitle": "Telemetrie", + "telemetry.enableCrashReporting": "Aktiviert Absturzberichte, die an Microsoft gesendet werden.\nDiese Option erfordert einen Neustart, damit sie wirksam wird." +} \ No newline at end of file diff --git a/i18n/deu/src/vs/workbench/services/progress/browser/progressService2.i18n.json b/i18n/deu/src/vs/workbench/services/progress/browser/progressService2.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..6db7d6aae514a031afce5ac346abfd84bb8ee1cc --- /dev/null +++ b/i18n/deu/src/vs/workbench/services/progress/browser/progressService2.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "progress.text": "{0} - {1}", + "progress.title": "{0}: {1}" +} \ No newline at end of file diff --git a/i18n/esn/extensions/git/out/commands.i18n.json b/i18n/esn/extensions/git/out/commands.i18n.json index 1897af0ac2629c98c7076a6d9d88d4fcba58d1b5..6ace96fe6d2c1f281d44d53bbdfd736e5228b754 100644 --- a/i18n/esn/extensions/git/out/commands.i18n.json +++ b/i18n/esn/extensions/git/out/commands.i18n.json @@ -26,6 +26,9 @@ "provide commit message": "Proporcione un mensaje de confirmación", "branch name": "Nombre de rama", "provide branch name": "Especifique un nombre para la rama", + "select branch to delete": "Seleccione una rama para borrar", + "confirm force delete branch": "La rama '{0}' no está completamente fusionada. ¿Borrarla de todas formas?", + "delete branch": "Borrar rama...", "no remotes to pull": "El repositorio no tiene remotos configurados de los que extraer.", "no remotes to push": "El repositorio no tiene remotos configurados en los que insertar.", "nobranch": "Extraiga del repositorio una rama para insertar un remoto.", diff --git a/i18n/esn/extensions/git/package.i18n.json b/i18n/esn/extensions/git/package.i18n.json index 504bfa025696e98fcb72f935a5cb34ddac5fb04d..607d4f1df8120c2fa5f8064c83a6e69958737698 100644 --- a/i18n/esn/extensions/git/package.i18n.json +++ b/i18n/esn/extensions/git/package.i18n.json @@ -26,12 +26,13 @@ "command.undoCommit": "Deshacer última confirmación", "command.checkout": "Desproteger en...", "command.branch": "Crear rama...", + "command.deleteBranch": "Borrar rama...", "command.pull": "Incorporación de cambios", "command.pullRebase": "Incorporación de cambios (fusionar mediante cambio de base)", "command.push": "Insertar", "command.pushTo": "Insertar en...", "command.sync": "Sincronizar", - "command.publish": "Publicar", + "command.publish": "Publicar rama", "command.showOutput": "Mostrar salida de GIT", "config.enabled": "Si GIT está habilitado", "config.path": "Ruta de acceso del ejecutable de GIT", diff --git a/i18n/esn/extensions/jake/out/main.i18n.json b/i18n/esn/extensions/jake/out/main.i18n.json index 8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a..1b387f270700219af0b93b31a0c4e6962f08cc00 100644 --- a/i18n/esn/extensions/jake/out/main.i18n.json +++ b/i18n/esn/extensions/jake/out/main.i18n.json @@ -3,4 +3,6 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. -{} \ No newline at end of file +{ + "execFailed": "La detección automática de Jake falló con el error: {0}" +} \ No newline at end of file diff --git a/i18n/esn/extensions/jake/package.i18n.json b/i18n/esn/extensions/jake/package.i18n.json index 8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a..c22d4c52c92020aa9f8fdbfe7e7c1602f19402e2 100644 --- a/i18n/esn/extensions/jake/package.i18n.json +++ b/i18n/esn/extensions/jake/package.i18n.json @@ -3,4 +3,6 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. -{} \ No newline at end of file +{ + "config.jake.autoDetect": "Controla si la detección automática de tareas Jake estan activada/desactivada. El valor predeterminado es \"activada\"." +} \ No newline at end of file diff --git a/i18n/esn/extensions/markdown/out/extension.i18n.json b/i18n/esn/extensions/markdown/out/extension.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..360f0b974b76ff12c78efd7acfbd1d9541ab882e --- /dev/null +++ b/i18n/esn/extensions/markdown/out/extension.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "onPreviewStyleLoadError": "No se pudo cargar 'markdown.styles': {0}" +} \ No newline at end of file diff --git a/i18n/esn/extensions/merge-conflict/out/codelensProvider.i18n.json b/i18n/esn/extensions/merge-conflict/out/codelensProvider.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..22ca13053b59f036483f6831659773d0a1bd0492 --- /dev/null +++ b/i18n/esn/extensions/merge-conflict/out/codelensProvider.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "acceptCurrentChange": "Aceptar cambio actual", + "acceptIncomingChange": "Aceptar cambio entrante", + "acceptBothChanges": "Aceptar ambos cambios", + "compareChanges": "Comparar cambios" +} \ No newline at end of file diff --git a/i18n/esn/extensions/merge-conflict/out/commandHandler.i18n.json b/i18n/esn/extensions/merge-conflict/out/commandHandler.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..e94eadacd8d8ca98d7da15160907312c3cdf78b8 --- /dev/null +++ b/i18n/esn/extensions/merge-conflict/out/commandHandler.i18n.json @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "cursorNotInConflict": "El cursor de edición no se encuentra en un conflicto de fusión", + "compareChangesTitle": "{0}: Cambios actuales ⟷ Cambios entrantes", + "cursorOnCommonAncestorsRange": "El cursor del editor está dentro del bloque de ancestros comunes, por favor muévalo al bloque \"actual\" o al \"entrante\"", + "cursorOnSplitterRange": "El cursor del editor está dentro del separador de conflictos de fusión, muévalo al bloque \"actual\" o al \"entrante\" ", + "noConflicts": "No se encontraron conflictos en este archivo", + "noOtherConflictsInThisFile": "No hay más conflictos en este archivo" +} \ No newline at end of file diff --git a/i18n/esn/extensions/merge-conflict/out/mergeDecorator.i18n.json b/i18n/esn/extensions/merge-conflict/out/mergeDecorator.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..9cf24c3ecc5e017d6c075168090e1fadcebaf194 --- /dev/null +++ b/i18n/esn/extensions/merge-conflict/out/mergeDecorator.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "currentChange": "(Cambio actual)", + "incomingChange": "(Cambio entrante)" +} \ No newline at end of file diff --git a/i18n/esn/extensions/merge-conflict/package.i18n.json b/i18n/esn/extensions/merge-conflict/package.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..b72c99c527d15ee51d7b8d32c6486b77f8347a24 --- /dev/null +++ b/i18n/esn/extensions/merge-conflict/package.i18n.json @@ -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. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "command.category": "Fusionar conflicto", + "command.accept.all-incoming": "Aceptar todos los entrantes", + "command.accept.all-both": "Aceptar ambos", + "command.accept.current": "Aceptar actuales", + "command.accept.incoming": "Aceptar entrantes", + "command.accept.selection": "Aceptar selección", + "command.accept.both": "Aceptar ambos", + "command.next": "Siguiente conflicto", + "command.previous": "Conflicto anterior", + "command.compare": "Comparar conflicto actual", + "config.title": "Fusionar conflicto", + "config.codeLensEnabled": "Habilitar/deshabilitar CodeLens de fusionar bloque de conflictos en el editor", + "config.decoratorsEnabled": "Habilitar/deshabilitar decoradores de conflictos de fusión en el editor" +} \ No newline at end of file diff --git a/i18n/esn/extensions/npm/package.i18n.json b/i18n/esn/extensions/npm/package.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..d71e21915daba7ea91af1034d20d81a492aef640 --- /dev/null +++ b/i18n/esn/extensions/npm/package.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "config.npm.autoDetect": "Controla si la detección automática de scripts npm está activada o desactivada. Por defecto está activada." +} \ No newline at end of file diff --git a/i18n/esn/extensions/typescript/out/features/bufferSyncSupport.i18n.json b/i18n/esn/extensions/typescript/out/features/bufferSyncSupport.i18n.json index ce77997be34a47f6537b7fc60a829c33a5f957a2..11669b0c32b47cfba0d91cd04523041c3c776835 100644 --- a/i18n/esn/extensions/typescript/out/features/bufferSyncSupport.i18n.json +++ b/i18n/esn/extensions/typescript/out/features/bufferSyncSupport.i18n.json @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "versionMismatch": "Las versiones no coinciden; global tsc ({0}) != servicio de lenguaje de VS Code ({1}). Pueden producirse errores de compilación incoherente.", "moreInformation": "Más información", "doNotCheckAgain": "No volver a comprobar", "close": "Cerrar", diff --git a/i18n/esn/extensions/typescript/out/utils/projectStatus.i18n.json b/i18n/esn/extensions/typescript/out/utils/projectStatus.i18n.json index 22620be6b22239fec9d4fb239ce5bfa662a0251b..1248c23303354c27ba2af3964470969a95bc0665 100644 --- a/i18n/esn/extensions/typescript/out/utils/projectStatus.i18n.json +++ b/i18n/esn/extensions/typescript/out/utils/projectStatus.i18n.json @@ -6,7 +6,6 @@ { "hintExclude": "Para habilitar las características de lenguaje de JavaScript/TypeScript en todo el proyecto, excluya las carpetas con muchos archivos, como: {0}", "hintExclude.generic": "Para habilitar las características de idioma de JavaScript/TypeScript IntelliSense en todo el proyecto, excluya las carpetas de tamaño grande con archivos de origen en los que no trabaje.", - "open": "Configurar exclusiones", "large.label": "Configurar exclusiones", "hintExclude.tooltip": "Para habilitar las características de idioma de JavaScript/TypeScript IntelliSense en todo el proyecto, excluya las carpetas de tamaño grande con archivos de origen en los que no trabaje." } \ No newline at end of file diff --git a/i18n/esn/extensions/typescript/out/utils/typingsStatus.i18n.json b/i18n/esn/extensions/typescript/out/utils/typingsStatus.i18n.json index f522401a83d6ed09d098738cb66c987eb306e0d1..0d41f3ba91cef374d755c661440d1e6a11e59520 100644 --- a/i18n/esn/extensions/typescript/out/utils/typingsStatus.i18n.json +++ b/i18n/esn/extensions/typescript/out/utils/typingsStatus.i18n.json @@ -5,7 +5,7 @@ // Do not edit this file. It is machine generated. { "installingPackages": "Recuperando cambios en los datos para un mejor rendimiento de TypeScript IntelliSense", - "typesInstallerInitializationFailed.title": "No se pudieron instalar los archivos de lenguaje para las características de lenguaje JavaScript. Asegúrese que NPM está instalado y en su ruta de acceso", + "typesInstallerInitializationFailed.title": "No se pudieron instalar archivos de términos para las características de lenguaje de JavaScript. Asegúrese de que NPM está instalado o configure \"typescript.npm\" en la configuración de usuario", "typesInstallerInitializationFailed.moreInformation": "Más información", "typesInstallerInitializationFailed.doNotCheckAgain": "No volver a comprobar", "typesInstallerInitializationFailed.close": "Cerrar" diff --git a/i18n/esn/extensions/typescript/package.i18n.json b/i18n/esn/extensions/typescript/package.i18n.json index 599140da8f582ce319730b8ff3fb7798650620e7..95927c8d1dd7c7672114357e9de12b74d84a6d84 100644 --- a/i18n/esn/extensions/typescript/package.i18n.json +++ b/i18n/esn/extensions/typescript/package.i18n.json @@ -13,7 +13,6 @@ "typescript.check.tscVersion": "Compruebe si un compilador de TypeScript de instalación global (p. ej., tsc) difiere del servicio de lenguaje de TypeScript usado.", "typescript.tsserver.log": "votes Habilita los registros del servidor TS a un archivo. Este registro se puede utilizar para diagnosticar problemas en el servidor TS. Este registro puede contener rutas de acceso, código fuente y posiblemente otra información sensitiva acerca del proyecto.", "typescript.tsserver.trace": "Habilita el seguimiento de mensajes al servidor TS. Este seguimiento se puede utilizar para diagnosticar problemas en el servidor TS. Este seguimiento puede contener rutas de acceso, código fuente y posiblemente otra información sensitiva acerca del proyecto.", - "typescript.tsserver.experimentalAutoBuild": "Permite la generación automática experimental. Requiere la versión de desarrollo 1.9 o tsserver 2.x y un reinicio de VS Code después de modificarlo.", "typescript.validate.enable": "Habilita o deshabilita la validación de TypeScript.", "typescript.format.enable": "Habilita o deshabilita el formateador predeterminado de TypeScript.", "javascript.format.enable": "Habilita o deshabilita el formateador predeterminado de JavaScript.", @@ -37,9 +36,12 @@ "typescript.referencesCodeLens.enabled": "Habilitar/deshabilitar las referencias de CodeLens en los archivos de TypeScript. Requiere TypeScript >= 2.0.6.", "typescript.implementationsCodeLens.enabled": "Habilita o deshabilita implementaciones de CodeLens. Requiere TypeScript >= 2.2.0.", "typescript.openTsServerLog.title": "Abrir registro del servidor de TS", + "typescript.restartTsServer": "Reiniciar servidor TS", "typescript.selectTypeScriptVersion.title": "Seleccionar versión de TypeScript", "jsDocCompletion.enabled": "Habilita o deshabilita comentarios automaticos de JSDoc", "javascript.implicitProjectConfig.checkJs": "Habilita/deshabilita la comprobación semántica de los archivos JavaScript. Los archivos jsconfig.json o tsconfig.json reemplazan esta configuración. Se requiere TypeScript >=2.3.1.", - "typescript.check.npmIsInstalled": "Comprueba si NPM esta instalado para recibir adquisiciones automaticas de Typings", - "javascript.nameSuggestions": "Habilitar/deshabilitar nombres únicos de la lista de sugerencias en los archivos de JavaScript. " + "typescript.npm": "Especifica la ruta de acceso al archivo ejecutable de NPM usada para la adquisición automática de tipos. Requiere TypeScript >= 2.3.4.", + "typescript.check.npmIsInstalled": "Compruebe si NPM está instalado para la adquisición automática de tipos.", + "javascript.nameSuggestions": "Habilitar/deshabilitar nombres únicos de la lista de sugerencias en los archivos de JavaScript. ", + "typescript.tsc.autoDetect": "Controla si la detección automática de tareas TSC está activada o desactivada." } \ No newline at end of file diff --git a/i18n/esn/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json b/i18n/esn/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json index f706005311588ab0b0a5c7fcf56a68b2c25662ca..169c17eadd6d02a15acf0a4b52e60e9a6e71c538 100644 --- a/i18n/esn/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json +++ b/i18n/esn/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json @@ -6,8 +6,7 @@ { "imgMeta": "{0} x {1} {2}", "largeImageError": "La imagen es muy grande para mostrar en el editor", - "resourceOpenExternalButton": "Abrir imagen", - "resourceOpenExternalText": "usar programa externo?", + "resourceOpenExternalButton": "¿Abrir la imagen mediante un programa externo?", "nativeBinaryError": "El archivo no se mostrará en el editor porque es binario, muy grande o usa una codificación de texto no compatible.", "sizeB": "{0} B", "sizeKB": "{0} KB", diff --git a/i18n/esn/src/vs/base/common/errorMessage.i18n.json b/i18n/esn/src/vs/base/common/errorMessage.i18n.json index ccfa6a32d0bb623939999a4426fb53db7c93d97d..88c477aba6ab32d3c35fe6d6c8b3da3b10545b08 100644 --- a/i18n/esn/src/vs/base/common/errorMessage.i18n.json +++ b/i18n/esn/src/vs/base/common/errorMessage.i18n.json @@ -13,6 +13,5 @@ "error.connection.unknown": "Error de conexión desconocido. Es posible que ya no esté conectado a Internet o que el servidor al que se había conectado esté sin conexión.", "stackTrace.format": "{0}: {1}", "error.defaultMessage": "Se ha producido un error desconocido. Consulte el registro para obtener más detalles.", - "nodeExceptionMessage": "Error del sistema ({0})", "error.moreErrors": "{0} ({1} errores en total)" } \ No newline at end of file diff --git a/i18n/esn/src/vs/base/common/keybindingLabels.i18n.json b/i18n/esn/src/vs/base/common/keybindingLabels.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a --- /dev/null +++ b/i18n/esn/src/vs/base/common/keybindingLabels.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{} \ No newline at end of file diff --git a/i18n/esn/src/vs/code/electron-main/menus.i18n.json b/i18n/esn/src/vs/code/electron-main/menus.i18n.json index 44ff7a3f5f1336e9a90c83a547b9009b34c84ff4..52fa22103d731149c7fb6bd259d4c1a68922abaf 100644 --- a/i18n/esn/src/vs/code/electron-main/menus.i18n.json +++ b/i18n/esn/src/vs/code/electron-main/menus.i18n.json @@ -55,6 +55,9 @@ "miShowEmmetCommands": "E&&mmet...", "miToggleLineComment": "&&Alternar comentario de línea", "miToggleBlockComment": "Alternar &&Bloquear comentario", + "miMultiCursorAlt": "Usar Alt+Clic para multicursor", + "miMultiCursorCmd": "Usar Cmd+Clic para multicursor", + "miMultiCursorCtrl": "Usar Ctrl+Clic para multicursor", "miInsertCursorAbove": "&&Agregar cursor arriba", "miInsertCursorBelow": "A&&gregar cursor abajo", "miInsertCursorAtEndOfEachLineSelected": "Agregar c&&ursores a extremos de línea", @@ -133,11 +136,11 @@ "miColumnBreakpoint": "Punto de interrupción de c&&olumna", "miFunctionBreakpoint": "Punto de interrupción de &&función...", "miNewBreakpoint": "&&Nuevo punto de interrupción", + "miEnableAllBreakpoints": "Habilitar todos los puntos de interrupción", "miDisableAllBreakpoints": "&&Deshabilitar todos los puntos de interrupción", "miRemoveAllBreakpoints": "Quitar &&todos los puntos de interrupción", "miInstallAdditionalDebuggers": "&&Instalar los depuradores adicionales...", "mMinimize": "Minimizar", - "mClose": "Cerrar", "mBringToFront": "Traer todo al frente", "miToggleDevTools": "&&Alternar herramientas de desarrollo", "miAccessibilityOptions": "&&Opciones de accesibilidad", @@ -153,6 +156,8 @@ "miLicense": "Ver &&licencia", "miPrivacyStatement": "&&Declaración de privacidad", "miAbout": "&&Acerca de", + "miTerminateTask": "&&Finalizar tarea", + "accessibilityOptionsWindowTitle": "Opciones de accesibilidad", "miRestartToUpdate": "Reiniciar para actualizar...", "miCheckingForUpdates": "Buscando actualizaciones...", "miDownloadUpdate": "Descargar actualización disponible", diff --git a/i18n/esn/src/vs/code/electron-main/windows.i18n.json b/i18n/esn/src/vs/code/electron-main/windows.i18n.json index fd891dfad946478827dd670edd60c263546f6e55..959ddae24463288fbc004d0fc749f6029173a9f0 100644 --- a/i18n/esn/src/vs/code/electron-main/windows.i18n.json +++ b/i18n/esn/src/vs/code/electron-main/windows.i18n.json @@ -7,16 +7,11 @@ "ok": "Aceptar", "pathNotExistTitle": "La ruta no existe", "pathNotExistDetail": "Parece que la ruta '{0}' ya no existe en el disco.", - "accessibilityOptionsWindowTitle": "Opciones de accesibilidad", "reopen": "Volver a abrir", "wait": "Siga esperando", "close": "Cerrar", "appStalled": "La ventana ha dejado de responder.", "appStalledDetail": "Puede volver a abrir la ventana, cerrarla o seguir esperando.", "appCrashed": "La ventana se bloqueó", - "appCrashedDetail": "Sentimos las molestias. Puede volver a abrir la ventana para continuar donde se detuvo.", - "newWindow": "Nueva ventana", - "newWindowDesc": "Abre una ventana nueva.", - "recentFolders": "Carpetas recientes", - "folderDesc": "{0} {1}" + "appCrashedDetail": "Sentimos las molestias. Puede volver a abrir la ventana para continuar donde se detuvo." } \ No newline at end of file diff --git a/i18n/esn/src/vs/editor/common/config/commonEditorConfig.i18n.json b/i18n/esn/src/vs/editor/common/config/commonEditorConfig.i18n.json index deeb605c6a664de33d0e931b79ee9034be50b32e..c70492563f8e4ed795d04c1f2b0c9aaeea11ba2c 100644 --- a/i18n/esn/src/vs/editor/common/config/commonEditorConfig.i18n.json +++ b/i18n/esn/src/vs/editor/common/config/commonEditorConfig.i18n.json @@ -9,6 +9,7 @@ "fontWeight": "Controla el grosor de la fuente.", "fontSize": "Controla el tamaño de fuente en píxeles.", "lineHeight": "Controla la altura de línea. Utilice 0 para calcular el valor de lineHeight a partir de fontSize.", + "letterSpacing": "Controla el espacio entre letras en pixels.", "lineNumbers": "Controla la presentación de los números de línea. Los valores posibles son \"on\", \"off\" y \"relative\". \"relative\" muestra el número de líneas desde la posición actual del cursor.", "rulers": "Columnas en las que mostrar reglas verticales", "wordSeparators": "Caracteres que se usarán como separadores de palabras al realizar operaciones o navegaciones relacionadas con palabras.", @@ -22,6 +23,8 @@ "minimap.enabled": "Controla si se muestra el minimapa", "minimap.renderCharacters": "Presentar los caracteres reales en una línea (por oposición a bloques de color)", "minimap.maxColumn": "Limitar el ancho del minimapa para presentar como mucho un número de columnas determinado", + "find.seedSearchStringFromSelection": "Controla si se inicializa la cadena de búsqueda en Buscar widget en la selección del editor", + "find.autoFindInSelection": "Controla si el indicador Buscar en selección se activa cuando se seleccionan varios caracteres o líneas de texto en el editor", "wordWrap.off": "Las líneas no se ajustarán nunca.", "wordWrap.on": "Las líneas se ajustarán en el ancho de la ventanilla.", "wordWrap.wordWrapColumn": "Las líneas se ajustarán en \"editor.wordWrapColumn\".", @@ -30,17 +33,19 @@ "wordWrapColumn": "Controls the wrapping column of the editor when `editor.wordWrap` is 'wordWrapColumn' or 'bounded'.", "wrappingIndent": "Controla el sangrado de las líneas ajustadas. Puede ser uno los valores 'none', 'same' o 'indent'.", "mouseWheelScrollSensitivity": "Se utilizará un multiplicador en los eventos de desplazamiento de la rueda del mouse `deltaX` y `deltaY`", + "multiCursorModifier.ctrlCmd": "Se asigna a \"Control\" en Windows y Linux y a \"Comando\" en OSX.", + "multiCursorModifier.alt": "Se asigna a \"Alt\" en Windows y Linux y a \"Opción\" en OSX.", + "multiCursorModifier": "El modificador que se usará para agregar varios cursores con el mouse. \"ctrlCmd\" se asigna a \"Control\" en Windows y Linux y a \"Comando\" en OSX. Los gestos del mouse Ir a la definición y Abrir vínculo se adaptarán de modo que no entren en conflicto con el modificador multicursor.", "quickSuggestions.strings": "Habilita sugerencias rápidas en las cadenas.", "quickSuggestions.comments": "Habilita sugerencias rápidas en los comentarios.", "quickSuggestions.other": "Habilita sugerencias rápidas fuera de las cadenas y los comentarios.", "quickSuggestions": "Controla si las sugerencias deben mostrarse automáticamente mientras se escribe", "quickSuggestionsDelay": "Controla el retardo en ms tras el cual aparecerán sugerencias rápidas", - "parameterHints": "Habilita sugerencias de parámetro", "autoClosingBrackets": "Controla si el editor debe cerrar automáticamente los corchetes después de abrirlos", "formatOnType": "Controla si el editor debe dar formato automáticamente a la línea después de escribirla", "formatOnPaste": "Controla si el editor debe formatear automáticamente el contenido pegado. Debe haber disponible un formateador capaz de aplicar formato a un intervalo dentro de un documento.", "suggestOnTriggerCharacters": "Controla si las sugerencias deben aparecer de forma automática al escribir caracteres desencadenadores", - "acceptSuggestionOnEnter": "Controla si las sugerencias deben aceptarse en \"Entrar\" (además de \"TAB\"). Ayuda a evitar la ambigüedad entre insertar nuevas líneas o aceptar sugerencias.", + "acceptSuggestionOnEnter": "Controla si las sugerencias deben aceptarse en \"Entrar\" (además de \"TAB\"). Ayuda a evitar la ambigüedad entre insertar nuevas líneas o aceptar sugerencias. El valor \"smart\" significa que solo se acepta una sugerencia con Entrar cuando se realiza un cambio textual.", "acceptSuggestionOnCommitCharacter": "Controla si se deben aceptar sugerencias en los caracteres de confirmación. Por ejemplo, en Javascript, el punto y coma (\";\") puede ser un carácter de confirmación que acepta una sugerencia y escribe ese carácter.", "snippetSuggestions": "Controla si se muestran los fragmentos de código con otras sugerencias y cómo se ordenan.", "emptySelectionClipboard": "Controla si al copiar sin selección se copia la línea actual.", @@ -62,12 +67,17 @@ "renderLineHighlight": "Controla cómo el editor debe presentar el resaltado de línea. Las posibilidades son \"ninguno\", \"margen\", \"línea\" y \"todo\".", "codeLens": "Controla si el editor muestra lentes de código", "folding": "Controla si el editor tiene habilitado el plegado de código.", + "showFoldingControls": "Controla cuándo los controles de plegado del margen son ocultados automáticamente.", "matchBrackets": "Resaltar corchetes coincidentes cuando se seleccione uno de ellos.", "glyphMargin": "Controla si el editor debe representar el margen de glifo vertical. El margen de glifo se usa, principalmente, para depuración.", "useTabStops": "La inserción y eliminación del espacio en blanco sigue a las tabulaciones.", "trimAutoWhitespace": "Quitar espacio en blanco final autoinsertado", "stablePeek": "Mantiene abierto el editor interactivo incluso al hacer doble clic en su contenido o presionar Escape.", "dragAndDrop": "Controla si el editor debe permitir mover selecciones mediante arrastrar y colocar.", + "accessibilitySupport.auto": "El editor usará API de plataforma para detectar cuándo está conectado un lector de pantalla.", + "accessibilitySupport.on": "El editor se optimizará de forma permanente para su uso con un editor de pantalla.", + "accessibilitySupport.off": "El editor nunca se optimizará para su uso con un lector de pantalla.", + "accessibilitySupport": "Controla si el editor se debe ejecutar en un modo optimizado para lectores de pantalla.", "sideBySide": "Controla si el editor de diferencias muestra las diferencias en paralelo o alineadas.", "ignoreTrimWhitespace": "Controla si el editor de diferencias muestra los cambios de espacio inicial o espacio final como diferencias.", "renderIndicators": "Controla si el editor de diff muestra indicadores +/- para cambios agregados/quitados", diff --git a/i18n/esn/src/vs/editor/common/config/editorOptions.i18n.json b/i18n/esn/src/vs/editor/common/config/editorOptions.i18n.json index b1da401aa984a1a3aba62b72d185df8ae7d802d2..c82ce8730064c33708f57fa7750c688923b417d5 100644 --- a/i18n/esn/src/vs/editor/common/config/editorOptions.i18n.json +++ b/i18n/esn/src/vs/editor/common/config/editorOptions.i18n.json @@ -4,5 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "accessibilityOffAriaLabel": "No se puede acceder al editor en este momento. Presione Alt+F1 para ver opciones.", "editorViewAccessibleLabel": "Contenido del editor" } \ No newline at end of file diff --git a/i18n/esn/src/vs/editor/common/view/editorColorRegistry.i18n.json b/i18n/esn/src/vs/editor/common/view/editorColorRegistry.i18n.json index fcdba2ee5ad58b83cf18730f28aebe0c7ed2a68b..e5d0cfe1b5bae5dfc97fa91449b78720e330504c 100644 --- a/i18n/esn/src/vs/editor/common/view/editorColorRegistry.i18n.json +++ b/i18n/esn/src/vs/editor/common/view/editorColorRegistry.i18n.json @@ -16,5 +16,9 @@ "editorBracketMatchBackground": "Color de fondo tras corchetes coincidentes", "editorBracketMatchBorder": "Color de bloques con corchetes coincidentes", "editorOverviewRulerBorder": "Color del borde de la regla de visión general.", - "editorGutter": "Color de fondo del margen del editor. Este espacio contiene los márgenes de glifos y los números de línea." + "editorGutter": "Color de fondo del margen del editor. Este espacio contiene los márgenes de glifos y los números de línea.", + "errorForeground": "Color de primer plano de squigglies de error en el editor.", + "errorBorder": "Color de borde de squigglies de error en el editor.", + "warningForeground": "Color de primer plano de squigglies de advertencia en el editor.", + "warningBorder": "Color de borde de squigglies de advertencia en el editor." } \ No newline at end of file diff --git a/i18n/esn/src/vs/editor/contrib/find/common/findController.i18n.json b/i18n/esn/src/vs/editor/contrib/find/common/findController.i18n.json index a16ef436a20161824abd23fe012269c63ea509f8..70c6090fd324322cd73f1e0726002dacfc8dce55 100644 --- a/i18n/esn/src/vs/editor/contrib/find/common/findController.i18n.json +++ b/i18n/esn/src/vs/editor/contrib/find/common/findController.i18n.json @@ -14,6 +14,5 @@ "addSelectionToPreviousFindMatch": "Agregar selección hasta la anterior coincidencia de búsqueda", "moveSelectionToNextFindMatch": "Mover última selección hasta la siguiente coincidencia de búsqueda", "moveSelectionToPreviousFindMatch": "Mover última selección hasta la anterior coincidencia de búsqueda", - "selectAllOccurencesOfFindMatch": "Seleccionar todas las repeticiones de coincidencia de búsqueda", "changeAll.label": "Cambiar todas las ocurrencias" } \ No newline at end of file diff --git a/i18n/esn/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.i18n.json b/i18n/esn/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..d9243b761356e4bde67f679c3539bcea7989412a --- /dev/null +++ b/i18n/esn/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.i18n.json @@ -0,0 +1,23 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "noResultWord": "No se encontró ninguna definición para \"{0}\"", + "generic.noResults": "No se encontró ninguna definición", + "meta.title": " – {0} definiciones", + "actions.goToDecl.label": "Ir a definición", + "actions.goToDeclToSide.label": "Abrir definición en el lateral", + "actions.previewDecl.label": "Ver la definición", + "goToImplementation.noResultWord": "No se encontró ninguna implementación para \"{0}\"", + "goToImplementation.generic.noResults": "No se encontró ninguna implementación", + "meta.implementations.title": "{0} implementaciones", + "actions.goToImplementation.label": "Ir a implementación", + "actions.peekImplementation.label": "Inspeccionar implementación", + "goToTypeDefinition.noResultWord": "No se encontró ninguna definición de tipo para \"{0}\"", + "goToTypeDefinition.generic.noResults": "No se encontró ninguna definición de tipo", + "meta.typeDefinitions.title": " – {0} definiciones de tipo", + "actions.goToTypeDefinition.label": "Ir a la definición de tipo", + "actions.peekTypeDefinition.label": "Inspeccionar definición de tipo" +} \ No newline at end of file diff --git a/i18n/esn/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.i18n.json b/i18n/esn/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..d35f93e7fae0b1cbe655c09356aece5b2da2e48a --- /dev/null +++ b/i18n/esn/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "multipleResults": "Haga clic para mostrar {0} definiciones." +} \ No newline at end of file diff --git a/i18n/esn/src/vs/editor/contrib/links/browser/links.i18n.json b/i18n/esn/src/vs/editor/contrib/links/browser/links.i18n.json index 9446261fac5d81ae186088236dca24e6047d2321..7b9ee53d86a2cd0169c6e1186e25e138f222b8a8 100644 --- a/i18n/esn/src/vs/editor/contrib/links/browser/links.i18n.json +++ b/i18n/esn/src/vs/editor/contrib/links/browser/links.i18n.json @@ -6,6 +6,7 @@ { "links.navigate.mac": "Cmd + clic para abrir el vínculo", "links.navigate": "Ctrl + clic para abrir el vínculo", + "links.navigate.al": "Alt + clic para seguir el vínculo", "invalid.url": "No se pudo abrir este vínculo porque no tiene un formato correcto: {0}", "missing.url": "No se pudo abrir este vínculo porque falta el destino.", "label": "Abrir vínculo" diff --git a/i18n/esn/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json b/i18n/esn/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json index 515c40c0c1d5e909ecb944cb161ca1267d895a31..2d8140e32a7002d5b91ac9eea2bbef5923f1bc23 100644 --- a/i18n/esn/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json +++ b/i18n/esn/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json @@ -5,8 +5,6 @@ // Do not edit this file. It is machine generated. { "aria.oneReference": "símbolo en {0} linea {1} en la columna {2}", - "aria.fileReferences.1": "1 símbolo en {0}", - "aria.fileReferences.N": "{0} símbolos en {1}", "aria.result.0": "No se encontraron resultados", "aria.result.1": "Encontró 1 símbolo en {0}", "aria.result.n1": "Encontró {0} símbolos en {1}", diff --git a/i18n/esn/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json b/i18n/esn/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json index f9d2c2d5f0993b0adcdd58565c6472c667211add..bf3d8015426a108b7627d75f73a60eddcfff23c1 100644 --- a/i18n/esn/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json +++ b/i18n/esn/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json @@ -12,6 +12,7 @@ "readMore": "Leer más...{0}", "suggestionWithDetailsAriaLabel": "{0}, sugerencia, con detalles", "suggestionAriaLabel": "{0}, sugerencia", + "readLess": "Leer menos...{0}", "suggestWidget.loading": "Cargando...", "suggestWidget.noSuggestions": "No hay sugerencias.", "suggestionAriaAccepted": "{0}, aceptada", diff --git a/i18n/esn/src/vs/editor/node/languageConfigurationExtensionPoint.i18n.json b/i18n/esn/src/vs/editor/node/languageConfigurationExtensionPoint.i18n.json index df256b0ca88ad6cb9727f1ba52374a44052b9149..43ec87cbde1f652d5c17b78cba41c327bdb1486e 100644 --- a/i18n/esn/src/vs/editor/node/languageConfigurationExtensionPoint.i18n.json +++ b/i18n/esn/src/vs/editor/node/languageConfigurationExtensionPoint.i18n.json @@ -15,5 +15,9 @@ "schema.brackets": "Define los corchetes que aumentan o reducen la sangría.", "schema.autoClosingPairs": "Define el par de corchetes. Cuando se escribe un corchete de apertura, se inserta automáticamente el corchete de cierre.", "schema.autoClosingPairs.notIn": "Define una lista de ámbitos donde los pares automáticos están deshabilitados.", - "schema.surroundingPairs": "Define los pares de corchetes que se pueden usar para encerrar una cadena seleccionada." + "schema.surroundingPairs": "Define los pares de corchetes que se pueden usar para encerrar una cadena seleccionada.", + "schema.wordPattern": " La definición de la palabra en el idioma.", + "schema.wordPattern.pattern": "El patrón de expresión regular utilizado para localizar palabras.", + "schema.wordPattern.flags": "Los flags de expresión regular utilizados para localizar palabras.", + "schema.wordPattern.flags.errorMessage": "Debe coincidir con el patrón `/^([gimuy]+)$/`." } \ No newline at end of file diff --git a/i18n/esn/src/vs/platform/actions/electron-browser/menusExtensionPoint.i18n.json b/i18n/esn/src/vs/platform/actions/electron-browser/menusExtensionPoint.i18n.json index 963cc3dbe3d5a6aa3c1f79e5de67eec91f2d3bc2..253f50641c33f4c4817f4bf0bc75bc293c961fc0 100644 --- a/i18n/esn/src/vs/platform/actions/electron-browser/menusExtensionPoint.i18n.json +++ b/i18n/esn/src/vs/platform/actions/electron-browser/menusExtensionPoint.i18n.json @@ -14,13 +14,15 @@ "vscode.extension.contributes.menus": "Contribuye con elementos de menú al editor", "menus.commandPalette": "La paleta de comandos", "menus.editorTitle": "El menú de título del editor", - "menus.editorContext": "El menú conextual del editor", + "menus.editorContext": "El menú contextual del editor", "menus.explorerContext": "El menú contextual del explorador de archivos", - "menus.editorTabContext": "Menú contextual de pestañas del editor", + "menus.editorTabContext": "El menú contextual de pestañas del editor", "menus.debugCallstackContext": "El menú contextual de la pila de llamadas de depuración", "menus.scmTitle": "El menú del título Control de código fuente", "menus.resourceGroupContext": "El menú contextual del grupo de recursos de Control de código fuente", "menus.resourceStateContext": "El menú contextual de estado de recursos de Control de código fuente", + "view.viewTitle": "El menú de título de vista contribuida", + "view.itemContext": "El menú contextual del elemento de vista contribuida", "nonempty": "se esperaba un valor no vacío.", "opticon": "la propiedad `icon` se puede omitir o debe ser una cadena o un literal como `{dark, light}`", "requireStringOrObject": "La propiedad \"{0}\" es obligatoria y debe ser de tipo \"string\" u \"object\"", diff --git a/i18n/esn/src/vs/platform/extensions/common/extensionsRegistry.i18n.json b/i18n/esn/src/vs/platform/extensions/common/extensionsRegistry.i18n.json index 09295c5362ba4bc9cd8256b8acd1b2e9f33062ec..b7b9d3c4f35f047e4f2b4c1e8328a2aef6255e1a 100644 --- a/i18n/esn/src/vs/platform/extensions/common/extensionsRegistry.i18n.json +++ b/i18n/esn/src/vs/platform/extensions/common/extensionsRegistry.i18n.json @@ -14,6 +14,12 @@ "vscode.extension.contributes": "Todas las contribuciones de la extensión VS Code representadas por este paquete.", "vscode.extension.preview": "Establece la extensión que debe marcarse como versión preliminar en Marketplace.", "vscode.extension.activationEvents": "Eventos de activación de la extensión VS Code.", + "vscode.extension.activationEvents.onLanguage": "Un evento de activación emitido cada vez que se abre un archivo que se resuelve en el idioma especificado.", + "vscode.extension.activationEvents.onCommand": "Un evento de activación emitido cada vez que se invoca el comando especificado.", + "vscode.extension.activationEvents.onDebug": "Un evento de activación emitido cada vez que se inicia una sesión de depuración del tipo especificado.", + "vscode.extension.activationEvents.workspaceContains": "Un evento de activación emitido cada vez que se abre una carpeta que contiene al menos un archivo que coincide con el patrón global especificado.", + "vscode.extension.activationEvents.onView": "Un evento de activación emitido cada vez que se expande la vista especificada.", + "vscode.extension.activationEvents.star": "Un evento de activación emitido al inicio de VS Code. Para garantizar una buena experiencia para el usuario final, use este evento de activación en su extensión solo cuando no le sirva ninguna otra combinación de eventos de activación en su caso.", "vscode.extension.badges": "Matriz de distintivos que se muestran en la barra lateral de la página de extensiones de Marketplace.", "vscode.extension.badges.url": "URL de la imagen del distintivo.", "vscode.extension.badges.href": "Vínculo del distintivo.", diff --git a/i18n/esn/src/vs/platform/history/electron-main/historyMainService.i18n.json b/i18n/esn/src/vs/platform/history/electron-main/historyMainService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..ef4f14a4e296352b80d4c079d3f148a420c013ac --- /dev/null +++ b/i18n/esn/src/vs/platform/history/electron-main/historyMainService.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "newWindow": "Nueva ventana", + "newWindowDesc": "Abre una ventana nueva.", + "recentFolders": "Carpetas recientes", + "folderDesc": "{0} {1}" +} \ No newline at end of file diff --git a/i18n/esn/src/vs/platform/markers/common/problemMatcher.i18n.json b/i18n/esn/src/vs/platform/markers/common/problemMatcher.i18n.json index 967ffc7598360b2d52af09fda4797f802bc93e89..1c9dfefb5cb7066ea6f1a141375fd7bf1de8a763 100644 --- a/i18n/esn/src/vs/platform/markers/common/problemMatcher.i18n.json +++ b/i18n/esn/src/vs/platform/markers/common/problemMatcher.i18n.json @@ -34,6 +34,7 @@ "ProblemMatcherParser.noValidIdentifier": "Error: La propiedad pattern {0} no es un nombre de variable de patrón válido.", "ProblemMatcherParser.problemPattern.watchingMatcher": "Un buscador de coincidencias de problemas debe definir tanto un patrón de inicio como un patrón de finalización para la inspección.", "ProblemMatcherParser.invalidRegexp": "Error: La cadena {0} no es una expresión regular válida.\n", + "WatchingPatternSchema.regexp": "Expresión regular para detectar el principio o el final de una tarea en segundo plano.", "WatchingPatternSchema.file": "Índice de grupo de coincidencias del nombre de archivo. Se puede omitir.", "PatternTypeSchema.name": "Nombre de un patrón aportado o predefinido", "PatternTypeSchema.description": "Patrón de problema o nombre de un patrón de problema que se ha aportado o predefinido. Se puede omitir si se especifica la base.", @@ -42,6 +43,12 @@ "ProblemMatcherSchema.severity": "Gravedad predeterminada para los problemas de capturas. Se usa si el patrón no define un grupo de coincidencias para \"severity\".", "ProblemMatcherSchema.applyTo": "Controla si un problema notificado en un documento de texto se aplica solamente a los documentos abiertos, cerrados o a todos los documentos.", "ProblemMatcherSchema.fileLocation": "Define cómo deben interpretarse los nombres de archivo notificados en un patrón de problema.", + "ProblemMatcherSchema.background": "Patrones para hacer seguimiento del comienzo y el final en un comprobador activo de la tarea en segundo plano.", + "ProblemMatcherSchema.background.activeOnStart": "Si se establece en True, el monitor está en modo activo cuando la tarea empieza. Esto es equivalente a emitir una línea que coincide con beginPattern", + "ProblemMatcherSchema.background.beginsPattern": "Si se encuentran coincidencias en la salida, se señala el inicio de una tarea en segundo plano.", + "ProblemMatcherSchema.background.endsPattern": "Si se encuentran coincidencias en la salida, se señala el fin de una tarea en segundo plano.", + "ProblemMatcherSchema.watching.deprecated": "Esta propiedad está en desuso. Use la propiedad en segundo plano.", + "ProblemMatcherSchema.watching": "Patrones para hacer un seguimiento del comienzo y el final de un patrón de supervisión.", "ProblemMatcherSchema.watching.activeOnStart": "Si se establece en true, el monitor está en modo activo cuando la tarea empieza. Esto es equivalente a emitir una línea que coincide con beginPattern", "ProblemMatcherSchema.watching.beginsPattern": "Si se encuentran coincidencias en la salida, se señala el inicio de una tarea de inspección.", "ProblemMatcherSchema.watching.endsPattern": "Si se encuentran coincidencias en la salida, se señala el fin de una tarea de inspección", diff --git a/i18n/esn/src/vs/platform/theme/common/colorRegistry.i18n.json b/i18n/esn/src/vs/platform/theme/common/colorRegistry.i18n.json index 85f87911be1bdddca55c9f6c8414eab6c261d30b..91c6d95a0e2778832cb9d95a17ddb9f1d94ea269 100644 --- a/i18n/esn/src/vs/platform/theme/common/colorRegistry.i18n.json +++ b/i18n/esn/src/vs/platform/theme/common/colorRegistry.i18n.json @@ -12,7 +12,6 @@ "focusBorder": "Color de borde de los elementos con foco. Este color solo se usa si un componente no lo invalida.", "contrastBorder": "Un borde adicional alrededor de los elementos para separarlos unos de otros y así mejorar el contraste.", "activeContrastBorder": "Un borde adicional alrededor de los elementos activos para separarlos unos de otros y así mejorar el contraste.", - "selectionBackground": "El color de fondo del texto seleccionado en la área de trabajo (por ejemplo, campos de entrada o áreas de texto). Esto no se aplica a las selecciones dentro del editor o el terminal.", "textSeparatorForeground": "Color para los separadores de texto.", "textLinkForeground": "Color de primer plano para los vínculos en el texto.", "textLinkActiveForeground": "Color de primer plano para los vínculos activos en el texto.", @@ -36,11 +35,13 @@ "dropdownForeground": "Primer plano de lista desplegable.", "dropdownBorder": "Borde de lista desplegable.", "listFocusBackground": "Color de fondo de la lista o el árbol del elemento con el foco cuando la lista o el árbol están activos. Una lista o un árbol tienen el foco del teclado cuando están activos, cuando están inactivos no.", + "listFocusForeground": "Color de fondo de la lista o el árbol del elemento con el foco cuando la lista o el árbol están activos. Una lista o un árbol tienen el foco del teclado cuando están activos, cuando están inactivos no.", "listActiveSelectionBackground": "Color de fondo de la lista o el árbol del elemento seleccionado cuando la lista o el árbol están activos. Una lista o un árbol tienen el foco del teclado cuando están activos, cuando están inactivos no.", "listActiveSelectionForeground": "Color de primer plano de la lista o el árbol del elemento con el foco cuando la lista o el árbol están activos. Una lista o un árbol tienen el foco del teclado cuando están activos, cuando están inactivos no.", "listInactiveSelectionBackground": "Color de fondo de la lista o el árbol del elemento seleccionado cuando la lista o el árbol están inactivos. Una lista o un árbol tienen el foco del teclado cuando están activos, cuando están inactivos no.", "listInactiveSelectionForeground": "Color de primer plano de la lista o el árbol del elemento con el foco cuando la lista o el árbol esta inactiva. Una lista o un árbol tiene el foco del teclado cuando está activo, cuando esta inactiva no.", "listHoverBackground": "Fondo de la lista o el árbol al mantener el mouse sobre los elementos.", + "listHoverForeground": "Color de primer plano de la lista o el árbol al pasar por encima de los elementos con el ratón.", "listDropBackground": "Fondo de arrastrar y colocar la lista o el árbol al mover los elementos con el mouse.", "highlight": "Color de primer plano de la lista o el árbol de las coincidencias resaltadas al buscar dentro de la lista o el ábol.", "pickerGroupForeground": "Selector de color rápido para la agrupación de etiquetas.", @@ -58,6 +59,7 @@ "editorBackground": "Color de fondo del editor.", "editorForeground": "Color de primer plano predeterminado del editor.", "editorWidgetBackground": "Color de fondo del editor de widgets como buscar/reemplazar", + "editorWidgetBorder": "Color de borde de los widgets del editor. El color solo se usa si el widget elige tener un borde y no invalida el color.", "editorSelection": "Color de la selección del editor.", "editorInactiveSelection": "Color de la selección en un editor inactivo.", "editorSelectionHighlight": "Color de las regiones con el mismo contenido que la selección.", @@ -71,5 +73,12 @@ "diffEditorInserted": "Color de fondo para el texto insertado.", "diffEditorRemoved": "Color de fondo para el texto quitado.", "diffEditorInsertedOutline": "Color de contorno para el texto insertado.", - "diffEditorRemovedOutline": "Color de contorno para el texto quitado." + "diffEditorRemovedOutline": "Color de contorno para el texto quitado.", + "mergeCurrentHeaderBackground": "Fondo del encabezado actual en conflictos de combinación alineados.", + "mergeCurrentContentBackground": "Fondo del contenido actual en conflictos de combinación alineados.", + "mergeIncomingHeaderBackground": "Fondo del encabezado de entrada en conflictos de combinación alineados.", + "mergeIncomingContentBackground": "Fondo del contenido de entrada en conflcitos de combinación alineados.", + "mergeBorder": "Color del borde en los encabezados y el divisor en conflictos de combinación alineados.", + "overviewRulerCurrentContentForeground": "Primer plano de la regla de visión general actual para conflictos de combinación alineados.", + "overviewRulerIncomingContentForeground": "Primer plano de regla de visión general de entrada para conflictos de combinación alineados." } \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/api/node/extHostTask.i18n.json b/i18n/esn/src/vs/workbench/api/node/extHostTask.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..4b90a12aaf247b4a1af0e887542958471d8df5e5 --- /dev/null +++ b/i18n/esn/src/vs/workbench/api/node/extHostTask.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "task.label": "{0}: {1}" +} \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/api/node/extHostTreeViews.i18n.json b/i18n/esn/src/vs/workbench/api/node/extHostTreeViews.i18n.json index 8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a..1127a4ec4f832993371655e52fc17e5b4cc59dff 100644 --- a/i18n/esn/src/vs/workbench/api/node/extHostTreeViews.i18n.json +++ b/i18n/esn/src/vs/workbench/api/node/extHostTreeViews.i18n.json @@ -3,4 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. -{} \ No newline at end of file +{ + "treeView.notRegistered": "No se ha registrado ninga vista del árbol con id '{0}'.", + "treeItem.notFound": "No se encontró ningún item del árbol con id '{0}'.", + "treeView.duplicateElement": "El elemento '{0}' ya está registrado" +} \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/browser/parts/activitybar/activitybarPart.i18n.json b/i18n/esn/src/vs/workbench/browser/parts/activitybar/activitybarPart.i18n.json index 86c8b000ea6eae786385b15ab54ce1d7a548302a..bfe695f895bcad9c1d5720b4977f6553bd4ed620 100644 --- a/i18n/esn/src/vs/workbench/browser/parts/activitybar/activitybarPart.i18n.json +++ b/i18n/esn/src/vs/workbench/browser/parts/activitybar/activitybarPart.i18n.json @@ -5,5 +5,6 @@ // Do not edit this file. It is machine generated. { "hideActivitBar": "Ocultar barra de actividades", - "activityBarAriaLabel": "Modificador de vista activa" + "activityBarAriaLabel": "Modificador de vista activa", + "globalActions": "Acciones globales" } \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/browser/parts/editor/editorStatus.i18n.json b/i18n/esn/src/vs/workbench/browser/parts/editor/editorStatus.i18n.json index 399678bda1960d38be10f981a4e1c5c46c7890b6..57f49827a55ffb7392ee0a8a9e6f69e746722f76 100644 --- a/i18n/esn/src/vs/workbench/browser/parts/editor/editorStatus.i18n.json +++ b/i18n/esn/src/vs/workbench/browser/parts/editor/editorStatus.i18n.json @@ -10,7 +10,7 @@ "multiSelection": "{0} selecciones", "endOfLineLineFeed": "LF", "endOfLineCarriageReturnLineFeed": "CRLF", - "tabFocusModeEnabled": "La tabulación mueve el foco", + "screenReaderDetectedExtra": "Si no va a usar un lector de pantalla, cambie el valor de configuración \"editor.accessibilitySupport\" a \"desactivado\".", "disableTabMode": "Deshabilitar modo de accesibilidad", "gotoLine": "Ir a la línea", "indentation": "Sangría", diff --git a/i18n/esn/src/vs/workbench/browser/parts/quickopen/quickopen.i18n.json b/i18n/esn/src/vs/workbench/browser/parts/quickopen/quickopen.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..7a95e7a0c694e7a842bc7d0d0bd77ae4e19aed36 --- /dev/null +++ b/i18n/esn/src/vs/workbench/browser/parts/quickopen/quickopen.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "quickOpen": "Ir al archivo...", + "quickNavigateNext": "Navegar a siguiente en Quick Open", + "quickNavigatePrevious": "Navegar a anterior en Quick Open", + "quickSelectNext": "Seleccionar Siguiente en Quick Open", + "quickSelectPrevious": "Seleccionar Anterior en Quick Open" +} \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/browser/quickopen.i18n.json b/i18n/esn/src/vs/workbench/browser/quickopen.i18n.json index bc196c6f3577f81c8122ede439ed1e1ece7d7bff..6677960aba0d790b91dbeb5491c3c5ecc6282979 100644 --- a/i18n/esn/src/vs/workbench/browser/quickopen.i18n.json +++ b/i18n/esn/src/vs/workbench/browser/quickopen.i18n.json @@ -6,6 +6,5 @@ { "noResultsMatching": "No hay resultados coincidentes", "noResultsFound2": "No se encontraron resultados", - "entryAriaLabel": "{0}, comando", - "noCommands": "No hay comandos coincidentes" + "entryAriaLabel": "{0}, comando" } \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/browser/viewlet.i18n.json b/i18n/esn/src/vs/workbench/browser/viewlet.i18n.json index 26b81eaef9214871d229d1ddd5e99cf636762678..ff2c96161787bf5fd5826590a5339a361233335b 100644 --- a/i18n/esn/src/vs/workbench/browser/viewlet.i18n.json +++ b/i18n/esn/src/vs/workbench/browser/viewlet.i18n.json @@ -4,6 +4,5 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "collapse": "Contraer todo", - "viewToolbarAriaLabel": "{0} acciones" + "collapse": "Contraer todo" } \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/common/theme.i18n.json b/i18n/esn/src/vs/workbench/common/theme.i18n.json index 97f9736e665720a7d179afd11c658e6b2654df72..5128dcdbbc0ef0ffe2abe5db8c2be2b253fbfe82 100644 --- a/i18n/esn/src/vs/workbench/common/theme.i18n.json +++ b/i18n/esn/src/vs/workbench/common/theme.i18n.json @@ -7,10 +7,13 @@ "tabActiveBackground": "Color de fondo de la pestaña activa. Las pestañas son los contenedores de los editores en el área de editores. Se pueden abrir varias pestañas en un grupo de editores. Puede haber varios grupos de editores.", "tabInactiveBackground": "Color de fondo de la pestaña inactiva. Las pestañas son los contenedores de los editores en el área de editores. Se pueden abrir varias pestañas en un grupo de editores. Puede haber varios grupos de editores.", "tabBorder": "Borde para separar las pestañas entre sí. Las pestañas son contenedores de editores en el área de editores. Se pueden abrir varias pestañas en un grupo de editores. Puede haber varios grupos de editores.", - "tabActiveEditorGroupActiveForeground": "Color de primer plano de la pestaña activa en un grupo activo. Las pestañas son los contenedores de los editores en el área de editores. Se pueden abrir varias pestañas en un grupo de editores. Puede haber varios grupos de editores.", - "tabInactiveEditorGroupActiveForeground": "Color de primer plano de la pestaña inactiva en un grupo activo. Las pestañas son los contenedores de los editores en el área de editores. Se pueden abrir varias pestañas en un grupo de editores. Puede haber varios grupos de editores.", + "tabActiveForeground": "Color de primer plano de la pestaña activa en un grupo activo. Las pestañas son los contenedores de los editores en el área de editores. Se pueden abrir varias pestañas en un grupo de editores. Puede haber varios grupos de editores.", + "tabInactiveForeground": "Color de primer plano de la pestaña inactiva en un grupo activo. Las pestañas son los contenedores de los editores en el área de editores. Se pueden abrir varias pestañas en un grupo de editores. Puede haber varios grupos de editores.", + "tabUnfocusedActiveForeground": "Color de primer plano de la pestaña activa en un grupo inactivo. Las pestañas son los contenedores de los editores en el área de editores. Se pueden abrir varias pestañas en un grupo de editores. Puede haber varios grupos de editores.", + "tabUnfocusedInactiveForeground": "Color de primer plano de la pestaña inactiva en un grupo inactivo. Las pestañas son los contenedores de los editores en el área de editores. Se pueden abrir varias pestañas en un grupo de editores. Puede haber varios grupos de editores.", "editorGroupBackground": "Color de fondo de un grupo de editores. Los grupos de editores son los contenedores de los editores. El color de fondo se ve cuando se mueven arrastrando los grupos de editores.", "tabsContainerBackground": "Color de fondo del encabezado del título del grupo de editores cuando las fichas están habilitadas. Los grupos de editores son contenedores de editores.", + "tabsContainerBorder": "Color de borde del encabezado del título del grupo de editores cuando las fichas están habilitadas. Los grupos de editores son contenedores de editores.", "editorGroupHeaderBackground": "Color de fondo del encabezado del título del grupo de editores cuando las fichas están deshabilitadas. Los grupos de editores son contenedores de editores.", "editorGroupBorder": "Color para separar varios grupos de editores entre sí. Los grupos de editores son los contenedores de los editores.", "editorDragAndDropBackground": "Color de fondo cuando se arrastran los editores. El color debería tener transparencia para que el contenido del editor pueda brillar a su través.", @@ -21,19 +24,25 @@ "panelActiveTitleBorder": "Color de borde del título del panel activo. Los paneles se muestran debajo del área del editor y contienen vistas como Salida y Terminal integrado.", "statusBarForeground": "Color de primer plano de la barra de estado, que se muestra en la parte inferior de la ventana.", "statusBarBackground": "Color de fondo de la barra de estado estándar, que se muestra en la parte inferior de la ventana.", + "statusBarBorder": "Color de borde de la barra de estado que separa la barra lateral y el editor. La barra de estado se muestra en la parte inferior de la ventana.", "statusBarNoFolderBackground": "Color de fondo de la barra de estado cuando no hay ninguna carpeta abierta. La barra de estado se muestra en la parte inferior de la ventana.", + "statusBarNoFolderForeground": "Color de primer plano de la barra de estado cuando no hay ninguna carpeta abierta. La barra de estado se muestra en la parte inferior de la ventana.", "statusBarItemActiveBackground": "Color de fondo de un elemento de la barra de estado al hacer clic. La barra de estado se muestra en la parte inferior de la ventana.", "statusBarItemHoverBackground": "Color de fondo de un elemento de la barra de estado al mantener el puntero. La barra de estado se muestra en la parte inferior de la ventana.", "statusBarProminentItemBackground": "Color de fondo de los elementos destacados en la barra de estado. Estos elementos sobresalen para indicar importancia. La barra de estado está ubicada en la parte inferior de la ventana.", "statusBarProminentItemHoverBackground": "Color de fondo de los elementos destacados en la barra de estado cuando se mantiene el mouse sobre estos elementos. Estos elementos sobresalen para indicar importancia. La barra de estado está ubicada en la parte inferior de la ventana.", "activityBarBackground": "Color de fondo de la barra de actividad, que se muestra en el lado izquierdo o derecho y que permite cambiar entre diferentes vistas de la barra lateral.", "activityBarForeground": "Color de fondo de la barra de actividad (por ejemplo utilizado por los iconos). La barra de actividad muestra en el lado izquierdo o derecho y permite cambiar entre diferentes vistas de la barra lateral.", + "activityBarBorder": "Color de borde de la barra de actividad que separa la barra lateral. La barra de actividad se muestra en el extremo derecho o izquierdo y permite cambiar entre las vistas de la barra lateral.", "activityBarDragAndDropBackground": "Arrastre y suelte el color de las sugerencias para los elementos de la barra de actividad. El color debería tener transparencias, de forma que los elementos de la barra continúen siendo visibles a través de él. La barra de actividad se muestra en el extremo izquierdo o derecho y permite cambiar entre distintas vistas de la barra lateral.", "activityBarBadgeBackground": "Color de fondo de distintivo de notificación de actividad. La barra de actividad se muestra en el extremo izquierdo o derecho y permite cambiar entre vistas de la barra lateral.", "activityBarBadgeForeground": "Color de primer plano de distintivo de notificación de actividad. La barra de actividad se muestra en el extremo izquierdo o derecho y permite cambiar entre vistas de la barra lateral.", "sideBarBackground": "Color de fondo de la barra lateral, que es el contenedor de vistas como Explorador y Búsqueda.", + "sideBarForeground": "Color de primer plano de la barra lateral, que es el contenedor de vistas como Explorador y Búsqueda.", + "sideBarBorder": "Color de borde de la barra lateral en el lado que separa el editor. La barra lateral es el contenedor de vistas como Explorador y Búsqueda.", "sideBarTitleForeground": "Color de primer plano del título de la barra lateral, que es el contenedor de vistas como Explorador y Búsqueda.", "sideBarSectionHeaderBackground": "Color de fondo del encabezado de sección de la barra lateral, que es el contenedor de vistas como Explorador y Búsqueda.", + "sideBarSectionHeaderForeground": "Color de primer plano del encabezado de sección de la barra lateral, que es el contenedor de vistas como Explorador y Búsqueda.", "titleBarActiveForeground": "Color de primer plano de la barra de título cuando la ventana está activa. Tenga en cuenta que, actualmente, este clor solo se admite en macOS.", "titleBarInactiveForeground": "Color de primer plano de la barra de título cuando la ventana está inactiva. Tenga en cuenta que, actualmente, este color solo se admite en macOS.", "titleBarActiveBackground": "Fondo de la barra de título cuando la ventana está activa. Tenga en cuenta que, actualmente, este color solo se admite en macOS.", diff --git a/i18n/esn/src/vs/workbench/electron-browser/actions.i18n.json b/i18n/esn/src/vs/workbench/electron-browser/actions.i18n.json index cf43b7ec441f94c5317aaac68f487b5f502eff72..2956c1f4a475b96f65ca6aedbd21f2c789336c04 100644 --- a/i18n/esn/src/vs/workbench/electron-browser/actions.i18n.json +++ b/i18n/esn/src/vs/workbench/electron-browser/actions.i18n.json @@ -6,9 +6,6 @@ { "closeActiveEditor": "Cerrar editor", "closeWindow": "Cerrar ventana", - "switchWindow": "Cambiar de ventana", - "switchWindowPlaceHolder": "Seleccionar una ventana", - "current": "Ventana actual", "closeFolder": "Cerrar carpeta", "noFolderOpened": "No hay ninguna carpeta abierta en esta instancia para cerrar.", "newWindow": "Nueva ventana", @@ -20,7 +17,7 @@ "zoomReset": "Restablecer zoom", "appPerf": "Rendimiento de inicio", "reloadWindow": "Recargar ventana", - "openRecent": "Abrir recientes", + "current": "Ventana actual", "folders": "carpetas", "files": "archivos", "openRecentPlaceHolderMac": "Seleccione una ruta de acceso (mantenga presionada la tecla Cmd para abrirla en una nueva ventana)", @@ -32,10 +29,6 @@ "openDocumentationUrl": "Documentación", "openIntroductoryVideosUrl": "Vídeos de introducción", "toggleSharedProcess": "Alternar proceso compartido", - "navigateLeft": "Mover a la vista de la izquierda", - "navigateRight": "Mover a la vista de la derecha", - "navigateUp": "Mover a la vista superior", - "navigateDown": "Mover a la vista inferior", "increaseViewSize": "Aumentar tamaño de vista actual", "decreaseViewSize": "Reducir tamaño de vista actual" } \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/electron-browser/main.contribution.i18n.json b/i18n/esn/src/vs/workbench/electron-browser/main.contribution.i18n.json index cbf9d0deef3dc5e1d18a6793e488935620f51f71..701489feabd57803e11a5ef909e3607a554e19c7 100644 --- a/i18n/esn/src/vs/workbench/electron-browser/main.contribution.i18n.json +++ b/i18n/esn/src/vs/workbench/electron-browser/main.contribution.i18n.json @@ -7,6 +7,7 @@ "view": "Ver", "help": "Ayuda", "file": "Archivo", + "developer": "Desarrollador", "showEditorTabs": "Controla si los editores abiertos se deben mostrar o no en pestañas.", "editorTabCloseButton": "Controla la posición de los botones de cierre de pestañas del editor o los deshabilita si se establece en \"off\".", "showIcons": "Controla si los editores abiertos deben mostrarse o no con un icono. Requiere que también se habilite un tema de icono.", @@ -30,10 +31,6 @@ "window.openFoldersInNewWindow.off": "Las carpetas reemplazarán la ventana activa más reciente", "window.openFoldersInNewWindow.default": "Las carpetas se abrirán en una nueva ventana a menos que se seleccione una carpeta desde la aplicación (p. ej. mediante el menú Archivo)", "openFoldersInNewWindow": "Controla si las carpetas deben abrirse en una ventana nueva o reemplazar la última ventana activa.\n- default: las carpetas se abrirán en una ventana nueva, a menos que se seleccione una carpeta desde la aplicación (por ejemplo, desde el menú Archivo)\n- on: las carpetas se abrirán en una ventana nueva\n- off: las carpetas reemplazarán la última ventana activa\nTenga en cuenta que aún puede haber casos en los que este parámetro se ignore (por ejemplo, al usar la opción de la línea de comandos -new-window o -reuse-window).", - "window.reopenFolders.none": "No volver a abrir nunca una carpeta.", - "window.reopenFolders.one": "Volver a abrir la carpeta activa más reciente.", - "window.reopenFolders.all": "Volver a abrir todas las carpetas de la sesión más reciente.", - "reopenFolders": "Controla cómo se vuelven a abrir las carpetas tras un reinicio. Seleccione \"none\" para no volver a abrir jamás una carpeta, \"one\" para volver a abrir la última carpeta en la que trabajó o seleccione \"all\" para volver a abrir todas las carpetas de la última sesión.", "restoreFullscreen": "Controla si una ventana se debe restaurar al modo de pantalla completa si se salió de ella en dicho modo.", "zoomLevel": "Ajuste el nivel de zoom de la ventana. El tamaño original es 0 y cada incremento (por ejemplo, 1) o disminución (por ejemplo, -1) representa una aplicación de zoom un 20 % más grande o más pequeño. También puede especificar decimales para ajustar el nivel de zoom con una granularidad más precisa.", "title": "Controla el título de la ventana según el editor activo. Las variables se sustituyen según el contexto: ${activeEditorShort}: por ejemplo, myFile.txt ${activeEditorMedium}: por ejemplo, myFolder/myFile.txt ${activeEditorLong}: por ejemplo, /Users/Development/myProject/myFolder/myFile.txt ${rootName}: por ejemplo, myProject ${rootPath}: por ejemplo, /Users/Development/myProject ${appName}: por ejemplo, VS Code ${dirty}: un indicador con modificaciones si el editor activo está desfasado ${separator}: un separador condicional (\" - \") que solo se muestra cuando está rodeado por variables con valores", @@ -57,5 +54,7 @@ "zenMode.hideTabs": "Controla si la activación del modo zen también oculta las pestañas del área de trabajo.", "zenMode.hideStatusBar": "Controla si la activación del modo zen oculta también la barra de estado en la parte inferior del área de trabajo.", "zenMode.hideActivityBar": "Controla si la activación del modo zen oculta también la barra de estado en la parte izquierda del área de trabajo.", - "zenMode.restore": "Controla si una ventana debe restaurarse a modo zen si se cerró en modo zen." + "zenMode.restore": "Controla si una ventana debe restaurarse a modo zen si se cerró en modo zen.", + "workspaceConfigurationTitle": "Área de trabajo", + "files.exclude.boolean": "El patrón global con el que se harán coincidir las rutas de acceso de los archivos. Establézcalo en true o false para habilitarlo o deshabilitarlo." } \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/electron-browser/workbench.i18n.json b/i18n/esn/src/vs/workbench/electron-browser/workbench.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..24a3d974637a1638b06d6a1a13dc533afc1d65e6 --- /dev/null +++ b/i18n/esn/src/vs/workbench/electron-browser/workbench.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "developer": "Desarrollador", + "file": "Archivo" +} \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/codeEditor/electron-browser/accessibility.i18n.json b/i18n/esn/src/vs/workbench/parts/codeEditor/electron-browser/accessibility.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..58480e0cd81d8a8dfaeddd882719ba5c06915f27 --- /dev/null +++ b/i18n/esn/src/vs/workbench/parts/codeEditor/electron-browser/accessibility.i18n.json @@ -0,0 +1,26 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "emergencyConfOn": "Se cambiará ahora el valor de configuración \"editor.accessibilitySupport\" a \"activado\".", + "openingDocs": "Se abrirá ahora la página de documentación de accesibilidad de VS Code.", + "introMsg": "Gracias por probar las opciones de accesibilidad de VS Code.", + "status": "Estado:", + "changeConfigToOnMac": "Para configurar el editor de forma que esté optimizado de permanentemente para su uso con un lector de pantalla, presione ahora Comando+E.", + "changeConfigToOnWinLinux": "Para configurar el editor de forma que esté optimizado permanentemente para su uso con un lector de pantalla, presione ahora Control+E.", + "auto_unknown": "El editor está configurado para usar API de plataforma para detectar cuándo está conectado un lector de pantalla, pero el entorno actual de tiempo de ejecución no admite esta característica.", + "auto_on": "El editor ha detectado automáticamente un lector de pantalla conectado.", + "auto_off": "El editor está configurado para detectar automáticamente cuándo está conectado un lector de pantalla, lo que no es el caso en este momento.", + "configuredOn": "El editor está configurado para optimizarse permanentemente para su uso con un lector de pantalla; para cambiar este comportamiento, edite el valor de configuración \"editor.accessibilitySupport\".", + "configuredOff": "El editor está configurado de forma que no esté nunca optimizado para su uso con un lector de pantalla.", + "tabFocusModeOnMsg": "Al presionar TAB en el editor actual, el foco se mueve al siguiente elemento activable. Presione {0} para activar o desactivar este comportamiento.", + "tabFocusModeOnMsgNoKb": "Al presionar TAB en el editor actual, el foco se mueve al siguiente elemento activable. El comando {0} no se puede desencadenar actualmente mediante un enlace de teclado.", + "tabFocusModeOffMsg": "Al presionar TAB en el editor actual, se insertará el carácter de tabulación. Presione {0} para activar o desactivar este comportamiento.", + "tabFocusModeOffMsgNoKb": "Al presionar TAB en el editor actual, se insertará el carácter de tabulación. El comando {0} no se puede desencadenar actualmente mediante un enlace de teclado.", + "openDocMac": "Presione Comando+H ahora para abrir una ventana de explorador con más información de VS Code relacionada con la accesibilidad.", + "openDocWinLinux": "Presione Control+H ahora para abrir una ventana de explorador con más información de VS Code relacionada con la accesibilidad.", + "outroMsg": "Para descartar esta información sobre herramientas y volver al editor, presione Esc o Mayús+Escape.", + "ShowAccessibilityHelpAction": "Mostrar ayuda de accesibilidad" +} \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/codeEditor/electron-browser/inspectTMScopes.i18n.json b/i18n/esn/src/vs/workbench/parts/codeEditor/electron-browser/inspectTMScopes.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a --- /dev/null +++ b/i18n/esn/src/vs/workbench/parts/codeEditor/electron-browser/inspectTMScopes.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{} \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/codeEditor/electron-browser/toggleMultiCursorModifier.i18n.json b/i18n/esn/src/vs/workbench/parts/codeEditor/electron-browser/toggleMultiCursorModifier.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..6612e373361ceb09ae539bc2837f889a37fb421a --- /dev/null +++ b/i18n/esn/src/vs/workbench/parts/codeEditor/electron-browser/toggleMultiCursorModifier.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "toggleLocation": "Alternar modificador multicursor" +} \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/debug/electron-browser/debugService.i18n.json b/i18n/esn/src/vs/workbench/parts/debug/electron-browser/debugService.i18n.json index 96a50f5d740f810ea13133b233d420f5bb89f6aa..ce2f816c86847c05728e228cc15da3b96b084b2a 100644 --- a/i18n/esn/src/vs/workbench/parts/debug/electron-browser/debugService.i18n.json +++ b/i18n/esn/src/vs/workbench/parts/debug/electron-browser/debugService.i18n.json @@ -5,8 +5,8 @@ // Do not edit this file. It is machine generated. { "snapshotObj": "Solo se muestran valores primitivos para este objeto.", - "debuggingStarted": "La depuración se ha iniciado.", "debuggingPaused": "La depuración se ha pausado. Motivo: {0}, {1} {2}", + "debuggingStarted": "La depuración se ha iniciado.", "debuggingStopped": "La depuración se ha detenido.", "breakpointAdded": "Punto de interrupción agregado, línea {0}, archivo {1}", "breakpointRemoved": "Punto de interrupción quitado, línea {0}, archivo {1}", diff --git a/i18n/esn/src/vs/workbench/parts/debug/electron-browser/debugViews.i18n.json b/i18n/esn/src/vs/workbench/parts/debug/electron-browser/debugViews.i18n.json index 92832a7c2dc8a96926b62caddc926f956072f25c..7b12765e51e8f40b4102afe739d6d4617b36cc22 100644 --- a/i18n/esn/src/vs/workbench/parts/debug/electron-browser/debugViews.i18n.json +++ b/i18n/esn/src/vs/workbench/parts/debug/electron-browser/debugViews.i18n.json @@ -5,16 +5,12 @@ // Do not edit this file. It is machine generated. { "variablesSection": "Sección de variables", - "variables": "Variables", "variablesAriaTreeLabel": "Variables de depuración", "expressionsSection": "Sección de expresiones", - "watch": "Inspección", "watchAriaTreeLabel": "Expresiones de inspección de la depuración", "callstackSection": "Sección de la pila de llamadas", "debugStopped": "En pausa en {0}", - "callStack": "Pila de llamadas", "callStackAriaLabel": "Pila de llamadas de la depuración", "breakpointsSection": "Sección de puntos de interrupción", - "breakpoints": "Puntos de interrupción", "breakpointsAriaTreeLabel": "Puntos de interrupción de la depuración" } \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/debug/electron-browser/statusbarColorProvider.i18n.json b/i18n/esn/src/vs/workbench/parts/debug/electron-browser/statusbarColorProvider.i18n.json index 916ac3e48848ce5d989593fac2b13756d53c2262..ff677b59a60d7db60f598e857c6a74b0719443ab 100644 --- a/i18n/esn/src/vs/workbench/parts/debug/electron-browser/statusbarColorProvider.i18n.json +++ b/i18n/esn/src/vs/workbench/parts/debug/electron-browser/statusbarColorProvider.i18n.json @@ -4,5 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "statusBarDebuggingBackground": "Color de fondo de la barra de estado cuando se está depurando un programa. La barra de estado se muestra en la parte inferior de la ventana" + "statusBarDebuggingBackground": "Color de fondo de la barra de estado cuando se está depurando un programa. La barra de estado se muestra en la parte inferior de la ventana", + "statusBarDebuggingForeground": "Color de primer plano de la barra de estado cuando se está depurando un programa. La barra de estado se muestra en la parte inferior de la ventana" } \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json b/i18n/esn/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json index cb1c21395831b22dba2d6d9d0aa7563c271c595c..00a55728fff7c05706588ddeea5e28cea24a151a 100644 --- a/i18n/esn/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json +++ b/i18n/esn/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json @@ -7,6 +7,7 @@ "debugAdapterBinNotFound": "El ejecutable del adaptador de depuración \"{0}\" no existe.", "debugAdapterCannotDetermineExecutable": "No se puede determinar el ejecutable para el adaptador de depuración \"{0}\".", "debugType": "Tipo de configuración.", + "debugTypeNotRecognised": "Este tipo de depuración no se reconoce. Compruebe que tiene instalada la correspondiente extensión de depuración y que está habilitada.", "node2NotSupported": "\"node2\" ya no se admite; use \"node\" en su lugar y establezca el atributo \"protocol\" en \"inspector\".", "debugName": "Nombre de la configuración. Aparece en el menú desplegable de la configuración de inicio.", "debugRequest": "Tipo de solicitud de la configuración. Puede ser \"launch\" o \"attach\".", diff --git a/i18n/esn/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json b/i18n/esn/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json index 328583915c472800ced09a53b35ae33c80f304fe..a06b5c267dd110482a4cac9fab6c0ed8d70a3439 100644 --- a/i18n/esn/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json +++ b/i18n/esn/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json @@ -4,6 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "previousEditPoint": "Emmet: Punto de edición anterior", - "nextEditPoint": "Emmet: Punto de edición siguiente" + "previousEditPoint": "Emmet: Ir al punto de edición anterior", + "nextEditPoint": "Emmet: Ir al punto de edición siguiente" } \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json b/i18n/esn/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json index 176ecb884a1910638496b8ee11f203e269573582..a1f452f38ff14753091ecac3d2c16617b30ebae0 100644 --- a/i18n/esn/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json +++ b/i18n/esn/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json @@ -9,5 +9,6 @@ "emmetPreferences": "Preferencias usadas para modificar el comportamiento de algunas acciones y resoluciones de Emmet.", "emmetSyntaxProfiles": "Defina el perfil de la sintaxis especificada o use su propio perfil con reglas específicas.", "emmetExclude": "Matriz de lenguajes donde no deben expandirse la abreviación Emmet.", - "emmetExtensionsPath": "Ruta de acceso a una carpeta que contiene perfiles de Emmet, fragmentos de código y preferencias" + "emmetExtensionsPath": "Ruta de acceso a una carpeta que contiene perfiles de Emmet, fragmentos de código y preferencias", + "useNewEmmet": "Pruebe los nuevos módulos de Emmet (que finalmente sustituirán a la biblioteca anterior de Emmet) para conocer todas las características de Emmet." } \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/extensions/browser/extensionEditor.i18n.json b/i18n/esn/src/vs/workbench/parts/extensions/browser/extensionEditor.i18n.json index bd5f70d9a8dc7450cba66d72cb6272863198e583..e68b4424c5280ae4757fb49b6bbb0967556b65dd 100644 --- a/i18n/esn/src/vs/workbench/parts/extensions/browser/extensionEditor.i18n.json +++ b/i18n/esn/src/vs/workbench/parts/extensions/browser/extensionEditor.i18n.json @@ -24,6 +24,10 @@ "default": "Predeterminado", "debuggers": "Depuradores ({0})", "debugger name": "Nombre", + "views": "Vistas ({0})", + "view id": "Id.", + "view name": "Nombre", + "view location": "Donde", "themes": "Temas ({0})", "JSON Validation": "Validación JSON ({0})", "commands": "Comandos ({0})", diff --git a/i18n/esn/src/vs/workbench/parts/extensions/browser/extensionsActions.i18n.json b/i18n/esn/src/vs/workbench/parts/extensions/browser/extensionsActions.i18n.json index 7da24054556a5371c939df9922facb03f8f5c59e..5e236865193d6269c830c1a492ada0d2c55fd245 100644 --- a/i18n/esn/src/vs/workbench/parts/extensions/browser/extensionsActions.i18n.json +++ b/i18n/esn/src/vs/workbench/parts/extensions/browser/extensionsActions.i18n.json @@ -22,6 +22,8 @@ "disableGloballyAction": "Siempre", "disableAction": "Deshabilitar", "checkForUpdates": "Buscar actualizaciones", + "enableAutoUpdate": "Habilitar extensiones de actualización automática", + "disableAutoUpdate": "Deshabilitar extensiones de actualización automática", "updateAll": "Actualizar todas las extensiones", "reloadAction": "Recargar", "postUpdateTooltip": "Recargar para actualizar", @@ -44,6 +46,8 @@ "showWorkspaceRecommendedExtensions": "Mostrar extensiones recomendadas del área de trabajo", "showRecommendedKeymapExtensions": "Mostrar asignaciones de teclado recomendadas", "showRecommendedKeymapExtensionsShort": "Asignaciones de teclado", + "showLanguageExtensions": "Mostrar extensiones del lenguaje", + "showLanguageExtensionsShort": "Extensiones del lenguaje", "configureWorkspaceRecommendedExtensions": "Configurar extensiones recomendadas (área de trabajo)", "ConfigureWorkspaceRecommendations.noWorkspace": "Las recomendaciones solo están disponibles en una carpeta de área de trabajo.", "OpenExtensionsFile.failed": "No se puede crear el archivo \"extensions.json\" dentro de la carpeta \".vscode\" ({0}).", @@ -51,5 +55,8 @@ "disableAll": "Deshabilitar todas las extensiones instaladas", "disableAllWorkspace": "Deshabilitar todas las extensiones instaladas para esta área de trabajo", "enableAll": "Habilitar todas las extensiones instaladas", - "enableAllWorkspace": "Habilitar todas las extensiones instaladas para esta área de trabajo" + "enableAllWorkspace": "Habilitar todas las extensiones instaladas para esta área de trabajo", + "extensionButtonProminentBackground": "Color de fondo del botón para la extensión de acciones que se destacan (por ejemplo, el botón de instalación).", + "extensionButtonProminentForeground": "Color de primer plano del botón para la extensión de acciones que se destacan (por ejemplo, botón de instalación).", + "extensionButtonProminentHoverBackground": "Color de fondo del botón al mantener el mouse para la extensión de acciones que se destacan (por ejemplo, el botón de instalación)." } \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json b/i18n/esn/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json index 8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a..6151f36cc6b226dcdc5b83777dcdc46932ce329d 100644 --- a/i18n/esn/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json +++ b/i18n/esn/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json @@ -3,4 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. -{} \ No newline at end of file +{ + "disableOtherKeymapsConfirmation": "¿Quiere deshabilitar otras asignaciones de teclas ({0}) para evitar conflictos entre enlaces de teclado?", + "yes": "Sí", + "no": "No", + "betterMergeDisabled": "La extensión Mejor combinación está ahora integrada, la extensión instalada se deshabilitó y no se puede desinstalar.", + "uninstall": "Desinstalación", + "later": "Más tarde" +} \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/files/browser/files.contribution.i18n.json b/i18n/esn/src/vs/workbench/parts/files/browser/files.contribution.i18n.json index 9b8bcb5fdf13467837337a087ff826bafd4f8fb5..b104c63f09f93e2818a4830aff19b47efad9d1b0 100644 --- a/i18n/esn/src/vs/workbench/parts/files/browser/files.contribution.i18n.json +++ b/i18n/esn/src/vs/workbench/parts/files/browser/files.contribution.i18n.json @@ -16,7 +16,7 @@ "associations": "Configure asociaciones de archivo para los lenguajes (por ejemplo, \"*.extension\": \"html\"). Estas asociaciones tienen prioridad sobre las asociaciones predeterminadas de los lenguajes instalados.", "encoding": "La codificación del juego de caracteres predeterminada que debe utilizarse al leer y escribir archivos.", "autoGuessEncoding": "Si está opción está habilitada, se intentará adivinar la codificación del juego de caracteres al abrir los archivos", - "eol": "Carácter predeterminado de final de línea.", + "eol": "Carácter predeterminado de final de línea. Utilice \\n para LF y \\r\\n para CRLF.", "trimTrailingWhitespace": "Si se habilita, se recortará el espacio final cuando se guarde un archivo.", "insertFinalNewline": "Si se habilita, inserte una nueva línea final al final del archivo cuando lo guarde.", "files.autoSave.off": "Un archivo con modificaciones no se guarda nunca automáticamente.", @@ -28,7 +28,6 @@ "watcherExclude": "Configure patrones globales de las rutas de acceso de archivo que se van a excluir de la inspección de archivos. Al cambiar esta configuración, es necesario reiniciar. Si observa que Code consume mucho tiempo de CPU al iniciarse, puede excluir las carpetas grandes para reducir la carga inicial.", "hotExit.off": "Deshabilita la salida rápida.", "hotExit.onExit": "hotExit se desencadena al cerrar la aplicación, es decir, al cerrarse la última ventana en Windows/Linux o cuando se desencadena el comando workbench.action.quit (paleta de comandos, enlace de teclado, menú). Todas las ventanas con copias de seguridad se restaurarán la próxima vez que se inicie.", - "hotExit.onExitAndWindowClose": "HotExit se desencadena al cerrar la aplicación, es decir, al cerrarse la última ventana en Windows/Linux o cuando se desencadena el comando workbench.action.quit (paleta de comandos, enlace de teclado, menú). También para cualquier ventana que tenga una carpeta abierta, independientemente de que sea o no la última ventana. Todas las ventanas sin carpetas abiertas se restaurarán la próxima vez que se inicie. Para restaurar las ventanas con carpetas tal cual estaban antes de cerrarse, establezca \"window.reopenFolders\" en \"all\".", "hotExit": "Controla si los archivos no guardados se recuerdan entre las sesiones, lo que permite omitir el mensaje para guardar al salir del editor.", "defaultLanguage": "El modo de lenguaje predeterminado que se asigna a nuevos archivos.", "editorConfigurationTitle": "Editor", diff --git a/i18n/esn/src/vs/workbench/parts/files/browser/views/emptyView.i18n.json b/i18n/esn/src/vs/workbench/parts/files/browser/views/emptyView.i18n.json index f62bf00d0ebca0bbb82d99fa888158345f721423..c2ff9cef3d7b3c8d70e7e6a5be3cb3763327bc19 100644 --- a/i18n/esn/src/vs/workbench/parts/files/browser/views/emptyView.i18n.json +++ b/i18n/esn/src/vs/workbench/parts/files/browser/views/emptyView.i18n.json @@ -5,7 +5,5 @@ // Do not edit this file. It is machine generated. { "explorerSection": "Sección del Explorador de archivos", - "noWorkspace": "No hay ninguna carpeta abierta", - "noWorkspaceHelp": "Todavía no ha abierto ninguna carpeta.", "openFolder": "Abrir carpeta" } \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/files/browser/views/openEditorsView.i18n.json b/i18n/esn/src/vs/workbench/parts/files/browser/views/openEditorsView.i18n.json index 1b3168622ee331d8b484625efe95a56d724180ea..30c064adf3d1dd8752b6b20d82428289bfebf4a6 100644 --- a/i18n/esn/src/vs/workbench/parts/files/browser/views/openEditorsView.i18n.json +++ b/i18n/esn/src/vs/workbench/parts/files/browser/views/openEditorsView.i18n.json @@ -4,8 +4,8 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "openEditosrSection": "Sección Editores abiertos", "openEditors": "Editores abiertos", + "openEditosrSection": "Sección Editores abiertos", "treeAriaLabel": "Editores abiertos: lista de archivos activos", "dirtyCounter": "{0} sin guardar" } \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json b/i18n/esn/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json index 712641fcab11d001158d6a2bc2fa3f7b83de6b20..81f5a667ca8d38acc222e18d4759a4248c6aba6d 100644 --- a/i18n/esn/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json +++ b/i18n/esn/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json @@ -5,5 +5,11 @@ // Do not edit this file. It is machine generated. { "slow": "Inicio lento detectado", - "slow.detail": "Lamentamos que haya tenido un inicio lento. Reinicie \"{0}\" con la generación de perfiles habilitada, comparta los perfiles con nosotros y trabajaremos a fondo para que vuelva a disfrutar de un inicio increíble." + "slow.detail": "Lamentamos que haya tenido un inicio lento. Reinicie \"{0}\" con la generación de perfiles habilitada, comparta los perfiles con nosotros y trabajaremos a fondo para que vuelva a disfrutar de un inicio increíble.", + "prof.message": "Los perfiles se crearon correctamente.", + "prof.detail": "Cree un problema y asóciele manualmente los siguientes archivos: {0}", + "prof.restartAndFileIssue": "Crear problema y reiniciar", + "prof.restart": "Reiniciar", + "prof.thanks": "Gracias por ayudarnos.", + "prof.detail.restart": "Se necesita un reinicio final para continuar utilizando '{0}'. De nuevo, gracias por su aportación." } \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/preferences/browser/keybindingsEditorContribution.i18n.json b/i18n/esn/src/vs/workbench/parts/preferences/browser/keybindingsEditorContribution.i18n.json index cb715f512200ffec87dd6af21c4f17fad800c025..e8414e42d1430c4b1363764458f0aed0de1fa065 100644 --- a/i18n/esn/src/vs/workbench/parts/preferences/browser/keybindingsEditorContribution.i18n.json +++ b/i18n/esn/src/vs/workbench/parts/preferences/browser/keybindingsEditorContribution.i18n.json @@ -5,6 +5,7 @@ // Do not edit this file. It is machine generated. { "defineKeybinding.start": "Definir enlace de teclado", - "defineKeybinding.kbLayoutInfoMessage": "Para la distribución del teclado actual, presione ", - "defineKeybinding.kbLayoutErrorMessage": "La distribución del teclado actual no permite reproducir esta combinación de teclas." + "defineKeybinding.kbLayoutErrorMessage": "La distribución del teclado actual no permite reproducir esta combinación de teclas.", + "defineKeybinding.kbLayoutLocalAndUSMessage": "**{0}** para su distribución de teclado actual (**{1}** para EE. UU. estándar).", + "defineKeybinding.kbLayoutLocalMessage": "**{0}** para su distribución de teclado actual." } \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.i18n.json b/i18n/esn/src/vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..d3057c63b085319fe50983e43b676551920c5a83 --- /dev/null +++ b/i18n/esn/src/vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "relaunchMessage": "Ha cambiado un ajuste que requiere un reinicio para ser efectivo.", + "relaunchDetail": "Pulse el botón de reinicio para reiniciar {0} y habilitar el ajuste.", + "restart": "Reiniciar" +} \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.i18n.json b/i18n/esn/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..5fe13ab86c4315a4f15f2147ff96e1dacf1a47e3 --- /dev/null +++ b/i18n/esn/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "editorGutterModifiedBackground": "Color de fondo del medianil del editor para las líneas modificadas.", + "editorGutterAddedBackground": "Color de fondo del medianil del editor para las líneas agregadas.", + "editorGutterDeletedBackground": "Color de fondo del medianil del editor para las líneas eliminadas." +} \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/scm/electron-browser/scm.contribution.i18n.json b/i18n/esn/src/vs/workbench/parts/scm/electron-browser/scm.contribution.i18n.json index 2d44f58d5145a7f19318557e6b24393b0a4bea4c..a77a22117808a0b699d54ff4b5e035bd5f1bea79 100644 --- a/i18n/esn/src/vs/workbench/parts/scm/electron-browser/scm.contribution.i18n.json +++ b/i18n/esn/src/vs/workbench/parts/scm/electron-browser/scm.contribution.i18n.json @@ -5,6 +5,7 @@ // Do not edit this file. It is machine generated. { "toggleGitViewlet": "Mostrar GIT", + "installAdditionalSCMProviders": "Instalar proveedores adicionales de SCM...", "source control": "Control de código fuente", "toggleSCMViewlet": "Mostrar SCM", "view": "Ver" diff --git a/i18n/esn/src/vs/workbench/parts/scm/electron-browser/scmMenus.i18n.json b/i18n/esn/src/vs/workbench/parts/scm/electron-browser/scmMenus.i18n.json index 58e5c2559c839261d45fa059757e453bd614269f..048db5a28d068b5beee83af5f1d115e69f426a9a 100644 --- a/i18n/esn/src/vs/workbench/parts/scm/electron-browser/scmMenus.i18n.json +++ b/i18n/esn/src/vs/workbench/parts/scm/electron-browser/scmMenus.i18n.json @@ -4,5 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "installAdditionalSCMProviders": "Instalar proveedores adicionales de SCM...", "switch provider": "Cambiar proveedor de SCM..." } \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/snippets/electron-browser/TMSnippets.i18n.json b/i18n/esn/src/vs/workbench/parts/snippets/electron-browser/TMSnippets.i18n.json index 2841d09230e04719fa0b17a2c501cf7078cfa86c..08084e884982f3d7eef03d55be365cf557fb3e91 100644 --- a/i18n/esn/src/vs/workbench/parts/snippets/electron-browser/TMSnippets.i18n.json +++ b/i18n/esn/src/vs/workbench/parts/snippets/electron-browser/TMSnippets.i18n.json @@ -9,5 +9,6 @@ "vscode.extension.contributes.snippets-path": "Ruta de acceso del archivo de fragmentos de código. La ruta es relativa a la carpeta de extensión y normalmente empieza por \"./snippets/\".", "invalid.language": "Lenguaje desconocido en \"contributes.{0}.language\". Valor proporcionado: {1}", "invalid.path.0": "Se esperaba una cadena en \"contributes.{0}.path\". Valor proporcionado: {1}", - "invalid.path.1": "Se esperaba que \"contributes.{0}.path\" ({1}) se incluyera en la carpeta de la extensión ({2}). Esto puede hacer que la extensión no sea portátil." + "invalid.path.1": "Se esperaba que \"contributes.{0}.path\" ({1}) se incluyera en la carpeta de la extensión ({2}). Esto puede hacer que la extensión no sea portátil.", + "badVariableUse": "Es muy probable que el fragmento de código \"{0}\" confunda las variables de fragmento de código y los marcadores de posición de fragmento de código. Consulte https://code.visualstudio.com/docs/editor/userdefinedsnippets#_snippet-syntax para más informacion." } \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/snippets/electron-browser/snippets.contribution.i18n.json b/i18n/esn/src/vs/workbench/parts/snippets/electron-browser/snippets.contribution.i18n.json index 6bb2b76ad2be307798ccbe8f0e300fdebc84b0e5..4a006c7f571759a3c7dd2f879e544412debf5bcb 100644 --- a/i18n/esn/src/vs/workbench/parts/snippets/electron-browser/snippets.contribution.i18n.json +++ b/i18n/esn/src/vs/workbench/parts/snippets/electron-browser/snippets.contribution.i18n.json @@ -11,6 +11,6 @@ "snippetSchema.json.default": "Fragmento de código vacío", "snippetSchema.json": "Configuración de fragmento de código del usuario", "snippetSchema.json.prefix": "El prefijo que se debe usar al seleccionar el fragmento de código en Intellisense", - "snippetSchema.json.body": "Contenido del fragmento de código. Use '${id}', '${id:label}', '${1:label}' para las variables y '$0', '$1' para las posiciones del cursor", + "snippetSchema.json.body": "El contenido del fragmento de código. Use \"$1', \"${1:defaultText}\" para definir las posiciones del cursor, use \"$0\" para la posición final del cursor. Inserte valores de variable con \"${varName}\" y \"${varName:defaultText}\", por ejemplo, \"This is file: $TM_FILENAME\".", "snippetSchema.json.description": "La descripción del fragmento de código." } \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/surveys/electron-browser/languageSurveys.contribution.i18n.json b/i18n/esn/src/vs/workbench/parts/surveys/electron-browser/languageSurveys.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..411c12dbc460888b5370351a38b38544203cd1f1 --- /dev/null +++ b/i18n/esn/src/vs/workbench/parts/surveys/electron-browser/languageSurveys.contribution.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "helpUs": "Ayúdenos a mejorar nuestro soporte para {0}", + "takeShortSurvey": "Realizar una breve encuesta", + "remindLater": "Recordármelo más tarde", + "neverAgain": "No volver a mostrar" +} \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/surveys/electron-browser/nps.contribution.i18n.json b/i18n/esn/src/vs/workbench/parts/surveys/electron-browser/nps.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..2e4d1ea682fefa425ae432fa97dbeafcc42c29ef --- /dev/null +++ b/i18n/esn/src/vs/workbench/parts/surveys/electron-browser/nps.contribution.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "surveyQuestion": "¿Le importaría realizar una breve encuesta de opinión?", + "takeSurvey": "Realizar encuesta", + "remindLater": "Recordármelo más tarde", + "neverAgain": "No volver a mostrar" +} \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/tasks/browser/buildQuickOpen.i18n.json b/i18n/esn/src/vs/workbench/parts/tasks/browser/buildQuickOpen.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..6574ffdaef17d6c0de3349019747a50a599cdc95 --- /dev/null +++ b/i18n/esn/src/vs/workbench/parts/tasks/browser/buildQuickOpen.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "noTasksMatching": "No tasks matching" +} \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/tasks/browser/quickOpen.i18n.json b/i18n/esn/src/vs/workbench/parts/tasks/browser/quickOpen.i18n.json index e5995f59713d990cee2dc4b8795a424c5a819360..59b152344cf5d56c35d2b92e1c20bc994de2d5a1 100644 --- a/i18n/esn/src/vs/workbench/parts/tasks/browser/quickOpen.i18n.json +++ b/i18n/esn/src/vs/workbench/parts/tasks/browser/quickOpen.i18n.json @@ -4,5 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "entryAriaLabel": "{0}, tareas" + "entryAriaLabel": "{0}, tareas", + "customizeTask": "Personalizar tarea" } \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/tasks/browser/testQuickOpen.i18n.json b/i18n/esn/src/vs/workbench/parts/tasks/browser/testQuickOpen.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..6574ffdaef17d6c0de3349019747a50a599cdc95 --- /dev/null +++ b/i18n/esn/src/vs/workbench/parts/tasks/browser/testQuickOpen.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "noTasksMatching": "No tasks matching" +} \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/tasks/common/taskConfiguration.i18n.json b/i18n/esn/src/vs/workbench/parts/tasks/common/taskConfiguration.i18n.json index 14c75ef21d9858b0127cf51f817dc531f12ca1a5..71a6380a7abf0dd3a1cccaf37de869dc6f7d68c7 100644 --- a/i18n/esn/src/vs/workbench/parts/tasks/common/taskConfiguration.i18n.json +++ b/i18n/esn/src/vs/workbench/parts/tasks/common/taskConfiguration.i18n.json @@ -5,13 +5,13 @@ // Do not edit this file. It is machine generated. { "ConfigurationParser.invalidCWD": "Advertencia: options.cwd debe ser de tipo cadena. Se ignora el valor {0}.", - "ConfigurationParser.noShell": "Advertencia: La configuración del shell solo se admite al ejecutar tareas en el terminal.", "ConfigurationParser.noargs": "Error: Los argumentos de comando deben ser una matriz de cadenas. El valor proporcionado es: {0}", + "ConfigurationParser.noShell": "Advertencia: La configuración del shell solo se admite al ejecutar tareas en el terminal.", "ConfigurationParser.noName": "Error: El buscador de coincidencias de problemas del ámbito de declaración debe tener un nombre: {0}", "ConfigurationParser.unknownMatcherKind": "Advertencia: El buscador de coincidencias de problemas definido se desconoce. Los tipos admitidos son string | ProblemMatcher | (string | ProblemMatcher). {0}", "ConfigurationParser.invalidVaraibleReference": "Error: Referencia a problemMatcher no válida: {0}", "ConfigurationParser.noTaskName": "Error: Las tareas deben proporcionar una propiedad taskName. La tarea se ignorará. {0}", "taskConfiguration.shellArgs": "Advertencia: La tarea \"{0}\" es un comando de shell y su nombre de comando o uno de sus argumentos tiene espacios sin escape. Para asegurarse de que la línea de comandos se cite correctamente, combine mediante fusión los argumentos en el comando.", - "taskConfiguration.noCommandOrDependsOn": "Error: La tarea \"{0}\" no especifica un comando ni una propiedad dependsOn. La tarea se ignorará. Su definición es: {1}", + "taskConfiguration.noCommandOrDependsOn": "Error: La tarea \"{0}\" no especifica un comando ni una propiedad dependsOn. La tarea se ignorará. Su definición es: \n{1}", "taskConfiguration.noCommand": "Error: La tarea \"{0}\" no define un comando. La tarea se ignorará. Su definición es: {1}" } \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/tasks/electron-browser/jsonSchemaCommon.i18n.json b/i18n/esn/src/vs/workbench/parts/tasks/electron-browser/jsonSchemaCommon.i18n.json index 20c5a4af69853bdbc236f5a1dbe43f67e91d21ef..b148f0ec22a9b73e126385adb72bdb1d8f005734 100644 --- a/i18n/esn/src/vs/workbench/parts/tasks/electron-browser/jsonSchemaCommon.i18n.json +++ b/i18n/esn/src/vs/workbench/parts/tasks/electron-browser/jsonSchemaCommon.i18n.json @@ -7,6 +7,7 @@ "JsonSchema.options": "Opciones de comando adicionales", "JsonSchema.options.cwd": "Directorio de trabajo actual del script o el programa ejecutado. Si se omite, se usa la raíz del área de trabajo actual de Code.", "JsonSchema.options.env": "Entorno del shell o el programa ejecutado. Si se omite, se usa el entorno del proceso primario.", + "JsonSchema.shellConfiguration": "Configura el shell que se usará.", "JsonSchema.shell.executable": "Shell que se va a usar.", "JsonSchema.shell.args": "Argumentos de shell.", "JsonSchema.command": "El comando que se va a ejecutar. Puede ser un programa externo o un comando shell.", diff --git a/i18n/esn/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v1.i18n.json b/i18n/esn/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v1.i18n.json index 9c0e9c0db0b4711918fc5e7efa5e2b4d248befe3..d8137d279a8da7b52ec824766a82d109e2f5c924 100644 --- a/i18n/esn/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v1.i18n.json +++ b/i18n/esn/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v1.i18n.json @@ -5,6 +5,8 @@ // Do not edit this file. It is machine generated. { "JsonSchema.version": "Número de versión de la configuración", + "JsonSchema._runner": "El ejecutador se ha graduado. Use el ejecutador oficial correctamente", + "JsonSchema.runner": "Define si la tarea se ejecuta como un proceso y la salida se muestra en la ventana de salida o dentro del terminal.", "JsonSchema.windows": "Configuración de comando específico de Windows", "JsonSchema.mac": "Configuración de comando específico de Mac", "JsonSchema.linux": "Configuración de comando específico de Linux", diff --git a/i18n/esn/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.i18n.json b/i18n/esn/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.i18n.json index 35f7a06e8d6c1ce63e32ad0b1fde9b8eba1d4261..af62585104d015449443cf650bcd15fae7ed3de6 100644 --- a/i18n/esn/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.i18n.json +++ b/i18n/esn/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.i18n.json @@ -4,11 +4,14 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "JsonSchema.version": "Número de versión de la configuración", - "JsonSchema.windows": "Configuración de comando específico de Windows", - "JsonSchema.mac": "Configuración de comando específico de Mac", - "JsonSchema.linux": "Configuración de comando específico de Linux", "JsonSchema.shell": "Especifica si el comando es un comando shell o un programa externo. Si se omite, el valor predeterminado es false.", "JsonSchema.tasks.dependsOn.string": "Otra tarea de la que depende esta tarea.", - "JsonSchema.tasks.dependsOn.array": "Las otras tareas de las que depende esta tarea." + "JsonSchema.tasks.dependsOn.array": "Las otras tareas de las que depende esta tarea.", + "JsonSchema.tasks.group": "Define el grupo de ejecución al que pertenece esta tarea. Si se omite, la tarea no pertenece a ningún grupo.", + "JsonSchema.tasks.type": "Define si la tarea se ejecuta como un proceso o como un comando dentro de un shell. El valor predeterminado es proceso.", + "JsonSchema.version": "El número de versión de la configuración.", + "JsonSchema.tasks.customize": "La tarea contribuida que se va a personalizar.", + "JsonSchema.windows": "Configuración de comando específico de Windows", + "JsonSchema.mac": "Configuración de comando específico de Mac", + "JsonSchema.linux": "Configuración de comando específico de Linux" } \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json b/i18n/esn/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json index 05a4cfef6c77a8df4d672a1b614ebc78353104ca..7be9d7375de8607b68d2b5f53f47e6e8dc347eaa 100644 --- a/i18n/esn/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json +++ b/i18n/esn/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json @@ -22,7 +22,8 @@ "TaskService.noBuildTask": "No se ha definido ninguna tarea de compilación. Marque una tarea con \"isBuildCommand\" en el archivo tasks.json.", "TaskService.noTestTask": "No se ha definido ninguna tarea de prueba. Marque una tarea con \"isTestCommand\" en el archivo tasks.json.", "TaskServer.noTask": "No se encuentra la tarea {0} que se ha solicitado para ejecutarla.", - "TaskSystem.activeSame": "La tarea ya está activa y en modo de inspección. Para finalizar la tarea, use \"F1 > finalizar tarea\"", + "customizeParseErrors": "La configuración actual de tareas contiene errores. Antes de personalizar una tarea, corrija los errores.", + "moreThanOneBuildTask": "Hay muchas tareas de compilación definidas en el archivo tasks.json. Se ejecutará la primera.\n", "TaskSystem.active": "Ya hay una tarea en ejecución. Finalícela antes de ejecutar otra tarea.", "TaskSystem.restartFailed": "No se pudo terminar y reiniciar la tarea {0}", "TaskSystem.configurationErrors": "Error: La configuración de la tarea proporcionada tiene errores de validación y no se puede usar. Corrija los errores primero.", diff --git a/i18n/esn/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.i18n.json b/i18n/esn/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.i18n.json index 930b60298c1c38772933fcb7fe90890b82973494..99a6eef0566be74bb5fc08ed680ebbe8c6de7886 100644 --- a/i18n/esn/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.i18n.json +++ b/i18n/esn/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.i18n.json @@ -6,5 +6,7 @@ { "TerminalTaskSystem.unknownError": "Error desconocido durante la ejecución de una tarea. Vea el registro de resultados de la tarea para obtener más detalles.", "TerminalTaskSystem.terminalName": "Tarea - {0}", - "TerminalTaskSystem": "No se puede ejecutar un comando shell en una unidad UNC." + "reuseTerminal": "Las tareas reutilizarán el terminal, presione cualquier tecla para cerrarlo.", + "TerminalTaskSystem": "No se puede ejecutar un comando shell en una unidad UNC.", + "unkownProblemMatcher": "No puede resolver el comprobador de problemas {0}. Será omitido." } \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/tasks/node/processTaskSystem.i18n.json b/i18n/esn/src/vs/workbench/parts/tasks/node/processTaskSystem.i18n.json index 651c8b00513f4d4c4a5e88b76d1dab5f0ba5799a..b300e0e061aa5506725060a913179d7a4d73b8d2 100644 --- a/i18n/esn/src/vs/workbench/parts/tasks/node/processTaskSystem.i18n.json +++ b/i18n/esn/src/vs/workbench/parts/tasks/node/processTaskSystem.i18n.json @@ -7,5 +7,6 @@ "TaskRunnerSystem.unknownError": "Error desconocido durante la ejecución de una tarea. Vea el registro de resultados de la tarea para obtener más detalles.", "TaskRunnerSystem.watchingBuildTaskFinished": "La inspección de las tareas de compilación ha finalizado.", "TaskRunnerSystem.childProcessError": "Failed to launch external program {0} {1}.", - "TaskRunnerSystem.cancelRequested": "La tarea '{0}' se finalizó por solicitud del usuario." + "TaskRunnerSystem.cancelRequested": "La tarea '{0}' se finalizó por solicitud del usuario.", + "unkownProblemMatcher": "No puede resolver el comprobador de problemas {0}. Será omitido" } \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/terminal/electron-browser/terminalActions.i18n.json b/i18n/esn/src/vs/workbench/parts/terminal/electron-browser/terminalActions.i18n.json index 50e571af89f115bdb26ee31ffbe0703616df931b..fe23037a3ffd32d654444450baa6d572375ff975 100644 --- a/i18n/esn/src/vs/workbench/parts/terminal/electron-browser/terminalActions.i18n.json +++ b/i18n/esn/src/vs/workbench/parts/terminal/electron-browser/terminalActions.i18n.json @@ -8,6 +8,7 @@ "workbench.action.terminal.kill": "Terminar la instancia del terminal activo", "workbench.action.terminal.kill.short": "Terminar el terminal", "workbench.action.terminal.copySelection": "Copiar selección", + "workbench.action.terminal.selectAll": "Seleccionar todo", "workbench.action.terminal.new": "Crear nuevo terminal integrado", "workbench.action.terminal.new.short": "Nuevo terminal", "workbench.action.terminal.focus": "Enfocar terminal", @@ -28,5 +29,6 @@ "workbench.action.terminal.scrollToTop": "Desplazar al principio", "workbench.action.terminal.clear": "Borrar", "workbench.action.terminal.allowWorkspaceShell": "Permitir la configuración del área de trabajo Shell", - "workbench.action.terminal.disallowWorkspaceShell": "No permitir la configuración del área de trabajo Shell" + "workbench.action.terminal.disallowWorkspaceShell": "No permitir la configuración del área de trabajo Shell", + "workbench.action.terminal.rename": "Cambiar nombre" } \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/terminal/electron-browser/terminalFindWidget.i18n.json b/i18n/esn/src/vs/workbench/parts/terminal/electron-browser/terminalFindWidget.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..213a60a3c4feae67352fdc8b3d064bc10e3c4bfe --- /dev/null +++ b/i18n/esn/src/vs/workbench/parts/terminal/electron-browser/terminalFindWidget.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "label.find": "Buscar", + "placeholder.find": "Buscar", + "label.previousMatchButton": "Coincidencia anterior", + "label.nextMatchButton": "Coincidencia siguiente", + "label.closeButton": "Cerrar" +} \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.i18n.json b/i18n/esn/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.i18n.json index af3664237c856e584510969a08e762f4e9ce9404..651e16251db541b24a6d5fc3addcee232ae99b97 100644 --- a/i18n/esn/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.i18n.json +++ b/i18n/esn/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.i18n.json @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "terminal.integrated.copySelection.noSelection": "No se puede copiar la selección del terminal cuando el terminal no tiene el foco", "terminal.integrated.exitedWithCode": "El proceso del terminal finalizó con el código de salida: {0}", "terminal.integrated.waitOnExit": "Presione cualquier tecla para cerrar el terminar", "terminal.integrated.launchFailed": "No se pudo iniciar el comando de proceso terminal \"{0}{1}\" (código de salida: {2})" diff --git a/i18n/esn/src/vs/workbench/parts/update/electron-browser/update.i18n.json b/i18n/esn/src/vs/workbench/parts/update/electron-browser/update.i18n.json index 2d90eac682801d2b4a7b118adf2c52d357c6021e..614696014d8f929e6f3588da9ddcf1ad9645524f 100644 --- a/i18n/esn/src/vs/workbench/parts/update/electron-browser/update.i18n.json +++ b/i18n/esn/src/vs/workbench/parts/update/electron-browser/update.i18n.json @@ -15,5 +15,18 @@ "license": "Leer licencia", "updateAvailable": "{0} se actualizará después de reiniciarse.", "thereIsUpdateAvailable": "Hay una actualización disponible.", - "noUpdatesAvailable": "Actualmente no hay actualizaciones disponibles." + "noUpdatesAvailable": "Actualmente no hay actualizaciones disponibles.", + "updateIsReady": "Nueva actualización disponible.", + "commandPalette": "Paleta de comandos...", + "settings": "Configuración", + "keyboardShortcuts": "Métodos abreviados de teclado", + "selectTheme.label": "Tema de color", + "themes.selectIconTheme.label": "Tema de icono de archivo", + "not available": "Actualizaciones no disponibles", + "checkingForUpdates": "Buscando actualizaciones...", + "DownloadUpdate": "Descargar actualización disponible", + "DownloadingUpdate": "Descargando actualización...", + "InstallingUpdate": "Instalando actualización...", + "restartToUpdate": "Reiniciar para actualizar...", + "checkForUpdates": "Buscar actualizaciones..." } \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/views/browser/views.i18n.json b/i18n/esn/src/vs/workbench/parts/views/browser/views.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..62933f6b509ea5c06df3601765df92605ec2f36d --- /dev/null +++ b/i18n/esn/src/vs/workbench/parts/views/browser/views.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "viewToolbarAriaLabel": "{0} acciones" +} \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/views/browser/viewsExtensionPoint.i18n.json b/i18n/esn/src/vs/workbench/parts/views/browser/viewsExtensionPoint.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..825009fbc6c7e1e59521c217eb2492d35f313e26 --- /dev/null +++ b/i18n/esn/src/vs/workbench/parts/views/browser/viewsExtensionPoint.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "requirearray": "views debe ser una mariz", + "requirestring": "la propiedad `{0}` es obligatoria y debe ser de tipo \"string\"", + "optstring": "la propiedad `{0}` se puede omitir o debe ser de tipo \"string\"", + "vscode.extension.contributes.view.id": "Identificador de la vista. Úselo para registrar un proveedor de datos mediante la API \"vscode.window.registerTreeDataProviderForView\". También para desencadenar la activación de su extensión al registrar el evento \"onView:${id}\" en \"activationEvents\".", + "vscode.extension.contributes.view.name": "Nombre de la vista en lenguaje natural. Será mostrado", + "vscode.extension.contributes.views": "Aporta vistas al editor", + "views.explorer": "Vista del explorador", + "locationId.invalid": "`{0}` no es una ubicación de vista válida" +} \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json b/i18n/esn/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json index 9591e0b1673919858f94d412e8d0c2c2f4412e1c..d10b9f98464780d068c0c3da01978f23e6a94d38 100644 --- a/i18n/esn/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json +++ b/i18n/esn/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json @@ -14,19 +14,23 @@ "welcomePage.moreRecent": "Más...", "welcomePage.noRecentFolders": "No hay ninguna carpeta reciente", "welcomePage.help": "Ayuda", + "welcomePage.keybindingsCheatsheet": "Hoja imprimible con ayudas de teclado", "welcomePage.introductoryVideos": "Vídeos de introducción", "welcomePage.productDocumentation": "Documentación del producto", "welcomePage.gitHubRepository": "Repositorio de GitHub", "welcomePage.stackOverflow": "Stack Overflow", "welcomePage.showOnStartup": "Mostrar página principal al inicio", "welcomePage.customize": "Personalizar", + "welcomePage.installExtensionPacks": "Herramientas y lenguajes", + "welcomePage.installExtensionPacksDescription": "Instalar soporte para {0} y {1}", + "welcomePage.moreExtensions": "más", "welcomePage.installKeymapDescription": "Instalar los métodos abreviados de teclado", + "welcomePage.installKeymapExtension": "Instalar los métodos abreviados de teclado de {0} y {1}", "welcomePage.others": "otros", "welcomePage.colorTheme": "Tema de color", "welcomePage.colorThemeDescription": "Modifique a su gusto la apariencia del editor y el código", "welcomePage.learn": "Más información", "welcomePage.showCommands": "Buscar y ejecutar todos los comandos", - "welcomePage.showCommandsDescription": "Acceda rápidamente y busque comandos desde el panel de control ({0})", "welcomePage.interfaceOverview": "Introducción a la interfaz", "welcomePage.interfaceOverviewDescription": "Obtenga una superposición que resalta los componentes principales de la interfaz de usuario", "welcomePage.interactivePlayground": "Área de juegos interactiva", diff --git a/i18n/esn/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.contribution.i18n.json b/i18n/esn/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.contribution.i18n.json index f366b9af6fd8468db08a497231b64dfca66658b4..7fb18c5a5ef29ef4038b5da4b75e2572604b767a 100644 --- a/i18n/esn/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.contribution.i18n.json +++ b/i18n/esn/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.contribution.i18n.json @@ -4,7 +4,5 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "workbenchConfigurationTitle": "Área de trabajo", - "welcomePage.enabled": "Cuando está habilitado, se mostrará la página principal en el inicio.", "help": "Ayuda" } \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json b/i18n/esn/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json index 28283fba5c3e1fa561d3f2bd7857f9207f7fd9cb..7542d5d3b7c5938365930b01aff1843b96063ace 100644 --- a/i18n/esn/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json +++ b/i18n/esn/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json @@ -4,14 +4,35 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "workbenchConfigurationTitle": "Área de trabajo", + "welcomePage.enabled": "Cuando está habilitado, se mostrará la página principal en el inicio.", "welcomePage": "Bienvenido", + "welcomePage.javaScript": "JavaScript", + "welcomePage.typeScript": "TypeScript", + "welcomePage.python": "Python", + "welcomePage.php": "PHP", + "welcomePage.docker": "Docker", + "welcomePage.vim": "Vim", + "welcomePage.sublime": "Sublime", + "welcomePage.atom": "Atom", + "welcomePage.extensionPackAlreadyInstalled": "El soporte para '{0}' ya está instalado.", + "welcomePage.willReloadAfterInstallingExtensionPack": "La ventana se volverá a cargar después de instalar compatibilidad adicional con {0}.", + "welcomePage.installingExtensionPack": "Instalando compatibilidad adicional con {0}...", + "welcomePage.extensionPackNotFound": "No se pudo encontrar el soporte para {0} con id {1}.", "welcomePage.keymapAlreadyInstalled": "Los métodos abreviados de teclado {0} ya están instalados.", "welcomePage.willReloadAfterInstallingKeymap": "La ventana se volverá a cargar después de instalar los métodos abreviados de teclado {0}.", "welcomePage.installingKeymap": "Instalando los métodos abreviados de teclado de {0}...", "welcomePage.keymapNotFound": "No se pudieron encontrar los métodos abreviados de teclado {0} con el identificador {1}.", "welcome.title": "Bienvenido", + "welcomePage.openFolderWithPath": "Abrir la carpeta {0} con la ruta de acceso {1}", + "welcomePage.extensionListSeparator": ", ", + "welcomePage.installKeymap": "Instalar mapa de teclas de {0}", + "welcomePage.installExtensionPack": "Instalar compatibilidad adicional con {0}", + "welcomePage.installedKeymap": "El mapa de teclas de {0} ya está instalado", + "welcomePage.installedExtensionPack": "La compatibilidad con {0} ya está instalada", "ok": "Aceptar", + "details": "Detalles", "cancel": "Cancelar", - "welcomePage.quickLinkBackground": "Color de fondo de los vínculos rápidos en la página principal.", - "welcomePage.quickLinkHoverBackground": "Mantener el puntero sobre el color de fondo para acceder los vínculos rápidos en la página principal." + "welcomePage.buttonBackground": "Color de fondo de los botones en la página principal.", + "welcomePage.buttonHoverBackground": "Color de fondo al mantener el mouse en los botones de la página principal." } \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/services/crashReporter/common/crashReporterService.i18n.json b/i18n/esn/src/vs/workbench/services/crashReporter/common/crashReporterService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..fb3b052d7b4b0ddfd91dd8d881bf254af959b7ba --- /dev/null +++ b/i18n/esn/src/vs/workbench/services/crashReporter/common/crashReporterService.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "telemetryConfigurationTitle": "Telemetría", + "telemetry.enableCrashReporting": "Habilite los informes de bloqueo para enviarlos a Microsoft. Esta opción requiere reiniciar para que tenga efecto." +} \ No newline at end of file diff --git a/i18n/esn/src/vs/workbench/services/progress/browser/progressService2.i18n.json b/i18n/esn/src/vs/workbench/services/progress/browser/progressService2.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..ee9bbb9d071d33866fb8a7febdf96f5224e7828e --- /dev/null +++ b/i18n/esn/src/vs/workbench/services/progress/browser/progressService2.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "progress.text": "{0} - {1} ", + "progress.title": "{0}: {1}" +} \ No newline at end of file diff --git a/i18n/fra/extensions/git/out/commands.i18n.json b/i18n/fra/extensions/git/out/commands.i18n.json index 3601e044f8b2575ed22aa4335de6a32988f12b6e..f1b007aaf1ec7e06e4ca6b970dbd0f2f6cc776fa 100644 --- a/i18n/fra/extensions/git/out/commands.i18n.json +++ b/i18n/fra/extensions/git/out/commands.i18n.json @@ -18,6 +18,7 @@ "discard": "Ignorer les modifications", "confirm discard all": "Voulez-vous vraiment ignorer TOUTES les modifications ? Cette action est IRRÉVERSIBLE.", "discardAll": "Ignorer TOUTES les modifications", + "no staged changes": "Aucune modification en attente à valider.\n\nVoulez-vous automatiquement mettre en attente toutes vos modifications et les valider directement ?", "yes": "Oui", "always": "Toujours", "no changes": "Il n'existe aucun changement à valider.", @@ -25,6 +26,9 @@ "provide commit message": "Indiquez un message de validation", "branch name": "Nom de la branche", "provide branch name": "Fournissez un nom de branche", + "select branch to delete": "Sélectionner une branche à supprimer", + "confirm force delete branch": "La branche '{0}' n'est pas complètement fusionnée. Supprimer quand même ?", + "delete branch": "Supprimer la branche", "no remotes to pull": "Votre dépôt n'a aucun dépôt distant configuré pour un Pull.", "no remotes to push": "Votre dépôt n'a aucun dépôt distant configuré pour un Push.", "nobranch": "Vous devez extraire une branche dont vous souhaitez effectuer le Push vers un emplacement distant.", diff --git a/i18n/fra/extensions/git/package.i18n.json b/i18n/fra/extensions/git/package.i18n.json index 801419a6433bb379eb767ea63117132edbb3e575..16a737e5dd0127b46a05b710080a975a71858f6b 100644 --- a/i18n/fra/extensions/git/package.i18n.json +++ b/i18n/fra/extensions/git/package.i18n.json @@ -26,12 +26,13 @@ "command.undoCommit": "Annuler la dernière validation", "command.checkout": "Extraire vers...", "command.branch": "Créer une branche...", + "command.deleteBranch": "Supprimer la branche...", "command.pull": "Pull", "command.pullRebase": "Pull (rebaser)", "command.push": "Push", "command.pushTo": "Transfert (Push) vers...", "command.sync": "Synchroniser", - "command.publish": "Publier", + "command.publish": "Publier la branche", "command.showOutput": "Afficher la sortie Git", "config.enabled": "Indique si git est activé", "config.path": "Chemin d'accès à l'exécutable git", @@ -42,5 +43,7 @@ "config.countBadge": "Contrôle le compteur de badges Git. La valeur 'toutes' compte toutes les modifications. La valeur 'suivies' compte uniquement les modifications suivies. La valeur 'désactivé' désactive le compteur.", "config.checkoutType": "Contrôle le type des branches répertoriées pendant l'exécution de 'Extraire vers...'. La valeur 'toutes' montre toutes les références, la valeur 'locales' montre uniquement les branches locales, la valeur 'balises' montre uniquement les balises et la valeur 'distantes' montre uniquement les branches distantes.", "config.ignoreLegacyWarning": "Ignore l'avertissement Git hérité", - "config.ignoreLimitWarning": "Ignore l'avertissement quand il y a trop de modifications dans un dépôt" + "config.ignoreLimitWarning": "Ignore l'avertissement quand il y a trop de modifications dans un dépôt", + "config.defaultCloneDirectory": "Emplacement par défaut où cloner un dépôt git", + "config.enableSmartCommit": "Validez toutes les modifications en l'absence de modifications en attente." } \ No newline at end of file diff --git a/i18n/fra/extensions/jake/out/main.i18n.json b/i18n/fra/extensions/jake/out/main.i18n.json index 8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a..4811debb9a3c0a762c6d0a72f4aea0e2bf34d34f 100644 --- a/i18n/fra/extensions/jake/out/main.i18n.json +++ b/i18n/fra/extensions/jake/out/main.i18n.json @@ -3,4 +3,6 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. -{} \ No newline at end of file +{ + "execFailed": "Échec de la détection automatique des tâches Jake avec l'erreur : {0}" +} \ No newline at end of file diff --git a/i18n/fra/extensions/jake/package.i18n.json b/i18n/fra/extensions/jake/package.i18n.json index 8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a..0a21c419d8f279d8f516ad8dac0d08ea22d7dc15 100644 --- a/i18n/fra/extensions/jake/package.i18n.json +++ b/i18n/fra/extensions/jake/package.i18n.json @@ -3,4 +3,6 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. -{} \ No newline at end of file +{ + "config.jake.autoDetect": "Contrôle si la détection automatique des tâches Jake est activée ou désactivée. La valeur par défaut est activée." +} \ No newline at end of file diff --git a/i18n/fra/extensions/markdown/out/extension.i18n.json b/i18n/fra/extensions/markdown/out/extension.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..34001f88bb7eeeb1ffcddc567606734d8afb1b73 --- /dev/null +++ b/i18n/fra/extensions/markdown/out/extension.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "onPreviewStyleLoadError": "Impossible de charger 'markdown.styles' : {0}" +} \ No newline at end of file diff --git a/i18n/fra/extensions/merge-conflict/out/codelensProvider.i18n.json b/i18n/fra/extensions/merge-conflict/out/codelensProvider.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..96643427968faeb08a22f19f2db7dce640e0572e --- /dev/null +++ b/i18n/fra/extensions/merge-conflict/out/codelensProvider.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "acceptCurrentChange": "Accepter la modification actuelle", + "acceptIncomingChange": "Accepter la modification entrante", + "acceptBothChanges": "Accepter les deux modifications", + "compareChanges": "Comparer les modifications" +} \ No newline at end of file diff --git a/i18n/fra/extensions/merge-conflict/out/commandHandler.i18n.json b/i18n/fra/extensions/merge-conflict/out/commandHandler.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..ef10c1f10639d4e84dcad40b52eedc8c5c02eb66 --- /dev/null +++ b/i18n/fra/extensions/merge-conflict/out/commandHandler.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "cursorNotInConflict": "Le curseur de l'éditeur ne se trouve pas dans un conflit de fusion", + "compareChangesTitle": "{0} : Modifications actuelles ⟷ Modifications entrantes", + "cursorOnSplitterRange": "Le curseur de l'éditeur se trouve dans le séparateur du conflit de fusion, déplacez-le dans le bloc \"actuelles\" ou \"entrantes\"", + "noConflicts": "Aucun conflit de fusion dans ce fichier", + "noOtherConflictsInThisFile": "Aucun autre conflit de fusion dans ce fichier" +} \ No newline at end of file diff --git a/i18n/fra/extensions/merge-conflict/out/mergeDecorator.i18n.json b/i18n/fra/extensions/merge-conflict/out/mergeDecorator.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..1dfd58679b3d55fab1bd09eff0f56c15fa06fec2 --- /dev/null +++ b/i18n/fra/extensions/merge-conflict/out/mergeDecorator.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "currentChange": "(Modification actuelle)", + "incomingChange": "(Modification entrante)" +} \ No newline at end of file diff --git a/i18n/fra/extensions/merge-conflict/package.i18n.json b/i18n/fra/extensions/merge-conflict/package.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..6f812b18e76d10b89d44483232704475c66c08d5 --- /dev/null +++ b/i18n/fra/extensions/merge-conflict/package.i18n.json @@ -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. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "command.category": "Conflit de fusion", + "command.accept.all-incoming": "Accepter toutes les modifications entrantes", + "command.accept.all-both": "Accepter les deux", + "command.accept.current": "Accepter les modifications actuelles", + "command.accept.incoming": "Accepter les modifications entrantes", + "command.accept.selection": "Accepter la sélection", + "command.accept.both": "Accepter les deux", + "command.next": "Conflit suivant", + "command.previous": "Conflit précédent", + "command.compare": "Conflit de comparaison des modifications actuelles", + "config.title": "Conflit de fusion", + "config.codeLensEnabled": "Activer/désactiver le bloc CodeLens du conflit de fusion dans l'éditeur", + "config.decoratorsEnabled": "Activer/désactiver les éléments décoratifs du conflit de fusion dans l'éditeur" +} \ No newline at end of file diff --git a/i18n/fra/extensions/npm/package.i18n.json b/i18n/fra/extensions/npm/package.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..df84303decb34d5077f626ca57077bcf98044057 --- /dev/null +++ b/i18n/fra/extensions/npm/package.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "config.npm.autoDetect": "Contrôle si la détection automatique des scripts npm est activée ou désactivée. La valeur par défaut est activée." +} \ No newline at end of file diff --git a/i18n/fra/extensions/typescript/out/features/bufferSyncSupport.i18n.json b/i18n/fra/extensions/typescript/out/features/bufferSyncSupport.i18n.json index 26cde295cd569d229758b325c8136b0093d99696..3187cd8f22f858d10b85ba5fa0bce42b81da5ebd 100644 --- a/i18n/fra/extensions/typescript/out/features/bufferSyncSupport.i18n.json +++ b/i18n/fra/extensions/typescript/out/features/bufferSyncSupport.i18n.json @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "versionMismatch": "Incompatibilité de version ! global tsc ({0}) != Service de langage de VS Code ({1}). Des erreurs de compilation incohérentes risquent de se produire", "moreInformation": "Informations", "doNotCheckAgain": "Ne plus vérifier", "close": "Fermer", diff --git a/i18n/fra/extensions/typescript/out/features/directiveCommentCompletionProvider.i18n.json b/i18n/fra/extensions/typescript/out/features/directiveCommentCompletionProvider.i18n.json index 8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a..052fa717730f136fb1c74252c69460cad24a3510 100644 --- a/i18n/fra/extensions/typescript/out/features/directiveCommentCompletionProvider.i18n.json +++ b/i18n/fra/extensions/typescript/out/features/directiveCommentCompletionProvider.i18n.json @@ -3,4 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. -{} \ No newline at end of file +{ + "ts-check": "Active la vérification sémantique dans un fichier JavaScript. Doit se trouver au début d'un fichier.", + "ts-nocheck": "Désactive la vérification sémantique dans un fichier JavaScript. Doit se trouver au début d'un fichier.", + "ts-ignore": "Supprime les erreurs @ts-check sur la ligne suivante d'un fichier." +} \ No newline at end of file diff --git a/i18n/fra/extensions/typescript/out/utils/projectStatus.i18n.json b/i18n/fra/extensions/typescript/out/utils/projectStatus.i18n.json index 9f6a19db97f04aca55787267f6ec12bf62ef97fe..7890a4f6439a644e107e94106984ac05bf039dfd 100644 --- a/i18n/fra/extensions/typescript/out/utils/projectStatus.i18n.json +++ b/i18n/fra/extensions/typescript/out/utils/projectStatus.i18n.json @@ -6,7 +6,6 @@ { "hintExclude": "Pour activer les fonctionnalités de langage JavaScript/TypeScript à l'échelle du projet, excluez les dossiers contenant de nombreux fichiers, par exemple : {0}", "hintExclude.generic": "Pour activer les fonctionnalités de langage JavaScript/TypeScript à l'échelle du projet, excluez les dossiers volumineux contenant des fichiers sources inutilisés.", - "open": "Configurer les exclusions", "large.label": "Configurer les exclusions", "hintExclude.tooltip": "Pour activer les fonctionnalités de langage JavaScript/TypeScript à l'échelle du projet, excluez les dossiers volumineux contenant des fichiers sources inutilisés." } \ No newline at end of file diff --git a/i18n/fra/extensions/typescript/out/utils/typingsStatus.i18n.json b/i18n/fra/extensions/typescript/out/utils/typingsStatus.i18n.json index d9cc787276c710b3d38bc5a62046a281d60bbf3e..36ca9606c1cf2b9445fa02ffa09fd28bee8b629c 100644 --- a/i18n/fra/extensions/typescript/out/utils/typingsStatus.i18n.json +++ b/i18n/fra/extensions/typescript/out/utils/typingsStatus.i18n.json @@ -5,7 +5,7 @@ // Do not edit this file. It is machine generated. { "installingPackages": "Récupération (fetch) des données pour l'amélioration de TypeScript IntelliSense", - "typesInstallerInitializationFailed.title": "Impossible d'installer des fichiers de typages pour les fonctionnalités du langage JavaScript. Vérifiez que NPM est installé et se trouve dans votre chemin", + "typesInstallerInitializationFailed.title": "Impossible d'installer des fichiers de typages pour les fonctionnalités de langage JavaScript. Vérifiez que NPM est installé ou configurez 'typescript.npm' dans vos paramètres utilisateur", "typesInstallerInitializationFailed.moreInformation": "Informations", "typesInstallerInitializationFailed.doNotCheckAgain": "Ne plus vérifier", "typesInstallerInitializationFailed.close": "Fermer" diff --git a/i18n/fra/extensions/typescript/package.i18n.json b/i18n/fra/extensions/typescript/package.i18n.json index d60399d9b5bde5d278c5d6e7479f0582dc49ec64..53c76f9a4c4e5221e060808881cdcc29593d6c70 100644 --- a/i18n/fra/extensions/typescript/package.i18n.json +++ b/i18n/fra/extensions/typescript/package.i18n.json @@ -13,7 +13,6 @@ "typescript.check.tscVersion": "Vérifiez si un compilateur TypeScript installé globalement (par exemple tsc) est différent du service de langage TypeScript.", "typescript.tsserver.log": "Active la journalisation du serveur TS dans un fichier. Ce journal peut être utilisé pour diagnostiquer les problèmes du serveur TS. Il peut contenir des chemins de fichier, du code source et d'autres informations potentiellement sensibles de votre projet.", "typescript.tsserver.trace": "Active le traçage des messages envoyés au serveur TS. Cette trace peut être utilisée pour diagnostiquer les problèmes du serveur TS. Elle peut contenir des chemins de fichier, du code source et d'autres informations potentiellement sensibles de votre projet.", - "typescript.tsserver.experimentalAutoBuild": "Active la build automatique expérimentale. Nécessite la version 1.9 dev ou 2.x tsserver et le redémarrage du code VS une fois celui-ci modifié.", "typescript.validate.enable": "Activez/désactivez la validation TypeScript.", "typescript.format.enable": "Activez/désactivez le formateur TypeScript par défaut.", "javascript.format.enable": "Activez/désactivez le formateur JavaScript par défaut.", @@ -33,9 +32,16 @@ "javascript.validate.enable": "Activez/désactivez la validation JavaScript.", "typescript.goToProjectConfig.title": "Accéder à la configuration du projet", "javascript.goToProjectConfig.title": "Accéder à la configuration du projet", + "javascript.referencesCodeLens.enabled": "Activez/désactivez les références CodeLens dans les fichiers JavaScript.", + "typescript.referencesCodeLens.enabled": "Activez/désactivez les références CodeLens dans les fichiers TypeScript. Nécessite TypeScript >= 2.0.6.", "typescript.implementationsCodeLens.enabled": "Activer/désactiver CodeLens dans les implémentations. Nécessite TypeScript >= 2.2.0.", + "typescript.openTsServerLog.title": "Ouvrir le journal du serveur TS", + "typescript.restartTsServer": "Redémarrer le serveur TS", "typescript.selectTypeScriptVersion.title": "Sélectionner la version de TypeScript", "jsDocCompletion.enabled": "Activer/désactiver les commentaires JSDoc automatiques", "javascript.implicitProjectConfig.checkJs": "Activer/désactiver la vérification sémantique des fichiers JavaScript. Les fichiers jsconfig.json ou tsconfig.json existants remplacent ce paramètre. Nécessite TypeScript >=2.3.1.", - "typescript.check.npmIsInstalled": "Vérifie si NPM est installé pour l'acquisition automatique des typages" + "typescript.npm": "Spécifie le chemin de l'exécutable NPM utilisé pour l'acquisition de type automatique. Nécessite TypeScript >= 2.3.4.", + "typescript.check.npmIsInstalled": "Vérifie si NPM est installé pour l'acquisition de type automatique.", + "javascript.nameSuggestions": "Activez/désactivez l'inclusion de noms uniques à partir du fichier dans les listes de suggestions JavaScript.", + "typescript.tsc.autoDetect": "Contrôle si la détection automatique des tâches tsc est activée ou désactivée." } \ No newline at end of file diff --git a/i18n/fra/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json b/i18n/fra/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json index d6968482f68eb92b583a3757d9fcf0410f5586f2..e5800681aa3076a94687a476f88c6eff758aaaf9 100644 --- a/i18n/fra/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json +++ b/i18n/fra/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json @@ -6,8 +6,7 @@ { "imgMeta": "{0}x{1} {2}", "largeImageError": "L'image est trop grande pour être affichée dans l'éditeur. ", - "resourceOpenExternalButton": "Ouvrir l'image", - "resourceOpenExternalText": " en utilisant un programme externe ?", + "resourceOpenExternalButton": " Ouvrir l'image en utilisant un programme externe ?", "nativeBinaryError": "Impossible d'afficher le fichier dans l'éditeur : soit il est binaire, soit il est très volumineux, soit il utilise un encodage de texte non pris en charge.", "sizeB": "{0} o", "sizeKB": "{0} Ko", diff --git a/i18n/fra/src/vs/base/common/errorMessage.i18n.json b/i18n/fra/src/vs/base/common/errorMessage.i18n.json index 0276e51a4a05106da2693d6559a4a6c2e553bc4e..4871401845f6e2be632a7c2dd1bdf2ea720708c1 100644 --- a/i18n/fra/src/vs/base/common/errorMessage.i18n.json +++ b/i18n/fra/src/vs/base/common/errorMessage.i18n.json @@ -13,6 +13,5 @@ "error.connection.unknown": "Une erreur de connexion inconnue s'est produite. Soit vous n'êtes plus connecté à Internet, soit le serveur auquel vous êtes connecté est hors connexion.", "stackTrace.format": "{0} : {1}", "error.defaultMessage": "Une erreur inconnue s’est produite. Veuillez consulter le journal pour plus de détails.", - "nodeExceptionMessage": "Une erreur système s'est produite ({0})", "error.moreErrors": "{0} ({1} erreurs au total)" } \ No newline at end of file diff --git a/i18n/fra/src/vs/base/common/keybindingLabels.i18n.json b/i18n/fra/src/vs/base/common/keybindingLabels.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a --- /dev/null +++ b/i18n/fra/src/vs/base/common/keybindingLabels.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{} \ No newline at end of file diff --git a/i18n/fra/src/vs/code/electron-main/menus.i18n.json b/i18n/fra/src/vs/code/electron-main/menus.i18n.json index 767d8088cca7dc949568abc890792460cce56111..15083213d9a101812597854e32d26a7a17d6f58a 100644 --- a/i18n/fra/src/vs/code/electron-main/menus.i18n.json +++ b/i18n/fra/src/vs/code/electron-main/menus.i18n.json @@ -14,6 +14,7 @@ "mHelp": "&&Aide", "miNewWindow": "Nouvelle &&fenêtre", "mAbout": "À propos de {0}", + "mServices": "Services", "mHide": "Masquer {0}", "mHideOthers": "Masquer les autres", "mShowAll": "Afficher tout", @@ -54,6 +55,9 @@ "miShowEmmetCommands": "E&&mmet...", "miToggleLineComment": "Afficher/masquer le commen&&taire de ligne", "miToggleBlockComment": "Afficher/masquer le commentaire de &&bloc", + "miMultiCursorAlt": "Utiliser Alt+Clic pour l'option multicurseur", + "miMultiCursorCmd": "Utiliser Cmd+Clic pour l'option multicurseur", + "miMultiCursorCtrl": "Utiliser Ctrl+Clic pour l'option multicurseur", "miInsertCursorAbove": "&&Ajouter un curseur au-dessus", "miInsertCursorBelow": "Aj&&outer un curseur en dessous", "miInsertCursorAtEndOfEachLineSelected": "Ajouter des c&&urseurs à la fin des lignes", @@ -69,6 +73,7 @@ "miSmartSelectShrink": "&&Réduire la sélection", "miViewExplorer": "&&Explorateur", "miViewSearch": "&&Rechercher", + "miViewSCM": "S&&CM", "miViewDebug": "&&Déboguer", "miViewExtensions": "E&&xtensions", "miToggleOutput": "&&Sortie", @@ -113,6 +118,8 @@ "miGotoSymbolInFile": "Atteindre le &&symbole dans le fichier...", "miGotoSymbolInWorkspace": "Atteindre le symbole dans l'espace de &&travail...", "miGotoDefinition": "Atteindre la &&définition", + "miGotoTypeDefinition": "Accéder à la définition de &&type", + "miGotoImplementation": "Accéder à l'&&implémentation", "miGotoLine": "Atteindre la &&ligne...", "miStartDebugging": "&&Démarrer le débogage", "miStartWithoutDebugging": "Démarrer &&sans débogage", @@ -129,16 +136,17 @@ "miColumnBreakpoint": "P&&oint d'arrêt de la colonne", "miFunctionBreakpoint": "Point d'arrêt sur &&fonction...", "miNewBreakpoint": "&&Nouveau point d'arrêt", + "miEnableAllBreakpoints": "Activer tous les points d'arrêt", "miDisableAllBreakpoints": "Désacti&&ver tous les points d'arrêt", "miRemoveAllBreakpoints": "Supprimer &&tous les points d'arrêt", "miInstallAdditionalDebuggers": "&&Installer des débogueurs supplémentaires...", "mMinimize": "Réduire", - "mClose": "Fermer", "mBringToFront": "Mettre tout au premier plan", "miToggleDevTools": "Activer/désactiver les ou&&tils de développement", "miAccessibilityOptions": "&&Options d'accessibilité", "miReportIssues": "S&&ignaler les problèmes", "miWelcome": "&&Bienvenue", + "miInteractivePlayground": "Terrain de jeu &&interactif", "miDocumentation": "&&Documentation", "miReleaseNotes": "Notes de pu&&blication", "miKeyboardShortcuts": "Référence des racco&&urcis clavier", @@ -148,6 +156,8 @@ "miLicense": "Affic&&her la licence", "miPrivacyStatement": "Déc&&laration de confidentialité", "miAbout": "À pr&&opos de", + "miTerminateTask": "&&Terminer la tâche", + "accessibilityOptionsWindowTitle": "Options d'accessibilité", "miRestartToUpdate": "Redémarrer pour mettre à jour...", "miCheckingForUpdates": "Recherche des mises à jour...", "miDownloadUpdate": "Télécharger la mise à jour disponible", diff --git a/i18n/fra/src/vs/code/electron-main/windows.i18n.json b/i18n/fra/src/vs/code/electron-main/windows.i18n.json index 7893fb77cc30afbaab8b1474cc2e036f8bf8482d..b1abddadd2442c3c5a7844186995f37338c38a9f 100644 --- a/i18n/fra/src/vs/code/electron-main/windows.i18n.json +++ b/i18n/fra/src/vs/code/electron-main/windows.i18n.json @@ -7,16 +7,11 @@ "ok": "OK", "pathNotExistTitle": "Le chemin d'accès n'existe pas", "pathNotExistDetail": "Le chemin d'accès '{0}' ne semble plus exister sur le disque.", - "accessibilityOptionsWindowTitle": "Options d'accessibilité", "reopen": "Rouvrir", "wait": "Continuer à attendre", "close": "Fermer", "appStalled": "La fenêtre ne répond plus", "appStalledDetail": "Vous pouvez rouvrir ou fermer la fenêtre, ou continuer à patienter.", "appCrashed": "La fenêtre s'est bloquée", - "appCrashedDetail": "Nous vous prions de nous excuser pour ce désagrément. Vous pouvez rouvrir la fenêtre pour reprendre l'action au moment où elle a été interrompue.", - "newWindow": "Nouvelle fenêtre", - "newWindowDesc": "Ouvre une nouvelle fenêtre", - "recentFolders": "Dossiers récents", - "folderDesc": "{0} {1}" + "appCrashedDetail": "Nous vous prions de nous excuser pour ce désagrément. Vous pouvez rouvrir la fenêtre pour reprendre l'action au moment où elle a été interrompue." } \ No newline at end of file diff --git a/i18n/fra/src/vs/editor/common/config/commonEditorConfig.i18n.json b/i18n/fra/src/vs/editor/common/config/commonEditorConfig.i18n.json index afe0864b817defa43c09cc8f2675d8c6764fe839..a6f12dfbce141f5f6067314bd58ad7db21468889 100644 --- a/i18n/fra/src/vs/editor/common/config/commonEditorConfig.i18n.json +++ b/i18n/fra/src/vs/editor/common/config/commonEditorConfig.i18n.json @@ -23,6 +23,8 @@ "minimap.enabled": "Contrôle si la minicarte est affichée", "minimap.renderCharacters": "Afficher les caractères réels sur une ligne (par opposition aux blocs de couleurs)", "minimap.maxColumn": "Limiter la largeur de la minicarte pour afficher au maximum un certain nombre de colonnes", + "find.seedSearchStringFromSelection": "Contrôle si nous remplissons la chaîne à rechercher dans le Widget Recherche à partir de la sélection de l'éditeur", + "find.autoFindInSelection": "Contrôle si l'indicateur Rechercher dans la sélection est activé quand plusieurs caractères ou lignes de texte sont sélectionnés dans l'éditeur", "wordWrap.off": "Le retour automatique à la ligne n'est jamais effectué.", "wordWrap.on": "Le retour automatique à la ligne s'effectue en fonction de la largeur de la fenêtre d'affichage.", "wordWrap.wordWrapColumn": "Le retour automatique à la ligne s'effectue en fonction de 'editor.wordWrapColumn'.", @@ -31,17 +33,19 @@ "wordWrapColumn": "Contrôle la colonne de retour automatique à la ligne de l'éditeur quand 'editor.wordWrap' a la valeur 'wordWrapColumn' ou 'bounded'.", "wrappingIndent": "Contrôle le retrait des lignes renvoyées. La valeur peut être 'none', 'same' ou 'indent'.", "mouseWheelScrollSensitivity": "Multiplicateur à utiliser pour le 'deltaX' et le 'deltaY' des événements de défilement de la roulette de la souris", + "multiCursorModifier.ctrlCmd": "Mappe vers 'Contrôle' dans Windows et Linux, et vers 'Commande' dans OSX.", + "multiCursorModifier.alt": "Mappe vers 'Alt' dans Windows et Linux, et vers 'Option' dans OSX.", + "multiCursorModifier": "Modificateur à utiliser pour ajouter plusieurs curseurs avec la souris. 'ctrlCmd' mappe vers 'Contrôle' dans Windows et Linux, et vers 'Commande' dans OSX. Les mouvements de souris Accéder à la définition et Ouvrir le lien s'adaptent pour ne pas entrer en conflit avec le modificateur multicurseur.", "quickSuggestions.strings": "Activez les suggestions rapides dans les chaînes.", "quickSuggestions.comments": "Activez les suggestions rapides dans les commentaires.", "quickSuggestions.other": "Activez les suggestions rapides en dehors des chaînes et des commentaires.", "quickSuggestions": "Contrôle si les suggestions doivent s'afficher automatiquement en cours de frappe", "quickSuggestionsDelay": "Contrôle le délai en ms au bout duquel les suggestions rapides s'affichent", - "parameterHints": "Active les indicateurs de paramètres", "autoClosingBrackets": "Contrôle si l'éditeur doit automatiquement fermer les crochets après les avoir ouverts", "formatOnType": "Contrôle si l'éditeur doit automatiquement mettre en forme la ligne après la saisie", "formatOnPaste": "Contrôle si l'éditeur doit automatiquement mettre en forme le contenu collé. Un formateur doit être disponible et doit pouvoir mettre en forme une plage dans un document.", "suggestOnTriggerCharacters": "Contrôle si les suggestions doivent s'afficher automatiquement durant la saisie de caractères de déclenchement", - "acceptSuggestionOnEnter": "Contrôle si les suggestions peuvent être acceptées avec Entrée (en plus de Tab). Cela permet d'éviter toute ambiguïté entre l'insertion de nouvelles lignes et l'acceptation de suggestions.", + "acceptSuggestionOnEnter": "Contrôle si les suggestions doivent être acceptées avec 'Entrée', en plus de 'Tab'. Cela permet d'éviter toute ambiguïté entre l'insertion de nouvelles lignes et l'acceptation de suggestions. La valeur 'smart' signifie que vous acceptez uniquement une suggestion avec Entrée quand elle applique une modification de texte", "acceptSuggestionOnCommitCharacter": "Contrôle si les suggestions doivent être acceptées avec des caractères de validation. Par exemple, en JavaScript, le point-virgule (';') peut être un caractère de validation qui permet d'accepter une suggestion et de taper ce caractère.", "snippetSuggestions": "Contrôle si les extraits de code s'affichent en même temps que d'autres suggestions, ainsi que leur mode de tri.", "emptySelectionClipboard": "Contrôle si la copie sans sélection permet de copier la ligne actuelle.", @@ -63,12 +67,17 @@ "renderLineHighlight": "Contrôle la façon dont l'éditeur doit afficher la surbrillance de la ligne active. Les différentes possibilités sont 'none', 'gutter', 'line' et 'all'.", "codeLens": "Contrôle si l'éditeur affiche les indicateurs CodeLens", "folding": "Contrôle si le pliage de code est activé dans l'éditeur", + "showFoldingControls": "Définit si les contrôles de réduction sur la bordure sont cachés automatiquement", "matchBrackets": "Met en surbrillance les crochets correspondants quand l'un d'eux est sélectionné.", "glyphMargin": "Contrôle si l'éditeur doit afficher la marge de glyphes verticale. La marge de glyphes sert principalement au débogage.", "useTabStops": "L'insertion et la suppression d'un espace blanc suit les taquets de tabulation", "trimAutoWhitespace": "Supprimer l'espace blanc de fin inséré automatiquement", "stablePeek": "Garder les éditeurs d'aperçu ouverts même si l'utilisateur double-clique sur son contenu ou appuie sur la touche Échap.", "dragAndDrop": "Contrôle si l'éditeur autorise le déplacement des sélections par glisser-déplacer.", + "accessibilitySupport.auto": "L'éditeur utilise les API de la plateforme pour détecter si un lecteur d'écran est attaché.", + "accessibilitySupport.on": "L'éditeur est optimisé en permanence pour une utilisation avec un lecteur d'écran.", + "accessibilitySupport.off": "L'éditeur n'est jamais optimisé pour une utilisation avec un lecteur d'écran.", + "accessibilitySupport": "Contrôle si l'éditeur doit s'exécuter dans un mode optimisé pour les lecteurs d'écran.", "sideBySide": "Contrôle si l'éditeur de différences affiche les différences en mode côte à côte ou inline", "ignoreTrimWhitespace": "Contrôle si l'éditeur de différences affiche les changements liés aux espaces blancs de début ou de fin comme des différences", "renderIndicators": "Contrôle si l'éditeur de différences affiche les indicateurs +/- pour les modifications ajoutées/supprimées", diff --git a/i18n/fra/src/vs/editor/common/config/editorOptions.i18n.json b/i18n/fra/src/vs/editor/common/config/editorOptions.i18n.json index bf45d0601aaa9d50b335a7ca41849cfdc5bafbc8..452e3e365b7d60f1a4a57bf166cab1e123d46818 100644 --- a/i18n/fra/src/vs/editor/common/config/editorOptions.i18n.json +++ b/i18n/fra/src/vs/editor/common/config/editorOptions.i18n.json @@ -4,5 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "accessibilityOffAriaLabel": "L'éditeur n'est pas accessible pour le moment. Appuyez sur Alt+F1 pour connaître les options.", "editorViewAccessibleLabel": "Contenu d'éditeur" } \ No newline at end of file diff --git a/i18n/fra/src/vs/editor/common/view/editorColorRegistry.i18n.json b/i18n/fra/src/vs/editor/common/view/editorColorRegistry.i18n.json index 77ca0b5bb8ff88c52dc531f32296f8638354ac6d..0025ed5f438c38e1e5fac3f4f0491b15e2de1973 100644 --- a/i18n/fra/src/vs/editor/common/view/editorColorRegistry.i18n.json +++ b/i18n/fra/src/vs/editor/common/view/editorColorRegistry.i18n.json @@ -16,5 +16,9 @@ "editorBracketMatchBackground": "Couleur d'arrière-plan pour les accolades associées", "editorBracketMatchBorder": "Couleur pour le contour des accolades associées", "editorOverviewRulerBorder": "Couleur de la bordure de la règle d'apperçu.", - "editorGutter": "Couleur de fond pour la bordure de l'éditeur. La bordure contient les marges pour les symboles et les numéros de ligne." + "editorGutter": "Couleur de fond pour la bordure de l'éditeur. La bordure contient les marges pour les symboles et les numéros de ligne.", + "errorForeground": "Couleur de premier plan de la ligne ondulée marquant les erreurs dans l'éditeur.", + "errorBorder": "Couleur de bordure de la ligne ondulée marquant les erreurs dans l'éditeur.", + "warningForeground": "Couleur de premier plan de la ligne ondulée marquant les avertissements dans l'éditeur.", + "warningBorder": "Couleur de bordure de la ligne ondulée marquant les avertissements dans l'éditeur." } \ No newline at end of file diff --git a/i18n/fra/src/vs/editor/contrib/find/common/findController.i18n.json b/i18n/fra/src/vs/editor/contrib/find/common/findController.i18n.json index 83dcc17be9b65b0f1efffb850c1204898e878473..255c5de5a2793e2940e86dfb64c718e43badfc6a 100644 --- a/i18n/fra/src/vs/editor/contrib/find/common/findController.i18n.json +++ b/i18n/fra/src/vs/editor/contrib/find/common/findController.i18n.json @@ -14,6 +14,5 @@ "addSelectionToPreviousFindMatch": "Ajouter la sélection à la correspondance de recherche précédente", "moveSelectionToNextFindMatch": "Déplacer la dernière sélection vers la correspondance de recherche suivante", "moveSelectionToPreviousFindMatch": "Déplacer la dernière sélection à la correspondance de recherche précédente", - "selectAllOccurencesOfFindMatch": "Sélectionner toutes les occurrences des correspondances de la recherche", "changeAll.label": "Modifier toutes les occurrences" } \ No newline at end of file diff --git a/i18n/fra/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.i18n.json b/i18n/fra/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..0488ff48354592dc8b07785813b92c5155778fbc --- /dev/null +++ b/i18n/fra/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.i18n.json @@ -0,0 +1,23 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "noResultWord": "Définition introuvable pour '{0}'", + "generic.noResults": "Définition introuvable", + "meta.title": " – {0} définitions", + "actions.goToDecl.label": "Atteindre la définition", + "actions.goToDeclToSide.label": "Ouvrir la définition sur le côté", + "actions.previewDecl.label": "Apercu de définition", + "goToImplementation.noResultWord": "Implémentation introuvable pour '{0}'", + "goToImplementation.generic.noResults": "Implémentation introuvable", + "meta.implementations.title": "– Implémentations {0}", + "actions.goToImplementation.label": "Accéder à l'implémentation", + "actions.peekImplementation.label": "Aperçu de l'implémentation", + "goToTypeDefinition.noResultWord": "Définition de type introuvable pour '{0}'", + "goToTypeDefinition.generic.noResults": "Définition de type introuvable", + "meta.typeDefinitions.title": " – Définitions de type {0}", + "actions.goToTypeDefinition.label": "Atteindre la définition de type", + "actions.peekTypeDefinition.label": "Aperçu de la définition du type" +} \ No newline at end of file diff --git a/i18n/fra/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.i18n.json b/i18n/fra/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..247bd9d24da5dd200ceed48268f446f11030215c --- /dev/null +++ b/i18n/fra/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "multipleResults": "Cliquez pour afficher {0} définitions." +} \ No newline at end of file diff --git a/i18n/fra/src/vs/editor/contrib/links/browser/links.i18n.json b/i18n/fra/src/vs/editor/contrib/links/browser/links.i18n.json index f16f0098955940da182256c4a1d81ff3e05cd2e1..3b71097e7dfb4b445cd77650a7a4b5b909e38c18 100644 --- a/i18n/fra/src/vs/editor/contrib/links/browser/links.i18n.json +++ b/i18n/fra/src/vs/editor/contrib/links/browser/links.i18n.json @@ -6,6 +6,7 @@ { "links.navigate.mac": "Commande + clic pour suivre le lien", "links.navigate": "Ctrl + clic pour suivre le lien", + "links.navigate.al": "Alt + clic pour suivre le lien", "invalid.url": "Échec de l'ouverture de ce lien, car il n'est pas bien formé : {0}", "missing.url": "Échec de l'ouverture de ce lien, car sa cible est manquante.", "label": "Ouvrir le lien" diff --git a/i18n/fra/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json b/i18n/fra/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json index e4871d36b8975d026dfdcefc767c090b981d4bc9..733dbb088ce67fa41a6ce22c0da5b345e4381c58 100644 --- a/i18n/fra/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json +++ b/i18n/fra/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json @@ -5,8 +5,6 @@ // Do not edit this file. It is machine generated. { "aria.oneReference": "symbole dans {0} sur la ligne {1}, colonne {2}", - "aria.fileReferences.1": "1 symbole dans {0}", - "aria.fileReferences.N": "{0} symboles dans {1}", "aria.result.0": "Résultats introuvables", "aria.result.1": "1 symbole dans {0}", "aria.result.n1": "{0} symboles dans {1}", diff --git a/i18n/fra/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.i18n.json b/i18n/fra/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.i18n.json index b2ba0b9ad35f00b62fdcb900d0c7f980860f9f62..498b3551c287b1812583939421e865cb8189872f 100644 --- a/i18n/fra/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.i18n.json +++ b/i18n/fra/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.i18n.json @@ -16,9 +16,12 @@ "peekViewTitleInfoForeground": "Couleur des informations sur le titre de l'affichage d'aperçu.", "peekViewBorder": "Couleur des bordures et de la flèche de l'affichage d'aperçu.", "peekViewResultsBackground": "Couleur d'arrière-plan de la liste des résultats de l'affichage d'aperçu.", + "peekViewResultsMatchForeground": "Couleur de premier plan des noeuds de lignes dans la liste des résultats de l'affichage d'aperçu.", + "peekViewResultsFileForeground": "Couleur de premier plan des noeuds de fichiers dans la liste des résultats de l'affichage d'aperçu.", "peekViewResultsSelectionBackground": "Couleur d'arrière-plan de l'entrée sélectionnée dans la liste des résultats de l'affichage d'aperçu.", "peekViewResultsSelectionForeground": "Couleur de premier plan de l'entrée sélectionnée dans la liste des résultats de l'affichage d'aperçu.", "peekViewEditorBackground": "Couleur d'arrière-plan de l'éditeur d'affichage d'aperçu.", + "peekViewEditorGutterBackground": "Couleur d'arrière-plan de la bordure de l'éditeur d'affichage d'aperçu.", "peekViewResultsMatchHighlight": "Couleur de mise en surbrillance d'une correspondance dans la liste des résultats de l'affichage d'aperçu.", "peekViewEditorMatchHighlight": "Couleur de mise en surbrillance d'une correspondance dans l'éditeur de l'affichage d'aperçu." } \ No newline at end of file diff --git a/i18n/fra/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json b/i18n/fra/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json index e38b8d1bf14ed851561b445ae63135aa69f88b4c..75285eb257ef9c364daceb563098b38cd16141ee 100644 --- a/i18n/fra/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json +++ b/i18n/fra/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json @@ -12,6 +12,7 @@ "readMore": "En savoir plus...{0}", "suggestionWithDetailsAriaLabel": "{0}, suggestion, avec détails", "suggestionAriaLabel": "{0}, suggestion", + "readLess": "En savoir moins...{0}", "suggestWidget.loading": "Chargement...", "suggestWidget.noSuggestions": "Pas de suggestions.", "suggestionAriaAccepted": "{0}, accepté", diff --git a/i18n/fra/src/vs/platform/actions/electron-browser/menusExtensionPoint.i18n.json b/i18n/fra/src/vs/platform/actions/electron-browser/menusExtensionPoint.i18n.json index 315671f3b2287299b875172eba757127c67dd017..4ec0caa12c157c34be7be12bed96c08488348d5c 100644 --- a/i18n/fra/src/vs/platform/actions/electron-browser/menusExtensionPoint.i18n.json +++ b/i18n/fra/src/vs/platform/actions/electron-browser/menusExtensionPoint.i18n.json @@ -21,6 +21,8 @@ "menus.scmTitle": "Menu du titre du contrôle de code source", "menus.resourceGroupContext": "Menu contextuel du groupe de ressources du contrôle de code source", "menus.resourceStateContext": "Menu contextuel de l'état des ressources du contrôle de code source", + "view.viewTitle": "Menu de titre de la vue ajoutée", + "view.itemContext": "Menu contextuel de l'élément de vue ajoutée", "nonempty": "valeur non vide attendue.", "opticon": "la propriété 'icon' peut être omise, ou bien elle doit être une chaîne ou un littéral tel que '{dark, light}'", "requireStringOrObject": "la propriété `{0}` est obligatoire et doit être de type `string` ou `object`", diff --git a/i18n/fra/src/vs/platform/extensions/common/extensionsRegistry.i18n.json b/i18n/fra/src/vs/platform/extensions/common/extensionsRegistry.i18n.json index 23d586b47fb7379cc69a325c038938d953f59bbb..1b99c644dbbe3e0316febd9904a038d990f38f9b 100644 --- a/i18n/fra/src/vs/platform/extensions/common/extensionsRegistry.i18n.json +++ b/i18n/fra/src/vs/platform/extensions/common/extensionsRegistry.i18n.json @@ -14,6 +14,12 @@ "vscode.extension.contributes": "Toutes les contributions de l'extension VS Code représentées par ce package.", "vscode.extension.preview": "Définit l'extension à marquer en tant que préversion dans Marketplace.", "vscode.extension.activationEvents": "Événements d'activation pour l'extension VS Code.", + "vscode.extension.activationEvents.onLanguage": "Événement d'activation envoyé quand un fichier résolu dans le langage spécifié est ouvert.", + "vscode.extension.activationEvents.onCommand": "Événement d'activation envoyé quand la commande spécifiée est appelée.", + "vscode.extension.activationEvents.onDebug": "Événement d'activation envoyé quand une session de débogage du type spécifié est démarrée.", + "vscode.extension.activationEvents.workspaceContains": "Événement d'activation envoyé quand un dossier ouvert contient au moins un fichier correspondant au modèle glob spécifié.", + "vscode.extension.activationEvents.onView": "Événement d'activation envoyé quand la vue spécifiée est développée.", + "vscode.extension.activationEvents.star": "Événement d'activation envoyé au démarrage de VS Code. Pour garantir la qualité de l'expérience utilisateur, utilisez cet événement d'activation dans votre extension uniquement quand aucune autre combinaison d'événements d'activation ne fonctionne dans votre cas d'utilisation.", "vscode.extension.badges": "Ensemble de badges à afficher dans la barre latérale de la page d'extensions de Marketplace.", "vscode.extension.badges.url": "URL de l'image du badge.", "vscode.extension.badges.href": "Lien du badge.", diff --git a/i18n/fra/src/vs/platform/history/electron-main/historyMainService.i18n.json b/i18n/fra/src/vs/platform/history/electron-main/historyMainService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..316d8cd9473a975fdb09b6956dac643b0fb40855 --- /dev/null +++ b/i18n/fra/src/vs/platform/history/electron-main/historyMainService.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "newWindow": "Nouvelle fenêtre", + "newWindowDesc": "Ouvre une nouvelle fenêtre", + "recentFolders": "Dossiers récents", + "folderDesc": "{0} {1}" +} \ No newline at end of file diff --git a/i18n/fra/src/vs/platform/markers/common/problemMatcher.i18n.json b/i18n/fra/src/vs/platform/markers/common/problemMatcher.i18n.json index 985f7884334ddc391b9f3a1e8ceb19186f38d778..42756c8837cf13a76dc460031f06edfa2e6576e2 100644 --- a/i18n/fra/src/vs/platform/markers/common/problemMatcher.i18n.json +++ b/i18n/fra/src/vs/platform/markers/common/problemMatcher.i18n.json @@ -34,6 +34,7 @@ "ProblemMatcherParser.noValidIdentifier": "Erreur : la propriété de modèle {0} n'est pas un nom de variable de modèle valide.", "ProblemMatcherParser.problemPattern.watchingMatcher": "Un détecteur de problèmes de correspondance doit définir un modèle de début et un modèle de fin à observer.", "ProblemMatcherParser.invalidRegexp": "Erreur : la chaîne {0} est une expression régulière non valide.\n", + "WatchingPatternSchema.regexp": "Expression régulière permettant de détecter le début ou la fin d'une tâche en arrière-plan.", "WatchingPatternSchema.file": "Index de groupe de correspondance du nom de fichier. Peut être omis.", "PatternTypeSchema.name": "Nom d'un modèle faisant l'objet d'une contribution ou prédéfini", "PatternTypeSchema.description": "Modèle de problème ou bien nom d'un modèle de problème faisant l'objet d'une contribution ou prédéfini. Peut être omis si base est spécifié.", @@ -42,6 +43,12 @@ "ProblemMatcherSchema.severity": "Gravité par défaut des problèmes de capture. Est utilisé si le modèle ne définit aucun groupe de correspondance pour la gravité.", "ProblemMatcherSchema.applyTo": "Contrôle si un problème signalé pour un document texte s'applique uniquement aux documents ouverts ou fermés, ou bien à l'ensemble des documents.", "ProblemMatcherSchema.fileLocation": "Définit la façon dont les noms de fichiers signalés dans un modèle de problème doivent être interprétés.", + "ProblemMatcherSchema.background": "Modèles de suivi du début et de la fin d'un détecteur de problèmes de correspondance actif sur une tâche en arrière-plan.", + "ProblemMatcherSchema.background.activeOnStart": "Si la valeur est true, le moniteur d'arrière-plan est actif au démarrage de la tâche. Cela revient à envoyer une ligne qui correspond à beginPattern", + "ProblemMatcherSchema.background.beginsPattern": "En cas de correspondance dans la sortie, le début d'une tâche en arrière-plan est signalé.", + "ProblemMatcherSchema.background.endsPattern": "En cas de correspondance dans la sortie, la fin d'une tâche en arrière-plan est signalée.", + "ProblemMatcherSchema.watching.deprecated": "La propriété espion est déconseillée. Utilisez l'arrière-plan à la place.", + "ProblemMatcherSchema.watching": "Modèles de suivi du début et de la fin d'un détecteur de problèmes de correspondance espion.", "ProblemMatcherSchema.watching.activeOnStart": "Si la valeur est true, le mode espion est actif au démarrage de la tâche. Cela revient à émettre une ligne qui correspond à beginPattern", "ProblemMatcherSchema.watching.beginsPattern": "En cas de correspondance dans la sortie, le début d'une tâche de suivi est signalé.", "ProblemMatcherSchema.watching.endsPattern": "En cas de correspondance dans la sortie, la fin d'une tâche de suivi est signalée.", diff --git a/i18n/fra/src/vs/platform/theme/common/colorRegistry.i18n.json b/i18n/fra/src/vs/platform/theme/common/colorRegistry.i18n.json index 4977fe04f0ba54e5b4f5a86121620c85d0bf6e9b..5d206ed6b986e218eac66bbb71ed554b6e1d6940 100644 --- a/i18n/fra/src/vs/platform/theme/common/colorRegistry.i18n.json +++ b/i18n/fra/src/vs/platform/theme/common/colorRegistry.i18n.json @@ -16,11 +16,15 @@ "textLinkForeground": "Couleur des liens dans le texte.", "textLinkActiveForeground": "Couleur des liens actifs dans le texte.", "textPreformatForeground": "Couleur des segments de texte préformatés.", + "textBlockQuoteBackground": "Couleur d'arrière-plan des citations dans le texte.", + "textBlockQuoteBorder": "Couleur de bordure des citations dans le texte.", + "textCodeBlockBackground": "Couleur d'arrière-plan des blocs de code dans le texte.", "widgetShadow": "Couleur de l'ombre des widgets, comme rechercher/remplacer, au sein de l'éditeur.", "inputBoxBackground": "Arrière-plan de la zone d'entrée.", "inputBoxForeground": "Premier plan de la zone d'entrée.", "inputBoxBorder": "Bordure de la zone d'entrée.", "inputBoxActiveOptionBorder": "Couleur de la bordure des options activées dans les champs d'entrée.", + "inputPlaceholderForeground": "Couleur de premier plan de la zone d'entrée pour le texte d'espace réservé.", "inputValidationInfoBackground": "Couleur d'arrière-plan de la validation d'entrée pour la gravité des informations.", "inputValidationInfoBorder": "Couleur de bordure de la validation d'entrée pour la gravité des informations.", "inputValidationWarningBackground": "Couleur d'arrière-plan de la validation d'entrée pour l'avertissement sur les informations.", @@ -31,10 +35,13 @@ "dropdownForeground": "Premier plan de la liste déroulante.", "dropdownBorder": "Bordure de la liste déroulante.", "listFocusBackground": "Couleur d'arrière-plan de la liste/l'arborescence pour l'élément ayant le focus quand la liste/l'arborescence est active. Une liste/aborescence active peut être sélectionnée au clavier, elle ne l'est pas quand elle est inactive.", + "listFocusForeground": "Couleur de premier plan de la liste/l'arborescence pour l'élément ayant le focus quand la liste/l'arborescence est active. Une liste/aborescence active peut être sélectionnée au clavier, elle ne l'est pas quand elle est inactive.", "listActiveSelectionBackground": "Couleur d'arrière-plan de la liste/l'arborescence de l'élément sélectionné quand la liste/l'arborescence est active. Une liste/arborescence active peut être sélectionnée au clavier, elle ne l'est pas quand elle est inactive.", "listActiveSelectionForeground": "Couleur de premier plan de la liste/l'arborescence pour l'élément sélectionné quand la liste/l'arborescence est active. Une liste/aborescence active peut être sélectionnée au clavier, elle ne l'est pas quand elle est inactive.", "listInactiveSelectionBackground": "Couleur d'arrière-plan de la liste/l'arborescence pour l'élément sélectionné quand la liste/l'arborescence est inactive. Une liste/aborescence active peut être sélectionnée au clavier, elle ne l'est pas quand elle est inactive.", + "listInactiveSelectionForeground": "Couleur de premier plan de la liste/l'arborescence pour l'élément sélectionné quand la liste/l'arborescence est active. Une liste/aborescence active peut être sélectionnée au clavier, elle ne l'est pas quand elle est inactive.", "listHoverBackground": "Arrière-plan de la liste/l'arborescence pendant le pointage sur des éléments avec la souris.", + "listHoverForeground": "Premier plan de la liste/l'arborescence pendant le pointage sur des éléments avec la souris.", "listDropBackground": "Arrière-plan de l'opération de glisser-déplacer dans une liste/arborescence pendant le déplacement d'éléments avec la souris.", "highlight": "Couleur de premier plan dans la liste/l'arborescence pour la surbrillance des correspondances pendant la recherche dans une liste/arborescence.", "pickerGroupForeground": "Couleur du sélecteur rapide pour les étiquettes de regroupement.", @@ -52,6 +59,7 @@ "editorBackground": "Couleur d'arrière-plan de l'éditeur.", "editorForeground": "Couleur de premier plan par défaut de l'éditeur.", "editorWidgetBackground": "Couleur d'arrière-plan des gadgets de l'éditeur tels que rechercher/remplacer.", + "editorWidgetBorder": "Couleur de bordure des widgets de l'éditeur. La couleur est utilisée uniquement si le widget choisit d'avoir une bordure et si la couleur n'est pas remplacée par un widget.", "editorSelection": "Couleur de la sélection de l'éditeur.", "editorInactiveSelection": "Couleur de la sélection dans un éditeur inactif.", "editorSelectionHighlight": "Couleur des régions dont le contenu est identique à la sélection.", @@ -65,5 +73,12 @@ "diffEditorInserted": "Couleur d'arrière-plan du texte inséré.", "diffEditorRemoved": "Couleur d'arrière-plan du texte supprimé.", "diffEditorInsertedOutline": "Couleur de contour du texte inséré.", - "diffEditorRemovedOutline": "Couleur de contour du texte supprimé." + "diffEditorRemovedOutline": "Couleur de contour du texte supprimé.", + "mergeCurrentHeaderBackground": "Arrière-plan de l'en-tête actuel dans les conflits de fusion inline.", + "mergeCurrentContentBackground": "Arrière-plan du contenu actuel dans les conflits de fusion inline.", + "mergeIncomingHeaderBackground": "Arrière-plan de l'en-tête entrant dans les conflits de fusion inline.", + "mergeIncomingContentBackground": "Arrière-plan du contenu entrant dans les conflits de fusion inline.", + "mergeBorder": "Couleur de bordure des en-têtes et du séparateur dans les conflits de fusion inline.", + "overviewRulerCurrentContentForeground": "Premier plan de la règle d'aperçu actuelle pour les conflits de fusion inline.", + "overviewRulerIncomingContentForeground": "Premier plan de la règle d'aperçu entrante pour les conflits de fusion inline." } \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/api/node/extHostTask.i18n.json b/i18n/fra/src/vs/workbench/api/node/extHostTask.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..c9b8882d43762e35d864059407069b88ba4c31f5 --- /dev/null +++ b/i18n/fra/src/vs/workbench/api/node/extHostTask.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "task.label": "{0} : {1}" +} \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/api/node/extHostTreeViews.i18n.json b/i18n/fra/src/vs/workbench/api/node/extHostTreeViews.i18n.json index 8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a..2c25d01eeb19c95193f0492c7f1fc02377b2fcda 100644 --- a/i18n/fra/src/vs/workbench/api/node/extHostTreeViews.i18n.json +++ b/i18n/fra/src/vs/workbench/api/node/extHostTreeViews.i18n.json @@ -3,4 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. -{} \ No newline at end of file +{ + "treeView.notRegistered": "Aucune arborescence avec l'ID '{0}' n'est inscrite.", + "treeItem.notFound": "L'élément d'arborescence avec l'ID '{0}' est introuvable.", + "treeView.duplicateElement": "L'élément '{0}' est déjà inscrit" +} \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/browser/actions/configureLocale.i18n.json b/i18n/fra/src/vs/workbench/browser/actions/configureLocale.i18n.json index ef4f2686d9e8d42d28fe7ffbacada7885190ac76..a8e6e2e51470cb6f82bc9c7baf28feb4a8ee5b76 100644 --- a/i18n/fra/src/vs/workbench/browser/actions/configureLocale.i18n.json +++ b/i18n/fra/src/vs/workbench/browser/actions/configureLocale.i18n.json @@ -7,6 +7,7 @@ "configureLocale": "Configurer la langue", "displayLanguage": "Définit le langage affiché par VSCode.", "doc": "Consultez {0} pour connaître la liste des langues prises en charge.", + "restart": "Le changement de la valeur nécessite le redémarrage de VS Code.", "fail.createSettings": "Impossible de créer '{0}' ({1}).", "JsonSchema.locale": "Langue d'interface utilisateur (IU) à utiliser." } \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/browser/parts/activitybar/activitybarPart.i18n.json b/i18n/fra/src/vs/workbench/browser/parts/activitybar/activitybarPart.i18n.json index 7b7e61c23f48c4b22960a4f1dfbea036f931c1bb..a04b897abfe8bd1953a1d34888db7ceaf57a3bbd 100644 --- a/i18n/fra/src/vs/workbench/browser/parts/activitybar/activitybarPart.i18n.json +++ b/i18n/fra/src/vs/workbench/browser/parts/activitybar/activitybarPart.i18n.json @@ -5,5 +5,6 @@ // Do not edit this file. It is machine generated. { "hideActivitBar": "Masquer la barre d'activités", - "activityBarAriaLabel": "Sélecteur d'affichage actif" + "activityBarAriaLabel": "Sélecteur d'affichage actif", + "globalActions": "Actions globales" } \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/browser/parts/editor/editorStatus.i18n.json b/i18n/fra/src/vs/workbench/browser/parts/editor/editorStatus.i18n.json index a96ef282603f6c36359dbed7e8d051995025db64..625e22d6bcd49353c9849f2727edc862165bd499 100644 --- a/i18n/fra/src/vs/workbench/browser/parts/editor/editorStatus.i18n.json +++ b/i18n/fra/src/vs/workbench/browser/parts/editor/editorStatus.i18n.json @@ -10,7 +10,7 @@ "multiSelection": "{0} sélections", "endOfLineLineFeed": "LF", "endOfLineCarriageReturnLineFeed": "CRLF", - "tabFocusModeEnabled": "La touche Tab déplace le focus", + "screenReaderDetectedExtra": "Si vous n'utilisez pas de lecteur d'écran, définissez le paramètre 'editor.accessibilitySupport' sur \"désactivé\".", "disableTabMode": "Désactiver le mode d'accessibilité", "gotoLine": "Atteindre la ligne", "indentation": "Retrait", diff --git a/i18n/fra/src/vs/workbench/browser/parts/quickopen/quickopen.i18n.json b/i18n/fra/src/vs/workbench/browser/parts/quickopen/quickopen.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..4ae604a5c68fd022f60a4d4f057ce3da57fc0466 --- /dev/null +++ b/i18n/fra/src/vs/workbench/browser/parts/quickopen/quickopen.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "quickOpen": "Atteindre le fichier...", + "quickNavigateNext": "Naviguer vers l'élément suivant dans Quick Open", + "quickNavigatePrevious": "Naviguer vers l'élément précédent dans Quick Open", + "quickSelectNext": "Sélectionner l'élément suivant dans Quick Open", + "quickSelectPrevious": "Sélectionner l'élément précédent dans Quick Open" +} \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/browser/quickopen.i18n.json b/i18n/fra/src/vs/workbench/browser/quickopen.i18n.json index 553ab99539ca4aa78156413ad41b6969e73324f0..6c5413c9c047c7fd025d1b18e56289b5aba6fc91 100644 --- a/i18n/fra/src/vs/workbench/browser/quickopen.i18n.json +++ b/i18n/fra/src/vs/workbench/browser/quickopen.i18n.json @@ -6,6 +6,5 @@ { "noResultsMatching": "Aucun résultat correspondant", "noResultsFound2": "Résultats introuvables", - "entryAriaLabel": "{0}, commande", - "noCommands": "Aucune commande correspondante" + "entryAriaLabel": "{0}, commande" } \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/browser/viewlet.i18n.json b/i18n/fra/src/vs/workbench/browser/viewlet.i18n.json index a2b2c00414d0b733ad465918ef37855e6d0b897a..0c0be9aff9bee49a27b893f49973f4f6c073fe06 100644 --- a/i18n/fra/src/vs/workbench/browser/viewlet.i18n.json +++ b/i18n/fra/src/vs/workbench/browser/viewlet.i18n.json @@ -4,6 +4,5 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "collapse": "Réduire tout", - "viewToolbarAriaLabel": "{0} actions" + "collapse": "Réduire tout" } \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/common/theme.i18n.json b/i18n/fra/src/vs/workbench/common/theme.i18n.json index 8363fa14b9a0967d67750bb2a5e49475328b003f..33eccb30b80b3a22d1867c67a13117f4e178041a 100644 --- a/i18n/fra/src/vs/workbench/common/theme.i18n.json +++ b/i18n/fra/src/vs/workbench/common/theme.i18n.json @@ -7,11 +7,16 @@ "tabActiveBackground": "Couleur d'arrière-plan de l'onglet actif. Les onglets sont les conteneurs des éditeurs dans la zone d'éditeurs. Vous pouvez ouvrir plusieurs onglets dans un groupe d'éditeurs. Il peut exister plusieurs groupes d'éditeurs.", "tabInactiveBackground": "Couleur d'arrière-plan de l'onglet inactif. Les onglets sont les conteneurs des éditeurs dans la zone d'éditeurs. Vous pouvez ouvrir plusieurs onglets dans un groupe d'éditeurs. Il peut exister plusieurs groupes d'éditeurs.", "tabBorder": "Bordure séparant les onglets les uns des autres. Les onglets sont les conteneurs des éditeurs dans la zone d'éditeurs. Vous pouvez ouvrir plusieurs onglets dans un groupe d'éditeurs. Il peut exister plusieurs groupes d'éditeurs.", - "tabActiveEditorGroupActiveForeground": "Couleur de premier plan de l'onglet actif dans un groupe actif. Les onglets sont les conteneurs des éditeurs dans la zone d'éditeurs. Vous pouvez ouvrir plusieurs onglets dans un groupe d'éditeurs. Il peut exister plusieurs groupes d'éditeurs.", - "tabInactiveEditorGroupActiveForeground": "Couleur de premier plan de l'onglet inactif dans un groupe actif. Les onglets sont les conteneurs des éditeurs dans la zone d'éditeurs. Vous pouvez ouvrir plusieurs onglets dans un groupe d'éditeurs. Il peut exister plusieurs groupes d'éditeurs.", + "tabActiveForeground": "Couleur de premier plan de l'onglet actif dans un groupe actif. Les onglets sont les conteneurs des éditeurs dans la zone d'éditeurs. Vous pouvez ouvrir plusieurs onglets dans un groupe d'éditeurs. Il peut exister plusieurs groupes d'éditeurs.", + "tabInactiveForeground": "Couleur de premier plan de l'onglet inactif dans un groupe actif. Les onglets sont les conteneurs des éditeurs dans la zone d'éditeurs. Vous pouvez ouvrir plusieurs onglets dans un groupe d'éditeurs. Il peut exister plusieurs groupes d'éditeurs.", + "tabUnfocusedActiveForeground": "Couleur de premier plan de l'onglet actif dans un groupe inactif. Les onglets sont les conteneurs des éditeurs dans la zone d'éditeurs. Vous pouvez ouvrir plusieurs onglets dans un groupe d'éditeurs. Il peut exister plusieurs groupes d'éditeurs.", + "tabUnfocusedInactiveForeground": "Couleur de premier plan de l'onglet inactif dans un groupe inactif. Les onglets sont les conteneurs des éditeurs dans la zone d'éditeurs. Vous pouvez ouvrir plusieurs onglets dans un groupe d'éditeurs. Il peut exister plusieurs groupes d'éditeurs.", "editorGroupBackground": "Couleur d'arrière-plan d'un groupe d'éditeurs. Les groupes d'éditeurs sont les conteneurs des éditeurs. La couleur d'arrière-plan s'affiche pendant le glissement de groupes d'éditeurs.", + "tabsContainerBackground": "Couleur d'arrière-plan de l'en-tête du titre du groupe d'éditeurs quand les onglets sont activés. Les groupes d'éditeurs sont les conteneurs des éditeurs.", + "tabsContainerBorder": "Couleur de bordure de l'en-tête du titre du groupe d'éditeurs quand les onglets sont activés. Les groupes d'éditeurs sont les conteneurs des éditeurs.", "editorGroupHeaderBackground": "Couleur d'arrière-plan de l'en-tête du titre du groupe d'éditeurs quand les onglets sont désactivés. Les groupes d'éditeurs sont les conteneurs des éditeurs.", "editorGroupBorder": "Couleur séparant plusieurs groupes d'éditeurs les uns des autres. Les groupes d'éditeurs sont les conteneurs des éditeurs.", + "editorDragAndDropBackground": "Couleur d'arrière-plan lors du déplacement des éditeurs par glissement. La couleur doit avoir une transparence pour que le contenu de l'éditeur soit visible à travers.", "panelBackground": "Couleur d'arrière-plan du panneau. Les panneaux s'affichent sous la zone d'éditeurs et contiennent des affichages tels que la sortie et le terminal intégré.", "panelBorder": "Couleur de bordure de panneau dans la partie supérieure de séparation de l'éditeur. Les panneaux s'affichent sous la zone d'éditeurs et contiennent des affichages tels que la sortie et le terminal intégré.", "panelActiveTitleForeground": "Couleur du titre du panneau actif. Les panneaux se situent sous la zone de l'éditeur et contiennent des affichages comme la sortie et le terminal intégré.", @@ -19,18 +24,25 @@ "panelActiveTitleBorder": "Couleur de la bordure du titre du panneau actif. Les panneaux se situent sous la zone de l'éditeur et contiennent des affichages comme la sortie et le terminal intégré.", "statusBarForeground": "Couleur de premier plan de la barre d'état. La barre d'état est affichée en bas de la fenêtre.", "statusBarBackground": "Couleur d'arrière-plan de la barre d'état standard. La barre d'état est affichée en bas de la fenêtre.", + "statusBarBorder": "Couleur de bordure de la barre d'état faisant la séparation avec la barre latérale et l'éditeur. La barre d'état est affichée en bas de la fenêtre.", "statusBarNoFolderBackground": "Couleur d'arrière-plan de la barre d'état quand aucun dossier n'est ouvert. La barre d'état est affichée en bas de la fenêtre.", + "statusBarNoFolderForeground": "Couleur de premier plan de la barre d'état quand aucun dossier n'est ouvert. La barre d'état est affichée en bas de la fenêtre.", "statusBarItemActiveBackground": "Couleur d'arrière-plan de l'élément de la barre d'état durant un clic. La barre d'état est affichée en bas de la fenêtre.", "statusBarItemHoverBackground": "Couleur d'arrière-plan de l'élément de la barre d'état durant un pointage. La barre d'état est affichée en bas de la fenêtre.", "statusBarProminentItemBackground": "Couleur d'arrière-plan des éléments importants de la barre d'état. Les éléments importants se différencient des autres entrées de la barre d'état pour indiquer l'importance. La barre d'état est affichée en bas de la fenêtre.", "statusBarProminentItemHoverBackground": "Couleur d'arrière-plan des éléments importants de la barre d'état pendant le pointage. Les éléments importants se différencient des autres entrées de la barre d'état pour indiquer l'importance. La barre d'état est affichée en bas de la fenêtre.", "activityBarBackground": "Couleur d'arrière-plan de la barre d'activités. La barre d'activités s'affiche complètement à gauche ou à droite, et permet de naviguer entre les affichages de la barre latérale.", "activityBarForeground": "Couleur de premier plan de la barre d'activités (par ex., utilisée pour les icônes). La barre d'activités s'affiche complètement à gauche ou à droite, et permet de parcourir les vues de la barre latérale.", + "activityBarBorder": "Couleur de bordure de la barre d'activités faisant la séparation avec la barre latérale. La barre d'activités, située à l'extrême droite ou gauche, permet de parcourir les vues de la barre latérale.", + "activityBarDragAndDropBackground": "Couleur des commentaires sur une opération de glisser-déplacer pour les éléments de la barre d'activités. La couleur doit avoir une transparence pour que les entrées de la barre d'activités soient visibles à travers. La barre d'activités, située à l'extrême droite ou gauche, permet de parcourir les vues de la barre latérale.", "activityBarBadgeBackground": "Couleur d'arrière-plan du badge de notification d'activité. La barre d'activités, située à l'extrême gauche ou droite, permet de basculer entre les affichages de la barre latérale.", "activityBarBadgeForeground": "Couleur de premier plan du badge de notification d'activité. La barre d'activités, située à l'extrême gauche ou droite, permet de basculer entre les affichages de la barre latérale.", "sideBarBackground": "Couleur d'arrière-plan de la barre latérale. La barre latérale est le conteneur des affichages tels que ceux de l'exploration et la recherche.", + "sideBarForeground": "Couleur de premier plan de la barre latérale. La barre latérale est le conteneur des vues comme celles de l'explorateur et de la recherche.", + "sideBarBorder": "Couleur de bordure de la barre latérale faisant la séparation avec l'éditeur. La barre latérale est le conteneur des vues comme celles de l'explorateur et de la recherche.", "sideBarTitleForeground": "Couleur de premier plan du titre de la barre latérale. La barre latérale est le conteneur des affichages tels que ceux de l'exploration et la recherche.", "sideBarSectionHeaderBackground": "Couleur d'arrière-plan de l'en-tête de section de la barre latérale. La barre latérale est le conteneur des vues comme celles de l'explorateur et la recherche.", + "sideBarSectionHeaderForeground": "Couleur de premier plan de l'en-tête de section de la barre latérale. La barre latérale est le conteneur des vues comme celles de l'explorateur et de la recherche.", "titleBarActiveForeground": "Premier plan de la barre de titre quand la fenêtre est active. Notez que cette couleur est uniquement prise en charge sur macOS.", "titleBarInactiveForeground": "Premier plan de la barre de titre quand la fenêtre est inactive. Notez que cette couleur est uniquement prise en charge sur macOS.", "titleBarActiveBackground": "Arrière-plan de la barre de titre quand la fenêtre est active. Notez que cette couleur est uniquement prise en charge sur macOS.", diff --git a/i18n/fra/src/vs/workbench/electron-browser/actions.i18n.json b/i18n/fra/src/vs/workbench/electron-browser/actions.i18n.json index 89d053f8d1df43464286503ada7a7dcb11ecef65..96da96abc3d9cea84eeed46f4d4713787912a86f 100644 --- a/i18n/fra/src/vs/workbench/electron-browser/actions.i18n.json +++ b/i18n/fra/src/vs/workbench/electron-browser/actions.i18n.json @@ -6,9 +6,6 @@ { "closeActiveEditor": "Fermer l'éditeur", "closeWindow": "Fermer la fenêtre", - "switchWindow": "Changer de fenêtre", - "switchWindowPlaceHolder": "Sélectionner une fenêtre", - "current": "Fenêtre active", "closeFolder": "Fermer un dossier", "noFolderOpened": "Il n'existe actuellement aucun dossier ouvert à fermer dans cette instance.", "newWindow": "Nouvelle fenêtre", @@ -20,7 +17,7 @@ "zoomReset": "Réinitialiser le zoom", "appPerf": "Performance de démarrage", "reloadWindow": "Recharger la fenêtre", - "openRecent": "Ouvrir les éléments récents", + "current": "Fenêtre active", "folders": "dossiers", "files": "fichiers", "openRecentPlaceHolderMac": "Sélectionner un chemin (maintenir la touche Cmd enfoncée pour l'ouvrir dans une nouvelle fenêtre)", @@ -32,10 +29,6 @@ "openDocumentationUrl": "Documentation", "openIntroductoryVideosUrl": "Vidéos d'introduction", "toggleSharedProcess": "Activer/désactiver le processus partagé", - "navigateLeft": "Déplacer vers l'affichage à gauche", - "navigateRight": "Déplacer vers l'affichage à droite", - "navigateUp": "Déplacer vers l'affichage au-dessus", - "navigateDown": "Déplacer vers l'affichage en dessous", "increaseViewSize": "Augmenter la taille de l'affichage actuel", "decreaseViewSize": "Diminuer la taille de l'affichage actuel" } \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/electron-browser/main.contribution.i18n.json b/i18n/fra/src/vs/workbench/electron-browser/main.contribution.i18n.json index 7d14c23b2b5f39c679211b74935312ab038b947c..1d5619cef58d4eb0589a7e27a39cc56c8a688fc0 100644 --- a/i18n/fra/src/vs/workbench/electron-browser/main.contribution.i18n.json +++ b/i18n/fra/src/vs/workbench/electron-browser/main.contribution.i18n.json @@ -7,6 +7,7 @@ "view": "Affichage", "help": "Aide", "file": "Fichier", + "developer": "Développeur", "showEditorTabs": "Contrôle si les éditeurs ouverts doivent s'afficher ou non sous des onglets.", "editorTabCloseButton": "Contrôle la position des boutons de fermeture des onglets de l'éditeur, ou les désactive quand le paramètre a la valeur 'off'.", "showIcons": "Contrôle si les éditeurs ouverts doivent s'afficher ou non avec une icône. Cela implique notamment l'activation d'un thème d'icône.", @@ -30,10 +31,6 @@ "window.openFoldersInNewWindow.off": "Les dossiers remplacent la dernière fenêtre active", "window.openFoldersInNewWindow.default": "Les dossiers s'ouvrent dans une nouvelle fenêtre, sauf si un dossier est sélectionné depuis l'application (par exemple, via le menu Fichier)", "openFoldersInNewWindow": "Contrôle si les dossiers doivent s'ouvrir dans une nouvelle fenêtre ou remplacer la dernière fenêtre active.\n- default : les dossiers s'ouvrent dans une nouvelle fenêtre, sauf si un dossier est sélectionné depuis l'application (par exemple, via le menu Fichier)\n- on : les dossiers s'ouvrent dans une nouvelle fenêtre\n- off : les dossiers remplacent la dernière fenêtre active\nNotez que dans certains cas, ce paramètre est ignoré (par exemple, quand vous utilisez l'option de ligne de commande -new-window ou -reuse-window).", - "window.reopenFolders.none": "Permet de ne jamais rouvrir un dossier.", - "window.reopenFolders.one": "Permet de rouvrir le dernier dossier actif.", - "window.reopenFolders.all": "Permet de rouvrir tous les dossiers de la dernière session.", - "reopenFolders": "Contrôle la façon dont les dossiers sont rouverts après un redémarrage. Sélectionnez 'none' pour ne jamais rouvrir un dossier, 'one' pour rouvrir le dernier dossier utilisé, ou 'all' pour rouvrir tous les dossiers de votre dernière session.", "restoreFullscreen": "Contrôle si une fenêtre doit être restaurée en mode plein écran si elle a été fermée dans ce mode.", "zoomLevel": "Modifiez le niveau de zoom de la fenêtre. La taille d'origine est 0. Chaque incrément supérieur (exemple : 1) ou inférieur (exemple : -1) représente un zoom 20 % plus gros ou plus petit. Vous pouvez également entrer des décimales pour changer le niveau de zoom avec une granularité plus fine.", "title": "Contrôle le titre de la fenêtre en fonction de l'éditeur actif. Les variables sont remplacées en fonction du contexte :\n${activeEditorShort} : exemple : myFile.txt\n${activeEditorMedium} : exemple : myFolder/myFile.txt\n${activeEditorLong} : exemple : /Users/Development/myProject/myFolder/myFile.txt\n${rootName} : exemple : myProject\n${rootPath} : exemple : /Users/Development/myProject\n${appName} : exemple : VS Code\n${dirty} : indicateur d'intégrité si l'intégrité de l'éditeur actif est compromise\n${separator} : séparateur conditionnel (\" - \") qui s'affiche uniquement quand il est entouré de variables avec des valeurs", @@ -41,11 +38,13 @@ "window.newWindowDimensions.inherit": "Permet d'ouvrir les nouvelles fenêtres avec la même dimension que la dernière fenêtre active.", "window.newWindowDimensions.maximized": "Permet d'ouvrir les nouvelles fenêtres de manière agrandie.", "window.newWindowDimensions.fullscreen": "Permet d'ouvrir les nouvelles fenêtres en mode plein écran.", + "newWindowDimensions": "Contrôle les dimensions d'ouverture d'une nouvelle fenêtre quand au moins une fenêtre est déjà ouverte. Par défaut, une nouvelle fenêtre s'ouvre au centre de l'écran avec des dimensions réduites. Quand la valeur est 'inherit', la fenêtre a les mêmes dimensions que la dernière fenêtre active. Quand la valeur est 'maximized', la fenêtre s'ouvre dans sa taille maximale et quand la valeur est 'fullscreen', elle s'ouvre en mode plein écran. Notez que ce paramètre n'a aucun impact sur la première fenêtre ouverte, laquelle est toujours restaurée à la taille et l'emplacement définis au moment de sa fermeture.", "window.menuBarVisibility.default": "Le menu n'est masqué qu'en mode plein écran.", "window.menuBarVisibility.visible": "Le menu est toujours visible même en mode plein écran.", "window.menuBarVisibility.toggle": "Le menu est masqué mais il peut être affiché via la touche Alt.", "window.menuBarVisibility.hidden": "Le menu est toujours masqué.", "menuBarVisibility": "Contrôle la visibilité de la barre de menus. Le paramètre 'toggle' signifie que la barre de menus est masquée, et qu'une seule pression sur la touche Alt permet de l'afficher. Par défaut, la barre de menus est visible, sauf si la fenêtre est en mode plein écran.", + "enableMenuBarMnemonics": "S'ils sont activés, les menus principaux peuvent être ouverts via des raccourcis avec la touche Alt. La désactivation des mnémoniques permet plutôt de lier ces raccourcis avec la touche Alt aux commandes de l'éditeur.", "autoDetectHighContrast": "Si cette option est activée, le thème à contraste élevé est automatiquement choisi quand Windows utilise un thème à contraste élevé. À l'inverse, le thème sombre est automatiquement choisi quand Windows n'utilise plus le thème à contraste élevé.", "titleBarStyle": "Ajustez l'apparence de la barre de titre de la fenêtre. Vous devez effectuer un redémarrage complet pour que les changements soient appliqués.", "window.nativeTabs": "Active les onglets macOS Sierra. Notez que vous devez redémarrer l'ordinateur pour appliquer les modifications et que les onglets natifs désactivent tout style de barre de titre personnalisé configuré, le cas échéant.", @@ -55,5 +54,7 @@ "zenMode.hideTabs": "Contrôle si l'activation du mode Zen masque également les onglets du banc d'essai.", "zenMode.hideStatusBar": "Contrôle si l'activation du mode Zen masque également la barre d'état au bas du banc d'essai.", "zenMode.hideActivityBar": "Contrôle si l'activation du mode Zen masque également la barre d'activités à gauche du banc d'essai.", - "zenMode.restore": "Contrôle si une fenêtre doit être restaurée en mode zen, si elle a été fermée en mode zen." + "zenMode.restore": "Contrôle si une fenêtre doit être restaurée en mode zen, si elle a été fermée en mode zen.", + "workspaceConfigurationTitle": "Espace de travail", + "files.exclude.boolean": "Modèle Glob auquel les chemins de fichiers doivent correspondre. Affectez la valeur true ou false pour activer ou désactiver le modèle." } \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/electron-browser/workbench.i18n.json b/i18n/fra/src/vs/workbench/electron-browser/workbench.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..771fa003a693fa4a9725ee0987892ce9af6a965b --- /dev/null +++ b/i18n/fra/src/vs/workbench/electron-browser/workbench.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "developer": "Développeur", + "file": "Fichier" +} \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/codeEditor/electron-browser/accessibility.i18n.json b/i18n/fra/src/vs/workbench/parts/codeEditor/electron-browser/accessibility.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..a99450230b2d2e602e387ba22ff154030d7d0c51 --- /dev/null +++ b/i18n/fra/src/vs/workbench/parts/codeEditor/electron-browser/accessibility.i18n.json @@ -0,0 +1,26 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "emergencyConfOn": "Définition du paramètre 'editor.accessibilitySupport' sur 'activé'.", + "openingDocs": "Ouverture de la page de documentation sur l'accessibilité dans VS Code.", + "introMsg": "Nous vous remercions de tester les options d'accessibilité de VS Code.", + "status": "État :", + "changeConfigToOnMac": "Pour configurer l'éditeur de sorte qu'il soit optimisé en permanence pour une utilisation avec un lecteur d'écran, appuyez sur Commande+E.", + "changeConfigToOnWinLinux": "Pour configurer l'éditeur de sorte qu'il soit optimisé en permanence pour une utilisation avec un lecteur d'écran, appuyez sur Ctrl+E.", + "auto_unknown": "L'éditeur est configuré pour utiliser les API de la plateforme afin de détecter si un lecteur d'écran est attaché, mais le runtime actuel ne prend pas en charge cette configuration.", + "auto_on": "L'éditeur a automatiquement détecté qu'un lecteur d'écran est attaché.", + "auto_off": "L'éditeur est configuré pour détecter automatiquement si un lecteur d'écran est attaché, ce qui n'est pas le cas pour le moment.", + "configuredOn": "L'éditeur est configuré de sorte qu'il soit optimisé en permanence pour une utilisation avec un lecteur d'écran. Vous pouvez changer ce comportement en modifiant le paramètre 'editor.accessibilitySupport'.", + "configuredOff": "L'éditeur est configuré de sorte à ne jamais être optimisé pour une utilisation avec un lecteur d'écran.", + "tabFocusModeOnMsg": "Appuyez sur Tab dans l'éditeur pour déplacer le focus vers le prochain élément pouvant être désigné comme élément actif. Activez ou désactivez ce comportement en appuyant sur {0}.", + "tabFocusModeOnMsgNoKb": "Appuyez sur Tab dans l'éditeur pour déplacer le focus vers le prochain élément pouvant être désigné comme élément actif. La commande {0} ne peut pas être déclenchée par une combinaison de touches.", + "tabFocusModeOffMsg": "Appuyez sur Tab dans l'éditeur pour insérer le caractère de tabulation. Activez ou désactivez ce comportement en appuyant sur {0}.", + "tabFocusModeOffMsgNoKb": "Appuyez sur Tab dans l'éditeur pour insérer le caractère de tabulation. La commande {0} ne peut pas être déclenchée par une combinaison de touches.", + "openDocMac": "Appuyez sur Commande+H pour ouvrir une fenêtre de navigateur contenant plus d'informations sur l'accessibilité dans VS Code.", + "openDocWinLinux": "Appuyez sur Ctrl+H pour ouvrir une fenêtre de navigateur contenant plus d'informations sur l'accessibilité dans VS Code.", + "outroMsg": "Vous pouvez masquer cette info-bulle et revenir à l'éditeur en appuyant sur Échap ou Maj+Échap.", + "ShowAccessibilityHelpAction": "Afficher l'aide sur l'accessibilité" +} \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/codeEditor/electron-browser/inspectTMScopes.i18n.json b/i18n/fra/src/vs/workbench/parts/codeEditor/electron-browser/inspectTMScopes.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a --- /dev/null +++ b/i18n/fra/src/vs/workbench/parts/codeEditor/electron-browser/inspectTMScopes.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{} \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/codeEditor/electron-browser/toggleMultiCursorModifier.i18n.json b/i18n/fra/src/vs/workbench/parts/codeEditor/electron-browser/toggleMultiCursorModifier.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..a18dfa416d9816bd5db71eb5cd0f7334d87ecbcf --- /dev/null +++ b/i18n/fra/src/vs/workbench/parts/codeEditor/electron-browser/toggleMultiCursorModifier.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "toggleLocation": "Changer le modificateur multicurseur" +} \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/debug/browser/debugActions.i18n.json b/i18n/fra/src/vs/workbench/parts/debug/browser/debugActions.i18n.json index 1783ec559cbd7ab1e8dc0552558402131cda2909..fd1a330f1c0af5a26380135594695f1c3fe77cb0 100644 --- a/i18n/fra/src/vs/workbench/parts/debug/browser/debugActions.i18n.json +++ b/i18n/fra/src/vs/workbench/parts/debug/browser/debugActions.i18n.json @@ -6,6 +6,7 @@ { "openLaunchJson": "Ouvrir {0}", "launchJsonNeedsConfigurtion": "Configurer ou corriger 'launch.json'", + "noFolderDebugConfig": "Ouvrez d'abord un dossier pour effectuer une configuration de débogage avancée.", "startDebug": "Démarrer le débogage", "startWithoutDebugging": "Exécuter sans débogage", "selectAndStartDebugging": "Sélectionner et démarrer le débogage", diff --git a/i18n/fra/src/vs/workbench/parts/debug/electron-browser/debugCommands.i18n.json b/i18n/fra/src/vs/workbench/parts/debug/electron-browser/debugCommands.i18n.json index 8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a..9ea33c457e4d98e347ea0f145e87bc7aeb34206e 100644 --- a/i18n/fra/src/vs/workbench/parts/debug/electron-browser/debugCommands.i18n.json +++ b/i18n/fra/src/vs/workbench/parts/debug/electron-browser/debugCommands.i18n.json @@ -3,4 +3,6 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. -{} \ No newline at end of file +{ + "noFolderDebugConfig": "Ouvrez d'abord un dossier pour effectuer une configuration de débogage avancée." +} \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/debug/electron-browser/debugService.i18n.json b/i18n/fra/src/vs/workbench/parts/debug/electron-browser/debugService.i18n.json index 377b069eb131a84ef15db4c9e3e981f09ce87d21..afd0c7bd386861cba5a10a3c77ad4f8829b892ef 100644 --- a/i18n/fra/src/vs/workbench/parts/debug/electron-browser/debugService.i18n.json +++ b/i18n/fra/src/vs/workbench/parts/debug/electron-browser/debugService.i18n.json @@ -5,8 +5,8 @@ // Do not edit this file. It is machine generated. { "snapshotObj": "Seules les valeurs primitives sont affichées pour cet objet.", - "debuggingStarted": "Débogage démarré.", "debuggingPaused": "Débogage en pause. Raison : {0}, {1} {2}", + "debuggingStarted": "Débogage démarré.", "debuggingStopped": "Débogage arrêté.", "breakpointAdded": "Point d'arrêt ajouté, ligne {0}, fichier {1}", "breakpointRemoved": "Point d'arrêt supprimé, ligne {0}, fichier {1}", diff --git a/i18n/fra/src/vs/workbench/parts/debug/electron-browser/debugViews.i18n.json b/i18n/fra/src/vs/workbench/parts/debug/electron-browser/debugViews.i18n.json index 810f2f0eab16028fa441a5a9bf9fdac03de9ea76..66ff22521aa359c337c42adc35a8213dbd217c6a 100644 --- a/i18n/fra/src/vs/workbench/parts/debug/electron-browser/debugViews.i18n.json +++ b/i18n/fra/src/vs/workbench/parts/debug/electron-browser/debugViews.i18n.json @@ -5,16 +5,12 @@ // Do not edit this file. It is machine generated. { "variablesSection": "Section des variables", - "variables": "Variables", "variablesAriaTreeLabel": "Déboguer les variables", "expressionsSection": "Section des expressions", - "watch": "Espion", "watchAriaTreeLabel": "Déboguer les expressions espionnées", "callstackSection": "Section de pile des appels", "debugStopped": "En pause sur {0}", - "callStack": "Pile des appels", "callStackAriaLabel": "Déboguer la pile des appels", "breakpointsSection": "Section des points d'arrêt", - "breakpoints": "Points d'arrêt", "breakpointsAriaTreeLabel": "Déboguer les points d'arrêt" } \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/debug/electron-browser/electronDebugActions.i18n.json b/i18n/fra/src/vs/workbench/parts/debug/electron-browser/electronDebugActions.i18n.json index 213e8a8ab69b91dd2e72a3ae770f84c0fdebdd89..e963a7127e70682bd4ea1499fb45b4c07dc55763 100644 --- a/i18n/fra/src/vs/workbench/parts/debug/electron-browser/electronDebugActions.i18n.json +++ b/i18n/fra/src/vs/workbench/parts/debug/electron-browser/electronDebugActions.i18n.json @@ -6,5 +6,6 @@ { "copyValue": "Copier la valeur", "copy": "Copier", + "copyAll": "Copier tout", "copyStackTrace": "Copier la pile des appels" } \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/debug/electron-browser/statusbarColorProvider.i18n.json b/i18n/fra/src/vs/workbench/parts/debug/electron-browser/statusbarColorProvider.i18n.json index ea381e994a0651b4efc5122622662136e9c7fda3..b4fa3eab63698bf2d7d1b2c6f094448308ec86ad 100644 --- a/i18n/fra/src/vs/workbench/parts/debug/electron-browser/statusbarColorProvider.i18n.json +++ b/i18n/fra/src/vs/workbench/parts/debug/electron-browser/statusbarColorProvider.i18n.json @@ -4,5 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "statusBarDebuggingBackground": "Couleur d'arrière-plan de la barre d'état quand un programme est en cours de débogage. La barre d'état est affichée en bas de la fenêtre" + "statusBarDebuggingBackground": "Couleur d'arrière-plan de la barre d'état quand un programme est en cours de débogage. La barre d'état est affichée en bas de la fenêtre", + "statusBarDebuggingForeground": "Couleur de premier plan de la barre d'état quand un programme est en cours de débogage. La barre d'état est affichée en bas de la fenêtre" } \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json b/i18n/fra/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json index b52cacf9ab292689a6d607992ed4152bddb4c082..8b0cfe2f540cb8128b2cbaddc148934f09a96b43 100644 --- a/i18n/fra/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json +++ b/i18n/fra/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json @@ -7,6 +7,7 @@ "debugAdapterBinNotFound": "L'exécutable d'adaptateur de débogage '{0}' n'existe pas.", "debugAdapterCannotDetermineExecutable": "Impossible de déterminer l'exécutable pour l'adaptateur de débogage '{0}'.", "debugType": "Type de configuration.", + "debugTypeNotRecognised": "Le type de débogage n'est pas reconnu. Vérifiez que vous avez installé l'extension de débogage correspondante et qu'elle est activée.", "node2NotSupported": "\"node2\" n'est plus pris en charge. Utilisez \"node\" à la place, et affectez la valeur \"inspector\" à l'attribut \"protocol\".", "debugName": "Le nom de la configuration s'affiche dans le menu déroulant de la configuration de lancement.", "debugRequest": "Type de requête de configuration. Il peut s'agir de \"launch\" ou \"attach\".", diff --git a/i18n/fra/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json b/i18n/fra/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json index a8c57987711146fd9cbfb4655c9ff6ced2c73801..ad194859cdcfe8c108d341c2818f2dd5b1836d4f 100644 --- a/i18n/fra/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json +++ b/i18n/fra/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json @@ -4,6 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "previousEditPoint": "Emmet : Previous Edit Point", - "nextEditPoint": "Emmet : Next Edit Point" + "previousEditPoint": "Emmet : Go to Previous Edit Point", + "nextEditPoint": "Emmet : Go to Next Edit Point" } \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json b/i18n/fra/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json index 33db3866d0c12df1819087f17205b9c05f1be496..3bd0a45f5943a413bb056b13836da5c36016bb45 100644 --- a/i18n/fra/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json +++ b/i18n/fra/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json @@ -9,5 +9,6 @@ "emmetPreferences": "Préférences utilisées pour modifier le comportement de certaines actions et résolveurs d'Emmet.", "emmetSyntaxProfiles": "Définissez le profil pour la syntaxe spécifiée ou utilisez votre propre profil avec des règles spécifiques.", "emmetExclude": "Ensemble de langages où les abréviations emmet ne doivent pas être développées.", - "emmetExtensionsPath": "Chemin d'un dossier contenant les profils, extraits et préférences Emmet" + "emmetExtensionsPath": "Chemin d'un dossier contenant les profils, extraits et préférences Emmet", + "useNewEmmet": "Essayez les nouveaux modules Emmet (qui remplaceront à terme l'ancienne bibliothèque Emmet) pour toutes les fonctionnalités Emmet." } \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/extensions/browser/extensionEditor.i18n.json b/i18n/fra/src/vs/workbench/parts/extensions/browser/extensionEditor.i18n.json index 5dd842e57ef7fd33caf4ea70d100cbdeb87a2bfc..df8369170ce5810221ffc2b4dbd4b27514c0944c 100644 --- a/i18n/fra/src/vs/workbench/parts/extensions/browser/extensionEditor.i18n.json +++ b/i18n/fra/src/vs/workbench/parts/extensions/browser/extensionEditor.i18n.json @@ -24,6 +24,10 @@ "default": "Par défaut", "debuggers": "Débogueurs ({0})", "debugger name": "Nom", + "views": "Vues ({0})", + "view id": "ID", + "view name": "Nom", + "view location": "Emplacement", "themes": "Thèmes ({0})", "JSON Validation": "Validation JSON ({0})", "commands": "Commandes ({0})", diff --git a/i18n/fra/src/vs/workbench/parts/extensions/browser/extensionsActions.i18n.json b/i18n/fra/src/vs/workbench/parts/extensions/browser/extensionsActions.i18n.json index 5b7a7ecda7f3187d7b75d1f913c939626739489f..0112a21db366de319a7a5193ffda7b5f497aba67 100644 --- a/i18n/fra/src/vs/workbench/parts/extensions/browser/extensionsActions.i18n.json +++ b/i18n/fra/src/vs/workbench/parts/extensions/browser/extensionsActions.i18n.json @@ -22,6 +22,8 @@ "disableGloballyAction": "Toujours", "disableAction": "Désactiver", "checkForUpdates": "Rechercher les mises à jour", + "enableAutoUpdate": "Activer la mise à jour automatique des extensions", + "disableAutoUpdate": "Désactiver la mise à jour automatique des extensions", "updateAll": "Mettre à jour toutes les extensions", "reloadAction": "Recharger", "postUpdateTooltip": "Recharger pour mettre à jour", @@ -44,6 +46,8 @@ "showWorkspaceRecommendedExtensions": "Afficher les extensions recommandées pour l'espace de travail", "showRecommendedKeymapExtensions": "Afficher les mappages de touches recommandés", "showRecommendedKeymapExtensionsShort": "Mappages de touches", + "showLanguageExtensions": "Afficher les extensions de langage", + "showLanguageExtensionsShort": "Extensions de langage", "configureWorkspaceRecommendedExtensions": "Configurer les extensions recommandées (espace de travail)", "ConfigureWorkspaceRecommendations.noWorkspace": "Les recommandations ne sont disponibles que pour un dossier d'espace de travail.", "OpenExtensionsFile.failed": "Impossible de créer le fichier 'extensions.json' dans le dossier '.vscode' ({0}).", @@ -51,5 +55,8 @@ "disableAll": "Désactiver toutes les extensions installées", "disableAllWorkspace": "Désactiver toutes les extensions installées pour cet espace de travail", "enableAll": "Activer toutes les extensions installées", - "enableAllWorkspace": "Activer toutes les extensions installées pour cet espace de travail" + "enableAllWorkspace": "Activer toutes les extensions installées pour cet espace de travail", + "extensionButtonProminentBackground": "Couleur d'arrière-plan du bouton pour les extension d'actions importantes (par ex., le bouton d'installation).", + "extensionButtonProminentForeground": "Couleur d'arrière-plan du bouton pour l'extension d'actions importantes (par ex., le bouton d'installation).", + "extensionButtonProminentHoverBackground": "Couleur d'arrière-plan du pointage de bouton pour l'extension d'actions importantes (par ex., le bouton d'installation)." } \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.i18n.json b/i18n/fra/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.i18n.json index c4a2f4bc59dbe0cd074ece88e34a4c780053b262..ba4825598d4c77cf969dbf98f3f06183b763e502 100644 --- a/i18n/fra/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.i18n.json +++ b/i18n/fra/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.i18n.json @@ -9,6 +9,8 @@ "neverShowAgain": "Ne plus afficher", "close": "Fermer", "workspaceRecommended": "Cet espace de travail a des recommandations d'extension.", + "ignoreExtensionRecommendations": "Voulez-vous ignorer toutes les recommandations d'extension ?", + "ignoreAll": "Oui, ignorer tout", "no": "Non", "cancel": "Annuler" } \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.i18n.json b/i18n/fra/src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.i18n.json index 89edbc50c8928c28e297cdfa8854f7c27f372610..be819e14deb678f64e9ccece2207739ce70e9bcc 100644 --- a/i18n/fra/src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.i18n.json +++ b/i18n/fra/src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.i18n.json @@ -10,5 +10,6 @@ "extensions": "Extensions", "view": "Affichage", "extensionsConfigurationTitle": "Extensions", - "extensionsAutoUpdate": "Mettre à jour automatiquement les extensions" + "extensionsAutoUpdate": "Mettre à jour automatiquement les extensions", + "extensionsIgnoreRecommendations": "Ignorer les recommandations d'extension" } \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json b/i18n/fra/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json index 8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a..3eea012e3732dadcc4badc12ddac61a540d5aa08 100644 --- a/i18n/fra/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json +++ b/i18n/fra/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json @@ -3,4 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. -{} \ No newline at end of file +{ + "disableOtherKeymapsConfirmation": "Désactiver les autres mappages de touches ({0}) pour éviter les conflits de combinaisons de touches ?", + "yes": "Oui", + "no": "Non", + "betterMergeDisabled": "L'extension Better Merge est désormais intégrée, l'extension installée est désactivée et peut être désinstallée.", + "uninstall": "Désinstaller", + "later": "Plus tard" +} \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/files/browser/files.contribution.i18n.json b/i18n/fra/src/vs/workbench/parts/files/browser/files.contribution.i18n.json index 8d72ad31935496b6adb20db1b1219a79a15f58f3..2416f91e4c10f22bbe2de17e9cfdf9872ecaf044 100644 --- a/i18n/fra/src/vs/workbench/parts/files/browser/files.contribution.i18n.json +++ b/i18n/fra/src/vs/workbench/parts/files/browser/files.contribution.i18n.json @@ -16,7 +16,7 @@ "associations": "Configurez les associations entre les fichiers et les langages (par exemple, \"*.extension\": \"html\"). Celles-ci ont priorité sur les associations par défaut des langages installés.", "encoding": "Encodage du jeu de caractères par défaut à utiliser durant la lecture et l'écriture des fichiers.", "autoGuessEncoding": "Quand cette option est activée, tente de deviner l'encodage du jeu de caractères à l'ouverture des fichiers", - "eol": "Caractère de fin de ligne par défaut.", + "eol": "Caractère de fin de ligne par défaut. Utilisez \\n pour LF et \\r\\n pour CRLF.", "trimTrailingWhitespace": "Si l'option est activée, l'espace blanc de fin est supprimé au moment de l'enregistrement d'un fichier.", "insertFinalNewline": "Quand l'option est activée, une nouvelle ligne finale est insérée à la fin du fichier au moment de son enregistrement.", "files.autoSave.off": "Un fichier dont l'intégrité est compromise n'est jamais enregistré automatiquement.", @@ -27,6 +27,7 @@ "autoSaveDelay": "Contrôle le délai en ms au bout duquel un fichier à l'intégrité compromise est enregistré automatiquement. S'applique uniquement quand 'files.autoSave' a la valeur '{0}'", "watcherExclude": "Configurez les modèles Glob des chemins de fichiers à exclure de la surveillance des fichiers. La modification de ce paramètre nécessite un redémarrage. Si vous constatez que le code consomme beaucoup de temps processeur au démarrage, excluez les dossiers volumineux pour réduire la charge initiale.", "hotExit.off": "Désactivez la sortie à chaud.", + "hotExit.onExit": "La sortie à chaud se déclenche à la fermeture de l'application, c'est-à-dire quand la dernière fenêtre est fermée dans Windows/Linux, ou quand la commande workbench.action.quit est déclenchée (palette de commandes, combinaison de touches, menu). Toutes les fenêtres avec des sauvegardes sont restaurées au prochain lancement.", "hotExit": "Contrôle si les fichiers non enregistrés sont mémorisés entre les sessions, ce qui permet d'ignorer la demande d'enregistrement à la sortie de l'éditeur.", "defaultLanguage": "Mode de langage par défaut affecté aux nouveaux fichiers.", "editorConfigurationTitle": "Éditeur", diff --git a/i18n/fra/src/vs/workbench/parts/files/browser/views/emptyView.i18n.json b/i18n/fra/src/vs/workbench/parts/files/browser/views/emptyView.i18n.json index 3b4a98a5b1ac2ff4b7af869a2bb7f8d74fd92993..3e9166e1c44ea4db9c389f6b58991d181839a89d 100644 --- a/i18n/fra/src/vs/workbench/parts/files/browser/views/emptyView.i18n.json +++ b/i18n/fra/src/vs/workbench/parts/files/browser/views/emptyView.i18n.json @@ -5,7 +5,5 @@ // Do not edit this file. It is machine generated. { "explorerSection": "Section de l'Explorateur de fichiers", - "noWorkspace": "Aucun dossier ouvert", - "noWorkspaceHelp": "Vous n'avez pas encore ouvert de dossier.", "openFolder": "Ouvrir le dossier" } \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/files/browser/views/openEditorsView.i18n.json b/i18n/fra/src/vs/workbench/parts/files/browser/views/openEditorsView.i18n.json index 049ecf726f0120b0edc3ff44defc7204dee19e1f..edcca33816cdaed901e3df0636ea49bf91810773 100644 --- a/i18n/fra/src/vs/workbench/parts/files/browser/views/openEditorsView.i18n.json +++ b/i18n/fra/src/vs/workbench/parts/files/browser/views/openEditorsView.i18n.json @@ -4,8 +4,8 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "openEditosrSection": "Section des éditeurs ouverts", "openEditors": "Éditeurs ouverts", + "openEditosrSection": "Section des éditeurs ouverts", "treeAriaLabel": "Éditeurs ouverts : liste des fichiers actifs", "dirtyCounter": "{0} non enregistré(s)" } \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json b/i18n/fra/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json index fb432045fcc8d4709572658a37c9c7102a945425..13b60d7dd5c5305fc7bd9e00f3683b83fc4cabfb 100644 --- a/i18n/fra/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json +++ b/i18n/fra/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json @@ -5,5 +5,11 @@ // Do not edit this file. It is machine generated. { "slow": "Démarrage lent détecté", - "slow.detail": "Le démarrage a été très lent. Redémarrez '{0}' en ayant activé le profilage, partagez les profils avec nous, et nous ferons en sorte que le démarrage retrouve sa rapidité d'exécution." + "slow.detail": "Le démarrage a été très lent. Redémarrez '{0}' en ayant activé le profilage, partagez les profils avec nous, et nous ferons en sorte que le démarrage retrouve sa rapidité d'exécution.", + "prof.message": "Création réussie des profils.", + "prof.detail": "Créez un problème et joignez manuellement les fichiers suivants :\n{0}", + "prof.restartAndFileIssue": "Créer le problème et redémarrer", + "prof.restart": "Redémarrer", + "prof.thanks": "Merci de votre aide.", + "prof.detail.restart": "Un redémarrage final est nécessaire pour continuer à utiliser '{0}'. Nous vous remercions une fois de plus pour votre contribution." } \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/preferences/browser/keybindingsEditorContribution.i18n.json b/i18n/fra/src/vs/workbench/parts/preferences/browser/keybindingsEditorContribution.i18n.json index d147a9a8e3203597adfd21cf13866a80a2042907..0fa91c30616a09f7ea9b021740698970c968d049 100644 --- a/i18n/fra/src/vs/workbench/parts/preferences/browser/keybindingsEditorContribution.i18n.json +++ b/i18n/fra/src/vs/workbench/parts/preferences/browser/keybindingsEditorContribution.i18n.json @@ -5,6 +5,7 @@ // Do not edit this file. It is machine generated. { "defineKeybinding.start": "Définir une combinaison de touches", - "defineKeybinding.kbLayoutInfoMessage": "Pour votre disposition actuelle du clavier, appuyez sur ", - "defineKeybinding.kbLayoutErrorMessage": "Vous ne pouvez pas produire cette combinaison de touches avec la disposition actuelle du clavier." + "defineKeybinding.kbLayoutErrorMessage": "Vous ne pouvez pas produire cette combinaison de touches avec la disposition actuelle du clavier.", + "defineKeybinding.kbLayoutLocalAndUSMessage": "**{0}** pour votre disposition actuelle du clavier (**{1}** pour le clavier États-Unis standard).", + "defineKeybinding.kbLayoutLocalMessage": "**{0}** pour votre disposition actuelle du clavier." } \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/preferences/browser/preferencesRenderers.i18n.json b/i18n/fra/src/vs/workbench/parts/preferences/browser/preferencesRenderers.i18n.json index 6d2534d7624c3f68b9b35fa012fa633059a932dc..26f2edae5fef7cedbb8b55692072789fdec34f5b 100644 --- a/i18n/fra/src/vs/workbench/parts/preferences/browser/preferencesRenderers.i18n.json +++ b/i18n/fra/src/vs/workbench/parts/preferences/browser/preferencesRenderers.i18n.json @@ -4,6 +4,7 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "errorInvalidConfiguration": "Impossible d'écrire les paramètres. Corrigez les erreurs/avertissements présents dans le fichier, puis réessayez.", "editTtile": "Modifier", "replaceDefaultValue": "Remplacer dans les paramètres", "copyDefaultValue": "Copier dans Paramètres", diff --git a/i18n/fra/src/vs/workbench/parts/quickopen/browser/commandsHandler.i18n.json b/i18n/fra/src/vs/workbench/parts/quickopen/browser/commandsHandler.i18n.json index 54c588725ce405d166ce177780878ced1a07d708..261570184f1273a57644acac488bee89b833306d 100644 --- a/i18n/fra/src/vs/workbench/parts/quickopen/browser/commandsHandler.i18n.json +++ b/i18n/fra/src/vs/workbench/parts/quickopen/browser/commandsHandler.i18n.json @@ -5,6 +5,7 @@ // Do not edit this file. It is machine generated. { "showTriggerActions": "Afficher toutes les commandes", + "showCommands.label": "Palette de commandes...", "entryAriaLabelWithKey": "{0}, {1}, commandes", "entryAriaLabel": "{0}, commandes", "canNotRun": "La commande '{0}' ne peut pas être exécutée à partir d'ici.", diff --git a/i18n/fra/src/vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.i18n.json b/i18n/fra/src/vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..35b4553577f00e4562f5613334e128572234c692 --- /dev/null +++ b/i18n/fra/src/vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "relaunchMessage": "Un paramètre a changé et nécessite un redémarrage pour être appliqué.", + "relaunchDetail": "Appuyez sur le bouton de redémarrage pour redémarrer {0} et activer le paramètre.", + "restart": "Redémarrer" +} \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.i18n.json b/i18n/fra/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..3fe2c3e213dbebc4fe35cba045e9ea57af1e8d9b --- /dev/null +++ b/i18n/fra/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "editorGutterModifiedBackground": "Couleur d'arrière-plan de la reliure de l'éditeur pour les lignes modifiées.", + "editorGutterAddedBackground": "Couleur d'arrière-plan de la reliure de l'éditeur pour les lignes ajoutées.", + "editorGutterDeletedBackground": "Couleur d'arrière-plan de la reliure de l'éditeur pour les lignes supprimées." +} \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/scm/electron-browser/scm.contribution.i18n.json b/i18n/fra/src/vs/workbench/parts/scm/electron-browser/scm.contribution.i18n.json index 015c5898f64a1906ae042e551610af6e1eb3b070..50606f11e00f0d8620a7ff2995710e416fd82d55 100644 --- a/i18n/fra/src/vs/workbench/parts/scm/electron-browser/scm.contribution.i18n.json +++ b/i18n/fra/src/vs/workbench/parts/scm/electron-browser/scm.contribution.i18n.json @@ -5,6 +5,7 @@ // Do not edit this file. It is machine generated. { "toggleGitViewlet": "Afficher Git", + "installAdditionalSCMProviders": "Installer des fournisseurs SCM supplémentaires...", "source control": "Contrôle de code source", "toggleSCMViewlet": "Afficher SCM", "view": "Afficher" diff --git a/i18n/fra/src/vs/workbench/parts/scm/electron-browser/scmMenus.i18n.json b/i18n/fra/src/vs/workbench/parts/scm/electron-browser/scmMenus.i18n.json index 28a54af77fa669c08780e086b766955e24589f07..90044a6bbbc57b4b73c2a6c952690305e8b9fa4b 100644 --- a/i18n/fra/src/vs/workbench/parts/scm/electron-browser/scmMenus.i18n.json +++ b/i18n/fra/src/vs/workbench/parts/scm/electron-browser/scmMenus.i18n.json @@ -4,5 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "installAdditionalSCMProviders": "Installer des fournisseurs SCM supplémentaires...", "switch provider": "Changer de fournisseur GCL..." } \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json b/i18n/fra/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json index b89dba6f17f9e9b16ff8a89db3ceb73f28352766..052e41c13ac834a4a073d338cc434d21861bf194 100644 --- a/i18n/fra/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json +++ b/i18n/fra/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json @@ -6,5 +6,7 @@ { "searchMatches": "{0} correspondances trouvées", "searchMatch": "{0} correspondance trouvée", - "fileMatchAriaLabel": "{0} correspondances dans le fichier {1} du dossier {2}, Résultat de la recherche" + "fileMatchAriaLabel": "{0} correspondances dans le fichier {1} du dossier {2}, Résultat de la recherche", + "replacePreviewResultAria": "Remplacer le terme {0} par {1} à la position de colonne {2} dans la ligne avec le texte {3}", + "searchResultAria": "Terme {0} trouvé à la position de colonne {1} dans la ligne avec le texte {2}" } \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/snippets/electron-browser/TMSnippets.i18n.json b/i18n/fra/src/vs/workbench/parts/snippets/electron-browser/TMSnippets.i18n.json index 379815030a8eda30451c4fdfacd54db63dff33d6..ce5cfc948495ddb35c92c4fb56f512ed6dfbbe32 100644 --- a/i18n/fra/src/vs/workbench/parts/snippets/electron-browser/TMSnippets.i18n.json +++ b/i18n/fra/src/vs/workbench/parts/snippets/electron-browser/TMSnippets.i18n.json @@ -9,5 +9,6 @@ "vscode.extension.contributes.snippets-path": "Chemin du fichier d'extraits de code. Le chemin est relatif au dossier d'extensions et commence généralement par './snippets/'.", "invalid.language": "Langage inconnu dans 'contributes.{0}.language'. Valeur fournie : {1}", "invalid.path.0": "Chaîne attendue dans 'contributes.{0}.path'. Valeur fournie : {1}", - "invalid.path.1": "'contributes.{0}.path' ({1}) est censé être inclus dans le dossier ({2}) de l'extension. Cela risque de rendre l'extension non portable." + "invalid.path.1": "'contributes.{0}.path' ({1}) est censé être inclus dans le dossier ({2}) de l'extension. Cela risque de rendre l'extension non portable.", + "badVariableUse": "L'extrait de code \"{0}\" confond très probablement les variables et les espaces réservés d'extrait de code. Consultez https://code.visualstudio.com/docs/editor/userdefinedsnippets#_snippet-syntax pour plus d'informations." } \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/snippets/electron-browser/snippets.contribution.i18n.json b/i18n/fra/src/vs/workbench/parts/snippets/electron-browser/snippets.contribution.i18n.json index 0b77278c9389ac65c66005c63d24d740e31cf317..af0ca524f41df7f3f856b919c87e6c12a66721ec 100644 --- a/i18n/fra/src/vs/workbench/parts/snippets/electron-browser/snippets.contribution.i18n.json +++ b/i18n/fra/src/vs/workbench/parts/snippets/electron-browser/snippets.contribution.i18n.json @@ -11,6 +11,6 @@ "snippetSchema.json.default": "Extrait de code vide", "snippetSchema.json": "Configuration de l'extrait de code utilisateur", "snippetSchema.json.prefix": "Préfixe à utiliser durant la sélection de l'extrait de code dans IntelliSense", - "snippetSchema.json.body": "Contenu de l'extrait de code. Utilisez '${id}', '${id:label}', '${1:label}' pour les variables, et '$0', '$1' pour les positions du curseur", + "snippetSchema.json.body": "Contenu de l'extrait de code. Utilisez '$1', '${1:defaultText}' pour définir les positions du curseur, utilisez '$0' pour la position finale du curseur. Insérez les valeurs de variable avec '${varName}' et '${varName:defaultText}', par ex., 'Il s'agit du fichier : $TM_FILENAME'.", "snippetSchema.json.description": "Description de l'extrait de code." } \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/surveys/electron-browser/languageSurveys.contribution.i18n.json b/i18n/fra/src/vs/workbench/parts/surveys/electron-browser/languageSurveys.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..b68d1b3bcbbf27f0856190adf3c7a54ef7cd7cc4 --- /dev/null +++ b/i18n/fra/src/vs/workbench/parts/surveys/electron-browser/languageSurveys.contribution.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "helpUs": "Aidez-nous à améliorer le support de {0}", + "takeShortSurvey": "Répondre à une enquête rapide", + "remindLater": "Me le rappeler plus tard", + "neverAgain": "Ne plus afficher" +} \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/surveys/electron-browser/nps.contribution.i18n.json b/i18n/fra/src/vs/workbench/parts/surveys/electron-browser/nps.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..18c8f1427ffb0bebc6701a1ff10633d41eef56de --- /dev/null +++ b/i18n/fra/src/vs/workbench/parts/surveys/electron-browser/nps.contribution.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "surveyQuestion": "Acceptez-vous de répondre à une enquête rapide ?", + "takeSurvey": "Répondre à l'enquête", + "remindLater": "Me le rappeler plus tard", + "neverAgain": "Ne plus afficher" +} \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/tasks/browser/buildQuickOpen.i18n.json b/i18n/fra/src/vs/workbench/parts/tasks/browser/buildQuickOpen.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..c4f5420f0963bbf178ae5c46f2192c815dddcbab --- /dev/null +++ b/i18n/fra/src/vs/workbench/parts/tasks/browser/buildQuickOpen.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "noTasksMatching": "Aucune tâche correspondante" +} \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/tasks/browser/quickOpen.i18n.json b/i18n/fra/src/vs/workbench/parts/tasks/browser/quickOpen.i18n.json index c0432625724e130ef22a389a594c6fac63748493..34aab6d5ccf35fbecc65e5e36be954ad7738e7a5 100644 --- a/i18n/fra/src/vs/workbench/parts/tasks/browser/quickOpen.i18n.json +++ b/i18n/fra/src/vs/workbench/parts/tasks/browser/quickOpen.i18n.json @@ -4,5 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "entryAriaLabel": "{0}, tasks" + "entryAriaLabel": "{0}, tasks", + "customizeTask": "Personnaliser la tâche" } \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/tasks/browser/testQuickOpen.i18n.json b/i18n/fra/src/vs/workbench/parts/tasks/browser/testQuickOpen.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..c4f5420f0963bbf178ae5c46f2192c815dddcbab --- /dev/null +++ b/i18n/fra/src/vs/workbench/parts/tasks/browser/testQuickOpen.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "noTasksMatching": "Aucune tâche correspondante" +} \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/tasks/common/taskConfiguration.i18n.json b/i18n/fra/src/vs/workbench/parts/tasks/common/taskConfiguration.i18n.json index ae9887787513b401469f35ad1699785f1b99b459..cfdcd7341c0d1b4aad499f2f6702f4fa47afee25 100644 --- a/i18n/fra/src/vs/workbench/parts/tasks/common/taskConfiguration.i18n.json +++ b/i18n/fra/src/vs/workbench/parts/tasks/common/taskConfiguration.i18n.json @@ -5,13 +5,13 @@ // Do not edit this file. It is machine generated. { "ConfigurationParser.invalidCWD": "Warning: options.cwd must be of type string. Ignoring value {0}\n", - "ConfigurationParser.noShell": "Avertissement : La configuration de l'interpréteur de commandes n'est prise en charge que durant l'exécution des tâches dans le terminal.", "ConfigurationParser.noargs": "Erreur : les arguments de commande doivent correspondre à un tableau de chaînes. La valeur fournie est :\n{0}", + "ConfigurationParser.noShell": "Avertissement : La configuration de l'interpréteur de commandes n'est prise en charge que durant l'exécution des tâches dans le terminal.", "ConfigurationParser.noName": "Erreur : le détecteur de problèmes de correspondance dans la portée de déclaration doit avoir un nom :\n{0}\n", "ConfigurationParser.unknownMatcherKind": "Avertissement : le détecteur de problèmes de correspondance défini est inconnu. Les types pris en charge sont string | ProblemMatcher | (string | ProblemMatcher)[].\n{0}\n", "ConfigurationParser.invalidVaraibleReference": "Erreur : référence à problemMatcher non valide : {0}\n", "ConfigurationParser.noTaskName": "Erreur : les tâches doivent fournir une propriété taskName. La tâche va être ignorée.\n{0}\n", "taskConfiguration.shellArgs": "Avertissement : La tâche '{0}' est une commande d'interpréteur de commandes, et le nom de la commande ou l'un de ses arguments contient des espaces non précédés d'un caractère d'échappement. Pour garantir une ligne de commande correcte, fusionnez les arguments dans la commande.", - "taskConfiguration.noCommandOrDependsOn": "Erreur : La tâche '{0}' ne spécifie ni une commande, ni une propriété dependsOn. La tâche va être ignorée. Sa définition est :\n{1}", + "taskConfiguration.noCommandOrDependsOn": "Erreur : La tâche '{0}' ne spécifie ni une commande, ni une propriété dependsOn. La tâche est ignorée. Sa définition est :\n{1}", "taskConfiguration.noCommand": "Erreur : La tâche '{0}' ne définit aucune commande. La tâche va être ignorée. Sa définition est :\n{1}" } \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/tasks/electron-browser/jsonSchemaCommon.i18n.json b/i18n/fra/src/vs/workbench/parts/tasks/electron-browser/jsonSchemaCommon.i18n.json index f9b47cd0ac4cfbb821805e62aec6dcda1f403f36..4a1e27d2714b193b0aadf3782e9e24ad21058e70 100644 --- a/i18n/fra/src/vs/workbench/parts/tasks/electron-browser/jsonSchemaCommon.i18n.json +++ b/i18n/fra/src/vs/workbench/parts/tasks/electron-browser/jsonSchemaCommon.i18n.json @@ -7,6 +7,7 @@ "JsonSchema.options": "Options de commande supplémentaires", "JsonSchema.options.cwd": "Répertoire de travail actif du programme ou script exécuté. En cas d'omission, la racine de l'espace de travail actif de Code est utilisée.", "JsonSchema.options.env": "Environnement du programme ou de l'interpréteur de commandes exécuté. En cas d'omission, l'environnement du processus parent est utilisé.", + "JsonSchema.shellConfiguration": "Configure l'interpréteur de commandes à utiliser.", "JsonSchema.shell.executable": "Interpréteur de commandes à utiliser.", "JsonSchema.shell.args": "Arguments de l'interpréteur de commandes.", "JsonSchema.command": "Commande à exécuter. Il peut s'agir d'un programme externe ou d'une commande d'interpréteur de commandes.", diff --git a/i18n/fra/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v1.i18n.json b/i18n/fra/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v1.i18n.json index c2cb490358eee6eeedbc589ee26b4e70e246e2da..d125a6f5534f471b5a5fee254de8a26540c17f44 100644 --- a/i18n/fra/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v1.i18n.json +++ b/i18n/fra/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v1.i18n.json @@ -5,6 +5,8 @@ // Do not edit this file. It is machine generated. { "JsonSchema.version": "Numéro de version de la configuration", + "JsonSchema._runner": "Le runner est dégradé. Utiliser la propriété runner officielle", + "JsonSchema.runner": "Définit si la tâche est exécutée sous forme de processus, et si la sortie s'affiche dans la fenêtre de sortie ou dans le terminal.", "JsonSchema.windows": "Configuration de commande spécifique à Windows", "JsonSchema.mac": "Configuration de commande spécifique à Mac", "JsonSchema.linux": "Configuration de commande spécifique à Linux", diff --git a/i18n/fra/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.i18n.json b/i18n/fra/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.i18n.json index 19b06a2f224002b0cf690a80b641794fad442921..7df99994e1847d5efcf3ded1b89898667266796d 100644 --- a/i18n/fra/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.i18n.json +++ b/i18n/fra/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.i18n.json @@ -4,11 +4,14 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "JsonSchema.version": "Numéro de version de la configuration", - "JsonSchema.windows": "Configuration de commande spécifique à Windows", - "JsonSchema.mac": "Configuration de commande spécifique à Mac", - "JsonSchema.linux": "Configuration de commande spécifique à Linux", "JsonSchema.shell": "Spécifie si la commande est une commande d'interpréteur de commandes ou un programme externe. La valeur par défaut est false, en cas d'omission.", "JsonSchema.tasks.dependsOn.string": "Autre tâche dont cette tâche dépend.", - "JsonSchema.tasks.dependsOn.array": "Autres tâches dont cette tâche dépend." + "JsonSchema.tasks.dependsOn.array": "Autres tâches dont cette tâche dépend.", + "JsonSchema.tasks.group": "Définit le groupe d'exécution auquel la tâche appartient. En cas d'omission, la tâche n'appartient à aucun groupe.", + "JsonSchema.tasks.type": "Définit si la tâche est exécutée sous forme de processus ou d'une commande d'un interpréteur de commandes. La valeur par défaut est un processus.", + "JsonSchema.version": "Numéro de version de la configuration.", + "JsonSchema.tasks.customize": "Tâche ajoutée à personnaliser.", + "JsonSchema.windows": "Configuration de commande spécifique à Windows", + "JsonSchema.mac": "Configuration de commande spécifique à Mac", + "JsonSchema.linux": "Configuration de commande spécifique à Linux" } \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json b/i18n/fra/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json index e59f5fcb09a77789d84c13da0799849c25a963c9..f406beb28c88587e844c1d98b6d1322f169f529a 100644 --- a/i18n/fra/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json +++ b/i18n/fra/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json @@ -18,10 +18,12 @@ "problems": "Problèmes", "manyMarkers": "99", "tasks": "Tâches", + "TaskSystem.noHotSwap": "Le changement du moteur d'exécution de tâches nécessite le redémarrage de VS Code. Changement ignoré.", "TaskService.noBuildTask": "Aucune tâche de build définie. Marquez une tâche avec 'isBuildCommand' dans le fichier tasks.json.", "TaskService.noTestTask": "Aucune tâche de test définie. Marquez une tâche avec 'isTestCommand' dans le fichier tasks.json.", "TaskServer.noTask": "La tâche {0} à exécuter est introuvable.", - "TaskSystem.activeSame": "La tâche est déjà active et en mode espion. Pour terminer la tâche, utilisez 'F1 > terminer la tâche'", + "customizeParseErrors": "La configuration de tâche actuelle contient des erreurs. Corrigez-les avant de personnaliser une tâche. ", + "moreThanOneBuildTask": "De nombreuses tâches de génération sont définies dans le fichier tasks.json. Exécution de la première.\n", "TaskSystem.active": "Une tâche est déjà en cours d'exécution. Terminez-la avant d'exécuter une autre tâche.", "TaskSystem.restartFailed": "Échec de la fin de l'exécution de la tâche {0}", "TaskSystem.configurationErrors": "Erreur : la configuration de tâche fournie comporte des erreurs de validation et ne peut pas être utilisée. Corrigez d'abord les erreurs.", diff --git a/i18n/fra/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.i18n.json b/i18n/fra/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.i18n.json index 32ff4c480d3b6c23e494ed2a6b898fc46ec2e7a5..413680671bf493157f3140745a78fc20f6371c0b 100644 --- a/i18n/fra/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.i18n.json +++ b/i18n/fra/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.i18n.json @@ -6,5 +6,7 @@ { "TerminalTaskSystem.unknownError": "Une erreur inconnue s'est produite durant l'exécution d'une tâche. Pour plus d'informations, consultez le journal de sortie des tâches.", "TerminalTaskSystem.terminalName": "Tâche - {0}", - "TerminalTaskSystem": "Impossible d'exécuter une commande d'interpréteur de commandes sur un lecteur UNC." + "reuseTerminal": "Le terminal sera réutilisé par les tâches, appuyez sur une touche pour le fermer.", + "TerminalTaskSystem": "Impossible d'exécuter une commande d'interpréteur de commandes sur un lecteur UNC.", + "unkownProblemMatcher": "Impossible de résoudre le détecteur de problèmes {0}. Le détecteur est ignoré" } \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/tasks/node/processTaskSystem.i18n.json b/i18n/fra/src/vs/workbench/parts/tasks/node/processTaskSystem.i18n.json index a2ea447d1055af5148df0af5037048cabfe342c4..50a093077839ad501efc6524992f73ac9dbfe7bd 100644 --- a/i18n/fra/src/vs/workbench/parts/tasks/node/processTaskSystem.i18n.json +++ b/i18n/fra/src/vs/workbench/parts/tasks/node/processTaskSystem.i18n.json @@ -7,5 +7,6 @@ "TaskRunnerSystem.unknownError": "Une erreur inconnue s'est produite durant l'exécution d'une tâche. Pour plus d'informations, consultez le journal de sortie des tâches.", "TaskRunnerSystem.watchingBuildTaskFinished": "\nFin du suivi des tâches de génération.", "TaskRunnerSystem.childProcessError": "Failed to launch external program {0} {1}.", - "TaskRunnerSystem.cancelRequested": "\nThe task '{0}' was terminated per user request." + "TaskRunnerSystem.cancelRequested": "\nThe task '{0}' was terminated per user request.", + "unkownProblemMatcher": "Impossible de résoudre le détecteur de problèmes {0}. Le détecteur est ignoré" } \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/terminal/electron-browser/terminalActions.i18n.json b/i18n/fra/src/vs/workbench/parts/terminal/electron-browser/terminalActions.i18n.json index fdfee189e15bd74bc3f735886865d8d3c1457b8b..b2f5634cfe83e3acdfbf0df76c1c1453f3ffb6d4 100644 --- a/i18n/fra/src/vs/workbench/parts/terminal/electron-browser/terminalActions.i18n.json +++ b/i18n/fra/src/vs/workbench/parts/terminal/electron-browser/terminalActions.i18n.json @@ -8,6 +8,7 @@ "workbench.action.terminal.kill": "Tuer l'instance active du terminal", "workbench.action.terminal.kill.short": "Tuer le terminal", "workbench.action.terminal.copySelection": "Copier la sélection", + "workbench.action.terminal.selectAll": "Tout Sélectionner", "workbench.action.terminal.new": "Créer un terminal intégré", "workbench.action.terminal.new.short": "Nouveau terminal", "workbench.action.terminal.focus": "Focus sur le terminal", @@ -26,5 +27,8 @@ "workbench.action.terminal.scrollUp": "Faire défiler vers le haut (ligne)", "workbench.action.terminal.scrollUpPage": "Faire défiler vers le haut (page)", "workbench.action.terminal.scrollToTop": "Faire défiler jusqu'en haut", - "workbench.action.terminal.clear": "Effacer" + "workbench.action.terminal.clear": "Effacer", + "workbench.action.terminal.allowWorkspaceShell": "Autoriser la configuration de l'interpréteur de commandes de l'espace de travail", + "workbench.action.terminal.disallowWorkspaceShell": "Interdire la configuration de l'interpréteur de commandes de l'espace de travail", + "workbench.action.terminal.rename": "Renommer" } \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/terminal/electron-browser/terminalColorRegistry.i18n.json b/i18n/fra/src/vs/workbench/parts/terminal/electron-browser/terminalColorRegistry.i18n.json index 24d7761697ecca58299f1837cc0c6489950b2860..2a639927b494a60c0250bc95e3eb2e7d42fc2ce6 100644 --- a/i18n/fra/src/vs/workbench/parts/terminal/electron-browser/terminalColorRegistry.i18n.json +++ b/i18n/fra/src/vs/workbench/parts/terminal/electron-browser/terminalColorRegistry.i18n.json @@ -4,5 +4,7 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "terminal.background": "Couleur d'arrière-plan du terminal, permet d'appliquer au terminal une couleur différente de celle du panneau.", + "terminal.foreground": "Couleur de premier plan du terminal.", "terminal.ansiColor": "Couleur ansi '{0}' dans le terminal." } \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/terminal/electron-browser/terminalFindWidget.i18n.json b/i18n/fra/src/vs/workbench/parts/terminal/electron-browser/terminalFindWidget.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..6183484b59cad3c2ebfac56a5ee7a36280076366 --- /dev/null +++ b/i18n/fra/src/vs/workbench/parts/terminal/electron-browser/terminalFindWidget.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "label.find": "Rechercher", + "placeholder.find": "Rechercher", + "label.previousMatchButton": "Correspondance précédente", + "label.nextMatchButton": "Correspondance suivante", + "label.closeButton": "Fermer" +} \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.i18n.json b/i18n/fra/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.i18n.json index e783aa11ec074ffb5b2d192af1c416800276c5ca..1129e824638a8cecc7623ee2fa8a052a614a7bce 100644 --- a/i18n/fra/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.i18n.json +++ b/i18n/fra/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.i18n.json @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "terminal.integrated.copySelection.noSelection": "Impossible de copier la sélection du terminal quand il n'a pas le focus", "terminal.integrated.exitedWithCode": "Le processus du terminal s'est achevé avec le code de sortie {0}", "terminal.integrated.waitOnExit": "Appuyez sur une touche pour fermer le terminal", "terminal.integrated.launchFailed": "Échec du lancement de la commande de traitement du terminal '{0}{1}' (code de sortie : {2})" diff --git a/i18n/fra/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json b/i18n/fra/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json index 515d4f6f9c5869e7f2010ad3154c6871cb2d6c08..ae4ba496061e06c5a8a899298aa9f740e7ae73e0 100644 --- a/i18n/fra/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json +++ b/i18n/fra/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json @@ -6,6 +6,7 @@ { "selectTheme.label": "Thème de couleur", "installColorThemes": "Installer des thèmes de couleurs supplémentaires...", + "themes.selectTheme": "Sélectionner un thème de couleur (flèches bas/haut pour afficher l'aperçu)", "selectIconTheme.label": "Thème d'icône de fichier", "installIconThemes": "Installer des thèmes d'icônes de fichiers supplémentaires...", "noIconThemeLabel": "Aucun", diff --git a/i18n/fra/src/vs/workbench/parts/update/electron-browser/update.i18n.json b/i18n/fra/src/vs/workbench/parts/update/electron-browser/update.i18n.json index 641b395e494d60a76b9db48d41752e6e8990b70d..9f0475f53b4130a69ef9bcfdbb816aa7dd1717e2 100644 --- a/i18n/fra/src/vs/workbench/parts/update/electron-browser/update.i18n.json +++ b/i18n/fra/src/vs/workbench/parts/update/electron-browser/update.i18n.json @@ -15,5 +15,18 @@ "license": "Lire la licence", "updateAvailable": "{0} sera mis à jour après avoir redémarré.", "thereIsUpdateAvailable": "Une mise à jour est disponible.", - "noUpdatesAvailable": "Aucune mise à jour n'est disponible actuellement." + "noUpdatesAvailable": "Aucune mise à jour n'est disponible actuellement.", + "updateIsReady": "Nouvelle mise à jour disponible.", + "commandPalette": "Palette de commandes...", + "settings": "Paramètres", + "keyboardShortcuts": "Raccourcis clavier", + "selectTheme.label": "Thème de couleur", + "themes.selectIconTheme.label": "Thème d'icône de fichier", + "not available": "Mises à jour non disponibles", + "checkingForUpdates": "Recherche des mises à jour...", + "DownloadUpdate": "Télécharger la mise à jour disponible", + "DownloadingUpdate": "Téléchargement de la mise à jour...", + "InstallingUpdate": "Installation de la mise à jour...", + "restartToUpdate": "Redémarrer pour mettre à jour...", + "checkForUpdates": "Rechercher les mises à jour..." } \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/views/browser/views.i18n.json b/i18n/fra/src/vs/workbench/parts/views/browser/views.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..4868e0b0e11942a2f0db0667e1fc1cf8b851fb0b --- /dev/null +++ b/i18n/fra/src/vs/workbench/parts/views/browser/views.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "viewToolbarAriaLabel": "{0} actions" +} \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/views/browser/viewsExtensionPoint.i18n.json b/i18n/fra/src/vs/workbench/parts/views/browser/viewsExtensionPoint.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..792b28b26828d8e1a0dfba8ad647483b95fd3319 --- /dev/null +++ b/i18n/fra/src/vs/workbench/parts/views/browser/viewsExtensionPoint.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "requirearray": "les vues doivent figurer dans un tableau", + "requirestring": "la propriété '{0}' est obligatoire et doit être de type 'string'", + "optstring": "La propriété '{0}' peut être omise ou doit être de type 'string'", + "vscode.extension.contributes.view.id": "Identificateur de la vue. Utilisez-le pour inscrire un fournisseur de données au moyen de l'API 'vscode.window.registerTreeDataProviderForView', ainsi que pour déclencher l'activation de votre extension en inscrivant l'événement 'onView:${id}' dans 'activationEvents'.", + "vscode.extension.contributes.view.name": "Nom de la vue, contrôlable de visu. Affiché", + "vscode.extension.contributes.views": "Ajoute des vues à l'éditeur", + "views.explorer": "Mode Explorateur", + "locationId.invalid": "'{0}' n'est pas un emplacement de vue valide" +} \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json b/i18n/fra/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json index 88d26394dcf40cc0686e13a184ecfc0c60683d3a..97f83a61230f5bf23d25cdce5c76ade786092e25 100644 --- a/i18n/fra/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json +++ b/i18n/fra/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json @@ -11,20 +11,26 @@ "welcomePage.openFolder": "Ouvrir un dossier...", "welcomePage.cloneGitRepository": "Cloner le dépôt Git...", "welcomePage.recent": "Récent", + "welcomePage.moreRecent": "Plus...", "welcomePage.noRecentFolders": "Aucun dossier récent", "welcomePage.help": "Aide", + "welcomePage.keybindingsCheatsheet": "Fiche de révision du clavier imprimable", "welcomePage.introductoryVideos": "Vidéos d'introduction", "welcomePage.productDocumentation": "Documentation du produit", "welcomePage.gitHubRepository": "Dépôt GitHub", "welcomePage.stackOverflow": "Stack Overflow", "welcomePage.showOnStartup": "Afficher la page d'accueil au démarrage", "welcomePage.customize": "Personnaliser", + "welcomePage.installExtensionPacks": "Outils et langages", + "welcomePage.installExtensionPacksDescription": "Installer un support pour {0} et {1}", + "welcomePage.moreExtensions": "plus", "welcomePage.installKeymapDescription": "Installer les raccourcis clavier", + "welcomePage.installKeymapExtension": "Installer les raccourcis clavier de {0} et {1}", "welcomePage.others": "autres", "welcomePage.colorTheme": "Thème de couleur", "welcomePage.colorThemeDescription": "Personnalisez l'apparence de l'éditeur et de votre code", + "welcomePage.learn": "Apprendre", "welcomePage.showCommands": "Rechercher et exécuter toutes les commandes", - "welcomePage.showCommandsDescription": "Utilisez et recherchez rapidement des commandes dans le Panneau de configuration ({0})", "welcomePage.interfaceOverview": "Vue d'ensemble de l'interface", "welcomePage.interfaceOverviewDescription": "Obtenez une superposition visuelle mettant en évidence les principaux composants de l'IU", "welcomePage.interactivePlayground": "Terrain de jeu interactif", diff --git a/i18n/fra/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.contribution.i18n.json b/i18n/fra/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.contribution.i18n.json index 8cf53ce388ea5ee4fef86194ecbb7cb0e69eb75f..b3c44c1bab1e52d2c793f1ded775f6a58e32fd1f 100644 --- a/i18n/fra/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.contribution.i18n.json +++ b/i18n/fra/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.contribution.i18n.json @@ -4,7 +4,5 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "workbenchConfigurationTitle": "Banc d'essai", - "welcomePage.enabled": "Quand cette option est activée, la page de bienvenue s'affiche au démarrage.", "help": "Aide" } \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json b/i18n/fra/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json index 915c12960a049f577dc1d7b524dd390d6f0435fa..9f2d8bfccaf2676d90ff3e22bbd412b81fbff1a7 100644 --- a/i18n/fra/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json +++ b/i18n/fra/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json @@ -4,12 +4,35 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "workbenchConfigurationTitle": "Banc d'essai", + "welcomePage.enabled": "Quand cette option est activée, la page de bienvenue s'affiche au démarrage.", "welcomePage": "Bienvenue", + "welcomePage.javaScript": "JavaScript", + "welcomePage.typeScript": "TypeScript", + "welcomePage.python": "Python", + "welcomePage.php": "PHP", + "welcomePage.docker": "Docker", + "welcomePage.vim": "Vim", + "welcomePage.sublime": "Sublime", + "welcomePage.atom": "Atom", + "welcomePage.extensionPackAlreadyInstalled": "Le support pour {0} est déjà installé.", + "welcomePage.willReloadAfterInstallingExtensionPack": "La fenêtre se recharge après l'installation d'un support supplémentaire pour {0}.", + "welcomePage.installingExtensionPack": "Installation d'un support supplémentaire pour {0}...", + "welcomePage.extensionPackNotFound": "Le support pour {0} avec l'ID {1} est introuvable.", "welcomePage.keymapAlreadyInstalled": "Les raccourcis clavier {0} sont déjà installés.", "welcomePage.willReloadAfterInstallingKeymap": "La fenêtre se recharge après l'installation des raccourcis clavier {0}.", "welcomePage.installingKeymap": "Installation des raccourcis clavier de {0}...", "welcomePage.keymapNotFound": "Les raccourcis clavier {0} ayant l'ID {1} sont introuvables.", "welcome.title": "Bienvenue", + "welcomePage.openFolderWithPath": "Ouvrir le dossier {0} avec le chemin {1}", + "welcomePage.extensionListSeparator": ", ", + "welcomePage.installKeymap": "Installer le mappage de touches {0}", + "welcomePage.installExtensionPack": "Installer un support supplémentaire pour {0} ", + "welcomePage.installedKeymap": "Le mappage de touches '{0}' est déjà installé", + "welcomePage.installedExtensionPack": "Le support {0} est déjà installé.", "ok": "OK", - "cancel": "Annuler" + "details": "Détails", + "cancel": "Annuler", + "welcomePage.buttonBackground": "Couleur d'arrière-plan des boutons de la page d'accueil.", + "welcomePage.buttonHoverBackground": "Couleur d'arrière-plan du pointage des boutons de la page d'accueil." } \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json b/i18n/fra/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json index a27dad756b16e61a0d0095527759552221dbfb63..4fd64e5f282e16821ca17d798f4ab932784d7813 100644 --- a/i18n/fra/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json +++ b/i18n/fra/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json @@ -5,5 +5,6 @@ // Do not edit this file. It is machine generated. { "walkThrough.unboundCommand": "indépendant", - "walkThrough.gitNotFound": "Git semble ne pas être installé sur votre système." + "walkThrough.gitNotFound": "Git semble ne pas être installé sur votre système.", + "walkThrough.embeddedEditorBackground": "Couleur d'arrière-plan des éditeurs incorporés dans le terrain de jeu interactif." } \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json b/i18n/fra/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json index 8c86edbfa4038aba96487df8cce0b67533bfc70d..1e0860c2647e93b761d826d4db34e608bfd10cbc 100644 --- a/i18n/fra/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json +++ b/i18n/fra/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json @@ -6,6 +6,12 @@ { "open": "Ouvrir les paramètres", "close": "Fermer", + "saveAndRetry": "Enregistrer les paramètres et recommencer", "errorUnknownKey": "Impossible d'écrire dans le fichier de configuration (clé inconnue)", - "errorInvalidTarget": "Impossible d'écrire dans le fichier config (cible non valide)" + "errorInvalidTarget": "Impossible d'écrire dans le fichier config (cible non valide)", + "errorNoWorkspaceOpened": "Impossible d'écrire les paramètres, car aucun dossier n'est ouvert. Ouvrez d'abord un dossier, puis réessayez.", + "errorInvalidConfiguration": "Impossible d'écrire les paramètres. Ouvrez les **Paramètres utilisateur** pour corriger les erreurs/avertissements présents dans le fichier, puis réessayez.", + "errorInvalidConfigurationWorkspace": "Impossible d'écrire les paramètres. Ouvrez les **Paramètres d'espace de travail** pour corriger les erreurs/avertissements présents dans le fichier, puis réessayez.", + "errorConfigurationFileDirty": "Impossible d'écrire les paramètres, car l'intégrité du fichier est compromise. Enregistrez le fichier des **Paramètres utilisateur**, puis réessayez.", + "errorConfigurationFileDirtyWorkspace": "Impossible d'écrire les paramètres, car l'intégrité du fichier est compromise. Enregistrez le fichier des **Paramètres d'espace de travail**, puis réessayez." } \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/services/crashReporter/common/crashReporterService.i18n.json b/i18n/fra/src/vs/workbench/services/crashReporter/common/crashReporterService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..42bafb09091bafaf8ef4d7e46f380b4143ff1fc3 --- /dev/null +++ b/i18n/fra/src/vs/workbench/services/crashReporter/common/crashReporterService.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "telemetryConfigurationTitle": "Télémétrie", + "telemetry.enableCrashReporting": "Activez l'envoi de rapports d'incidents à Microsoft.\nCette option nécessite un redémarrage pour être prise en compte." +} \ No newline at end of file diff --git a/i18n/fra/src/vs/workbench/services/progress/browser/progressService2.i18n.json b/i18n/fra/src/vs/workbench/services/progress/browser/progressService2.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..541b82ff55a2e20b30bd3aa5d2d04420df3f9ea7 --- /dev/null +++ b/i18n/fra/src/vs/workbench/services/progress/browser/progressService2.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "progress.text": "{0} - {1}", + "progress.title": "{0} : {1}" +} \ No newline at end of file diff --git a/i18n/hun/extensions/configuration-editing/out/settingsDocumentHelper.i18n.json b/i18n/hun/extensions/configuration-editing/out/settingsDocumentHelper.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..7521c58758cb88e47612a24fd83b4b09ef76df8f --- /dev/null +++ b/i18n/hun/extensions/configuration-editing/out/settingsDocumentHelper.i18n.json @@ -0,0 +1,36 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "activeEditorShort": "pl.: myFile.txt", + "activeEditorMedium": "pl.: myFolder/myFile.txt", + "activeEditorLong": "pl.: /Users/Development/myProject/myFolder/myFile.txt", + "rootName": "pl.: myProject", + "rootPath": "pl.: /Users/Development/myProject", + "appName": "pl.: VS Code", + "dirty": "módosításjelző, ami akkor jelenik meg, ha az aktív szerkesztőablak tartalma módosítva lett", + "separator": "egy feltételes elválasztó (' - '), ami akkor jelenik meg, ha olyan változókkal van körülvéve, amelyeknek van értéke", + "assocLabelFile": "Fájlok kiterjesztésekkel", + "assocDescriptionFile": "A megadott azonosítójú nyelvhez tartozó glob mintának megfelelő fájlok feltérképezése.", + "assocLabelPath": "Fájlok elérési úttal", + "assocDescriptionPath": "A megadott azonosítójú nyelvhez tartozó abszolút elérési utas glob mintának megfelelő fájlok feltérképezése.", + "fileLabel": "Fájlok kiterjesztés szerint", + "fileDescription": "Adott kiterjesztéssel rendelkező fájlok keresése.", + "filesLabel": "Fájlok több kiterjesztés szerint", + "filesDescription": "A megadott kiterjesztések bármelyikével rendelkező fájlok keresése.", + "derivedLabel": "Testvérekkel rendelkező fájlok név szerint", + "derivedDescription": "Olyan fájlok keresése, amelyek azonos nevű, de különböző kiterjesztésű testvérekkel rendelkeznek.", + "topFolderLabel": "Mappák név szerint (legfelső szinten)", + "topFolderDescription": "Adott névvel rendelkező, legfelső szintű mappák keresése", + "topFoldersLabel": "Fájlok több név szerint (legfelső szinten)", + "topFoldersDescription": "Több legfelső szintű mappa keresése.", + "folderLabel": "Mappa név szerint (bármely helyen)", + "folderDescription": "Adott névvel rendelkező mappa keresése helytől függetlenül.", + "falseDescription": "A minta letiltása.", + "trueDescription": "A minta engedélyezése.", + "siblingsDescription": "Olyan fájlok keresése, amelyek azonos nevű, de különböző kiterjesztésű testvérekkel rendelkeznek.", + "languageSpecificEditorSettings": "Nyelvspecifikus szerkesztőbeállítások", + "languageSpecificEditorSettingsDescription": "A szerkesztő beállításainak felülírása az adott nyelvre vonatkozóan" +} \ No newline at end of file diff --git a/i18n/hun/extensions/css/client/out/cssMain.i18n.json b/i18n/hun/extensions/css/client/out/cssMain.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..ded2c0dd4761a045428e35639cb416892f120f29 --- /dev/null +++ b/i18n/hun/extensions/css/client/out/cssMain.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "cssserver.name": "CSS nyelvi szerver" +} \ No newline at end of file diff --git a/i18n/hun/extensions/css/package.i18n.json b/i18n/hun/extensions/css/package.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..5f6b8a4014be091e22df6a069ac2400aafd568ff --- /dev/null +++ b/i18n/hun/extensions/css/package.i18n.json @@ -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. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "css.lint.argumentsInColorFunction.desc": "Nem megfelelő számú paraméter", + "css.lint.boxModel.desc": "A width és a height tulajdonság kerülése a padding és a border tulajdonság használata esetén", + "css.lint.compatibleVendorPrefixes.desc": "Gyártóspecifikus előtag használata esetén minden más gyártóspecifikus tulajdonságot is meg kell adni", + "css.lint.duplicateProperties.desc": "Duplikált stílusdefiníciók kerülése", + "css.lint.emptyRules.desc": "Üres szabályhalmazok kerülése", + "css.lint.float.desc": "A float tulajdonságérték kerülése, mivel könnyen váratlan eredményt idézhet elő az elrendezés változásakor.", + "css.lint.fontFaceProperties.desc": "A @font-face szabályokban az src és a font-family tulajdonságot is definiálni kell", + "css.lint.hexColorLength.desc": "A hexadecimális formában megadott színeknek három vagy hat hexadecimális számjegyből kell állniuk", + "css.lint.idSelector.desc": "A szelektorok nem tartalmazhatnak azonosítókat, mivel az ilyen szabályok túl szorosan kötődnek a HTML-hez.", + "css.lint.ieHack.desc": "Az IE hangolása csak az IE7 vagy régebbi verziók támogatása esetén szükséges", + "css.lint.important.desc": "Az !important attribútum mellőzése. Az attribútum jelenléte arra utal, hogy a CSS-struktúra átláthatatlanná vált, és refaktorálásra szorul.", + "css.lint.importStatement.desc": "Ne töltődjenek párhuzamosan az importálási utasítások", + "css.lint.propertyIgnoredDueToDisplay.desc": "A megjelenítési mód miatt a megjelenítőkomponensek nem fogják figyelembe venni a tulajdonságot. Ha például a display tulajdonság értéke inline, akkor a megjelenítők figyelmen kívül hagyják a width, a height, a margin-top, a margin-bottom és a float tulajdonságot.", + "css.lint.universalSelector.desc": "Az univerzális szelektor (*) lassú működést eredményez", + "css.lint.unknownProperties.desc": "Ismeretlen tulajdonság.", + "css.lint.unknownVendorSpecificProperties.desc": "Ismeretlen gyártóspecifikus tulajdonság.", + "css.lint.vendorPrefix.desc": "Gyártóspecifikus előtagok használata esetén az adott tulajdonság szabványos változatát is meg kell adni", + "css.lint.zeroUnits.desc": "A 0 értékhez nem szükséges mértékegység", + "css.validate.desc": "Összes validálás engedélyezése vagy letiltása", + "less.lint.argumentsInColorFunction.desc": "Nem megfelelő számú paraméter", + "less.lint.boxModel.desc": "A width és a height tulajdonság kerülése a padding és a border tulajdonság használata esetén", + "less.lint.compatibleVendorPrefixes.desc": "Gyártóspecifikus előtag használata esetén minden más gyártóspecifikus tulajdonságot is meg kell adni", + "less.lint.duplicateProperties.desc": "Duplikált stílusdefiníciók kerülése", + "less.lint.emptyRules.desc": "Üres szabályhalmazok kerülése", + "less.lint.float.desc": "A float tulajdonságérték kerülése, mivel könnyen váratlan eredményt idézhet elő az elrendezés változásakor.", + "less.lint.fontFaceProperties.desc": "A @font-face szabályokban az src és a font-family tulajdonságot is definiálni kell", + "less.lint.hexColorLength.desc": "A hexadecimális formában megadott színeknek három vagy hat hexadecimális számjegyből kell állniuk", + "less.lint.idSelector.desc": "A szelektorok nem tartalmazhatnak azonosítókat, mivel az ilyen szabályok túl szorosan kötődnek a HTML-hez.", + "less.lint.ieHack.desc": "Az IE hangolása csak az IE7 vagy régebbi verziók támogatása esetén szükséges", + "less.lint.important.desc": "Az !important attribútum mellőzése. Az attribútum jelenléte arra utal, hogy a CSS-struktúra átláthatatlanná vált, és refaktorálásra szorul.", + "less.lint.importStatement.desc": "Ne töltődjenek párhuzamosan az importálási utasítások", + "less.lint.propertyIgnoredDueToDisplay.desc": "A megjelenítési mód miatt a megjelenítőkomponensek nem fogják figyelembe venni a tulajdonságot. Ha például a display tulajdonság értéke inline, akkor a megjelenítők figyelmen kívül hagyják a width, a height, a margin-top, a margin-bottom és a float tulajdonságot.", + "less.lint.universalSelector.desc": "Az univerzális szelektor (*) lassú működést eredményez", + "less.lint.unknownProperties.desc": "Ismeretlen tulajdonság.", + "less.lint.unknownVendorSpecificProperties.desc": "Ismeretlen gyártóspecifikus tulajdonság.", + "less.lint.vendorPrefix.desc": "Gyártóspecifikus előtagok használata esetén az adott tulajdonság szabványos változatát is meg kell adni", + "less.lint.zeroUnits.desc": "A 0 értékhez nem szükséges mértékegység", + "less.validate.desc": "Összes validálás engedélyezése vagy letiltása", + "scss.lint.argumentsInColorFunction.desc": "Nem megfelelő számú paraméter", + "scss.lint.boxModel.desc": "A width és a height tulajdonság kerülése a padding és a border tulajdonság használata esetén", + "scss.lint.compatibleVendorPrefixes.desc": "Gyártóspecifikus előtag használata esetén minden más gyártóspecifikus tulajdonságot is meg kell adni", + "scss.lint.duplicateProperties.desc": "Duplikált stílusdefiníciók kerülése", + "scss.lint.emptyRules.desc": "Üres szabályhalmazok kerülése", + "scss.lint.float.desc": "A float tulajdonságérték kerülése, mivel könnyen váratlan eredményt idézhet elő az elrendezés változásakor.", + "scss.lint.fontFaceProperties.desc": "A @font-face szabályokban az src és a font-family tulajdonságot is definiálni kell", + "scss.lint.hexColorLength.desc": "A hexadecimális formában megadott színeknek három vagy hat hexadecimális számjegyből kell állniuk", + "scss.lint.idSelector.desc": "A szelektorok nem tartalmazhatnak azonosítókat, mivel az ilyen szabályok túl szorosan kötődnek a HTML-hez.", + "scss.lint.ieHack.desc": "Az IE hangolása csak az IE7 vagy régebbi verziók támogatása esetén szükséges", + "scss.lint.important.desc": "Az !important attribútum mellőzése. Az attribútum jelenléte arra utal, hogy a CSS-struktúra átláthatatlanná vált, és refaktorálásra szorul.", + "scss.lint.importStatement.desc": "Ne töltődjenek párhuzamosan az importálási utasítások", + "scss.lint.propertyIgnoredDueToDisplay.desc": "A megjelenítési mód miatt a megjelenítőkomponensek nem fogják figyelembe venni a tulajdonságot. Ha például a display tulajdonság értéke inline, akkor a megjelenítők figyelmen kívül hagyják a width, a height, a margin-top, a margin-bottom és a float tulajdonságot.", + "scss.lint.universalSelector.desc": "Az univerzális szelektor (*) lassú működést eredményez", + "scss.lint.unknownProperties.desc": "Ismeretlen tulajdonság.", + "scss.lint.unknownVendorSpecificProperties.desc": "Ismeretlen gyártóspecifikus tulajdonság.", + "scss.lint.vendorPrefix.desc": "Gyártóspecifikus előtagok használata esetén az adott tulajdonság szabványos változatát is meg kell adni", + "scss.lint.zeroUnits.desc": "A 0 értékhez nem szükséges mértékegység", + "scss.validate.desc": "Összes validálás engedélyezése vagy letiltása", + "less.colorDecorators.enable.desc": "Színdekorátorok engedélyezése vagy letiltása", + "scss.colorDecorators.enable.desc": "Színdekorátorok engedélyezése vagy letiltása", + "css.colorDecorators.enable.desc": "Színdekorátorok engedélyezése vagy letiltása" +} \ No newline at end of file diff --git a/i18n/hun/extensions/extension-editing/out/packageDocumentHelper.i18n.json b/i18n/hun/extensions/extension-editing/out/packageDocumentHelper.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..12ff7e4eb5a04da718c5bc18852da313c6ef980f --- /dev/null +++ b/i18n/hun/extensions/extension-editing/out/packageDocumentHelper.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "languageSpecificEditorSettings": "Nyelvspecifikus szerkesztőbeállítások", + "languageSpecificEditorSettingsDescription": "A szerkesztő beállításainak felülírása az adott nyelvre vonatkozóan" +} \ No newline at end of file diff --git a/i18n/hun/extensions/git/out/askpass-main.i18n.json b/i18n/hun/extensions/git/out/askpass-main.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a --- /dev/null +++ b/i18n/hun/extensions/git/out/askpass-main.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{} \ No newline at end of file diff --git a/i18n/hun/extensions/git/out/commands.i18n.json b/i18n/hun/extensions/git/out/commands.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..2459ab031bd4a149bf9bcbcc42c931ddbb59f375 --- /dev/null +++ b/i18n/hun/extensions/git/out/commands.i18n.json @@ -0,0 +1,17 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "tag at": "Címke, a következőre mutat: {0}", + "remote branch at": "Távoli ág, a következőre mutat: {0}", + "repourl": "Forráskódtár URL-címe", + "yes": "Igen", + "always": "Mindig", + "commit message": "Beadási üzenet", + "pick remote": "Válassza ki a távoli szervert, ahová publikálni szeretné a(z) '{0}' ágat:", + "sync is unpredictable": "Ez a művelet pusholja és pullozza a commitokat a következő helyről: '{0}'.", + "ok": "OK", + "never again": "Rendben, ne jelenítse meg újra" +} \ No newline at end of file diff --git a/i18n/hun/extensions/git/out/main.i18n.json b/i18n/hun/extensions/git/out/main.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..024c38affd0b07e5ff6571a8e299ddc838b1915e --- /dev/null +++ b/i18n/hun/extensions/git/out/main.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "neverShowAgain": "Ne jelenítse meg újra" +} \ No newline at end of file diff --git a/i18n/hun/extensions/git/out/model.i18n.json b/i18n/hun/extensions/git/out/model.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..7dece8191bd872e1d8cbf265ae394712aa8d5e9a --- /dev/null +++ b/i18n/hun/extensions/git/out/model.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "merge changes": "Módosítások egyesítése", + "staged changes": "Beadásra előjegyzett módosítások", + "changes": "Módosítások", + "ok": "OK" +} \ No newline at end of file diff --git a/i18n/hun/extensions/git/out/scmProvider.i18n.json b/i18n/hun/extensions/git/out/scmProvider.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..7fded37328a95360b0ac60f4e287a4fdbfcaa1ea --- /dev/null +++ b/i18n/hun/extensions/git/out/scmProvider.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "commit": "Commit" +} \ No newline at end of file diff --git a/i18n/hun/extensions/git/out/statusbar.i18n.json b/i18n/hun/extensions/git/out/statusbar.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..a2c0dd5ce393590e399f7fb3b7312082895bd0bb --- /dev/null +++ b/i18n/hun/extensions/git/out/statusbar.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "sync changes": "Módosítások szinkronizálása" +} \ No newline at end of file diff --git a/i18n/hun/extensions/git/package.i18n.json b/i18n/hun/extensions/git/package.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..9c502715934129f869ccc7c66eda6010555bfe2e --- /dev/null +++ b/i18n/hun/extensions/git/package.i18n.json @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "command.clone": "Klónozás", + "command.refresh": "Frissítés", + "command.openFile": "Fájl megnyitása", + "command.commit": "Commit", + "command.commitStaged": "Beadásra előjegyezve", + "command.commitStagedSigned": "Előjegyzettek beadása (commit) aláírással", + "command.commitAll": "Teljes beadás", + "command.commitAllSigned": "Összes beadása (commit) aláírással", + "command.undoCommit": "Legutolsó beadás (commit) visszavonása", + "command.pull": "Letöltés", + "command.push": "Feltöltés", + "command.pushTo": "Push...", + "command.sync": "Szinkronizálás", + "command.publish": "Ág publikálása", + "command.showOutput": "Git kimenet megjelenítése", + "config.path": "Elérési út a git végrehajtható fájljához", + "config.autorefresh": "Meghatározza, hogy engedélyezve van-e az automatikus frissítés" +} \ No newline at end of file diff --git a/i18n/hun/extensions/grunt/out/main.i18n.json b/i18n/hun/extensions/grunt/out/main.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..9c9746663158bea3537d5e0966aa4749567d5e64 --- /dev/null +++ b/i18n/hun/extensions/grunt/out/main.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "execFailed": "A Grunt automatikus felderítése nem sikerült a következő hiba miatt: {0}" +} \ No newline at end of file diff --git a/i18n/hun/extensions/grunt/package.i18n.json b/i18n/hun/extensions/grunt/package.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..9888b20bc6a5f8742b32c12b6d3bf9d29eb8590c --- /dev/null +++ b/i18n/hun/extensions/grunt/package.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "config.grunt.autoDetect": "Meghatározza, hogy a Grunt feladatok automatikus felderításe be van-e kapcsolva. A beállítás alapértelmezetten aktív." +} \ No newline at end of file diff --git a/i18n/hun/extensions/gulp/out/main.i18n.json b/i18n/hun/extensions/gulp/out/main.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..8c8ac9db0317f10e6352e89fedaa5f29a85b491c --- /dev/null +++ b/i18n/hun/extensions/gulp/out/main.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "execFailed": "A gulp automatikus felderítése nem sikerült a következő hiba miatt: {0}" +} \ No newline at end of file diff --git a/i18n/hun/extensions/gulp/package.i18n.json b/i18n/hun/extensions/gulp/package.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..ecaab76d9c7853f6a82d52cfdccd3e1d5a5a02ee --- /dev/null +++ b/i18n/hun/extensions/gulp/package.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "config.gulp.autoDetect": "Meghatározza, hogy a Gulp feladatok automatikus felderításe be van-e kapcsolva. A beállítás alapértelmezetten aktív." +} \ No newline at end of file diff --git a/i18n/hun/extensions/html/client/out/htmlMain.i18n.json b/i18n/hun/extensions/html/client/out/htmlMain.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..3aff5dce6a06a16504b2a89675efc7a0bd570bc0 --- /dev/null +++ b/i18n/hun/extensions/html/client/out/htmlMain.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "htmlserver.name": "HTML nyelvi szerver" +} \ No newline at end of file diff --git a/i18n/hun/extensions/html/package.i18n.json b/i18n/hun/extensions/html/package.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..1eea9c9eee6614d9c1304f284bdfa8568cdaa399 --- /dev/null +++ b/i18n/hun/extensions/html/package.i18n.json @@ -0,0 +1,27 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "html.format.enable.desc": "Alapértelmezett HTML-formázó engedélyezése vagy letiltása (újraindítást igényel)", + "html.format.wrapLineLength.desc": "Maximális karakterszám soronként (0 = letiltás)", + "html.format.unformatted.desc": "Azon elemek vesszővel elválasztott listája, melyek ne legyenek újraformázva. 'null' érték esetén a https://www.w3.org/TR/html5/dom.html#phrasing-content oldalon listázott elemek lesznek használva.", + "html.format.contentUnformatted.desc": "Azon elemek vesszővel elválasztott listája, melyek ne legyenek újraformázva. 'null' érték esetén a 'pre' tag lesz használva.", + "html.format.indentInnerHtml.desc": "- és -szakaszok indentálása.", + "html.format.preserveNewLines.desc": "Az elemek előtt lévő sortörések meg legyenek-e hagyva. Csak elemek előtt működik, elemek belsejében vagy szövegben nem.", + "html.format.maxPreserveNewLines.desc": "Az egymás után megőrzött sortörések maximális száma. Ha nem szeretné korlátozni, használja a 'null' értéket!", + "html.format.indentHandlebars.desc": "{{#foo}} és {{/foo}} formázása és indentálása.", + "html.format.endWithNewline.desc": "Lezárás új sorral.", + "html.format.extraLiners.desc": "Azon elemek veszővel elválasztott listája, amelyek előtt lennie kell egy extra új sornak. 'null' érték esetén a \"head,body,/html\" érték van használva.", + "html.format.wrapAttributes.desc": "Attribútumok tördelése.", + "html.format.wrapAttributes.auto": "Az attribútumok csak akkor vannak tördelve, ha a sorhossz túl lett lépve.", + "html.format.wrapAttributes.force": "Minden egyes attribútum tördelve van, kivéve az elsőt.", + "html.format.wrapAttributes.forcealign": "Minden egyes attribútum tördelve van, kivéve az elsőt, és igazítva vannak.", + "html.format.wrapAttributes.forcemultiline": "Minden egyes attribútum tördelve van.", + "html.suggest.angular1.desc": "Meghatározza, hogy a beépített HTML nyelvi támogatás ajánl-e Angular V1 elemeket és tulajdonságokat.", + "html.suggest.ionic.desc": "Meghatározza, hogy a beépített HTML nyelvi támogatás ajánl-e Ionic elemeket, tulajdonságokat és értékeket.", + "html.suggest.html5.desc": "Meghatározza, hogy a beépített HTML nyelvi támogatás ajánl-e HTML5-ös elemeket, tulajdonságokat és értékeket.", + "html.validate.scripts": "Meghatározza, hogy a beépített HTML nyelvi támogatás validálja-e a beágyazott parancsafájlokat.", + "html.validate.styles": "Meghatározza, hogy a beépített HTML nyelvi támogatás validálja-e a beágyazott stílusfájlokat." +} \ No newline at end of file diff --git a/i18n/hun/extensions/jake/out/main.i18n.json b/i18n/hun/extensions/jake/out/main.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..c73ae9cac7e911d40e5462e8aa7948af702ec246 --- /dev/null +++ b/i18n/hun/extensions/jake/out/main.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "execFailed": "A Jake automatikus felderítése nem sikerült a következő hiba miatt: {0}" +} \ No newline at end of file diff --git a/i18n/hun/extensions/jake/package.i18n.json b/i18n/hun/extensions/jake/package.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..4ac74e50f940faa94d86be6d615e3ca145f85b0c --- /dev/null +++ b/i18n/hun/extensions/jake/package.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "config.jake.autoDetect": "Meghatározza, hogy a Jake-feladatok automatikus felderításe be van-e kapcsolva. A beállítás alapértelmezetten aktív." +} \ No newline at end of file diff --git a/i18n/hun/extensions/javascript/out/features/bowerJSONContribution.i18n.json b/i18n/hun/extensions/javascript/out/features/bowerJSONContribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..c1e4df9ef01413c4ffe5592f0b37b8af5bd9ceb2 --- /dev/null +++ b/i18n/hun/extensions/javascript/out/features/bowerJSONContribution.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "json.bower.default": "Alapértelmezett bower.json", + "json.bower.error.repoaccess": "A bower-adattár lekérdezése nem sikerült: {0}", + "json.bower.latest.version": "legutóbbi" +} \ No newline at end of file diff --git a/i18n/hun/extensions/javascript/out/features/packageJSONContribution.i18n.json b/i18n/hun/extensions/javascript/out/features/packageJSONContribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..364a0ae2d172f0c2229f9611d723e6c0cff8c14a --- /dev/null +++ b/i18n/hun/extensions/javascript/out/features/packageJSONContribution.i18n.json @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "json.package.default": "Alapértelmezett package.json", + "json.npm.error.repoaccess": "Az NPM-adattár lekérdezése nem sikerült: {0}", + "json.npm.latestversion": "A csomag jelenlegi legújabb verziója", + "json.npm.majorversion": "A legfrissebb főverzió keresése (1.x.x)", + "json.npm.minorversion": "A legfrissebb alverzió keresése (1.2.x)", + "json.npm.version.hover": "Legújabb verzió: {0}" +} \ No newline at end of file diff --git a/i18n/hun/extensions/json/client/out/jsonMain.i18n.json b/i18n/hun/extensions/json/client/out/jsonMain.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..a71a351271b115891817e66cf05a0b52132265a8 --- /dev/null +++ b/i18n/hun/extensions/json/client/out/jsonMain.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "jsonserver.name": "JSON nyelvi szerver" +} \ No newline at end of file diff --git a/i18n/hun/extensions/json/package.i18n.json b/i18n/hun/extensions/json/package.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..9357a63ffaf869283d8ea308a0afcb1cd28cf4a4 --- /dev/null +++ b/i18n/hun/extensions/json/package.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "json.schemas.desc": "Sémák hozzárendelése JSON-fájlokhoz a jelenlegi projektben", + "json.schemas.url.desc": "Egy séma URL-címe vagy egy séma relatív elérési útja az aktuális könyvtárban", + "json.schemas.fileMatch.desc": "Fájlminták tömbje, amely a JSON-fájlok sémákhoz való rendelésénél van használva.", + "json.schemas.fileMatch.item.desc": "Fájlminták tömbje, amely a JSON-fájlok sémákhoz való rendelésénél van használva. Tartalmazhat '*'-ot.", + "json.schemas.schema.desc": "Az adott URL-cím sémadefiníciója. A sémát csak a séma URL-címéhez való fölösleges lekérdezések megakadályozása érdekében kell megadni.", + "json.format.enable.desc": "Alapértelmezett JSON-formázó engedélyezése vagy letiltása (újraindítást igényel)", + "json.tracing.desc": "A VS Code és a JSON nyelvi szerver közötti kommunikáció naplózása.", + "json.colorDecorators.enable.desc": "Színdekorátorok engedélyezése vagy letiltása" +} \ No newline at end of file diff --git a/i18n/hun/extensions/markdown/out/extension.i18n.json b/i18n/hun/extensions/markdown/out/extension.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..5f2c5343afb2869e83c5926872ff637751b01a1d --- /dev/null +++ b/i18n/hun/extensions/markdown/out/extension.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "onPreviewStyleLoadError": "A 'markdown.styles' nem tölthető be: {0}" +} \ No newline at end of file diff --git a/i18n/hun/extensions/markdown/out/previewContentProvider.i18n.json b/i18n/hun/extensions/markdown/out/previewContentProvider.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..9e943e324b8ac1c1bda529ee23418af1f51db958 --- /dev/null +++ b/i18n/hun/extensions/markdown/out/previewContentProvider.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "preview.securityMessage.text": "A parancsfájlok futtatása le van tiltva az aktuális dokumentumban", + "preview.securityMessage.title": "A parancsfájlok futtatása le van tiltva a markdown-előnézetben. Módosítsa a markdown-előnézet biztonsági beállításait a parancsfájlok engedélyezéséhez", + "preview.securityMessage.label": "Biztonsági figyelmeztetés: a parancsfájlok le vannak tiltva" +} \ No newline at end of file diff --git a/i18n/hun/extensions/markdown/out/security.i18n.json b/i18n/hun/extensions/markdown/out/security.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..2bba397346ffc0eb1e81e33920f8f002f8bfc24f --- /dev/null +++ b/i18n/hun/extensions/markdown/out/security.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "preview.showPreviewSecuritySelector.disallowScriptsForWorkspaceTitle": "Parancsfájlok futtatásának letiltása a markdown-előnézetben ezen a munkaterületen", + "preview.showPreviewSecuritySelector.currentSelection": "Aktuális beállítás", + "preview.showPreviewSecuritySelector.allowScriptsForWorkspaceTitle": "Parancsfájlok futtatásának engedélyezése a markdown-előnézetben ezen a munkaterületen", + "preview.showPreviewSecuritySelector.title": "A markdown-előnézet biztonsági beállításainak módosítása" +} \ No newline at end of file diff --git a/i18n/hun/extensions/markdown/package.i18n.json b/i18n/hun/extensions/markdown/package.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..8c3641582cb80c7d8afdca9d4d09734e8ae416ce --- /dev/null +++ b/i18n/hun/extensions/markdown/package.i18n.json @@ -0,0 +1,22 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "markdown.preview.doubleClickToSwitchToEditor.desc": "Kattintson duplán a markdown-előnézetre a szerkesztőre való átváltáshoz.", + "markdown.preview.fontFamily.desc": "Meghatározza a markdown-előnézeten használt betűkészletet.", + "markdown.preview.fontSize.desc": "Meghatározza a markdown-előnézet betűméretét, pixelekben.", + "markdown.preview.lineHeight.desc": "Meghatározza a markdown-előnézeten használt sormagasságot. Az érték relatív a betűmérethez képest.", + "markdown.preview.markEditorSelection.desc": "Az aktuális kijelölés megjelölése a markdown-előnézeten", + "markdown.preview.scrollEditorWithPreview.desc": "Amikor a markdown-előnézetet görgetik, a szerkesztőnézet is aktualizálódik", + "markdown.preview.scrollPreviewWithEditorSelection.desc": "A markdown-előnézetet úgy görgeti, hogy látni lehessen az aktuálisan kijelölt sort", + "markdown.preview.title": "Előnézet megnyitása", + "markdown.previewFrontMatter.dec": "Meghatározza, hogy a YAML konfiguráció (front matter) hogyan legyen megjelenítve a markdown-előnézetben. A 'hide' elrejti a konfigurációt, minden más esetben a front matter markdown-tartalomként van kezelve.", + "markdown.previewSide.title": "Előnézet megnyitása oldalt", + "markdown.showSource.title": "Forrás megjelenítése", + "markdown.styles.dec": "CSS-stíluslapok URL-címeinek vagy helyi elérési útjainak listája, amelyek a markdown-előnézeten használva vannak. A relatív elérési utak az intézőben megnyitott mappához képest vannak relatívan értelmezve. Ha nincs mappa megnyitva, akkor a markdown-fájl elréséi útjához képest. Minden '\\' karaktert '\\\\' formában kell megadni.", + "markdown.showPreviewSecuritySelector.title": "A markdown-előnézet biztonsági beállításainak módosítása", + "markdown.preview.enableExperimentalExtensionApi.desc": "[Kísérleti] Kiterjesztések módosíthatják a markdown előnézetet.", + "markdown.trace.desc": "Hibakeresési napló engedélyezése a markdown kiterjesztésben." +} \ No newline at end of file diff --git a/i18n/hun/extensions/merge-conflict/out/codelensProvider.i18n.json b/i18n/hun/extensions/merge-conflict/out/codelensProvider.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..7dfc4ee0d5de0dd8e6ff23d92d62eb731799d26a --- /dev/null +++ b/i18n/hun/extensions/merge-conflict/out/codelensProvider.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "acceptCurrentChange": "Helyi változtatás elfogadása", + "acceptIncomingChange": "Beérkező változtatás elfogadása", + "acceptBothChanges": "Változtatások elfogadása mindkét oldalról", + "compareChanges": "Változtatások összehasonlítása" +} \ No newline at end of file diff --git a/i18n/hun/extensions/merge-conflict/out/commandHandler.i18n.json b/i18n/hun/extensions/merge-conflict/out/commandHandler.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..16d242a669ce62faa26e4c7cf331663027e02c65 --- /dev/null +++ b/i18n/hun/extensions/merge-conflict/out/commandHandler.i18n.json @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "cursorNotInConflict": "A szerkesztőablak kurzora nem egy összeolvasztási konfliktuson belül van.", + "compareChangesTitle": "{0}: Helyi változtatások ⟷ Beérkező változtatások", + "cursorOnCommonAncestorsRange": "A szerkesztőablak kurzora a közös ős blokkján van. Vigye vagy a \"helyi\" vagy a \"beérkező\" blokkra.", + "cursorOnSplitterRange": "A szerkesztőablak kurzora az összeolvasztási konfliktus elválasztójánál van. Vigye vagy a \"helyi\" vagy a \"beérkező\" blokkra.", + "noConflicts": "Ebben a fájlban nincsenek összeolvasztási konfliktusok", + "noOtherConflictsInThisFile": "Ebben a fájlban nincsenek további összeolvasztási konfliktusok" +} \ No newline at end of file diff --git a/i18n/hun/extensions/merge-conflict/out/mergeDecorator.i18n.json b/i18n/hun/extensions/merge-conflict/out/mergeDecorator.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..dac641cdd10997e4843e182190ec09f65582c17d --- /dev/null +++ b/i18n/hun/extensions/merge-conflict/out/mergeDecorator.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "currentChange": "(Helyi változtatás)", + "incomingChange": "(Beérkező változtatás)" +} \ No newline at end of file diff --git a/i18n/hun/extensions/merge-conflict/package.i18n.json b/i18n/hun/extensions/merge-conflict/package.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..b3814f8d7e637e0b5f8a7740333822346f96c09f --- /dev/null +++ b/i18n/hun/extensions/merge-conflict/package.i18n.json @@ -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. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "command.category": "Összeolvasztási konfliktus", + "command.accept.all-incoming": "Összes beérkező változás elfogadása", + "command.accept.all-both": "Változások elfogadása mindkét oldalról", + "command.accept.current": "Helyi változtatás elfogadása", + "command.accept.incoming": "Beérkező változtatás elfogadása", + "command.accept.selection": "Kijelölt változtatás elfogadása", + "command.accept.both": "Változás elfogadása mindkét oldalról", + "command.next": "Következő konfliktus", + "command.previous": "Előző konfliktus", + "command.compare": "Aktuális konfliktus összehasonlítása", + "config.title": "Összeolvasztási konfliktus", + "config.codeLensEnabled": "Összeolvasztási konfliktust jelző kódlencsék engedélyezése vagy letiltása a szerkesztőablakban.", + "config.decoratorsEnabled": "Összeolvasztási konfliktust jelző dekorátorok engedélyezése vagy letiltása a szerkesztőablakban." +} \ No newline at end of file diff --git a/i18n/hun/extensions/npm/package.i18n.json b/i18n/hun/extensions/npm/package.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..89c11886b21ac4d6b00a42e82f64cf707d1e4952 --- /dev/null +++ b/i18n/hun/extensions/npm/package.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "config.npm.autoDetect": "Meghatározza, hogy az npm-parancsfájlok automatikus felderításe be van-e kapcsolva. A beállítás alapértelmezetten aktív." +} \ No newline at end of file diff --git a/i18n/hun/extensions/php/out/features/validationProvider.i18n.json b/i18n/hun/extensions/php/out/features/validationProvider.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..2786c871df69c19c3ee67ba0ae936a3ef7b9c49f --- /dev/null +++ b/i18n/hun/extensions/php/out/features/validationProvider.i18n.json @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "php.useExecutablePath": "Engedélyezi a(z) {0} (munkaterületi beállításként megadott) végrehajtását a PHP-fájlok linteléséhez?", + "php.yes": "Engedélyezés", + "php.no": "Tiltás", + "wrongExecutable": "A validáció nem sikerült, mivel a(z) {0} nem egy érvényes php végrehajtható fájl. Használja a 'php.validate.executablePath' beállítást a PHP végrehajtható fájl konfigurálásához!", + "noExecutable": "A validáció nem sikerült, mivel nincs beállítva PHP végrehajtható fájl. Használja a 'php.validate.executablePath' beállítást a PHP végrehajtható fájl konfigurálásához!", + "unknownReason": "Nem sikerült futtatni a PHP-t a következő elérési út használatával: {0}. Az ok ismeretlen." +} \ No newline at end of file diff --git a/i18n/hun/extensions/php/package.i18n.json b/i18n/hun/extensions/php/package.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..59e189e72c4c43d3d8d6b229c7cfc8d7754f188d --- /dev/null +++ b/i18n/hun/extensions/php/package.i18n.json @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "configuration.suggest.basic": "Meghatározza, hogy a beépített PHP nyelvi támogatás ajánl-e PHP globálisokat és változókat.", + "configuration.validate.enable": "Beépített PHP-validáció engedélyezése vagy letiltása", + "configuration.validate.executablePath": "A PHP végrehajtható fájljának elérési útja.", + "configuration.validate.run": "A linter mentéskor vagy gépeléskor fut-e.", + "configuration.title": "PHP", + "commands.categroy.php": "PHP", + "command.untrustValidationExecutable": "PHP-validációs végrehajtható fájl letiltása (munkaterületi beállításként megadva)" +} \ No newline at end of file diff --git a/i18n/hun/extensions/typescript/out/features/bufferSyncSupport.i18n.json b/i18n/hun/extensions/typescript/out/features/bufferSyncSupport.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..36e9902ff5e78ca25e56c231ea3576f0869c20b6 --- /dev/null +++ b/i18n/hun/extensions/typescript/out/features/bufferSyncSupport.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "versionMismatch": "TypeScript ({1}) használata a szerkesztőfunkciókhoz. A számítógére TypeScript (01}) van globálisan telepítve. A VS Code-ban látható hibák eltérhetnek a TSC által visszaadott hibáktól.", + "moreInformation": "További információ", + "doNotCheckAgain": "Ne ellenőrizze újra", + "close": "Bezárás", + "updateTscCheck": "A 'typescript.check.tscVersion' felhasználói beállítás értéke módosítva false-ra" +} \ No newline at end of file diff --git a/i18n/hun/extensions/typescript/out/features/completionItemProvider.i18n.json b/i18n/hun/extensions/typescript/out/features/completionItemProvider.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..69b50af008f826622d3dbc0de087c81df9a0e999 --- /dev/null +++ b/i18n/hun/extensions/typescript/out/features/completionItemProvider.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "acquiringTypingsLabel": "Típusdefiníciók letöltése...", + "acquiringTypingsDetail": "Típusdefiníciók letöltése az IntelliSense-hez." +} \ No newline at end of file diff --git a/i18n/hun/extensions/typescript/out/features/directiveCommentCompletionProvider.i18n.json b/i18n/hun/extensions/typescript/out/features/directiveCommentCompletionProvider.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..4785b97e7228d35bef35b87aef50c232005e4172 --- /dev/null +++ b/i18n/hun/extensions/typescript/out/features/directiveCommentCompletionProvider.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "ts-check": "Engedélyezi a JavaScript-fájlok szemantikai ellenőrzését. A fájl tetején kell szerepelnie.", + "ts-nocheck": "Letiltja a JavaScript-fájlok szemantikai ellenőrzését. A fájl tetején kell szerepelnie.", + "ts-ignore": "Elfedi a fájl következő sorában található @ts-check-hibákat." +} \ No newline at end of file diff --git a/i18n/hun/extensions/typescript/out/features/implementationsCodeLensProvider.i18n.json b/i18n/hun/extensions/typescript/out/features/implementationsCodeLensProvider.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..f5a576fa8a74e80f664f1070aed87e090dee3a62 --- /dev/null +++ b/i18n/hun/extensions/typescript/out/features/implementationsCodeLensProvider.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "oneImplementationLabel": "1 implementáció", + "manyImplementationLabel": "{0} implementáció", + "implementationsErrorLabel": "Nem sikerült meghatározni az implementációkat" +} \ No newline at end of file diff --git a/i18n/hun/extensions/typescript/out/features/jsDocCompletionProvider.i18n.json b/i18n/hun/extensions/typescript/out/features/jsDocCompletionProvider.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..c1b25917e3b52b352a34f1371497941f32b2d3dc --- /dev/null +++ b/i18n/hun/extensions/typescript/out/features/jsDocCompletionProvider.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "typescript.jsDocCompletionItem.documentation": "JSDoc-megjegyzés" +} \ No newline at end of file diff --git a/i18n/hun/extensions/typescript/out/features/referencesCodeLensProvider.i18n.json b/i18n/hun/extensions/typescript/out/features/referencesCodeLensProvider.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..797518b5091029e8ce48f9bc135aacc49e0a46e9 --- /dev/null +++ b/i18n/hun/extensions/typescript/out/features/referencesCodeLensProvider.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "oneReferenceLabel": "1 referencia", + "manyReferenceLabel": "{0} referencia", + "referenceErrorLabel": "Nem sikerült meghatározni a referenciákat" +} \ No newline at end of file diff --git a/i18n/hun/extensions/typescript/out/typescriptMain.i18n.json b/i18n/hun/extensions/typescript/out/typescriptMain.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..c521fb331a6d229b7ae06a62b562681dd79fcb75 --- /dev/null +++ b/i18n/hun/extensions/typescript/out/typescriptMain.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "typescript.projectConfigNoWorkspace": "Nyisson meg egy mappát a VS Code-ban typescriptes vagy javascriptes projekt használatához!", + "typescript.projectConfigUnsupportedFile": "Nem sikerült meghatározni a TypeScript- vagy JavaScript-projektet. Nem támogatott fájltípus", + "typescript.projectConfigCouldNotGetInfo": "Nem sikerült meghatározni a TypeScript- vagy JavaScript-projektet", + "typescript.noTypeScriptProjectConfig": "A fájl nem része egy TypeScript-projektnek", + "typescript.noJavaScriptProjectConfig": "A fájl nem része egy JavaScript-projektnek", + "typescript.configureTsconfigQuickPick": "tsconfig.json konfigurálása", + "typescript.configureJsconfigQuickPick": "jsconfig.json konfigurálása", + "typescript.projectConfigLearnMore": "További információ" +} \ No newline at end of file diff --git a/i18n/hun/extensions/typescript/out/typescriptServiceClient.i18n.json b/i18n/hun/extensions/typescript/out/typescriptServiceClient.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..e46f95c0a626a58f425161881b9d4dd0d1ee0b1d --- /dev/null +++ b/i18n/hun/extensions/typescript/out/typescriptServiceClient.i18n.json @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "noServerFound": "A(z) {0} elérési út nem egy érvényes tsserver-telepítésre mutat. A beépített TypeScript-verzió lesz használva.", + "noBundledServerFound": "A VSCode beépített TS-szerverét törölte egy másik alkalmazás, például egy hibásan viselkedő víruskereső eszköz. Telepítse újra a VSCode-ot! ", + "versionNumber.custom": "egyedi", + "serverCouldNotBeStarted": "Nem sikerült elindítani a TypeScript nyelvi szervert. Hibaüzenet: {0}", + "useVSCodeVersionOption": "A VSCode verziójának használata", + "activeVersion": "Jelenleg aktív", + "useWorkspaceVersionOption": "A munkaterület verziójának használata", + "learnMore": "További információ", + "selectTsVersion": "Válassza ki a javascriptes és typescriptes nyelvi funkciókhoz használt TypeScript-verziót", + "typescript.openTsServerLog.notSupported": "A TS-szerver naplózáshoz TS 2.2.2+ szükséges", + "typescript.openTsServerLog.loggingNotEnabled": "A TS-szervernaplózás ki van kapcsolva. Állítsa be a `typescript.tsserver.log` beállítást, majd indítsa újra a TS-szervert a naplózás engedélyezéséhez!", + "typescript.openTsServerLog.enableAndReloadOption": "Naplózás engedélyezése és TS-szerver újraindítása", + "typescript.openTsServerLog.noLogFile": "A TS-szerver nem kezdett el naplózni", + "openTsServerLog.openFileFailedFailed": "A TS-szervernapló nem nyitható meg", + "serverDiedAfterStart": "A TypeScript nyelvi szolgáltatás öt alkalommal omlott össze rögtön azután, hogy el lett indítva. A szolgáltatás nem lesz újraindítva.", + "serverDiedReportIssue": "Probléma jelentése", + "serverDied": "A TypeScript nyelvi szolgáltatás öt alkalommal omlott össze az elmúlt öt percben." +} \ No newline at end of file diff --git a/i18n/hun/extensions/typescript/out/utils/logger.i18n.json b/i18n/hun/extensions/typescript/out/utils/logger.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..bc738f43d0c37059f5f771d3763cdf52b10ab10d --- /dev/null +++ b/i18n/hun/extensions/typescript/out/utils/logger.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "channelName": "TypeScript" +} \ No newline at end of file diff --git a/i18n/hun/extensions/typescript/out/utils/projectStatus.i18n.json b/i18n/hun/extensions/typescript/out/utils/projectStatus.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..a75ecaf059829f310aa0d22153da707052aa29fd --- /dev/null +++ b/i18n/hun/extensions/typescript/out/utils/projectStatus.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "hintExclude": "A JavaScript/TypeScript funkciók teljes projektre való engedélyezéséhez zárja ki a sok fájlt tartalmazó mappákat. Például: {0}", + "hintExclude.generic": "A JavaScript/TypeScript funkciók teljes projektre való engedélyezéséhez zárja ki azokat a mappákat, amelyben olyan forrásfájlok találhatók, melyen nem dolgozik.", + "large.label": "Kivételek konfigurálása", + "hintExclude.tooltip": "A JavaScript/TypeScript funkciók teljes projektre való engedélyezéséhez zárja ki azokat a mappákat, amelyben olyan forrásfájlok találhatók, melyen nem dolgozik. " +} \ No newline at end of file diff --git a/i18n/hun/extensions/typescript/out/utils/typingsStatus.i18n.json b/i18n/hun/extensions/typescript/out/utils/typingsStatus.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..4b308f26e042525834eb310587ecaf822015a681 --- /dev/null +++ b/i18n/hun/extensions/typescript/out/utils/typingsStatus.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "installingPackages": "Adatok lekérése a jobb typescriptes IntelliSense-hez", + "typesInstallerInitializationFailed.title": "Nem sikerült telepíteni a típusdefiníciós fájlokat a javascriptes nyelvi funkciókhoz. Győződjön meg róla, hogy az NPM telepítve van vagy módosítsa a 'typescript.npm' beállítás értékét a felhasználói beállításokban", + "typesInstallerInitializationFailed.moreInformation": "További információ", + "typesInstallerInitializationFailed.doNotCheckAgain": "Ne ellenőrizze újra", + "typesInstallerInitializationFailed.close": "Bezárás" +} \ No newline at end of file diff --git a/i18n/hun/extensions/typescript/package.i18n.json b/i18n/hun/extensions/typescript/package.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..42fa728d94191dcd4cf7b45f4be881dd3ba06b31 --- /dev/null +++ b/i18n/hun/extensions/typescript/package.i18n.json @@ -0,0 +1,48 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "typescript.reloadProjects.title": "Projekt újratöltése", + "javascript.reloadProjects.title": "Projekt újratöltése", + "configuration.typescript": "TypeScript", + "typescript.useCodeSnippetsOnMethodSuggest.dec": "Függvények kiegészítése paraméterdefiníciójukkal.", + "typescript.tsdk.desc": "A tsservert és a lib*.d.ts fájlokat tartalmazó mappa elérési útja.", + "typescript.disableAutomaticTypeAcquisition": "Automatikus típusdefiníció-letöltés letiltása. Legalább 2.0.6-os TypeScriptet igényel, és a módosítás után újraindítás szükséges.", + "typescript.check.tscVersion": "Megvizsgálja, hogy a globálisan telepített TypeScript fordító (pl. tsc) különbözik-e a TypeScript nyelvi szolgáltatás által használttól.", + "typescript.tsserver.log": "Engedélyezi a TS-szerver naplózását egy fájlba. Ez a napló a TS-szerverrel kapcsolatos problémák diagnosztizálására használható. A napló tartalmazhat elérési utakat, forráskódot és más potenciálisan érzékeny, projekttel kapcsolatos adatot.", + "typescript.tsserver.trace": "Engedélyezi a TS-szervernek küldött üzenetek naplózását. Ez a napló a TS-szerverrel kapcsolatos problémák diagnosztizálására használható. A napló tartalmazhat elérési utakat, forráskódot és más potenciálisan érzékeny, projekttel kapcsolatos adatot. ", + "typescript.validate.enable": "TypeScript-validálás engedélyezése vagy letiltása.", + "typescript.format.enable": "Alapértelmezett TypeScript-formázó engedélyezése vagy letiltása.", + "javascript.format.enable": "Alapértelmezett JavaScript-formázó engedélyezése vagy letiltása.", + "format.insertSpaceAfterCommaDelimiter": "Meghatározza a szóközök kezelését vessző elválasztókarakter után.", + "format.insertSpaceAfterConstructor": "Meghatározza a szóközök kezelését a constructor kulcsszó után. TypeScript >= 2.3.0-t igényel.", + "format.insertSpaceAfterSemicolonInForStatements": "Meghatározza a szóközök kezelését pontosvessző után a for ciklusban.", + "format.insertSpaceBeforeAndAfterBinaryOperators": "Meghatározza a szóközök kezelését bináris operátorok után.", + "format.insertSpaceAfterKeywordsInControlFlowStatements": "Meghatározza a szóközök kezelését vezérlési szerkezetek kulcsszavai után.", + "format.insertSpaceAfterFunctionKeywordForAnonymousFunctions": "Meghatározza a szóközök kezelését a névtelen függvényekben található function kulcsszó után.", + "format.insertSpaceBeforeFunctionParenthesis": "Meghatározza a szóközök kezelését a függvényargumentumokat tartalmazó zárójel előtt. TypeScript >= 2.1.5-öt igényel.", + "format.insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": "Meghatározza a szóközök kezelését nem üres zárójelek nyitása után és zárása előtt.", + "format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": "Meghatározza a szóközök kezelését nem üres szögletes zárójelek nyitása után és zárása előtt.", + "format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": "Meghatározza a szóközök kezelését nem üres kapcsos zárójelek nyitása után és zárása előtt. TypeScript >= 2.3.0-t igényel.", + "format.insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": "Meghatározza a szóközök kezelését a sablonkarakterláncok (template stringek) kapcsos zárójeleinek nyitása után és zárása előtt. TypeScript >= 2.0.6-ot igényel.", + "format.insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces": "Meghatározza a szóközök kezelését JSX-kifejezések kapcsos zárójeleinek nyitása után és zárása előtt. TypeScript >= 2.0.6-ot igényel.", + "format.placeOpenBraceOnNewLineForFunctions": "Meghatározza, hogy a függvények nyitó kapcsos zárójelei új sorba kerüljenek-e vagy sem.", + "format.placeOpenBraceOnNewLineForControlBlocks": "Meghatározza, hogy a vezérlőblokkok nyitó kapcsos zárójelei új sorba kerüljenek-e vagy sem.", + "javascript.validate.enable": "JavaScript-validálás engedélyezése vagy letiltása.", + "typescript.goToProjectConfig.title": "Projektkonfiguráció megkeresése", + "javascript.goToProjectConfig.title": "Projektkonfiguráció megkeresése", + "javascript.referencesCodeLens.enabled": "Referencia kódlencsék engedélyezése vagy letiltása a JavaScript-fájlokban.", + "typescript.referencesCodeLens.enabled": "Referencia kódlencsék engedélyezése vagy letiltása a TypeScript-fájlokban. TypeScript >= 2.0.6-ot igényel.", + "typescript.implementationsCodeLens.enabled": "Implementációs kódlencsék engedélyezése vagy letiltása. TypeScript >= 2.2.0-t igényel.", + "typescript.openTsServerLog.title": "TS-szervernapló megnyitása", + "typescript.restartTsServer": "TS-szerver újraindítása", + "typescript.selectTypeScriptVersion.title": "TypeScript-verzió kiválasztása", + "jsDocCompletion.enabled": "Automatikus JSDoc-megjegyzések engedélyezése vagy letiltása", + "javascript.implicitProjectConfig.checkJs": "JavaScript-fájlok szemantikai ellenőrzésének engedélyezése vagy letiltása. A meglévő jsconfig.json vagy tsconfig.json fájlok felülírják ezt a beállítást. TypeScript >= 2.3.1-et igényel.", + "typescript.npm": "Az automatikus típusdefiníció-letöltéshez használt NPM végrehajtható fájl elérési útja. TypeScript 2.3.4-et igényel.", + "typescript.check.npmIsInstalled": "Ellenőrizze, hogy az NPM telepítve van-e az automatikus típusdefiníció-letöltéshez.", + "javascript.nameSuggestions": "Egyedi nevek listázásának engedélyezése a javascriptes javaslati listákban.", + "typescript.tsc.autoDetect": "Meghatározza, hogy a tsc-feladatok automatikus felderítése be van-e kapcsolva." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/base/browser/ui/actionbar/actionbar.i18n.json b/i18n/hun/src/vs/base/browser/ui/actionbar/actionbar.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..4ecb2c803f4cd296354114cedc1d8ec138c4677c --- /dev/null +++ b/i18n/hun/src/vs/base/browser/ui/actionbar/actionbar.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "titleLabel": "{0} ({1})" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/base/browser/ui/aria/aria.i18n.json b/i18n/hun/src/vs/base/browser/ui/aria/aria.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..3bc0f0c0e684bcfa6c35714bfd72f64a765ab92e --- /dev/null +++ b/i18n/hun/src/vs/base/browser/ui/aria/aria.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "repeated": "{0} (ismét előfordult)" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/base/browser/ui/findinput/findInput.i18n.json b/i18n/hun/src/vs/base/browser/ui/findinput/findInput.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..d43a176512b4de290ad2f1723f7314b96a4a3dc0 --- /dev/null +++ b/i18n/hun/src/vs/base/browser/ui/findinput/findInput.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "defaultLabel": "bemeneti adat" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/base/browser/ui/findinput/findInputCheckboxes.i18n.json b/i18n/hun/src/vs/base/browser/ui/findinput/findInputCheckboxes.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..d165fd190240acb95d733beb122da03c4fa341b4 --- /dev/null +++ b/i18n/hun/src/vs/base/browser/ui/findinput/findInputCheckboxes.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "caseDescription": "Kis- és nagybetűk megkülönböztetése", + "wordsDescription": "Csak teljes szavas egyezés", + "regexDescription": "Reguláris kifejezés használata" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/base/browser/ui/inputbox/inputBox.i18n.json b/i18n/hun/src/vs/base/browser/ui/inputbox/inputBox.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..f6a7c8c5b206961b3699be217f9ae7afd43ee9bb --- /dev/null +++ b/i18n/hun/src/vs/base/browser/ui/inputbox/inputBox.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "alertErrorMessage": "Hiba: {0}", + "alertWarningMessage": "Figyelmeztetés: {0}", + "alertInfoMessage": "Információ: {0}" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json b/i18n/hun/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..a5030e91872054c4ff74cae62f3975e32e8eac19 --- /dev/null +++ b/i18n/hun/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "imgMeta": "{0}x{1} {2}", + "largeImageError": "A kép túl nagy a szerkesztőben való megjelenítéshez.", + "resourceOpenExternalButton": "Kép megnyitása külső program használatával?", + "nativeBinaryError": "A fájl nem jeleníthető meg a szerkesztőben, mert bináris adatokat tartalmaz, túl nagy vagy nem támogatott szövegkódolást használ.", + "sizeB": "{0} B", + "sizeKB": "{0} KB", + "sizeMB": "{0} MB", + "sizeGB": "{0} GB", + "sizeTB": "{0} TB" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/base/browser/ui/toolbar/toolbar.i18n.json b/i18n/hun/src/vs/base/browser/ui/toolbar/toolbar.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..d28a4867625d1792b716be1d6f922920c2e272ad --- /dev/null +++ b/i18n/hun/src/vs/base/browser/ui/toolbar/toolbar.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "more": "Tovább" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/base/common/errorMessage.i18n.json b/i18n/hun/src/vs/base/common/errorMessage.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..a5107de5d65b1ac8588df739d544081a2c5e7277 --- /dev/null +++ b/i18n/hun/src/vs/base/common/errorMessage.i18n.json @@ -0,0 +1,17 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "message": "{0}: {1}", + "error.permission.verbose": "Engedélyhiány (HTTP {0})", + "error.permission": "Engedélyhiány", + "error.http.verbose": "{0} (HTTP {1}: {2})", + "error.http": "{0} (HTTP {1})", + "error.connection.unknown.verbose": "Ismeretlen csatlakozási hiba ({0})", + "error.connection.unknown": "Ismeretlen csatlakozási hiba történt. Vagy megszakadt az internetkapcsolat, vagy a kiszolgáló vált offline-ná.", + "stackTrace.format": "{0}: {1}", + "error.defaultMessage": "Ismeretlen hiba történt. Részletek a naplóban.", + "error.moreErrors": "{0} (összesen {1} hiba)" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/base/common/jsonErrorMessages.i18n.json b/i18n/hun/src/vs/base/common/jsonErrorMessages.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..c73ba839ef69682ff09be7a32b974cbdb57abb18 --- /dev/null +++ b/i18n/hun/src/vs/base/common/jsonErrorMessages.i18n.json @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "error.invalidSymbol": "Érvénytelen szimbólum", + "error.invalidNumberFormat": "Érvénytelen számformátum.", + "error.propertyNameExpected": "Hiányzó tulajdonságnév", + "error.valueExpected": "Hiányzó érték.", + "error.colonExpected": "Hiányzó kettőspont.", + "error.commaExpected": "Hiányzó vessző", + "error.closeBraceExpected": "Hiányzó záró kapcsos zárójel", + "error.closeBracketExpected": "Hiányzó záró szögletes zárójel", + "error.endOfFileExpected": "Itt fájlvége jelnek kellene szerepelnie." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/base/common/keybindingLabels.i18n.json b/i18n/hun/src/vs/base/common/keybindingLabels.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a --- /dev/null +++ b/i18n/hun/src/vs/base/common/keybindingLabels.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{} \ No newline at end of file diff --git a/i18n/hun/src/vs/base/common/processes.i18n.json b/i18n/hun/src/vs/base/common/processes.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..d80423e4ca7778febe21cfbbe70d9d5809841e4a --- /dev/null +++ b/i18n/hun/src/vs/base/common/processes.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "ExecutableParser.commandMissing": "Hiba: a végrehajtási információnak definiálnia kell egy karakterlánc típusú parancsot.", + "ExecutableParser.isShellCommand": "Figyelmeztetés: az isShellCommand értékének boolean típusúnak kell lennie. A következő érték figyelmen kívül van hagyva: {0}.", + "ExecutableParser.args": "Figyelmeztetés: az args értékének string[] típusúnak kell lennie. A következő érték figyelmen kívül van hagyva: {0}.", + "ExecutableParser.invalidCWD": "Figyelmeztetés: az options.cwd értékének string típusúnak kell lennie. A következő érték figyelmen kívül van hagyva: {0}." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/base/common/severity.i18n.json b/i18n/hun/src/vs/base/common/severity.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..5c503caf2798103db5cb77b8419569b3756bf638 --- /dev/null +++ b/i18n/hun/src/vs/base/common/severity.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "sev.error": "Hiba", + "sev.warning": "Figyelmeztetés", + "sev.info": "Információ" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/base/node/processes.i18n.json b/i18n/hun/src/vs/base/node/processes.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..9e3ad98b69c3a010171d2e318bca012db90d03cb --- /dev/null +++ b/i18n/hun/src/vs/base/node/processes.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "TaskRunner.UNC": "Rendszerparancsok UNC-meghajtókon nem hajthatók végre." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/base/node/zip.i18n.json b/i18n/hun/src/vs/base/node/zip.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..feb34282ee736119459d9ff352d80a729d4747f0 --- /dev/null +++ b/i18n/hun/src/vs/base/node/zip.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "notFound": "{0} nem található a zipen belül." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/base/parts/quickopen/browser/quickOpenModel.i18n.json b/i18n/hun/src/vs/base/parts/quickopen/browser/quickOpenModel.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..fb2705ff3c83b0a2cea948181ca9ae5015272175 --- /dev/null +++ b/i18n/hun/src/vs/base/parts/quickopen/browser/quickOpenModel.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "quickOpenAriaLabelEntry": "{0}, választó", + "quickOpenAriaLabel": "választó" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/base/parts/quickopen/browser/quickOpenWidget.i18n.json b/i18n/hun/src/vs/base/parts/quickopen/browser/quickOpenWidget.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..095139488e0b55a115b4d1c57275daf0491f96cf --- /dev/null +++ b/i18n/hun/src/vs/base/parts/quickopen/browser/quickOpenWidget.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "quickOpenAriaLabel": "Gyorsválasztó. Kezdjen el gépelni a találati lista szűkítéséhez!", + "treeAriaLabel": "Gyorsválasztó" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/base/parts/tree/browser/treeDefaults.i18n.json b/i18n/hun/src/vs/base/parts/tree/browser/treeDefaults.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..1bb27ebb3237f1ade48f6594aa0b2613a131fa14 --- /dev/null +++ b/i18n/hun/src/vs/base/parts/tree/browser/treeDefaults.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "collapse": "Összecsukás" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/code/electron-main/menus.i18n.json b/i18n/hun/src/vs/code/electron-main/menus.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..72b0fe6308632c625d1e1212560759b761fd48a2 --- /dev/null +++ b/i18n/hun/src/vs/code/electron-main/menus.i18n.json @@ -0,0 +1,178 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "mFile": "&&Fájl", + "mEdit": "Sz&&erkesztés", + "mSelection": "Kijelölé&&s", + "mView": "&&Nézet", + "mGoto": "U&&grás", + "mDebug": "Hi&&bakeresés", + "mWindow": "Ablak", + "mHelp": "&&Súgó", + "mTask": "&&Feladatok", + "miNewWindow": "Új &&ablak", + "mAbout": "A(z) {0} névjegye", + "mServices": "Szolgáltatások", + "mHide": "{0} elrejtése", + "mHideOthers": "Egyebek elrejtése", + "mShowAll": "Az összes megjelenítése", + "miQuit": "Kilépés innen: {0}", + "miNewFile": "Ú&&j fájl", + "miOpen": "&&Megnyitás", + "miOpenFolder": "Ma&&ppa megnyitása", + "miOpenFile": "&&Fájl megnyitása", + "miOpenRecent": "&&Legutóbbi megnyitása", + "miSave": "Menté&&s", + "miSaveAs": "M&&entés másként", + "miSaveAll": "Összes men&&tése", + "miAutoSave": "Automatikus mentés", + "miRevert": "Fájl &&visszaállítása", + "miCloseWindow": "Ablak be&&zárása", + "miCloseFolder": "Mappa &&bezárása", + "miCloseEditor": "Szer&&kesztőablak bezárása", + "miExit": "&&Kilépés", + "miOpenSettings": "&&Beállítások", + "miOpenKeymap": "&&Billentyűparancsok", + "miOpenKeymapExtensions": "Billentyűparancs-kiegészítő&&k", + "miOpenSnippets": "Felhasználói kód&&részletek", + "miSelectColorTheme": "Szín&&téma", + "miSelectIconTheme": "Fájl&&ikonok témája", + "miPreferences": "&&Beállítások", + "miReopenClosedEditor": "Bezárt szerkesztőablak ú&&jranyitása", + "miMore": "&&Továbbiak...", + "miClearRecentOpen": "Leg&&utóbbi fájlok listájának törlése", + "miUndo": "&&Visszavonás", + "miRedo": "Ú&&jra", + "miCut": "&&Kivágás", + "miCopy": "&&Másolás", + "miPaste": "&&Beillesztés", + "miFind": "K&&eresés", + "miReplace": "&&Csere", + "miFindInFiles": "Keresés a &&fájlokban", + "miReplaceInFiles": "Csere a fá&&jlokban", + "miEmmetExpandAbbreviation": "Emmet: Rövidítés k&&ibontása", + "miShowEmmetCommands": "E&&mmet...", + "miToggleLineComment": "&&Egysoros megjegyzés ki-/bekapcsolása", + "miToggleBlockComment": "Me&&gjegyzésblokk ki-/bekapcsolása", + "miMultiCursorAlt": "Alt+kattintás használata több kurzorhoz", + "miMultiCursorCmd": "Cmd+kattintás használata több kurzorhoz", + "miMultiCursorCtrl": "Ctrl+kattintás használata több kurzorhoz", + "miInsertCursorAbove": "&&Kurzor beszúrása egy sorral feljebb", + "miInsertCursorBelow": "Ku&&rzor beszúrása egy sorral feljebb", + "miInsertCursorAtEndOfEachLineSelected": "K&&urzor beszúrása a sorok végére", + "miAddSelectionToNextFindMatch": "&&Következő találat kijelölése", + "miAddSelectionToPreviousFindMatch": "&&Előző találat kijelölése", + "miSelectHighlights": "Az összes keresési találat &&kijelölése", + "miCopyLinesUp": "Sor másolása eggyel &&feljebb", + "miCopyLinesDown": "Sor másolása eggyel &&lejjebb", + "miMoveLinesUp": "Sor feljebb &&helyezése", + "miMoveLinesDown": "Sor lejje&&bb helyezése", + "miSelectAll": "Az össze&&s kijelölése", + "miSmartSelectGrow": "Kijelölés &&bővítése", + "miSmartSelectShrink": "Ki&&jelölés szűkítése", + "miViewExplorer": "Fájlk&&ezelő", + "miViewSearch": "&&Keresés", + "miViewSCM": "&&Verziókezelés", + "miViewDebug": "&&Hibakeresés", + "miViewExtensions": "Kiegé&&szítők", + "miToggleOutput": "&&Kimenet", + "miToggleDebugConsole": "Hi&&bakeresési konzol", + "miToggleIntegratedTerminal": "Beépített term&&inál", + "miMarker": "&&Problémák", + "miAdditionalViews": "További &&nézetek", + "miCommandPalette": "Paran&&cskatalógus...", + "miToggleFullScreen": "&&Teljes képernyő be- és kikapcsolása", + "miToggleZenMode": "Zen mód be- és kikapcsolása", + "miToggleMenuBar": "Menüsáv &&be- és kikapcsolása", + "miSplitEditor": "Szerkesztőablak k&&ettéosztása", + "miToggleEditorLayout": "Szerkesztőablak-csoport e&&lrendezésének váltása", + "miToggleSidebar": "&&Oldalsáv be- és kikapcsolása", + "miMoveSidebarRight": "Oldalsáv áthelyezése &&jobbra", + "miMoveSidebarLeft": "Oldalsáv áthelyezése &&balra", + "miTogglePanel": "&&Panel be- és kikapcsolása", + "miHideStatusbar": "Állapotsor &&elrejtése", + "miShowStatusbar": "Állapotsor &&megjelenítése", + "miHideActivityBar": "&&Tevékenységsáv elrejtése", + "miShowActivityBar": "&&Tevékenységsáv megjelenítése", + "miToggleWordWrap": "&&Sortörés be- és kikapcsolása", + "miToggleRenderWhitespace": "S&&zóközök kirajzolásának be- és kikapcsolása", + "miToggleRenderControlCharacters": "&&Vezérlőkarakterek kirajzolásának be- és kikapcsolása", + "miZoomIn": "&&Nagyítás", + "miZoomOut": "&&Kicsinyítés", + "miZoomReset": "&&Nagyítási szint alaphelyzetbe állítása", + "miBack": "&&Vissza", + "miForward": "&&Előre", + "miNextEditor": "&&Következő szerkesztőablak", + "miPreviousEditor": "&&Előző szerkesztőablak", + "miNextEditorInGroup": "Következő &&használt szerkesztőablak a csoportban", + "miPreviousEditorInGroup": "Következő h&&asznált szerkesztőablak a csoportban", + "miSwitchEditor": "Sz&&szerkesztőablak váltása", + "miFocusFirstGroup": "&&Első csoport", + "miFocusSecondGroup": "&&Második csoport", + "miFocusThirdGroup": "&&Harmadik csoport", + "miNextGroup": "&&Következő csoport", + "miPreviousGroup": "&&Előző csoport", + "miSwitchGroup": "Csoport &&váltása", + "miGotoFile": "Ugrás &&fájlhoz...", + "miGotoSymbolInFile": "Ugrás szim&&bólumhoz egy fájlban...", + "miGotoSymbolInWorkspace": "Ugrás szimbólumhoz a &&munkaterületen...", + "miGotoDefinition": "Ugrás a &&definícióra", + "miGotoTypeDefinition": "Ugrás a &&típusdefinícióra", + "miGotoImplementation": "Ugrás az &&implementációra", + "miGotoLine": "&&Sor megkeresáse...", + "miStartDebugging": "Hibakeresés indítá&&sa", + "miStartWithoutDebugging": "Indítás hibakeresés &&nélkül", + "miStopDebugging": "Hibakeresés leállítá&&sa", + "miRestart Debugging": "Hibakeresés új&&raindítása", + "miOpenConfigurations": "&&Konfigurációk megnyitása", + "miAddConfiguration": "Konfiguráció hozzáadása...", + "miStepOver": "Á&&tugrás", + "miStepInto": "&&Belépés", + "miStepOut": "&&Kilépés", + "miContinue": "&&Folytatás", + "miToggleBreakpoint": "&&Töréspont be- és kikapcsolása", + "miConditionalBreakpoint": "Feltételes törés&&pont", + "miColumnBreakpoint": "Töréspont &&oszlopnál", + "miFunctionBreakpoint": "Töréspont&&funkció...", + "miNewBreakpoint": "Ú&&j töréspont", + "miEnableAllBreakpoints": "Összes töréspont engedélyezése", + "miDisableAllBreakpoints": "Összes töréspont leti&<ása", + "miRemoveAllBreakpoints": "Összes töréspont eltávolítás&&a", + "miInstallAdditionalDebuggers": "Tovább&&i hibakeresők telepítése", + "mMinimize": "Kis méret", + "mZoom": "Nagyítás", + "mBringToFront": "Legyen az összes előtérben", + "miSwitchWindow": "&&Ablak váltása...", + "miToggleDevTools": "&&Fejlesztői eszközök be- és kikapcsolása", + "miAccessibilityOptions": "&&Kisegítő lehetőségek", + "miReportIssues": "&&Problémák jelentése", + "miWelcome": "Üdvözlő&&oldal", + "miInteractivePlayground": "&&Interaktív játszótér", + "miDocumentation": "&&Dokumentáció", + "miReleaseNotes": "&&Kiadási jegyzék", + "miKeyboardShortcuts": "Billentyűparancs-&&referencia", + "miIntroductoryVideos": "Bemutató&&videók", + "miTwitter": "&&Csatlakozzon hozzánk a Twitteren", + "miUserVoice": "Funkcióigények keresé&&se", + "miLicense": "&&Licenc megtekintése", + "miPrivacyStatement": "&&Adatvédelmi nyilatkozat", + "miAbout": "&&Névjegy", + "miRunTask": "&&Feladat futtatása...", + "miRestartTask": "F&&eladat újraindítása", + "miTerminateTask": "Felada&&t megszakítása", + "miBuildTask": "&&Buildelési feladat", + "miTestTask": "Tesztelési felad&&at", + "miShowTaskLog": "Feladat&&napló megtekintése", + "accessibilityOptionsWindowTitle": "Kisegítő lehetőségek beállításai", + "miRestartToUpdate": "Újraindítás a frissítéshez...", + "miCheckingForUpdates": "Frissítések keresése...", + "miDownloadUpdate": "Elérhető frissítés letöltése", + "miDownloadingUpdate": "Frissítés letöltése...", + "miInstallingUpdate": "Frissítés telepítése...", + "miCheckForUpdates": "Frissítések keresése...", + "aboutDetail": "\nVerzió: {0}\nCommit: {1}\nDátum: {2}\nShell: {3}\nRendelő: {4}\nNode: {5}", + "okButton": "OK" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/code/electron-main/window.i18n.json b/i18n/hun/src/vs/code/electron-main/window.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..4acca80d5c4d87d10631bc09ffcfb9d085422dcc --- /dev/null +++ b/i18n/hun/src/vs/code/electron-main/window.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "hiddenMenuBar": "A menüsáv továbbra is elréhető az **Alt** billentyű leütésével." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/code/electron-main/windows.i18n.json b/i18n/hun/src/vs/code/electron-main/windows.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..46afd591492534061a1c5d77c1acaa9ea1f505c5 --- /dev/null +++ b/i18n/hun/src/vs/code/electron-main/windows.i18n.json @@ -0,0 +1,17 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "ok": "OK", + "pathNotExistTitle": "Az elérési út nem létezik", + "pathNotExistDetail": "Úgy tűnik, hogy a(z) „{0}” elérési út már nem létezik a lemezen.", + "reopen": "Újranyitás", + "wait": "Várakozás tovább", + "close": "Bezárás", + "appStalled": "Az ablak nem válaszol", + "appStalledDetail": "Bezárhatja vagy újranyithatja az ablakot vagy várakozhat tovább.", + "appCrashed": "Az ablak összeomlott", + "appCrashedDetail": "Elnézést kérünk az okozott kellemetlenségért. Nyissa újra az ablakot, ha onnan szeretné folytatni a munkát, ahol abbahagyta." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/code/node/cliProcessMain.i18n.json b/i18n/hun/src/vs/code/node/cliProcessMain.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..fe8c039d35fd9c934e874bd6ea4604fa61004882 --- /dev/null +++ b/i18n/hun/src/vs/code/node/cliProcessMain.i18n.json @@ -0,0 +1,17 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "notFound": "A(z) '{0}' kiegészítő nem található.", + "notInstalled": "A(z) '{0}' kiegészítő nincs telepítve.", + "useId": "Bizonyosodjon meg róla, hogy a kiegészítő teljes azonosítóját használja, beleértve a kiadót, pl.: {0}", + "successVsixInstall": "A(z) '{0}' kiegszítő sikeresen telepítve lett.", + "alreadyInstalled": "A(z) '{0}' kiegészítő már telepítve van.", + "foundExtension": "A(z) '{0}' kiegészítő megtalálva a piactéren.", + "installing": "Telepítés...", + "successInstall": "A(z) '{0}' v{1} kiegészítő sikeresen telepítve lett.", + "uninstalling": "{0} eltávolítása...", + "successUninstall": "A(z) '{0}' kiegészítő sikeresen el lett távolítva." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/editor/common/config/commonEditorConfig.i18n.json b/i18n/hun/src/vs/editor/common/config/commonEditorConfig.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..1e9ce0d9025a74dbd4af5852864a35bf294ec46c --- /dev/null +++ b/i18n/hun/src/vs/editor/common/config/commonEditorConfig.i18n.json @@ -0,0 +1,88 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "editorConfigurationTitle": "Szerkesztőablak", + "fontFamily": "Ez a beállítás a betűkészletet határozza meg.", + "fontWeight": "Meghatározza a betűvastagságot.", + "fontSize": "Meghatározza a betű méretét, pixelekben.", + "lineHeight": "Meghatározza a sormagasságot. A 0 érték használata esetén a sormagasság a fontSize értékéből van számolva.", + "letterSpacing": "Meghatározza a betűközt, pixelekben.", + "lineNumbers": "Meghatározza, hogy megjelenjenek-e a sorszámok. A lehetséges értékek 'on', 'off' és 'relative'. A 'relative' érték használata esetén a kurzor aktuális pozíciójához képest számított sorszám jelenik meg.", + "rulers": "Azon oszlopok listája, ahol függőleges segédvonal jelenjen meg.", + "wordSeparators": "Azon karakterek listája, amelyek szóelválasztónak vannak tekintve szavakkal kapcsolatos navigáció vagy műveletek során.", + "tabSize": "Egy tabulátor hány szóköznek felel meg. Ez a beállítás felülírásra kerül a fájl tartalma alapján, ha az 'editor.detectIndentation' beállítás aktív.", + "tabSize.errorMessage": "A várt érték 'number' típusú. Megjegyzés: az \"auto\" értéket az 'editor.detectIndentation' beállítás helyettesíti.", + "insertSpaces": "Tabulátor billentyű lenyomásánál szóközök legyenek-e beszúrva. Ez a beállítás felülírásra kerül a fájl tartalma alapján, ha az 'editor.detectIndentation' beállítás aktív.", + "insertSpaces.errorMessage": "A várt érték 'boolean' típusú. Megjegyzés: az \"auto\" értéket az 'editor.detectIndentation' beállítás helyettesíti.", + "detectIndentation": "Fájl megnyitásakor az `editor.tabSize` és az `editor.insertSpaces` értéke a fájl tartalma alapján lesz meghatározva.", + "roundedSelection": "Itt adható meg, hogy a kijelölt elemek sarkai lekerekítettek legyenek-e", + "scrollBeyondLastLine": "Meghatározza, hogy a szerkesztőablak görgethető-e az utolsó sor után.", + "minimap.enabled": "Meghatározza, hogy megjelenjen-e a kódtérkép.", + "minimap.showSlider": "Meghatározza, hogy automatikusan el legyen-e rejtve a kódtérképes görgetősáv.", + "minimap.renderCharacters": "Meghatározza, hogy a tényleges karakterek legyenek-e megjelenítve (színes téglalapok helyett)", + "minimap.maxColumn": "Meghatározza, hogy a kódtérképen legfeljebb hány oszlop legyen kirajzolva.", + "find.seedSearchStringFromSelection": "Meghatározza, hogy a keresés modulba automatikusan bekerüljön-e a szerkesztőablakban kiválasztott szöveg.", + "find.autoFindInSelection": "Meghatározza, hogy a keresés a kijelölésben beállítás be van-e kapcsolva, ha több karakternyi vagy sornyi szöveg ki van jelölve a szerkesztőablakban.", + "wordWrap.off": "A sorok soha nem lesznek tördelve.", + "wordWrap.on": "A sorok tördelve lesznek a nézetablak szélességénél.", + "wordWrap.wordWrapColumn": "A sorok tördelve lesznek az `editor.wordWrapColumn` oszlopnál.", + "wordWrap.bounded": "A sorok tördelve lesznek a nézetablak szélességének és az `editor.wordWrapColumn` értékének minimumánál.", + "wordWrap": "Ez a beállítás meghatározza, hogy a sorok hogyan legyenek tördelve. Lehetséges értékek:\n- 'off' (nincs sortörés)\n- 'on' (sortörés a nézetablakban)\n- 'wordWrapColumn' (sortörés az `editor.wordWrapColumn` oszlopnál) vagy\n- 'bounded' (sortörés az `editor.wordWrapColumn` és a nézetablak minimumánál)", + "wordWrapColumn": "Meghatározza a sortöréshez használt oszlopszámot a szerkesztőablakban, ha az `editor.wordWrap` értéke 'wordWrapColumn' vagy 'bounded'.", + "wrappingIndent": "Meghatározza a tördelt sorok behúzását. Értéke 'none', 'same' vagy 'indent' lehet.", + "mouseWheelScrollSensitivity": "Az egér görgetési eseményeinél keletkező `deltaX` és `deltaY` paraméterek szorzója", + "multiCursorModifier.ctrlCmd": "Windows és Linux alatt a `Control`, OSX alatt a `Command` billentyűt jelenti.", + "multiCursorModifier.alt": "Windows és Linux alatt az `Alt`, OSX alatt az `Option` billentyűt jelenti.", + "multiCursorModifier": "Több kurzor hozzáadásához használt módosítóbillentyű. A `ctrlCmd` Windows és Linux alatt a `Control`, OSX alatt a `Command` billentyűt jelenti. A Definíció megkeresése és Hivatkozás megnyitása egérgesztusok automatikusan alkalmazkodnak úgy, hogy ne ütközzenek a többkurzorhoz tartozó módosítóval.", + "quickSuggestions.strings": "Kiegészítési javaslatok engedélyezése karakterláncokban (stringekben)", + "quickSuggestions.comments": "Kiegészítési javaslatok engedélyezése megjegyzésekben", + "quickSuggestions.other": "Kiegészítési javaslatok engedélyezése karakterláncokon (stringeken) és megjegyzéseken kívül", + "quickSuggestions": "Meghatározza, hogy automatikusan megjelenjenek-e a javaslatok gépelés közben", + "quickSuggestionsDelay": "Meghatározza, hogy hány ezredmásodperc késleltetéssel jelenjenek meg a kiegészítési javaslatok", + "parameterHints": "Paraméterinformációkat és típusinformációkat tartalmazó felugró ablak engedélyezése gépelés közben", + "autoClosingBrackets": "Meghatározza, hogy a szerkesztő automatikusan beszúrja-e a nyitó zárójelek záró párját", + "formatOnType": "Meghatározza, hogy a szerkesztő automatikusan formázza-e a sort a gépelés után", + "formatOnPaste": "Meghatározza, hogy a szerkesztő automatikusan formázza-e a beillesztett tartalmat. Ehhez szükség van egy formázóra, illetve a formázónak tudnia kell a dokumentum egy részét formázni.", + "suggestOnTriggerCharacters": "Itt adható meg, hogy eseményindító karakterek beírásakor automatikusan megjelenjenek-e a javaslatok", + "acceptSuggestionOnEnter": "Meghatározza, hogy a javaslatok az 'Enter' gomb leütésére is el legyenek fogadva a 'Tab' mellett. Segít feloldani a bizonytalanságot az új sorok beillesztése és a javaslatok elfogadása között. A 'smart' érték azt jelenti, hogy csak akkor fogadja el a javaslatot az Enter leütése esetén, ha az módosítja a szöveget.", + "acceptSuggestionOnCommitCharacter": "Meghatározza, hogy a javaslaok a zárókarakterek leütésére is el legyenek fogadva. A JavaScriptben például a pontosvessző (';') számít zárókarakternek, leütésére a javaslat elfogadásra kerül és beillesztődik az adott karakter. ", + "snippetSuggestions": "Meghatározza, hogy a kódtöredékek megjelenjenek-e a javaslatok között, illetve hogy hogyan legyenek rendezve.", + "emptySelectionClipboard": "Meghatározza, hogy kijelölés nélküli másolás esetén a teljes sor legyen-e másolva.", + "wordBasedSuggestions": "Meghatározza, hogy a kiegészítések listája a dokumentumban lévő szövegek alapján legyen-e meghatározva.", + "suggestFontSize": "Az ajánlásokat tartalmazó modul betűmérete", + "suggestLineHeight": "Az ajánlásokat tartalmazó modul sormagassága", + "selectionHighlight": "Itt adható meg, hogy a szerkesztő kiemelje-e a kijelöléshez hasonló találatokat", + "occurrencesHighlight": "Meghatározza, hogy a szerkesztőablakban ki legyenek-e emelve a szimbólum szemantikailag hozzá tartozó előfordulásai.", + "overviewRulerLanes": "Meghatározza, hogy hány dekoráció jelenhet meg azonos pozícióban az áttekintő sávon.", + "overviewRulerBorder": "Meghatározza, hogy legyen-e kerete az áttekintő sávnak.", + "cursorBlinking": "Meghatározza a kurzor animációjának stílusát. Lehetséges értékek: 'blink', 'smooth', 'phase', 'expand' vagy 'solid'", + "mouseWheelZoom": "A szerkesztőablak betűtípusának nagyítása vagy kicsinyítése az egérgörgő Ctrl lenyomása mellett történő használata esetén", + "cursorStyle": "Meghatározza a kurzor stílusát. Lehetséges értékek: 'block', 'block-outline', 'line', 'line-thin', 'underline' vagy 'underline-thin'", + "fontLigatures": "Engedélyezi a betűtípusban található ligatúrák használatát", + "hideCursorInOverviewRuler": "Meghatározza, hogy a kurzor pozíciója el legyen-e rejtve az áttekintő sávon.", + "renderWhitespace": "Meghatározza, hogy a szerkesztőablakban hogyan legyenek kirajzolva a szóköz karakterek. Lehetséges értékek: 'none', 'boundary', vagy 'all'. A 'boundary' beállítás esetén, ha szavak között egyetlen szóköz található, akkor az nem lesz kirajzolva.", + "renderControlCharacters": "Meghatározza, hogy a szerkesztőablakban ki legyenek-e rajzolva a vezérlőkarakterek.", + "renderIndentGuides": "Meghatározza, hogy a szerkesztőablakban ki legyenek-e rajzolva az indentálási segédvonalak.", + "renderLineHighlight": "Meghatározza, hogy a szerkesztőablakban hogyan legyen kirajzolva az aktuális sor kiemelése. Lehetséges értékek: 'none', 'gutter', 'line', vagy 'all'.", + "codeLens": "Meghatározza, hogy megjelenjenek-e a kódlencsék", + "folding": "Meghatározza, hogy engedélyezve van-e a kódrészletek bezárása a szerkesztőablakban.", + "showFoldingControls": "Meghatározza, hogy a kódrészletek bezárásához tartozó vezérlőelemek automatikusan el legyenek-e rejtve.", + "matchBrackets": "Zárójel kiválasztása esetén a hozzátartozó zárójel kiemelése.", + "glyphMargin": "Meghatározza, hogy legyen-e vertikális szimbólummargó a szerkesztőablakban. A szimbólummargó elsősorban hibakeresésnél van használva.", + "useTabStops": "Szóközök beillesztése és törlése során követve vannak a tabulátorok.", + "trimAutoWhitespace": "A sorok végén lévő, automatikusan beillesztett szóközök eltávolítása", + "stablePeek": "A betekintőablakok maradjanak nyitva akkor is, ha duplán kattintanak a tartalmára vagy megnyomják az Escape gombot.", + "dragAndDrop": "Meghatározza, hogy a szerkesztőablakban engedélyezett-e a kijelölt szövegrészletek áhelyezése húzással.", + "accessibilitySupport.auto": "A szerkesztő a platform által biztosított API-kat használja annak megállapításához, hogy van-e képernyőolvasó csatlakoztatva.", + "accessibilitySupport.on": "A szerkesztő folyamatos képernyőolvasóval való használatára van optimalizálva.", + "accessibilitySupport.off": "A szerkesztő soha nincs képernyőolvasó használatára optimalizálva.", + "accessibilitySupport": "Meghatározza, hogy a szerkesztő olyan módban fusson-e, ami optimalizálva van képernyőolvasóval való használathoz.", + "links": "Meghatározza, hogy a szerkesztőablak érzékelje-e a hivatkozásokat, és kattinthatóvá tegye-e őket.", + "sideBySide": "Meghatározza, hogy a differenciaszerkesztő ablakban egymás mellett vagy a sorban jelenjenek meg az eltérések", + "ignoreTrimWhitespace": "Meghatározza, hogy a differenciaszerkesztő ablakban megjelenjenek-e a sor elején vagy végén a szóközökben talált különbségek", + "renderIndicators": "Meghatározza, hogy a differenciaszerkesztő ablakban megjelenjenek-e a +/- jelzők az hozzáadott/eltávolított változásoknál", + "selectionClipboard": "Meghatározza-e, hogy támogatva van-e az elsődleges vágólap Linux alatt" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/editor/common/config/editorOptions.i18n.json b/i18n/hun/src/vs/editor/common/config/editorOptions.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..6a2e0478211879c4229035b5355daffda88b4b70 --- /dev/null +++ b/i18n/hun/src/vs/editor/common/config/editorOptions.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "accessibilityOffAriaLabel": "A szerkesztőablak jelenleg nem elérhető. Nyomja meg az Alt+F1-et a beállítási lehetőségek megjelenítéséhez!", + "editorViewAccessibleLabel": "Szerkesztőablak tartalma" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/editor/common/controller/cursor.i18n.json b/i18n/hun/src/vs/editor/common/controller/cursor.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..6b33fa4e18ecab3394d916aed288b07f2a41f7f5 --- /dev/null +++ b/i18n/hun/src/vs/editor/common/controller/cursor.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "corrupt.commands": "Váratlan kivétel egy parancs végrehajtása során." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/editor/common/model/textModelWithTokens.i18n.json b/i18n/hun/src/vs/editor/common/model/textModelWithTokens.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..41687561a2e4b401dd6a083a936b0e4c08d242e0 --- /dev/null +++ b/i18n/hun/src/vs/editor/common/model/textModelWithTokens.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "mode.tokenizationSupportFailed": "Ebben az üzemmódban nem sikerült lexikális elemekre bontani a bemenetet." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/editor/common/modes/modesRegistry.i18n.json b/i18n/hun/src/vs/editor/common/modes/modesRegistry.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..26fe7e29f4c1981f20a56522fd9156fc32eab828 --- /dev/null +++ b/i18n/hun/src/vs/editor/common/modes/modesRegistry.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "plainText.alias": "Egyszerű szöveg" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/editor/common/services/bulkEdit.i18n.json b/i18n/hun/src/vs/editor/common/services/bulkEdit.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..b0bbd29edb05293cc937ae1168dad53ebb99c43d --- /dev/null +++ b/i18n/hun/src/vs/editor/common/services/bulkEdit.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "conflict": "A következő fájlok módosultak időközben: {0}", + "summary.0": "Nem történtek változtatások", + "summary.nm": "{0} változtatást végzett {0} fájlban", + "summary.n0": "{0} változtatást végzett egy fájlban" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/editor/common/services/modeServiceImpl.i18n.json b/i18n/hun/src/vs/editor/common/services/modeServiceImpl.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..b85462146b6e139717f4ac312e7c47e6318b8a47 --- /dev/null +++ b/i18n/hun/src/vs/editor/common/services/modeServiceImpl.i18n.json @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "vscode.extension.contributes.languages": "Nyelvdeklarációkat szolgáltat.", + "vscode.extension.contributes.languages.id": "A nyelv azonosítója", + "vscode.extension.contributes.languages.aliases": "A nyelv kiegészítő nevei.", + "vscode.extension.contributes.languages.extensions": "A nyelvhez hozzárendelt fájlkiterjesztések.", + "vscode.extension.contributes.languages.filenames": "A nyelvhez hozzárendelt fájlnevek.", + "vscode.extension.contributes.languages.filenamePatterns": "A nyelvhez hozzárendelt globális minták.", + "vscode.extension.contributes.languages.mimetypes": "A nyelvhez hozzárendelt MIME-típusok.", + "vscode.extension.contributes.languages.firstLine": "Reguláris kifejezés, ami az adott nyelven írt fájl első sorára illeszkedik.", + "vscode.extension.contributes.languages.configuration": "A nyelvhez tartozó konfigurációkat tartalmazó fájl relatív elérési útja." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/editor/common/services/modelServiceImpl.i18n.json b/i18n/hun/src/vs/editor/common/services/modelServiceImpl.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..a12e01358bbaf8f6df021310323af3205d59b90a --- /dev/null +++ b/i18n/hun/src/vs/editor/common/services/modelServiceImpl.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "diagAndSourceMultiline": "[{0}]\n{1}", + "diagAndSource": "[{0}] {1}" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/editor/common/view/editorColorRegistry.i18n.json b/i18n/hun/src/vs/editor/common/view/editorColorRegistry.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..94d90edc0717ee88001e109c981a27c76896fd6d --- /dev/null +++ b/i18n/hun/src/vs/editor/common/view/editorColorRegistry.i18n.json @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "lineHighlight": "A kurzor pozícióján található sor kiemelési háttérszíne.", + "lineHighlightBorderBox": "A kurzor pozícióján található sor keretszíne.", + "rangeHighlight": "A kiemelt területek háttérszíne, pl. a gyors megnyitás és keresés funkcióknál.", + "caret": "A szerkesztőablak kurzorának színe.", + "editorWhitespaces": "A szerkesztőablakban található szóköz karakterek színe.", + "editorIndentGuides": "A szerkesztőablak segédvonalainak színe.", + "editorLineNumbers": "A szerkesztőablak sorszámainak színe.", + "editorRuler": "A szerkesztőablak sávjainak színe.", + "editorCodeLensForeground": "A szerkesztőablakban található kódlencsék előtérszíne", + "editorBracketMatchBackground": "Hozzátartozó zárójelek háttérszíne", + "editorBracketMatchBorder": "Az összetartozó zárójelek dobozának színe", + "editorOverviewRulerBorder": "Az áttekintő sáv keretszíne.", + "editorGutter": "A szerkesztőablag margójának háttérszíne. A margón található a szimbólummargó és a sorszámok.", + "errorForeground": "A hibákat jelző hullámvonal előtérszíne a szerkesztőablakban.", + "errorBorder": "A hibákat jelző hullámvonal keretszíne a szerkesztőablakban.", + "warningForeground": "A figyelmeztetéseket jelző hullámvonal előtérszíne a szerkesztőablakban.", + "warningBorder": "A figyelmeztetéseket jelző hullámvonal keretszíne a szerkesztőablakban." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/editor/contrib/bracketMatching/common/bracketMatching.i18n.json b/i18n/hun/src/vs/editor/contrib/bracketMatching/common/bracketMatching.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..647a263affcf5570f0dabbbd7eaacc2aede915e9 --- /dev/null +++ b/i18n/hun/src/vs/editor/contrib/bracketMatching/common/bracketMatching.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "smartSelect.jumpBracket": "Ugrás a zárójelre" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/editor/contrib/caretOperations/common/caretOperations.i18n.json b/i18n/hun/src/vs/editor/contrib/caretOperations/common/caretOperations.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..1fc37d076840cc3783adbc5e2d05490db1782e45 --- /dev/null +++ b/i18n/hun/src/vs/editor/contrib/caretOperations/common/caretOperations.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "caret.moveLeft": "Kurzor mozgatása balra", + "caret.moveRight": "Kurzor mozgatása jobbra" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/editor/contrib/caretOperations/common/transpose.i18n.json b/i18n/hun/src/vs/editor/contrib/caretOperations/common/transpose.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..e8cbbca5cf4d6e5ef0a0b24b7c1b598687a82c1a --- /dev/null +++ b/i18n/hun/src/vs/editor/contrib/caretOperations/common/transpose.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "transposeLetters.label": "Betűk megcserélése" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/editor/contrib/clipboard/browser/clipboard.i18n.json b/i18n/hun/src/vs/editor/contrib/clipboard/browser/clipboard.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..09439c237cb30365b78be0488db8c975913d2efb --- /dev/null +++ b/i18n/hun/src/vs/editor/contrib/clipboard/browser/clipboard.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "actions.clipboard.cutLabel": "Kivágás", + "actions.clipboard.copyLabel": "Másolás", + "actions.clipboard.pasteLabel": "Beillesztés", + "actions.clipboard.copyWithSyntaxHighlightingLabel": "Másolás szintaktikai kiemeléssel" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/editor/contrib/comment/common/comment.i18n.json b/i18n/hun/src/vs/editor/contrib/comment/common/comment.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..219553bdc4e1af4c4cd42ec20a6bebb722c21d6b --- /dev/null +++ b/i18n/hun/src/vs/editor/contrib/comment/common/comment.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "comment.line": "Egysoros megjegyzés ki-/bekapcsolása", + "comment.line.add": "Egysoros megjegyzés hozzáadása", + "comment.line.remove": "Egysoros megjegyzés eltávolítása", + "comment.block": "Megjegyzésblokk ki-/bekapcsolása" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/editor/contrib/contextmenu/browser/contextmenu.i18n.json b/i18n/hun/src/vs/editor/contrib/contextmenu/browser/contextmenu.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..78d9a20aae1c93912c90524ac9828a6d45d116ef --- /dev/null +++ b/i18n/hun/src/vs/editor/contrib/contextmenu/browser/contextmenu.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "action.showContextMenu.label": "Szerkesztőablak helyi menüjének megjelenítése" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/editor/contrib/find/browser/findWidget.i18n.json b/i18n/hun/src/vs/editor/contrib/find/browser/findWidget.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..2e445d0ec2eb95eee1fba258e2045d739319d86d --- /dev/null +++ b/i18n/hun/src/vs/editor/contrib/find/browser/findWidget.i18n.json @@ -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. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "label.find": "Keresés", + "placeholder.find": "Keresés", + "label.previousMatchButton": "Előző találat", + "label.nextMatchButton": "Következő találat", + "label.toggleSelectionFind": "Keresés kijelölésben", + "label.closeButton": "Bezárás", + "label.replace": "Csere", + "placeholder.replace": "Csere", + "label.replaceButton": "Csere", + "label.replaceAllButton": "Az összes előfordulás cseréje", + "label.toggleReplaceButton": "Váltás csere módra", + "title.matchesCountLimit": "Csak az első 999 találat van kiemelve, de minden keresési művelet a teljes szöveggel dolgozik.", + "label.matchesLocation": "{0} (összesen {1})", + "label.noResults": "Nincs eredmény" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/editor/contrib/find/common/findController.i18n.json b/i18n/hun/src/vs/editor/contrib/find/common/findController.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..4b84cd4d15b3f8c73460c01af01d76b311e063dc --- /dev/null +++ b/i18n/hun/src/vs/editor/contrib/find/common/findController.i18n.json @@ -0,0 +1,18 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "startFindAction": "Keresés", + "findNextMatchAction": "Következő találat", + "findPreviousMatchAction": "Előző találat", + "nextSelectionMatchFindAction": "Következő kijelölés", + "previousSelectionMatchFindAction": "Előző kijelölés", + "startReplace": "Csere", + "addSelectionToNextFindMatch": "Kijelölés hozzáadása a következő keresési találathoz", + "addSelectionToPreviousFindMatch": "Kijelölés hozzáadása az előző keresési találathoz", + "moveSelectionToNextFindMatch": "Utolsó kijelölés áthelyezése a következő keresési találatra", + "moveSelectionToPreviousFindMatch": "Utolsó kijelölés áthelyezése az előző keresési találatra", + "changeAll.label": "Minden előfordulás módosítása" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/editor/contrib/folding/browser/folding.i18n.json b/i18n/hun/src/vs/editor/contrib/folding/browser/folding.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..07da29ad41aa96956b4c6c308994d562fabd6c27 --- /dev/null +++ b/i18n/hun/src/vs/editor/contrib/folding/browser/folding.i18n.json @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "unfoldAction.label": "Kibontás", + "unFoldRecursivelyAction.label": "Kibontás rekurzívan", + "foldAction.label": "Bezárás", + "foldRecursivelyAction.label": "Bezárás rekurzívan", + "foldAllAction.label": "Az összes bezárása", + "unfoldAllAction.label": "Az összes kinyitása", + "foldLevelAction.label": "{0} szintű blokkok bezárása" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/editor/contrib/format/browser/formatActions.i18n.json b/i18n/hun/src/vs/editor/contrib/format/browser/formatActions.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..6ef4ffd2eedc1ba310e1af99b3ce0ab700f41608 --- /dev/null +++ b/i18n/hun/src/vs/editor/contrib/format/browser/formatActions.i18n.json @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "hint11": "Egy formázást végzett a(z) {0}. sorban", + "hintn1": "{0} formázást végzett a(z) {1}. sorban", + "hint1n": "Egy formázást végzett a(z) {0}. és {1}. sorok között", + "hintnn": "{0} formázást végzett a(z) {1}. és {2}. sorok között", + "formatDocument.label": "Dokumentum formázása", + "formatSelection.label": "Kijelölt tartalom formázása" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.i18n.json b/i18n/hun/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..50e0679aba90887eee9f28558ad246c14325ac67 --- /dev/null +++ b/i18n/hun/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.i18n.json @@ -0,0 +1,23 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "noResultWord": "Nem található a(z) '{0}' definíciója", + "generic.noResults": "Definíció nem található", + "meta.title": " – {0} definíció", + "actions.goToDecl.label": "Ugrás a definícióra", + "actions.goToDeclToSide.label": "Definíció megnyitása oldalt", + "actions.previewDecl.label": "Betekintés a definícióba", + "goToImplementation.noResultWord": "Nem található a(z) '{0}' implementációja", + "goToImplementation.generic.noResults": "Implementáció nem található", + "meta.implementations.title": " – {0} implementáció", + "actions.goToImplementation.label": "Ugrás az implementációra", + "actions.peekImplementation.label": "Betekintés az implementációba", + "goToTypeDefinition.noResultWord": "Nem található a(z) '{0}' típusdefiníciója", + "goToTypeDefinition.generic.noResults": "Típusdefiníció nem található", + "meta.typeDefinitions.title": " – {0} típusdefiníció", + "actions.goToTypeDefinition.label": "Ugrás a típusdefinícióra", + "actions.peekTypeDefinition.label": "Betekintés a típusdefinícióba" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.i18n.json b/i18n/hun/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..782190fef044cb657b03df86acfd3060aced2cc4 --- /dev/null +++ b/i18n/hun/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "multipleResults": "Kattintson {0} definíció megjelenítéséhez." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/editor/contrib/gotoError/browser/gotoError.i18n.json b/i18n/hun/src/vs/editor/contrib/gotoError/browser/gotoError.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..ce65a365e4533445f2231992d26dc84826b6d9ac --- /dev/null +++ b/i18n/hun/src/vs/editor/contrib/gotoError/browser/gotoError.i18n.json @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "title.wo_source": "({0}/{1})", + "markerAction.next.label": "Következő hiba vagy figyelmeztetés", + "markerAction.previous.label": "Előző hiba vagy figyelmeztetés", + "editorMarkerNavigationError": "A szerkesztőablak jelzőnavigációs moduljának színe hiba esetén.", + "editorMarkerNavigationWarning": "A szerkesztőablak jelzőnavigációs moduljának színe figyelmeztetés esetén.", + "editorMarkerNavigationBackground": "A szerkesztőablak jelzőnavigációs moduljának háttérszíne." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/editor/contrib/hover/browser/hover.i18n.json b/i18n/hun/src/vs/editor/contrib/hover/browser/hover.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..e9de48281ee8f5e81d57615513d3e52958cb9511 --- /dev/null +++ b/i18n/hun/src/vs/editor/contrib/hover/browser/hover.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "showHover": "Súgószöveg megjelenítése" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/editor/contrib/hover/browser/modesContentHover.i18n.json b/i18n/hun/src/vs/editor/contrib/hover/browser/modesContentHover.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..a9cab1dd0d559edf2361ba51f5851157f1e5afc7 --- /dev/null +++ b/i18n/hun/src/vs/editor/contrib/hover/browser/modesContentHover.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "modesContentHover.loading": "Betöltés..." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/editor/contrib/inPlaceReplace/common/inPlaceReplace.i18n.json b/i18n/hun/src/vs/editor/contrib/inPlaceReplace/common/inPlaceReplace.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..0339e509b33a475fc2515baac9b2ae184d5b6441 --- /dev/null +++ b/i18n/hun/src/vs/editor/contrib/inPlaceReplace/common/inPlaceReplace.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "InPlaceReplaceAction.previous.label": "Csere az előző értékre", + "InPlaceReplaceAction.next.label": "Csere a következő értékre" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/editor/contrib/indentation/common/indentation.i18n.json b/i18n/hun/src/vs/editor/contrib/indentation/common/indentation.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..4b8870d20ac8b2b3bd70138fa00be85f896bee00 --- /dev/null +++ b/i18n/hun/src/vs/editor/contrib/indentation/common/indentation.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "indentationToSpaces": "Indentálások átalakítása szóközökké", + "indentationToTabs": "Indentálások átalakítása tabulátorokká", + "configuredTabSize": "Beállított tabulátorméret", + "selectTabWidth": "Tabulátorméret kiválasztása az aktuális fájlhoz", + "indentUsingTabs": "Indentálás tabulátorral", + "indentUsingSpaces": "Indentálás szóközzel", + "detectIndentation": "Indentálás felismerése a tartalom alapján", + "editor.reindentlines": "Sorok újraindentálása" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/editor/contrib/linesOperations/common/linesOperations.i18n.json b/i18n/hun/src/vs/editor/contrib/linesOperations/common/linesOperations.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..d5c935359b070682c188b055b4c810c29fddd73f --- /dev/null +++ b/i18n/hun/src/vs/editor/contrib/linesOperations/common/linesOperations.i18n.json @@ -0,0 +1,25 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "lines.copyUp": "Sor másolása eggyel feljebb", + "lines.copyDown": "Sor másolása eggyel lejjebb", + "lines.moveUp": "Sor feljebb helyezése", + "lines.moveDown": "Sor lejjebb helyezése", + "lines.sortAscending": "Rendezés növekvő sorrendben", + "lines.sortDescending": "Rendezés csökkenő sorrendben", + "lines.trimTrailingWhitespace": "Sor végén található szóközök levágása", + "lines.delete": "Sor törlése", + "lines.indent": "Sor behúzása", + "lines.outdent": "Sor kihúzása", + "lines.insertBefore": "Sor beszúrása eggyel feljebb", + "lines.insertAfter": "Sor beszúrása eggyel lejjebb", + "lines.deleteAllLeft": "Balra lévő tartalom törlése", + "lines.deleteAllRight": "Jobbra lévő tartalom törlése", + "lines.joinLines": "Sorok egyesítése", + "editor.transpose": "A kurzor körüli karakterek felcserélése", + "editor.transformToUppercase": "Átalakítás nagybetűssé", + "editor.transformToLowercase": "Átalakítás kisbetűssé" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/editor/contrib/links/browser/links.i18n.json b/i18n/hun/src/vs/editor/contrib/links/browser/links.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..ece9320a75896cd9303844b15a97d7039cd6d7a8 --- /dev/null +++ b/i18n/hun/src/vs/editor/contrib/links/browser/links.i18n.json @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "links.navigate.mac": "Hivatkozott oldal megnyitása Cmd + kattintás paranccsal", + "links.navigate": "Hivatkozott oldal megnyitása Ctrl + kattintás paranccsal", + "links.navigate.al": "Hivatkozás megnyitása Alt + kattintás paranccsal", + "invalid.url": "A hivatkozást nem sikerült megnyitni, mert nem jól formázott: {0}", + "missing.url": "A hivatkozást nem sikerült megnyitni, hiányzik a célja.", + "label": "Hivatkozás megnyitása" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/editor/contrib/multicursor/common/multicursor.i18n.json b/i18n/hun/src/vs/editor/contrib/multicursor/common/multicursor.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..8aa3dbca9ff721b487be1621f410eb69e711d12f --- /dev/null +++ b/i18n/hun/src/vs/editor/contrib/multicursor/common/multicursor.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "mutlicursor.insertAbove": "Kurzor beszúrása egy sorral feljebb", + "mutlicursor.insertBelow": "Kurzor beszúrása egy sorral lejjebb", + "mutlicursor.insertAtEndOfEachLineSelected": "Kurzor beszúrása a sorok végére" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/editor/contrib/parameterHints/browser/parameterHints.i18n.json b/i18n/hun/src/vs/editor/contrib/parameterHints/browser/parameterHints.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..973e6d7ae912e465cdc49d14317b84c096e3f89f --- /dev/null +++ b/i18n/hun/src/vs/editor/contrib/parameterHints/browser/parameterHints.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "parameterHints.trigger.label": "Paraméterinformációk megjelenítése" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.i18n.json b/i18n/hun/src/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..f05a169d614ffa55e7efac9cdbe8d76b04cefefe --- /dev/null +++ b/i18n/hun/src/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "hint": "{0}, információ" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/editor/contrib/quickFix/browser/quickFixCommands.i18n.json b/i18n/hun/src/vs/editor/contrib/quickFix/browser/quickFixCommands.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..1fef02c03eb52fa6a3efadfac094e0ba975c8a90 --- /dev/null +++ b/i18n/hun/src/vs/editor/contrib/quickFix/browser/quickFixCommands.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "quickFixWithKb": "Javítások megjelenítése ({0})", + "quickFix": "Javítások megjelenítése", + "quickfix.trigger.label": "Gyorsjavítás" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/editor/contrib/referenceSearch/browser/referenceSearch.i18n.json b/i18n/hun/src/vs/editor/contrib/referenceSearch/browser/referenceSearch.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..bc4f4f5abd630114ea66c574f7181a4c4563ab11 --- /dev/null +++ b/i18n/hun/src/vs/editor/contrib/referenceSearch/browser/referenceSearch.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "meta.titleReference": " – {0} referencia", + "references.action.label": "Minden hivatkozás megkeresése" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/editor/contrib/referenceSearch/browser/referencesController.i18n.json b/i18n/hun/src/vs/editor/contrib/referenceSearch/browser/referencesController.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..b93a507d5d9bdb5f5f4d21a4daaf581abaa5362d --- /dev/null +++ b/i18n/hun/src/vs/editor/contrib/referenceSearch/browser/referencesController.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "labelLoading": "Betöltés..." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json b/i18n/hun/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..4ab9002859c96e11ef9f28f89a6ba8cebf8ec402 --- /dev/null +++ b/i18n/hun/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "aria.oneReference": "szimbólum a következő helyen: {0}, sor: {1}, oszlop: {2}", + "aria.fileReferences.1": "Egy szimbólum a következő helyen: {0}, teljes elérési út: {1}", + "aria.fileReferences.N": "{0} szimbólum a következő helyen: {1}, teljes elérési út: {2}", + "aria.result.0": "Nincs találat", + "aria.result.1": "Egy szimbólum a következő helyen: {0}", + "aria.result.n1": "{0} szimbólum a következő helyen: {1}", + "aria.result.nm": "{0} szimbólum {1} fájlban" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.i18n.json b/i18n/hun/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..2701fadac42d98a200ac3f9df14c7eceaa3ab532 --- /dev/null +++ b/i18n/hun/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.i18n.json @@ -0,0 +1,27 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "referencesFailre": "Nem sikerült feloldani a fájlt.", + "referencesCount": "{0} referencia", + "referenceCount": "{0} referencia", + "missingPreviewMessage": "előnézet nem érhető el", + "treeAriaLabel": "Referenciák", + "noResults": "Nincs eredmény", + "peekView.alternateTitle": "Referenciák", + "peekViewTitleBackground": "A betekintőablak címsorának háttérszíne.", + "peekViewTitleForeground": "A betekintőablak címének színe.", + "peekViewTitleInfoForeground": "A betekintőablak címsorában található információ színe.", + "peekViewBorder": "A betekintőablak keretének és nyilainak színe.", + "peekViewResultsBackground": "A betekintőablak eredménylistájának háttérszíne.", + "peekViewResultsMatchForeground": "A betekintőablak eredménylistájában található sorhivatkozások előtérszíne.", + "peekViewResultsFileForeground": "A betekintőablak eredménylistájában található fájlhivatkozások előtérszíne.", + "peekViewResultsSelectionBackground": "A betekintőablak eredménylistájában kiválaszott elem háttérszíne.", + "peekViewResultsSelectionForeground": "A betekintőablak eredménylistájában kiválaszott elem előtérszíne.", + "peekViewEditorBackground": "A betekintőablak szerkesztőablakának háttérszíne.", + "peekViewEditorGutterBackground": "A betekintőablak szerkesztőablakában található margó háttérszíne.", + "peekViewResultsMatchHighlight": "Kiemelt keresési eredmények színe a betekintőablak eredménylistájában.", + "peekViewEditorMatchHighlight": "Kiemelt keresési eredmények színe a betekintőablak szerkesztőablakában." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/editor/contrib/rename/browser/rename.i18n.json b/i18n/hun/src/vs/editor/contrib/rename/browser/rename.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..c6eac10add61f154693fab592f4bd352341f6bb6 --- /dev/null +++ b/i18n/hun/src/vs/editor/contrib/rename/browser/rename.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "no result": "Nincs eredmény.", + "aria": "'{0}' sikeresen át lett nevezve a következőre: '{1}'. Összefoglaló: {2}", + "rename.failed": "Az átnevezést nem sikerült végrehajtani.", + "rename.label": "Szimbólum átnevezése" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/editor/contrib/rename/browser/renameInputField.i18n.json b/i18n/hun/src/vs/editor/contrib/rename/browser/renameInputField.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..cd26c078ae05ba5ba0562f22577f2754b864092a --- /dev/null +++ b/i18n/hun/src/vs/editor/contrib/rename/browser/renameInputField.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "renameAriaLabel": "Átnevezésre szolgáló beviteli mező. Adja meg az új nevet, majd nyomja meg az Enter gombot a változtatások elvégzéséhez." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/editor/contrib/smartSelect/common/smartSelect.i18n.json b/i18n/hun/src/vs/editor/contrib/smartSelect/common/smartSelect.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..463be33cb03fa8bdfb47933297295c8d4be4cd06 --- /dev/null +++ b/i18n/hun/src/vs/editor/contrib/smartSelect/common/smartSelect.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "smartSelect.grow": "Kijelölés bővítése", + "smartSelect.shrink": "Kijelölés szűkítése" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/editor/contrib/suggest/browser/suggestController.i18n.json b/i18n/hun/src/vs/editor/contrib/suggest/browser/suggestController.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..d7050253ff13e9edb33d0f96b59ea573ee3be191 --- /dev/null +++ b/i18n/hun/src/vs/editor/contrib/suggest/browser/suggestController.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "arai.alert.snippet": "A(z) '{0}' elfogadása a következő szöveg beszúrását eredményezte: {1}", + "suggest.trigger.label": "Javaslatok megjelenítése" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json b/i18n/hun/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..1ea907a2db039d5308f2d9b467cc34d8134974a0 --- /dev/null +++ b/i18n/hun/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json @@ -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. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "editorSuggestWidgetBackground": "A javaslatokat tartalmazó modul háttérszíne.", + "editorSuggestWidgetBorder": "A javaslatokat tartalmazó modul keretszíne.", + "editorSuggestWidgetForeground": "A javaslatokat tartalmazó modul előtérszíne.", + "editorSuggestWidgetSelectedBackground": "A javaslatokat tartalmazó modulban kiválasztott elem háttérszíne.", + "editorSuggestWidgetHighlightForeground": "Az illeszkedő szövegrészletek kiemelése a javaslatok modulban.", + "readMore": "További információk megjelenítése...{0}", + "suggestionWithDetailsAriaLabel": "{0}, javaslat, részletekkel", + "suggestionAriaLabel": "{0}, javaslat", + "readLess": "Kevesebb információ megjelenítése...{0}", + "suggestWidget.loading": "Betöltés...", + "suggestWidget.noSuggestions": "Nincsenek javaslatok.", + "suggestionAriaAccepted": "{0}, elfogadva", + "ariaCurrentSuggestionWithDetails": "{0}, javaslat, részletekkel", + "ariaCurrentSuggestion": "{0}, javaslat" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/editor/contrib/toggleTabFocusMode/common/toggleTabFocusMode.i18n.json b/i18n/hun/src/vs/editor/contrib/toggleTabFocusMode/common/toggleTabFocusMode.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..dc4360652cbf419fea7b2bfe6f6e90184410262b --- /dev/null +++ b/i18n/hun/src/vs/editor/contrib/toggleTabFocusMode/common/toggleTabFocusMode.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "toggle.tabMovesFocus": "Tab billentyűvel mozgatott fókusz ki- és bekapcsolása" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/editor/contrib/wordHighlighter/common/wordHighlighter.i18n.json b/i18n/hun/src/vs/editor/contrib/wordHighlighter/common/wordHighlighter.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..6192eaea44a972c2ba7e20e6523a599db126c80e --- /dev/null +++ b/i18n/hun/src/vs/editor/contrib/wordHighlighter/common/wordHighlighter.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "wordHighlight": "Szimbólumok háttérszíne olvasási hozzáférés, páldául változó olvasása esetén.", + "wordHighlightStrong": "Szimbólumok háttérszíne írási hozzáférés, páldául változó írása esetén." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/editor/contrib/zoneWidget/browser/peekViewWidget.i18n.json b/i18n/hun/src/vs/editor/contrib/zoneWidget/browser/peekViewWidget.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..a40829f1ae605adacd0ceb7516b6f84fdea8ac1c --- /dev/null +++ b/i18n/hun/src/vs/editor/contrib/zoneWidget/browser/peekViewWidget.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "label.close": "Bezárás" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/editor/electron-browser/textMate/TMSyntax.i18n.json b/i18n/hun/src/vs/editor/electron-browser/textMate/TMSyntax.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..be4ee2e7989984e87caa4cc36ebf16afdd5eb82e --- /dev/null +++ b/i18n/hun/src/vs/editor/electron-browser/textMate/TMSyntax.i18n.json @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "invalid.language": "Ismeretlen nyelv található a következőben: `contributes.{0}.language`. A megadott érték: {1}", + "invalid.scopeName": "Hiányzó karakterlánc a `contributes.{0}.scopeName`-ben. A megadott érték: {1}", + "invalid.path.0": "Hiányzó karakterlánc a `contributes.{0}.path`-ban. A megadott érték: {1}", + "invalid.injectTo": "A `contributes.{0}.injectTo` értéke érvénytelen. Az értéke egy tömb lehet, ami nyelvhatókörök neveit tartalmazza. A megadott érték: {1}", + "invalid.embeddedLanguages": "A `contributes.{0}.embeddedLanguages` értéke érvénytelen. Az értéke egy hatókörnév-nyelv kulcs-érték párokat tartalmazó objektum lehet. A megadott érték: {1}", + "invalid.path.1": "A `contributes.{0}.path` ({1}) nem a kiegészítő mappáján belül található ({2}). Emiatt előfordulhat, hogy a kiegészítő nem lesz hordozható.", + "no-tm-grammar": "Nincs TM Grammar regisztrálva ehhez a nyelvhez." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/editor/node/languageConfigurationExtensionPoint.i18n.json b/i18n/hun/src/vs/editor/node/languageConfigurationExtensionPoint.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..45673b13e303e1176442309edaa3b0573cd6b28f --- /dev/null +++ b/i18n/hun/src/vs/editor/node/languageConfigurationExtensionPoint.i18n.json @@ -0,0 +1,23 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "parseErrors": "Hiba a(z) {0} feldolgozása közben: {1}", + "schema.openBracket": "A nyitó zárójelet definiáló karakter vagy karaktersorozat", + "schema.closeBracket": "A záró zárójelet definiáló karakter vagy karaktersorozat", + "schema.comments": "Meghatározza a megjegyzésszimbólumokat", + "schema.blockComments": "Meghatározza, hogyan vannak jelölve a megjegyzésblokkok.", + "schema.blockComment.begin": "A megjegyzésblokk kezdetét definiáló karaktersorozat.", + "schema.blockComment.end": "A megjegyzésblokk végét definiáló karaktersorozat.", + "schema.lineComment": "A megjegyzéssor kezdetét definiáló karaktersorozat.", + "schema.brackets": "Meghatározza azokat a zárójelszimbólumokat, amelyek növeik vagy csökkentik az indentálást.", + "schema.autoClosingPairs": "Meghatározza a zárójelpárokat. Ha egy nyitó zárójelet írnak be a szerkesztőbe, a záró párja automatikusan be lesz illesztve.", + "schema.autoClosingPairs.notIn": "Azon hatókörök listája, ahol az automatikus zárójelek automatikus párosítása le van tiltve.", + "schema.surroundingPairs": "Meghatározza azok zárójelpárok listáját, melyek használhatók a kijelölt szöveg körbezárására.", + "schema.wordPattern": "A nyelvben található szavak definíciója.", + "schema.wordPattern.pattern": "A szavak illesztésére használt reguláris kifejezés.", + "schema.wordPattern.flags": "A szavak illesztésére használt reguláris kifejezés beállításai.", + "schema.wordPattern.flags.errorMessage": "Illeszkednie kell a következő mintára: `/^([gimuy]+)$/`." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/editor/node/textMate/TMGrammars.i18n.json b/i18n/hun/src/vs/editor/node/textMate/TMGrammars.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..4ae6117a727d97d60aeaf0231299334d84e23784 --- /dev/null +++ b/i18n/hun/src/vs/editor/node/textMate/TMGrammars.i18n.json @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "vscode.extension.contributes.grammars": "TextMate-tokenizálókat szolgáltat.", + "vscode.extension.contributes.grammars.language": "Annak a nyelvnek az azonosítója, amely számára szolgáltatva van ez a szintaxis.", + "vscode.extension.contributes.grammars.scopeName": "A tmLanguage-fájl által használt TextMate-hatókör neve.", + "vscode.extension.contributes.grammars.path": "A tmLanguage-fájl elérési útja. Az elérési út relatív a kiegészítő mappájához képest, és általában './syntaxes/'-zal kezdődik.", + "vscode.extension.contributes.grammars.embeddedLanguages": "Hatókörnév-nyelvazonosító kulcs-érték párokat tartalmazó objektum, ha a nyelvtan tartalmaz beágyazott nyelveket.", + "vscode.extension.contributes.grammars.injectTo": "Azon nyelvi hatókörök nevei, ahová be lesz ágyazva ez a nyelvtan." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/platform/actions/browser/menuItemActionItem.i18n.json b/i18n/hun/src/vs/platform/actions/browser/menuItemActionItem.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..e64a7d0ed09f01155f7629cf3084270adaad2390 --- /dev/null +++ b/i18n/hun/src/vs/platform/actions/browser/menuItemActionItem.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "titleAndKb": "{0} ({1})" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/platform/actions/electron-browser/menusExtensionPoint.i18n.json b/i18n/hun/src/vs/platform/actions/electron-browser/menusExtensionPoint.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..e935364b995c1caf12188090261b638ab4a90cf1 --- /dev/null +++ b/i18n/hun/src/vs/platform/actions/electron-browser/menusExtensionPoint.i18n.json @@ -0,0 +1,43 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "requirearray": "a menüelemeket tömbként kell megadni", + "requirestring": "a(z) `{0}` tulajdonság kötelező és `string` típusúnak kell lennie", + "optstring": "a(z) `{0}` tulajdonság elhagyható vagy `string` típusúnak kell lennie", + "vscode.extension.contributes.menuItem.command": "A végrehajtandó parancs azonosítója. A parancsot a 'commands'-szakaszban kell deklarálni", + "vscode.extension.contributes.menuItem.alt": "Egy alternatív végrehajtandó parancs azonosítója. A parancsot a 'commands'-szakaszban kell deklarálni", + "vscode.extension.contributes.menuItem.when": "A feltételnek igaznak kell lennie az elem megjelenítéséhez", + "vscode.extension.contributes.menuItem.group": "A csoport, amibe a parancs tartozik", + "vscode.extension.contributes.menus": "Menüket szolgáltat a szerkesztőhöz", + "menus.commandPalette": "A parancskatalógus", + "menus.editorTitle": "A szerkesztőablak címsora menüje", + "menus.editorContext": "A szerkesztőablak helyi menüje", + "menus.explorerContext": "A fájlkezelő helyi menüje", + "menus.editorTabContext": "A szerkesztőablak füleinek helyi menüje", + "menus.debugCallstackContext": "A hibakeresési hívási verem helyi menüje", + "menus.scmTitle": "A verziókezelő címsora menüje", + "menus.resourceGroupContext": "A verziókezelő erőforráscsoportja helyi menüje", + "menus.resourceStateContext": "A verziókzeleő erőforrásállapot helyi menüje", + "view.viewTitle": "A szolgáltatott nézet címsorának menüje", + "view.itemContext": "A szolgáltatott nézet elemének helyi menüje", + "nonempty": "az érték nem lehet üres.", + "opticon": "a(z) `icon` tulajdonság elhagyható vagy ha van értéke, akkor string vagy literál (pl. `{dark, light}`) típusúnak kell lennie", + "requireStringOrObject": "a(z) `{0}` tulajdonság kötelező és `string` vagy `object` típusúnak kell lennie", + "requirestrings": "a(z) `{0}` és `{1}` tulajdonságok kötelezők és `string` típusúnak kell lenniük", + "vscode.extension.contributes.commandType.command": "A végrehajtandó parancs azonosítója", + "vscode.extension.contributes.commandType.title": "A cím, amivel a parancs meg fog jelenni a felhasználói felületen", + "vscode.extension.contributes.commandType.category": "(Nem kötelező) Kategória neve, amibe a felületen csoportosítva lesz a parancs", + "vscode.extension.contributes.commandType.icon": "(Nem kötelező) Ikon, ami reprezentálni fogja a parancsot a felhasználói felületen. Egy fájl elérési útja vagy egy színtéma-konfiguráció", + "vscode.extension.contributes.commandType.icon.light": "Az ikon elérési útja, ha világos téma van használatban", + "vscode.extension.contributes.commandType.icon.dark": "Az ikon elérési útja, ha sötét téma van használatban", + "vscode.extension.contributes.commands": "Parancsokat szolgáltat a parancskatalógushoz.", + "dup": "A(z) `{0}` parancs többször szerepel a `commands`-szakaszban.", + "menuId.invalid": "A(z) `{0}` nem érvényes menüazonosító", + "missing.command": "A menüpont a(z) `{0}` parancsra hivatkozik, ami nincs deklarálva a 'commands'-szakaszban.", + "missing.altCommand": "A menüpont a(z) `{0}` alternatív parancsra hivatkozik, ami nincs deklarálva a 'commands'-szakaszban.", + "dupe.command": "A menüpont ugyanazt a parancsot hivatkozza alapértelmezett és alternatív parancsként", + "nosupport.altCommand": "Jelenleg csak az 'editor/title' menü 'navigation' csoportja támogatja az alternatív parancsokat" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/platform/configuration/common/configurationRegistry.i18n.json b/i18n/hun/src/vs/platform/configuration/common/configurationRegistry.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..bfd5f7e168cf776cf571dbd79fdac1bb39e81cf7 --- /dev/null +++ b/i18n/hun/src/vs/platform/configuration/common/configurationRegistry.i18n.json @@ -0,0 +1,19 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "defaultConfigurations.title": "Felülírt alapértelmezett konfigurációk", + "overrideSettings.description": "A szerkesztő beállításainak felülírása a(z) {0} nyelvre vonatkozóan", + "overrideSettings.defaultDescription": "A szerkesztő beállításainak felülírása egy adott nyelvre vonatkozóan", + "vscode.extension.contributes.configuration": "Konfigurációs beállításokat szolgáltat.", + "vscode.extension.contributes.configuration.title": "A beállítások összefoglaló leírása. Ez a címke jelenik meg a beállítások fájlban egy különálló megjegyzésként.", + "vscode.extension.contributes.configuration.properties": "A konfigurációs tulajdonságok leírása.", + "config.property.languageDefault": "A(z) '{0}' nem regisztrálható. Ez a beállítás illeszkedik a '\\\\[.*\\\\]$' mintára, ami a nyelvspecifikus szerkesztőbeállításokhoz van használva. Használja a 'configurationDefaults' szolgáltatási lehetőséget.", + "config.property.duplicate": "A(z) '{0}' nem regisztrálható: ez a tulajdonság már regisztrálva van.", + "invalid.properties": "A 'configuration.properties' értékét egy objektumként kell megadni", + "invalid.type": "ha meg van adva, a 'configuration.type' értékét egy objektumként kell megadnii", + "invalid.title": "a 'configuration.title' értékét karakterláncként kell megadni", + "vscode.extension.contributes.defaultConfiguration": "Adott nyelvre vonatkozóan szerkesztőbeállításokat szolgáltat." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/platform/environment/node/argv.i18n.json b/i18n/hun/src/vs/platform/environment/node/argv.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..e6ca14e40be7dd49a26d934e5a125d9ed433345d --- /dev/null +++ b/i18n/hun/src/vs/platform/environment/node/argv.i18n.json @@ -0,0 +1,32 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "gotoValidation": "`--goto` mód esetén az argumentumokat a következő formában kell megadni: `FÁJL(:SOR(:OSZLOP))`.", + "diff": "Megnyit egy diffszerkesztőt. Argumentumként két fájl elérési útját kell átadni.", + "goto": "Megnyitja a megadott elérési úton található fájlt a megadott sornál és oszlopnál (a :sor[:oszlop] információt az elérési út végére kell fűzni)", + "locale": "A használt lokalizáció (pl. en-US vagy zh-TW)", + "newWindow": "Mindenképp induljon új példány a Code-ból.", + "performance": "Indítás a 'Developer: Startup Performance' parancs engedélyezésével.", + "prof-startup": "Processzorhasználat profilozása induláskor", + "reuseWindow": "Fájl vagy mappa megnyitása a legutoljára aktív ablakban.", + "userDataDir": "Meghatározza a könyvtárat, ahol a felhasználói adatok vannak tárolva. Hasznás, ha rootként van futtatva.", + "verbose": "Részletes kimenet kiírása (magába foglalja a --wait kapcsolót)", + "wait": "Várjon az ablak bezárására a visszatérés előtt.", + "extensionHomePath": "A kiegészítők gyökérkönyvtárának beállítása.", + "listExtensions": "Telepített kiegészítők listázása.", + "showVersions": "Telepített kiegészítők verziójának megjelenítése a --list-extension kapcsoló használata esetén.", + "installExtension": "Kiegészítő telepítése.", + "uninstallExtension": "Kiegészítő eltávolítása.", + "experimentalApis": "Tervezett API-funkciók engedélyezése egy kiegészítő számára.", + "disableExtensions": "Összes telepített kiegészítő letiltása.", + "disableGPU": "Hardveres gyorsítás letiltása.", + "version": "Verzió kiírása.", + "help": "Használati útmutató kiírása.", + "usage": "Használat", + "options": "beállítások", + "paths": "elérési utak", + "optionsUpperCase": "Beálítások" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/platform/extensionManagement/common/extensionEnablementService.i18n.json b/i18n/hun/src/vs/platform/extensionManagement/common/extensionEnablementService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..5da094f11e357abc2b9cde1627decf4cd9257284 --- /dev/null +++ b/i18n/hun/src/vs/platform/extensionManagement/common/extensionEnablementService.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "noWorkspace": "Nincs munkaterület." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/platform/extensionManagement/common/extensionManagement.i18n.json b/i18n/hun/src/vs/platform/extensionManagement/common/extensionManagement.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..c6aca38bd35a8619000b0e7cfc0f77127e0c8226 --- /dev/null +++ b/i18n/hun/src/vs/platform/extensionManagement/common/extensionManagement.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "extensions": "Kiegészítők", + "preferences": "Beállítások" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/platform/extensionManagement/node/extensionGalleryService.i18n.json b/i18n/hun/src/vs/platform/extensionManagement/node/extensionGalleryService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..62fa385ee0481e6405f07acd13092f5e46f423cc --- /dev/null +++ b/i18n/hun/src/vs/platform/extensionManagement/node/extensionGalleryService.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "notFound": "Kiegészítő nem található", + "noCompatible": "A(z) {0} kiegészítőnek nincs ezzel a Code-verzióval kompatibilis változata." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/platform/extensionManagement/node/extensionManagementService.i18n.json b/i18n/hun/src/vs/platform/extensionManagement/node/extensionManagementService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..9a21167685a8b5c29714ce14ca244963507fa994 --- /dev/null +++ b/i18n/hun/src/vs/platform/extensionManagement/node/extensionManagementService.i18n.json @@ -0,0 +1,22 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "invalidManifest": "A kiegészítő érvénytelen: a package.json nem egy JSON-fájl.", + "restartCode": "Indítsa újra a Code-ot a(z) {0} újratelepítése előtt.", + "installDependeciesConfirmation": "A(z) '{0}' teleítése során annak függőségei is telepítve lesznek. Szeretné folytatni?", + "install": "Igen", + "doNotInstall": "Nem", + "uninstallDependeciesConfirmation": "Csak a(z) '{0}' kiegészítőt szeretné eltávolítani vagy annak függőségeit is?", + "uninstallOnly": "Csak ezt", + "uninstallAll": "Mindent", + "cancel": "Mégse", + "uninstallConfirmation": "Biztosan szeretné eltávolítani a(z) '{0}' kiegészítőt?", + "ok": "OK", + "singleDependentError": "Nem sikerült eltávolítani a(z) '{0}' kiegészítőt: a(z) '{1}' kiegészítő függ tőle.", + "twoDependentsError": "Nem sikerült eltávolítani a(z) '{0}' kiegészítőt: a(z) '{1}' és '{2}' kiegészítők függnek tőle.", + "multipleDependentsError": "Nem sikerült eltávolítani a(z) '{0}' kiegészítőt: a(z) '{1}', '{2}' és más kiegészítők függnek tőle.", + "notExists": "Nem sikerült megtalálni a kiegészítőt" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/platform/extensions/common/abstractExtensionService.i18n.json b/i18n/hun/src/vs/platform/extensions/common/abstractExtensionService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..a4e5d9f9437b0b41bd4343a2183b9a4cfc4cc641 --- /dev/null +++ b/i18n/hun/src/vs/platform/extensions/common/abstractExtensionService.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "unknownDep": "A(z) `{1}` kiegészítőt nem sikerült aktiválni. Oka: ismeretlen függőség: `{0}`.", + "failedDep1": "A(z) `{1}` kiegészítőt nem sikerült aktiválni. Oka: a(z) `{0}` függőséget nem sikerült aktiválni.", + "failedDep2": "A(z) `{0}` kiegészítőt nem sikerült aktiválni. Oka: több, mint 10 szintnyi függőség van (nagy valószínűséggel egy függőségi hurok miatt).", + "activationError": "A(z) `{0}` kiegészítő aktiválása nem sikerült: {1}." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/platform/extensions/common/extensionsRegistry.i18n.json b/i18n/hun/src/vs/platform/extensions/common/extensionsRegistry.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..d7c85757ebd94a6b2e098e55f39edf83854f973a --- /dev/null +++ b/i18n/hun/src/vs/platform/extensions/common/extensionsRegistry.i18n.json @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "vscode.extension.engines.vscode": "VS Code kiegészítőkhöz. Meghatározza azt a VS Code-verziót, amivel a kiegészítő kompatibilis. Nem lehet *. Például a ^0.10.5 a VS Code minimum 0.10.5-ös verziójával való kompatibilitást jelzi.", + "vscode.extension.publisher": "A VS Code-kiegészítő kiadója.", + "vscode.extension.displayName": "A kiegészítő VS Code galériában megjelenített neve.", + "vscode.extension.categories": "A VS Code-galériában való kategorizálásra használt kategóriák.", + "vscode.extension.galleryBanner": "A VS Code piactéren használt szalagcím.", + "vscode.extension.galleryBanner.color": "A VS Code piactéren használt szalagcím színe.", + "vscode.extension.galleryBanner.theme": "A szalagcímben használt betűtípus színsémája.", + "vscode.extension.contributes": "A csomagban található összes szolgáltatás, amit ez a VS Code kiterjesztés tartalmaz.", + "vscode.extension.preview": "A kiegészítő előnézetesnek jelölése a piactéren.", + "vscode.extension.activationEvents": "A VS Code kiegészítő aktiválási eseményei.", + "vscode.extension.activationEvents.onLanguage": "Aktiváló esemény, ami akkor fut le, ha az adott nyelvhez társított fájl kerül megnyitásra.", + "vscode.extension.activationEvents.onCommand": "Aktiváló esemény, ami akkor fut le, amikor a megadott parancsot meghívják.", + "vscode.extension.activationEvents.onDebug": "Aktiváló esemény, ami akkor fut le, amikor elindul az adott típusú hibakeresési folyamat.", + "vscode.extension.activationEvents.workspaceContains": "Aktiváló esemény, ami akkor fut le, ha egy olyan mappa kerül megnyitásra, amiben legalább egy olyan fájl van, amely illeszkedik a megadott globális mintára.", + "vscode.extension.activationEvents.onView": "Aktiváló esemény, ami akkor fut le, amikor a megadott nézetet kiterjesztik.", + "vscode.extension.activationEvents.star": "Aktiváló esemény, ami a VS Code indításakor fut le. A jó felhasználói élmény érdekében csak akkor használja ezt az eseményt, ha más aktiváló események nem alkalmasak az adott kiegészítő esetében.", + "vscode.extension.badges": "A kiegészítő piactéren található oldalának oldalsávjában megjelenő jelvények listája.", + "vscode.extension.badges.url": "A jelvény kép URL-je.", + "vscode.extension.badges.href": "A jelvény hivatkozása.", + "vscode.extension.badges.description": "A jelvény leírása.", + "vscode.extension.extensionDependencies": "Más kiegészítők, melyek függőségei ennek a kiegészítőnek. A kiegészítők azonosítója mindig ${publisher}.${name} formájú. Például: vscode.csharp.", + "vscode.extension.scripts.prepublish": "A VS Code kiegészítő publikálása előtt végrehajtott parancsfájl.", + "vscode.extension.icon": "Egy 128x128 pixeles ikon elérési útja." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/platform/extensions/node/extensionValidator.i18n.json b/i18n/hun/src/vs/platform/extensions/node/extensionValidator.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..6d0f5c97cf4199a3f881f1a09e261053043eef4f --- /dev/null +++ b/i18n/hun/src/vs/platform/extensions/node/extensionValidator.i18n.json @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "versionSyntax": "Nem sikerült feldolgozni az `engines.vscode` beállítás értékét ({0}). Használja például a következők egyikét: ^0.10.0, ^1.2.3, ^0.11.0, ^0.10.x stb.", + "versionSpecificity1": "Az `engines.vscode` beállításban megadott érték ({0}) nem elég konkrét. A vscode 1.0.0 előtti verzióihoz legalább a kívánt fő- és alverziót is meg kell adni. Pl.: ^0.10.0, 0.10.x, 0.11.0 stb.", + "versionSpecificity2": "Az `engines.vscode` beállításban megadott érték ({0}) nem elég konkrét. A vscode 1.0.0 utáni verzióihoz legalább a kívánt főverziót meg kell adni. Pl.: ^1.10.0, 1.10.x, 1.x.x, 2.x.x stb.", + "versionMismatch": "A kiegészítő nem kompatibilis a Code {0} verziójával. A következő szükséges hozzá: {1}.", + "extensionDescription.empty": "A kiegészítő leírása üres", + "extensionDescription.publisher": "a(z) `{0}` tulajdonság kötelező és `string` típusúnak kell lennie", + "extensionDescription.name": "a(z) `{0}` tulajdonság kötelező és `string` típusúnak kell lennie", + "extensionDescription.version": "a(z) `{0}` tulajdonság kötelező és `string` típusúnak kell lennie", + "extensionDescription.engines": "a(z) `{0}` tulajdonság kötelező és `object` típusúnak kell lennie", + "extensionDescription.engines.vscode": "a(z) `{0}` tulajdonság kötelező és `string` típusúnak kell lennie", + "extensionDescription.extensionDependencies": "a(z) `{0}` tulajdonság elhagyható vagy `string[]` típusúnak kell lennie", + "extensionDescription.activationEvents1": "a(z) `{0}` tulajdonság elhagyható vagy `string[]` típusúnak kell lennie", + "extensionDescription.activationEvents2": "a(z) `{0}` és `{1}` megadása kötelező vagy mindkettőt el kell hagyni", + "extensionDescription.main1": "a(z) `{0}` tulajdonság elhagyható vagy `string` típusúnak kell lennie", + "extensionDescription.main2": "A `main` ({0}) nem a kiegészítő mappáján belül található ({1}). Emiatt előfordulhat, hogy a kiegészítő nem lesz hordozható.", + "extensionDescription.main3": "a(z) `{0}` és `{1}` megadása kötelező vagy mindkettőt el kell hagyni", + "notSemver": "A kiegészítő verziója nem semver-kompatibilis." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/platform/history/electron-main/historyMainService.i18n.json b/i18n/hun/src/vs/platform/history/electron-main/historyMainService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..a8e30a812a24226605faf7f7ebafc12735fae3aa --- /dev/null +++ b/i18n/hun/src/vs/platform/history/electron-main/historyMainService.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "newWindow": "Új ablak", + "newWindowDesc": "Nyit egy új ablakot", + "recentFolders": "Legutóbbi mappák", + "folderDesc": "{0} {1}" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/platform/integrity/node/integrityServiceImpl.i18n.json b/i18n/hun/src/vs/platform/integrity/node/integrityServiceImpl.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..b60e588de5f64a5a52f7c75dc1217abdf7641d61 --- /dev/null +++ b/i18n/hun/src/vs/platform/integrity/node/integrityServiceImpl.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "integrity.ok": "OK", + "integrity.dontShowAgain": "Ne jelenítse meg újra", + "integrity.moreInfo": "További információ", + "integrity.prompt": "A feltelepített {0} hibásnak tűnik. Telepítse újra!" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/platform/jsonschemas/common/jsonValidationExtensionPoint.i18n.json b/i18n/hun/src/vs/platform/jsonschemas/common/jsonValidationExtensionPoint.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..8e300a2fd3874d7953e110d272b2fea6eb21d6e7 --- /dev/null +++ b/i18n/hun/src/vs/platform/jsonschemas/common/jsonValidationExtensionPoint.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "contributes.jsonValidation": "JSON-sémakonfigurációkat szolgáltat.", + "contributes.jsonValidation.fileMatch": "Az illesztendő fájlok mintája, például \"package.json\" vagy \"*.launch\".", + "contributes.jsonValidation.url": "A séma URL-címe ('http:', 'https:') vagy relatív elérési útja a kiegészítő mappájához képest ('./').", + "invalid.jsonValidation": "a 'configuration.jsonValidation' értékét tömbként kell megadni", + "invalid.fileMatch": "a 'configuration.jsonValidation.fileMatch' tulajdonság kötelező", + "invalid.url": "a 'configuration.jsonValidation.url' értéke URL-cím vagy relatív elérési út lehet", + "invalid.url.fileschema": "a 'configuration.jsonValidation.url' érvénytelen relatív elérési utat tartalmaz: {0}", + "invalid.url.schema": "a 'configuration.jsonValidation.url' érténének 'http:'-tal, 'https:'-tal, vagy a kiegészítőben elhelyezett sémák hivatkozása esetén './'-rel kell kezdődnie." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/platform/keybinding/common/abstractKeybindingService.i18n.json b/i18n/hun/src/vs/platform/keybinding/common/abstractKeybindingService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..3e93e9b7ff5fcee9061dd1356102805f705513ac --- /dev/null +++ b/i18n/hun/src/vs/platform/keybinding/common/abstractKeybindingService.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "first.chord": "Lenyomta a következőt: ({0}). Várakozás a kombináció második billentyűjére...", + "missing.chord": "A(z) ({0}, {1}) billentyűkombináció nem egy parancs." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/platform/markers/common/problemMatcher.i18n.json b/i18n/hun/src/vs/platform/markers/common/problemMatcher.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..e24a428b5f13fb9a9fdbbf91c4579fe2c64ec39d --- /dev/null +++ b/i18n/hun/src/vs/platform/markers/common/problemMatcher.i18n.json @@ -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. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "ProblemPatternParser.loopProperty.notLast": "A loop tulajdonság csak az utolsó, sorra illesztő kifejezésnél támogatott.", + "ProblemPatternParser.problemPattern.missingRegExp": "A problémamintából hiányzik egy reguláris kifejezés.", + "ProblemPatternParser.problemPattern.missingProperty": "A probléma mintája érvénytelen. Mindenképp tartalmaznia kell egy fájlra, egy üzenetre és egy sorra vagy helyre illesztő csoportot.", + "ProblemPatternParser.invalidRegexp": "Hiba: A(z) {0} karakterlánc nem érvényes reguláris kifejezés.\n", + "ProblemPatternSchema.regexp": "A kimenetben található hibák, figyelmeztetések és információk megkeresésére használt reguláris kifejezés.", + "ProblemPatternSchema.file": "Annak az illesztési csoportnak az indexe, amely tartalmazza azt, hogy a probléma melyik fájlban található. Ha nincs megadva, akkor az alapértelmezett érték, 1 van használva.", + "ProblemPatternSchema.location": "Annak az illesztési csoportnak az indexe, amely tartalmazza a probléma helyét. Az érvényes minták helyek illesztésére: (line), (line,column) és (startLine,startColumn,endLine,endColumn). Ha nincs megadva, akkor a (line,column) van feltételezve.", + "ProblemPatternSchema.line": "Annak az illesztési csoportnak az indexe, amely tartalmazza azt, hogy a probléma hanyadik sorban található. Alapértelmezett értéke 2.", + "ProblemPatternSchema.column": "Annak az illesztési csoportnak az indexe, amely tartalmazza azt, hogy a probléma az adott soron belül mely oszlopban található. Alapértelmezett értéke 3.", + "ProblemPatternSchema.endLine": "Annak az illesztési csoportnak az indexe, amely tartalmazza azt, hogy a probléma mely sorban ér véget. Alapértelmezett értéke határozatlan.", + "ProblemPatternSchema.endColumn": "Annak az illesztési csoportnak az indexe, amely tartalmazza azt, hogy a probléma vége a zárósoron belül mely oszlopban található. Alapértelmezett értéke határozatlan.", + "ProblemPatternSchema.severity": "Annak az illesztési csoportnak az indexe, amely tartalmazza a probléma súlyosságát. Alapértelmezett értéke határozatlan.", + "ProblemPatternSchema.code": "Annak az illesztési csoportnak az indexe, amely tartalmazza a problémás kódrészletet. Alapértelmezett értéke határozatlan.", + "ProblemPatternSchema.message": "Annak az illesztési csoportnak az indexe, amely tartalmazza az üzenetet. Ha nincs megadva, és a location paraméternek van értéke, akkor a 4, minden más esetben 5 az alapértelmezett érték.", + "ProblemPatternSchema.loop": "Több soros illesztés esetén meghatározza, hogy az aktuális minta mindaddig végre legyen-e hajtva, amíg eredményt talál. Csak többsoros minta esetén használható, utolsóként.", + "NamedProblemPatternSchema.name": "A problémaminta neve.", + "NamedMultiLineProblemPatternSchema.name": "A többsoros problémaminta neve.", + "NamedMultiLineProblemPatternSchema.patterns": "A konkrét minkák.", + "ProblemPatternExtPoint": "Problémamintákat szolgáltat.", + "ProblemPatternRegistry.error": "Érvénytelen problémaminta. A minta figyelmen kívül lesz hagyva.", + "ProblemMatcherParser.noProblemMatcher": "Hiba: a leírást nem sikerült problémaillesztővé alakítani:\n{0}\n", + "ProblemMatcherParser.noProblemPattern": "Hiba: a leírás nem definiál érvényes problémamintát:\n{0}\n", + "ProblemMatcherParser.noOwner": "Hiba: a leírás nem határoz meg tulajdonost:\n{0}\n", + "ProblemMatcherParser.noFileLocation": "Hiba: a leírás nem határoz meg fájlhelyszínt:\n{0}\n", + "ProblemMatcherParser.unknownSeverity": "Információ: ismeretlen súlyosság: {0}. Az érvényes értékek: error, warning és info.\n", + "ProblemMatcherParser.noDefinedPatter": "Hiba: nem létezik {0} azonosítóval rendelkező minta.", + "ProblemMatcherParser.noIdentifier": "Hiba: a minta tulajdonság egy üres azonosítóra hivatkozik.", + "ProblemMatcherParser.noValidIdentifier": "Hiba: a minta {0} tulajdonsága nem érvényes mintaváltozónév.", + "ProblemMatcherParser.problemPattern.watchingMatcher": "A problémaillesztőnek definiálnia kell a kezdőmintát és a zárómintát is a figyeléshez.", + "ProblemMatcherParser.invalidRegexp": "Hiba: A(z) {0} karakterlánc nem érvényes reguláris kifejezés.\n", + "WatchingPatternSchema.regexp": "Reguláris kifejezés a háttérben futó feladat indulásának vagy befejeződésének detektálására.", + "WatchingPatternSchema.file": "Annak az illesztési csoportnak az indexe, amely tartalmazza azt, hogy a probléma melyik fájlban található. Elhagyható.", + "PatternTypeSchema.name": "Egy szolgáltatott vagy elődefiniált minta neve", + "PatternTypeSchema.description": "Egy problémaminta vagy egy szolgáltatott vagy elődefiniált problémaminta neve. Elhagyható, ha az alapként használandó minta meg van adva.", + "ProblemMatcherSchema.base": "A alapként használni kívánt problémaillesztő neve.", + "ProblemMatcherSchema.owner": "A probléma tulajdonosa a Code-on belül. Elhagyható, ha az alapként használt minta meg van adva. Alapértelmezett értéke 'external', ha nem létezik és az alapként használt minta nincs meghatározva.", + "ProblemMatcherSchema.severity": "Az elkapott problémák alapértelmezett súlyossága. Ez az érték van használva, ha a minta nem definiál illesztési csoportot a súlyossághoz.", + "ProblemMatcherSchema.applyTo": "Meghatározza, hogy a szöveges dokumentumhoz jelentett probléma megnyitott, bezárt vagy minden dokumentumra legyen alkalmazva.", + "ProblemMatcherSchema.fileLocation": "Meghatározza, hogy a problémamintában talált fájlnevek hogyan legyenek értelmezve.", + "ProblemMatcherSchema.background": "Minták, melyekkel követhető egy háttérben futó feladaton aktív illesztő indulása és befejeződése.", + "ProblemMatcherSchema.background.activeOnStart": "Ha értéke igaz, akkor a háttérfeladat aktív módban van, amikor a feladat indul. Ez egyenlő egy olyan sor kimenetre történő kiírásával, ami illeszkedik a beginPatternre.", + "ProblemMatcherSchema.background.beginsPattern": "Ha illeszkedik a kimenetre, akkor a háttérben futó feladat elindulása lesz jelezve.", + "ProblemMatcherSchema.background.endsPattern": "Ha illeszkedik a kimenetre, akkor a háttérben futó feladat befejeződése lesz jelezve.", + "ProblemMatcherSchema.watching.deprecated": "A watching tulajdonság elavult. Használja a backgroundot helyette.", + "ProblemMatcherSchema.watching": "Minták, melyekkel következő a figyelő illesztők indulása és befejeződése.", + "ProblemMatcherSchema.watching.activeOnStart": "Ha értéke igaz, akkor a figyelő aktív módban van, amikor a feladat indul. Ez egyenlő egy olyan sor kimenetre történő kiírásával, ami illeszkedik a beginPatternre.", + "ProblemMatcherSchema.watching.beginsPattern": "Ha illeszkedik a kimenetre, akkor a figyelő feladat elindulása lesz jelezve.", + "ProblemMatcherSchema.watching.endsPattern": "Ha illeszkedik a kimenetre, akkor a figyelő feladat befejeződése lesz jelezve.", + "LegacyProblemMatcherSchema.watchedBegin.deprecated": "Ez a tulajdonság elavult. Használja a watching tulajdonságot helyette.", + "LegacyProblemMatcherSchema.watchedBegin": "Reguláris kifejezés, mely jelzi, hogy a figyeltő feladatok fájlmódosítás miatt éppen műveletet hajtanak végre.", + "LegacyProblemMatcherSchema.watchedEnd.deprecated": "Ez a tulajdonság elavult. Használja a watching tulajdonságot helyette.", + "LegacyProblemMatcherSchema.watchedEnd": "Reguláros kifejezés, ami jelzi, hogy a figyelő feladat befejezte a végrehajtást.", + "NamedProblemMatcherSchema.name": "A problémaillesztő neve.", + "ProblemMatcherExtPoint": "Problémaillesztőket szolgáltat." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/platform/message/common/message.i18n.json b/i18n/hun/src/vs/platform/message/common/message.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..a4f556eb01c230e361a1f99208d3fb06f0a954af --- /dev/null +++ b/i18n/hun/src/vs/platform/message/common/message.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "close": "Bezárás", + "later": "Később", + "cancel": "Mégse" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/platform/request/node/request.i18n.json b/i18n/hun/src/vs/platform/request/node/request.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..83987512ccd7cd747606247d952e12af9cde5f6e --- /dev/null +++ b/i18n/hun/src/vs/platform/request/node/request.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "httpConfigurationTitle": "HTTP", + "proxy": "A használni kívánt proxybeállítás. Ha nincs beállítva, a http_proxy és a https_proxy környezeti változókból lesz átvéve", + "strictSSL": "A proxyszerver tanúsítványa hitelesítve legyen-e a megadott hitelesítésszolgáltatóknál.", + "proxyAuthorization": "Minden hálózati kérés 'Proxy-Authorization' fejlécében küldendő érték." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/platform/telemetry/common/telemetryService.i18n.json b/i18n/hun/src/vs/platform/telemetry/common/telemetryService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..312528f889138cffee817f71841ad0bd09c60848 --- /dev/null +++ b/i18n/hun/src/vs/platform/telemetry/common/telemetryService.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "telemetryConfigurationTitle": "Telemetria", + "telemetry.enableTelemetry": "Használati adatok és hibák küldésének engedélyezése a Microsoft felé." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/platform/theme/common/colorRegistry.i18n.json b/i18n/hun/src/vs/platform/theme/common/colorRegistry.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..9521382b276ca2bee49cbea6b71fba863422a765 --- /dev/null +++ b/i18n/hun/src/vs/platform/theme/common/colorRegistry.i18n.json @@ -0,0 +1,88 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "invalid.color": "Érvénytelen színformátum. Az #RGB, #RGBA, #RRGGBB vagy #RRGGBBAA formátum használható.", + "schema.colors": "A munkaterületen használt színek.", + "foreground": "Általános előtérszín. Csak akkor van használva, ha nem írja felül az adott komponens.", + "errorForeground": "A hibaüzenetek általános előtérszíne. Csak akkor van használva, ha nem írja felül az adott komponens.", + "descriptionForeground": "A további információkat szolgáltató leíró szövegek, pl. a címkék előtérszíne.", + "focusBorder": "Fókuszált elemek keretének általános színe. Csak akkor van használva, ha nem írja felül az adott komponens.", + "contrastBorder": "Az elemek körüli extra keret, mely arra szolgál, hogy elválassza egymástól őket, így növelve a kontrasztot.", + "activeContrastBorder": "Az aktív elemek körüli extra keret, mely arra szolgál, hogy elválassza egymástól őket, így növelve a kontrasztot.", + "selectionBackground": "A munkaterületen kijelölt szövegek háttérszíne (pl. beviteli mezők vagy szövegmezők esetén). Ez a beállítás nem vonatkozik a szerkesztőablakban végzett kijelölésekre. ", + "textSeparatorForeground": "A szövegelválasztók színe.", + "textLinkForeground": "A szövegben található hivatkozások előtérszíne.", + "textLinkActiveForeground": "A szövegben található aktív hivatkozások előtérszíne.", + "textPreformatForeground": "Az előformázott szövegrészek előtérszíne.", + "textBlockQuoteBackground": "A szövegben található idézetblokkok háttérszíne.", + "textBlockQuoteBorder": "A szövegben található idézetblokkok keretszíne.", + "textCodeBlockBackground": "A szövegben található kódblokkok háttérszíne.", + "widgetShadow": "A szerkesztőablakon belül található modulok, pl. a keresés/csere árnyékának színe.", + "inputBoxBackground": "A beviteli mezők háttérszíne.", + "inputBoxForeground": "A beviteli mezők előtérszíne.", + "inputBoxBorder": "A beviteli mezők kerete.", + "inputBoxActiveOptionBorder": "A beviteli mezőben található aktivált beállítások keretszíne.", + "inputPlaceholderForeground": "A beviteli mezőkben használt helykitöltő szövegek előtérszíne.", + "inputValidationInfoBackground": "Beviteli mezők háttérszíne információs szintű validációs állapot esetén.", + "inputValidationInfoBorder": "Beviteli mezők keretszíne információs szintű validációs állapot esetén.", + "inputValidationWarningBackground": "Beviteli mezők háttérszíne figyelmeztetés szintű validációs állapot esetén.", + "inputValidationWarningBorder": "Beviteli mezők keretszíne figyelmeztetés szintű validációs állapot esetén.", + "inputValidationErrorBackground": "Beviteli mezők háttérszíne hiba szintű validációs állapot esetén.", + "inputValidationErrorBorder": "Beviteli mezők keretszíne hiba szintű validációs állapot esetén.", + "dropdownBackground": "A legördülő menük háttérszíne.", + "dropdownForeground": "A legördülő menük előtérszíne.", + "dropdownBorder": "A legördülő menük kerete.", + "listFocusBackground": "Listák/fák fókuszált elemének háttérszine, amikor a lista aktív. Egy aktív listának/fának van billentyűfőkusza, míg egy inaktívnak nincs.", + "listFocusForeground": "Listák/fák fókuszált elemének előtérszíne, amikor a lista aktív. Egy aktív listának/fának van billentyűfőkusza, míg egy inaktívnak nincs.", + "listActiveSelectionBackground": "Listák/fák kiválasztott elemének háttérszíne, amikor a lista aktív. Egy aktív listának/fának van billentyűfőkusza, míg egy inaktívnak nincs.", + "listActiveSelectionForeground": "Listák/fák kiválasztott elemének előtérszíne, amikor a lista aktív. Egy aktív listának/fának van billentyűfőkusza, míg egy inaktívnak nincs.", + "listInactiveSelectionBackground": "Listák/fák kiválasztott elemének háttérszíne, amikor a lista inaktív. Egy aktív listának/fának van billentyűfőkusza, míg egy inaktívnak nincs.", + "listInactiveSelectionForeground": "Listák/fák kiválasztott elemének előtérszíne, amikor a lista inaktív. Egy aktív listának/fának van billentyűfőkusza, míg egy inaktívnak nincs.", + "listHoverBackground": "A lista/fa háttérszíne, amikor az egérkurzor egy adott elem fölé kerül.", + "listHoverForeground": "A lista/fa előtérszíne, amikor az egérkurzor egy adott elem fölé kerül.", + "listDropBackground": "A lista/fa háttérszíne, amikor az elemek az egérkurzorral vannak mozgatva egyik helyről a másikra.", + "highlight": "Kiemelt találatok előtérszíne a listában/fában való keresés esetén.", + "pickerGroupForeground": "Csoportcímkék színe a gyorsválasztóban.", + "pickerGroupBorder": "Csoportok keretszíne a gyorsválasztóban.", + "buttonForeground": "A gombok előtérszíne.", + "buttonBackground": "A gombok háttérszíne.", + "buttonHoverBackground": "A gomb háttérszine, ha az egérkurzor fölötte van.", + "badgeBackground": "A jelvények háttérszíne. A jelvények apró információs címkék, pl. a keresési eredmények számának jelzésére.", + "badgeForeground": "A jelvények előtérszíne. A jelvények apró információs címkék, pl. a keresési eredmények számának jelzésére.", + "scrollbarShadow": "A görgetősáv árnyéka, ami jelzi, hogy a nézet el van görgetve.", + "scrollbarSliderBackground": "A csúszkák háttérszíne.", + "scrollbarSliderHoverBackground": "A csúszkák háttérszíne, ha az egérkurzor felette van.", + "scrollbarSliderActiveBackground": "Az aktív csúszkák háttérszíne.", + "progressBarBackground": "A hosszú ideig tartó folyamatok esetén megjelenített folyamatjelző háttérszíne.", + "editorBackground": "A szerkesztőablak háttérszíne.", + "editorForeground": "A szerkesztőablak alapértelmezett előtérszíne.", + "editorWidgetBackground": "A szerkesztőablak moduljainak háttérszíne, pl. a keresés/cserének.", + "editorWidgetBorder": "A szerkesztőablak-modulok keretszíne. A szín csak akkor van használva, ha a modul beállítása alapján rendelkezik kerettel, és a színt nem írja felül a modul.", + "editorSelection": "A szerkesztőablakban található kijelölések színe.", + "editorInactiveSelection": "Az inaktív szerkesztőablakban található kijelölések színe.", + "editorSelectionHighlight": "A kijelöléssel megegyező tartalmú területek színe.", + "editorFindMatch": "A keresés jelenlegi találatának színe.", + "findMatchHighlight": "A keresés további találatainak színe.", + "findRangeHighlight": "A keresést korlátozó terület színe.", + "hoverHighlight": "Kiemelés azon szó alatt, amely fölött lebegő elem jelenik meg.", + "hoverBackground": "A szerkesztőablakban lebegő elemek háttérszíne.", + "hoverBorder": "A szerkesztőablakban lebegő elemek keretszíne.", + "activeLinkForeground": "Az aktív hivatkozások háttérszíne.", + "diffEditorInserted": "A beillesztett szövegek háttérszíne.", + "diffEditorRemoved": "Az eltávolított szövegek háttérszíne.", + "diffEditorInsertedOutline": "A beillesztett szövegek körvonalának színe.", + "diffEditorRemovedOutline": "Az eltávolított szövegek körvonalának színe.", + "mergeCurrentHeaderBackground": "A helyi tartalom fejlécének háttérszíne sorok között megjelenített összeolvasztási konfliktusok esetén.", + "mergeCurrentContentBackground": "A helyi tartalom háttérszíne sorok között megjelenített összeolvasztási konfliktusok esetén.", + "mergeIncomingHeaderBackground": "A beérkező tartalom fejlécének háttérszíne sorok között megjelenített összeolvasztási konfliktusok esetén.", + "mergeIncomingContentBackground": "A beérkező tartalom háttérszíne sorok között megjelenített összeolvasztási konfliktusok esetén.", + "mergeCommonHeaderBackground": "A közös ős tartalom fejlécének háttérszíne sorok között megjelenített összeolvasztási konfliktusok esetén. ", + "mergeCommonContentBackground": "A közös ős tartalom háttérszíne sorok között megjelenített összeolvasztási konfliktusok esetén. ", + "mergeBorder": "A fejlécek és az elválasztó sáv keretszíne a sorok között megjelenített összeolvasztási konfliktusok esetén.", + "overviewRulerCurrentContentForeground": "A helyi tartalom előtérszíne az áttekintő sávon összeolvasztási konfliktusok esetén.", + "overviewRulerIncomingContentForeground": "A beérkező tartalom előtérszíne az áttekintő sávon összeolvasztási konfliktusok esetén.", + "overviewRulerCommonContentForeground": "A közös ős tartalom előtérszíne az áttekintő sávon összeolvasztási konfliktusok esetén. " +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/api/electron-browser/mainThreadExtensionService.i18n.json b/i18n/hun/src/vs/workbench/api/electron-browser/mainThreadExtensionService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..c9ac5c4a1264fe4f08cf2cacd610eb3b79761842 --- /dev/null +++ b/i18n/hun/src/vs/workbench/api/electron-browser/mainThreadExtensionService.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "overwritingExtension": "A(z) {0} kiegészítő felülírása a következővel: {1}.", + "extensionUnderDevelopment": "A(z) {0} elérési úton található fejlesztői kiegészítő betöltése" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/api/electron-browser/mainThreadMessageService.i18n.json b/i18n/hun/src/vs/workbench/api/electron-browser/mainThreadMessageService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..32ac1f41978bc8d5c5f7f8f938db2eb01742a861 --- /dev/null +++ b/i18n/hun/src/vs/workbench/api/electron-browser/mainThreadMessageService.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "close": "Bezárás", + "cancel": "Mégse", + "ok": "OK" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/api/node/extHostDiagnostics.i18n.json b/i18n/hun/src/vs/workbench/api/node/extHostDiagnostics.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..4b78aadacdece7a23b4b63bd42f5e92aac22bc1a --- /dev/null +++ b/i18n/hun/src/vs/workbench/api/node/extHostDiagnostics.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "limitHit": "{0} további hiba és figyelmeztetés nem jelenik meg." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/api/node/extHostTask.i18n.json b/i18n/hun/src/vs/workbench/api/node/extHostTask.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..4b90a12aaf247b4a1af0e887542958471d8df5e5 --- /dev/null +++ b/i18n/hun/src/vs/workbench/api/node/extHostTask.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "task.label": "{0}: {1}" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/api/node/extHostTreeViews.i18n.json b/i18n/hun/src/vs/workbench/api/node/extHostTreeViews.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..ad630367cbae501c824f2c6b3391f7d446b345ea --- /dev/null +++ b/i18n/hun/src/vs/workbench/api/node/extHostTreeViews.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "treeView.notRegistered": "Nincs '{0}' azonosítóval regisztrált fanézet.", + "treeItem.notFound": "Nincs '{0}' azonosítójú elem a fában.", + "treeView.duplicateElement": "A(z) {0} elem már regisztrálva van" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/browser/actions/configureLocale.i18n.json b/i18n/hun/src/vs/workbench/browser/actions/configureLocale.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..fde77c790146fe57245dee30c46fcee55b3844f3 --- /dev/null +++ b/i18n/hun/src/vs/workbench/browser/actions/configureLocale.i18n.json @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "configureLocale": "Nyelv beállítása", + "displayLanguage": "Meghatározza a VSCode felületének nyelvét.", + "doc": "Az elérhető nyelvek listája a következő címen tekinthető meg: {0}", + "restart": "Az érték módosítása után újra kell indítani a VSCode-ot.", + "fail.createSettings": "A(z) '{0}' nem hozható létre ({1})", + "JsonSchema.locale": "A felhasználói felületen használt nyelv." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/browser/actions/fileActions.i18n.json b/i18n/hun/src/vs/workbench/browser/actions/fileActions.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..9c4fe7cdf283db0c1fbb3079ce6747a3d9940a52 --- /dev/null +++ b/i18n/hun/src/vs/workbench/browser/actions/fileActions.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "openFolder": "Mappa megnyitása...", + "openFileFolder": "Megnyitás..." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/browser/actions/toggleActivityBarVisibility.i18n.json b/i18n/hun/src/vs/workbench/browser/actions/toggleActivityBarVisibility.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..5855d42c943d055cc682af72058587b654af5824 --- /dev/null +++ b/i18n/hun/src/vs/workbench/browser/actions/toggleActivityBarVisibility.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "toggleActivityBar": "Tevékenységsáv be- és kikapcsolása", + "view": "Nézet" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/browser/actions/toggleEditorLayout.i18n.json b/i18n/hun/src/vs/workbench/browser/actions/toggleEditorLayout.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..3880a172e267e7353a5c96081fcd8dc6fa3b6a63 --- /dev/null +++ b/i18n/hun/src/vs/workbench/browser/actions/toggleEditorLayout.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "toggleEditorGroupLayout": "Szerkesztőablak-csoport vízszintes/függőleges elrendezésének váltása", + "horizontalLayout": "Szerkesztőablak-csoport elrendezése vízszintesen", + "verticalLayout": "Szerkesztőablak-csoport elrendezése függőlegesen", + "view": "Nézet" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/browser/actions/toggleSidebarPosition.i18n.json b/i18n/hun/src/vs/workbench/browser/actions/toggleSidebarPosition.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..b5b22901d6a80dcff1fb1856dad02a4809e521f0 --- /dev/null +++ b/i18n/hun/src/vs/workbench/browser/actions/toggleSidebarPosition.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "toggleLocation": "Oldalsáv helyének váltása", + "view": "Nézet" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/browser/actions/toggleSidebarVisibility.i18n.json b/i18n/hun/src/vs/workbench/browser/actions/toggleSidebarVisibility.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..851dacaba5ceab37002d12cb4b492a8323e4744d --- /dev/null +++ b/i18n/hun/src/vs/workbench/browser/actions/toggleSidebarVisibility.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "toggleSidebar": "Oldalsáv be- és kikapcsolása", + "view": "Nézet" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/browser/actions/toggleStatusbarVisibility.i18n.json b/i18n/hun/src/vs/workbench/browser/actions/toggleStatusbarVisibility.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..b2087b12af601d0e181895164a2d05f3b6a0867e --- /dev/null +++ b/i18n/hun/src/vs/workbench/browser/actions/toggleStatusbarVisibility.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "toggleStatusbar": "Állapotsor be- és kikapcsolása", + "view": "Nézet" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/browser/actions/toggleZenMode.i18n.json b/i18n/hun/src/vs/workbench/browser/actions/toggleZenMode.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..de2a4b219be26a6e7549d152848fa992334e9150 --- /dev/null +++ b/i18n/hun/src/vs/workbench/browser/actions/toggleZenMode.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "toggleZenMode": "Zen mód be- és kikapcsolása", + "view": "Nézet" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/browser/parts/activitybar/activitybarActions.i18n.json b/i18n/hun/src/vs/workbench/browser/parts/activitybar/activitybarActions.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..38f496cc0eecb251b76b38cb0b3d8160097e60e2 --- /dev/null +++ b/i18n/hun/src/vs/workbench/browser/parts/activitybar/activitybarActions.i18n.json @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "removeFromActivityBar": "Eltávolítás a tevékenységsávról", + "keepInActivityBar": "Megtartás a tevékenységsávon", + "titleKeybinding": "{0} ({1})", + "additionalViews": "További nézetek", + "numberBadge": "{0} ({1})", + "manageExtension": "Kiegészítő kezelése", + "toggle": "Nézet rögzítésének be- és kikapcsolása" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/browser/parts/activitybar/activitybarPart.i18n.json b/i18n/hun/src/vs/workbench/browser/parts/activitybar/activitybarPart.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..266ac56433e84307e45374dd3d72b1c3afb41668 --- /dev/null +++ b/i18n/hun/src/vs/workbench/browser/parts/activitybar/activitybarPart.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "hideActivitBar": "Tevékenységsáv elrejtése", + "activityBarAriaLabel": "Az aktív nézet váltása", + "globalActions": "Globális műveletek" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/browser/parts/compositePart.i18n.json b/i18n/hun/src/vs/workbench/browser/parts/compositePart.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..46148b0c7c3bd6735d4a77fc53be38cfbcc747f7 --- /dev/null +++ b/i18n/hun/src/vs/workbench/browser/parts/compositePart.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "ariaCompositeToolbarLabel": "{0} művelet", + "titleTooltip": "{0} ({1})" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/browser/parts/editor/binaryDiffEditor.i18n.json b/i18n/hun/src/vs/workbench/browser/parts/editor/binaryDiffEditor.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..a38af02d663527576754d8164f4e2b729825137b --- /dev/null +++ b/i18n/hun/src/vs/workbench/browser/parts/editor/binaryDiffEditor.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "metadataDiff": "{0} ↔ {1}" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/browser/parts/editor/binaryEditor.i18n.json b/i18n/hun/src/vs/workbench/browser/parts/editor/binaryEditor.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..a8bbd66e2e81416427df10770814a38f63cdfd7e --- /dev/null +++ b/i18n/hun/src/vs/workbench/browser/parts/editor/binaryEditor.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "binaryEditor": "Bináris megjelenítő" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/browser/parts/editor/editor.contribution.i18n.json b/i18n/hun/src/vs/workbench/browser/parts/editor/editor.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..186c2e66b64ba0872d2b741d2bd6a683b5ce49a4 --- /dev/null +++ b/i18n/hun/src/vs/workbench/browser/parts/editor/editor.contribution.i18n.json @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "textEditor": "Szövegszerkesztő", + "textDiffEditor": "Szöveges tartalmak differenciaszerkesztő ablaka", + "binaryDiffEditor": "Bináris tartalmak differenciaszerkesztő ablaka", + "sideBySideEditor": "Párhuzamos szerkesztőablakok", + "groupOnePicker": "Az első csoportban található szerkesztőablakok megjelenítése", + "groupTwoPicker": "A második csoportban található szerkesztőablakok megjelenítése", + "groupThreePicker": "A harmadik csoportban található szerkesztőablakok megjelenítése", + "allEditorsPicker": "Összes megnyitott szerkesztőablak megjelenítése", + "view": "Nézet" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/browser/parts/editor/editorActions.i18n.json b/i18n/hun/src/vs/workbench/browser/parts/editor/editorActions.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..e2495b74e21de1f83def2e153d599ed7fe5efde7 --- /dev/null +++ b/i18n/hun/src/vs/workbench/browser/parts/editor/editorActions.i18n.json @@ -0,0 +1,56 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "splitEditor": "Szerkesztő kettéosztása", + "joinTwoGroups": "Két szerkesztőcsoport összevonása", + "navigateEditorGroups": "Váltás szerkesztőcsoportok között", + "focusActiveEditorGroup": "Váltás az aktív szerkesztőcsoportra", + "focusFirstEditorGroup": "Váltás az első szerkesztőcsoportra", + "focusSecondEditorGroup": "Váltás a második szerkesztőcsoportra", + "focusThirdEditorGroup": "Váltás a harmadik szerkesztőcsoportra", + "focusPreviousGroup": "Váltás az előző csoportra", + "focusNextGroup": "Váltás a következő csoportra", + "openToSide": "Megnyitás oldalt", + "closeEditor": "Szerkesztőablak bezárása", + "revertAndCloseActiveEditor": "Visszaállítás és szerkesztőablak bezárása", + "closeEditorsToTheLeft": "Balra lévő szerkesztőablakok bezárása", + "closeEditorsToTheRight": "Jobbra lévő szerkesztőablakok bezárása", + "closeAllEditors": "Összes szerkesztőablak bezárása", + "closeUnmodifiedEditors": "Nem módosult szerkesztőablakok bezárása a csoportban", + "closeEditorsInOtherGroups": "A többi csoport szerkesztőablakainak bezárása", + "closeOtherEditorsInGroup": "Többi szerkesztőablak bezárása", + "closeEditorsInGroup": "A csoportban lévő összes szerkesztőablak bezárása", + "moveActiveGroupLeft": "Szerkesztőablak-csoport mozgatása balra", + "moveActiveGroupRight": "Szerkesztőablak-csoport mozgatása jobbra", + "minimizeOtherEditorGroups": "Többi szerkesztőablak-csoport kis méretűvé tétele", + "evenEditorGroups": "Szerkesztőablak-csoportok egyenlő méretűvé tétele", + "maximizeEditor": "Szerkesztőablak-csoport nagy méretűvé tétele és oldalsáv elrejtése", + "keepEditor": "Szerkesztőablak nyitva tartása", + "openNextEditor": "Következő szerkesztőablak megnyitása", + "openPreviousEditor": "Előző szerkesztőablak megnyitása", + "nextEditorInGroup": "A csoport következő szerkesztőablakának megnyitása", + "openPreviousEditorInGroup": "A csoport előző szerkesztőablakának megnyitása", + "navigateNext": "Ugrás előre", + "navigatePrevious": "Ugrás vissza", + "reopenClosedEditor": "Bezárt szerkesztőablak újranyitása", + "clearRecentFiles": "Legutóbbi fájlok listájának törlése", + "showEditorsInFirstGroup": "Az első csoportban található szerkesztőablakok megjelenítése", + "showEditorsInSecondGroup": "A második csoportban található szerkesztőablakok megjelenítése", + "showEditorsInThirdGroup": "A harmadik csoportban található szerkesztőablakok megjelenítése", + "showEditorsInGroup": "A csoportban található szerkesztőablakok megjelenítése", + "showAllEditors": "Összes szerkesztőablak megjelenítése", + "openPreviousRecentlyUsedEditorInGroup": "A csoportban előző legutoljára használt szerksztőablak megnyitása", + "openNextRecentlyUsedEditorInGroup": "A csoportban következő legutoljára használt szerksztőablak megnyitása", + "navigateEditorHistoryByInput": "Előző szerkesztőablak menyitása az előzményekből", + "openNextRecentlyUsedEditor": "A következő legutoljára használt szerksztőablak megnyitása", + "openPreviousRecentlyUsedEditor": "Az előző legutoljára használt szerksztőablak megnyitása", + "clearEditorHistory": "Szerkesztőablak-előzmények törlése", + "focusLastEditorInStack": "Csoport utolsó szerkesztőablakának megnyitása", + "moveEditorLeft": "Szerkesztőablak mozgatása balra", + "moveEditorRight": "Szerkesztőablak mozgatása jobbra", + "moveEditorToPreviousGroup": "Szerkesztőablak mozgatása az előző csoportba", + "moveEditorToNextGroup": "Szerkesztőablak mozgatása a következő csoportba" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/browser/parts/editor/editorCommands.i18n.json b/i18n/hun/src/vs/workbench/browser/parts/editor/editorCommands.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..6e6ffe92dbd1e3cb0e6b702f38d81e08bbbcec25 --- /dev/null +++ b/i18n/hun/src/vs/workbench/browser/parts/editor/editorCommands.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "editorCommand.activeEditorMove.description": "Aktív szerkesztőablak mozgatása fülek vagy csoportok között", + "editorCommand.activeEditorMove.arg.name": "Aktív szerkesztőablak mozgatási argumentum", + "editorCommand.activeEditorMove.arg.description": "Argumentumtulajdonságok:\n\t\t\t\t\t\t* 'to': karakterlánc, a mozgatás célpontja.\n\t\t\t\t\t\t* 'by': karakterlánc, a mozgatás egysége. Fülek (tab) vagy csoportok (group) alapján.\n\t\t\t\t\t\t* 'value': szám, ami meghatározza, hogy hány pozíciót kell mozgatni, vagy egy abszolút pozíciót, ahová mozgatni kell.\n\t\t\t\t\t", + "commandDeprecated": "A(z) **{0}** parancs el lett távolítva. A(z) **{1}** használható helyette", + "openKeybindings": "Billentyűparancsok beállítása" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/browser/parts/editor/editorPart.i18n.json b/i18n/hun/src/vs/workbench/browser/parts/editor/editorPart.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..6936103772894f35c972a0d8426ccc10330f7a20 --- /dev/null +++ b/i18n/hun/src/vs/workbench/browser/parts/editor/editorPart.i18n.json @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "groupOneVertical": "Bal", + "groupTwoVertical": "Középső", + "groupThreeVertical": "Jobb", + "groupOneHorizontal": "Felső", + "groupTwoHorizontal": "Középső", + "groupThreeHorizontal": "Alsó", + "editorOpenError": "Nem sikerült megnyitni a(z) '{0}' fájlt: {1}." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/browser/parts/editor/editorPicker.i18n.json b/i18n/hun/src/vs/workbench/browser/parts/editor/editorPicker.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..51a1f4752547d3bc31cdf6b0a5d6c9a2850d5866 --- /dev/null +++ b/i18n/hun/src/vs/workbench/browser/parts/editor/editorPicker.i18n.json @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "entryAriaLabel": "{0}, szerkesztőcsoport-választó", + "groupLabel": "Csoport: {0}", + "noResultsFoundInGroup": "A csoportban nem található ilyen nyitott szerkesztőablak", + "noOpenedEditors": "A csoportban jelenleg nincs megnyitott szerkesztőablak", + "noResultsFound": "Nem található ilyen nyitott szerkesztőablak", + "noOpenedEditorsAllGroups": "Jelenleg nincs megnyitott szerkesztőablak" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/browser/parts/editor/editorStatus.i18n.json b/i18n/hun/src/vs/workbench/browser/parts/editor/editorStatus.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..cf37b615cda9cac7f2d557a77f9602c1e8816ace --- /dev/null +++ b/i18n/hun/src/vs/workbench/browser/parts/editor/editorStatus.i18n.json @@ -0,0 +1,51 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "singleSelectionRange": "{0}. sor, {1}. oszlop ({2} kijelölve)", + "singleSelection": "{0}. sor, {1}. oszlop", + "multiSelectionRange": "{0} kijelölés ({1} karakter kijelölve)", + "multiSelection": "{0} kijelölés", + "endOfLineLineFeed": "LF", + "endOfLineCarriageReturnLineFeed": "CRLF", + "tabFocusModeEnabled": "Tab fókuszt vált", + "screenReaderDetected": "Képernyőolvasó érzékelve", + "screenReaderDetectedExtra": "Ha nem használ képernyőolvasót, állítsa az `editor.accessibilitySupport` értékét \"off\"-ra.", + "disableTabMode": "Kisegítő mód letiltása", + "gotoLine": "Sor megkeresése", + "indentation": "Indentálás", + "selectEncoding": "Kódolás kiválasztása", + "selectEOL": "Sorvégjel kiválasztása", + "selectLanguageMode": "Nyelvmód kiválasztása", + "fileInfo": "Fájlinformáció", + "spacesSize": "Szóközök: {0}", + "tabSize": "Tabulátorméret: {0}", + "showLanguageExtensions": "'{0}' kiegészítő keresése a piactéren...", + "changeMode": "Nyelvmód váltása", + "noEditor": "Jelenleg nincs aktív szerkesztőablak", + "languageDescription": "({0}) - Beállított nyelv", + "languageDescriptionConfigured": "({0})", + "languagesPicks": "nyelvek (azonosító)", + "configureModeSettings": "'{0}' nyelvi beállítások módosítása...", + "configureAssociationsExt": "'{0}' fájlhozzárendelések módosítása...", + "autoDetect": "Automatikus felderítés", + "pickLanguage": "Nyelvmód kiválasztása", + "currentAssociation": "Jelenlegi társítás", + "pickLanguageToConfigure": "A(z) '{0}' kiterjesztéshez társított nyelvmód kiválasztása", + "changeIndentation": "Indentálás módosítása", + "noWritableCodeEditor": "Az aktív kódszerkesztő-ablak írásvédett módban van.", + "indentView": "nézet váltása", + "indentConvert": "fájl konvertálása", + "pickAction": "Művelet kiválasztása", + "changeEndOfLine": "Sorvégjel módosítása", + "pickEndOfLine": "Sorvégjel kiválasztása", + "changeEncoding": "Fájlkódolás módosítása", + "noFileEditor": "Jelenleg nincs aktív fájl", + "saveWithEncoding": "Mentés adott kódolással", + "reopenWithEncoding": "Újranyitás adott kódolással", + "guessedEncoding": "Kitalálva a tartalomból", + "pickEncodingForReopen": "Válassza ki a kódolást a fájl újranyitásához", + "pickEncodingForSave": "Válassza ki a mentéshez használandó kódolást" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/browser/parts/editor/tabsTitleControl.i18n.json b/i18n/hun/src/vs/workbench/browser/parts/editor/tabsTitleControl.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..716abaa9fd0419950e9e036ea8ebb0b7d2dda197 --- /dev/null +++ b/i18n/hun/src/vs/workbench/browser/parts/editor/tabsTitleControl.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "araLabelTabActions": "Fülműveletek" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/browser/parts/editor/textDiffEditor.i18n.json b/i18n/hun/src/vs/workbench/browser/parts/editor/textDiffEditor.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..0cb7c46cb05e4fabb9aa9c72f0406ad3a9b3f2a6 --- /dev/null +++ b/i18n/hun/src/vs/workbench/browser/parts/editor/textDiffEditor.i18n.json @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "textDiffEditor": "Szöveges tartalmak differenciaszerkesztő ablaka", + "readonlyEditorWithInputAriaLabel": "{0}. Írásvédett szövegösszehasonlító.", + "readonlyEditorAriaLabel": "Írásvédett szövegösszehasonlító.", + "editableEditorWithInputAriaLabel": "{0}. Szövegfájl-összehasonlító.", + "editableEditorAriaLabel": "Szövegfájl-összehasonlító.", + "navigate.next.label": "Következő módosítás", + "navigate.prev.label": "Előző módosítás", + "inlineDiffLabel": "Váltás inline nézetre", + "sideBySideDiffLabel": "Váltás párhuzamos nézetre" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/browser/parts/editor/textEditor.i18n.json b/i18n/hun/src/vs/workbench/browser/parts/editor/textEditor.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..bc6c6d9162f3d390afe4a77e0ad070f491479d81 --- /dev/null +++ b/i18n/hun/src/vs/workbench/browser/parts/editor/textEditor.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "editorLabelWithGroup": "{0}, {1}. csoport" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/browser/parts/editor/textResourceEditor.i18n.json b/i18n/hun/src/vs/workbench/browser/parts/editor/textResourceEditor.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..357b1df914cd4b708f30668dca63ec1aab535200 --- /dev/null +++ b/i18n/hun/src/vs/workbench/browser/parts/editor/textResourceEditor.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "textEditor": "Szövegszerkesztő", + "readonlyEditorWithInputAriaLabel": "{0}. Írásvédett szövegszerkesztő.", + "readonlyEditorAriaLabel": "Írásvédett szövegszerkesztő.", + "untitledFileEditorWithInputAriaLabel": "{0}. Névtelen szövegszerkesztő.", + "untitledFileEditorAriaLabel": "Névtelen szövegszerkesztő." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/browser/parts/editor/titleControl.i18n.json b/i18n/hun/src/vs/workbench/browser/parts/editor/titleControl.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..0ef6405cab271d74fa57e086b7af25565adef1d2 --- /dev/null +++ b/i18n/hun/src/vs/workbench/browser/parts/editor/titleControl.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "close": "Bezárás", + "closeOthers": "Többi bezárása", + "closeRight": "Jobbra lévők bezárása", + "closeAll": "Összes bezárása", + "closeAllUnmodified": "Nem módosultak bezárása", + "keepOpen": "Maradjon nyitva", + "showOpenedEditors": "Megnyitott szerkesztőablak megjelenítése", + "araLabelEditorActions": "Szerkesztőablak-műveletek" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/browser/parts/panel/panelActions.i18n.json b/i18n/hun/src/vs/workbench/browser/parts/panel/panelActions.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..79a37ed7da4fa344a765cee3e284724c4b2536af --- /dev/null +++ b/i18n/hun/src/vs/workbench/browser/parts/panel/panelActions.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "panelActionTooltip": "{0} ({1})", + "closePanel": "Panel bezárása", + "togglePanel": "Panel be- és kikapcsolása", + "focusPanel": "Váltás a panelra", + "toggleMaximizedPanel": "Teljes méretű panel be- és kikapcsolása", + "maximizePanel": "Panel teljes méretűvé tétele", + "minimizePanel": "Panel méretének visszaállítása", + "view": "Nézet" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/browser/parts/panel/panelPart.i18n.json b/i18n/hun/src/vs/workbench/browser/parts/panel/panelPart.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..6bbddde8753175761a443c221de5b4ead254e3bd --- /dev/null +++ b/i18n/hun/src/vs/workbench/browser/parts/panel/panelPart.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "panelSwitcherBarAriaLabel": "Az aktív panel váltása" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/browser/parts/quickopen/quickOpenController.i18n.json b/i18n/hun/src/vs/workbench/browser/parts/quickopen/quickOpenController.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..d1d7a5732f94996b2263c6ae6b2fc4cf509a6bf3 --- /dev/null +++ b/i18n/hun/src/vs/workbench/browser/parts/quickopen/quickOpenController.i18n.json @@ -0,0 +1,17 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "inputModeEntryDescription": "{0} (Nyomjon 'Enter'-t a megerősítéshez vagy 'Escape'-et a megszakításhoz)", + "inputModeEntry": "Nyomjon 'Enter'-t a megerősítéshez vagy 'Escape'-et a megszakításhoz", + "emptyPicks": "Nincs választható elem", + "quickOpenInput": "A végrehajtható műveletek körét a ? karakter beírásával tekintheti meg", + "historyMatches": "legutóbb megnyitott", + "noResultsFound1": "Nincs találat", + "canNotRunPlaceholder": "A jelenlegi kontextusban nem használható a gyorsmegnyitási funkció", + "entryAriaLabel": "{0}, legutóbb megnyitott", + "removeFromEditorHistory": "Eltávolítás az előzményekből", + "pickHistory": "Válassza ki azt a szerkesztőablakot, amit el szeretne távolítani az előzményekből" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/browser/parts/quickopen/quickopen.i18n.json b/i18n/hun/src/vs/workbench/browser/parts/quickopen/quickopen.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..1686ffdab02d63bf8412a0c7d7cdac0267c76fe8 --- /dev/null +++ b/i18n/hun/src/vs/workbench/browser/parts/quickopen/quickopen.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "quickOpen": "File megkeresése...", + "quickNavigateNext": "Ugrás a következőre a fájlok gyors megnyitásánál", + "quickNavigatePrevious": "Ugrás az előzőre a fájlok gyors megnyitásánál", + "quickSelectNext": "Következő kiválasztása a fájlok gyors megnyitásánál", + "quickSelectPrevious": "Előző kiválasztása a fájlok gyors megnyitásánál" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/browser/parts/sidebar/sidebarPart.i18n.json b/i18n/hun/src/vs/workbench/browser/parts/sidebar/sidebarPart.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..f150e0f9ff2098aa89e7a4d3eae136a207457acd --- /dev/null +++ b/i18n/hun/src/vs/workbench/browser/parts/sidebar/sidebarPart.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "focusSideBar": "Váltás az oldalsávra", + "viewCategory": "Nézet" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/browser/parts/statusbar/statusbarPart.i18n.json b/i18n/hun/src/vs/workbench/browser/parts/statusbar/statusbarPart.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..3cc19480b6240cc50ed202b7c7bc4b10076eec65 --- /dev/null +++ b/i18n/hun/src/vs/workbench/browser/parts/statusbar/statusbarPart.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "canNotRun": "A(z) '{0}' parancs jelenleg nem engedélyezett és nem futtatható.", + "manageExtension": "Kiegészítő kezelése" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/browser/parts/titlebar/titlebarPart.i18n.json b/i18n/hun/src/vs/workbench/browser/parts/titlebar/titlebarPart.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..6ed546539cf83653779af2df1324a1ff40ab0c37 --- /dev/null +++ b/i18n/hun/src/vs/workbench/browser/parts/titlebar/titlebarPart.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "patchedWindowTitle": "[Nem támogatott]", + "devExtensionWindowTitlePrefix": "[Kiegészítő fejlesztői példány]" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/browser/quickopen.i18n.json b/i18n/hun/src/vs/workbench/browser/quickopen.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..3f67d6f3e139dc35f4e87707a3c95c71d49787de --- /dev/null +++ b/i18n/hun/src/vs/workbench/browser/quickopen.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "noResultsMatching": "Nincs eredmény", + "noResultsFound2": "Nincs találat", + "entryAriaLabel": "{0}, parancs" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/browser/viewlet.i18n.json b/i18n/hun/src/vs/workbench/browser/viewlet.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..1d02ba8d6eed1bc4cff2310b730092618e7b1a0f --- /dev/null +++ b/i18n/hun/src/vs/workbench/browser/viewlet.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "collapse": "Összes bezárása" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/common/theme.i18n.json b/i18n/hun/src/vs/workbench/common/theme.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..4966ba698450ec5ed7c9b455d30524510bdb1aeb --- /dev/null +++ b/i18n/hun/src/vs/workbench/common/theme.i18n.json @@ -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. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "tabActiveBackground": "Az aktív fül háttérszíne. A fülek tartalmazzák a szerkesztőablakoket a szerkesztőterületen. Egy szerkesztőablak-csoportban több fül is megnyitható. Több szerkesztőablak-csoportot is létre lehet hozni.", + "tabInactiveBackground": "Az inaktív fülek háttérszíne. A fülek tartalmazzák a szerkesztőablakoket a szerkesztőterületen. Egy szerkesztőablak-csoportban több fül is megnyitható. Több szerkesztőablak-csoportot is létre lehet hozni.", + "tabBorder": "A füleket egymástól elválasztó keret színe. A fülek tartalmazzák a szerkesztőablakoket a szerkesztőterületen. Egy szerkesztőablak-csoportban több fül is megnyitható. Több szerkesztőablak-csoportot is létre lehet hozni.", + "tabActiveForeground": "Az aktív fül előtérszíne az aktív csoportban. A fülek tartalmazzák a szerkesztőablakoket a szerkesztőterületen. Egy szerkesztőablak-csoportban több fül is megnyitható. Több szerkesztőablak-csoportot is létre lehet hozni.", + "tabInactiveForeground": "Az inaktív fülek előtérszíne az aktív csoportban. A fülek tartalmazzák a szerkesztőablakoket a szerkesztőterületen. Egy szerkesztőablak-csoportban több fül is megnyitható. Több szerkesztőablak-csoportot is létre lehet hozni.", + "tabUnfocusedActiveForeground": "Az aktív fül előtérszíne az inaktív csoportokban. A fülek tartalmazzák a szerkesztőablakoket a szerkesztőterületen. Egy szerkesztőablak-csoportban több fül is megnyitható. Több szerkesztőablak-csoportot is létre lehet hozni.", + "tabUnfocusedInactiveForeground": "Az inaktív fülek előtérszíne inaktív csoportokban. A fülek tartalmazzák a szerkesztőablakoket a szerkesztőterületen. Egy szerkesztőablak-csoportban több fül is megnyitható. Több szerkesztőablak-csoportot is létre lehet hozni.", + "editorGroupBackground": "A szerkesztőcsoportok háttérszíne. A szerkesztőcsoportok szerkesztőablakokat tartalmaznak. A háttérszín akkor jelenik meg, ha a szerkesztőcsoportok mozgatva vannak.", + "tabsContainerBackground": "A szerkesztőcsoport címsorának háttérszíne, ha a fülek engedélyezve vannak. A szerkesztőcsoportok szerkesztőablakokat tartalmaznak.", + "tabsContainerBorder": "A szerkesztőcsoport címsorának keretszíne, ha a fülek engedélyezve vannak. A szerkesztőcsoportok szerkesztőablakokat tartalmaznak.", + "editorGroupHeaderBackground": "A szerkesztőcsoport címsorának keretszíne, ha a fülek le vannak tiltva. A szerkesztőcsoportok szerkesztőablakokat tartalmaznak.", + "editorGroupBorder": "A szerkesztőcsoportokat elválasztó vonal színe. A szerkesztőcsoportok szerkesztőablakokat tartalmaznak.", + "editorDragAndDropBackground": "A szerkesztőablakok mozgatásánál használt háttérszín. Érdemes átlátszó színt választani, hogy a szerkesztőablak tartalma továbbra is látszódjon.", + "panelBackground": "A panelek háttérszíne. A panelek a szerkesztőterület alatt jelennek meg, és pl. itt található a kimenetet és az integrált terminál.", + "panelBorder": "A panelek keretszíne, ami elválasztja őket a szerkesztőablakoktól. A panelek a szerkesztőterület alatt jelennek meg, és pl. itt található a kimenetet és az integrált terminál.", + "panelActiveTitleForeground": "Az aktív panel címsorának színe. A panelek a szerkesztőterület alatt jelennek meg, és pl. itt található a kimenetet és az integrált terminál.", + "panelInactiveTitleForeground": "Az inaktív panelek címsorának színe. A panelek a szerkesztőterület alatt jelennek meg, és pl. itt található a kimenetet és az integrált terminál.", + "panelActiveTitleBorder": "Az aktív panel címsorának keretszíne. A panelek a szerkesztőterület alatt jelennek meg, és pl. itt található a kimenetet és az integrált terminál.", + "statusBarForeground": "Az állapotsor előtérszíne. Az állapotsor az ablak alján jelenik meg.", + "statusBarBackground": "Az állapotsor alapértelmezett háttérszíne. Az állapotsor az ablak alján jelenik meg.", + "statusBarBorder": "Az állapotsort az oldalsávtól és a szerkesztőablakoktól elválasztó keret színe. Az állapotsor az ablak alján jelenik meg.", + "statusBarNoFolderBackground": "Az állapotsor háttérszíne, ha nincs mappa megnyitva. Az állapotsor az ablak alján jelenik meg.", + "statusBarNoFolderForeground": "Az állapotsor előtérszíne, ha nincs mappa megnyitva. Az állapotsor az ablak alján jelenik meg.", + "statusBarItemActiveBackground": "Az állapotsor elemének háttérszíne kattintás esetén. Az állapotsor az ablak alján jelenik meg.", + "statusBarItemHoverBackground": "Az állapotsor elemének háttérszíne, ha az egérkurzor fölötte van. Az állapotsor az ablak alján jelenik meg.", + "statusBarProminentItemBackground": "Az állapotsor kiemelt elemeinek háttérszíne. A kiemelt elemek kitűnnek az állapotsor többi eleme közül, így jelezve a fontosságukat. Az állapotsor az ablak alján jelenik meg.", + "statusBarProminentItemHoverBackground": "Az állapotsor kiemelt elemeinek háttérszíne, ha az egérkurzor fölöttük van. A kiemelt elemek kitűnnek az állapotsor többi eleme közül, így jelezve a fontosságukat. Az állapotsor az ablak alján jelenik meg.", + "activityBarBackground": "A tevékenységsáv háttérszíne. A tevékenységsáv az ablak legszélén jelenik meg bal vagy jobb oldalon, segítségével lehet váltani az oldalsáv nézetei között.", + "activityBarForeground": "A tevékenységsáv előtérszíne (pl. az ikonok színe). A tevékenységsáv az ablak legszélén jelenik meg bal vagy jobb oldalon, segítségével lehet váltani az oldalsáv nézetei között.", + "activityBarBorder": "A tevékenyésgsáv keretszíne, ami elválasztja az oldalsávtól. A tevékenységsáv az ablak legszélén jelenik meg bal vagy jobb oldalon, segítségével lehet váltani az oldalsáv nézetei között.", + "activityBarDragAndDropBackground": "A tevékenységsáv elemeinek mozgatásánál használt visszajelzési szín. Érdemes átlátszó színt választani, hogy a tevékenységsáv elemei láthatóak maradjanak. A tevékenységsáv az ablak legszélén jelenik meg bal vagy jobb oldalon, segítségével lehet váltani az oldalsáv nézetei között.", + "activityBarBadgeBackground": "A tevékenységsáv értesítési jelvényeinek háttérszíne. A tevékenységsáv az ablak legszélén jelenik meg bal vagy jobb oldalon, segítségével lehet váltani az oldalsáv nézetei között.", + "activityBarBadgeForeground": "A tevékenységsáv értesítési jelvényeinek előtérszíne. A tevékenységsáv az ablak legszélén jelenik meg bal vagy jobb oldalon, segítségével lehet váltani az oldalsáv nézetei között.", + "sideBarBackground": "Az oldalsáv háttérszíne. Az oldalsávon található például a fájlkezelő és a keresés nézet.", + "sideBarForeground": "Az oldalsáv előtérszíne. Az oldalsávon található például a fájlkezelő és a keresés nézet.", + "sideBarBorder": "Az oldalsáv keretszíne, ami elválasztja a szerkesztőablaktól. Az oldalsávon található például a fájlkezelő és a keresés nézet.", + "sideBarTitleForeground": "Az oldalsáv címsorának előtérszíne. Az oldalsávon található például a fájlkezelő és a keresés nézet.", + "sideBarSectionHeaderBackground": "Az oldalsáv szakaszfejlécének háttérszíne. Az oldalsávon található például a fájlkezelő és a keresés nézet.", + "sideBarSectionHeaderForeground": "Az oldalsáv szakaszfejlécének előtérszíne. Az oldalsávon található például a fájlkezelő és a keresés nézet.", + "titleBarActiveForeground": "A címsor előtérszíne, ha az ablak aktív. Megjegyzés: ez a beállítás jelenleg csak macOS-en támogatott.", + "titleBarInactiveForeground": "A címsor előtérszíne, ha az ablak inaktív. Megjegyzés: ez a beállítás jelenleg csak macOS-en támogatott.", + "titleBarActiveBackground": "A címsor háttérszíne, ha az ablak aktív. Megjegyzés: ez a beállítás jelenleg csak macOS-en támogatott.", + "titleBarInactiveBackground": "A címsor háttérszíne, ha az ablak inaktív. Megjegyzés: ez a beállítás jelenleg csak macOS-en támogatott.", + "notificationsForeground": "Az értesítések előtérszíne. Az értesítések az ablak tetején ugranak fel.", + "notificationsBackground": "Az értesítések háttérszíne. Az értesítések az ablak tetején ugranak fel.", + "notificationsButtonBackground": "Az értesítések gombjainak háttérszíne. Az értesítések az ablak tetején ugranak fel.", + "notificationsButtonHoverBackground": "Az értesítések gombjainak háttérszíne, ha az egérkurzor fölöttük van. Az értesítések az ablak tetején ugranak fel.", + "notificationsButtonForeground": "Az értesítések gombjainak előtérszíne. Az értesítések az ablak tetején ugranak fel.", + "notificationsInfoBackground": "Az információs értesítések háttérszíne. Az értesítések az ablak tetején ugranak fel.", + "notificationsInfoForeground": "Az információs értesítések előtérszíne. Az értesítések az ablak tetején ugranak fel.", + "notificationsWarningBackground": "A figyelmeztető értesítések háttérszíne. Az értesítések az ablak tetején ugranak fel.", + "notificationsWarningForeground": "A figyelmeztető értesítések előtérszíne. Az értesítések az ablak tetején ugranak fel.", + "notificationsErrorBackground": "A hibajelző értesítések háttérszíne. Az értesítések az ablak tetején ugranak fel.", + "notificationsErrorForeground": "A hibajelző értesítések előtérszíne. Az értesítések az ablak tetején ugranak fel." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/electron-browser/actions.i18n.json b/i18n/hun/src/vs/workbench/electron-browser/actions.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..623bfad721c6dbfadbdb510832e36d7bf0550c18 --- /dev/null +++ b/i18n/hun/src/vs/workbench/electron-browser/actions.i18n.json @@ -0,0 +1,43 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "closeActiveEditor": "Szerkesztőablak bezárása", + "closeWindow": "Ablak bezárása", + "closeFolder": "Mappa bezárása", + "noFolderOpened": "Ebben a példányban nincs mappa megnyitva, amit be lehetne zárni.", + "newWindow": "Új ablak", + "toggleFullScreen": "Teljes képernyő be- és kikapcsolása", + "toggleMenuBar": "Menüsáv be- és kikapcsolása", + "toggleDevTools": "Fejlesztői eszközök be- és kikapcsolása", + "zoomIn": "Nagyítás", + "zoomOut": "Kicsinyítés", + "zoomReset": "Nagyítási szint alaphelyzetbe állítása", + "appPerf": "Indulási teljesítmény", + "reloadWindow": "Ablak újratöltése", + "switchWindowPlaceHolder": "Válassza ki az ablakot, amire váltani szeretne", + "current": "Aktuális ablak", + "switchWindow": "Ablak váltása...", + "quickSwitchWindow": "Gyors ablakváltás...", + "folders": "mappák", + "files": "fájlok", + "openRecentPlaceHolderMac": "Válasszon egy elérési utat! (A Cmd billentyű lenyomása esetén új ablakban nyílik meg)", + "openRecentPlaceHolder": "Válasszon egy elérési utat! (A Ctrl billentyű lenyomása esetén új ablakban nyílik meg)", + "openRecent": "Legutóbbi megnyitása...", + "quickOpenRecent": "Legutóbbi gyors megnyitása...", + "closeMessages": "Értesítések törlése", + "reportIssues": "Problémák jelentése", + "reportPerformanceIssue": "Teljesítményproblémák jelentése", + "keybindingsReference": "Billentyűparancs-referencia", + "openDocumentationUrl": "Dokumentáció", + "openIntroductoryVideosUrl": "Bemutatóvideók", + "toggleSharedProcess": "Megosztott folyamat be- és klikapcsolása", + "navigateLeft": "Navigálás a balra lévő nézetre", + "navigateRight": "Navigálás a jobbra lévő nézetre", + "navigateUp": "Navigálás a felül lévő nézetre", + "navigateDown": "Navigálás az alul lévő nézetre", + "increaseViewSize": "Jelenlegi nézet méretének növelése", + "decreaseViewSize": "Jelenlegi nézet méretének csökkentése" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/electron-browser/commands.i18n.json b/i18n/hun/src/vs/workbench/electron-browser/commands.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..3a1051dcfdad7ec7db70524f0a31f277885230df --- /dev/null +++ b/i18n/hun/src/vs/workbench/electron-browser/commands.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "diffLeftRightLabel": "{0} ⟷ {1}" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/electron-browser/extensionHost.i18n.json b/i18n/hun/src/vs/workbench/electron-browser/extensionHost.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..41f2c6757d6a86cf648ea75d4a52dc1d277d1fdb --- /dev/null +++ b/i18n/hun/src/vs/workbench/electron-browser/extensionHost.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "extensionHostProcess.startupFailDebug": "A kiegészítő gazdafolyamata nem idult el 10 másodperben belül. Elképzelhető, hogy megállt az első soron, és szüksége van a hibakeresőre a folytatáshoz.", + "extensionHostProcess.startupFail": "A kiegészítő gazdafolyamata nem idult el 10 másodperben belül. Ez probléma lehet.", + "extensionHostProcess.error": "A kiegészítő gazdafolyamatától hiba érkezett: {0}", + "extensionHostProcess.crash": "A kiegészítő gazdafolyamata váratlanul leállt. Töltse újra az ablakot a visszaállításhoz." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/electron-browser/main.contribution.i18n.json b/i18n/hun/src/vs/workbench/electron-browser/main.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..65965e2d964664e6383b1bca12de8527c3ea339e --- /dev/null +++ b/i18n/hun/src/vs/workbench/electron-browser/main.contribution.i18n.json @@ -0,0 +1,69 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "view": "Nézet", + "help": "Súgó", + "file": "Fájl", + "developer": "Fejlesztői", + "showEditorTabs": "Meghatározza, hogy a megnyitott szerkesztőablakok telején megjelenjenek-e a fülek", + "editorTabCloseButton": "Meghatározza a szerkesztőablakok fülein található bezárógomb pozícióját vagy eltávolítja őket, ha a beállítás értéke 'off'.", + "showIcons": "Meghatározza, hogy a megnyitott szerkesztőablakok ikonnal együtt jelenjenek-e meg. A működéshez szükséges egy ikontéma engedélyezése is.", + "enablePreview": "Meghatározza, hogy a megnyitott szerkesztőablakok előnézetként jelenjenek-e meg. Az előnézetként használt szerkesztőablakok újra vannak hasznosítva, amíg meg nem tartja őket a felhasználó (pl. dupla kattintás vagy szerkesztés esetén).", + "enablePreviewFromQuickOpen": "Meghatározza, hogy a gyors megnyitás során megnyitott szerkesztőablakok előnézetként jelenjenek-e meg. Az előnézetként használt szerkesztőablakok újra vannak hasznosítva, amíg meg nem tartja őket a felhasználó (pl. dupla kattintás vagy szerkesztés esetén).", + "editorOpenPositioning": "Meghatározza, hogy hol nyíljanak meg a szerkesztőablakok. A 'left' vagy 'right' használata esetén az aktív szerkesztőablaktól jobbra vagy balra nyílnak meg az újak. A 'first' vagy 'last' esetén a szerkesztőablakok a jelenleg aktív ablaktól függetlenül nyílnak meg.", + "revealIfOpen": "Meghatározza, hogy egy szerkesztőablak fel legyen-e fedve, ha már meg van nyitva a látható csoportok bármelyiképben. Ha le van tiltva, akkor egy új szerkesztőablak nyílik az aktív szerkesztőablak-csoportban. Ha engedélyezve van, akkor a már megnyitott szerkesztőablak lesz felfedve egy új megnyitása helyett. Megjegyzés: vannak esetek, amikor ez a beállítás figyelmen kívül van hagyva, pl. ha egy adott szerkesztőablak egy konkrét csoportban vagy a jelenleg aktív csoport mellett van menyitva.", + "commandHistory": "Meghatározza, hogy mennyi legutóbb használt parancs jelenjen meg a parancskatalógus előzményeinek listájában. Az előzmények kikapcsolásához állítsa az értéket 0-ra.", + "preserveInput": "Meghatározza, hogy a legutóbb beírt parancs automatikusan helyre legyen-e állítva a parancskatalógus következő megnyitása során.", + "closeOnFocusLost": "Meghatározza, hogy a gyors megnyitás automatikusan bezáródjon-e amint elveszíti a fókuszt.", + "openDefaultSettings": "Meghatározza, hogy a beállítások megnyitásakor megnyíljon-e egy szerkesztő az összes alapértelmezett beállítással.", + "sideBarLocation": "Meghatározza az oldalsáv helyét. Az oldalsáv megjelenhet a munkaterület bal vagy jobb oldalán.", + "statusBarVisibility": "Meghatározza, hogy megjelenjen-e az állapotsor a munkaterület alján.", + "activityBarVisibility": "Meghatározza, hogy megjelenjen-e a tevékenységsáv a munkaterületen.", + "closeOnFileDelete": "Meghatározza, hogy bezáródjanak-e azok a szerkesztőablakok, melyekben olyan fájl van megnyitva, amelyet töröl vagy átnevez egy másik folyamat. A beállítás letiltása esetén a szerkesztőablak nyitva marad módosított állapotban ilyen esemény után. Megjegyzés: az alkalmazáson belüli törlések esetén mindig bezáródik a szerkesztőablakok, a módosított fájlok pedig soha nem záródnak be, hogy az adatok megmaradjanak.", + "swipeToNavigate": "Navigálás a nyitott fájlok között háromujjas, vízszintes húzással.", + "workbenchConfigurationTitle": "Munkaterület", + "window.openFilesInNewWindow.on": "A fájlok új ablakban nyílnak meg", + "window.openFilesInNewWindow.off": "A fájlok abban az ablakban nyílnak meg, ahol a mappájuk meg van nyitva vagy a legutoljára aktív ablakban", + "window.openFilesInNewWindow.default": "A fájlok abban az ablakban nyílnak meg, ahol a mappájuk meg van nyitva vagy a legutoljára aktív ablakban, kivéve, ha a dokkról vagy a Finderből lettek megnyitva (csak macOS-en)", + "openFilesInNewWindow": "Meghatározza, hogy a fájlok új ablakban legyenek-e megnyitva.\n- default: A fájlok abban az ablakban nyílnak meg, ahol a mappájuk meg van nyitva vagy a legutoljára aktív ablakban, kivéve, ha a dokkról vagy a Finderből lettek megnyitva (csak macOS-en)\n- on: A fájlok új ablakban nyílnak meg.\n- off: A fájlok abban az ablakban nyílnak meg, ahol a mappájuk meg van nyitva vagy a legutoljára aktív ablakban\nMegjegyzés: vannak esetek, amikor ez a beállítás figyelmen kívül van hagyva (pl. a -new-window vagy a -reuse-window parancssori beállítás használata esetén).", + "window.openFoldersInNewWindow.on": "A mappák új ablakban nyílnak meg", + "window.openFoldersInNewWindow.off": "A mappák lecserélik a legutoljára aktív ablakot", + "window.openFoldersInNewWindow.default": "A mappák új ablakban nyílnak meg, kivéve akkor, ha a mappát az alkalmazáson belül lett kiválasztva (pl. a Fájl menüből)", + "openFoldersInNewWindow": "Meghatározza, hogy a mappák új ablakban legyenek-e megnyitva.\n- alapértelmezett: A mappák új ablakban nyílnak meg, kivéve akkor, ha a mappát az alkalmazáson belül lett kiválasztva (pl. a Fájl menüből)\n- on: A mappák új ablakban nyílnak meg\n- off: A mappák lecserélik a legutoljára aktív ablakot\nMegjegyzés: vannak esetek, amikor ez a beállítás figyelmen kívül van hagyva (pl. a -new-window vagy a -reuse-window parancssori beállítás használata esetén).", + "window.reopenFolders.all": "Összes ablak újranyitása.", + "window.reopenFolders.folders": "Összes mappa újranyitása. Az üres ablakok nem lesznek helyreállítva.", + "window.reopenFolders.one": "A legutóbbi aktív ablak újranyitása.", + "window.reopenFolders.none": "Soha ne nyisson meg újra ablakot. Mindig üresen induljon.", + "restoreWindows": "Meghatározza, hogy újraindítás után hogyan vannak ismét megnyitva az ablakok. A 'none' választása esetén mindig üres ablak indul, 'one' esetén a legutóbb használt ablak nyílik meg újra, a 'folders' megnyitja az összes megnyitott mappát, míg az 'all' újranyitja az összes ablakot az előző munkamenetből.", + "restoreFullscreen": "Meghatározza, hogy az ablak teljesképernyős módban nyíljon-e meg, ha kilépéskor teljes képernyős módban volt.", + "zoomLevel": "Meghatározza az ablak nagyítási szintjét. Az eredei méret 0, és minden egyes plusz (pl. 1) vagy mínusz (pl. -1) 20%-kal nagyobb vagy kisebb nagyítási szintet jelent. Tizedestört megadása esetén a nagyítási szint finomabban állítható.", + "title": "Meghatározza az ablak címét az aktív szerkesztőablak alapján. A változók a környezet alapján vannak behelyettesítve:\n${activeEditorShort}: pl. myFile.txt\n${activeEditorMedium}: pl. myFolder/myFile.txt\n${activeEditorLong}: pl. /Users/Development/myProject/myFolder/myFile.txt\n${rootName}: pl. myProject\n${rootPath}: pl. /Users/Development/myProject\n${appName}: pl. VS Code\n${dirty}: módosításjelző, ami jelzi, ha az aktív szerkesztőablak tartalma módosítva lett\n${separator}: feltételes elválasztó (\" - \"), ami akkor jelenik meg, ha olyan változókkal van körülvéve, amelyeknek van értéke\n", + "window.newWindowDimensions.default": "Az új ablakok a képernyő közepén nyílnak meg.", + "window.newWindowDimensions.inherit": "Az új ablakok ugyanolyan méretben és ugyanazon a helyen jelennek meg, mint a legutoljára aktív ablak.", + "window.newWindowDimensions.maximized": "Az új ablakok teljes méretben nyílnak meg.", + "window.newWindowDimensions.fullscreen": "Az új ablakok teljes képernyős módban nyílnak meg.", + "newWindowDimensions": "Meghatározza az új ablakok méretét és pozícióját, ha már legalább egy ablak meg van nyitva. Az új ablakok alapértlmezetten a képernyő közepén, kis mérettel nyílnak meg. Ha az értéke 'inherit', az ablak ugyanazon méretben és pozícióban nyílik meg, mint a legutoljára aktív. Ha az értéke 'maximized', teljes méretben, ha pedig 'fullscreen' akkor teljes képernyős módban nyílik meg. Megjegyzés: a beállítás nincs hatással az első megnyitott ablakra. Az első ablak mindig a bezárás előtti mérettel és pozícióban nyílik meg.", + "window.menuBarVisibility.default": "A menü csak teljes képernyős mód esetén van elrejtve.", + "window.menuBarVisibility.visible": "A menü mindig látható, még teljes képernyő módban is.", + "window.menuBarVisibility.toggle": "A menü rejtett, de megjeleníthető az Alt billentyű lenyomásával.", + "window.menuBarVisibility.hidden": "A menü mindig el van rejtve.", + "menuBarVisibility": "Meghatározza a menüsáv láthatóságát. A 'toggle' érték azt jelenti, hogy a menüsáv rejtett, és az Alt billentyű lenyomására megjelenik. A menüsáv alapértelmezetten látható, kivéve, ha az ablak teljes képernyős módban van.", + "enableMenuBarMnemonics": "Ha engedélyezve van, a főmenük megnyithatók Alt-billentyűs billentyűparancsokkal. Letiltás esetén ezek az Alt-billentyűparancsok más parancsokhoz rendelhetők.", + "autoDetectHighContrast": "Ha engedélyezve van, az alkalmazás automatikusan átvált a nagy kontrasztos témára, ha a WIndows a nagy kontrasztos témát használ, és a sötét témára, ha a Windows átvált a nagy kontrasztos témáról.", + "titleBarStyle": "Módosítja az ablak címsorának megjelenését. A változtatás teljes újraindítást igényel.", + "window.nativeTabs": "Engedélyezi a macOS Sierra ablakfüleket. Megjegyzés: a változtatás teljes újraindítást igényel, és a natív fülek letiltják az egyedi címsorstílust, ha azok be vannak konfigurálva.", + "windowConfigurationTitle": "Ablak", + "zenModeConfigurationTitle": "Zen-mód", + "zenMode.fullScreen": "Meghatározza, hogy zen-módban a munakterület teljes képernyős módba vált-e.", + "zenMode.hideTabs": "Meghatározza, hogy zen-módban el vannak-e rejtve a munkaterület fülei.", + "zenMode.hideStatusBar": "Meghatározza, hogy zen-módban el van-e rejtve a munkaterület alján található állapotsor.", + "zenMode.hideActivityBar": "Meghatározza, hogy zen-módban el van-e rejtve a munkaterület bal oldalán található tevékenységsáv.", + "zenMode.restore": "Meghatározza, hogy az ablak zen-módban induljon-e, ha kilépéskor zen-módban volt.", + "workspaceConfigurationTitle": "Munkaterület", + "workspaces.title": "A munkaterület mappakonfiugrációja", + "files.exclude.boolean": "A globális minta, amire illesztve lesznek a fájlok elérési útjai. A minta engedélyezéséhez vagy letiltásához állítsa igaz vagy hamis értékre.", + "workspaces.additionalFolders": "A munkaterület mappái" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/electron-browser/main.i18n.json b/i18n/hun/src/vs/workbench/electron-browser/main.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..35ad4a784e889a69a09ff2414cb55d3965302cff --- /dev/null +++ b/i18n/hun/src/vs/workbench/electron-browser/main.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "loaderError": "Az egyik szükséges fájlt nem sikerült betölteni. Vagy megszakadt az internetkapcsolat, vagy a kiszolgáló vált offline-ná. Frissítse az oldalt a böngészőben, és próbálkozzon újra.", + "loaderErrorNative": "Egy szükséges fájl betöltése nem sikerült. Indítsa újra az alkalmazást, és próbálkozzon újra. Részletek: {0}" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/electron-browser/shell.i18n.json b/i18n/hun/src/vs/workbench/electron-browser/shell.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..f9fefa3fe2d6e14beace3b9edec491f93993ed45 --- /dev/null +++ b/i18n/hun/src/vs/workbench/electron-browser/shell.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "runningAsRoot": "Nem ajánlott a Code-ot 'root'-ként futtatni." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/electron-browser/window.i18n.json b/i18n/hun/src/vs/workbench/electron-browser/window.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..13f0befdb66be49725f39bbd24e15c98acc0b076 --- /dev/null +++ b/i18n/hun/src/vs/workbench/electron-browser/window.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "undo": "Visszavonás", + "redo": "Újra", + "cut": "Kivágás", + "copy": "Másolás", + "paste": "Beillesztés", + "selectAll": "Összes kijelölése", + "confirmOpen": "Biztosan meg akar nyitni {0} mappát?", + "confirmOpenButton": "&&Megnyitás" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/electron-browser/workbench.i18n.json b/i18n/hun/src/vs/workbench/electron-browser/workbench.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..e230783deddd83dc37a79829b6dd3d8787fb0d48 --- /dev/null +++ b/i18n/hun/src/vs/workbench/electron-browser/workbench.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "developer": "Fejlesztői", + "file": "Fájl" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/node/extensionHostMain.i18n.json b/i18n/hun/src/vs/workbench/node/extensionHostMain.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..acba56dc6e902817514204162d76b46b05efa75b --- /dev/null +++ b/i18n/hun/src/vs/workbench/node/extensionHostMain.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "extensionTestError": "Az {0} elérési út nem érvényes kiegészítő tesztfuttató alkalmazásra mutat." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/node/extensionPoints.i18n.json b/i18n/hun/src/vs/workbench/node/extensionPoints.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..e9cae50ed459f81e007d9d6eb4171974196972a2 --- /dev/null +++ b/i18n/hun/src/vs/workbench/node/extensionPoints.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "jsonParseFail": "Hiba a(z) {0} feldolgozása közben: {1}.", + "fileReadFail": "A(z) ({0}) fájl nem olvasható: {1}.", + "jsonsParseFail": "Hiba a(z) {0} vagy {1} feldolgozása közben: {2}.", + "missingNLSKey": "A(z) {0} kulcshoz tartozó üzenet nem található." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/cli/electron-browser/cli.contribution.i18n.json b/i18n/hun/src/vs/workbench/parts/cli/electron-browser/cli.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..371e0ad88d7c659a65dcfc2877878d97e5631f65 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/cli/electron-browser/cli.contribution.i18n.json @@ -0,0 +1,18 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "install": "'{0}' parancs telepítése a PATH-ba", + "not available": "Ez a parancs nem érhető el.", + "successIn": "A(z) '{0}' rendszerparancs sikeresen telepítve lett a PATH-ba.", + "warnEscalation": "A Code adminisztrátori jogosultságot fog kérni az 'osascript'-tel a rendszerparancs telepítéséhez.", + "ok": "OK", + "cantCreateBinFolder": "Nem sikerült létrehozni az '/usr/local/bin' könyvtárat.", + "cancel2": "Mégse", + "aborted": "Megszakítva", + "uninstall": "'{0}' parancs eltávolítása a PATH-ból", + "successFrom": "A(z) '{0}' rendszerparancs sikeresen el lett a PATH-ból.", + "shellCommand": "Rendszerparancs" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/codeEditor/electron-browser/accessibility.i18n.json b/i18n/hun/src/vs/workbench/parts/codeEditor/electron-browser/accessibility.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..0edff5007dec953a3a93de7453ff348fffa1c64f --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/codeEditor/electron-browser/accessibility.i18n.json @@ -0,0 +1,26 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "emergencyConfOn": "Az `editor.accessibilitySupport` beállítás értékének beállítása a következőre: 'on'.", + "openingDocs": "A VS Code kisegítő lehetőségei dokumentációjának megnyitása.", + "introMsg": "Köszönjük, hogy kipróbálta a VS Code kisegítő lehetőségeit.", + "status": "Állapot:", + "changeConfigToOnMac": "A szerkesztő folyamatos képernyőolvasóval való használatára optimalizálásához nyomja meg a Command+E gombot!", + "changeConfigToOnWinLinux": "A szerkesztő folyamatos képernyőolvasóval való használatára optimalizálásához nyomja meg a Control+E gombot!", + "auto_unknown": "A szerkesztő úgy van konfigurálva, hogy a platform által biztosított API-kat használja annak megállapításához, hogy van-e képernyőolvasó csatlakoztatva, azonban a jelenlegi futtatókörnyezet ezt nem támogatja.", + "auto_on": "A szerkesztő automatikusan észlelte a csatlakoztatott képernyőolvasót.", + "auto_off": "A szerkesztő úgy van konfigurálva, hogy automatikusan érzékelkje, ha képernyőolvasó van csatlakoztatva. Jelenleg nincs csatlakoztatva.", + "configuredOn": "A szerkesztő folyamatos képernyőolvasóval való használatára van optimalizálva – ez az `editor.accessibilitySupport` beállítás módosításával változtatható.", + "configuredOff": "A szerkesztő úgy van konfigurálva, hogy soha nincs képernyőolvasó használatára optimalizálva.", + "tabFocusModeOnMsg": "Az aktuális szerkesztőablakban a Tab billentyű lenyomása esetén a fókusz a következő fókuszálható elemre kerül. Ez a viselkedés a(z) {0} leütésével módosítható.", + "tabFocusModeOnMsgNoKb": "Az aktuális szerkesztőablakban a Tab billentyű lenyomása esetén a fókusz a következő fókuszálható elemre kerül. A(z) {0} parancs jelenleg nem aktiválható billentyűkombinációval.", + "tabFocusModeOffMsg": "Az aktuális szerkesztőablakban a Tab billentyű lenyomása esetén beszúrásra kerül egy tabulátor karakter. Ez a viselkedés a(z) {0} leütésével módosítható.", + "tabFocusModeOffMsgNoKb": "Az aktuális szerkesztőablakban a Tab billentyű lenyomása esetén beszúrásra kerül egy tabulátor karakter. A(z) {0} parancs jelenleg nem aktiválható billentyűkombinációval.", + "openDocMac": "VS Code kisegítő lehetőségeivel kapcsolatos információk böngészőben való megjelenítéséhez nyomja meg a Command+H billentyűkombinációt!", + "openDocWinLinux": "VS Code kisegítő lehetőségeivel kapcsolatos információk böngészőben való megjelenítéséhez nyomja meg a Control+H billentyűkombinációt!", + "outroMsg": "A súgószöveg eltüntetéséhez és a szerkesztőablakba való visszatéréshez nyomja meg az Escape billentyűt vagy a Shift+Escape billentyűkombinációt!", + "ShowAccessibilityHelpAction": "Kisegítő lehetőségek súgó megjelenítése" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/codeEditor/electron-browser/inspectKeybindings.i18n.json b/i18n/hun/src/vs/workbench/parts/codeEditor/electron-browser/inspectKeybindings.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..b01c9a81930b85a9c7a8c1c182cb6dc658730b74 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/codeEditor/electron-browser/inspectKeybindings.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "workbench.action.inspectKeyMap": "Fejlesztői: Billentyűkiosztás vizsgálata" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/codeEditor/electron-browser/inspectTMScopes.i18n.json b/i18n/hun/src/vs/workbench/parts/codeEditor/electron-browser/inspectTMScopes.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/codeEditor/electron-browser/inspectTMScopes.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/codeEditor/electron-browser/toggleMultiCursorModifier.i18n.json b/i18n/hun/src/vs/workbench/parts/codeEditor/electron-browser/toggleMultiCursorModifier.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..a0a8e4d89284749edb766f0a62d69675aa48b1ce --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/codeEditor/electron-browser/toggleMultiCursorModifier.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "toggleLocation": "Többkurzoros módosító be- és kikapcsolása" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/codeEditor/electron-browser/toggleRenderControlCharacter.i18n.json b/i18n/hun/src/vs/workbench/parts/codeEditor/electron-browser/toggleRenderControlCharacter.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..79c5e7716eee6a74be07454f0ede463934a9d1da --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/codeEditor/electron-browser/toggleRenderControlCharacter.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "toggleRenderControlCharacters": "Vezérlőkarakterek be- és kikapcsolása" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/codeEditor/electron-browser/toggleRenderWhitespace.i18n.json b/i18n/hun/src/vs/workbench/parts/codeEditor/electron-browser/toggleRenderWhitespace.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..e496d62b10240839adf4ab79ee3fd2010648044f --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/codeEditor/electron-browser/toggleRenderWhitespace.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "toggleRenderWhitespace": "Szóközök kirajzolásának be- és kikapcsolása" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/codeEditor/electron-browser/toggleWordWrap.i18n.json b/i18n/hun/src/vs/workbench/parts/codeEditor/electron-browser/toggleWordWrap.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..02a67dbe14632a81b094a79b95bf9d3ab413c4fa --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/codeEditor/electron-browser/toggleWordWrap.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "toggle.wordwrap": "Nézet: Sortörés be- és kikapcsolása", + "wordWrap.notInDiffEditor": "A sortörés nem kapcsolható be vagy ki differenciaszerkesztőben.", + "unwrapMinified": "Sortörés letiltása ebben a fájlban", + "wrapMinified": "Sortörés engedélyezése ebben a fájlban" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/codeEditor/electron-browser/wordWrapMigration.i18n.json b/i18n/hun/src/vs/workbench/parts/codeEditor/electron-browser/wordWrapMigration.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..1631851aee5fc1d1a3752c92515e59275b59bacf --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/codeEditor/electron-browser/wordWrapMigration.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "wordWrapMigration.ok": "OK", + "wordWrapMigration.dontShowAgain": "Ne jelenjen meg újra", + "wordWrapMigration.openSettings": "Beállítások megnyitása", + "wordWrapMigration.prompt": "Az `editor.wrappingColumn` beállítás elavult az `editor.wordWrap` bevezetése miatt." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/debug/browser/breakpointWidget.i18n.json b/i18n/hun/src/vs/workbench/parts/debug/browser/breakpointWidget.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..9a0eccdde5015348ebc8f3cf48630e2a274d8c2b --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/debug/browser/breakpointWidget.i18n.json @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "breakpointWidgetExpressionPlaceholder": "Futás megállítása, ha a kifejezés értéke igazra értékelődik ki. 'Enter' a megerősítéshez vagy 'Escape' a megszakításhoz.", + "breakpointWidgetAriaLabel": "A program csak akkor áll meg itt, ha a feltétel igaz. Nyomjon 'Enter'-t a megerősítéshez vagy 'Escape'-et a megszakításhoz.", + "breakpointWidgetHitCountPlaceholder": "Futás megállítása, ha adott alkalommal érintve lett. 'Enter' a megerősítéshez vagy 'Escape' a megszakításhoz.", + "breakpointWidgetHitCountAriaLabel": "A program akkor fog megállni itt, ha adott alkalommal érintette ezt a pontot. Nyomjon 'Enter'-t a megerősítéshez vagy 'Escape'-et a megszakításhoz.", + "expression": "Kifejezés", + "hitCount": "Érintések száma" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/debug/browser/debugActionItems.i18n.json b/i18n/hun/src/vs/workbench/parts/debug/browser/debugActionItems.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..c7cfbc8b3baa9090e8bd9100ce1b824a30d327cc --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/debug/browser/debugActionItems.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "addConfiguration": "Konfiguráció hozzáadása...", + "noConfigurations": "Nincs konfiguráció" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/debug/browser/debugActions.i18n.json b/i18n/hun/src/vs/workbench/parts/debug/browser/debugActions.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..e98acd71fa1570b01905b422b57059a3c1607b9f --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/debug/browser/debugActions.i18n.json @@ -0,0 +1,49 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "openLaunchJson": "{0} megnyitása", + "launchJsonNeedsConfigurtion": "'launch.json' konfigurálása vagy javítása", + "noFolderDebugConfig": "Fejlettebb hibakeresési konfigurációk használatához nyisson meg egy mappát!", + "startDebug": "Hibakeresés indítása", + "startWithoutDebugging": "Indítás hibakeresés nélkül", + "selectAndStartDebugging": "Hibakeresés kiválasztása és indítása", + "restartDebug": "Újraindítás", + "reconnectDebug": "Újracsatlakozás", + "stepOverDebug": "Átugrás", + "stepIntoDebug": "Belépés", + "stepOutDebug": "Kilépés", + "stopDebug": "Leállítás", + "disconnectDebug": "Kapcsolat bontása", + "continueDebug": "Folytatás", + "pauseDebug": "Szüneteltetés", + "restartFrame": "Keret újraindítása", + "removeBreakpoint": "Töréspont eltávolítása", + "removeAllBreakpoints": "Összes töréspont eltávolítása", + "enableBreakpoint": "Töréspont engedélyezése", + "disableBreakpoint": "Töréspont letiltása", + "enableAllBreakpoints": "Összes töréspont engedélyezése", + "disableAllBreakpoints": "Összes töréspont letiltása", + "activateBreakpoints": "Töréspontok aktiválása", + "deactivateBreakpoints": "Töréspontok deaktiválása", + "reapplyAllBreakpoints": "Töréspontok felvétele ismét", + "addFunctionBreakpoint": "Függvénytöréspont hozzáadása", + "renameFunctionBreakpoint": "Függvénytöréspont átnevezése", + "addConditionalBreakpoint": "Feltételes töréspont hozzáadása...", + "editConditionalBreakpoint": "Töréspont szerkesztése...", + "setValue": "Érték beállítása", + "addWatchExpression": "Kifejezés hozzáadása", + "editWatchExpression": "Kifejezés szerkesztése", + "addToWatchExpressions": "Hozzáadás a figyelőlistához", + "removeWatchExpression": "Kifejezés eltávolítása", + "removeAllWatchExpressions": "Összes kifejezés eltávolítása", + "clearRepl": "Konzoltartalom törlése", + "debugConsoleAction": "Hibakeresési konzol", + "unreadOutput": "Új kimenet a hibakeresési konzolban", + "debugFocusConsole": "Váltás a hibakeresési konzolra", + "focusProcess": "Váltás a folyamatra", + "stepBackDebug": "Visszalépés", + "reverseContinue": "Visszafordítás" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/debug/browser/debugActionsWidget.i18n.json b/i18n/hun/src/vs/workbench/parts/debug/browser/debugActionsWidget.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..fa1bc4e164b69e736e9af17c81da7b8222f52b7c --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/debug/browser/debugActionsWidget.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "debugToolBarBackground": "A hibakeresési eszköztár háttérszíne." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/debug/browser/debugContentProvider.i18n.json b/i18n/hun/src/vs/workbench/parts/debug/browser/debugContentProvider.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..b66b9f52e68974625ef94ab366c55bac4193c874 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/debug/browser/debugContentProvider.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "unable": "Az erőforrás nem oldható fel hibakeresési munkamenet nélkül" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/debug/browser/debugEditorActions.i18n.json b/i18n/hun/src/vs/workbench/parts/debug/browser/debugEditorActions.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..7d9b38824da42fd33728812ea6d4035641664031 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/debug/browser/debugEditorActions.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "toggleBreakpointAction": "Hibakeresés: Töréspont be- és kikapcsolása", + "columnBreakpointAction": "Hibakeresés: Töréspont oszlopnál", + "columnBreakpoint": "Oszlop töréspont hozzáadása", + "conditionalBreakpointEditorAction": "Hibakeresés: Feltételes töréspont...", + "runToCursor": "Futtatás a kurzorig", + "debugEvaluate": "Hibakeresés: Kiértékelés", + "debugAddToWatch": "Hibakeresés: Hozzáadás a figyelőlistához", + "showDebugHover": "Hibakeresés: Súgószöveg megjelenítése" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/debug/browser/debugEditorModelManager.i18n.json b/i18n/hun/src/vs/workbench/parts/debug/browser/debugEditorModelManager.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..bbe58d3ce4242e84123246e3c187d5c56159a368 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/debug/browser/debugEditorModelManager.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "breakpointDisabledHover": "Letiltott töréspont", + "breakpointUnverifieddHover": "Nem megerősített töréspont", + "breakpointDirtydHover": "Nem megerősített töréspont. A fájl módosult, indítsa újra a hibakeresési munkamenetet.", + "breakpointUnsupported": "Ez a hibakereső nem támogatja a feltételes töréspontokat" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/debug/browser/debugQuickOpen.i18n.json b/i18n/hun/src/vs/workbench/parts/debug/browser/debugQuickOpen.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..4020242c40ced7373bf1b6599e3e76e918203ca0 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/debug/browser/debugQuickOpen.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "entryAriaLabel": "{0}, hibakeresés", + "debugAriaLabel": "Írja be a futtatandó konfiguráció nevét.", + "noConfigurationsMatching": "Nincs illeszkedő hibakeresési konfiguráció", + "noConfigurationsFound": "Nem található hibakeresési konfiguráció. Készítsen egy 'launch.json' fájlt." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/debug/browser/exceptionWidget.i18n.json b/i18n/hun/src/vs/workbench/parts/debug/browser/exceptionWidget.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..37b31bfd19b4746775c6b24c3a7782b07aca03f0 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/debug/browser/exceptionWidget.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "debugExceptionWidgetBorder": "A kivételmodul keretszíne.", + "debugExceptionWidgetBackground": "A kivételmodul háttérszíne.", + "exceptionThrownWithId": "Kivétel következett be: {0}", + "exceptionThrown": "Kivétel következett be." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/debug/browser/linkDetector.i18n.json b/i18n/hun/src/vs/workbench/parts/debug/browser/linkDetector.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..8e0e584901b1f74c8b1a2fe3bf1d5065f84dee6d --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/debug/browser/linkDetector.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "fileLinkMac": "Megnyitás kattintásra (Cmd + kattintásra oldalt nyitja meg)", + "fileLink": "Megnyitás kattintásra (Ctrl + kattintásra oldalt nyitja meg)" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/debug/common/debug.i18n.json b/i18n/hun/src/vs/workbench/parts/debug/common/debug.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..bceb3f2cf21ab204191df4e9bf0e208352060567 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/debug/common/debug.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "internalConsoleOptions": "Meghatározza a belső hibakeresési konzol viselkedését." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/debug/common/debugModel.i18n.json b/i18n/hun/src/vs/workbench/parts/debug/common/debugModel.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..a3704d30698352551121d9aea3a1372e489c8c30 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/debug/common/debugModel.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "notAvailable": "nem elérhető", + "startDebugFirst": "Indítson egy hibakeresési folyamatot a kiértékeléshez" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/debug/common/debugSource.i18n.json b/i18n/hun/src/vs/workbench/parts/debug/common/debugSource.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..4054145e143a85338ca7b7aea106834d2c0522f7 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/debug/common/debugSource.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "unknownSource": "Ismeretlen forrás" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/debug/electron-browser/debug.contribution.i18n.json b/i18n/hun/src/vs/workbench/parts/debug/electron-browser/debug.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..fa24086f10125fc115367bf9bd6583e1527941ec --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/debug/electron-browser/debug.contribution.i18n.json @@ -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. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "toggleDebugViewlet": "Hibakeresés megjelenítése", + "toggleDebugPanel": "Hibakeresési konzol", + "debug": "Hibakeresés", + "debugPanel": "Hibakeresési konzol", + "view": "Nézet", + "debugCategory": "Hibakeresés", + "debugCommands": "Hibakeresési konfiguráció", + "debugConfigurationTitle": "Hibakeresés", + "allowBreakpointsEverywhere": "Bármelyik fájlban helyezhető el töréspont", + "openExplorerOnEnd": "Hibakeresési munkamenet végén automatikusan nyíljon meg a fájlkezelő nézet", + "inlineValues": "Változók értékének megjelenítése a sorok között hibakeresés közben", + "hideActionBar": "Meghatározza, hogy megjelenjen-e a lebegő hibakeresési műveletsáv", + "launch": "Globális hibakeresés indítási konfiguráció. Használható a 'launch.json' alternatívájaként, ami meg van osztva több munkaterület között" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/debug/electron-browser/debugCommands.i18n.json b/i18n/hun/src/vs/workbench/parts/debug/electron-browser/debugCommands.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..096d97567fc372d44f7c9512e85781751971b6e3 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/debug/electron-browser/debugCommands.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "noFolderDebugConfig": "Fejlettebb hibakeresési konfigurációk használatához nyisson meg egy mappát!" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/debug/electron-browser/debugConfigurationManager.i18n.json b/i18n/hun/src/vs/workbench/parts/debug/electron-browser/debugConfigurationManager.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..7f6a09aa689f5766b40d8fbbef4542c2e04f1fba --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/debug/electron-browser/debugConfigurationManager.i18n.json @@ -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. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "vscode.extension.contributes.debuggers": "Hibakeresési illesztőket szolgáltat.", + "vscode.extension.contributes.debuggers.type": "A hibakeresési illesztő egyedi azonosítója.", + "vscode.extension.contributes.debuggers.label": "A hibakeresési illesztő megjelenített neve.", + "vscode.extension.contributes.debuggers.program": "A hibakeresési illesztő program elérési útja. Az elérési út lehet abszolút vagy relatív a kiegészítő mappájához képest.", + "vscode.extension.contributes.debuggers.args": "Az illesztő számára átadott argumentumok.", + "vscode.extension.contributes.debuggers.runtime": "Kiegészítő futtatókörnyezet arra az esetre, ha a program attribútum nem egy futtatható fájl, és futtatókörnyezetre van szüksége.", + "vscode.extension.contributes.debuggers.runtimeArgs": "Kiegészítő argumentumok a futtatókörnyezet számára.", + "vscode.extension.contributes.debuggers.variables": "A `launch.json`-ban található interaktív változók (pl. ${action.pickProcess}) hozzárendelése parancsokhoz.", + "vscode.extension.contributes.debuggers.initialConfigurations": "Konfigurációk a 'launch.json' első változatának elkészítéséhez.", + "vscode.extension.contributes.debuggers.languages": "Azon nyelvek listája, amelyeknél ez a hibakeresési kiegészítő alapértelmezett hibakeresőnek tekinthető.", + "vscode.extension.contributes.debuggers.adapterExecutableCommand": "Ha meg van adva, a VS Code ezt a parancsot fogja hívni a hibakeresési illesztő futtatható állománya elérési útjának és az átadandó argumentumok meghatározásához.", + "vscode.extension.contributes.debuggers.startSessionCommand": "Ha meg van határozva, a VS Code ezt a parancsot fogja hívni az ennek a kiegészítőnek küldött \"debug\" vagy \"run\" parancsok esetén.", + "vscode.extension.contributes.debuggers.configurationSnippets": "Kódtöredékek új 'launch.json'-konfigurációk hozzáadásához.", + "vscode.extension.contributes.debuggers.configurationAttributes": "JSON-sémakonfigurációk a 'launch.json' validálásához.", + "vscode.extension.contributes.debuggers.windows": "Windows-specifikus beállítások.", + "vscode.extension.contributes.debuggers.windows.runtime": "A Windows által használt futtatókörnyezet.", + "vscode.extension.contributes.debuggers.osx": "OS X-specifikus beállítások.", + "vscode.extension.contributes.debuggers.osx.runtime": "Az OSX által használt futtatókörnyezet.", + "vscode.extension.contributes.debuggers.linux": "Linux-specifikus beállítások.", + "vscode.extension.contributes.debuggers.linux.runtime": "A Linux által használt futtatókörnyezet.", + "vscode.extension.contributes.breakpoints": "Töréspontokat szolgáltat.", + "vscode.extension.contributes.breakpoints.language": "Töréspontok engedélyezése ennél a nyelvnél.", + "app.launch.json.title": "Indítás", + "app.launch.json.version": "A fájlformátum verziója.", + "app.launch.json.configurations": "A konfigurációk listája. Új konfigurációk hozzáadhatók vagy a meglévők szerkeszthetők az IntelliSense használatával.", + "app.launch.json.compounds": "A kombinációk listája. Minden kombináció több konfigurációt hivatkozik meg, melyek együtt indulnak el.", + "app.launch.json.compound.name": "A kombináció neve. Az indítási konfiguráció lenyíló menüjében jelenik meg.", + "app.launch.json.compounds.configurations": "Azon konfigurációk neve, melyek elindulnak ezen kombináció részeként.", + "debugNoType": "A hibakeresési illesztő 'type' tulajdonsága kötelező, és 'string' típusúnak kell lennie.", + "DebugConfig.failed": "Nem sikerült létrehozni a 'launch.json' fájlt a '.vscode' mappánan ({0}).", + "selectDebug": "Környezet kiválasztása" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/debug/electron-browser/debugEditorContribution.i18n.json b/i18n/hun/src/vs/workbench/parts/debug/electron-browser/debugEditorContribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..dde289381299ccdafd557b0b978448e4640282d3 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/debug/electron-browser/debugEditorContribution.i18n.json @@ -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. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "removeBreakpoints": "Töréspontok eltávolítása", + "removeBreakpointOnColumn": "{0}. oszlopban található töréspont eltávolítása", + "removeLineBreakpoint": "Sorra vonatkozó töréspont eltávolítása", + "editBreakpoints": "Töréspontok szerkesztése", + "editBreakpointOnColumn": "{0}. oszlopban található töréspont szerkesztése", + "editLineBrekapoint": "Sorra vonatkozó töréspont szerkesztése", + "enableDisableBreakpoints": "Töréspontok engedélyezése/letiltása", + "disableColumnBreakpoint": "{0}. oszlopban található töréspont letiltása", + "disableBreakpointOnLine": "Sorszintű töréspont letiltása", + "enableBreakpoints": "{0}. oszlopban található töréspont engedélyezése", + "enableBreakpointOnLine": "Sorszintű töréspont engedélyezése", + "addBreakpoint": "Töréspont hozzáadása", + "addConfiguration": "Konfiguráció hozzáadása..." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/debug/electron-browser/debugHover.i18n.json b/i18n/hun/src/vs/workbench/parts/debug/electron-browser/debugHover.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..c222653e922ef87b181384c753ae5321b60d1cf4 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/debug/electron-browser/debugHover.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "treeAriaLabel": "Hibakeresési súgószöveg" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/debug/electron-browser/debugService.i18n.json b/i18n/hun/src/vs/workbench/parts/debug/electron-browser/debugService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..644abcafd013b5ba02d6abcba3a09853d43d1037 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/debug/electron-browser/debugService.i18n.json @@ -0,0 +1,25 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "snapshotObj": "Ennél az objektumhoz csak a primitív értékek vannak megjelenítve.", + "debuggingPaused": "Hibakeresés szüneteltetve, oka: {0}, {1} {2}", + "debuggingStarted": "Hibakeresés elindítva.", + "debuggingStopped": "Hibakeresés leállítva.", + "breakpointAdded": "Töréspont hozzáadva, {0}. sor, fájl: {1}", + "breakpointRemoved": "Töréspont eltávoíltva, {0}. sor, fájl: {1}", + "compoundMustHaveConfigurations": "A kombinációk \"configurations\" tulajdonságát be kell állítani több konfiguráció elindításához.", + "configMissing": "A(z) '{0}' konfiguráció hiányzik a 'launch.json'-ból.", + "debugTypeNotSupported": "A megadott hibakeresési típus ('{0}') nem támogatott.", + "debugTypeMissing": "A kiválasztott indítási konfigurációnak hiányzik a 'type' tulajdonsága.", + "preLaunchTaskErrors": "Buildelési hibák léptek fel a(z) '{0}' preLaunchTask futása közben.", + "preLaunchTaskError": "Buildelési hiba lépett fel a(z) '{0}' preLaunchTask futása közben.", + "preLaunchTaskExitCode": "A(z) '{0}' preLaunchTask a következő hibakóddal fejeződött be: {1}.", + "debugAnyway": "Hibakeresés indítása mindenképp", + "noFolderWorkspaceDebugError": "Az aktív fájlon nem lehet hibakeresést végezni. Bizonyosodjon meg róla, hogy el van mentve a lemezre, és hogy az adott fájltípushoz telepítve van a megfelelő hibakeresési kiegészítő.", + "NewLaunchConfig": "Állítson be egy indítási konfigurációt az alkalmazása számára. {0}", + "DebugTaskNotFound": "A(z) '{0}' preLaunchTask nem található.", + "differentTaskRunning": "A(z) {0} feladat már fut. Nem futtatható a(z) {1} indítás előtti feladat." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/debug/electron-browser/debugViewer.i18n.json b/i18n/hun/src/vs/workbench/parts/debug/electron-browser/debugViewer.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..b11dd377626684822a1bd9404728f55083b114d2 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/debug/electron-browser/debugViewer.i18n.json @@ -0,0 +1,28 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "process": "Folyamat", + "paused": "Szüneteltetve", + "running": "Fut", + "thread": "Szál", + "pausedOn": "Szüneteltetve a következő helyen: {0}", + "loadMoreStackFrames": "További veremkeretek betöltése", + "threadAriaLabel": "Szál: {0}, hívási verem, hibakeresés", + "stackFrameAriaLabel": "{0} veremkeret, {0}. sor {1} {2}, hívási verem, hibakeresés", + "variableValueAriaLabel": "Adja meg a változó új nevét", + "variableScopeAriaLabel": "{0} hatókör, változók, hibakeresés", + "variableAriaLabel": "{0} értéke {1}, változók, hibakeresés", + "watchExpressionPlaceholder": "Figyelendő kifejezés", + "watchExpressionInputAriaLabel": "Adja meg a figyelendő kifejezést", + "watchExpressionAriaLabel": "{0} értéke {1}, figyelt, hibakeresés", + "watchVariableAriaLabel": "{0} értéke {1}, figyelt, hibakeresés", + "functionBreakpointPlaceholder": "A függvény, amin meg kell állni", + "functionBreakPointInputAriaLabel": "Adja meg a függvénytöréspontot", + "functionBreakpointsNotSupported": "Ez a hibakereső nem támogatja a függvénytöréspontokat", + "breakpointAriaLabel": "Töréspont a(z) {0}. sorban {1}, töréspontok, hibakeresés", + "functionBreakpointAriaLabel": "{0} függvénytöréspont, töréspontok, hibakeresés", + "exceptionBreakpointAriaLabel": "{0} kivételtöréspont, töréspontok, hibakeresés" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/debug/electron-browser/debugViews.i18n.json b/i18n/hun/src/vs/workbench/parts/debug/electron-browser/debugViews.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..e7e17b09fd6b583ee4154b95fdba35a2bea4f9c1 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/debug/electron-browser/debugViews.i18n.json @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "variablesSection": "Változók szakasz", + "variablesAriaTreeLabel": "Hibakeresési változók", + "expressionsSection": "Kifejezések szaszasz", + "watchAriaTreeLabel": "Hibakeresési figyelőkifejezések", + "callstackSection": "Hívási verem szakasz", + "debugStopped": "Szüneteltetve a következő helyen: {0}", + "callStackAriaLabel": "Hibakeresési hívási verem", + "breakpointsSection": "Töréspontok szakasz", + "breakpointsAriaTreeLabel": "Hibakeresési töréspontok" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/debug/electron-browser/electronDebugActions.i18n.json b/i18n/hun/src/vs/workbench/parts/debug/electron-browser/electronDebugActions.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..b71c6795fa6ce21b4a132b25b54d333f1eee05f0 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/debug/electron-browser/electronDebugActions.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "copyValue": "Érték másolása", + "copy": "Másolás", + "copyAll": "Összes másolása", + "copyStackTrace": "Hívási verem másolása" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/debug/electron-browser/rawDebugSession.i18n.json b/i18n/hun/src/vs/workbench/parts/debug/electron-browser/rawDebugSession.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..fb49eeb2cdb18c2b44de87fcb96023d3880e927b --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/debug/electron-browser/rawDebugSession.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "moreInfo": "További információ", + "unableToLaunchDebugAdapter": "Nem sikerült elindítani a hibakeresési illesztőt a következő helyről: '{0}'.", + "unableToLaunchDebugAdapterNoArgs": "Nem sikerült elindítani a hibakeresési illesztőt.", + "stoppingDebugAdapter": "{0}. Hibakeresési illesztő leállítása.", + "debugAdapterCrash": "A hibakeresési illesztő folyamata váratlanul leállt" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/debug/electron-browser/repl.i18n.json b/i18n/hun/src/vs/workbench/parts/debug/electron-browser/repl.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..2490789235bb564e20a298396434e72542e3859d --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/debug/electron-browser/repl.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "replAriaLabel": "REPL-panel", + "actions.repl.historyPrevious": "Előző az előzményekből", + "actions.repl.historyNext": "Következő az előzményekből", + "actions.repl.acceptInput": "REPL bemenet elfogadása", + "actions.repl.copyAll": "Hibakeresés: Összes másolása a konzolból" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/debug/electron-browser/replViewer.i18n.json b/i18n/hun/src/vs/workbench/parts/debug/electron-browser/replViewer.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..929096a6c4338cad437eff91c1ede524de46ae40 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/debug/electron-browser/replViewer.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "stateCapture": "Az objekum állapota az első kiértékelés idején", + "replVariableAriaLabel": "A(z) {0} változó értéke: {1}, REPL, hibakeresés", + "replExpressionAriaLabel": "A(z) {0} kifejezés értéke: {1}, REPL, hibakeresés", + "replValueOutputAriaLabel": "{0}, REPL, hibakeresés", + "replKeyValueOutputAriaLabel": "A(z) {0} kimeneti változó értéke: {1}, REPL, hibakeresés" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/debug/electron-browser/statusbarColorProvider.i18n.json b/i18n/hun/src/vs/workbench/parts/debug/electron-browser/statusbarColorProvider.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..861e45437c786b884f64b43e46f0649f706d3cbe --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/debug/electron-browser/statusbarColorProvider.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "statusBarDebuggingBackground": "Az állapotsor háttérszíne, ha a programon hibakeresés folyik. Az állapotsor az ablak alján jelenik meg.", + "statusBarDebuggingForeground": "Az állapotsor előtérszíne, ha a programon hibakeresés folyik. Az állapotsor az ablak alján jelenik meg." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/debug/electron-browser/terminalSupport.i18n.json b/i18n/hun/src/vs/workbench/parts/debug/electron-browser/terminalSupport.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..8e82d560ff02743e1db814ac8ccca057ba3eba35 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/debug/electron-browser/terminalSupport.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "debug.terminal.title": "hibakereső", + "debug.terminal.not.available.error": "Az integrált terminál nem elérhető" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json b/i18n/hun/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..6b2154af74d903c84c03e98c3056b513d4e27075 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json @@ -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. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "debugAdapterBinNotFound": "A hibakeresési illesztő futtatható állománya ('{0}') nem létezik.", + "debugAdapterCannotDetermineExecutable": "Nem határozható meg a(z) '{0}' hibakeresési illesztő futtatható állománya.", + "debugType": "A konfiguráció típusa.", + "debugTypeNotRecognised": "Ez a hibakeresési típus nem ismert. Bizonyosodjon meg róla, hogy telepítve és engedélyezve van a megfelelő hibakeresési kiegészítő.", + "node2NotSupported": "A \"node2\" már nem támogatott. Használja helyette a \"node\"-ot, és állítsa a \"protocol\" attribútum értékét \"inspector\"-ra.", + "debugName": "A konfiguráció neve. Az indítási konfiguráció lenyíló menüjében jelenik meg.", + "debugRequest": "A konfiguráció kérési típusa. Lehet \"launch\" vagy \"attach\".", + "debugServer": "Csak hibakeresési kiegészítők fejlesztéséhez: ha a port meg van adva, akkor a VS Code egy szerver módban futó hibakeresési illesztőhöz próbál meg csatlakozni.", + "debugPrelaunchTask": "A hibakeresési folyamat előtt futtatandó feladat.", + "debugWindowsConfiguration": "Windows-specifikus indítási konfigurációs attribútumok.", + "debugOSXConfiguration": "OS X-specifikus indítási konfigurációs attribútumok.", + "debugLinuxConfiguration": "Linux-specifikus indítási konfigurációs attribútumok.", + "deprecatedVariables": "Az 'env.', 'config.' és 'command.' tujdonságok elavultak, használja helyette az 'env:', 'config:' és 'command:' tulajdonságokat." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/emmet/browser/actions/showEmmetCommands.i18n.json b/i18n/hun/src/vs/workbench/parts/emmet/browser/actions/showEmmetCommands.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..0f5eb4400f63b0464339a675b39a85d3e99b8089 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/emmet/browser/actions/showEmmetCommands.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "showEmmetCommands": "Emmet-parancsok megjelenítése" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/emmet/electron-browser/actions/balance.i18n.json b/i18n/hun/src/vs/workbench/parts/emmet/electron-browser/actions/balance.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..1534d8b6077e9d3845ec3d11ad6605c440651a94 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/emmet/electron-browser/actions/balance.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "balanceInward": "Emmet: Egyensúlyozás (belefé)", + "balanceOutward": "Emmet: Egyensúlyozás (kifelé)" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json b/i18n/hun/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..219aad079bd90185ace39615aeb282176306cb53 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "previousEditPoint": "Emmet: Ugrás az előző szerkesztési pontra", + "nextEditPoint": "Emmet: Ugrás a következő szerkesztési pontra" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/emmet/electron-browser/actions/evaluateMath.i18n.json b/i18n/hun/src/vs/workbench/parts/emmet/electron-browser/actions/evaluateMath.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..ab60a0c6b09da00c6a8488e0605d8fc8eefbda12 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/emmet/electron-browser/actions/evaluateMath.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "evaluateMathExpression": "Emmet: Matematikai kifejezés kiértékelése" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/emmet/electron-browser/actions/expandAbbreviation.i18n.json b/i18n/hun/src/vs/workbench/parts/emmet/electron-browser/actions/expandAbbreviation.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..646e5adcf6f2d9779398fa07d87efa91ca19e620 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/emmet/electron-browser/actions/expandAbbreviation.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "expandAbbreviationAction": "Emmet: Rövidítés kibontása" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/emmet/electron-browser/actions/incrementDecrement.i18n.json b/i18n/hun/src/vs/workbench/parts/emmet/electron-browser/actions/incrementDecrement.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..d9e318872d89da4a355aec22521176d9eeca0300 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/emmet/electron-browser/actions/incrementDecrement.i18n.json @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "incrementNumberByOneTenth": "Emmet: Növelés 0,1-gyel", + "incrementNumberByOne": "Emmet: Növelés 1-gyel", + "incrementNumberByTen": "Emmet: Növelés 10-zel", + "decrementNumberByOneTenth": "Emmet: Csökkentés 0,1-gyel", + "decrementNumberByOne": "Emmet: Csökkentés 1-gyel", + "decrementNumberByTen": "Emmet: Csökkentés 10-zel" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/emmet/electron-browser/actions/matchingPair.i18n.json b/i18n/hun/src/vs/workbench/parts/emmet/electron-browser/actions/matchingPair.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..cec247d0e8fd3c8e4a7f0991c864eb39ca9808cb --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/emmet/electron-browser/actions/matchingPair.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "matchingPair": "Emmet: Ugrás az illeszkedő párra" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/emmet/electron-browser/actions/mergeLines.i18n.json b/i18n/hun/src/vs/workbench/parts/emmet/electron-browser/actions/mergeLines.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..de85d11a1367ef81afd66390bca3f0a11bcbba93 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/emmet/electron-browser/actions/mergeLines.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "mergeLines": "Emmet: Sorok összeolvasztása" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/emmet/electron-browser/actions/reflectCssValue.i18n.json b/i18n/hun/src/vs/workbench/parts/emmet/electron-browser/actions/reflectCssValue.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..f4fa17b28600af650f583039b64e387026d7b785 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/emmet/electron-browser/actions/reflectCssValue.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "reflectCSSValue": "Emmet: CSS-érték tükrözése" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/emmet/electron-browser/actions/removeTag.i18n.json b/i18n/hun/src/vs/workbench/parts/emmet/electron-browser/actions/removeTag.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..ee23339dfca23c6b9fd4c896dd700591e50029f2 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/emmet/electron-browser/actions/removeTag.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "removeTag": "Emmet: Elem eltávolítása" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/emmet/electron-browser/actions/selectItem.i18n.json b/i18n/hun/src/vs/workbench/parts/emmet/electron-browser/actions/selectItem.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..0d67ceb7a0237ece72efd2eea533878de931ad83 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/emmet/electron-browser/actions/selectItem.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "selectPreviousItem": "Emmet: Előző elem kiválasztása", + "selectNextItem": "Emmet: Következő elem kiválasztása" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/emmet/electron-browser/actions/splitJoinTag.i18n.json b/i18n/hun/src/vs/workbench/parts/emmet/electron-browser/actions/splitJoinTag.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..93c0cba54af557ecc6bbd9c734eaae3d7dc0f579 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/emmet/electron-browser/actions/splitJoinTag.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "splitJoinTag": "Emmet: Elem szétbontása/összeolvasztása" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/emmet/electron-browser/actions/toggleComment.i18n.json b/i18n/hun/src/vs/workbench/parts/emmet/electron-browser/actions/toggleComment.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..cd5b4fc1fe3485361e42ef127ef5f8b90bfdfdb7 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/emmet/electron-browser/actions/toggleComment.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "toggleComment": "Emmet: Megjegyzés be- és kikapcsolása" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/emmet/electron-browser/actions/updateImageSize.i18n.json b/i18n/hun/src/vs/workbench/parts/emmet/electron-browser/actions/updateImageSize.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..82dab2c362c8bdf4b3120722413d2a06a0abf645 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/emmet/electron-browser/actions/updateImageSize.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "updateImageSize": "Emmet: Képméret frissítése" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/emmet/electron-browser/actions/updateTag.i18n.json b/i18n/hun/src/vs/workbench/parts/emmet/electron-browser/actions/updateTag.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..60dea6fbae0d2bf1f1503c5ddf7ece30bf5b7fec --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/emmet/electron-browser/actions/updateTag.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "updateTag": "Emmet: Elem frissítése", + "enterTag": "Adja meg az elemet", + "tag": "Elem" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/emmet/electron-browser/actions/wrapWithAbbreviation.i18n.json b/i18n/hun/src/vs/workbench/parts/emmet/electron-browser/actions/wrapWithAbbreviation.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..7a062455c627056368ed37b2b707b8570a3c5f17 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/emmet/electron-browser/actions/wrapWithAbbreviation.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "wrapWithAbbreviationAction": "Emmet: Becsomagolás rövidítéssel", + "enterAbbreviation": "Adja meg a rövidítést", + "abbreviation": "Rövidítés" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json b/i18n/hun/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..a4c1aceb7c643c9c546f8779d986a84b64a52d32 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "emmetConfigurationTitle": "Emmet", + "triggerExpansionOnTab": "Ha engedélyezve van, akkor az Emmet-rövidítések a Tab billentyű lenyomásával bonthatók ki.", + "emmetPreferences": "Beállítások, melyek módosítják az Emmet műveleteinek és feloldó algoritmusainak viselkedését.", + "emmetSyntaxProfiles": "Konkrét szintaktika profiljának meghatározása vagy saját profil használata adott szabályokkal.", + "emmetExclude": "Azon nyelvek listája, ahol az Emmet-rövidítések ne legyenek kibontva.", + "emmetExtensionsPath": "Az Emmet-profilokat, -kódtöredékeket és -beállításokat tartalmazó mappa", + "useNewEmmet": "Új Emmet-modulok használata az összes Emmet-funkcióhoz (ami előbb-utóbb helyettesíteni fogja az egyedülálló Emmet-könyvtárat)." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/execution/electron-browser/terminal.contribution.i18n.json b/i18n/hun/src/vs/workbench/parts/execution/electron-browser/terminal.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..91f0c001e15c70adacad4007108edf7393dfccf2 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/execution/electron-browser/terminal.contribution.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "terminalConfigurationTitle": "Külső terminál", + "terminal.external.windowsExec": "Meghatározza, hogy mely terminál fusson Windowson.", + "terminal.external.osxExec": "Meghatározza, hogy mely terminál fusson OS X-en.", + "terminal.external.linuxExec": "Meghatározza, hogy mely terminál fusson Linuxon.", + "globalConsoleActionWin": "Új parancssor megnyitása", + "globalConsoleActionMacLinux": "Új terminál megnyitása", + "scopedConsoleActionWin": "Megnyitás a parancssorban", + "scopedConsoleActionMacLinux": "Megnyitás a terminálban" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/execution/electron-browser/terminalService.i18n.json b/i18n/hun/src/vs/workbench/parts/execution/electron-browser/terminalService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..d8480642f686233ad3370f83a103d4e46622f439 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/execution/electron-browser/terminalService.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "console.title": "VS Code-konzol", + "mac.terminal.script.failed": "A(z) '{0}' parancsfájl a következő hibakóddal lépett ki: {1}", + "mac.terminal.type.not.supported": "A(z) '{0}' nem támogatott", + "press.any.key": "A folytatáshoz nyomjon meg egy billentyűt...", + "linux.term.failed": "A(z) '{0}' a következő hibakóddal lépett ki: {1}" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/explorers/browser/treeExplorer.contribution.i18n.json b/i18n/hun/src/vs/workbench/parts/explorers/browser/treeExplorer.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..e441ed0dd6dc6a200474af2179b2872424ba7062 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/explorers/browser/treeExplorer.contribution.i18n.json @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "vscode.extension.contributes.view": "Egyedi nézetet szolgáltat", + "vscode.extension.contributes.view.id": "A vscode.workspace.createTreeView-n keresztül létrehozott nézet azonosítására szolgáló egyedi azonosító", + "vscode.extension.contributes.view.label": "A nézet kirajzolásához használt, emberek által olvasható szöveg", + "vscode.extension.contributes.view.icon": "A nézet ikonjának elérési útja", + "vscode.extension.contributes.views": "Egyedi nézeteket szolgáltat", + "showViewlet": "{0} megjelenítése", + "view": "Nézet" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/explorers/browser/treeExplorerActions.i18n.json b/i18n/hun/src/vs/workbench/parts/explorers/browser/treeExplorerActions.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..982d3cebdfeaaf071211de47d668ff72bd7f2efd --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/explorers/browser/treeExplorerActions.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "refresh": "Frissítés" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/explorers/browser/treeExplorerService.i18n.json b/i18n/hun/src/vs/workbench/parts/explorers/browser/treeExplorerService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..ccb7f2536108ae90851b975ffbcff1fff4bd2e67 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/explorers/browser/treeExplorerService.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "treeExplorer.noMatchingProviderId": "Nincs {0} azonosítójú TreeExplorerNodeProvider regisztrálva" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/explorers/browser/views/treeExplorerView.i18n.json b/i18n/hun/src/vs/workbench/parts/explorers/browser/views/treeExplorerView.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..4c975404538f6cfc97255ae9bbefda1ec90c990a --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/explorers/browser/views/treeExplorerView.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "treeExplorerViewlet.tree": "Fa-alapú kezelőszakasz" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/extensions/browser/dependenciesViewer.i18n.json b/i18n/hun/src/vs/workbench/parts/extensions/browser/dependenciesViewer.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..0ea38cb93c45ce579aed22cb6966c63f6b3b3ac3 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/extensions/browser/dependenciesViewer.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "error": "Hiba", + "Unknown Dependency": "Ismeretlen függőség:" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/extensions/browser/extensionEditor.i18n.json b/i18n/hun/src/vs/workbench/parts/extensions/browser/extensionEditor.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..9e2b6f5d7a4ceb3df5803ea7ebe195386fb3f33d --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/extensions/browser/extensionEditor.i18n.json @@ -0,0 +1,43 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "name": "Kiegészítő neve", + "extension id": "Kiegészítő azonosítója", + "publisher": "Kiadó neve", + "install count": "Telepítések száma", + "rating": "Értékelés", + "license": "Licenc", + "details": "Részletek", + "contributions": "Szolgáltatások", + "changelog": "Változtatási napló", + "dependencies": "Függőségek", + "noReadme": "Leírás nem található.", + "noChangelog": "Változtatási napló nem található.", + "noContributions": "Nincsenek szolgáltatások", + "noDependencies": "Nincsenek függőségek", + "settings": "Beállítások ({0})", + "setting name": "Név", + "description": "Leírás", + "default": "Alapértelmezett érték", + "debuggers": "Hibakeresők ({0})", + "debugger name": "Név", + "views": "Nézetek ({0})", + "view id": "Azonosító", + "view name": "Név", + "view location": "Hol?", + "themes": "Témák ({0})", + "JSON Validation": "JSON-validációk ({0})", + "commands": "Parancsok ({0})", + "command name": "Név", + "keyboard shortcuts": "Billentyűparancsok", + "menuContexts": "Helyi menük", + "languages": "Nyelvek ({0})", + "language id": "Azonosító", + "language name": "Név", + "file extensions": "Fájlkiterjesztések", + "grammar": "Nyelvtan", + "snippets": "Kódtöredékek" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/extensions/browser/extensionsActions.i18n.json b/i18n/hun/src/vs/workbench/parts/extensions/browser/extensionsActions.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..348b2ebb6afb44cc24055296b6c56f50dd137c1f --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/extensions/browser/extensionsActions.i18n.json @@ -0,0 +1,62 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "installAction": "Telepítés", + "installing": "Telepítés...", + "uninstallAction": "Eltávolítás", + "Uninstalling": "Eltávolítás...", + "updateAction": "Frissítés", + "updateTo": "Frissítés ({0})", + "enableForWorkspaceAction.label": "Engedélyezés a munkaterületen", + "enableAlwaysAction.label": "Engedélyezés mindig", + "disableForWorkspaceAction.label": "Letiltás a munkaterületen", + "disableAlwaysAction.label": "Letiltás mindig", + "ManageExtensionAction.uninstallingTooltip": "Eltávolítás", + "enableForWorkspaceAction": "Munkaterület", + "enableGloballyAction": "Mindig", + "enableAction": "Engedélyezés", + "disableForWorkspaceAction": "Munkaterület", + "disableGloballyAction": "Mindig", + "disableAction": "Letiltás", + "checkForUpdates": "Frissítések keresése", + "enableAutoUpdate": "Kiegészítők automatikus frissítésének engedélyezése", + "disableAutoUpdate": "Kiegészítők automatikus frissítésének letiltása", + "updateAll": "Összes kiegészítő frissítése", + "reloadAction": "Újratöltés", + "postUpdateTooltip": "Újratöltés a frissítéshez", + "postUpdateMessage": "Újratölti az ablakot a frissített kiegészítő ('{0}') aktiválásához?", + "postEnableTooltip": "Újratöltés az aktiváláshoz", + "postEnableMessage": "Újratölti az ablakot a kiegészítő ('{0}') aktiválásához?", + "postDisableTooltip": "Újratöltés a kikapcsoláshoz", + "postDisableMessage": "Újratölti az ablakot a kiegészítő ('{0}') kikapcsolásához?", + "postUninstallTooltip": "Újratöltés a kikapcsoláshoz", + "postUninstallMessage": "Újratölti az ablakot az eltávolított kiegészítő ('{0}') kikapcsolásához?", + "reload": "Ablak új&&ratöltése", + "toggleExtensionsViewlet": "Kiegészítők megjelenítése", + "installExtensions": "Kiegészítők telepítése", + "showInstalledExtensions": "Telepített kiegészítők megjelenítése", + "showDisabledExtensions": "Letiltott kiegészítők megjelenítése", + "clearExtensionsInput": "Kiegészítők beviteli mező tartalmának törlése", + "showOutdatedExtensions": "Elavult kiegészítők megjelenítése", + "showPopularExtensions": "Népszerű kiegészítők megjelenítése", + "showRecommendedExtensions": "Ajánlott kiegészítők megjelenítése", + "showWorkspaceRecommendedExtensions": "Munkaterülethez ajánlott kiegészítők megjelenítése", + "showRecommendedKeymapExtensions": "Ajánlott billentyűkonfigurációk megjelenítése", + "showRecommendedKeymapExtensionsShort": "Billentyűkonfigurációk", + "showLanguageExtensions": "Nyelvi kiegészítők megjelenítése", + "showLanguageExtensionsShort": "Nyelvi kiegészítők", + "configureWorkspaceRecommendedExtensions": "Ajánlott kiegészítők konfigurálása (munkaterületre vonatkozóan)", + "ConfigureWorkspaceRecommendations.noWorkspace": "Az ajánlatok csak egy munkaterület mappájára vonatkozóan érhetők el.", + "OpenExtensionsFile.failed": "Nem sikerült létrehozni az 'extensions.json' fájlt a '.vscode' mappánan ({0}).", + "builtin": "Beépített", + "disableAll": "Összes telepített kiegészítő letiltása", + "disableAllWorkspace": "Összes telepített kiegészítő letiltása a munkaterületre vonatkozóan", + "enableAll": "Összes telepített kiegészítő engedélyezése", + "enableAllWorkspace": "Összes telepített kiegészítő engedélyezése a munkaterületre vonatkozóan", + "extensionButtonProminentBackground": "A kiegészítőkhöz tartozó kiemelt műveletgombok (pl. a Telepítés gomb) háttérszíne.", + "extensionButtonProminentForeground": "A kiegészítőkhöz tartozó kiemelt műveletgombok (pl. a Telepítés gomb) előtérszíne.", + "extensionButtonProminentHoverBackground": "A kiegészítőkhöz tartozó kiemelt műveletgombok (pl. a Telepítés gomb) háttérszíne, ha az egér fölötte van." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/extensions/browser/extensionsQuickOpen.i18n.json b/i18n/hun/src/vs/workbench/parts/extensions/browser/extensionsQuickOpen.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..85d01b9b53eab2de4b86a901543f902bf55b0dff --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/extensions/browser/extensionsQuickOpen.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "manage": "Nyomjon Entert a kiegészítők kezeléséhez.", + "searchFor": "Nyomja meg az Enter gombot a(z) '{0}' kiegészítő kereséséhez a piactéren.", + "noExtensionsToInstall": "Adja meg a kiegészítő nevét" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/extensions/common/extensionsFileTemplate.i18n.json b/i18n/hun/src/vs/workbench/parts/extensions/common/extensionsFileTemplate.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..81a39e83e429f024caaa4f3c7ff87b67ff57e540 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/extensions/common/extensionsFileTemplate.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "app.extensions.json.title": "Kiegészítők", + "app.extensions.json.recommendations": "Ajánlott kiegészítők listája. A kiegészítők azonosítója mindig '${publisher}.${name}' formában van. Példa: 'vscode.csharp'.", + "app.extension.identifier.errorMessage": "Az elvárt formátum: '${publisher}.${name}'. Példa: 'vscode.csharp'." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/extensions/common/extensionsInput.i18n.json b/i18n/hun/src/vs/workbench/parts/extensions/common/extensionsInput.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..ed471bc488cfa2127879400e87486ea9043d132c --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/extensions/common/extensionsInput.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "extensionsInputName": "Kiegészítő: {0}" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.i18n.json b/i18n/hun/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..09c306397f420327744344ed714999fa1f51e867 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.i18n.json @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "reallyRecommended2": "Ehhez a fájltípushoz a(z) '{0}' kiegészítő ajánlott", + "showRecommendations": "Ajánlatok megjelenítése", + "neverShowAgain": "Ne jelenítse meg újra", + "close": "Bezárás", + "workspaceRecommended": "A munkaterülethez vannak javasolt kiegészítők", + "ignoreExtensionRecommendations": "Figyelmen kívül akarja hagyni az összes javasolt kiegészítőt?", + "ignoreAll": "Igen, az összes figyelmen kívül hagyása", + "no": "Nem", + "cancel": "Mégse" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.i18n.json b/i18n/hun/src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..61b346af2edff042d35d58516053cd4beb313631 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "extensionsCommands": "Kiegészítők kezelése", + "galleryExtensionsCommands": "Kiegészítők telepítése a galériából", + "extension": "Kiegészítő", + "extensions": "Kiegészítők", + "view": "Nézet", + "extensionsConfigurationTitle": "Kiegészítők", + "extensionsAutoUpdate": "Kiegészítők automatikus frissítése", + "extensionsIgnoreRecommendations": "Ajánlott kiegészítők figyelmen kívül hagyása" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/extensions/electron-browser/extensionsActions.i18n.json b/i18n/hun/src/vs/workbench/parts/extensions/electron-browser/extensionsActions.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..aa157cfb84a025a179130b5a2c5f5ff0c922b417 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/extensions/electron-browser/extensionsActions.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "openExtensionsFolder": "Kiegészítők mappájának megnyitása", + "installVSIX": "Telepítés VSIX-ből...", + "InstallVSIXAction.success": "A kiegészítő sikeresen fel lett telepítve. Indítsa újra az engedélyezéshez.", + "InstallVSIXAction.reloadNow": "Újratöltés most" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json b/i18n/hun/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..f71021aaf8793df86f3cb825e01867d7bd522d46 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "disableOtherKeymapsConfirmation": "Letiltja a többi billentyűkonfigurációt ({0}) a billentyűparancsok közötti konfliktusok megelőzése érdekében?", + "yes": "Igen", + "no": "Nem", + "betterMergeDisabled": "A Better Merge kiegészítő most már be van építve. A telepített kiegészítő le lett tiltva és eltávolítható.", + "uninstall": "Eltávolítás", + "later": "Később" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/extensions/electron-browser/extensionsViewlet.i18n.json b/i18n/hun/src/vs/workbench/parts/extensions/electron-browser/extensionsViewlet.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..b897e553bd59da23b5270ef71913df65dcf4ed5a --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/extensions/electron-browser/extensionsViewlet.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "searchExtensions": "Kiegészítők keresése a piactéren", + "extensions": "Kiegészítők", + "sort by installs": "Rendezés a telepítések száma szerint", + "sort by rating": "Rendezés értékelés szerint", + "sort by name": "Rendezés név szerint", + "no extensions found": "Kiegészítő nem található.", + "suggestProxyError": "A piactér 'ECONNREFUSED' hibával tért vissza. Ellenőrizze a 'http.proxy' beállítást!", + "outdatedExtensions": "{0} elavult kiegészítő" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/extensions/node/extensionsWorkbenchService.i18n.json b/i18n/hun/src/vs/workbench/parts/extensions/node/extensionsWorkbenchService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..c4d13294809f7f493442a055051b49d0d132ea47 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/extensions/node/extensionsWorkbenchService.i18n.json @@ -0,0 +1,17 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "enableDependeciesConfirmation": "A(z) '{0}' engedélyezésével annak függőségei is engedélyezve lesznek. Szeretné folytatni?", + "enable": "Igen", + "doNotEnable": "Nem", + "disableDependeciesConfirmation": "Csak a(z) '{0}' kiegészítőt szeretné letiltani vagy annak függőségeit is?", + "disableOnly": "Csak ezt", + "disableAll": "Az összeset", + "cancel": "Mégse", + "singleDependentError": "Nem sikerült letiltani a(z) '{0}' kiegészítőt: a(z) '{1}' kiegészítő függ tőle.", + "twoDependentsError": "Nem sikerült letiltani a(z) '{0}' kiegészítőt: a(z) '{1}' és '{2}' kiegészítők függnek tőle.", + "multipleDependentsError": "Nem sikerült letiltani a(z) '{0}' kiegészítőt: a(z) '{1}', '{2}' és más kiegészítők függnek tőle." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/feedback/electron-browser/feedback.i18n.json b/i18n/hun/src/vs/workbench/parts/feedback/electron-browser/feedback.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..d2b7c3c88fa26c808df63de9ea1f4008e1fcd386 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/feedback/electron-browser/feedback.i18n.json @@ -0,0 +1,25 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "sendFeedback": "Visszajelzés tweetelése", + "label.sendASmile": "Küldje el nekünk egy tweetben a visszajelzését!", + "patchedVersion1": "A telepítés hibás.", + "patchedVersion2": "Az alábbiakat adja meg, ha hibát akar beküldeni.", + "sentiment": "Milyennek találja az alkalmazást?", + "smileCaption": "Elégedett", + "frownCaption": "Elégedetlen vagyok vele", + "other ways to contact us": "Más értesítési módok", + "submit a bug": "Hibajelentés küldése", + "request a missing feature": "Hiányzó funkció kérése", + "tell us why?": "Mondja el, hogy miért", + "commentsHeader": "Visszajelzés", + "tweet": "Tweer", + "character left": "karakter maradt", + "characters left": "karakter maradt", + "feedbackSending": "Küldés", + "feedbackSent": "Köszönjük!", + "feedbackSendingError": "Újrapróbálkozás" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/files/browser/editors/binaryFileEditor.i18n.json b/i18n/hun/src/vs/workbench/parts/files/browser/editors/binaryFileEditor.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..b0c0567e179202d3e30d83d3f2a5a774be07e82a --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/files/browser/editors/binaryFileEditor.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "binaryFileEditor": "Bináris megjelenítő" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/files/browser/editors/textFileEditor.i18n.json b/i18n/hun/src/vs/workbench/parts/files/browser/editors/textFileEditor.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..d37f4ed8778eab04356d2329dbcf50ec736f27b4 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/files/browser/editors/textFileEditor.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "textFileEditor": "Szövegfájlszerkesztő", + "createFile": "Fájl létrehozása", + "fileEditorWithInputAriaLabel": "{0}. Szövegfájlszerkesztő.", + "fileEditorAriaLabel": "Szövegfájlszerkesztő" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/files/browser/fileActions.contribution.i18n.json b/i18n/hun/src/vs/workbench/parts/files/browser/fileActions.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..a5d582952d07ceab327b9112cc4198edad12ec54 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/files/browser/fileActions.contribution.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "filesCategory": "Fájlok", + "revealInSideBar": "Megjelenítés az oldalsávon", + "acceptLocalChanges": "Helyi változtatások használata és a lemezen lévő tartalom felülírása", + "revertLocalChanges": "Helyi változtatások eldobása és visszaállítás a lemezen lévő tartalomra" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/files/browser/fileActions.i18n.json b/i18n/hun/src/vs/workbench/parts/files/browser/fileActions.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..a6ef3bb7930a8a8c8ee9fa4a5b354f417736a7d1 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/files/browser/fileActions.i18n.json @@ -0,0 +1,73 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "retry": "Újra", + "rename": "Átnevezés", + "newFile": "Új fájl", + "newFolder": "Új mappa", + "openFolderFirst": "Mappák vagy fájlok létrehozásához először nyisson meg egy mappát!", + "newUntitledFile": "Új, névtelen fájl", + "createNewFile": "Új fájl", + "createNewFolder": "Új mappa", + "deleteButtonLabelRecycleBin": "Áthelyezés a lo&&mtárba", + "deleteButtonLabelTrash": "Áthelyezés a &&kukába", + "deleteButtonLabel": "&&Törlés", + "dirtyMessageFolderOneDelete": "Törölni készül egy olyan mappát, melyben egy nem mentett változtatásokat tartalmazó fájl van. Folytatja?", + "dirtyMessageFolderDelete": "Törölni készül egy olyan mappát, melyben {0} nem mentett változtatásokat tartalmazó fájl van. Folytatja?", + "dirtyMessageFileDelete": "Törölni készül egy olyan fájlt, amely nem mentett változtatásokat tartalmaz. Folytatja?", + "dirtyWarning": "A módosítások elvesznek, ha nem menti őket.", + "confirmMoveTrashMessageFolder": "Törli a(z) '{0}' nevű mappát és a teljes tartalmát?", + "confirmMoveTrashMessageFile": "Törli a(z) '{0}' nevű fájlt?", + "undoBin": "Helyreállíthatja a lomtárból.", + "undoTrash": "Helyreállíthatja a kukából.", + "confirmDeleteMessageFolder": "Törli a(z) {0} mappát és a teljes tartalmát?", + "confirmDeleteMessageFile": "Véglegesen törli a következőt: {0}?", + "irreversible": "A művelet nem vonható vissza!", + "permDelete": "Végleges törlés", + "delete": "Törlés", + "importFiles": "Fájlok importálása", + "confirmOverwrite": "A célmappában már van ilyen nevű mappa vagy fájl. Le szeretné cserélni?", + "replaceButtonLabel": "&&Csere", + "copyFile": "Másolás", + "pasteFile": "Beillesztés", + "duplicateFile": "Duplikálás", + "openToSide": "Megnyitás oldalt", + "compareSource": "Kijelölés összehasonlításhoz", + "globalCompareFile": "Aktív fájl összehasonlítása...", + "pickHistory": "Válasszon egy korábban megnyitott fájlt az összehasonlításhoz", + "unableToFileToCompare": "A kiválasztott fájl nem hasonlítható össze a következővel: '{0}'.", + "openFileToCompare": "Fájlok összehasonlításához elősször nyisson meg egy fájlt.", + "compareWith": "Összehasonlítás a következővel: '{0}'", + "compareFiles": "Fájlok összehasonlítása", + "refresh": "Frissítés", + "save": "Mentés", + "saveAs": "Mentés másként...", + "saveAll": "Összes mentése", + "saveAllInGroup": "Összes mentése a csoportban", + "saveFiles": "Módosított fájlok mentése", + "revert": "Fájl visszaállítása", + "focusOpenEditors": "Váltás a megnyitott szerkesztőablakok nézetre", + "focusFilesExplorer": "Váltás a fájlkezelőre", + "showInExplorer": "Aktív fájl megjelenítése az oldalsávon", + "openFileToShow": "Fájl fájlkezelőben történő megjelenítéséhez először nyisson meg egy fájlt", + "collapseExplorerFolders": "Mappák összecsukása a fájlkezelőben", + "refreshExplorer": "Fájlkezelő frissítése", + "openFile": "Fájl megnyitása...", + "openFileInNewWindow": "Aktív fájl megnyitása új ablakban", + "openFileToShowInNewWindow": "Fájl új ablakban történő megnyitásához először nyisson meg egy fájlt", + "revealInWindows": "Megjelenítés a fájlkezelőben", + "revealInMac": "Megjelenítés a Finderben", + "openContainer": "Tartalmazó mappa megnyitása", + "revealActiveFileInWindows": "Aktív fájl megjelenítése a Windows Intézőben", + "revealActiveFileInMac": "Aktív fájl megjelenítése a Finderben", + "openActiveFileContainer": "Aktív fájlt tartalmazó mappa megnyitása", + "copyPath": "Elérési út másolása", + "copyPathOfActive": "Aktív fájl elérési útjának másolása", + "emptyFileNameError": "Meg kell adni egy fájl vagy mappa nevét.", + "fileNameExistsError": "Már létezik **{0}** nevű fájl vagy mappa ezen a helyszínen. Adjon meg egy másik nevet!", + "invalidFileNameError": "A(z) **{0}** név nem érvényes fájl- vagy mappanév. Adjon meg egy másik nevet!", + "filePathTooLongError": "A(z) **{0}** név egy olyan elérési utat eredményez, ami túl hosszú. Adjon meg egy másik nevet!" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/files/browser/fileCommands.i18n.json b/i18n/hun/src/vs/workbench/parts/files/browser/fileCommands.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..dd9057b1fa4b3a5d19b450f77eb6adb79dc83d18 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/files/browser/fileCommands.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "openFileToCopy": "Fájlok elérési útjának másolásához elősször nyisson meg egy fájlt", + "openFileToReveal": "Fájlok felfedéséhez elősször nyisson meg egy fájlt" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/files/browser/files.contribution.i18n.json b/i18n/hun/src/vs/workbench/parts/files/browser/files.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..7a29310b0e06dc4f26bbe77720d35c8cb1467fba --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/files/browser/files.contribution.i18n.json @@ -0,0 +1,41 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "showExplorerViewlet": "Fájlkezelő megjelenítése", + "explore": "Fájlkezelő", + "view": "Nézet", + "textFileEditor": "Szövegfájlszerkesztő", + "binaryFileEditor": "Bináris fájlszerkesztő", + "filesConfigurationTitle": "Fájlok", + "exclude": "Globális minták konfigurálása fájlok és mappák kiszűréséhez.", + "files.exclude.boolean": "A globális minta, amire illesztve lesznek a fájlok elérési útjai. A minta engedélyezéséhez vagy letiltásához állítsa igaz vagy hamis értékre.", + "files.exclude.when": "További ellenőrzés elvégzése egy egyező fájl testvérein. Az egyező fájlnévhez használja a $(basename) változót.", + "associations": "Rendeljen nyelveket a fájlokhoz (pl: \"*.kiterjesztés\": \"html\"). Ezek a hozzárendelések elsőbbséget élveznek a telepített nyelvek által definiált alapértelmezett beállításokkal szemben.", + "encoding": "A fájlok olvasásakor és írásakor használt alapértelmezett karakterkódolás.", + "autoGuessEncoding": "Ha engedélyezve van, az alkalmazás automatikusan megpróbálja kitalálni a fájlok kódolását megnyitáskor", + "eol": "Az alapértelmezett sorvégjel. LF-hez használjon \\n-t, CRLF-hez pedig \\r\\n-t.", + "trimTrailingWhitespace": "Ha engedélyezve van, a fájl mentésekor levágja a sor végén található szóközöket.", + "insertFinalNewline": "Ha engedélyezve van, mentéskor beszúr egy záró újsort a fájl végére.", + "files.autoSave.off": "A módosított fájlok soha nincsenek automatikusan mentve.", + "files.autoSave.afterDelay": "A módosított fájlok automatikusan mentésre kerülnek a 'files.autoSaveDelay' beállításban meghatározott időközönként.", + "files.autoSave.onFocusChange": "A módosított fájlok automatikusan mentésre kerülnek, ha a szerkesztőablak elveszíti a fókuszt.", + "files.autoSave.onWindowChange": "A módosított fájlok automatikusan mentésre kerülnek, ha az ablak elveszíti a fókuszt.", + "autoSave": "Meghatározza a módosított fájlok automatikus mentési stratégiáját. Elfogadott értékek: '{0}', '{1}', '{2}' (a szerkesztőablak elveszíti a fókuszt), '{3}' (az ablak elveszíti a fókuszt). Ha az értéke '{4}', megadható a késleltetés a 'files.autoSaveDelay' beállításban.", + "autoSaveDelay": "Meghatározza ezredmásodpercben a késleltetést, ami után a módosított fájlok automatikusan mentésre kerülnek. Csak akkor van hatása, ha a 'files.autoSave' beállítás értéke '{0}'.", + "watcherExclude": "Globális minta, ami meghatározza azoknak a fájloknak a listáját, amelyek ki vannak szűrve a figyelésből. A beállítás módosítása újraindítást igényel. Ha úgy észleli, hogy a Code túl sok processzort használ indításnál, ki tudja szűrni a nagy mappákat a kezdeti terhelés csökkentés érdekében.", + "hotExit.off": "Gyors kilépés letiltása.", + "hotExit.onExit": "Gyors kilépésről akkor van szó, ha az utolsó ablakot bezárják Windowson és Linuxon, vagy ha a workbench.action.quit parancs van futtatva (a parancskatalógusból, billentyűkombinációval vagy a menüből). Az összes biztonsági mentéssel rendelkező ablak helyre lesz állítva a következő indítás során.", + "hotExit.onExitAndWindowClose": "Gyors kilépésről akkor van szó, ha az utolsó ablakot bezárják Windowson és Linuxon, ha a workbench.action.quit parancs van futtatva (a parancskatalógusból, billentyűkombinációval vagy a menüből), vagy bármely ablak, amelyben mappa van megnyitva, függetlenül attól, hogy az az utolsó ablak-e. Az összes megnyitott, mappa nélküli ablak helyre lesz állítva a következő indítás során. A megnyitott mappát tartalmazó ablakok helyreállításához állítsa a \"window.restoreWindows\" értékét \"all\"-ra.", + "hotExit": "Meghatározza, hogy a nem mentett fájlokra emlékezzen-e az alkalmazás a munkamenetek között, így ki lehet hagyni a mentéssel kapcsolatos felugró ablakokat kilépésnél.", + "defaultLanguage": "Az új fájlokhoz alapértelmezetten hozzárendelt nyelv.", + "editorConfigurationTitle": "Szerkesztőablak", + "formatOnSave": "Fájlok formázása mentéskor. Az adott nyelvhez rendelkezésre kell állni formázónak, nem lehet beállítva automatikus mentés, és a szerkesztő nem állhat éppen lefelé.", + "explorerConfigurationTitle": "Fájlkezelő", + "openEditorsVisible": "A megnyitott szerkesztőablakok panelen megjelenített szerkesztőablakok száma. Állítsa 0-ra, ha el szeretné rejteni a panelt.", + "dynamicHeight": "Meghatározza, hogy a megnyitott szerkesztőablakok szakasz magassága automatikusan illeszkedjen a megnyitott elemek számához vagy sem.", + "autoReveal": "Meghatározza, hogy a fájlkezelőben automatikusan fel legyenek fedve és ki legyenek jelölve a fájlok, amikor megnyitják őket.", + "enableDragAndDrop": "Meghatározza, hogy a fájlkezelőben áthelyezhetők-e a fájlok és mappák húzással." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/files/browser/saveErrorHandler.i18n.json b/i18n/hun/src/vs/workbench/parts/files/browser/saveErrorHandler.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..bd3c645714af581315c18038174e2f5936f97473 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/files/browser/saveErrorHandler.i18n.json @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "discard": "Elvetés", + "overwrite": "Felülírás", + "retry": "Újrapróbálkozás", + "readonlySaveError": "Nem sikerült menteni a(z) '{0}' fájlt: a fájl írásvédett. Válassza a 'Felülírás' lehetőséget a védelem eltávolításához.", + "genericSaveError": "Hiba a(z) '{0}' mentése közben: {1}", + "staleSaveError": "Nem sikerült menteni a(z) '{0}' fájlt: a lemezen lévő tartalom újabb. Kattintson az **Összehasonlítás*** gombra a helyi és a lemezen lévő változat összehasonlításához.", + "compareChanges": "Összehasonlítás", + "saveConflictDiffLabel": "{0} (a lemezen) ↔ {1} ({2}) – Mentési konfliktus feloldása", + "userGuide": "Használja a szerkesztői eszköztáron található műveleteket a helyi változtatások **visszavonására** vagy **írja felül** a lemezen lévő tartalmat a változtatásokkal" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/files/browser/views/emptyView.i18n.json b/i18n/hun/src/vs/workbench/parts/files/browser/views/emptyView.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..e1d7ba53a99b339799f027b1d2c14a4194be3ad1 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/files/browser/views/emptyView.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "explorerSection": "Fájlkezelő szakasz", + "openFolder": "Mappa megnyitása" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/files/browser/views/explorerView.i18n.json b/i18n/hun/src/vs/workbench/parts/files/browser/views/explorerView.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..d5015512419dc323972f70ecf02f18f59a1d890b --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/files/browser/views/explorerView.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "explorerSection": "Fájlkezelő szakasz", + "treeAriaLabel": "Fájlkezelő" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/files/browser/views/explorerViewer.i18n.json b/i18n/hun/src/vs/workbench/parts/files/browser/views/explorerViewer.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..d2f6b36195dbdd606b1955f3de43fb39913ad1a4 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/files/browser/views/explorerViewer.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "fileInputAriaLabel": "Adja meg a fájl nevét. Nyomjon 'Enter'-t a megerősítéshez vagy 'Escape'-et a megszakításhoz.", + "filesExplorerViewerAriaLabel": "{0}, Fájlkezelő", + "confirmOverwriteMessage": "A célmappában már létezik '{0}' nevű elem. Le szeretné cserélni?", + "irreversible": "A művelet nem vonható vissza!", + "replaceButtonLabel": "&&Csere" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/files/browser/views/openEditorsView.i18n.json b/i18n/hun/src/vs/workbench/parts/files/browser/views/openEditorsView.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..4a7e2812057176ef40834bdc2def396899477f98 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/files/browser/views/openEditorsView.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "openEditors": "Megnyitott szerkesztőablakok", + "openEditosrSection": "Megnyitott szerkesztőablakok szakasz", + "treeAriaLabel": "Megnyitott szerkesztőablakok: az aktív fájlok listája", + "dirtyCounter": "{0} nincs mentve" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/files/browser/views/openEditorsViewer.i18n.json b/i18n/hun/src/vs/workbench/parts/files/browser/views/openEditorsViewer.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..4ee03d3f18f04eb39d94cd7bc95200d89816deca --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/files/browser/views/openEditorsViewer.i18n.json @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "editorGroupAriaLabel": "{0}, Szerkesztőcsoport", + "openEditorAriaLabel": "{0}, megnyitott szerkesztőablak", + "saveAll": "Összes mentése", + "closeAllUnmodified": "Nem módosultak bezárása", + "closeAll": "Összes bezárása", + "close": "Bezárás", + "closeOthers": "Többi bezárása" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/files/common/dirtyFilesTracker.i18n.json b/i18n/hun/src/vs/workbench/parts/files/common/dirtyFilesTracker.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..24ed237c8feacf59ff3da032eb8564269ef033db --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/files/common/dirtyFilesTracker.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "dirtyFiles": "{0} nem mentett fájl" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/files/common/editors/fileEditorInput.i18n.json b/i18n/hun/src/vs/workbench/parts/files/common/editors/fileEditorInput.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..30e3c5f45be9a0d34e74abe40e181474bba7091f --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/files/common/editors/fileEditorInput.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "orphanedFile": "{0} (törölve a lemezről)" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/html/browser/html.contribution.i18n.json b/i18n/hun/src/vs/workbench/parts/html/browser/html.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..cd4faab781787f9f25a38171d2613a5421cdd761 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/html/browser/html.contribution.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "html.editor.label": "HTML-előnézet" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/html/browser/htmlPreviewPart.i18n.json b/i18n/hun/src/vs/workbench/parts/html/browser/htmlPreviewPart.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..e0ec7953f3b60d96add519cd09a5eb316dcf04d6 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/html/browser/htmlPreviewPart.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "html.voidInput": "Érvénytelen bemenet a szerkesztőablakból." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/html/browser/webview.i18n.json b/i18n/hun/src/vs/workbench/parts/html/browser/webview.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..2f238385c100aad354fc0c6c52b93373aefeb9db --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/html/browser/webview.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "devtools.webview": "Fejlesztői: Webview-eszközök" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/markers/common/messages.i18n.json b/i18n/hun/src/vs/workbench/parts/markers/common/messages.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..f17c3b300c490fa2af76e2e7967f24d09e70e5de --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/markers/common/messages.i18n.json @@ -0,0 +1,39 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "viewCategory": "Nézet", + "problems.view.show.label": "Problémák megjelenítése", + "problems.panel.configuration.title": "Problémák-nézet", + "problems.panel.configuration.autoreveal": "Meghatározza, hogy a problémák nézet automatikusan felfedje-e a fájlokat, amikor megnyitja őket.", + "markers.panel.title.problems": "Problémák", + "markers.panel.aria.label.problems.tree": "Problémák fájlonként csoportosítva", + "markers.panel.no.problems.build": "A munkaterületen eddig egyetlen hiba sem lett érzékelve.", + "markers.panel.no.problems.filters": "A megadott szűrőfeltételnek egyetlen elem sem felel meg.", + "markers.panel.action.filter": "Problémák szűrése", + "markers.panel.filter.placeholder": "Szűrés típus vagy szöveg alapján", + "markers.panel.filter.errors": "hibák", + "markers.panel.filter.warnings": "figyelmeztetések", + "markers.panel.filter.infos": "információk", + "markers.panel.single.error.label": "1 hiba", + "markers.panel.multiple.errors.label": "{0} hiba", + "markers.panel.single.warning.label": "1 figyelmeztetés", + "markers.panel.multiple.warnings.label": "{0} figyelmeztetés", + "markers.panel.single.info.label": "1 információ", + "markers.panel.multiple.infos.label": "{0} információ", + "markers.panel.single.unknown.label": "1 ismeretlen", + "markers.panel.multiple.unknowns.label": "{0} ismeretlen", + "markers.panel.at.ln.col.number": "({0}, {1})", + "problems.tree.aria.label.resource": "{0} {1} problémával", + "problems.tree.aria.label.error.marker": "{0} által generált hiba: {1}, sor: {2}, oszlop: {3}", + "problems.tree.aria.label.error.marker.nosource": "Hiba: {0}, sor: {1}, oszlop: {2}", + "problems.tree.aria.label.warning.marker": "{0} által generált figyelmeztetés: {1}, sor: {2}, oszlop: {3}", + "problems.tree.aria.label.warning.marker.nosource": "Figyelmeztetés: {0}, sor: {1}, oszlop: {2}", + "problems.tree.aria.label.info.marker": "{0} által generált információ: {1}, sor: {2}, oszlop: {3}", + "problems.tree.aria.label.info.marker.nosource": "Információ: {0}, sor: {1}, oszlop: {2}", + "problems.tree.aria.label.marker": "{0} által generált probléma: {1}, sor: {2}, oszlop: {3}", + "problems.tree.aria.label.marker.nosource": "Probléma: {0}, sor: {1}, oszlop: {2}", + "errors.warnings.show.label": "Hibák és figyelmezetések megjelenítése" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/markers/electron-browser/markersElectronContributions.i18n.json b/i18n/hun/src/vs/workbench/parts/markers/electron-browser/markersElectronContributions.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..ef6d4a9d7dbf3c7b539b2fc4ca8437383f017a4c --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/markers/electron-browser/markersElectronContributions.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "copyMarker": "Másolás" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/nps/electron-browser/nps.contribution.i18n.json b/i18n/hun/src/vs/workbench/parts/nps/electron-browser/nps.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..bd0a0d1969614582e69920ed4a988b7596c6c40e --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/nps/electron-browser/nps.contribution.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "surveyQuestion": "Lenne kedve egy gyors elégedettségi felméréshez?", + "takeSurvey": "Felmérés kitöltése", + "remindLater": "Emlékeztessen később", + "neverAgain": "Ne jelenjen meg újra" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/output/browser/output.contribution.i18n.json b/i18n/hun/src/vs/workbench/parts/output/browser/output.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..06381af2f689200b13bc757f6a1a6ef2c129196c --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/output/browser/output.contribution.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "output": "Kimenet", + "viewCategory": "Nézet", + "clearOutput.label": "Kimenet törlése" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/output/browser/outputActions.i18n.json b/i18n/hun/src/vs/workbench/parts/output/browser/outputActions.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..fb409d189e4016a3116caf4c789a474d68af1147 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/output/browser/outputActions.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "toggleOutput": "Kimenet be- és kikapcsolása", + "clearOutput": "Kimenet törlése", + "toggleOutputScrollLock": "Kimenet görgetési zárának be- és kikapcsolása", + "switchToOutput.label": "Váltás a kimenetre" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/output/browser/outputPanel.i18n.json b/i18n/hun/src/vs/workbench/parts/output/browser/outputPanel.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..b91026689822621b594d5de7b18195a91995d13d --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/output/browser/outputPanel.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "outputPanelWithInputAriaLabel": "{0}, kimenetpanel", + "outputPanelAriaLabel": "Kimenetpanel" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/output/common/output.i18n.json b/i18n/hun/src/vs/workbench/parts/output/common/output.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..6d78e77e5ec6857f3d3e481e52f3af23f0b6280e --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/output/common/output.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "output": "Kimenet", + "channel": "a következőhöz: '{0}'" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json b/i18n/hun/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..497bbff0b892de7fa3eecbbe02fdcfff51a0e253 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "slow": "Lassú indulás érzékelve", + "slow.detail": "Sajnáljuk, hogy lassú volt az alkalmazás indulása. Indítsa újra a(z) '{0}' alkalmazást bekapcsolt profilozással, ossza meg a profilt velünk, és keményen fogunk dolgozni azon, hogy az indulás ismét gyors legyen.", + "prof.message": "Profil sikeresen elkészítve.", + "prof.detail": "Készítsen egy hibajelentést, és manuálisan csatolja a következő fájlokat:\n{0}", + "prof.restartAndFileIssue": "Hibajelentés létrehozása és újraindítás", + "prof.restart": "Újraindítás", + "prof.thanks": "Köszönjük a segítséget!", + "prof.detail.restart": "Egy utolsó újraindítás szükséges a(z) '{0}' használatához. Ismételten köszönjük a közreműködését!" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/preferences/browser/keybindingWidgets.i18n.json b/i18n/hun/src/vs/workbench/parts/preferences/browser/keybindingWidgets.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..f660711dc6b6d3cd80a30321c7ba468c270ab689 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/preferences/browser/keybindingWidgets.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "defineKeybinding.initial": "Üsse le a kívánt billentyűkombinációt, majd nyomjon ENTER-t. ESCAPE a megszakításhoz.", + "defineKeybinding.chordsTo": "kombináció a következőhöz:" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/preferences/browser/keybindingsEditor.i18n.json b/i18n/hun/src/vs/workbench/parts/preferences/browser/keybindingsEditor.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..1e432a804192abbcdb68f081b4d112bf77199cdb --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/preferences/browser/keybindingsEditor.i18n.json @@ -0,0 +1,35 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "keybindingsInputName": "Billentyűparancsok", + "SearchKeybindings.AriaLabel": "Billentyűparancsok keresése", + "SearchKeybindings.Placeholder": "Billentyűparancsok keresése", + "sortByPrecedene": "Rendezés precedencia szerint", + "header-message": "Haladó beállításokhoz nyissa meg és szerkessze a következőt:", + "keybindings-file-name": "keybindings.json", + "keybindingsLabel": "Billentyűparancsok", + "changeLabel": "Billentyűparancs módosítása", + "addLabel": "Billentyűparancs hozzáadása", + "removeLabel": "Billentyűparancs eltávolítása", + "resetLabel": "Billentyűparancs visszaállítása", + "showConflictsLabel": "Konfliktusok megjelenítése", + "copyLabel": "Másolás", + "error": "'{0}' hiba a billentyűparancsok szerkesztése közben. Nyissa meg a 'keybindings.json' fájlt, és ellenőrizze!", + "command": "Parancs", + "keybinding": "Billentyűparancs", + "source": "Forrás", + "when": "Mikor?", + "editKeybindingLabelWithKey": "{0} billentyűparancs módosítása", + "editKeybindingLabel": "Billentyűparancs módosítása", + "addKeybindingLabelWithKey": "{0} billentyűparancs hozzáadása", + "addKeybindingLabel": "Billentyűparancs hozzáadása", + "commandAriaLabel": "Parancs: {0}.", + "keybindingAriaLabel": "Billentyűparancs: {0}.", + "noKeybinding": "Nincs billentyűparancs hozzárendelve.", + "sourceAriaLabel": "Forrás: {0}.", + "whenAriaLabel": "Mikor: {0}.", + "noWhen": "Nincs 'mikor'-kontextus." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/preferences/browser/keybindingsEditorContribution.i18n.json b/i18n/hun/src/vs/workbench/parts/preferences/browser/keybindingsEditorContribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..bce5ff41424bd5e1dd5246c8dcfaca14a8efb4a6 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/preferences/browser/keybindingsEditorContribution.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "defineKeybinding.start": "Billentyűparancs megadása", + "defineKeybinding.kbLayoutErrorMessage": "A jelenlegi billentyűkiosztással nem használható ez a billentyűkombináció.", + "defineKeybinding.kbLayoutLocalAndUSMessage": "**{0}** a jelenlegi billentyűkiosztással (**{1}** az alapértelmezett amerikaival.", + "defineKeybinding.kbLayoutLocalMessage": "**{0}** a jelenlegi billentyűkiosztással." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/preferences/browser/preferences.contribution.i18n.json b/i18n/hun/src/vs/workbench/parts/preferences/browser/preferences.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..b2ceafc3869aaccfb67a82755f4352565e2c0188 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/preferences/browser/preferences.contribution.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "defaultPreferencesEditor": "Alapértelmezett beállításszerkesztő", + "keybindingsEditor": "Billentyűparancs-szerkesztő", + "preferences": "Beállítások" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/preferences/browser/preferencesActions.i18n.json b/i18n/hun/src/vs/workbench/parts/preferences/browser/preferencesActions.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..6b0c1dfa1dace97169d79b1f7f26a36cbb57aa81 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/preferences/browser/preferencesActions.i18n.json @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "openGlobalSettings": "Felhasználói beállítások megnyitása", + "openGlobalKeybindings": "Billentyűparancsok megnyitása", + "openGlobalKeybindingsFile": "Billentyűparancsfájl megnyitása", + "openWorkspaceSettings": "Munkaterület beállításainak megnyitása", + "configureLanguageBasedSettings": "Nyelvspecifikus beállítások konfigurálása...", + "languageDescriptionConfigured": "(({0})", + "pickLanguage": "Nyelv kiválasztása" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/preferences/browser/preferencesEditor.i18n.json b/i18n/hun/src/vs/workbench/parts/preferences/browser/preferencesEditor.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..f06c901c35494ed5bd702925d74b91ceb5bc111a --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/preferences/browser/preferencesEditor.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "settingsEditorName": "Alapértelmezett beállítások", + "SearchSettingsWidget.AriaLabel": "Beállítások keresése", + "SearchSettingsWidget.Placeholder": "Beállítások keresése", + "totalSettingsMessage": "Összesen {0} beállítás", + "noSettingsFound": "Nincs eredmény", + "oneSettingFound": "1 illeszkedő beállítás", + "settingsFound": "{0} illeszkedő beállítás", + "preferencesAriaLabel": "Az alapértelmezett beállítások. Írásvédett szerkesztőablak." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/preferences/browser/preferencesRenderers.i18n.json b/i18n/hun/src/vs/workbench/parts/preferences/browser/preferencesRenderers.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..961013af48103aa2eaeacd11d56647e0aefdb0aa --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/preferences/browser/preferencesRenderers.i18n.json @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "errorInvalidConfiguration": "Nem sikerült írni a beállításokba. Javítsa a fájlban található hibákat/figyelmeztetéseket, majd próbálja újra!", + "editTtile": "Szerkesztés", + "replaceDefaultValue": "Csere a beállításokban", + "copyDefaultValue": "Másolás a beállításokba", + "unsupportedPHPExecutablePathSetting": "Ez a beállítás csak a felhasználói beállításokban szerepelhet. A PHP munkaterülethez történő konfigurálásához nyisson meg egy PHP-fájlt, majd kattintson a PHP-elérési útra az állapotsoron!", + "unsupportedWorkspaceSetting": "Ez a beállítás csak a felhasználói beállításokban szerepelhet." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/preferences/browser/preferencesService.i18n.json b/i18n/hun/src/vs/workbench/parts/preferences/browser/preferencesService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..a7800d606fb5d282e18f9ca34b211b11d98afe83 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/preferences/browser/preferencesService.i18n.json @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "openFolderFirst": "Munkaterületspecifikus beállítások létrehozásához nyisson meg egy mappát", + "emptyKeybindingsHeader": "Az ebben a fájlban elhelyezett billentyűparancsok felülírják az alapértelmezett beállításokat", + "defaultKeybindings": "Alapértelmezett billentyűparancsok", + "emptySettingsHeader": "Az ebben a fájlban elhelyezett beállítások felülírják az alapértelmezett beállításokat", + "emptySettingsHeader1": "Az ebben a fájlban elhelyezett beállítások felülírják az alapértelmezett és felhasználói beállításokat", + "fail.createSettings": "Nem sikerült a(z) '{0}' létrehozás ({1})." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/preferences/browser/preferencesWidgets.i18n.json b/i18n/hun/src/vs/workbench/parts/preferences/browser/preferencesWidgets.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..b2d1254fb58afd113be8ca8d064defe5cbf7ac00 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/preferences/browser/preferencesWidgets.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "settingsSwitcherBarAriaLabel": "Beállításkapcsoló", + "userSettings": "Felhasználói beállítások", + "workspaceSettings": "Munkaterület-beállítások" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/preferences/common/keybindingsEditorModel.i18n.json b/i18n/hun/src/vs/workbench/parts/preferences/common/keybindingsEditorModel.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..8fb1c62719267ace54e9f93cae40a0a62ce9fda5 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/preferences/common/keybindingsEditorModel.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "default": "Alapértelmezett", + "user": "Felhasználói", + "meta": "meta", + "option": "beállítás" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/preferences/common/preferencesModels.i18n.json b/i18n/hun/src/vs/workbench/parts/preferences/common/preferencesModels.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..35cc39622d0b228bc74bd668bd12c257a3928b0f --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/preferences/common/preferencesModels.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "commonlyUsed": "Gyakran használt", + "defaultKeybindingsHeader": "A billentyűparancsok fájlban elhelyezett billentyűparancsok felülírják az alapértelmezett beállításokat" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/quickopen/browser/commandsHandler.i18n.json b/i18n/hun/src/vs/workbench/parts/quickopen/browser/commandsHandler.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..41ec82c33f7218cfa3228e9b0e48bc3dad151479 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/quickopen/browser/commandsHandler.i18n.json @@ -0,0 +1,19 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "showTriggerActions": "Minden parancs megjelenítése", + "clearCommandHistory": "Parancselőzmények törlése", + "showCommands.label": "Parancskatalógus...", + "entryAriaLabelWithKey": "{0}, {1}, parancsok", + "entryAriaLabel": "{0}, parancs", + "canNotRun": "Innen nem futtatható a(z) {0} parancs.", + "actionNotEnabled": "Ebben a kontextusban nem engedélyezett a(z) {0} parancs futtatása.", + "recentlyUsed": "legutóbb használt", + "morecCommands": "további parancsok", + "commandLabel": "{0}: {1}", + "cat.title": "{0}: {1}", + "noCommandsMatching": "Parancs nem található" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/quickopen/browser/gotoLineHandler.i18n.json b/i18n/hun/src/vs/workbench/parts/quickopen/browser/gotoLineHandler.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..fca514543eac22be213b0f753c62ac9a9680e365 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/quickopen/browser/gotoLineHandler.i18n.json @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "gotoLine": "Sor megkeresése...", + "gotoLineLabelEmptyWithLimit": "A keresett sor 1 és {0} közötti sorszáma", + "gotoLineLabelEmpty": "A keresett sor száma", + "gotoLineColumnLabel": "Ugrás a(z) {0}. sor {1}. oszlopára", + "gotoLineLabel": "Sor megkeresése {0}", + "gotoLineHandlerAriaLabel": "Adja meg a keresett sor számát!", + "cannotRunGotoLine": "Sor megkereséséhez nyisson meg egy fájlt" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/quickopen/browser/gotoSymbolHandler.i18n.json b/i18n/hun/src/vs/workbench/parts/quickopen/browser/gotoSymbolHandler.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..25da1f31b6b8be0a2ff78f6ba74f58e22c95f9ec --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/quickopen/browser/gotoSymbolHandler.i18n.json @@ -0,0 +1,34 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "gotoSymbol": "Ugrás szimbólumhoz egy fájlban...", + "symbols": "szimbólumok ({0})", + "method": "metódusok ({0})", + "function": "függvények ({0})", + "_constructor": "konstruktorok ({0})", + "variable": "változók ({0})", + "class": "osztályok ({0})", + "interface": "interfészek ({0})", + "namespace": "névterek ({0})", + "package": "csomagok ({0})", + "modules": "modulok ({0})", + "property": "tulajdonságok ({0})", + "enum": "enumerátorok ({0n)", + "string": "karakterláncok ({0})", + "rule": "szabályok ({0})", + "file": "fájlok ({0})", + "array": "tömbök ({0})", + "number": "számok ({0})", + "boolean": "logikai értékek ({0})", + "object": "objektumok ({0})", + "key": "kulcsok ({0})", + "entryAriaLabel": "{0}, szimbólumok", + "noSymbolsMatching": "Nincs illeszkedő szimbólum", + "noSymbolsFound": "Szimbólum nem található", + "gotoSymbolHandlerAriaLabel": "Írjon az aktív szerkesztőablakban található szimbólumok szűréséhez.", + "cannotRunGotoSymbolInFile": "Ehhez a fájlhoz nincs szimbóluminformáció", + "cannotRunGotoSymbol": "Szimbólum megkereséséhez nyisson meg egy szövegfájlt" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/quickopen/browser/helpHandler.i18n.json b/i18n/hun/src/vs/workbench/parts/quickopen/browser/helpHandler.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..3b68e8685326500524e788852c98a9fde82f477f --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/quickopen/browser/helpHandler.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "entryAriaLabel": "{0}, választó súgó", + "globalCommands": "globális parancsok", + "editorCommands": "szerkesztőablak parancsai" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/quickopen/browser/quickopen.contribution.i18n.json b/i18n/hun/src/vs/workbench/parts/quickopen/browser/quickopen.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..7e61210cdf735b07d4eb51ee7fd095eafb87752f --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/quickopen/browser/quickopen.contribution.i18n.json @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "commandsHandlerDescriptionDefault": "Parancsok megjelenítése és futtatása", + "gotoLineDescriptionMac": "Sor megkeresése", + "gotoLineDescriptionWin": "Sor megkeresése", + "gotoSymbolDescription": "Ugrás szimbólumhoz egy fájlban...", + "gotoSymbolDescriptionScoped": "Szimbólum megkeresése kategória alapján", + "helpDescription": "Súgó megjelenítése", + "viewPickerDescription": "Nézet megnyitása" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/quickopen/browser/viewPickerHandler.i18n.json b/i18n/hun/src/vs/workbench/parts/quickopen/browser/viewPickerHandler.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..955a8d6a1ececafed85ec168984fcf2f26d02784 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/quickopen/browser/viewPickerHandler.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "entryAriaLabel": "{0}, nézetválasztó", + "views": "Nézetek", + "panels": "Panelek", + "terminals": "Terminál", + "terminalTitle": "{0}: {1}", + "channels": "Kimenet", + "openView": "Nézet megnyitása", + "quickOpenView": "Gyors megnyitás nézet" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.i18n.json b/i18n/hun/src/vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..757fd45ffecbdc8cd466f5b11593ea6ab5071578 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "relaunchMessage": "Egy olyan beállítás változott, melynek hatályba lépéséhez újraindítás szükséges.", + "relaunchDetail": "A beállítás engedélyezéséhez nyomja meg az újraindítás gombot a {0} újraindításához.", + "restart": "Újraindítás" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.i18n.json b/i18n/hun/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..088f4ecdf17398fe6e5960475b16e286273adbc1 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "editorGutterModifiedBackground": "A szerkesztőablak margójának háttérszíne a módosított soroknál.", + "editorGutterAddedBackground": "A szerkesztőablak margójának háttérszíne a hozzáadott soroknál.", + "editorGutterDeletedBackground": "A szerkesztőablak margójának háttérszíne a törölt soroknál." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/scm/electron-browser/scm.contribution.i18n.json b/i18n/hun/src/vs/workbench/parts/scm/electron-browser/scm.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..fd2863510afd56f94e9d869faf5007ef8a37c2a3 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/scm/electron-browser/scm.contribution.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "toggleGitViewlet": "Git megjelenítése", + "installAdditionalSCMProviders": "További verziókezelő rendszerek telepítése...", + "source control": "Verziókezelő rendszer", + "toggleSCMViewlet": "Verziókezelő megjelenítése", + "view": "Nézet" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/scm/electron-browser/scmActivity.i18n.json b/i18n/hun/src/vs/workbench/parts/scm/electron-browser/scmActivity.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..89a9d4e2341c4944e165ef6b02b3282b837a0f49 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/scm/electron-browser/scmActivity.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "scmPendingChangesBadge": "{0} függőben lévő módosítás" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/scm/electron-browser/scmMenus.i18n.json b/i18n/hun/src/vs/workbench/parts/scm/electron-browser/scmMenus.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..a7af703f9fc29e73e4b1877c84a69ac8069fdb1c --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/scm/electron-browser/scmMenus.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "installAdditionalSCMProviders": "További verziókezelő rendszerek telepítése...", + "switch provider": "Váltás más verziókezelő rendszerre..." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/scm/electron-browser/scmViewlet.i18n.json b/i18n/hun/src/vs/workbench/parts/scm/electron-browser/scmViewlet.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..529d2491ca21ff8f7a5db6e232273461c28bcab1 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/scm/electron-browser/scmViewlet.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "commitMessage": "Üzenet (nyomja meg a következőt a commithoz: {0})", + "source control": "Verziókezelő rendszer", + "viewletTitle": "{0}: {1}" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/search/browser/openAnythingHandler.i18n.json b/i18n/hun/src/vs/workbench/parts/search/browser/openAnythingHandler.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..20f5e1c646aa906687e1f7072744bcaef75906f0 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/search/browser/openAnythingHandler.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "fileAndTypeResults": "fájl- és szimbólumkeresés eredménye", + "fileResults": "fájlkeresés eredménye" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/search/browser/openFileHandler.i18n.json b/i18n/hun/src/vs/workbench/parts/search/browser/openFileHandler.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..39b05feed4f2dcef606e718d054d9a80a5a03111 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/search/browser/openFileHandler.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "entryAriaLabel": "{0}, fájlválasztó", + "searchResults": "keresési eredmények" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/search/browser/openSymbolHandler.i18n.json b/i18n/hun/src/vs/workbench/parts/search/browser/openSymbolHandler.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..a8dd776594b111ba88c699f3f5ae1f2e035ecdaa --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/search/browser/openSymbolHandler.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "entryAriaLabel": "{0}, szimbólumválasztó", + "symbols": "szimbólumkeresési eredmények", + "noSymbolsMatching": "Nincs illeszkedő szimbólum", + "noSymbolsWithoutInput": "Adja meg a keresett szimbólumot" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/search/browser/patternInputWidget.i18n.json b/i18n/hun/src/vs/workbench/parts/search/browser/patternInputWidget.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..0f499bf29572c7d86521cc72a7af20ca4764d7d0 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/search/browser/patternInputWidget.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "defaultLabel": "bemeneti adat", + "patternDescription": "Globális minták használata", + "patternHelpInclude": "Az illesztéshez használt minta. Pl. **\\*\\*/*.js** használható az összes JavaScript-fájl, vagy a **myFolder/\\*\\*** egy adott mappa és a benne található összes fájl illesztéséhez.\n\n**Referencia**:\n**\\*** 0 vagy több karakterre illeszkedik\n**?** 1 karakterre illeszkedik\n**\\*\\*** 0 vagy több könyvtárra illeszkedik\n**[a-z]** karakterek tartományára illeszkedik\n**{a,b}** a megadott minták bármelyikére illeszkedik", + "useIgnoreFilesDescription": "Ignore-fájlok használata", + "useExcludeSettingsDescription": "Kizárási beállítások használata" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/search/browser/replaceService.i18n.json b/i18n/hun/src/vs/workbench/parts/search/browser/replaceService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..7825dc551c078c7a1018abdc3f2d84e0b0b6f60f --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/search/browser/replaceService.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "fileReplaceChanges": "{0} ↔ {1} (csere előnézete)" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/search/browser/search.contribution.i18n.json b/i18n/hun/src/vs/workbench/parts/search/browser/search.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..47387e215d88a7991ad56872fd7df9b045487de4 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/search/browser/search.contribution.i18n.json @@ -0,0 +1,22 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "showTriggerActions": "Szimbólum megkeresése a munkaterületen...", + "name": "Keresés", + "showSearchViewlet": "Keresés megjelenítése", + "view": "Nézet", + "findInFiles": "Keresés a fájlokban", + "openAnythingHandlerDescription": "Fájl megkeresése", + "openSymbolDescriptionNormal": "Szimbólum megkeresése a munkaterületen", + "searchOutputChannelTitle": "Keresés", + "searchConfigurationTitle": "Keresés", + "exclude": "Globális minták konfigurálása fájlok és mappák keresésből való kizárásához. Örökli az összes globális mintát a fliex.exclude beállításból.", + "exclude.boolean": "A globális minta, amire illesztve lesznek a fájlok elérési útjai. A minta engedélyezéséhez vagy letiltásához állítsa igaz vagy hamis értékre.", + "exclude.when": "További ellenőrzés elvégzése az illeszkedő fájlok testvérein. Az illeszkedő fájl nevéhez használja a $(basename) változót!", + "useRipgrep": "Meghatározza, hogy a szövegben való kereséshez a ripgrep van-e használva.", + "useIgnoreFilesByDefault": "Meghatározza, hogy a .gitignore és .ignore fájlok használva vannak-e az új munkaterületeken a kereséshez.", + "search.quickOpen.includeSymbols": "Meghatározza, hogy a fájlok gyors megnyitásánál megjelenjenek-e a globális szimbólumkereső találatai." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/search/browser/searchActions.i18n.json b/i18n/hun/src/vs/workbench/parts/search/browser/searchActions.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..11ab7f2e40ec030a396b0ee0aa20929d1fa6746f --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/search/browser/searchActions.i18n.json @@ -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. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "nextSearchTerm": "Következő keresőkifejezés megjelenítése", + "previousSearchTerm": "Előző keresőkifejezés megjelenítése", + "focusNextInputBox": "Váltás a következő beviteli mezőre", + "focusPreviousInputBox": "Váltás az előző beviteli mezőre", + "replaceInFiles": "Csere a fájlokban", + "findInFolder": "Keresés mappában", + "RefreshAction.label": "Frissítés", + "ClearSearchResultsAction.label": "Keresési eredmények törlése", + "FocusNextSearchResult.label": "Váltás a következő keresési eredményre", + "FocusPreviousSearchResult.label": "Váltás az előző keresési eredményre", + "RemoveAction.label": "Eltávolítás", + "file.replaceAll.label": "Összes cseréje", + "match.replace.label": "Csere", + "ConfigureGlobalExclusionsAction.label": "Beállítások megnyitása" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json b/i18n/hun/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..d0aadbe17bcf446f76d5fcf93646bd780daeb452 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "searchMatches": "{0} találat", + "searchMatch": "{0} találat", + "fileMatchAriaLabel": "{0} találat a(z) {2} mappa {1} fájljában. Keresési eredmény", + "replacePreviewResultAria": "{0} kifejezés cseréje a következőre: {1}, a(z) {2}. oszlopban, a következő szöveget tartalmazó sorban: {3}", + "searchResultAria": "Találat a(z) {0} kifejezésre a(z) {1}. oszlopban, a következő szöveget tartalmazó sorban: {2}" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/search/browser/searchViewlet.i18n.json b/i18n/hun/src/vs/workbench/parts/search/browser/searchViewlet.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..d97ee9906db8ec84c776260de0a59a1c2fdc99e5 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/search/browser/searchViewlet.i18n.json @@ -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. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "moreSearch": "Keresési részletek be- és kikapcsolása", + "searchScope.includes": "bele foglalt fájlok", + "label.includes": "Keresésbe bele foglalt fájlok", + "searchScope.excludes": "kizárt fájlok", + "label.excludes": "Keresésből kizárt fájlok", + "global.searchScope.folders": "keresésből a beállítások miatt kizárt fájlok", + "label.global.excludes": "Beállított keresésből kizáró minták", + "replaceAll.confirmation.title": "Minden előfordulás cseréje", + "replaceAll.confirm.button": "Csere", + "replaceAll.occurrence.file.message": "{0} előfordulás cserélve {1} fájlban a következőre: '{2}'.", + "removeAll.occurrence.file.message": "{0} előfordulás cserélve {1} fájlban.", + "replaceAll.occurrence.files.message": "{0} előfordulás cserélve {1} fájlban a következőre: '{2}'.", + "removeAll.occurrence.files.message": "{0} előfordulás cserélve {1} fájlban.", + "replaceAll.occurrences.file.message": "{0} előfordulás cserélve {1} fájlban a következőre: '{2}'.", + "removeAll.occurrences.file.message": "{0} előfordulás cserélve {1} fájlban.", + "replaceAll.occurrences.files.message": "{0} előfordulás cserélve {1} fájlban a következőre: '{2}'.", + "removeAll.occurrences.files.message": "{0} előfordulás cserélve {1} fájlban.", + "removeAll.occurrence.file.confirmation.message": "Cserél {0} előfordulás {1} fájlban a következőre: '{2}'?", + "replaceAll.occurrence.file.confirmation.message": "Cserél {0} előfordulást {1} fájlban?", + "removeAll.occurrence.files.confirmation.message": "Cserél {0} előfordulás {1} fájlban a következőre: '{2}'?", + "replaceAll.occurrence.files.confirmation.message": "Cserél {0} előfordulást {1} fájlban?", + "removeAll.occurrences.file.confirmation.message": "Cserél {0} előfordulás {1} fájlban a következőre: '{2}'?", + "replaceAll.occurrences.file.confirmation.message": "Cserél {0} előfordulást {1} fájlban?", + "removeAll.occurrences.files.confirmation.message": "Cserél {0} előfordulás {1} fájlban a következőre: '{2}'?", + "replaceAll.occurrences.files.confirmation.message": "Cserél {0} előfordulást {1} fájlban?", + "treeAriaLabel": "Keresési eredmények", + "globLabel": "{0}, ha {1}", + "searchMaxResultsWarning": "Az eredményhalmaz csak a találatok egy részét tartalmazza. Pontosítsa a keresést a keresési eredmények halmazának szűkítéséhez!", + "searchCanceled": "A keresés meg lett szakítva, mielőtt eredményt hozott volna –", + "noResultsIncludesExcludes": "Nincs találat a következő helyen: '{0}', '{1}' kivételével –", + "noResultsIncludes": "Nincs találat a következő helyen: '{0}' –", + "noResultsExcludes": "Nincs találat '{1}' kivételével –", + "noResultsFound": "Nincs találat. Ellenőrizze a kizárási beállításokat –", + "rerunSearch.message": "Keresés megismétlése", + "rerunSearchInAll.message": "Keresés megismétlése az összes fájlban", + "openSettings.message": "Beállítások megnyitása", + "ariaSearchResultsStatus": "A keresés {0} találatot eredményezett {1} fájlban", + "search.file.result": "{0} találat {1} fájlban", + "search.files.result": "{0} találat {1} fájlban", + "search.file.results": "{0} találat {1} fájlban", + "search.files.results": "{0} találat {1} fájlban", + "searchWithoutFolder": "Még nincs mappa megnyitva. Jelenleg csak a nyitott fájlokban történik keresés –", + "openFolder": "Mappa megnyitása" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/search/browser/searchWidget.i18n.json b/i18n/hun/src/vs/workbench/parts/search/browser/searchWidget.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..1bc0f722bcd2f8505c0988d10e7aa9c2cfaaa47f --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/search/browser/searchWidget.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "search.action.replaceAll.disabled.label": "Összes cseréje (küldje el a keresést az engedélyezéshez)", + "search.action.replaceAll.enabled.label": "Összes cseréje", + "search.replace.toggle.button.title": "Cseremd be- és kikapcsolása", + "label.Search": "Keresés: adja meg a keresőkifejezést, majd nyomjon Entert a kereséshez vagy Escape-et a megszakításhoz", + "search.placeHolder": "Keresés", + "label.Replace": "Csere: adja meg a cerekifejezést, majd nyomjon Entert a kereséshez vagy Escape-et a megszakításhoz", + "search.replace.placeHolder": "Csere", + "regexp.validationFailure": "A kifejezés mindenre illeszkedik" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/snippets/electron-browser/TMSnippets.i18n.json b/i18n/hun/src/vs/workbench/parts/snippets/electron-browser/TMSnippets.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..161e797da75ac97889ecb2723f77e8d82e73f3f9 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/snippets/electron-browser/TMSnippets.i18n.json @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "vscode.extension.contributes.snippets": "Kódrészleteket szolgáltat.", + "vscode.extension.contributes.snippets-language": "Azon nyelv azonosítója, amely számára szolgáltatva van ez a kódrészlet.", + "vscode.extension.contributes.snippets-path": "A kódrészlet-fájl elérési útja. Az elérési út relatív a kiegészítő mappájához, és általában a következővel kezdődik: './snippets/',", + "invalid.language": "Ismeretlen nyelv található a következőben: `contributes.{0}.language`. A megadott érték: {1}", + "invalid.path.0": "Hiányzó karakterlánc a `contributes.{0}.path`-ban. A megadott érték: {1}", + "invalid.path.1": "A `contributes.{0}.path` ({1}) nem a kiegészítő mappáján belül található ({2}). Emiatt előfordulhat, hogy a kiegészítő nem lesz hordozható.", + "badVariableUse": "A(z) \"{0}\" kódrészlet nagy valószínűséggel keveri a kódrészletváltozók és a kódrészlet-helyjelölők fogalmát. További információ a következő oldalon található: https://code.visualstudio.com/docs/editor/userdefinedsnippets#_snippet-syntax" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/snippets/electron-browser/insertSnippet.i18n.json b/i18n/hun/src/vs/workbench/parts/snippets/electron-browser/insertSnippet.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..8a772b4496230f1d2bfa1590c0be58b65e570e61 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/snippets/electron-browser/insertSnippet.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "snippet.suggestions.label": "Kódrészlet beszúrása" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/snippets/electron-browser/snippets.contribution.i18n.json b/i18n/hun/src/vs/workbench/parts/snippets/electron-browser/snippets.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..b0d1519ec90822410543240bf9b8c42fd2372cbb --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/snippets/electron-browser/snippets.contribution.i18n.json @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "openSnippet.label": "Felhasználói kódrészletek megnyitása", + "openSnippet.pickLanguage": "Kódrészlet nyelvének kiválasztása", + "openSnippet.errorOnCreate": "A(z) {0} nem hozható létre", + "preferences": "Beállítások", + "snippetSchema.json.default": "Üres kódrészlet", + "snippetSchema.json": "Felhasználói kódrészlet-konfiguráció", + "snippetSchema.json.prefix": "A kódrészlet IntelliSense-ben történő kiválasztásánál használt előtag", + "snippetSchema.json.body": "A kódrészlet tartalma. Kurzorpozíciók definiálásához használja a '$1' és '${1:defaultText}' jelölőket, a '$0' pedig a végső kurzorpozíció. Változónevek a '${varName}' és '${varName:defaultText}' formában definiálhatók, pl.: 'Ez a fájl: $TM_FILENAME'.", + "snippetSchema.json.description": "A kódrészlet leírása" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/snippets/electron-browser/snippetsService.i18n.json b/i18n/hun/src/vs/workbench/parts/snippets/electron-browser/snippetsService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..eff0054bfb52650fd31dbe236b47f0b362b64f4c --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/snippets/electron-browser/snippetsService.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "detail.userSnippet": "Felhasználói kódrészlet", + "snippetSuggest.longLabel": "{0}, {1}" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/snippets/electron-browser/tabCompletion.i18n.json b/i18n/hun/src/vs/workbench/parts/snippets/electron-browser/tabCompletion.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..0e84caff00bc57fb15224f442354b0eb1bb47920 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/snippets/electron-browser/tabCompletion.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "tabCompletion": "Kódrészletek beszúrása, ha az előtagjuk illeszkedik. Legjobban akkor működik, ha a 'quickSuggestions' nincs engedélyezve." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/surveys/electron-browser/languageSurveys.contribution.i18n.json b/i18n/hun/src/vs/workbench/parts/surveys/electron-browser/languageSurveys.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..9ed5e0feacca5436965b5a3e731509564af9726e --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/surveys/electron-browser/languageSurveys.contribution.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "helpUs": "Segítsen javítani a {0}-támogatásunkat", + "takeShortSurvey": "Rövid felmérés kitöltése", + "remindLater": "Emlékeztessen később", + "neverAgain": "Ne jelenítse meg újra" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/surveys/electron-browser/nps.contribution.i18n.json b/i18n/hun/src/vs/workbench/parts/surveys/electron-browser/nps.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..b4f41dcbe89a85ebc66fa09d78b3fa289ea45427 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/surveys/electron-browser/nps.contribution.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "surveyQuestion": "Lenne kedve egy gyors elégedettségi felméréshez?", + "takeSurvey": "Felmérés kitöltése", + "remindLater": "Emlékeztessen később", + "neverAgain": "Ne jelenítse meg újra" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/tasks/browser/buildQuickOpen.i18n.json b/i18n/hun/src/vs/workbench/parts/tasks/browser/buildQuickOpen.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..014090555b3d0cb33b9ba12f4b029d382b2e613e --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/tasks/browser/buildQuickOpen.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "tasksAriaLabel": "Adja meg a buildelési feladat nevét!", + "noTasksMatching": "Nincs ilyen feladat", + "noTasksFound": "Buildelési feladat nem található" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/tasks/browser/quickOpen.i18n.json b/i18n/hun/src/vs/workbench/parts/tasks/browser/quickOpen.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..f6eaf1f370f4edbf4c511a66270f80db04ac6029 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/tasks/browser/quickOpen.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "entryAriaLabel": "{0}, feladatok", + "customizeTask": "Feladat testreszabása" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/tasks/browser/restartQuickOpen.i18n.json b/i18n/hun/src/vs/workbench/parts/tasks/browser/restartQuickOpen.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..dad5b6db3e881998185a130f7343df8969631bdf --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/tasks/browser/restartQuickOpen.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "tasksAriaLabel": "Adja meg az újraindítandó feladat nevét!", + "noTasksMatching": "Nincs ilyen feladat", + "noTasksFound": "Újraindítandó feladat nem található" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/tasks/browser/taskQuickOpen.i18n.json b/i18n/hun/src/vs/workbench/parts/tasks/browser/taskQuickOpen.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..4b81a1db7741c52e9914342b7bef3bfa4484238d --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/tasks/browser/taskQuickOpen.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "tasksAriaLabel": "Adja meg a futtatandó feladat nevét!", + "noTasksMatching": "Nincs ilyen feladat", + "noTasksFound": "Feladat nem található" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/tasks/browser/terminateQuickOpen.i18n.json b/i18n/hun/src/vs/workbench/parts/tasks/browser/terminateQuickOpen.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..76eb0f2619dd6ec5c889f81d220cdf97ddea38a0 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/tasks/browser/terminateQuickOpen.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "tasksAriaLabel": "Adja meg a megszakítandó feladat nevét!", + "noTasksMatching": "Nincs ilyen feladat", + "noTasksFound": "Megszakítandó feladat nem található" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/tasks/browser/testQuickOpen.i18n.json b/i18n/hun/src/vs/workbench/parts/tasks/browser/testQuickOpen.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..52db1a193d3c737188e8f828af8d3b5c0a3278f2 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/tasks/browser/testQuickOpen.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "tasksAriaLabel": "Adja meg a tesztelési feladat nevét!", + "noTasksMatching": "Nincs ilyen feladat", + "noTasksFound": "Tesztelési feladat nem találhat" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/tasks/common/taskConfiguration.i18n.json b/i18n/hun/src/vs/workbench/parts/tasks/common/taskConfiguration.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..b798f4ca94f82bf8e78c8c5b4f3723f783244981 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/tasks/common/taskConfiguration.i18n.json @@ -0,0 +1,17 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "ConfigurationParser.invalidCWD": "Figyelmeztetés: az options.cwd értékének string típusúnak kell lennie. A következő érték figyelmen kívül van hagyva: {0}.", + "ConfigurationParser.noargs": "Hiba: a parancssori argumentumokat string típusú tömbként kell megadni. A megadott érték:\n{0}", + "ConfigurationParser.noShell": "Figyelmeztetés: a shellkonfiguráció csak akkor támogatott, ha a feladat a terminálban van végrehajtva.", + "ConfigurationParser.noName": "Hiba: a deklarációs hatókörben lévő problémailleszőnek kötelező nevet adni:\n{0}\n", + "ConfigurationParser.unknownMatcherKind": "Figyelem: a megadott problémaillesztő ismeretlen. A támogatott típusok: string | ProblemMatcher | (string | ProblemMatcher)[].\n{0}\n", + "ConfigurationParser.invalidVaraibleReference": "Hiba: érvénytelen problemMatcher-referencia: {0}\n", + "ConfigurationParser.noTaskName": "Hiba: a feladathoz meg kell adni a taskName tulajdonságot. A feladat figyelmen kívül lesz hagyva.\n{0}\n", + "taskConfiguration.shellArgs": "Figyelmeztetés: a(z) '{0}' feladat egy rendszerparancs, és vagy a parancs nevében vagy az argumentumok egyikében escape nélküli szóköz található. A megfelelő idézőjelezés érdekében olvassza bele az argumentumokat a parancsba.", + "taskConfiguration.noCommandOrDependsOn": "Hiba: a(z) '{0}' feladat nem ad meg parancsot, és nem definiálja a dependsOn tulajdonságot sem. A feladat figyelmen kívül lesz hagyva. A definíciója:\n{1}", + "taskConfiguration.noCommand": "Hiba: a(z) '{0}' feladathoz nincs definiálva a parancs. A feladat figyelmen kívül lesz hagyva. A definíciója:\n{1}" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/tasks/common/taskTemplates.i18n.json b/i18n/hun/src/vs/workbench/parts/tasks/common/taskTemplates.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..eb7c4006c2ec413adc90a88e0d90f7c81a4c16b0 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/tasks/common/taskTemplates.i18n.json @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "tsc.config": "Lefordít egy TypeScript-projektet", + "tsc.watch": "Lefordít egy TypeScript-projektet figyelő módban", + "dotnetCore": "Végrehajt egy .NET Core buildelési parancsot", + "msbuild": "Végrehajtja a buildelés célpontját", + "externalCommand": "Példa egy tetszőleges külső parancs futtatására", + "Maven": "Általános maven parancsokat hajt végre" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/tasks/electron-browser/jsonSchemaCommon.i18n.json b/i18n/hun/src/vs/workbench/parts/tasks/electron-browser/jsonSchemaCommon.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..5372bc32e8115db0d53f78f458eee51ad79bd9b7 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/tasks/electron-browser/jsonSchemaCommon.i18n.json @@ -0,0 +1,39 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "JsonSchema.options": "További parancsbeálíltások", + "JsonSchema.options.cwd": "A végrehajtott program vagy parancsfájl munkakönyvtára. Ha nincs megadva, akkor a Code aktuális munkaterületének gyökérkönyvtára van használva.", + "JsonSchema.options.env": "A végrehajtott parancs vagy shell környezete. Ha nincs megadva, akkor a szülőfolyamat környezete van használva.", + "JsonSchema.shellConfiguration": "Meghatározza a használt shellt.", + "JsonSchema.shell.executable": "A használt shell.", + "JsonSchema.shell.args": "Shellargumentumok.", + "JsonSchema.command": "A végrehajtandó parancs. Lehet egy külső parancs vagy egy rendszerparancs.", + "JsonSchema.tasks.args": "A parancs meghívásakor átadott argumentumok.", + "JsonSchema.tasks.taskName": "A feladat neve.", + "JsonSchema.tasks.windows": "Windows-specifikus parancskonfiguráció", + "JsonSchema.tasks.mac": "Mac-specifikus parancskonfiguráció", + "JsonSchema.tasks.linux": "Linux-specifikus parancskonfiguráció", + "JsonSchema.tasks.suppressTaskName": "Meghatározza, hogy a feladat neve hozzá van adva argumentumként a parancshoz. Ha nincs megadva, akkor a globálisan meghatározot érték van használva.", + "JsonSchema.tasks.showOutput": "Meghatározza, hogy a futó feladat kimenete meg van-e jelenítve, vagy sem. Ha nincs megadva, akkor a globálisan meghatározot érték van használva.", + "JsonSchema.echoCommand": "Meghatározza, hogy a végrehajtott parancs ki van-e írva a kimenetre. Alapértelmezett értéke hamis.", + "JsonSchema.tasks.watching.deprecation": "Elavult. Használja helyette az isBackground beállítást.", + "JsonSchema.tasks.watching": "A feladat folyamatosan fut-e és figyeli-e a fájlrendszert.", + "JsonSchema.tasks.background": "A feladat folyamatosan fut-e és a háttérben fut-e.", + "JsonSchema.tasks.promptOnClose": "A felhasználó figyelmeztetve van-e, ha a VS Code egy futó feladat közben záródik be.", + "JsonSchema.tasks.build": "A parancsot a Code alapértelmezett buildelési parancsához rendeli.", + "JsonSchema.tasks.test": "A parancsot a Code alapértelmezett tesztelési parancsához rendeli.", + "JsonSchema.tasks.matchers": "A használt problémaillesztők. Lehet karakterlánc, problémaillesztő, vagy egy tömb, ami karakterláncokat és problémaillesztőket tartalmaz.", + "JsonSchema.args": "A parancsnak átadott további argumentumok.", + "JsonSchema.showOutput": "Meghatározza, hogy a futó feladat kimenete megjelenjen-e vagy sem. Ha nincs megadva, az 'always' érték van használva.", + "JsonSchema.watching.deprecation": "Elavult. Használja helyette az isBackground beállítást.", + "JsonSchema.watching": "A feladat folyamatosan fut-e és figyeli-e a fájlrendszert.", + "JsonSchema.background": "A feladat folyamatosan fut-e és a háttérben fut-e.", + "JsonSchema.promptOnClose": "A felhasználó figyelmeztetve van-e, ha a VS Code egy háttérben futó feladat közben záródik be.", + "JsonSchema.suppressTaskName": "Meghatározza, hogy a feladat neve hozzá van adva argumentumként a parancshoz. Alapértelmezett értéke hamis.", + "JsonSchema.taskSelector": "Előtag, ami jelzi, hogy az argumentum a feladat.", + "JsonSchema.matchers": "A használt problémaillesztők. Lehet karakterlánc, problémaillesztő, vagy egy tömb, ami karakterláncokat és problémaillesztőket tartalmaz.", + "JsonSchema.tasks": "Feladatkonfigurációk. Általában egy külső feladatfuttató rendszerben definiált feladatok kiegészítő beállításokkal ellátott változatai." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v1.i18n.json b/i18n/hun/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v1.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..e288243af01ac3e6555bb85103dd127664668200 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v1.i18n.json @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "JsonSchema.version": "A konfiguráció verziószáma", + "JsonSchema._runner": "A futtató kikerült a kísérleti állapotból. Használja a hivatalos runner tulajdonságot!", + "JsonSchema.runner": "Meghatározza, hogy a feladat folyamatként van-e végrehajtva, és a kimenet a kimeneti ablakban jelenjen-e meg, vagy a terminálban.", + "JsonSchema.windows": "Windows-specifikus parancskonfiguráció", + "JsonSchema.mac": "Mac-specifikus parancskonfiguráció", + "JsonSchema.linux": "Linux-specifikus parancskonfiguráció", + "JsonSchema.shell": "Meghatározza, hogy a parancs egy rendszerparancs vagy egy külső program. Alapértelmezett értéke hamis, ha nincs megadva." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.i18n.json b/i18n/hun/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..808f2879fd91a4d248b52d01c8e022d7337fae4f --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.i18n.json @@ -0,0 +1,17 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "JsonSchema.shell": "Meghatározza, hogy a parancs egy rendszerparancs vagy egy külső program. Alapértelmezett értéke hamis, ha nincs megadva.", + "JsonSchema.tasks.dependsOn.string": "Egy másik feladat, amitől ez a feladat függ.", + "JsonSchema.tasks.dependsOn.array": "Más feladatok, amiktől ez a feladat függ.", + "JsonSchema.tasks.group": "Meghatározza a feladat végrehajtási csoportját. Ha nincs megadva, akkor a feladat nem tartozik egyetlen csoportba sem.", + "JsonSchema.tasks.type": "Meghatározza, hogy a feladat folyamatként van-e végrehajtva vagy egy parancsként a shellben. Alapértelmetten folyamatként vannak végrehajtva.", + "JsonSchema.version": "A konfiguráció verziószáma", + "JsonSchema.tasks.customize": "A szolgáltatott feladat, ami testre van szabva.", + "JsonSchema.windows": "Windows-specifikus parancskonfiguráció", + "JsonSchema.mac": "Mac-specifikus parancskonfiguráció", + "JsonSchema.linux": "Linux-specifikus parancskonfiguráció" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json b/i18n/hun/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..eb87dfa126fe358f72740871680b637d3b0736a9 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json @@ -0,0 +1,51 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "tasksCategory": "Feladatok", + "ConfigureTaskRunnerAction.noWorkspace": "A feladatok csak egy munkaterület mappájára vonatkozóan érhetők el.", + "ConfigureTaskRunnerAction.quickPick.template": "Feladatfuttató rendszer választása", + "ConfigureTaskRunnerAction.autoDetecting": "Feladatok automatikus felderítése a következőhöz: {0}", + "ConfigureTaskRunnerAction.autoDetect": "A feladatfuttató rendszer automatikus felderítése nem sikerült. Az alapértelmezett sablon használata. Tekintse meg a feladatkimenetet a részletekért.", + "ConfigureTaskRunnerAction.autoDetectError": "A feladatfuttató rendszer automatikus felderítése hibákat eredményezett. Tekintse meg a feladatkimenetet a részletekért.", + "ConfigureTaskRunnerAction.failed": "Nem sikerült létrehozni a 'tasks.json' fájlt a '.vscode' mappában. Tekintse meg a feladatkimenetet a részletekért.", + "ConfigureTaskRunnerAction.label": "Feladatfuttató rendszer beállítása", + "ConfigureBuildTaskAction.label": "Buildelési feladat beállítása", + "CloseMessageAction.label": "Bezárás", + "ShowTerminalAction.label": "Terminál megtekintése", + "problems": "Problémák", + "manyMarkers": "99+", + "tasks": "Feladatok", + "TaskSystem.noHotSwap": "A feladatvégrehajtó motor megváltoztatása a VS Code újraindítását igényli. A módosítás figyelmen kívül van hagyva.", + "TaskService.noBuildTask": "Nincs buildelési feladat definiálva. Jelöljön meg egy feladatot az 'isBuildCommand' tulajdonsággal a tasks.json fájlban.", + "TaskService.noTestTask": "Nincs tesztelési feladat definiálva. Jelöljön meg egy feladatot az 'isTestCommand' tulajdonsággal a tasks.json fájlban.", + "TaskServer.noTask": "A futtatni kívánt feladat ({0}) nem található.", + "customizeParseErrors": "A jelenlegi feladatkonfigurációban hibák vannak. Feladat egyedivé tétele előtt javítsa a hibákat!", + "moreThanOneBuildTask": "Túl sok buildelési feladat van definiálva a tasks.json-ban. Az első lesz végrehajtva.\n", + "TaskSystem.activeSame.background": "A feladat már aktív és a háttérben fut. A feladat befejezéséhez használja az `F1 > feladat megszakítása` parancsot! ", + "TaskSystem.active": "Már fut egy feladat. Szakítsa meg, mielőtt egy másik feladatot futtatna.", + "TaskSystem.restartFailed": "Nem sikerült a(z) {0} feladat befejezése és újraindítása.", + "TaskSystem.configurationErrors": "Hiba: a megadott feladatkonfigurációban validációs hibák vannak, és nem használható. Először javítsa ezeket a hibákat!", + "TaskSystem.invalidTaskJson": "Hiba. A tasks.json fájlban szintaktikai hibák találhatók. Javítsa ezeket a hibákat feladatvégrehajtás előtt.\n", + "TaskSystem.runningTask": "Már fut egy feladat. Szeretné megszakítani?", + "TaskSystem.terminateTask": "Felada&&t megszakítása", + "TaskSystem.noProcess": "Az elindított feladat már nem létezik. Ha a feladat egy háttérfolyamatot indított, a VS Code-ból való kilépés árva folyamatokat eredményezhet. Ennek megakadályozása érdekében indítsa el a legutóbbi háttérfolyamatot a wait kapcsolóval!", + "TaskSystem.exitAnyways": "Kilépés mind&&enképp", + "TerminateAction.label": "Futó feladat megszakítása", + "TaskSystem.unknownError": "Hiba történt a feladat futtatása közben. További részletek a feladatnaplóban.", + "TaskService.noWorkspace": "A feladatok csak egy munkaterület mappájára vonatkozóan érhetők el.", + "TerminateAction.noProcess": "Az elindított folyamat már nem létezik. Ha a feladat háttérfeladatokat indított, a VS Code-ból való kilépés árva folyamatokat eredményezhet. ", + "TerminateAction.failed": "Nem sikerült megszakítani a futó feladatot", + "ShowLogAction.label": "Feladatnapló megtekintése", + "RunTaskAction.label": "Feladat futtatása", + "RestartTaskAction.label": "Feladat újraindítása", + "BuildAction.label": "Buildelési feladat futtatása", + "TestAction.label": "Tesztelési feladat futtatása", + "quickOpen.task": "Feladat futtatása", + "quickOpen.terminateTask": "Feladat megszakítása", + "quickOpen.restartTask": "Feladat újraindítása", + "quickOpen.buildTask": "Buildelési feladat", + "quickOpen.testTask": "Tesztelési feladat" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.i18n.json b/i18n/hun/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..cbc547d3e4aa0f2a57295bad283ce397ea81a07a --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "TerminalTaskSystem.unknownError": "Ismeretlen hiba történt a feladat végrehajtása közben. Részletek a feladat kimeneti naplójában találhatók.", + "TerminalTaskSystem.terminalName": "Feladat – {0}", + "reuseTerminal": "A terminál újra lesz hasznosítva a feladatok által. Nyomjon meg egy billentyűt a bezáráshoz.", + "TerminalTaskSystem": "Rendszerparancsok nem hajthatók végre UNC-meghajtókon.", + "unkownProblemMatcher": "A(z) {0} problémaillesztő nem található. Az illesztő figyelmen kívül lesz hagyva." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/tasks/node/processRunnerDetector.i18n.json b/i18n/hun/src/vs/workbench/parts/tasks/node/processRunnerDetector.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..12233f706c84c903a89ac5b089a6c0e1bf1dd86f --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/tasks/node/processRunnerDetector.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "TaskSystemDetector.noGulpTasks": "A gulp --tasks-simple futtatása nem listázott egyetlen feladatot sem. Futtatta az npm install parancsot?", + "TaskSystemDetector.noJakeTasks": "A jake --tasks futtatása nem listázott egyetlen feladatot sem. Futtatta az npm install parancsot?", + "TaskSystemDetector.noGulpProgram": "A Gulp nincs telepítve a rendszerre. Futtassa az npm install -g gulp parancsot a telepítéshez!", + "TaskSystemDetector.noJakeProgram": "A Jake nincs telepítve a rendszerre. Futtassa az npm install -g jake parancsot a telepítéshez!", + "TaskSystemDetector.noGruntProgram": "A Grunt nincs telepítve a rendszerre. Futtassa az npm install -g grunt parancsot a telepítéshez!", + "TaskSystemDetector.noProgram": "Az) {0} program nem található. Az üzenet: {1}", + "TaskSystemDetector.buildTaskDetected": "'{0}' nevű build feladat észlelve.", + "TaskSystemDetector.testTaskDetected": "'{0}' nevű tesztelési feladat észlelve." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/tasks/node/processTaskSystem.i18n.json b/i18n/hun/src/vs/workbench/parts/tasks/node/processTaskSystem.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..37fca18236daaf921474c9dd4cc5072c48e85893 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/tasks/node/processTaskSystem.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "TaskRunnerSystem.unknownError": "Ismeretlen hiba történt a feladat végrehajtása közben. Részletek a kimeneti naplóban találhatók.", + "TaskRunnerSystem.watchingBuildTaskFinished": "A figyelő buildelési feladat befejeződött.", + "TaskRunnerSystem.childProcessError": "Nem sikerült elindítani a külső programot: {0} {1}.", + "TaskRunnerSystem.cancelRequested": "Az) '{0}' feladat a felhasználó kérésére lett megszakítva.", + "unkownProblemMatcher": "A(z) {0} problémaillesztőt nem lehet feloldani. Az illesztő figyelmen kívül lesz hagyva." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/terminal/electron-browser/terminal.contribution.i18n.json b/i18n/hun/src/vs/workbench/parts/terminal/electron-browser/terminal.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..47de274f4d6a56201b9af7a355a13db7188dd2fb --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/terminal/electron-browser/terminal.contribution.i18n.json @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "terminalIntegratedConfigurationTitle": "Beépített terminál", + "terminal.integrated.shell.linux": "A terminál által használt shell elérési útja Linuxon.", + "terminal.integrated.shellArgs.linux": "Linux-terminál esetén használt parancssori argumentumok.", + "terminal.integrated.shell.osx": "A terminál által használt shell elérési útja OS X-en.", + "terminal.integrated.shellArgs.osx": "OS X-terminál esetén használt parancssori argumentumok.", + "terminal.integrated.shell.windows": "A terminál által használt shell elérési útja Windowson. Ha a Windows beépített shelljét használja (cmd-t, PowerShellt vagy Bash on Ubuntut), a C:\\Windows\\sysnative elérési utat adja meg a C:\\Windows\\System32 helyett a 64-bites verzió használatához.", + "terminal.integrated.shellArgs.windows": "Windows-terminál esetén használt parancssori argumentumok.", + "terminal.integrated.rightClickCopyPaste": "Ha be van állítva, megakadályozza a helyi menü megjelenését a terminálon történő jobb kattintás esetén. Helyette másol, ha van kijelölés, és beilleszt, ha nincs.", + "terminal.integrated.fontFamily": "Meghatározza a terminál betűtípusát. Alapértelmezett értéke az editor.fontFamily értéke.", + "terminal.integrated.fontLigatures": "Meghatározza, hogy a terminálban engedélyezve vannak-e a betűtípus-ligatúrák.", + "terminal.integrated.fontSize": "Meghatározza a terminálban használt betű méretét, pixelekben.", + "terminal.integrated.lineHeight": "Meghatározza a sormagasságot a terminálban. A tényleges méret a megadott szám és a terminál betűméretének szorzatából jön ki.", + "terminal.integrated.enableBold": "Engedélyezve van-e a félkövér szöveg a terminálban. A működéshez szükséges, hogy a terminál shellje támogassa a félkövér betűket.", + "terminal.integrated.cursorBlinking": "Meghatározza, hogy a terminál kurzora villog-e.", + "terminal.integrated.cursorStyle": "Meghatározza a terminál kurzorának stílusát.", + "terminal.integrated.scrollback": "Meghatározza, hogy a terminál legfeljebb hány sort tárol a pufferben.", + "terminal.integrated.setLocaleVariables": "Meghatározza, hogy a lokálváltozók be vannak-e állítva a terminál indításánál. Alapértelmezett értéke igaz OS X-en, hamis más platformokon.", + "terminal.integrated.cwd": "Explicit elérési út, ahol a terminál indítva lesz. Ez a shellfolyamat munkakönyvtára (cwd) lesz. Ez a beállítás nagyon hasznos olyan munkaterületeken, ahol a gyökérkönyvtár nem felel meg munkakönyvtárnak.", + "terminal.integrated.confirmOnExit": "Meghatározza, hogy megerősítést kér-e az alkalamzás, ha van aktív terminál-munkafolyamat.", + "terminal.integrated.commandsToSkipShell": "Olyan parancsazonosítók listája, melyek nem lesznek elküldve a shellnek, és ehelyett mindig a Code kezeli le őket. Ez lehetővé teszi, hogy az olyan billentyűparancsok, melyeket normál esetben a shell dolgozna fel, ugyanúgy működjenek, mint mikor a terminálon nincs fókusz. Például ilyen a gyorsmegnyitás indításához használt Ctrl+P.", + "terminal": "Terminál", + "terminalCategory": "Terminál", + "viewCategory": "Nézet" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/terminal/electron-browser/terminalActions.i18n.json b/i18n/hun/src/vs/workbench/parts/terminal/electron-browser/terminalActions.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..aa97cc3e5700cf0de6e22326872b692b92eca133 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/terminal/electron-browser/terminalActions.i18n.json @@ -0,0 +1,37 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "workbench.action.terminal.toggleTerminal": "Integrált terminál be- és kikapcsolása", + "workbench.action.terminal.kill": "Az aktív terminálpéldány leállítása", + "workbench.action.terminal.kill.short": "Terminál leállítása", + "workbench.action.terminal.copySelection": "Kijelölés másolása", + "workbench.action.terminal.selectAll": "Összes kijelölése", + "workbench.action.terminal.new": "Új integrált terminál létrehozása", + "workbench.action.terminal.new.short": "Új terminál", + "workbench.action.terminal.focus": "Váltás a terminálra", + "workbench.action.terminal.focusNext": "Váltás a következő terminálra", + "workbench.action.terminal.focusAtIndex": "Váltás a(z) {0}. terminálra", + "workbench.action.terminal.focusPrevious": "Váltás az előző terminálra", + "workbench.action.terminal.paste": "Beillesztés az aktív terminálba", + "workbench.action.terminal.DefaultShell": "Alapértelmezett shell kiválasztása", + "workbench.action.terminal.runSelectedText": "Kijelölt szöveg futtatása az aktív terminálban", + "workbench.action.terminal.runActiveFile": "Aktív fájl futtatása az az aktív terminálban", + "workbench.action.terminal.runActiveFile.noFile": "Csak a lemezen lévő fájlok futtathatók a terminálban", + "workbench.action.terminal.switchTerminalInstance": "Terminálpéldány váltása", + "workbench.action.terminal.scrollDown": "Görgetés lefelé (soronként)", + "workbench.action.terminal.scrollDownPage": "Görgetés lefelé (oldalanként)", + "workbench.action.terminal.scrollToBottom": "Görgetés az aljára", + "workbench.action.terminal.scrollUp": "Görgetés felfelé (soronként)", + "workbench.action.terminal.scrollUpPage": "G9rgetés felfelé (oldalanként)", + "workbench.action.terminal.scrollToTop": "Görgetés a tetejére", + "workbench.action.terminal.clear": "Törlés", + "workbench.action.terminal.allowWorkspaceShell": "Munkaterületspecifikus shellkonfiguráció engedélyezése", + "workbench.action.terminal.disallowWorkspaceShell": "Munkaterületspecifikus shellkonfiguráció letiltása", + "workbench.action.terminal.rename": "Átnevezés", + "workbench.action.terminal.rename.prompt": "Adja meg a terminál nevét!", + "workbench.action.terminal.focusFindWidget": "Váltás a keresőmodulra", + "workbench.action.terminal.hideFindWidget": "Keresőmodul elrejtése" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/terminal/electron-browser/terminalColorRegistry.i18n.json b/i18n/hun/src/vs/workbench/parts/terminal/electron-browser/terminalColorRegistry.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..890ebc35e3d4eb436c9b9cde78cfe2a9426531fe --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/terminal/electron-browser/terminalColorRegistry.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "terminal.background": "A terminál háttérszíne. Ez lehetővé teszi a terminál paneltől eltérő színezését.", + "terminal.foreground": "A terminál előtérszíne.", + "terminal.ansiColor": "A(z) '{0}' ANSI-szín a terminálban." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/terminal/electron-browser/terminalConfigHelper.i18n.json b/i18n/hun/src/vs/workbench/parts/terminal/electron-browser/terminalConfigHelper.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..d6881142372df40ec5ad6ecea3860e328296310e --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/terminal/electron-browser/terminalConfigHelper.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "terminal.integrated.allowWorkspaceShell": "Engedélyezi a(z) {0} (a munkaterületi beállításokban definiálva) terminálról történő indítását?", + "allow": "Engedélyezés", + "disallow": "Tiltás" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/terminal/electron-browser/terminalFindWidget.i18n.json b/i18n/hun/src/vs/workbench/parts/terminal/electron-browser/terminalFindWidget.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..2d5b3af7ef7b1ee3c01034479012ee5c3b934cd0 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/terminal/electron-browser/terminalFindWidget.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "label.find": "Keresés", + "placeholder.find": "Keresés", + "label.previousMatchButton": "Előző találat", + "label.nextMatchButton": "Következő találat", + "label.closeButton": "Bezárás" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.i18n.json b/i18n/hun/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..319655fe00e2f8eeeac2a061a5a85b588ce86255 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "terminal.integrated.copySelection.noSelection": "A terminálban nincs semmi kijelölve a másoláshoz", + "terminal.integrated.exitedWithCode": "A terminálfolyamat a következő kilépési kóddal állt le: {0}", + "terminal.integrated.waitOnExit": "A folytatáshoz nyomjon meg egy billentyűt...", + "terminal.integrated.launchFailed": "A(z) `{0}{1}` terminálfolyamat-parancsot nem sikerült elindítani (kilépési kód: {2})" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/terminal/electron-browser/terminalLinkHandler.i18n.json b/i18n/hun/src/vs/workbench/parts/terminal/electron-browser/terminalLinkHandler.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..b7e7147089acbcea2a2ccbf30339f8287472f3ef --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/terminal/electron-browser/terminalLinkHandler.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "terminalLinkHandler.followLinkCmd": "Hivatkozott oldal megnyitása Cmd + kattintás paranccsal", + "terminalLinkHandler.followLinkCtrl": "Hivatkozott oldal megnyitása Ctrl + kattintás paranccsal" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/terminal/electron-browser/terminalPanel.i18n.json b/i18n/hun/src/vs/workbench/parts/terminal/electron-browser/terminalPanel.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..3b0d8ea170a7480100e3a3cd160d4f91ce953bed --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/terminal/electron-browser/terminalPanel.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "copy": "Másolás", + "createNewTerminal": "Új terminál", + "paste": "Beillesztés", + "clear": "Törlés" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/terminal/electron-browser/terminalService.i18n.json b/i18n/hun/src/vs/workbench/parts/terminal/electron-browser/terminalService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..babb2962c469ec84e62f8ad11fa281bd0d00ab69 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/terminal/electron-browser/terminalService.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "terminal.integrated.chooseWindowsShellInfo": "Megváltoztathatja az alapértelmezett terminált a testreszabás gomb választásával.", + "customize": "Testreszabás", + "cancel": "Mégse", + "never again": "Rendben, ne jelenítse meg újra", + "terminal.integrated.chooseWindowsShell": "Válassza ki a preferált terminál shellt! Ez később módosítható a beállításokban.", + "terminalService.terminalCloseConfirmationSingular": "Van egy aktív terminálmunkamenet. Szeretné megszakítani?", + "terminalService.terminalCloseConfirmationPlural": "{0} aktív terminálmunkamenet van. Szeretné megszakítani?", + "yes": "Igen" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json b/i18n/hun/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..f56e3fb23b947a10310da9f288928e88a9180b72 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json @@ -0,0 +1,19 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "selectTheme.label": "Színtéma", + "installColorThemes": "További színtémák telepítése...", + "themes.selectTheme": "Válassza ki a színtémát (előnézet a fel/le billentyűvel)", + "selectIconTheme.label": "Fájlikontéma", + "installIconThemes": "További fájlikontémák telepítése...", + "noIconThemeLabel": "Nincs", + "noIconThemeDesc": "Fájlikonok letiltása", + "problemChangingIconTheme": "Hiba történt az ikontéma beállítása közben: {0}", + "themes.selectIconTheme": "Válasszon fájlikontémát!", + "generateColorTheme.label": "Színtéma generálása az aktuális beállítások alapján", + "preferences": "Beállítások", + "developer": "Fejlesztői" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/trust/electron-browser/unsupportedWorkspaceSettings.contribution.i18n.json b/i18n/hun/src/vs/workbench/parts/trust/electron-browser/unsupportedWorkspaceSettings.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..977546fa1cab3eed88f5d65041509cd1c150f664 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/trust/electron-browser/unsupportedWorkspaceSettings.contribution.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "unsupportedWorkspaceSettings": "A munkaterület olyan beállításokat tartalmaz, amelyet csak a felhasználói beállításoknál lehet megadni ({0})", + "openWorkspaceSettings": "Munkaterület beállításainak megnyitása", + "openDocumentation": "További információ", + "ignore": "Figyelmen kívül hagyás" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/update/electron-browser/releaseNotesInput.i18n.json b/i18n/hun/src/vs/workbench/parts/update/electron-browser/releaseNotesInput.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..c6ac7bd9d2fc8004cc6eeb267d5967cf26b35fd7 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/update/electron-browser/releaseNotesInput.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "releaseNotesInputName": "Kiadási jegyzék: {0}" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/update/electron-browser/update.contribution.i18n.json b/i18n/hun/src/vs/workbench/parts/update/electron-browser/update.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..42549a7d3568575eb25f9f4726ab0b8bbe83f2a4 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/update/electron-browser/update.contribution.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "release notes": "Kiadási jegyzék", + "updateConfigurationTitle": "Frissítés", + "updateChannel": "Meghatározza, hogy érkeznek-e automatikus frissítések a frissítési csatornáról. A beállítás módosítása után újraindítás szükséges." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/update/electron-browser/update.i18n.json b/i18n/hun/src/vs/workbench/parts/update/electron-browser/update.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..3184270d4e295568e6490036f9ad513803e3d9fe --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/update/electron-browser/update.i18n.json @@ -0,0 +1,32 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "updateNow": "Frissítés most", + "later": "Később", + "unassigned": "nincs hozzárendelve", + "releaseNotes": "Kiadási jegyzék", + "showReleaseNotes": "Kiadási jegyzék megjelenítése", + "downloadNow": "Letöltés most", + "read the release notes": "Üdvözöljük a {0} v{1} verziójában. Szeretné megtekinteni a kiadási jegyzéket?", + "licenseChanged": "A licencfeltételek változtak. Olvassa végig!", + "license": "Licenc elolvasása", + "updateAvailable": "A {0} frissül az újraindítás után.", + "thereIsUpdateAvailable": "Van elérhető frissítés.", + "noUpdatesAvailable": "Jelenleg nincs elérhető frissítés.", + "updateIsReady": "Új frissítés érhető el.", + "commandPalette": "Parancskatalógus...", + "settings": "Beállítások", + "keyboardShortcuts": "Billentyűparancsok", + "selectTheme.label": "Színtéma", + "themes.selectIconTheme.label": "Fájlikontéma", + "not available": "A frissítések nem érhetők el", + "checkingForUpdates": "Frissítések keresése...", + "DownloadUpdate": "Elérhető frissítés letöltése", + "DownloadingUpdate": "Frissítés letöltése...", + "InstallingUpdate": "Frissítés telepítése...", + "restartToUpdate": "Újraindítás a frissítéshez...", + "checkForUpdates": "Frissítések keresése..." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/views/browser/views.i18n.json b/i18n/hun/src/vs/workbench/parts/views/browser/views.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..30ba124e291160d9527555b70849d5dc72d1a468 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/views/browser/views.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "viewToolbarAriaLabel": "{0} művelet" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/views/browser/viewsExtensionPoint.i18n.json b/i18n/hun/src/vs/workbench/parts/views/browser/viewsExtensionPoint.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..377ac0a4b979ed0e7221251b430b4c3a015fbeed --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/views/browser/viewsExtensionPoint.i18n.json @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "requirearray": "a nézeteket tömbként kell megadni", + "requirestring": "a(z) `{0}` tulajdonság kötelező és `string` típusúnak kell lennie", + "optstring": "a(z) `{0}` tulajdonság elhagyható vagy `string` típusúnak kell lennie", + "vscode.extension.contributes.view.id": "A nézet azonosítója. Ez használható az adatszolgáltató regisztrálásához a `vscode.window.registerTreeDataProviderForView` API-n keresztül. Ezen túl a kiegészítő aktiválásához regisztrálni kell az `onView:${id}` eseményt az `activationEvents`-nél.", + "vscode.extension.contributes.view.name": "A nézet emberek számára olvasható neve. Meg fog jelenni", + "vscode.extension.contributes.view.when": "A nézet megjelenítésének feltétele", + "vscode.extension.contributes.views": "Nézeteket szolgáltat a szerkesztőhöz", + "views.explorer": "Fájlkezelő-nézet", + "locationId.invalid": "A(z) `{0}` nem érvényes nézethelyszín" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/watermark/electron-browser/watermark.i18n.json b/i18n/hun/src/vs/workbench/parts/watermark/electron-browser/watermark.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..08aec5acaf8abb6b0a057e88ed70fbf112b52c55 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/watermark/electron-browser/watermark.i18n.json @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "watermark.showCommands": "Minden parancs megjelenítése", + "watermark.quickOpen": "Fájl megkeresése", + "watermark.openFile": "Fájl megnyitása", + "watermark.openFolder": "Mappa megnyitása", + "watermark.openFileFolder": "Fájl vagy mappa megnyitása", + "watermark.openRecent": "Legutóbbi megnyitása", + "watermark.newUntitledFile": "Új, névtelen fájl", + "watermark.toggleTerminal": "Terminál be- és kikapcsolása", + "watermark.findInFiles": "Keresés a fájlokban", + "watermark.startDebugging": "Hibakeresés indítása", + "watermark.selectTheme": "Téma módosítása", + "watermark.selectKeymap": "Billentyűkonfiguráció módosítása", + "watermark.keybindingsReference": "Billentyűparancs-referencia", + "watermark.openGlobalKeybindings": "Billentyűparancsok", + "watermark.unboundCommand": "nincs hozzárendelve", + "workbenchConfigurationTitle": "Munkaterület", + "tips.enabled": "Ha engedélyezve van, tippek jelennek meg vízjelként, ha nincs egyetlen szerkesztőablak sem nyitva." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/welcome/overlay/browser/welcomeOverlay.i18n.json b/i18n/hun/src/vs/workbench/parts/welcome/overlay/browser/welcomeOverlay.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..9ea3e3e0530b4d10f4acb4781d6b45644a69e84b --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/welcome/overlay/browser/welcomeOverlay.i18n.json @@ -0,0 +1,17 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "welcomeOverlay.explorer": "Fájlkezelő", + "welcomeOverlay.search": "Keresés a fájlok között", + "welcomeOverlay.git": "Forráskódkezelés", + "welcomeOverlay.debug": "Indítás és hibakeresés", + "welcomeOverlay.extensions": "Kiterjesztések kezelése", + "welcomeOverlay.problems": "Hibák és figyelmeztetések megtekintése", + "welcomeOverlay.commandPalette": "Összes parancs megkeresése és futtatása", + "welcomeOverlay": "Felhasználói felület áttekintése", + "hideWelcomeOverlay": "Felület áttekintésének elrejtése", + "help": "Segítség" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json b/i18n/hun/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..ce95c6137fd3962c36d500780636124cda9bac68 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json @@ -0,0 +1,43 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "welcomePage.vscode": "Visual Studio Code", + "welcomePage.editingEvolved": "Szerkesztés, továbbfejlesztve", + "welcomePage.start": "Start", + "welcomePage.newFile": "Új fájl", + "welcomePage.openFolder": "Mappa megnyitása...", + "welcomePage.cloneGitRepository": "Git forráskódtár klónozása...", + "welcomePage.recent": "Legutóbbi", + "welcomePage.moreRecent": "Tovább...", + "welcomePage.noRecentFolders": "Nincsenek megnyitott mappák", + "welcomePage.help": "Segítség", + "welcomePage.keybindingsCheatsheet": "Nyomatható billentyűparancs-referencia", + "welcomePage.introductoryVideos": "Bemutatóvideók", + "welcomePage.productDocumentation": "Termékdokumentáció", + "welcomePage.gitHubRepository": "GitHub-forráskódtár", + "welcomePage.stackOverflow": "Stack Overflow", + "welcomePage.showOnStartup": "Üdvözlőlap megjelenítése induláskor", + "welcomePage.customize": "Testreszabás", + "welcomePage.installExtensionPacks": "Eszközk és nyelvek", + "welcomePage.installExtensionPacksDescription": "{0}- és {1}-környezet telepítése", + "welcomePage.moreExtensions": "tovább", + "welcomePage.installKeymapDescription": "Billentyűparancsok telepítése", + "welcomePage.installKeymapExtension": "{0} és {1} billentyűparancsainak telepítése", + "welcomePage.others": "további", + "welcomePage.colorTheme": "Színtéma", + "welcomePage.colorThemeDescription": "Alakítsa át szeretett szerkesztőjét úgy, ahogyan szeretné!", + "welcomePage.learn": "További információ", + "welcomePage.showCommands": "Összes parancs megkeresése és futtatása", + "welcomePage.interfaceOverview": "Felhasználói felület áttekintése", + "welcomePage.interfaceOverviewDescription": "Fedvény, ami vizuálisan bemutatja a felhasználói felület legfőbb részeit.", + "welcomePage.interactivePlayground": "Interaktív játszótér", + "welcomePage.interactivePlaygroundDescription": "Próbálja ki a szerkesztő funkcióit egy rövid bemutató keretében", + "welcomePage.quickLinks": "Gyorshivatkozások", + "welcomePage.keybindingsReference": "Billentyűparancs-referencia", + "welcomePage.keybindingsReferenceDescription": "Egy nyomtatható PDF a leggyakrabban használt billentyűparancsokkal", + "welcomePage.configureSettings": "Beállítások módosítása", + "welcomePage.configureSettingsDescription": "Szabadítsa fel a VS Code teljes tudását a beállítások személyre szabásával" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.contribution.i18n.json b/i18n/hun/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..fc0d08e88475dcb5834d45a9eb9e5608b0f4ee13 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.contribution.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "help": "Segítség" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json b/i18n/hun/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..558c35d13d2d46042be5217300f8808bfabc5f02 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json @@ -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. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "workbenchConfigurationTitle": "Munkaterület", + "welcomePage.enabled": "Ha engedélyezve van, indításkor megjelenik az üdvözlőlap.", + "welcomePage": "Üdvözöljük!", + "welcomePage.javaScript": "JavaScript", + "welcomePage.typeScript": "TypeScript", + "welcomePage.python": "Python", + "welcomePage.php": "PHP", + "welcomePage.docker": "Docker", + "welcomePage.vim": "Vim", + "welcomePage.sublime": "Sublime", + "welcomePage.atom": "Atom", + "welcomePage.extensionPackAlreadyInstalled": "A(z) {0}-környezet már telepítve van.", + "welcomePage.willReloadAfterInstallingExtensionPack": "Az ablak újratölt a(z) {0} kiegészítő környezet telepítése után.", + "welcomePage.installingExtensionPack": "{0} kiegészítő környezet telepítése...", + "welcomePage.extensionPackNotFound": "A(z) {1} azonosítójú {0}-környezet nem található.", + "welcomePage.keymapAlreadyInstalled": "A(z) {0} billentyűparancsok már telepítve vannak.", + "welcomePage.willReloadAfterInstallingKeymap": "Az ablak újratölt a(z) {0} billentyűparancsok telepítése után.", + "welcomePage.installingKeymap": "{0} billentyűparancsok telepítése...", + "welcomePage.keymapNotFound": "A(z) {1} azonosítójú {0} billentyűparancsok nem találhatók.", + "welcome.title": "Üdvözöljük!", + "welcomePage.openFolderWithPath": "{1} elérési úton található {0} mappa megnyitása", + "welcomePage.extensionListSeparator": ", ", + "welcomePage.installKeymap": "{0}-billentyűkonfiguráció telepítése", + "welcomePage.installExtensionPack": "{0} kiegészítő környezet telepítése", + "welcomePage.installedKeymap": "A(z) {0}-billenyűkiosztás már telepítve van", + "welcomePage.installedExtensionPack": "A(z) {0}-környezet már telepítve van.", + "ok": "OK", + "details": "Részletek", + "cancel": "Mégse", + "welcomePage.buttonBackground": "Az üdvözlőlapon található gombok háttérszíne", + "welcomePage.buttonHoverBackground": "Az üdvözlőlapon található gombok háttérszíne, amikor a mutató fölöttük áll." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/welcome/walkThrough/electron-browser/editor/editorWalkThrough.i18n.json b/i18n/hun/src/vs/workbench/parts/welcome/walkThrough/electron-browser/editor/editorWalkThrough.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..0120c6821a0a70d163478535d8f3656c042957d0 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/welcome/walkThrough/electron-browser/editor/editorWalkThrough.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "editorWalkThrough": "Interaktív játszótér", + "editorWalkThrough.title": "Interaktív játszótér" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThrough.contribution.i18n.json b/i18n/hun/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThrough.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..493706c26017edf1128b7fec7409db6d3bf6fdb4 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThrough.contribution.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "walkThrough.editor.label": "Interaktív játszótér", + "help": "Segítség", + "interactivePlayground": "Interaktív játszótér" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughActions.i18n.json b/i18n/hun/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughActions.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..84bb9fd97782498521e34dd31f96bf68a9cbb7e9 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughActions.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "editorWalkThrough.arrowUp": "Görgetés felfelé (soronként)", + "editorWalkThrough.arrowDown": "Görgetés lefelé (soronként)", + "editorWalkThrough.pageUp": "Görgetés felfelé (oldalanként)", + "editorWalkThrough.pageDown": "Görgetés lefelé (oldalanként)" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json b/i18n/hun/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..027da129b6153c13cb6a819006cd936a7fb966c0 --- /dev/null +++ b/i18n/hun/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "walkThrough.unboundCommand": "nincs hozzárendelve", + "walkThrough.gitNotFound": "Úgy tűnik, hogy a Git nincs telepítve a rendszerre.", + "walkThrough.embeddedEditorBackground": "Az interaktív játszótér szerkesztőablakainak háttérszíne." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json b/i18n/hun/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..c75e504c21ced1525cd2c687cd6b58ca1f8ae33b --- /dev/null +++ b/i18n/hun/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json @@ -0,0 +1,17 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "open": "Beállítások megnyitása", + "close": "Bezárás", + "saveAndRetry": "Beállítások mentése és újrapróbálkozás", + "errorUnknownKey": "Nem sikerült írni a konfigurációs fájlt (ismeretlen kulcs)", + "errorInvalidTarget": "Nem sikerült írni a konfigurációs fájlt (érvénytelen cél)", + "errorNoWorkspaceOpened": "Nem sikerült írni a beállításokba, mert nincs mappa megnyitva. Nyisson meg egy mappát, majd próbálja újra!", + "errorInvalidConfiguration": "Nem sikerült írni a beállításokba. Nyissa meg a **Felhasználói beállításokat**, javítsa a hibákat és figyelmeztetéseket a fájlban, majd próbálja újra!", + "errorInvalidConfigurationWorkspace": "Nem sikerült írni a beállításokba. Nyissa meg a **Munkaterült beállításait**, javítsa a hibákat és figyelmeztetéseket a fájlban, majd próbálja újra!", + "errorConfigurationFileDirty": "Nem sikerült írni a beállításokba, mert a fájl módosítva lett. Mentse a **Felhasználói beállítások** fájlt, majd próbálja újra!", + "errorConfigurationFileDirtyWorkspace": "Nem sikerült írni a beállításokba, mert a fájl módosítva lett. Mentse a **Munkaterület beállításai** fájlt, majd próbálja újra!" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/services/crashReporter/common/crashReporterService.i18n.json b/i18n/hun/src/vs/workbench/services/crashReporter/common/crashReporterService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..afdabd01421ba93260b17dc9be7468b797d5e0a7 --- /dev/null +++ b/i18n/hun/src/vs/workbench/services/crashReporter/common/crashReporterService.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "telemetryConfigurationTitle": "Telemetria", + "telemetry.enableCrashReporting": "Összeomlási jelentések küldésének engedélyezése a Microsofthoz.\nA beállítás érvénybe lépéséhez újraindítás szükséges." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/services/editor/browser/editorService.i18n.json b/i18n/hun/src/vs/workbench/services/editor/browser/editorService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..50e968f8ee37e64e5723ddba19803fdc8a2c9371 --- /dev/null +++ b/i18n/hun/src/vs/workbench/services/editor/browser/editorService.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "compareLabels": "{0} ↔ {1}" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/services/files/electron-browser/fileService.i18n.json b/i18n/hun/src/vs/workbench/services/files/electron-browser/fileService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..132ee0675af7ff7abc5ff31729782be31ced5806 --- /dev/null +++ b/i18n/hun/src/vs/workbench/services/files/electron-browser/fileService.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "netVersionError": "A működéshez Microsoft .NET-keretrendszer 4.5 szükséges. A telepítéshez kövesse az alábbi hivatkozást!", + "installNet": ".NET Framework 4.5 letöltése", + "neverShowAgain": "Ne jelenítse meg újra", + "trashFailed": "A(z) {0} kukába helyezése nem sikerült" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/services/files/node/fileService.i18n.json b/i18n/hun/src/vs/workbench/services/files/node/fileService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..3734eda652011d2700ed1af58391064c81af3ab9 --- /dev/null +++ b/i18n/hun/src/vs/workbench/services/files/node/fileService.i18n.json @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "fileInvalidPath": "Érvénytelen fájlerőforrás ({0})", + "fileIsDirectoryError": "A fájl egy kövtár ({0})", + "fileBinaryError": "A fájl binárisnak tűnik és nem nyitható meg szövegként", + "fileNotFoundError": "Fájl nem található ({0})", + "unableToMoveCopyError": "Nem lehet áthelyezni vagy másolni. A fájl felülírná a mappát, amiben található.", + "foldersCopyError": "A munkaterületre nem másolhatók mappák. Válasszon ki egyedi fájlokat a másoláshoz.", + "fileReadOnlyError": "A fájl csak olvasható" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/services/keybinding/common/keybindingEditing.i18n.json b/i18n/hun/src/vs/workbench/services/keybinding/common/keybindingEditing.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..36032acbd6ea2f9398a8a8ba63dbae821d1d34f0 --- /dev/null +++ b/i18n/hun/src/vs/workbench/services/keybinding/common/keybindingEditing.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "errorKeybindingsFileDirty": "Nem lehet írni, mert a fájl módosult. Mentse a **Billentyűparancsok** fájlt, majd próbálja újra.", + "parseErrors": "Nem lehet írni a billentyűparancsokat. Nyissa meg a**Billentyűparancsok fájl**t, javítsa a benne található hibákat vagy figyelmeztetéseket, majd próbálja újra.", + "errorInvalidConfiguration": "Nem lehet írni a billentyűparancsokat. A **Billentyűparancsok fájlban** vagy egy objektum, ami nem tömb típusú. Nyissa meg a fájlt a helyreállításhoz, majd próbálja újra.", + "emptyKeybindingsHeader": "Az ebben a fájlban elhelyezett billentyűparancsok felülírják az alapértelmezett beállításokat" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/services/keybinding/electron-browser/keybindingService.i18n.json b/i18n/hun/src/vs/workbench/services/keybinding/electron-browser/keybindingService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..9ea2570fa3e1463127e428708d566afe2c81924a --- /dev/null +++ b/i18n/hun/src/vs/workbench/services/keybinding/electron-browser/keybindingService.i18n.json @@ -0,0 +1,26 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "nonempty": "az érték nem lehet üres.", + "requirestring": "a(z) `{0}` tulajdonság kötelező és `string` típusúnak kell lennie", + "optstring": "a(z) `{0}` tulajdonság elhagyható vagy `string` típusúnak kell lennie", + "vscode.extension.contributes.keybindings.command": "A billentyűparancs aktiválása esetén futtatandó parancs azonosítója.", + "vscode.extension.contributes.keybindings.key": "Billenty vagy billentyűparancs (különálló billentyűk plusz jellel és sorozatok szóközzel, pl.: Crtl + O és Ctrl+L L)", + "vscode.extension.contributes.keybindings.mac": "Mac-specifikus billentyű vagy billentyűsorozat.", + "vscode.extension.contributes.keybindings.linux": "Linux-specifikus billentyű vagy billentyűsorozat.", + "vscode.extension.contributes.keybindings.win": "Windows-specifikus billentyű vagy billentyűsorozat.", + "vscode.extension.contributes.keybindings.when": "A billentyűparancs aktiválási feltétele.", + "vscode.extension.contributes.keybindings": "Billentyűparancsok kezelését teszi lehetővé.", + "invalid.keybindings": "Érvénytelen `contributes.{0}`: {1}", + "unboundCommands": "A további elérhető parancsok a következők: ", + "keybindings.json.title": "Billentyűparancsok konfigurációja", + "keybindings.json.key": "Billentyű vagy billentyűsorozat (szóközzel elválasztva)", + "keybindings.json.command": "A végrehajtandó parancs neve", + "keybindings.json.when": "A billentyűparancs aktiválási feltétele.", + "keybindings.json.args": "A végrehajtandó parancs számára átadott argumentumok", + "keyboardConfigurationTitle": "Billentyűzet", + "dispatch": "Meghatározza, hogy a billentyűleütések észleléséhez a `keydown.code` (ajánlott) vagy `keydown.keyCode` esemény legyen használva." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/services/message/browser/messageList.i18n.json b/i18n/hun/src/vs/workbench/services/message/browser/messageList.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..f97efd6f3ef08122ec5ff4bd1e0e17d4875d92a2 --- /dev/null +++ b/i18n/hun/src/vs/workbench/services/message/browser/messageList.i18n.json @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "alertErrorMessage": "Hiba: {0}", + "alertWarningMessage": "Figyelmeztetés: {0}", + "alertInfoMessage": "Információ: {0}", + "error": "Hiba", + "warning": "Figyelmeztetés", + "info": "Információ", + "close": "Bezárás" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/services/message/electron-browser/messageService.i18n.json b/i18n/hun/src/vs/workbench/services/message/electron-browser/messageService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..1da61962be2ed8a1612c8ab4e9d30ff72359b9cd --- /dev/null +++ b/i18n/hun/src/vs/workbench/services/message/electron-browser/messageService.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "yesButton": "&&Igen", + "cancelButton": "Mégse" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/services/mode/common/workbenchModeService.i18n.json b/i18n/hun/src/vs/workbench/services/mode/common/workbenchModeService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..62bcd1b704ccd5fd8441fe2c7b14d68203b2b82a --- /dev/null +++ b/i18n/hun/src/vs/workbench/services/mode/common/workbenchModeService.i18n.json @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "invalid": "Érvénytelen `contributes.{0}`: a várt érték egy tömb.", + "invalid.empty": "A `contributes.{0}` értéke üres", + "require.id": "a(z) `{0}` tulajdonság kötelező és `string` típusúnak kell lennie", + "opt.extensions": "a(z) `{0}` tulajdonság elhagyható és `string[]` típusúnak kell lennie", + "opt.filenames": "a(z) `{0}` tulajdonság elhagyható és `string[]` típusúnak kell lennie", + "opt.firstLine": "a(z) `{0}` tulajdonság elhagyható és `string` típusúnak kell lennie", + "opt.configuration": "a(z) `{0}` tulajdonság elhagyható és `string` típusúnak kell lennie", + "opt.aliases": "a(z) `{0}` tulajdonság elhagyható és `string[]` típusúnak kell lennie", + "opt.mimetypes": "a(z) `{0}` tulajdonság elhagyható és `string[]` típusúnak kell lennie" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/services/progress/browser/progressService2.i18n.json b/i18n/hun/src/vs/workbench/services/progress/browser/progressService2.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..1618012de896e611e6e7e89f0cac6810ddcdeae5 --- /dev/null +++ b/i18n/hun/src/vs/workbench/services/progress/browser/progressService2.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "progress.text": "{0} – {1}", + "progress.title": "{0}: {1}" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/services/textfile/common/textFileEditorModel.i18n.json b/i18n/hun/src/vs/workbench/services/textfile/common/textFileEditorModel.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..df0fb446988c0433f22ca15ffb004bc64b17652a --- /dev/null +++ b/i18n/hun/src/vs/workbench/services/textfile/common/textFileEditorModel.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "saveFileFirst": "A fájl módosítva lett. Mentse, mielőtt megnyitná egy másik kódolással.", + "genericSaveError": "Hiba a(z) {0} mentése közben ({1})." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/services/textfile/common/textFileService.i18n.json b/i18n/hun/src/vs/workbench/services/textfile/common/textFileService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..53a5c4f1246c7b56c4c3ce950e61e711c3dda62c --- /dev/null +++ b/i18n/hun/src/vs/workbench/services/textfile/common/textFileService.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "files.backup.failSave": "A fájlokról nem sikerült biztonsági másolatot készíteni (Hiba: {0}). Próbálja meg menteni a fájlokat a kilépéshez." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/services/textfile/electron-browser/textFileService.i18n.json b/i18n/hun/src/vs/workbench/services/textfile/electron-browser/textFileService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..a411a51ba5910c363ac333b59cfea93365ce12eb --- /dev/null +++ b/i18n/hun/src/vs/workbench/services/textfile/electron-browser/textFileService.i18n.json @@ -0,0 +1,18 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "saveChangesMessage": "Szeretné menteni a(z) {0} fájlban elvégzett módosításokat?", + "saveChangesMessages": "Szeretné menteni a következő {0} fájlban elvégzett módosításokat?", + "moreFile": "...1 további fájl nincs megjelenítve", + "moreFiles": "...{0} további fájl nincs megjelenítve", + "saveAll": "Ö&&sszes mentése", + "save": "Menté&&s", + "dontSave": "&&Ne mentse", + "cancel": "Mégse", + "saveChangesDetail": "A módosítások elvesznek, ha nem menti őket.", + "allFiles": "Összes fájl", + "noExt": "Nincs kiterjesztés" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/services/themes/common/colorThemeSchema.i18n.json b/i18n/hun/src/vs/workbench/services/themes/common/colorThemeSchema.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..0e909264d98759c741d7915583acb8afb363577f --- /dev/null +++ b/i18n/hun/src/vs/workbench/services/themes/common/colorThemeSchema.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "schema.colors": "A szintaktikai kiemeléshez használt színek", + "schema.properties.name": "A szabály leírása", + "schema.fontStyle": "A szabály betűtípusának stílusa: 'italic', 'bold', 'underline', vagy ezek kombinációja", + "schema.tokenColors.path": "A tmTheme-fájl elérési útja (az aktuális fájlhoz képest relatívan)" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/services/themes/common/fileIconThemeSchema.i18n.json b/i18n/hun/src/vs/workbench/services/themes/common/fileIconThemeSchema.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..b93f26958fa4e401e199222045eb3515bacb6090 --- /dev/null +++ b/i18n/hun/src/vs/workbench/services/themes/common/fileIconThemeSchema.i18n.json @@ -0,0 +1,37 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "schema.folderExpanded": "Kinyitott mappánál használt ikon. A kinyitott mappa ikonját nem kötelező megadni. Ha nincs megadva, akkor a mappaikon lesz megjelenítve.", + "schema.folder": "A bezárt mappák ikonja, illetve ha a folderExpanded nincs megadva, akkor a kinyitott mappáké is.", + "schema.file": "Az alapértelmezett fájlikon, ami minden olyan fájlnál megjelenik, ami nem illeszkedik egyetlen kiterjesztésre, fájlnévre vagy nyelvazonosítóra sem.", + "schema.folderNames": "Ikonokat társít mappanevekhez. Az objektum kulcsa a mappa neve elérési útvonalrészletek nélkül. Nem tartalmazhat mintákat és helyettesítő karaktereket. A mappa nevének vizsgálatánál a kis- és nagybetűk nincsenek megkülönböztetve.", + "schema.folderName": "A társításhoz tartozó ikondefiníció azonosítója.", + "schema.folderNamesExpanded": "Ikonokat társít mappanevekhez kinyitott mappák esetén. Az objektum kulcsa a mappa neve elérési útvonalrészletek nélkül. Nem tartalmazhat mintákat és helyettesítő karaktereket. A mappa nevének vizsgálatánál a kis- és nagybetűk nincsenek megkülönböztetve.", + "schema.folderNameExpanded": "A társításhoz tartozó ikondefiníció azonosítója. ", + "schema.fileExtensions": "Ikonokat társít fájlkiterjesztésekhez. Az objektum kulcsa a fájlkiterjesztés neve. A kiterjesztés neve a fájl nevének utolsó része az utolsó pont után (a pont nélkül). A kiterjesztések vizsgálatánál a kis- és nagybetűk nincsenek megkülönböztetve. ", + "schema.fileExtension": "A társításhoz tartozó ikondefiníció azonosítója. ", + "schema.fileNames": "Ikonokat társít fájlnevekhez. Az objektum kulcsa a fájl teljes neve, az elérési út többi része nélkül. A fájlnév tartalmazhat pontokat és fájlkiterjesztést. Nem tartalmazhat mintákat és helyettesítő karaktereket. A fájlnevek vizsgálatánál a kis- és nagybetűk nincsenek megkülönböztetve.", + "schema.fileName": "A társításhoz tartozó ikondefiníció azonosítója. ", + "schema.languageIds": "Ikonokat társít nyelvekhez. Az objektum kulcsa a nyelvet szolgáltató komponens által definiált nyelvazonosító.", + "schema.languageId": "A társításhoz tartozó ikondefiníció azonosítója. ", + "schema.fonts": "Az ikondefiníciókban használt betűkészletek.", + "schema.id": "A betűkészlet azonosítója.", + "schema.src": "A betűkészlet elérési útjai.", + "schema.font-path": "A betűkészlet elérési útja, relatívan az aktuális ikontémafájlhoz képest.", + "schema.font-format": "A betűkészlet formátuma.", + "schema.font-weight": "A betűkészlet betűvastagsága.", + "schema.font-sstyle": "A betűkészlet stílusa.", + "schema.font-size": "A betűkészlet alapértelmezett mérete.", + "schema.iconDefinitions": "A fájlok ikonokhoz történő rendelésénél használható ikonok leírása.", + "schema.iconDefinition": "Egy ikondefiníció. Az objektum kulcsa a definíció azonosítója.", + "schema.iconPath": "SVG vagy PNG használata esetén a kép elérési útja. Az elérési út relatív az ikonkészletfájlhoz képest.", + "schema.fontCharacter": "Betűkészlet használata esetén a betűkészletből használandó karakter.", + "schema.fontColor": "Betűkészlet használata esetén a használt szín.", + "schema.fontSize": "Betűkészlet használata esetén a betűkészlet mérete a szöveg betűkészletének méretéhez képest, százalékban. Ha nincs megadva, akkor a betűkészlet-definícióban megadott érték van használva.", + "schema.fontId": "Betűkészlet használata esetén a betűkészlet azonosítója. Ha nincs megadva, akkor az első betűkészlet-definíció van használva.", + "schema.light": "Fájlikon-társítások világos témák használata esetén. Nem kötelező megadni.", + "schema.highContrast": "Fájlikon-társítások nagy kontrasztú témák használata esetén. Nem kötelező megadni." +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/services/themes/electron-browser/colorThemeData.i18n.json b/i18n/hun/src/vs/workbench/services/themes/electron-browser/colorThemeData.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..88c2c7411555ac6f0f1903b688ffac04c62f1659 --- /dev/null +++ b/i18n/hun/src/vs/workbench/services/themes/electron-browser/colorThemeData.i18n.json @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "error.cannotparsejson": "Hiba a JSON témafájl feldolgozása közben: {0}", + "error.invalidformat.colors": "Hiba a színtémafájl feldolgozása közben: {0}. A 'colors' értéke nem 'object' típusú.", + "error.invalidformat.tokenColors": "Hiba a színtémafájl feldolgozása közben: {0}. A 'tokenColors' tulajdonság vagy egy színeket tartalmazó tömb legyen vagy egy TextMate témafájl elérési útja", + "error.plist.invalidformat": "Hiba a tmTheme-fájl feldolgozása közben: {0}. A 'settings' nem egy tömb.", + "error.cannotparse": "Hiba a tmTheme-fájl feldolgozása közben: {0}", + "error.cannotload": "Hiba a(z) {0} tmTheme fájl betöltése közben: {1}" +} \ No newline at end of file diff --git a/i18n/hun/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.i18n.json b/i18n/hun/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..52a7fb66fc2f08b49842b2bbab821cfadb182b6a --- /dev/null +++ b/i18n/hun/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.i18n.json @@ -0,0 +1,32 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "vscode.extension.contributes.themes": "TextMate-színtémákat szolgáltat.", + "vscode.extension.contributes.themes.id": "A téma felhasználói beállításokban használt azonosítója.", + "vscode.extension.contributes.themes.label": "A színtéma felhasználói felületen megjelenő neve.", + "vscode.extension.contributes.themes.uiTheme": "A szerkesztőablak körül megjelenő elemek alaptémája. A 'vs' a világos, a 'vs-dark' a sötét színtéma, a 'hc-black' pedig a sötét, nagy kontrasztú téma.", + "vscode.extension.contributes.themes.path": "A tmTheme-fájl elérési útja. Az elérési út relatív a kiegészítő mappájához képest, és általában './themes/themeFile.tmTheme'.", + "vscode.extension.contributes.iconThemes": "Fájlikontémákat szolgáltat.", + "vscode.extension.contributes.iconThemes.id": "Az ikontéma felhasználói beállításokban használt azonosítója.", + "vscode.extension.contributes.iconThemes.label": "Az ikontéma felhasználói felületen megjelenő neve.", + "vscode.extension.contributes.iconThemes.path": "A témadefiníciós fájl elérési útja. Az elérési út relatív a kiegészítő mappájához képest, és általában ./icons/awesome-icon-theme.json'.", + "migration.completed": "Új témabeállítások lettek hozzáadva a felhasználói beállításokhoz. Biztonsági mentés a következő helyen érhető el: {0}.", + "error.cannotloadtheme": "Nem sikerült betölteni a(z) '{0}' témát: {1}.", + "reqarray": "a(z) `{0}` kiegszítési pontot tömbként kell megadni", + "reqpath": "Hiányzó karakterlánc a `contributes.{0}.path`-ban. A megadott érték: {1}", + "invalid.path.1": "A `contributes.{0}.path` ({1}) nem a kiegészítő mappáján belül található ({2}). Emiatt előfordulhat, hogy a kiegészítő nem lesz hordozható.", + "reqid": "Hiányzó karakterlánc a `contributes.{0}.id`-ben. A megadott érték: {1}", + "error.cannotloadicontheme": "Nem sikerült megnyitni a(z) '{0}' témát", + "error.cannotparseicontheme": "Hiba a fájlikonokat leíró fájl feldolgozása közben: {0}", + "colorTheme": "Meghatározza a munkaterületen használt színtémát.", + "colorThemeError": "A téma ismeretlen vagy nincs telepítve.", + "iconTheme": "Meghatározza a munkaterületen használt ikontémát.", + "noIconThemeDesc": "Nincsenek fájlikonok", + "iconThemeError": "A fájlikontéma ismeretlen vagy nincs telepítve.", + "workbenchColors": "Felülírja az aktuális színtémában definiált színeket.", + "workbenchColors.deprecated": "A beállítás már nem kísérleti, és át lett nevezve 'workbench.colorCustomizations'-re.", + "workbenchColors.deprecatedDescription": "Használja a 'workbench.colorCustomizations' tulajdonságot helyette." +} \ No newline at end of file diff --git a/i18n/ita/extensions/git/out/commands.i18n.json b/i18n/ita/extensions/git/out/commands.i18n.json index 530bbe4a409b9c7d4966f4629256ac4b6c48bcec..1890044ddd33e400a17b14e6ca343f9ea8c98c4f 100644 --- a/i18n/ita/extensions/git/out/commands.i18n.json +++ b/i18n/ita/extensions/git/out/commands.i18n.json @@ -26,6 +26,9 @@ "provide commit message": "Specificare un messaggio di commit", "branch name": "Nome ramo", "provide branch name": "Specificare un nome di ramo", + "select branch to delete": "Seleziona un ramo da cancellare", + "confirm force delete branch": "Il merge del ramo '{0}' non è completo. Elimina comunque?", + "delete branch": "Elimina ramo", "no remotes to pull": "Il repository non contiene elementi remoti configurati come origini del pull.", "no remotes to push": "Il repository non contiene elementi remoti configurati come destinazione del push.", "nobranch": "Estrarre un ramo per eseguire il push in un elemento remoto.", diff --git a/i18n/ita/extensions/git/out/statusbar.i18n.json b/i18n/ita/extensions/git/out/statusbar.i18n.json index 06cabeb7330e8768d2afe7e4b3dc1e479adba168..fe9c1294a4150974b47a7e17ccadcc9d505d5f3e 100644 --- a/i18n/ita/extensions/git/out/statusbar.i18n.json +++ b/i18n/ita/extensions/git/out/statusbar.i18n.json @@ -7,5 +7,5 @@ "checkout": "Estrai...", "sync changes": "Sincronizza modifiche", "publish changes": "Pubblica modifiche", - "syncing changes": "Sincronizzazione delle modifiche..." + "syncing changes": "Sincronizzazione delle modifiche in corso..." } \ No newline at end of file diff --git a/i18n/ita/extensions/git/package.i18n.json b/i18n/ita/extensions/git/package.i18n.json index 3ba24f908e935bf9650790b54dc56eb9ab4e7171..118066c0c40f8bb22048114d2f2b229f137b1ab6 100644 --- a/i18n/ita/extensions/git/package.i18n.json +++ b/i18n/ita/extensions/git/package.i18n.json @@ -26,12 +26,13 @@ "command.undoCommit": "Annulla ultimo commit", "command.checkout": "Estrai in...", "command.branch": "Crea ramo...", + "command.deleteBranch": "Elimina ramo...", "command.pull": "Esegui pull", "command.pullRebase": "Esegui pull (Riassegna)", "command.push": "Esegui push", "command.pushTo": "Esegui push in...", "command.sync": "Sincronizza", - "command.publish": "Pubblica", + "command.publish": "Pubblica ramo", "command.showOutput": "Mostra output GIT", "config.enabled": "Indica se GIT è abilitato", "config.path": "Percorso dell'eseguibile di GIT", diff --git a/i18n/ita/extensions/jake/out/main.i18n.json b/i18n/ita/extensions/jake/out/main.i18n.json index 8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a..be50361d378e5c18dc163a5edbab86eccf3a9ddc 100644 --- a/i18n/ita/extensions/jake/out/main.i18n.json +++ b/i18n/ita/extensions/jake/out/main.i18n.json @@ -3,4 +3,6 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. -{} \ No newline at end of file +{ + "execFailed": "Rilevamento automatico di Jake non riuscito - errore: {0}" +} \ No newline at end of file diff --git a/i18n/ita/extensions/jake/package.i18n.json b/i18n/ita/extensions/jake/package.i18n.json index 8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a..76d5185d8c34728bcccbf93d327319c008a5a3e2 100644 --- a/i18n/ita/extensions/jake/package.i18n.json +++ b/i18n/ita/extensions/jake/package.i18n.json @@ -3,4 +3,6 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. -{} \ No newline at end of file +{ + "config.jake.autoDetect": "Controlla se la rilevazione automatica delle attività Jake è on/off. L'impostazione predefinita è 'on'." +} \ No newline at end of file diff --git a/i18n/ita/extensions/markdown/out/extension.i18n.json b/i18n/ita/extensions/markdown/out/extension.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..2448cc1f0e072ceac01543a2371f68795610053a --- /dev/null +++ b/i18n/ita/extensions/markdown/out/extension.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "onPreviewStyleLoadError": "Impossibile caricare 'markdown.styles': {0}" +} \ No newline at end of file diff --git a/i18n/ita/extensions/merge-conflict/out/codelensProvider.i18n.json b/i18n/ita/extensions/merge-conflict/out/codelensProvider.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..b8b557539d9597a5325e7692982fa757d0e969c4 --- /dev/null +++ b/i18n/ita/extensions/merge-conflict/out/codelensProvider.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "acceptCurrentChange": "Accetta modifica corrente", + "acceptIncomingChange": "Accetta modifica in ingresso", + "acceptBothChanges": "Accetta entrambe le modifiche", + "compareChanges": "Confronta le modifiche" +} \ No newline at end of file diff --git a/i18n/ita/extensions/merge-conflict/out/commandHandler.i18n.json b/i18n/ita/extensions/merge-conflict/out/commandHandler.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..bd26a995d326d052a921c2dcfd23d6c68985d677 --- /dev/null +++ b/i18n/ita/extensions/merge-conflict/out/commandHandler.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "cursorNotInConflict": "Il cursore dell'editor non si trova all'interno di un conflitto merge", + "compareChangesTitle": "{0}: modifiche correnti ⟷ modifiche in ingresso", + "cursorOnSplitterRange": "Il cursore si trova sulla barra di divisione di merge conflitti, si prega di spostarlo o al blocco \"corrente\" o a quello \"in ricezione\"", + "noConflicts": "Conflitti merge non trovati in questo file", + "noOtherConflictsInThisFile": "Nessun altro conflitto merge trovato in questo file" +} \ No newline at end of file diff --git a/i18n/ita/extensions/merge-conflict/out/mergeDecorator.i18n.json b/i18n/ita/extensions/merge-conflict/out/mergeDecorator.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..ff68382dadc76d0b05c8aa5f2737c932b0ba1a01 --- /dev/null +++ b/i18n/ita/extensions/merge-conflict/out/mergeDecorator.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "currentChange": "(modifica corrente)", + "incomingChange": "(modifica in ingresso)" +} \ No newline at end of file diff --git a/i18n/ita/extensions/merge-conflict/package.i18n.json b/i18n/ita/extensions/merge-conflict/package.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..323397967e1728a04b889c7549602c99656726d9 --- /dev/null +++ b/i18n/ita/extensions/merge-conflict/package.i18n.json @@ -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. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "command.category": "Esegui merge del conflitto", + "command.accept.all-incoming": "Accettare tutte le modifiche in ingresso", + "command.accept.all-both": "Accettare tutte in entrambe", + "command.accept.current": "Accettare corrente", + "command.accept.incoming": "Accettare modifiche in ingresso", + "command.accept.selection": "Accettare selezione", + "command.accept.both": "Accettare entrambe", + "command.next": "Conflitto successivo", + "command.previous": "Conflitto precedente", + "command.compare": "Confronta il conflitto corrente", + "config.title": "Esegui merge del conflitto", + "config.codeLensEnabled": "Abilita/Disabilita le finestre CodeLens del blocco merge di conflitti all'interno di editor", + "config.decoratorsEnabled": "Abilita/Disabilita gli elementi Decorator sul blocco merge di conflitti all'interno di editor" +} \ No newline at end of file diff --git a/i18n/ita/extensions/npm/package.i18n.json b/i18n/ita/extensions/npm/package.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..3e4c81db38dabb9ef0c14f7da52f95f74df313f1 --- /dev/null +++ b/i18n/ita/extensions/npm/package.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "config.npm.autoDetect": "Controlla se la rilevazione automatica degli script npm è on/off. L'impostazione predefinita è 'on'." +} \ No newline at end of file diff --git a/i18n/ita/extensions/typescript/out/features/bufferSyncSupport.i18n.json b/i18n/ita/extensions/typescript/out/features/bufferSyncSupport.i18n.json index 08776b1189332db833bebc0167d574bd1e266ed6..e6788ac396b005dcb89d9a8387f57fd2fa11a3a5 100644 --- a/i18n/ita/extensions/typescript/out/features/bufferSyncSupport.i18n.json +++ b/i18n/ita/extensions/typescript/out/features/bufferSyncSupport.i18n.json @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "versionMismatch": "Le versioni non corrispondono. Compilatore tsc globale ({0}) != servizio di linguaggio di Visual Studio Code ({1}). Potrebbero verificarsi errori di compilazione incoerente", "moreInformation": "Altre informazioni", "doNotCheckAgain": "Non eseguire più la verifica", "close": "Chiudi", diff --git a/i18n/ita/extensions/typescript/out/utils/projectStatus.i18n.json b/i18n/ita/extensions/typescript/out/utils/projectStatus.i18n.json index 641adbe5215b8a851af70fdfb31037d8134b3a27..2a71104630a9a693ff806af6f57dfb957d4fc783 100644 --- a/i18n/ita/extensions/typescript/out/utils/projectStatus.i18n.json +++ b/i18n/ita/extensions/typescript/out/utils/projectStatus.i18n.json @@ -6,7 +6,6 @@ { "hintExclude": "Per abilitare le funzionalità del linguaggio JavaScript/TypeScript a livello di progetto, escludere le cartelle che contengono molti file, come {0}", "hintExclude.generic": "Per abilitare le funzionalità del linguaggio JavaScript/TypeScript a livello di progetto, escludere le cartelle di grandi dimensioni che contengono file di origine su cui non si lavora.", - "open": "Configura esclusioni", "large.label": "Configura esclusioni", "hintExclude.tooltip": "Per abilitare le funzionalità del linguaggio JavaScript/TypeScript a livello di progetto, escludere le cartelle di grandi dimensioni che contengono file di origine su cui non si lavora." } \ No newline at end of file diff --git a/i18n/ita/extensions/typescript/out/utils/typingsStatus.i18n.json b/i18n/ita/extensions/typescript/out/utils/typingsStatus.i18n.json index ede347b5776310e4e6e6b5a57b83d846f619ee76..563d939145df6e228001a89cae3b20d2d86df562 100644 --- a/i18n/ita/extensions/typescript/out/utils/typingsStatus.i18n.json +++ b/i18n/ita/extensions/typescript/out/utils/typingsStatus.i18n.json @@ -5,7 +5,7 @@ // Do not edit this file. It is machine generated. { "installingPackages": "Recupero dei dati per ottimizzare IntelliSense in TypeScript", - "typesInstallerInitializationFailed.title": "Non è stato possibile installare i file di definizione tipi per le funzionalità del linguaggio JavaScript. Verificare che NPM sia installato e che sia incluso nel PATH", + "typesInstallerInitializationFailed.title": "Non è stato possibile installare i file di definizione tipi per le funzionalità del linguaggio JavaScript. Verificare che NPM sia installato e o configurare 'typescript.npm' nelle impostazioni utente", "typesInstallerInitializationFailed.moreInformation": "Altre informazioni", "typesInstallerInitializationFailed.doNotCheckAgain": "Non eseguire più la verifica", "typesInstallerInitializationFailed.close": "Chiudi" diff --git a/i18n/ita/extensions/typescript/package.i18n.json b/i18n/ita/extensions/typescript/package.i18n.json index 36ff2654b3ec4f37b916837fa675034eceda608d..7db05f3f135b92f5d016db32bb0d1ad318b5af6d 100644 --- a/i18n/ita/extensions/typescript/package.i18n.json +++ b/i18n/ita/extensions/typescript/package.i18n.json @@ -13,7 +13,6 @@ "typescript.check.tscVersion": "Verifica se un compilatore TypeScript di installazione globale, ad esempio tsc, è diverso dal servizio di linguaggio TypeScript usato.", "typescript.tsserver.log": "Abilita la registrazione del server TypeScript in un file. Questo registro può essere utilizzato per diagnosticare problemi del server TypeScript. Il registro può contenere percorsi di file, codice sorgente e altre informazioni del progetto potenzialmente riservate. ", "typescript.tsserver.trace": "Abilita la traccia dei messaggi inviati al server TypeScript. Questa traccia può essere utilizzata per diagnosticare problemi del server TypeScript. La traccia può contenere percorsi di file, codice sorgente e altre informazioni del progetto potenzialmente riservate.", - "typescript.tsserver.experimentalAutoBuild": "Abilita la compilazione automatica sperimentale. Richiede la versione 1.9 dev o 2.x tsserver e il riavvio di Visual Studio Code dopo la modifica.", "typescript.validate.enable": "Abilita/Disabilita la convalida TypeScript.", "typescript.format.enable": "Abilita/Disabilita il formattatore TypeScript predefinito.", "javascript.format.enable": "Abilita/Disabilita il formattatore JavaScript predefinito.", @@ -37,9 +36,12 @@ "typescript.referencesCodeLens.enabled": "Abilita/disabilita riferimenti CodeLens nei file TypeScript. Richiede TypeScript >= 2.0.6.", "typescript.implementationsCodeLens.enabled": "Abilita/Disabilita le finestre CodeLens per le implementazioni. Richiede una versione di TypeScript uguale o successiva alla 2.2.0.", "typescript.openTsServerLog.title": "Apri il log del server TypeScript", + "typescript.restartTsServer": "Riavvia server TS", "typescript.selectTypeScriptVersion.title": "Seleziona la versione di TypeScript", "jsDocCompletion.enabled": "Abilita/Disabilita commenti automatici JSDoc", "javascript.implicitProjectConfig.checkJs": "Abilita/disabilita il controllo semantico di file JavaScript. File jsconfig.json o tsconfig.json esistenti sovrascrivono su questa impostazione. Richiede TypeScript >= 2.3.1.", - "typescript.check.npmIsInstalled": "Controllare se NPM è installato per l'acquisizione automatica delle definizioni di tipi", - "javascript.nameSuggestions": "Abilita/disabilita l'inclusione di nomi univoci dal file negli elenchi di suggerimento di JavaScript." + "typescript.npm": "Specifica il percorso dell'eseguibile NPM utilizzato per l'acquisizione automatica delle definizioni di tipi. Richiede TypeScript >= 2.3.4.", + "typescript.check.npmIsInstalled": "Controlla se NPM è installato per l'acquisizione automatica delle definizioni di tipi", + "javascript.nameSuggestions": "Abilita/disabilita l'inclusione di nomi univoci dal file negli elenchi di suggerimento di JavaScript.", + "typescript.tsc.autoDetect": "Controlla se la rilevazione automatica di attività tsc è on/off." } \ No newline at end of file diff --git a/i18n/ita/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json b/i18n/ita/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json index 0ccb13bf8a736c2c40aee27a6f522227485f70c3..6e295ef1e2c5c31c8dc900b0e03428d88047083e 100644 --- a/i18n/ita/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json +++ b/i18n/ita/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json @@ -6,8 +6,7 @@ { "imgMeta": "{0}x{1} {2}", "largeImageError": "L'immagine è troppo grande per essere visualizzata nell'editor", - "resourceOpenExternalButton": "Apri immagine", - "resourceOpenExternalText": " con il programma esterno?", + "resourceOpenExternalButton": "Aprire immagine utilizzando un programma esterno?", "nativeBinaryError": "Il file non verrà visualizzato nell'editor perché è binario, è molto grande o usa una codifica testo non supportata.", "sizeB": "{0} B", "sizeKB": "{0} KB", diff --git a/i18n/ita/src/vs/base/common/errorMessage.i18n.json b/i18n/ita/src/vs/base/common/errorMessage.i18n.json index 8205108272918d15c570669b3b84359861aa3a6d..12c07aad24dfed3d70a017781865762db4e0723b 100644 --- a/i18n/ita/src/vs/base/common/errorMessage.i18n.json +++ b/i18n/ita/src/vs/base/common/errorMessage.i18n.json @@ -13,6 +13,5 @@ "error.connection.unknown": "Si è verificato un errore di connessione sconosciuto. La connessione a Internet è stata interrotta oppure il server al quale si è connessi è offline.", "stackTrace.format": "{0}: {1}", "error.defaultMessage": "Si è verificato un errore sconosciuto. Per altri dettagli, vedere il log.", - "nodeExceptionMessage": "Si è verificato un errore di sistema ({0})", "error.moreErrors": "{0} ({1} errori in totale)" } \ No newline at end of file diff --git a/i18n/ita/src/vs/base/common/keybindingLabels.i18n.json b/i18n/ita/src/vs/base/common/keybindingLabels.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a --- /dev/null +++ b/i18n/ita/src/vs/base/common/keybindingLabels.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{} \ No newline at end of file diff --git a/i18n/ita/src/vs/code/electron-main/menus.i18n.json b/i18n/ita/src/vs/code/electron-main/menus.i18n.json index 86c52fb5640b574ba4ce2172092b37b972c14b79..d83b44802e557574091056f69171cb8f2f6fd0e4 100644 --- a/i18n/ita/src/vs/code/electron-main/menus.i18n.json +++ b/i18n/ita/src/vs/code/electron-main/menus.i18n.json @@ -14,6 +14,7 @@ "mHelp": "&&Guida", "miNewWindow": "&&Nuova finestra", "mAbout": "Informazioni su {0}", + "mServices": "Servizi", "mHide": "Nascondi {0}", "mHideOthers": "Nascondi altri", "mShowAll": "Mostra tutto", @@ -54,6 +55,9 @@ "miShowEmmetCommands": "E&&mmet...", "miToggleLineComment": "Attiva/Disattiva commento per &&riga", "miToggleBlockComment": "Attiva/Disattiva commento per &&blocco", + "miMultiCursorAlt": "Utilizzare Alt+clic per multi-cursore", + "miMultiCursorCmd": "Utilizzare Cmd+Click per multi-cursore", + "miMultiCursorCtrl": "Utilizzare Ctrl+clic per multi-cursore", "miInsertCursorAbove": "&&Aggiungi cursore sopra", "miInsertCursorBelow": "A&&ggiungi cursore sotto", "miInsertCursorAtEndOfEachLineSelected": "Aggiungi c&&ursori a fine riga", @@ -69,6 +73,7 @@ "miSmartSelectShrink": "&&Riduci selezione", "miViewExplorer": "&&Esplora risorse", "miViewSearch": "Cerca", + "miViewSCM": "S&&CM", "miViewDebug": "&&Debug", "miViewExtensions": "E&&stensioni", "miToggleOutput": "&&Output", @@ -113,6 +118,8 @@ "miGotoSymbolInFile": "Vai al &&simbolo nel file...", "miGotoSymbolInWorkspace": "Vai al &&simbolo nell'area di lavoro...", "miGotoDefinition": "Vai alla &&definizione", + "miGotoTypeDefinition": "Vai alla &&definizione di tipo", + "miGotoImplementation": "Vai all'&&implementazione", "miGotoLine": "Vai alla riga...", "miStartDebugging": "&&Avvia debug", "miStartWithoutDebugging": "Avvia &&senza debug", @@ -129,16 +136,17 @@ "miColumnBreakpoint": "Punto di interruzione &&colonna", "miFunctionBreakpoint": "Punto di interruzione &&funzione...", "miNewBreakpoint": "&&Nuovo punto di interruzione", + "miEnableAllBreakpoints": "Abilita tutti i punti di interruzione", "miDisableAllBreakpoints": "Disabilita tutti i &&punti di interruzione", "miRemoveAllBreakpoints": "Rimuovi &&tutti i punti di interruzione", "miInstallAdditionalDebuggers": "&&Installa debugger aggiuntivi...", "mMinimize": "Riduci a icona", - "mClose": "Chiudi", "mBringToFront": "Porta tutto in primo piano", "miToggleDevTools": "&&Attiva/Disattiva strumenti di sviluppo", "miAccessibilityOptions": "&&Opzioni accessibilità", "miReportIssues": "&&Segnala problemi", "miWelcome": "&&Benvenuti", + "miInteractivePlayground": "Playground &&interattivo", "miDocumentation": "&&Documentazione", "miReleaseNotes": "&&Note sulla versione", "miKeyboardShortcuts": "&&Riferimento per tasti di scelta rapida", @@ -148,6 +156,8 @@ "miLicense": "&&Visualizza licenza", "miPrivacyStatement": "&&Informativa sulla privacy", "miAbout": "&&Informazioni su", + "miTerminateTask": "&&Termina attività", + "accessibilityOptionsWindowTitle": "Opzioni accessibilità", "miRestartToUpdate": "Riavvia per aggiornare...", "miCheckingForUpdates": "Verifica della disponibilità di aggiornamenti...", "miDownloadUpdate": "Scarica l'aggiornamento disponibile", diff --git a/i18n/ita/src/vs/code/electron-main/windows.i18n.json b/i18n/ita/src/vs/code/electron-main/windows.i18n.json index 2d2cdf7fee4d6831bd417d4f10984e60a9a511b9..6481aed58753252101c0df7c3fc466b0aa753a08 100644 --- a/i18n/ita/src/vs/code/electron-main/windows.i18n.json +++ b/i18n/ita/src/vs/code/electron-main/windows.i18n.json @@ -7,16 +7,11 @@ "ok": "OK", "pathNotExistTitle": "Il percorso non esiste", "pathNotExistDetail": "Il percorso '{0}' sembra non esistere più sul disco.", - "accessibilityOptionsWindowTitle": "Opzioni accessibilità", "reopen": "Riapri", "wait": "Continua ad attendere", "close": "Chiudi", "appStalled": "La finestra non risponde", "appStalledDetail": "È possibile riaprire la finestra, chiuderla oppure attendere.", "appCrashed": "Si è verificato un arresto anomalo della finestra", - "appCrashedDetail": "Ci scusiamo per l'inconveniente. Per riprendere dal punto in cui si è verificata l'interruzione, riaprire la finestra.", - "newWindow": "Nuova finestra", - "newWindowDesc": "Apre una nuova finestra", - "recentFolders": "Cartelle recenti", - "folderDesc": "{0} {1}" + "appCrashedDetail": "Ci scusiamo per l'inconveniente. Per riprendere dal punto in cui si è verificata l'interruzione, riaprire la finestra." } \ No newline at end of file diff --git a/i18n/ita/src/vs/editor/common/config/commonEditorConfig.i18n.json b/i18n/ita/src/vs/editor/common/config/commonEditorConfig.i18n.json index 59f730fe1dc6d6e64e8a0ec1a4841d058119c14e..c1b3f513186f0e7dd98c0ac707d839cc23f024b1 100644 --- a/i18n/ita/src/vs/editor/common/config/commonEditorConfig.i18n.json +++ b/i18n/ita/src/vs/editor/common/config/commonEditorConfig.i18n.json @@ -23,6 +23,8 @@ "minimap.enabled": "Controlla se la mini mappa è visualizzata", "minimap.renderCharacters": "Esegue il rendering dei caratteri effettivi di una riga (in contrapposizione ai blocchi colore)", "minimap.maxColumn": "Limita la larghezza della mini mappa in modo da eseguire il rendering al massimo di un certo numero di colonne", + "find.seedSearchStringFromSelection": "Controlla se inizializzare la stringa di ricerca nel Widget Trova con il testo selezionato nell'editor", + "find.autoFindInSelection": "Controlla se l'impostazione Trova nella selezione è attivata quando vengono selezionati più caratteri o righe di testo nell'editor", "wordWrap.off": "Il wrapping delle righe non viene eseguito.", "wordWrap.on": "Verrà eseguito il wrapping delle righe in base alla larghezza del viewport.", "wordWrap.wordWrapColumn": "Verrà eseguito il wrapping delle righe alla posizione corrispondente a `editor.wordWrapColumn`.", @@ -31,17 +33,19 @@ "wordWrapColumn": "Controlla la colonna di wrapping dell'editor quando il valore di `editor.wordWrap` è 'wordWrapColumn' o 'bounded'.", "wrappingIndent": "Controlla il rientro delle righe con ritorno a capo. Può essere uno dei valori seguenti: 'none', 'same' o 'indent'.", "mouseWheelScrollSensitivity": "Moltiplicatore da usare sui valori `deltaX` e `deltaY` degli eventi di scorrimento della rotellina del mouse", + "multiCursorModifier.ctrlCmd": "Rappresenta il tasto 'Control' (ctrl) su Windows e Linux e il tasto 'Comando' (cmd) su OSX.", + "multiCursorModifier.alt": "Rappresenta il tasto 'Alt' su Windows e Linux e il tasto 'Opzione' su OSX.", + "multiCursorModifier": "Il modificatore da utilizzare per aggiungere molteplici cursori con il mouse. 'ctrlCmd' rappresenta il tasto 'Control' su Windows e Linux e il tasto 'Comando' su OSX. I gesti del mouse Vai a definizione e Apri il Link si adatteranno in modo da non entrare in conflitto con il modificatore multi-cursore.", "quickSuggestions.strings": "Abilita i suggerimenti rapidi all'interno di stringhe.", "quickSuggestions.comments": "Abilita i suggerimenti rapidi all'interno di commenti.", "quickSuggestions.other": "Abilita i suggerimenti rapidi all'esterno di stringhe e commenti.", "quickSuggestions": "Controlla se visualizzare automaticamente i suggerimenti durante la digitazione", "quickSuggestionsDelay": "Controlla il ritardo in ms dopo il quale verranno visualizzati i suggerimenti rapidi", - "parameterHints": "Abilita i suggerimenti per i parametri", "autoClosingBrackets": "Controlla se l'editor deve chiudere automaticamente le parentesi quadre dopo che sono state aperte", "formatOnType": "Controlla se l'editor deve formattare automaticamente la riga dopo la digitazione", "formatOnPaste": "Controlla se l'editor deve formattare automaticamente il contenuto incollato. Deve essere disponibile un formattatore che deve essere in grado di formattare un intervallo in un documento.", "suggestOnTriggerCharacters": "Controlla se i suggerimenti devono essere visualizzati automaticamente durante la digitazione dei caratteri trigger", - "acceptSuggestionOnEnter": "Controlla se i suggerimenti devono essere accettati con 'INVIO' in aggiunta a 'TAB'. In questo modo è possibile evitare ambiguità tra l'inserimento di nuove righe e l'accettazione di suggerimenti.", + "acceptSuggestionOnEnter": "Controlla se i suggerimenti devono essere accettati con 'INVIO' in aggiunta a 'TAB'. In questo modo è possibile evitare ambiguità tra l'inserimento di nuove righe e l'accettazione di suggerimenti. Il valore 'smart' indica di accettare un suggerimento con 'INVIO' quando comporta una modifica al testo", "acceptSuggestionOnCommitCharacter": "Controlla se accettare i suggerimenti con i caratteri di commit. Ad esempio, in JavaScript il punto e virgola (';') può essere un carattere di commit che accetta un suggerimento e digita tale carattere.", "snippetSuggestions": "Controlla se i frammenti di codice sono visualizzati con altri suggerimenti e il modo in cui sono ordinati.", "emptySelectionClipboard": "Consente di controllare se, quando si copia senza aver effettuato una selezione, viene copiata la riga corrente.", @@ -63,12 +67,17 @@ "renderLineHighlight": "Consente di controllare in che modo l'editor deve eseguire il rendering dell'evidenziazione di riga corrente. Le opzioni possibili sono 'none', 'gutter', 'line' e 'all'.", "codeLens": "Controlla se nell'editor sono visualizzate le finestre di CodeLens", "folding": "Controlla se per l'editor è abilitata la riduzione del codice", + "showFoldingControls": "Controlla se i controlli di riduzione sul margine della barra di scorrimento sono automaticamente nascosti.", "matchBrackets": "Evidenzia le parentesi corrispondenti quando se ne seleziona una.", "glyphMargin": "Controlla se l'editor deve eseguire il rendering del margine verticale del glifo. Il margine del glifo viene usato principalmente per il debug.", "useTabStops": "Inserimento ed eliminazione dello spazio vuoto dopo le tabulazioni", "trimAutoWhitespace": "Rimuovi lo spazio vuoto finale inserito automaticamente", "stablePeek": "Mantiene aperti gli editor rapidi anche quando si fa doppio clic sul contenuto o si preme ESC.", "dragAndDrop": "Controlla se l'editor consentire lo spostamento di selezioni tramite trascinamento della selezione.", + "accessibilitySupport.auto": "L'editor utilizzerà API della piattaforma per rilevare quando è collegata un'utilità per la lettura dello schermo.", + "accessibilitySupport.on": "L'editor sarà definitivamente ottimizzato per l'utilizzo con un'utilità per la lettura dello schermo.", + "accessibilitySupport.off": "L'editor non sarà mai ottimizzato per l'utilizzo con un'utilità per la lettura dello schermo.", + "accessibilitySupport": "Controlla se l'editor deve essere eseguito in una modalità ottimizzata per le utilità per la lettura dello schermo.", "sideBySide": "Controlla se l'editor diff mostra le differenze affiancate o incorporate", "ignoreTrimWhitespace": "Controlla se l'editor diff mostra come differenze le modifiche relative a spazi vuoti iniziali e finali", "renderIndicators": "Consente di controllare se l'editor diff mostra gli indicatori +/- per le modifiche aggiunte/rimosse", diff --git a/i18n/ita/src/vs/editor/common/config/editorOptions.i18n.json b/i18n/ita/src/vs/editor/common/config/editorOptions.i18n.json index 9c443a0f33d33c516d9a5ca9c7d4ed61714b5e82..77d08c0ba729bfa0917677a69a59be9b2b881d48 100644 --- a/i18n/ita/src/vs/editor/common/config/editorOptions.i18n.json +++ b/i18n/ita/src/vs/editor/common/config/editorOptions.i18n.json @@ -4,5 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "accessibilityOffAriaLabel": "L'editor non è accessibile in questo momento. Premere Alt+F1 per le opzioni.", "editorViewAccessibleLabel": "Contenuto editor" } \ No newline at end of file diff --git a/i18n/ita/src/vs/editor/common/view/editorColorRegistry.i18n.json b/i18n/ita/src/vs/editor/common/view/editorColorRegistry.i18n.json index 48a155767d2a59bb7361bb36281b25bc2efa0046..1eb8439fa14a61ec646d827cf535ea7471c6027d 100644 --- a/i18n/ita/src/vs/editor/common/view/editorColorRegistry.i18n.json +++ b/i18n/ita/src/vs/editor/common/view/editorColorRegistry.i18n.json @@ -16,5 +16,9 @@ "editorBracketMatchBackground": "Colore di sfondo delle parentesi corrispondenti", "editorBracketMatchBorder": "Colore delle caselle di parentesi corrispondenti", "editorOverviewRulerBorder": "Colore del bordo del righello delle annotazioni.", - "editorGutter": "Colore di sfondo della barra di navigazione dell'editor. La barra contiene i margini di glifo e i numeri di riga." + "editorGutter": "Colore di sfondo della barra di navigazione dell'editor. La barra contiene i margini di glifo e i numeri di riga.", + "errorForeground": "Colore primo piano degli squiggle di errore nell'editor.", + "errorBorder": "Colore del bordo degli squiggle di errore nell'editor.", + "warningForeground": "Colore primo piano degli squiggle di avviso nell'editor", + "warningBorder": "Colore del bordo degli squggle di avviso nell'editor." } \ No newline at end of file diff --git a/i18n/ita/src/vs/editor/contrib/find/common/findController.i18n.json b/i18n/ita/src/vs/editor/contrib/find/common/findController.i18n.json index 7161f553e2f4961208b7f0315eb40f3be842cd43..f95c682bc98240510f668d15b3716e548c340092 100644 --- a/i18n/ita/src/vs/editor/contrib/find/common/findController.i18n.json +++ b/i18n/ita/src/vs/editor/contrib/find/common/findController.i18n.json @@ -14,6 +14,5 @@ "addSelectionToPreviousFindMatch": "Aggiungi selezione a risultato ricerca precedente", "moveSelectionToNextFindMatch": "Sposta ultima selezione a risultato ricerca successivo", "moveSelectionToPreviousFindMatch": "Sposta ultima selezione a risultato ricerca precedente", - "selectAllOccurencesOfFindMatch": "Seleziona tutte le occorrenze del risultato ricerca", "changeAll.label": "Cambia tutte le occorrenze" } \ No newline at end of file diff --git a/i18n/ita/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.i18n.json b/i18n/ita/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..9df481ec1b5e88d2b3863142b1beb8f1a87c47b8 --- /dev/null +++ b/i18n/ita/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.i18n.json @@ -0,0 +1,23 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "noResultWord": "Non è stata trovata alcuna definizione per '{0}'", + "generic.noResults": "Non è stata trovata alcuna definizione", + "meta.title": " - Definizioni di {0}", + "actions.goToDecl.label": "Vai alla definizione", + "actions.goToDeclToSide.label": "Apri definizione lateralmente", + "actions.previewDecl.label": "Visualizza la definizione", + "goToImplementation.noResultWord": "Non sono state trovate implementazioni per '{0}'", + "goToImplementation.generic.noResults": "Non sono state trovate implementazioni", + "meta.implementations.title": "- {0} implementazioni", + "actions.goToImplementation.label": "Vai all'implementazione", + "actions.peekImplementation.label": "Anteprima implementazione", + "goToTypeDefinition.noResultWord": "Non sono state trovate definizioni di tipi per '{0}'", + "goToTypeDefinition.generic.noResults": "Non sono state trovate definizioni di tipi", + "meta.typeDefinitions.title": " - {0} definizioni di tipo", + "actions.goToTypeDefinition.label": "Vai alla definizione di tipo", + "actions.peekTypeDefinition.label": "Anteprima definizione di tipo" +} \ No newline at end of file diff --git a/i18n/ita/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.i18n.json b/i18n/ita/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..fa526a1f9e6c37486392a15a48ad0acbcf9502d4 --- /dev/null +++ b/i18n/ita/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "multipleResults": "Fare clic per visualizzare {0} definizioni." +} \ No newline at end of file diff --git a/i18n/ita/src/vs/editor/contrib/links/browser/links.i18n.json b/i18n/ita/src/vs/editor/contrib/links/browser/links.i18n.json index e5d5773a6995321a7db968f2dfc8e0ce14af7b60..969ff8d55c9b9fa6dbdf679b4497444c010217ed 100644 --- a/i18n/ita/src/vs/editor/contrib/links/browser/links.i18n.json +++ b/i18n/ita/src/vs/editor/contrib/links/browser/links.i18n.json @@ -6,6 +6,7 @@ { "links.navigate.mac": "Cmd + clic per seguire il collegamento", "links.navigate": "CTRL + clic per seguire il collegamento", + "links.navigate.al": "Alt + clic per seguire il collegamento", "invalid.url": "Non è stato possibile aprire questo collegamento perché il formato non è valido: {0}", "missing.url": "Non è stato possibile aprire questo collegamento perché manca la destinazione.", "label": "Apri il collegamento" diff --git a/i18n/ita/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json b/i18n/ita/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json index 63fbdbdb30f16b741f57b71d346447bf41fc797e..2548e746317e0d75b4da51296bf16f302bf5d552 100644 --- a/i18n/ita/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json +++ b/i18n/ita/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json @@ -5,8 +5,6 @@ // Do not edit this file. It is machine generated. { "aria.oneReference": "simbolo in {0} alla riga {1} colonna {2}", - "aria.fileReferences.1": "1 simbolo in {0}", - "aria.fileReferences.N": "{0} simboli in {1}", "aria.result.0": "Non sono stati trovati risultati", "aria.result.1": "Trovato 1 simbolo in {0}", "aria.result.n1": "Trovati {0} simboli in {1}", diff --git a/i18n/ita/src/vs/platform/actions/electron-browser/menusExtensionPoint.i18n.json b/i18n/ita/src/vs/platform/actions/electron-browser/menusExtensionPoint.i18n.json index 660d8200868465aed4bef8d9f00d9de0e81352ca..f595c9809b7b32fc0b31247203b380221576aca1 100644 --- a/i18n/ita/src/vs/platform/actions/electron-browser/menusExtensionPoint.i18n.json +++ b/i18n/ita/src/vs/platform/actions/electron-browser/menusExtensionPoint.i18n.json @@ -21,6 +21,8 @@ "menus.scmTitle": "Menu del titolo del controllo del codice sorgente", "menus.resourceGroupContext": "Menu di scelta rapida del gruppo di risorse del controllo del codice sorgente", "menus.resourceStateContext": "Menu di scelta rapida dello stato delle risorse del controllo del codice sorgente", + "view.viewTitle": "Menu del titolo della visualizzazione contribuita", + "view.itemContext": "Menu di contesto dell'elemento visualizzazione contribuita", "nonempty": "è previsto un valore non vuoto.", "opticon": "la proprietà `icon` può essere omessa o deve essere una stringa o un valore letterale come `{dark, light}`", "requireStringOrObject": "la proprietà `{0}` è obbligatoria e deve essere di tipo `object` o `string`", diff --git a/i18n/ita/src/vs/platform/extensions/common/extensionsRegistry.i18n.json b/i18n/ita/src/vs/platform/extensions/common/extensionsRegistry.i18n.json index e23bc5864c45261ec5a43b729b30bc244adabfee..afe0f0f288088512cd41e69b686ebc8b6f659d45 100644 --- a/i18n/ita/src/vs/platform/extensions/common/extensionsRegistry.i18n.json +++ b/i18n/ita/src/vs/platform/extensions/common/extensionsRegistry.i18n.json @@ -14,6 +14,12 @@ "vscode.extension.contributes": "Tutti i contributi dell'estensione Visual Studio Code rappresentati da questo pacchetto.", "vscode.extension.preview": "Imposta l'estensione in modo che venga contrassegnata come Anteprima nel Marketplace.", "vscode.extension.activationEvents": "Eventi di attivazione per l'estensione Visual Studio Code.", + "vscode.extension.activationEvents.onLanguage": "Un evento di attivazione emesso ogni volta che viene aperto un file che risolve nella lingua specificata.", + "vscode.extension.activationEvents.onCommand": "Un evento di attivazione emesso ogni volta che viene invocato il comando specificato.", + "vscode.extension.activationEvents.onDebug": "Un evento di attivazione emesso ogni volta che viene iniziata una sessione di debug del tipo specificato.", + "vscode.extension.activationEvents.workspaceContains": "Un evento di attivazione emesso ogni volta che si apre una cartella che contiene almeno un file corrispondente al criterio GLOB specificato.", + "vscode.extension.activationEvents.onView": "Un evento di attivazione emesso ogni volta che la visualizzazione specificata viene espansa.", + "vscode.extension.activationEvents.star": "Un evento di attivazione emesso all'avvio di VS Code. Per garantire la migliore esperienza per l'utente finale, sei pregato di utilizzare questo evento di attivazione nella tua estensione solo quando nessun'altra combinazione di eventi di attivazione funziona nel tuo caso.", "vscode.extension.badges": "Matrice di notifiche da visualizzare nella barra laterale della pagina delle estensioni del Marketplace.", "vscode.extension.badges.url": "URL di immagine della notifica.", "vscode.extension.badges.href": "Collegamento della notifica.", diff --git a/i18n/ita/src/vs/platform/history/electron-main/historyMainService.i18n.json b/i18n/ita/src/vs/platform/history/electron-main/historyMainService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..53a0dcd14b3752193e9dfcfaa532dabf999db1db --- /dev/null +++ b/i18n/ita/src/vs/platform/history/electron-main/historyMainService.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "newWindow": "Nuova finestra", + "newWindowDesc": "Apre una nuova finestra", + "recentFolders": "Cartelle recenti", + "folderDesc": "{0} {1}" +} \ No newline at end of file diff --git a/i18n/ita/src/vs/platform/markers/common/problemMatcher.i18n.json b/i18n/ita/src/vs/platform/markers/common/problemMatcher.i18n.json index a2611139aecce3a666f3e11ca8102c70ae8388d8..87b88acd38842b6789e76519f063bcca00856e90 100644 --- a/i18n/ita/src/vs/platform/markers/common/problemMatcher.i18n.json +++ b/i18n/ita/src/vs/platform/markers/common/problemMatcher.i18n.json @@ -34,6 +34,7 @@ "ProblemMatcherParser.noValidIdentifier": "Errore: la proprietà {0} del criterio non è un nome di variabile criterio valido.", "ProblemMatcherParser.problemPattern.watchingMatcher": "Un matcher problemi deve definire un criterio di inizio e un criterio di fine per il controllo.", "ProblemMatcherParser.invalidRegexp": "Errore: la stringa {0} non è un'espressione regolare valida.\n", + "WatchingPatternSchema.regexp": "L'espressione regolare per rilevare l'inizio o la fine di un'attività in background.", "WatchingPatternSchema.file": "Indice del gruppo di corrispondenze del nome file. Può essere omesso.", "PatternTypeSchema.name": "Nome di un criterio predefinito o aggiunto come contributo", "PatternTypeSchema.description": "Criterio di problema o nome di un criterio di problema predefinito o aggiunto come contributo. Può essere omesso se si specifica base.", @@ -42,6 +43,12 @@ "ProblemMatcherSchema.severity": "Gravità predefinita per i problemi di acquisizione. Viene usato se il criterio non definisce un gruppo di corrispondenze per la gravità.", "ProblemMatcherSchema.applyTo": "Controlla se un problema segnalato in un documento di testo è valido solo per i documenti aperti o chiusi oppure per tutti i documenti.", "ProblemMatcherSchema.fileLocation": "Consente di definire come interpretare i nomi file indicati in un criterio di problema.", + "ProblemMatcherSchema.background": "Criteri per tenere traccia dell'inizio e della fine di un matcher attivo su un'attività in background.", + "ProblemMatcherSchema.background.activeOnStart": "Se impostato a true, il monitor in backbround è in modalità attiva quando l'attività inizia. Equivale a inviare una riga che corrisponde al beginPattern", + "ProblemMatcherSchema.background.beginsPattern": "Se corrisponde nell'output, viene segnalato l'avvio di un'attività in background.", + "ProblemMatcherSchema.background.endsPattern": "Se corrisponde nell'output, viene segnalata la fine di un'attività in background.", + "ProblemMatcherSchema.watching.deprecated": "La proprietà watching è deprecata. In alternativa, utilizzare background (sfondo).", + "ProblemMatcherSchema.watching": "Criteri per tenere traccia dell'inizio e della fine di un matcher watching.", "ProblemMatcherSchema.watching.activeOnStart": "Se impostato su true, indica che il watcher è in modalità attiva all'avvio dell'attività. Equivale a inviare una riga che corrisponde al criterio di avvio", "ProblemMatcherSchema.watching.beginsPattern": "Se corrisponde nell'output, viene segnalato l'avvio di un'attività di controllo.", "ProblemMatcherSchema.watching.endsPattern": "Se corrisponde nell'output, viene segnalata la fine di un'attività di controllo.", diff --git a/i18n/ita/src/vs/platform/theme/common/colorRegistry.i18n.json b/i18n/ita/src/vs/platform/theme/common/colorRegistry.i18n.json index e1d1005789b543eb091910a2f6dc27b9abe88052..bfe7913ae5f568f96cee540293c89b2bf590c795 100644 --- a/i18n/ita/src/vs/platform/theme/common/colorRegistry.i18n.json +++ b/i18n/ita/src/vs/platform/theme/common/colorRegistry.i18n.json @@ -12,7 +12,6 @@ "focusBorder": "Colore dei bordi degli elementi evidenziati. Questo colore è utilizzato solo se non viene sovrascritto da un componente.", "contrastBorder": "Un bordo supplementare attorno agli elementi per contrastarli maggiormente rispetto agli altri.", "activeContrastBorder": "Un bordo supplementare intorno agli elementi attivi per contrastarli maggiormente rispetto agli altri.", - "selectionBackground": "Il colore di sfondo delle selezioni di testo nel workbench (ad esempio per i campi di input o aree di testo). Si noti che questo non si applica alle selezioni all'interno dell'editor e del terminale.", "textSeparatorForeground": "Colore dei separatori di testo.", "textLinkForeground": "Colore primo piano dei link nel testo.", "textLinkActiveForeground": "Colore primo piano dei link attivi nel testo.", @@ -60,7 +59,7 @@ "editorBackground": "Colore di sfondo dell'editor.", "editorForeground": "Colore primo piano predefinito dell'editor.", "editorWidgetBackground": "Colore di sfondo dei widget dell'editor, ad esempio Trova/Sostituisci.", - "editorWidgetBorder": "Colore del bordo del widget editor.", + "editorWidgetBorder": "Colore bordo dei widget dell'editor. Il colore viene utilizzato solo se il widget sceglie di avere un bordo e se il colore non è sottoposto a override da un widget.", "editorSelection": "Colore della selezione dell'editor.", "editorInactiveSelection": "Colore della selezione in un editor inattivo.", "editorSelectionHighlight": "Colore delle aree con lo stesso contenuto della selezione.", @@ -74,5 +73,12 @@ "diffEditorInserted": "Colore di sfondo del testo che è stato inserito.", "diffEditorRemoved": "Colore di sfondo del testo che è stato rimosso.", "diffEditorInsertedOutline": "Colore del contorno del testo che è stato inserito.", - "diffEditorRemovedOutline": "Colore del contorno del testo che è stato rimosso." + "diffEditorRemovedOutline": "Colore del contorno del testo che è stato rimosso.", + "mergeCurrentHeaderBackground": "Sfondo intestazione corrente in conflitti di merge in linea.", + "mergeCurrentContentBackground": "Sfondo contenuto corrente in conflitti di merge in linea.", + "mergeIncomingHeaderBackground": "Sfondo intestazione modifica in ingresso in conflitti di merge in linea.", + "mergeIncomingContentBackground": "Sfondo contenuto modifica in ingresso in conflitti di merge in linea.", + "mergeBorder": "Colore bordo su intestazioni e sulla barra di divisione di conflitti di merge in linea.", + "overviewRulerCurrentContentForeground": "Colore primo piano righello panoramica attuale per i conflitti di merge in linea.", + "overviewRulerIncomingContentForeground": "Colore primo piano del righello panoramica modifiche in arrivo per i conflitti di merge in linea." } \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/api/node/extHostTask.i18n.json b/i18n/ita/src/vs/workbench/api/node/extHostTask.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..4b90a12aaf247b4a1af0e887542958471d8df5e5 --- /dev/null +++ b/i18n/ita/src/vs/workbench/api/node/extHostTask.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "task.label": "{0}: {1}" +} \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/api/node/extHostTreeViews.i18n.json b/i18n/ita/src/vs/workbench/api/node/extHostTreeViews.i18n.json index 8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a..04c4b11db8ce880414ddf274995758b9caf0ec71 100644 --- a/i18n/ita/src/vs/workbench/api/node/extHostTreeViews.i18n.json +++ b/i18n/ita/src/vs/workbench/api/node/extHostTreeViews.i18n.json @@ -3,4 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. -{} \ No newline at end of file +{ + "treeView.notRegistered": "Nessuna visualizzazione di struttura ad albero con ID '{0}' registrata.", + "treeItem.notFound": "Nessun elemento di struttura ad albero con id '{0}' trovato.", + "treeView.duplicateElement": "L'elemento {0} è già registrato" +} \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/browser/actions/configureLocale.i18n.json b/i18n/ita/src/vs/workbench/browser/actions/configureLocale.i18n.json index c9c8c1ec3e54ce70271603da4f0a8d63fe51116b..a124f7f6f312ea1123dd8c6e2ad7c9d732047844 100644 --- a/i18n/ita/src/vs/workbench/browser/actions/configureLocale.i18n.json +++ b/i18n/ita/src/vs/workbench/browser/actions/configureLocale.i18n.json @@ -7,6 +7,7 @@ "configureLocale": "Configura lingua", "displayLanguage": "Definisce la lingua visualizzata di VSCode.", "doc": "Per un elenco delle lingue supportate, vedere {0}.", + "restart": "Se si modifica il valore, è necessario riavviare VSCode.", "fail.createSettings": "Non è possibile creare '{0}' ({1}).", "JsonSchema.locale": "Linguaggio dell'interfaccia utente da usare." } \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/browser/parts/activitybar/activitybarPart.i18n.json b/i18n/ita/src/vs/workbench/browser/parts/activitybar/activitybarPart.i18n.json index 16c143386a8ea594911bf1af18da4cef244e25dc..d8cbee32bd51574ddb5e4392615744d3b7fc7a19 100644 --- a/i18n/ita/src/vs/workbench/browser/parts/activitybar/activitybarPart.i18n.json +++ b/i18n/ita/src/vs/workbench/browser/parts/activitybar/activitybarPart.i18n.json @@ -5,5 +5,6 @@ // Do not edit this file. It is machine generated. { "hideActivitBar": "Nascondi barra attività", - "activityBarAriaLabel": "Cambio visualizzazione attiva" + "activityBarAriaLabel": "Cambio visualizzazione attiva", + "globalActions": "Azioni globali" } \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/browser/parts/editor/editorStatus.i18n.json b/i18n/ita/src/vs/workbench/browser/parts/editor/editorStatus.i18n.json index 67fd42257c13d43fb565ef35dc1acb119af61d3a..844b3b480601ed6727dc6273e4393cb36d4890c9 100644 --- a/i18n/ita/src/vs/workbench/browser/parts/editor/editorStatus.i18n.json +++ b/i18n/ita/src/vs/workbench/browser/parts/editor/editorStatus.i18n.json @@ -10,7 +10,7 @@ "multiSelection": "{0} selezioni", "endOfLineLineFeed": "LF", "endOfLineCarriageReturnLineFeed": "CRLF", - "tabFocusModeEnabled": "Premere TAB per spostare lo stato attivo", + "screenReaderDetectedExtra": "Se non si utilizza un'utilità per la lettura dello schermo, si prega di impostare 'editor.accessibilitySupport' a \"off\".", "disableTabMode": "Disabilita modalità accessibilità", "gotoLine": "Vai alla riga", "indentation": "Rientro", diff --git a/i18n/ita/src/vs/workbench/browser/parts/quickopen/quickopen.i18n.json b/i18n/ita/src/vs/workbench/browser/parts/quickopen/quickopen.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..6a397dbe56c5274c13e5d84223fcdcf14dea4375 --- /dev/null +++ b/i18n/ita/src/vs/workbench/browser/parts/quickopen/quickopen.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "quickOpen": "Vai al file...", + "quickNavigateNext": "Passa a successiva in Quick Open", + "quickNavigatePrevious": "Passa a precedente in Quick Open", + "quickSelectNext": "Seleziona successiva in Quick Open", + "quickSelectPrevious": "Seleziona precedente in Quick Open" +} \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/browser/quickopen.i18n.json b/i18n/ita/src/vs/workbench/browser/quickopen.i18n.json index 5bd60920cf465fb1056a66875863515f3f864c60..4419620dddd1d582353d5fbed67fdcdcd63335ad 100644 --- a/i18n/ita/src/vs/workbench/browser/quickopen.i18n.json +++ b/i18n/ita/src/vs/workbench/browser/quickopen.i18n.json @@ -6,6 +6,5 @@ { "noResultsMatching": "Non ci sono risultati corrispondenti", "noResultsFound2": "Non sono stati trovati risultati", - "entryAriaLabel": "{0}, comando", - "noCommands": "Non ci sono comandi corrispondenti" + "entryAriaLabel": "{0}, comando" } \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/browser/viewlet.i18n.json b/i18n/ita/src/vs/workbench/browser/viewlet.i18n.json index 318000e27181147e9324fb224d0398fe3e2ed09c..7ffc4d29a97a273eb03807d82eab6319e415dc9c 100644 --- a/i18n/ita/src/vs/workbench/browser/viewlet.i18n.json +++ b/i18n/ita/src/vs/workbench/browser/viewlet.i18n.json @@ -4,6 +4,5 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "collapse": "Comprimi tutto", - "viewToolbarAriaLabel": "Azioni di {0}" + "collapse": "Comprimi tutto" } \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/common/theme.i18n.json b/i18n/ita/src/vs/workbench/common/theme.i18n.json index 05253aee2c400bda9827d3132fd7b3758fdc0f68..bdefeb9c236953ccdbd74f6666958e840a58c7ca 100644 --- a/i18n/ita/src/vs/workbench/common/theme.i18n.json +++ b/i18n/ita/src/vs/workbench/common/theme.i18n.json @@ -7,11 +7,16 @@ "tabActiveBackground": "Colore di sfondo delle schede attive. Le schede sono i contenitori degli editor nell'area degli editor. È possibile aprire più schede in un gruppo di editor e possono esistere più gruppi di editor.", "tabInactiveBackground": "Colore di sfondo delle schede inattive. Le schede sono i contenitori degli editor nell'area degli editor. È possibile aprire più schede in un gruppo di editor e possono esistere più gruppi di editor.", "tabBorder": "Bordo per separare le schede l'una dall'altra. Le schede sono i contenitori degli editor nell'area degli editor. È possibile aprire più schede in un gruppo di editor e possono esistere più gruppi di editor.", - "tabActiveEditorGroupActiveForeground": "Colore di primo piano delle schede attive in un gruppo attivo. Le schede sono i contenitori degli editor nell'area degli editor. È possibile aprire più schede in un gruppo di editor e possono esistere più gruppi di editor.", - "tabInactiveEditorGroupActiveForeground": "Colore di primo piano delle schede inattive in un gruppo attivo. Le schede sono i contenitori degli editor nell'area degli editor. È possibile aprire più schede in un gruppo di editor e possono esistere più gruppi di editor.", + "tabActiveForeground": "Colore di primo piano delle schede attive in un gruppo attivo. Le schede sono i contenitori degli editor nell'area degli editor. È possibile aprire più schede in un gruppo di editor e possono esistere più gruppi di editor.", + "tabInactiveForeground": "Colore di primo piano delle schede inattive in un gruppo attivo. Le schede sono i contenitori degli editor nell'area degli editor. È possibile aprire più schede in un gruppo di editor e possono esistere più gruppi di editor.", + "tabUnfocusedActiveForeground": "Colore di primo piano delle schede attive in un gruppo inattivo. Le schede sono i contenitori degli editor nell'area degli editor. È possibile aprire più schede in un gruppo di editor e possono esistere più gruppi di editor.", + "tabUnfocusedInactiveForeground": "Colore di primo piano delle schede inattiva in un gruppo inattivo. Le schede sono i contenitori degli editor nell'area degli editor. È possibile aprire più schede in un gruppo di editor e possono esistere più gruppi di editor.", "editorGroupBackground": "Colore di sfondo di un gruppo di editor. I gruppi di editor sono contenitori di editor. Il colore di sfondo viene visualizzato quando si trascinano i gruppi di editor in un'altra posizione.", + "tabsContainerBackground": "Colore di sfondo dell'intestazione del titolo di gruppo di editor, quando le schede sono abilitate. I gruppi di editor sono i contenitori degli editor.", + "tabsContainerBorder": "Colore del bordo dell'intestazione del titolo di gruppo di editor, quando le schede sono abilitate. I gruppi di editor sono i contenitori degli editor.", "editorGroupHeaderBackground": "Colore di sfondo dell'intestazione del titolo dell'editor quando le schede sono disabilitate. I gruppi di editor sono contenitori di editor.", "editorGroupBorder": "Colore per separare più gruppi di editor l'uno dall'altro. I gruppi di editor sono i contenitori degli editor.", + "editorDragAndDropBackground": "Colore di sfondo quando si trascinano gli editor. Il colore dovrebbe avere una trasparenza impostata in modo che il contenuto dell'editor sia ancora visibile.", "panelBackground": "Colore di sfondo dei pannelli. I pannelli sono visualizzati sotto l'area degli editor e contengono visualizzazioni quali quella di output e del terminale integrato.", "panelBorder": "Colore del bordo dei pannelli nella parte superiore di separazione dall'editor. I pannelli sono visualizzati sotto l'area degli editor e contengono visualizzazioni quali quella di output e del terminale integrato.", "panelActiveTitleForeground": "Colore del titolo del pannello attivo. I pannelli sono visualizzati sotto l'area degli editor e contengono visualizzazioni quali quella di output e quella del terminale integrato.", @@ -19,18 +24,25 @@ "panelActiveTitleBorder": "Colore del bordo del titolo del pannello attivo. I pannelli sono visualizzati sotto l'area degli editor e contengono visualizzazioni quali quella di output e del terminale integrato.", "statusBarForeground": "Colore primo piano della barra di stato. La barra di stato è visualizzata nella parte inferiore della finestra.", "statusBarBackground": "Colore di sfondo della barra di stato standard. La barra di stato è visualizzata nella parte inferiore della finestra.", + "statusBarBorder": "Colore del bordo della barra di stato che la separa dalla sidebar e dall'editor. La barra di stato è visualizzata nella parte inferiore della finestra.", "statusBarNoFolderBackground": "Colore di sfondo della barra di stato quando non ci sono cartelle aperte. La barra di stato è visualizzata nella parte inferiore della finestra.", + "statusBarNoFolderForeground": "Colore primo piano quando non ci sono cartelle aperte. La barra di stato è visualizzata nella parte inferiore della finestra.", "statusBarItemActiveBackground": "Colore di sfondo degli elementi della barra di stato quando si fa clic. La barra di stato è visualizzata nella parte inferiore della finestra.", "statusBarItemHoverBackground": "Colore di sfondo degli elementi della barra di stato al passaggio del mouse. La barra di stato è visualizzata nella parte inferiore della finestra.", "statusBarProminentItemBackground": "Colore di sfondo degli elementi rilevanti della barra di stato. Gli elementi rilevanti spiccano rispetto ad altre voci della barra di stato. La barra di stato è visualizzata nella parte inferiore della finestra.", "statusBarProminentItemHoverBackground": "Colore di sfondo degli elementi rilevanti della barra di stato al passaggio del mouse. Gli elementi rilevanti spiccano rispetto ad altre voci della barra di stato. La barra di stato è visualizzata nella parte inferiore della finestra.", "activityBarBackground": "Colore di sfondo della barra attività. La barra attività viene visualizzata nella parte inferiore sinistra/destra e consente il passaggio tra diverse visualizzazioni della barra laterale", "activityBarForeground": "Colore primo piano della barra attività (ad es. quello utilizzato per le icone). La barra attività viene mostrata all'estrema sinistra o destra e permette di alternare le visualizzazioni della barra laterale.", + "activityBarBorder": "Colore del bordo della barra attività che la separa dalla barra laterale. La barra di attività viene mostrata all'estrema sinistra o destra e permette di alternare le visualizzazioni della barra laterale.", + "activityBarDragAndDropBackground": "Colore feedback drag and drop per gli elementi della barra di attività. Il colore dovrebbe avere una trasparenza impostata in modo che le voci della barra di attività possano ancora essere visibili. La barra di attività viene mostrata all'estrema sinistra o destra e permette di alternare le visualizzazioni della barra laterale.", "activityBarBadgeBackground": "Colore di sfondo della notifica utente dell'attività. La barra attività viene visualizzata all'estrema sinistra o all'estrema destra e consente di spostarsi tra le visualizzazioni della barra laterale.", "activityBarBadgeForeground": "Colore primo piano della notifica utente dell'attività. La barra attività viene visualizzata all'estrema sinistra o all'estrema destra e consente di spostarsi tra le visualizzazioni della barra laterale.", "sideBarBackground": "Colore di sfondo della barra laterale. La barra laterale è il contenitore per visualizzazioni come Explorer e ricerca.", + "sideBarForeground": "Colore primo piano della barra laterale. La barra laterale è il contenitore per le visualizzazioni come Esplora risorse e Cerca.", + "sideBarBorder": "Colore del bordo della barra laterale che la separa all'editor. La barra laterale è il contenitore per visualizzazioni come Esplora risorse e Cerca.", "sideBarTitleForeground": "Colore primo piano del titolo della barra laterale. La barra laterale è il contenitore per visualizzazioni come Explorer e ricerca.", "sideBarSectionHeaderBackground": "Colore di sfondo dell'intestazione di sezione della barra laterale. La barra laterale è il contenitore di visualizzazioni quali Esplora risorse e Cerca.", + "sideBarSectionHeaderForeground": "Colore primo piano dell'intestazione di sezione della barra laterale. La barra laterale è il contenitore di visualizzazioni come Esplora risorse e Cerca.", "titleBarActiveForeground": "Colore primo piano della barra del titolo quando la finestra è attiva. Si noti che questo colore è attualmente supportato solo su macOS.", "titleBarInactiveForeground": "Colore primo piano della barra del titolo quando la finestra è inattiva. Si noti che questo colore è attualmente supportato solo su macOS.", "titleBarActiveBackground": "Colore di sfondo della barra di titolo quando la finestra è attiva. Si noti che questo colore è attualmente solo supportati su macOS.", diff --git a/i18n/ita/src/vs/workbench/electron-browser/actions.i18n.json b/i18n/ita/src/vs/workbench/electron-browser/actions.i18n.json index c1c0558b02c8a33e5542ae8a242449a1368948c4..d9d488bcccd338a60ca51e9872688a040434d616 100644 --- a/i18n/ita/src/vs/workbench/electron-browser/actions.i18n.json +++ b/i18n/ita/src/vs/workbench/electron-browser/actions.i18n.json @@ -6,9 +6,6 @@ { "closeActiveEditor": "Chiudi editor", "closeWindow": "Chiudi finestra", - "switchWindow": "Cambia finestra", - "switchWindowPlaceHolder": "Selezionare una finestra", - "current": "Finestra corrente", "closeFolder": "Chiudi cartella", "noFolderOpened": "In questa istanza non ci sono attualmente cartelle aperte da chiudere.", "newWindow": "Nuova finestra", @@ -20,7 +17,7 @@ "zoomReset": "Reimposta zoom", "appPerf": "Prestazioni all'avvio", "reloadWindow": "Ricarica finestra", - "openRecent": "Apri recenti", + "current": "Finestra corrente", "folders": "cartelle", "files": "file", "openRecentPlaceHolderMac": "Selezionare un percorso (tenere premuto CMD per aprirlo in una nuova finestra)", @@ -32,10 +29,6 @@ "openDocumentationUrl": "Documentazione", "openIntroductoryVideosUrl": "Video introduttivi", "toggleSharedProcess": "Attiva/Disattiva processo condiviso", - "navigateLeft": "Passa alla visualizzazione a sinistra", - "navigateRight": "Passa alla visualizzazione a destra", - "navigateUp": "Passa alla visualizzazione in alto", - "navigateDown": "Passa alla visualizzazione in basso", "increaseViewSize": "Aumenta la dimensione della visualizzazione corrente", "decreaseViewSize": "Diminuisce la dimensione della visualizzazione corrente" } \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/electron-browser/main.contribution.i18n.json b/i18n/ita/src/vs/workbench/electron-browser/main.contribution.i18n.json index c034a8cc727bf818f0cb742171f1dd1dc6462c78..b12b597ea59fa59484b9c1b48fdf5324b86f987b 100644 --- a/i18n/ita/src/vs/workbench/electron-browser/main.contribution.i18n.json +++ b/i18n/ita/src/vs/workbench/electron-browser/main.contribution.i18n.json @@ -7,6 +7,7 @@ "view": "Visualizza", "help": "Guida", "file": "File", + "developer": "Sviluppatore", "showEditorTabs": "Controlla se visualizzare o meno gli editor aperti in schede.", "editorTabCloseButton": "Controlla la posizione dei pulsanti di chiusura delle schede dell'editor oppure li disabilita quando è impostata su 'off'.", "showIcons": "Controlla se visualizzare o meno un'icona per gli editor aperti. Richiede l'abilitazione anche di un tema dell'icona.", @@ -30,10 +31,6 @@ "window.openFoldersInNewWindow.off": "Le cartelle sostituiranno l'ultima finestra attiva", "window.openFoldersInNewWindow.default": "Le cartelle verranno aperte in una nuova finestra a meno che non si selezioni una cartella dall'interno dell'applicazione, ad esempio tramite il menu File", "openFoldersInNewWindow": "Controlla se le cartelle devono essere aperte in una nuova finestra o sostituire l'ultima finestra attiva.\n- default: le cartelle verranno aperte in una nuova finestra a meno che non si selezioni una cartella dall'interno dell'applicazione, ad esempio tramite il menu File\n- on: le cartelle verranno aperte in una nuova finestra\n- off: le cartelle sostituiranno l'ultima finestra attiva\nNota: possono comunque verificarsi casi in cui questa impostazione viene ignorata, ad esempio quando si usa l'opzione della riga di comando -new-window o -reuse-window.", - "window.reopenFolders.none": "Non apre nessuna cartella.", - "window.reopenFolders.one": "Riapre l'ultima cartella attiva.", - "window.reopenFolders.all": "Riapre tutte le cartelle dell'ultima sessione.", - "reopenFolders": "Controlla la modalità di riapertura delle cartelle dopo un riavvio. Selezionare 'none' per non riaprire mai una cartella, 'one' per riaprire l'ultima cartella usata oppure 'all' per riaprire tutte le cartelle dell'ultima sessione.", "restoreFullscreen": "Controlla se una finestra deve essere ripristinata a schermo intero se è stata chiusa in questa modalità.", "zoomLevel": "Consente di modificare il livello di zoom della finestra. Il valore originale è 0 e ogni incremento superiore (ad esempio 1) o inferiore (ad esempio -1) rappresenta un aumento o una diminuzione del 20% della percentuale di zoom. È anche possibile immettere valori decimali per modificare il livello di zoom con maggiore granularità.", "title": "Controlla il titolo della finestra in base all'editor attivo. Le variabili vengono sostituite a seconda del contesto:\n${activeEditorShort}: ad esempio myFile.txt\n${activeEditorMedium}: ad esempio myFolder/myFile.txt\n${activeEditorLong}: ad esempio /Users/Development/myProject/myFolder/myFile.txt\n${rootName}: ad esempio myProject\n${rootPath}: ad esempio /Users/Development/myProject\n${appName}: ad esempio VS Code\n${dirty}: un indicatore dirty se l'editor attivo è dirty\n${separator}: un separatore condizionale (\" - \") visualizzato solo se circondato da variabili con valori", @@ -41,11 +38,13 @@ "window.newWindowDimensions.inherit": "Apre nuove finestre le cui dimensioni sono uguali a quelle dell'ultima finestra attiva.", "window.newWindowDimensions.maximized": "Apre nuove finestre ingrandite a schermo intero.", "window.newWindowDimensions.fullscreen": "Apre nuove finestre nella modalità a schermo intero.", + "newWindowDimensions": "Controlla le dimensioni relative all'apertura di una nuova finestra quando almeno un'altra finestra è già aperta. Per impostazione predefinita, una nuova finestra di dimensioni ridotte viene aperta al centro della schermata. Se è impostata su 'inherit', la finestra assumerà le stesse dimensioni dell'ultima finestra attiva. Se è impostata su 'maximized', la finestra aperta risulterà ingrandita, mentre con 'fullscreen' verrà visualizzata a schermo intero. Sia noti che questa impostazione non impatta sulla prima finestra che era stata aperta. La prima finestra si riaprirà sempre con la dimensione e la posizione che aveva prima della chiusura.", "window.menuBarVisibility.default": "Il menu è nascosto solo nella modalità a schermo intero.", "window.menuBarVisibility.visible": "Il menu è sempre visibile, anche nella modalità a schermo intero.", "window.menuBarVisibility.toggle": "Il menu è nascosto ma può essere visualizzato premendo ALT.", "window.menuBarVisibility.hidden": "Il menu è sempre nascosto.", "menuBarVisibility": "Controlla la visibilità della barra dei menu. L'impostazione 'toggle' indica che la barra dei menu è nascosta e che per visualizzarla è necessario premere una sola volta il tasto ALT. Per impostazione predefinita, la barra dei menu è visibile a meno che la finestra non sia a schermo intero.", + "enableMenuBarMnemonics": "Se abilitato, i menu principali possono essere aperti tramite tasti di scelta rapida Alt + tasto. Disattivare i tasti di scelta permette invece di associare questi tasti di scelta rapida Alt + tasto ai comandi dell'editor.", "autoDetectHighContrast": "Se è abilitata, passa automaticamente a un tema a contrasto elevato se Windows usa un tema di questo tipo e al tipo scuro quando non si usa più un tema a contrasto elevato Windows.", "titleBarStyle": "Consente di modificare l'aspetto della barra del titolo della finestra. Per applicare le modifiche, è necessario un riavvio completo.", "window.nativeTabs": "Abilita le finestre di tab per macOS Sierra. La modifica richiede un riavvio. Eventuali personalizzazioni della barra del titolo verranno disabilitate", @@ -55,5 +54,7 @@ "zenMode.hideTabs": "Controlla se attivando la modalità Zen vengono nascoste anche le schede del workbench.", "zenMode.hideStatusBar": "Controlla se attivando la modalità Zen viene nascosta anche la barra di stato nella parte inferiore del workbench.", "zenMode.hideActivityBar": "Controlla se attivando la modalità Zen viene nascosta anche la barra di stato alla sinistra del workbench", - "zenMode.restore": "Controlla se una finestra deve essere ripristinata nella modalità Zen se è stata chiusa in questa modalità." + "zenMode.restore": "Controlla se una finestra deve essere ripristinata nella modalità Zen se è stata chiusa in questa modalità.", + "workspaceConfigurationTitle": "Area di lavoro", + "files.exclude.boolean": "Criterio GLOB da usare per trovare percorsi file. Impostare su True o False per abilitare o disabilitare il criterio." } \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/electron-browser/workbench.i18n.json b/i18n/ita/src/vs/workbench/electron-browser/workbench.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..8392fa958357cfc717e1f4b00fbef1f8e711e387 --- /dev/null +++ b/i18n/ita/src/vs/workbench/electron-browser/workbench.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "developer": "Sviluppatore", + "file": "File" +} \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/codeEditor/electron-browser/accessibility.i18n.json b/i18n/ita/src/vs/workbench/parts/codeEditor/electron-browser/accessibility.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..01386d943158ff8761bc6529e8326d1af99f5121 --- /dev/null +++ b/i18n/ita/src/vs/workbench/parts/codeEditor/electron-browser/accessibility.i18n.json @@ -0,0 +1,26 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "emergencyConfOn": "Modifica dell'impostazione 'editor.accessibilitySupport' a 'on' in corso.", + "openingDocs": "Apertura della pagina di documentazione sull'accessibilità di VS Code in corso.", + "introMsg": "Grazie per aver provato le opzioni di accessibilità di Visual Studio Code.", + "status": "Stato:", + "changeConfigToOnMac": "Premere Comando+E per configurare l'editor per essere definitivamente ottimizzato per l'utilizzo con un un'utilità per la lettura dello schermo.", + "changeConfigToOnWinLinux": "Premere Control+E per configurare l'editor per essere definitivamente ottimizzato per l'utilizzo con un un'utilità per la lettura dello schermo.", + "auto_unknown": "L'editor è configurato per utilizzare le API della piattaforma per rilevare quando è collegata un'utilità per la lettura dello schermo ma il runtime corrente non lo supporta.", + "auto_on": "L'editor ha rilevato automaticamente che è collegata un'utilità per la lettura dello schermo.", + "auto_off": "L'editor è configurato per rilevare automaticamente quando è collegata un'utilità per la lettura dello schermo, che non è collegata in questo momento.", + "configuredOn": "L'editor è configurato per essere definitivamente ottimizzato per l'utilizzo con un'utilità per la lettura dello schermo - è possibile modificare questo modificando l'impostazione 'editor.accessibilitySupport'.", + "configuredOff": "L'editor è configurato per non essere ottimizzato per l'utilizzo con un'utilità per la lettura dello schermo.", + "tabFocusModeOnMsg": "Premere TAB nell'editor corrente per spostare lo stato attivo sull'elemento con stato attivabile successivo. Per attivare/disattivare questo comportamento, premere {0}.", + "tabFocusModeOnMsgNoKb": "Premere TAB nell'editor corrente per spostare lo stato attivo sull'elemento con stato attivabile successivo. Il comando {0} non può essere attualmente attivato con un tasto di scelta rapida.", + "tabFocusModeOffMsg": "Premere TAB nell'editor corrente per inserire il carattere di tabulazione. Per attivare/disattivare questo comportamento, premere {0}.", + "tabFocusModeOffMsgNoKb": "Premere TAB nell'editor corrente per inserire il carattere di tabulazione. Il comando {0} non può essere attualmente attivato con un tasto di scelta rapida.", + "openDocMac": "Premere Comando+H per aprire una finestra del browser con maggiori informazioni relative all'accessibilità di VS Code.", + "openDocWinLinux": "Premere Control+H per aprire una finestra del browser con maggiori informazioni relative all'accessibilità di VS Code.", + "outroMsg": "Per chiudere questa descrizione comando e tornare all'editor, premere ESC o MAIUSC+ESC.", + "ShowAccessibilityHelpAction": "Visualizza la Guida sull'accessibilità" +} \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/codeEditor/electron-browser/inspectTMScopes.i18n.json b/i18n/ita/src/vs/workbench/parts/codeEditor/electron-browser/inspectTMScopes.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a --- /dev/null +++ b/i18n/ita/src/vs/workbench/parts/codeEditor/electron-browser/inspectTMScopes.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{} \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/codeEditor/electron-browser/toggleMultiCursorModifier.i18n.json b/i18n/ita/src/vs/workbench/parts/codeEditor/electron-browser/toggleMultiCursorModifier.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..839633747f5227b4236b6e3436fba74743a967d1 --- /dev/null +++ b/i18n/ita/src/vs/workbench/parts/codeEditor/electron-browser/toggleMultiCursorModifier.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "toggleLocation": "Modificatore per l'attivazione/disattivazione multi-cursore" +} \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/debug/browser/debugActions.i18n.json b/i18n/ita/src/vs/workbench/parts/debug/browser/debugActions.i18n.json index d4c6f2a648693764c882146bd16d162b18f86ab9..dbac73dc76fea96f22a0c591e9a5ac3ac9593a5e 100644 --- a/i18n/ita/src/vs/workbench/parts/debug/browser/debugActions.i18n.json +++ b/i18n/ita/src/vs/workbench/parts/debug/browser/debugActions.i18n.json @@ -6,6 +6,7 @@ { "openLaunchJson": "Apri {0}", "launchJsonNeedsConfigurtion": "Configurare o correggere 'launch.json'", + "noFolderDebugConfig": "Si prega di aprire prima una cartella per consentire una configurazione di debug avanzato.", "startDebug": "Avvia debug", "startWithoutDebugging": "Avvia senza eseguire debug", "selectAndStartDebugging": "Seleziona e avvia il debug", diff --git a/i18n/ita/src/vs/workbench/parts/debug/electron-browser/debugCommands.i18n.json b/i18n/ita/src/vs/workbench/parts/debug/electron-browser/debugCommands.i18n.json index 8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a..f521324695bc9dab0be848088dfb4d48425986a4 100644 --- a/i18n/ita/src/vs/workbench/parts/debug/electron-browser/debugCommands.i18n.json +++ b/i18n/ita/src/vs/workbench/parts/debug/electron-browser/debugCommands.i18n.json @@ -3,4 +3,6 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. -{} \ No newline at end of file +{ + "noFolderDebugConfig": "Si prega di aprire prima una cartella per consentire una configurazione di debug avanzato." +} \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/debug/electron-browser/debugService.i18n.json b/i18n/ita/src/vs/workbench/parts/debug/electron-browser/debugService.i18n.json index d5422d908c394bb608caf96c1e10273611d9df7b..e90a97c9394f80a359b9cba82ee2c87c4309bf47 100644 --- a/i18n/ita/src/vs/workbench/parts/debug/electron-browser/debugService.i18n.json +++ b/i18n/ita/src/vs/workbench/parts/debug/electron-browser/debugService.i18n.json @@ -5,8 +5,8 @@ // Do not edit this file. It is machine generated. { "snapshotObj": "Per questo oggetto vengono visualizzati solo i valori primitivi.", - "debuggingStarted": "Il debug è stato avviato.", "debuggingPaused": "Il debug è stato sospeso. Motivo: {0}, {1} {2}", + "debuggingStarted": "Il debug è stato avviato.", "debuggingStopped": "Il debug è stato arrestato.", "breakpointAdded": "Aggiunto un punto di interruzione a riga {0} del file {1}", "breakpointRemoved": "Rimosso un punto di interruzione a riga {0} del file {1}", diff --git a/i18n/ita/src/vs/workbench/parts/debug/electron-browser/debugViews.i18n.json b/i18n/ita/src/vs/workbench/parts/debug/electron-browser/debugViews.i18n.json index 87d81fe21420bde0f17acb98b8c904b53900b9bd..78aa8974cb4eaa0ef269a05b76bb105b0d1bb9f2 100644 --- a/i18n/ita/src/vs/workbench/parts/debug/electron-browser/debugViews.i18n.json +++ b/i18n/ita/src/vs/workbench/parts/debug/electron-browser/debugViews.i18n.json @@ -5,16 +5,12 @@ // Do not edit this file. It is machine generated. { "variablesSection": "Sezione Variabili", - "variables": "Variabili", "variablesAriaTreeLabel": "Esegui debug variabili", "expressionsSection": "Sezione Espressioni", - "watch": "Espressione di controllo", "watchAriaTreeLabel": "Esegui debug espressioni di controllo", "callstackSection": "Sezione Stack di chiamate", "debugStopped": "In pausa su {0}", - "callStack": "Stack di chiamate", "callStackAriaLabel": "Esegui debug stack di chiamate", "breakpointsSection": "Sezione Punti di interruzione", - "breakpoints": "Punti di interruzione", "breakpointsAriaTreeLabel": "Esegui debug punti di interruzione" } \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/debug/electron-browser/electronDebugActions.i18n.json b/i18n/ita/src/vs/workbench/parts/debug/electron-browser/electronDebugActions.i18n.json index d65947bfcbc853ef2bd124ef0212f753128a4483..ae849e1dfbb14256e4be2fef7788a0bbdc847ffa 100644 --- a/i18n/ita/src/vs/workbench/parts/debug/electron-browser/electronDebugActions.i18n.json +++ b/i18n/ita/src/vs/workbench/parts/debug/electron-browser/electronDebugActions.i18n.json @@ -6,5 +6,6 @@ { "copyValue": "Copia valore", "copy": "Copia", + "copyAll": "Copia tutti", "copyStackTrace": "Copia stack di chiamate" } \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/debug/electron-browser/statusbarColorProvider.i18n.json b/i18n/ita/src/vs/workbench/parts/debug/electron-browser/statusbarColorProvider.i18n.json index 8de054fa31b72505e0e7ee30a7724b5dccab7109..c13997bfc292d9bff65fb64110c83127e3e7e65b 100644 --- a/i18n/ita/src/vs/workbench/parts/debug/electron-browser/statusbarColorProvider.i18n.json +++ b/i18n/ita/src/vs/workbench/parts/debug/electron-browser/statusbarColorProvider.i18n.json @@ -4,5 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "statusBarDebuggingBackground": "Colore di sfondo della barra di stato quando è in corso il debug di un programma. La barra di stato è visualizzata nella parte inferiore della finestra" + "statusBarDebuggingBackground": "Colore di sfondo della barra di stato quando è in corso il debug di un programma. La barra di stato è visualizzata nella parte inferiore della finestra", + "statusBarDebuggingForeground": "Colore primo piano della barra di stato quando è in corso il debug di un programma. La barra di stato è visualizzata nella parte inferiore della finestra" } \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json b/i18n/ita/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json index 53d3bcdd1ee9e8a6cb0eb5949fd20a2b0586d5f0..d116abf482013598248c17ace43c906bcc87f3bf 100644 --- a/i18n/ita/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json +++ b/i18n/ita/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json @@ -7,6 +7,7 @@ "debugAdapterBinNotFound": "Il file eseguibile '{0}' dell'adattatore di debug non esiste.", "debugAdapterCannotDetermineExecutable": "Non è possibile determinare il file eseguibile per l'adattatore di debug '{0}'.", "debugType": "Tipo di configurazione.", + "debugTypeNotRecognised": "Il tipo di debug non è riconosciuto. Assicurarsi di avere un'estensione appropriata per il debug installata e che sia abilitata.", "node2NotSupported": "\"node2\" non è più supportato. In alternativa, usare \"node\" e impostare l'attributo \"protocol\" su \"inspector\".", "debugName": "Nome della configurazione. Viene visualizzato nel menu a discesa della configurazione di avvio.", "debugRequest": "Tipo della richiesta di configurazione. Può essere \"launch\" o \"attach\".", diff --git a/i18n/ita/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json b/i18n/ita/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json index 1549e77ce27810cf8161bb8a3c4cc0ff59e8a99b..34249d623c89a0210f94d3c96c0f49eb9d7bb0e7 100644 --- a/i18n/ita/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json +++ b/i18n/ita/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json @@ -4,6 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "previousEditPoint": "Emmet: Punto di modifica precedente", - "nextEditPoint": "Emmet: Punto di modifica successivo" + "previousEditPoint": "Emmet: andare al punto di modifica precedente", + "nextEditPoint": "Emmet: andare al punto di modifica successivo" } \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json b/i18n/ita/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json index 2b16a19f047b93ece0c417c2d4cb3abce7620921..dc9fac282b124719eb7d6cf37671beff06fa4510 100644 --- a/i18n/ita/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json +++ b/i18n/ita/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json @@ -9,5 +9,6 @@ "emmetPreferences": "Preferenze usate per modificare il comportamento di alcune azioni e i resolver di Emmet.", "emmetSyntaxProfiles": "Consente di definire il profilo per la sintassi specificata oppure di usare un profilo personalizzato con regole specifiche.", "emmetExclude": "Matrice di linguaggi in cui le abbreviazioni Emmet non devono essere espanse.", - "emmetExtensionsPath": "Percorso di una cartella contenente snippet, preferenze e profili Emmet" + "emmetExtensionsPath": "Percorso di una cartella contenente snippet, preferenze e profili Emmet", + "useNewEmmet": "Prova i nuovi moduli emmet (che andrà a sostituire la vecchia libreria singola emmet) per tutte le funzionalità emmet." } \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/extensions/browser/extensionEditor.i18n.json b/i18n/ita/src/vs/workbench/parts/extensions/browser/extensionEditor.i18n.json index 9aeb226d9a315245ec91be907a0127840d9cebeb..6302bb9a38cfdd7b77cae97dc82db770b18d13d8 100644 --- a/i18n/ita/src/vs/workbench/parts/extensions/browser/extensionEditor.i18n.json +++ b/i18n/ita/src/vs/workbench/parts/extensions/browser/extensionEditor.i18n.json @@ -24,6 +24,10 @@ "default": "Impostazione predefinita", "debuggers": "Debugger ({0})", "debugger name": "Nome", + "views": "Visualizzazioni ({0})", + "view id": "ID", + "view name": "Nome", + "view location": "Dove", "themes": "Temi ({0})", "JSON Validation": "Convalida JSON ({0})", "commands": "Comandi ({0})", diff --git a/i18n/ita/src/vs/workbench/parts/extensions/browser/extensionsActions.i18n.json b/i18n/ita/src/vs/workbench/parts/extensions/browser/extensionsActions.i18n.json index 2199a5e0cccf8a89265b258ab9d0c4dd2f163110..2430ac5cd9b3b29fa37118750b6fe63a191687ba 100644 --- a/i18n/ita/src/vs/workbench/parts/extensions/browser/extensionsActions.i18n.json +++ b/i18n/ita/src/vs/workbench/parts/extensions/browser/extensionsActions.i18n.json @@ -22,6 +22,8 @@ "disableGloballyAction": "Sempre", "disableAction": "Disabilita", "checkForUpdates": "Controlla la disponibilità di aggiornamenti", + "enableAutoUpdate": "Abilita l'aggiornamento automatico delle estensioni", + "disableAutoUpdate": "Disabilita l'aggiornamento automatico delle estensioni", "updateAll": "Aggiorna tutte le estensioni", "reloadAction": "Ricarica", "postUpdateTooltip": "Ricaricare per aggiornare", @@ -44,6 +46,8 @@ "showWorkspaceRecommendedExtensions": "Mostra estensioni consigliate per l'area di lavoro", "showRecommendedKeymapExtensions": "Mostra mappature tastiera consigliate", "showRecommendedKeymapExtensionsShort": "Mappature tastiera", + "showLanguageExtensions": "Mostra estensioni del linguaggio", + "showLanguageExtensionsShort": "Estensioni del linguaggio", "configureWorkspaceRecommendedExtensions": "Configura estensioni consigliate (area di lavoro)", "ConfigureWorkspaceRecommendations.noWorkspace": "Gli elementi consigliati sono disponibili solo per una cartella dell'area di lavoro.", "OpenExtensionsFile.failed": "Non è possibile creare il file 'extensions.json' all'interno della cartella '.vscode' ({0}).", @@ -51,5 +55,8 @@ "disableAll": "Disabilita tutte le estensioni installate", "disableAllWorkspace": "Disabilita tutte le estensioni installate per questa area di lavoro", "enableAll": "Abilita tutte le estensioni installate", - "enableAllWorkspace": "Abilita tutte le estensioni installate per questa area di lavoro" + "enableAllWorkspace": "Abilita tutte le estensioni installate per questa area di lavoro", + "extensionButtonProminentBackground": "Colore di sfondo delle azioni di estensioni che si distinguono (es. pulsante Installa).", + "extensionButtonProminentForeground": "Colore primo piano di pulsanti per azioni di estensioni che si distinguono (es. pulsante Installa).", + "extensionButtonProminentHoverBackground": "Colore di sfondo al passaggio del mouse dei pulsanti per azioni di estensione che si distinguono (es. pulsante Installa)." } \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.i18n.json b/i18n/ita/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.i18n.json index f84b219fb4e8576591b989594ed66d508a03d695..9d16c7dad0f3464c24f061d4ac9e3ea68925d0c0 100644 --- a/i18n/ita/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.i18n.json +++ b/i18n/ita/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.i18n.json @@ -9,6 +9,8 @@ "neverShowAgain": "Non visualizzare più questo messaggio", "close": "Chiudi", "workspaceRecommended": "Per questa area di lavoro sono disponibili estensioni consigliate.", + "ignoreExtensionRecommendations": "Si desidera ignorare tutte le raccomandazioni di estensioni?", + "ignoreAll": "Sì, ignora tutti", "no": "No", "cancel": "Annulla" } \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.i18n.json b/i18n/ita/src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.i18n.json index 1122eeb85cfbfefd23852c1183ad63b2dae45e79..12c0b28e83dbf740f0b9a63e683a874e261548a6 100644 --- a/i18n/ita/src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.i18n.json +++ b/i18n/ita/src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.i18n.json @@ -10,5 +10,6 @@ "extensions": "Estensioni", "view": "Visualizza", "extensionsConfigurationTitle": "Estensioni", - "extensionsAutoUpdate": "Aggiorna automaticamente le estensioni" + "extensionsAutoUpdate": "Aggiorna automaticamente le estensioni", + "extensionsIgnoreRecommendations": "Ignora le raccomandazioni di estensioni" } \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json b/i18n/ita/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json index 8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a..4822a5d71bc5dd2ac78555c509a5828f8fff37b8 100644 --- a/i18n/ita/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json +++ b/i18n/ita/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json @@ -3,4 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. -{} \ No newline at end of file +{ + "disableOtherKeymapsConfirmation": "Disabilitare altre mappature tastiera ({0}) per evitare conflitti tra tasti di scelta rapida?", + "yes": "Sì", + "no": "No", + "betterMergeDisabled": "L'estensione Better Merge (miglior merge) è ora incorporata: l'estensione installata è stata disattivata e può essere disinstallata.", + "uninstall": "Disinstalla", + "later": "In seguito" +} \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/files/browser/files.contribution.i18n.json b/i18n/ita/src/vs/workbench/parts/files/browser/files.contribution.i18n.json index 5f1557087a04f7dcae3eedbbc55de4f542289e9d..69cc6c3dca2dc148d62276afdedea5cdac2e12ea 100644 --- a/i18n/ita/src/vs/workbench/parts/files/browser/files.contribution.i18n.json +++ b/i18n/ita/src/vs/workbench/parts/files/browser/files.contribution.i18n.json @@ -16,7 +16,7 @@ "associations": "Consente di configurare le associazioni tra file e linguaggi, ad esempio \"*.extension\": \"html\". Queste hanno la precedenza sulle associazioni predefinite dei linguaggi installate.", "encoding": "Codifica del set di caratteri predefinita da usare durante la lettura e la scrittura di file.", "autoGuessEncoding": "Quando questa opzione è abilitata, la codifica del set di caratteri viene ipotizzata all'apertura dei file", - "eol": "Carattere di fine riga predefinito.", + "eol": "Il carattere di fine riga predefinito. Utilizzare \\n per LF e \\r\\n per CRLF.", "trimTrailingWhitespace": "Se è abilitato, taglierà lo spazio vuoto quando si salva un file.", "insertFinalNewline": "Se è abilitato, inserisce un carattere di nuova riga finale alla fine del file durante il salvataggio.", "files.autoSave.off": "Un file dirty non viene mai salvato automaticamente.", @@ -27,6 +27,7 @@ "autoSaveDelay": "Controlla il ritardo in ms dopo il quale un file dirty viene salvato automaticamente. Si applica solo quando 'files.autoSave' è impostato su '{0}'", "watcherExclude": "Consente di configurare i criteri GLOB dei percorsi file da escludere dal controllo dei file. Se si modifica questa impostazione, è necessario riavviare. Quando si nota che Code consuma troppo tempo della CPU all'avvio, è possibile escludere le cartelle di grandi dimensioni per ridurre il carico iniziale.", "hotExit.off": "Disabilita Hot Exit.", + "hotExit.onExit": "La funzionalità Hot Exit verrà attivata alla chiusura dell'applicazione, ovvero quando si chiude l'ultima finestra in Windows/Linux o quando si attiva il comando workbench.action.quit (riquadro comandi, tasto di scelta rapida, menu). Tutte le finestre con backup verranno ripristinate al successivo avvio.", "hotExit": "Controlla se i file non salvati verranno memorizzati tra una sessione e l'altra, consentendo di ignorare il prompt di salvataggio alla chiusura dell'editor.", "defaultLanguage": "Modalità linguaggio predefinita assegnata ai nuovi file.", "editorConfigurationTitle": "Editor", diff --git a/i18n/ita/src/vs/workbench/parts/files/browser/views/emptyView.i18n.json b/i18n/ita/src/vs/workbench/parts/files/browser/views/emptyView.i18n.json index 71f3a7b410e695e9a1bf0a0298ae4d89dd2266e7..fccf829184b0421800ce2e9f4f08bf09b152fb64 100644 --- a/i18n/ita/src/vs/workbench/parts/files/browser/views/emptyView.i18n.json +++ b/i18n/ita/src/vs/workbench/parts/files/browser/views/emptyView.i18n.json @@ -5,7 +5,5 @@ // Do not edit this file. It is machine generated. { "explorerSection": "Sezione Esplora file", - "noWorkspace": "Nessuna cartella aperta", - "noWorkspaceHelp": "Non ci sono ancora cartelle aperte.", "openFolder": "Apri cartella" } \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/files/browser/views/openEditorsView.i18n.json b/i18n/ita/src/vs/workbench/parts/files/browser/views/openEditorsView.i18n.json index bc5c38d3fefd993c4d851ac54808a7d9351d77b1..1f6007832328a77839a47b99f6fe6596e9c81471 100644 --- a/i18n/ita/src/vs/workbench/parts/files/browser/views/openEditorsView.i18n.json +++ b/i18n/ita/src/vs/workbench/parts/files/browser/views/openEditorsView.i18n.json @@ -4,8 +4,8 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "openEditosrSection": "Sezione Editor aperti", "openEditors": "Editor aperti", + "openEditosrSection": "Sezione Editor aperti", "treeAriaLabel": "Editor aperti: elenco di file attivi", "dirtyCounter": "{0} non salvati" } \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json b/i18n/ita/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json index 18ae03ff77a603f53de1fdc1ecbbce0ea259587d..e72592662b95761f6ce8f85a99527f4983b22b66 100644 --- a/i18n/ita/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json +++ b/i18n/ita/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json @@ -5,5 +5,11 @@ // Do not edit this file. It is machine generated. { "slow": "È stato rilevato un rallentamento all'avvio", - "slow.detail": "È stato appena rilevato un rallentamento all'avvio. Per consentire a Microsoft di analizzare e risolvere il problema, riavviare '{0}' con la profilatura abilitata e condividere i profili." + "slow.detail": "È stato appena rilevato un rallentamento all'avvio. Per consentire a Microsoft di analizzare e risolvere il problema, riavviare '{0}' con la profilatura abilitata e condividere i profili.", + "prof.message": "I profili sono stati creati.", + "prof.detail": "Creare un problema e allegare manualmente i file seguenti:\n{0}", + "prof.restartAndFileIssue": "Crea problema e riavvia", + "prof.restart": "Riavvia", + "prof.thanks": "Grazie per l'aiuto.", + "prof.detail.restart": "È necessario un riavvio alla fine per continuare a utilizzare '{0}'. Ancora una volta, grazie per il vostro contributo." } \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/preferences/browser/keybindingsEditorContribution.i18n.json b/i18n/ita/src/vs/workbench/parts/preferences/browser/keybindingsEditorContribution.i18n.json index 670ffa4c4ac24f8f369cf5e54bf080c17945cc4a..92488da0463522fe6070b2105eb9c0b9f2da8bb7 100644 --- a/i18n/ita/src/vs/workbench/parts/preferences/browser/keybindingsEditorContribution.i18n.json +++ b/i18n/ita/src/vs/workbench/parts/preferences/browser/keybindingsEditorContribution.i18n.json @@ -5,6 +5,7 @@ // Do not edit this file. It is machine generated. { "defineKeybinding.start": "Definisci tasto di scelta rapida", - "defineKeybinding.kbLayoutInfoMessage": "Per il layout di tastiera corrente premere ", - "defineKeybinding.kbLayoutErrorMessage": "Non sarà possibile produrre questa combinazione di tasti con il layout di tastiera corrente." + "defineKeybinding.kbLayoutErrorMessage": "Non sarà possibile produrre questa combinazione di tasti con il layout di tastiera corrente.", + "defineKeybinding.kbLayoutLocalAndUSMessage": "**{0}** per il layout di tastiera corrente (**{1}** per quello standard US).", + "defineKeybinding.kbLayoutLocalMessage": "**{0}** per il layout di tastiera corrente." } \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/preferences/browser/preferencesRenderers.i18n.json b/i18n/ita/src/vs/workbench/parts/preferences/browser/preferencesRenderers.i18n.json index a9d3b766fdac461c58819e38aad646317bb73ae0..23a476fe6823d97ba6743eff14a20a5a7f6de1a4 100644 --- a/i18n/ita/src/vs/workbench/parts/preferences/browser/preferencesRenderers.i18n.json +++ b/i18n/ita/src/vs/workbench/parts/preferences/browser/preferencesRenderers.i18n.json @@ -4,6 +4,7 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "errorInvalidConfiguration": "Impossibile scrivere nelle impostazioni. Correggere eventuali errori o avvisi nel file e riprovare.", "editTtile": "Modifica", "replaceDefaultValue": "Sostituisci nelle impostazioni", "copyDefaultValue": "Copia nelle impostazioni", diff --git a/i18n/ita/src/vs/workbench/parts/quickopen/browser/commandsHandler.i18n.json b/i18n/ita/src/vs/workbench/parts/quickopen/browser/commandsHandler.i18n.json index 5be53aa1550e8189ba665c0a5a0408e0e70acd4f..35875c08105410eae44893a84a45f4e73118bd89 100644 --- a/i18n/ita/src/vs/workbench/parts/quickopen/browser/commandsHandler.i18n.json +++ b/i18n/ita/src/vs/workbench/parts/quickopen/browser/commandsHandler.i18n.json @@ -5,6 +5,7 @@ // Do not edit this file. It is machine generated. { "showTriggerActions": "Mostra tutti i comandi", + "showCommands.label": "Riquadro comandi...", "entryAriaLabelWithKey": "{0}, {1}, comandi", "entryAriaLabel": "{0}, comandi", "canNotRun": "Non è possibile eseguire il comando '{0}' da questa posizione.", diff --git a/i18n/ita/src/vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.i18n.json b/i18n/ita/src/vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..85fb16da61bf49d1be6ef593ac98522e4a522414 --- /dev/null +++ b/i18n/ita/src/vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "relaunchMessage": "È necessario riavviare per rendere effettiva un'impostazione modificata.", + "relaunchDetail": "Fare clic sul pulsante di riavvio per riavviare {0} e abilitare l'impostazione.", + "restart": "Riavvia" +} \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.i18n.json b/i18n/ita/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..504c42cd09001c7c376be465259b418e8b9f483e --- /dev/null +++ b/i18n/ita/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "editorGutterModifiedBackground": "Colore di sfondo della barra di navigazione dell'editor per le righe che sono state modificate.", + "editorGutterAddedBackground": "Colore di sfondo della barra di navigazione dell'editor per le righe che sono state aggiunte.", + "editorGutterDeletedBackground": "Colore di sfondo della barra di navigazione dell'editor per le righe che sono state cancellate." +} \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/scm/electron-browser/scm.contribution.i18n.json b/i18n/ita/src/vs/workbench/parts/scm/electron-browser/scm.contribution.i18n.json index 44389863a6597158d5c8c1ef5cea9a4f43086987..acbf024d405acf3a5f8c471458e030f24c59d6d2 100644 --- a/i18n/ita/src/vs/workbench/parts/scm/electron-browser/scm.contribution.i18n.json +++ b/i18n/ita/src/vs/workbench/parts/scm/electron-browser/scm.contribution.i18n.json @@ -5,6 +5,7 @@ // Do not edit this file. It is machine generated. { "toggleGitViewlet": "Mostra GIT", + "installAdditionalSCMProviders": "Installa ulteriori provider SCM ...", "source control": "Controllo del codice sorgente", "toggleSCMViewlet": "Mostra Gestione controllo servizi", "view": "Visualizza" diff --git a/i18n/ita/src/vs/workbench/parts/scm/electron-browser/scmMenus.i18n.json b/i18n/ita/src/vs/workbench/parts/scm/electron-browser/scmMenus.i18n.json index 529f073603a859844bf97cdd54b4efee3c083294..9f3adc546ff355fda5bff9d3f34516a603318956 100644 --- a/i18n/ita/src/vs/workbench/parts/scm/electron-browser/scmMenus.i18n.json +++ b/i18n/ita/src/vs/workbench/parts/scm/electron-browser/scmMenus.i18n.json @@ -4,5 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "installAdditionalSCMProviders": "Installa ulteriori provider SCM ...", "switch provider": "Cambia provider SCM" } \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json b/i18n/ita/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json index ef09ca3283a065480b42f793af520eb424ab00b2..13608466e81d1a2ce1b9b826b3a38ff7220a5c98 100644 --- a/i18n/ita/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json +++ b/i18n/ita/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json @@ -6,5 +6,7 @@ { "searchMatches": "{0} corrispondenze trovate", "searchMatch": "{0} corrispondenza trovata", - "fileMatchAriaLabel": "{0} corrispondenze nel file {1} della cartella {2}, risultato della ricerca" + "fileMatchAriaLabel": "{0} corrispondenze nel file {1} della cartella {2}, risultato della ricerca", + "replacePreviewResultAria": "Sostituisce il termine {0} con {1} alla colonna {2} in linea con il testo {3}", + "searchResultAria": "Trovato termine {0} alla colonna {1} in linea con il testo {2}" } \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/snippets/electron-browser/TMSnippets.i18n.json b/i18n/ita/src/vs/workbench/parts/snippets/electron-browser/TMSnippets.i18n.json index 78cd10645b4505aa49d3420fd60f033a7419ad59..cd9b550b98abaa3fe7d5a9ca74c5a45596046b3e 100644 --- a/i18n/ita/src/vs/workbench/parts/snippets/electron-browser/TMSnippets.i18n.json +++ b/i18n/ita/src/vs/workbench/parts/snippets/electron-browser/TMSnippets.i18n.json @@ -9,5 +9,6 @@ "vscode.extension.contributes.snippets-path": "Percorso del file snippets. È relativo alla cartella delle estensioni e in genere inizia con './snippets/'.", "invalid.language": "Il linguaggio in `contributes.{0}.language` è sconosciuto. Valore specificato: {1}", "invalid.path.0": "È previsto un valore stringa in `contributes.{0}.path`. Valore specificato: {1}", - "invalid.path.1": "Valore previsto di `contributes.{0}.path` ({1}) da includere nella cartella dell'estensione ({2}). L'estensione potrebbe non essere più portatile." + "invalid.path.1": "Valore previsto di `contributes.{0}.path` ({1}) da includere nella cartella dell'estensione ({2}). L'estensione potrebbe non essere più portatile.", + "badVariableUse": "Il frammento \"{0}\" molto probabilmente confonde variabili-frammento con segnaposti-frammento. Vedere https://code.visualstudio.com/docs/editor/userdefinedsnippets#_snippet-syntax per ulteriori dettagli." } \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/snippets/electron-browser/snippets.contribution.i18n.json b/i18n/ita/src/vs/workbench/parts/snippets/electron-browser/snippets.contribution.i18n.json index 89c9cdec78e4d50519372c362110f93673b463bf..ff128cda608c51bf1ce1a640fb0555d4bd126f7c 100644 --- a/i18n/ita/src/vs/workbench/parts/snippets/electron-browser/snippets.contribution.i18n.json +++ b/i18n/ita/src/vs/workbench/parts/snippets/electron-browser/snippets.contribution.i18n.json @@ -11,6 +11,6 @@ "snippetSchema.json.default": "Frammento vuoto", "snippetSchema.json": "Configurazione del frammento utente", "snippetSchema.json.prefix": "Prefisso da usare quando si seleziona il frammento in IntelliSense", - "snippetSchema.json.body": "Contenuto del frammento. Usare '${id}', '${id:label}', '${1:label}' per le variabili e '$0', '$1' per le posizioni del cursore", + "snippetSchema.json.body": "Il contenuto del frammento. Usare '$1', '${1:defaultText}' per definire le posizioni del cursore, utilizzare '$0' per la posizione finale del cursore. Inserire i valori delle variabili con '${varName}' e '${varName:defaultText}', ad esempio 'Nome del file: $TM_FILENAME'.", "snippetSchema.json.description": "Descrizione del frammento." } \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/surveys/electron-browser/languageSurveys.contribution.i18n.json b/i18n/ita/src/vs/workbench/parts/surveys/electron-browser/languageSurveys.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..07b53da59b30a1561903f0d8fca181b1d7448877 --- /dev/null +++ b/i18n/ita/src/vs/workbench/parts/surveys/electron-browser/languageSurveys.contribution.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "helpUs": "Aiutaci a migliorare il nostro supporto all'{0}", + "takeShortSurvey": "Partecipa a un breve sondaggio", + "remindLater": "Visualizza più tardi", + "neverAgain": "Non visualizzare più questo messaggio" +} \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/surveys/electron-browser/nps.contribution.i18n.json b/i18n/ita/src/vs/workbench/parts/surveys/electron-browser/nps.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..f5bb473c1df029455c104dc712e867535255303a --- /dev/null +++ b/i18n/ita/src/vs/workbench/parts/surveys/electron-browser/nps.contribution.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "surveyQuestion": "Partecipare a un breve sondaggio?", + "takeSurvey": "Partecipa a sondaggio", + "remindLater": "Visualizza più tardi", + "neverAgain": "Non visualizzare più questo messaggio" +} \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/tasks/browser/buildQuickOpen.i18n.json b/i18n/ita/src/vs/workbench/parts/tasks/browser/buildQuickOpen.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..6574ffdaef17d6c0de3349019747a50a599cdc95 --- /dev/null +++ b/i18n/ita/src/vs/workbench/parts/tasks/browser/buildQuickOpen.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "noTasksMatching": "No tasks matching" +} \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/tasks/browser/quickOpen.i18n.json b/i18n/ita/src/vs/workbench/parts/tasks/browser/quickOpen.i18n.json index c0432625724e130ef22a389a594c6fac63748493..0e5967d8803f6f32bece2385030647d8dc5ca9a8 100644 --- a/i18n/ita/src/vs/workbench/parts/tasks/browser/quickOpen.i18n.json +++ b/i18n/ita/src/vs/workbench/parts/tasks/browser/quickOpen.i18n.json @@ -4,5 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "entryAriaLabel": "{0}, tasks" + "entryAriaLabel": "{0}, tasks", + "customizeTask": "Personalizza attività" } \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/tasks/browser/testQuickOpen.i18n.json b/i18n/ita/src/vs/workbench/parts/tasks/browser/testQuickOpen.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..6574ffdaef17d6c0de3349019747a50a599cdc95 --- /dev/null +++ b/i18n/ita/src/vs/workbench/parts/tasks/browser/testQuickOpen.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "noTasksMatching": "No tasks matching" +} \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/tasks/common/taskConfiguration.i18n.json b/i18n/ita/src/vs/workbench/parts/tasks/common/taskConfiguration.i18n.json index 8de23c2bbed6dbb6156e6c6708ce13ce1d47f31f..f5aa6fc8cdaf2514bb59e499b66d875a4176535b 100644 --- a/i18n/ita/src/vs/workbench/parts/tasks/common/taskConfiguration.i18n.json +++ b/i18n/ita/src/vs/workbench/parts/tasks/common/taskConfiguration.i18n.json @@ -5,13 +5,13 @@ // Do not edit this file. It is machine generated. { "ConfigurationParser.invalidCWD": "Avviso: options.cwd deve essere di tipo string. Il valore {0} verrà ignorato.\n", - "ConfigurationParser.noShell": "Avviso: la configurazione della shell è supportata solo quando si eseguono attività nel terminale.", "ConfigurationParser.noargs": "Errore: gli argomenti del comando devono essere un array di stringhe. Il valore specificato è:\n{0}", + "ConfigurationParser.noShell": "Avviso: la configurazione della shell è supportata solo quando si eseguono attività nel terminale.", "ConfigurationParser.noName": "Errore: è necessario specificare un nome per il matcher problemi nell'ambito di dichiarazione:\n{0}\n", "ConfigurationParser.unknownMatcherKind": "Avviso: il matcher problemi definito è sconosciuto. I tipi supportati sono string | ProblemMatcher | (string | ProblemMatcher)[].\n{0}\n", "ConfigurationParser.invalidVaraibleReference": "Errore: il riferimento a problemMatcher non è valido: {0}\n", "ConfigurationParser.noTaskName": "Errore: le attività devono specificare una proprietà taskName. L'attività verrà ignorata.\n{0}\n", "taskConfiguration.shellArgs": "Avviso: l'attività '{0}' è un comando della shell e il nome del comando o uno dei relativi argomenti contiene spazi senza codice di escape. Per garantire la corretta indicazione della riga di comando, unire gli argomenti nel comando.", - "taskConfiguration.noCommandOrDependsOn": "Errore: l'attività '{0}' non specifica un comando o una proprietà dependsOn. L'attività verrà ignorata. Definizione dell'attività:\n{1}", + "taskConfiguration.noCommandOrDependsOn": "Errore: l'attività '{0}' non specifica un comando né una proprietà dependsOn. L'attività verrà ignorata. La sua definizione è:\n{1}", "taskConfiguration.noCommand": "Errore: l'attività '{0}' non definisce un comando. L'attività verrà ignorata. Definizione dell'attività:\n{1}" } \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/tasks/electron-browser/jsonSchemaCommon.i18n.json b/i18n/ita/src/vs/workbench/parts/tasks/electron-browser/jsonSchemaCommon.i18n.json index b14b007cde53132eb35323b9c24097b46dfea403..2c148fe49001d54e85d719e54d25f3dd23a18393 100644 --- a/i18n/ita/src/vs/workbench/parts/tasks/electron-browser/jsonSchemaCommon.i18n.json +++ b/i18n/ita/src/vs/workbench/parts/tasks/electron-browser/jsonSchemaCommon.i18n.json @@ -7,6 +7,7 @@ "JsonSchema.options": "Opzioni dei comandi aggiuntive", "JsonSchema.options.cwd": "Directory di lavoro corrente del programma o dello script eseguito. Se omesso, viene usata la radice dell'area di lavoro corrente di Visual Studio Code.", "JsonSchema.options.env": "Ambiente della shell o del programma eseguito. Se omesso, viene usato l'ambiente del processo padre.", + "JsonSchema.shellConfiguration": "Configura la shell da utilizzare.", "JsonSchema.shell.executable": "Shell da usare.", "JsonSchema.shell.args": "Argomenti della shell.", "JsonSchema.command": "Comando da eseguire. Può essere un programma esterno o un comando della shell.", diff --git a/i18n/ita/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v1.i18n.json b/i18n/ita/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v1.i18n.json index 2d791579971b3a26fb9531b20f0ef577b890a1cd..9aefb1b07c7d0fa533bc9f57b5b180306d13557a 100644 --- a/i18n/ita/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v1.i18n.json +++ b/i18n/ita/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v1.i18n.json @@ -5,6 +5,8 @@ // Do not edit this file. It is machine generated. { "JsonSchema.version": "Numero di versione della configurazione", + "JsonSchema._runner": "Runner è stata promossa. Utilizzare la proprietà ufficiale runner", + "JsonSchema.runner": "Definisce se l'attività viene eseguita come un processo e l'output viene visualizzato nella finestra di output o all'interno del terminale.", "JsonSchema.windows": "Configurazione dei comandi specifica di Windows", "JsonSchema.mac": "Configurazione dei comandi specifica di Mac", "JsonSchema.linux": "Configurazione dei comandi specifica di Linux", diff --git a/i18n/ita/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.i18n.json b/i18n/ita/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.i18n.json index 248adfe6f6e434986e939e990028af6427a256f1..24f8e7f95aa17342a6c40dd66a4d55fe259a8cb6 100644 --- a/i18n/ita/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.i18n.json +++ b/i18n/ita/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.i18n.json @@ -4,11 +4,14 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "JsonSchema.shell": "Specifica se il comando è un comando della shell o un programma esterno. Se omesso, viene usato il valore predefinito false.", + "JsonSchema.tasks.dependsOn.string": "Altra attività da cui dipende questa attività.", + "JsonSchema.tasks.dependsOn.array": "Altre attività da cui dipende questa attività.", + "JsonSchema.tasks.group": "Definisce a quale gruppo di esecuzione appartiene questa attività. Se omesso l'attività non appartiene ad alcun gruppo.", + "JsonSchema.tasks.type": "Definisce se l'attività viene eseguita come un processo o come un comando all'interno di una shell. L'impostazione predefinita è processo.", "JsonSchema.version": "Numero di versione della configurazione", + "JsonSchema.tasks.customize": "L'attività contribuita da personalizzare.", "JsonSchema.windows": "Configurazione dei comandi specifica di Windows", "JsonSchema.mac": "Configurazione dei comandi specifica di Mac", - "JsonSchema.linux": "Configurazione dei comandi specifica di Linux", - "JsonSchema.shell": "Specifica se il comando è un comando della shell o un programma esterno. Se omesso, viene usato il valore predefinito false.", - "JsonSchema.tasks.dependsOn.string": "Altra attività da cui dipende questa attività.", - "JsonSchema.tasks.dependsOn.array": "Altre attività da cui dipende questa attività." + "JsonSchema.linux": "Configurazione dei comandi specifica di Linux" } \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json b/i18n/ita/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json index 7be3f013ead8b3c0985cad27e6bcc2acab539d08..adad41059d111dbc0d051c12c956b9d4e4763d86 100644 --- a/i18n/ita/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json +++ b/i18n/ita/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json @@ -18,10 +18,12 @@ "problems": "Problemi", "manyMarkers": "Più di 99", "tasks": "Attività", + "TaskSystem.noHotSwap": "Per modificare il motore di esecuzione delle attività, è necessario riavviare VS Code. La modifica verrà ignorata.", "TaskService.noBuildTask": "Non è stata definita alcuna attività di Build. Contrassegnare un'attività con 'isBuildCommand' nel file tasks.json .", "TaskService.noTestTask": "Non è stata definita alcuna attività di test. Contrassegnare un'attività con 'isTestCommand' nel file tasks.json .", "TaskServer.noTask": "Attività {0} richiesta per l'esecuzione non trovata", - "TaskSystem.activeSame": "L'attività è già attiva e in modalità espressione di controllo. Per terminarla, usare `F1 > Termina attività`", + "customizeParseErrors": "La configurazione dell'attività corrente presenta errori. Per favore correggere gli errori prima di personalizzazione un'attività.", + "moreThanOneBuildTask": "tasks.json contiene molte attività di compilazione. È in corso l'esecuzione della prima.\n", "TaskSystem.active": "Al momento c'è già un'attività in esecuzione. Terminarla prima di eseguirne un'altra.", "TaskSystem.restartFailed": "Non è stato possibile terminare e riavviare l'attività {0}", "TaskSystem.configurationErrors": "Errore: la configurazione delle attività specificata contiene errori di convalida e non è utilizzabile. Correggere prima gli errori.", diff --git a/i18n/ita/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.i18n.json b/i18n/ita/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.i18n.json index f2c65d28fb8c26d5cd429b1a8d21a5509454ca13..3d9e3d5f42be47cf78d99c94da4dea4048c923e6 100644 --- a/i18n/ita/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.i18n.json +++ b/i18n/ita/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.i18n.json @@ -6,5 +6,7 @@ { "TerminalTaskSystem.unknownError": "Si è verificato un errore sconosciuto durante l'esecuzione di un'attività. Per dettagli, vedere il log di output dell'attività.", "TerminalTaskSystem.terminalName": "Attività - {0}", - "TerminalTaskSystem": "Non è possibile eseguire un comando della shell su un'unità UNC." + "reuseTerminal": "Terminale verrà riutilizzato dalle attività, premere un tasto qualsiasi per chiuderlo.", + "TerminalTaskSystem": "Non è possibile eseguire un comando della shell su un'unità UNC.", + "unkownProblemMatcher": "Il matcher problemi {0} non può essere risolto. il matcher verrà ignorato" } \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/tasks/node/processTaskSystem.i18n.json b/i18n/ita/src/vs/workbench/parts/tasks/node/processTaskSystem.i18n.json index 7f632a45eea93265c3274a6dcc429e3ec230b7f8..fe3fa63dc3b39c39d9464e99747319a39e720a16 100644 --- a/i18n/ita/src/vs/workbench/parts/tasks/node/processTaskSystem.i18n.json +++ b/i18n/ita/src/vs/workbench/parts/tasks/node/processTaskSystem.i18n.json @@ -7,5 +7,6 @@ "TaskRunnerSystem.unknownError": "Si è verificato un errore sconosciuto durante l'esecuzione di un'attività. Per dettagli, vedere il log di output dell'attività.", "TaskRunnerSystem.watchingBuildTaskFinished": "\nIl controllo delle attività di build è terminato.", "TaskRunnerSystem.childProcessError": "Failed to launch external program {0} {1}.", - "TaskRunnerSystem.cancelRequested": "\nL'attività '{0}' è stata terminata come richiesto dall'utente." + "TaskRunnerSystem.cancelRequested": "\nL'attività '{0}' è stata terminata come richiesto dall'utente.", + "unkownProblemMatcher": "Il matcher problemi {0} non può essere risolto. Il matcher verrà ignorato" } \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/terminal/electron-browser/terminalActions.i18n.json b/i18n/ita/src/vs/workbench/parts/terminal/electron-browser/terminalActions.i18n.json index 7df189ea6a7d1a90ab9ffbbc69082d4a95c2f146..a7393d354c76b4bd71993ea7f5e7e2d981c5b376 100644 --- a/i18n/ita/src/vs/workbench/parts/terminal/electron-browser/terminalActions.i18n.json +++ b/i18n/ita/src/vs/workbench/parts/terminal/electron-browser/terminalActions.i18n.json @@ -8,6 +8,7 @@ "workbench.action.terminal.kill": "Termina istanza attiva del terminale", "workbench.action.terminal.kill.short": "Termina il terminale", "workbench.action.terminal.copySelection": "Copia selezione", + "workbench.action.terminal.selectAll": "Seleziona tutto", "workbench.action.terminal.new": "Crea nuovo terminale integrato", "workbench.action.terminal.new.short": "Nuovo terminale", "workbench.action.terminal.focus": "Sposta stato attivo su terminale", @@ -26,5 +27,8 @@ "workbench.action.terminal.scrollUp": "Scorri su (riga)", "workbench.action.terminal.scrollUpPage": "Scorri su (pagina)", "workbench.action.terminal.scrollToTop": "Scorri all'inizio", - "workbench.action.terminal.clear": "Cancella" + "workbench.action.terminal.clear": "Cancella", + "workbench.action.terminal.allowWorkspaceShell": "Consente la configurazione della Shell dell'area di lavoro", + "workbench.action.terminal.disallowWorkspaceShell": "Non consente la configurazione della Shell dell'area di lavoro", + "workbench.action.terminal.rename": "Rinomina" } \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/terminal/electron-browser/terminalColorRegistry.i18n.json b/i18n/ita/src/vs/workbench/parts/terminal/electron-browser/terminalColorRegistry.i18n.json index c56209ab67f48db685ae8bb3b263890f78baf71d..43f3afaeb3087727e1206563ed8271f819d7fe47 100644 --- a/i18n/ita/src/vs/workbench/parts/terminal/electron-browser/terminalColorRegistry.i18n.json +++ b/i18n/ita/src/vs/workbench/parts/terminal/electron-browser/terminalColorRegistry.i18n.json @@ -4,5 +4,7 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "terminal.background": "Il colore di sfondo del terminale, questo consente di colorare il terminale in modo diverso dal pannello.", + "terminal.foreground": "Il colore di primo piano del terminale.", "terminal.ansiColor": "Colore ANSI '{0}' nel terminale." } \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/terminal/electron-browser/terminalFindWidget.i18n.json b/i18n/ita/src/vs/workbench/parts/terminal/electron-browser/terminalFindWidget.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..a930fde7ffb7bd12e3501a40a8db0478aaf3eca4 --- /dev/null +++ b/i18n/ita/src/vs/workbench/parts/terminal/electron-browser/terminalFindWidget.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "label.find": "Trova", + "placeholder.find": "Trova", + "label.previousMatchButton": "Risultato precedente", + "label.nextMatchButton": "Risultato successivo", + "label.closeButton": "Chiudi" +} \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.i18n.json b/i18n/ita/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.i18n.json index 919a2c26d3b175b55bd4e8d67d422b0f7e3c254c..713819e1226182481cf58c663aa2a9a862588527 100644 --- a/i18n/ita/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.i18n.json +++ b/i18n/ita/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.i18n.json @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "terminal.integrated.copySelection.noSelection": "Non è possibile copiare la selezione del terminale quando questo non ha lo stato attivo", "terminal.integrated.exitedWithCode": "Il processo del terminale è stato terminato. Codice di uscita: {0}", "terminal.integrated.waitOnExit": "Premere un tasto qualsiasi per chiudere il terminale", "terminal.integrated.launchFailed": "L'avvio del comando del processo di terminale `{0}{1}` non è riuscito. Codice di uscita: {2}" diff --git a/i18n/ita/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json b/i18n/ita/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json index cf402ad38021571404a3674082797a2a88e13106..7801fc1c4368ef35f67c3225c3f54f1f62103df9 100644 --- a/i18n/ita/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json +++ b/i18n/ita/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json @@ -6,6 +6,7 @@ { "selectTheme.label": "Tema colori", "installColorThemes": "Installa temi colori aggiuntivi...", + "themes.selectTheme": "Selezionare il Tema colori (tasti su/giù per anteprima)", "selectIconTheme.label": "Tema icona file", "installIconThemes": "Installa temi dell'icona file aggiuntivi...", "noIconThemeLabel": "Nessuno", diff --git a/i18n/ita/src/vs/workbench/parts/update/electron-browser/update.i18n.json b/i18n/ita/src/vs/workbench/parts/update/electron-browser/update.i18n.json index ddd31ed976db1a0d7709c1079186cffc04213feb..fdac59727b7344139e6a4d55a33021601debc301 100644 --- a/i18n/ita/src/vs/workbench/parts/update/electron-browser/update.i18n.json +++ b/i18n/ita/src/vs/workbench/parts/update/electron-browser/update.i18n.json @@ -15,5 +15,18 @@ "license": "Leggi licenza", "updateAvailable": "{0} verrà aggiornato dopo il riavvio.", "thereIsUpdateAvailable": "È disponibile un aggiornamento.", - "noUpdatesAvailable": "Al momento non sono disponibili aggiornamenti." + "noUpdatesAvailable": "Al momento non sono disponibili aggiornamenti.", + "updateIsReady": "Nuovo aggiornamento disponibile.", + "commandPalette": "Riquadro comandi...", + "settings": "Impostazioni", + "keyboardShortcuts": "Scelte rapide da tastiera", + "selectTheme.label": "Tema colori", + "themes.selectIconTheme.label": "Tema icona file", + "not available": "Aggiornamenti non disponibili", + "checkingForUpdates": "Verifica della disponibilità di aggiornamenti...", + "DownloadUpdate": "Scarica l'aggiornamento disponibile", + "DownloadingUpdate": "Download dell'aggiornamento...", + "InstallingUpdate": "Installazione dell'aggiornamento...", + "restartToUpdate": "Riavvia per aggiornare...", + "checkForUpdates": "Verifica disponibilità aggiornamenti..." } \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/views/browser/views.i18n.json b/i18n/ita/src/vs/workbench/parts/views/browser/views.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..a7b1c66172688f9136bf07fe85537eee22f69853 --- /dev/null +++ b/i18n/ita/src/vs/workbench/parts/views/browser/views.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "viewToolbarAriaLabel": "Azioni di {0}" +} \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/views/browser/viewsExtensionPoint.i18n.json b/i18n/ita/src/vs/workbench/parts/views/browser/viewsExtensionPoint.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..c5e18fdd63c83b3531d0c8d0df5d1c76a8051ea6 --- /dev/null +++ b/i18n/ita/src/vs/workbench/parts/views/browser/viewsExtensionPoint.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "requirearray": "Visualizzazioni devono essere una matrice", + "requirestring": "la proprietà `{0}` è obbligatoria e deve essere di tipo `string`", + "optstring": "la proprietà `{0}` può essere omessa o deve essere di tipo `string`", + "vscode.extension.contributes.view.id": "Identificatore della vista. Utilizzare questo per registrare un provider di dati tramite l'API 'vscode.window.registerTreeDataProviderForView'. Anche per innescare l'attivazione dell'estensione tramite la registrazione dell'evento 'onView: ${id}' a 'activationEvents'.", + "vscode.extension.contributes.view.name": "Il nome della visualizzazione. Verrà mostrato", + "vscode.extension.contributes.views": "Contribuisce visualizzazioni all'editor", + "views.explorer": "Visualizzazione di esplorazione", + "locationId.invalid": "'{0}' non è una posizione valida per la visualizzazione" +} \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json b/i18n/ita/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json index aa2a81f6197d8ec2a7e9afea33df1a9795c693d4..c3e2a0322fe76809f257e8c8b29ab64eedca0e92 100644 --- a/i18n/ita/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json +++ b/i18n/ita/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json @@ -11,20 +11,26 @@ "welcomePage.openFolder": "Apri cartella...", "welcomePage.cloneGitRepository": "Clona repository GIT...", "welcomePage.recent": "Recenti", + "welcomePage.moreRecent": "Altro...", "welcomePage.noRecentFolders": "Non ci sono cartelle recenti", "welcomePage.help": "Guida", + "welcomePage.keybindingsCheatsheet": "Bigino combinazione tasti stampabile", "welcomePage.introductoryVideos": "Video introduttivi", "welcomePage.productDocumentation": "Documentazione del prodotto", "welcomePage.gitHubRepository": "Repository GitHub", "welcomePage.stackOverflow": "Stack Overflow", "welcomePage.showOnStartup": "Mostra la pagina iniziale all'avvio", "welcomePage.customize": "Personalizza", + "welcomePage.installExtensionPacks": "Strumenti e linguaggi", + "welcomePage.installExtensionPacksDescription": "Installare il supporto per {0} e {1}", + "welcomePage.moreExtensions": "altro", "welcomePage.installKeymapDescription": "Installa i tasti di scelta rapida", + "welcomePage.installKeymapExtension": "Installa i tasti di scelta rapida di {0} e {1}", "welcomePage.others": "altri", "welcomePage.colorTheme": "Tema colori", "welcomePage.colorThemeDescription": "Tutto quel che serve per configurare editor e codice nel modo desiderato", + "welcomePage.learn": "Impara", "welcomePage.showCommands": "Trova ed esegui tutti i comandi", - "welcomePage.showCommandsDescription": "Accesso e ricerca rapida di comandi dal pannello di controllo ({0})", "welcomePage.interfaceOverview": "Panoramica dell'interfaccia", "welcomePage.interfaceOverviewDescription": "Immagine in sovrimpressione che evidenzia i principali componenti dell'interfaccia utente", "welcomePage.interactivePlayground": "Playground interattivo", diff --git a/i18n/ita/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.contribution.i18n.json b/i18n/ita/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.contribution.i18n.json index 20dd0cb2b010c7f95050ed479741c77ac3cc85eb..915868bb161b9967679728659506e2597fa39976 100644 --- a/i18n/ita/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.contribution.i18n.json +++ b/i18n/ita/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.contribution.i18n.json @@ -4,7 +4,5 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "workbenchConfigurationTitle": "Area di lavoro", - "welcomePage.enabled": "Se è abilitata, visualizzerà la pagina Benvenuti all'avvio.", "help": "Guida" } \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json b/i18n/ita/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json index d2d18b208df55a0ddc9317c4fad8d0e8bcd20e0d..d5b9daf31033e9cce976b231fca0da340c551040 100644 --- a/i18n/ita/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json +++ b/i18n/ita/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json @@ -4,12 +4,35 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "workbenchConfigurationTitle": "Area di lavoro", + "welcomePage.enabled": "Se è abilitata, visualizzerà la pagina Benvenuti all'avvio.", "welcomePage": "Benvenuti", + "welcomePage.javaScript": "JavaScript", + "welcomePage.typeScript": "TypeScript", + "welcomePage.python": "Python", + "welcomePage.php": "PHP", + "welcomePage.docker": "Docker", + "welcomePage.vim": "Vim", + "welcomePage.sublime": "Sublime", + "welcomePage.atom": "Atom", + "welcomePage.extensionPackAlreadyInstalled": "Il supporto per {0} è già installato.", + "welcomePage.willReloadAfterInstallingExtensionPack": "La finestra verrà ricaricata dopo l'installazione di supporto aggiuntivo per {0}.", + "welcomePage.installingExtensionPack": "Installazione di supporto aggiuntivo per {0} in corso...", + "welcomePage.extensionPackNotFound": "Il supporto per {0} con ID {1} non è stato trovato.", "welcomePage.keymapAlreadyInstalled": "I tasti di scelta rapida di {0} sono già installati.", "welcomePage.willReloadAfterInstallingKeymap": "La finestra verrà ricaricata dopo l'installazione dei tasti di scelta rapida di {0}.", "welcomePage.installingKeymap": "Installazione dei tasti di scelta rapida di {0}...", "welcomePage.keymapNotFound": "I tasti di scelta rapida di {0} con ID {1} non sono stati trovati.", "welcome.title": "Benvenuti", + "welcomePage.openFolderWithPath": "Apri la cartella {0} con percorso {1}", + "welcomePage.extensionListSeparator": ",", + "welcomePage.installKeymap": "Installa mappatura tastiera {0}", + "welcomePage.installExtensionPack": "Installa supporto aggiuntivo per {0}", + "welcomePage.installedKeymap": "Mappatura tastiera {0} è già installata", + "welcomePage.installedExtensionPack": "Il supporto {0} è già installato", "ok": "OK", - "cancel": "Annulla" + "details": "Dettagli", + "cancel": "Annulla", + "welcomePage.buttonBackground": "Colore di sfondo dei pulsanti nella pagina di benvenuto.", + "welcomePage.buttonHoverBackground": "Colore di sfondo al passaggio del mouse dei pulsanti nella pagina di benvenuto." } \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json b/i18n/ita/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json index e40df93be8dd28108027a76c623e235251736142..1ee1f44cc1d836645e73390c2217eb0d7d4dffa0 100644 --- a/i18n/ita/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json +++ b/i18n/ita/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json @@ -5,5 +5,6 @@ // Do not edit this file. It is machine generated. { "walkThrough.unboundCommand": "non associato", - "walkThrough.gitNotFound": "Sembra che GIT non sia installato nel sistema." + "walkThrough.gitNotFound": "Sembra che GIT non sia installato nel sistema.", + "walkThrough.embeddedEditorBackground": "Colore di sfondo degli editor incorporati nel playground interattivo." } \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json b/i18n/ita/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json index 52726bd226cdbb4eac1197500aa63487a516bcdf..4566b1bcc6f46a1e81e4836850cdb6fd9cc01324 100644 --- a/i18n/ita/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json +++ b/i18n/ita/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json @@ -6,6 +6,12 @@ { "open": "Apri impostazioni", "close": "Chiudi", + "saveAndRetry": "Salva le impostazioni e riprova", "errorUnknownKey": "Non è possibile scrivere nel file di configurazione. La chiave è sconosciuta", - "errorInvalidTarget": "Non è possibile scrivere nel file di configurazione (destinazione non valida)" + "errorInvalidTarget": "Non è possibile scrivere nel file di configurazione (destinazione non valida)", + "errorNoWorkspaceOpened": "Impossibile scrivere nelle impostazioni perché nessuna cartella è aperta. Si prega di aprire una cartella e riprovare.", + "errorInvalidConfiguration": "Impossibile scrivere nelle impostazioni. Si prega di aprire **Impostazioni utente** per correggere eventuali errori o avvisi nel file e riprovare.", + "errorInvalidConfigurationWorkspace": "Impossibile scrivere in impostazioni. Si prega di aprire **Impostazioni area di lavoro** per correggere eventuali errori o avvisi nel file e riprovare.", + "errorConfigurationFileDirty": "Impossibile scrivere nelle impostazioni perché il file è stato modificato ma non salvato. Si prega di salvare il file **impostazioni utente** e riprovare.", + "errorConfigurationFileDirtyWorkspace": "Non è possibile scrivere in impostazioni perché il file è stato modificato ma non salvato. Salvare il file delle **Impostazioni area di lavoro** e riprovare." } \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/services/crashReporter/common/crashReporterService.i18n.json b/i18n/ita/src/vs/workbench/services/crashReporter/common/crashReporterService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..f3982be9f88ef8e54e38ebe657d785e8c12db408 --- /dev/null +++ b/i18n/ita/src/vs/workbench/services/crashReporter/common/crashReporterService.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "telemetryConfigurationTitle": "Telemetria", + "telemetry.enableCrashReporting": "Consente l'invio di segnalazioni di arresto anomalo del sistema a Microsoft.\nPer rendere effettiva questa opzione, è necessario riavviare." +} \ No newline at end of file diff --git a/i18n/ita/src/vs/workbench/services/progress/browser/progressService2.i18n.json b/i18n/ita/src/vs/workbench/services/progress/browser/progressService2.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..6db7d6aae514a031afce5ac346abfd84bb8ee1cc --- /dev/null +++ b/i18n/ita/src/vs/workbench/services/progress/browser/progressService2.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "progress.text": "{0} - {1}", + "progress.title": "{0}: {1}" +} \ No newline at end of file diff --git a/i18n/jpn/extensions/git/out/commands.i18n.json b/i18n/jpn/extensions/git/out/commands.i18n.json index 8ecbb5639655116b15057b0c168a8a003269d53c..9c6bd23d155497ce9626c3af20abe4ee9f3cda4e 100644 --- a/i18n/jpn/extensions/git/out/commands.i18n.json +++ b/i18n/jpn/extensions/git/out/commands.i18n.json @@ -26,6 +26,9 @@ "provide commit message": "コミット メッセージを入力してください", "branch name": "ブランチ名", "provide branch name": "ブランチ名を指定してください", + "select branch to delete": "削除するブランチの選択", + "confirm force delete branch": "ブランチ '{0}' はマージされていません。それでも削除しますか?", + "delete branch": "ブランチの削除", "no remotes to pull": "リポジトリには、プル元として構成されているリモートがありません。", "no remotes to push": "リポジトリには、プッシュ先として構成されているリモートがありません。", "nobranch": "リモートにプッシュするブランチをチェックアウトしてください。", diff --git a/i18n/jpn/extensions/git/package.i18n.json b/i18n/jpn/extensions/git/package.i18n.json index 66c511eaf69b24e0153c9164e4fd97173a57e88a..f71d3d2ced6394992cf3dfb1364124826f5b79d6 100644 --- a/i18n/jpn/extensions/git/package.i18n.json +++ b/i18n/jpn/extensions/git/package.i18n.json @@ -26,12 +26,13 @@ "command.undoCommit": "前回のコミットを元に戻す", "command.checkout": "チェックアウト先...", "command.branch": "分岐の作成...", + "command.deleteBranch": "ブランチの削除...", "command.pull": "プル", "command.pullRebase": "プル (リベース)", "command.push": "プッシュ", "command.pushTo": "プッシュ先...", "command.sync": "同期", - "command.publish": "公開", + "command.publish": "ブランチの発行", "command.showOutput": "Git 出力の表示", "config.enabled": "Git が有効になっているかどうか", "config.path": "Git 実行可能ファイルのパス", diff --git a/i18n/jpn/extensions/jake/out/main.i18n.json b/i18n/jpn/extensions/jake/out/main.i18n.json index 8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a..0f77342ecbcca766fee6a8b69eb32ebdb8fffe05 100644 --- a/i18n/jpn/extensions/jake/out/main.i18n.json +++ b/i18n/jpn/extensions/jake/out/main.i18n.json @@ -3,4 +3,6 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. -{} \ No newline at end of file +{ + "execFailed": "Jake のエラーによる失敗を自動検出: {0}" +} \ No newline at end of file diff --git a/i18n/jpn/extensions/jake/package.i18n.json b/i18n/jpn/extensions/jake/package.i18n.json index 8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a..def0eab1b4ce2f598a84ae1875bb0fc4c473a1a7 100644 --- a/i18n/jpn/extensions/jake/package.i18n.json +++ b/i18n/jpn/extensions/jake/package.i18n.json @@ -3,4 +3,6 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. -{} \ No newline at end of file +{ + "config.jake.autoDetect": "Jake タスクの自動検出をオンにするかオフにするかを制御します。既定はオンです。" +} \ No newline at end of file diff --git a/i18n/jpn/extensions/markdown/out/extension.i18n.json b/i18n/jpn/extensions/markdown/out/extension.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..fd083fda4b6ca0b11b321bbf899b91eb4ee1f1c6 --- /dev/null +++ b/i18n/jpn/extensions/markdown/out/extension.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "onPreviewStyleLoadError": "'markdown.styles' を読み込むことができません: {0}" +} \ No newline at end of file diff --git a/i18n/jpn/extensions/merge-conflict/out/codelensProvider.i18n.json b/i18n/jpn/extensions/merge-conflict/out/codelensProvider.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..e4f0ccc6045abfb9c5931601ab7781f151d55a7f --- /dev/null +++ b/i18n/jpn/extensions/merge-conflict/out/codelensProvider.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "acceptCurrentChange": "現在の変更を取り込む", + "acceptIncomingChange": "入力側の変更を取り込む", + "acceptBothChanges": "両方の変更を取り込む", + "compareChanges": "変更の比較" +} \ No newline at end of file diff --git a/i18n/jpn/extensions/merge-conflict/out/commandHandler.i18n.json b/i18n/jpn/extensions/merge-conflict/out/commandHandler.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..aa976005ee9e24a4a7f7bd4127198ec0b31ea251 --- /dev/null +++ b/i18n/jpn/extensions/merge-conflict/out/commandHandler.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "cursorNotInConflict": "エディターのカーソルがマージの競合の範囲内にありません", + "compareChangesTitle": "{0}: 現在の変更 ⟷ 入力側の変更", + "cursorOnSplitterRange": "エディターのカーソルがマージ コンフリクトのスプリッター内にあります。”現在” または \"入力側\" のいずれかのブロックに移動してください", + "noConflicts": "このファイルにマージの競合は存在しません", + "noOtherConflictsInThisFile": "このファイルに他のマージの競合は存在しません" +} \ No newline at end of file diff --git a/i18n/jpn/extensions/merge-conflict/out/mergeDecorator.i18n.json b/i18n/jpn/extensions/merge-conflict/out/mergeDecorator.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..6f8b1654a4d4ff9d6b7d22ea373d3501226e0adc --- /dev/null +++ b/i18n/jpn/extensions/merge-conflict/out/mergeDecorator.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "currentChange": "(現在の変更)", + "incomingChange": "(入力側の変更)" +} \ No newline at end of file diff --git a/i18n/jpn/extensions/merge-conflict/package.i18n.json b/i18n/jpn/extensions/merge-conflict/package.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..3a6930d38af31d0448f6a64016acf48b84e9204a --- /dev/null +++ b/i18n/jpn/extensions/merge-conflict/package.i18n.json @@ -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. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "command.category": "マージの競合", + "command.accept.all-incoming": "入力側のすべてを取り込む", + "command.accept.all-both": "両方をすべて取り込む", + "command.accept.current": "現在の方を取り込む", + "command.accept.incoming": "入力側を取り込む", + "command.accept.selection": "選択項目を取り込む", + "command.accept.both": "両方を取り込む", + "command.next": "次の競合", + "command.previous": "前の競合", + "command.compare": "現在の競合を比較", + "config.title": "マージの競合", + "config.codeLensEnabled": "エディター内のマージ競合ブロックで CodeLens を有効/無効にします", + "config.decoratorsEnabled": "エディター内でマージの競合デコレーターを有効/無効にします。" +} \ No newline at end of file diff --git a/i18n/jpn/extensions/npm/package.i18n.json b/i18n/jpn/extensions/npm/package.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..6a332075fd0c7ec02f79f2729259038951ef67a2 --- /dev/null +++ b/i18n/jpn/extensions/npm/package.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "config.npm.autoDetect": "npm スクリプトの自動検出をオンにするかオフにするかを制御します。既定はオンです。" +} \ No newline at end of file diff --git a/i18n/jpn/extensions/typescript/out/features/bufferSyncSupport.i18n.json b/i18n/jpn/extensions/typescript/out/features/bufferSyncSupport.i18n.json index 01e33938ce2b0d9341e69d0320c73824da6f0e60..4df0b825c766933e407b58d7cd6111c42248df59 100644 --- a/i18n/jpn/extensions/typescript/out/features/bufferSyncSupport.i18n.json +++ b/i18n/jpn/extensions/typescript/out/features/bufferSyncSupport.i18n.json @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "versionMismatch": "グローバルな tsc ({0}) と VS Code の言語サービス ({1}) の間にバージョンの不一致があります。非整合のコンパイル エラーを引き起こす可能性があります", "moreInformation": "詳細情報", "doNotCheckAgain": "今後確認しない", "close": "閉じる", diff --git a/i18n/jpn/extensions/typescript/out/utils/projectStatus.i18n.json b/i18n/jpn/extensions/typescript/out/utils/projectStatus.i18n.json index 2b687b8f1c5320f692e75c8e72721f4f3994e43d..9cd627a0d907a461c702a0e8cfc3f6f7dc77ebac 100644 --- a/i18n/jpn/extensions/typescript/out/utils/projectStatus.i18n.json +++ b/i18n/jpn/extensions/typescript/out/utils/projectStatus.i18n.json @@ -6,7 +6,6 @@ { "hintExclude": "プロジェクト全体の JavaScript/TypeScript 言語機能を有効にするには、多数のファイルが含まれるフォルダーを除外します。例: {0}", "hintExclude.generic": "プロジェクト全体の JavaScript/TypeScript 言語機能を有効にするには、作業していないソース ファイルが含まれるサイズの大きなフォルダーを除外します。", - "open": "除外の構成", "large.label": "除外の構成", "hintExclude.tooltip": "プロジェクト全体の JavaScript/TypeScript 言語機能を有効にするには、作業していないソース ファイルが含まれるサイズの大きなフォルダーを除外します。" } \ No newline at end of file diff --git a/i18n/jpn/extensions/typescript/out/utils/typingsStatus.i18n.json b/i18n/jpn/extensions/typescript/out/utils/typingsStatus.i18n.json index 5696b940392106ce4b06936b77acbba284102219..1f1eb703bd6b7a0bb1b28dde4804507f0a46438d 100644 --- a/i18n/jpn/extensions/typescript/out/utils/typingsStatus.i18n.json +++ b/i18n/jpn/extensions/typescript/out/utils/typingsStatus.i18n.json @@ -5,7 +5,7 @@ // Do not edit this file. It is machine generated. { "installingPackages": "より適した TypeScript IntelliSense に関するデータをフェッチしています", - "typesInstallerInitializationFailed.title": "JavaScript 言語機能のための型定義ファイルをインストールできませんでした。NPM がインストールされ、PATH にあることを確認してください。", + "typesInstallerInitializationFailed.title": "JavaScript 言語機能のための型定義ファイルをインストールできませんでした。NPM のインストールを確認するか、ユーザー設定で 'typescript.npm' を構成してください", "typesInstallerInitializationFailed.moreInformation": "詳細情報", "typesInstallerInitializationFailed.doNotCheckAgain": "今後確認しない", "typesInstallerInitializationFailed.close": "閉じる" diff --git a/i18n/jpn/extensions/typescript/package.i18n.json b/i18n/jpn/extensions/typescript/package.i18n.json index e30965564d08be2d34c940c76b0a490283c74ef5..dcf8478a4d65959d774471829b0c2b11d88c5c3d 100644 --- a/i18n/jpn/extensions/typescript/package.i18n.json +++ b/i18n/jpn/extensions/typescript/package.i18n.json @@ -13,7 +13,6 @@ "typescript.check.tscVersion": "グローバル インストール TypeScript コンパイラ (tsc など) が、使用された TypeScript 言語サービスと異なっているかどうかを確認します。", "typescript.tsserver.log": "ファイルへの TS サーバーのログを有効にします。このログは TS サーバーの問題を診断するために使用できます。ログには、プロジェクトのファイルパス、ソースコード、その他の潜在的に機密性の高い情報が含まれている場合があります。", "typescript.tsserver.trace": "TS サーバーに送信されるメッセージのトレースを有効にします。このトレースは TS サーバーの問題を診断するために使用できます。トレースには、プロジェクトのファイルパス、ソースコード、その他の潜在的に機密性の高い情報が含まれている場合があります。", - "typescript.tsserver.experimentalAutoBuild": "試験的な自動ビルドを有効にします。1.9 dev または 2.x tsserver バージョンと、変更後に VS Code の再起動が必要です。", "typescript.validate.enable": "TypeScript の検証を有効/無効にします。", "typescript.format.enable": "既定の TypeScript フォーマッタを有効/無効にします。", "javascript.format.enable": "既定の JavaScript フォーマッタを有効/無効にします。", @@ -33,10 +32,16 @@ "javascript.validate.enable": "JavaScript の検証を有効/無効にします。", "typescript.goToProjectConfig.title": "プロジェクト構成に移動", "javascript.goToProjectConfig.title": "プロジェクト構成に移動", + "javascript.referencesCodeLens.enabled": "JavaScript ファイル内で CodeLens の参照を有効/無効にします。", + "typescript.referencesCodeLens.enabled": "TypeScript ファイル内で CodeLens の参照を有効/無効にします。TypeScript 2.0.6 以上が必要です。", "typescript.implementationsCodeLens.enabled": "CodeLens の実装を有効/無効にします。TypeScript 2.2.0 以上が必要です。", "typescript.openTsServerLog.title": "TS サーバーのログを開く", + "typescript.restartTsServer": "TS サーバーを再起動する", "typescript.selectTypeScriptVersion.title": "TypeScript のバージョンの選択", "jsDocCompletion.enabled": " 自動 JSDoc コメントを有効/無効にします", "javascript.implicitProjectConfig.checkJs": "JavaScript ファイルのセマンティック チェックを有効/無効にします。既存の jsconfi.json や tsconfi.json ファイルの設定はこれより優先されます。TypeScript は 2.3.1 以上である必要があります。", - "typescript.check.npmIsInstalled": "型定義の自動取得に NPM がインストールされているかどうかを確認する" + "typescript.npm": "型定義の自動取得に使用される NPM 実行可能ファイルへのパスを指定します。TypeScript 2.3.4 以上が必要です。", + "typescript.check.npmIsInstalled": "型定義の自動取得に NPM がインストールされているかどうかを確認します。", + "javascript.nameSuggestions": "JavaScript の候補リスト内でファイルから一意の名前を含むかどうかを有効/無効にします。", + "typescript.tsc.autoDetect": "tsc タスクの自動検出をオンにするかオフにするかを制御します。" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json b/i18n/jpn/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json index ea2e47d981329b87d779876ebfc822aadcad8994..d00ceb129a0f404dd289e6d746610ee0fb84db42 100644 --- a/i18n/jpn/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json +++ b/i18n/jpn/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json @@ -5,9 +5,8 @@ // Do not edit this file. It is machine generated. { "imgMeta": "{0}x{1} {2}", - "largeImageError": "イメージが大きすぎてエディターに表示できません。", - "resourceOpenExternalButton": "イメージを開く", - "resourceOpenExternalText": " 外部プログラムを使用していますか?", + "largeImageError": "画像が非常に大きいため、エディターに表示されません。 ", + "resourceOpenExternalButton": "外部のプログラムを使用して画像を開きますか?", "nativeBinaryError": "このファイルはバイナリか、非常に大きいか、またはサポートされていないテキスト エンコードを使用しているため、エディターに表示されません。", "sizeB": "{0}B", "sizeKB": "{0}KB", diff --git a/i18n/jpn/src/vs/base/common/errorMessage.i18n.json b/i18n/jpn/src/vs/base/common/errorMessage.i18n.json index d233c4458225933e1b7e5079aab01fb669885bfe..43574f420b29d7a27cfd6b5d585775c84da9c118 100644 --- a/i18n/jpn/src/vs/base/common/errorMessage.i18n.json +++ b/i18n/jpn/src/vs/base/common/errorMessage.i18n.json @@ -13,6 +13,5 @@ "error.connection.unknown": "不明な接続エラーが発生しました。インターネット接続が切れたか、接続先のサーバーがオフラインです。", "stackTrace.format": "{0}: {1}", "error.defaultMessage": "不明なエラーが発生しました。ログで詳細を確認してください。", - "nodeExceptionMessage": "システム エラーが発生しました ({0})", "error.moreErrors": "{0} (合計 {1} エラー)" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/base/common/keybindingLabels.i18n.json b/i18n/jpn/src/vs/base/common/keybindingLabels.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a --- /dev/null +++ b/i18n/jpn/src/vs/base/common/keybindingLabels.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{} \ No newline at end of file diff --git a/i18n/jpn/src/vs/code/electron-main/menus.i18n.json b/i18n/jpn/src/vs/code/electron-main/menus.i18n.json index 79412979d8d7f2cc25695d6cd524fe19210a469c..fb8e314eb0ccbb982312ec5cad08c31dcf0bbf18 100644 --- a/i18n/jpn/src/vs/code/electron-main/menus.i18n.json +++ b/i18n/jpn/src/vs/code/electron-main/menus.i18n.json @@ -133,11 +133,11 @@ "miColumnBreakpoint": "列のブレークポイント(&&O)", "miFunctionBreakpoint": "関数のブレークポイント(&&F)...", "miNewBreakpoint": "新しいブレークポイント(&&N)", + "miEnableAllBreakpoints": "すべてのブレークポイントを有効にする", "miDisableAllBreakpoints": "すべてのブレークポイントを無効にする(&&L)", "miRemoveAllBreakpoints": "すべてのブレークポイントを削除する(&&R)", "miInstallAdditionalDebuggers": "その他のデバッガーをインストールします(&&I)...", "mMinimize": "最小化", - "mClose": "閉じる", "mBringToFront": "すべてを前面に配置", "miToggleDevTools": "開発者ツールの切り替え(&&T)", "miAccessibilityOptions": "ユーザー補助オプション(&&O)", @@ -153,6 +153,8 @@ "miLicense": "ライセンスの表示(&&L)", "miPrivacyStatement": "プライバシーについて(&&P)", "miAbout": "バージョン情報(&&A)", + "miTerminateTask": "タスクの終了(&&T)", + "accessibilityOptionsWindowTitle": "ユーザー補助オプション", "miRestartToUpdate": "更新のために再起動します...", "miCheckingForUpdates": "更新を確認しています...", "miDownloadUpdate": "利用可能な更新プログラムをダウンロードします", diff --git a/i18n/jpn/src/vs/code/electron-main/windows.i18n.json b/i18n/jpn/src/vs/code/electron-main/windows.i18n.json index 6b0480ce2d2eb1a827a31539bb5faa7e47f82933..6a230da6588c3f4edc2fe66089583fa729f346a8 100644 --- a/i18n/jpn/src/vs/code/electron-main/windows.i18n.json +++ b/i18n/jpn/src/vs/code/electron-main/windows.i18n.json @@ -7,16 +7,11 @@ "ok": "OK", "pathNotExistTitle": "パスが存在しません", "pathNotExistDetail": "パス '{0}' はディスクに存在しなくなったようです。", - "accessibilityOptionsWindowTitle": "ユーザー補助オプション", "reopen": "もう一度開く", "wait": "待機を続ける", "close": "閉じる", "appStalled": "ウィンドウから応答がありません", "appStalledDetail": "ウィンドウを再度開くか、閉じるか、このまま待機できます。", "appCrashed": "ウィンドウがクラッシュしました", - "appCrashedDetail": "ご不便をおかけして申し訳ありません。ウィンドウを再度開いて、中断したところから続行できます。", - "newWindow": "新しいウィンドウ", - "newWindowDesc": "新しいウィンドウを開く", - "recentFolders": "最近使用したフォルダー", - "folderDesc": "{0} {1}" + "appCrashedDetail": "ご不便をおかけして申し訳ありません。ウィンドウを再度開いて、中断したところから続行できます。" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/editor/common/config/commonEditorConfig.i18n.json b/i18n/jpn/src/vs/editor/common/config/commonEditorConfig.i18n.json index da6b50dacf0750f546fe56e88d3dcfa726209a4e..ffbae4db59c58ac1f36d24c60d80f069ccfba8d6 100644 --- a/i18n/jpn/src/vs/editor/common/config/commonEditorConfig.i18n.json +++ b/i18n/jpn/src/vs/editor/common/config/commonEditorConfig.i18n.json @@ -21,8 +21,11 @@ "roundedSelection": "選択範囲の角を丸くするかどうかを制御します", "scrollBeyondLastLine": "エディターで最後の行を越えてスクロールするかどうかを制御します", "minimap.enabled": "ミニマップを表示するかどうかを制御します", + "minimap.showSlider": "ミニマップを自動的に非表示にするかどうかを制御します 。", "minimap.renderCharacters": "行に (カラー ブロックではなく) 実際の文字を表示します", "minimap.maxColumn": "表示するミニマップの最大幅を特定の桁数に制限します", + "find.seedSearchStringFromSelection": "エディターの選択から検索ウィジェット内の検索文字列を与えるかどうかを制御します", + "find.autoFindInSelection": "エディター内で複数の文字もしくは行が選択されているときに選択範囲を検索するフラグを有効にするかどうかを制御します", "wordWrap.off": "行を折り返しません。", "wordWrap.on": "行をビューポートの幅で折り返します。", "wordWrap.wordWrapColumn": "行を 'editor.wordWrapColumn' で折り返します。", @@ -31,17 +34,19 @@ "wordWrapColumn": "'editor.wordWrap' が 'wordWrapColumn' または 'bounded' の場合に、エディターの折り返し桁を制御します。", "wrappingIndent": "折り返し行のインデントを制御します。'none'、'same'、または 'indent' のいずれかを指定できます。", "mouseWheelScrollSensitivity": "マウス ホイール スクロール イベントの `deltaX` と `deltaY` で使用される乗数", + "multiCursorModifier.ctrlCmd": "Windows および Linux 上の `Control` と OSX 上の `Command` にマップします。", + "multiCursorModifier.alt": "Windows および Linux 上の `Alt` と OSX 上の `Option` にマップします。", + "multiCursorModifier": "マウスで複数のカーソルを追加するときに使用する修飾キーです。`ctrlCmd` は Windows および Linux 上の `Control` キーと OSX 上の `Command` キーにマップします。「定義に移動」や「リンクを開く」のマウス操作は、マルチカーソルの修飾キーと競合しないように適用されます。", "quickSuggestions.strings": "文字列内でクイック候補を有効にします。", "quickSuggestions.comments": "コメント内でクイック候補を有効にします。", "quickSuggestions.other": "文字列およびコメント外でクイック候補を有効にします。", "quickSuggestions": "入力中に候補を自動的に表示するかどうかを制御します", "quickSuggestionsDelay": "クイック候補が表示されるまでの待ち時間 (ミリ秒) を制御します", - "parameterHints": "パラメーター ヒントを有効にする", "autoClosingBrackets": "エディターで左角かっこの後に自動的に右角かっこを挿入するかどうかを制御します", "formatOnType": "エディターで入力後に自動的に行の書式設定を行うかどうかを制御します", "formatOnPaste": "貼り付けた内容がエディターにより自動的にフォーマットされるかどうかを制御します。フォーマッタを使用可能にする必要があります。また、フォーマッタがドキュメント内の範囲をフォーマットできなければなりません。", "suggestOnTriggerCharacters": "トリガー文字の入力時に候補が自動的に表示されるようにするかどうかを制御します", - "acceptSuggestionOnEnter": "'Tab' キーに加えて 'Enter' キーで候補を受け入れるかどうかを制御します。改行の挿入や候補の反映の間であいまいさを解消するのに役立ちます。", + "acceptSuggestionOnEnter": "'Tab' キーに加えて 'Enter' キーで候補を受け入れるかどうかを制御します。改行の挿入や候補の反映の間であいまいさを解消するのに役立ちます。'smart' 値は文字を変更するときに、Enter キーを押すだけで提案を反映することを意味します。", "acceptSuggestionOnCommitCharacter": "コミット文字で候補を受け入れるかどうかを制御します。たとえば、JavaScript ではセミコロン (';') をコミット文字にして、候補を受け入れてその文字を入力することができます。", "snippetSuggestions": "他の修正候補と一緒にスニペットを表示するかどうか、およびその並び替えの方法を制御します。", "emptySelectionClipboard": "選択範囲を指定しないでコピーする場合に現在の行をコピーするかどうかを制御します。", @@ -63,12 +68,17 @@ "renderLineHighlight": "エディターが現在の行をどのように強調表示するかを制御します。考えられる値は 'none'、'gutter'、'line'、'all' です。", "codeLens": "エディターで CodeLens を表示するかどうかを制御する", "folding": "エディターでコードの折りたたみを有効にするかどうかを制御します", + "showFoldingControls": "余白上の折りたたみコントロールを自動的に非表示にするかどうかを制御します 。", "matchBrackets": "かっこを選択すると、対応するかっこを強調表示します。", "glyphMargin": "エディターで縦のグリフ余白が表示されるかどうかを制御します。ほとんどの場合、グリフ余白はデバッグに使用されます。", "useTabStops": "空白の挿入や削除はタブ位置に従って行われます", "trimAutoWhitespace": "自動挿入された末尾の空白を削除する", "stablePeek": "エディターのコンテンツをダブルクリックするか、Esc キーを押しても、ピーク エディターを開いたままにします。", "dragAndDrop": "ドラッグ アンド ドロップによる選択範囲の移動をエディターが許可する必要があるかどうかを制御します。", + "accessibilitySupport.auto": "エディターはスクリーン リーダーがいつ接続されたかを検出するためにプラットフォーム API を使用します。", + "accessibilitySupport.on": "エディターは永続的にスクリーン リーダー向けに最適化されます。", + "accessibilitySupport.off": "エディターはスクリーン リーダー向けに最適化されません。", + "accessibilitySupport": "エディターをスクリーン リーダーに最適化されたモードで実行するかどうかを制御します。", "sideBySide": "差分エディターが差分を横に並べて表示するか、行内に表示するかを制御します", "ignoreTrimWhitespace": "差分エディターが、先頭または末尾の空白の変更を差分として表示するかどうかを制御します。", "renderIndicators": "差分エディターが追加/削除された変更に +/- インジケーターを示すかどうかを制御します", diff --git a/i18n/jpn/src/vs/editor/common/config/editorOptions.i18n.json b/i18n/jpn/src/vs/editor/common/config/editorOptions.i18n.json index 3fdfb4e461b96736f5c05a6886cecc36399c802a..be8d7821ab4eec113eba2b153d9b59578c5aec40 100644 --- a/i18n/jpn/src/vs/editor/common/config/editorOptions.i18n.json +++ b/i18n/jpn/src/vs/editor/common/config/editorOptions.i18n.json @@ -4,5 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "accessibilityOffAriaLabel": "現在エディターにアクセスすることはできません。 Alt + F1 キーを押してオプションを選択します。", "editorViewAccessibleLabel": "エディターのコンテンツ" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/editor/common/view/editorColorRegistry.i18n.json b/i18n/jpn/src/vs/editor/common/view/editorColorRegistry.i18n.json index f364e5e0d147a48a1a860cc40941227e9c4e3cdb..b380e645e98602146bb9015209436e3bb3fd6385 100644 --- a/i18n/jpn/src/vs/editor/common/view/editorColorRegistry.i18n.json +++ b/i18n/jpn/src/vs/editor/common/view/editorColorRegistry.i18n.json @@ -16,5 +16,9 @@ "editorBracketMatchBackground": "一致するかっこの背景色", "editorBracketMatchBorder": "一致するかっこ内のボックスの色", "editorOverviewRulerBorder": "概要ルーラーの境界色。", - "editorGutter": "エディターの余白の背景色。余白にはグリフ マージンと行番号が含まれます。" + "editorGutter": "エディターの余白の背景色。余白にはグリフ マージンと行番号が含まれます。", + "errorForeground": "エディターでエラーを示す波線の前景色。", + "errorBorder": "エディターでエラーを示す波線の境界線の色。", + "warningForeground": "エディターで警告を示す波線の前景色。", + "warningBorder": "エディターで警告を示す波線の境界線の色。" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/editor/contrib/find/common/findController.i18n.json b/i18n/jpn/src/vs/editor/contrib/find/common/findController.i18n.json index 873ccff036a9bbecb43ac27bfd40ba3f4d25453b..f949479f389162ca90a3bba510783aaf2c306080 100644 --- a/i18n/jpn/src/vs/editor/contrib/find/common/findController.i18n.json +++ b/i18n/jpn/src/vs/editor/contrib/find/common/findController.i18n.json @@ -14,6 +14,5 @@ "addSelectionToPreviousFindMatch": "選んだ項目を前の一致項目に追加する", "moveSelectionToNextFindMatch": "最後に選択した項目を次の一致項目に移動", "moveSelectionToPreviousFindMatch": "最後に選んだ項目を前の一致項目に移動する", - "selectAllOccurencesOfFindMatch": "一致するすべての出現箇所を選択します", "changeAll.label": "すべての出現箇所を変更" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/editor/contrib/format/browser/formatActions.i18n.json b/i18n/jpn/src/vs/editor/contrib/format/browser/formatActions.i18n.json index d1fd1741e7486efe93df0a756a4d5c7d923f1068..6a613cb5b685b54036def7da759b7ec55fc65d1d 100644 --- a/i18n/jpn/src/vs/editor/contrib/format/browser/formatActions.i18n.json +++ b/i18n/jpn/src/vs/editor/contrib/format/browser/formatActions.i18n.json @@ -9,5 +9,5 @@ "hint1n": "Made 1 formatting edit between lines {0} and {1}", "hintnn": "Made {0} formatting edits between lines {1} and {2}", "formatDocument.label": "Format Document", - "formatSelection.label": "Format Selection" + "formatSelection.label": "選択範囲のフォーマット" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.i18n.json b/i18n/jpn/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..624f9b7af703013519ac2bcf87c514750501d8e2 --- /dev/null +++ b/i18n/jpn/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.i18n.json @@ -0,0 +1,23 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "noResultWord": "'{0}' の定義は見つかりません", + "generic.noResults": "定義が見つかりません", + "meta.title": " – {0} 個の定義", + "actions.goToDecl.label": "定義へ移動", + "actions.goToDeclToSide.label": "定義を横に開く", + "actions.previewDecl.label": "定義をここに表示", + "goToImplementation.noResultWord": "'{0}' の実装が見つかりません", + "goToImplementation.generic.noResults": "実装が見つかりません", + "meta.implementations.title": "– {0} 個の実装", + "actions.goToImplementation.label": "実装に移動", + "actions.peekImplementation.label": "実装のプレビュー", + "goToTypeDefinition.noResultWord": "'{0}' の型定義が見つかりません", + "goToTypeDefinition.generic.noResults": "型定義が見つかりません", + "meta.typeDefinitions.title": " – {0} 個の型定義", + "actions.goToTypeDefinition.label": "型定義へ移動", + "actions.peekTypeDefinition.label": "型定義を表示" +} \ No newline at end of file diff --git a/i18n/jpn/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.i18n.json b/i18n/jpn/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..f918ba9f96d5c2129b6fc2e5d1896df28ba4db1d --- /dev/null +++ b/i18n/jpn/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "multipleResults": "クリックして、{0} の定義を表示します。" +} \ No newline at end of file diff --git a/i18n/jpn/src/vs/editor/contrib/links/browser/links.i18n.json b/i18n/jpn/src/vs/editor/contrib/links/browser/links.i18n.json index 178a2d932ba15cc565f2a9fe55fbee7a83e64f44..67812ff35d18ce6bafb15bf9d8a3ad6e2f4ab8f7 100644 --- a/i18n/jpn/src/vs/editor/contrib/links/browser/links.i18n.json +++ b/i18n/jpn/src/vs/editor/contrib/links/browser/links.i18n.json @@ -6,6 +6,7 @@ { "links.navigate.mac": "command キーを押しながらクリックしてリンク先を表示", "links.navigate": "Ctrl キーを押しながらクリックしてリンク先を表示", + "links.navigate.al": "Altl キーを押しながらクリックしてリンク先を表示", "invalid.url": "申し訳ありません。このリンクは形式が正しくないため開くことができませんでした: {0}", "missing.url": "申し訳ありません。このリンクはターゲットが存在しないため開くことができませんでした。", "label": "リンクを開く" diff --git a/i18n/jpn/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json b/i18n/jpn/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json index 0e09eb3904df0af3f2c86cbb8f3267b3e4378c1d..39b8edf5de2aa7f6f30a5d42fb933f4d37649fe8 100644 --- a/i18n/jpn/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json +++ b/i18n/jpn/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json @@ -5,8 +5,6 @@ // Do not edit this file. It is machine generated. { "aria.oneReference": "列 {2} の {1} 行目に {0} つのシンボル", - "aria.fileReferences.1": "{0} に 1 個のシンボル", - "aria.fileReferences.N": "{1} に {0} 個のシンボル", "aria.result.0": "一致する項目はありません", "aria.result.1": "{0} に 1 個のシンボルが見つかりました", "aria.result.n1": "{1} に {0} 個のシンボルが見つかりました", diff --git a/i18n/jpn/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json b/i18n/jpn/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json index b5c107a4338c74df40687233bd41502f79a87a34..65e2583d291f28bdbd1a41683d11f43ba4dc8d5c 100644 --- a/i18n/jpn/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json +++ b/i18n/jpn/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json @@ -12,6 +12,7 @@ "readMore": "詳細を表示...{0}", "suggestionWithDetailsAriaLabel": "{0}、候補、詳細あり", "suggestionAriaLabel": "{0}、候補", + "readLess": "詳細を隠す...{0}", "suggestWidget.loading": "読み込んでいます...", "suggestWidget.noSuggestions": "候補はありません。", "suggestionAriaAccepted": "{0}、受け入れ済み", diff --git a/i18n/jpn/src/vs/editor/node/languageConfigurationExtensionPoint.i18n.json b/i18n/jpn/src/vs/editor/node/languageConfigurationExtensionPoint.i18n.json index 991783c660296f4acf3e612fbad7b886e4e76ae0..7f3e60f73e417a31f915cdd46ec8daa3a9d3659a 100644 --- a/i18n/jpn/src/vs/editor/node/languageConfigurationExtensionPoint.i18n.json +++ b/i18n/jpn/src/vs/editor/node/languageConfigurationExtensionPoint.i18n.json @@ -16,6 +16,7 @@ "schema.autoClosingPairs": "角かっこのペアを定義します。左角かっこが入力されると、右角かっこが自動的に挿入されます。", "schema.autoClosingPairs.notIn": "自動ペアが無効なスコープの一覧を定義します。", "schema.surroundingPairs": "選択文字列を囲むときに使用できる角かっこのペアを定義します。", + "schema.wordPattern": "言語のための単語の定義。", "schema.wordPattern.pattern": "言葉の照合に使用する正規表現パターン。", "schema.wordPattern.flags": "言葉の照合に使用する正規表現フラグ。", "schema.wordPattern.flags.errorMessage": "`/^([gimuy]+)$/` パターンに一致する必要があります。" diff --git a/i18n/jpn/src/vs/platform/actions/electron-browser/menusExtensionPoint.i18n.json b/i18n/jpn/src/vs/platform/actions/electron-browser/menusExtensionPoint.i18n.json index 5b2270de60407de7de83b3e0fffd929b770d1994..36b95788727ff63061f2b9ac64e70d944dd30364 100644 --- a/i18n/jpn/src/vs/platform/actions/electron-browser/menusExtensionPoint.i18n.json +++ b/i18n/jpn/src/vs/platform/actions/electron-browser/menusExtensionPoint.i18n.json @@ -21,6 +21,8 @@ "menus.scmTitle": "ソース管理のタイトル メニュー", "menus.resourceGroupContext": "ソース管理リソース グループのコンテキスト メニュー", "menus.resourceStateContext": "ソース管理リソース状態のコンテキスト メニュー", + "view.viewTitle": "提供されたビューのタイトル メニュー", + "view.itemContext": "提供されたビュー項目のコンテキスト メニュー", "nonempty": "空以外の値が必要です。", "opticon": "`icon` プロパティは省略できます。指定する場合には、文字列または `{dark, light}` などのリテラルにする必要があります", "requireStringOrObject": "`{0}` プロパティは必須で、`string` または `object` の型でなければなりません", diff --git a/i18n/jpn/src/vs/platform/environment/node/argv.i18n.json b/i18n/jpn/src/vs/platform/environment/node/argv.i18n.json index f63839a1d9b13c9e28c356c312d700d8904fcd73..6cd2c2e4b34acd009c647186b74f2f81258cdef5 100644 --- a/i18n/jpn/src/vs/platform/environment/node/argv.i18n.json +++ b/i18n/jpn/src/vs/platform/environment/node/argv.i18n.json @@ -6,25 +6,25 @@ { "gotoValidation": "`--goto` モードの引数は `FILE(:LINE(:CHARACTER))` の形式にする必要があります。", "diff": "差分エディターを開きます。引数として 2 つのファイル パスを渡す必要があります。", - "goto": "指定の行と文字のパスのファイルを開きます (パスに :line[:character] を追加します)。", - "locale": "使用するロケール (例: en-US、zh-TW など)。", - "newWindow": "新しいコード インスタンスを強制します。", + "goto": "指定の行と文字の位置でファイルを開きます(パスに :line[:character] を追加してください)。", + "locale": "使用する国と地域 (例:en-US や zh-TW など)。", + "newWindow": "新しい Code のインスタンスを強制します。", "performance": "'Developer: Startup Performance' コマンドを有効にして開始します。", "prof-startup": "起動中に CPU プロファイラーを実行する", "reuseWindow": "最後のアクティブ ウィンドウにファイルまたはフォルダーを強制的に開きます。", "userDataDir": "ユーザー データを保持するディレクトリを指定します。ルートで実行している場合に役立ちます。", - "verbose": "詳細出力を印刷します (お待ちください)。", - "wait": "戻る前にウィンドウが閉じるまでお待ちください。", + "verbose": "詳細出力を表示します (--wait を含みます)。", + "wait": "現在のウィンドウが閉じるまで待機します。", "extensionHomePath": "拡張機能のルート パスを設定します。", "listExtensions": "インストールされている拡張機能を一覧表示します。", - "showVersions": "#NAME?", + "showVersions": "--list-extension と使用するとき、インストールされている拡張機能のバージョンを表示します。", "installExtension": "拡張機能をインストールします。", "uninstallExtension": "拡張機能をアンインストールします。", "experimentalApis": "拡張機能に対して Proposed API 機能を有効にします。", "disableExtensions": "インストールされたすべての拡張機能を無効にします。", "disableGPU": "GPU ハードウェア アクセラレータを無効にします。", - "version": "バージョンを印刷します。", - "help": "使用法を印刷します。", + "version": "バージョンを表示します。", + "help": "使用法を表示します。", "usage": "使用法", "options": "オプション", "paths": "パス", diff --git a/i18n/jpn/src/vs/platform/extensions/common/extensionsRegistry.i18n.json b/i18n/jpn/src/vs/platform/extensions/common/extensionsRegistry.i18n.json index ae0dfa88edb83c167a87d7fbb4ec91239498f607..38e5bf8d7a177a8c840843469077728d3016ac24 100644 --- a/i18n/jpn/src/vs/platform/extensions/common/extensionsRegistry.i18n.json +++ b/i18n/jpn/src/vs/platform/extensions/common/extensionsRegistry.i18n.json @@ -14,6 +14,12 @@ "vscode.extension.contributes": "このパッケージで表される VS Code 拡張機能のすべてのコントリビューション。", "vscode.extension.preview": "Marketplace で Preview としてフラグが付けられるように拡張機能を設定します。", "vscode.extension.activationEvents": "VS Code 拡張機能のアクティブ化イベント。", + "vscode.extension.activationEvents.onLanguage": "指定された言語を解決するファイルが開かれるたびにアクティブ化イベントが発行されます。", + "vscode.extension.activationEvents.onCommand": "指定したコマンドが呼び出されるたびにアクティブ化イベントが発行されます。", + "vscode.extension.activationEvents.onDebug": "指定されたタイプのデバッグ セッションが開始されるたびにアクティブ化イベントが発行されます。", + "vscode.extension.activationEvents.workspaceContains": "指定した glob パターンに一致するファイルを少なくとも 1 つ以上含むフォルダーを開くたびにアクティブ化イベントが発行されます。", + "vscode.extension.activationEvents.onView": "指定したビューを展開するたびにアクティブ化イベントが発行されます。", + "vscode.extension.activationEvents.star": "VS Code 起動時にアクティブ化イベントを発行します。優れたエンドユーザー エクスペリエンスを確保するために、他のアクティブ化イベントの組み合わせでは望む動作にならないときのみ使用してください。", "vscode.extension.badges": "Marketplace の拡張機能ページのサイドバーに表示されるバッジの配列。", "vscode.extension.badges.url": "バッジのイメージ URL。", "vscode.extension.badges.href": "バッジのリンク。", diff --git a/i18n/jpn/src/vs/platform/history/electron-main/historyMainService.i18n.json b/i18n/jpn/src/vs/platform/history/electron-main/historyMainService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..da8dfc2d76350d6dcb2fe49ec3bf754df5f82787 --- /dev/null +++ b/i18n/jpn/src/vs/platform/history/electron-main/historyMainService.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "newWindow": "新しいウィンドウ", + "newWindowDesc": "新しいウィンドウを開く", + "recentFolders": "最近使用したフォルダー", + "folderDesc": "{0} {1}" +} \ No newline at end of file diff --git a/i18n/jpn/src/vs/platform/markers/common/problemMatcher.i18n.json b/i18n/jpn/src/vs/platform/markers/common/problemMatcher.i18n.json index 2bbfe1d0b1d59dd082dc332ffbb5f8f246535a28..7d46ebd0c9b1ad365ff82bd3da4afc93a3b4b847 100644 --- a/i18n/jpn/src/vs/platform/markers/common/problemMatcher.i18n.json +++ b/i18n/jpn/src/vs/platform/markers/common/problemMatcher.i18n.json @@ -34,6 +34,7 @@ "ProblemMatcherParser.noValidIdentifier": "エラー: パターン プロパティ {0} は有効なパターン変数名ではありません。", "ProblemMatcherParser.problemPattern.watchingMatcher": "問題マッチャーは、ウォッチ対象の開始パターンと終了パターンの両方を定義する必要があります。", "ProblemMatcherParser.invalidRegexp": "エラー: 文字列 {0} は、有効な正規表現ではありません。\n", + "WatchingPatternSchema.regexp": "バックグラウンド タスクの開始または終了を検出する正規表現。", "WatchingPatternSchema.file": "ファイル名の一致グループ インデックス。省略できます。", "PatternTypeSchema.name": "提供されたか事前定義された問題パターンの名前", "PatternTypeSchema.description": "A problem pattern or the name of a contributed or predefined problem pattern. Can be omitted if base is specified.", @@ -42,12 +43,18 @@ "ProblemMatcherSchema.severity": "キャプチャされた問題の既定の重大度。パターンが重要度の一致グループを定義していない場合に使用されます。", "ProblemMatcherSchema.applyTo": "テキスト ドキュメントで報告された問題が、開いているドキュメントのみ、閉じられたドキュメントのみ、すべてのドキュメントのいずれに適用されるかを制御します。", "ProblemMatcherSchema.fileLocation": "問題パターンで報告されたファイル名を解釈する方法を定義します。", + "ProblemMatcherSchema.background": "バックグラウンド タスクでアクティブなマッチャーの開始と終了を追跡するパターン。", + "ProblemMatcherSchema.background.activeOnStart": "true に設定すると、タスクの開始時にバックグラウンド モニターがアクティブ モードになります。これは beginPattern と一致する行の発行と同等です。", + "ProblemMatcherSchema.background.beginsPattern": "出力内で一致すると、バックグラウンド タスクの開始が通知されます。", + "ProblemMatcherSchema.background.endsPattern": "出力内で一致すると、バックグラウンド タスクの終了が通知されます。", + "ProblemMatcherSchema.watching.deprecated": "watching プロパティは使用されなくなりました。代わりに background をご使用ください。", + "ProblemMatcherSchema.watching": "監視パターンの開始と終了を追跡するマッチャー。", "ProblemMatcherSchema.watching.activeOnStart": "true に設定すると、タスクの開始時にウォッチャーがアクティブ モードになります。これは beginPattern と一致する行の発行と同等です。", "ProblemMatcherSchema.watching.beginsPattern": "出力内で一致すると、ウォッチ中のタスクの開始が通知されます。", "ProblemMatcherSchema.watching.endsPattern": "出力内で一致すると、ウォッチ中のタスクの終了が通知されます。", - "LegacyProblemMatcherSchema.watchedBegin.deprecated": "This property is deprecated. Use the watching property instead.", + "LegacyProblemMatcherSchema.watchedBegin.deprecated": "このプロパティは非推奨です。代わりに watching プロパティをご使用ください。", "LegacyProblemMatcherSchema.watchedBegin": "ファイル ウォッチでトリガーされた ウォッチ対象タスクの実行が開始されたことを伝達する正規表現。", - "LegacyProblemMatcherSchema.watchedEnd.deprecated": "This property is deprecated. Use the watching property instead.", + "LegacyProblemMatcherSchema.watchedEnd.deprecated": "このプロパティは非推奨です。代わりに watching プロパティをご使用ください。", "LegacyProblemMatcherSchema.watchedEnd": "ウォッチ対象タスクの実行が終了したことを伝達する正規表現。", "NamedProblemMatcherSchema.name": "問題マッチャーの名前。", "ProblemMatcherExtPoint": "問題マッチャーを提供" diff --git a/i18n/jpn/src/vs/platform/theme/common/colorRegistry.i18n.json b/i18n/jpn/src/vs/platform/theme/common/colorRegistry.i18n.json index 8da89f6115cfed5c13939876425a907c10c0b76e..a8865bcfa0d43d4e6c41bde4cfc65d2e370eb801 100644 --- a/i18n/jpn/src/vs/platform/theme/common/colorRegistry.i18n.json +++ b/i18n/jpn/src/vs/platform/theme/common/colorRegistry.i18n.json @@ -12,7 +12,7 @@ "focusBorder": "フォーカスされた要素の境界線全体の色。この色はコンポーネントによって上書きされていない場合にのみ使用されます。", "contrastBorder": "コントラストを強めるために、他の要素と隔てる追加の境界線。", "activeContrastBorder": "コントラストを強めるために、アクティブな他要素と隔てる追加の境界線。", - "selectionBackground": "ワークベンチ内のテキスト選択の背景色 (例: 入力フィールドやテキストエリア)。エディター内やターミナル内の選択には適用されないことに注意してください。", + "selectionBackground": "ワークベンチ内のテキスト選択の背景色 (例: 入力フィールドやテキストエリア)。エディター内の選択には適用されないことに注意してください。", "textSeparatorForeground": "テキストの区切り文字の色。", "textLinkForeground": "テキスト内のリンクの前景色。", "textLinkActiveForeground": "テキスト内のアクティブなリンクの前景色。", @@ -60,6 +60,7 @@ "editorBackground": "エディターの背景色。", "editorForeground": "エディターの既定の前景色。", "editorWidgetBackground": "検索/置換窓など、エディター ウィジェットの背景色。", + "editorWidgetBorder": "エディター ウィジェットの境界線色。ウィジェットに境界線があり、ウィジェットによって配色を上書きされていない場合でのみこの配色は使用されます。", "editorSelection": "エディターの選択範囲の色。", "editorInactiveSelection": "非アクティブなエディターの選択範囲の色。", "editorSelectionHighlight": "選択範囲と同じコンテンツの領域の色。", @@ -73,5 +74,12 @@ "diffEditorInserted": "挿入されたテキストの背景色。", "diffEditorRemoved": "削除されたテキストの背景色。", "diffEditorInsertedOutline": "挿入されたテキストの輪郭の色。", - "diffEditorRemovedOutline": "削除されたテキストの輪郭の色。" + "diffEditorRemovedOutline": "削除されたテキストの輪郭の色。", + "mergeCurrentHeaderBackground": "行内マージ競合の現在のヘッダー背景色。", + "mergeCurrentContentBackground": "行内マージ競合の現在のコンテンツ背景色。", + "mergeIncomingHeaderBackground": "行内マージ競合の入力側ヘッダー背景色。", + "mergeIncomingContentBackground": "行内マージ競合の入力側コンテンツ背景色。", + "mergeBorder": "行内マージ競合のヘッダーとスプリッターの境界線の色。", + "overviewRulerCurrentContentForeground": "行内マージ競合の現在の概要ルーラー前景色。", + "overviewRulerIncomingContentForeground": "行内マージ競合の入力側の概要ルーラー前景色。" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/api/node/extHostTask.i18n.json b/i18n/jpn/src/vs/workbench/api/node/extHostTask.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..4b90a12aaf247b4a1af0e887542958471d8df5e5 --- /dev/null +++ b/i18n/jpn/src/vs/workbench/api/node/extHostTask.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "task.label": "{0}: {1}" +} \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/api/node/extHostTreeViews.i18n.json b/i18n/jpn/src/vs/workbench/api/node/extHostTreeViews.i18n.json index 8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a..74c5f0eabd7020572aa3c8f8959faa3362591a60 100644 --- a/i18n/jpn/src/vs/workbench/api/node/extHostTreeViews.i18n.json +++ b/i18n/jpn/src/vs/workbench/api/node/extHostTreeViews.i18n.json @@ -3,4 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. -{} \ No newline at end of file +{ + "treeView.notRegistered": "ID '{0}' のツリー ビューは登録されていません。", + "treeItem.notFound": "ID '{0}' のツリー項目は見つかりませんでした。", + "treeView.duplicateElement": " {0} 要素は既に登録されています。" +} \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/browser/parts/activitybar/activitybarPart.i18n.json b/i18n/jpn/src/vs/workbench/browser/parts/activitybar/activitybarPart.i18n.json index ad17b1a0a2c45d11155ca12b6df13ca1ff632477..b9c158c07866f7766ba4d890c164148cff0d4f49 100644 --- a/i18n/jpn/src/vs/workbench/browser/parts/activitybar/activitybarPart.i18n.json +++ b/i18n/jpn/src/vs/workbench/browser/parts/activitybar/activitybarPart.i18n.json @@ -5,5 +5,6 @@ // Do not edit this file. It is machine generated. { "hideActivitBar": "アクティビティ バーを非表示にする", - "activityBarAriaLabel": "アクティブなビュー スイッチャー" + "activityBarAriaLabel": "アクティブなビュー スイッチャー", + "globalActions": "グローバル操作" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/browser/parts/editor/editorStatus.i18n.json b/i18n/jpn/src/vs/workbench/browser/parts/editor/editorStatus.i18n.json index ff6068c783714dbbd767a414e5281072cc1ca1aa..b0d78c01023b3037a7094f9b107ba57f8056a96b 100644 --- a/i18n/jpn/src/vs/workbench/browser/parts/editor/editorStatus.i18n.json +++ b/i18n/jpn/src/vs/workbench/browser/parts/editor/editorStatus.i18n.json @@ -10,7 +10,7 @@ "multiSelection": "{0} 個の選択項目", "endOfLineLineFeed": "LF", "endOfLineCarriageReturnLineFeed": "CRLF", - "tabFocusModeEnabled": "タブによるフォーカスの移動", + "screenReaderDetectedExtra": "スクリーン リーダーを使用しない場合、`editor.accessibilitySupport` を \"off\" にしてください。", "disableTabMode": "アクセシビリティ モードを無効にする", "gotoLine": "行へ移動", "indentation": "インデント", diff --git a/i18n/jpn/src/vs/workbench/browser/parts/quickopen/quickopen.i18n.json b/i18n/jpn/src/vs/workbench/browser/parts/quickopen/quickopen.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..b1dcfefa58e6c855c50a0b288b852948e7afb3b7 --- /dev/null +++ b/i18n/jpn/src/vs/workbench/browser/parts/quickopen/quickopen.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "quickOpen": "ファイルに移動...", + "quickNavigateNext": "Quick Open で次に移動", + "quickNavigatePrevious": "Quick Open で前に移動", + "quickSelectNext": "Quick Open で [次へ] を選択", + "quickSelectPrevious": "Quick Open で [前へ] を選択" +} \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/browser/quickopen.i18n.json b/i18n/jpn/src/vs/workbench/browser/quickopen.i18n.json index 715d0b6fb80338c43534717d54e242f38b18c36e..b598142bc87f2c938e9f7aeede1f8c797a8e192c 100644 --- a/i18n/jpn/src/vs/workbench/browser/quickopen.i18n.json +++ b/i18n/jpn/src/vs/workbench/browser/quickopen.i18n.json @@ -6,6 +6,5 @@ { "noResultsMatching": "一致する結果はありません", "noResultsFound2": "一致する項目はありません", - "entryAriaLabel": "{0}、コマンド", - "noCommands": "一致するコマンドはありません" + "entryAriaLabel": "{0}、コマンド" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/browser/viewlet.i18n.json b/i18n/jpn/src/vs/workbench/browser/viewlet.i18n.json index e44e917c23baa78fb80a54cc171b0479579721fb..cd69288971a77f859e03d664bea0cfb307814221 100644 --- a/i18n/jpn/src/vs/workbench/browser/viewlet.i18n.json +++ b/i18n/jpn/src/vs/workbench/browser/viewlet.i18n.json @@ -4,6 +4,5 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "collapse": "すべて折りたたむ", - "viewToolbarAriaLabel": "{0} 個のアクション" + "collapse": "すべて折りたたむ" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/common/theme.i18n.json b/i18n/jpn/src/vs/workbench/common/theme.i18n.json index b361c556bdcec2eb22278f4a15307200e6286d02..89788c6658b835e60ef072b59dc34ebfc00e37cb 100644 --- a/i18n/jpn/src/vs/workbench/common/theme.i18n.json +++ b/i18n/jpn/src/vs/workbench/common/theme.i18n.json @@ -7,10 +7,13 @@ "tabActiveBackground": "アクティブ タブの背景色。タブはエディター領域におけるエディターのコンテナーです。1 つのエディター グループで複数のタブを開くことができます。エディター グループを複数にすることもできます。", "tabInactiveBackground": "非アクティブ タブの背景色。タブはエディター領域におけるエディターのコンテナーです。1 つのエディター グループで複数のタブを開くことができます。エディター グループを複数にすることもできます。", "tabBorder": "タブ同士を分けるための境界線。タブはエディター領域内にあるエディターのコンテナーです。複数のタブを 1 つのエディター グループで開くことができます。複数のエディター グループがある可能性があります。", - "tabActiveEditorGroupActiveForeground": "アクティブ グループ内のアクティブ タブの前景色。タブはエディター領域におけるエディターのコンテナーです。1 つのエディター グループで複数のタブを開くことができます。エディター グループを複数にすることもできます。", - "tabInactiveEditorGroupActiveForeground": "アクティブ グループ内の非アクティブ タブの前景色。タブはエディター領域におけるエディターのコンテナーです。1 つのエディター グループで複数のタブを開くことができます。エディター グループを複数にすることもできます。", + "tabActiveForeground": "アクティブ グループ内のアクティブ タブの前景色。タブはエディター領域におけるエディターのコンテナーです。1 つのエディター グループで複数のタブを開くことができます。エディター グループを複数にすることもできます。", + "tabInactiveForeground": "アクティブ グループ内の非アクティブ タブの前景色。タブはエディター領域におけるエディターのコンテナーです。1 つのエディター グループで複数のタブを開くことができます。エディター グループを複数にすることもできます。", + "tabUnfocusedActiveForeground": "非アクティブ グループ内のアクティブ タブの前景色。タブはエディター領域におけるエディターのコンテナーです。1 つのエディター グループで複数のタブを開くことができます。エディター グループを複数にすることもできます。", + "tabUnfocusedInactiveForeground": "非アクティブ タブの前景色。タブはエディター領域におけるエディターのコンテナーです。1 つのエディター グループで複数のタブを開くことができます。エディター グループを複数にすることもできます。", "editorGroupBackground": "エディター グループの背景色。エディター グループはエディターのコンテナーです。背景色はエディター グループをドラッグすると表示されます。", "tabsContainerBackground": "タブが有効な場合の エディター グループ タイトル ヘッダーの背景色。エディター グループはエディターのコンテナーです。", + "tabsContainerBorder": "タブが有効な場合の エディター グループ タイトル ヘッダーの境界線色。エディター グループはエディターのコンテナーです。", "editorGroupHeaderBackground": "タブが無効な場合の エディター グループ タイトル ヘッダーの背景色。エディター グループはエディターのコンテナーです。", "editorGroupBorder": "複数のエディター グループを互いに分離するための色。エディター グループはエディターのコンテナーです。", "editorDragAndDropBackground": "エディターの周囲をドラッグしているときの背景色。エディターのコンテンツが最後まで輝くために、色は透過である必要があります。", @@ -21,19 +24,25 @@ "panelActiveTitleBorder": "アクティブ パネル タイトルの境界線の色。パネルはエディター領域の下に表示され、出力や統合ターミナルなどのビューを含みます。", "statusBarForeground": "ステータス バーの前景色。ステータス バーはウィンドウの下部に表示されます。", "statusBarBackground": "標準ステータス バーの背景色。ステータス バーはウィンドウの下部に表示されます。", + "statusBarBorder": "サイドバーとエディターを隔てるステータス バーの境界線色。ステータス バーはウィンドウの下部に表示されます。", "statusBarNoFolderBackground": "フォルダーが開いていないときのステータス バーの背景色。ステータス バーはウィンドウの下部に表示されます。", + "statusBarNoFolderForeground": "フォルダーが開いていないときのステータス バーの前景色。ステータス バーはウィンドウの下部に表示されます。", "statusBarItemActiveBackground": "クリック時のステータス バーの項目の背景色。ステータス バーはウィンドウの下部に表示されます。", "statusBarItemHoverBackground": "ホバーしたときのステータス バーの項目の背景色。ステータス バーはウィンドウの下部に表示されます。", "statusBarProminentItemBackground": "ステータス バーの重要な項目の背景色。重要な項目は、重要性を示すために他のステータスバーの項目から際立っています。 ステータス バーはウィンドウの下部に表示されます。", "statusBarProminentItemHoverBackground": "ホバーしたときのステータス バーの重要な項目の背景色。重要な項目は、重要性を示すために他のステータスバーの項目から際立っています。 ステータス バーはウィンドウの下部に表示されます。", "activityBarBackground": "アクティビティ バーの背景色。アクティビティ バーは左端または右端に表示され、サイド バーのビューを切り替えることができます。", "activityBarForeground": "アクティビティ バーの前景色 (例: アイコンの色)。アクティビティ バーは左端または右端に表示され、サイド バーのビューを切り替えることができます。", + "activityBarBorder": "サイド バーと隔てるアクティビティ バーの境界線色。アクティビティ バーは左端または右端に表示され、サイド バーのビューを切り替えることができます。", "activityBarDragAndDropBackground": "アクティビティ バーの項目のドラッグ アンド ドロップ フィードバックの色。アクティビティ バーが最後まで輝くために、色は透過である必要があります。アクティビティ バーは左端または右端に表示され、サイド バーの表示を切り替えることができます。", "activityBarBadgeBackground": "アクティビティ通知バッジの背景色。アクティビティ バーは左端または右端に表示され、サイド バーの表示を切り替えることができます。", "activityBarBadgeForeground": "アクティビティ通知バッジの前景色。アクティビティ バーは左端または右端に表示され、サイド バーの表示を切り替えることができます。", "sideBarBackground": "サイド バーの背景色。サイド バーは、エクスプローラーや検索などのビューが入るコンテナーです。", + "sideBarForeground": "サイド バーの前景色。サイド バーは、エクスプローラーや検索などのビューが入るコンテナーです。", + "sideBarBorder": "エディターとの区切りを示すサイド バーの境界線の色。サイド バーは、エクスプローラーや検索などのビューが入るコンテナーです。", "sideBarTitleForeground": "サイド バーのタイトルの前景色。サイド バーは、エクスプローラーや検索などのビューが入るコンテナーです。", "sideBarSectionHeaderBackground": "サイド バーのセクション ヘッダーの背景色。サイド バーは、エクスプローラーや検索などのビューが入るコンテナーです。", + "sideBarSectionHeaderForeground": "サイド バーのセクション ヘッダーの前景色。サイド バーは、エクスプローラーや検索などのビューが入るコンテナーです。", "titleBarActiveForeground": "ウィンドウがアクティブな場合のタイトル バーの前景。現在、この色は macOS でのみサポートされているのでご注意ください。", "titleBarInactiveForeground": "ウィンドウが非アクティブな場合のタイトル バーの前景。現在、この色は macOS でのみサポートされているのでご注意ください。", "titleBarActiveBackground": "ウィンドウがアクティブな場合のタイトル バーの背景。現在、この色は macOS でのみサポートされているのでご注意ください。", diff --git a/i18n/jpn/src/vs/workbench/electron-browser/actions.i18n.json b/i18n/jpn/src/vs/workbench/electron-browser/actions.i18n.json index 854573811104d0088174ac4e1b48bda0b8990de0..ab86da5259e0df94006bf86c952cca0faf62494b 100644 --- a/i18n/jpn/src/vs/workbench/electron-browser/actions.i18n.json +++ b/i18n/jpn/src/vs/workbench/electron-browser/actions.i18n.json @@ -6,9 +6,6 @@ { "closeActiveEditor": "エディターを閉じる", "closeWindow": "ウィンドウを閉じる", - "switchWindow": "切り替えウィンドウ", - "switchWindowPlaceHolder": "ウィンドウの選択", - "current": "現在のウィンドウ", "closeFolder": "フォルダーを閉じる", "noFolderOpened": "このインスタンスで現在開いているフォルダーがないので、閉じられません。", "newWindow": "新しいウィンドウ", @@ -20,7 +17,7 @@ "zoomReset": "ズームのリセット", "appPerf": "スタートアップ パフォーマンス", "reloadWindow": "ウィンドウの再読み込み", - "openRecent": "最近開いた項目", + "current": "現在のウィンドウ", "folders": "フォルダー", "files": "ファイル", "openRecentPlaceHolderMac": "パスを選択 (Cmd キーを押しながら新しいウィンドウで開く)", @@ -32,10 +29,6 @@ "openDocumentationUrl": "ドキュメント", "openIntroductoryVideosUrl": "紹介ビデオ", "toggleSharedProcess": "共有プロセスを切り替える", - "navigateLeft": "左のビュー部分に移動", - "navigateRight": "右のビュー部分に移動", - "navigateUp": "上のビュー部分に移動", - "navigateDown": "下のビュー部分に移動", "increaseViewSize": "現在のビューのサイズの拡大", "decreaseViewSize": "現在のビューのサイズの縮小" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/electron-browser/main.contribution.i18n.json b/i18n/jpn/src/vs/workbench/electron-browser/main.contribution.i18n.json index e69cb0fb627aab64651417656c0b64929977b74c..38a801fbf9bfb2de35ac0508a7987d60f8298a98 100644 --- a/i18n/jpn/src/vs/workbench/electron-browser/main.contribution.i18n.json +++ b/i18n/jpn/src/vs/workbench/electron-browser/main.contribution.i18n.json @@ -7,6 +7,7 @@ "view": "表示", "help": "ヘルプ", "file": "ファイル", + "developer": "開発者", "showEditorTabs": "開いているエディターをタブに表示するかどうかを制御します。", "editorTabCloseButton": "エディター タブの閉じるボタンの位置を制御するか、[off] に設定した場合に無効にします。", "showIcons": "開いているエディターをアイコンで表示するかどうかを制御します。これには、アイコンのテーマを有効にする必要もあります。", @@ -30,10 +31,6 @@ "window.openFoldersInNewWindow.off": "フォルダーは、最後のアクティブ ウィンドウで開きます", "window.openFoldersInNewWindow.default": "フォルダーがアプリケーション内から (たとえば、[ファイル] メニューから) 選択された場合を除いて、新しいウィンドウでフォルダーを開きます", "openFoldersInNewWindow": "フォルダーを新しいウィンドウで開くか、最後のアクティブ ウィンドウで開くかを制御します。\n- default: アプリケーション内で ([ファイル] メニューなどから) 選択したものでなければ、新しいウィンドウでフォルダーを開く\n- on: 新しいウィンドウでフォルダーを開く\n- off: 最後のアクティブ ウィンドウでフォルダーを開く\nこの設定は無視される場合もあります (-new-window または -reuse-window コマンド ライン オプションを使用する場合など)。", - "window.reopenFolders.none": "フォルダーを再度開きません。", - "window.reopenFolders.one": "最後にアクティブだったフォルダーを再び開きます。", - "window.reopenFolders.all": "最後のセッションの全フォルダーを再び開きます。", - "reopenFolders": "再起動後にフォルダーを再度開く方法を制御します。'none' を選択するとフォルダーを再度開くことはありません。'one' を選択すると最後に作業したフォルダーを再度開きます。'all' を選択すると前回のセッションのフォルダーすべてを再度開きます。", "restoreFullscreen": "全画面表示モードで終了した場合に、ウィンドウを全画面表示モードに復元するかどうかを制御します。", "zoomLevel": "ウィンドウのズーム レベルを調整します。元のサイズは 0 で、1 つ上げるごとに (1 など) 20% ずつ拡大することを表し、1 つ下げるごとに (-1 など) 20% ずつ縮小することを表します。小数点以下の桁数を入力して、さらに細かくズーム レベルを調整することもできます。", "title": "アクティブなエディターに基づいてウィンドウのタイトルを制御します。変数は、コンテキストに基づいて置換されます:\n${activeEditorShort}: 例: myFile.txt\n${activeEditorMedium}: 例: myFolder/myFile.txt\n${activeEditorLong}: 例: /Users/Development/myProject/myFolder/myFile.txt\n${rootName}: 例: myProject\n${rootPath}: 例: /Users/Development/myProject\n${appName}: 例: VS Code\n${dirty}: アクティブなエディターがダーティである場合のダーティ インジケーター\n${separator}: 値のある変数で囲まれた場合にのみ表示される条件付き区切り記号 (\" - \")", @@ -57,5 +54,7 @@ "zenMode.hideTabs": "Zen Mode をオンにしたときにワークベンチ タブも非表示にするかどうかを制御します。", "zenMode.hideStatusBar": "Zen Mode をオンにするとワークベンチの下部にあるステータス バーを非表示にするかどうかを制御します。", "zenMode.hideActivityBar": "Zen Mode をオンにするとワークベンチの左側にあるアクティビティ バーを非表示にするかを制御します。", - "zenMode.restore": "Zen Mode で終了したウィンドウを Zen Mode に復元するかどうかを制御します。" + "zenMode.restore": "Zen Mode で終了したウィンドウを Zen Mode に復元するかどうかを制御します。", + "workspaceConfigurationTitle": "ワークスペース", + "files.exclude.boolean": "ファイル パスの照合基準となる glob パターン。これを true または false に設定すると、パターンがそれぞれ有効/無効になります。" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/electron-browser/workbench.i18n.json b/i18n/jpn/src/vs/workbench/electron-browser/workbench.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..bbe34173584eed57f9414c387949169bd5ec0b71 --- /dev/null +++ b/i18n/jpn/src/vs/workbench/electron-browser/workbench.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "developer": "開発者", + "file": "ファイル" +} \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/codeEditor/electron-browser/accessibility.i18n.json b/i18n/jpn/src/vs/workbench/parts/codeEditor/electron-browser/accessibility.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..1c53dd86bdd7755e8704fc04d9b680e1041a03a8 --- /dev/null +++ b/i18n/jpn/src/vs/workbench/parts/codeEditor/electron-browser/accessibility.i18n.json @@ -0,0 +1,26 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "emergencyConfOn": "現在 `editor.accessibilitySupport` 設定を 'on' に変更しています。", + "openingDocs": "現在 VS Code のアクセシビリティ ドキュメントページを開いています。", + "introMsg": "VS Code のアクセシビリティ オプションをご利用いただき、ありがとうございます。", + "status": "ステータス:", + "changeConfigToOnMac": "スクリーン リーダーで使用するためにエディターを永続的に最適化するように設定するには、Command + E を押してください。", + "changeConfigToOnWinLinux": "スクリーン リーダーで使用するためにエディターを永続的に最適化するように設定するには、Control + E を押してください。", + "auto_unknown": "エディターは、プラットフォーム API を使用してスクリーン リーダーがいつ接続されたかを検出するように設定されていますが、現在のランタイムはこれをサポートしていません。", + "auto_on": "エディターはスクリーン リーダーの接続を自動検出しました。", + "auto_off": "エディターは、スクリーン リーダーが接続されると自動的に検出するように構成されていますが、今回は検出できませんでした。", + "configuredOn": "エディターはスクリーン リーダーで使用するために永続的に最適化されるように設定されています。これは `editor.accessibilitySupport` の設定を編集することで変更できます。", + "configuredOff": "エディターはスクリーン リーダー向けに最適化しないように構成されています。", + "tabFocusModeOnMsg": "現在のエディターで Tab キーを押すと、次のフォーカス可能な要素にフォーカスを移動します。{0} を押すと、この動作が切り替わります。", + "tabFocusModeOnMsgNoKb": "現在のエディターで Tab キーを押すと、次のフォーカス可能な要素にフォーカスを移動します。コマンド {0} は、キー バインドでは現在トリガーできません。", + "tabFocusModeOffMsg": "現在のエディターで Tab キーを押すと、タブ文字が挿入されます。{0} を押すと、この動作が切り替わります。", + "tabFocusModeOffMsgNoKb": "現在のエディターで Tab キーを押すと、タブ文字が挿入されます。コマンド {0} は、キー バインドでは現在トリガーできません。", + "openDocMac": "command + H キーを押して、ブラウザー ウィンドウを今すぐ開き、アクセシビリティに関連する他の VS Code 情報を確認します。", + "openDocWinLinux": "Ctrl + H キーを押して、ブラウザー ウィンドウを今すぐ開き、アクセシビリティに関連する他の VS Code 情報を確認します。", + "outroMsg": "Esc キー か Shift+Esc を押すと、ヒントを消してエディターに戻ることができます。", + "ShowAccessibilityHelpAction": "アクセシビリティのヘルプを表示します" +} \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/codeEditor/electron-browser/inspectTMScopes.i18n.json b/i18n/jpn/src/vs/workbench/parts/codeEditor/electron-browser/inspectTMScopes.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a --- /dev/null +++ b/i18n/jpn/src/vs/workbench/parts/codeEditor/electron-browser/inspectTMScopes.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{} \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/codeEditor/electron-browser/toggleMultiCursorModifier.i18n.json b/i18n/jpn/src/vs/workbench/parts/codeEditor/electron-browser/toggleMultiCursorModifier.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..3b84ee3fdb42ee514a5ff3cc16ab720a6edc61d7 --- /dev/null +++ b/i18n/jpn/src/vs/workbench/parts/codeEditor/electron-browser/toggleMultiCursorModifier.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "toggleLocation": "マルチ カーソルの修飾キーを切り替える" +} \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/debug/electron-browser/debugService.i18n.json b/i18n/jpn/src/vs/workbench/parts/debug/electron-browser/debugService.i18n.json index dfffb6e0790da035b6a5815991236bcc5d19fe41..45728f86746ffdf30a8ca61324bc2c80640fbbde 100644 --- a/i18n/jpn/src/vs/workbench/parts/debug/electron-browser/debugService.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/debug/electron-browser/debugService.i18n.json @@ -5,8 +5,8 @@ // Do not edit this file. It is machine generated. { "snapshotObj": "このオブジェクトのプリミティブ値のみ表示されます。", - "debuggingStarted": "デバッグは開始されました。", "debuggingPaused": "デバッグは一時停止されました、理由 {0}、{1} {2}", + "debuggingStarted": "デバッグは開始されました。", "debuggingStopped": "デバッグは停止されました。", "breakpointAdded": "ブレークポイントを追加しました。行 {0}、ファイル {1}", "breakpointRemoved": "ブレークポイントを削除しました。行 {0}、ファイル {1}", diff --git a/i18n/jpn/src/vs/workbench/parts/debug/electron-browser/debugViews.i18n.json b/i18n/jpn/src/vs/workbench/parts/debug/electron-browser/debugViews.i18n.json index fc8e32566a5a5e03f3508e8b2cf48e412c6a6d1c..e6c7a195a3d9d41ca220263eaebacb5e05c4cf0e 100644 --- a/i18n/jpn/src/vs/workbench/parts/debug/electron-browser/debugViews.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/debug/electron-browser/debugViews.i18n.json @@ -5,16 +5,12 @@ // Do not edit this file. It is machine generated. { "variablesSection": "変数セクション", - "variables": "変数", "variablesAriaTreeLabel": "変数のデバッグ", "expressionsSection": "式セクション", - "watch": "ウォッチ式", "watchAriaTreeLabel": "ウォッチ式のデバッグ", "callstackSection": "コール スタック セクション", "debugStopped": "{0} で一時停止", - "callStack": "コール スタック", "callStackAriaLabel": "コール スタックのデバッグ", "breakpointsSection": "ブレークポイント セクション", - "breakpoints": "ブレークポイント", "breakpointsAriaTreeLabel": "デバッグ ブレークポイント" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/debug/electron-browser/electronDebugActions.i18n.json b/i18n/jpn/src/vs/workbench/parts/debug/electron-browser/electronDebugActions.i18n.json index e57fd60ee0de57c9a9f85d415f6b9c29ad271081..8943a8809bd0f31ebba06b0d4fc659ebbc570a38 100644 --- a/i18n/jpn/src/vs/workbench/parts/debug/electron-browser/electronDebugActions.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/debug/electron-browser/electronDebugActions.i18n.json @@ -6,5 +6,6 @@ { "copyValue": "値のコピー", "copy": "コピー", + "copyAll": "すべてコピー", "copyStackTrace": "呼び出し履歴のコピー" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/debug/electron-browser/statusbarColorProvider.i18n.json b/i18n/jpn/src/vs/workbench/parts/debug/electron-browser/statusbarColorProvider.i18n.json index aa4a05fcb72367bce5a880f6b1f970a65769775a..ccdb00421dca2c5b2deae311b08fd799789cc66c 100644 --- a/i18n/jpn/src/vs/workbench/parts/debug/electron-browser/statusbarColorProvider.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/debug/electron-browser/statusbarColorProvider.i18n.json @@ -4,5 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "statusBarDebuggingBackground": "プログラムをデバッグしているときのステータス バーの背景色。ステータス バーはウィンドウの下部に表示されます" + "statusBarDebuggingBackground": "プログラムをデバッグしているときのステータス バーの背景色。ステータス バーはウィンドウの下部に表示されます", + "statusBarDebuggingForeground": "プログラムをデバッグしているときのステータス バーの前景色。ステータス バーはウィンドウの下部に表示されます" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json b/i18n/jpn/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json index af68e40b4aef295682fcb5feceac070aeefa46aa..d63fe387f50b01d86c60c5fb38c9b8a2ed7dbf47 100644 --- a/i18n/jpn/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json @@ -7,6 +7,7 @@ "debugAdapterBinNotFound": "デバッグ アダプターの実行可能ファイル '{0}' がありません。", "debugAdapterCannotDetermineExecutable": "デバッグ アダプター '{0}' の実行可能ファイルを判別できません。", "debugType": "構成の種類。", + "debugTypeNotRecognised": "デバッグの種類は認識されませんでした。対応するデバッグの拡張機能がインストールされており、有効になっていることを確認してください。", "node2NotSupported": "\"node2\" はサポートされていません。代わりに \"node\" を使用し、\"protocol\" 属性を \"inspector\" に設定してください。", "debugName": "構成の名前。起動構成のドロップダウン メニューに表示されます。", "debugRequest": "構成の要求の種類。\"launch\" または \"attach\" です。", diff --git a/i18n/jpn/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json b/i18n/jpn/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json index cf9dccd3bbde3a3dbc68f324bd4cde5d4ed88d9c..188f2a35673731c664bd96ad7af5469445c4f73c 100644 --- a/i18n/jpn/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json @@ -4,6 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "previousEditPoint": "Emmet: 前の編集点", - "nextEditPoint": "Emmet: 次の編集点" + "previousEditPoint": "Emmet: 前の編集点に移動する", + "nextEditPoint": "Emmet: 次の編集点に移動する" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json b/i18n/jpn/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json index f8b16e8c78d6f4fe7df07c5cdca30c92c018f733..470a456bc9d8fcc4045d0e2c8676f09543d90ce3 100644 --- a/i18n/jpn/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json @@ -9,5 +9,6 @@ "emmetPreferences": "Emmet の一部のアクションやリゾルバーの動作の変更に使用される基本設定。", "emmetSyntaxProfiles": "指定した構文に対してプロファイルを定義するか、特定の規則がある独自のプロファイルをご使用ください。", "emmetExclude": "emmet 省略記法を展開すべきでない言語の配列。", - "emmetExtensionsPath": "Emmet のプロファイル、スニペット、基本設定を含むフォルダーへのパス" + "emmetExtensionsPath": "Emmet のプロファイル、スニペット、基本設定を含むフォルダーへのパス", + "useNewEmmet": "すべての emmet 機能に対して、新しい emmet モジュールをお試しください (最終的に、以前の単一 emmet ライブラリは置き換えられます)。" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/extensions/browser/extensionEditor.i18n.json b/i18n/jpn/src/vs/workbench/parts/extensions/browser/extensionEditor.i18n.json index 078b21ede6a222bffc03824a741fefa18d084a5b..631dbad18af1ebb72b95a76226cfe745af264252 100644 --- a/i18n/jpn/src/vs/workbench/parts/extensions/browser/extensionEditor.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/extensions/browser/extensionEditor.i18n.json @@ -24,6 +24,10 @@ "default": "既定", "debuggers": "デバッガー ({0})", "debugger name": "名前", + "views": "ビュー ({0})", + "view id": "ID", + "view name": "名前", + "view location": "場所", "themes": "テーマ ({0})", "JSON Validation": "JSON 検証 ({0})", "commands": "コマンド ({0})", diff --git a/i18n/jpn/src/vs/workbench/parts/extensions/browser/extensionsActions.i18n.json b/i18n/jpn/src/vs/workbench/parts/extensions/browser/extensionsActions.i18n.json index b12d5ba07d8455b5629dd43f1eed8810a0e40db1..d37634ee4857c751b409c0b048408af2952db757 100644 --- a/i18n/jpn/src/vs/workbench/parts/extensions/browser/extensionsActions.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/extensions/browser/extensionsActions.i18n.json @@ -22,15 +22,17 @@ "disableGloballyAction": "常に行う", "disableAction": "無効にする", "checkForUpdates": "更新の確認", + "enableAutoUpdate": "拡張機能の自動更新を有効にする", + "disableAutoUpdate": "拡張機能の自動更新を無効にする", "updateAll": "すべての拡張機能を更新します", "reloadAction": "再読み込み", - "postUpdateTooltip": "再度読み込んで更新する", - "postUpdateMessage": "このウィンドウを再度読み込んで、更新済みの拡張機能 '{0}' をアクティブ化しますか?", - "postEnableTooltip": "再度読み込んでアクティブにする", + "postUpdateTooltip": "再読み込みして更新する", + "postUpdateMessage": "このウィンドウを再読み込みして、更新済みの拡張機能 '{0}' をアクティブ化しますか?", + "postEnableTooltip": "再読み込みしてアクティブにする", "postEnableMessage": "このウィンドウを再度読み込んで、拡張機能 '{0}' をアクティブ化しますか?", - "postDisableTooltip": "読み込んで非アクティブ化する", - "postDisableMessage": "このウィンドウを再度読み込んで、拡張機能 '{0}' を非アクティブ化しますか?", - "postUninstallTooltip": "読み込んで非アクティブ化する", + "postDisableTooltip": "再読み込みして非アクティブ化する", + "postDisableMessage": "このウィンドウを再読み込みして、拡張機能 '{0}' を非アクティブ化しますか?", + "postUninstallTooltip": "再読み込みして非アクティブ化する", "postUninstallMessage": "このウィンドウを再度読み込んで、アンインストール済みの拡張機能 '{0}' を非アクティブ化しますか?", "reload": "ウィンドウの再読み込み(&&R)", "toggleExtensionsViewlet": "拡張機能を表示する", @@ -44,6 +46,8 @@ "showWorkspaceRecommendedExtensions": "ワークスペースのおすすめの拡張機能を表示", "showRecommendedKeymapExtensions": "推奨のキーマップを表示する", "showRecommendedKeymapExtensionsShort": "キーマップ", + "showLanguageExtensions": "言語の拡張機能を表示", + "showLanguageExtensionsShort": "言語の拡張機能", "configureWorkspaceRecommendedExtensions": "お勧めの拡張機能の構成 (ワークスペース)", "ConfigureWorkspaceRecommendations.noWorkspace": "推奨事項はワークスペース フォルダーでのみ利用可能です。", "OpenExtensionsFile.failed": "'.vscode' ファルダー ({0}) 内に 'extensions.json' ファイルを作成できません。", @@ -51,5 +55,8 @@ "disableAll": "インストール済みのすべての拡張機能を無効にする", "disableAllWorkspace": "このワークスペースのインストール済みの拡張機能をすべて無効にする", "enableAll": "インストール済みの拡張機能をすべて有効にする", - "enableAllWorkspace": "このワークスペースのインストール済みの拡張機能をすべて有効にする" + "enableAllWorkspace": "このワークスペースのインストール済みの拡張機能をすべて有効にする", + "extensionButtonProminentBackground": "際立っているアクション拡張機能のボタンの背景色(例: インストールボタン)。", + "extensionButtonProminentForeground": "際立っているアクション拡張機能のボタンの前景色(例: インストールボタン)。", + "extensionButtonProminentHoverBackground": "際立っているアクション拡張機能のボタンのホバー背景色(例: インストールボタン)。" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json b/i18n/jpn/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json index 8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a..4859dfe81bbb3e9b19723add11ccc1f06df2edd5 100644 --- a/i18n/jpn/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json @@ -3,4 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. -{} \ No newline at end of file +{ + "disableOtherKeymapsConfirmation": "キーバインド間の競合を回避するために、他のキーマップ ({0}) を無効にしますか?", + "yes": "はい", + "no": "いいえ", + "betterMergeDisabled": "拡張機能 Better Merge は現在ビルトインです。インストール済みの拡張機能は無効化され、アンインストールできます。", + "uninstall": "アンインストール", + "later": "後続" +} \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/files/browser/files.contribution.i18n.json b/i18n/jpn/src/vs/workbench/parts/files/browser/files.contribution.i18n.json index 15c3aee15db3c174027c6a03dcf5d8b9e96cf8ea..5d17c064fd1ddb50fd8e2d075b5dce713cc76ceb 100644 --- a/i18n/jpn/src/vs/workbench/parts/files/browser/files.contribution.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/files/browser/files.contribution.i18n.json @@ -16,7 +16,7 @@ "associations": "言語に対するファイルの関連付け (例 \"*.extension\": \"html\") を構成します。これらの関連付けは、インストールされている言語の既定の関連付けより優先されます。", "encoding": "ファイルの読み取り/書き込みで使用する既定の文字セット エンコーディング。", "autoGuessEncoding": "有効な場合、ファイルを開くときに文字セット エンコードを推測します", - "eol": "既定の改行文字。", + "eol": "既定の改行文字。LF の場合には \\n を CRLF の場合には \\r\\n を使用してください。", "trimTrailingWhitespace": "有効にすると、ファイルの保存時に末尾の空白をトリミングします。", "insertFinalNewline": "有効にすると、ファイルの保存時に最新の行を末尾に挿入します。", "files.autoSave.off": "ダーティ ファイルを自動的に保存することはしません。", @@ -27,6 +27,7 @@ "autoSaveDelay": "ダーティ ファイルの自動保存の遅延をミリ秒単位で制御します。'files.autoSave' が '{0}' に設定されている場合のみ適用されます", "watcherExclude": "ファイル モニタリングから除外するファイル パスの glob パターンを構成します。この設定を変更すると、再起動が必要になります。始動時に Code が消費する CPU 時間が多い場合は、大規模なフォルダーを除外して初期ロードを減らせます。", "hotExit.off": "Hot Exit を無効にします。", + "hotExit.onExit": "アプリケーションが閉じると (Windows/Linux で最後のウィンドウが閉じるとき、または workbench.action.quit コマンドがトリガーされるとき (コマンド パレット、キー バインド、メニュー))、Hot Exit がトリガーされます。バックアップされているすべてのウィンドウは、次の起動時に復元されます。", "hotExit": "エディターを終了するときに保存を確認するダイアログを省略し、保存されていないファイルをセッション後も保持するかどうかを制御します。", "defaultLanguage": "新しいファイルに割り当てられる既定の言語モード。", "editorConfigurationTitle": "エディター", diff --git a/i18n/jpn/src/vs/workbench/parts/files/browser/views/emptyView.i18n.json b/i18n/jpn/src/vs/workbench/parts/files/browser/views/emptyView.i18n.json index b6fe55337f3cd2cab73b46cf898b675212c81d28..6caca19da44272d0c6a163579d154da92698466e 100644 --- a/i18n/jpn/src/vs/workbench/parts/files/browser/views/emptyView.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/files/browser/views/emptyView.i18n.json @@ -5,7 +5,5 @@ // Do not edit this file. It is machine generated. { "explorerSection": "ファイル エクスプローラー セクション", - "noWorkspace": "開いているフォルダーがありません", - "noWorkspaceHelp": "まだフォルダーを開いていません。", "openFolder": "フォルダーを開く" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/files/browser/views/openEditorsView.i18n.json b/i18n/jpn/src/vs/workbench/parts/files/browser/views/openEditorsView.i18n.json index e97af3104a28107ab70cf98077de29afa5206959..489a4baaeebcdc0b11b21915aae2783d49a7c4cc 100644 --- a/i18n/jpn/src/vs/workbench/parts/files/browser/views/openEditorsView.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/files/browser/views/openEditorsView.i18n.json @@ -4,8 +4,8 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "openEditosrSection": "[開いているエディター] セクション", "openEditors": "開いているエディター", + "openEditosrSection": "[開いているエディター] セクション", "treeAriaLabel": "開いているエディター: アクティブなファイルのリスト", "dirtyCounter": "未保存 ({0})" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json b/i18n/jpn/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json index a71fcb6fc945c20ddededeed53f7d2d6f7f12eb6..e14e57a90eb7907fc1b6024468adef5b4c2a9da5 100644 --- a/i18n/jpn/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json @@ -5,5 +5,11 @@ // Do not edit this file. It is machine generated. { "slow": "スタートアップの遅延が検出されました", - "slow.detail": "スタートアップが遅かったとのこと、申し訳ございません。プロファイルを有効にして、'{0}' を再起動し、プロファイルを共有してください。スタートアップの改善のために参考にさせていただきます。" + "slow.detail": "スタートアップが遅かったとのこと、申し訳ございません。プロファイルを有効にして、'{0}' を再起動し、プロファイルを共有してください。スタートアップの改善のために参考にさせていただきます。", + "prof.message": "プロファイルが正常に作成されました。", + "prof.detail": "案件を作成し、手動で次のファイルを添付してください:\\n{0}", + "prof.restartAndFileIssue": "問題を作成して再起動", + "prof.restart": "再起動", + "prof.thanks": "ご協力いただき、ありがとうございます。", + "prof.detail.restart": "'{0}' を引き続き使用するには、最後の再起動が必要です。 改めてあなたの貢献に感謝します。" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/preferences/browser/keybindingsEditorContribution.i18n.json b/i18n/jpn/src/vs/workbench/parts/preferences/browser/keybindingsEditorContribution.i18n.json index 08cb632b3e77751e0db24575caeca53d5de485c3..a4fef8cf3c06df2975d6b3e5e7caf9cab79c6eea 100644 --- a/i18n/jpn/src/vs/workbench/parts/preferences/browser/keybindingsEditorContribution.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/preferences/browser/keybindingsEditorContribution.i18n.json @@ -5,6 +5,7 @@ // Do not edit this file. It is machine generated. { "defineKeybinding.start": "キー バインドの定義", - "defineKeybinding.kbLayoutInfoMessage": "現在のキーボード レイアウト用に", - "defineKeybinding.kbLayoutErrorMessage": "現在のキーボード レイアウトでは、このキーの組み合わせを生成することはできません。" + "defineKeybinding.kbLayoutErrorMessage": "現在のキーボード レイアウトでは、このキーの組み合わせを生成することはできません。", + "defineKeybinding.kbLayoutLocalAndUSMessage": "現在のキーボード レイアウトで示すと **{0}** です。(US 標準: **{1}**)", + "defineKeybinding.kbLayoutLocalMessage": "現在のキーボード レイアウトで示すと **{0}** です。" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/preferences/browser/preferencesRenderers.i18n.json b/i18n/jpn/src/vs/workbench/parts/preferences/browser/preferencesRenderers.i18n.json index 0a35cdb1be9b0dc5aaeab24e3bcfcd325ce037e3..dba4d278b1447356cea4aa4f3a910251fc91ff51 100644 --- a/i18n/jpn/src/vs/workbench/parts/preferences/browser/preferencesRenderers.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/preferences/browser/preferencesRenderers.i18n.json @@ -4,6 +4,7 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "errorInvalidConfiguration": "設定を書き込めません。ファイル内のエラー/警告を修正してからもう一度お試しください。", "editTtile": "編集", "replaceDefaultValue": "設定を置換", "copyDefaultValue": "設定にコピー", diff --git a/i18n/jpn/src/vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.i18n.json b/i18n/jpn/src/vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..6024752558c818089cf1d682393fa98da551a69e --- /dev/null +++ b/i18n/jpn/src/vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "relaunchMessage": "再起動が必要な設定を変更しました。", + "relaunchDetail": "{0} を再起動ボタンで再起動して、設定を有効にしてください。", + "restart": "再起動" +} \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.i18n.json b/i18n/jpn/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..3902ae7752750f24eb59156a29c50674d5f10662 --- /dev/null +++ b/i18n/jpn/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "editorGutterModifiedBackground": "編集された行を示すエディター余白の背景色。", + "editorGutterAddedBackground": "追加された行を示すエディター余白の背景色。", + "editorGutterDeletedBackground": "削除された行を示すエディター余白の背景色。" +} \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/scm/electron-browser/scm.contribution.i18n.json b/i18n/jpn/src/vs/workbench/parts/scm/electron-browser/scm.contribution.i18n.json index b650b0b0eb32f851abac1ec77b6afec79ef866ff..d45b84374594d68d5db62ce518ad4b699d9eb2aa 100644 --- a/i18n/jpn/src/vs/workbench/parts/scm/electron-browser/scm.contribution.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/scm/electron-browser/scm.contribution.i18n.json @@ -5,6 +5,7 @@ // Do not edit this file. It is machine generated. { "toggleGitViewlet": "Git を表示", + "installAdditionalSCMProviders": "その他の SCM プロバイダーをインストール...", "source control": "ソース管理", "toggleSCMViewlet": "SCM を表示", "view": "表示" diff --git a/i18n/jpn/src/vs/workbench/parts/scm/electron-browser/scmMenus.i18n.json b/i18n/jpn/src/vs/workbench/parts/scm/electron-browser/scmMenus.i18n.json index d53de2c62b0708a3593b95d0e369e4bc48faa54e..d93c7d2fb84f67ddf84c04f0793e067ae17866c4 100644 --- a/i18n/jpn/src/vs/workbench/parts/scm/electron-browser/scmMenus.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/scm/electron-browser/scmMenus.i18n.json @@ -4,5 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "installAdditionalSCMProviders": "その他の SCM プロバイダーをインストール...", "switch provider": "SCM プロバイダーの切り替え..." } \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/snippets/electron-browser/TMSnippets.i18n.json b/i18n/jpn/src/vs/workbench/parts/snippets/electron-browser/TMSnippets.i18n.json index 54fb4cd8f93664cd36b9541e5323653aa2141605..98112fb116446302855c4dc10ab2102118dd8c84 100644 --- a/i18n/jpn/src/vs/workbench/parts/snippets/electron-browser/TMSnippets.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/snippets/electron-browser/TMSnippets.i18n.json @@ -9,5 +9,6 @@ "vscode.extension.contributes.snippets-path": "スニペット ファイルのパス。拡張機能フォルダーの相対パスであり、通常 './snippets/' で始まります。", "invalid.language": "`contributes.{0}.language` で不明な言語です。提供された値: {1}", "invalid.path.0": "`contributes.{0}.path` に文字列が必要です。提供された値: {1}", - "invalid.path.1": "拡張機能のフォルダー ({2}) の中に `contributes.{0}.path` ({1}) が含まれている必要があります。これにより拡張を移植できなくなる可能性があります。" + "invalid.path.1": "拡張機能のフォルダー ({2}) の中に `contributes.{0}.path` ({1}) が含まれている必要があります。これにより拡張を移植できなくなる可能性があります。", + "badVariableUse": "スニペット \"{0}\" は、スニペット変数とスニペット プレースホルダーを混乱させる可能性が非常にあります。詳細については https://code.visualstudio.com/docs/editor/userdefinedsnippets#_snippet-syntax をご覧ください。" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/snippets/electron-browser/snippets.contribution.i18n.json b/i18n/jpn/src/vs/workbench/parts/snippets/electron-browser/snippets.contribution.i18n.json index dbc7f6d6a36f7530e701af609b7235d63d291bbc..8f9586b85f4e2368e44e92352440a385b2e4bb50 100644 --- a/i18n/jpn/src/vs/workbench/parts/snippets/electron-browser/snippets.contribution.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/snippets/electron-browser/snippets.contribution.i18n.json @@ -11,6 +11,6 @@ "snippetSchema.json.default": "空のスニペット", "snippetSchema.json": "ユーザー スニペット構成", "snippetSchema.json.prefix": "intellisense でスニペットを選択するときに使用するプレフィックス", - "snippetSchema.json.body": "スニペットの内容。変数には '${id}'、'${id:label}'、'${1:label}' を使用し、カーソル位置には '$0'、'$1' を使用します", + "snippetSchema.json.body": "スニペットのコンテンツです。カーソルの位置を定義するには '$1', '${1:defaultText}' を使用し、最後のカーソルの位置には '$0' を使用します。'${varName}' と '${varName:defaultText}' を使用すると変数値を挿入します。例: 'This is file: $TM_FILENAME'.", "snippetSchema.json.description": "スニペットについての記述。" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/surveys/electron-browser/languageSurveys.contribution.i18n.json b/i18n/jpn/src/vs/workbench/parts/surveys/electron-browser/languageSurveys.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..fef6bb6566bebd76929bd28285e44f6859a35ef6 --- /dev/null +++ b/i18n/jpn/src/vs/workbench/parts/surveys/electron-browser/languageSurveys.contribution.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "helpUs": "{0} のサポートの改善にご協力ください", + "takeShortSurvey": "簡単なアンケートの実施", + "remindLater": "後で通知する", + "neverAgain": "今後は表示しない" +} \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/surveys/electron-browser/nps.contribution.i18n.json b/i18n/jpn/src/vs/workbench/parts/surveys/electron-browser/nps.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..1b0a91d1c83f8a7953e8fc5406f9be8787ee99cd --- /dev/null +++ b/i18n/jpn/src/vs/workbench/parts/surveys/electron-browser/nps.contribution.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "surveyQuestion": "短いフィードバック アンケートにご協力をお願いできますか?", + "takeSurvey": "アンケートの実施", + "remindLater": "後で通知する", + "neverAgain": "今後は表示しない" +} \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/tasks/browser/buildQuickOpen.i18n.json b/i18n/jpn/src/vs/workbench/parts/tasks/browser/buildQuickOpen.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..ac80aac08cdfe612b4d13a50f72fd70e5f3da729 --- /dev/null +++ b/i18n/jpn/src/vs/workbench/parts/tasks/browser/buildQuickOpen.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "noTasksMatching": "一致するタスクがありません" +} \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/tasks/browser/quickOpen.i18n.json b/i18n/jpn/src/vs/workbench/parts/tasks/browser/quickOpen.i18n.json index c0432625724e130ef22a389a594c6fac63748493..06f2b5a47d509cc69a48f57d08d07ef442bd4aef 100644 --- a/i18n/jpn/src/vs/workbench/parts/tasks/browser/quickOpen.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/tasks/browser/quickOpen.i18n.json @@ -4,5 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "entryAriaLabel": "{0}, tasks" + "entryAriaLabel": "{0}, tasks", + "customizeTask": "タスクのカスタマイズ" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/tasks/browser/restartQuickOpen.i18n.json b/i18n/jpn/src/vs/workbench/parts/tasks/browser/restartQuickOpen.i18n.json index 37bbf2ce2e01afae81a5ef37aced0f4c73654f6e..1e77cbdffdfe9114be935a0099da8aafcfbe29d7 100644 --- a/i18n/jpn/src/vs/workbench/parts/tasks/browser/restartQuickOpen.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/tasks/browser/restartQuickOpen.i18n.json @@ -5,6 +5,6 @@ // Do not edit this file. It is machine generated. { "tasksAriaLabel": "再開するタスクの名前を入力します", - "noTasksMatching": "No tasks matching", + "noTasksMatching": "一致するタスクがありません", "noTasksFound": "再開するタスクはありません" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/tasks/browser/taskQuickOpen.i18n.json b/i18n/jpn/src/vs/workbench/parts/tasks/browser/taskQuickOpen.i18n.json index 99543dd018aa685fbdad06a85367df8ad5a50bb1..5a397f34e036dde7b62f79edc84feb6d2e82158e 100644 --- a/i18n/jpn/src/vs/workbench/parts/tasks/browser/taskQuickOpen.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/tasks/browser/taskQuickOpen.i18n.json @@ -5,6 +5,6 @@ // Do not edit this file. It is machine generated. { "tasksAriaLabel": "実行するタスクの名前を入力します", - "noTasksMatching": "No tasks matching", + "noTasksMatching": "一致するタスクがありません", "noTasksFound": "タスクが見つかりません" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/tasks/browser/testQuickOpen.i18n.json b/i18n/jpn/src/vs/workbench/parts/tasks/browser/testQuickOpen.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..ac80aac08cdfe612b4d13a50f72fd70e5f3da729 --- /dev/null +++ b/i18n/jpn/src/vs/workbench/parts/tasks/browser/testQuickOpen.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "noTasksMatching": "一致するタスクがありません" +} \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/tasks/common/taskConfiguration.i18n.json b/i18n/jpn/src/vs/workbench/parts/tasks/common/taskConfiguration.i18n.json index c7b8031b6e5c339156c1fbf30a2eeec434d72ca4..f4de865e7e83566e5967ce3ece4df18fe275d9e5 100644 --- a/i18n/jpn/src/vs/workbench/parts/tasks/common/taskConfiguration.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/tasks/common/taskConfiguration.i18n.json @@ -5,13 +5,13 @@ // Do not edit this file. It is machine generated. { "ConfigurationParser.invalidCWD": "警告: options.cwd は、string 型でなければなりません。値 {0} を無視します", - "ConfigurationParser.noShell": "警告: シェル構成がサポートされるのは、ターミナルでタスクを実行している場合のみです。", "ConfigurationParser.noargs": "エラー: コマンド引数は文字列の配列でなければなりません。指定された値:\n{0}", + "ConfigurationParser.noShell": "警告: シェル構成がサポートされるのは、ターミナルでタスクを実行している場合のみです。", "ConfigurationParser.noName": "エラー: 宣言スコープ内の問題マッチャーに次の名前がなければなりません:\n{0}\n", "ConfigurationParser.unknownMatcherKind": "警告: 定義されている問題マッチャーが不明です。サポートされている型は string | ProblemMatcher | (string | ProblemMatcher)[] です。\n{0}\n", "ConfigurationParser.invalidVaraibleReference": "エラー: 正しくない problemMatcher 参照 {0}\n", "ConfigurationParser.noTaskName": "エラー: タスクが taskName プロパティを提供しなければなりません。このタスクは無視されます。\n{0}\n", "taskConfiguration.shellArgs": "警告: タスク '{0}' はシェル コマンドです。コマンド名または引数の 1 つに、エスケープされていないスペースが含まれています。コマンド ラインの引用が正しく解釈されるように、引数をコマンドにマージしてください。", - "taskConfiguration.noCommandOrDependsOn": "エラー: タスク '{0}' は、コマンドも、dependsOn プロパティも指定していません。このタスクは無視されます。定義は次のとおりです:\n{1}", + "taskConfiguration.noCommandOrDependsOn": "エラー: タスク '{0}' は、コマンドも dependsOn プロパティも指定していません。このタスクは無視されます。定義は次のとおりです:\n{1}", "taskConfiguration.noCommand": "エラー: タスク '{0}' はコマンドを定義していません。このタスクは無視されます。定義は次のとおりです:\n{1}" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/tasks/electron-browser/jsonSchemaCommon.i18n.json b/i18n/jpn/src/vs/workbench/parts/tasks/electron-browser/jsonSchemaCommon.i18n.json index 522b6ddc0ea396075ca2108f56dc59d328d0ce7b..c0f160530b628f93b24995c115ca0ef38cf633ee 100644 --- a/i18n/jpn/src/vs/workbench/parts/tasks/electron-browser/jsonSchemaCommon.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/tasks/electron-browser/jsonSchemaCommon.i18n.json @@ -7,6 +7,7 @@ "JsonSchema.options": "追加のコマンド オプション", "JsonSchema.options.cwd": "実行されるプログラムまたはスクリプトの現在の作業ディレクトリ。省略すると、Code の現在のワークスペースのルートが使用されます。", "JsonSchema.options.env": "実行されるプログラムまたはシェルの環境。省略すると、親プロセスの環境が使用されます。", + "JsonSchema.shellConfiguration": "使用するシェルを構成します。", "JsonSchema.shell.executable": "使用するシェル。", "JsonSchema.shell.args": "シェル引数。", "JsonSchema.command": "実行されるコマンド。外部プログラムかシェル コマンドです。", diff --git a/i18n/jpn/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v1.i18n.json b/i18n/jpn/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v1.i18n.json index d4e5894c8b6dfe5aad58db83e023785af4caac87..fec9e1206745f6bfc61d8779082016eb46714cb0 100644 --- a/i18n/jpn/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v1.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v1.i18n.json @@ -5,6 +5,8 @@ // Do not edit this file. It is machine generated. { "JsonSchema.version": "構成のバージョン番号", + "JsonSchema._runner": "ランナーが新しくなります。正式なランナープロパティーを使用してください", + "JsonSchema.runner": "タスクをプロセスとして実行して、出力が出力ウィンドウまたは端末内に表示されるかどうかを定義します。", "JsonSchema.windows": "Windows 固有のコマンド構成", "JsonSchema.mac": "Mac 固有のコマンド構成", "JsonSchema.linux": "Linux 固有のコマンド構成", diff --git a/i18n/jpn/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.i18n.json b/i18n/jpn/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.i18n.json index fd5f48dd415170f340325ec65272ced106b6f4dc..2b0fd3079f186ef52bccd68fa81ba87920abf778 100644 --- a/i18n/jpn/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.i18n.json @@ -4,11 +4,14 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "JsonSchema.shell": "コマンドがシェル コマンドか外部プログラムかを指定します。省略すると、既定は false になります。", + "JsonSchema.tasks.dependsOn.string": "このタスクが依存している別のタスク。", + "JsonSchema.tasks.dependsOn.array": "このタスクが依存している他の複数のタスク。", + "JsonSchema.tasks.group": "このタスクが属する実行グループを定義します。省略した場合、タスクはグループに属しません。", + "JsonSchema.tasks.type": "タスクをプロセスとして実行するか、またはシェル内部でコマンドとして実行するかどうかを定義します。既定は process です。", "JsonSchema.version": "構成のバージョン番号", + "JsonSchema.tasks.customize": "カスタマイズ対象の提供されたタスク。", "JsonSchema.windows": "Windows 固有のコマンド構成", "JsonSchema.mac": "Mac 固有のコマンド構成", - "JsonSchema.linux": "Linux 固有のコマンド構成", - "JsonSchema.shell": "コマンドがシェル コマンドか外部プログラムかを指定します。省略すると、既定は false になります。", - "JsonSchema.tasks.dependsOn.string": "このタスクが依存している別のタスク。", - "JsonSchema.tasks.dependsOn.array": "このタスクが依存している他の複数のタスク。" + "JsonSchema.linux": "Linux 固有のコマンド構成" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json b/i18n/jpn/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json index 81375f18706a6f9c0274f3c294e92824d3e16611..4d056135a7a3616402a5d42b66d291ad1f19ee08 100644 --- a/i18n/jpn/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json @@ -22,7 +22,8 @@ "TaskService.noBuildTask": "ビルド タスクが定義されていません。tasks.json ファイルでタスクに 'isBuildCommand' というマークを付けてください。", "TaskService.noTestTask": "テスト タスクが定義されていません。tasks.json ファイルでタスクに 'isTestCommand' というマークを付けてください。", "TaskServer.noTask": "実行が要求されたタスク {0} が見つかりません。", - "TaskSystem.activeSame": "タスクは既にアクティブおよびウォッチ モードになっています。タスクを終了するには、`F1 > タスクの終了` を使用します", + "customizeParseErrors": "現在のタスクの構成にはエラーがあります。タスクをカスタマイズする前にエラーを修正してください。", + "moreThanOneBuildTask": "tasks.json で複数のビルド タスクが定義されています。最初のタスクのみを実行します。\\n", "TaskSystem.active": "既に実行中のタスクがあります。まずこのタスクを終了してから、別のタスクを実行してください。", "TaskSystem.restartFailed": "タスク {0} を終了して再開できませんでした", "TaskSystem.configurationErrors": "エラー: 指定したタスク構成に検証エラーがあり、使用できません。最初にエラーを修正してください。", diff --git a/i18n/jpn/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.i18n.json b/i18n/jpn/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.i18n.json index 12b9c699bf24f546a0861686640ea77630934e84..40f8e647676e6f355d6372f2961c3aba909fb7ad 100644 --- a/i18n/jpn/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.i18n.json @@ -6,5 +6,7 @@ { "TerminalTaskSystem.unknownError": "タスクの実行中に不明なエラーが発生しました。詳細については、タスク出力ログを参照してください。", "TerminalTaskSystem.terminalName": "タスク - {0}", - "TerminalTaskSystem": "UNC ドライブでシェル コマンドを実行できません。" + "reuseTerminal": "端末はタスクで再利用されます、閉じるには任意のキーを押してください。", + "TerminalTaskSystem": "UNC ドライブでシェル コマンドを実行できません。", + "unkownProblemMatcher": "問題マッチャー {0} は解決できませんでした。マッチャーは無視されます" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/tasks/node/processTaskSystem.i18n.json b/i18n/jpn/src/vs/workbench/parts/tasks/node/processTaskSystem.i18n.json index 6f9be6076a6bf88817a675e3a99dfcfeb5c254fb..0cc1f921982e6c2499d3edc95ef21e67b1b4ed21 100644 --- a/i18n/jpn/src/vs/workbench/parts/tasks/node/processTaskSystem.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/tasks/node/processTaskSystem.i18n.json @@ -7,5 +7,6 @@ "TaskRunnerSystem.unknownError": "タスクの実行中に不明なエラーが発生しました。詳細については、タスク出力ログを参照してください。", "TaskRunnerSystem.watchingBuildTaskFinished": "\nビルド タスクのウォッチが終了しました。", "TaskRunnerSystem.childProcessError": "Failed to launch external program {0} {1}.", - "TaskRunnerSystem.cancelRequested": "\nユーザー要求ごとにタスク '{0}' が終了しました。" + "TaskRunnerSystem.cancelRequested": "\nユーザー要求ごとにタスク '{0}' が終了しました。", + "unkownProblemMatcher": "問題マッチャー {0} は解決できませんでした。マッチャーは無視されます" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/terminal/electron-browser/terminal.contribution.i18n.json b/i18n/jpn/src/vs/workbench/parts/terminal/electron-browser/terminal.contribution.i18n.json index 11afc0e1f72332ec04b779b5599a6a8718c26ca6..1288c0d2584a7db83456164478ff97b6c8cf645e 100644 --- a/i18n/jpn/src/vs/workbench/parts/terminal/electron-browser/terminal.contribution.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/terminal/electron-browser/terminal.contribution.i18n.json @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "terminalIntegratedConfigurationTitle": "統合端末", + "terminalIntegratedConfigurationTitle": "統合ターミナル", "terminal.integrated.shell.linux": "ターミナルが Linux で使用するシェルのパス。", "terminal.integrated.shellArgs.linux": "Linux のターミナルで使用するコマンド ライン引数。", "terminal.integrated.shell.osx": "ターミナルが OS X で使用するシェルのパス。", @@ -24,7 +24,7 @@ "terminal.integrated.cwd": "端末を起動する明示的な開始パスです。これはシェル プロセスの現在の作業ディレクトリ (cwd) として使用されます。特にルート ディレクトリが cwd に適していない場合に、ワークスペースの設定で役立ちます。", "terminal.integrated.confirmOnExit": "アクティブなターミナル セッションがある場合に終了の確認をするかどうか。", "terminal.integrated.commandsToSkipShell": "キーバインドがシェルに送信されず、代わりに常に Code で処理されるコマンド ID のセット。これにより、ターミナルがフォーカスされていない場合と同じ動作をするシェルによって通常使用されるキーバインドを使用できるようになります。例: Ctrl+p で Quick Open を起動します。", - "terminal": "端末", - "terminalCategory": "端末", + "terminal": "ターミナル", + "terminalCategory": "ターミナル", "viewCategory": "表示" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/terminal/electron-browser/terminalActions.i18n.json b/i18n/jpn/src/vs/workbench/parts/terminal/electron-browser/terminalActions.i18n.json index 799b12a797bdc78eea665c55e7459ac6e3b75b57..31a4c0908cc3548e9e3a8b854343e88df1de72b9 100644 --- a/i18n/jpn/src/vs/workbench/parts/terminal/electron-browser/terminalActions.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/terminal/electron-browser/terminalActions.i18n.json @@ -6,9 +6,10 @@ { "workbench.action.terminal.toggleTerminal": "統合ターミナルの切り替え", "workbench.action.terminal.kill": "アクティブな端末インスタンスを強制終了", - "workbench.action.terminal.kill.short": "端末の強制終了", + "workbench.action.terminal.kill.short": "ターミナルの強制終了", "workbench.action.terminal.copySelection": "選択内容のコピー", - "workbench.action.terminal.new": "新しい統合端末の作成", + "workbench.action.terminal.selectAll": "すべて選択", + "workbench.action.terminal.new": "新しい統合ターミナルの作成", "workbench.action.terminal.new.short": "新しいターミナル", "workbench.action.terminal.focus": "端末にフォーカス", "workbench.action.terminal.focusNext": "次の端末にフォーカス", @@ -19,12 +20,15 @@ "workbench.action.terminal.runSelectedText": "アクティブなターミナルで選択したテキストを実行", "workbench.action.terminal.runActiveFile": "アクティブなファイルをアクティブなターミナルで実行", "workbench.action.terminal.runActiveFile.noFile": "ターミナルで実行できるのは、ディスク上のファイルのみです", - "workbench.action.terminal.switchTerminalInstance": "端末インスタンスをスイッチ", + "workbench.action.terminal.switchTerminalInstance": "ターミナル インスタンスの切り替え", "workbench.action.terminal.scrollDown": "下にスクロール (行)", "workbench.action.terminal.scrollDownPage": "スクロール ダウン (ページ)", "workbench.action.terminal.scrollToBottom": "一番下にスクロール", "workbench.action.terminal.scrollUp": "上にスクロール (行)", "workbench.action.terminal.scrollUpPage": "スクロール アップ (ページ)", "workbench.action.terminal.scrollToTop": "一番上にスクロール", - "workbench.action.terminal.clear": "クリア" + "workbench.action.terminal.clear": "クリア", + "workbench.action.terminal.allowWorkspaceShell": "ワークスペースでシェルを構成することを許可する", + "workbench.action.terminal.disallowWorkspaceShell": "ワークスペースでシェルを構成することを許可しない", + "workbench.action.terminal.rename": "名前変更" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/terminal/electron-browser/terminalFindWidget.i18n.json b/i18n/jpn/src/vs/workbench/parts/terminal/electron-browser/terminalFindWidget.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..19f4b3b0c2debbf9c8d8bd17678104479fe6a4ff --- /dev/null +++ b/i18n/jpn/src/vs/workbench/parts/terminal/electron-browser/terminalFindWidget.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "label.find": "検索", + "placeholder.find": "検索", + "label.previousMatchButton": "前の一致項目", + "label.nextMatchButton": "次の一致項目", + "label.closeButton": "閉じる" +} \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.i18n.json b/i18n/jpn/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.i18n.json index a898f37da7b14275c17226efc5e330d25ae63e2a..94bcb838b051d2c15f6432c756b2bf2225804911 100644 --- a/i18n/jpn/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.i18n.json @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "terminal.integrated.copySelection.noSelection": "ターミナルにフォーカスがない場合は、ターミナルの選択をコピーできません", "terminal.integrated.exitedWithCode": "ターミナルの処理が終了しました (終了コード: {0})", "terminal.integrated.waitOnExit": "任意のキーを押して端末を終了します", "terminal.integrated.launchFailed": "ターミナル プロセス コマンド `{0}{1}` を起動できませんでした (終了コード: {2})" diff --git a/i18n/jpn/src/vs/workbench/parts/terminal/electron-browser/terminalPanel.i18n.json b/i18n/jpn/src/vs/workbench/parts/terminal/electron-browser/terminalPanel.i18n.json index e8e8ad9346b1345edfae265027c54899a2f0c124..997819962b8231cb219ba1aba1f3bb5b3bc1dc13 100644 --- a/i18n/jpn/src/vs/workbench/parts/terminal/electron-browser/terminalPanel.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/terminal/electron-browser/terminalPanel.i18n.json @@ -5,7 +5,7 @@ // Do not edit this file. It is machine generated. { "copy": "コピー", - "createNewTerminal": "新しい端末", + "createNewTerminal": "新しいターミナル", "paste": "貼り付け", "clear": "クリア" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json b/i18n/jpn/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json index 89ac9d8c928e117dbc4d1219f6e4b027f03f3ca1..7592dde26b53f93bc1768f7bee56f4cd93804ec3 100644 --- a/i18n/jpn/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json @@ -6,6 +6,7 @@ { "selectTheme.label": "配色テーマ", "installColorThemes": "その他の配色テーマをインストール...", + "themes.selectTheme": "配色テーマの選択 (上/下キーでプレビュー可能)", "selectIconTheme.label": "ファイル アイコンのテーマ", "installIconThemes": "その他のファイル アイコンのテーマをインストール...", "noIconThemeLabel": "なし", diff --git a/i18n/jpn/src/vs/workbench/parts/update/electron-browser/update.i18n.json b/i18n/jpn/src/vs/workbench/parts/update/electron-browser/update.i18n.json index a420d7608028d13d4f97cd31fc20e5b0136ba279..a396b05a2854d016e3c200637657d402c85cbcae 100644 --- a/i18n/jpn/src/vs/workbench/parts/update/electron-browser/update.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/update/electron-browser/update.i18n.json @@ -15,5 +15,18 @@ "license": "ライセンスの閲覧", "updateAvailable": "{0} は再起動後に更新されます。", "thereIsUpdateAvailable": "利用可能な更新プログラムがあります。", - "noUpdatesAvailable": "現在入手可能な更新はありません。" + "noUpdatesAvailable": "現在入手可能な更新はありません。", + "updateIsReady": "新しい更新が利用可能です。", + "commandPalette": "コマンド パレット...", + "settings": "設定", + "keyboardShortcuts": "キーボード ショートカット", + "selectTheme.label": "配色テーマ", + "themes.selectIconTheme.label": "ファイル アイコンのテーマ", + "not available": "更新は利用できません", + "checkingForUpdates": "更新を確認しています...", + "DownloadUpdate": "利用可能な更新プログラムをダウンロードします", + "DownloadingUpdate": "更新をダウンロードしています...", + "InstallingUpdate": "更新プログラムをインストールしています...", + "restartToUpdate": "更新のために再起動します...", + "checkForUpdates": "更新の確認..." } \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/views/browser/views.i18n.json b/i18n/jpn/src/vs/workbench/parts/views/browser/views.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..6bcbcb522f9b504a19cbcc4172368d5c7c0ede69 --- /dev/null +++ b/i18n/jpn/src/vs/workbench/parts/views/browser/views.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "viewToolbarAriaLabel": "{0} 個のアクション" +} \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/views/browser/viewsExtensionPoint.i18n.json b/i18n/jpn/src/vs/workbench/parts/views/browser/viewsExtensionPoint.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..4a55950fc52d2ffcef818bb8cea1b33fe7954a9d --- /dev/null +++ b/i18n/jpn/src/vs/workbench/parts/views/browser/viewsExtensionPoint.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "requirearray": "ビューは配列にする必要があります", + "requirestring": " `{0}` プロパティは必須で、`string` 型でなければなりません", + "optstring": "`{0}` プロパティは省略するか、`string` 型にする必要があります", + "vscode.extension.contributes.view.id": "ビューの識別子。`vscode.window.registerTreeDataProviderForView` API を介してデータ プロバイダーを登録するには、これを使用します。また、`onView:${id}` イベントを `activationEvents` に登録することによって、拡張機能のアクティブ化をトリガーするためにも使用できます。", + "vscode.extension.contributes.view.name": "ビューの判読できる名前。表示されます", + "vscode.extension.contributes.views": "ビューをエディターに提供します", + "views.explorer": "エクスプローラー ビュー", + "locationId.invalid": "`{0}` は有効なビューの場所ではありません" +} \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json b/i18n/jpn/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json index 587eecb5f9d518ef09cc397d3465f9aa25c55c6c..ce85f8d6a8363cce0f4c85457c52aa7046ba8884 100644 --- a/i18n/jpn/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json @@ -11,20 +11,26 @@ "welcomePage.openFolder": "フォルダーを開く...", "welcomePage.cloneGitRepository": "Git リポジトリを複製...", "welcomePage.recent": "最近", + "welcomePage.moreRecent": "その他", "welcomePage.noRecentFolders": "最近使用したフォルダーなし", "welcomePage.help": "ヘルプ", + "welcomePage.keybindingsCheatsheet": "印刷可能なキーボードのチートシート", "welcomePage.introductoryVideos": "紹介ビデオ", "welcomePage.productDocumentation": "製品ドキュメント", "welcomePage.gitHubRepository": "GitHub リポジトリ", "welcomePage.stackOverflow": "Stack Overflow", "welcomePage.showOnStartup": "起動時にウェルカム ページを表示", "welcomePage.customize": "カスタマイズする", + "welcomePage.installExtensionPacks": "ツールと言語", + "welcomePage.installExtensionPacksDescription": "{0} と {1} のサポートをインストールする ", + "welcomePage.moreExtensions": "その他", "welcomePage.installKeymapDescription": "キーボード ショートカットをインストールします", + "welcomePage.installKeymapExtension": "{0} と {1} のキーボード ショートカットをインストール", "welcomePage.others": "その他", "welcomePage.colorTheme": "配色テーマ", "welcomePage.colorThemeDescription": "エディターとコードの外観を自由に設定します", + "welcomePage.learn": "学ぶ", "welcomePage.showCommands": "すべてのコマンドの検索と実行", - "welcomePage.showCommandsDescription": "コントロール パネルからコマンドを検索してすばやくアクセスします ({0})", "welcomePage.interfaceOverview": "インターフェイスの概要", "welcomePage.interfaceOverviewDescription": "UI の主要コンポーネントを解説した視覚オーバーレイを表示します", "welcomePage.interactivePlayground": "対話型プレイグラウンド", diff --git a/i18n/jpn/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.contribution.i18n.json b/i18n/jpn/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.contribution.i18n.json index 09458a86c492a22c3891600167ea7a19db5a013c..0f4f46adf62668f75db4dacba4034afa91c5c0dd 100644 --- a/i18n/jpn/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.contribution.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.contribution.i18n.json @@ -4,7 +4,5 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "workbenchConfigurationTitle": "ワークベンチ", - "welcomePage.enabled": "有効にすると、起動時にウェルカム ページを表示します。", "help": "ヘルプ" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json b/i18n/jpn/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json index 07b2eb85861d5c7d37d0f2f424b423f24759b6a7..59bc465791f89cbb92af83184134146892f9c656 100644 --- a/i18n/jpn/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json +++ b/i18n/jpn/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json @@ -4,12 +4,35 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "workbenchConfigurationTitle": "ワークベンチ", + "welcomePage.enabled": "有効にすると、起動時にウェルカム ページを表示します。", "welcomePage": "ようこそ", + "welcomePage.javaScript": "JavaScript", + "welcomePage.typeScript": "TypeScript", + "welcomePage.python": "Python", + "welcomePage.php": "PHP", + "welcomePage.docker": "Docker", + "welcomePage.vim": "Vim", + "welcomePage.sublime": "Sublime", + "welcomePage.atom": "Atom", + "welcomePage.extensionPackAlreadyInstalled": "{0} のサポートは既にインストールされています。", + "welcomePage.willReloadAfterInstallingExtensionPack": "{0} に追加のサポートをインストールしたあと、ウィンドウが再度読み込まれます。", + "welcomePage.installingExtensionPack": "{0} に追加のサポートをインストールしています...", + "welcomePage.extensionPackNotFound": "ID {1} のサポート {0} は見つかりませんでした。", "welcomePage.keymapAlreadyInstalled": "キーボード ショートカット {0} は既にインストールされています。", "welcomePage.willReloadAfterInstallingKeymap": "キーボード ショートカット {0} をインストールした後、ウィンドウが再度読み込まれます。", "welcomePage.installingKeymap": "{0} のキーボード ショートカットをインストールしています...", "welcomePage.keymapNotFound": "ID {1} のキーボード ショートカット {0} は見つかりませんでした。", "welcome.title": "ようこそ", + "welcomePage.openFolderWithPath": "パス {1} のフォルダー {0} を開く", + "welcomePage.extensionListSeparator": ",", + "welcomePage.installKeymap": "{0} キーマップをインストールする", + "welcomePage.installExtensionPack": "{0} に追加のサポートをインストールする", + "welcomePage.installedKeymap": "{0} キーマップは既にインストールされています", + "welcomePage.installedExtensionPack": "{0} のサポートは既にインストールされています", "ok": "OK", - "cancel": "キャンセル" + "details": "詳細", + "cancel": "キャンセル", + "welcomePage.buttonBackground": "ウェルカム ページのボタンの背景色。", + "welcomePage.buttonHoverBackground": "ウェルカム ページのボタンのホバー背景色。" } \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json b/i18n/jpn/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json index 0c7056bc9fcc8b839bb55fb16b20a1d51983b0fe..81d7a645e32904a6aad7029ee8082e5cb17c8fb0 100644 --- a/i18n/jpn/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json +++ b/i18n/jpn/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json @@ -6,6 +6,7 @@ { "open": "設定を開く", "close": "閉じる", + "saveAndRetry": "設定を保存して再試行", "errorUnknownKey": "構成ファイルに書き込めません (不明なキー)", "errorInvalidTarget": "構成ファイルに書き込めません (無効なターゲット)", "errorNoWorkspaceOpened": "開いているフォルダーがないため、設定を書き込めません。最初にフォルダーを開いてから、もう一度お試しください。", diff --git a/i18n/jpn/src/vs/workbench/services/crashReporter/common/crashReporterService.i18n.json b/i18n/jpn/src/vs/workbench/services/crashReporter/common/crashReporterService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..7df1ec40941afbac1266ebb9f6f3ff97f74d58a7 --- /dev/null +++ b/i18n/jpn/src/vs/workbench/services/crashReporter/common/crashReporterService.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "telemetryConfigurationTitle": "テレメトリ", + "telemetry.enableCrashReporting": "クラッシュ レポートを Microsoft に送信するように設定します。\nこのオプションを有効にするには、再起動が必要です。" +} \ No newline at end of file diff --git a/i18n/jpn/src/vs/workbench/services/progress/browser/progressService2.i18n.json b/i18n/jpn/src/vs/workbench/services/progress/browser/progressService2.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..6db7d6aae514a031afce5ac346abfd84bb8ee1cc --- /dev/null +++ b/i18n/jpn/src/vs/workbench/services/progress/browser/progressService2.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "progress.text": "{0} - {1}", + "progress.title": "{0}: {1}" +} \ No newline at end of file diff --git a/i18n/kor/extensions/git/out/commands.i18n.json b/i18n/kor/extensions/git/out/commands.i18n.json index 9798aa482fa611dd705657ddce072573462bb96d..b60ceccaa806e64196a5b7e66ba758688e7f9aeb 100644 --- a/i18n/kor/extensions/git/out/commands.i18n.json +++ b/i18n/kor/extensions/git/out/commands.i18n.json @@ -18,6 +18,7 @@ "discard": "변경 내용 취소", "confirm discard all": "모든 변경 내용을 취소하시겠습니까? 이 작업은 되돌릴 수 없습니다.", "discardAll": "모든 변경 내용 취소", + "no staged changes": "저장할 단계적 변경 사항이 없습니다.\n\n모든 변경 사항을 자동으로 스테이징하고 직접 저장하시겠습니까?", "yes": "예", "always": "항상", "no changes": "커밋할 변경 내용이 없습니다.", @@ -25,6 +26,9 @@ "provide commit message": "커밋 메시지를 제공하세요.", "branch name": "분기 이름", "provide branch name": "분기 이름을 입력하세요.", + "select branch to delete": "삭제할 분기 선택", + "confirm force delete branch": "'{0}' 분기가 완벽히 병합되지 않았습니다. 그래도 삭제할까요?", + "delete branch": "분기 삭제", "no remotes to pull": "리포지토리에 풀하도록 구성된 원격 항목이 없습니다.", "no remotes to push": "리포지토리에 푸시하도록 구성된 원격이 없습니다.", "nobranch": "원격에 푸시할 분기를 체크 아웃하세요.", diff --git a/i18n/kor/extensions/git/package.i18n.json b/i18n/kor/extensions/git/package.i18n.json index aed0ca69317b065bcdc855ae2ee114ef91213b64..115ba2122208cfda84694d5f620043ed24c80964 100644 --- a/i18n/kor/extensions/git/package.i18n.json +++ b/i18n/kor/extensions/git/package.i18n.json @@ -26,12 +26,13 @@ "command.undoCommit": "마지막 커밋 실행 취소", "command.checkout": "다음으로 체크 아웃...", "command.branch": "분기 만들기...", + "command.deleteBranch": "분기 삭제...", "command.pull": "풀", "command.pullRebase": "풀(다시 지정)", "command.push": "푸시", "command.pushTo": "다음으로 푸시...", "command.sync": "동기화", - "command.publish": "게시", + "command.publish": "분기 게시", "command.showOutput": "Git 출력 표시", "config.enabled": "Git 사용 여부", "config.path": "Git 실행 파일의 경로", @@ -42,5 +43,7 @@ "config.countBadge": "Git 배지 카운터를 제어합니다. `all`이면 변경 내용을 모두 계산하고, `tracked`이면 추적된 변경 내용만 계산하고, `off`이면 해제합니다.", "config.checkoutType": "`다음으로 체크 아웃...`을 실행할 때 나열되는 분기 유형을 제어합니다. `all`이면 모든 참조를 표시하고, `local`이면 로컬 분기만 표시하고, `tags`이면 태그만 표시하고, `remote`이면 원격 분기만 표시합니다.", "config.ignoreLegacyWarning": "레거시 Git 경고를 무시합니다.", - "config.ignoreLimitWarning": "리포지토리에 변경 내용이 너무 많으면 경고를 무시합니다." + "config.ignoreLimitWarning": "리포지토리에 변경 내용이 너무 많으면 경고를 무시합니다.", + "config.defaultCloneDirectory": "git 리포지토리를 복제할 기본 위치", + "config.enableSmartCommit": "단계적 변경 사항이 없는 경우 모든 변경 사항을 저장합니다." } \ No newline at end of file diff --git a/i18n/kor/extensions/jake/out/main.i18n.json b/i18n/kor/extensions/jake/out/main.i18n.json index 8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a..2e5af401ba1cb0d457adad61cd35ac8015426d1a 100644 --- a/i18n/kor/extensions/jake/out/main.i18n.json +++ b/i18n/kor/extensions/jake/out/main.i18n.json @@ -3,4 +3,6 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. -{} \ No newline at end of file +{ + "execFailed": "Jake 자동 검색 실패 오류: {0}" +} \ No newline at end of file diff --git a/i18n/kor/extensions/jake/package.i18n.json b/i18n/kor/extensions/jake/package.i18n.json index 8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a..8a1b290c1d45bd68568434f5b626faff1be22e29 100644 --- a/i18n/kor/extensions/jake/package.i18n.json +++ b/i18n/kor/extensions/jake/package.i18n.json @@ -3,4 +3,6 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. -{} \ No newline at end of file +{ + "config.jake.autoDetect": "Jake 작업에 대한 자동 검색 사용 여부를 설정합니다. 기본값은 [켜기]입니다." +} \ No newline at end of file diff --git a/i18n/kor/extensions/markdown/out/extension.i18n.json b/i18n/kor/extensions/markdown/out/extension.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..f38833da5da5d01eae3688a6f47f536d55d39c9b --- /dev/null +++ b/i18n/kor/extensions/markdown/out/extension.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "onPreviewStyleLoadError": "'markdown.styles': {0}을 불러올 수 없음" +} \ No newline at end of file diff --git a/i18n/kor/extensions/merge-conflict/out/codelensProvider.i18n.json b/i18n/kor/extensions/merge-conflict/out/codelensProvider.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..8b5b2b04aab77e8c4674eabd6dca599b663c4b8c --- /dev/null +++ b/i18n/kor/extensions/merge-conflict/out/codelensProvider.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "acceptCurrentChange": "현재 변경 사항 수락", + "acceptIncomingChange": "수신 변경 사항 수락", + "acceptBothChanges": "두 변경 사항 모두 수락", + "compareChanges": "변경 사항 비교" +} \ No newline at end of file diff --git a/i18n/kor/extensions/merge-conflict/out/commandHandler.i18n.json b/i18n/kor/extensions/merge-conflict/out/commandHandler.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..ce73e350da6e6d4b08ed04f3e1866d9e4706c77e --- /dev/null +++ b/i18n/kor/extensions/merge-conflict/out/commandHandler.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "cursorNotInConflict": "편집기 커서가 병합 충돌 내에 없음", + "compareChangesTitle": "{0}: 현재 변경 사항 ⟷ 수신 변경 사항", + "cursorOnSplitterRange": "편집기 커서가 병합 충돌 스플리터 내에 있습니다. \"현재\" 또는 \"수신\" 블록으로 옮기세요.", + "noConflicts": "이 파일에서 발견된 병합 충돌 없음", + "noOtherConflictsInThisFile": "이 파일 내에 다른 병합 충돌 없음" +} \ No newline at end of file diff --git a/i18n/kor/extensions/merge-conflict/out/mergeDecorator.i18n.json b/i18n/kor/extensions/merge-conflict/out/mergeDecorator.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..41b53ce1e6c5945b1a921793be5f7be15cf21122 --- /dev/null +++ b/i18n/kor/extensions/merge-conflict/out/mergeDecorator.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "currentChange": "(현재 변경 사항)", + "incomingChange": "(수신 변경 사항)" +} \ No newline at end of file diff --git a/i18n/kor/extensions/merge-conflict/package.i18n.json b/i18n/kor/extensions/merge-conflict/package.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..ceb1a3d504d98f6ee0e17b7184726cc893393ea4 --- /dev/null +++ b/i18n/kor/extensions/merge-conflict/package.i18n.json @@ -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. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "command.category": "충돌 병합", + "command.accept.all-incoming": "수신 모두 수락", + "command.accept.all-both": "둘 다 모두 수락", + "command.accept.current": "현재 수락", + "command.accept.incoming": "수신 수락", + "command.accept.selection": "선택 수락", + "command.accept.both": "둘 다 수락", + "command.next": "다음 충돌", + "command.previous": "이전 충돌", + "command.compare": "현재 충돌 비교", + "config.title": "충돌 병합", + "config.codeLensEnabled": "편집기 내에서 충돌 블록 CodeLense 병합 사용/사용 안 함", + "config.decoratorsEnabled": "편집기 내에서 충돌 병합 사용/사용 안 함" +} \ No newline at end of file diff --git a/i18n/kor/extensions/npm/package.i18n.json b/i18n/kor/extensions/npm/package.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..bae4e5954d08bb38ccbe0ffdc966eaaeeb0d5013 --- /dev/null +++ b/i18n/kor/extensions/npm/package.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "config.npm.autoDetect": "npm 스크립트에 대한 자동 검색 여부를 설정합니다. 기본값은 [켜기]입니다." +} \ No newline at end of file diff --git a/i18n/kor/extensions/typescript/out/features/bufferSyncSupport.i18n.json b/i18n/kor/extensions/typescript/out/features/bufferSyncSupport.i18n.json index be16b468c9ab5d971d64a15fec10549030652fe8..099f0f45bd182df56bcb647f21a08d4e5e74ecc9 100644 --- a/i18n/kor/extensions/typescript/out/features/bufferSyncSupport.i18n.json +++ b/i18n/kor/extensions/typescript/out/features/bufferSyncSupport.i18n.json @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "versionMismatch": "버전이 일치하지 않습니다. 전역 tsc({0})가 VS Code의 언어 서비스({1})와 다릅니다. 일관되지 않은 컴파일 오류가 발생할 수 있습니다.", "moreInformation": "추가 정보", "doNotCheckAgain": "다시 확인 안 함", "close": "닫기", diff --git a/i18n/kor/extensions/typescript/out/features/directiveCommentCompletionProvider.i18n.json b/i18n/kor/extensions/typescript/out/features/directiveCommentCompletionProvider.i18n.json index 8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a..cca18a8243ede5d80c6dae3482632b0fb77ef33a 100644 --- a/i18n/kor/extensions/typescript/out/features/directiveCommentCompletionProvider.i18n.json +++ b/i18n/kor/extensions/typescript/out/features/directiveCommentCompletionProvider.i18n.json @@ -3,4 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. -{} \ No newline at end of file +{ + "ts-check": "JavaScript 파일에서 의미 검사를 사용합니다. 파일의 최상단에 있어야 합니다.", + "ts-nocheck": "JavaScript 파일에서 의미 검사를 사용하지 않습니다. 파일의 최상단에 있어야 합니다.", + "ts-ignore": "파일의 다음 행에서 @ts-check 오류를 억제합니다." +} \ No newline at end of file diff --git a/i18n/kor/extensions/typescript/out/utils/projectStatus.i18n.json b/i18n/kor/extensions/typescript/out/utils/projectStatus.i18n.json index 8702bb693609ae051c0223c85666eddca3bb07c6..bd9076903888ba200db810ef7bae4abe24af0ec9 100644 --- a/i18n/kor/extensions/typescript/out/utils/projectStatus.i18n.json +++ b/i18n/kor/extensions/typescript/out/utils/projectStatus.i18n.json @@ -6,7 +6,6 @@ { "hintExclude": "프로젝트 전체에서 JavaScript/TypeScript 언어 기능을 사용하도록 설정하려면 {0}과(와) 같이 파일이 많은 폴더를 제외하세요.", "hintExclude.generic": "프로젝트 전체에서 JavaScript/TypeScript 언어 기능을 사용하도록 설정하려면 사용하지 않는 소스 파일이 포함된 큰 폴더를 제외하세요.", - "open": "제외 구성", "large.label": "제외 구성", "hintExclude.tooltip": "프로젝트 전체에서 JavaScript/TypeScript 언어 기능을 사용하도록 설정하려면 사용하지 않는 소스 파일이 포함된 큰 폴더를 제외하세요." } \ No newline at end of file diff --git a/i18n/kor/extensions/typescript/out/utils/typingsStatus.i18n.json b/i18n/kor/extensions/typescript/out/utils/typingsStatus.i18n.json index 07c376496cff1f8adc30ca064c91101b20eac4b1..e070552b4200c6ecc5ebb70f05baad66f71913e3 100644 --- a/i18n/kor/extensions/typescript/out/utils/typingsStatus.i18n.json +++ b/i18n/kor/extensions/typescript/out/utils/typingsStatus.i18n.json @@ -5,7 +5,7 @@ // Do not edit this file. It is machine generated. { "installingPackages": "TypeScript IntelliSense를 향상하기 위해 데이터를 페치하는 중", - "typesInstallerInitializationFailed.title": "JavaScript 언어 기능에 대해 입력 파일을 설치할 수 없습니다. NPM이 설치되어 있고 PATH에 있는지 확인하세요.", + "typesInstallerInitializationFailed.title": "JavaScript 언어 기능에 대한 입력 파일을 설치할 수 없습니다. NPM이 설치되어 있는지 확인하거나 사용자 설정에서 'typescript.npm'을 구성하세요.", "typesInstallerInitializationFailed.moreInformation": "추가 정보", "typesInstallerInitializationFailed.doNotCheckAgain": "다시 확인 안 함", "typesInstallerInitializationFailed.close": "닫기" diff --git a/i18n/kor/extensions/typescript/package.i18n.json b/i18n/kor/extensions/typescript/package.i18n.json index 4e1ce76b2130f30bb90e35be4ba2f6c6f7e6de9d..f2cc400f199c7c19faf79b0b39c92490e1939ef3 100644 --- a/i18n/kor/extensions/typescript/package.i18n.json +++ b/i18n/kor/extensions/typescript/package.i18n.json @@ -13,7 +13,6 @@ "typescript.check.tscVersion": "전역 설치 TypeScript 컴파일러(예: tsc)가 사용된 TypeScript 언어 서비스와 다른지 확인하세요.", "typescript.tsserver.log": "파일에 대해 TS 서버 로깅을 사용하도록 설정합니다. 이 로그는 TS 서버 문제를 진단하는 데 사용될 수 있습니다. 로그에는 파일 경로, 소스 코드 및 프로젝트에서 잠재적으로 중요한 기타 정보가 포함될 수 있습니다.", "typescript.tsserver.trace": "TS 서버로 전송한 메시지 추적을 사용하도록 설정합니다. 이\n 추적은 TS 서버 문제를 진단하는 데 사용될 수 있습니다. 추적에는 파일 경로, 소스 코드 및 프로젝트에서 잠재적으로 중요한\n 기타 정보가 포함될 수 있습니다.", - "typescript.tsserver.experimentalAutoBuild": "실험적 자동 빌드를 사용하도록 설정합니다. 1.9 dev 또는 2.x tsserver 버전이 필요하며 변경 후에는 VS Code를 다시 시작해야 합니다.", "typescript.validate.enable": "TypeScript 유효성 검사를 사용하거나 사용하지 않습니다.", "typescript.format.enable": "기본 TypeScript 포맷터를 사용하거나 사용하지 않습니다.", "javascript.format.enable": "기본 JavaScript 포맷터를 사용하거나 사용하지 않습니다.", @@ -33,9 +32,16 @@ "javascript.validate.enable": "JavaScript 유효성 검사를 사용하거나 사용하지 않습니다.", "typescript.goToProjectConfig.title": "프로젝트 구성으로 이동", "javascript.goToProjectConfig.title": "프로젝트 구성으로 이동", + "javascript.referencesCodeLens.enabled": "JavaScript 파일에서 CodeLense 참조를 사용/사용 안 함으로 설정합니다.", + "typescript.referencesCodeLens.enabled": "TypeScript 파일에서 참조 CodeLense를 사용/사용 안 함으로 설정합니다. TypeScript >= 2.0.6이 필요합니다.", "typescript.implementationsCodeLens.enabled": "구현 CodeLens를 사용하거나 사용하지 않도록 설정합니다. TypeScript >= 2.2.0이 필요합니다.", + "typescript.openTsServerLog.title": "TS 서버 로그 열기", + "typescript.restartTsServer": "TS 서버 다시 시작", "typescript.selectTypeScriptVersion.title": "TypeScript 버전 선택", "jsDocCompletion.enabled": "자동 JSDoc 주석 사용/사용 안 함", "javascript.implicitProjectConfig.checkJs": "JavaScript 파일의 의미 체계 검사를 사용/사용하지 않습니다. 기존 jsconfig.json 또는 tsconfig.json 파일은 이 설정을 재정의합니다. TypeScript >=2.3.1이 필요합니다. ", - "typescript.check.npmIsInstalled": "자동 입력 인식에 대해 NPM이 설치되어 있는지 확인" + "typescript.npm": "자동 입력 인식에 사용된 NPM 실행 파일 경로를 지정합니다. TypeScript >= 2.3.4가 필요합니다.", + "typescript.check.npmIsInstalled": "자동 입력 인식에 대해 NPM이 설치되어 있는지 확인합니다.", + "javascript.nameSuggestions": "JavaScript 제안 목록의 파일에서 고유한 이름 포함을 사용/사용 안 함으로 설정합니다.", + "typescript.tsc.autoDetect": "tsc 작업의 자동 검색을 켜거나 끕니다." } \ No newline at end of file diff --git a/i18n/kor/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json b/i18n/kor/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json index def2cd28d67c8de33792d5446b2791ff004822eb..6d1aafbc27134fc87c0c268b8580ac055ccabfdf 100644 --- a/i18n/kor/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json +++ b/i18n/kor/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json @@ -6,8 +6,7 @@ { "imgMeta": "{0}x{1} {2}", "largeImageError": "이미지가 너무 커서 편집기에 표시할 수 없습니다. ", - "resourceOpenExternalButton": "이미지 열기", - "resourceOpenExternalText": " 외부 프로그램을 사용할까요?", + "resourceOpenExternalButton": " 외부 프로그램으로 이미지를 열까요?", "nativeBinaryError": "파일이 이진이거나 매우 크거나 지원되지 않는 텍스트 인코딩을 사용하기 때문에 편집기에서 표시되지 않습니다.", "sizeB": "{0}B", "sizeKB": "{0}KB", diff --git a/i18n/kor/src/vs/base/common/errorMessage.i18n.json b/i18n/kor/src/vs/base/common/errorMessage.i18n.json index a1079b639599e3aa56de091b8a94abc4a9e146e3..f7f99e392a0a540d8ae60df84a36592e5654998c 100644 --- a/i18n/kor/src/vs/base/common/errorMessage.i18n.json +++ b/i18n/kor/src/vs/base/common/errorMessage.i18n.json @@ -13,6 +13,5 @@ "error.connection.unknown": "알 수 없는 연결 오류가 발생했습니다. 인터넷에 연결되지 않았거나 연결된 서버가 오프라인 상태입니다.", "stackTrace.format": "{0}: {1}", "error.defaultMessage": "알 수 없는 오류가 발생했습니다. 자세한 내용은 로그를 참조하세요.", - "nodeExceptionMessage": "시스템 오류가 발생했습니다({0}).", "error.moreErrors": "{0}(총 {1}개의 오류)" } \ No newline at end of file diff --git a/i18n/kor/src/vs/base/common/keybindingLabels.i18n.json b/i18n/kor/src/vs/base/common/keybindingLabels.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a --- /dev/null +++ b/i18n/kor/src/vs/base/common/keybindingLabels.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{} \ No newline at end of file diff --git a/i18n/kor/src/vs/code/electron-main/menus.i18n.json b/i18n/kor/src/vs/code/electron-main/menus.i18n.json index a8faf00b8586317d56cddd3928ab6d99d4beb000..4716e6a22e5a5f02a029ef82293d97a92c045d89 100644 --- a/i18n/kor/src/vs/code/electron-main/menus.i18n.json +++ b/i18n/kor/src/vs/code/electron-main/menus.i18n.json @@ -14,6 +14,7 @@ "mHelp": "도움말(&&H)", "miNewWindow": "새 창(&&W)", "mAbout": "{0} 정보", + "mServices": "서비스", "mHide": "{0} 숨기기", "mHideOthers": "기타 숨기기", "mShowAll": "모두 표시", @@ -54,6 +55,9 @@ "miShowEmmetCommands": "Emmet(&&M)...", "miToggleLineComment": "줄 주석 설정/해제(&&T)", "miToggleBlockComment": "블록 주석 설정/해제(&&B)", + "miMultiCursorAlt": "다중 커서에 Alt+클릭 사용", + "miMultiCursorCmd": "다중 커서에 Cmd+클릭 사용", + "miMultiCursorCtrl": "다중 커서에 Ctrl+클릭 사용", "miInsertCursorAbove": "위에 커서 추가(&&A)", "miInsertCursorBelow": "아래에 커서 추가(&&D)", "miInsertCursorAtEndOfEachLineSelected": "줄 끝에 커서 추가(&&U)", @@ -69,6 +73,7 @@ "miSmartSelectShrink": "선택 영역 축소(&&S)", "miViewExplorer": "탐색기(&&E)", "miViewSearch": "검색(&&S)", + "miViewSCM": "SCM(&&C)", "miViewDebug": "디버그(&&D)", "miViewExtensions": "확장(&&X)", "miToggleOutput": "출력(&&O)", @@ -113,6 +118,8 @@ "miGotoSymbolInFile": "파일의 기호로 이동(&&S)...", "miGotoSymbolInWorkspace": "작업 영역의 기호로 이동(&&W)...", "miGotoDefinition": "정의로 이동(&&D)", + "miGotoTypeDefinition": "형식 정의로 이동( &&T)", + "miGotoImplementation": "구현으로 이동( &&I)", "miGotoLine": "줄 이동(&&L)...", "miStartDebugging": "디버깅 시작(&&S)", "miStartWithoutDebugging": "디버깅하지 않고 시작(&&W)", @@ -129,16 +136,17 @@ "miColumnBreakpoint": "열 중단점(&&O)", "miFunctionBreakpoint": "함수 중단점(&&F)...", "miNewBreakpoint": "새 중단점(&&N)", + "miEnableAllBreakpoints": "모든 중단점 설정", "miDisableAllBreakpoints": "모든 중단점 사용 안 함(&&L)", "miRemoveAllBreakpoints": "모든 중단점 제거(&&A)", "miInstallAdditionalDebuggers": "추가 디버거 설치(&&I)...", "mMinimize": "최소화", - "mClose": "닫기", "mBringToFront": "모두 맨 앞으로 가져오기", "miToggleDevTools": "개발자 도구 설정/해제(&&T)", "miAccessibilityOptions": "접근성 옵션(&&O)", "miReportIssues": "문제 보고(&&I)", "miWelcome": "시작(&&W)", + "miInteractivePlayground": "대화형 실습(&&I)", "miDocumentation": "설명서(&&D)", "miReleaseNotes": "릴리스 정보(&&R)", "miKeyboardShortcuts": "바로 가기 키 참조(&&K)", @@ -148,6 +156,8 @@ "miLicense": "라이선스 보기(&&L)", "miPrivacyStatement": "개인정보처리방침(&&P)", "miAbout": "정보(&&A)", + "miTerminateTask": "작업 종료(&&T)", + "accessibilityOptionsWindowTitle": "접근성 옵션", "miRestartToUpdate": "업데이트하기 위해 다시 시작...", "miCheckingForUpdates": "업데이트를 확인하는 중...", "miDownloadUpdate": "사용 가능한 업데이트 다운로드", diff --git a/i18n/kor/src/vs/code/electron-main/windows.i18n.json b/i18n/kor/src/vs/code/electron-main/windows.i18n.json index 0756d51cd469daea5077b26f38130776bec1e976..bad419f4787af3307fb19ae6bd502e85fc917982 100644 --- a/i18n/kor/src/vs/code/electron-main/windows.i18n.json +++ b/i18n/kor/src/vs/code/electron-main/windows.i18n.json @@ -7,16 +7,11 @@ "ok": "확인", "pathNotExistTitle": "경로가 없습니다.", "pathNotExistDetail": "'{0}' 경로가 디스크에 더 이상 없는 것 같습니다.", - "accessibilityOptionsWindowTitle": "접근성 옵션", "reopen": "다시 열기", "wait": "계속 대기", "close": "닫기", "appStalled": "창이 더 이상 응답하지 않습니다.", "appStalledDetail": "창을 다시 열거나, 닫거나, 계속 기다릴 수 있습니다.", "appCrashed": "창이 충돌했습니다.", - "appCrashedDetail": "불편을 드려서 죄송합니다. 창을 다시 열면 중단된 위치에서 계속할 수 있습니다.", - "newWindow": "새 창", - "newWindowDesc": "새 창을 엽니다.", - "recentFolders": "최근 폴더", - "folderDesc": "{0} {1}" + "appCrashedDetail": "불편을 드려서 죄송합니다. 창을 다시 열면 중단된 위치에서 계속할 수 있습니다." } \ No newline at end of file diff --git a/i18n/kor/src/vs/editor/common/config/commonEditorConfig.i18n.json b/i18n/kor/src/vs/editor/common/config/commonEditorConfig.i18n.json index 185383233538c9d1bce065c7b8d7d434204826ae..3baffd1c3a9bf56a866b8a285310378a8778bc8a 100644 --- a/i18n/kor/src/vs/editor/common/config/commonEditorConfig.i18n.json +++ b/i18n/kor/src/vs/editor/common/config/commonEditorConfig.i18n.json @@ -9,6 +9,7 @@ "fontWeight": "글꼴 두께를 제어합니다.", "fontSize": "글꼴 크기(픽셀)를 제어합니다.", "lineHeight": "줄 높이를 제어합니다. fontSize의 lineHeight를 계산하려면 0을 사용합니다.", + "letterSpacing": "글자 간격을 픽셀 단위로 조정합니다.", "lineNumbers": "줄 번호의 표시 여부를 제어합니다. 가능한 값은 'on', 'off', 'relative'입니다. 'relative'는 현재 커서 위치에서 줄 수를 표시합니다.", "rulers": "세로 눈금자를 표시할 열", "wordSeparators": "단어 관련 탐색 또는 작업을 수행할 때 단어 구분 기호로 사용되는 문자입니다.", @@ -22,6 +23,8 @@ "minimap.enabled": "미니맵 표시 여부를 제어합니다.", "minimap.renderCharacters": "줄의 실제 문자(색 블록 아님) 렌더링", "minimap.maxColumn": "최대 특정 수의 열을 렌더링하도록 미니맵의 너비를 제한합니다.", + "find.seedSearchStringFromSelection": "편집기 선택에서 Find Widget의 검색 문자열을 시딩할지 설정합니다.", + "find.autoFindInSelection": "편집기에서 여러 글자 또는 행을 선택했을 때 Find in Selection 플래그를 켤지 설정합니다.", "wordWrap.off": "줄이 바뀌지 않습니다.", "wordWrap.on": "뷰포트 너비에서 줄이 바뀝니다.", "wordWrap.wordWrapColumn": "`editor.wordWrapColumn`에서 줄이 바뀝니다.", @@ -30,12 +33,14 @@ "wordWrapColumn": "`editor.wordWrap`이 'wordWrapColumn' 또는 'bounded'인 경우 편집기의 열 줄 바꿈을 제어합니다.", "wrappingIndent": "줄 바꿈 행의 들여쓰기를 제어합니다. 'none', 'same' 또는 'indent' 중 하나일 수 있습니다.", "mouseWheelScrollSensitivity": "마우스 휠 스크롤 이벤트의 `deltaX` 및 `deltaY`에서 사용할 승수", + "multiCursorModifier.ctrlCmd": "Windows와 Linux의 'Control'을 OSX의 'Command'로 매핑합니다.", + "multiCursorModifier.alt": "Windows와 Linux의 'Alt'를 OSX의 'Option'으로 매핑합니다.", + "multiCursorModifier": "마우스로 여러 커서를 추가할 때 사용할 수정자입니다. `ctrlCmd`는 Windows와 Linux에서 `Control`로 매핑되고 OSX에서 `Command`로 매핑됩니다. Go To Definition 및 Open Link 마우스 제스처가 멀티커서 수정자와 충돌하지 않도록 조정됩니다.", "quickSuggestions.strings": "문자열 내에서 빠른 제안을 사용합니다.", "quickSuggestions.comments": "주석 내에서 빠른 제안을 사용합니다.", "quickSuggestions.other": "문자열 및 주석 외부에서 빠른 제안을 사용합니다.", "quickSuggestions": "입력하는 동안 제안을 자동으로 표시할지 여부를 제어합니다.", "quickSuggestionsDelay": "빠른 제안을 표시할 지연 시간(ms)을 제어합니다.", - "parameterHints": "매개 변수 힌트를 사용하도록 설정합니다.", "autoClosingBrackets": "괄호를 연 다음에 편집기에서 괄호를 자동으로 닫을지 여부를 제어합니다.", "formatOnType": "입력 후 편집기에서 자동으로 줄의 서식을 지정할지 여부를 제어합니다.", "formatOnPaste": "붙여넣은 콘텐츠의 서식을 편집기에서 자동으로 지정할지 여부를 제어합니다. 포맷터는 반드시 사용할 수 있어야 하며 문서에서 범위의 서식을 지정할 수 있어야 합니다.", @@ -62,12 +67,17 @@ "renderLineHighlight": "편집기가 현재 줄 강조 표시를 렌더링하는 방식을 제어합니다. 가능한 값은 'none', 'gutter', 'line' 및 'all'입니다.", "codeLens": "편집기에서 코드 필터를 표시하는지 여부를 제어합니다.", "folding": "편집기에서 코드 접기를 사용할지 여부를 제어합니다.", + "showFoldingControls": "거터의 폴드 컨트롤을 자동으로 숨길지 결정합니다.", "matchBrackets": "대괄호 중 하나를 선택할 때 일치하는 대괄호를 강조 표시합니다.", "glyphMargin": "편집기에서 세로 문자 모양 여백을 렌더링할지 여부를 제어합니다. 문자 모양 여백은 주로 디버깅에 사용됩니다.", "useTabStops": "탭 정지 뒤에 공백 삽입 및 삭제", "trimAutoWhitespace": "끝에 자동 삽입된 공백 제거", "stablePeek": "해당 콘텐츠를 두 번 클릭하거나 키를 누르더라도 Peek 편집기를 열린 상태로 유지합니다.", "dragAndDrop": "편집기에서 끌어서 놓기로 선택 영역을 이동할 수 있는지 여부를 제어합니다.", + "accessibilitySupport.auto": "편집기가 스크린 리더가 연결되면 플랫폼 API를 사용하여 감지합니다.", + "accessibilitySupport.on": "편집기가 스크린 리더 사용을 위해 영구적으로 최적화됩니다.", + "accessibilitySupport.off": "편집기가 스크린 리더 사용을 위해 최적화되지 않습니다.", + "accessibilitySupport": "편집기를 스크린 리더를 위해 최적화된 모드로 실행할지 결정합니다.", "sideBySide": "diff 편집기에서 diff를 나란히 표시할지 인라인으로 표시할지 여부를 제어합니다.", "ignoreTrimWhitespace": "diff 편집기에서 선행 공백 또는 후행 공백 변경을 diffs로 표시할지 여부를 제어합니다.", "renderIndicators": "diff 편집기에서 추가/제거된 변경 내용에 대해 +/- 표시기를 표시하는지 여부를 제어합니다.", diff --git a/i18n/kor/src/vs/editor/common/config/editorOptions.i18n.json b/i18n/kor/src/vs/editor/common/config/editorOptions.i18n.json index 4118aae2aa724e05b685e8d4af10f9668b0fb4b6..f2303e9e3676cd7cecdb38a7883469515bed2d9f 100644 --- a/i18n/kor/src/vs/editor/common/config/editorOptions.i18n.json +++ b/i18n/kor/src/vs/editor/common/config/editorOptions.i18n.json @@ -4,5 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "accessibilityOffAriaLabel": "지금은 편집기를 사용할 수 없습니다. Alt+F1을 눌러 옵션을 보세요.", "editorViewAccessibleLabel": "편집기 콘텐츠" } \ No newline at end of file diff --git a/i18n/kor/src/vs/editor/common/view/editorColorRegistry.i18n.json b/i18n/kor/src/vs/editor/common/view/editorColorRegistry.i18n.json index e45a777ecdb40b4c7049f131f1570ca47ee8a25b..dcef1416eba3b36e89704049946067dd61560e9f 100644 --- a/i18n/kor/src/vs/editor/common/view/editorColorRegistry.i18n.json +++ b/i18n/kor/src/vs/editor/common/view/editorColorRegistry.i18n.json @@ -10,5 +10,15 @@ "caret": "편집기 커서 색입니다.", "editorWhitespaces": "편집기의 공백 문자 색입니다.", "editorIndentGuides": "편집기 들여쓰기 안내선 색입니다.", - "editorLineNumbers": "편집기 줄 번호 색입니다." + "editorLineNumbers": "편집기 줄 번호 색입니다.", + "editorRuler": "편집기 눈금의 색상입니다.", + "editorCodeLensForeground": "편집기 코드 렌즈의 전경색입니다.", + "editorBracketMatchBackground": "일치하는 브래킷 뒤의 배경색입니다.", + "editorBracketMatchBorder": "일치하는 브래킷 박스의 색상", + "editorOverviewRulerBorder": "개요 눈금 경계의 색상입니다.", + "editorGutter": "편집기 거터의 배경색입니다. 거터에는 글리프 여백과 행 수가 있습니다.", + "errorForeground": "편집기 내 오류 표시선의 전경색입니다.", + "errorBorder": "편집기 내 오류 표시선의 테두리 색입니다.", + "warningForeground": "편집기 내 경고 표시선의 전경색입니다.", + "warningBorder": "편집기 내 경고 표시선의 테두리 색입니다." } \ No newline at end of file diff --git a/i18n/kor/src/vs/editor/contrib/find/common/findController.i18n.json b/i18n/kor/src/vs/editor/contrib/find/common/findController.i18n.json index e49f22d8123027ed8d8765c65171a51476ac7de6..468f641effe12483627176794991cc1872346bb4 100644 --- a/i18n/kor/src/vs/editor/contrib/find/common/findController.i18n.json +++ b/i18n/kor/src/vs/editor/contrib/find/common/findController.i18n.json @@ -14,6 +14,5 @@ "addSelectionToPreviousFindMatch": "이전 일치 항목 찾기에 선택 항목 추가", "moveSelectionToNextFindMatch": "다음 일치 항목 찾기로 마지막 선택 항목 이동", "moveSelectionToPreviousFindMatch": "마지막 선택 항목을 이전 일치 항목 찾기로 이동", - "selectAllOccurencesOfFindMatch": "일치 항목 찾기의 모든 항목 선택", "changeAll.label": "모든 항목 변경" } \ No newline at end of file diff --git a/i18n/kor/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.i18n.json b/i18n/kor/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..eb7148607bdaa1fe68527849d56f8fbccbe6d453 --- /dev/null +++ b/i18n/kor/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.i18n.json @@ -0,0 +1,23 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "noResultWord": "'{0}'에 대한 정의를 찾을 수 없습니다.", + "generic.noResults": "정의를 찾을 수 없음", + "meta.title": "– {0} 정의", + "actions.goToDecl.label": "정의로 이동", + "actions.goToDeclToSide.label": "측면에서 정의 열기", + "actions.previewDecl.label": "정의 피킹(Peeking)", + "goToImplementation.noResultWord": "'{0}'에 대한 구현을 찾을 수 없습니다.", + "goToImplementation.generic.noResults": "구현을 찾을 수 없습니다.", + "meta.implementations.title": " – {0} 개 구현", + "actions.goToImplementation.label": "구현으로 이동", + "actions.peekImplementation.label": "구현 미리 보기", + "goToTypeDefinition.noResultWord": "'{0}'에 대한 형식 정의를 찾을 수 없습니다.", + "goToTypeDefinition.generic.noResults": "형식 정의를 찾을 수 없습니다.", + "meta.typeDefinitions.title": "– {0} 형식 정의", + "actions.goToTypeDefinition.label": "형식 정의로 이동", + "actions.peekTypeDefinition.label": "형식 정의 미리 보기" +} \ No newline at end of file diff --git a/i18n/kor/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.i18n.json b/i18n/kor/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..57b4929798ff4aac1bd55990aebcf3f94cfb11fb --- /dev/null +++ b/i18n/kor/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "multipleResults": "{0}개 정의를 표시하려면 클릭하세요." +} \ No newline at end of file diff --git a/i18n/kor/src/vs/editor/contrib/links/browser/links.i18n.json b/i18n/kor/src/vs/editor/contrib/links/browser/links.i18n.json index e38e83f3a2f5b78f910909f6d8255cfa7f055de3..ddf7b26a227e80027f718fe670b65721fd9561b3 100644 --- a/i18n/kor/src/vs/editor/contrib/links/browser/links.i18n.json +++ b/i18n/kor/src/vs/editor/contrib/links/browser/links.i18n.json @@ -6,6 +6,7 @@ { "links.navigate.mac": "Cmd 키를 누르고 클릭하여 링크로 이동", "links.navigate": "Ctrl 키를 누르고 클릭하여 링크로 이동", + "links.navigate.al": "Alt 키를 누르고 클릭하여 링크로 이동", "invalid.url": "죄송합니다. 이 링크는 형식이 올바르지 않으므로 열지 못했습니다. {0}", "missing.url": "죄송합니다. 대상이 없으므로 이 링크를 열지 못했습니다.", "label": "링크 열기" diff --git a/i18n/kor/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json b/i18n/kor/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json index 2aeba994a61d1a409a4e62d1034cc5aeb66984f8..0bb0099a543f32aa438105ef5290ade888d952a7 100644 --- a/i18n/kor/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json +++ b/i18n/kor/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json @@ -5,8 +5,6 @@ // Do not edit this file. It is machine generated. { "aria.oneReference": "{2}열, {1}줄, {0}의 기호", - "aria.fileReferences.1": "{0}의 기호 1개", - "aria.fileReferences.N": "{1}의 기호 {0}개", "aria.result.0": "결과 없음", "aria.result.1": "{0}에서 기호 1개를 찾았습니다.", "aria.result.n1": "{1}에서 기호 {0}개를 찾았습니다.", diff --git a/i18n/kor/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.i18n.json b/i18n/kor/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.i18n.json index d5cc24a60e7ce2aea174e9bebea7bc9893b7c69e..bebeacf63465f0a8a06fae0ed9b95a029f56590f 100644 --- a/i18n/kor/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.i18n.json +++ b/i18n/kor/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.i18n.json @@ -16,9 +16,12 @@ "peekViewTitleInfoForeground": "Peek 뷰 제목 정보 색입니다.", "peekViewBorder": "Peek 뷰 테두리 및 화살표 색입니다.", "peekViewResultsBackground": "Peek 뷰 결과 목록의 배경색입니다.", + "peekViewResultsMatchForeground": "Peek 뷰 결과 목록에서 라인 노드의 전경색입니다.", + "peekViewResultsFileForeground": "Peek 뷰 결과 목록에서 파일 노드의 전경색입니다.", "peekViewResultsSelectionBackground": "Peek 뷰 결과 목록에서 선택된 항목의 배경색입니다.", "peekViewResultsSelectionForeground": "Peek 뷰 결과 목록에서 선택된 항목의 전경색입니다.", "peekViewEditorBackground": "Peek 뷰 편집기의 배경색입니다.", + "peekViewEditorGutterBackground": "Peek 뷰 편집기의 거터 배경색입니다.", "peekViewResultsMatchHighlight": "Peek 뷰 결과 목록의 일치 항목 강조 표시 색입니다.", "peekViewEditorMatchHighlight": "Peek 뷰 편집기의 일치 항목 강조 표시 색입니다." } \ No newline at end of file diff --git a/i18n/kor/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json b/i18n/kor/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json index 8f85109ab671be7af7373e37266373d869141179..db8bbbe66702bd69fbcb7ace923921c099b9967f 100644 --- a/i18n/kor/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json +++ b/i18n/kor/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json @@ -12,6 +12,7 @@ "readMore": "자세히 알아보기...{0}", "suggestionWithDetailsAriaLabel": "{0}, 제안, 세부 정보 있음", "suggestionAriaLabel": "{0}, 제안", + "readLess": "간단히 보기...{0}", "suggestWidget.loading": "로드 중...", "suggestWidget.noSuggestions": "제안 항목이 없습니다.", "suggestionAriaAccepted": "{0}, 수락됨", diff --git a/i18n/kor/src/vs/editor/node/languageConfigurationExtensionPoint.i18n.json b/i18n/kor/src/vs/editor/node/languageConfigurationExtensionPoint.i18n.json index d8b1d74b5f77a9809edb59b21fac6bd0952e15b6..59242661db1f7612c69347ec8420211ab80d9ebf 100644 --- a/i18n/kor/src/vs/editor/node/languageConfigurationExtensionPoint.i18n.json +++ b/i18n/kor/src/vs/editor/node/languageConfigurationExtensionPoint.i18n.json @@ -15,5 +15,9 @@ "schema.brackets": "들여쓰기를 늘리거나 줄이는 대괄호 기호를 정의합니다.", "schema.autoClosingPairs": "대괄호 쌍을 정의합니다. 여는 대괄호를 입력하면 닫는 대괄호가 자동으로 삽입됩니다.", "schema.autoClosingPairs.notIn": "자동 쌍을 사용하지 않도록 설정된 범위 목록을 정의합니다.", - "schema.surroundingPairs": "선택한 문자열을 둘러싸는 데 사용할 수 있는 대괄호 쌍을 정의합니다." + "schema.surroundingPairs": "선택한 문자열을 둘러싸는 데 사용할 수 있는 대괄호 쌍을 정의합니다.", + "schema.wordPattern": "해당 언어에 대한 단어 정의입니다.", + "schema.wordPattern.pattern": "단어 일치에 사용하는 RegEXP 패턴입니다.", + "schema.wordPattern.flags": "단어 일치에 사용하는 RegExp 플래그입니다.", + "schema.wordPattern.flags.errorMessage": "`/^([gimuy]+)$/` 패턴과 일치해야 합니다." } \ No newline at end of file diff --git a/i18n/kor/src/vs/platform/actions/electron-browser/menusExtensionPoint.i18n.json b/i18n/kor/src/vs/platform/actions/electron-browser/menusExtensionPoint.i18n.json index d2433872a7da1d66908ba2916bcbfb9f655437e5..1c5f62b7b236b643cadede01f2015471de886ab6 100644 --- a/i18n/kor/src/vs/platform/actions/electron-browser/menusExtensionPoint.i18n.json +++ b/i18n/kor/src/vs/platform/actions/electron-browser/menusExtensionPoint.i18n.json @@ -21,6 +21,8 @@ "menus.scmTitle": "소스 제어 제목 메뉴", "menus.resourceGroupContext": "소스 제어 리소스 그룹 상황에 맞는 메뉴", "menus.resourceStateContext": "소스 제어 리소스 상태 상황에 맞는 메뉴", + "view.viewTitle": "기여 조회 제목 메뉴", + "view.itemContext": "기여 조회 항목 상황에 맞는 메뉴", "nonempty": "비어 있지 않은 값이 필요합니다.", "opticon": "`icon` 속성은 생략할 수 있거나 문자열 또는 리터럴(예: `{dark, light}`)이어야 합니다.", "requireStringOrObject": "`{0}` 속성은 필수이며 `string` 또는 `object` 형식이어야 합니다.", diff --git a/i18n/kor/src/vs/platform/extensions/common/extensionsRegistry.i18n.json b/i18n/kor/src/vs/platform/extensions/common/extensionsRegistry.i18n.json index 2fca8d6643b6985c193742e305bac55db2f4c255..7207158c622dc0bd02a809d027aab19801f465ed 100644 --- a/i18n/kor/src/vs/platform/extensions/common/extensionsRegistry.i18n.json +++ b/i18n/kor/src/vs/platform/extensions/common/extensionsRegistry.i18n.json @@ -14,6 +14,12 @@ "vscode.extension.contributes": "이 패키지에 표시된 VS Code 확장의 전체 기여입니다.", "vscode.extension.preview": "마켓플레이스에서 Preview로 플래그 지정할 확장을 설정합니다.", "vscode.extension.activationEvents": "VS Code 확장에 대한 활성화 이벤트입니다.", + "vscode.extension.activationEvents.onLanguage": "지정된 언어로 확인되는 파일을 열 때마다 활성화 이벤트가 발송됩니다.", + "vscode.extension.activationEvents.onCommand": "지정된 명령을 호출할 때마다 활성화 이벤트가 발송됩니다.", + "vscode.extension.activationEvents.onDebug": "지정된 유형의 디버깅 세션을 시작할 때마다 활성화 알림이 발송됩니다.", + "vscode.extension.activationEvents.workspaceContains": "지정된 glob 패턴과 일치하는 파일이 하나 이상 있는 폴더를 열 때마다 활성화 알림이 발송됩니다.", + "vscode.extension.activationEvents.onView": "지정된 뷰가 확장될 때마다 활성화 이벤트가 내보내 집니다.", + "vscode.extension.activationEvents.star": "VS Code 시작 시 활성화 이벤트가 발송됩니다. 훌륭한 최종 사용자 경험을 보장하려면 사용 케이스에서 다른 활성화 이벤트 조합이 작동하지 않을 때에만 확장에서 이 활성화 이벤트를 사용하세요.", "vscode.extension.badges": "마켓플레이스 확장 페이지의 사이드바에 표시할 배지의 배열입니다.", "vscode.extension.badges.url": "배지 이미지 URL입니다.", "vscode.extension.badges.href": "배지 링크입니다.", diff --git a/i18n/kor/src/vs/platform/history/electron-main/historyMainService.i18n.json b/i18n/kor/src/vs/platform/history/electron-main/historyMainService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..6b87a635f59dda1e6d49a8615400153081a7c1e5 --- /dev/null +++ b/i18n/kor/src/vs/platform/history/electron-main/historyMainService.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "newWindow": "새 창", + "newWindowDesc": "새 창을 엽니다.", + "recentFolders": "최근 폴더", + "folderDesc": "{0} {1}" +} \ No newline at end of file diff --git a/i18n/kor/src/vs/platform/markers/common/problemMatcher.i18n.json b/i18n/kor/src/vs/platform/markers/common/problemMatcher.i18n.json index ff679b577b23592ed99858de70dec05915e94af9..22a96d0b0b8080d06966ef41d72f07ba6351ae31 100644 --- a/i18n/kor/src/vs/platform/markers/common/problemMatcher.i18n.json +++ b/i18n/kor/src/vs/platform/markers/common/problemMatcher.i18n.json @@ -34,6 +34,7 @@ "ProblemMatcherParser.noValidIdentifier": "오류: 패턴 속성 {0}이(가) 유효한 패턴 변수 이름이 아닙니다.", "ProblemMatcherParser.problemPattern.watchingMatcher": "문제 검사기에서 감시 시작 패턴과 종료 패턴을 모두 정의해야 합니다.", "ProblemMatcherParser.invalidRegexp": "오류: {0} 문자열은 유효한 정규식이 아닙니다.\n", + "WatchingPatternSchema.regexp": "백그라운드 작업의 시작 또는 종료를 감지하는 정규식입니다.", "WatchingPatternSchema.file": "파일 이름의 일치 그룹 인덱스이며 생략할 수 있습니다.", "PatternTypeSchema.name": "제공되거나 미리 정의된 패턴의 이름", "PatternTypeSchema.description": "문제 패턴 또는 제공되거나 미리 정의된 문제 패턴의 이름입니다. 기본이 지정된 경우 생략할 수 있습니다.", @@ -42,6 +43,12 @@ "ProblemMatcherSchema.severity": "캡처 문제에 대한 기본 심각도입니다. 패턴에서 심각도에 대한 일치 그룹을 정의하지 않은 경우에 사용됩니다.", "ProblemMatcherSchema.applyTo": "텍스트 문서에 복된 문제가 열린 문서, 닫힌 문서 또는 모든 문서에 적용되는지를 제어합니다.", "ProblemMatcherSchema.fileLocation": "문제 패턴에 보고된 파일 이름을 해석하는 방법을 정의합니다.", + "ProblemMatcherSchema.background": "백그라운드 작업에서 활성 상태인 matcher의 시작과 끝을 추적하는 패턴입니다.", + "ProblemMatcherSchema.background.activeOnStart": "true로 설정한 경우 작업이 시작되면 백그라운드 모니터가 활성 모드로 전환됩니다. 이는 beginPattern과 일치하는 줄을 실행하는 것과 같습니다.", + "ProblemMatcherSchema.background.beginsPattern": "출력이 일치하는 경우 백그라운드 작업을 시작할 때 신호를 받습니다.", + "ProblemMatcherSchema.background.endsPattern": "출력이 일치하는 경우 백그라운드 작업을 끝날 때 신호를 받습니다.", + "ProblemMatcherSchema.watching.deprecated": "조사 속성은 사용되지 않습니다. 백그라운드 속성을 대신 사용하세요.", + "ProblemMatcherSchema.watching": "조사 matcher의 시작과 끝을 추적하는 패턴입니다.", "ProblemMatcherSchema.watching.activeOnStart": "true로 설정한 경우 작업이 시작되면 선택기가 활성 모드로 전환됩니다. 이는 beginPattern과 일치하는 줄을 실행하는 것과 같습니다.", "ProblemMatcherSchema.watching.beginsPattern": "출력이 일치하는 경우 조사 작업을 시작할 때 신호를 받습니다.", "ProblemMatcherSchema.watching.endsPattern": "출력이 일치하는 경우 조사 작업을 끝날 때 신호를 받습니다.", diff --git a/i18n/kor/src/vs/platform/theme/common/colorRegistry.i18n.json b/i18n/kor/src/vs/platform/theme/common/colorRegistry.i18n.json index 4ff5446bc0358111fe710a21bc4db5d8c0867891..bae0d085ef9ca92aa268a9f50306802f627b7b7c 100644 --- a/i18n/kor/src/vs/platform/theme/common/colorRegistry.i18n.json +++ b/i18n/kor/src/vs/platform/theme/common/colorRegistry.i18n.json @@ -7,14 +7,24 @@ "invalid.color": "잘못된 색 형식입니다. #RGB, #RGBA, #RRGGBB 또는 #RRGGBBAA를 사용하세요.", "schema.colors": "워크벤치에서 사용되는 색입니다.", "foreground": "전체 전경색입니다. 이 색은 구성 요소에서 재정의하지 않은 경우에만 사용됩니다.", + "errorForeground": "오류 메시지에 대한 전체 전경색입니다. 이 색은 구성 요소에서 재정의하지 않은 경우에만 사용됩니다.", + "descriptionForeground": "레이블과 같이 추가 정보를 제공하는 설명 텍스트의 전경색입니다.", "focusBorder": "포커스가 있는 요소의 전체 테두리 색입니다. 이 색은 구성 요소에서 재정의하지 않은 경우에만 사용됩니다.", "contrastBorder": "더 뚜렷이 대비되도록 요소를 다른 요소와 구분하는 요소 주위의 추가 테두리입니다.", "activeContrastBorder": "더 뚜렷이 대비되도록 요소를 다른 요소와 구분하는 활성 요소 주위의 추가 테두리입니다.", + "textSeparatorForeground": "텍스트 구분자 색상입니다.", + "textLinkForeground": "텍스트 내 링크의 전경색입니다.", + "textLinkActiveForeground": "텍스트 내 활성 링크의 전경색입니다.", + "textPreformatForeground": "미리 서식이 지정된 텍스트 세그먼트의 전경색입니다.", + "textBlockQuoteBackground": "텍스트 내 블록 인용의 전경색입니다.", + "textBlockQuoteBorder": "텍스트 내 블록 인용의 테두리 색입니다.", + "textCodeBlockBackground": "텍스트 내 코드 블록의 전경색입니다.", "widgetShadow": "편집기 내에서 찾기/바꾸기 같은 위젯의 그림자 색입니다.", "inputBoxBackground": "입력 상자 배경입니다.", "inputBoxForeground": "입력 상자 전경입니다.", "inputBoxBorder": "입력 상자 테두리입니다.", "inputBoxActiveOptionBorder": "입력 필드에서 활성화된 옵션의 테두리 색입니다.", + "inputPlaceholderForeground": "위치 표시자 텍스트에 대한 입력 상자 전경색입니다.", "inputValidationInfoBackground": "정보 심각도의 입력 유효성 검사 배경색입니다.", "inputValidationInfoBorder": "정보 심각도의 입력 유효성 검사 테두리 색입니다.", "inputValidationWarningBackground": "정보 경고의 입력 유효성 검사 배경색입니다.", @@ -25,10 +35,13 @@ "dropdownForeground": "드롭다운 전경입니다.", "dropdownBorder": "드롭다운 테두리입니다.", "listFocusBackground": "목록/트리가 활성 상태인 경우 포커스가 있는 항목의 목록/트리 배경색입니다. 목록/트리가 활성 상태이면 키보드 포커스를 가지며, 비활성 상태이면 포커스가 없습니다.", + "listFocusForeground": "목록/트리가 활성 상태인 경우 포커스가 있는 항목의 목록/트리 전경색입니다. 목록/트리가 활성 상태이면 키보드 포커스를 가지며, 비활성 상태이면 포커스가 없습니다.", "listActiveSelectionBackground": "목록/트리가 활성 상태인 경우 선택한 항목의 목록/트리 배경색입니다. 목록/트리가 활성 상태이면 키보드 포커스를 가지며, 비활성 상태이면 포커스가 없습니다.", "listActiveSelectionForeground": "목록/트리가 활성 상태인 경우 선택한 항목의 목록/트리 전경색입니다. 목록/트리가 활성 상태이면 키보드 포커스를 가지며, 비활성 상태이면 포커스가 없습니다.", "listInactiveSelectionBackground": "목록/트리가 비활성 상태인 경우 선택한 항목의 목록/트리 배경색입니다. 목록/트리가 활성 상태이면 키보드 포커스를 가지며, 비활성 상태이면 포커스가 없습니다.", + "listInactiveSelectionForeground": "목록/트리가 비활성 상태인 경우 선택한 항목의 목록/트리 전경색입니다. 목록/트리가 활성 상태이면 키보드 포커스를 가지며, 비활성 상태이면 포커스가 없습니다.", "listHoverBackground": "마우스로 항목을 가리킬 때 목록/트리 배경입니다.", + "listHoverForeground": "마우스로 항목을 가리킬 때 목록/트리 전경입니다.", "listDropBackground": "마우스로 항목을 이동할 때 목록/트리 끌어서 놓기 배경입니다.", "highlight": "목록/트리 내에서 검색할 때 일치 항목 강조 표시의 목록/트리 전경색입니다.", "pickerGroupForeground": "그룹화 레이블에 대한 빠른 선택기 색입니다.", @@ -36,13 +49,17 @@ "buttonForeground": "단추 기본 전경색입니다.", "buttonBackground": "단추 배경색입니다.", "buttonHoverBackground": "마우스로 가리킬 때 단추 배경색입니다.", + "badgeBackground": "배지 배경색입니다. 배지는 검색 결과 수와 같은 소량의 정보 레이블입니다.", + "badgeForeground": "배지 전경색입니다. 배지는 검색 결과 수와 같은 소량의 정보 레이블입니다.", "scrollbarShadow": "스크롤되는 보기를 나타내는 스크롤 막대 그림자입니다.", "scrollbarSliderBackground": "슬라이더 배경색입니다.", "scrollbarSliderHoverBackground": "마우스로 가리킬 때 슬라이더 배경색입니다.", "scrollbarSliderActiveBackground": "활성 상태인 경우 슬라이더 배경색입니다.", + "progressBarBackground": "오래 실행 중인 작업에 대해 표시되는 진행률 표시 막대의 배경색입니다.", "editorBackground": "편집기 배경색입니다.", "editorForeground": "편집기 기본 전경색입니다.", "editorWidgetBackground": "찾기/바꾸기 같은 편집기 위젯의 배경색입니다.", + "editorWidgetBorder": "편집기 위젯의 테두리 색입니다. 위젯에 테두리가 있고 위젯이 색상을 무시하지 않을 때만 사용됩니다.", "editorSelection": "편집기 선택 영역의 색입니다.", "editorInactiveSelection": "비활성 편집기 선택 영역의 색입니다.", "editorSelectionHighlight": "선택 영역과 동일한 콘텐츠가 있는 영역의 색입니다.", @@ -56,5 +73,12 @@ "diffEditorInserted": "삽입된 텍스트의 배경색입니다.", "diffEditorRemoved": "제거된 텍스트의 배경색입니다.", "diffEditorInsertedOutline": "삽입된 텍스트의 윤곽선 색입니다.", - "diffEditorRemovedOutline": "제거된 텍스트의 윤곽선 색입니다." + "diffEditorRemovedOutline": "제거된 텍스트의 윤곽선 색입니다.", + "mergeCurrentHeaderBackground": "인라인 병합 충돌의 현재 헤더 배경입니다.", + "mergeCurrentContentBackground": "인라인 병합 충돌의 현재 콘텐츠 배경입니다.", + "mergeIncomingHeaderBackground": "인라인 병합 충돌에서 수신 헤더 배경입니다.", + "mergeIncomingContentBackground": "인라인 병합 충돌에서 수신 콘텐츠 배경입니다.", + "mergeBorder": "인라인 병합 충돌에서 헤더 및 스플리터의 테두리 색입니다.", + "overviewRulerCurrentContentForeground": "인라인 병합 충돌에서 현재 개요 눈금 전경색입니다.", + "overviewRulerIncomingContentForeground": "인라인 병합 충돌에서 수신 개요 눈금 전경색입니다." } \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/api/node/extHostTask.i18n.json b/i18n/kor/src/vs/workbench/api/node/extHostTask.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..4b90a12aaf247b4a1af0e887542958471d8df5e5 --- /dev/null +++ b/i18n/kor/src/vs/workbench/api/node/extHostTask.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "task.label": "{0}: {1}" +} \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/api/node/extHostTreeViews.i18n.json b/i18n/kor/src/vs/workbench/api/node/extHostTreeViews.i18n.json index 8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a..4dfa6a6e897b2345cb362e2a5dd9f07169480213 100644 --- a/i18n/kor/src/vs/workbench/api/node/extHostTreeViews.i18n.json +++ b/i18n/kor/src/vs/workbench/api/node/extHostTreeViews.i18n.json @@ -3,4 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. -{} \ No newline at end of file +{ + "treeView.notRegistered": "ID가 '{0}'인 등록된 트리 뷰가 없습니다.", + "treeItem.notFound": "ID가 '{0}'인 트리 항목을 찾을 수 없습니다.", + "treeView.duplicateElement": "{0} 요소가 이미 등록되어 있습니다." +} \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/browser/actions/configureLocale.i18n.json b/i18n/kor/src/vs/workbench/browser/actions/configureLocale.i18n.json index 724438134733212f64944480f45a7d435f536295..4623005568330f10d693a712c646a73d275e7d1e 100644 --- a/i18n/kor/src/vs/workbench/browser/actions/configureLocale.i18n.json +++ b/i18n/kor/src/vs/workbench/browser/actions/configureLocale.i18n.json @@ -7,6 +7,7 @@ "configureLocale": "언어 구성", "displayLanguage": "VSCode의 표시 언어를 정의합니다.", "doc": "지원되는 언어 목록은 {0} 을(를) 참조하세요.", + "restart": "값을 변경하려면 VSCode를 다시 시작해야 합니다.", "fail.createSettings": "'{0}'({1})을(를) 만들 수 없습니다.", "JsonSchema.locale": "사용할 UI 언어입니다." } \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/browser/parts/activitybar/activitybarPart.i18n.json b/i18n/kor/src/vs/workbench/browser/parts/activitybar/activitybarPart.i18n.json index 64445b492e09fb01bc041de24124922a30dce4ea..775ac0271857b6a47520276d87c2f5d0e00dcaba 100644 --- a/i18n/kor/src/vs/workbench/browser/parts/activitybar/activitybarPart.i18n.json +++ b/i18n/kor/src/vs/workbench/browser/parts/activitybar/activitybarPart.i18n.json @@ -5,5 +5,6 @@ // Do not edit this file. It is machine generated. { "hideActivitBar": "작업 막대 숨기기", - "activityBarAriaLabel": "활성 뷰 전환기" + "activityBarAriaLabel": "활성 뷰 전환기", + "globalActions": "전역 작업" } \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/browser/parts/editor/editorStatus.i18n.json b/i18n/kor/src/vs/workbench/browser/parts/editor/editorStatus.i18n.json index 8b7506a02d06a498786e30d2d8ee80758fd0b61b..0f9049de2aceac36b60747a5d9d3d852ce50a94c 100644 --- a/i18n/kor/src/vs/workbench/browser/parts/editor/editorStatus.i18n.json +++ b/i18n/kor/src/vs/workbench/browser/parts/editor/editorStatus.i18n.json @@ -10,7 +10,7 @@ "multiSelection": "{0} 선택 항목", "endOfLineLineFeed": "LF", "endOfLineCarriageReturnLineFeed": "CRLF", - "tabFocusModeEnabled": "Tab으로 포커스 이동", + "screenReaderDetectedExtra": "화면 읽기 프로그램을 사용하지 않는 경우 `editor.accessibilitySupport` 설정을 \"off\"로 변경하세요.", "disableTabMode": "접근성 모드 사용 안 함", "gotoLine": "줄 이동", "indentation": "들여쓰기", diff --git a/i18n/kor/src/vs/workbench/browser/parts/quickopen/quickopen.i18n.json b/i18n/kor/src/vs/workbench/browser/parts/quickopen/quickopen.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..8b1fffebc06a3f73d795f5b770592ec1be75f233 --- /dev/null +++ b/i18n/kor/src/vs/workbench/browser/parts/quickopen/quickopen.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "quickOpen": "파일로 이동...", + "quickNavigateNext": "Quick Open에서 다음 탐색", + "quickNavigatePrevious": "Quick Open에서 이전 탐색", + "quickSelectNext": "Quick Open에서 다음 선택", + "quickSelectPrevious": "Quick Open에서 이전 선택" +} \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/browser/quickopen.i18n.json b/i18n/kor/src/vs/workbench/browser/quickopen.i18n.json index 438739dc2828cf52e5f87b4424d031da0c77b43f..15bbb282f5256b91f319c1500c13f3d416ca486a 100644 --- a/i18n/kor/src/vs/workbench/browser/quickopen.i18n.json +++ b/i18n/kor/src/vs/workbench/browser/quickopen.i18n.json @@ -6,6 +6,5 @@ { "noResultsMatching": "일치하는 결과 없음", "noResultsFound2": "결과 없음", - "entryAriaLabel": "{0}, 명령", - "noCommands": "일치하는 명령 없음" + "entryAriaLabel": "{0}, 명령" } \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/browser/viewlet.i18n.json b/i18n/kor/src/vs/workbench/browser/viewlet.i18n.json index c5364af71848c3551ad9a0a3a65f9e9e880fbe2e..1b18c6972e499e2186edf419af16c09d74d60919 100644 --- a/i18n/kor/src/vs/workbench/browser/viewlet.i18n.json +++ b/i18n/kor/src/vs/workbench/browser/viewlet.i18n.json @@ -4,6 +4,5 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "collapse": "모두 축소", - "viewToolbarAriaLabel": "{0} 동작" + "collapse": "모두 축소" } \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/common/theme.i18n.json b/i18n/kor/src/vs/workbench/common/theme.i18n.json index ca6f547f854becffc52376b32e725504a8867f17..96c96b6d68740f8d7ac362c866afa9e41863d7be 100644 --- a/i18n/kor/src/vs/workbench/common/theme.i18n.json +++ b/i18n/kor/src/vs/workbench/common/theme.i18n.json @@ -7,11 +7,16 @@ "tabActiveBackground": "활성 탭 배경색입니다. 탭은 편집기 영역에서 편집기의 컨테이너입니다. 한 편집기 그룹에서 여러 탭을 열 수 있습니다. 여러 편집기 그룹이 있을 수 있습니다.", "tabInactiveBackground": "비활성 탭 배경색입니다. 탭은 편집기 영역에서 편집기의 컨테이너입니다. 한 편집기 그룹에서 여러 탭을 열 수 있습니다. 여러 편집기 그룹이 있을 수 있습니다.", "tabBorder": "탭을 서로 구분하기 위한 테두리입니다. 탭은 편집기 영역에서 편집기의 컨테이너입니다. 한 편집기 그룹에 여러 탭을 열 수 있습니다. 여러 편집기 그룹이 있을 수 있습니다.", - "tabActiveEditorGroupActiveForeground": "활성 그룹의 활성 탭 전경색입니다. 탭은 편집기 영역에서 편집기의 컨테이너입니다. 한 편집기 그룹에서 여러 탭을 열 수 있습니다. 여러 편집기 그룹이 있을 수 있습니다.", - "tabInactiveEditorGroupActiveForeground": "활성 그룹의 비활성 탭 전경색입니다. 탭은 편집기 영역에서 편집기의 컨테이너입니다. 한 편집기 그룹에서 여러 탭을 열 수 있습니다. 여러 편집기 그룹이 있을 수 있습니다.", + "tabActiveForeground": "활성 그룹의 활성 탭 전경색입니다. 탭은 편집기 영역에서 편집기의 컨테이너입니다. 한 편집기 그룹에서 여러 탭을 열 수 있습니다. 여러 편집기 그룹이 있을 수 있습니다.", + "tabInactiveForeground": "활성 그룹의 비활성 탭 전경색입니다. 탭은 편집기 영역에서 편집기의 컨테이너입니다. 한 편집기 그룹에서 여러 탭을 열 수 있습니다. 여러 편집기 그룹이 있을 수 있습니다.", + "tabUnfocusedActiveForeground": "비활성 그룹의 활성 탭 전경색입니다. 탭은 편집기 영역에서 편집기의 컨테이너입니다. 한 편집기 그룹에서 여러 탭을 열 수 있습니다. 여러 편집기 그룹이 있을 수 있습니다.", + "tabUnfocusedInactiveForeground": "비활성 그룹의 비활성 탭 전경색입니다. 탭은 편집기 영역에서 편집기의 컨테이너입니다. 한 편집기 그룹에서 여러 탭을 열 수 있습니다. 여러 편집기 그룹이 있을 수 있습니다.", "editorGroupBackground": "편집기 그룹의 배경색입니다. 편집기 그룹은 편집기의 컨테이너입니다. 배경색은 편집기 그룹을 끌 때 표시됩니다.", + "tabsContainerBackground": "탭을 사용도록 설정한 경우 편집기 그룹 제목 머리글의 배경색입니다. 편집기 그룹은 편집기의 컨테이너입니다.", + "tabsContainerBorder": "탭을 사용하도록 설정한 경우 편집기 그룹 제목 머리글의 테두리 색입니다. 편집기 그룹은 편집기의 컨테이너입니다.", "editorGroupHeaderBackground": "탭을 사용하지 않도록 설정한 경우 편집기 그룹 제목 머리글의 배경색입니다. 편집기 그룹은 편집기의 컨테이너입니다.", "editorGroupBorder": "여러 편집기 그룹을 서로 구분하기 위한 색입니다. 편집기 그룹은 편집기의 컨테이너입니다.", + "editorDragAndDropBackground": "편집기를 끌 때 배경색입니다. 편집기 내용이 계속 비추어 보이도록 이 색은 투명해야 합니다.", "panelBackground": "패널 배경색입니다. 패널은 편집기 영역 아래에 표시되며 출력 및 통합 터미널 같은 보기가 포함됩니다.", "panelBorder": "편집기와 구분되는 맨 위의 패널 테두리 색입니다. 패널은 편집기 영역 아래에 표시되며 출력 및 통합 터미널 같은 보기가 포함됩니다.", "panelActiveTitleForeground": "활성 패널의 제목 색입니다. 패널은 편집기 영역 아래에 표시되며 출력 및 통합 터미널 같은 보기가 포함됩니다.", @@ -19,18 +24,25 @@ "panelActiveTitleBorder": "활성 패널 제목의 테두리 색입니다. 패널은 편집기 영역 아래에 표시되며 출력 및 통합 터미널 같은 보기가 포함됩니다.", "statusBarForeground": "상태 표시줄 전경색입니다. 상태 표시줄은 창의 맨 아래에 표시됩니다.", "statusBarBackground": "표준 상태 표시줄 배경색입니다. 상태 표시줄은 창의 맨 아래에 표시됩니다.", + "statusBarBorder": "사이드바 및 편집기와 구분하는 상태 표시줄 테두리 색입니다. 상태 표시줄은 창의 맨 아래에 표시됩니다.", "statusBarNoFolderBackground": "폴더가 열리지 않았을 때의 상태 표시줄 배경색입니다. 상태 표시줄은 창의 맨 아래에 표시됩니다.", + "statusBarNoFolderForeground": "폴더가 열리지 않았을 때의 상태 표시줄 전경색입니다. 상태 표시줄은 창의 맨 아래에 표시됩니다.", "statusBarItemActiveBackground": "클릭할 때의 상태 표시줄 항목 배경색입니다. 상태 표시줄은 창의 맨 아래에 표시됩니다.", "statusBarItemHoverBackground": "마우스로 가리킬 때의 상태 표시줄 항목 배경색입니다. 상태 표시줄은 창의 맨 아래에 표시됩니다.", "statusBarProminentItemBackground": "상태 표시줄 주요 항목 배경색입니다. 주요 항목은 중요도를 나타내는 다른 상태 표시줄 항목보다 눈에 잘 띕니다. 상태 표시줄은 창의 맨 아래에 표시됩니다.", "statusBarProminentItemHoverBackground": "마우스로 가리킬 때의 상태 표시줄 주요 항목 배경색입니다. 주요 항목은 중요도를를 나타내는 다른 상태 표시줄 항목보다 눈에 잘 띕니다. 상태 표시줄은 창의 맨 아래에 표시됩니다.", "activityBarBackground": "작업 막대 배경색입니다. 작업 막대는 맨 왼쪽이나 오른쪽에 표시되며 사이드바의 뷰 간을 전환하는 데 사용할 수 있습니다.", "activityBarForeground": "작업 막대 전경 색(예: 아이콘에 사용됨)입니다. 작업 막대는 오른쪽이나 왼쪽 끝에 표시되며 사이드바의 보기 간을 전환할 수 있습니다.", + "activityBarBorder": "사이드바와 구분하는 작업 막대 테두리색입니다. 작업 막대는 오른쪽이나 왼쪽 끝에 표시되며 사이드바의 보기 간을 전환할 수 있습니다.", + "activityBarDragAndDropBackground": "작업 막대 항목의 끌어서 놓기 피드백 색입니다. 작업 막대 항목이 계속 비추어 보이도록 이 색은 투명해야 합니다. 작업 막대는 왼쪽이나 오른쪽 끝에 표시되며 사이드바의 보기를 전환할 수 있습니다.", "activityBarBadgeBackground": "활동 알림 배지 배경색입니다. 작업 막대는 왼쪽이나 오른쪽 끝에 표시되며 사이드바의 보기를 전환할 수 있습니다.", "activityBarBadgeForeground": "활동 알림 배지 전경색입니다. 작업 막대는 왼쪽이나 오른쪽 끝에 표시되며 사이드바의 보기를 전환할 수 있습니다.", "sideBarBackground": "사이드바 배경색입니다. 사이드바는 탐색기 및 검색과 같은 뷰의 컨테이너입니다.", + "sideBarForeground": "사이드바 전경색입니다. 사이드바는 탐색기 및 검색과 같은 뷰의 컨테이너입니다.", + "sideBarBorder": "편집기와 구분하는 측면의 사이드바 테두리 색입니다. 사이드바는 탐색기 및 검색과 같은 뷰의 컨테이너입니다.", "sideBarTitleForeground": "사이드바 제목 전경색입니다. 사이드바는 탐색기 및 검색과 같은 뷰의 컨테이너입니다.", "sideBarSectionHeaderBackground": "사이드바 섹션 헤더 배경색입니다. 사이드바는 탐색기 및 검색과 같은 뷰의 컨테이너입니다.", + "sideBarSectionHeaderForeground": "사이드바 섹션 헤더 전경색입니다. 사이드바는 탐색기 및 검색과 같은 뷰의 컨테이너입니다.", "titleBarActiveForeground": "창이 활성화된 경우의 제목 표시줄 전경입니다. 이 색은 현재 macOS에서만 지원됩니다.", "titleBarInactiveForeground": "창이 비활성화된 경우의 제목 표시줄 전경입니다. 이 색은 현재 macOS에서만 지원됩니다.", "titleBarActiveBackground": "창을 활성화할 때의 제목 표시줄 전경입니다. 이 색은 현재 macOS에서만 지원됩니다.", diff --git a/i18n/kor/src/vs/workbench/electron-browser/actions.i18n.json b/i18n/kor/src/vs/workbench/electron-browser/actions.i18n.json index dce95cceba857d7b3d62f6b36f92ea031a9d72df..f17d6eb1c6e9dba388440893c43eb708a3e542d7 100644 --- a/i18n/kor/src/vs/workbench/electron-browser/actions.i18n.json +++ b/i18n/kor/src/vs/workbench/electron-browser/actions.i18n.json @@ -6,9 +6,6 @@ { "closeActiveEditor": "편집기 닫기", "closeWindow": "창 닫기", - "switchWindow": "창 전환", - "switchWindowPlaceHolder": "창 선택", - "current": "현재 창", "closeFolder": "폴더 닫기", "noFolderOpened": "이 인스턴스에 현재 열려 있는 닫을 폴더가 없습니다.", "newWindow": "새 창", @@ -20,7 +17,7 @@ "zoomReset": "확대/축소 다시 설정", "appPerf": "시작 성능", "reloadWindow": "창 다시 로드", - "openRecent": "최근 파일 열기", + "current": "현재 창", "folders": "폴더", "files": "파일", "openRecentPlaceHolderMac": "경로 선택(새 창에서 열려면 Cmd 키를 길게 누름)", @@ -32,10 +29,6 @@ "openDocumentationUrl": "설명서", "openIntroductoryVideosUrl": "소개 비디오", "toggleSharedProcess": "공유 프로세스 설정/해제", - "navigateLeft": "뷰 왼쪽으로 이동", - "navigateRight": "뷰 오른쪽으로 이동", - "navigateUp": "뷰 위로 이동", - "navigateDown": "뷰 아래로 이동", "increaseViewSize": "현재 뷰 크기 늘리기", "decreaseViewSize": "현재 뷰 크기 줄이기" } \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/electron-browser/main.contribution.i18n.json b/i18n/kor/src/vs/workbench/electron-browser/main.contribution.i18n.json index 603999dbae9f462059e3f8ea215fb063e53254c8..2bb9dd4aa4808dae6c117e6ade9f3332ef0ce2de 100644 --- a/i18n/kor/src/vs/workbench/electron-browser/main.contribution.i18n.json +++ b/i18n/kor/src/vs/workbench/electron-browser/main.contribution.i18n.json @@ -7,6 +7,7 @@ "view": "보기", "help": "도움말", "file": "파일", + "developer": "개발자", "showEditorTabs": "열려 있는 편집기를 탭에서 표시할지 여부를 제어합니다.", "editorTabCloseButton": "편집기의 탭 닫기 단추의 위치를 제어하거나 'off'로 설정된 경우 이 단추를 사용하지 않도록 설정합니다.", "showIcons": "열린 편집기를 아이콘과 함께 표시할지 여부를 제어합니다. 이를 위해서는 아이콘 테마도 사용하도록 설정해야 합니다.", @@ -30,10 +31,6 @@ "window.openFoldersInNewWindow.off": "폴더가 마지막 활성 창을 바꿉니다.", "window.openFoldersInNewWindow.default": "폴더를 응용 프로그램 내에서 선택(예: 파일 메뉴를 통해)하는 경우를 제외하고 폴더가 새 창에서 열립니다.", "openFoldersInNewWindow": "폴더를 새 창에서 열지, 마지막 활성 창과 바꿀지를 제어합니다.\n- default: 응용 프로그램 내에서 [파일] 메뉴 등을 통해 폴더를 선택하는 경우를 제외하고, 폴더는 새 창에서 열립니다.\n- on: 폴더가 새 창에서 열립니다.\n- off: 폴더가 마지막 활성 창을 대체합니다\n이 설정이 무시되는 경우도 있을 수 있습니다(예: -new-window 또는 -reuse-window 명령줄 옵션을 사용할 경우).", - "window.reopenFolders.none": "폴더를 다시 열지 않습니다.", - "window.reopenFolders.one": "마지막 활성 폴더를 다시 엽니다.", - "window.reopenFolders.all": "마지막 세션의 모든 폴더를 다시 엽니다.", - "reopenFolders": "다시 시작한 이후에 폴더를 다시 여는 방법을 제어합니다. 폴더를 다시 열지 않으려면 'none'을 선택하고, 마지막으로 작업한 폴더를 다시 열려면 'one'을 선택하고, 마지막 세션의 모든 폴더를 다시 열려면 'all'을 선택합니다.", "restoreFullscreen": "창이 전체 화면 모드에서 종료된 경우 창을 전체 화면 모드로 복원할지 여부를 제어합니다.", "zoomLevel": "창의 확대/축소 수준을 조정합니다. 원래 크기는 0이고 각 상한 증분(예: 1) 또는 하한 증분(예: -1)은 20% 더 크거나 더 작게 확대/축소하는 것을 나타냅니다. 10진수를 입력하여 확대/축소 수준을 세부적으로 조정할 수도 있습니다.", "title": "활성 편집기를 기반으로 창 제목을 제어합니다. 변수는 컨텍스트를 기반으로 대체됩니다.\n${activeEditorShort}: 예: myFile.txt\n${activeEditorMedium}: 예: myFolder/myFile.txt\n${activeEditorLong}: 예: /Users/Development/myProject/myFolder/myFile.txt\n${rootName}: 예: myProject\n${rootPath}: 예: /Users/Development/myProject\n${appName}: 예: VS Code\n${dirty}: 활성 편집기가 더티인 경우 더티 표시기\n${separator}: 값이 있는 변수로 둘러싸인 경우에만 표시되는 조건부 구분 기호(\" - \")", @@ -41,11 +38,13 @@ "window.newWindowDimensions.inherit": "마지막 활성 창과 동일한 크기로 새 창을 엽니다.", "window.newWindowDimensions.maximized": "최대화된 새 창을 엽니다.", "window.newWindowDimensions.fullscreen": "전체 화면 모드에서 새 창을 엽니다.", + "newWindowDimensions": "하나 이상의 창이 이미 열려 있을 때 여는 새 새 창의 크기를 제어합니다. 기본적으로 새 창은 화면 가운데에 작은 크기로 열립니다. 'inherit'으로 설정할 경우 마지막 활성 창과 동일한 크기로 창이 열립니다. 'maximized'로 설정할 경우 창이 최대화되어 열리고 'fullscreen'으로 구성할 경우 전체 화면으로 열립니다. 이 설정은 여는 첫 번째 창에는 적용되지 않습니다. 첫 번째 창의 경우 항상 창을 닫기 전의 크기와 위치가 복원됩니다.", "window.menuBarVisibility.default": "메뉴가 전체 화면 모드에서만 숨겨집니다.", "window.menuBarVisibility.visible": "메뉴가 전체 화면 모드에서도 항상 표시됩니다.", "window.menuBarVisibility.toggle": "메뉴가 숨겨져 있지만 키를 통해 메뉴를 표시할 수 있습니다.", "window.menuBarVisibility.hidden": "메뉴가 항상 숨겨집니다.", "menuBarVisibility": "메뉴 모음의 표시 여부를 제어합니다. '설정/해제'를 설정함으로써 메뉴 모음이 숨겨지고 키를 누를 때마다 메뉴 모음이 표시됩니다. 기본값으로, 창이 전체 화면인 경우를 제외하고 메뉴 모음이 표시됩니다.", + "enableMenuBarMnemonics": "사용하도록 설정하는 경우 Alt 키 바로 가기를 통해 주 메뉴를 열 수 있습니다. 니모닉을 사용하지 않도록 설정하면 대신 이러한 Alt 키 바로 가기를 편집기 명령에 바인딩할 수 있습니다.", "autoDetectHighContrast": "사용하도록 설정한 경우 Windows에서 고대비 테마를 사용 중이면 고대비 테마로 자동으로 변경되고 Windows 고대비 테마를 해제하면 어두운 테마로 변경됩니다.", "titleBarStyle": "창 제목 표시줄의 모양을 조정합니다. 변경 내용을 적용하려면 전체 다시 시작해야 합니다.", "window.nativeTabs": "macOS Sierra 창 탭을 사용하도록 설정합니다. 변경\n 내용을 적용하려면 전체 다시 시작해야 하고, 기본 탭에서\n 사용자 지정 제목 표시줄 스타일(구성된 경우)을 비활성화합니다.", @@ -55,5 +54,7 @@ "zenMode.hideTabs": "Zen 모드를 켜면 워크벤치 탭도 숨길지를 제어합니다.", "zenMode.hideStatusBar": "Zen 모드를 켜면 워크벤치 하단에서 상태 표시줄도 숨길지를 제어합니다.", "zenMode.hideActivityBar": "Zen 모드를 켜면 워크벤치의 왼쪽에 있는 작업 막대도 숨길지\n 여부를 제어합니다.", - "zenMode.restore": "창이 Zen 모드에서 종료된 경우 Zen 모드로 복원할지 제어합니다." + "zenMode.restore": "창이 Zen 모드에서 종료된 경우 Zen 모드로 복원할지 제어합니다.", + "workspaceConfigurationTitle": "작업 영역", + "files.exclude.boolean": "파일 경로를 일치시킬 GLOB 패턴입니다. 패턴을 사용하거나 사용하지 않도록 설정하려면 true 또는 false로 설정하세요." } \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/electron-browser/workbench.i18n.json b/i18n/kor/src/vs/workbench/electron-browser/workbench.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..de8d40eec3b440014849d3c88bebfea415948bd7 --- /dev/null +++ b/i18n/kor/src/vs/workbench/electron-browser/workbench.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "developer": "개발자", + "file": "파일" +} \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/codeEditor/electron-browser/accessibility.i18n.json b/i18n/kor/src/vs/workbench/parts/codeEditor/electron-browser/accessibility.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..e7e010529e224e051493135c14eabffaa3afeddb --- /dev/null +++ b/i18n/kor/src/vs/workbench/parts/codeEditor/electron-browser/accessibility.i18n.json @@ -0,0 +1,26 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "emergencyConfOn": "이제 `editor.accessibilitySupport` 설정을 'on'으로 변경합니다.", + "openingDocs": "이제 VS Code 접근성 설명서 페이지를 엽니다.", + "introMsg": "VS Code의 접근성 옵션을 사용해 주셔서 감사합니다.", + "status": "상태:", + "changeConfigToOnMac": "화면 읽기 프로그램에서 사용에 영구적으로 최적화되도록 편집기를 구성하려면 지금 Command+E를 누르세요.", + "changeConfigToOnWinLinux": "화면 읽기 프로그램에서 사용에 영구적으로 최적화되도록 편집기를 구성하려면 지금 Command+E를 누르세요.", + "auto_unknown": "편집기는 플랫폼 API를 사용하여 화면 읽기 프로그램이 연결되는 시기를 검색하도록 구성되어 있지만 현재 런타임에서는 이 구성을 지원하지 않습니다.", + "auto_on": "편집기는 화면 읽기 프로그램이 연결되어 있음을 자동으로\n 검색했습니다.", + "auto_off": "편집기는 화면 편집기가 연결되는 시기를 자동으로 검색하도록 구성되어 있지만, 이 구성은 현재 지원되지 않습니다.", + "configuredOn": "편집기는 화면 읽기 프로그램에서 사용에 영구적으로 최적화되도록 편집기를 구성되어 있습니다. `editor.accessibilitySupport` 설정을 편집하여 이 구성을 변경할 수 있습니다.", + "configuredOff": "편집기는 화면 읽기 프로그램에서 사용에 최적화되지 않도록 구성되었습니다.", + "tabFocusModeOnMsg": "현재 편집기에서 키를 누르면 포커스가 다음 포커스 가능한 요소로 이동합니다. {0}을(를) 눌러서 이 동작을 설정/해제합니다.", + "tabFocusModeOnMsgNoKb": "현재 편집기에서 키를 누르면 포커스가 다음 포커스 가능한 요소로 이동합니다. {0} 명령은 현재 키 바인딩으로 트리거할 수 없습니다.", + "tabFocusModeOffMsg": "현재 편집기에서 키를 누르면 탭 문자가 삽입됩니다. {0}을(를) 눌러서 이 동작을 설정/해제합니다.", + "tabFocusModeOffMsgNoKb": "현재 편집기에서 키를 누르면 탭 문자가 삽입됩니다. {0} 명령은 현재 키 바인딩으로 트리거할 수 없습니다.", + "openDocMac": "브라우저 창에 접근성과 관련된 추가 VS Code 정보를 열려면 Command+H를 누르세요.", + "openDocWinLinux": "브라우저 창에 접근성과 관련된 추가 VS Code 정보를 열려면 지금 Control+H를 누르세요.", + "outroMsg": "이 도구 설명을 해제하고 Esc 키 또는 Shift+Esc를 눌러서 편집기로 돌아갈 수 있습니다.", + "ShowAccessibilityHelpAction": "접근성 도움말 표시" +} \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/codeEditor/electron-browser/inspectTMScopes.i18n.json b/i18n/kor/src/vs/workbench/parts/codeEditor/electron-browser/inspectTMScopes.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a --- /dev/null +++ b/i18n/kor/src/vs/workbench/parts/codeEditor/electron-browser/inspectTMScopes.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{} \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/codeEditor/electron-browser/toggleMultiCursorModifier.i18n.json b/i18n/kor/src/vs/workbench/parts/codeEditor/electron-browser/toggleMultiCursorModifier.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..4b0a0af7f76de402b454668039a7aa665707b7fe --- /dev/null +++ b/i18n/kor/src/vs/workbench/parts/codeEditor/electron-browser/toggleMultiCursorModifier.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "toggleLocation": "다중 커서 한정자 설정/해제" +} \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/debug/browser/debugActions.i18n.json b/i18n/kor/src/vs/workbench/parts/debug/browser/debugActions.i18n.json index 60f3a2078085db611980ab4ffc65282ebd334945..46ca3defb9b7e512f46f7f629122e2510cb1a37e 100644 --- a/i18n/kor/src/vs/workbench/parts/debug/browser/debugActions.i18n.json +++ b/i18n/kor/src/vs/workbench/parts/debug/browser/debugActions.i18n.json @@ -6,6 +6,7 @@ { "openLaunchJson": "{0} 열기", "launchJsonNeedsConfigurtion": "'launch.json' 구성 또는 수정", + "noFolderDebugConfig": "고급 디버그 구성을 수행하려면 먼저 폴더를 여세요.", "startDebug": "디버깅 시작", "startWithoutDebugging": "디버깅하지 않고 시작", "selectAndStartDebugging": "디버깅 선택 및 시작", diff --git a/i18n/kor/src/vs/workbench/parts/debug/electron-browser/debugCommands.i18n.json b/i18n/kor/src/vs/workbench/parts/debug/electron-browser/debugCommands.i18n.json index 8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a..9f3ccc2a869b8cd1e758ad38801efcff4eb0122b 100644 --- a/i18n/kor/src/vs/workbench/parts/debug/electron-browser/debugCommands.i18n.json +++ b/i18n/kor/src/vs/workbench/parts/debug/electron-browser/debugCommands.i18n.json @@ -3,4 +3,6 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. -{} \ No newline at end of file +{ + "noFolderDebugConfig": "고급 디버그 구성을 수행하려면 먼저 폴더를 여세요." +} \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/debug/electron-browser/debugService.i18n.json b/i18n/kor/src/vs/workbench/parts/debug/electron-browser/debugService.i18n.json index d56a0b492cd068f448a8921a0d0d9004a23d874b..a864dd07491c9b039239b2d4fabb18f145c0c9f7 100644 --- a/i18n/kor/src/vs/workbench/parts/debug/electron-browser/debugService.i18n.json +++ b/i18n/kor/src/vs/workbench/parts/debug/electron-browser/debugService.i18n.json @@ -5,8 +5,8 @@ // Do not edit this file. It is machine generated. { "snapshotObj": "이 개체에 대한 기본 값만 표시됩니다.", - "debuggingStarted": "디버그가 시작되었습니다.", "debuggingPaused": "디버그가 일시 중지되었습니다. 이유 {0}, {1} {2}", + "debuggingStarted": "디버그가 시작되었습니다.", "debuggingStopped": "디버그가 중지되었습니다.", "breakpointAdded": "파일 {1}, 줄 {0}에 중단점이 추가되었습니다.", "breakpointRemoved": "파일 {1}, 줄 {0}에서 중단점이 제거되었습니다.", diff --git a/i18n/kor/src/vs/workbench/parts/debug/electron-browser/debugViews.i18n.json b/i18n/kor/src/vs/workbench/parts/debug/electron-browser/debugViews.i18n.json index c9ed1bd1f227c077abde11ac6ccb3c7932b4a50b..b890a7946e25d6f09a404948905c923eb93cf14a 100644 --- a/i18n/kor/src/vs/workbench/parts/debug/electron-browser/debugViews.i18n.json +++ b/i18n/kor/src/vs/workbench/parts/debug/electron-browser/debugViews.i18n.json @@ -5,16 +5,12 @@ // Do not edit this file. It is machine generated. { "variablesSection": "변수 섹션", - "variables": "변수", "variablesAriaTreeLabel": "변수 디버그", "expressionsSection": "식 섹션", - "watch": "조사식", "watchAriaTreeLabel": "조사식 디버그", "callstackSection": "호출 스택 섹션", "debugStopped": "{0}에서 일시 중지됨", - "callStack": "호출 스택", "callStackAriaLabel": "호출 스택 디버그", "breakpointsSection": "중단점 섹션", - "breakpoints": "중단점", "breakpointsAriaTreeLabel": "중단점 디버그" } \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/debug/electron-browser/electronDebugActions.i18n.json b/i18n/kor/src/vs/workbench/parts/debug/electron-browser/electronDebugActions.i18n.json index 889e2264a0182f634906c4942f2a6ddfcbcdf3cc..0477024ab5d4455fa4767879568a4627a569f289 100644 --- a/i18n/kor/src/vs/workbench/parts/debug/electron-browser/electronDebugActions.i18n.json +++ b/i18n/kor/src/vs/workbench/parts/debug/electron-browser/electronDebugActions.i18n.json @@ -6,5 +6,6 @@ { "copyValue": "값 복사", "copy": "복사", + "copyAll": "모두 복사", "copyStackTrace": "호출 스택 복사" } \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/debug/electron-browser/statusbarColorProvider.i18n.json b/i18n/kor/src/vs/workbench/parts/debug/electron-browser/statusbarColorProvider.i18n.json index fa9a8cbb690ab92a015fb588d380a3227a709a90..6de8809b45e61af1d63e0b627e3919cb0487d957 100644 --- a/i18n/kor/src/vs/workbench/parts/debug/electron-browser/statusbarColorProvider.i18n.json +++ b/i18n/kor/src/vs/workbench/parts/debug/electron-browser/statusbarColorProvider.i18n.json @@ -4,5 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "statusBarDebuggingBackground": "프로그램이 디버그될 때의 상태 표시줄 배경색입니다. 상태 표시줄은 창의 맨 아래에 표시됩니다." + "statusBarDebuggingBackground": "프로그램이 디버그될 때의 상태 표시줄 배경색입니다. 상태 표시줄은 창의 맨 아래에 표시됩니다.", + "statusBarDebuggingForeground": "프로그램이 디버그될 때의 상태 표시줄 전경색입니다. 상태 표시줄은 창의 맨 아래에 표시됩니다." } \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json b/i18n/kor/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json index fb59d091ab99e155d49d3f450fffd9a514479c9b..6be8b2345dfb03f9ec19f4f24e069d2cd92e1fe5 100644 --- a/i18n/kor/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json +++ b/i18n/kor/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json @@ -7,6 +7,7 @@ "debugAdapterBinNotFound": "디버그 어댑터 실행 파일 '{0}'이(가) 없습니다.", "debugAdapterCannotDetermineExecutable": "디버그 어댑터 '{0}'에 대한 실행 파일을 확인할 수 없습니다.", "debugType": "구성의 형식입니다.", + "debugTypeNotRecognised": "디버그 형식이 인식되지 않습니다. 해당하는 디버그 확장을 설치하고 사용하도록 설정했는지 확인하세요.", "node2NotSupported": "\"node2\"는 더 이상 지원되지 않습니다. 대신 \"node\"를 사용하고 \"protocol\" 특성을 \"inspector\"로 설정하세요.", "debugName": "구성 이름이며, 구성 시작 드롭다운 메뉴에 표시됩니다.", "debugRequest": "구성 형식을 요청합니다. \"시작\" 또는 \"연결\"일 수 있습니다.", diff --git a/i18n/kor/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json b/i18n/kor/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json index 739aa4ea5378af5fa11e497030afda0c02c89fde..12f82e199c95aad98bbd415b6bc4995b0f5126a0 100644 --- a/i18n/kor/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json +++ b/i18n/kor/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json @@ -4,6 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "previousEditPoint": "Emmet: 이전 편집 점", - "nextEditPoint": "Emmet: 다음 편집 점" + "previousEditPoint": "Emmet: 이전 편집 점으로 이동", + "nextEditPoint": "Emmet: 다음 편집 점으로 이동" } \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json b/i18n/kor/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json index b4ba4df288c3d4a4a9147916645bf084c7d61173..5b243d9a2c538c688980277169876738b0ed50ee 100644 --- a/i18n/kor/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json +++ b/i18n/kor/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json @@ -9,5 +9,6 @@ "emmetPreferences": "Emmet의 일부 작업 및 해결 프로그램의 동작을 수정하는 데 사용되는 기본 설정입니다.", "emmetSyntaxProfiles": "지정된 구문에 대한 프로필을 정의하거나 특정 규칙이 포함된 고유한 프로필을 사용하세요.", "emmetExclude": "Emmet 약어를 확장하면 안 되는 언어의 배열입니다.", - "emmetExtensionsPath": "Emmet 프로필, 코드 조각 및 기본 설정이 포함된 폴더의 경로" + "emmetExtensionsPath": "Emmet 프로필, 코드 조각 및 기본 설정이 포함된 폴더의 경로", + "useNewEmmet": "모든 emmet 기능에 대해 새 emmet 모듈을 사용해 보세요(이전 단일 emmet 라이브러리를 대체함)." } \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/extensions/browser/extensionEditor.i18n.json b/i18n/kor/src/vs/workbench/parts/extensions/browser/extensionEditor.i18n.json index e290352a80156c32aa19ec55338c999e8d225c3b..4600edbe9fd578c8221e834878f31c5da10f0f7e 100644 --- a/i18n/kor/src/vs/workbench/parts/extensions/browser/extensionEditor.i18n.json +++ b/i18n/kor/src/vs/workbench/parts/extensions/browser/extensionEditor.i18n.json @@ -24,6 +24,10 @@ "default": "기본값", "debuggers": "디버거({0})", "debugger name": "이름", + "views": "뷰({0})", + "view id": "ID", + "view name": "이름", + "view location": "위치", "themes": "테마({0})", "JSON Validation": "JSON 유효성 검사({0})", "commands": "명령({0})", diff --git a/i18n/kor/src/vs/workbench/parts/extensions/browser/extensionsActions.i18n.json b/i18n/kor/src/vs/workbench/parts/extensions/browser/extensionsActions.i18n.json index 02f4f0241769c842d09eec0f9823b352fe4efa3f..748fbd6e5f8c01227daf8ce913e8569c6cd7e51d 100644 --- a/i18n/kor/src/vs/workbench/parts/extensions/browser/extensionsActions.i18n.json +++ b/i18n/kor/src/vs/workbench/parts/extensions/browser/extensionsActions.i18n.json @@ -22,6 +22,8 @@ "disableGloballyAction": "항상", "disableAction": "사용 안 함", "checkForUpdates": "업데이트 확인", + "enableAutoUpdate": "확장 자동 업데이트 사용", + "disableAutoUpdate": "확장 자동 업데이트 사용 안 함", "updateAll": "모든 확장 업데이트", "reloadAction": "다시 로드", "postUpdateTooltip": "업데이트하려면 다시 로드", @@ -44,6 +46,8 @@ "showWorkspaceRecommendedExtensions": "작업 영역 권장 확장 표시", "showRecommendedKeymapExtensions": "권장되는 키 맵 표시", "showRecommendedKeymapExtensionsShort": "키 맵", + "showLanguageExtensions": "언어 확장 표시", + "showLanguageExtensionsShort": "언어 확장", "configureWorkspaceRecommendedExtensions": "권장 확장 구성(작업 영역)", "ConfigureWorkspaceRecommendations.noWorkspace": "권장 사항은 작업 영역 폴더에서만 사용할 수 있습니다.", "OpenExtensionsFile.failed": "'.vscode' 폴더({0}) 내에 'extensions.json' 파일을 만들 수 없습니다.", @@ -51,5 +55,8 @@ "disableAll": "설치된 모든 확장 사용 안 함", "disableAllWorkspace": "이 작업 영역에 대해 설치된 모든 확장 사용 안 함", "enableAll": "설치된 모든 확장 사용", - "enableAllWorkspace": "이 작업 영역에 대해 설치된 모든 확장 사용" + "enableAllWorkspace": "이 작업 영역에 대해 설치된 모든 확장 사용", + "extensionButtonProminentBackground": "눈에 잘 띄는 작업 확장의 단추 배경색입니다(예: 설치 단추).", + "extensionButtonProminentForeground": "눈에 잘 띄는 작업 확장의 단추 전경색입니다(예: 설치 단추).", + "extensionButtonProminentHoverBackground": "눈에 잘 띄는 작업 확장의 단추 배경 커서 올리기 색입니다(예: 설치 단추)." } \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.i18n.json b/i18n/kor/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.i18n.json index 84dc72bd8eb1c2dca89bf7c1f6691fa075ed5497..3e7d2bd101a83a2b3127247d5e0dee848d7d0d1d 100644 --- a/i18n/kor/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.i18n.json +++ b/i18n/kor/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.i18n.json @@ -9,6 +9,8 @@ "neverShowAgain": "다시 표시 안 함", "close": "닫기", "workspaceRecommended": "이 작업 영역에 확장 권장 사항이 있습니다.", + "ignoreExtensionRecommendations": "확장 권장 사항을 모두 무시하시겠습니까?", + "ignoreAll": "예, 모두 무시", "no": "아니요", "cancel": "취소" } \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.i18n.json b/i18n/kor/src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.i18n.json index 467a41c361ac489338cf22be4e61be5d5515c362..ef99dee28ef1eadfdee33c301eca0c531c67fb84 100644 --- a/i18n/kor/src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.i18n.json +++ b/i18n/kor/src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.i18n.json @@ -10,5 +10,6 @@ "extensions": "확장", "view": "보기", "extensionsConfigurationTitle": "확장", - "extensionsAutoUpdate": "자동으로 확장 업데이트" + "extensionsAutoUpdate": "자동으로 확장 업데이트", + "extensionsIgnoreRecommendations": "확장 권장 사항 무시" } \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json b/i18n/kor/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json index 8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a..f2a02a3a9f95aa21cef23a7d6288d12c262e61e5 100644 --- a/i18n/kor/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json +++ b/i18n/kor/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json @@ -3,4 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. -{} \ No newline at end of file +{ + "disableOtherKeymapsConfirmation": "키 바인딩 간 충돌을 피하기 위해 다른 키 맵({0})을 사용하지 않도록 설정할까요?", + "yes": "예", + "no": "아니요", + "betterMergeDisabled": "Better Merge 확장이 이제 빌드되었습니다. 설치된 확장은 사용하지 않도록 설정되었으며 제거할 수 있습니다.", + "uninstall": "제거", + "later": "나중에" +} \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/files/browser/files.contribution.i18n.json b/i18n/kor/src/vs/workbench/parts/files/browser/files.contribution.i18n.json index f9b799b1655ec4b25095edf067e0d6657e8c52bd..6ad22dfdfbc755fac74e0bc1b43d2c889ee6ea36 100644 --- a/i18n/kor/src/vs/workbench/parts/files/browser/files.contribution.i18n.json +++ b/i18n/kor/src/vs/workbench/parts/files/browser/files.contribution.i18n.json @@ -16,7 +16,7 @@ "associations": "파일과 언어의 연결을 구성하세요(예: \"*.extension\": \"html\"). 이러한 구성은 설치된 언어의 기본 연결보다 우선 순위가 높습니다.", "encoding": "파일을 읽고 쓸 때 사용할 기본 문자 집합 인코딩입니다.", "autoGuessEncoding": "사용하도록 설정하는 경우 파일을 열 때 문자 집합 인코딩을 추측합니다.", - "eol": "줄 바꿈 문자의 기본 끝입니다.", + "eol": "줄 바꿈 문자의 기본 끝입니다. LF에는 \\n, CRLF에는 \\r\\n을 사용하세요.", "trimTrailingWhitespace": "사용하도록 설정되면 파일을 저장할 때 후행 공백이 잘립니다.", "insertFinalNewline": "사용하도록 설정되면 저장할 때 파일 끝에 마지막 줄바꿈을 삽입합니다.", "files.autoSave.off": "더티 파일이 자동으로 저장되지 않습니다.", @@ -27,6 +27,7 @@ "autoSaveDelay": "더티 파일을 자동으로 저장할 때까지의 지연(밀리초)을 제어합니다. 'files.autoSave'를 '{0}'(으)로 설정한 경우에만 적용됩니다.", "watcherExclude": "파일 감시에서 제외할 파일 경로의 GLOB 패턴을 구성하세요. 이 설정을 변경하려면 다시 시작해야 합니다. 시작 시 Code에서 CPU 시간을 많이 차지하면 대용량 폴더를 제외하여 초기 로드를 줄일 수 있습니다.", "hotExit.off": "핫 종료를 사용하지 않습니다.", + "hotExit.onExit": "핫 종료는 응용 프로그램을 닫을 때 트리거됩니다. 즉 Windows/Linux에서 마지막 창을 닫을 때나 workbench.action.quit 명령이 트리거될 때(명령 팔레트, 키 바인딩, 메뉴)입니다. 다음 실행 시 백업을 포함한 모든 창이 복원됩니다.", "hotExit": "저장하지 않은 파일을 세션 간에 기억하여, 편집기를 종료할 때 저장할지 묻는 메시지를 건너뛸지 여부를 제어합니다.", "defaultLanguage": "새 파일에 할당되는 기본 언어 모드입니다.", "editorConfigurationTitle": "편집기", diff --git a/i18n/kor/src/vs/workbench/parts/files/browser/views/emptyView.i18n.json b/i18n/kor/src/vs/workbench/parts/files/browser/views/emptyView.i18n.json index 3aeececa62a3be90f8cfee6fdfdb3d53f0faac8c..d5e1244f535ad89748a9bd70ba9d70dd9e749ad0 100644 --- a/i18n/kor/src/vs/workbench/parts/files/browser/views/emptyView.i18n.json +++ b/i18n/kor/src/vs/workbench/parts/files/browser/views/emptyView.i18n.json @@ -5,7 +5,5 @@ // Do not edit this file. It is machine generated. { "explorerSection": "파일 탐색기 섹션", - "noWorkspace": "열린 폴더 없음", - "noWorkspaceHelp": "아직 폴더를 열지 않았습니다.", "openFolder": "폴더 열기" } \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/files/browser/views/openEditorsView.i18n.json b/i18n/kor/src/vs/workbench/parts/files/browser/views/openEditorsView.i18n.json index a820c30095af7b1a40efd7b7c49519dcefcaaac3..cb51b565b3155cf38b5d6e8860f8b66d5e5fc7bf 100644 --- a/i18n/kor/src/vs/workbench/parts/files/browser/views/openEditorsView.i18n.json +++ b/i18n/kor/src/vs/workbench/parts/files/browser/views/openEditorsView.i18n.json @@ -4,8 +4,8 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "openEditosrSection": "열려 있는 편집기 섹션", "openEditors": "열려 있는 편집기", + "openEditosrSection": "열려 있는 편집기 섹션", "treeAriaLabel": "열린 편집기: 활성 파일 목록", "dirtyCounter": "{0}이(가) 저장되지 않음" } \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json b/i18n/kor/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json index 4b931297269d4b665ae8e15013798e4ed246a5c3..3eaa6c8350957eefb312762914006dc2aa3bcc29 100644 --- a/i18n/kor/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json +++ b/i18n/kor/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json @@ -5,5 +5,11 @@ // Do not edit this file. It is machine generated. { "slow": "느린 시작 감지됨", - "slow.detail": "방금 느리게 시작되었습니다. 프로파일링을 사용하도록 설정한 상태로 '{0}'을(를) 다시 시작하세요. 프로필을 공유해 주시면 다시 빠르게 시작될 수 있도록 최선을 다하겠습니다." + "slow.detail": "방금 느리게 시작되었습니다. 프로파일링을 사용하도록 설정한 상태로 '{0}'을(를) 다시 시작하세요. 프로필을 공유해 주시면 다시 빠르게 시작될 수 있도록 최선을 다하겠습니다.", + "prof.message": "프로필을 만들었습니다.", + "prof.detail": "문제를 발생시키고 다음 파일을 수동으로 첨부하세요.\n{0}", + "prof.restartAndFileIssue": "문제 만들기 및 다시 시작", + "prof.restart": "다시 시작", + "prof.thanks": "도움을 주셔서 감사합니다.", + "prof.detail.restart": "계속 '{0}'을(를) 사용하려면 마지막으로 다시 시작해야 합니다. 기여해 주셔서 다시 한번 감사드립니다." } \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/preferences/browser/keybindingsEditorContribution.i18n.json b/i18n/kor/src/vs/workbench/parts/preferences/browser/keybindingsEditorContribution.i18n.json index d03c1ba3ba27c3aca9a21078f3f9a9b330486df6..aa4e75fa0bcbe52691ff3c64c8c9c354e92a5518 100644 --- a/i18n/kor/src/vs/workbench/parts/preferences/browser/keybindingsEditorContribution.i18n.json +++ b/i18n/kor/src/vs/workbench/parts/preferences/browser/keybindingsEditorContribution.i18n.json @@ -5,6 +5,7 @@ // Do not edit this file. It is machine generated. { "defineKeybinding.start": "키 바인딩 정의", - "defineKeybinding.kbLayoutInfoMessage": "현재 자판 배열의 경우 다음을 누르세요.", - "defineKeybinding.kbLayoutErrorMessage": "현재 자판 배열에서는 이 키 조합을 생성할 수 없습니다." + "defineKeybinding.kbLayoutErrorMessage": "현재 자판 배열에서는 이 키 조합을 생성할 수 없습니다.", + "defineKeybinding.kbLayoutLocalAndUSMessage": "현재 자판 배열의 경우 **{0}**입니다(**{1}**: 미국 표준).", + "defineKeybinding.kbLayoutLocalMessage": "현재 자판 배열의 경우 **{0}**입니다." } \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/preferences/browser/preferencesRenderers.i18n.json b/i18n/kor/src/vs/workbench/parts/preferences/browser/preferencesRenderers.i18n.json index 353737131fc4a876cb3879edad615c35bc1d2dea..473165389206cf07db296305ee9f5de61a329e9f 100644 --- a/i18n/kor/src/vs/workbench/parts/preferences/browser/preferencesRenderers.i18n.json +++ b/i18n/kor/src/vs/workbench/parts/preferences/browser/preferencesRenderers.i18n.json @@ -4,6 +4,7 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "errorInvalidConfiguration": "설정에 쓸 수 없습니다. 파일에서 오류/경고를 해결하고 다시 시도하세요.", "editTtile": "편집", "replaceDefaultValue": "설정에서 바꾸기", "copyDefaultValue": "설정에 복사", diff --git a/i18n/kor/src/vs/workbench/parts/quickopen/browser/commandsHandler.i18n.json b/i18n/kor/src/vs/workbench/parts/quickopen/browser/commandsHandler.i18n.json index dec2d486f02f9dd72898debfe9d4fbb265c4e8de..d410308122c676a04b8741ffc8a7662a19844fa2 100644 --- a/i18n/kor/src/vs/workbench/parts/quickopen/browser/commandsHandler.i18n.json +++ b/i18n/kor/src/vs/workbench/parts/quickopen/browser/commandsHandler.i18n.json @@ -5,6 +5,7 @@ // Do not edit this file. It is machine generated. { "showTriggerActions": "모든 명령 표시", + "showCommands.label": "명령 팔레트...", "entryAriaLabelWithKey": "{0}, {1}, 명령", "entryAriaLabel": "{0}, 명령", "canNotRun": "'{0}' 명령은 여기에서 실행할 수 없습니다.", diff --git a/i18n/kor/src/vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.i18n.json b/i18n/kor/src/vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..f1cc0233f255c9414f4c376e1ee44de57bf54b17 --- /dev/null +++ b/i18n/kor/src/vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "relaunchMessage": "설정이 변경되어 다시 시작해야만 적용됩니다.", + "relaunchDetail": "[다시 시작] 단추를 눌러 {0}을(를) 다시 시작하고 설정을 사용하도록 설정하세요.", + "restart": "다시 시작" +} \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.i18n.json b/i18n/kor/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..984555805217c571faeb954229b51502871acf99 --- /dev/null +++ b/i18n/kor/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "editorGutterModifiedBackground": "수정된 줄의 편집기 여백 배경색입니다.", + "editorGutterAddedBackground": "추가된 줄의 편집기 여백 배경색입니다.", + "editorGutterDeletedBackground": "삭제된 줄의 편집기 여백 배경색입니다." +} \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/scm/electron-browser/scm.contribution.i18n.json b/i18n/kor/src/vs/workbench/parts/scm/electron-browser/scm.contribution.i18n.json index 4b848835e917596b00ac1d10a906244611a01da8..791c967182aa4669eb4ea2d2e90d8015e9be4fb2 100644 --- a/i18n/kor/src/vs/workbench/parts/scm/electron-browser/scm.contribution.i18n.json +++ b/i18n/kor/src/vs/workbench/parts/scm/electron-browser/scm.contribution.i18n.json @@ -5,6 +5,7 @@ // Do not edit this file. It is machine generated. { "toggleGitViewlet": "Git 표시", + "installAdditionalSCMProviders": "추가 SCM 공급자 설치...", "source control": "소스 제어", "toggleSCMViewlet": "SCM 표시", "view": "보기" diff --git a/i18n/kor/src/vs/workbench/parts/scm/electron-browser/scmMenus.i18n.json b/i18n/kor/src/vs/workbench/parts/scm/electron-browser/scmMenus.i18n.json index 550a8745b89fa51ce4c14aa0629237b340ca8038..2910b5c28ea4699bdf42c29a32654947cb123162 100644 --- a/i18n/kor/src/vs/workbench/parts/scm/electron-browser/scmMenus.i18n.json +++ b/i18n/kor/src/vs/workbench/parts/scm/electron-browser/scmMenus.i18n.json @@ -4,5 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "installAdditionalSCMProviders": "추가 SCM 공급자 설치...", "switch provider": "SCM 공급자 전환..." } \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json b/i18n/kor/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json index 5346ff5c5cf9c5fe973ac73ac77eee7aa2302920..4d21f25e146300f8b406b2915191ba0751c1a47f 100644 --- a/i18n/kor/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json +++ b/i18n/kor/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json @@ -6,5 +6,7 @@ { "searchMatches": "일치하는 {0}개 항목을 찾음", "searchMatch": "일치하는 {0}개 항목을 찾음", - "fileMatchAriaLabel": "{2} 폴더의 {1} 파일에 {0}개의 일치 항목이 있음, 검색 결과" + "fileMatchAriaLabel": "{2} 폴더의 {1} 파일에 {0}개의 일치 항목이 있음, 검색 결과", + "replacePreviewResultAria": "{3} 텍스트가 있는 줄의 열 위치 {2}에서 용어 {0}을(를) {1}(으)로 바꾸기", + "searchResultAria": "{2} 텍스트가 있는 줄의 열 위치 {1}에서 {0} 용어 찾기" } \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/snippets/electron-browser/TMSnippets.i18n.json b/i18n/kor/src/vs/workbench/parts/snippets/electron-browser/TMSnippets.i18n.json index 65bffc51443178bb980aaaacc01607e15f62e471..c9ce2ccb5f32a19d65968604dbba1a387e2c36e0 100644 --- a/i18n/kor/src/vs/workbench/parts/snippets/electron-browser/TMSnippets.i18n.json +++ b/i18n/kor/src/vs/workbench/parts/snippets/electron-browser/TMSnippets.i18n.json @@ -9,5 +9,6 @@ "vscode.extension.contributes.snippets-path": "코드 조각 파일의 경로입니다. 이 경로는 확장 폴더의 상대 경로이며 일반적으로 './snippets/'로 시작합니다.", "invalid.language": "`contributes.{0}.language`에 알 수 없는 언어가 있습니다. 제공된 값: {1}", "invalid.path.0": "`contributes.{0}.path`에 문자열이 필요합니다. 제공된 값: {1}", - "invalid.path.1": "확장 폴더({2})에 포함할 `contributes.{0}.path`({1})가 필요합니다. 확장이 이식 불가능해질 수 있습니다." + "invalid.path.1": "확장 폴더({2})에 포함할 `contributes.{0}.path`({1})가 필요합니다. 확장이 이식 불가능해질 수 있습니다.", + "badVariableUse": "\"{0}\"-snippet은 snippet-variables 및 snippet-placeholders와 혼동하기 쉽습니다. 자세한 내용은\n https://code.visualstudio.com/docs/editor/userdefinedsnippets#_snippet-syntax를 참조하세요." } \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/snippets/electron-browser/snippets.contribution.i18n.json b/i18n/kor/src/vs/workbench/parts/snippets/electron-browser/snippets.contribution.i18n.json index 8705a3ff40b1b106ac41ef203a1b84e6799e5cad..c2a063232029bdfa6f8ffe04c715fa0f3e547d85 100644 --- a/i18n/kor/src/vs/workbench/parts/snippets/electron-browser/snippets.contribution.i18n.json +++ b/i18n/kor/src/vs/workbench/parts/snippets/electron-browser/snippets.contribution.i18n.json @@ -11,6 +11,6 @@ "snippetSchema.json.default": "빈 코드 조각", "snippetSchema.json": "사용자 코드 조각 구성", "snippetSchema.json.prefix": "IntelliSense에서 코드 조각을 선택할 때 사용할 접두사입니다.", - "snippetSchema.json.body": "코드 조각 콘텐츠입니다. '${id}', '${id:label}', '${1:label}'을 변수에 사용하고 '$0', '$1'을 커서 위치에 사용하세요.", + "snippetSchema.json.body": "코드 조각 콘텐츠입니다. '$1', '${1:defaultText}'를 사용하여 커서 위치를 정의하고, '$0'을 최종 커서 위치에 사용하세요. '${varName}' 및 '${varName:defaultText}'에 변수 값을 삽입하세요(예: '$TM_FILENAME 파일입니다').", "snippetSchema.json.description": "코드 조각 설명입니다." } \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/surveys/electron-browser/languageSurveys.contribution.i18n.json b/i18n/kor/src/vs/workbench/parts/surveys/electron-browser/languageSurveys.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..4685b4310b01ed3415db393720d81661d2a4564a --- /dev/null +++ b/i18n/kor/src/vs/workbench/parts/surveys/electron-browser/languageSurveys.contribution.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "helpUs": "{0}에 대한 지원을 개선하는 데 도움을 주세요.", + "takeShortSurvey": "간단한 설문 조사 참여", + "remindLater": "나중에 알림", + "neverAgain": "다시 표시 안 함" +} \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/surveys/electron-browser/nps.contribution.i18n.json b/i18n/kor/src/vs/workbench/parts/surveys/electron-browser/nps.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..9cc54c77a3c23fa2c7d864de1ffd9ce8480e3262 --- /dev/null +++ b/i18n/kor/src/vs/workbench/parts/surveys/electron-browser/nps.contribution.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "surveyQuestion": "간단한 피드백 설문 조사에 참여하시겠어요?", + "takeSurvey": "설문 조사 참여", + "remindLater": "나중에 알림", + "neverAgain": "다시 표시 안 함" +} \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/tasks/browser/buildQuickOpen.i18n.json b/i18n/kor/src/vs/workbench/parts/tasks/browser/buildQuickOpen.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..1f6208b0c919def40eb13da89e472b59dfa54a28 --- /dev/null +++ b/i18n/kor/src/vs/workbench/parts/tasks/browser/buildQuickOpen.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "noTasksMatching": "일치하는 작업 없음" +} \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/tasks/browser/quickOpen.i18n.json b/i18n/kor/src/vs/workbench/parts/tasks/browser/quickOpen.i18n.json index 2d6bac5e8cbaa79a14fc08162cb49169fbd5553f..2847a251263170b085b898ac80b0fc1d4cc86e32 100644 --- a/i18n/kor/src/vs/workbench/parts/tasks/browser/quickOpen.i18n.json +++ b/i18n/kor/src/vs/workbench/parts/tasks/browser/quickOpen.i18n.json @@ -4,5 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "entryAriaLabel": "{0}, 작업" + "entryAriaLabel": "{0}, 작업", + "customizeTask": "작업 사용자 지정" } \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/tasks/browser/testQuickOpen.i18n.json b/i18n/kor/src/vs/workbench/parts/tasks/browser/testQuickOpen.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..1f6208b0c919def40eb13da89e472b59dfa54a28 --- /dev/null +++ b/i18n/kor/src/vs/workbench/parts/tasks/browser/testQuickOpen.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "noTasksMatching": "일치하는 작업 없음" +} \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/tasks/common/taskConfiguration.i18n.json b/i18n/kor/src/vs/workbench/parts/tasks/common/taskConfiguration.i18n.json index cf0d425f7fd7e71d0319f249ee363a30a4bc1c6e..aa72080ed625c4610577c368daa382145fd31d36 100644 --- a/i18n/kor/src/vs/workbench/parts/tasks/common/taskConfiguration.i18n.json +++ b/i18n/kor/src/vs/workbench/parts/tasks/common/taskConfiguration.i18n.json @@ -5,13 +5,13 @@ // Do not edit this file. It is machine generated. { "ConfigurationParser.invalidCWD": "경고: options.cwd는 string 형식이어야 합니다. {0} 값을 무시합니다.\n", - "ConfigurationParser.noShell": "경고: 셸 구성은 작업을 터미널에서 실행 중일 때에만 지원됩니다.", "ConfigurationParser.noargs": "오류: 명령 인수는 문자열의 배열이어야 합니다. 제공된 값:\n{0}", + "ConfigurationParser.noShell": "경고: 셸 구성은 작업을 터미널에서 실행 중일 때에만 지원됩니다.", "ConfigurationParser.noName": "오류: 선언 범위 내의 문제 선택기는 이름이 있어야 합니다.\n{0}\n", "ConfigurationParser.unknownMatcherKind": "경고: 정의된 문제 선택기를 알 수 없습니다. 지원되는 형식은 string | ProblemMatcher |(string | ProblemMatcher)[]입니다.\n{0}\n", "ConfigurationParser.invalidVaraibleReference": "오류: 잘못된 problemMatcher 참조: {0}\n", "ConfigurationParser.noTaskName": "오류: 작업에서 taskName 속성을 제공해야 합니다. 이 작업은 무시됩니다.\n{0}\n", "taskConfiguration.shellArgs": "경고: 작업 '{0}'은(는) 셸 명령이며, 명령 이름이나 인수 중 하나에 이스케이프되지 않은 공백이 있습니다. 명령줄 인용을 올바르게 하려면 인수를 명령으로 병합하세요.", - "taskConfiguration.noCommandOrDependsOn": "오류: 작업 '{0}'에서 명령이나 dependsOn 속성을 지정하지 않습니다. 이 작업은 무시됩니다. 해당 작업의 정의는:\n{1}입니다.", + "taskConfiguration.noCommandOrDependsOn": "오류: 작업 '{0}'에서 명령이나 dependsOn 속성을 지정하지 않습니다. 이 작업은 무시됩니다. 해당 작업의 정의는 {1}입니다.", "taskConfiguration.noCommand": "오류: 작업 '{0}'에서 명령을 정의하지 않습니다. 이 작업은 무시됩니다. 해당 작업의 정의는\n{1}입니다." } \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/tasks/electron-browser/jsonSchemaCommon.i18n.json b/i18n/kor/src/vs/workbench/parts/tasks/electron-browser/jsonSchemaCommon.i18n.json index c0f40665880066924804bceb409bf3d8da9e37e4..f07448af1127f3032af452642a21f3a82bd50ab3 100644 --- a/i18n/kor/src/vs/workbench/parts/tasks/electron-browser/jsonSchemaCommon.i18n.json +++ b/i18n/kor/src/vs/workbench/parts/tasks/electron-browser/jsonSchemaCommon.i18n.json @@ -7,6 +7,7 @@ "JsonSchema.options": "추가 명령 옵션", "JsonSchema.options.cwd": "실행된 프로그램 또는 스크립트의 현재 작업 디렉터리입니다. 생략된 경우 Code의 현재 작업 영역 루트가 사용됩니다.", "JsonSchema.options.env": "실행할 프로그램 또는 셸의 환경입니다. 생략하면 부모 프로세스의 환경이 사용됩니다.", + "JsonSchema.shellConfiguration": "사용할 셸을 구성합니다.", "JsonSchema.shell.executable": "사용할 셸입니다.", "JsonSchema.shell.args": "셸 인수입니다.", "JsonSchema.command": "실행할 명령이며, 외부 프로그램 또는 셸 명령입니다.", diff --git a/i18n/kor/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v1.i18n.json b/i18n/kor/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v1.i18n.json index 18e49dd95a0a0364ef7548458b8b179087e05fe5..06d667c9b130612b77e6a54962c952afad38cb96 100644 --- a/i18n/kor/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v1.i18n.json +++ b/i18n/kor/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v1.i18n.json @@ -5,6 +5,8 @@ // Do not edit this file. It is machine generated. { "JsonSchema.version": "구성의 버전 번호입니다.", + "JsonSchema._runner": "러너가 더 이상 사용되지 않습니다. 공식 러너 속성을 사용하세요.", + "JsonSchema.runner": "작업이 프로세스로 실행되는지 여부와 출력이 출력 창이나 터미널 내부 중 어디에 표시되는지를 정의합니다.", "JsonSchema.windows": "Windows 특정 명령 구성", "JsonSchema.mac": "Mac 특정 명령 구성", "JsonSchema.linux": "Linux 특정 명령 구성", diff --git a/i18n/kor/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.i18n.json b/i18n/kor/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.i18n.json index 9ae6b6172e576b118c92546a9ea202768ab6d7fa..00c94add47cddb9a14bebca5ff26c3e979f956b7 100644 --- a/i18n/kor/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.i18n.json +++ b/i18n/kor/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.i18n.json @@ -4,11 +4,14 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "JsonSchema.shell": "명령이 셸 명령인지 외부 프로그램인지 여부를 지정합니다. 생략하면 기본값 false가 사용됩니다.", + "JsonSchema.tasks.dependsOn.string": "이 작업이 종속된 또 다른 작업입니다.", + "JsonSchema.tasks.dependsOn.array": "이 작업이 종속된 다른 여러 작업입니다.", + "JsonSchema.tasks.group": "이 작업이 속한 실행 그룹을 정의합니다. 생략하면 작업은\n 아무 그룹에도 속하지 않습니다.", + "JsonSchema.tasks.type": "작업이 프로세스로 실행되는지 또는 셸 내의 명령으로 실행되는지를 제어합니다. 기본값은 프로세스입니다.", "JsonSchema.version": "구성의 버전 번호입니다.", + "JsonSchema.tasks.customize": "사용자 지정할 적용된 작업입니다.", "JsonSchema.windows": "Windows 특정 명령 구성", "JsonSchema.mac": "Mac 특정 명령 구성", - "JsonSchema.linux": "Linux 특정 명령 구성", - "JsonSchema.shell": "명령이 셸 명령인지 외부 프로그램인지 여부를 지정합니다. 생략하면 기본값 false가 사용됩니다.", - "JsonSchema.tasks.dependsOn.string": "이 작업이 종속된 또 다른 작업입니다.", - "JsonSchema.tasks.dependsOn.array": "이 작업이 종속된 다른 여러 작업입니다." + "JsonSchema.linux": "Linux 특정 명령 구성" } \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json b/i18n/kor/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json index 4e1c891e83fbfefd534ce566e30889fd6ca54787..0e231caf66c90392c96206a4853240fcf6fc8d46 100644 --- a/i18n/kor/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json +++ b/i18n/kor/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json @@ -18,10 +18,12 @@ "problems": "문제", "manyMarkers": "99+", "tasks": "작업", + "TaskSystem.noHotSwap": "작업 실행 엔진을 변경하려면 VS Code를 다시 시작해야 합니다. 변경이 무시됩니다.", "TaskService.noBuildTask": "정의된 빌드 작업이 없습니다. tasks.json 파일에서 작업을 'isBuildCommand'로 표시하세요.", "TaskService.noTestTask": "정의된 테스트 작업이 없습니다. tasks.json 파일에서 작업을 'isTestCommand'로 표시하세요.", "TaskServer.noTask": "실행하도록 요청한 작업 {0}을(를) 찾을 수 없습니다.", - "TaskSystem.activeSame": "작업이 이미 활성 상태이며 감시 모드입니다. 작업을 종료하려면 `F1 > 작업 종료`를 사용하세요.", + "customizeParseErrors": "현재 작성 구성에 오류가 있습니다. 작업을 사용자 지정하기 전에 오류를 수정하세요.\n", + "moreThanOneBuildTask": "tasks.json에 여러 빌드 작업이 정의되어 있습니다. 첫 번째 작업을 실행합니다.\n", "TaskSystem.active": "이미 실행 중인 작업이 있습니다. 다른 작업을 실행하려면 먼저 이 작업을 종료하세요.", "TaskSystem.restartFailed": "{0} 작업을 종료하고 다시 시작하지 못했습니다.", "TaskSystem.configurationErrors": "오류: 제공한 작업 구성에 유효성 검사 오류가 있으며 사용할 수 없습니다. 먼저 오류를 수정하세요.", diff --git a/i18n/kor/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.i18n.json b/i18n/kor/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.i18n.json index 960fcef74d09fbd9d258ed4b561db0452b2756ec..4c053b9817c393ca195c98e0775da58257024c9f 100644 --- a/i18n/kor/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.i18n.json +++ b/i18n/kor/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.i18n.json @@ -6,5 +6,7 @@ { "TerminalTaskSystem.unknownError": "작업을 실행하는 동안 알 수 없는 오류가 발생했습니다. 자세한 내용은 작업 출력 로그를 참조하세요.", "TerminalTaskSystem.terminalName": "작업 - {0}", - "TerminalTaskSystem": "UNC 드라이브에서 셸 명령을 실행할 수 없습니다." + "reuseTerminal": "터미널이 작업에서 다시 사용됩니다. 닫으려면 아무 키나 누르세요.", + "TerminalTaskSystem": "UNC 드라이브에서 셸 명령을 실행할 수 없습니다.", + "unkownProblemMatcher": "문제 선택기 {0}을(를) 확인할 수 없습니다. 이 선택기는 무시됩니다." } \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/tasks/node/processTaskSystem.i18n.json b/i18n/kor/src/vs/workbench/parts/tasks/node/processTaskSystem.i18n.json index 41639c4c051fee38c98c5740f978e6995ca17d8e..e222c1b151d6a10050ddc7f2df39316ca7189a7e 100644 --- a/i18n/kor/src/vs/workbench/parts/tasks/node/processTaskSystem.i18n.json +++ b/i18n/kor/src/vs/workbench/parts/tasks/node/processTaskSystem.i18n.json @@ -7,5 +7,6 @@ "TaskRunnerSystem.unknownError": "작업을 실행하는 동안 알 수 없는 오류가 발생했습니다. 자세한 내용은 작업 출력 로그를 참조하세요.", "TaskRunnerSystem.watchingBuildTaskFinished": "\n빌드 감시 작업이 완료되었습니다.", "TaskRunnerSystem.childProcessError": "Failed to launch external program {0} {1}.", - "TaskRunnerSystem.cancelRequested": "\n사용자 요청에 따라 '{0}' 작업이 종료되었습니다." + "TaskRunnerSystem.cancelRequested": "\n사용자 요청에 따라 '{0}' 작업이 종료되었습니다.", + "unkownProblemMatcher": "문제 선택기 {0}을(를) 확인할 수 없습니다. 이 선택기는 무시됩니다." } \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/terminal/electron-browser/terminalActions.i18n.json b/i18n/kor/src/vs/workbench/parts/terminal/electron-browser/terminalActions.i18n.json index 2953f126a31a098a44c3acfd597394aa0390aaac..8d5763a792bb3de51cb8a5e1c5674c615b4dd1e0 100644 --- a/i18n/kor/src/vs/workbench/parts/terminal/electron-browser/terminalActions.i18n.json +++ b/i18n/kor/src/vs/workbench/parts/terminal/electron-browser/terminalActions.i18n.json @@ -8,6 +8,7 @@ "workbench.action.terminal.kill": "활성 터미널 인스턴스 종료", "workbench.action.terminal.kill.short": "터미널 종료", "workbench.action.terminal.copySelection": "선택 영역 복사", + "workbench.action.terminal.selectAll": "모두 선택", "workbench.action.terminal.new": "새 통합 터미널 만들기", "workbench.action.terminal.new.short": "새 터미널", "workbench.action.terminal.focus": "터미널에 포커스", @@ -26,5 +27,8 @@ "workbench.action.terminal.scrollUp": "위로 스크롤(줄)", "workbench.action.terminal.scrollUpPage": "위로 스크롤(페이지)", "workbench.action.terminal.scrollToTop": "맨 위로 스크롤", - "workbench.action.terminal.clear": "지우기" + "workbench.action.terminal.clear": "지우기", + "workbench.action.terminal.allowWorkspaceShell": "작업 영역 셸 구성 허용", + "workbench.action.terminal.disallowWorkspaceShell": "작업 영역 셸 구성 허용 안 함", + "workbench.action.terminal.rename": "이름 바꾸기" } \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/terminal/electron-browser/terminalColorRegistry.i18n.json b/i18n/kor/src/vs/workbench/parts/terminal/electron-browser/terminalColorRegistry.i18n.json index 0b29da8897d4b362c0cd42352163fedcf17c7f2f..5923a5bf7d5ca280848e6757c78142d7c96e7133 100644 --- a/i18n/kor/src/vs/workbench/parts/terminal/electron-browser/terminalColorRegistry.i18n.json +++ b/i18n/kor/src/vs/workbench/parts/terminal/electron-browser/terminalColorRegistry.i18n.json @@ -4,5 +4,7 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "terminal.background": "터미널의 배경색입니다. 이 설정을 사용하면 터미널\n 색을 패널과 다르게 지정할 수 있습니다.", + "terminal.foreground": "터미널의 전경색입니다.", "terminal.ansiColor": "터미널의 '{0}' ANSI 색입니다." } \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/terminal/electron-browser/terminalFindWidget.i18n.json b/i18n/kor/src/vs/workbench/parts/terminal/electron-browser/terminalFindWidget.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..c45550055e9c43ae25f8fd14d29629b0b6f25426 --- /dev/null +++ b/i18n/kor/src/vs/workbench/parts/terminal/electron-browser/terminalFindWidget.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "label.find": "찾기", + "placeholder.find": "찾기", + "label.previousMatchButton": "이전 검색 결과", + "label.nextMatchButton": "다음 검색 결과", + "label.closeButton": "닫기" +} \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.i18n.json b/i18n/kor/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.i18n.json index a35b2cdc8f1a9ade5f2490bf505f33a5f2fe03ef..7ae3f4f9275ac5a272e18060600177ebbdc9bb37 100644 --- a/i18n/kor/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.i18n.json +++ b/i18n/kor/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.i18n.json @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "terminal.integrated.copySelection.noSelection": "터미널에 포커스가 없는 경우 터미널 선택을 복사할 수 없습니다.", "terminal.integrated.exitedWithCode": "터미널 프로세스가 종료 코드 {0}(으)로 종료되었습니다.", "terminal.integrated.waitOnExit": "터미널을 닫으려면 아무 키나 누르세요.", "terminal.integrated.launchFailed": "터미널 프로세스 명령 `{0}{1}`이(가) 시작하지 못했습니다(종료 코드: {2})." diff --git a/i18n/kor/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json b/i18n/kor/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json index 25cf1e962031cf78851a73c053ea56573e77a8ac..b3a4598456f78b29c960000b33926950502cb039 100644 --- a/i18n/kor/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json +++ b/i18n/kor/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json @@ -6,6 +6,7 @@ { "selectTheme.label": "색 테마", "installColorThemes": "추가 색 테마 설치...", + "themes.selectTheme": "색 테마 선택(미리 보려면 위로/아래로 키 사용)", "selectIconTheme.label": "파일 아이콘 테마", "installIconThemes": "추가 파일 아이콘 테마 설치...", "noIconThemeLabel": "없음", diff --git a/i18n/kor/src/vs/workbench/parts/update/electron-browser/update.i18n.json b/i18n/kor/src/vs/workbench/parts/update/electron-browser/update.i18n.json index 07b9da83abe773f826fab9d55f0877724b2d3181..dbdb545ea205256ceb6ce92b9dbcfd201f755025 100644 --- a/i18n/kor/src/vs/workbench/parts/update/electron-browser/update.i18n.json +++ b/i18n/kor/src/vs/workbench/parts/update/electron-browser/update.i18n.json @@ -15,5 +15,18 @@ "license": "라이선스 읽기", "updateAvailable": "다시 시작하면 {0}이(가) 업데이트됩니다.", "thereIsUpdateAvailable": "사용 가능한 업데이트가 있습니다.", - "noUpdatesAvailable": "현재 사용 가능한 업데이트가 없습니다." + "noUpdatesAvailable": "현재 사용 가능한 업데이트가 없습니다.", + "updateIsReady": "새 업데이트를 사용할 수 있습니다.", + "commandPalette": "명령 팔레트...", + "settings": "설정", + "keyboardShortcuts": "바로 가기 키(&&K)", + "selectTheme.label": "색 테마", + "themes.selectIconTheme.label": "파일 아이콘 테마", + "not available": "업데이트를 사용할 수 없음", + "checkingForUpdates": "업데이트를 확인하는 중...", + "DownloadUpdate": "사용 가능한 업데이트 다운로드", + "DownloadingUpdate": "업데이트를 다운로드하는 중...", + "InstallingUpdate": "업데이트를 설치하는 중...", + "restartToUpdate": "업데이트하기 위해 다시 시작...", + "checkForUpdates": "업데이트 확인..." } \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/views/browser/views.i18n.json b/i18n/kor/src/vs/workbench/parts/views/browser/views.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..8d20ba83c9aa5bc71e82065b368d8f865db112c0 --- /dev/null +++ b/i18n/kor/src/vs/workbench/parts/views/browser/views.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "viewToolbarAriaLabel": "{0} 동작" +} \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/views/browser/viewsExtensionPoint.i18n.json b/i18n/kor/src/vs/workbench/parts/views/browser/viewsExtensionPoint.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..cb664992fc151ad4a7f397bcbe286f04015377a9 --- /dev/null +++ b/i18n/kor/src/vs/workbench/parts/views/browser/viewsExtensionPoint.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "requirearray": "뷰는 배열이어야 합니다.", + "requirestring": "속성 `{0}`은(는) 필수이며 `string` 형식이어야 합니다.", + "optstring": "속성 `{0}`은(는) 생략할 수 있으며 `string` 형식이어야 합니다.", + "vscode.extension.contributes.view.id": "뷰의 식별자입니다. 'vscode.window.registerTreeDataProviderForView` API를 통해 데이터 공급자를 등록하는 데 사용합니다. `onView:${id}` 이벤트를 `activationEvents`에 등록하여 확장 활성화를 트리거하는 데에도 사용합니다.", + "vscode.extension.contributes.view.name": "사용자가 읽을 수 있는 뷰 이름입니다. 표시됩니다.", + "vscode.extension.contributes.views": "뷰를 에디터에 적용합니다.", + "views.explorer": "탐색기 뷰", + "locationId.invalid": "`{0}`은(는) 유효한 뷰 위치가 아닙니다." +} \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json b/i18n/kor/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json index 3b4766bb5d93ee3cf02c374fcc5d1796b093cc09..abd099ba950ddedd1dc0cc6763dced907d59b1b5 100644 --- a/i18n/kor/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json +++ b/i18n/kor/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json @@ -11,20 +11,26 @@ "welcomePage.openFolder": "폴더 열기...", "welcomePage.cloneGitRepository": "Git 리포지토리 복제...", "welcomePage.recent": "최근 항목", + "welcomePage.moreRecent": "자세히...", "welcomePage.noRecentFolders": "최근 폴더 없음", "welcomePage.help": "도움말", + "welcomePage.keybindingsCheatsheet": "인쇄 가능 키보드 치트시트", "welcomePage.introductoryVideos": "소개 비디오", "welcomePage.productDocumentation": "제품 설명서", "welcomePage.gitHubRepository": "GitHub 리포지토리", "welcomePage.stackOverflow": "Stack Overflow", "welcomePage.showOnStartup": "시작 시 시작 페이지 표시", "welcomePage.customize": "사용자 지정", + "welcomePage.installExtensionPacks": "도구 및 언어", + "welcomePage.installExtensionPacksDescription": "{0} 및 {1}에 대한 지원 설치", + "welcomePage.moreExtensions": "자세히", "welcomePage.installKeymapDescription": "바로 가기 키 설치", + "welcomePage.installKeymapExtension": "{0} 및 {1}의 바로 가기 키 설치", "welcomePage.others": "기타", "welcomePage.colorTheme": "색 테마", "welcomePage.colorThemeDescription": "편집기 및 코드가 좋아하는 방식으로 표시되게 만들기", + "welcomePage.learn": "알아보기", "welcomePage.showCommands": "모든 명령 찾기 및 실행", - "welcomePage.showCommandsDescription": "제어판에서 명령을 빠르게 검색 및 액세스({0})", "welcomePage.interfaceOverview": "인터페이스 개요", "welcomePage.interfaceOverviewDescription": "UI의 주요 구성 요소를 강조 표시하는 시각적 오버레이 가져오기", "welcomePage.interactivePlayground": "대화형 실습", diff --git a/i18n/kor/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.contribution.i18n.json b/i18n/kor/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.contribution.i18n.json index 5f662c88c2eb84ba66d7b3e8b1b74929f0b2d882..d09100eafce7c6292dd448fb0206b8c091387c40 100644 --- a/i18n/kor/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.contribution.i18n.json +++ b/i18n/kor/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.contribution.i18n.json @@ -4,7 +4,5 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "workbenchConfigurationTitle": "워크벤치", - "welcomePage.enabled": "사용하도록 설정되면 시작할 때 시작 페이지를 표시합니다.", "help": "도움말" } \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json b/i18n/kor/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json index cb5666d331a1595a373cbc30ba2d87213da8fdef..32604316d81ddfb47b68a3d87987bbf8a186efdf 100644 --- a/i18n/kor/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json +++ b/i18n/kor/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json @@ -4,12 +4,35 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "workbenchConfigurationTitle": "워크벤치", + "welcomePage.enabled": "사용하도록 설정되면 시작할 때 시작 페이지를 표시합니다.", "welcomePage": "시작", + "welcomePage.javaScript": "JavaScript", + "welcomePage.typeScript": "TypeScript", + "welcomePage.python": "Python", + "welcomePage.php": "PHP", + "welcomePage.docker": "Docker", + "welcomePage.vim": "Vim", + "welcomePage.sublime": "Sublime", + "welcomePage.atom": "Atom", + "welcomePage.extensionPackAlreadyInstalled": "{0}에 대한 지원이 이미 설치되어 있습니다.", + "welcomePage.willReloadAfterInstallingExtensionPack": "{0}에 대한 추가 지원을 설치한 후 창이 다시 로드됩니다.", + "welcomePage.installingExtensionPack": "{0}에 대한 추가 지원을 설치하는 중...", + "welcomePage.extensionPackNotFound": "ID가 {1}인 {0}에 대한 지원을 찾을 수 없습니다.", "welcomePage.keymapAlreadyInstalled": "{0} 바로 가기 키가 이미 설치되어 있습니다.", "welcomePage.willReloadAfterInstallingKeymap": "{0} 바로 가기 키를 설치한 후 창이 다시 로드됩니다.", "welcomePage.installingKeymap": "{0} 바로 가기 키를 설치하는 중...", "welcomePage.keymapNotFound": "ID가 {1}인 {0} 바로 가기 키를 찾을 수 없습니다.", "welcome.title": "시작", + "welcomePage.openFolderWithPath": "경로가 {1}인 {0} 폴더 열기", + "welcomePage.extensionListSeparator": ", ", + "welcomePage.installKeymap": "{0} 키맵 설치", + "welcomePage.installExtensionPack": "{0}에 대한 추가 지원 설치", + "welcomePage.installedKeymap": "{0} 키맵이 이미 설치되어 있습니다.", + "welcomePage.installedExtensionPack": "{0} 지원이 이미 설치되어 있습니다.", "ok": "확인", - "cancel": "취소" + "details": "세부 정보", + "cancel": "취소", + "welcomePage.buttonBackground": "시작 페이지에서 단추의 배경색입니다.", + "welcomePage.buttonHoverBackground": "시작 페이지에서 단추의 커서 올리기 배경색입니다." } \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json b/i18n/kor/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json index 7f6ec89a740b297723bae63652e9f1a95f2f76a9..25c6b86854dd712459808134e08c7f7d2e959c30 100644 --- a/i18n/kor/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json +++ b/i18n/kor/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json @@ -5,5 +5,6 @@ // Do not edit this file. It is machine generated. { "walkThrough.unboundCommand": "바인딩 안 됨", - "walkThrough.gitNotFound": "Git가 시스템에 설치되지 않은 것 같습니다." + "walkThrough.gitNotFound": "Git가 시스템에 설치되지 않은 것 같습니다.", + "walkThrough.embeddedEditorBackground": "대화형 실습에서 포함된 편집기의 배경색입니다." } \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json b/i18n/kor/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json index 131b473a69bd8ba9e640ab87bc960addeb1374e1..fa07b04f779b3c8fe639b72bc4aeefeed66e618a 100644 --- a/i18n/kor/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json +++ b/i18n/kor/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json @@ -6,6 +6,12 @@ { "open": "설정 열기", "close": "닫기", + "saveAndRetry": "설정 저장 및 다시 시도", "errorUnknownKey": "구성 파일에 쓸 수 없습니다(알 수 없는 키).", - "errorInvalidTarget": "구성 파일에 쓸 수 없습니다(잘못된 대상)." + "errorInvalidTarget": "구성 파일에 쓸 수 없습니다(잘못된 대상).", + "errorNoWorkspaceOpened": "폴더가 열려 있지 않으므로 설정에 쓸 수 없습니다. 먼저 폴더를 열고 다시 시도하세요.", + "errorInvalidConfiguration": "설정에 쓸 수 없습니다. **사용자 설정**을 열어 파일에서 오류/경고를 해결하고 다시 시도하세요.", + "errorInvalidConfigurationWorkspace": "설정에 쓸 수 없습니다. **작업 영역 설정**을 열어 파일에서 오류/경고를 해결하고 다시 시도하세요.", + "errorConfigurationFileDirty": "파일이 변경되어 설정에 쓸 수 없습니다. **사용자 설정** 파일을 저장하고 다시 시도하세요.", + "errorConfigurationFileDirtyWorkspace": "파일이 변경되어 설정에 쓸 수 없습니다. **작업 영역 설정** 파일을 저장하고 다시 시도하세요." } \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/services/crashReporter/common/crashReporterService.i18n.json b/i18n/kor/src/vs/workbench/services/crashReporter/common/crashReporterService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..cff423b1f3bf7da6f7c32662d59050581c40080d --- /dev/null +++ b/i18n/kor/src/vs/workbench/services/crashReporter/common/crashReporterService.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "telemetryConfigurationTitle": "원격 분석", + "telemetry.enableCrashReporting": "충돌 보고서를 Microsoft에 전송할 수 있도록 설정합니다.\n이 옵션을 적용하려면 다시 시작해야 합니다." +} \ No newline at end of file diff --git a/i18n/kor/src/vs/workbench/services/progress/browser/progressService2.i18n.json b/i18n/kor/src/vs/workbench/services/progress/browser/progressService2.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..6db7d6aae514a031afce5ac346abfd84bb8ee1cc --- /dev/null +++ b/i18n/kor/src/vs/workbench/services/progress/browser/progressService2.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "progress.text": "{0} - {1}", + "progress.title": "{0}: {1}" +} \ No newline at end of file diff --git a/i18n/ptb/extensions/configuration-editing/out/settingsDocumentHelper.i18n.json b/i18n/ptb/extensions/configuration-editing/out/settingsDocumentHelper.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..8f2407b1dfa69f5856cccf93cf126fa9a70a412f --- /dev/null +++ b/i18n/ptb/extensions/configuration-editing/out/settingsDocumentHelper.i18n.json @@ -0,0 +1,36 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "activeEditorShort": "por exemplo meuArquivo.txt", + "activeEditorMedium": "e.g. minhaPasta/meuArquivo.txt", + "activeEditorLong": "por exemplo /Usuários/Desenvolvimento/meuProjeto/minhaPasta/meuArquivo/txt", + "rootName": "e.g. meuProjeto", + "rootPath": "por exemplo /Usuários/desenvolvimento/meuProjeto", + "appName": "e.g. VS Code", + "dirty": "Um indicador de alteração se o editor ativo foi alterado", + "separator": "um separador condicional (' - ') que somente é mostrado quando envolvido por variáveis com valores", + "assocLabelFile": "Arquivos com Extensão", + "assocDescriptionFile": "Mapear todos arquivos que correspondem ao padrão global no seu nome de arquivo à linguagem com o identificador dado", + "assocLabelPath": "Arquivos com Caminho", + "assocDescriptionPath": "Mapear todos os arquivos que correspondem ao caminho absoluto global no seu caminho à linguagem com o identificador dado", + "fileLabel": "Arquivos por Extensão", + "fileDescription": "Combina todos os arquivos de uma extensão de arquivo específica.", + "filesLabel": "Arquivos com Várias Extensões", + "filesDescription": "Combina todos os arquivos com qualquer uma das extensões de arquivo.", + "derivedLabel": "Arquivos com Irmãos por Nome", + "derivedDescription": "Combina arquivos que têm irmãos com o mesmo nome, mas uma extensão diferente.", + "topFolderLabel": "Pasta por Nome (Nível Superior)", + "topFolderDescription": "Combina uma pasta de nível superior com um nome específico.", + "topFoldersLabel": "Pastas com Vários Nomes (Nível Superior)", + "topFoldersDescription": "Combina várias pastas de nível superior.", + "folderLabel": "Pasta por Nome (Qualquer Local)", + "folderDescription": "Combina uma pasta com um nome específico em qualquer local.", + "falseDescription": "Desabilita o padrão.", + "trueDescription": "Habilita o padrão.", + "siblingsDescription": "Combina arquivos que têm irmãos com o mesmo nome, mas uma extensão diferente.", + "languageSpecificEditorSettings": "Configurações do editor especificas para a linguagem", + "languageSpecificEditorSettingsDescription": "Sobrescrever as configurações do editor para a linguagem" +} \ No newline at end of file diff --git a/i18n/ptb/extensions/css/client/out/cssMain.i18n.json b/i18n/ptb/extensions/css/client/out/cssMain.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..a649796227bda634027527793a431b116acea450 --- /dev/null +++ b/i18n/ptb/extensions/css/client/out/cssMain.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "cssserver.name": "Servidor de linguagem CSS" +} \ No newline at end of file diff --git a/i18n/ptb/extensions/css/package.i18n.json b/i18n/ptb/extensions/css/package.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..de011d44dcee1e5b84348cbbbac47b39514e14b0 --- /dev/null +++ b/i18n/ptb/extensions/css/package.i18n.json @@ -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. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "css.lint.argumentsInColorFunction.desc": "Número inválido de parâmetros", + "css.lint.boxModel.desc": "Não use largura ou altura ao usar preenchimento ou borda", + "css.lint.compatibleVendorPrefixes.desc": "Ao usar um prefixo específico de fornecedor, certifique-se de também incluir todas as outras propriedades específicas do fornecedor", + "css.lint.duplicateProperties.desc": "Não use as definições de estilo duplicadas", + "css.lint.emptyRules.desc": "Não use conjuntos de regra em branco", + "css.lint.float.desc": "Evite usar 'float'. Floats levam a CSS frágil, que é fácil de quebrar se um aspecto do layout for alterado.", + "css.lint.fontFaceProperties.desc": "A regra @font-face deve definir propriedades 'src' e 'font-family'", + "css.lint.hexColorLength.desc": "Cores hexadecimais devem consistir em três ou seis números hexadecimais", + "css.lint.idSelector.desc": "Seletores não devem conter IDs, pois essas regras estão firmemente acopladas ao HTML.", + "css.lint.ieHack.desc": "IE hacks somente são necessários ao dar suporte ao IE7 e mais antigos", + "css.lint.important.desc": "Evite usar !important. Esta é uma indicação de que a especificidade do CSS inteiro saiu de controle e precisa ser fatorada novamente.", + "css.lint.importStatement.desc": "Instruções de importação não carregam em paralelo", + "css.lint.propertyIgnoredDueToDisplay.desc": "Propriedade ignorada devido à exibição. Por exemplo, com 'display: inline', as propriedades width, height, margin-top, margin-bottom e float não têm efeito", + "css.lint.universalSelector.desc": "O seletor universal (*) é conhecido por ser lento", + "css.lint.unknownProperties.desc": "Propriedade desconhecida.", + "css.lint.unknownVendorSpecificProperties.desc": "Propriedade específica do fornecedor desconhecida.", + "css.lint.vendorPrefix.desc": "Ao usar um prefixo específico do fornecedor, inclua também a propriedade padrão", + "css.lint.zeroUnits.desc": "Nenhuma unidade para zero é necessária", + "css.validate.desc": "Habilita ou desabilita todas as validações", + "less.lint.argumentsInColorFunction.desc": "Número inválido de parâmetros", + "less.lint.boxModel.desc": "Não use largura ou altura ao usar preenchimento ou borda", + "less.lint.compatibleVendorPrefixes.desc": "Ao usar um prefixo específico de fornecedor, certifique-se de também incluir todas as outras propriedades específicas do fornecedor", + "less.lint.duplicateProperties.desc": "Não use as definições de estilo duplicadas", + "less.lint.emptyRules.desc": "Não use conjuntos de regra em branco", + "less.lint.float.desc": "Evite usar 'float'. Floats levam a CSS frágil, que é fácil de quebrar se um aspecto do layout for alterado.", + "less.lint.fontFaceProperties.desc": "A regra @font-face deve definir propriedades 'src' e 'font-family'", + "less.lint.hexColorLength.desc": "Cores hexadecimais devem consistir em três ou seis números hexadecimais", + "less.lint.idSelector.desc": "Seletores não devem conter IDs, pois essas regras estão firmemente acopladas ao HTML.", + "less.lint.ieHack.desc": "IE hacks somente são necessários ao dar suporte ao IE7 e mais antigos", + "less.lint.important.desc": "Evite usar !important. Esta é uma indicação de que a especificidade do CSS inteiro saiu de controle e precisa ser fatorada novamente.", + "less.lint.importStatement.desc": "Instruções de importação não carregam em paralelo", + "less.lint.propertyIgnoredDueToDisplay.desc": "Propriedade ignorada devido à exibição. Por exemplo, com 'display: inline', as propriedades width, height, margin-top, margin-bottom e float não têm efeito", + "less.lint.universalSelector.desc": "O seletor universal (*) é conhecido por ser lento", + "less.lint.unknownProperties.desc": "Propriedade desconhecida.", + "less.lint.unknownVendorSpecificProperties.desc": "Propriedade específica do fornecedor desconhecida.", + "less.lint.vendorPrefix.desc": "Ao usar um prefixo específico do fornecedor, inclua também a propriedade padrão", + "less.lint.zeroUnits.desc": "Nenhuma unidade para zero é necessária", + "less.validate.desc": "Habilita ou desabilita todas as validações", + "scss.lint.argumentsInColorFunction.desc": "Número inválido de parâmetros", + "scss.lint.boxModel.desc": "Não use largura ou altura ao usar preenchimento ou borda", + "scss.lint.compatibleVendorPrefixes.desc": "Ao usar um prefixo específico de fornecedor, certifique-se de também incluir todas as outras propriedades específicas do fornecedor", + "scss.lint.duplicateProperties.desc": "Não use as definições de estilo duplicadas", + "scss.lint.emptyRules.desc": "Não use conjuntos de regra em branco", + "scss.lint.float.desc": "Evite usar 'float'. Floats levam a CSS frágil, que é fácil de quebrar se um aspecto do layout for alterado.", + "scss.lint.fontFaceProperties.desc": "A regra @font-face deve definir propriedades 'src' e 'font-family'", + "scss.lint.hexColorLength.desc": "Cores hexadecimais devem consistir em três ou seis números hexadecimais", + "scss.lint.idSelector.desc": "Seletores não devem conter IDs, pois essas regras estão firmemente acopladas ao HTML.", + "scss.lint.ieHack.desc": "IE hacks somente são necessários ao dar suporte ao IE7 e mais antigos", + "scss.lint.important.desc": "Evite usar !important. Esta é uma indicação de que a especificidade do CSS inteiro saiu de controle e precisa ser fatorada novamente.", + "scss.lint.importStatement.desc": "Instruções de importação não carregam em paralelo", + "scss.lint.propertyIgnoredDueToDisplay.desc": "Propriedade ignorada devido à exibição. Por exemplo, com 'display: inline', as propriedades width, height, margin-top, margin-bottom e float não têm efeito", + "scss.lint.universalSelector.desc": "O seletor universal (*) é conhecido por ser lento", + "scss.lint.unknownProperties.desc": "Propriedade desconhecida.", + "scss.lint.unknownVendorSpecificProperties.desc": "Propriedade específica do fornecedor desconhecida.", + "scss.lint.vendorPrefix.desc": "Ao usar um prefixo específico do fornecedor, inclua também a propriedade padrão", + "scss.lint.zeroUnits.desc": "Nenhuma unidade para zero é necessária", + "scss.validate.desc": "Habilita ou desabilita todas as validações", + "less.colorDecorators.enable.desc": "Habilita ou desabilita decoradores de cores", + "scss.colorDecorators.enable.desc": "Habilita ou desabilita decoradores de cores", + "css.colorDecorators.enable.desc": "Habilita ou desabilita decoradores de cores" +} \ No newline at end of file diff --git a/i18n/ptb/extensions/extension-editing/out/packageDocumentHelper.i18n.json b/i18n/ptb/extensions/extension-editing/out/packageDocumentHelper.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..8505afd6d4a89481bfcafa95e72cb3316ddf40b8 --- /dev/null +++ b/i18n/ptb/extensions/extension-editing/out/packageDocumentHelper.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "languageSpecificEditorSettings": "Configurações do editor especificas para a linguagem", + "languageSpecificEditorSettingsDescription": "Sobrescrever as configurações do editor para a linguagem" +} \ No newline at end of file diff --git a/i18n/ptb/extensions/git/out/askpass-main.i18n.json b/i18n/ptb/extensions/git/out/askpass-main.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..280b14bd0d70c5add003e09e4465f311cea5c941 --- /dev/null +++ b/i18n/ptb/extensions/git/out/askpass-main.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "missOrInvalid": "Credenciais ausentes ou inválidas." +} \ No newline at end of file diff --git a/i18n/ptb/extensions/git/out/commands.i18n.json b/i18n/ptb/extensions/git/out/commands.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..6744be04c882da9982235d65103ab0492d5dc78d --- /dev/null +++ b/i18n/ptb/extensions/git/out/commands.i18n.json @@ -0,0 +1,46 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "tag at": "Etiqueta em {0}", + "remote branch at": "Ramo remoto em {0}", + "repourl": "URL do repositório", + "parent": "Diretório pai", + "cloning": "Clonando repositório do Git...", + "openrepo": "Abrir Repositório", + "proposeopen": "Gostaria de abrir o repositório clonado?", + "confirm revert": "Tem certeza que deseja reverter as alterações selecionadas em {0}?", + "revert": "Reverter as alterações", + "confirm discard": "Tem certeza que deseja descartar as alterações em {0}?", + "confirm discard multiple": "Tem certeza que deseja descartar as alterações em {0} arquivos?", + "discard": "Descartar alterações", + "confirm discard all": "Tem certeza que deseja descartar TODAS as alterações? Isso é IRREVERSÍVEL!", + "discardAll": "Descartar TODAS as alterações", + "no staged changes": "Não há nenhuma modificação escalonada para confirmar.\n\nGostaria de escalonar automaticamente todas as suas alterações e confirmá-las diretamente?", + "yes": "Sim", + "always": "Sempre", + "no changes": "Não há mudanças para confirmar.", + "commit message": "Confirmar mensagem", + "provide commit message": "Por favor, forneça uma mensagem de commit", + "branch name": "Nome do Ramo", + "provide branch name": "Por favor, forneça um nome de ramo", + "select branch to delete": "Selecione uma ramificação para excluir", + "confirm force delete branch": "A ramificação '{0}' não foi totalmente mesclada. Excluir mesmo assim?", + "delete branch": "Excluir ramificação", + "no remotes to pull": "O seu repositório não possui remotos configurados para efetuar pull.", + "no remotes to push": "O seu repositório não possui remotos configurados para efetuar push.", + "nobranch": "Por favor, faça checkout em um ramo para fazer push em um remoto.", + "pick remote": "Pegue um remoto para publicar o ramo '{0}':", + "sync is unpredictable": "Esta ação vai fazer push e pull nos commits de e para '{0}'.", + "ok": "OK", + "never again": "Ok, Nunca Mostrar Novamente", + "no remotes to publish": "Seu repositório não possui remotos configurados para publicação.", + "disabled": "Git está desativado ou não é suportado neste espaço de trabalho", + "clean repo": "Por favor, limpe sua árvore de trabalho do repositório antes de fazer check-out.", + "cant push": "Não pode empurrar referências para remoto. Execute 'Pull' primeiro para integrar suas alterações.", + "git error details": "Git: {0}", + "git error": "Erro de Git", + "open git log": "Abrir Histórico do Git" +} \ No newline at end of file diff --git a/i18n/ptb/extensions/git/out/main.i18n.json b/i18n/ptb/extensions/git/out/main.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..ae1dee2603294960e444450082c7c214a6c7f05e --- /dev/null +++ b/i18n/ptb/extensions/git/out/main.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "using git": "Usando git {0} de {1}", + "updateGit": "Atualizar o Git", + "neverShowAgain": "Não mostrar novamente", + "git20": "Você parece ter o git {0} instalado. Code funciona melhor com git > = 2" +} \ No newline at end of file diff --git a/i18n/ptb/extensions/git/out/model.i18n.json b/i18n/ptb/extensions/git/out/model.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..717d2b4364a76160a0ba309d9b60023bedb750bf --- /dev/null +++ b/i18n/ptb/extensions/git/out/model.i18n.json @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "open": "Abrir", + "merge changes": "Mesclar Alterações", + "staged changes": "Alterações em Etapas", + "changes": "Alterações", + "ok": "OK", + "neveragain": "Nunca Mostrar Novamente", + "huge": "O repositório git em '{0}' tem muitas atualizações ativas, somente um subconjunto de funcionalidades do Git será habilitado." +} \ No newline at end of file diff --git a/i18n/ptb/extensions/git/out/scmProvider.i18n.json b/i18n/ptb/extensions/git/out/scmProvider.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..490dda3603e0d0bfbd4567da422673d8fc0dfe8a --- /dev/null +++ b/i18n/ptb/extensions/git/out/scmProvider.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "commit": "Confirmar" +} \ No newline at end of file diff --git a/i18n/ptb/extensions/git/out/statusbar.i18n.json b/i18n/ptb/extensions/git/out/statusbar.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..a7cb7d22aae22689c491132d9e25f4df45e0b8e7 --- /dev/null +++ b/i18n/ptb/extensions/git/out/statusbar.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "checkout": "Checkout...", + "sync changes": "Sincronizar alterações", + "publish changes": "Publicar Alterações", + "syncing changes": "Sincronizando Alterações..." +} \ No newline at end of file diff --git a/i18n/ptb/extensions/git/package.i18n.json b/i18n/ptb/extensions/git/package.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..20e7fed4901c46c82d9a779e945968efadc82cba --- /dev/null +++ b/i18n/ptb/extensions/git/package.i18n.json @@ -0,0 +1,49 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "command.clone": "Clonar", + "command.init": "Inicializar Repositório", + "command.refresh": "Atualizar", + "command.openChange": "Abrir alterações", + "command.openFile": "Abrir Arquivo", + "command.stage": "Estagiar Alterações", + "command.stageAll": "Estagiar Todas Alterações", + "command.stageSelectedRanges": "Estagiar Faixas Selecionadas", + "command.revertSelectedRanges": "Reverter Faixas Selecionadas", + "command.unstage": "Desestagiar Alterações", + "command.unstageAll": "Desestagiar Todas Alterações", + "command.unstageSelectedRanges": "Desestagiar Faixas Selecionadas", + "command.clean": "Descartar Alterações", + "command.cleanAll": "Descartar Todas as Alterações", + "command.commit": "Confirmar", + "command.commitStaged": "Confirmar os preparados", + "command.commitStagedSigned": "Confirmar Estagiados (Desconectado)", + "command.commitAll": "Confirmar tudo", + "command.commitAllSigned": "Confirmar Tudo (Desconectado)", + "command.undoCommit": "Desfazer Ultima Confirmação", + "command.checkout": "Fazer checkout para...", + "command.branch": "Criar Ramificação...", + "command.deleteBranch": "Excluir Ramificação...", + "command.pull": "Efetuar pull", + "command.pullRebase": "Efetuar pull (Rebase)", + "command.push": "Enviar por push", + "command.pushTo": "Enviar por push para...", + "command.sync": "Sincronizar", + "command.publish": "Publicar Ramo", + "command.showOutput": "Mostrar Saída do Git", + "config.enabled": "Se o git estiver habilitado", + "config.path": "Caminho para o executável do git", + "config.autorefresh": "Se a atualização automática estiver habilitada", + "config.autofetch": "Se a recuperação automática estiver habilitada", + "config.enableLongCommitWarning": "Se mensagens longas de confirmação devem ter aviso", + "config.confirmSync": "Confirmar antes de sincronizar repositórios git", + "config.countBadge": "Controla o contador de distintivos do git. 'todos' considera todas as alterações. 'rastreado' considera apenas as alterações controladas. 'desligado' desliga o contador.", + "config.checkoutType": "Controla quais tipos de ramos são listados quando executando `Checkout para... `. `todos` mostra todas as referências, `local` mostra apenas os ramos locais, `etiqueta` mostra apenas etiquetas e `remoto` mostra apenas os ramos remotos.", + "config.ignoreLegacyWarning": "Ignora o aviso de Git legado", + "config.ignoreLimitWarning": "Ignora o aviso quando houver muitas alterações em um repositório", + "config.defaultCloneDirectory": "O local padrão onde clonar um repositório git", + "config.enableSmartCommit": "Confirme todas as alterações quando não há modificações escalonadas." +} \ No newline at end of file diff --git a/i18n/ptb/extensions/grunt/out/main.i18n.json b/i18n/ptb/extensions/grunt/out/main.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..909b68937c6e81d499acc72de3e6ed2932eb2609 --- /dev/null +++ b/i18n/ptb/extensions/grunt/out/main.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "execFailed": "Auto detecção de Grunt falhou com erro: {0}" +} \ No newline at end of file diff --git a/i18n/ptb/extensions/grunt/package.i18n.json b/i18n/ptb/extensions/grunt/package.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..d79ce76907e732d3892f25d511d4ed46471e0fd4 --- /dev/null +++ b/i18n/ptb/extensions/grunt/package.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "config.grunt.autoDetect": "Controla se a deteção automática de tarefas do Grunt está ligado ou desligado. Padrão é ligado." +} \ No newline at end of file diff --git a/i18n/ptb/extensions/gulp/out/main.i18n.json b/i18n/ptb/extensions/gulp/out/main.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..51b05e4013effc4dc49426d22407f9b00fa383dc --- /dev/null +++ b/i18n/ptb/extensions/gulp/out/main.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "execFailed": "Auto detecção de gulp falhou com erro: {0}" +} \ No newline at end of file diff --git a/i18n/ptb/extensions/gulp/package.i18n.json b/i18n/ptb/extensions/gulp/package.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..fae292414c287ed394bd839b37d515b197a81f92 --- /dev/null +++ b/i18n/ptb/extensions/gulp/package.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "config.gulp.autoDetect": "Controla se a detecção automática de tarefas Gulp está ativada ou desativada. Por padrão, é ativado." +} \ No newline at end of file diff --git a/i18n/ptb/extensions/html/client/out/htmlMain.i18n.json b/i18n/ptb/extensions/html/client/out/htmlMain.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..314d1e5c58ac0715b94fecca485c1ac615a5455a --- /dev/null +++ b/i18n/ptb/extensions/html/client/out/htmlMain.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "htmlserver.name": "Servidor de Linguagem HTML" +} \ No newline at end of file diff --git a/i18n/ptb/extensions/html/package.i18n.json b/i18n/ptb/extensions/html/package.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..2f255a02e7f1c4b914878b7355dd19b5ff4e679a --- /dev/null +++ b/i18n/ptb/extensions/html/package.i18n.json @@ -0,0 +1,27 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "html.format.enable.desc": "Ativa/desativa o formatador HTML padrão (requer reinicialização)", + "html.format.wrapLineLength.desc": "Quantidade máxima de caracteres por linha (0 = desativar).", + "html.format.unformatted.desc": "Lista de tags, separados por vírgula, que não deveria ser reformatada. o padrão é 'nulo' para todas as tags listadas em https://www.w3.org/TR/html5/dom.html#phrasing-content.", + "html.format.contentUnformatted.desc": "Lista de tags, separada por vírgula, onde o conteúdo não deve ser reformatado. o padrão é 'nulo' para a tag 'pré'.", + "html.format.indentInnerHtml.desc": "Indentar secões e .", + "html.format.preserveNewLines.desc": "Se quebras de linha existentes antes de elementos deveriam ser preservadas. Só funciona antes de elementos, não dentro de rótulos ou para texto.", + "html.format.maxPreserveNewLines.desc": "Número máximo de quebras de linha a serem preservadas em um bloco. Use 'null' para ilimitado.", + "html.format.indentHandlebars.desc": "Formatar e indentar {{#foo}} e {{/ foo}}.", + "html.format.endWithNewline.desc": "Finalizar com uma nova linha.", + "html.format.extraLiners.desc": "Lista de rótulos, separados por vírgulas, que deveriam ter uma quebra de linha extra antes deles. 'null' admite o padrão \"head, body, /html\".", + "html.format.wrapAttributes.desc": "Agrupar atributos.", + "html.format.wrapAttributes.auto": "Agrupar atributos somente quando o tamanho da linha é excedido.", + "html.format.wrapAttributes.force": "Agrupar cada atributo exceto o primeiro.", + "html.format.wrapAttributes.forcealign": "Agrupar cada atributo, exceto o primeiro e manter alinhado.", + "html.format.wrapAttributes.forcemultiline": "Agrupar cada atributo.", + "html.suggest.angular1.desc": "Configura se o suporte da linguagem HTML interna sugere rótulos e propriedades do Angular V1.", + "html.suggest.ionic.desc": "Configura se o suporte da linguagem HTML interna sugere rótulos, propriedades e valores Ionic.", + "html.suggest.html5.desc": "Configura se o suporte da linguagem HTML interna sugere rótulos, propriedades e valores HTML5.", + "html.validate.scripts": "Configura se o suporte da linguagem HTML interna valida scripts embutidos.", + "html.validate.styles": "Configura se o suporte da linguagem HTML interna valida estilos embutidos." +} \ No newline at end of file diff --git a/i18n/ptb/extensions/jake/out/main.i18n.json b/i18n/ptb/extensions/jake/out/main.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..4cfc54e5fef5fd7a12d6e2a6388cec6bc9f7a90e --- /dev/null +++ b/i18n/ptb/extensions/jake/out/main.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "execFailed": "Auto detecção de Jake falhou com erro: {0}" +} \ No newline at end of file diff --git a/i18n/ptb/extensions/jake/package.i18n.json b/i18n/ptb/extensions/jake/package.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..94c08817c8d4e5832d3f1ce47c64eeb5c44ea53d --- /dev/null +++ b/i18n/ptb/extensions/jake/package.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "config.jake.autoDetect": "Controla se a detecção automática de tarefas Jake está ativada ou desativada. Por padrão, é ativado." +} \ No newline at end of file diff --git a/i18n/ptb/extensions/javascript/out/features/bowerJSONContribution.i18n.json b/i18n/ptb/extensions/javascript/out/features/bowerJSONContribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..84b277202e8efb541ab590737410fffcf0b51b7f --- /dev/null +++ b/i18n/ptb/extensions/javascript/out/features/bowerJSONContribution.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "json.bower.default": "Bower.json padrão", + "json.bower.error.repoaccess": "Falha na solicitação ao repositório bower: {0}", + "json.bower.latest.version": "último" +} \ No newline at end of file diff --git a/i18n/ptb/extensions/javascript/out/features/packageJSONContribution.i18n.json b/i18n/ptb/extensions/javascript/out/features/packageJSONContribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..9917fa36b2ea148fe6b931c75764cc9b33718c39 --- /dev/null +++ b/i18n/ptb/extensions/javascript/out/features/packageJSONContribution.i18n.json @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "json.package.default": "Package.json padrão", + "json.npm.error.repoaccess": "Falha na solicitação ao repositório NPM: {0}", + "json.npm.latestversion": "A versão do pacote mais recente no momento", + "json.npm.majorversion": "Combina com a versão principal mais recente (1.x.x)", + "json.npm.minorversion": "Combina a versão secundária mais recente (1.2.x)", + "json.npm.version.hover": "Última versão: {0}" +} \ No newline at end of file diff --git a/i18n/ptb/extensions/json/client/out/jsonMain.i18n.json b/i18n/ptb/extensions/json/client/out/jsonMain.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..4391c95a2ba22a5ea0f23556813387185b9c39a5 --- /dev/null +++ b/i18n/ptb/extensions/json/client/out/jsonMain.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "jsonserver.name": "Servidor de linguagem JSON" +} \ No newline at end of file diff --git a/i18n/ptb/extensions/json/package.i18n.json b/i18n/ptb/extensions/json/package.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..9d812f5b25317170c07a603dc12d284c8df60b4b --- /dev/null +++ b/i18n/ptb/extensions/json/package.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "json.schemas.desc": "Esquemas associadas a arquivos de JSON no projeto atual", + "json.schemas.url.desc": "Um URL para um esquema ou um caminho relativo a um esquema no diretório atual", + "json.schemas.fileMatch.desc": "Uma matriz de padrões de arquivos para correspondência ao resolver arquivos JSON para esquemas.", + "json.schemas.fileMatch.item.desc": "Um padrão de arquivos que pode conter '*' para fazer a correspondência ao resolver arquivos JSON para esquemas.", + "json.schemas.schema.desc": "A definição de esquema para o URL dado. O esquema precisa ser fornecido apenas para evitar acessos ao URL do esquema.", + "json.format.enable.desc": "Habilitar/desabilitar o formatador JSON padrão (requer reinicialização)", + "json.tracing.desc": "Loga a comunicação entre o VS Code e o servidor de linguagem JSON.", + "json.colorDecorators.enable.desc": "Habilita ou desabilita os decoradores de cor" +} \ No newline at end of file diff --git a/i18n/ptb/extensions/markdown/out/extension.i18n.json b/i18n/ptb/extensions/markdown/out/extension.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..0f4d1689d7f2e554d62712a162b21d5fe6513dcc --- /dev/null +++ b/i18n/ptb/extensions/markdown/out/extension.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "onPreviewStyleLoadError": "Não foi possível carregar o 'markdown.styles': {0}" +} \ No newline at end of file diff --git a/i18n/ptb/extensions/markdown/out/previewContentProvider.i18n.json b/i18n/ptb/extensions/markdown/out/previewContentProvider.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..f4e956aa5ebe6fc43501afe1b0994ac6888ca082 --- /dev/null +++ b/i18n/ptb/extensions/markdown/out/previewContentProvider.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "preview.securityMessage.text": "Scripts foram desabilitados neste documento", + "preview.securityMessage.title": "Scripts são desabilitados na pré-visualização de markdown. Altere a configuração de segurança de pré-visualização do Markdown para habilitar scripts", + "preview.securityMessage.label": "Aviso de segurança de scripts desabilitados" +} \ No newline at end of file diff --git a/i18n/ptb/extensions/markdown/out/security.i18n.json b/i18n/ptb/extensions/markdown/out/security.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..6b83ed6faed19d4909e24291fe238912d627e17f --- /dev/null +++ b/i18n/ptb/extensions/markdown/out/security.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "preview.showPreviewSecuritySelector.disallowScriptsForWorkspaceTitle": "Desabilitar a execução de scripts em pré-visualização de markdown para este espaço de trabalho", + "preview.showPreviewSecuritySelector.currentSelection": "Configuração atual", + "preview.showPreviewSecuritySelector.allowScriptsForWorkspaceTitle": "Habilitar a execução de scripts em pré-visualizações de markdown para este espaço de trabalho", + "preview.showPreviewSecuritySelector.title": "Alterar configurações de segurança para a pré-visualização do Markdown" +} \ No newline at end of file diff --git a/i18n/ptb/extensions/markdown/package.i18n.json b/i18n/ptb/extensions/markdown/package.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..83c2f99b160585f97c72a5534231352e4bfd6991 --- /dev/null +++ b/i18n/ptb/extensions/markdown/package.i18n.json @@ -0,0 +1,22 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "markdown.preview.doubleClickToSwitchToEditor.desc": "Duplo clique na pré-visualização markdown para alternar para o editor.", + "markdown.preview.fontFamily.desc": "Controla a família de fonte usada na pré-visualização de markdown.", + "markdown.preview.fontSize.desc": "Controla o tamanho da fonte em pixels usado na pré-visualização de markdown.", + "markdown.preview.lineHeight.desc": "Controla a altura de linha usada na pré-visualização de markdown. Este número é relativo ao tamanho de fonte.", + "markdown.preview.markEditorSelection.desc": "Marca a seleção atual do editor na pré-visualização de markdown.", + "markdown.preview.scrollEditorWithPreview.desc": "Quando a pré-visualização de markdown é rolada, atualiza a exibição do editor.", + "markdown.preview.scrollPreviewWithEditorSelection.desc": "Rola a pré-visualização do markdown para revelar a linha atualmente selecionada do editor.", + "markdown.preview.title": "Abrir a visualização", + "markdown.previewFrontMatter.dec": "Configura como o frontispicio YAML frente questão devem ser processado na pré-visualização de markdown. 'hide' remove o frontispicio. Caso contrário, o frontispicio é tratado como conteúdo de markdown.", + "markdown.previewSide.title": "Abre pré-visualização ao lado", + "markdown.showSource.title": "Exibir Código-Fonte", + "markdown.styles.dec": "Uma lista de URLs ou caminhos locais para folhas de estilo CSS para usar na pré-visualização do markdown. Caminhos relativos são interpretados em relação à pasta aberta no explorer. Se não houver nenhuma pasta aberta, eles são interpretados em relação ao local do arquivo markdown. Todos os ' \\' precisam ser escritos como ' \\ \\ '.", + "markdown.showPreviewSecuritySelector.title": "Alterar as configurações de segurança de pré-visualização do Markdown", + "markdown.preview.enableExperimentalExtensionApi.desc": "[Experimental] Permitir extensões para ampliar a pré-visualização do markdown.", + "markdown.trace.desc": "Habilitar log de depuração para a extensão do markdown." +} \ No newline at end of file diff --git a/i18n/ptb/extensions/merge-conflict/out/codelensProvider.i18n.json b/i18n/ptb/extensions/merge-conflict/out/codelensProvider.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..e3c986692386caf6ac4ab79ea43dae69376106a2 --- /dev/null +++ b/i18n/ptb/extensions/merge-conflict/out/codelensProvider.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "acceptCurrentChange": "Aceitar a mudança atual", + "acceptIncomingChange": "Aceitar a mudança de entrada", + "acceptBothChanges": "Aceitar as duas alterações", + "compareChanges": "Comparar as mudanças" +} \ No newline at end of file diff --git a/i18n/ptb/extensions/merge-conflict/out/commandHandler.i18n.json b/i18n/ptb/extensions/merge-conflict/out/commandHandler.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..6308a5d70f564f8a7a27f5281863bbd65cf42b7f --- /dev/null +++ b/i18n/ptb/extensions/merge-conflict/out/commandHandler.i18n.json @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "cursorNotInConflict": "Cursor do editor não está dentro de um conflito de mesclagem", + "compareChangesTitle": "{0}: Alterações Atuais ⟷ Alterações de Entrada", + "cursorOnCommonAncestorsRange": "Cursor do editor está dentro do bloco comum de ancestrais, favor mover para o bloco \"atual\" ou \"entrada\"", + "cursorOnSplitterRange": "Cursor do editor está dentro do separador de conflitos de mesclagem, por favor mova-o para o bloco \"atual\" ou \"entrada\"", + "noConflicts": "Nenhum conflito de mesclagem encontrado neste arquivo", + "noOtherConflictsInThisFile": "Não há outros conflitos de mesclagem dentro desse arquivo" +} \ No newline at end of file diff --git a/i18n/ptb/extensions/merge-conflict/out/mergeDecorator.i18n.json b/i18n/ptb/extensions/merge-conflict/out/mergeDecorator.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..2b29ae4a254ca74f4b66c8e2f85bc9e508ba888a --- /dev/null +++ b/i18n/ptb/extensions/merge-conflict/out/mergeDecorator.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "currentChange": "(Mudança Atual)", + "incomingChange": "(Próxima Mudança)" +} \ No newline at end of file diff --git a/i18n/ptb/extensions/merge-conflict/package.i18n.json b/i18n/ptb/extensions/merge-conflict/package.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..ad47caacee95b7326c1a5f436722d492e9dabb85 --- /dev/null +++ b/i18n/ptb/extensions/merge-conflict/package.i18n.json @@ -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. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "command.category": "Conflito de Mesclagem", + "command.accept.all-incoming": "Aceitar todas entradas", + "command.accept.all-both": "Aceitar todas as duas", + "command.accept.current": "Aceitar a corrente", + "command.accept.incoming": "Aceitar entrada", + "command.accept.selection": "Aceitar a seleção", + "command.accept.both": "Aceitar Ambos", + "command.next": "Próximo conflito", + "command.previous": "Conflito anterior", + "command.compare": "Comparar o conflito atual", + "config.title": "Mesclar conflitos", + "config.codeLensEnabled": "Habilitar/Desabilitar o conflito de mesclagem no bloco CodeLens dentro do editor", + "config.decoratorsEnabled": "Habilitar/Desabilitar decoradores de mesclagem de conflitos dentro do editor" +} \ No newline at end of file diff --git a/i18n/ptb/extensions/npm/package.i18n.json b/i18n/ptb/extensions/npm/package.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..8d33aa31e7fdd0c78a196ee616b43242f5c8c0f8 --- /dev/null +++ b/i18n/ptb/extensions/npm/package.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "config.npm.autoDetect": "Controla se a deteção automática de scripts npm está ligado ou desligado. O padrão é ligado." +} \ No newline at end of file diff --git a/i18n/ptb/extensions/php/out/features/validationProvider.i18n.json b/i18n/ptb/extensions/php/out/features/validationProvider.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..9e0ce64f472fb1cf17d7c3d9a467822c8745b7cd --- /dev/null +++ b/i18n/ptb/extensions/php/out/features/validationProvider.i18n.json @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "php.useExecutablePath": "Você permite {0} (definido como uma configuração do espaço de trabalho) a ser executado para lint de arquivos PHP?", + "php.yes": "Permitir", + "php.no": "Não permitir", + "wrongExecutable": "Não é possível validar {0} pois não é um executável php válido. Use a configuração 'php.validate.executablePath' para configurar o executável do PHP.", + "noExecutable": "Não é possível validar porque nenhum executável PHP está definido. Use a configuração 'php.validate.executablePath' para configurar o executável do PHP.", + "unknownReason": "Falha ao executar o php usando o caminho: {0}. O motivo é desconhecido." +} \ No newline at end of file diff --git a/i18n/ptb/extensions/php/package.i18n.json b/i18n/ptb/extensions/php/package.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..7ec916f5dd829e06e213f07790ee93f4a5c2f1a3 --- /dev/null +++ b/i18n/ptb/extensions/php/package.i18n.json @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "configuration.suggest.basic": "Configura se as sugestões intrínsecas da linguagem PHP estão habilitadas. O suporte sugere globais e variáveis do PHP.", + "configuration.validate.enable": "Habilita/desabilita a validação interna do PHP.", + "configuration.validate.executablePath": "Aponta para o executável do PHP.", + "configuration.validate.run": "Se o linter é executado ao salvar ou ao digitar.", + "configuration.title": "PHP", + "commands.categroy.php": "PHP", + "command.untrustValidationExecutable": "Desabilita a validação de executável do PHP (definida como configuração do espaço de trabalho)" +} \ No newline at end of file diff --git a/i18n/ptb/extensions/typescript/out/features/bufferSyncSupport.i18n.json b/i18n/ptb/extensions/typescript/out/features/bufferSyncSupport.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..3cc3ca76ce71956dcd87e2e3a357311731fabd43 --- /dev/null +++ b/i18n/ptb/extensions/typescript/out/features/bufferSyncSupport.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "versionMismatch": "Usando o TypeScript ({1}) para recursos do editor. TypeScript ({0}) está instalado globalmente em sua máquina. Erros no VS Code podem diferir dos erros TSC", + "moreInformation": "Mais informações", + "doNotCheckAgain": "Não verificar novamente", + "close": "Fechar", + "updateTscCheck": "Atualizada configuração de usuário 'typescript.check.tscVersion' para false " +} \ No newline at end of file diff --git a/i18n/ptb/extensions/typescript/out/features/completionItemProvider.i18n.json b/i18n/ptb/extensions/typescript/out/features/completionItemProvider.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..58097d90545cceb60a28e3749029b31d3fff71a1 --- /dev/null +++ b/i18n/ptb/extensions/typescript/out/features/completionItemProvider.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "acquiringTypingsLabel": "Adquirindo digitações...", + "acquiringTypingsDetail": "Adquirindo definições de digitações para o Intellisense." +} \ No newline at end of file diff --git a/i18n/ptb/extensions/typescript/out/features/directiveCommentCompletionProvider.i18n.json b/i18n/ptb/extensions/typescript/out/features/directiveCommentCompletionProvider.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..99716f32145fddb0faaf9d3477b7517c29558ccc --- /dev/null +++ b/i18n/ptb/extensions/typescript/out/features/directiveCommentCompletionProvider.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "ts-check": "Habilita verificação semântica em um arquivo JavaScript. Deve estar no topo de um arquivo.", + "ts-nocheck": "Desabilita verificação semântica em um arquivo JavaScript. Deve estar no topo de um arquivo.", + "ts-ignore": "Suprime erros de @ts-check na próxima linha de um arquivo." +} \ No newline at end of file diff --git a/i18n/ptb/extensions/typescript/out/features/implementationsCodeLensProvider.i18n.json b/i18n/ptb/extensions/typescript/out/features/implementationsCodeLensProvider.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..ef8dd6423d6a6a39a4d4cd5e673b786139904dad --- /dev/null +++ b/i18n/ptb/extensions/typescript/out/features/implementationsCodeLensProvider.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "oneImplementationLabel": "1 implementação", + "manyImplementationLabel": "{0} implementações", + "implementationsErrorLabel": "Não foi possível determinar implementações" +} \ No newline at end of file diff --git a/i18n/ptb/extensions/typescript/out/features/jsDocCompletionProvider.i18n.json b/i18n/ptb/extensions/typescript/out/features/jsDocCompletionProvider.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..20b08d7679b9dffd8a5ab82d98c20fbcd4e3caba --- /dev/null +++ b/i18n/ptb/extensions/typescript/out/features/jsDocCompletionProvider.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "typescript.jsDocCompletionItem.documentation": "Comentário JSDoc" +} \ No newline at end of file diff --git a/i18n/ptb/extensions/typescript/out/features/referencesCodeLensProvider.i18n.json b/i18n/ptb/extensions/typescript/out/features/referencesCodeLensProvider.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..1838c3c1621177e45c31bdea9bc0d22e89751f30 --- /dev/null +++ b/i18n/ptb/extensions/typescript/out/features/referencesCodeLensProvider.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "oneReferenceLabel": "1 referência", + "manyReferenceLabel": "{0} referências", + "referenceErrorLabel": "Não foi possível determinar as referências" +} \ No newline at end of file diff --git a/i18n/ptb/extensions/typescript/out/typescriptMain.i18n.json b/i18n/ptb/extensions/typescript/out/typescriptMain.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..82e6c288fb198f9718cd0fb13d0bcf467847c083 --- /dev/null +++ b/i18n/ptb/extensions/typescript/out/typescriptMain.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "typescript.projectConfigNoWorkspace": "Favor abrir uma pasta no VS Code para usar um projeto TypeScript ou JavaScript", + "typescript.projectConfigUnsupportedFile": "Não foi possível determinar o projeto TypeScript ou JavaScript. Tipo de arquivo não suportado", + "typescript.projectConfigCouldNotGetInfo": "Não foi possível determinar o projeto TypeScript ou JavaScript", + "typescript.noTypeScriptProjectConfig": "Arquivo não é parte de um projeto TypeScript", + "typescript.noJavaScriptProjectConfig": "Arquivo não é parte de um projeto JavaScript", + "typescript.configureTsconfigQuickPick": "Configurar tsconfig.json", + "typescript.configureJsconfigQuickPick": "Configurar jsconfig.json", + "typescript.projectConfigLearnMore": "Saber Mais" +} \ No newline at end of file diff --git a/i18n/ptb/extensions/typescript/out/typescriptServiceClient.i18n.json b/i18n/ptb/extensions/typescript/out/typescriptServiceClient.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..37527e507b0ea5b1175dccdcf4ad358fc14626f7 --- /dev/null +++ b/i18n/ptb/extensions/typescript/out/typescriptServiceClient.i18n.json @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "noServerFound": "O caminho {0} não aponta para uma instalação de tsserver válida. Voltando para a versão do TypeScript empacotada.", + "noBundledServerFound": "O tsserver do VS Code foi excluído por outra aplicação, como por exemplo uma ferramenta de detecção de virus mal-comportada. Favor reinstalar o VS Code.", + "versionNumber.custom": "personalizado", + "serverCouldNotBeStarted": "Servidor de linguagem TypeScript não pôde ser iniciado. Mensagem de erro é: {0}", + "useVSCodeVersionOption": "Usar a Versão do VS Code", + "activeVersion": "Atualmente ativo", + "useWorkspaceVersionOption": "Use a versão de área de trabalho", + "learnMore": "Saiba Mais", + "selectTsVersion": "Selecione a versão do TypeScript usada para os recursos de linguagem JavaScript e TypeScript", + "typescript.openTsServerLog.notSupported": "Logging de TS Server requer TS TS 2.2.2+", + "typescript.openTsServerLog.loggingNotEnabled": "Logging de TS Server está desligado. Por favor configure 'typescript.tsserver.log' e reinicie o TS Server para habilitar o log", + "typescript.openTsServerLog.enableAndReloadOption": "Habilitar logging e reniciar TS server", + "typescript.openTsServerLog.noLogFile": "O TS Server não iniciou o logging.", + "openTsServerLog.openFileFailedFailed": "Não foi possível abrir o arquivo de log do TS Server", + "serverDiedAfterStart": "O serviço de linguagem TypeScript morreu 5 vezes depois que começou. O serviço não será reiniciado.", + "serverDiedReportIssue": "Reportar Problema", + "serverDied": "O serviço TypeScript morreu inesperadamente 5 vezes nos últimos 5 minutos." +} \ No newline at end of file diff --git a/i18n/ptb/extensions/typescript/out/utils/logger.i18n.json b/i18n/ptb/extensions/typescript/out/utils/logger.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..bc738f43d0c37059f5f771d3763cdf52b10ab10d --- /dev/null +++ b/i18n/ptb/extensions/typescript/out/utils/logger.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "channelName": "TypeScript" +} \ No newline at end of file diff --git a/i18n/ptb/extensions/typescript/out/utils/projectStatus.i18n.json b/i18n/ptb/extensions/typescript/out/utils/projectStatus.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..6f06552e9293a31f05d3c3720b4060d8ea5a22d0 --- /dev/null +++ b/i18n/ptb/extensions/typescript/out/utils/projectStatus.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "hintExclude": "Para habilitar os recursos de linguagem JavaScript/TypeScipt em todo o projeto, excluir pastas com muitos arquivos, como: {0}", + "hintExclude.generic": "Para habilitar os recursos de linguagem JavaScript/TypeScipt em todo o projeto, excluir pastas grandes com arquivos em que você não trabalha.", + "large.label": "Configurar exclusões", + "hintExclude.tooltip": "Para habilitar os recursos de linguagem JavaScript/TypeScipt em todo o projeto, excluir pastas grandes com arquivos em que você não trabalha." +} \ No newline at end of file diff --git a/i18n/ptb/extensions/typescript/out/utils/typingsStatus.i18n.json b/i18n/ptb/extensions/typescript/out/utils/typingsStatus.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..e6e29d6431a9b45ff5837f23cce4e23603624de8 --- /dev/null +++ b/i18n/ptb/extensions/typescript/out/utils/typingsStatus.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "installingPackages": "Buscando dados para melhor IntelliSense do TypeScript", + "typesInstallerInitializationFailed.title": "Não foi possível instalar arquivos de tipagens para recursos da linguagem JavaScript. Por favor, certifique-se de que a NPM está instalado ou configure 'typescript.npm' em suas configurações de usuário", + "typesInstallerInitializationFailed.moreInformation": "Mais informações", + "typesInstallerInitializationFailed.doNotCheckAgain": "Não verificar novamente", + "typesInstallerInitializationFailed.close": "Fechar" +} \ No newline at end of file diff --git a/i18n/ptb/extensions/typescript/package.i18n.json b/i18n/ptb/extensions/typescript/package.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..88b67be90006f28f637e859d01c0c99b5d903cce --- /dev/null +++ b/i18n/ptb/extensions/typescript/package.i18n.json @@ -0,0 +1,48 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "typescript.reloadProjects.title": "Recarregar Projeto", + "javascript.reloadProjects.title": "Recarregar Projeto", + "configuration.typescript": "TypeScript", + "typescript.useCodeSnippetsOnMethodSuggest.dec": "Funções completas com a assinatura do parâmetro.", + "typescript.tsdk.desc": "Especifica o caminho da pasta que contém os arquivos tsserver e lib*.d.ts para usar.", + "typescript.disableAutomaticTypeAcquisition": "Desabilita a aquisição automática de tipo. Requer TypeScript > = 2.0.6 e um reinício depois da alteração.", + "typescript.check.tscVersion": "Verifica se um ima instalação global do compilador TypeScript (por exemplo, tsc) difere do serviço de linguagem TypeScript usado.", + "typescript.tsserver.log": "Habilita o log do servidor TS para um arquivo. Este log pode ser usado para diagnosticar problemas do servidor de TS. O log pode conter caminhos de arquivo, código-fonte e outras informações potencialmente confidenciais do seu projeto.", + "typescript.tsserver.trace": "Habilita o rastreamento de mensagens enviadas para o servidor de TS. Este rastreamento pode ser usado para diagnosticar problemas do servidor de TS. O rastreamento pode conter caminhos de arquivo, código-fonte e outras informações potencialmente confidenciais do seu projeto.", + "typescript.validate.enable": "Habilita/Desabilita a validação TypeScript.", + "typescript.format.enable": "Habilita/Desabilita o formatador padrão TypeScript.", + "javascript.format.enable": "Habilita/Desabilita o formatador padrão JavaScript.", + "format.insertSpaceAfterCommaDelimiter": "Define o tratamento de espaços após um delimitador vírgula.", + "format.insertSpaceAfterConstructor": "Define a manipulação de espaços após a palavra-chave do construtor. Requer TypeScript > = 2.3.0.", + "format.insertSpaceAfterSemicolonInForStatements": "Define o tratamento de espaços após um ponto e vírgula para um comando.", + "format.insertSpaceBeforeAndAfterBinaryOperators": "Define o tratamento de espaços após um operador binário.", + "format.insertSpaceAfterKeywordsInControlFlowStatements": "Define o tratamento de espaços após palavras-chave em um comando de controle de fluxo.", + "format.insertSpaceAfterFunctionKeywordForAnonymousFunctions": "Define o tratamento de espaços após uma palavra-chave de função para funções anônimas.", + "format.insertSpaceBeforeFunctionParenthesis": "Define a manipulação de espaços antes de parênteses do argumento de função. Requer TypeScript > = 2.1.5.", + "format.insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": "Define a manipulação de espaços após abrir e antes de fechar parênteses não vazios.", + "format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": "Define a manipulação de espaços após abrir e antes de fechar colchetes não vazios.", + "format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": "Define a manipulação de espaços após abrir e antes de fechar chaves não vazias. Requer TypeScript >= 2.3.0.", + "format.insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": "Define a manipulação de espaços após abrir e antes de fechar chaves de cadeias de caracteres de modelos. Requer TypeScript >= 2.0.6.", + "format.insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces": "Define a manipulação de espaços após abrir e antes de fechar chaves de expressões JSX. Requer TypeScript >= 2.0.6.", + "format.placeOpenBraceOnNewLineForFunctions": "Define-se uma chave de abertura é colocada em uma nova linha para funções ou não.", + "format.placeOpenBraceOnNewLineForControlBlocks": "Define-se uma chave de abertura é colocada em uma nova linha para blocos de controle ou não.", + "javascript.validate.enable": "Habilitar/Desabilitar validação JavaScript.", + "typescript.goToProjectConfig.title": "Ir para a Configuração do Projeto", + "javascript.goToProjectConfig.title": "Ir para a Configuração do Projeto", + "javascript.referencesCodeLens.enabled": "Habilitar/desabilitar referências CodeLens em arquivos JavaScript.", + "typescript.referencesCodeLens.enabled": "Habilitar/desabilitar referências CodeLens em arquivos TypeScript. Requer TypeScript > = 2.0.6.", + "typescript.implementationsCodeLens.enabled": "Habilitar/desabilitar implementações CodeLens. Requer TypeScript > = 2.0.6.", + "typescript.openTsServerLog.title": "Abrir arquivo de log do servidor TS", + "typescript.restartTsServer": "Reiniciar o servidor TS", + "typescript.selectTypeScriptVersion.title": "Selecionar a versão do JavaScript", + "jsDocCompletion.enabled": "Habilitar/Desabilitar comentários JSDoc automáticos.", + "javascript.implicitProjectConfig.checkJs": "Habilitar/desabilitar verificação semântica de arquivos JavaScript. Os arquivos existentes jsconfig.json ou tsconfig.json substituem essa configuração. Requer TypeScript > = 2.3.1.", + "typescript.npm": "Especifica o caminho para o executável do NPM usado para Aquisição de Tipo Automático. Requer TypeScript > = 2.3.4.", + "typescript.check.npmIsInstalled": "Verificar se o NPM está instalado para aquisição automática de tipo.", + "javascript.nameSuggestions": "Habilitar/desabilitar incluindo nomes exclusivos do arquivo nas listas de sugestão de JavaScript.", + "typescript.tsc.autoDetect": "Controla se a auto-detecção de tarefas tsc estão ligadas ou desligadas." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/base/browser/ui/actionbar/actionbar.i18n.json b/i18n/ptb/src/vs/base/browser/ui/actionbar/actionbar.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..4ecb2c803f4cd296354114cedc1d8ec138c4677c --- /dev/null +++ b/i18n/ptb/src/vs/base/browser/ui/actionbar/actionbar.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "titleLabel": "{0} ({1})" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/base/browser/ui/aria/aria.i18n.json b/i18n/ptb/src/vs/base/browser/ui/aria/aria.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..e558eb6187aa10de31c16b37cfe7fb42ac2de36c --- /dev/null +++ b/i18n/ptb/src/vs/base/browser/ui/aria/aria.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "repeated": "{0} (ocorreu novamente)" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/base/browser/ui/findinput/findInput.i18n.json b/i18n/ptb/src/vs/base/browser/ui/findinput/findInput.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..524ba7bb4a79b32c8bee63cb916eac4d984d049e --- /dev/null +++ b/i18n/ptb/src/vs/base/browser/ui/findinput/findInput.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "defaultLabel": "entrada" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/base/browser/ui/findinput/findInputCheckboxes.i18n.json b/i18n/ptb/src/vs/base/browser/ui/findinput/findInputCheckboxes.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..1a477ef1e6d2bc63cc0bacf29bf5f51be336aaaa --- /dev/null +++ b/i18n/ptb/src/vs/base/browser/ui/findinput/findInputCheckboxes.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "caseDescription": "Diferenciar Maiúsculas de Minúsculas", + "wordsDescription": "Coincidir Palavra Inteira", + "regexDescription": "Usar Expressão Regular" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/base/browser/ui/inputbox/inputBox.i18n.json b/i18n/ptb/src/vs/base/browser/ui/inputbox/inputBox.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..0b282bdee8a5140dc6c3eff7b02b6de4d425394d --- /dev/null +++ b/i18n/ptb/src/vs/base/browser/ui/inputbox/inputBox.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "alertErrorMessage": "Erro: {0}", + "alertWarningMessage": "Aviso: {0}", + "alertInfoMessage": "Informações: {0}" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json b/i18n/ptb/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..ff9f2c98cbb22a485a392a478ef9b851a4f1b931 --- /dev/null +++ b/i18n/ptb/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "imgMeta": "{0}x{1} {2}", + "largeImageError": "A imagem é muito grande para ser exibida no editor.", + "resourceOpenExternalButton": "Abrir imagem usando um programa externo?", + "nativeBinaryError": "O arquivo não pode ser exibido no editor porque é binário, muito grande ou usa uma codificação de texto sem suporte.", + "sizeB": "{0}B", + "sizeKB": "{0}KB", + "sizeMB": "{0}MB", + "sizeGB": "{0}GB", + "sizeTB": "{0}TB" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/base/browser/ui/toolbar/toolbar.i18n.json b/i18n/ptb/src/vs/base/browser/ui/toolbar/toolbar.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..4a046b57296cd86f207b7427a8eb699c711bde24 --- /dev/null +++ b/i18n/ptb/src/vs/base/browser/ui/toolbar/toolbar.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "more": "Mais" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/base/common/errorMessage.i18n.json b/i18n/ptb/src/vs/base/common/errorMessage.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..8653d71b65e2719ca8c3a1f400f2121078d32319 --- /dev/null +++ b/i18n/ptb/src/vs/base/common/errorMessage.i18n.json @@ -0,0 +1,17 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "message": "{0}. Código de erro: {1}", + "error.permission.verbose": "Permissão Negada (HTTP {0})", + "error.permission": "Permissão Negada", + "error.http.verbose": "{0} (HTTP {1}: {2})", + "error.http": "{0} (HTTP {1})", + "error.connection.unknown.verbose": "Erro de Conexão Desconhecido ({0})", + "error.connection.unknown": "Ocorreu um erro de conexão desconhecido. Você não está mais conectado à Internet ou o servidor que você está conectado está offline.", + "stackTrace.format": "{0}: {1}", + "error.defaultMessage": "Ocorreu um erro desconhecido. Consulte o log para obter mais detalhes.", + "error.moreErrors": "{0} ({1} erros no total)" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/base/common/jsonErrorMessages.i18n.json b/i18n/ptb/src/vs/base/common/jsonErrorMessages.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..d6108586df8b1ff6fab7bb0bd9ee68e2c4d537ac --- /dev/null +++ b/i18n/ptb/src/vs/base/common/jsonErrorMessages.i18n.json @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "error.invalidSymbol": "Símbolo inválido", + "error.invalidNumberFormat": "Formato de número inválido", + "error.propertyNameExpected": "Nome de propriedade esperado", + "error.valueExpected": "Valor esperado", + "error.colonExpected": "Dois-pontos esperados", + "error.commaExpected": "Vírgula esperada", + "error.closeBraceExpected": "Chave de fechamento esperada", + "error.closeBracketExpected": "Colchete de fechamento esperado", + "error.endOfFileExpected": "Fim do arquivo esperado" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/base/common/keybindingLabels.i18n.json b/i18n/ptb/src/vs/base/common/keybindingLabels.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a --- /dev/null +++ b/i18n/ptb/src/vs/base/common/keybindingLabels.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{} \ No newline at end of file diff --git a/i18n/ptb/src/vs/base/common/processes.i18n.json b/i18n/ptb/src/vs/base/common/processes.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..165322e59523438da0f0114bb485eecb7cf78ed8 --- /dev/null +++ b/i18n/ptb/src/vs/base/common/processes.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "ExecutableParser.commandMissing": "Erro: informações de executável devem definir um comando do tipo string", + "ExecutableParser.isShellCommand": "Aviso: IsShellCommand deve ser to tipo booleano. Ignorando valor {0}", + "ExecutableParser.args": "Aviso: args deve ser do tipo string[]. Ignorando valor {0}.", + "ExecutableParser.invalidCWD": "Aviso: options.cwd deve ser do tipo string. Ignorando valor {0}." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/base/common/severity.i18n.json b/i18n/ptb/src/vs/base/common/severity.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..7aff8041180ffbbaa3dd950e6b5f41ccc08da7bd --- /dev/null +++ b/i18n/ptb/src/vs/base/common/severity.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "sev.error": "Erro", + "sev.warning": "Aviso", + "sev.info": "Informações" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/base/node/processes.i18n.json b/i18n/ptb/src/vs/base/node/processes.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..3584dc9b15e34c3142c01ba0ffdfcb15d8a60045 --- /dev/null +++ b/i18n/ptb/src/vs/base/node/processes.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "TaskRunner.UNC": "Não é possível executar um comando shell em uma unidade UNC." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/base/node/zip.i18n.json b/i18n/ptb/src/vs/base/node/zip.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..a577f90ea2e5389c1d15b71a27b7de1d70a0e1a8 --- /dev/null +++ b/i18n/ptb/src/vs/base/node/zip.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "notFound": "{0} não encontrado dentro do zip." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/base/parts/quickopen/browser/quickOpenModel.i18n.json b/i18n/ptb/src/vs/base/parts/quickopen/browser/quickOpenModel.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..1d0f7ebd47a0a7e987e5ab7c8967b3b82a6b9ce8 --- /dev/null +++ b/i18n/ptb/src/vs/base/parts/quickopen/browser/quickOpenModel.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "quickOpenAriaLabelEntry": "{0}, seletor", + "quickOpenAriaLabel": "seletor" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/base/parts/quickopen/browser/quickOpenWidget.i18n.json b/i18n/ptb/src/vs/base/parts/quickopen/browser/quickOpenWidget.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..ca3d8a5266afb14c943d3597f16211aa6356d0cf --- /dev/null +++ b/i18n/ptb/src/vs/base/parts/quickopen/browser/quickOpenWidget.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "quickOpenAriaLabel": "Seletor rápido. Digite para filtrar resultados.", + "treeAriaLabel": "Seletor rápido" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/base/parts/tree/browser/treeDefaults.i18n.json b/i18n/ptb/src/vs/base/parts/tree/browser/treeDefaults.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..5e72c45050c6e080fb517969069c7e3c363de218 --- /dev/null +++ b/i18n/ptb/src/vs/base/parts/tree/browser/treeDefaults.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "collapse": "Recolher" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/code/electron-main/menus.i18n.json b/i18n/ptb/src/vs/code/electron-main/menus.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..91b837832c4a83888c06310c5a6d74037a70127d --- /dev/null +++ b/i18n/ptb/src/vs/code/electron-main/menus.i18n.json @@ -0,0 +1,177 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "mFile": "&&Arquivo", + "mEdit": "&&Editar", + "mSelection": "&&Seleção", + "mView": "&&Visualizar", + "mGoto": "&&Ir", + "mDebug": "&&Depurar", + "mWindow": "Janela", + "mHelp": "&&Ajuda", + "mTask": "&&Tarefas", + "miNewWindow": "Nova &&Janela", + "mAbout": "Sobre {0}", + "mServices": "Serviços", + "mHide": "Ocultar {0}", + "mHideOthers": "Ocultar Outros", + "mShowAll": "Mostrar Tudo", + "miQuit": "Sair de {0}", + "miNewFile": "&&Novo Arquivo", + "miOpen": "&&Abrir", + "miOpenFolder": "Abrir &&Pasta", + "miOpenFile": "&&Abrir Arquivo", + "miOpenRecent": "Abrir &&Recente", + "miSave": "&&Salvar", + "miSaveAs": "Salvar &&Como...", + "miSaveAll": "Salvar &&Tudo", + "miAutoSave": "Salvar Automaticamente", + "miRevert": "Re&&verter Arquivo", + "miCloseWindow": "Fe&&char Janela", + "miCloseFolder": "Fechar &&Pasta", + "miCloseEditor": "Fechar &&Editor", + "miExit": "Sai&&r", + "miOpenSettings": "&&Configurações", + "miOpenKeymap": "Atalhos de &&Teclado", + "miOpenKeymapExtensions": "Extensões de &&Mapeamento de Teclado", + "miOpenSnippets": "Trechos de Có&&digo do Usuário", + "miSelectColorTheme": "Cor do T&&ema", + "miSelectIconTheme": "&&Ícone de Arquivo do Tema", + "miPreferences": "&&Preferências", + "miReopenClosedEditor": "&&Reabrir Editor Fechado", + "miMore": "&&Mais...", + "miClearRecentOpen": "&&Limpar Arquivos Recentes", + "miUndo": "&&Desfazer", + "miRedo": "&&Refazer", + "miCut": "Cor&&tar", + "miCopy": "&&Copiar", + "miPaste": "Co&&lar", + "miFind": "&&Localizar", + "miReplace": "&&Substituir", + "miFindInFiles": "Localizar &&nos Arquivos", + "miReplaceInFiles": "Substituir &&nos Arquivos", + "miEmmetExpandAbbreviation": "Emmet: E&&xpandir Abreviação", + "miShowEmmetCommands": "E&&mmet...", + "miToggleLineComment": "&&Alternar Comentário de Linha", + "miToggleBlockComment": "Alternar Comentário de &&Bloco", + "miMultiCursorAlt": "Use Alt+clique para Multi-Cursor", + "miMultiCursorCmd": "Use o Cmd+clique para Multi-Cursor", + "miMultiCursorCtrl": "Use Ctrl+clique para Multi-Cursor", + "miInsertCursorAbove": "&&Inserir cursor acima", + "miInsertCursorBelow": "Inserir cursor a&&baixo", + "miInsertCursorAtEndOfEachLineSelected": "Adicionar C&&ursores ao Final das Linhas", + "miAddSelectionToNextFindMatch": "Adicionar &&próxima ocorrência", + "miAddSelectionToPreviousFindMatch": "Adicionar ocorrência a&&nterior ", + "miSelectHighlights": "Selecionar todas as &&ocorrências", + "miCopyLinesUp": "&&Copiar linha acima", + "miCopyLinesDown": "C&&opiar linha abaixo", + "miMoveLinesUp": "Mo&&ver linha para cima", + "miMoveLinesDown": "Mover &&linha para baixo", + "miSelectAll": "&&Selecionar Tudo", + "miSmartSelectGrow": "&&Expandir seleção", + "miSmartSelectShrink": "&&Reduzir seleção", + "miViewExplorer": "&&Explorador", + "miViewSearch": "&&Pesquisar", + "miViewSCM": "S&&CM", + "miViewDebug": "&&Depurar", + "miViewExtensions": "E&&xtensões", + "miToggleOutput": "&&Saída", + "miToggleDebugConsole": "Con&&sole de Depuração", + "miToggleIntegratedTerminal": "Terminal &&Integrado", + "miMarker": "&&Problemas", + "miAdditionalViews": "&&Visualizações Adicionais", + "miCommandPalette": "&&Paleta de comando", + "miToggleFullScreen": "Alternar &&Tela Inteira", + "miToggleZenMode": "Alternar modo Zen", + "miToggleMenuBar": "Alternar &&Barra de Menus", + "miSplitEditor": "Dividir &&editor", + "miToggleEditorLayout": "Alternar &&Layout do Grupo de Editor", + "miToggleSidebar": "&&Alternar Barra Lateral", + "miMoveSidebarRight": "&&Mover a barra lateral para a direita", + "miMoveSidebarLeft": "&&Mover a barra lateral para a esquerda", + "miTogglePanel": "Alternar &&Painel", + "miHideStatusbar": "&&Ocultar Barra de Status", + "miShowStatusbar": "&&Mostrar Barra de Status", + "miHideActivityBar": "Ocultar Barra de &&Atividades", + "miShowActivityBar": "Mostrar Barra de &&Atividades", + "miToggleWordWrap": "Alternar &&Quebra de Linha", + "miToggleRenderWhitespace": "Alternar &&Renderização de Espaços em Branco", + "miToggleRenderControlCharacters": "Alternar &&Caracteres de Controle", + "miZoomIn": "&&Ampliar", + "miZoomOut": "Red&&uzir", + "miZoomReset": "&&Reinicializar Zoom", + "miBack": "&&Voltar", + "miForward": "&&Avançar", + "miNextEditor": "&&Próximo Editor", + "miPreviousEditor": "&&Editor Anterior", + "miNextEditorInGroup": "&&Próximo Editor Usado no Grupo", + "miPreviousEditorInGroup": "&&Editor Anterior Usado no Grupo", + "miSwitchEditor": "Trocar &&Editor", + "miFocusFirstGroup": "&&Primeiro Grupo", + "miFocusSecondGroup": "&&Segundo Grupo", + "miFocusThirdGroup": "&&Terceiro Grupo", + "miNextGroup": "&&Próximo Grupo", + "miPreviousGroup": "&&Grupo Anterior", + "miSwitchGroup": "Trocar &&Grupo", + "miGotoFile": "Ir para &&Arquivo...", + "miGotoSymbolInFile": "Ir para o &&Símbolo no Arquivo...", + "miGotoSymbolInWorkspace": "Ir para o Símbolo em &&Área de Trabalho", + "miGotoDefinition": "Ir para &&Definição", + "miGotoTypeDefinition": "Ir para a &&definição de tipo", + "miGotoImplementation": "Ir para a &&implementação", + "miGotoLine": "Ir para &&Linha...", + "miStartDebugging": "Iniciar Depuração", + "miStartWithoutDebugging": "Iniciar &&Sem Depuração", + "miStopDebugging": "&&Parar Depuração", + "miRestart Debugging": "&&Reiniciar Depuração", + "miOpenConfigurations": "Abrir &&Configurações", + "miAddConfiguration": "Adicionar Configuração...", + "miStepOver": "Pular &&Sobre", + "miStepInto": "Pular &&Dentro", + "miStepOut": "Pular &&Fora", + "miContinue": "&&Continuar", + "miToggleBreakpoint": "Alternar &&Ponto de Parada", + "miConditionalBreakpoint": "Ponto de Parada &&Condicional...", + "miColumnBreakpoint": "Ponto de Parada de C&&oluna", + "miFunctionBreakpoint": "Ponto de Parada de &&Função...", + "miNewBreakpoint": "&&Novo Ponto de Parada", + "miEnableAllBreakpoints": "Habilitar Todos os Pontos de Parada", + "miDisableAllBreakpoints": "Desabilitar T&&odos os Pontos de Parada", + "miRemoveAllBreakpoints": "Remover &&Todos os Pontos de Parada", + "miInstallAdditionalDebuggers": "&&Instalar Depuradores Adicionais...", + "mMinimize": "Minimizar", + "mBringToFront": "Trazer Tudo para a Frente", + "miSwitchWindow": "Alternar &&Janela...", + "miToggleDevTools": "&&Alternar Ferramentas do Desenvolvedor", + "miAccessibilityOptions": "&&Opções de Acessibilidade", + "miReportIssues": "Relatar &&Problemas", + "miWelcome": "&&Bem-vindo", + "miInteractivePlayground": "Playground &&Interativo", + "miDocumentation": "&&Documentação", + "miReleaseNotes": "&&Notas de Versão", + "miKeyboardShortcuts": "Referência de &&Atalhos de Teclado", + "miIntroductoryVideos": "&&Vídeos Introdutórios", + "miTwitter": "&&Junte-se a nós no Twitter", + "miUserVoice": "&&Pesquisar Solicitações de Recursos", + "miLicense": "&&Exibir Licença", + "miPrivacyStatement": "&&Política de Privacidade", + "miAbout": "&&Sobre", + "miRunTask": "&&Executar Tarefa...", + "miRestartTask": "R&&einiciar Tarefa", + "miTerminateTask": "&&Finalizar Tarefa", + "miBuildTask": "&&Tarefa de Compilação.", + "miTestTask": "Tarefa de T&&este", + "miShowTaskLog": "&&Visualizar o Log de Tarefas", + "accessibilityOptionsWindowTitle": "Opções de Acessibilidade", + "miRestartToUpdate": "Reinicie para Atualizar...", + "miCheckingForUpdates": "Verificando Atualizações...", + "miDownloadUpdate": "Baixar Atualização Disponível", + "miDownloadingUpdate": "Baixando Atualização...", + "miInstallingUpdate": "Instalando Atualização...", + "miCheckForUpdates": "Verificar Atualizações...", + "aboutDetail": "\nVersão {0}\nConfirmação {1}\nData {2}\nShell {3}\nRenderizador {4}\nNó {5}", + "okButton": "OK" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/code/electron-main/window.i18n.json b/i18n/ptb/src/vs/code/electron-main/window.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..abee584a9c11df71620431f721da4f808e8a0255 --- /dev/null +++ b/i18n/ptb/src/vs/code/electron-main/window.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "hiddenMenuBar": "Você ainda pode acessar a barra de menu pressionando a tecla * * Alt * *." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/code/electron-main/windows.i18n.json b/i18n/ptb/src/vs/code/electron-main/windows.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..639e101557fc6e3b6c5d3852cf75bf48d43cafa4 --- /dev/null +++ b/i18n/ptb/src/vs/code/electron-main/windows.i18n.json @@ -0,0 +1,17 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "ok": "OK", + "pathNotExistTitle": "O caminho não existe", + "pathNotExistDetail": "O caminho '{0}' não parece mais existir no disco.", + "reopen": "Reabrir", + "wait": "Continuar Esperando", + "close": "Fechar", + "appStalled": "A janela não está mais respondendo", + "appStalledDetail": "Você pode reabrir, fechar a janela ou continuar esperando.", + "appCrashed": "A janela foi fechada inesperadamente", + "appCrashedDetail": "Pedimos desculpas pelo inconveniente! Você pode reabrir a janela para continuar de onde parou." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/code/node/cliProcessMain.i18n.json b/i18n/ptb/src/vs/code/node/cliProcessMain.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..ee0b74f6e41e5468d93e5f7173b69f0603644ff5 --- /dev/null +++ b/i18n/ptb/src/vs/code/node/cliProcessMain.i18n.json @@ -0,0 +1,17 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "notFound": "Extensão '{0}' não encontrada.", + "notInstalled": "Extensão '{0}' não está instalada.", + "useId": "Certifique-se de usar a ID de extensão completa, incluindo o editor, por exemplo: {0}", + "successVsixInstall": "Extensão '{0}' foi instalada com sucesso!", + "alreadyInstalled": "Extensão '{0}' já está instalada.", + "foundExtension": "Encontrado '{0}' na loja VS Code.", + "installing": "Instalando...", + "successInstall": "Extensão '{0}' v {1} foi instalada com sucesso!", + "uninstalling": "Desinstalando {0}...", + "successUninstall": "Extensão '{0}' foi desinstalada com sucesso!" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/common/config/commonEditorConfig.i18n.json b/i18n/ptb/src/vs/editor/common/config/commonEditorConfig.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..4dbd3e7153e1c3166ca0cf20ac71f6e192c1c1a9 --- /dev/null +++ b/i18n/ptb/src/vs/editor/common/config/commonEditorConfig.i18n.json @@ -0,0 +1,88 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "editorConfigurationTitle": "Editor", + "fontFamily": "Controla a família de fontes.", + "fontWeight": "Controla o peso da fonte.", + "fontSize": "Controla o tamanho da fonte em pixels.", + "lineHeight": "Controla a altura da linha. Use 0 para computar a altura da linha a partir do tamanho da fonte.", + "letterSpacing": "Controla o espaçamento da letra em pixels.", + "lineNumbers": "Controla a exibição de números de linha. Valores possíveis são 'on', 'off' e 'relative'. 'relative' mostra a contagem de linhas a partir da posição atual do cursor.", + "rulers": "Colunas nas quais mostrar réguas verticais", + "wordSeparators": "Caracteres que serão usados como separadores de palavras ao fazer navegação relacionada a palavras ou operações", + "tabSize": "O número de espaços equivalentes a uma tabulação. Esta configuração é sobreposta no conteúdo do arquivo quando `editor.detectIndentation` está ligado.", + "tabSize.errorMessage": "Esperado 'número'. Note que o valor \"auto\" foi alterado pela configuração 'editor.detectIndentation'.", + "insertSpaces": "Insere espaços quanto pressionado Tab. Esta configuração é sobrescrita com base no conteúdo do arquivo quando 'editor.detectIndentation' está habilitado.", + "insertSpaces.errorMessage": "Esperado 'booleano'. Note que o valor \"auto\" foi alterado pela configuração 'editor.detectIndentation'.", + "detectIndentation": "Quando um arquivo está sendo aberto, 'editor.tabSize' e 'editor.insertSpace' será detectado com base no conteúdo do arquivo.", + "roundedSelection": "Controla se as seleções têm cantos arredondados", + "scrollBeyondLastLine": "Controla se o editor rolará além da última linha", + "minimap.enabled": "Controla se o mini mapa é exibido", + "minimap.showSlider": "Controla se o controle deslizante minimap é oculto automaticamente.", + "minimap.renderCharacters": "Renderizar os caracteres em uma linha (em oposição a blocos de caracteres)", + "minimap.maxColumn": "Limitar o tamanho de um mini-mapa para renderizar no máximo um número determinado de colunas", + "find.seedSearchStringFromSelection": "Controla se nós inicializamos a string de pesquisa na Ferramenta de Pesquisa a partir da seleção do editor", + "find.autoFindInSelection": "Controla se a configuração Find in Selection deve estar ativada quando vários caracteres ou linhas de texto estão selecionados no editor", + "wordWrap.off": "As linhas nunca serão quebradas.", + "wordWrap.on": "As linhas serão quebradas na largura de visualização", + "wordWrap.wordWrapColumn": "As linhas serão quebradas em `editor.wordWrapColumn`.", + "wordWrap.bounded": "As linhas serão quebradas no mínimo entre a largura de visualização e `editor.wordWrapColumn`.", + "wordWrap": "Controla como as linhas devem ser quebradas automaticamente. Pode ser:\n- 'off' (quebra automática de linha desabilitada)\n- 'on' (quebra automática de linha na largura da janela)\n- 'wordWrapColumn' (quebra automática no numero de colunas definido em `editor.wordWrapColumn`) ou\n- 'bounded' (quebra automática em uma dimensão minima da janela e na largura configurada)", + "wordWrapColumn": "Controla a coluna de quebra de linha do editor quando editor.wordWrap` é 'wordWrapColumn' ou 'bounded'.", + "wrappingIndent": "Controla o recuo de linhas quebradas. Pode ser \"none\", \"same\" ou \"indent\".", + "mouseWheelScrollSensitivity": "Um multiplicador a ser usado em \"deltaX\" e \"deltaY\" dos eventos de rolagem do botão de rolagem do mouse", + "multiCursorModifier.ctrlCmd": "Mapeia para 'Control' no Windows e Linux e 'Command' no OSX.", + "multiCursorModifier.alt": "Mapeia para 'Alt' em Windows e Linux e 'Option' em OSX.", + "multiCursorModifier": "O modificador a ser usado para adicionar vários cursores com o mouse. `ctrlCmd` mapeia 'Control' no Windows e Linux e 'Command' no OSX. Os gestos do mouse Ir para definição e Abrir Link irão adaptar-se tal maneira que eles não entrem em conflito com o modificador multicursor.", + "quickSuggestions.strings": "Habilitar sugestões rápidas dentro de strings.", + "quickSuggestions.comments": "Habilitar sugestões rápidas dentro de comentários.", + "quickSuggestions.other": "Habilitar sugestões rápidas fora de strings e comentários.", + "quickSuggestions": "Controlar se sugestões devem aparecer automaticamente ao digitar", + "quickSuggestionsDelay": "Controla o atraso em ms após o qual sugestões rápidas serão exibidas", + "parameterHints": "Habilita pop-up que mostra documentação de parâmetros e o tipo de informação conforme você digita", + "autoClosingBrackets": "Controla se o editor deve fechar colchetes automaticamente depois de abri-los", + "formatOnType": "Controla se o editor deve formatar automaticamente a linha após a digitação", + "formatOnPaste": "Controla se o editor deve formatar automaticamente o conteúdo colado. Um formatador deve estar disponível e o formatador deve ser capaz de formatar apenas uma parte do documento.", + "suggestOnTriggerCharacters": "Controla se as sugestões devem aparecer automaticamente ao digitar caracteres de gatilho", + "acceptSuggestionOnEnter": "Controla se as sugestões devem ser aceitas com 'Enter' - em adição a 'Tab'. Ajuda a evitar a ambiguidade entre a inserção de novas linhas ou aceitar sugestões. O valor 'smart' significa apenas aceitar uma sugestão com Enter quando ela fizer uma mudança textual", + "acceptSuggestionOnCommitCharacter": "Controla se as sugestões devem ser aceitas em caracteres de confirmação. Por exemplo, em JavaScript, o ponto-e-vírgula (';') pode ser um caractere de confirmação que aceita uma sugestão e digita esse caractere.", + "snippetSuggestions": "Controla se os snippets são exibidos juntamente com as outras sugestões e como eles são ordenados.", + "emptySelectionClipboard": "Controla se a cópia sem nenhuma seleção copia a linha atual.", + "wordBasedSuggestions": "Controla se o auto-completar deve ser calculado baseado nas palavras no documento.", + "suggestFontSize": "Tamanho da fonte para a ferramenta de sugestão", + "suggestLineHeight": "Altura de linha para a ferramenta de sugestão", + "selectionHighlight": "Controla se o editor deve realçar correspondências semelhantes à seleção", + "occurrencesHighlight": "Controla se o editor deve realçar ocorrências de símbolos semânticos.", + "overviewRulerLanes": "Controla o número de decorações que podem ser exibidas na mesma posição na régua de visão geral", + "overviewRulerBorder": "Controla se deve desenhar uma borda ao redor da régua de visão geral.", + "cursorBlinking": "Controla o estilo de animação do cursor, os valores possíveis são 'blink', 'smooth', 'phase', 'expand' e 'solid'", + "mouseWheelZoom": "Alterar o zoom da fonte editor quando utilizada a roda do mouse e pressionando Ctrl", + "cursorStyle": "Controla o estilo do cursor, os valores aceitos são 'block', 'block-outline', 'line', 'line-thin', 'underline' e 'underline-thin'", + "fontLigatures": "Habilita ligaduras de fontes", + "hideCursorInOverviewRuler": "Controla se o cursor deve ficar oculto na régua de visão geral.", + "renderWhitespace": "Controla como o editor deve rendenizar caracteres de espaços em branco, possibilidades são 'none', 'boundary' e 'all'. A opção 'boundary' não rendeniza espaços simples entre palavras.", + "renderControlCharacters": "Controla se o editor deve renderizar caracteres de controle", + "renderIndentGuides": "Controla se o editor deve renderizar guias de identação", + "renderLineHighlight": "Controla como o editor deve renderizar a linha atual, as possibilidades são 'none', 'gutter', 'line' e 'all'.", + "codeLens": "Controla se o editor exibirá a lente de códigos.", + "folding": "Controla se o editor tem codigo colapsível hablitado", + "showFoldingControls": "Controla se os controles de desdobramento na divisão são ocultas automaticamente.", + "matchBrackets": "Realça colchetes correspondente quando um deles estiver selecionado.", + "glyphMargin": "Controla se o editor deve renderizar a margem vertical de ícones. A margem vertical de ícones é usada primordialmente na depuração", + "useTabStops": "Inserção e deleção de espaço em branco seguem a tabulação", + "trimAutoWhitespace": "Remove espaços em branco inseridos automaticamente no fim da linha", + "stablePeek": "Mantém os editores de visualização abertos mesmo quando clicando seu conteúdo ou teclando Escape.", + "dragAndDrop": "Controla se o editor deve permitir mover seleções via arrastar e soltar.", + "accessibilitySupport.auto": "O editor irá utilizar a plataforma da API para detectar quando um leitor de tela está conectado.", + "accessibilitySupport.on": "O editor será permanentemente otimizado para o uso de um leitor de tela.", + "accessibilitySupport.off": "O editor nunca será otimizado para o uso de um leitor de tela.", + "accessibilitySupport": "Controla quando o editor deve executar em modo otimizado para leitores de tela.", + "links": "Controla se o editor deve detectar links e torná-los clicáveis", + "sideBySide": "Controla se o editor de diff mostra as diff lado a lado ou inline.", + "ignoreTrimWhitespace": "Controla se o editor de diff mostra alterações nos espaços iniciais ou finais como diferenças", + "renderIndicators": "Controla se o editor de diff mostra indicadores +/- para alterações adicionadas/removidas", + "selectionClipboard": "Controla se a área primária de transferência Linux deve ser suportada." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/common/config/editorOptions.i18n.json b/i18n/ptb/src/vs/editor/common/config/editorOptions.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..53f11838ed4693ac0f404fa6c203b1c330458bd3 --- /dev/null +++ b/i18n/ptb/src/vs/editor/common/config/editorOptions.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "accessibilityOffAriaLabel": "O editor não está acessível neste momento. Por favor pressione Alt+F1 para opções.", + "editorViewAccessibleLabel": "Conteúdo do editor" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/common/controller/cursor.i18n.json b/i18n/ptb/src/vs/editor/common/controller/cursor.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..60bcb5f5b5ad5d6bb31d42cdd154155d1ba20d13 --- /dev/null +++ b/i18n/ptb/src/vs/editor/common/controller/cursor.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "corrupt.commands": "Exceção inesperada ao executar o comando." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/common/model/textModelWithTokens.i18n.json b/i18n/ptb/src/vs/editor/common/model/textModelWithTokens.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..fc3574b7fde6810cb74c6a4edab27d6bb5013b0b --- /dev/null +++ b/i18n/ptb/src/vs/editor/common/model/textModelWithTokens.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "mode.tokenizationSupportFailed": "O modo falhou ao gerar token da entrada." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/common/modes/modesRegistry.i18n.json b/i18n/ptb/src/vs/editor/common/modes/modesRegistry.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..509203220c861b5e00ca65dae3ebca9c4d77e7f1 --- /dev/null +++ b/i18n/ptb/src/vs/editor/common/modes/modesRegistry.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "plainText.alias": "Texto sem formatação" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/common/services/bulkEdit.i18n.json b/i18n/ptb/src/vs/editor/common/services/bulkEdit.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..3fada6ebf537581377ea04cd371ef3c4da8912ac --- /dev/null +++ b/i18n/ptb/src/vs/editor/common/services/bulkEdit.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "conflict": "Estes arquivos foram alterados nesse meio tempo: {0}", + "summary.0": "Não foram feitas edições", + "summary.nm": "Feitas {0} edições de texto em {1} arquivos", + "summary.n0": "Feitas {0} edições de texto em um arquivo" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/common/services/modeServiceImpl.i18n.json b/i18n/ptb/src/vs/editor/common/services/modeServiceImpl.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..85f2d2943f68d3ec1d9c7b34769eb564fb6d6476 --- /dev/null +++ b/i18n/ptb/src/vs/editor/common/services/modeServiceImpl.i18n.json @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "vscode.extension.contributes.languages": "Contribui às declarações de linguagem.", + "vscode.extension.contributes.languages.id": "ID da linguagem", + "vscode.extension.contributes.languages.aliases": "Aliases de nome para esta linguagem.", + "vscode.extension.contributes.languages.extensions": "Extensões de arquivos associadas a esta linguagem", + "vscode.extension.contributes.languages.filenames": "Nome dos arquivos associados a esta linguagem", + "vscode.extension.contributes.languages.filenamePatterns": "Padrão glob de nomes de arquivos associados a linguagem.", + "vscode.extension.contributes.languages.mimetypes": "Tipos Mime associados à linguagem.", + "vscode.extension.contributes.languages.firstLine": "Uma expressão regular que coincide com a primeira linha de um arquivo da linguaguem.", + "vscode.extension.contributes.languages.configuration": "Um caminho relativo para um arquivo contendo opções de configuração para a linguagem." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/common/services/modelServiceImpl.i18n.json b/i18n/ptb/src/vs/editor/common/services/modelServiceImpl.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..b6c528c5a25055b3d4cdc2b10f1abd3ffd3e6cc8 --- /dev/null +++ b/i18n/ptb/src/vs/editor/common/services/modelServiceImpl.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "diagAndSourceMultiline": "[{0}] {1}", + "diagAndSource": "[{0}] {1}" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/common/view/editorColorRegistry.i18n.json b/i18n/ptb/src/vs/editor/common/view/editorColorRegistry.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..a1bf17d6ec86b4e5d3b614f721ea760a9351378a --- /dev/null +++ b/i18n/ptb/src/vs/editor/common/view/editorColorRegistry.i18n.json @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "lineHighlight": "Cor de fundo para a posição do cursor na seleção de linhas.", + "lineHighlightBorderBox": "Cor de fundo para a borda em volta da linha na posição do cursor", + "rangeHighlight": "Cor de fundo dos ranges selecionados, assim como abertura instantânea e descoberta de recursos ", + "caret": "Cor do cursor no editor.", + "editorWhitespaces": "Cor dos caracteres em branco no editor", + "editorIndentGuides": "Cor das guias de indentação do editor.", + "editorLineNumbers": "Cor dos números de linha do editor.", + "editorRuler": "Cor das réguas do editor.", + "editorCodeLensForeground": "Cor do primeiro plano das lentes de código do editor", + "editorBracketMatchBackground": "Cor de fundo atrás do colchetes correspondentes", + "editorBracketMatchBorder": "Cor para as caixas de colchetes correspondentes", + "editorOverviewRulerBorder": "Cor da borda da régua de visão geral.", + "editorGutter": "Cor de fundo da separação do editor.O separador contém os glifos das margens e os números de linha.", + "errorForeground": "Cor do primeiro plano das linhas onduladas de erro no editor.", + "errorBorder": "Cor da borda das linhas onduladas de erro no editor.", + "warningForeground": "Cor do primeiro plano de linhas onduladas de aviso no editor.", + "warningBorder": "Cor da borda das linhas onduladas de aviso no editor." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/accessibility/browser/accessibility.i18n.json b/i18n/ptb/src/vs/editor/contrib/accessibility/browser/accessibility.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..e045839f7c689e8aee63445aa58ca7b018196787 --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/accessibility/browser/accessibility.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "introMsg": "Obrigado por testar a opção de acessibilidade do VS Code.", + "status": "Status", + "tabFocusModeOnMsg": "Pressionando Tab no editor corrente irá mover o foco para o próximo elemento focável. Mude este comportamento ao pressionar {0}.", + "tabFocusModeOnMsgNoKb": "Pressionando Tab no editor corrente irá mover o foco para o próximo elemento focável. O comando {0} não pode ser ativado atualmente por uma tecla.", + "tabFocusModeOffMsg": "Pressionando Tab no editor atual irá inserir um caractere Tab. Mude este comportamente ao pressionar {0}.", + "tabFocusModeOffMsgNoKb": "Pressionando Tab no editor atual irá inserir um caractere Tab. O comando {0} não pode ser ativado atualmente por uma tecla.", + "outroMsg": "Você pode ignorar essa dica e retornar ao editor apertando a tecla ESC", + "ShowAccessibilityHelpAction": "Mostrar ajuda de acessibilidade" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/bracketMatching/common/bracketMatching.i18n.json b/i18n/ptb/src/vs/editor/contrib/bracketMatching/common/bracketMatching.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..4af1753636d6d806c0dd7f96d3310a0d9de20295 --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/bracketMatching/common/bracketMatching.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "smartSelect.jumpBracket": "Ir para colchete" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/caretOperations/common/caretOperations.i18n.json b/i18n/ptb/src/vs/editor/contrib/caretOperations/common/caretOperations.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..157105c4a358faf121caf2fd971dbbf5f56d43f0 --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/caretOperations/common/caretOperations.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "caret.moveLeft": "Mover cursor para a esquerda", + "caret.moveRight": "Mover cursor para a direita" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/caretOperations/common/transpose.i18n.json b/i18n/ptb/src/vs/editor/contrib/caretOperations/common/transpose.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..c1d3083b1985c0fefd94d051d1392c23aef94faa --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/caretOperations/common/transpose.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "transposeLetters.label": "Transport letras" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/clipboard/browser/clipboard.i18n.json b/i18n/ptb/src/vs/editor/contrib/clipboard/browser/clipboard.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..903f9fc1086fc13b1b52aa80800210b27161c4c3 --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/clipboard/browser/clipboard.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "actions.clipboard.cutLabel": "Recortar", + "actions.clipboard.copyLabel": "Copiar", + "actions.clipboard.pasteLabel": "Colar", + "actions.clipboard.copyWithSyntaxHighlightingLabel": "Copiar com realce de sintaxe" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/comment/common/comment.i18n.json b/i18n/ptb/src/vs/editor/contrib/comment/common/comment.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..ff1ba569c0c954899e7eb628b114eb1433eb469e --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/comment/common/comment.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "comment.line": "Alternar Comentário de Linha", + "comment.line.add": "Adicionar Comentário de Linha", + "comment.line.remove": "Remover Comentário de Linha", + "comment.block": "Alternar Comentário de Bloco" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/contextmenu/browser/contextmenu.i18n.json b/i18n/ptb/src/vs/editor/contrib/contextmenu/browser/contextmenu.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..e2b1d946bee130fd219954b62a5769c07b0666b3 --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/contextmenu/browser/contextmenu.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "action.showContextMenu.label": "Mostrar o menu de contexto do editor" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/find/browser/findWidget.i18n.json b/i18n/ptb/src/vs/editor/contrib/find/browser/findWidget.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..473543c08504502f18dfa67b92378702c3c3f521 --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/find/browser/findWidget.i18n.json @@ -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. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "label.find": "Localizar", + "placeholder.find": "Localizar", + "label.previousMatchButton": "Correspondência anterior", + "label.nextMatchButton": "Próxima correspondência", + "label.toggleSelectionFind": "Localizar na seleção", + "label.closeButton": "Fechar", + "label.replace": "Substituir", + "placeholder.replace": "Substituir", + "label.replaceButton": "Substituir", + "label.replaceAllButton": "Substituir Tudo", + "label.toggleReplaceButton": "Ativar/desativar modo Substituir", + "title.matchesCountLimit": "Somente os primeiros 999 resultados são realçados, mas todas as operações de pesquisa funcionam em todo o texto.", + "label.matchesLocation": "{0} de {1}", + "label.noResults": "Nenhum resultado" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/find/common/findController.i18n.json b/i18n/ptb/src/vs/editor/contrib/find/common/findController.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..c8f66700ae9d0b77e0bf28d5cb7d9070f503b1b0 --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/find/common/findController.i18n.json @@ -0,0 +1,18 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "startFindAction": "Localizar", + "findNextMatchAction": "Localizar Próximo", + "findPreviousMatchAction": "Localizar anterior", + "nextSelectionMatchFindAction": "Localizar Próxima Seleção", + "previousSelectionMatchFindAction": "Localizar Seleção Anterior", + "startReplace": "Substituir", + "addSelectionToNextFindMatch": "Adicionar Seleção ao Próximo Localizar Correspondência", + "addSelectionToPreviousFindMatch": "Adicionar Seleção à Correspondência de Localização Anterior", + "moveSelectionToNextFindMatch": "Mover Última Seleção para Próximo Localizar Correspondência", + "moveSelectionToPreviousFindMatch": "Mover Última Seleção para Correspondência de Localização Anterior", + "changeAll.label": "Alterar todas as ocorrências" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/folding/browser/folding.i18n.json b/i18n/ptb/src/vs/editor/contrib/folding/browser/folding.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..c9d6b88a8527915d820764275a4a617923230cf5 --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/folding/browser/folding.i18n.json @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "unfoldAction.label": "Abrir", + "unFoldRecursivelyAction.label": "Abrir recursivamente", + "foldAction.label": "Colapsar", + "foldRecursivelyAction.label": "Colapsar recursivamente", + "foldAllAction.label": "Colapsar tudo", + "unfoldAllAction.label": "Abrir tudo", + "foldLevelAction.label": "Nível de colapsamento {0}" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/format/browser/formatActions.i18n.json b/i18n/ptb/src/vs/editor/contrib/format/browser/formatActions.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..4327e5f6744c21dd3723bc5cbd023430a668bd13 --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/format/browser/formatActions.i18n.json @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "hint11": "1 edição de formatação feita na linha {0}", + "hintn1": "{0} edições de formatação feitas na linha {1}", + "hint1n": "Feita 1 edição de formatação entre as linhas {0} e {1}", + "hintnn": "Feitas {0} edições de formatação entre as linhas {1} e {2}", + "formatDocument.label": "Formatar Documento", + "formatSelection.label": "Formatar Seleção" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.i18n.json b/i18n/ptb/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..01753366bca153aad1c8f88dc65838ab4477bb09 --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.i18n.json @@ -0,0 +1,23 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "noResultWord": "Não foi encontrada definição para '{0}'", + "generic.noResults": "Nenhuma definição encontrada", + "meta.title": "- {0} definições", + "actions.goToDecl.label": "Ir para Definição", + "actions.goToDeclToSide.label": "Abrir definição ao lado", + "actions.previewDecl.label": "Inspecionar definição", + "goToImplementation.noResultWord": "Nenhuma implementação encontrada para '{0}'", + "goToImplementation.generic.noResults": "Nenhuma implementação encontrada", + "meta.implementations.title": "– {0} implementações", + "actions.goToImplementation.label": "Ir para a implementação", + "actions.peekImplementation.label": "Inspecionar implementação", + "goToTypeDefinition.noResultWord": "Nenhuma definição encontrada para '{0}'", + "goToTypeDefinition.generic.noResults": "Nenhuma definição de tipo encontrada", + "meta.typeDefinitions.title": "– {0} definições de tipos", + "actions.goToTypeDefinition.label": "Ir para a definição de tipo", + "actions.peekTypeDefinition.label": "Inspecionar definição de tipo" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.i18n.json b/i18n/ptb/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..675cbe29ae198720140d24bdc0a2c1fb38e1ca8a --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "multipleResults": "Clique para mostrar {0} definições." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/gotoError/browser/gotoError.i18n.json b/i18n/ptb/src/vs/editor/contrib/gotoError/browser/gotoError.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..0ad65de88635a35a04492c31b3ec5d4fe5e54bc4 --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/gotoError/browser/gotoError.i18n.json @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "title.wo_source": "({0}/{1})", + "markerAction.next.label": "Ir para o Próximo Erro ou Aviso", + "markerAction.previous.label": "Ir para o Erro ou Aviso Anterior", + "editorMarkerNavigationError": "Ferramenta de marcação de edição apresentando error na cor ", + "editorMarkerNavigationWarning": "Ferramenta de marcação de edição apresentando adventência na cor", + "editorMarkerNavigationBackground": "Cor de fundo da ferramenta de marcação de navegação do editor." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/hover/browser/hover.i18n.json b/i18n/ptb/src/vs/editor/contrib/hover/browser/hover.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..196a8fb2bb0aa6b0bd6931d63bffa5f6b89af0da --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/hover/browser/hover.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "showHover": "Mostrar Item Flutuante" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/hover/browser/modesContentHover.i18n.json b/i18n/ptb/src/vs/editor/contrib/hover/browser/modesContentHover.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..2c74cf6f1ec3a9960aa90189f156d7cdecdbc395 --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/hover/browser/modesContentHover.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "modesContentHover.loading": "Carregando..." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/inPlaceReplace/common/inPlaceReplace.i18n.json b/i18n/ptb/src/vs/editor/contrib/inPlaceReplace/common/inPlaceReplace.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..fbbfbd021610108a14875461071467cbe1c56846 --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/inPlaceReplace/common/inPlaceReplace.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "InPlaceReplaceAction.previous.label": "Substituir pelo valor anterior", + "InPlaceReplaceAction.next.label": "Substituir pelo próximo valor" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/indentation/common/indentation.i18n.json b/i18n/ptb/src/vs/editor/contrib/indentation/common/indentation.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..8edeaaf810408cd3a64b032df8c9e699832ee733 --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/indentation/common/indentation.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "indentationToSpaces": "Converter indentação em espaços.", + "indentationToTabs": "Coverter Indentação a Tabulações.", + "configuredTabSize": "Tamanho de Tabulação Configurado", + "selectTabWidth": "Selecione o Tamanho de Tabulação para o Arquivo Atual", + "indentUsingTabs": "Indentar Usando Tabulações", + "indentUsingSpaces": "Indentar Usando Espaços", + "detectIndentation": "Detectar Indentação a Partir do Conteúdo", + "editor.reindentlines": "Reindentar Linhas" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/inspectTMScopes/electron-browser/inspectTMScopes.i18n.json b/i18n/ptb/src/vs/editor/contrib/inspectTMScopes/electron-browser/inspectTMScopes.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..e715c4d667fe4d092ef0dff311e270fc2d4e2c57 --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/inspectTMScopes/electron-browser/inspectTMScopes.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "inspectTMScopes": "Desenvolvedor: Inspecionar escopos TM", + "inspectTMScopesWidget.loading": "Carregando..." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/linesOperations/common/linesOperations.i18n.json b/i18n/ptb/src/vs/editor/contrib/linesOperations/common/linesOperations.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..8a368ab368da1220e511dc38352420684ed27e78 --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/linesOperations/common/linesOperations.i18n.json @@ -0,0 +1,25 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "lines.copyUp": "Copiar linha acima", + "lines.copyDown": "Copiar linha abaixo", + "lines.moveUp": "Mover linha para cima", + "lines.moveDown": "Mover linha para baixo", + "lines.sortAscending": "Classificar Linhas Ascendentemente", + "lines.sortDescending": "Classificar Linhas Descendentemente", + "lines.trimTrailingWhitespace": "Cortar Espaço em Branco à Direita", + "lines.delete": "Excluir linha", + "lines.indent": "Recuar linha", + "lines.outdent": "Recuar linha para a esquerda", + "lines.insertBefore": "Inserir linha acima", + "lines.insertAfter": "Inserir linha abaixo", + "lines.deleteAllLeft": "Excluir tudo à Esquerda", + "lines.deleteAllRight": "Excluir Tudo à Direita", + "lines.joinLines": "Unir Linhas", + "editor.transpose": "Transpor caracteres ao redor do cursor", + "editor.transformToUppercase": "Transformar para maiúsculas", + "editor.transformToLowercase": "Transformar para minúsculas" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/links/browser/links.i18n.json b/i18n/ptb/src/vs/editor/contrib/links/browser/links.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..32cd9d3212a7b3386883152936a60d108cdfd066 --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/links/browser/links.i18n.json @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "links.navigate.mac": "Cmd + clique para seguir o link", + "links.navigate": "Ctrl + clique para seguir o link", + "links.navigate.al": "Alt + clique para seguir o link", + "invalid.url": "Desculpe, falha ao abrir este link porque ele não está bem formatado: {0}", + "missing.url": "Desculpe, falha ao abrir este link porque seu destino está faltando.", + "label": "Abrir link" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/multicursor/common/multicursor.i18n.json b/i18n/ptb/src/vs/editor/contrib/multicursor/common/multicursor.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..583be5b3e5c449c332b77db00a80d523ba529478 --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/multicursor/common/multicursor.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "mutlicursor.insertAbove": "Inserir cursor acima", + "mutlicursor.insertBelow": "Inserir cursor abaixo", + "mutlicursor.insertAtEndOfEachLineSelected": "Adicionar Cursores ao Final das Linhas" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/parameterHints/browser/parameterHints.i18n.json b/i18n/ptb/src/vs/editor/contrib/parameterHints/browser/parameterHints.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..f0450d3f4de4451323e0b351dcaac5e0a9aac29d --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/parameterHints/browser/parameterHints.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "parameterHints.trigger.label": "Dicas de parâmetro de gatilho" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.i18n.json b/i18n/ptb/src/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..0f8237adbb3f63d3eda886883caef4e23acf4993 --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "hint": "{0}, dica" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/quickFix/browser/quickFixCommands.i18n.json b/i18n/ptb/src/vs/editor/contrib/quickFix/browser/quickFixCommands.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..01ae8d7aff8af618714427752d637f89a96f2e97 --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/quickFix/browser/quickFixCommands.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "quickFixWithKb": "Mostrar correções ({0})", + "quickFix": "Mostrar correções", + "quickfix.trigger.label": "Correção Rápida" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/referenceSearch/browser/referenceSearch.i18n.json b/i18n/ptb/src/vs/editor/contrib/referenceSearch/browser/referenceSearch.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..9d557535df6117dfcea9a7349a1ac48f37028e87 --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/referenceSearch/browser/referenceSearch.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "meta.titleReference": "- {0} referências", + "references.action.label": "Localizar Todas as Referências" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/referenceSearch/browser/referencesController.i18n.json b/i18n/ptb/src/vs/editor/contrib/referenceSearch/browser/referencesController.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..65217d2ace8866e98140645c905789fd4c7839d1 --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/referenceSearch/browser/referencesController.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "labelLoading": "Carregando..." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json b/i18n/ptb/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..2e25322d32c0830c4b4008cb2efd924cb8a9fe61 --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "aria.oneReference": "símbolo em {0} na linha {1} e coluna {2}", + "aria.fileReferences.1": "1 símbolo em {0}, caminho completo {1}", + "aria.fileReferences.N": "{0} símbolos em {1}, caminho completo {2}", + "aria.result.0": "Nenhum resultado encontrado", + "aria.result.1": "Encontrado 1 símbolo em {0}", + "aria.result.n1": "Encontrados {0} símbolos em {1}", + "aria.result.nm": "Encontrados {0} símbolos em {1} arquivos" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.i18n.json b/i18n/ptb/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..72f61eeaf832ba4a08b749c96e2f7070e7f62738 --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.i18n.json @@ -0,0 +1,27 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "referencesFailre": "Falha ao resolver arquivo.", + "referencesCount": "{0} referências", + "referenceCount": "{0} referência", + "missingPreviewMessage": "nenhuma visualização disponível", + "treeAriaLabel": "Referências", + "noResults": "Nenhum resultado", + "peekView.alternateTitle": "Referências", + "peekViewTitleBackground": "Cor de fundo da área de visualização do título.", + "peekViewTitleForeground": "Cor de visualização do título.", + "peekViewTitleInfoForeground": "Cor da visualização de informações do título.", + "peekViewBorder": "Cor das bordas e seta da área de visualização", + "peekViewResultsBackground": "Cor de fundo da área de visualização da lista de resultados.", + "peekViewResultsMatchForeground": "Cor de primeiro plano para nós de linha na lista de resultados visualizados.", + "peekViewResultsFileForeground": "Cor de primeiro plano para nós de arquivos na lista de resultados visualizados.", + "peekViewResultsSelectionBackground": "Cor de fundo da entrada selecionada na visualização da lista de resultados.", + "peekViewResultsSelectionForeground": "Cor da entrada selecionada na visualização da lista de resultados.", + "peekViewEditorBackground": "Cor de fundo da visualização do editor.", + "peekViewEditorGutterBackground": "Cor de fundo da separação na visualização rápida do editor.", + "peekViewResultsMatchHighlight": "Corresponder cor de realce com visualização da lista de resultados.", + "peekViewEditorMatchHighlight": "Corresponder cor de realce com visualização do editor." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/rename/browser/rename.i18n.json b/i18n/ptb/src/vs/editor/contrib/rename/browser/rename.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..a56535f6241cf508c8de7c11b2cfa054af377499 --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/rename/browser/rename.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "no result": "Nenhum resultado.", + "aria": "Renomeado '{0}' para '{1}'com sucesso. Resumo: {2}", + "rename.failed": "Desculpe, falha na execução de renomear.", + "rename.label": "Renomear Símbolo" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/rename/browser/renameInputField.i18n.json b/i18n/ptb/src/vs/editor/contrib/rename/browser/renameInputField.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..49eba92fa449e42e6738c9c0d7c3351bbc42e654 --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/rename/browser/renameInputField.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "renameAriaLabel": "Renomear entrada. Digite o novo nome e tecle Enter para gravar." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/smartSelect/common/smartSelect.i18n.json b/i18n/ptb/src/vs/editor/contrib/smartSelect/common/smartSelect.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..89319f9a266967c5b618e03313591bc9932a0176 --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/smartSelect/common/smartSelect.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "smartSelect.grow": "Expandir seleção", + "smartSelect.shrink": "Reduzir seleção" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/suggest/browser/suggestController.i18n.json b/i18n/ptb/src/vs/editor/contrib/suggest/browser/suggestController.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..b064152c8be90878d161ee624c46f808f7593a5c --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/suggest/browser/suggestController.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "arai.alert.snippet": "Ao aceitar '{0}' foi inserido o seguinte texto: {1}", + "suggest.trigger.label": "Sugestão de gatilho" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json b/i18n/ptb/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..c9da4793d67a95dad4df9f7f90b925fbbfedab35 --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json @@ -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. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "editorSuggestWidgetBackground": "Cor de fundo para a ferramenta de sugestão.", + "editorSuggestWidgetBorder": "Cor da borda para a ferramenta de sugestão.", + "editorSuggestWidgetForeground": "Cor de primeiro plano para a ferramenta de sugestão.", + "editorSuggestWidgetSelectedBackground": "Cor de fundo da entrada selecionada da ferramenta de sugestões.", + "editorSuggestWidgetHighlightForeground": "Cor de realce da correspondência na ferramenta de sugestão.", + "readMore": "Ler Mais...{0}", + "suggestionWithDetailsAriaLabel": "{0}, sugestão, tem detalhes", + "suggestionAriaLabel": "{0}, sugestão", + "readLess": "Ler menos... {0}", + "suggestWidget.loading": "Carregando...", + "suggestWidget.noSuggestions": "Nenhuma sugestão.", + "suggestionAriaAccepted": "{0}, aceito", + "ariaCurrentSuggestionWithDetails": "{0}, sugestão, tem detalhes", + "ariaCurrentSuggestion": "{0}, sugestão" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/toggleTabFocusMode/common/toggleTabFocusMode.i18n.json b/i18n/ptb/src/vs/editor/contrib/toggleTabFocusMode/common/toggleTabFocusMode.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..0f3dd0680954e024796a51f3dd2ee565746ce628 --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/toggleTabFocusMode/common/toggleTabFocusMode.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "toggle.tabMovesFocus": "Alterne o uso da tecla Tab para mover o foco" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/wordHighlighter/common/wordHighlighter.i18n.json b/i18n/ptb/src/vs/editor/contrib/wordHighlighter/common/wordHighlighter.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..e8556cb38a817be3e7945f29a146ad1f6c32d208 --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/wordHighlighter/common/wordHighlighter.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "wordHighlight": "Cor de fundo de um símbolo durante acesso de leitura, como ao ler uma variável.", + "wordHighlightStrong": "Cor de fundo de um símbolo durante acesso de escrita, como ao escrever uma variável." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/contrib/zoneWidget/browser/peekViewWidget.i18n.json b/i18n/ptb/src/vs/editor/contrib/zoneWidget/browser/peekViewWidget.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..41ad7313b7de52d45fd71574b7fea566f359350a --- /dev/null +++ b/i18n/ptb/src/vs/editor/contrib/zoneWidget/browser/peekViewWidget.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "label.close": "Fechar" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/electron-browser/textMate/TMSyntax.i18n.json b/i18n/ptb/src/vs/editor/electron-browser/textMate/TMSyntax.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..dfef3cc47a597818e670e9120bac328e6e2bb71e --- /dev/null +++ b/i18n/ptb/src/vs/editor/electron-browser/textMate/TMSyntax.i18n.json @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "invalid.language": "Linguagem desconhecida em `contributes.{0}.language`. Valor fornecido: {1}", + "invalid.scopeName": "Esperada uma string em 'contributes.{0}.scopeName'. Valor informado: {1}", + "invalid.path.0": "Esperada uma string em `contributes.{0}.path`. Valor informado: {1}", + "invalid.injectTo": "Valor inválido em `contributes.{0}.injectTo`. Deve ser uma matriz de nomes de escopo de idioma. Valor fornecido: {1}", + "invalid.embeddedLanguages": "Valor inválido em `contributes.{0}.embeddedLanguages`. Deve ser um objeto de mapeamento do nome do escopo para a linguagem. Valor informado: {1}", + "invalid.path.1": "É esperado que `contributes.{0}.path` ({1}) seja incluído na pasta da extensão ({2}). Isto pode tornar a extensão não portável.", + "no-tm-grammar": "Nenhuma gramática TM registrada para este idioma." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/node/languageConfigurationExtensionPoint.i18n.json b/i18n/ptb/src/vs/editor/node/languageConfigurationExtensionPoint.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..04aa2bc703fba5abf14dadc201b9ae2aa16366e2 --- /dev/null +++ b/i18n/ptb/src/vs/editor/node/languageConfigurationExtensionPoint.i18n.json @@ -0,0 +1,23 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "parseErrors": "Erros parseando {0}: {1}", + "schema.openBracket": "O colchete de abertura de caractere ou sequência de caracteres.", + "schema.closeBracket": "O colchete de fechamento de caractere ou sequência de caracteres.", + "schema.comments": "Define o símbolo dos comentários", + "schema.blockComments": "Define como comentários em bloco são marcados.", + "schema.blockComment.begin": "A sequência de caracteres que inicia um comentário em bloco.", + "schema.blockComment.end": "A sequência de caracteres que termina um comentário de bloco.", + "schema.lineComment": "A sequência de caracteres que inicia um comentário de linha.", + "schema.brackets": "Define os símbolos de colchetes que aumentam ou diminuem a indentação.", + "schema.autoClosingPairs": "Define os pares de colchetes. Quando é introduzido um colchete de abertura, o colchete de fechamento é inserido automaticamente.", + "schema.autoClosingPairs.notIn": "Define uma lista de escopos onde os auto pares são desativados.", + "schema.surroundingPairs": "Define os pares de colchetes que podem ser usados para cercar uma seqüência selecionada.", + "schema.wordPattern": "A definição da palavra para a linguagem.", + "schema.wordPattern.pattern": "O padrão RegExp usado para coincidir com as palavras.", + "schema.wordPattern.flags": "Os sinalizadores RegExp usados para coincidir com as palavras.", + "schema.wordPattern.flags.errorMessage": "Deve corresponder ao padrão `/^([gimuy]+)$/`." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/editor/node/textMate/TMGrammars.i18n.json b/i18n/ptb/src/vs/editor/node/textMate/TMGrammars.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..7707ea3401f3b10f89eb1f1aee61b624c19dc20f --- /dev/null +++ b/i18n/ptb/src/vs/editor/node/textMate/TMGrammars.i18n.json @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "vscode.extension.contributes.grammars": "Contibui aos toquenizadores textmate", + "vscode.extension.contributes.grammars.language": "Identificador da linguagem para qual a sintaxe contribui.", + "vscode.extension.contributes.grammars.scopeName": "Nome do escopo Textmate usado pelo arquivo tmLanguage.", + "vscode.extension.contributes.grammars.path": "Caminho para o arquivo tmLanguage. O caminho é relativo a pasta da extensão e geralmente começa com './syntaxes/'.", + "vscode.extension.contributes.grammars.embeddedLanguages": "Um mapeamento no nome do escopo para o Id da linguagem se esta gramática contenha linguagens embutidas.", + "vscode.extension.contributes.grammars.injectTo": "Lista de nomes de escopos de linguagem aos quais esta gramática é injetada." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/platform/actions/browser/menuItemActionItem.i18n.json b/i18n/ptb/src/vs/platform/actions/browser/menuItemActionItem.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..e64a7d0ed09f01155f7629cf3084270adaad2390 --- /dev/null +++ b/i18n/ptb/src/vs/platform/actions/browser/menuItemActionItem.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "titleAndKb": "{0} ({1})" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/platform/actions/electron-browser/menusExtensionPoint.i18n.json b/i18n/ptb/src/vs/platform/actions/electron-browser/menusExtensionPoint.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..d7ef91038db0f53899ed23930cf2505853e2f91d --- /dev/null +++ b/i18n/ptb/src/vs/platform/actions/electron-browser/menusExtensionPoint.i18n.json @@ -0,0 +1,43 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "requirearray": "os itens de menu devem ser um array", + "requirestring": "a propriedade `{0}` é obrigatória e deve ser do tipo `string`", + "optstring": "a propriedade `{0}` é opcional ou deve ser do tipo `string`", + "vscode.extension.contributes.menuItem.command": "Identificador do comando para ser executado. O comando deve ser declarado na seção de 'Comandos'", + "vscode.extension.contributes.menuItem.alt": "O identificador de um comando alternativo para executar. O comando deve ser declarado na sessão 'Comandos'", + "vscode.extension.contributes.menuItem.when": "Condição, que deve ser verdadeira, para mostrar esse item", + "vscode.extension.contributes.menuItem.group": "Grupo ao qual pertence este comando", + "vscode.extension.contributes.menus": "Contribui itens de menu ao editor", + "menus.commandPalette": "Paleta de comandos", + "menus.editorTitle": "Meno do título editor", + "menus.editorContext": "Mostrar o menu de contexto do editor", + "menus.explorerContext": "Menu no contexto de explorador de arquivos", + "menus.editorTabContext": "Mostrar o menu de contexto do editor", + "menus.debugCallstackContext": "O menu de contexto de pilha de chamadas de depuração", + "menus.scmTitle": "O menu de título do controle de fonte", + "menus.resourceGroupContext": "O menu de contexto do grupo de recursos de controle de fonte", + "menus.resourceStateContext": "O menu de contexto de estado de recursos do controle de fonte", + "view.viewTitle": "O menu de título da visualização contribuída", + "view.itemContext": "O menu de contexto do item da visualização contribuída", + "nonempty": "Esperado um valor não vazio", + "opticon": "a propriedade '{0}' é opcional ou pode ser do tipo 'string'", + "requireStringOrObject": "a propriedade '{0}' é obrigatória e deve ser do tipo 'string'", + "requirestrings": "a propriedade `{0}` é obrigatória e deve ser do tipo `string`", + "vscode.extension.contributes.commandType.command": "Indentificador de comando para executar", + "vscode.extension.contributes.commandType.title": "Título para o qual o comando é representado na UI", + "vscode.extension.contributes.commandType.category": "(Opcional) Sequência de categoria será agrupada na interface de usuário", + "vscode.extension.contributes.commandType.icon": "(Opcional) Icone utilizado para representar o comando na interface de usuário. Um arquivo ou configuração do tema.", + "vscode.extension.contributes.commandType.icon.light": "Caminho do Ícone quando o tema light for utilizado", + "vscode.extension.contributes.commandType.icon.dark": "Caminho do ícone quando o tema dark for utilizado", + "vscode.extension.contributes.commands": "Contribui comandos à paleta de comandos", + "dup": "Comando '{0}' aparece multiplas vezes na sessão 'comandos'\n", + "menuId.invalid": "'{0}' nao é um identificador de menu válido ", + "missing.command": "Identificador do comando para ser executado. O comando deve ser declarado na seção de 'Comandos'", + "missing.altCommand": "Referências ao item de menu no alt-command '{0}' qual nao é definido na sessão 'comandos'", + "dupe.command": "Itens de referencias do mesmo comando como padrão e alt-command", + "nosupport.altCommand": "Desculpe, mas atualmente somente o groupo 'navegação' do menu 'editor/título' suporta alt-commands" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/platform/configuration/common/configurationRegistry.i18n.json b/i18n/ptb/src/vs/platform/configuration/common/configurationRegistry.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..928f36b2ee48bfc6803a8109c436c1d1ced5773b --- /dev/null +++ b/i18n/ptb/src/vs/platform/configuration/common/configurationRegistry.i18n.json @@ -0,0 +1,19 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "defaultConfigurations.title": "Sobreposições da Configuração Padrão", + "overrideSettings.description": "Definir que configurações do editor sejam substituídas para idioma {0}.", + "overrideSettings.defaultDescription": "Definir que configurações do editor sejam substituídas para um idioma.", + "vscode.extension.contributes.configuration": "Contribui às definições de configuração.", + "vscode.extension.contributes.configuration.title": "Um resumo das configurações. Este rótulo será usado no arquivo de configurações como um comentário de separação.", + "vscode.extension.contributes.configuration.properties": "Descrição das propriedades de configuração.", + "config.property.languageDefault": "Não é possível registrar '{0}'. Isto corresponde a propriedade padrão '\\\\[.*\\\\]$' para descrever configurações do editor específico de linguagem. Use a contribuição 'configurationDefaults'.", + "config.property.duplicate": "Não é possível registrar '{0}'. Esta propriedade já está registrada.", + "invalid.properties": "'configuration.properties' deve ser um objeto", + "invalid.type": "Se definido, 'configuration.type' deve ser do tipo 'object'", + "invalid.title": "'configuration.title' deve ser um string", + "vscode.extension.contributes.defaultConfiguration": "Contribui às definições de configuração padrão do editor por linguagem." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/platform/environment/node/argv.i18n.json b/i18n/ptb/src/vs/platform/environment/node/argv.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..4cec19113d2174c75f5074f4aa78af1eacd5f45b --- /dev/null +++ b/i18n/ptb/src/vs/platform/environment/node/argv.i18n.json @@ -0,0 +1,32 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "gotoValidation": "Argumentos no modo '--goto' deve ser no formato de 'Arquivo(:LINHA(:CARACTERE))'.", + "diff": "Abrir um editor de diff. Requer passar dois caminhos de arquivo como argumentos.", + "goto": "Abra o arquivo no caminho, na linha e caractere (addcionar:linha[:caractere] para o caminho).", + "locale": "Para localização utilize (ex. en-US ou zh-TW).", + "newWindow": "Força uma nova instância do Código.", + "performance": "Comece com o 'Desenvolvedor: Desempenho de inicialização' comando habilitado.", + "prof-startup": "Rodar o CPU profiler durante a inicialização", + "reuseWindow": "Forçar a abertura de um arquivo ou pasta na última janela ativa", + "userDataDir": "Especifica o diretório que os dados do usuário serão mantidos, útil quando estiver rodando como root.", + "verbose": "Imprimir a saída detalhada (Implica -- esperar).", + "wait": "Aguarde a janela ser fechada antes de retornar.", + "extensionHomePath": "Defina o caminho raíz para as extensões.", + "listExtensions": "Lista de extensões instaladas", + "showVersions": "Exibir versões de extensões instaladas, quando estiver usando --list-extension", + "installExtension": "Instala uma extensão.", + "uninstallExtension": "Desinstala uma extensão.", + "experimentalApis": "Permite recursos de api propostos para uma extensão.", + "disableExtensions": "Desabilita todas as extensões instaladas.", + "disableGPU": "Desabilita aceleração de hardware da GPU.", + "version": "Versão de impressão", + "help": "Uso de impressão.", + "usage": "Uso", + "options": "opções", + "paths": "caminhos", + "optionsUpperCase": "Opções" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/platform/extensionManagement/common/extensionEnablementService.i18n.json b/i18n/ptb/src/vs/platform/extensionManagement/common/extensionEnablementService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..52f37b66ccd2393148387b0b2b599fc5a1c5ceda --- /dev/null +++ b/i18n/ptb/src/vs/platform/extensionManagement/common/extensionEnablementService.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "noWorkspace": "Não há espaço de trabalho." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/platform/extensionManagement/common/extensionManagement.i18n.json b/i18n/ptb/src/vs/platform/extensionManagement/common/extensionManagement.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..33ea82613268bdd658af347f0f556164a47fb8cc --- /dev/null +++ b/i18n/ptb/src/vs/platform/extensionManagement/common/extensionManagement.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "extensions": "Extensões", + "preferences": "Preferências" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/platform/extensionManagement/node/extensionGalleryService.i18n.json b/i18n/ptb/src/vs/platform/extensionManagement/node/extensionGalleryService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..76dc4cf48f3d0c5556dcf5d0b29a0db9699cac5c --- /dev/null +++ b/i18n/ptb/src/vs/platform/extensionManagement/node/extensionGalleryService.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "notFound": "Extensão não encontrada", + "noCompatible": "Não foi possível econtrar uma versão de {0} com esta versão do Code." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/platform/extensionManagement/node/extensionManagementService.i18n.json b/i18n/ptb/src/vs/platform/extensionManagement/node/extensionManagementService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..a6c5a37ab058b12ec4119899ceb1aff7e36b48b9 --- /dev/null +++ b/i18n/ptb/src/vs/platform/extensionManagement/node/extensionManagementService.i18n.json @@ -0,0 +1,22 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "invalidManifest": "Extensão inválida: pacote.json nao é um arquivo JSON válido", + "restartCode": "Por favor reinicie Code antes de reinstalar {0}.", + "installDependeciesConfirmation": "A instalação de '{0}' também inclui suas dependências. Gostaria de continuar?", + "install": "Sim", + "doNotInstall": "Não", + "uninstallDependeciesConfirmation": "Gostaria de desinstalar '{0}' somente, ou suas dependências também?", + "uninstallOnly": "Apenas", + "uninstallAll": "Todos", + "cancel": "Cancelar", + "uninstallConfirmation": "Tem certeza que deseja desinstalar '{0}'?", + "ok": "OK", + "singleDependentError": "Não foi possível desinstalar a extensão '{0}'. A extensão '{1}' depende dela.", + "twoDependentsError": "Não foi possível desinstalar a extensão '{0}'. As extensões '{1}' e '{2}' dependem dela.", + "multipleDependentsError": "Não foi possível desinstalar a extensão '{0}'. As extensões '{1}' e '{2}' e outras dependem dela.", + "notExists": "Não foi possível encontrar a extensão" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/platform/extensions/common/abstractExtensionService.i18n.json b/i18n/ptb/src/vs/platform/extensions/common/abstractExtensionService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..d521fce97ffbace1597ee213be97e4a2f5270150 --- /dev/null +++ b/i18n/ptb/src/vs/platform/extensions/common/abstractExtensionService.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "unknownDep": "Extensão '{1}' falhou ao ativar. Motivo: dependência desconhecida '{0}'.", + "failedDep1": "Extensão '{1}' falhou ao ativar. Motivo: a dependência '{0}' falhou ao ativar.", + "failedDep2": "Extensão '{0}' falhou ao ativar. Motivo: mais de 10 níveis de dependências (provavelmente um laço de dependência).", + "activationError": "Ativação da extensão `{0}` falhou: {1}." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/platform/extensions/common/extensionsRegistry.i18n.json b/i18n/ptb/src/vs/platform/extensions/common/extensionsRegistry.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..8de8bd11bbfc722d1b4140cd54c893edde10cada --- /dev/null +++ b/i18n/ptb/src/vs/platform/extensions/common/extensionsRegistry.i18n.json @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "vscode.extension.engines.vscode": "Para extensões do VS Code, especifica a versão do VS Code que a extensão é compatível. Não pode ser *. Por exemplo: ^0.10.5 indica compatibilidade com uma versão mínima de 0.10.5 para o VS Code.", + "vscode.extension.publisher": "O editor da extensão do VS Code.", + "vscode.extension.displayName": "O nome de exibição para a extensão do VS Code.", + "vscode.extension.categories": "As categorias usadas pela galeria do VS Code para categorizar a extensão.", + "vscode.extension.galleryBanner": "Banner usado na loja VS Code.", + "vscode.extension.galleryBanner.color": "A cor do banner usado no cabeçalho de página da loja VS Code.", + "vscode.extension.galleryBanner.theme": "A cor do tema usada para o fonte usado no banner.", + "vscode.extension.contributes": "Todas as contribuições da extensão VS Code representadas por este pacote.", + "vscode.extension.preview": "Configura a extensão para ser marcada como pré-visualização na Loja.", + "vscode.extension.activationEvents": "Eventos de ativação para a extensão VS Code.", + "vscode.extension.activationEvents.onLanguage": "Um evento de ativação emitido sempre que um arquivo que resolve para a linguagem especificada é aberto.", + "vscode.extension.activationEvents.onCommand": "Um evento de ativação emitido sempre que o comando especificado for invocado.", + "vscode.extension.activationEvents.onDebug": "Um evento de ativação emitido sempre que uma sessão de depuração do tipo especificado é iniciada.", + "vscode.extension.activationEvents.workspaceContains": "Um evento de ativação emitido quando uma pasta que contém pelo menos um arquivo correspondente ao padrão global especificado é aberta.", + "vscode.extension.activationEvents.onView": "Um evento de ativação emitido sempre que o modo de visualização especificado é expandido.", + "vscode.extension.activationEvents.star": "Um evento de ativação emitido na inicialização do VS Code. Para garantir uma ótima experiência de usuário, por favor, use este evento de ativação em sua extensão somente quando nenhuma outra combinação de eventos de ativação funcionar em seu caso de uso.", + "vscode.extension.badges": "Matriz de emblemas a mostrar na barra lateral da página da extensão na Loja.", + "vscode.extension.badges.url": "URL da imagem do emblema.", + "vscode.extension.badges.href": "Link do emblema.", + "vscode.extension.badges.description": "Descrição do emblema.", + "vscode.extension.extensionDependencies": "Dependências para outras extensões. O identificador de uma extensão sempre é ${publisher}. ${nome}. Por exemplo: vscode.csharp.", + "vscode.extension.scripts.prepublish": "Script a ser executado antes do pacote ser publicado como uma extensão VS Code.", + "vscode.extension.icon": "O caminho para um ícone de 128x128 pixels." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/platform/extensions/node/extensionValidator.i18n.json b/i18n/ptb/src/vs/platform/extensions/node/extensionValidator.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..fe37dd1820f45062da908a0a96360ac77a77fca7 --- /dev/null +++ b/i18n/ptb/src/vs/platform/extensions/node/extensionValidator.i18n.json @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "versionSyntax": "Não foi possível analisar o valor de 'engines.vscode' {0}. Por favor, utilize, por exemplo: ^ 0.10.0, ^ 1.2.3, ^ 0.11.0, ^ 0.10.x, etc.", + "versionSpecificity1": "Versão especificada em 'engines.vscode' ({0}) não é específica o suficiente. Para versões do vscode anteriores a 1.0.0, por favor defina no mínimo a versão principal e secundária desejada. Por exemplo, ^ 0.10.0, 0.10.x, 0.11.0, etc.", + "versionSpecificity2": "Versão especificada em 'engines.vscode' ({0}) não é específica o suficiente. Para as versões do vscode posteriores a 1.0.0, por favor defina no mínimo a versão principal do desejado. Por exemplo, ^ 1.10.0, 1.10.x 1. XX, 2.x.x, etc.", + "versionMismatch": "Extensão não é compatível com Code {0}. A extensão requer: {1}.", + "extensionDescription.empty": "Descrição de extensão vazia obtida", + "extensionDescription.publisher": "a propriedade `{0}` é obrigatória e deve ser do tipo `string`", + "extensionDescription.name": "a propriedade `{0}` é obrigatória e deve ser do tipo `string`", + "extensionDescription.version": "a propriedade `{0}` é obrigatória e deve ser do tipo `string`", + "extensionDescription.engines": "a propriedade `{0}` é obrigatória e deve ser do tipo `object`", + "extensionDescription.engines.vscode": "a propriedade `{0}` é obrigatória e deve ser do tipo `string`", + "extensionDescription.extensionDependencies": "a propriedade `{0}` pode ser omitida ou deve ser do tipo `string[]`", + "extensionDescription.activationEvents1": "a propriedade `{0}` pode ser omitida ou deve ser do tipo `string[]`", + "extensionDescription.activationEvents2": "Propriedades '{0}' e '{1}' devem ser especificadas ou devem ambas ser omitidas", + "extensionDescription.main1": "a propriedade `{0}` é opcional ou pode ser do tipo `string`", + "extensionDescription.main2": "Esperado 'main' ({0}) ser incluído dentro da pasta da extensão ({1}). Isto pode fazer a extensão não-portável.", + "extensionDescription.main3": "propriedades '{0}' e '{1}' devem ser especificadas ou devem ambas ser omitidas", + "notSemver": "Versão da extensão não é compatível a semver" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/platform/history/electron-main/historyMainService.i18n.json b/i18n/ptb/src/vs/platform/history/electron-main/historyMainService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..05f131174eada882c07ce376c9a0b34cb7e77303 --- /dev/null +++ b/i18n/ptb/src/vs/platform/history/electron-main/historyMainService.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "newWindow": "Nova Janela", + "newWindowDesc": "Abrir uma nova janela", + "recentFolders": "Pastas Recentes", + "folderDesc": "{0} {1}" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/platform/integrity/node/integrityServiceImpl.i18n.json b/i18n/ptb/src/vs/platform/integrity/node/integrityServiceImpl.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..d252527ac153300e44c4d6f7c6c6bb0a90dcfb33 --- /dev/null +++ b/i18n/ptb/src/vs/platform/integrity/node/integrityServiceImpl.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "integrity.ok": "OK", + "integrity.dontShowAgain": "Não mostrar novamente", + "integrity.moreInfo": "Mais informações", + "integrity.prompt": "Sua instalação de {0} parece estar corrompida. Favor reinstalar." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/platform/jsonschemas/common/jsonValidationExtensionPoint.i18n.json b/i18n/ptb/src/vs/platform/jsonschemas/common/jsonValidationExtensionPoint.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..47ff1ba6badad918e70a6d080cae5bf65d85f91a --- /dev/null +++ b/i18n/ptb/src/vs/platform/jsonschemas/common/jsonValidationExtensionPoint.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "contributes.jsonValidation": "Contribui à configuração do schema json.", + "contributes.jsonValidation.fileMatch": "O padrão de arquivo a corresponder, por exemplo \"package.json\" ou \"*.launch\".", + "contributes.jsonValidation.url": "Um esquema de URL ('http:', 'https:') ou caminho relativo à pasta de extensão('./').", + "invalid.jsonValidation": "'configuration.jsonValidation' deve ser uma matriz", + "invalid.fileMatch": "'configuration.jsonValidation.fileMatch' deve ser definido", + "invalid.url": "'configuration.jsonValidation.url' deve ser uma URL ou caminho relativo", + "invalid.url.fileschema": "'configuration.jsonValidation.url' é uma URL relativa inválida: {0}", + "invalid.url.schema": "'configuration.jsonValidation.url' deve começar com ' http:', ' https: 'ou'. /' para os esquemas de referência localizados na extensão" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/platform/keybinding/common/abstractKeybindingService.i18n.json b/i18n/ptb/src/vs/platform/keybinding/common/abstractKeybindingService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..59961c4476a0f734ff9f20b7c700645e404ec635 --- /dev/null +++ b/i18n/ptb/src/vs/platform/keybinding/common/abstractKeybindingService.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "first.chord": "({0}) foi pressionado. Aguardando segunda tecla de pressionamento simultâneo...", + "missing.chord": "A combinação de chave ({0}, {1}) não é um comando." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/platform/keybinding/common/keybindingLabels.i18n.json b/i18n/ptb/src/vs/platform/keybinding/common/keybindingLabels.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..bf2baf839060849cf84c714ebc9b91e51da423d5 --- /dev/null +++ b/i18n/ptb/src/vs/platform/keybinding/common/keybindingLabels.i18n.json @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "ctrlKey": "Ctrl", + "shiftKey": "Shift", + "altKey": "Alt", + "windowsKey": "Windows", + "ctrlKey.long": "Controle", + "shiftKey.long": "Shift", + "altKey.long": "Alt", + "cmdKey.long": "Comando", + "windowsKey.long": "Windows" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/platform/markers/common/problemMatcher.i18n.json b/i18n/ptb/src/vs/platform/markers/common/problemMatcher.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..29df9e58b2bf02d6546e193644ba7e4809ef3a9c --- /dev/null +++ b/i18n/ptb/src/vs/platform/markers/common/problemMatcher.i18n.json @@ -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. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "ProblemPatternParser.loopProperty.notLast": "A propriedade loop só é suportada na última linha correspondente.", + "ProblemPatternParser.problemPattern.missingRegExp": "Está faltando uma expressão regular a problema padrão.", + "ProblemPatternParser.problemPattern.missingProperty": "O problema padrão é inválido. Ele deve ter ao menos um arquivo, mensagem e linha ou local de grupo de correspondência.", + "ProblemPatternParser.invalidRegexp": "Erro: a cadeia de caracteres {0} não é uma expressão regular válida.\n", + "ProblemPatternSchema.regexp": "A expressão regular para procurar um erro, aviso ou informação na saída.", + "ProblemPatternSchema.file": "O índice do grupo de correspondência do arquivo. Se omitido, será usado 1.", + "ProblemPatternSchema.location": "O índice de grupo de correspondência da localização do problema. Padrões de localização válidos são: (linha), (linha, coluna) e (startLine, startColumn, endLine, endColumn). Se omitido (linha, coluna) é assumido.", + "ProblemPatternSchema.line": "O índice de grupo de correspondência da linha do problema. O padrão é 2", + "ProblemPatternSchema.column": "O índice de grupo de correspondência de caractere da linha do problema. O padrão é 3", + "ProblemPatternSchema.endLine": "O índice de grupo de correspondência de linha final do problema. O padrão é indefinido", + "ProblemPatternSchema.endColumn": "O índice de grupo de correspondência de caráter final de linha do problema. O padrão é indefinido", + "ProblemPatternSchema.severity": "O índice de grupo de correspondência da gravidade do problema. O padrão é indefinido", + "ProblemPatternSchema.code": "O índice de grupo de correspondência do código do problema. O padrão é indefinido", + "ProblemPatternSchema.message": "O índice de grupo de correspondência da mensagem. Se omitido o padrão é 4 se o local for especificado. Caso contrário o padrão é 5.", + "ProblemPatternSchema.loop": "Em um loop de correspondência multi linha indica se este padrão é executado em um loop enquanto houver correspondências. Somente pode ser especificado no último padrão em um padrão de linha múltiplas.", + "NamedProblemPatternSchema.name": "O nome do modelo de problema.", + "NamedMultiLineProblemPatternSchema.name": "O nome do modelo de problema multi-linhas.", + "NamedMultiLineProblemPatternSchema.patterns": "Os padrões atuais.", + "ProblemPatternExtPoint": "Contribui aos modelos de problema", + "ProblemPatternRegistry.error": "Modelo de problema inválido. O modelo será ignorado.", + "ProblemMatcherParser.noProblemMatcher": "Erro: a descrição não pode ser convertida em uma correspondência de problema:\n{0}\n\n", + "ProblemMatcherParser.noProblemPattern": "Erro: a descrição nao define um padrão de problema válido: {0}\n", + "ProblemMatcherParser.noOwner": "Erro: a descriçao não define um proprietário:\n{0}\n", + "ProblemMatcherParser.noFileLocation": "Erro: a descrição não define uma localização de arquivo:\n{0}\n", + "ProblemMatcherParser.unknownSeverity": "Info: severidade {0} desconhecida. Valores válidos são erro, aviso e info.\n", + "ProblemMatcherParser.noDefinedPatter": "Erro: o padrão com o identificador {0} não existe.", + "ProblemMatcherParser.noIdentifier": "Erro: a propriedade padrão se refere a um identificador vazio.", + "ProblemMatcherParser.noValidIdentifier": "Erro: a propriedade padrão {0} não é uma variável de padrões válida.", + "ProblemMatcherParser.problemPattern.watchingMatcher": "Um problema de correspondência deve obrigatoriamente definir padrão inicial e um padrão final para monitoramento.", + "ProblemMatcherParser.invalidRegexp": "Erro: a cadeia de caracteres {0} não é uma expressão regular válida.\n", + "WatchingPatternSchema.regexp": "A expressão regular para detectar o início ou o fim de uma tarefa em segundo plano.", + "WatchingPatternSchema.file": "O índice do grupo de correspondência do arquivo. Pode ser omitido.", + "PatternTypeSchema.name": "O nome de um padrão pré-definido ou contribuído.", + "PatternTypeSchema.description": "Um padrão de problema ou o nome de um padrão de problema pré-definido ou contribuído. Pode ser omitido se base for especificada.", + "ProblemMatcherSchema.base": "O nome de uma correspondência de problema base a ser utilizado.", + "ProblemMatcherSchema.owner": "O proprietário de um problema dentro do código. Pode ser omitido se base for especificada. Default para 'externo' se omitido e base não for especificada.", + "ProblemMatcherSchema.severity": "A severidade padrão para captura de problemas. É utilizada se o padrão não definir um grupo correspondente para severidade.", + "ProblemMatcherSchema.applyTo": "Controla se um problema reportado em um documento de texto é aplicado somente para aberto, fechado ou todos os documentos.", + "ProblemMatcherSchema.fileLocation": "Define como os nomes de arquivos reportados em um padrão de problema devem ser interpretados.", + "ProblemMatcherSchema.background": "Padrões para monitorar o início e o término de um pesquisador ativo em uma tarefa em segundo plano.", + "ProblemMatcherSchema.background.activeOnStart": "Se configurado para verdadeiro, o monitor em segundo plano está em modo ativo quando a tarefa inicia. Isto é igual a emissão de uma linha que corresponde ao beginPattern", + "ProblemMatcherSchema.background.beginsPattern": "Se houver correspondência na saída o início de uma tarefa em segundo plano é sinalizada.", + "ProblemMatcherSchema.background.endsPattern": "Se houver correspondência na saída o final de uma tarefa em segundo plano é sinalizada.", + "ProblemMatcherSchema.watching.deprecated": "A propriedade watching foi descontinuada. Use background no lugar dela.", + "ProblemMatcherSchema.watching": "Padrões para monitorar o início e o término de um pesquisador observando.", + "ProblemMatcherSchema.watching.activeOnStart": "Se configurado para verdadeiro, o monitoramento está em modo ativo quando a tarefa inicia. Isto é igual a emissão de uma linha que corresponde ao beginPattern", + "ProblemMatcherSchema.watching.beginsPattern": "Se houver correspondência na saída o início de uma tarefa observada é sinalizada.", + "ProblemMatcherSchema.watching.endsPattern": "Se houver correspondência na saída o final de uma tarefa observada é sinalizada.", + "LegacyProblemMatcherSchema.watchedBegin.deprecated": "Esta propriedade está descontinuada. Ao invés, use a propriedade de observação.", + "LegacyProblemMatcherSchema.watchedBegin": "Uma expressão regular sinalizando que uma tarefa observada é ativada através da observação.", + "LegacyProblemMatcherSchema.watchedEnd.deprecated": "Esta propriedade está descontinuada. Ao invés, use a propriedade de observação.", + "LegacyProblemMatcherSchema.watchedEnd": "Uma expressão regular sinalizando que uma tarefa observada terminou a execução.", + "NamedProblemMatcherSchema.name": "O nome do correspondente do problema.", + "ProblemMatcherExtPoint": "Contribui aos correspondentes de problema" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/platform/message/common/message.i18n.json b/i18n/ptb/src/vs/platform/message/common/message.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..620c63edd0712ec1f8e8ed3fd061052a203859db --- /dev/null +++ b/i18n/ptb/src/vs/platform/message/common/message.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "close": "Fechar", + "later": "Mais tarde", + "cancel": "Cancelar" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/platform/request/node/request.i18n.json b/i18n/ptb/src/vs/platform/request/node/request.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..1f7fd75e5aa685e2bac1c353af468a48cbaa3366 --- /dev/null +++ b/i18n/ptb/src/vs/platform/request/node/request.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "httpConfigurationTitle": "HTTP", + "proxy": "As configurações de proxy a usar. Se não forem configuradas, serão obtidas das variáveis de ambiente http_proxy e https_proxy", + "strictSSL": "Se o certificado do servidor de proxy deve ser verificado contra a lista de autoridades de certificação fornecida.", + "proxyAuthorization": "O valor para enviar como o cabeçalho de 'autorização Proxy' para cada solicitação de rede." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/platform/telemetry/common/telemetryService.i18n.json b/i18n/ptb/src/vs/platform/telemetry/common/telemetryService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..a1d67b82fb73f387b34cce42fee0a74e895c2d8c --- /dev/null +++ b/i18n/ptb/src/vs/platform/telemetry/common/telemetryService.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "telemetryConfigurationTitle": "Telemetria", + "telemetry.enableTelemetry": "Permitir que os dados de uso e erros sejam enviados à Microsoft." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/platform/theme/common/colorRegistry.i18n.json b/i18n/ptb/src/vs/platform/theme/common/colorRegistry.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..0cfc1a7ffbe962b06b34ef69e205c4ca74656e93 --- /dev/null +++ b/i18n/ptb/src/vs/platform/theme/common/colorRegistry.i18n.json @@ -0,0 +1,85 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "invalid.color": "Formato inválido de cor. Use #RGB, #RGBA, #RRGGBB ou #RRGGBBAA", + "schema.colors": "Cores usadas no workbench.", + "foreground": "Cor de primeiro plano geral. Essa cor é só usada se não for substituída por um componente.", + "errorForeground": "Cor de primeiro plano geral para mensagens de erro. Essa cor é só usada se não for substituída por um componente.", + "descriptionForeground": "Cor de primeiro plano para a descrição do texto provendo informação adicional, por exemplo para uma etiqueta.", + "focusBorder": "Cor geral da borda para elementos focalizados. Essa cor é usada somente se não for substituída por um componente.", + "contrastBorder": "Uma borda extra em torno de elementos para separá-los dos outros de maior contraste.", + "activeContrastBorder": "Uma borda extra em torno de elementos ativos para separá-los dos outros de maior contraste.", + "selectionBackground": "A cor de fundo das seleções de texto na área de trabalho (por exemplo, para campos de entrada ou áreas de texto). Note que isto não se aplica a seleções dentro do editor.", + "textSeparatorForeground": "Cor para separadores de texto.", + "textLinkForeground": "Cor de primeiro plano para links no texto.", + "textLinkActiveForeground": "Cor de primeiro plano para links ativos no texto.", + "textPreformatForeground": "Cor de primeiro plano para segmentos de texto pré-formatados.", + "textBlockQuoteBackground": "Cor de fundo para blocos de citações no texto.", + "textBlockQuoteBorder": "Cor da borda para blocos de citações no texto.", + "textCodeBlockBackground": "Cor de fundo para blocos de código no texto.", + "widgetShadow": "Cor de sombra ferramentas como localizar/substituir dentro do editor.", + "inputBoxBackground": "Cor de fundo da caixa de entrada.", + "inputBoxForeground": "Cor de primeiro plano da caixa de entrada.", + "inputBoxBorder": "Borda da caixa de entrada.", + "inputBoxActiveOptionBorder": "Cor da borda das opções ativas em campos de entrada.", + "inputPlaceholderForeground": "Cor de primeiro plano da caixa de entrada para o texto de espaço reservado.", + "inputValidationInfoBackground": "Cor de fundo de validação de entrada para a severidade de informações.", + "inputValidationInfoBorder": "Cor da borda de validação de entrada para a severidade de informações.", + "inputValidationWarningBackground": "Cor de fundo de validação de entrada para avisos.", + "inputValidationWarningBorder": "Cor da borda de validação para a severidade de avisos.", + "inputValidationErrorBackground": "Cor de fundo de validação de entrada para a severidade do erro.", + "inputValidationErrorBorder": "Cor da borda de validação de entrada para a severidade do erro.", + "dropdownBackground": "Cor de fundo do menu suspenso.", + "dropdownForeground": "Cor de primeiro plano do menu suspenso.", + "dropdownBorder": "Borda do menu suspenso.", + "listFocusBackground": "Cor de fundo para o item focalizado de Lista/árvore quando a lista/árvore está ativa. Uma árvore/lista de ativa tem o foco do teclado, uma inativa não.", + "listFocusForeground": "Cor de fundo da Lista/árvore para o item focalizado quando a lista/árvore está ativa. Uma árvore/lista ativa tem o foco do teclado, uma inativa não.", + "listActiveSelectionBackground": "Cor de fundo para o item selecionado de Lista/árvore quando a lista/árvore está ativa. Uma lista/árvore ativa tem o foco do teclado, uma inativa não.", + "listActiveSelectionForeground": "Cor de primeiro plano para o item selecionado de Lista/árvore quando a lista/árvore está ativa. Uma lista/árvore ativa tem o foco do teclado, uma inativa não.", + "listInactiveSelectionBackground": "Cor de fundo para o item selecionado de Lista/árvore quando a lista/árvore está inativa. Uma lista/árvore ativa tem o foco do teclado, uma inativa não.", + "listInactiveSelectionForeground": "Cor de primeiro plano para Lista/árvore para o item selecionado quando a lista/árvore está inativa. Uma árvore/lista ativa tem o foco do teclado, um inativo não.", + "listHoverBackground": "Cor de fundo de Lista/árvore quando pairando sobre itens usando o mouse.", + "listHoverForeground": "Primeiro plano da Lista/Árvoce quando passar sobre itens usando o mouse.", + "listDropBackground": "Cor de fundo ao arrastar e soltar de Lista/árvore quando movendo itens usando o mouse.", + "highlight": "Cor de primeiro plano de Lista/árvore de destaques de correspondências ao pesquisar na árvore/lista.", + "pickerGroupForeground": "Seletor rápido de cor para rótulos de agrupamento.", + "pickerGroupBorder": "Seletor rápido de cor para bordas de agrupamentos.", + "buttonForeground": "Cor de primeiro plano do botão.", + "buttonBackground": "Cor de fundo do botão.", + "buttonHoverBackground": "Cor de fundo de botão quando flutuar sobre ele.", + "badgeBackground": "Cor de fundo do distintivo. Distintivos são rótulos de pequenas informações, por exemplo, para a contagem de resultados de pesquisa.", + "badgeForeground": "Cor de primeiro plano do distintivo. Distintivos são rótulos de pequenas informações, por exemplo, para a contagem de resultados de pesquisa.", + "scrollbarShadow": "Sombra da barra de rolagem para indicar que a visualização está sendo rolada.", + "scrollbarSliderBackground": "Cor de fundo do controle deslizante.", + "scrollbarSliderHoverBackground": "Cor de fundo de controle deslizante quando estiver flutuando sobre ele.", + "scrollbarSliderActiveBackground": "Cor de fundo de controle deslizante quando ativo.", + "progressBarBackground": "Cor de fundo da barra de progresso que pode ser mostrada em operações de execução demorada.", + "editorBackground": "Cor de plano de fundo do editor.", + "editorForeground": "Cor de primeiro plano padrão do editor.", + "editorWidgetBackground": "Cor de plano de fundo das ferramentas de edição, como pesquisar/substituir.", + "editorWidgetBorder": "Cor da borda das ferramentas do editor. A cor é usada somente se a ferramenta escolhe ter uma borda e a cor não é substituída por uma ferramenta.", + "editorSelection": "Cor de seleção do editor.", + "editorInactiveSelection": "Cor de seleção em um editor inativo.", + "editorSelectionHighlight": "Cor de regiões com o mesmo conteúdo da seleção.", + "editorFindMatch": "Cor da correspondência de pesquisa atual.", + "findMatchHighlight": "Cor dos outros resultados de pesquisa.", + "findRangeHighlight": "Cor da faixa que limita a pesquisa.", + "hoverHighlight": "Realçar abaixo da palavra onde é mostrado item flutuante", + "hoverBackground": "Cor de fundo para o item flutuante do editor", + "hoverBorder": "Cor da borda para o item flutuante do editor.", + "activeLinkForeground": "Cor dos links ativos.", + "diffEditorInserted": "Cor de fundo para texto que foi inserido.", + "diffEditorRemoved": "Cor de fundo para texto que foi removido.", + "diffEditorInsertedOutline": "Cor de contorno para o texto que foi inserido.", + "diffEditorRemovedOutline": "Cor de contorno para o texto que foi removido.", + "mergeCurrentHeaderBackground": "Cor de fundo de cabeçalho atual em conflito de mesclagem em linha.", + "mergeCurrentContentBackground": "Cor de fundo de conteúdo atual em conflito de mesclagem em linha.", + "mergeIncomingHeaderBackground": "Cor de fundo de cabeçalho de entrada em conflito de mesclagem em linha.", + "mergeIncomingContentBackground": "Cor de fundo de conteúdo de entrada em conflito de mesclagem em linha.", + "mergeBorder": "Cor da borda dos cabeçalhos e separadores estão em conflito de mesclagem em linha.", + "overviewRulerCurrentContentForeground": "Cor de fundo de régua de visuaização atual em conflito de mesclagem em linha.", + "overviewRulerIncomingContentForeground": "Cor de fundo de régua de visuaização de entrada em conflito de mesclagem em linha." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/api/electron-browser/mainThreadExtensionService.i18n.json b/i18n/ptb/src/vs/workbench/api/electron-browser/mainThreadExtensionService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..d45294dd3175775a67614b3d0213d2624109fdcc --- /dev/null +++ b/i18n/ptb/src/vs/workbench/api/electron-browser/mainThreadExtensionService.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "overwritingExtension": "Sobrescrevendo extensão {0} por {1}.", + "extensionUnderDevelopment": "Carregando extensão de desenvolvimento em {0}" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/api/electron-browser/mainThreadMessageService.i18n.json b/i18n/ptb/src/vs/workbench/api/electron-browser/mainThreadMessageService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..0feb87677bb4d004bdd6b63ad5864627fae9b04a --- /dev/null +++ b/i18n/ptb/src/vs/workbench/api/electron-browser/mainThreadMessageService.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "close": "Fechar", + "cancel": "Cancelar", + "ok": "OK" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/api/node/extHostDiagnostics.i18n.json b/i18n/ptb/src/vs/workbench/api/node/extHostDiagnostics.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..867922ab8d2daabd8a7b274b87c2dc15ae3542c5 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/api/node/extHostDiagnostics.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "limitHit": "Não apresentando {0} erros e avisos a mais." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/api/node/extHostTask.i18n.json b/i18n/ptb/src/vs/workbench/api/node/extHostTask.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..4b90a12aaf247b4a1af0e887542958471d8df5e5 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/api/node/extHostTask.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "task.label": "{0}: {1}" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/api/node/extHostTreeViews.i18n.json b/i18n/ptb/src/vs/workbench/api/node/extHostTreeViews.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..d5ca67a93536092670de28815cfbc255646ab541 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/api/node/extHostTreeViews.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "treeView.notRegistered": "Nenhuma visualização de árvore com id '{0}' registrado.", + "treeItem.notFound": "Nenhum item de árvore com id '{0}' encontrado.", + "treeView.duplicateElement": "Elemento {0} já está registrado" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/browser/actions/configureLocale.i18n.json b/i18n/ptb/src/vs/workbench/browser/actions/configureLocale.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..80686b2c89835ac3803758e25dd979f108a3be83 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/browser/actions/configureLocale.i18n.json @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "configureLocale": "Configurar Idioma", + "displayLanguage": "Define o idioma de exibição do VSCode.", + "doc": "Veja {0} para obter uma lista dos idiomas suportados.", + "restart": "Modificar o valor requer reinicialização do VSCode.", + "fail.createSettings": "Não foi possível criar '{0}' ({1}).", + "JsonSchema.locale": "O idioma da interface do usuário a ser usada." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/browser/actions/fileActions.i18n.json b/i18n/ptb/src/vs/workbench/browser/actions/fileActions.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..9da2e4e11c7b4aeb323a6cf029dbc98edd480982 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/browser/actions/fileActions.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "openFolder": "Abrir Pasta...", + "openFileFolder": "Abrir..." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/browser/actions/toggleActivityBarVisibility.i18n.json b/i18n/ptb/src/vs/workbench/browser/actions/toggleActivityBarVisibility.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..02e74f2918f40c21a586d89410b25bda0f0811b5 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/browser/actions/toggleActivityBarVisibility.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "toggleActivityBar": "Alternar Visibilidade da Barra de Atividades", + "view": "Exibir" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/browser/actions/toggleEditorLayout.i18n.json b/i18n/ptb/src/vs/workbench/browser/actions/toggleEditorLayout.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..4cdb847aaca74468b2dc3503facd137e657bc91d --- /dev/null +++ b/i18n/ptb/src/vs/workbench/browser/actions/toggleEditorLayout.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "toggleEditorGroupLayout": "Alternar Layout Vertical/Horizontal do Grupo de Editor", + "horizontalLayout": "Layout do Grupo de Editor Horizontal", + "verticalLayout": "Layout do Grupo de Editor Vertical", + "view": "Exibir" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/browser/actions/toggleSidebarPosition.i18n.json b/i18n/ptb/src/vs/workbench/browser/actions/toggleSidebarPosition.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..ee4fc5303618de4d8b8a499f13ac9742fcbcc141 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/browser/actions/toggleSidebarPosition.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "toggleLocation": "Alternar Localização da Barra Lateral", + "view": "Exibir" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/browser/actions/toggleSidebarVisibility.i18n.json b/i18n/ptb/src/vs/workbench/browser/actions/toggleSidebarVisibility.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..5143e35479cc21d29647f6131984c5e026409081 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/browser/actions/toggleSidebarVisibility.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "toggleSidebar": "Alternar Localização da Barra Lateral", + "view": "Exibir" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/browser/actions/toggleStatusbarVisibility.i18n.json b/i18n/ptb/src/vs/workbench/browser/actions/toggleStatusbarVisibility.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..5376fb36c3a6371d70acc88550cfd03dcdf7f237 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/browser/actions/toggleStatusbarVisibility.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "toggleStatusbar": "Alternar Visibilidade da Barra de Status", + "view": "Exibir" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/browser/actions/toggleZenMode.i18n.json b/i18n/ptb/src/vs/workbench/browser/actions/toggleZenMode.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..b0a635982f2efa1816eed73e3428c44564cb3041 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/browser/actions/toggleZenMode.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "toggleZenMode": "Alternar Modo Zen", + "view": "Exibir" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/browser/parts/activitybar/activitybarActions.i18n.json b/i18n/ptb/src/vs/workbench/browser/parts/activitybar/activitybarActions.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..8dab311a65fbf8657de496771dd5ee105a47d3e7 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/browser/parts/activitybar/activitybarActions.i18n.json @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "removeFromActivityBar": "Remover da Barra de Atividades", + "keepInActivityBar": "Manter na Barra de Atividades", + "titleKeybinding": "{0} ({1})", + "additionalViews": "Visualizações Adicionais", + "numberBadge": "{0} ({1})", + "manageExtension": "Gerenciar Extensão", + "toggle": "Alternar Visualização Fixa" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/browser/parts/activitybar/activitybarPart.i18n.json b/i18n/ptb/src/vs/workbench/browser/parts/activitybar/activitybarPart.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..577ad33d0b41fcbdf8097223ff49f64a0c7058e7 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/browser/parts/activitybar/activitybarPart.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "hideActivitBar": "Ocultar a Barra de Atividades", + "activityBarAriaLabel": "Chave do Modo de exibição Ativo", + "globalActions": "Ações globais" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/browser/parts/compositePart.i18n.json b/i18n/ptb/src/vs/workbench/browser/parts/compositePart.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..e12e6d4b90e56ba202ff876045f99b041c077b54 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/browser/parts/compositePart.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "ariaCompositeToolbarLabel": "{0} ações ", + "titleTooltip": "{0} ({1})" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/browser/parts/editor/binaryDiffEditor.i18n.json b/i18n/ptb/src/vs/workbench/browser/parts/editor/binaryDiffEditor.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..a38af02d663527576754d8164f4e2b729825137b --- /dev/null +++ b/i18n/ptb/src/vs/workbench/browser/parts/editor/binaryDiffEditor.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "metadataDiff": "{0} ↔ {1}" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/browser/parts/editor/binaryEditor.i18n.json b/i18n/ptb/src/vs/workbench/browser/parts/editor/binaryEditor.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..53321246ac788991c236daee9da8d43901ca685a --- /dev/null +++ b/i18n/ptb/src/vs/workbench/browser/parts/editor/binaryEditor.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "binaryEditor": "Visualizador binário" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/browser/parts/editor/editor.contribution.i18n.json b/i18n/ptb/src/vs/workbench/browser/parts/editor/editor.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..dbfae18a9bfb0890fb2fcaca5452a3413885af20 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/browser/parts/editor/editor.contribution.i18n.json @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "textEditor": "Editor de texto", + "textDiffEditor": "Editor de Diferentes Textos", + "binaryDiffEditor": "Editor de Diferença Binária", + "sideBySideEditor": "Editor Lado a lado", + "groupOnePicker": "Mostrar editores no primeiro grupo", + "groupTwoPicker": "Mostrar editores no segundo grupo", + "groupThreePicker": "Mostrar editores no terceiro grupo", + "allEditorsPicker": "Mostrar todos editores abertos", + "view": "Exibir" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/browser/parts/editor/editorActions.i18n.json b/i18n/ptb/src/vs/workbench/browser/parts/editor/editorActions.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..b49742676674d6cac3d2a073c570f7b022dc84f6 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/browser/parts/editor/editorActions.i18n.json @@ -0,0 +1,56 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "splitEditor": "Dividir editor", + "joinTwoGroups": "Juntar editores de dois grupos", + "navigateEditorGroups": "Navegar entre grupos de editores", + "focusActiveEditorGroup": "Focalizar grupo de editores ativo", + "focusFirstEditorGroup": "Focalizar o primeiro grupo de editores", + "focusSecondEditorGroup": "Focalizar o segundo grupo de editores", + "focusThirdEditorGroup": "Focalizar o terceiro grupo de editores", + "focusPreviousGroup": "Focalizar grupo anterior", + "focusNextGroup": "Focalizar próximo grupo", + "openToSide": "Aberto para o lado", + "closeEditor": "Fechar editor", + "revertAndCloseActiveEditor": "Reverter e fechar editor", + "closeEditorsToTheLeft": "Fechar editores à esquerda ", + "closeEditorsToTheRight": "Fechar editores à direita", + "closeAllEditors": "Fechar todos editores", + "closeUnmodifiedEditors": "Fechar os Editores Não Modificados no Grupo", + "closeEditorsInOtherGroups": "Fechar editores nos outros grupos", + "closeOtherEditorsInGroup": "Fechar outros editores", + "closeEditorsInGroup": "Fechar todos editores no grupo", + "moveActiveGroupLeft": "Mover grupo de editores para esquerda", + "moveActiveGroupRight": "Mover grupo de editores para direita", + "minimizeOtherEditorGroups": "Minimizar outros grupos de editores", + "evenEditorGroups": "Igualar larguras de grupos de editores", + "maximizeEditor": "Maximizar grupo de editor e ocultar barra lateral", + "keepEditor": "Manter editor", + "openNextEditor": "Abrir próximo editor", + "openPreviousEditor": "Abrir editor anterior", + "nextEditorInGroup": "Abrir próximo editor no grupo", + "openPreviousEditorInGroup": "Abrir editor anterior no grupo", + "navigateNext": "Avançar", + "navigatePrevious": "Voltar", + "reopenClosedEditor": "Reabrir Editor Fechado", + "clearRecentFiles": "Limpar arquivos recentes", + "showEditorsInFirstGroup": "Mostrar editores no primeiro grupo", + "showEditorsInSecondGroup": "Mostrar editores no segundo grupo", + "showEditorsInThirdGroup": "Mostrar editores no terceiro grupo", + "showEditorsInGroup": "Mostrar editores no grupo", + "showAllEditors": "Mostrar todos editores", + "openPreviousRecentlyUsedEditorInGroup": "Abrir o Editor Anterior Recentemente Usado no Grupo", + "openNextRecentlyUsedEditorInGroup": "Abrir o Próximo Editor Recentemente Usado no Grupo", + "navigateEditorHistoryByInput": "Abrir o Editor Anterior do Histórico", + "openNextRecentlyUsedEditor": "Abrir o Próximo Editor Recentemente Utilizado", + "openPreviousRecentlyUsedEditor": "Abrir o Editor Anterior Recentemente Utilizado", + "clearEditorHistory": "Limpar Histórico do Editor", + "focusLastEditorInStack": "Abrir Último Editor do Grupo", + "moveEditorLeft": "Mover Editor para Esquerda", + "moveEditorRight": "Mover Editor para Direita", + "moveEditorToPreviousGroup": "Mover Editor para o Grupo Anterior", + "moveEditorToNextGroup": "Mover o Editor para o Próximo Grupo" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/browser/parts/editor/editorCommands.i18n.json b/i18n/ptb/src/vs/workbench/browser/parts/editor/editorCommands.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..f42c45c02f558b72b0ba4f5e56e0ea9818e69a5b --- /dev/null +++ b/i18n/ptb/src/vs/workbench/browser/parts/editor/editorCommands.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "editorCommand.activeEditorMove.description": "Mover o editor ativo por guias ou grupos", + "editorCommand.activeEditorMove.arg.name": "Argumento de movimento do editor ativo", + "editorCommand.activeEditorMove.arg.description": "Propriedades do argumento: \n\t\t\t\t\t\t- 'para': sequência de valor fornecendo para onde mover.\n\t\t\t\t\t\t- 'por': sequência de valor, fornecendo a unidade para o movimento. Por guia ou por grupo.\n\t\t\t\t\t\t- 'valor': valor numérico, fornecendo quantas posições ou uma posição absoluta para mover.\n\t\t\t\t\t", + "commandDeprecated": "Comando **{0}** foi removido. Você pode usar **{1}** em vez disso", + "openKeybindings": "Configurar os atalhos de teclado" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/browser/parts/editor/editorPart.i18n.json b/i18n/ptb/src/vs/workbench/browser/parts/editor/editorPart.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..c6a90d88542a6d9cf2ffee76cd9f9d1f75e2bda4 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/browser/parts/editor/editorPart.i18n.json @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "groupOneVertical": "Esquerda", + "groupTwoVertical": "Centro", + "groupThreeVertical": "Direita", + "groupOneHorizontal": "Topo", + "groupTwoHorizontal": "Centro", + "groupThreeHorizontal": "Baixo", + "editorOpenError": "Não foi possível abrir '{0}': {1}." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/browser/parts/editor/editorPicker.i18n.json b/i18n/ptb/src/vs/workbench/browser/parts/editor/editorPicker.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..e17bc9405654b9e2ca3659cb1062cdd1126a5df7 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/browser/parts/editor/editorPicker.i18n.json @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "entryAriaLabel": "{0}, seletor de grupo editor", + "groupLabel": "Grupo: {0}", + "noResultsFoundInGroup": "Não foi encontrado nennhum editor aberto no grupo", + "noOpenedEditors": "Lista de editores abertos está atualmente vazia no grupo", + "noResultsFound": "Não foi encontrado editor correspondente aberto", + "noOpenedEditorsAllGroups": "A lista de editores abertos está atualmente vazia" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/browser/parts/editor/editorStatus.i18n.json b/i18n/ptb/src/vs/workbench/browser/parts/editor/editorStatus.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..7ec5ce6904c27ca98a52d0df53cfb4959d6cecee --- /dev/null +++ b/i18n/ptb/src/vs/workbench/browser/parts/editor/editorStatus.i18n.json @@ -0,0 +1,51 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "singleSelectionRange": "Ln {0}, {1} Col ({2} selecionado)", + "singleSelection": "Ln {0}, {1} Col", + "multiSelectionRange": "{0} seleções ({1} caracteres selecionados)", + "multiSelection": "{0} seleções", + "endOfLineLineFeed": "LF", + "endOfLineCarriageReturnLineFeed": "CRLF", + "tabFocusModeEnabled": "Tabulação Move o Foco", + "screenReaderDetected": "Leitor de Tela Detectado", + "screenReaderDetectedExtra": "Se você não estiver usando um leitor de tela, por favor altere a configuração `editor.accessibilitySupport` para \"desligado\".", + "disableTabMode": "Desativar o modo de acessibilidade", + "gotoLine": "Ir para linha", + "indentation": "Indentação", + "selectEncoding": "Selecionar a codificação", + "selectEOL": "Selecionar a sequência de fim de linha", + "selectLanguageMode": "Selecionar modo de idioma", + "fileInfo": "Informações do arquivo", + "spacesSize": "Espaços: {0}", + "tabSize": "Tamanho de Tabulação: {0}", + "showLanguageExtensions": "Pesquisar extensões na loja para '{0}'...", + "changeMode": "Alterar o modo de linguagem", + "noEditor": "Nenhum editor de texto ativo neste momento", + "languageDescription": "({0}) - linguagem configurada", + "languageDescriptionConfigured": "({0})", + "languagesPicks": "linguagens (identificador)", + "configureModeSettings": "Configurar '{0}' configurações baseadas em linguagem...", + "configureAssociationsExt": "Configurar a associação de arquivo para '{0}'...", + "autoDetect": "Detecção automática", + "pickLanguage": "Selecionar o modo do idioma", + "currentAssociation": "Associação atual", + "pickLanguageToConfigure": "Selecionar o modo de linguagem para associar a '{0}'", + "changeIndentation": "Alterar a indentação", + "noWritableCodeEditor": "O editor de código ativo é somente leitura.", + "indentView": "alterar visualização", + "indentConvert": "converter arquivo", + "pickAction": "Selecionar ação", + "changeEndOfLine": "Alterar sequência de final de linha", + "pickEndOfLine": "Selecionar sequência de final de linha", + "changeEncoding": "Alterar a codificação do arquivo", + "noFileEditor": "Nenhum arquivo ativo neste momento", + "saveWithEncoding": "Salvar com codificação", + "reopenWithEncoding": "Reabrir com codificação", + "guessedEncoding": "Adivinhado a partir do conteúdo", + "pickEncodingForReopen": "Selecione a codificaçãodo arquivo para reabrir o arquivo.", + "pickEncodingForSave": "Selecione a codificação do arquivo para Salvar Com" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/browser/parts/editor/tabsTitleControl.i18n.json b/i18n/ptb/src/vs/workbench/browser/parts/editor/tabsTitleControl.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..9001e58fa993187e66720e707952b81c0e3cf99a --- /dev/null +++ b/i18n/ptb/src/vs/workbench/browser/parts/editor/tabsTitleControl.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "araLabelTabActions": "Ações de tablulação" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/browser/parts/editor/textDiffEditor.i18n.json b/i18n/ptb/src/vs/workbench/browser/parts/editor/textDiffEditor.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..8af2aff62d5e24ad58816935b949dd546f2e3617 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/browser/parts/editor/textDiffEditor.i18n.json @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "textDiffEditor": "Editor de Diferentes Textos", + "readonlyEditorWithInputAriaLabel": "{0}. Editor de comparação de texto somente leitura.", + "readonlyEditorAriaLabel": "Editor de comparação de texto somente leitura.", + "editableEditorWithInputAriaLabel": "{0}. Editor de comparação de arquivos texto.", + "editableEditorAriaLabel": "Editor de comparação de arquivos texto.", + "navigate.next.label": "Próxima Alteração", + "navigate.prev.label": "Alteração Anterior", + "inlineDiffLabel": "Alternar para exibição embutida", + "sideBySideDiffLabel": "Alternar para exibição lado a lado" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/browser/parts/editor/textEditor.i18n.json b/i18n/ptb/src/vs/workbench/browser/parts/editor/textEditor.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..eb58230b8543114b07c1dd82e2a685c72d2fa8e8 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/browser/parts/editor/textEditor.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "editorLabelWithGroup": "{0}, Grupo {1}." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/browser/parts/editor/textResourceEditor.i18n.json b/i18n/ptb/src/vs/workbench/browser/parts/editor/textResourceEditor.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..77f89efba5f9c04dfde3c6adf8a5750995d16883 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/browser/parts/editor/textResourceEditor.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "textEditor": "Editor de texto", + "readonlyEditorWithInputAriaLabel": "{0}. Editor de texto somente leitura.", + "readonlyEditorAriaLabel": "Editor de texto somente leitura.", + "untitledFileEditorWithInputAriaLabel": "{0}. Editor de texto de arquivo sem nome.", + "untitledFileEditorAriaLabel": "Editor de texto de arquivo sem nome." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/browser/parts/editor/titleControl.i18n.json b/i18n/ptb/src/vs/workbench/browser/parts/editor/titleControl.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..aafa87dc9bf2f2941d23620c8a8e08c4e2314c76 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/browser/parts/editor/titleControl.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "close": "Fechar", + "closeOthers": "Fechar Outros", + "closeRight": "Fechar à direita", + "closeAll": "Fechar todos", + "closeAllUnmodified": "Fechar Não Modificados", + "keepOpen": "Manter aberto", + "showOpenedEditors": "Mostrar editores abertos", + "araLabelEditorActions": "Ações de editor" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/browser/parts/panel/panelActions.i18n.json b/i18n/ptb/src/vs/workbench/browser/parts/panel/panelActions.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..1f98f38c47e8eeab9926a3758e38ad6bf0de9709 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/browser/parts/panel/panelActions.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "panelActionTooltip": "{0} ({1})", + "closePanel": "Fechar Painel", + "togglePanel": "Alternar Painel", + "focusPanel": "Foco no Painel", + "toggleMaximizedPanel": "Alternar Painel Maximizado", + "maximizePanel": "Maximizar Tamanho do Painel", + "minimizePanel": "Restaurar tamanho do Painel", + "view": "Exibir" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/browser/parts/panel/panelPart.i18n.json b/i18n/ptb/src/vs/workbench/browser/parts/panel/panelPart.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..48a7b1b2f768e5ae6ac01d02c30453fe1bcdc8a5 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/browser/parts/panel/panelPart.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "panelSwitcherBarAriaLabel": "Chave do Painel Ativo" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/browser/parts/quickopen/quickOpenController.i18n.json b/i18n/ptb/src/vs/workbench/browser/parts/quickopen/quickOpenController.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..c98dd22d95d3705d218f247b64d1c46894983199 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/browser/parts/quickopen/quickOpenController.i18n.json @@ -0,0 +1,17 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "inputModeEntryDescription": "{0} (Pressione 'Enter' para confirmar ou 'Esc' para cancelar)", + "inputModeEntry": "Pressione 'Enter' para confirmar o texto digitado ou 'Esc' para cancelar", + "emptyPicks": "Não há entradas a serem escolhidas", + "quickOpenInput": "Digite '?' para obter ajuda sobre as ações que você pode realizar a partir daqui", + "historyMatches": "aberto recentemente", + "noResultsFound1": "Nenhum resultado encontrado", + "canNotRunPlaceholder": "Esse manipulador de abertura rápida não pode ser usado no contexto atual", + "entryAriaLabel": "{0}, recentemente aberto", + "removeFromEditorHistory": "Remover do Histórico", + "pickHistory": "Selecionar uma entrada do editor para remover do histórico" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/browser/parts/quickopen/quickopen.contribution.i18n.json b/i18n/ptb/src/vs/workbench/browser/parts/quickopen/quickopen.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..57f5524e1be3ad379706e7f5a42eec449f1a3f0f --- /dev/null +++ b/i18n/ptb/src/vs/workbench/browser/parts/quickopen/quickopen.contribution.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "quickOpen": "Ir para o Arquivo...", + "quickNavigateNext": "Navegar ao próximo em modo de abertura rápida", + "quickNavigatePrevious": "Navegar ao anterior em modo de abertura rápida", + "quickSelectNext": "Selecionar próximo em modo de abertura rápida", + "quickSelectPrevious": "Selecionar anterior em modo de abertura rápida" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/browser/parts/quickopen/quickopen.i18n.json b/i18n/ptb/src/vs/workbench/browser/parts/quickopen/quickopen.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..57f5524e1be3ad379706e7f5a42eec449f1a3f0f --- /dev/null +++ b/i18n/ptb/src/vs/workbench/browser/parts/quickopen/quickopen.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "quickOpen": "Ir para o Arquivo...", + "quickNavigateNext": "Navegar ao próximo em modo de abertura rápida", + "quickNavigatePrevious": "Navegar ao anterior em modo de abertura rápida", + "quickSelectNext": "Selecionar próximo em modo de abertura rápida", + "quickSelectPrevious": "Selecionar anterior em modo de abertura rápida" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/browser/parts/sidebar/sidebarPart.i18n.json b/i18n/ptb/src/vs/workbench/browser/parts/sidebar/sidebarPart.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..89806e051ea345e117f29b219b373fff1a3b9c58 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/browser/parts/sidebar/sidebarPart.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "focusSideBar": "Foco na Barra Lateral", + "viewCategory": "Exibir" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/browser/parts/statusbar/statusbarPart.i18n.json b/i18n/ptb/src/vs/workbench/browser/parts/statusbar/statusbarPart.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..4a2adabf5a69dbe77e2043d4bc07f335a2d879ad --- /dev/null +++ b/i18n/ptb/src/vs/workbench/browser/parts/statusbar/statusbarPart.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "canNotRun": "O comando '{0}' não está habilitado e não pode ser executado.", + "manageExtension": "Gerenciar Extensão" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/browser/parts/titlebar/titlebarPart.i18n.json b/i18n/ptb/src/vs/workbench/browser/parts/titlebar/titlebarPart.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..1c3db4d572b5064d3259de8d01bbaf6430ac25e8 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/browser/parts/titlebar/titlebarPart.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "patchedWindowTitle": "[Sem Suporte]", + "devExtensionWindowTitlePrefix": "[Host de Desenvolvimento de Extensão]" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/browser/quickopen.i18n.json b/i18n/ptb/src/vs/workbench/browser/quickopen.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..098ead453d829079363fc447e06fffebc3cdae43 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/browser/quickopen.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "noResultsMatching": "Nenhum resultado encontrado", + "noResultsFound2": "Nenhum resultado encontrado", + "entryAriaLabel": "{0}, comando" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/browser/viewlet.i18n.json b/i18n/ptb/src/vs/workbench/browser/viewlet.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..4b960693e35673313a96fe2a1b31971df78896ce --- /dev/null +++ b/i18n/ptb/src/vs/workbench/browser/viewlet.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "collapse": "Recolher tudo" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/common/theme.i18n.json b/i18n/ptb/src/vs/workbench/common/theme.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..86cc4957066b48420aa936e2da4edbcfae8ca999 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/common/theme.i18n.json @@ -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. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "tabActiveBackground": "Cor de fundo da guia ativa. As guias são os recipientes para editores na área do editor. Várias guias podem ser abertas em um grupo de editores. Podem haver vários grupos de editor.", + "tabInactiveBackground": "Cor de fundo da guia inativa. As guias são os recipientes para editores na área do editor. Várias guias podem ser abertas em um grupo de editores. Podem haver vários grupos de editor.", + "tabBorder": "Borda para separar uma guia das outras. As guias são os recipientes para editores na área do editor. Várias guias podem ser abertas em um grupo de editores. Podem haver vários grupos de editor.", + "tabActiveForeground": "Cor de primeiro plano da guia ativa em um grupo ativo. As guias são os recipientes para editores na área do editor. Várias guias podem ser abertas em um grupo de editores. Podem haver vários grupos de editor.", + "tabInactiveForeground": "Cor de primeiro plano da guia inativa em um grupo ativo. As guias são os recipientes para editores na área do editor. Várias guias podem ser abertas em um grupo de editores. Podem haver vários grupos de editor.", + "tabUnfocusedActiveForeground": "Cor de primeiro plano da aba ativa em um grupo inativo. As abas são recipientes para editores na área do editor. Várias abas podem ser abertas em um grupo de editor. Pode haver vários grupos de editor.", + "tabUnfocusedInactiveForeground": "Cor de primeiro plano da aba inativa em um grupo inativo. As abas são recipientes para editores na área do editor. Várias abas podem ser abertas em um grupo de editor. Pode haver vários grupos de editor.", + "editorGroupBackground": "Cor de fundo de um grupo de editor. Grupos de editor são os recipientes dos editores. A cor de fundo é mostrada ao arrastar o editor de grupos ao redor.", + "tabsContainerBackground": "Cor de fundo do cabeçalho do título do grupo de editor quando as guias são habilitadas. Grupos de editor são os recipientes dos editores.", + "tabsContainerBorder": "Cor da borda do cabeçalho do título do grupo de editor quando as guias estão habilitadas. Grupos de editor são os recipientes dos editores.", + "editorGroupHeaderBackground": "Cor de fundo do título do cabeçalho do grupo de editor quando as guias são desabilitadas. Grupos de editor são os recipientes dos editores.", + "editorGroupBorder": "Cor para separar múltiplos grupos de editor de outro. Grupos de editor são os recipientes dos editores.", + "editorDragAndDropBackground": "Cor de fundo ao arrastar editores. A cor deve ter transparência para que o conteúdo do editor ainda possa ser visto.", + "panelBackground": "Cor de fundo do painel. Os painéis são mostrados abaixo da área do editor e contém visualizações como saída e terminal integrado.", + "panelBorder": "Cor da borda do painel no topo separando do editor. Os painéis são mostrados abaixo da área do editor e contém visualizações como saída e terminal integrado.", + "panelActiveTitleForeground": "Cor do título para o painel ativo. Os painéis são mostrados abaixo da área do editor e contém visualizações como saída e terminal integrado.", + "panelInactiveTitleForeground": "Cor do título para o painel inativo. Os painéis são mostrados abaixo da área do editor e contém visualizações como saída e terminal integrado.", + "panelActiveTitleBorder": "Cor da borda para o título do painel ativo. Os painéis são mostrados abaixo da área do editor e contém visualizações como saída e terminal integrado.", + "statusBarForeground": "Cor do primeiro plano da barra de status. A barra de status é mostrada na parte inferior da janela.", + "statusBarBackground": "Cor de fundo da barra de status padrão. A barra de status é mostrada na parte inferior da janela.", + "statusBarBorder": "Cor da borda da barra de status que separa a barra lateral e o editor.A barra de status é mostrada na parte inferior da janela.", + "statusBarNoFolderBackground": "Cor de fundo da barra de status quando nenhuma pasta está aberta. A barra de status é mostrada na parte inferior da janela.", + "statusBarNoFolderForeground": "Cor do primeiro plano da barra de status quando nenhuma pasta está aberta. A barra de status é mostrada na parte inferior da janela.", + "statusBarItemActiveBackground": "Cor de fundo do item da barra de status quando você clicado. A barra de status é mostrada na parte inferior da janela.", + "statusBarItemHoverBackground": "Cor de fundo do item da barra de status quando estiver passando sobre ele. A barra de status é mostrada na parte inferior da janela.", + "statusBarProminentItemBackground": "Cor de fundo de itens proeminentes da barra de status. Itens proeminentes destacam-se outras entradas da barra de status para indicar a importância. A barra de status é mostrada na parte inferior da janela.", + "statusBarProminentItemHoverBackground": "Cor de fundo dos itens proeminentes de barra de status quando estiver passando sobre eles. Itens proeminentes destacam-se outras entradas de barra de status para indicar a importância. A barra de status é mostrada na parte inferior da janela.", + "activityBarBackground": "Cor de fundo da barra de atividades. Barra de atividade está visível à esquerda ou à direita e permite alternar entre as visualizações da barra lateral.", + "activityBarForeground": "Cor de primeiro plano da barra de atividades (por exemplo, usada para os ícones). A barra de atividades está visível à esquerda ou à direita e permite alternar entre as visualizações da barra lateral.", + "activityBarBorder": "Cor da borda da barra de atividades separando a barra lateral. A barra de atividade é mostrada à esquerda ou à direita e permite alternar entre as visualizações da barra lateral.", + "activityBarDragAndDropBackground": "Cor de feedback de arrastar e soltar para os itens da barra de atividades. A cor deve ter transparência para que as entradas de bar de atividade ainda possam brilhar. A barra de atividade está visível à esquerda ou à direita e permite para alternar entre as visualizações da barra lateral.", + "activityBarBadgeBackground": "Cor de fundo da notificação de atividade. A barra de atividade está visível à esquerda ou à direita e permite alternar entre as visualizações da barra lateral.", + "activityBarBadgeForeground": "Cor de primeiro plano da notificação de atividade. A barra de atividade está visível à esquerda ou à direita e permite alternar entre as visualizações da barra lateral.", + "sideBarBackground": "Cor de fundo da barra lateral. A barra lateral é o recipiente para visualizações como explorador e pesquisa.", + "sideBarForeground": "Cor de primeiro plano da barra lateral. A barra lateral é o recipiente para visualizações como o explorador e a busca.", + "sideBarBorder": "Cor da borda da barra lateral separando o editor. A barra lateral é o recipiente para visualizações como explorador e pesquisa.", + "sideBarTitleForeground": "Cor de primeiro plano do título da barra lateral. A barra lateral é o recipiente para visualizações como explorador e pesquisa.", + "sideBarSectionHeaderBackground": "Cor de fundo do cabeçalho de seção lateral. A barra lateral é o recipiente para visões como explorador e pesquisa.", + "sideBarSectionHeaderForeground": "Cor de primeiro plano do cabeçalho de seção da barra lateral. A barra lateral é o recipiente para visualizações como o explorador e pesquisa.", + "titleBarActiveForeground": "Cor da barra de título do primeiro plano quando a janela está ativa. Observe que essa cor atualmente somente é suportada no macOS.", + "titleBarInactiveForeground": "Cor de primeiro plano da barra de título quando a janela está inativa. Observe que essa cor atualmente somente é suportada no macOS.", + "titleBarActiveBackground": "Cor de fundo da barra de título quando a janela está ativa. Observe que essa cor atualmente somente é suportada no macOS.", + "titleBarInactiveBackground": "Cor de fundo de barra de título quando a janela está inativa. Observe que essa cor é atualmente somente suportada no macOS.", + "notificationsForeground": "Cor do primeiro plano de notificações. Notificações deslizam na parte superior da janela.", + "notificationsBackground": "Cor de fundo de notificações. Notificações deslizam na parte superior da janela.", + "notificationsButtonBackground": "Cor de fundo do botão de notificações. Notificações deslizam da parte superior da janela.", + "notificationsButtonHoverBackground": "Cor de fundo do botão de notificações quando passar sobre ele. Notificações deslizam da parte superior da janela. ", + "notificationsButtonForeground": "Cor de primeiro plano do botão de notificações. Notificações deslizam da parte superior da janela. ", + "notificationsInfoBackground": "Cor de fundo da notificação de informações. Notificações deslizam da parte superior da janela. ", + "notificationsInfoForeground": "Cor de primeiro plano das notificações de informação. Notificações deslizam da parte superior da janela. ", + "notificationsWarningBackground": "Cor de fundo das notificações de aviso. Notificações deslizam da parte superior da janela. ", + "notificationsWarningForeground": "Cor de primeiro plano das notificações de aviso. Notificações deslizam da parte superior da janela.", + "notificationsErrorBackground": "Cor de fundo das notificações de erro. Notificações deslizam da parte superior da janela. ", + "notificationsErrorForeground": "Cor de primeiro plano das notificações de erro. Notificações deslizam da parte superior da janela." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/electron-browser/actions.i18n.json b/i18n/ptb/src/vs/workbench/electron-browser/actions.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..d1ec3a23336c3f8b256a4074870344b6c947ff31 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/electron-browser/actions.i18n.json @@ -0,0 +1,43 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "closeActiveEditor": "Fechar Editor", + "closeWindow": "Fechar Janela", + "closeFolder": "Fechar Pasta", + "noFolderOpened": "Não há nenhuma pasta aberta nesta instância para ser fechada.", + "newWindow": "Nova Janela", + "toggleFullScreen": "Alternar Tela Inteira", + "toggleMenuBar": "Alternar Barra de Menus", + "toggleDevTools": "Alternar Ferramentas do Desenvolvedor", + "zoomIn": "Ampliar", + "zoomOut": "Reduzir", + "zoomReset": "Reinicializar Zoom", + "appPerf": "Desempenho de inicialização", + "reloadWindow": "Recarregar Janela", + "switchWindowPlaceHolder": "Selecionar uma janela para onde alternar", + "current": "Janela Atual", + "switchWindow": "Alternar a janela...", + "quickSwitchWindow": "Troca Rápida de Janela...", + "folders": "pastas", + "files": "arquivos", + "openRecentPlaceHolderMac": "Selecionar um caminho (Pressione a tecla Cmd para abrir em uma nova janela)", + "openRecentPlaceHolder": "Selecionar um caminho para abrir (Pressione a tecla Cmd para abrir em uma nova janela)", + "openRecent": "Abrir Recente...", + "quickOpenRecent": "Abertura Rápida de Recente...", + "closeMessages": "Fechar mensagens de notificação", + "reportIssues": "Reportar Problemas", + "reportPerformanceIssue": "Reportar Problema de Desempenho", + "keybindingsReference": "Referência de Atalhos de Teclado", + "openDocumentationUrl": "Documentação", + "openIntroductoryVideosUrl": "Vídeos Introdutórios", + "toggleSharedProcess": "Alternar processo compartilhado", + "navigateLeft": "Navegar para a Visualização à Esquerda", + "navigateRight": "Navegar para a Visualização à Direita", + "navigateUp": "Navegar para a Visualização Acima", + "navigateDown": "Navegar para a Visualização Abaixo", + "increaseViewSize": "Aumentar o Tamanho da Visualização Atual", + "decreaseViewSize": "Diminuir o Tamanho da Visualização Atual" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/electron-browser/commands.i18n.json b/i18n/ptb/src/vs/workbench/electron-browser/commands.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..3a1051dcfdad7ec7db70524f0a31f277885230df --- /dev/null +++ b/i18n/ptb/src/vs/workbench/electron-browser/commands.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "diffLeftRightLabel": "{0} ⟷ {1}" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/electron-browser/crashReporter.i18n.json b/i18n/ptb/src/vs/workbench/electron-browser/crashReporter.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..10b7a7ff108487df22480862a6fe0a281265e4c3 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/electron-browser/crashReporter.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "telemetryConfigurationTitle": "Telemetria", + "telemetry.enableCrashReporting": "Ativar o envio de relatórios de incidentes à Microsoft.\nEsta opção requer reinicialização para ser efetivada." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/electron-browser/extensionHost.i18n.json b/i18n/ptb/src/vs/workbench/electron-browser/extensionHost.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..e5a7ab8168661ecd54ecda227f61014dd23b1527 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/electron-browser/extensionHost.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "extensionHostProcess.startupFailDebug": "O host de extensão não iniciou em 10 segundos, ele pode ser interrompido na primeira linha e precisa de um depurador para continuar.", + "extensionHostProcess.startupFail": "Host de extensão não começou em 10 segundos, isso pode ser um problema.", + "extensionHostProcess.error": "Erro do host de extensão: {0}", + "extensionHostProcess.crash": "Host de extensão foi encerrado inesperadamente. Por favor recarregar a janela para recuperar." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/electron-browser/main.contribution.i18n.json b/i18n/ptb/src/vs/workbench/electron-browser/main.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..710676ff7ae5af3db460c3b7db04ade9b1b4f258 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/electron-browser/main.contribution.i18n.json @@ -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. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "view": "Exibir", + "help": "Ajuda", + "file": "Arquivo", + "developer": "Desenvolvedor", + "showEditorTabs": "Controla se os editores abertos devem ou não serem exibidos em abas.", + "editorTabCloseButton": "Controla a posição dos botões de fechar das abas do editor ou os desabilita quando configurados para 'desligado'.", + "showIcons": "Controla se os editores abertos devem ou não ser exibidos com um ícone. Requer um tema de ícone para ser habilitado. ", + "enablePreview": "Controla se os editores abertos são exibidos como visualização. Editores de visualização são reutilizados até que eles sejam preservados (por exemplo, através de um duplo clique ou edição).", + "enablePreviewFromQuickOpen": "Controla se os editores abertos da Abertura Rápida são exibidos como visualização. Os editores de visualização são reutilizados até serem preservados (por exemplo, através de um duplo clique ou edição).", + "editorOpenPositioning": "Controla onde os editores serão abertos. Escolha 'esquerda' ou 'direita' para abrir os editores à esquerda ou à direita do \neditor ativo. Selecione 'primeiro' ou 'último' para abrir os editores independentemente do atual.", + "revealIfOpen": "Controla se um editor é exibido em qualquer um dos grupos, se aberto. Se desabilitado, um editor será aberto preferencialmente no grupo de editores ativo. Se habilitado, um editor já aberto será exibido no grupo de editores ativo, ao invés de ser aberto novamente. Note que há alguns casos onde esta configuração é ignorada, por exemplo, quando for forçada a abertura de um editor em um grupo específico ou ao lado do grupo atualmente ativo.", + "commandHistory": "Controla o número de comandos recentemente usados mantidos no histórico para a paleta de comandos. Definir como 0 para desativar o histórico de comandos.", + "preserveInput": "Controla se a última entrada digitada na paleta de comandos deve ser restaurada ao abri-la da próxima vez.", + "closeOnFocusLost": "Controla se Abertura Rápida deve fechar automaticamente caso perca o foco.", + "openDefaultSettings": "Controla se a abertura de configurações também abre um editor mostrando todas as configurações padrão.", + "sideBarLocation": "Controla a localização da barra lateral. Ele pode ser exibido à esquerda ou à direita da área de trabalho.", + "statusBarVisibility": "Controla a visibilidade da barra de status na parte inferior da área de trabalho.", + "activityBarVisibility": "Controla a visibilidade da barra de atividades na área de trabalho.", + "closeOnFileDelete": "Controla se os editores que mostram um arquivo devem fechar automaticamente quanto o arquivo é apagado ou renomeado por algum outro processo. Desativar isso manterá o editor aberto como sujo neste evento. Note que apagar do aplicativo sempre fechará o editor e os arquivos sujos nunca fecharão para preservar seus dados.", + "swipeToNavigate": "Navegue entre arquivos abertos usando o deslizamento horizontal de três dedos.", + "workbenchConfigurationTitle": "Área de Trabalho", + "window.openFilesInNewWindow.on": "Arquivos serão abertos em uma nova janela", + "window.openFilesInNewWindow.off": "Arquivos serão abertos em uma nova janela com a pasta de arquivos aberta ou com a última janela ativa.", + "window.openFilesInNewWindow.default": "Os arquivos serão abertos na janela com a pasta de arquivos aberta ou a última janela ativa, a menos que seja aberto através do dock ou do finder (somente macOS)", + "openFilesInNewWindow": "Controla se os arquivos devem ser abertos em uma nova janela\n- padrão: os arquivos serão abertos em uma nova janela com a pasta de arquivos aberta ou na última janela ativa, a menos que seja aberta através do dock ou do finder (apenas macOS)\n- ligado: os arquivos serão abertos em uma nova janela\n- desligado: os arquivos serão abertos em uma janela com a pasta de arquivos aberta ou a última janela ativa\nNota que ainda podem haver casos em que esta configuração será ignorada (por exemplo, quando estiver usando as opções de linha de comando -new-window ou -reuse-window).", + "window.openFoldersInNewWindow.on": "As pastas serão abertas em uma nova janela", + "window.openFoldersInNewWindow.off": "As pastas substituirão a última janela ativa", + "window.openFoldersInNewWindow.default": "As pastas serão abertas em uma nova janela, a menos que uma pasta seja selecionada dentro do aplicativo (por exemplo, através do menu Arquivo)", + "openFoldersInNewWindow": "Controla se as pastas devem ser abertas em uma nova janela ou substituir a última janela ativa\n- padrão: as pastas serão abertas em uma nova janela, a menos que seja selecionada dentro do aplicativo (por exemplo, através do menu Arquivo)\n- ligado: as pastas serão abertas em uma nova janela\n- desligado: as pastas substituirão a última janela ativa\nNote que ainda podem haver casos em que esta configuração será ignorada (por exemplo, quando estiver usando as opções de linha de comando -new-window ou -reuse-window).", + "window.reopenFolders.all": "Reabrir todas as janelas.", + "window.reopenFolders.folders": "Reabrir todas as pastas. Janelas vazias não serão restauradas.", + "window.reopenFolders.one": "Reabrir a última janela ativa.", + "window.reopenFolders.none": "Nunca reabrir uma janela. Sempre começar com uma janela vazia.", + "restoreFullscreen": "Controla se uma janela deve ser restaurada em modo de tela cheia se ela foi finalizada em modo de tela cheia.", + "zoomLevel": "Ajusta o nível de zoom da janela. O tamanho original é 0 e cada aumento (por exemplo, 1) ou redução (por exemplo, -1) representa um zoom 20% maior ou menor. Você também pode digitar decimais para ajustar o nível de zoom com uma granularidade mais fina.", + "title": "Controla o título da janela com base no editor ativo. As variáveis são substituídas com base no contexto:\n$ {ActiveEditorShort}: por exemplo, meuArquivo.txt\n$ {ActiveEditorMedium}: por exemplo, minhaPasta / meuArquivo.txt\n$ {ActiveEditorLong}: por exemplo, /Usuários/Desenvolvimento/meuProjeto/minhaPasta/meuArquivo.txt\n$ {RootName}: por exemplo, meuProjeto\n$ {RootPath}: por exemplo, /Usuários/Desenvolvimento/meuProjeto\n$ {AppName}: por exemplo, VS Code\n$ {Dirty}: um indicador sujo se o editor ativo for sujo\n$ {Separator}: um separador condicional (\"-\") que só aparece quando for rodeado por variáveis com valores", + "window.newWindowDimensions.default": "Abrir novas janelas no centro da tela.", + "window.newWindowDimensions.inherit": "Abrir novas janelas com a mesma dimensão da última janela ativa.", + "window.newWindowDimensions.maximized": "Abrir novas janelas maximizadas.", + "window.newWindowDimensions.fullscreen": "Abrir novas janelas em modo de tela cheia.", + "newWindowDimensions": "Controla as dimensões ao abrir uma nova janela quando pelo menos uma janela já está aberta. Por padrão, uma nova janela será aberta no centro da tela com pequena dimensão. Quando definido como 'inherit', a janela vai ter as mesmas dimensões que a última janela que estava ativa. Quando definido como 'maximized', a janela abrirá maximizada e em tela cheia se configurado para 'fullscreen'. Observe que essa configuração não tem um impacto sobre a primeira janela que é aberta. A primeira janela sempre irá restaurar o tamanho e a localização como você deixou antes de fechar.", + "window.menuBarVisibility.default": "O menu está oculto apenas em modo de tela cheia.", + "window.menuBarVisibility.visible": "O menu está sempre visivel mesmo quando em modo de tela cheia.", + "window.menuBarVisibility.toggle": "O menu está oculto, mas pode ser mostrado através da tecla Alt.", + "window.menuBarVisibility.hidden": "O menu está sempre oculto.", + "menuBarVisibility": "Controla a visibilidade da barra de menu. Uma configuração 'alternar' significa que a barra de menus está oculta e pressionar a tecla Alt irá mostrá-la. Por padrão, a barra de menu será visível, a menos que a janela esteja em modo de tela cheia.", + "enableMenuBarMnemonics": "Se habilitado, os menus principais podem ser abertos através de atalhos de tecla Alt. Desativar mnemônicos permite vincular esses atalhos de tecla Alt para comandos do editor.", + "autoDetectHighContrast": "Se habilitado, irá mudar automaticamente para o tema de alto contraste se o Windows estiver utilizando um tema de alto contraste, e para o tema escuro ao mudar de um tema de alto contraste do Windows.", + "titleBarStyle": "Ajusta a aparência da barra de título da janela. As alterações exigem um reinício completo.", + "window.nativeTabs": "Habilita as abas da janela do macOS Sierra. Note que as alterações exigem um reinício completo e que as abas nativas desabilitarão um estilo de barra de título customizado, se configurado.", + "windowConfigurationTitle": "Janela", + "zenModeConfigurationTitle": "Modo Zen", + "zenMode.fullScreen": "Controla se a ativação do modo Zen também coloca o espaço de trabalho em modo de tela cheia.", + "zenMode.hideTabs": "Controla se a ativação do modo Zen também oculta as abas do espaço de trabalho.", + "zenMode.hideStatusBar": "Controla se a ativação do modo Zen também oculta a barra de status no rodapé do espaço de trabalho.", + "zenMode.hideActivityBar": "Controla se a ativação do modo Zen também oculta a barra de atividades à esquerda do espaço de trabalho.", + "zenMode.restore": "Controla se uma janela deve ser restaurada para o modo zen se ela foi finalizada no modo zen.", + "workspaceConfigurationTitle": "Espaço de trabalho", + "workspaces.title": "Configuração de pasta da área de trabalho", + "files.exclude.boolean": "O padrão glob com o qual combinar os caminhos de arquivo. Defina para verdadeiro ou falso para habilitar ou desabilitar o padrão." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/electron-browser/main.i18n.json b/i18n/ptb/src/vs/workbench/electron-browser/main.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..056d426d27d53f2059b11c4e9501424029533cc1 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/electron-browser/main.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "loaderError": "Falha ao carregar o arquivo necessário. Você não está mais conectado à Internet ou o servidor que você está conectado está offline. Atualize o navegador e tente novamente.", + "loaderErrorNative": "Falha ao carregar um arquivo necessário. Reinicie o aplicativo para tentar novamente. Detalhes: {0}" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/electron-browser/shell.i18n.json b/i18n/ptb/src/vs/workbench/electron-browser/shell.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..951a140a2ea016d63f010cf67155ea1f580821bc --- /dev/null +++ b/i18n/ptb/src/vs/workbench/electron-browser/shell.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "runningAsRoot": "Não é recomendado executar Code como 'root'." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/electron-browser/window.i18n.json b/i18n/ptb/src/vs/workbench/electron-browser/window.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..50118b77afeb407cd5db186bba1606318d43d536 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/electron-browser/window.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "undo": "Desfazer", + "redo": "Refazer", + "cut": "Recortar", + "copy": "Copiar", + "paste": "Colar", + "selectAll": "Selecionar Tudo", + "confirmOpen": "Tem certeza de que deseja abrir '{0}' pastas?", + "confirmOpenButton": "&&Abrir" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/electron-browser/workbench.i18n.json b/i18n/ptb/src/vs/workbench/electron-browser/workbench.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..46bdaa6720de933a1e362e69799ec169e8fe12c6 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/electron-browser/workbench.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "developer": "Desenvolvedor", + "file": "Arquivo" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/node/extensionHostMain.i18n.json b/i18n/ptb/src/vs/workbench/node/extensionHostMain.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..f0596b258711cb2a75ee439c884af10227aa4461 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/node/extensionHostMain.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "extensionTestError": "Caminho {0} não aponta para um executor de testes com extensão válida." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/node/extensionPoints.i18n.json b/i18n/ptb/src/vs/workbench/node/extensionPoints.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..18d7b3f26c89224006e2aff67b13f89a11715b3a --- /dev/null +++ b/i18n/ptb/src/vs/workbench/node/extensionPoints.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "jsonParseFail": "Falha ao analisar {0}: {1}.", + "fileReadFail": "Não foi possível ler o arquivo {0}: {1}.", + "jsonsParseFail": "Falha ao analisar {0} ou {1}: {2}.", + "missingNLSKey": "Não foi possível encontrar a mensagem para a chave {0}." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/cli/electron-browser/cli.contribution.i18n.json b/i18n/ptb/src/vs/workbench/parts/cli/electron-browser/cli.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..69df9b15d8773412c3f156cb4d1a0289b014593e --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/cli/electron-browser/cli.contribution.i18n.json @@ -0,0 +1,18 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "install": "Instalar o comando '{0}' em PATH", + "not available": "Este comando não está disponível", + "successIn": "Comando shell '{0}' instalado com sucesso em PATH.", + "warnEscalation": "O código solicitará com 'osascript' pelos privilégios de Administrador para instalar o comando shell.", + "ok": "OK", + "cantCreateBinFolder": "Não é possível criar '/usr/local/bin'.", + "cancel2": "Cancelar", + "aborted": "Abortado", + "uninstall": "Desinstalar o comando '{0}' de PATH", + "successFrom": "Comando shell '{0}' desinstalado com sucesso de PATH.", + "shellCommand": "Comando shell" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/codeEditor/electron-browser/accessibility.i18n.json b/i18n/ptb/src/vs/workbench/parts/codeEditor/electron-browser/accessibility.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..21239364c7cfc72accaf52c942217216150fae80 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/codeEditor/electron-browser/accessibility.i18n.json @@ -0,0 +1,26 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "emergencyConfOn": "Modificando a configuração 'editor.accessibilitySupport' para 'on'.", + "openingDocs": "Abrindo a página de documentação de Acessibilidade do VS Code.", + "introMsg": "Obrigado por testar a opção de acessibilidade do VS Code.", + "status": "Status", + "changeConfigToOnMac": "Para configurar o editor para ser permanentemente otimizado para uso com um leitor de tela pressione Command+E agora.", + "changeConfigToOnWinLinux": "Para configurar o editor para ser permanentemente otimizado para uso com um leitor de tela pressione Control+E agora.", + "auto_unknown": "O editor está configurado para usar as APIs de plataforma para detectar quando está conectado a um leitor de tela, mas o tempo de execução atual não oferece suporte a isso.", + "auto_on": "O editor detectou automaticamente que foi anexado um leitor de tela.", + "auto_off": "O editor está configurado para detectar automaticamente quando um leitor de tela é anexado, o que não é o caso neste momento.", + "configuredOn": "O editor está configurado para ser permanentemente otimizado para uso com um leitor de tela - você pode mudar isso editando a configuração 'editor.accessibilitySupport'.", + "configuredOff": "O editor está configurado para nunca ser otimizado para uso com um Leitor de Tela.", + "tabFocusModeOnMsg": "Pressionando Tab no editor corrente irá mover o foco para o próximo elemento focável. Mude este comportamento ao pressionar {0}.", + "tabFocusModeOnMsgNoKb": "Pressionando Tab no editor corrente irá mover o foco para o próximo elemento focável. O comando {0} não pode ser ativado atualmente por uma tecla.", + "tabFocusModeOffMsg": "Pressionando Tab no editor atual irá inserir um caractere Tab. Mude este comportamente ao pressionar {0}.", + "tabFocusModeOffMsgNoKb": "Pressionando Tab no editor atual irá inserir um caractere Tab. O comando {0} não pode ser ativado atualmente por uma tecla.", + "openDocMac": "Pressione Command+H agora para abrir uma janela do navegador com mais informação do VS Code relacionada à Acessibilidade.", + "openDocWinLinux": "Pressione Ctrl+H para abrir uma janela do navegador com mais informação do VS Code relacionada à acessibilidade.", + "outroMsg": "Você pode ignorar esta dica de ferramenta e retornar ao editor pressionando Escape ou Shift+Escape.", + "ShowAccessibilityHelpAction": "Mostrar ajuda de acessibilidade" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/codeEditor/electron-browser/inspectKeybindings.i18n.json b/i18n/ptb/src/vs/workbench/parts/codeEditor/electron-browser/inspectKeybindings.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..18ee740ae318ef3aecaa49aed3467d07511eb822 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/codeEditor/electron-browser/inspectKeybindings.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "workbench.action.inspectKeyMap": "Desenvolvedor: Inspecionar Mapeamentos de Chave" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/codeEditor/electron-browser/inspectTMScopes.i18n.json b/i18n/ptb/src/vs/workbench/parts/codeEditor/electron-browser/inspectTMScopes.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/codeEditor/electron-browser/inspectTMScopes.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/codeEditor/electron-browser/toggleMultiCursorModifier.i18n.json b/i18n/ptb/src/vs/workbench/parts/codeEditor/electron-browser/toggleMultiCursorModifier.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..955efefcac9d34cf9757e998323514d594d68e07 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/codeEditor/electron-browser/toggleMultiCursorModifier.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "toggleLocation": "Alternar Modificador de Multi-Cursor" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/codeEditor/electron-browser/toggleRenderControlCharacter.i18n.json b/i18n/ptb/src/vs/workbench/parts/codeEditor/electron-browser/toggleRenderControlCharacter.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..217bdf1c04ed596e34d8b147ac31780d067a4014 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/codeEditor/electron-browser/toggleRenderControlCharacter.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "toggleRenderControlCharacters": "Alternar caracteres de controle" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/codeEditor/electron-browser/toggleRenderWhitespace.i18n.json b/i18n/ptb/src/vs/workbench/parts/codeEditor/electron-browser/toggleRenderWhitespace.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..453104fcc6d6055a9dc3a1cc3c09728931160aea --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/codeEditor/electron-browser/toggleRenderWhitespace.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "toggleRenderWhitespace": "Alternar Espaço em Branco Renderizado" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/codeEditor/electron-browser/toggleWordWrap.i18n.json b/i18n/ptb/src/vs/workbench/parts/codeEditor/electron-browser/toggleWordWrap.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..058048058af449bdaf54b12aeb04ee77307282d6 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/codeEditor/electron-browser/toggleWordWrap.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "toggle.wordwrap": "Visualizar: Alternar Quebra de Linha", + "wordWrap.notInDiffEditor": "Não pode alternar quebra de linha em um editor diff.", + "unwrapMinified": "Desabilitar empacotamento para este arquivo", + "wrapMinified": "Habilitar empacotamento para este arquivo" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/codeEditor/electron-browser/wordWrapMigration.i18n.json b/i18n/ptb/src/vs/workbench/parts/codeEditor/electron-browser/wordWrapMigration.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..12f93be687c5daa74d1677c0459676dab65caa58 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/codeEditor/electron-browser/wordWrapMigration.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "wordWrapMigration.ok": "OK", + "wordWrapMigration.dontShowAgain": "Não mostrar novamente", + "wordWrapMigration.openSettings": "Abrir configurações", + "wordWrapMigration.prompt": "A configuração `editor.wrappingColumn` foi descontinuada e substituída pela configuração `editor.wordWrap`" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/debug/browser/breakpointWidget.i18n.json b/i18n/ptb/src/vs/workbench/parts/debug/browser/breakpointWidget.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..3d74879563371e801cb24afa84c4b64a196ac62a --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/debug/browser/breakpointWidget.i18n.json @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "breakpointWidgetExpressionPlaceholder": "Parar quando a expressão for avaliada como true. 'Enter' para aceitar, 'esc' para cancelar.", + "breakpointWidgetAriaLabel": "O programa só vai parar aqui se esta condição for verdadeira. Pressione Enter para aceitar ou Escape para cancelar.", + "breakpointWidgetHitCountPlaceholder": "Parar quando contagem de ocorrências condição for alcançada. 'Enter' para aceitar, 'esc' para cancelar.", + "breakpointWidgetHitCountAriaLabel": "O programa só vai parar aqui, se a contagem de ocorrências for alcançada. Pressione Enter para aceitar ou Escape para cancelar.", + "expression": "Expressão", + "hitCount": "Contagem de ocorrências" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/debug/browser/debugActionItems.i18n.json b/i18n/ptb/src/vs/workbench/parts/debug/browser/debugActionItems.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..32a88b85efd619cd4caaa1fa06236aedd8be4a1a --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/debug/browser/debugActionItems.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "addConfiguration": "Adicionar Configuração...", + "noConfigurations": "Sem configurações" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/debug/browser/debugActions.i18n.json b/i18n/ptb/src/vs/workbench/parts/debug/browser/debugActions.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..1bc052297a12ecd669efc54284833ca929858dcc --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/debug/browser/debugActions.i18n.json @@ -0,0 +1,49 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "openLaunchJson": "Abrir {0}", + "launchJsonNeedsConfigurtion": "Configurar ou corrigir 'launch.json'", + "noFolderDebugConfig": "Primeiro abra uma pasta para fazer uma configuração de depuração avançada.", + "startDebug": "Iniciar Depuração", + "startWithoutDebugging": "Iniciar Sem Depuração", + "selectAndStartDebugging": "Selecionar e Iniciar a Depuração", + "restartDebug": "Reiniciar", + "reconnectDebug": "Reconectar", + "stepOverDebug": "Pular Sobre", + "stepIntoDebug": "Pular Dentro", + "stepOutDebug": "Pular Fora", + "stopDebug": "Parar", + "disconnectDebug": "Desconectar", + "continueDebug": "Continuar", + "pauseDebug": "Pausa", + "restartFrame": "Reiniciar o Frame", + "removeBreakpoint": "Remover Ponto de Parada", + "removeAllBreakpoints": "Remover Todos os Pontos de Parada", + "enableBreakpoint": "Habilitar ponto de Parada", + "disableBreakpoint": "Desativar Ponto de Parada", + "enableAllBreakpoints": "Habilitar Todos os Pontos de Parada", + "disableAllBreakpoints": "Desabilitar Todos Pontos de Parada", + "activateBreakpoints": "Ativar Pontos de Parada", + "deactivateBreakpoints": "Desativar Pontos de Parada", + "reapplyAllBreakpoints": "Reaplicar Todos os Pontos de Parada", + "addFunctionBreakpoint": "Adicionar Ponto de Parada de Função", + "renameFunctionBreakpoint": "Renomeie o Ponto de Parada de Função", + "addConditionalBreakpoint": "Adicionar Ponto de Parada Condicional...", + "editConditionalBreakpoint": "Editar o Ponto de Parada...", + "setValue": "Definir Valor", + "addWatchExpression": "Adicionar Expressão", + "editWatchExpression": "Editar expressão", + "addToWatchExpressions": "Adicionar ao monitoramento", + "removeWatchExpression": "Remover Expressão", + "removeAllWatchExpressions": "Remover Todas as Expressões", + "clearRepl": "Limpar console", + "debugConsoleAction": "Console do Depurador", + "unreadOutput": "Nova Saída no Console de Depuração", + "debugFocusConsole": "Foco no Console de Depuração", + "focusProcess": "Foco no Processo", + "stepBackDebug": "Passo para trás", + "reverseContinue": "Reverter" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/debug/browser/debugActionsWidget.i18n.json b/i18n/ptb/src/vs/workbench/parts/debug/browser/debugActionsWidget.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..421e5b19c79c48f393096b4c2b57c679964447d3 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/debug/browser/debugActionsWidget.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "debugToolBarBackground": "Cor de fundo da barra de ferramentas de depuração." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/debug/browser/debugContentProvider.i18n.json b/i18n/ptb/src/vs/workbench/parts/debug/browser/debugContentProvider.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..d8aa95c869a674974646500f9c708af1a3164590 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/debug/browser/debugContentProvider.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "unable": "Não é possível resolver o recurso sem uma sessão de depuração" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/debug/browser/debugEditorActions.i18n.json b/i18n/ptb/src/vs/workbench/parts/debug/browser/debugEditorActions.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..ef74c88413dcbf0505eef2fee83791d45315f737 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/debug/browser/debugEditorActions.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "toggleBreakpointAction": "Depurar: Alternar Ponto de Parada", + "columnBreakpointAction": "Depurar: Ponto de Interrupção de Coluna", + "columnBreakpoint": "Adicionar Ponto de Interrupção de Coluna", + "conditionalBreakpointEditorAction": "Depurar: Adicionar Ponto de Interrupção Condicional...", + "runToCursor": "Executar até o Cursor", + "debugEvaluate": "Depurar: Avaliar", + "debugAddToWatch": "Depurar: Adicionar ao monitoramento", + "showDebugHover": "Mostrar Item Flutuante" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/debug/browser/debugEditorModelManager.i18n.json b/i18n/ptb/src/vs/workbench/parts/debug/browser/debugEditorModelManager.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..f30b378456b37321f7eb28e0c56e855e509d421a --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/debug/browser/debugEditorModelManager.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "breakpointDisabledHover": "Ponto de Parada Desativado", + "breakpointUnverifieddHover": "Ponto de Parada Não Verificado", + "breakpointDirtydHover": "Ponto de parada não verificado. O arquivo foi modificado, por favor reinicie a sessão de depuração.", + "breakpointUnsupported": "Pontos de parada condicionais não são suportados por esse tipo de depurador" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/debug/browser/debugQuickOpen.i18n.json b/i18n/ptb/src/vs/workbench/parts/debug/browser/debugQuickOpen.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..01955c44965b6776fdeb97130783ff84a9a9ad39 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/debug/browser/debugQuickOpen.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "entryAriaLabel": "depurar {0}", + "debugAriaLabel": "Digite um nome de uma configuração de lançamento para ser executado.", + "noConfigurationsMatching": "Não há configurações de depuração correspondentes", + "noConfigurationsFound": "Configurações de depuração não encontradas. Por favor, crie um arquivo 'launch.json'." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/debug/browser/exceptionWidget.i18n.json b/i18n/ptb/src/vs/workbench/parts/debug/browser/exceptionWidget.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..a8802c1316474a3b2148425d2c7f5794f26cafe1 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/debug/browser/exceptionWidget.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "debugExceptionWidgetBorder": "Cor da borda da ferramenta de exceção.", + "debugExceptionWidgetBackground": "Cor de fundo da ferramenta de exceção.", + "exceptionThrownWithId": "Ocorreu exceção: {0}", + "exceptionThrown": "Ocorreu exceção." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/debug/browser/linkDetector.i18n.json b/i18n/ptb/src/vs/workbench/parts/debug/browser/linkDetector.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..8c7a8761f41cc11dec0c8481e67bb7bfbb18d5fc --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/debug/browser/linkDetector.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "fileLinkMac": "Clique para seguir (Cmd + clique abre ao lado)", + "fileLink": "Clique para seguir (Cmd + clique abre ao lado)" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/debug/common/debug.i18n.json b/i18n/ptb/src/vs/workbench/parts/debug/common/debug.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..3476b79d9e1766e77c80fa706979eca79107a132 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/debug/common/debug.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "internalConsoleOptions": "Controla o comportamento do console depuração interna." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/debug/common/debugModel.i18n.json b/i18n/ptb/src/vs/workbench/parts/debug/common/debugModel.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..fa2f5e8ada5ce5d56f2a9c62b6339c4867b268d4 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/debug/common/debugModel.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "notAvailable": "não disponível", + "startDebugFirst": "Por favor, inicie uma sessão de depuração para avaliar" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/debug/common/debugSource.i18n.json b/i18n/ptb/src/vs/workbench/parts/debug/common/debugSource.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..0e10c85d8186e7910910f131d8155e58e2901b13 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/debug/common/debugSource.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "unknownSource": "Fonte desconhecida" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/debug.contribution.i18n.json b/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/debug.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..05a7ccfe82744dac5623d6f94af3eb2db5841787 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/debug.contribution.i18n.json @@ -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. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "toggleDebugViewlet": "Visualizar Depurador", + "toggleDebugPanel": "Console do Depurador", + "debug": "Depurar", + "debugPanel": "Console do Depurador", + "view": "Exibir", + "debugCategory": "Depurar", + "debugCommands": "Configuração do Depurador", + "debugConfigurationTitle": "Depurar", + "allowBreakpointsEverywhere": "Permite definir um ponto de interrupção em qualquer arquivo.", + "openExplorerOnEnd": "Automaticamente abre a visualização do explorador no final de uma sessão de depuração", + "inlineValues": "Mostrar valores de variáveis em linha no editor durante a depuração", + "hideActionBar": "Controlar se a barra de ação flutuante do depurador deve ser ocultada", + "launch": "Configuração global do lançamento do depurador. Deve ser usado como uma alternativa para o arquivo 'launch.json' que é compartilhado entre os espaços de trabalho" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/debugCommands.i18n.json b/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/debugCommands.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..85b353a37fe00d26e661b7dc8bd97fd7b2ac870f --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/debugCommands.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "noFolderDebugConfig": "Primeiro abra uma pasta para fazer uma configuração de depuração avançada." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/debugConfigurationManager.i18n.json b/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/debugConfigurationManager.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..ada60277e7bf6089baa6ee093266f5cd0fc06074 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/debugConfigurationManager.i18n.json @@ -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. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "vscode.extension.contributes.debuggers": "Contribui adaptadores de depuração.", + "vscode.extension.contributes.debuggers.type": "Identificador único para esse adaptador de depuração.", + "vscode.extension.contributes.debuggers.label": "Nome de exibição para esse adaptador de depuração.", + "vscode.extension.contributes.debuggers.program": "Caminho para o programa adaptador de depuração. O caminho pode ser absoluto ou relativo à pasta de extensão.", + "vscode.extension.contributes.debuggers.args": "Argumentos opcionais a serem informados para o adaptador.", + "vscode.extension.contributes.debuggers.runtime": "Runtime opcional no caso do atributo do programa não ser um executável, mas requerer um runtime.", + "vscode.extension.contributes.debuggers.runtimeArgs": "Argumentos opcionais do runtime.", + "vscode.extension.contributes.debuggers.variables": "Mapeamento de variáveis interativas (por exemplo ${action.pickProcess}) em 'launch.json' para um comando.", + "vscode.extension.contributes.debuggers.initialConfigurations": "Configurações para gerar o 'launch.json' inicial.", + "vscode.extension.contributes.debuggers.languages": "Lista de idiomas para os quais a extensão de depuração pode ser considerada o \"depurador padrão\".", + "vscode.extension.contributes.debuggers.adapterExecutableCommand": "Se especificado VS Code chamará este comando para determinar o caminho do executável do adaptador de depuração e os argumentos para passar.", + "vscode.extension.contributes.debuggers.startSessionCommand": "Se especificado VS Code chamará este comando para as ações de \"depurar\" ou \"executar\" direcionadas para esta extensão.", + "vscode.extension.contributes.debuggers.configurationSnippets": "Trechos de código para adicionar novas configurações em 'launch.json'.", + "vscode.extension.contributes.debuggers.configurationAttributes": "Configurações de esquema JSON para validar 'launch.json'.", + "vscode.extension.contributes.debuggers.windows": "Configurações específicas do Windows.", + "vscode.extension.contributes.debuggers.windows.runtime": "Runtime usado para Windows.", + "vscode.extension.contributes.debuggers.osx": "Configurações específicas do OS X.", + "vscode.extension.contributes.debuggers.osx.runtime": "Runtime usado para o OS X.", + "vscode.extension.contributes.debuggers.linux": "Configurações específicas do Linux.", + "vscode.extension.contributes.debuggers.linux.runtime": "Runtime usado para o Linux.", + "vscode.extension.contributes.breakpoints": "Contribui aos pontos de interrupção.", + "vscode.extension.contributes.breakpoints.language": "Permitir pontos de parada para este idioma.", + "app.launch.json.title": "Executar", + "app.launch.json.version": "Versão deste formato de arquivo.", + "app.launch.json.configurations": "Lista de configurações. Adicionar novas configurações ou editar as existentes usando o IntelliSense.", + "app.launch.json.compounds": "Lista de compostos. Cada composto faz referência a várias configurações que vão ser executadas juntas.", + "app.launch.json.compound.name": "Nome do composto. Aparece no menu drop-down da configuração de execução.", + "app.launch.json.compounds.configurations": "Nomes das configurações que serão iniciadas como parte deste composto.", + "debugNoType": "'type' do adaptador de depuração não pode ser omitido e deve ser do tipo 'string'.", + "DebugConfig.failed": "Não é possível criar o arquivo 'launch.json' dentro da pasta '.vscode' ({0}).", + "selectDebug": "Selecione o ambiente" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/debugEditorContribution.i18n.json b/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/debugEditorContribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..1424499bfccb95ff802aefe85debc64cf0ee7d34 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/debugEditorContribution.i18n.json @@ -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. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "removeBreakpoints": "Remover pontos de interrupção", + "removeBreakpointOnColumn": "Remover ponto de interrupção na coluna {0}", + "removeLineBreakpoint": "Remover ponto de interrupção de linha", + "editBreakpoints": "Editar pontos de interrupção", + "editBreakpointOnColumn": "Editar o ponto de interrupção na coluna {0}", + "editLineBrekapoint": "Editar o ponto de interrupção de linha", + "enableDisableBreakpoints": "Habilitar/Desabilitar pontos de interrupção", + "disableColumnBreakpoint": "Desabilitar ponto de interrupção na coluna {0}", + "disableBreakpointOnLine": "Desabilitar ponto de interrupção de linha", + "enableBreakpoints": "Habilitar o ponto de interrupção na coluna {0}", + "enableBreakpointOnLine": "Habilitar o ponto de interrupção de linha", + "addBreakpoint": "Adicionar ponto de interrupção", + "addConfiguration": "Adicionar Configuração..." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/debugHover.i18n.json b/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/debugHover.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..1853865a1ecf914dd8952b2f3130fa37af702c65 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/debugHover.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "treeAriaLabel": "Depurar passando o mouse por cima" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/debugService.i18n.json b/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/debugService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..de6d591510a0be3ce82f4037452b279bf8f34147 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/debugService.i18n.json @@ -0,0 +1,25 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "snapshotObj": "Apenas valores primitivos são mostrados para este objeto.", + "debuggingPaused": "Depuração pausada, razão {0}, {1} {2}", + "debuggingStarted": "Depuração Iniciada.", + "debuggingStopped": "Depuração parada.", + "breakpointAdded": "Adicionado ponto de interrupção, linha {0}, arquivo {1}", + "breakpointRemoved": "Ponto de interrupção removido, linha {0}, arquivo {1}", + "compoundMustHaveConfigurations": "Composição deve ter o atributo \"configurations\" definido para iniciar várias configurações.", + "configMissing": "Configuração '{0}' não tem 'launch.json'.", + "debugTypeNotSupported": "Tipo de depuração configurado '{0}' não é suportado.", + "debugTypeMissing": "Falta a propriedade 'type' para a configuração de lançamento escolhida.", + "preLaunchTaskErrors": "Erros de build foram detectados durante a preLaunchTask '{0}'.", + "preLaunchTaskError": "Erro de build foi detectado durante a preLaunchTask '{0}'.", + "preLaunchTaskExitCode": "A preLaunchTask '{0}' encerrada com código de saída {1}.", + "debugAnyway": "Depurar mesmo assim", + "noFolderWorkspaceDebugError": "O arquivo ativo não pode ser depurado. Certifique-se de que ele está salvo no disco e que tem uma extensão de depuração instalada para esse tipo de arquivo.", + "NewLaunchConfig": "Por favor, configure o arquivo de configuração de lançamento para seu aplicativo. {0}", + "DebugTaskNotFound": "Não foi possível encontrar o preLaunchTask '{0}'.", + "differentTaskRunning": "Há uma tarefa {0} sendo executada. Não pode executar a tarefa de pré-lançamento {1}." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/debugViewer.i18n.json b/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/debugViewer.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..ae47cc6a47d15ce043eb905d2a62aa06468f4cf3 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/debugViewer.i18n.json @@ -0,0 +1,28 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "process": "Processar", + "paused": "Em pausa", + "running": "Em execução", + "thread": "Thread", + "pausedOn": "Pausado em {0}", + "loadMoreStackFrames": "Carregar mais segmentos de pilha", + "threadAriaLabel": "Thread {0}, pilha de chamadas, depuração", + "stackFrameAriaLabel": "Segmento de Pilha {0} linha {1} {2}, pilha de chamadas, depuração", + "variableValueAriaLabel": "Digite o novo valor da variável", + "variableScopeAriaLabel": "Escopo {0}, variáveis, depuração", + "variableAriaLabel": "{0} valor {1}, variáveis, depuração", + "watchExpressionPlaceholder": "Expressão para monitorar", + "watchExpressionInputAriaLabel": "Digitar expressão a monitorar", + "watchExpressionAriaLabel": "{0} valor {1}, monitorar, depuração", + "watchVariableAriaLabel": "{0} valor {1}, monitorar, depuração", + "functionBreakpointPlaceholder": "Função de parada", + "functionBreakPointInputAriaLabel": "Digitar Ponto de Parada de Função", + "functionBreakpointsNotSupported": "Pontos de parada de função não são suportados por este tipo de depuração", + "breakpointAriaLabel": "Ponto de parada linha {0} {1}, pontos de parada, depuração", + "functionBreakpointAriaLabel": "Ponto de parada de função {0}, pontos de parada, depuração", + "exceptionBreakpointAriaLabel": "Ponto de parada de exceção {0}, pontos de parada, depuração" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/debugViews.i18n.json b/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/debugViews.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..c981f42161e74560b58e3f5f284508275c1f7247 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/debugViews.i18n.json @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "variablesSection": "Seção de variáveis", + "variablesAriaTreeLabel": "Variáveis de Depuração", + "expressionsSection": "Seção de Expressões", + "watchAriaTreeLabel": "Depurar Expressões Monitoradas", + "callstackSection": "Seção de Pilha de Chamada", + "debugStopped": "Pausado em {0}", + "callStackAriaLabel": "Depurar a Pilha de Chamadas", + "breakpointsSection": "Seção de Pontos de Parada", + "breakpointsAriaTreeLabel": "Depurar os Pontos de Parada" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/electronDebugActions.i18n.json b/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/electronDebugActions.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..227ca95927f6aaf7efe027c03c3e2992c093ecf3 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/electronDebugActions.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "copyValue": "Copiar valor", + "copy": "Copiar", + "copyAll": "Copiar todos", + "copyStackTrace": "Copiar Pilha de Chamadas" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/rawDebugSession.i18n.json b/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/rawDebugSession.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..0ce97a8f7969ccf421ca8e493acd9a98fca9a9a9 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/rawDebugSession.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "moreInfo": "Mais Informações", + "unableToLaunchDebugAdapter": "Não é possível executar o adaptador de depuração de '{0}'.", + "unableToLaunchDebugAdapterNoArgs": "Não é possível executar o adaptador de depuração.", + "stoppingDebugAdapter": "{0}. Parando o adaptador de depuração.", + "debugAdapterCrash": "Processo do adaptador de depuração foi finalizado inesperadamente" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/repl.i18n.json b/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/repl.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..86d901ff7caf62ad798538f35f279d7b8cc24f95 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/repl.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "replAriaLabel": "Ler o Painel de Impressão Eval", + "actions.repl.historyPrevious": "História anterior", + "actions.repl.historyNext": "Próxima história", + "actions.repl.acceptInput": "REPL Aceitar Entrada", + "actions.repl.copyAll": "Depurar: Copiar Todos os Consoles" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/replViewer.i18n.json b/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/replViewer.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..4afd6d64d82570e0c458a051c162568a5ec9501a --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/replViewer.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "stateCapture": "Estado do objeto é capturado na primeira avaliação", + "replVariableAriaLabel": "Variável {0} tem valor {1}, ler a impressão do valor do loop, depurar", + "replExpressionAriaLabel": "Expressão {0} tem valor {1}, ler o laço de avaliação de impressão, depurar", + "replValueOutputAriaLabel": " impressão da avaliação do laço de leitura, depurar", + "replKeyValueOutputAriaLabel": "Variável de saída {0} tem valor {1}, ler o loop de avaliação de impressão, depurar" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/statusbarColorProvider.i18n.json b/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/statusbarColorProvider.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..86bf6e71ecc6ac5bc0a5046f1faf44870b106bb1 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/statusbarColorProvider.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "statusBarDebuggingBackground": "Cor de fundo da barra de status quando um programa está sendo depurado. A barra de status é mostrada na parte inferior da janela", + "statusBarDebuggingForeground": "Cor de primeiro plano da barra de status quando um programa está sendo depurado. A barra de status é mostrada na parte inferior da janela" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/terminalSupport.i18n.json b/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/terminalSupport.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..898a18605fbc3836ec3ae70dcdd6ac489fc138bf --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/debug/electron-browser/terminalSupport.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "debug.terminal.title": "depurado", + "debug.terminal.not.available.error": "Terminal integrado não disponível" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json b/i18n/ptb/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..f0551dfe57b82daa311b6d59611c53805e552ce2 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json @@ -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. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "debugAdapterBinNotFound": "Executável do adaptador de depuração '{0}' não existe.", + "debugAdapterCannotDetermineExecutable": "Não é possível determinar o executável para o adaptador de depuração '{0}'.", + "debugType": "Tipo de configuração.", + "debugTypeNotRecognised": "O tipo de depuração não é reconhecido. Certifique-se de que você tem uma extensão de depuração correspondente instalada e que ela está habilitada.", + "node2NotSupported": "\"node2\" não é mais suportado, use \"node\" ao invés e defina o atributo \"protocol\" para \"inspector\".", + "debugName": "Nome da configuração; aparece no menu drop-down da configuração de lançamento. ", + "debugRequest": "Requer o tipo de configuração. Pode ser \"launch\" ou \"attach\".", + "debugServer": "Somente para o desenvolvimento de extensão de depuração: se uma porta é especificada, o VS Code tenta se conectar a um adaptador de depuração executando em modo de servidor", + "debugPrelaunchTask": "Tarefa para ser executada antes de começar a sessão de depuração.", + "debugWindowsConfiguration": "Atributos de configuração de lançamento específicos do Windows.", + "debugOSXConfiguration": "Atributos de configuração de lançamento específicos do OS X.", + "debugLinuxConfiguration": "Atributos de configuração de lançamento específicos do Linux.", + "deprecatedVariables": "'env.', 'config.' e 'command.' foram descontinuados, use ' env:', ' config:' e ' command:' em vez disso." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/emmet/browser/actions/showEmmetCommands.i18n.json b/i18n/ptb/src/vs/workbench/parts/emmet/browser/actions/showEmmetCommands.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..1e3a1c0f277af4b6d60bf9e216ac797a66bcc7b9 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/emmet/browser/actions/showEmmetCommands.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "showEmmetCommands": "Mostrar Comandos do Emmet" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/balance.i18n.json b/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/balance.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..1dc5e1e3b692321f86ec59f91b4a717fb0488da3 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/balance.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "balanceInward": "Emmet: Saldo (interno)", + "balanceOutward": "Emmet: Saldo (externo)" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json b/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..d9e3601f991afbe4f57118a90cad8c9cb584a13b --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "previousEditPoint": "Emmet: Ir para o Ponto de Edição Anterior", + "nextEditPoint": "Emmet: Ir para o Próximo Ponto de Edição" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/evaluateMath.i18n.json b/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/evaluateMath.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..b4a6a03e213571d2f13d21dbc96ba471c68d28ee --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/evaluateMath.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "evaluateMathExpression": "Emmet: Avaliar a expressão matemática" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/expandAbbreviation.i18n.json b/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/expandAbbreviation.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..5a5dd3cc3e843707cbf93bbabc51c1b9abd8cda6 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/expandAbbreviation.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "expandAbbreviationAction": "Emmet: Expandir Abreviação" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/incrementDecrement.i18n.json b/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/incrementDecrement.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..306332a4af226466e5372ddbfae264da43d20ae0 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/incrementDecrement.i18n.json @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "incrementNumberByOneTenth": "Emmet: Incremento de 0.1", + "incrementNumberByOne": "Emmet: Incremento de 1", + "incrementNumberByTen": "Emmet: Incremento de 10", + "decrementNumberByOneTenth": "Emmet: Decréscimo por 0.1", + "decrementNumberByOne": "Emmet: Decréscimo por 1", + "decrementNumberByTen": "Emmet: Decréscimo por 10" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/matchingPair.i18n.json b/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/matchingPair.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..6a742c4d5f91d3e87e9fda3968b28b5595cdd338 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/matchingPair.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "matchingPair": "Emmet: Ir para o par de correspondência" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/mergeLines.i18n.json b/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/mergeLines.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..22ed3f5f533ab35725a2a8ecb1f72a69eaaa8305 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/mergeLines.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "mergeLines": "Emmet: Mesclar linhas" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/reflectCssValue.i18n.json b/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/reflectCssValue.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..bc0eefc2e0042043b6dd3e72b51b04a8a382c798 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/reflectCssValue.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "reflectCSSValue": "Emmet: Refletir valor CSS" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/removeTag.i18n.json b/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/removeTag.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..a30414b08d2d3e47f999db1700285b2d6a8f5dc4 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/removeTag.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "removeTag": "Emmet: Remover Rótulo" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/selectItem.i18n.json b/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/selectItem.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..1343e2d6b3664500f8d7b28affd8cc8180846a06 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/selectItem.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "selectPreviousItem": "Emmet: Selecione o Item anterior", + "selectNextItem": "Emmet: Selecione o próximo Item" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/splitJoinTag.i18n.json b/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/splitJoinTag.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..ea04346ea7cf58773037b3b458f04392601e2877 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/splitJoinTag.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "splitJoinTag": "Emmet: Dividir/Juntar Rótulo" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/toggleComment.i18n.json b/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/toggleComment.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..366cb874a0c704815f112ac1d170db9f9c5a09b2 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/toggleComment.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "toggleComment": "Emmet: Alternar Comentário" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/updateImageSize.i18n.json b/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/updateImageSize.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..1eff88ade9dcd4644b6377a1b58bc6f9059ca6d5 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/updateImageSize.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "updateImageSize": "Emmet: Atualizar o Tamanho da Imagem" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/updateTag.i18n.json b/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/updateTag.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..963a85e1671f5af8e3d7a3ee5afa0f5f8b7bc62e --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/updateTag.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "updateTag": "Emmet: Atualizar Rótulo", + "enterTag": "Insira o Rótulo", + "tag": "Rótulo" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/wrapWithAbbreviation.i18n.json b/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/wrapWithAbbreviation.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..501253b7dcbb7d37e3f4f72acf827533ceaee2e7 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/actions/wrapWithAbbreviation.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "wrapWithAbbreviationAction": "Emmet: Envelope com a abreviatura", + "enterAbbreviation": "Digite a abreviação", + "abbreviation": "Abreviação" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json b/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..ee08d95bf189dd262554ba7f4436e0ca963c87c6 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "emmetConfigurationTitle": "Emmet", + "triggerExpansionOnTab": "Quando habilitado, abreviações emmet são expandidas ao pressionar TAB.", + "emmetPreferences": "Preferências usadas para modificar o comportamento de algumas ações e resolvedores de Emmet.", + "emmetSyntaxProfiles": "Definir o perfil para a sintaxe especificada ou usar seu próprio perfil com regras específicas.", + "emmetExclude": "Uma matriz de línguagens onde abreviaturas emmet não devem ser expandidas.", + "emmetExtensionsPath": "Caminho para uma pasta contendo perfis emmet, trechos e preferências", + "useNewEmmet": "Experimente os novos módulos emmet (que irão substituir a antiga biblioteca unica emmet) para todos os recursos emmet." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/execution/electron-browser/terminal.contribution.i18n.json b/i18n/ptb/src/vs/workbench/parts/execution/electron-browser/terminal.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..95274daf750399b92ffd4799cf6b62ce0ebee3fe --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/execution/electron-browser/terminal.contribution.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "terminalConfigurationTitle": "Terminal Externo", + "terminal.external.windowsExec": "Personalizar qual terminal executar no Windows.", + "terminal.external.osxExec": "Personalizar qual aplicativo de terminal executar no OS X.", + "terminal.external.linuxExec": "Personalizar qual terminal executar no Linux.", + "globalConsoleActionWin": "Abrir Novo Prompt de Comando", + "globalConsoleActionMacLinux": "Abrir Novo Terminal", + "scopedConsoleActionWin": "Abrir no Prompt de Comando", + "scopedConsoleActionMacLinux": "Abrir no Terminal" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/execution/electron-browser/terminalService.i18n.json b/i18n/ptb/src/vs/workbench/parts/execution/electron-browser/terminalService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..fde640b09c5d2d74029ad2101bcdfe21a6abdced --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/execution/electron-browser/terminalService.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "console.title": "Console VS Code", + "mac.terminal.script.failed": "Script '{0}' falhou com código de saída {1}", + "mac.terminal.type.not.supported": "'{0}' não suportado", + "press.any.key": "Pressione qualquer tecla para continuar...", + "linux.term.failed": "'{0}' falhou com código de saída {1}" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/explorers/browser/treeExplorer.contribution.i18n.json b/i18n/ptb/src/vs/workbench/parts/explorers/browser/treeExplorer.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..d79e3c4ca0ac237ebbae90efa44e4f99cca051d7 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/explorers/browser/treeExplorer.contribution.i18n.json @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "vscode.extension.contributes.view": "Contribui ao modo de exibição personalizado", + "vscode.extension.contributes.view.id": "Identificação única usada para identificar a vista criada por vscode.workspace.createTreeView", + "vscode.extension.contributes.view.label": "Sequência de caracteres legível usada para processar a visualização", + "vscode.extension.contributes.view.icon": "Caminho para o ícone da visualização", + "vscode.extension.contributes.views": "Contribui com visualizações personalizadas", + "showViewlet": "Mostrar {0}", + "view": "Exibir" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/explorers/browser/treeExplorerActions.i18n.json b/i18n/ptb/src/vs/workbench/parts/explorers/browser/treeExplorerActions.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..37735d1000708ca8a6b3a36054b624801a0804a3 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/explorers/browser/treeExplorerActions.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "refresh": "Atualizar" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/explorers/browser/treeExplorerService.i18n.json b/i18n/ptb/src/vs/workbench/parts/explorers/browser/treeExplorerService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..7b7f16b3812fcf990a7b9539f64f6bfbfa10ab60 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/explorers/browser/treeExplorerService.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "treeExplorer.noMatchingProviderId": "Não há TreeExplorerNodeProvider com id {providerId} registrado." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/explorers/browser/views/treeExplorerView.i18n.json b/i18n/ptb/src/vs/workbench/parts/explorers/browser/views/treeExplorerView.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..0e7f5f9cd9210525f529385e3c0ee2d296eb08e5 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/explorers/browser/views/treeExplorerView.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "treeExplorerViewlet.tree": "Seção do Explorador da Árvore" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/extensions/browser/dependenciesViewer.i18n.json b/i18n/ptb/src/vs/workbench/parts/extensions/browser/dependenciesViewer.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..0ebd24a9fd8a5463f2ca58044646b76d3a259c53 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/extensions/browser/dependenciesViewer.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "error": "Erro", + "Unknown Dependency": "Dependência Desconhecida:" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/extensions/browser/extensionEditor.i18n.json b/i18n/ptb/src/vs/workbench/parts/extensions/browser/extensionEditor.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..9a0bba90ea25a7cebcd26acbf277419f48c690a9 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/extensions/browser/extensionEditor.i18n.json @@ -0,0 +1,43 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "name": "Nome da extensão", + "extension id": "Identificador da extensão", + "publisher": "Nome do editor", + "install count": "Quantidade de Instalações", + "rating": "Avaliação", + "license": "Licença", + "details": "Detalhes", + "contributions": "Contribuições", + "changelog": "Registro de Alterações", + "dependencies": "Dependências", + "noReadme": "README não disponível.", + "noChangelog": "Registro de Alterações não disponível.", + "noContributions": "Sem Contribuições", + "noDependencies": "Sem Dependências", + "settings": "Configurações ({0})", + "setting name": "Nome", + "description": "Descrição", + "default": "Valor padrão", + "debuggers": "Depuradores ({0})", + "debugger name": "Nome", + "views": "Visualizações ({0})", + "view id": "ID", + "view name": "Nome", + "view location": "Onde", + "themes": "Temas ({0})", + "JSON Validation": "Validação JSON ({0})", + "commands": "Comandos ({0})", + "command name": "Nome", + "keyboard shortcuts": "Atalhos de Teclado", + "menuContexts": "Contextos de Menu", + "languages": "Linguagens ({0})", + "language id": "ID", + "language name": "Nome", + "file extensions": "Extensões de Arquivo", + "grammar": "Gramática", + "snippets": "Trechos" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/extensions/browser/extensionsActions.i18n.json b/i18n/ptb/src/vs/workbench/parts/extensions/browser/extensionsActions.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..61966d0e312bb2ef030a3fca6371160ba11cc16e --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/extensions/browser/extensionsActions.i18n.json @@ -0,0 +1,62 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "installAction": "Instalar", + "installing": "Instalando", + "uninstallAction": "Desinstalar", + "Uninstalling": "Desinstalando", + "updateAction": "Atualizar", + "updateTo": "Atualizar para {0}", + "enableForWorkspaceAction.label": "Habilitar (Espaço de Trabalho)", + "enableAlwaysAction.label": "Habilitar (Sempre)", + "disableForWorkspaceAction.label": "Desabilitar (Espaço de Trabalho)", + "disableAlwaysAction.label": "Desabilitar (Sempre)", + "ManageExtensionAction.uninstallingTooltip": "Desinstalando", + "enableForWorkspaceAction": "Espaço de trabalho", + "enableGloballyAction": "Sempre", + "enableAction": "Habilitar", + "disableForWorkspaceAction": "Espaço de trabalho", + "disableGloballyAction": "Sempre", + "disableAction": "Desabilitar", + "checkForUpdates": "Verificar Atualizações", + "enableAutoUpdate": "Habilitar Extensões Auto-Atualizáveis", + "disableAutoUpdate": "Desabilitar Extensões Auto-Atualizáveis", + "updateAll": "Atualizar Todas as Extensões", + "reloadAction": "Recarregar", + "postUpdateTooltip": "Recarregar para atualizar", + "postUpdateMessage": "Recarregar esta janela para ativar a extensão atualizada '{0}'?", + "postEnableTooltip": "Recarregar para ativar", + "postEnableMessage": "Recarregar esta janela para ativar a extensão '{0}'?", + "postDisableTooltip": "Recarregar para desativar", + "postDisableMessage": "Recarregar esta janela para desativar a extensão '{0}'?", + "postUninstallTooltip": "Recarregar para desativar", + "postUninstallMessage": "Recarregar esta janela para desativar a extensão desinstalada '{0}'?", + "reload": "&&Recarregar Janela", + "toggleExtensionsViewlet": "Mostrar Extensões", + "installExtensions": "Instalar Extensões", + "showInstalledExtensions": "Mostrar Extensões Instaladas", + "showDisabledExtensions": "Mostrar Extensões Desabilitadas", + "clearExtensionsInput": "Limpar Entrada de Extensões", + "showOutdatedExtensions": "Mostrar Extensões Desatualizadas", + "showPopularExtensions": "Mostrar Extensões Populares", + "showRecommendedExtensions": "Mostrar Extensões Recomendadas", + "showWorkspaceRecommendedExtensions": "Mostrar Extensões Recomendadas para o Espaço de Trabalho", + "showRecommendedKeymapExtensions": "Mostrar Mapeamentos de Teclado Recomendados", + "showRecommendedKeymapExtensionsShort": "Mapeamentos de Teclado", + "showLanguageExtensions": "Mostrar Extensões de Linguagem", + "showLanguageExtensionsShort": "Extensões de Linguagem", + "configureWorkspaceRecommendedExtensions": "Configurar Extensões Recomendadas (Espaço de Trabalho)", + "ConfigureWorkspaceRecommendations.noWorkspace": "As recomendações somente estão disponíveis em uma pasta do espaço de trabalho.", + "OpenExtensionsFile.failed": "Não foi possível criar o arquivo 'extensions.json' na pasta '.vscode' ({0}).", + "builtin": "Intrínseco", + "disableAll": "Desabilitar Todas as Extensões Instaladas", + "disableAllWorkspace": "Desabilitar Todas as Extensões Instaladas para este Espaço de Trabalho", + "enableAll": "Habilitar Todas as Extensões Instaladas", + "enableAllWorkspace": "Habilitar Todas as Extensões Instaladas para este Espaço de Trabalho", + "extensionButtonProminentBackground": "Cor de fundo do botão para a ações de extensão que se destacam (por exemplo, o botão de instalar).", + "extensionButtonProminentForeground": "Cor de primeiro plano do botão para a ações de extensão que se destacam (por exemplo, o botão de instalar).", + "extensionButtonProminentHoverBackground": "Cor de fundo ao passar o mouse sobre o botão para a ações de extensão que se destacam (por exemplo, o botão de instalar)." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/extensions/browser/extensionsQuickOpen.i18n.json b/i18n/ptb/src/vs/workbench/parts/extensions/browser/extensionsQuickOpen.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..666a66921792b2c206522fe91afb0e47a5553d93 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/extensions/browser/extensionsQuickOpen.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "manage": "Pressione Enter para gerenciar suas extensões.", + "searchFor": "Pressione Enter para pesquisar por '{0}' na Loja.", + "noExtensionsToInstall": "Digite um nome de extensão" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/extensions/common/extensionsFileTemplate.i18n.json b/i18n/ptb/src/vs/workbench/parts/extensions/common/extensionsFileTemplate.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..b90c0d5ac642cfa90d27ff0e924c31ba4ba1a850 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/extensions/common/extensionsFileTemplate.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "app.extensions.json.title": "Extensões", + "app.extensions.json.recommendations": "Lista de recomendações de extensões. O identificador de uma extensão é sempre ' ${publisher}. ${nome}'. Por exemplo: 'vscode.csharp'.", + "app.extension.identifier.errorMessage": "Formato esperado '${editor}.${nome}'. Exemplo: 'vscode.csharp'." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/extensions/common/extensionsInput.i18n.json b/i18n/ptb/src/vs/workbench/parts/extensions/common/extensionsInput.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..333627e961989b6ce7b25e061401966732228aea --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/extensions/common/extensionsInput.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "extensionsInputName": "Extensão: {0}" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.i18n.json b/i18n/ptb/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..663560d4d78a1744c0dfd79b02d7a89dd22840c0 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.i18n.json @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "reallyRecommended2": "A extensão {0} é recomendada para este tipo de arquivo.", + "showRecommendations": "Mostrar Recomendações", + "neverShowAgain": "Não mostrar novamente", + "close": "Fechar", + "workspaceRecommended": "Este espaço de trabalho possui recomendações de extensão.", + "ignoreExtensionRecommendations": "Deseja ignorar todas as recomendações de extensão?", + "ignoreAll": "Sim, Ignorar Tudo", + "no": "Não", + "cancel": "Cancelar" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.i18n.json b/i18n/ptb/src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..76bf0379481589ebf5f569514c31d98575143254 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "extensionsCommands": "Gerenciar Extensões", + "galleryExtensionsCommands": "Instalar Extensões da Galeria", + "extension": "Extensão", + "extensions": "Extensões", + "view": "Exibir", + "extensionsConfigurationTitle": "Extensões", + "extensionsAutoUpdate": "Atualizar extensões automaticamente", + "extensionsIgnoreRecommendations": "Ignorar recomendações de extensão" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/extensions/electron-browser/extensionsActions.i18n.json b/i18n/ptb/src/vs/workbench/parts/extensions/electron-browser/extensionsActions.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..731e4ef949173e09919b892673c2982c24deaeeb --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/extensions/electron-browser/extensionsActions.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "openExtensionsFolder": "Abrir a Pasta de Extensões", + "installVSIX": "Instalar do VSIX...", + "InstallVSIXAction.success": "A extensão foi instalada com sucesso. Reinicie para habilitá-la.", + "InstallVSIXAction.reloadNow": "Recarregar Agora" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json b/i18n/ptb/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..e1aa51729e52b948e96b4728938f6a266f7e421d --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "disableOtherKeymapsConfirmation": "Desabilitar outros mapeamentos de teclado ({0}) para evitar conflitos entre as combinações de teclas?", + "yes": "Sim", + "no": "Não", + "betterMergeDisabled": "A extensão Better Merge agora é intrínseca, a extensão instalada foi desabilitada e pode ser desinstalada.", + "uninstall": "Desinstalar", + "later": "Mais tarde" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/extensions/electron-browser/extensionsViewlet.i18n.json b/i18n/ptb/src/vs/workbench/parts/extensions/electron-browser/extensionsViewlet.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..a35f8bbe6c67304f9fe620df0f85c7b986fee1f4 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/extensions/electron-browser/extensionsViewlet.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "searchExtensions": "Pesquisar Extensões na Loja", + "extensions": "Extensões", + "sort by installs": "Ordenar por: Quantidade de Instalações", + "sort by rating": "Ordenar por: Avaliação", + "sort by name": "Ordenar por: Nome", + "no extensions found": "Nenhuma extensão encontrada.", + "suggestProxyError": "A Loja retornou 'ECONNREFUSED'. Por favor, verifique a configuração de 'http.proxy'.", + "outdatedExtensions": "{0} Extensões Desatualizadas" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/extensions/node/extensionsWorkbenchService.i18n.json b/i18n/ptb/src/vs/workbench/parts/extensions/node/extensionsWorkbenchService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..f0313c203438bcbe84ca1514902115f8048816e5 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/extensions/node/extensionsWorkbenchService.i18n.json @@ -0,0 +1,17 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "enableDependeciesConfirmation": "Habilitando '{0}' também habilita suas dependências. Gostaria de continuar?", + "enable": "Sim", + "doNotEnable": "Não", + "disableDependeciesConfirmation": "Gostaria de desabilitar somente '{0}', ou as suas dependências também?", + "disableOnly": "Apenas", + "disableAll": "Todos", + "cancel": "Cancelar", + "singleDependentError": "Não é possível desabilitar a extensão '{0}'. A extensão '{1}' depende dela.", + "twoDependentsError": "Não é possível desabilitar a extensão '{0}'. As extensões '{1}' e '{2}' dependem dela.", + "multipleDependentsError": "Não é possível desabilitar a extensão '{0}'. As extensões '{1}', '{2}' e outras dependem dela." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/feedback/electron-browser/feedback.i18n.json b/i18n/ptb/src/vs/workbench/parts/feedback/electron-browser/feedback.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..5d3c22c39a84f4edfe64977a9c3b33160b19618e --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/feedback/electron-browser/feedback.i18n.json @@ -0,0 +1,25 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "sendFeedback": "Tweetar Feedback", + "label.sendASmile": "Tweete feedback para nós", + "patchedVersion1": "Sua instalação está corrompida.", + "patchedVersion2": "Por favor especificar isso ao enviar um bug.", + "sentiment": "Como foi sua experiência?", + "smileCaption": "Feliz", + "frownCaption": "Triste", + "other ways to contact us": "Outras maneiras de nos contatar", + "submit a bug": "Submeter um bug", + "request a missing feature": "Solicitar um recurso ausente", + "tell us why?": "Diga-nos porquê?", + "commentsHeader": "Comentários", + "tweet": "Tweetar", + "character left": "caractere à esquerda", + "characters left": "caracteres à esquerda", + "feedbackSending": "Enviando", + "feedbackSent": "Obrigado", + "feedbackSendingError": "Tentar novamente" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/files/browser/editors/binaryFileEditor.i18n.json b/i18n/ptb/src/vs/workbench/parts/files/browser/editors/binaryFileEditor.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..9c33fd25246c018e871750983f6f14f6127a5fc1 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/files/browser/editors/binaryFileEditor.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "binaryFileEditor": "Visualizador de Arquivo Binário" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/files/browser/editors/textFileEditor.i18n.json b/i18n/ptb/src/vs/workbench/parts/files/browser/editors/textFileEditor.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..792781bc8c79410bc6632e5e149fe9fea5558947 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/files/browser/editors/textFileEditor.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "textFileEditor": "Editor de Arquivo de Texto", + "createFile": "Criar arquivo", + "fileEditorWithInputAriaLabel": "{0}. Editor de Arquivo de Texto.", + "fileEditorAriaLabel": "Editor de Arquivo de Texto" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/files/browser/fileActions.contribution.i18n.json b/i18n/ptb/src/vs/workbench/parts/files/browser/fileActions.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..f203671c230bf4a5ed19703a9bf985c80cdba9e1 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/files/browser/fileActions.contribution.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "filesCategory": "Arquivos", + "revealInSideBar": "Revelar na Barra Lateral", + "acceptLocalChanges": "Usar mudanças locais e sobrescrever o conteúdo do disco", + "revertLocalChanges": "Descartar mudanças locais e reverter para conteúdo do disco" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/files/browser/fileActions.i18n.json b/i18n/ptb/src/vs/workbench/parts/files/browser/fileActions.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..161e7a9a16cdfd50e89030f2fb58dca446369c4c --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/files/browser/fileActions.i18n.json @@ -0,0 +1,73 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "retry": "Tentar novamente", + "rename": "Renomear", + "newFile": "Novo Arquivo", + "newFolder": "Nova Pasta", + "openFolderFirst": "Abrir uma pasta primeiro para criar arquivos ou pastas dentro dele.", + "newUntitledFile": "Novo Arquivo Sem Título", + "createNewFile": "Novo Arquivo", + "createNewFolder": "Nova Pasta", + "deleteButtonLabelRecycleBin": "&&Mover para Lixeira", + "deleteButtonLabelTrash": "&&Mover para o Lixo", + "deleteButtonLabel": "&&Excluir", + "dirtyMessageFolderOneDelete": "Você está excluindo uma pasta com alterações não salvas em 1 arquivo. Você quer continuar?", + "dirtyMessageFolderDelete": "Você está excluindo uma pasta com alterações não salvas em {0} arquivos. Você quer continuar?", + "dirtyMessageFileDelete": "Você está excluindo um arquivo com alterações não salvas. Você quer continuar?", + "dirtyWarning": "Suas alterações serão perdidas se você não salvá-las.", + "confirmMoveTrashMessageFolder": "Tem certeza de que deseja excluir '{0}' e seu conteúdo?", + "confirmMoveTrashMessageFile": "Tem certeza de que deseja excluir '{0}'?", + "undoBin": "Você pode restaurar da lixeira.", + "undoTrash": "Você pode restaurar a partir do lixo.", + "confirmDeleteMessageFolder": "Tem certeza de que deseja excluir permanentemente '{0}' e seu conteúdo?", + "confirmDeleteMessageFile": "Tem certeza de que deseja excluir permanentemente '{0}'?", + "irreversible": "Esta ação é irreversível!", + "permDelete": "Excluir permanentemente", + "delete": "Excluir", + "importFiles": "Importar Arquivos", + "confirmOverwrite": "Um arquivo ou pasta com o mesmo nome já existe na pasta de destino. Você quer substituí-lo?", + "replaceButtonLabel": "&&Substituir", + "copyFile": "Copiar", + "pasteFile": "Colar", + "duplicateFile": "Duplicar", + "openToSide": "Aberto para o lado", + "compareSource": "Selecione para comparar", + "globalCompareFile": "Compare o Arquivo Ativo Com...", + "pickHistory": "Selecione um arquivo previamente aberto para comparar com", + "unableToFileToCompare": "O arquivo selecionado não pode ser comparado com '{0}'.", + "openFileToCompare": "Abrir um arquivo primeiro para compará-lo com outro arquivo.", + "compareWith": "Comparar com '{0}'", + "compareFiles": "Comparar Arquivos", + "refresh": "Atualizar", + "save": "Salvar", + "saveAs": "Salvar como...", + "saveAll": "Salvar Todos", + "saveAllInGroup": "Salvar Todos no Grupo", + "saveFiles": "Salvar Arquivos Sujos", + "revert": "Reverter Arquivo", + "focusOpenEditors": "Foco na Visualização dos Editores Abertos", + "focusFilesExplorer": "Foco no Explorador de Arquivos", + "showInExplorer": "Revelar o Arquivo Ativo na Barra Lateral", + "openFileToShow": "Abrir um arquivo primeiro para mostrá-lo no explorer", + "collapseExplorerFolders": "Esconder Pastas no Explorador", + "refreshExplorer": "Atualizar Explorador", + "openFile": "Abrir arquivo...", + "openFileInNewWindow": "Abrir o Arquivo Ativo em uma Nova Janela", + "openFileToShowInNewWindow": "Abrir um arquivo primeiro para abrir em uma nova janela", + "revealInWindows": "Revelar no Explorer", + "revealInMac": "Revelar no Finder", + "openContainer": "Abrir a Pasta", + "revealActiveFileInWindows": "Revelar Arquivo Ativo no Windows Explorer", + "revealActiveFileInMac": "Revelar Arquivo Ativo no Finder", + "openActiveFileContainer": "Abrir a Pasta do Arquivo Ativo.", + "copyPath": "Copiar Caminho", + "copyPathOfActive": "Copiar Caminho do Arquivo Ativo", + "emptyFileNameError": "Um nome de arquivo ou pasta deve ser fornecido.", + "fileNameExistsError": "Um arquivo ou pasta **{0}** já existe neste local. Escolha um nome diferente.", + "invalidFileNameError": "O nome **{0}** não é válido como um nome de arquivo ou pasta. Por favor, escolha um nome diferente.", + "filePathTooLongError": "O nome **{0}** resulta em um caminho muito longo. Escolha um nome mais curto." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/files/browser/fileCommands.i18n.json b/i18n/ptb/src/vs/workbench/parts/files/browser/fileCommands.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..2e61a1656c803409140a862fc3f46f08664243ef --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/files/browser/fileCommands.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "openFileToCopy": "Abrir um arquivo primeiro para copiar seu caminho", + "openFileToReveal": "Abrir um arquivo primeiro para revelar" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/files/browser/files.contribution.i18n.json b/i18n/ptb/src/vs/workbench/parts/files/browser/files.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..62b98096be419d38654924f73f7d7434b6166b38 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/files/browser/files.contribution.i18n.json @@ -0,0 +1,41 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "showExplorerViewlet": "Mostrar Explorer", + "explore": "Explorador", + "view": "Exibir", + "textFileEditor": "Editor de Arquivo de Texto", + "binaryFileEditor": "Editor de Arquivo Binário", + "filesConfigurationTitle": "Arquivos", + "exclude": "Configure os padrões glob para excluir arquivos e pastas.", + "files.exclude.boolean": "O padrão glob com o qual combinar os caminhos de arquivo. Defina para verdadeiro ou falso para habilitar ou desabilitar o padrão.", + "files.exclude.when": "Verificação adicional nos irmãos de um arquivo correspondente. Use $(basename) como variável para o nome do arquivo correspondente.", + "associations": "Configurar as associações de arquivo para linguagens (por exemplo, \"* Extension\": \"html\"). Estas têm precedência sobre as associações padrão das linguagens instaladas.", + "encoding": "A codificação padrão do conjunto de caracteres para ser usada ao ler e gravar arquivos.", + "autoGuessEncoding": "Quando habilitado, tentará adivinhar a codificação do conjunto de caracteres ao abrir arquivos", + "eol": "O caractere padrão de fim de linha. Use \\n para LF e \\r\\n para CRLF.", + "trimTrailingWhitespace": "Quando habilitado, removerá espaços em branco à direita ao salvar um arquivo.", + "insertFinalNewline": "Quando habilitado, inseririrá uma nova linha no final do arquivo quando salvá-lo.", + "files.autoSave.off": "Um arquivo sujo nunca é automaticamente salvo.", + "files.autoSave.afterDelay": "Um arquivo sujo é salvo automaticamente após configurado em 'files.autoSaveDelay'.", + "files.autoSave.onFocusChange": "Um arquivo sujo é salvo automaticamente quando o editor perde o foco.", + "files.autoSave.onWindowChange": "Um arquivo sujo é salvo automaticamente quando a janela perde o foco.", + "autoSave": "Controla o auto-salvamento de arquivos sujos. Aceita os valores: '{0}', '{1}', '{2}' (editor perde o foco), '{3}' (janela perde o foco). Se definido como '{4}', você pode configurar o atraso em 'files.autoSaveDelay'.", + "autoSaveDelay": "Controla o atraso em milissegundos depois que um arquivo sujo é salvo automaticamente. Só se aplica quando 'files.autoSave' for definida como '{0}'", + "watcherExclude": "Configure padrões glob de caminhos de arquivo para excluir do monitoramento de arquivos. Alterar essa configuração requer uma reinicialização. Quando você tiver consumo Code muito alto de cpu na inicialização, você pode excluir pastas grandes para reduzir a carga inicial.", + "hotExit.off": "Desabilitar a saída à quente.", + "hotExit.onExit": "Saída à quente será acionada quando o aplicativo for fechado, ou seja, quando a última janela é fechada no Windows/Linux ou quando o comando workbench.action.quit é acionado (paleta de comandos, keybinding, menu). Todas as janelas com backups serão restauradas na próxima execução.", + "hotExit.onExitAndWindowClose": "Saída à quente será acionada quando o aplicativo for fechado, ou seja, quando a última janela é fechada no Windows/Linux ou quando o comando workbench.action.quit é acionado (paleta de comando, keybinding, menu), e também para qualquer janela com uma pasta aberta independentemente se é a última janela. Todas as janelas sem pastas abertas serão restauradas no próximo lançamento. Para restaurar janelas de pastas como eram antes do desligamento configure \"window.restoreWindows\" para \"todos\".", + "hotExit": "Controla se os arquivos não salvos são lembrados entre as sessões, permitindo salvar alerta ao sair do editor seja ignorada.", + "defaultLanguage": "O modo de linguagem padrão que é atribuída para novos arquivos.", + "editorConfigurationTitle": "Editor", + "formatOnSave": "Formata um arquivo no salvamento. Um formatador deve estar disponível, o arquivo não deve ser salvo automaticamente e editor não deve ser desligado.", + "explorerConfigurationTitle": "Explorador de arquivos", + "openEditorsVisible": "Número de editores mostrado no painel Abrir Editores. Configurá-lo para 0 irá ocultar o painel.", + "dynamicHeight": "Controla se a altura da seção de editores abertos deve adaptar-se dinamicamente para o número de elementos ou não.", + "autoReveal": "Controla se o explorador deve automaticamente revelar e selecionar arquivos ao abri-los.", + "enableDragAndDrop": "Controla se o explorador deve permitir mover arquivos e pastas através de arrastar e soltar." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/files/browser/saveErrorHandler.i18n.json b/i18n/ptb/src/vs/workbench/parts/files/browser/saveErrorHandler.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..30a0a48f866a0fa140e26610f9d190d7dfa4e706 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/files/browser/saveErrorHandler.i18n.json @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "discard": "Descartar", + "overwrite": "Sobrescrever", + "retry": "Tentar novamente", + "readonlySaveError": "Falha ao salvar '{0}': O arquivo está protegido contra gravação. Selecione 'Substituir' para remover a proteção.", + "genericSaveError": "Erro ao salvar '{0}': {1}", + "staleSaveError": "Falha ao salvar '{0}': O conteúdo no disco é mais recente. Clique em **Comparar** para comparar a sua versão com a do disco.", + "compareChanges": "Comparar", + "saveConflictDiffLabel": "{0} (no disco) ↔ {1} (em {2}) - Resolver conflitos de salvamento", + "userGuide": "Use as ações na barra de ferramentas do editor para **desfazer** suas alterações ou **substituir** o conteúdo no disco com as suas alterações" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/files/browser/views/emptyView.i18n.json b/i18n/ptb/src/vs/workbench/parts/files/browser/views/emptyView.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..c06bcff690c991553cdb35db7c2c56ca32600a5d --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/files/browser/views/emptyView.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "explorerSection": "Seção de Explorador de Arquivos", + "openFolder": "Abrir Pasta" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/files/browser/views/explorerView.i18n.json b/i18n/ptb/src/vs/workbench/parts/files/browser/views/explorerView.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..4753a88bd4c9208ff43c31fe33f93d87edd5325b --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/files/browser/views/explorerView.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "explorerSection": "Seção de Explorador de Arquivos", + "treeAriaLabel": "Explorador de Arquivos" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/files/browser/views/explorerViewer.i18n.json b/i18n/ptb/src/vs/workbench/parts/files/browser/views/explorerViewer.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..c670883e6ace859593adbbdcc59ba9a92ee84b33 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/files/browser/views/explorerViewer.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "fileInputAriaLabel": "Digite o Nome do arquivo. Pressione Enter para confirmar ou Escape para cancelar.", + "filesExplorerViewerAriaLabel": "{0}, Explorador de Arquivos", + "confirmOverwriteMessage": "'{0}' já existe na pasta de destino. Deseja substituí-lo?", + "irreversible": "Esta ação é irreversível!", + "replaceButtonLabel": "&&Substituir" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/files/browser/views/openEditorsView.i18n.json b/i18n/ptb/src/vs/workbench/parts/files/browser/views/openEditorsView.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..11563199929011c76a4330a0a1842f5312d678f3 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/files/browser/views/openEditorsView.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "openEditors": "Abrir Editores", + "openEditosrSection": "Abrir Seção de Editores", + "treeAriaLabel": "Abrir Editores: Lista de Arquivos Ativos", + "dirtyCounter": "{0} não salvos" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/files/browser/views/openEditorsViewer.i18n.json b/i18n/ptb/src/vs/workbench/parts/files/browser/views/openEditorsViewer.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..31c95aa9bce41d8a3d4915e62ad11b3c6dc46991 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/files/browser/views/openEditorsViewer.i18n.json @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "editorGroupAriaLabel": "{0}, Agrupar Editor", + "openEditorAriaLabel": "{0}, Abrir Editor", + "saveAll": "Salvar Todos", + "closeAllUnmodified": "Fechar Não Modificados", + "closeAll": "Fechar todos", + "close": "Fechar", + "closeOthers": "Fechar Outros" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/files/common/dirtyFilesTracker.i18n.json b/i18n/ptb/src/vs/workbench/parts/files/common/dirtyFilesTracker.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..9e75b7b2a8904641642077ac4baaf68f3201c92c --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/files/common/dirtyFilesTracker.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "dirtyFiles": "{0} arquivos não salvos" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/files/common/editors/fileEditorInput.i18n.json b/i18n/ptb/src/vs/workbench/parts/files/common/editors/fileEditorInput.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..f29992f5d95ab5ac6a1ccb75a4c8d481e79955a3 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/files/common/editors/fileEditorInput.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "orphanedFile": "{0} (excluído do disco)" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/html/browser/html.contribution.i18n.json b/i18n/ptb/src/vs/workbench/parts/html/browser/html.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..f9530b0f6f6e541934e251332f8edb38ecbef933 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/html/browser/html.contribution.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "html.editor.label": "Visualização Html" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/html/browser/htmlPreviewPart.i18n.json b/i18n/ptb/src/vs/workbench/parts/html/browser/htmlPreviewPart.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..8df4c48f58cf1600dc506ecd00e292dd7cb9d2af --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/html/browser/htmlPreviewPart.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "html.voidInput": "Entrada inválida do editor." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/html/browser/webview.i18n.json b/i18n/ptb/src/vs/workbench/parts/html/browser/webview.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..2ef4463deb991c73e89c47fc822b41d7a64ed4cb --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/html/browser/webview.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "devtools.webview": "Desenvolvedor: Ferramentas Webview" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/markers/common/messages.i18n.json b/i18n/ptb/src/vs/workbench/parts/markers/common/messages.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..8576955d6093f67c3e563a488cdbc38982448efa --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/markers/common/messages.i18n.json @@ -0,0 +1,39 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "viewCategory": "Exibir", + "problems.view.show.label": "Mostrar Problemas", + "problems.panel.configuration.title": "Visualização de Problemas", + "problems.panel.configuration.autoreveal": "Controla se a visaulização de problemas evela os arquivos automaticamente ao abri-los", + "markers.panel.title.problems": "Problemas", + "markers.panel.aria.label.problems.tree": "Problemas agrupados por arquivos", + "markers.panel.no.problems.build": "Nenhum problema foi detectado na área de trabalho até agora.", + "markers.panel.no.problems.filters": "Nenhum resultado encontrado com os critérios de filtro fornecidos", + "markers.panel.action.filter": "Problemas de Filtro", + "markers.panel.filter.placeholder": "Filtrar por tipo ou texto", + "markers.panel.filter.errors": "erros", + "markers.panel.filter.warnings": "avisos", + "markers.panel.filter.infos": "informações", + "markers.panel.single.error.label": "1 Erro", + "markers.panel.multiple.errors.label": "{0} Erros", + "markers.panel.single.warning.label": "1 Aviso", + "markers.panel.multiple.warnings.label": "{0} Avisos", + "markers.panel.single.info.label": "1 Informação", + "markers.panel.multiple.infos.label": "{0} Informações", + "markers.panel.single.unknown.label": "1 Desconhecido", + "markers.panel.multiple.unknowns.label": "{0} Desconhecidos", + "markers.panel.at.ln.col.number": "({0}, {1})", + "problems.tree.aria.label.resource": "{0} com {1} problemas", + "problems.tree.aria.label.error.marker": "Erro gerado por {0}: {1} na linha {2} e caractere {3}", + "problems.tree.aria.label.error.marker.nosource": "Erro: {0} na linha {1} e caractere {2}", + "problems.tree.aria.label.warning.marker": "Aviso gerado por {0}: {1} na linha {2} e caractere {3}", + "problems.tree.aria.label.warning.marker.nosource": "Aviso: {0} na linha {1} e caractere {2}", + "problems.tree.aria.label.info.marker": "Informação gerada por {0}: {1} na linha {2} e caractere {3}", + "problems.tree.aria.label.info.marker.nosource": "Informação: {0} na linha {1} e caractere {2}", + "problems.tree.aria.label.marker": "Problema gerado por {0}: {1} na linha {2} e caractere {3}", + "problems.tree.aria.label.marker.nosource": "Problema: {0} na linha {1} e caractere {2}", + "errors.warnings.show.label": "Mostrar Erros e Avisos" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/markers/electron-browser/markersElectronContributions.i18n.json b/i18n/ptb/src/vs/workbench/parts/markers/electron-browser/markersElectronContributions.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..027c80cca307bc1f954e094b0c2430da0b50a2bf --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/markers/electron-browser/markersElectronContributions.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "copyMarker": "Copiar" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/nps/electron-browser/nps.contribution.i18n.json b/i18n/ptb/src/vs/workbench/parts/nps/electron-browser/nps.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..1ec18c632a4c66727d7a16b41d91633e9d52a1da --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/nps/electron-browser/nps.contribution.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "surveyQuestion": "Você deseja responder a uma pequena pesquisa?", + "takeSurvey": "Responder a pesquisa", + "remindLater": "Lembrar mais tarde", + "neverAgain": "Não mostrar novamente" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/output/browser/output.contribution.i18n.json b/i18n/ptb/src/vs/workbench/parts/output/browser/output.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..e36bdadf4e9c83ef10d239cd750fddbe392cdcdb --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/output/browser/output.contribution.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "output": "Saída", + "viewCategory": "Exibir", + "clearOutput.label": "Limpar saída" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/output/browser/outputActions.i18n.json b/i18n/ptb/src/vs/workbench/parts/output/browser/outputActions.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..00bca0dc3098c8856b1c3262e41aeed82003e7dd --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/output/browser/outputActions.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "toggleOutput": "Alternar Saída", + "clearOutput": "Limpar saída", + "toggleOutputScrollLock": "Alternar Scroll Lock de Saída", + "switchToOutput.label": "Mudar para Saída" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/output/browser/outputPanel.i18n.json b/i18n/ptb/src/vs/workbench/parts/output/browser/outputPanel.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..ec28fd7b2a324703cbbcb0f8ba3c28d205fff32a --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/output/browser/outputPanel.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "outputPanelWithInputAriaLabel": "{0}, Painel de saída", + "outputPanelAriaLabel": "Painel de saída" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/output/common/output.i18n.json b/i18n/ptb/src/vs/workbench/parts/output/common/output.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..a083a6e7d9d2173cff3a80c55593113dcc88a168 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/output/common/output.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "output": "Saída", + "channel": "para '{0}'" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json b/i18n/ptb/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..5fda62eb168cffd9c0d9f0051ce318883914b6cc --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "slow": "Inicialização lenta detectada", + "slow.detail": "Pena que você teve uma inicialização lenta. Por favor reinicie '{0}' com perfil de desempenho habilitado, compartilhe os perfis conosco e nós trabalharemos duro para fazer com que a inicialização fique perfeita novamente.", + "prof.message": "Perfis criados com sucesso.", + "prof.detail": "Por favor, crie um problema e anexe manualmente os seguintes arquivos:\n{0}", + "prof.restartAndFileIssue": "Criar Problema e Reiniciar", + "prof.restart": "Reiniciar", + "prof.thanks": "Obrigado por nos ajudar.", + "prof.detail.restart": "É necessário um reinício final para continuar a usar '{0}'. Novamente, obrigado pela sua contribuição." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/preferences/browser/keybindingWidgets.i18n.json b/i18n/ptb/src/vs/workbench/parts/preferences/browser/keybindingWidgets.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..279307d4b875619d62ef8b120aeac6866d170ca1 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/preferences/browser/keybindingWidgets.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "defineKeybinding.initial": "Pressionar a combinação de teclas desejada e ENTER. ESCAPE para cancelar.", + "defineKeybinding.chordsTo": "Acorde para" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/preferences/browser/keybindingsEditor.i18n.json b/i18n/ptb/src/vs/workbench/parts/preferences/browser/keybindingsEditor.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..1cb6541687c6c0c9190041dd7787db7cf246d43e --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/preferences/browser/keybindingsEditor.i18n.json @@ -0,0 +1,35 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "keybindingsInputName": "Atalhos de Teclado", + "SearchKeybindings.AriaLabel": "Pesquisar keybindings", + "SearchKeybindings.Placeholder": "Pesquisar keybindings", + "sortByPrecedene": "Ordenar por precedência", + "header-message": "Para personalizações avançadas abrir e editar", + "keybindings-file-name": "keybindings.json", + "keybindingsLabel": "Keybindings", + "changeLabel": "Alterar Keybinding", + "addLabel": "Adicionar Keybinding", + "removeLabel": "Remover Keybinding", + "resetLabel": "Redefinir Keybinding", + "showConflictsLabel": "Mostrar Conflitos", + "copyLabel": "Copiar", + "error": "Erro '{0}' enquanto edita keybinding. Por favor, abra o arquivo 'keybindings.json' e verifique.", + "command": "Comando", + "keybinding": "KeyBinding", + "source": "Fonte", + "when": "Quando", + "editKeybindingLabelWithKey": "Alterar Keybinding {0}", + "editKeybindingLabel": "Alterar Keybinding", + "addKeybindingLabelWithKey": "Adicionar Keybinding {0}", + "addKeybindingLabel": "Adicionar Keybinding", + "commandAriaLabel": "Comando é {0}.", + "keybindingAriaLabel": "KeyBinding é {0}.", + "noKeybinding": "Nenhum Keybinding atribuído.", + "sourceAriaLabel": "Fonte é {0}.", + "whenAriaLabel": "Quando é {0}.", + "noWhen": "Sem contexto Quando." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/preferences/browser/keybindingsEditorContribution.i18n.json b/i18n/ptb/src/vs/workbench/parts/preferences/browser/keybindingsEditorContribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..612db32643fd0c0040d698e7f1cd44df364f8658 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/preferences/browser/keybindingsEditorContribution.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "defineKeybinding.start": "Definir Keybinding", + "defineKeybinding.kbLayoutErrorMessage": "Você não será capaz de produzir esta combinação de teclas sob seu layout de teclado atual.", + "defineKeybinding.kbLayoutLocalAndUSMessage": "**{0}** para o seu layout de teclado atual (**{1}** para US padrão).", + "defineKeybinding.kbLayoutLocalMessage": "**{0}** para o seu layout de teclado atual." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/preferences/browser/preferences.contribution.i18n.json b/i18n/ptb/src/vs/workbench/parts/preferences/browser/preferences.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..40e6d0841da3441ca5c5f4d1ebb09914e64828a7 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/preferences/browser/preferences.contribution.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "defaultPreferencesEditor": "Editor de Preferências Padrão", + "keybindingsEditor": "Editor de Keybindings", + "preferences": "Preferências" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/preferences/browser/preferencesActions.i18n.json b/i18n/ptb/src/vs/workbench/parts/preferences/browser/preferencesActions.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..461e0fb96f78f105bfd61efa4e886b820f51b75a --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/preferences/browser/preferencesActions.i18n.json @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "openGlobalSettings": "Abra as Configurações de Usuário", + "openGlobalKeybindings": "Abrir Atalhos de Teclado", + "openGlobalKeybindingsFile": "Abrir Arquivo de Atalhos de Teclado", + "openWorkspaceSettings": "Abrir as configurações do espaço de trabalho", + "configureLanguageBasedSettings": "Definir Configurações Específicas de Linguagem...", + "languageDescriptionConfigured": "({0})", + "pickLanguage": "Selecionar Linguagem" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/preferences/browser/preferencesEditor.i18n.json b/i18n/ptb/src/vs/workbench/parts/preferences/browser/preferencesEditor.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..e3ef1e68a738f40d623d310d7845b917822ce9db --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/preferences/browser/preferencesEditor.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "settingsEditorName": "Configurações Padrão", + "SearchSettingsWidget.AriaLabel": "Configurações de Pesquisa", + "SearchSettingsWidget.Placeholder": "Configurações de Pesquisa", + "totalSettingsMessage": "Total {0} Configurações", + "noSettingsFound": "Nenhum resultado", + "oneSettingFound": "1 Configuração correspondente", + "settingsFound": "{0} Configurações correspondentes", + "preferencesAriaLabel": "Preferências padrão. Editor de texto somente leitura." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/preferences/browser/preferencesRenderers.i18n.json b/i18n/ptb/src/vs/workbench/parts/preferences/browser/preferencesRenderers.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..e35427eb2dfa1d40de4c6ddf02e79c9c5fe354c8 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/preferences/browser/preferencesRenderers.i18n.json @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "errorInvalidConfiguration": "Não é possível gravar em configurações. Corrija erros/avisos no arquivo e tente novamente.", + "editTtile": "Editar", + "replaceDefaultValue": "Substituir nas Configurações", + "copyDefaultValue": "Copiar para Configurações", + "unsupportedPHPExecutablePathSetting": "Essa configuração deve ser uma Configuração de Usuário. Para configurar o PHP para o espaço de trabalho, abra um arquivo PHP e clique em 'Caminho do PHP' na barra de status.", + "unsupportedWorkspaceSetting": "Essa configuração deve ser uma Configuração de Usuário." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/preferences/browser/preferencesService.i18n.json b/i18n/ptb/src/vs/workbench/parts/preferences/browser/preferencesService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..3d94af6361561d08d49af15c9f15cb796718fed7 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/preferences/browser/preferencesService.i18n.json @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "openFolderFirst": "Abrir uma pasta primeiro para criar configurações de espaço de trabalho", + "emptyKeybindingsHeader": "Coloque suas chaves de ligações neste arquivo para substituir os padrões", + "defaultKeybindings": "Keybindings Padrão", + "emptySettingsHeader": "Colocar suas configurações nesse arquivo para sobrecrever as configurações padrão", + "emptySettingsHeader1": "Colocar as suas configurações nesse arquivo para sobrescrever as configurações e usuário padrão.", + "fail.createSettings": "Não foi possível criar '{0}' ({1})." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/preferences/browser/preferencesWidgets.i18n.json b/i18n/ptb/src/vs/workbench/parts/preferences/browser/preferencesWidgets.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..556ef65c079dd4c794cd704f3175dfbb08cc40e5 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/preferences/browser/preferencesWidgets.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "settingsSwitcherBarAriaLabel": "Chave de Configurações", + "userSettings": "Configurações de Usuário", + "workspaceSettings": "Configurações de Espaço de Trabalho" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/preferences/common/keybindingsEditorModel.i18n.json b/i18n/ptb/src/vs/workbench/parts/preferences/common/keybindingsEditorModel.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..68e05e00daf4d94125de078f2318d254c1317fb7 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/preferences/common/keybindingsEditorModel.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "default": "Valor padrão", + "user": "Usuário", + "meta": "meta", + "option": "opção" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/preferences/common/preferencesModels.i18n.json b/i18n/ptb/src/vs/workbench/parts/preferences/common/preferencesModels.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..6427118b75bed8db6da9c928ecfb45ebc090726a --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/preferences/common/preferencesModels.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "commonlyUsed": "Comumente Utilizado", + "defaultKeybindingsHeader": "Substituir as chaves de ligações, colocando-os em seu arquivo de chave ligações." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/quickopen/browser/commandsHandler.i18n.json b/i18n/ptb/src/vs/workbench/parts/quickopen/browser/commandsHandler.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..b6d5cdbd2e5275c658166678c03f539623aa065c --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/quickopen/browser/commandsHandler.i18n.json @@ -0,0 +1,19 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "showTriggerActions": "Mostrar todos os comandos", + "clearCommandHistory": "Limpar o Histórico de Comandos", + "showCommands.label": "Paleta de comandos...", + "entryAriaLabelWithKey": "{0}, {1}, comandos", + "entryAriaLabel": "{0}, comandos", + "canNotRun": "O comando '{0}' não pode ser executado a partir daqui.", + "actionNotEnabled": "O comando '{0}' não está habilitado no contexto atual.", + "recentlyUsed": "usados recentemente", + "morecCommands": "outros comandos", + "commandLabel": "{0}: {1}", + "cat.title": "{0}: {1}", + "noCommandsMatching": "Não há comandos correspondentes" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/quickopen/browser/gotoLineHandler.i18n.json b/i18n/ptb/src/vs/workbench/parts/quickopen/browser/gotoLineHandler.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..3f922e6decaa04da459b2ed12a32264808709259 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/quickopen/browser/gotoLineHandler.i18n.json @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "gotoLine": "Ir para linha...", + "gotoLineLabelEmptyWithLimit": "Digite um número de linha entre 1 e {0} para navegar para lá", + "gotoLineLabelEmpty": "Digite um número de linha para navegar para lá", + "gotoLineColumnLabel": "Ir para linha {0} e caractere {1}", + "gotoLineLabel": "Ir para linha {0}", + "gotoLineHandlerAriaLabel": "Digite um número de linha para navegar.", + "cannotRunGotoLine": "Abrir um arquivo de texto primeiro para ir a uma linha" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/quickopen/browser/gotoSymbolHandler.i18n.json b/i18n/ptb/src/vs/workbench/parts/quickopen/browser/gotoSymbolHandler.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..5e56bdc5890f91e497db6356fd8440971f67247a --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/quickopen/browser/gotoSymbolHandler.i18n.json @@ -0,0 +1,34 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "gotoSymbol": "Ir para o Símbolo no Arquivo...", + "symbols": "símbolos ({0})", + "method": "métodos ({0})", + "function": "funções ({0})", + "_constructor": "construtores ({0})", + "variable": "variáveis ({0})", + "class": "classes ({0})", + "interface": "interfaces ({0})", + "namespace": "namespaces ({0})", + "package": "pacotes ({0})", + "modules": "módulos ({0})", + "property": "propriedades ({0})", + "enum": "enumerações ({0})", + "string": "cadeias de caracteres ({0})", + "rule": "regras ({0})", + "file": "arquivos ({0})", + "array": "matrizes ({0})", + "number": "números ({0})", + "boolean": "booleanos ({0})", + "object": "objetos ({0})", + "key": "chaves ({0})", + "entryAriaLabel": "{0}, símbolos", + "noSymbolsMatching": "Não há símbolos correspondentes", + "noSymbolsFound": "Nenhum símbolo encontrado", + "gotoSymbolHandlerAriaLabel": "Tipo para reduzir os símbolos do editor ativo atual.", + "cannotRunGotoSymbolInFile": "Não há informações de símbolo para o arquivo", + "cannotRunGotoSymbol": "Abrir um arquivo de texto primeiro para ir a um símbolo" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/quickopen/browser/helpHandler.i18n.json b/i18n/ptb/src/vs/workbench/parts/quickopen/browser/helpHandler.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..0a2fc637f737a1d342bdadb0cfded725d52bc1c9 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/quickopen/browser/helpHandler.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "entryAriaLabel": "{0}, ajuda do seletor", + "globalCommands": "comandos globais", + "editorCommands": "comandos do editor" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/quickopen/browser/quickopen.contribution.i18n.json b/i18n/ptb/src/vs/workbench/parts/quickopen/browser/quickopen.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..e3c6204b6055ca1ee0992fc51f9530523757334c --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/quickopen/browser/quickopen.contribution.i18n.json @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "commandsHandlerDescriptionDefault": "Exibir e executar comandos", + "gotoLineDescriptionMac": "Ir para linha", + "gotoLineDescriptionWin": "Ir para linha", + "gotoSymbolDescription": "Ir para o Símbolo no Arquivo", + "gotoSymbolDescriptionScoped": "Ir para o Símbolo no Arquivo Por Categoria", + "helpDescription": "Mostrar ajuda", + "viewPickerDescription": "Abrir Visualização" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/quickopen/browser/viewPickerHandler.i18n.json b/i18n/ptb/src/vs/workbench/parts/quickopen/browser/viewPickerHandler.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..388043547948b9e10c87c8f79554bd01ff1dc390 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/quickopen/browser/viewPickerHandler.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "entryAriaLabel": "{0}, visualizar seletor", + "views": "Modos de exibição", + "panels": "Painéis", + "terminals": "Terminal", + "terminalTitle": "{0}: {1}", + "channels": "Saída", + "openView": "Abrir Visualização", + "quickOpenView": "Abrir Visualização Rápida" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.i18n.json b/i18n/ptb/src/vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..f7269eb27eb08144826e19a06575dc81b6dd442c --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "relaunchMessage": "Uma configuração que requer uma reinicialização foi alterada.", + "relaunchDetail": "Pressione o botão de reinicialização para reiniciar {0} e habilitar a configuração.", + "restart": "Reiniciar" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.i18n.json b/i18n/ptb/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..1cb8d16e56630516183e70df2c1e4f5186628f6e --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "editorGutterModifiedBackground": "Cor de fundo da dobra do editor para as linhas que estão modificadas.", + "editorGutterAddedBackground": "Cor de fundo da dobra do editor para as linhas que estão adicionadas.", + "editorGutterDeletedBackground": "Cor de fundo da dobra do editor para as linhas que estão excluídas." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/scm/electron-browser/scm.contribution.i18n.json b/i18n/ptb/src/vs/workbench/parts/scm/electron-browser/scm.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..1b5369ebeea17dc7f726d852b47c6e9a348ee9f5 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/scm/electron-browser/scm.contribution.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "toggleGitViewlet": "Mostrar Git", + "installAdditionalSCMProviders": "Instalar provedores de SCM adicionais...", + "source control": "Controle de código-fonte", + "toggleSCMViewlet": "Mostrar SCM", + "view": "Exibir" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/scm/electron-browser/scmActivity.i18n.json b/i18n/ptb/src/vs/workbench/parts/scm/electron-browser/scmActivity.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..7846e2b872dcc39127e61520ec243681f3b41222 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/scm/electron-browser/scmActivity.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "scmPendingChangesBadge": "{0} alterações pendentes" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/scm/electron-browser/scmMenus.i18n.json b/i18n/ptb/src/vs/workbench/parts/scm/electron-browser/scmMenus.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..5b93869e8d8f4d4e3b965b2f5cfbe0dc52174051 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/scm/electron-browser/scmMenus.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "installAdditionalSCMProviders": "Instalar provedores de SCM adicionais...", + "switch provider": "Mudar Provedor SCM..." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/scm/electron-browser/scmViewlet.i18n.json b/i18n/ptb/src/vs/workbench/parts/scm/electron-browser/scmViewlet.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..c14da8019782da84ab3799eb67145541a4fd6074 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/scm/electron-browser/scmViewlet.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "commitMessage": "Mensagem (tecle {0} para confirmar)", + "source control": "Controle de código-fonte", + "viewletTitle": "{0}: {1}" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/search/browser/openAnythingHandler.i18n.json b/i18n/ptb/src/vs/workbench/parts/search/browser/openAnythingHandler.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..8d52351151529adac28f3101d7690fc2770cf95f --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/search/browser/openAnythingHandler.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "fileAndTypeResults": "resultados do arquivo e símbolo", + "fileResults": "resultados do arquivo" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/search/browser/openFileHandler.i18n.json b/i18n/ptb/src/vs/workbench/parts/search/browser/openFileHandler.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..016a91f2c3275ae59abacfd0de564a50810e1d05 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/search/browser/openFileHandler.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "entryAriaLabel": "{0}, seletor de arquivo", + "searchResults": "resultados da pesquisa" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/search/browser/openSymbolHandler.i18n.json b/i18n/ptb/src/vs/workbench/parts/search/browser/openSymbolHandler.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..ede0a0c718d4e789010b32c28920cbc61bee2c2d --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/search/browser/openSymbolHandler.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "entryAriaLabel": "{0}, selecionador de símbolos", + "symbols": "resultados de símbolo", + "noSymbolsMatching": "Não há símbolos correspondentes", + "noSymbolsWithoutInput": "Digitar para pesquisar símbolos" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/search/browser/patternInputWidget.i18n.json b/i18n/ptb/src/vs/workbench/parts/search/browser/patternInputWidget.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..68c8c0ad6b7007937b5a7698b854906d9b41d275 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/search/browser/patternInputWidget.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "defaultLabel": "entrada", + "patternDescription": "Use Padrões Glob", + "patternHelpInclude": "O padrão para combinações. Por exemplo, **\\*\\*/*.js** para corresponder a todos os arquivos JavaScript ou **myFolder/\\*\\*** para corresponder a essa pasta com todas pastas aninhadas.\n\n**Referência**:\n**\\*** corresponde a 0 ou mais caracteres\n**?** corresponde a 1 caractere\n**\\*\\*** corresponde a zero ou mais diretórios\n**[a-z]** corresponde a um intervalo de caracteres\n**{a, b}** corresponde a qualquer um dos padrões)", + "useIgnoreFilesDescription": "Usar Ignorar Arquivos", + "useExcludeSettingsDescription": "Usar Configurações de Exclusão" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/search/browser/replaceService.i18n.json b/i18n/ptb/src/vs/workbench/parts/search/browser/replaceService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..05d7f4e4cd00a66a47117251fa01aa60ad8f9c28 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/search/browser/replaceService.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "fileReplaceChanges": "{0} ↔ {1} (Substituir Preview)" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/search/browser/search.contribution.i18n.json b/i18n/ptb/src/vs/workbench/parts/search/browser/search.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..b14e20a1487672fe95bfe2955661138d56371bc7 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/search/browser/search.contribution.i18n.json @@ -0,0 +1,22 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "showTriggerActions": "Ir para Símbolo no Espaço de Trabalho...", + "name": "Pesquisar", + "showSearchViewlet": "Mostrar Busca", + "view": "Exibir", + "findInFiles": "Localizar nos Arquivos", + "openAnythingHandlerDescription": "Ir para o Arquivo", + "openSymbolDescriptionNormal": "Ir para o Símbolo em Área de Trabalho", + "searchOutputChannelTitle": "Pesquisar", + "searchConfigurationTitle": "Pesquisar", + "exclude": "Configure os padrões glob para excluir arquivos e pastas nas pesquisas. Herda todos os padrões glob da configuração files.exclude.", + "exclude.boolean": "O padrão glob com o qual combinar os caminhos de arquivo. Defina para verdadeiro ou falso para habilitar ou desabilitar o padrão.", + "exclude.when": "Verificação adicional nos irmãos de um arquivo correspondente. Use $(basename) como variável para o nome do arquivo correspondente.", + "useRipgrep": "Controla se deve utilizar ripgrep na pesquisa de texto", + "useIgnoreFilesByDefault": "Controla se deve utilizar arquivos .gitignore e .ignore por padrão ao fazer pesquisas em um novo espaço de trabalho.", + "search.quickOpen.includeSymbols": "Configurar para incluir resultados de uma pesquisa símbolo global nos resultados do arquivo para Abertura Rápida." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/search/browser/searchActions.i18n.json b/i18n/ptb/src/vs/workbench/parts/search/browser/searchActions.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..94f7c40e78209817031c2d4705f2e758674b2198 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/search/browser/searchActions.i18n.json @@ -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. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "nextSearchTerm": "Mostrar o Próximo Termo de Pesquisa", + "previousSearchTerm": "Mostrar Termo de Pesquisa Anterior", + "focusNextInputBox": "Focalizar a Próxima Caixa de Entrada", + "focusPreviousInputBox": "Focalizar a Caixa de Entrada Anterior", + "replaceInFiles": "Substituir nos Arquivos", + "findInFolder": "Encontrar na pasta", + "RefreshAction.label": "Atualizar", + "ClearSearchResultsAction.label": "Limpar os Resultados da Pesquisa", + "FocusNextSearchResult.label": "Focalizar o Próximo Resultado da Pesquisa", + "FocusPreviousSearchResult.label": "Focalizar o Resultado da Pesquisa Anterior", + "RemoveAction.label": "Remover", + "file.replaceAll.label": "Substituir Tudo", + "match.replace.label": "Substituir", + "ConfigureGlobalExclusionsAction.label": "Abrir configurações" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json b/i18n/ptb/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..3edda1861fb81acd58f8043c94ab7dada0f43506 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "searchMatches": "{0} correspondências encontradas", + "searchMatch": "{0} correspondência encontrada", + "fileMatchAriaLabel": "{0} correspondências no arquivo {1} da pasta {2}, Resultado da pesquisa", + "replacePreviewResultAria": "Substitua o termo {0} pelo termo {1} na coluna posição {2} correspondente ao texto {3}", + "searchResultAria": "Encontrado o termo {0} na posição da coluna {1} correspondente ao texto {2}" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/search/browser/searchViewlet.i18n.json b/i18n/ptb/src/vs/workbench/parts/search/browser/searchViewlet.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..4ceea6160102502730e22d8fa04ddb232a7882cb --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/search/browser/searchViewlet.i18n.json @@ -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. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "moreSearch": "Alternar Detalhes da Pesquisa", + "searchScope.includes": "arquivos a serem incluídos", + "label.includes": "Pesquisa Padrões de Inclusão", + "searchScope.excludes": "arquivos a serem excluídos", + "label.excludes": "Pesquisa de Padrões de Exclusão", + "global.searchScope.folders": "arquivos excluídos pelas configurações", + "label.global.excludes": "Configurado pesquisa padrões de exclusão", + "replaceAll.confirmation.title": "Substituir Tudo", + "replaceAll.confirm.button": "Substituir", + "replaceAll.occurrence.file.message": "Substituída {0} ocorrência no arquivo {1} com '{2}'.", + "removeAll.occurrence.file.message": "Substituída {0} ocorrência no arquivo {1}'.", + "replaceAll.occurrence.files.message": "Substituída {0} ocorrência no arquivo {1} com '{2}'.", + "removeAll.occurrence.files.message": "Substituída {0} ocorrência nos arquivos {1}", + "replaceAll.occurrences.file.message": "Substituídas {0} ocorrências no arquivo {1} com '{2}'.", + "removeAll.occurrences.file.message": "Substituídas {0} ocorrências nos arquivo {1}.", + "replaceAll.occurrences.files.message": "Substituídas {0} ocorrências nos arquivos {1} com '{2}'.", + "removeAll.occurrences.files.message": "Substituídas {0} ocorrências nos arquivos {1}.", + "removeAll.occurrence.file.confirmation.message": "Substituir {0} ocorrências no arquivo {1} com '{2}'?", + "replaceAll.occurrence.file.confirmation.message": "Substituir {0} ocorrência no arquivo {1}?", + "removeAll.occurrence.files.confirmation.message": "Substituir {0} ocorrência nos arquivos {1} com '{2}'?", + "replaceAll.occurrence.files.confirmation.message": "Substituir {0} ocorrência nos arquivos {1}?", + "removeAll.occurrences.file.confirmation.message": "Substituir {0} ocorrências no arquivo {1} com '{2}'?", + "replaceAll.occurrences.file.confirmation.message": "Substituir {0} ocorrências no arquivo {1}?", + "removeAll.occurrences.files.confirmation.message": "Substituir {0} ocorrências nos arquivos {1} com '{2}'?", + "replaceAll.occurrences.files.confirmation.message": "Substituir {0} ocorrências nos arquivos {1}?", + "treeAriaLabel": "Resultados da Pesquisa", + "globLabel": "{0} quando {1}", + "searchMaxResultsWarning": "O conjunto de resultados contém apenas um subconjunto de todas as correspondências. Seja mais específico na sua pesquisa para diminuir o número de resultados.", + "searchCanceled": "Pesquisa foi cancelada antes de qualquer resultado ser encontrado - ", + "noResultsIncludesExcludes": "Nenhum resultado encontrado em '{0}' excluindo '{1}' - ", + "noResultsIncludes": "Nenhum resultado encontrado em '{0}' -", + "noResultsExcludes": "Nenhum resultado encontrado excluindo '{0}' -", + "noResultsFound": "Nenhum resultado encontrado. Analise as configurações para exclusões configuradas - ", + "rerunSearch.message": "Pesquisar novamente", + "rerunSearchInAll.message": "Pesquisar novamente em todos os arquivos", + "openSettings.message": "Abrir configurações", + "ariaSearchResultsStatus": "Pesquisa retornou {0} resultados em {1} arquivos", + "search.file.result": "{0} resultado no arquivo {1}", + "search.files.result": "{0} resultado nos arquivos {1}", + "search.file.results": "{0} resultados no arquivo {1}", + "search.files.results": "{0} resultados nos arquivos {1}", + "searchWithoutFolder": "Você ainda não abriu uma pasta. Somente arquivos abertos são pesquisados - ", + "openFolder": "Abrir Pasta" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/search/browser/searchWidget.i18n.json b/i18n/ptb/src/vs/workbench/parts/search/browser/searchWidget.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..41178af28cc96d36341eb4e67483127f444f81be --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/search/browser/searchWidget.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "search.action.replaceAll.disabled.label": "Substituir Todos (Submeter Pesquisa para Habilitar)", + "search.action.replaceAll.enabled.label": "Substituir Tudo", + "search.replace.toggle.button.title": "Alternar Substituir", + "label.Search": "Pesquisar: Digite o termo de pesquisa e pressione Enter para pesquisar ou Escape para cancelar", + "search.placeHolder": "Pesquisar", + "label.Replace": "Substituir: Digite o termo a ser substituído e pressione Enter para visualizar ou Escape para cancelar", + "search.replace.placeHolder": "Substituir", + "regexp.validationFailure": "A expressão corresponde a tudo" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/snippets/electron-browser/TMSnippets.i18n.json b/i18n/ptb/src/vs/workbench/parts/snippets/electron-browser/TMSnippets.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..b98cf8d09373551f9d7cbd28774f0e3023b954da --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/snippets/electron-browser/TMSnippets.i18n.json @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "vscode.extension.contributes.snippets": "Contribui aos trechos de código.", + "vscode.extension.contributes.snippets-language": "Identificador de linguagem para o qual este trecho de código contribui.", + "vscode.extension.contributes.snippets-path": "Caminho do arquivo de trechos de código. O caminho é relativo à pasta de extensão e normalmente começa com '. /snippets/'.", + "invalid.language": "Linguagem desconhecida em `contributes.{0}.language`. Valor fornecido: {1}", + "invalid.path.0": "Esperada uma string em `contributes.{0}.path`. Valor informado: {1}", + "invalid.path.1": "É esperado que `contributes.{0}.path` ({1}) seja incluído na pasta da extensão ({2}). Isto pode tornar a extensão não portável.", + "badVariableUse": "O trecho de código \"{0}\" muito provavelmente confunde as variáveis de trecho de código e espaços reservados do trecho de código. Consulte https://code.visualstudio.com/docs/editor/userdefinedsnippets#_snippet-syntax para obter mais detalhes." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/snippets/electron-browser/insertSnippet.i18n.json b/i18n/ptb/src/vs/workbench/parts/snippets/electron-browser/insertSnippet.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..6c34a620b89ab90604bc799d28ffb73a92c39810 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/snippets/electron-browser/insertSnippet.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "snippet.suggestions.label": "Inserir trecho de código" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/snippets/electron-browser/snippets.contribution.i18n.json b/i18n/ptb/src/vs/workbench/parts/snippets/electron-browser/snippets.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..61a063374029bb137555a3941690006d102bf53c --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/snippets/electron-browser/snippets.contribution.i18n.json @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "openSnippet.label": "Abrir trechos de código do usuário", + "openSnippet.pickLanguage": "Selecionar Idioma para o Trecho", + "openSnippet.errorOnCreate": "Não é possível criar {0}", + "preferences": "Preferências", + "snippetSchema.json.default": "Trecho de código vazio", + "snippetSchema.json": "Configuração do trecho do usuário", + "snippetSchema.json.prefix": "O prefixo usado ao selecionar o trecho no intelliSense", + "snippetSchema.json.body": "O conteúdo do trecho. Use '$1', '${1:defaultText}' para definir as posições do cursor, use '$0' para a posição final do cursor. Insira valores de variáveis com '${varName}' e '${varName:defaultText}', por exemplo ' Este é o arquivo: $TM_FILENAME'.", + "snippetSchema.json.description": "A descrição do trecho." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/snippets/electron-browser/snippetsService.i18n.json b/i18n/ptb/src/vs/workbench/parts/snippets/electron-browser/snippetsService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..a4a18c1e970f9c5dd975bff7938f26c209d10575 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/snippets/electron-browser/snippetsService.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "detail.userSnippet": "Trecho de código do usuário", + "snippetSuggest.longLabel": "{0}, {1}" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/snippets/electron-browser/tabCompletion.i18n.json b/i18n/ptb/src/vs/workbench/parts/snippets/electron-browser/tabCompletion.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..adfb9a4190d5c9599aa8175b74b92e01dd5217e9 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/snippets/electron-browser/tabCompletion.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "tabCompletion": "Inserir trechos de código quando seu prefixo corresponder. Funciona melhor quando 'quickSuggestions' não está habilitado." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/surveys/electron-browser/languageSurveys.contribution.i18n.json b/i18n/ptb/src/vs/workbench/parts/surveys/electron-browser/languageSurveys.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..b16fc8446a4522b7a5be898f57feb934afcac967 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/surveys/electron-browser/languageSurveys.contribution.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "helpUs": "Nos ajude a melhorar o nosso apoio para {0}", + "takeShortSurvey": "Responda a uma pesquisa curta", + "remindLater": "Lembrar mais tarde", + "neverAgain": "Não mostrar novamente" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/surveys/electron-browser/nps.contribution.i18n.json b/i18n/ptb/src/vs/workbench/parts/surveys/electron-browser/nps.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..1ec18c632a4c66727d7a16b41d91633e9d52a1da --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/surveys/electron-browser/nps.contribution.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "surveyQuestion": "Você deseja responder a uma pequena pesquisa?", + "takeSurvey": "Responder a pesquisa", + "remindLater": "Lembrar mais tarde", + "neverAgain": "Não mostrar novamente" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/tasks/browser/buildQuickOpen.i18n.json b/i18n/ptb/src/vs/workbench/parts/tasks/browser/buildQuickOpen.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..ccd588d45278229588b08a1988da08e5258a56a8 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/tasks/browser/buildQuickOpen.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "tasksAriaLabel": "Digite o nome de uma tarefa de compilação", + "noTasksMatching": "Não há tarefas correspondentes", + "noTasksFound": "Tarefas de compilação não encontradas" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/tasks/browser/quickOpen.i18n.json b/i18n/ptb/src/vs/workbench/parts/tasks/browser/quickOpen.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..85a8f22ab41f4b3e36bd56d4194c2af7914726e4 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/tasks/browser/quickOpen.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "entryAriaLabel": "{0}, tarefas", + "customizeTask": "Personalizar Tarefa" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/tasks/browser/restartQuickOpen.i18n.json b/i18n/ptb/src/vs/workbench/parts/tasks/browser/restartQuickOpen.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..4009d3b81541622f52516f49a6af42be1d17d6a2 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/tasks/browser/restartQuickOpen.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "tasksAriaLabel": "Digite o nome de uma tarefa para reiniciar", + "noTasksMatching": "Não há tarefas correspondentes", + "noTasksFound": "Não há tarefa para ser reiniciada" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/tasks/browser/taskQuickOpen.i18n.json b/i18n/ptb/src/vs/workbench/parts/tasks/browser/taskQuickOpen.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..6b4d6134384d891006de02318050a7b32f7416af --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/tasks/browser/taskQuickOpen.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "tasksAriaLabel": "Digite o nome de uma tarefa para executar", + "noTasksMatching": "Não há tarefas correspondentes", + "noTasksFound": "Não há tarefas encontradas" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/tasks/browser/terminateQuickOpen.i18n.json b/i18n/ptb/src/vs/workbench/parts/tasks/browser/terminateQuickOpen.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..9c5ee4b4b598deb7b9706166f8ea3f062057db6e --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/tasks/browser/terminateQuickOpen.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "tasksAriaLabel": "Digite o nome de uma tarefa para finalizar", + "noTasksMatching": "Não há tarefas correspondentes", + "noTasksFound": "Nenhuma tarefa para finalizar encontrada" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/tasks/browser/testQuickOpen.i18n.json b/i18n/ptb/src/vs/workbench/parts/tasks/browser/testQuickOpen.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..07d53a8ee395700a1722b8b51a40829f102fae10 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/tasks/browser/testQuickOpen.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "tasksAriaLabel": "Digite o nome de uma tarefa de teste", + "noTasksMatching": "Não há tarefas correspondentes", + "noTasksFound": "Tarefas de teste não encontradas" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/tasks/common/taskConfiguration.i18n.json b/i18n/ptb/src/vs/workbench/parts/tasks/common/taskConfiguration.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..928e36c4c9b6a2a04b97b3307a97a3bf84fc007c --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/tasks/common/taskConfiguration.i18n.json @@ -0,0 +1,17 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "ConfigurationParser.invalidCWD": "Aviso: options.cwd deve ser do tipo string. Ignorando valor {0}\n", + "ConfigurationParser.noargs": "Erro: Argumentos do comando devem ser uma matriz de strings. Valor informado é:\n{0}", + "ConfigurationParser.noShell": "Aviso: A configuração do shell somente é suportada quando estiver executando tarefas no terminal.", + "ConfigurationParser.noName": "Erro: Problem Matcher no escopo declarado deve ter um nome:\n{0}\n", + "ConfigurationParser.unknownMatcherKind": "Aviso: a correspondência de problema definido é desconhecido. Tipos suportados são string | ProblemMatcher | (string | ProblemMatcher)[].\n{0}\n", + "ConfigurationParser.invalidVaraibleReference": "Erro: ProblemMatcher inválido referência: {0}\n", + "ConfigurationParser.noTaskName": "Erro: tarefas devem fornecer uma propriedade taskName. A tarefa será ignorada.\n{0}\n", + "taskConfiguration.shellArgs": "Aviso: a tarefa '{0}' é um comando do shell e o nome de comando ou um dos seus argumentos tem espaços sem escape. Para garantir a linha de comando correta por favor mesclar argumentos no comando.", + "taskConfiguration.noCommandOrDependsOn": "Erro: a tarefa '{0}' não especifica nem um comando nem uma propriedade dependsOn. A tarefa será ignorada. Sua definição é: \n{1}", + "taskConfiguration.noCommand": "Erro: a tarefa '{0}' não define um comando. A tarefa será ignorada. Sua definição é: {1}" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/tasks/common/taskTemplates.i18n.json b/i18n/ptb/src/vs/workbench/parts/tasks/common/taskTemplates.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..268871153e335f04db01be5057cf537b922d1245 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/tasks/common/taskTemplates.i18n.json @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "tsc.config": "Compila um projeto TypeScript", + "tsc.watch": "Compila um projeto TypeScript em mode de monitoramento", + "dotnetCore": "Executa comando de compilação do .NET Core", + "msbuild": "Executa a compilação destino", + "externalCommand": "Exemplo para executar um comando externo arbitrário", + "Maven": "Executa comandos comuns específicos" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/tasks/electron-browser/jsonSchemaCommon.i18n.json b/i18n/ptb/src/vs/workbench/parts/tasks/electron-browser/jsonSchemaCommon.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..4980a7daaa5dce20a5ba11145dfb22ec60343540 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/tasks/electron-browser/jsonSchemaCommon.i18n.json @@ -0,0 +1,39 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "JsonSchema.options": "Opções de comando adicionais", + "JsonSchema.options.cwd": "O diretório de trabalho atual do programa executado ou do script. Se omitido raiz de espaço de trabalho atual do código é usado.", + "JsonSchema.options.env": "O ambiente do programa executado ou comando shell. Se omitido o ambiente do processo pai é usado.", + "JsonSchema.shellConfiguration": "Configura a shell a ser usada.", + "JsonSchema.shell.executable": "O shell a ser usado.", + "JsonSchema.shell.args": "Os argumentos shell.", + "JsonSchema.command": "O comando a ser executado. Pode ser um programa externo ou um comando shell.", + "JsonSchema.tasks.args": "Argumentos passados para o comando quando esta tarefa é invocada.", + "JsonSchema.tasks.taskName": "Nome da tarefa", + "JsonSchema.tasks.windows": "Configuração de comando específica do Windows", + "JsonSchema.tasks.mac": "Configuração de comando específica do Mac", + "JsonSchema.tasks.linux": "Configuração de comando específica do Linux", + "JsonSchema.tasks.suppressTaskName": "Controla se o nome de tarefa é adicionado como um argumento para o comando. Se omitido o valor definido globalmente é usado.", + "JsonSchema.tasks.showOutput": "Controla se a saída da execução de tarefas é mostrada ou não. Se omitido o valor definido globalmente é usado.", + "JsonSchema.echoCommand": "Controla se o comando executado é enviado para a saída. O padrão é false.", + "JsonSchema.tasks.watching.deprecation": "Descontinuado. Use isBackground.", + "JsonSchema.tasks.watching": "Se a tarefa executada é mantida viva e está monitorando o sistema de arquivos.", + "JsonSchema.tasks.background": "Se a tarefa executada é mantida viva e é executado em segundo plano.", + "JsonSchema.tasks.promptOnClose": "Se o usuário é solicitado quando VS Code fecha com uma tarefa sendo executada.", + "JsonSchema.tasks.build": "Esta tarefa é mapeada para o comando de compilação padrão do código.", + "JsonSchema.tasks.test": "Esta tarefa é mapeada para o comando de teste padrão do código.", + "JsonSchema.tasks.matchers": "O problema matcher(s) a seu utilizado. Pode ser uma sequência de caracteres ou uma definição de problem matcher ou uma matriz de sequências de caracteres e problem matchers.", + "JsonSchema.args": "Argumentos adicionais passados para o comando.", + "JsonSchema.showOutput": "Controla se a saída da execução de tarefas é mostrada ou não. Se omitido 'sempre' é usado.", + "JsonSchema.watching.deprecation": "Descontinuado. Use isBackground.", + "JsonSchema.watching": "Se a tarefa executada é mantida viva e está monitorando o sistema de arquivos.", + "JsonSchema.background": "Se a tarefa executada é mantida viva e é executado em segundo plano.", + "JsonSchema.promptOnClose": "Se o usuário é solicitado quando VS Code fecha com uma tarefa de segundo plano em execução.", + "JsonSchema.suppressTaskName": "Controla se o nome de tarefa é adicionado como um argumento para o comando. O padrão é false.", + "JsonSchema.taskSelector": "Prefixo para indicar que um argumento é tarefa.", + "JsonSchema.matchers": "A correspondência de problemas a ser utilizada. Pode ser uma sequência de caracteres ou uma definição de correspondência de problemas ou uma matriz de sequências de caracteres e correspondência de problemas.", + "JsonSchema.tasks": "As configurações de tarefa. Normalmente são ampliações de tarefas já definidas na execução de tarefa externa." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v1.i18n.json b/i18n/ptb/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v1.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..46aad8f97eaf15afa0c676ad57f9d2956b11edc9 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v1.i18n.json @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "JsonSchema.version": "Número da versão do config", + "JsonSchema._runner": "O runner já se formou. Use a propriedade runner oficial", + "JsonSchema.runner": "Define se a tarefa é executada como um processo e a saída é mostrada na janela de saída ou dentro do terminal.", + "JsonSchema.windows": "Configuração de comando específica do Windows", + "JsonSchema.mac": "Configuração de comando específica do Mac", + "JsonSchema.linux": "Configuração de comando específica do Linux", + "JsonSchema.shell": "Especifica se o comando é um comando shell ou um programa externo. O padrão é falso se omitido." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.i18n.json b/i18n/ptb/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..9053b4d29eedb602c985a5126fdfb5bcf4814126 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.i18n.json @@ -0,0 +1,17 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "JsonSchema.shell": "Especifica se o comando é um comando shell ou um programa externo. O padrão é falso se omitido.", + "JsonSchema.tasks.dependsOn.string": "Outra tarefa da qual esta tarefa depende.", + "JsonSchema.tasks.dependsOn.array": "A outra tarefa que esta tarefa depende.", + "JsonSchema.tasks.group": "Define a que grupo de execução desta tarefa pertence. Se omitido a tarefa pertence a nenhum grupo.", + "JsonSchema.tasks.type": "Define se a tarefa é executada como um processo ou como um comando dentro de uma shell. O padrão é processo.", + "JsonSchema.version": "O número da versão do config.", + "JsonSchema.tasks.customize": "A tarefa de contribuição a ser customizada.", + "JsonSchema.windows": "Configuração de comando específica do Windows", + "JsonSchema.mac": "Configuração de comando específica do Mac", + "JsonSchema.linux": "Configuração de comando específica do Linux" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json b/i18n/ptb/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..439c6a386cabc71243859234c2110c00750797f3 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json @@ -0,0 +1,51 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "tasksCategory": "Tarefas", + "ConfigureTaskRunnerAction.noWorkspace": "Tarefas somente estão disponíveis em uma pasta da área de trabalho.", + "ConfigureTaskRunnerAction.quickPick.template": "Selecione um gerenciador de tarefa", + "ConfigureTaskRunnerAction.autoDetecting": "Tarefas de auto detecção para {0}", + "ConfigureTaskRunnerAction.autoDetect": "A tarefa de sistema de auto detecção falhou. Usando o modelo padrão. Consulte a saída da tarefa para detalhes.", + "ConfigureTaskRunnerAction.autoDetectError": "A tarefa de sistema de auto detecção produziu erros. Consulte a saída da tarefa para detalhes.", + "ConfigureTaskRunnerAction.failed": "Não é possível criar o arquivo 'tasks.json' na pasta '.vscode'. Consulte a saída da tarefa para detalhes.", + "ConfigureTaskRunnerAction.label": "Configure o gerenciador de tarefas", + "ConfigureBuildTaskAction.label": "Configurar Tarefa de Compilação", + "CloseMessageAction.label": "Fechar", + "ShowTerminalAction.label": "Terminal Visualização", + "problems": "Problemas", + "manyMarkers": "99+", + "tasks": "Tarefas", + "TaskSystem.noHotSwap": "Alterar o mecanismo de execução de tarefa requer reiniciar o VS Code. A alteração será ignorada.", + "TaskService.noBuildTask": "Nenhuma tarefa de compilação definida. Marque uma tarefa com 'isBuildCommand' no arquivo tasks.json.", + "TaskService.noTestTask": "Nenhuma tarefa de teste definida. Marque uma tarefa com 'isTestCommand' no arquivo tasks.json.", + "TaskServer.noTask": "Tarefa {0} requisitada para execução não encontrada.", + "customizeParseErrors": "A configuração da tarefa atual tem erros. Por favor, corrija os erros primeiro antes de personalizar uma tarefa.", + "moreThanOneBuildTask": "Há muitas tarefas de compilação definidas em tasks.json. Executando a primeira.\n", + "TaskSystem.activeSame.background": "A tarefa já está ativa e em modo background. Para finalizar a tarefa use 'F1 > terminar tarefa'", + "TaskSystem.active": "Já existe uma tarefa sendo executada. Finalize-a antes de executar outra tarefa.", + "TaskSystem.restartFailed": "Falha ao finalizar e reiniciar a tarefa {0}", + "TaskSystem.configurationErrors": "Erro: A configuração da tarefa informada possui erros de validação e não pode ser utilizada. Por favor, corrija os erros primeiro.", + "TaskSystem.invalidTaskJson": "Erro: O conteúdo do arquivo tasks.json possui erros de sintaxe. Por favor, corrija-os antes de executar uma tarefa.\n", + "TaskSystem.runningTask": "Há uma tarefa sendo executada. Deseja finalizá-la?", + "TaskSystem.terminateTask": "&&Finalizar Tarefa", + "TaskSystem.noProcess": "A tarefa executada não existe mais. Se a tarefa produziu processos em background, finalizar o VS Code pode resultar em processos órfãos. Para evitar isso inicie o último processo em background com uma flag de espera.", + "TaskSystem.exitAnyways": "&&Sair de qualquer maneira", + "TerminateAction.label": "Finalizar a tarefa sendo executada", + "TaskSystem.unknownError": "Ocorreu um erro enquanto a tarefa estava sendo executada. Verifique o log de tarefas para detalhes.", + "TaskService.noWorkspace": "Tarefas somente estão disponíveis em uma pasta da área de trabalho.", + "TerminateAction.noProcess": "O processo executado não existe mais. Se a tarefa produziu processos em background, finalizar o VS Code pode resultar em processos órfãos.", + "TerminateAction.failed": "Falha ao finalizar a tarefa sendo executada", + "ShowLogAction.label": "Visualizar o Log de Tarefas", + "RunTaskAction.label": "Executar Tarefa", + "RestartTaskAction.label": "Reiniciar Tarefa", + "BuildAction.label": "Executar Tarefa de compilação", + "TestAction.label": "Executar Tarefa de Teste", + "quickOpen.task": "Executar Tarefa", + "quickOpen.terminateTask": "Finalizar Tarefa", + "quickOpen.restartTask": "Reiniciar Tarefa", + "quickOpen.buildTask": "Tarefa de Compilação", + "quickOpen.testTask": "Tarefa de Teste" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.i18n.json b/i18n/ptb/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..1421a156ef7f20fec7f878939ac0347d64cc4f4b --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "TerminalTaskSystem.unknownError": "Um erro desconhecido ocorreu durante a execução de uma tarefa. Consulte o log de saída de tarefa para obter detalhes.", + "TerminalTaskSystem.terminalName": "Tarefa - {0}", + "reuseTerminal": "Terminal será reutilizado pelas tarefas, pressione qualquer tecla para fechar.", + "TerminalTaskSystem": "Não é possível executar um comando shell em uma unidade UNC.", + "unkownProblemMatcher": "Problem matcher {0} não pode ser resolvido. O matcher será ignorado" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/tasks/node/processRunnerDetector.i18n.json b/i18n/ptb/src/vs/workbench/parts/tasks/node/processRunnerDetector.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..a4f13c42f7c1c71d49f93df7ab81b4bb29825f95 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/tasks/node/processRunnerDetector.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "TaskSystemDetector.noGulpTasks": "Executando gulp..-tarefas-simples não listam nenhuma tarefa. Você executou a instalação do npm?", + "TaskSystemDetector.noJakeTasks": "Executando jake..-tarefas não listam nenhuma tarefa. Você instalou o npm?", + "TaskSystemDetector.noGulpProgram": "Gulp não está instalado no seu sistema. Execute npm install -g gulp para instalá-lo.", + "TaskSystemDetector.noJakeProgram": "Jake não está instalado no seu sistema. Execute npm install -g jake para instalá-lo.", + "TaskSystemDetector.noGruntProgram": "Grunhido não está instalado no seu sistema. Execute npm install -g grunt para instalá-lo.", + "TaskSystemDetector.noProgram": "Programa {0} não foi encontrado. Mensagem é {1}", + "TaskSystemDetector.buildTaskDetected": "Tarefa de construção chamada '{0}' detectada.", + "TaskSystemDetector.testTaskDetected": "Tarefa de teste chamada '{0}' detectada." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/tasks/node/processTaskSystem.i18n.json b/i18n/ptb/src/vs/workbench/parts/tasks/node/processTaskSystem.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..72848a8cde1f79593ce1b86029ccd72f66920d33 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/tasks/node/processTaskSystem.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "TaskRunnerSystem.unknownError": "Um erro desconhecido ocorreu durante a execução de uma tarefa. Consulte o log de saída de tarefa para obter detalhes.", + "TaskRunnerSystem.watchingBuildTaskFinished": "\nTarefas de compilação de monitoramento terminaram.", + "TaskRunnerSystem.childProcessError": "Falha ao iniciar o programa externo {0} {1}.", + "TaskRunnerSystem.cancelRequested": "\nA tarefa '{0}' foi finalizada por solicitação do usuário.", + "unkownProblemMatcher": "Problema matcher {0} não pode ser resolvido. O matcher será ignorado" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/terminal/electron-browser/terminal.contribution.i18n.json b/i18n/ptb/src/vs/workbench/parts/terminal/electron-browser/terminal.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..de21ec3dca10c595c82c01c5fe534bd366496fd8 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/terminal/electron-browser/terminal.contribution.i18n.json @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "terminalIntegratedConfigurationTitle": "Terminal Integrado", + "terminal.integrated.shell.linux": "O caminho do shell que o terminal usa no Linux.", + "terminal.integrated.shellArgs.linux": "Os argumentos de linha de comando a serem usados no terminal do Linux.", + "terminal.integrated.shell.osx": "O caminho do shell que o terminal usa no OS X.", + "terminal.integrated.shellArgs.osx": "Os argumentos de linha de comando a serem usados no terminal do OS X.", + "terminal.integrated.shell.windows": "O caminho do shell que o terminal usa no Windows. Quando usar um shell fornecido com o Windows (cmd, PowerShell ou Bash no Ubuntu), prefira utilizar C:\\Windows\\sysnative ao invés de C:\\Windows\\System32 para usar as versões de 64 bits.", + "terminal.integrated.shellArgs.windows": "Os argumentos de linha de comando a serem utilizados no terminal do Windows.", + "terminal.integrated.rightClickCopyPaste": "Quando configurado, isto evitará que o menu de contexto apareça quando pressionado o botão direito do mouse dentro do terminal, em vez disso vai copiar quando há uma seleção e colar quando não há nenhuma seleção.", + "terminal.integrated.fontFamily": "Controla a família de fontes do terminal, este padrão é o valor do editor.fontFamily.", + "terminal.integrated.fontLigatures": "Controla se as ligações de fonte são habilitadas no terminal.", + "terminal.integrated.fontSize": "Controla o tamanho da fonte em pixels do terminal.", + "terminal.integrated.lineHeight": "Controles a altura da linha do terminal, este número é multiplicada pelo tamanho da fonte terminal para obter a altura real da linha em pixels.", + "terminal.integrated.enableBold": "Se habilitar o texto em negrito dentro do terminal requer suporte do terminal shell.", + "terminal.integrated.cursorBlinking": "Controla se o cursor do terminal pisca.", + "terminal.integrated.cursorStyle": "Controla o estilo do cursor do terminal.", + "terminal.integrated.scrollback": "Controla a quantidade máxima de linhas que o terminal mantém em seu buffer.", + "terminal.integrated.setLocaleVariables": "Controla se as variáveis locais são definidas na inicialização do terminal, este padrão é verdadeiro no OS X e falso em outras plataformas.", + "terminal.integrated.cwd": "Um caminho de início explícito onde o terminal será lançado, isso é usado como o diretório de trabalho atual (cwd) para o processo shell. Isto pode ser particularmente útil em configurações de espaço de trabalho se o diretório raiz não é um cwd conveniente.", + "terminal.integrated.confirmOnExit": "Confirmar na saída se ainda houverem sessões de terminal ativas.", + "terminal.integrated.commandsToSkipShell": "Um conjunto de IDs de comando, cujas combinações de teclas não serão enviadas para o shell e sempre serão tratadas por código. Isto permite o uso de combinações de teclas que normalmente seriam consumidas pelo shell para agir da mesma forma quando o terminal não é focado, por exemplo ctrl+p para Execução Rápida.", + "terminal": "Terminal", + "terminalCategory": "Terminal", + "viewCategory": "Exibir" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/terminal/electron-browser/terminalActions.i18n.json b/i18n/ptb/src/vs/workbench/parts/terminal/electron-browser/terminalActions.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..ca6ab1cb9d9c5d2c896446a700d11137696d08b1 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/terminal/electron-browser/terminalActions.i18n.json @@ -0,0 +1,37 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "workbench.action.terminal.toggleTerminal": "Alternar Terminal Integrado", + "workbench.action.terminal.kill": "Finalizar a Instância de Terminal Ativa", + "workbench.action.terminal.kill.short": "Encerrar Terminal", + "workbench.action.terminal.copySelection": "Copiar Seleção", + "workbench.action.terminal.selectAll": "Selecionar Tudo", + "workbench.action.terminal.new": "Criar Novo Terminal Integrado", + "workbench.action.terminal.new.short": "Novo Terminal", + "workbench.action.terminal.focus": "Focalizar Terminal", + "workbench.action.terminal.focusNext": "Focalizar Próximo Terminal", + "workbench.action.terminal.focusAtIndex": "Focalizar Terminal {0}", + "workbench.action.terminal.focusPrevious": "Focalizar Terminal Anterior", + "workbench.action.terminal.paste": "Colar no Terminal Ativo", + "workbench.action.terminal.DefaultShell": "Selecionar Shell Padrão", + "workbench.action.terminal.runSelectedText": "Executar Texto Selecionado no Terminal Ativo", + "workbench.action.terminal.runActiveFile": "Executar Arquivo Ativo no Terminal Ativo", + "workbench.action.terminal.runActiveFile.noFile": "Apenas arquivos em disco podem ser executados no terminal", + "workbench.action.terminal.switchTerminalInstance": "Trocar a instância de Terminal", + "workbench.action.terminal.scrollDown": "Rolar para Baixo (Linha)", + "workbench.action.terminal.scrollDownPage": "Rolar para Baixo (Página)", + "workbench.action.terminal.scrollToBottom": "Rolar para baixo", + "workbench.action.terminal.scrollUp": "Rolar para Cima (Linha)", + "workbench.action.terminal.scrollUpPage": "Rolar para Cima (Página)", + "workbench.action.terminal.scrollToTop": "Rolar para cima", + "workbench.action.terminal.clear": "Limpar", + "workbench.action.terminal.allowWorkspaceShell": "Permitir a Configuração de Shell da Área de Trabalho", + "workbench.action.terminal.disallowWorkspaceShell": "Não Permitir a Configuração de Shell da Área de Trabalho", + "workbench.action.terminal.rename": "Renomear", + "workbench.action.terminal.rename.prompt": "Digite o nome do terminal", + "workbench.action.terminal.focusFindWidget": "Focalizar Ferramenta de Pesquisa", + "workbench.action.terminal.hideFindWidget": "Ocultar Ferramenta de Pesquisa" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/terminal/electron-browser/terminalColorRegistry.i18n.json b/i18n/ptb/src/vs/workbench/parts/terminal/electron-browser/terminalColorRegistry.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..495bd79c4bb428f601445b0a17af068640e48544 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/terminal/electron-browser/terminalColorRegistry.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "terminal.background": "A cor de fundo do terminal, isso permite colorir o terminal com uma cor diferente do painel.", + "terminal.foreground": "A cor de primeiro plano do terminal.", + "terminal.ansiColor": "'{0}' cor ansi no terminal." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/terminal/electron-browser/terminalConfigHelper.i18n.json b/i18n/ptb/src/vs/workbench/parts/terminal/electron-browser/terminalConfigHelper.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..b2b9a9a98432614fe2af9ecbeaffbabf7959d312 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/terminal/electron-browser/terminalConfigHelper.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "terminal.integrated.allowWorkspaceShell": "Você permite {0} (definido como uma configuração de espaço de trabalho) a ser executado no terminal?", + "allow": "Permitir", + "disallow": "Não permitir" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/terminal/electron-browser/terminalFindWidget.i18n.json b/i18n/ptb/src/vs/workbench/parts/terminal/electron-browser/terminalFindWidget.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..9172767f77085fcf8c0e822099b5ee2f1a7bf8ac --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/terminal/electron-browser/terminalFindWidget.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "label.find": "Localizar", + "placeholder.find": "Localizar", + "label.previousMatchButton": "Correspondência anterior", + "label.nextMatchButton": "Próxima correspondência", + "label.closeButton": "Fechar" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.i18n.json b/i18n/ptb/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..b530cb53e9b4880ebb428f555d28304e7794274f --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "terminal.integrated.copySelection.noSelection": "O terminal não tem nenhuma seleção para copiar", + "terminal.integrated.exitedWithCode": "O processo terminal encerrado com código de saída: {0}", + "terminal.integrated.waitOnExit": "Pressione qualquer tecla para fechar o terminal", + "terminal.integrated.launchFailed": "O comando de processo de terminal '{0}{1}' falhou ao ser iniciado (código de saída: {2})" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/terminal/electron-browser/terminalLinkHandler.i18n.json b/i18n/ptb/src/vs/workbench/parts/terminal/electron-browser/terminalLinkHandler.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..fd175c5ad29ad79fa6db8aa06056e30e76a055fc --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/terminal/electron-browser/terminalLinkHandler.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "terminalLinkHandler.followLinkCmd": "Cmd + clique para seguir o link", + "terminalLinkHandler.followLinkCtrl": "Ctrl + clique para seguir o link" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/terminal/electron-browser/terminalPanel.i18n.json b/i18n/ptb/src/vs/workbench/parts/terminal/electron-browser/terminalPanel.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..5e811b86100681bf14570d2d8a835bdde442138d --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/terminal/electron-browser/terminalPanel.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "copy": "Copiar", + "createNewTerminal": "Novo Terminal", + "paste": "Colar", + "clear": "Limpar" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/terminal/electron-browser/terminalService.i18n.json b/i18n/ptb/src/vs/workbench/parts/terminal/electron-browser/terminalService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..08ec4bd977709f529fbb4957bf917c8fe31ca995 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/terminal/electron-browser/terminalService.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "terminal.integrated.chooseWindowsShellInfo": "Você pode alterar o terminal shell padrão selecionando o botão Personalizar.", + "customize": "Personalizar", + "cancel": "Cancelar", + "never again": "Ok, Nunca Mostrar Novamente", + "terminal.integrated.chooseWindowsShell": "Selecione o seu terminal shell preferido, você pode alterar isso mais tarde em suas configurações", + "terminalService.terminalCloseConfirmationSingular": "Há uma sessão ativa de terminal, você quer finalizá-la?", + "terminalService.terminalCloseConfirmationPlural": "Existem {0} sessões ativas de terminal, você quer finalizá-las?", + "yes": "Sim" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json b/i18n/ptb/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..9968bf0b9b1e5bea8d6e1c31efb617292b127907 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json @@ -0,0 +1,19 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "selectTheme.label": "Tema de Cores", + "installColorThemes": "Instalar temas de cor adicionais...", + "themes.selectTheme": "Selecione o tema de cor (teclas cima/baixo para visualização)", + "selectIconTheme.label": "Arquivo de Ícone do Tema", + "installIconThemes": "Instalar Temas de Ícones de Arquivos Adicionais...", + "noIconThemeLabel": "Nenhum", + "noIconThemeDesc": "Desabilitar ícones de arquivos", + "problemChangingIconTheme": "Problema configurando tema de ícones: {0}", + "themes.selectIconTheme": "Selecionar Tema de Ícones de Arquivos", + "generateColorTheme.label": "Gerar Tema de Cores a Partir das Configurações Atuais", + "preferences": "Preferências", + "developer": "Desenvolvedor" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/trust/electron-browser/unsupportedWorkspaceSettings.contribution.i18n.json b/i18n/ptb/src/vs/workbench/parts/trust/electron-browser/unsupportedWorkspaceSettings.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..1fc9c8fe3a4cace4509293061648675789b47e3d --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/trust/electron-browser/unsupportedWorkspaceSettings.contribution.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "unsupportedWorkspaceSettings": "Esta área de trabalho contém configurações que só podem ser definidas nas configurações do usuário. ({0})", + "openWorkspaceSettings": "Abrir as configurações do espaço de trabalho", + "openDocumentation": "Saiba Mais", + "ignore": "Ignorar" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/update/electron-browser/releaseNotesInput.i18n.json b/i18n/ptb/src/vs/workbench/parts/update/electron-browser/releaseNotesInput.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..213c54a3d24848af12089962eaae2a079ef8ae5a --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/update/electron-browser/releaseNotesInput.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "releaseNotesInputName": "Notas da Versão: {0}" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/update/electron-browser/update.contribution.i18n.json b/i18n/ptb/src/vs/workbench/parts/update/electron-browser/update.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..3634d3c2f2ab0216106d452d2220f620593498ab --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/update/electron-browser/update.contribution.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "release notes": "Notas da versão", + "updateConfigurationTitle": "Atualizar", + "updateChannel": "Configurar se você recebe atualizações automáticas de um canal de atualização. Requer uma reinicialização depois da mudança." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/update/electron-browser/update.i18n.json b/i18n/ptb/src/vs/workbench/parts/update/electron-browser/update.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..083249ec7d84958c981917a4dc3c6c858a2b9971 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/update/electron-browser/update.i18n.json @@ -0,0 +1,32 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "updateNow": "Atualizar Agora", + "later": "Mais tarde", + "unassigned": "Não atribuído", + "releaseNotes": "Notas da Versão", + "showReleaseNotes": "Mostrar Notas da Versão", + "downloadNow": "Baixar agora", + "read the release notes": "Bem-vindo a {0} v{1}! Gostaria de ler as Notas da Versão?", + "licenseChanged": "Nossos termos de licença mudaram, favor revisá-los.", + "license": "Ler Licença", + "updateAvailable": "{0} será atualizado após reiniciar.", + "thereIsUpdateAvailable": "Há uma atualização disponível.", + "noUpdatesAvailable": "Não há nenhuma atualização disponível.", + "updateIsReady": "Nova atualização disponível.", + "commandPalette": "Paleta de comandos...", + "settings": "Configurações", + "keyboardShortcuts": "Atalhos de Teclado", + "selectTheme.label": "Tema de Cores", + "themes.selectIconTheme.label": "Arquivo de Ícone do Tema", + "not available": "Atualizações Indisponíveis", + "checkingForUpdates": "Verificando Atualizações...", + "DownloadUpdate": "Baixar Atualização Disponível", + "DownloadingUpdate": "Baixando Atualização...", + "InstallingUpdate": "Instalando Atualização...", + "restartToUpdate": "Reinicie para Atualizar...", + "checkForUpdates": "Verificar atualizações..." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/views/browser/views.i18n.json b/i18n/ptb/src/vs/workbench/parts/views/browser/views.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..32207b28d401da42c6f5a62c3baee78284917577 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/views/browser/views.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "viewToolbarAriaLabel": "{0} ações " +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/views/browser/viewsExtensionPoint.i18n.json b/i18n/ptb/src/vs/workbench/parts/views/browser/viewsExtensionPoint.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..5128faaa5e4c7d6b6d5f8abe3b1dfb9e353a2288 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/views/browser/viewsExtensionPoint.i18n.json @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "requirearray": "visualizações devem ser uma matriz", + "requirestring": "a propriedade `{0}` é obrigatória e deve ser do tipo `string`", + "optstring": "a propriedade `{0}` é opcional ou deve ser do tipo `string`", + "vscode.extension.contributes.view.id": "Identificador da visualiozação. Use isto para registrar um provedor de dados através de 'vscode.window.registerTreeDataProviderForView' API. Também para acionar ativando sua extensão registrando o evento 'onView: ${id}' para 'activationEvents'.", + "vscode.extension.contributes.view.name": "O nome legível da visualização. Será mostrado", + "vscode.extension.contributes.view.when": "Condição que deve ser verdadeira para mostrar esta visualização", + "vscode.extension.contributes.views": "Contribui visualizações ao editor", + "views.explorer": "Visualização do explorador", + "locationId.invalid": "'{0}' não é um local válido de visualização" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/watermark/electron-browser/watermark.i18n.json b/i18n/ptb/src/vs/workbench/parts/watermark/electron-browser/watermark.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..dea49eef8d5127be286cd6db9d8bbfe6ffc4eca3 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/watermark/electron-browser/watermark.i18n.json @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "watermark.showCommands": "Mostrar todos os comandos", + "watermark.quickOpen": "Ir para o Arquivo", + "watermark.openFile": "Abrir Arquivo", + "watermark.openFolder": "Abrir Pasta", + "watermark.openFileFolder": "Abrir Arquivo ou Pasta", + "watermark.openRecent": "Abrir Recente", + "watermark.newUntitledFile": "Novo Arquivo Sem Título", + "watermark.toggleTerminal": "Alternar Terminal", + "watermark.findInFiles": "Localizar nos Arquivos", + "watermark.startDebugging": "Iniciar Depuração", + "watermark.selectTheme": "Mudar Tema", + "watermark.selectKeymap": "Mudar Mapa de Teclas", + "watermark.keybindingsReference": "Referência de Teclado", + "watermark.openGlobalKeybindings": "Atalhos de Teclado", + "watermark.unboundCommand": "não vinculado", + "workbenchConfigurationTitle": "Área de Trabalho", + "tips.enabled": "Quando habilitado, mostrará as dicas de marca d'água quando nenhum editor estiver aberto." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/welcome/overlay/browser/welcomeOverlay.i18n.json b/i18n/ptb/src/vs/workbench/parts/welcome/overlay/browser/welcomeOverlay.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..93d7a695382adea57ac03bec69c64ffe14954f57 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/welcome/overlay/browser/welcomeOverlay.i18n.json @@ -0,0 +1,17 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "welcomeOverlay.explorer": "Explorador de arquivos", + "welcomeOverlay.search": "Pesquisar em arquivos", + "welcomeOverlay.git": "Gerenciamento de código fonte", + "welcomeOverlay.debug": "Executar e depurar", + "welcomeOverlay.extensions": "Gerenciar extensões", + "welcomeOverlay.problems": "Visualizar erros e avisos", + "welcomeOverlay.commandPalette": "Encontrar e executar todos os comandos", + "welcomeOverlay": "Visão geral da Interface do usuário", + "hideWelcomeOverlay": "Esconder a visão geral da Interface", + "help": "Ajuda" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json b/i18n/ptb/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..d0ecebaf1bfffefee2792b5081ff92697be18f92 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json @@ -0,0 +1,43 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "welcomePage.vscode": "Visual Studio Code", + "welcomePage.editingEvolved": "Edição evoluiu", + "welcomePage.start": "Início", + "welcomePage.newFile": "Novo arquivo", + "welcomePage.openFolder": "Abrir pasta...", + "welcomePage.cloneGitRepository": "Clonar repositório Git...", + "welcomePage.recent": "Recente", + "welcomePage.moreRecent": "Mais...", + "welcomePage.noRecentFolders": "Não há pastas recentes", + "welcomePage.help": "Ajuda", + "welcomePage.keybindingsCheatsheet": "Folha de dicas de teclado para impressão", + "welcomePage.introductoryVideos": "Vídeos introdutórios", + "welcomePage.productDocumentation": "Documentação do produto", + "welcomePage.gitHubRepository": "Repositório GitHub", + "welcomePage.stackOverflow": "Stack Overflow", + "welcomePage.showOnStartup": "Mostrar a página de boas-vindas na inicialização", + "welcomePage.customize": "Personalizar", + "welcomePage.installExtensionPacks": "Ferramentas e linguagens", + "welcomePage.installExtensionPacksDescription": "Instalar o suporte para {0} e {1}", + "welcomePage.moreExtensions": "mais", + "welcomePage.installKeymapDescription": "Instalar atalhos de teclado", + "welcomePage.installKeymapExtension": "Instalar os atalhos de teclado de {0} e {1}", + "welcomePage.others": "outros", + "welcomePage.colorTheme": "Tema de cores", + "welcomePage.colorThemeDescription": "Fazer o editor e seu código parecer do jeito que você gosta", + "welcomePage.learn": "Aprender", + "welcomePage.showCommands": "Encontrar e executar todos os comandos", + "welcomePage.interfaceOverview": "Visão geral da interface", + "welcomePage.interfaceOverviewDescription": "Obter uma sobreposição visual, destacando os principais componentes da interface do usuário", + "welcomePage.interactivePlayground": "Playground interativo", + "welcomePage.interactivePlaygroundDescription": "Experimente as características essenciais do editor em um curto passo-a-passo", + "welcomePage.quickLinks": "Links rápidos", + "welcomePage.keybindingsReference": "Referência de atalhos de teclado", + "welcomePage.keybindingsReferenceDescription": "Um PDF para impressão com os atalhos de teclado mais comuns", + "welcomePage.configureSettings": "Configurar definições", + "welcomePage.configureSettingsDescription": "Desbloquear o poder completo do VS Coda ajustando as configurações" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.contribution.i18n.json b/i18n/ptb/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..450b1aa8f08f17564144443f8a9301043b33aa7f --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.contribution.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "help": "Ajuda" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json b/i18n/ptb/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..5bd13096e61a5aa86d04773d9f8804062f40b694 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json @@ -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. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "workbenchConfigurationTitle": "Área de Trabalho", + "welcomePage.enabled": "Quando habilitado, irá mostrar a página de boas-vindas na inicialização.", + "welcomePage": "Bem-vindo", + "welcomePage.javaScript": "JavaScript", + "welcomePage.typeScript": "TypeScript", + "welcomePage.python": "Python", + "welcomePage.php": "PHP", + "welcomePage.docker": "Docker", + "welcomePage.vim": "Vim", + "welcomePage.sublime": "Sublime", + "welcomePage.atom": "Atom", + "welcomePage.extensionPackAlreadyInstalled": "Suporte para {0} já está instalado.", + "welcomePage.willReloadAfterInstallingExtensionPack": "A janela irá recarregar depois de instalar o suporte adicional para {0}.", + "welcomePage.installingExtensionPack": "Instalando o suporte adicional para {0}...", + "welcomePage.extensionPackNotFound": "Suporte para {0} com o id {1} não pôde ser encontrado.", + "welcomePage.keymapAlreadyInstalled": "Os atalhos de teclado de {0} já estão instalados.", + "welcomePage.willReloadAfterInstallingKeymap": "A janela irá recarregar depois de instalar os {0} atalhos de teclado.", + "welcomePage.installingKeymap": "Instalando os {0} atalhos de teclado...", + "welcomePage.keymapNotFound": "Os {0} atalhos de teclado com o id {1} não podem ser encontrados.", + "welcome.title": "Bem-vindo", + "welcomePage.openFolderWithPath": "Abrir pasta {0} com o caminho {1}", + "welcomePage.extensionListSeparator": ", ", + "welcomePage.installKeymap": "Instalar {0} keymap", + "welcomePage.installExtensionPack": "Instalar o suporte adicional para {0}", + "welcomePage.installedKeymap": "Mapeamento de tecla '{0}' já está instalado.", + "welcomePage.installedExtensionPack": "Suporte {0} já está instalado.", + "ok": "OK", + "details": "Detalhes", + "cancel": "Cancelar", + "welcomePage.buttonBackground": "Cor de fundo para os botões na página de boas-vindas.", + "welcomePage.buttonHoverBackground": "Cor de fundo ao passar o mouse sobre os botões na página de boas-vindas." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/welcome/walkThrough/electron-browser/editor/editorWalkThrough.i18n.json b/i18n/ptb/src/vs/workbench/parts/welcome/walkThrough/electron-browser/editor/editorWalkThrough.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..9c7c7f681fa23f181619443d5c3391411eb1311b --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/welcome/walkThrough/electron-browser/editor/editorWalkThrough.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "editorWalkThrough": "Playground Interativo", + "editorWalkThrough.title": "Playground Interativo" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThrough.contribution.i18n.json b/i18n/ptb/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThrough.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..a789ae1c81fd46448fb16b15a404e7324f320f83 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThrough.contribution.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "walkThrough.editor.label": "Playground Interativo", + "help": "Ajuda", + "interactivePlayground": "Playground Interativo" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughActions.i18n.json b/i18n/ptb/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughActions.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..697623110b08d7250d79242cf4702e829d7f105d --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughActions.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "editorWalkThrough.arrowUp": "Rolar para Cima (Linha)", + "editorWalkThrough.arrowDown": "Rolar para Baixo (Linha)", + "editorWalkThrough.pageUp": "Rolar para Cima (Página)", + "editorWalkThrough.pageDown": "Rolar para Baixo (Página)" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json b/i18n/ptb/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..4131ebae487a7797216ed061521ef7c4fe55358d --- /dev/null +++ b/i18n/ptb/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "walkThrough.unboundCommand": "não vinculado", + "walkThrough.gitNotFound": "Parece que o Git não está instalado no seu sistema.", + "walkThrough.embeddedEditorBackground": "Cor de fundo para os editores incorporados no Playground Interativo." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json b/i18n/ptb/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..188ab8da37e69f78ca1a5dbf4692df058910e014 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json @@ -0,0 +1,17 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "open": "Abrir configurações", + "close": "Fechar", + "saveAndRetry": "Salvar as configurações e tentar novamente", + "errorUnknownKey": "Não é possível gravar no arquivo de configuração (chave desconhecida)", + "errorInvalidTarget": "Não é possível gravar no arquivo de configuração (destino inválido)", + "errorNoWorkspaceOpened": "Não é possível gravar em configurações porque nenhuma pasta está aberta. Por favor, abra uma pasta primeiro e tente novamente.", + "errorInvalidConfiguration": "Não é possível gravar em configurações. Por favor abra **User Settings** para corrigir erros/avisos no arquivo e tente novamente.", + "errorInvalidConfigurationWorkspace": "Não é possível gravar em configurações. Por favor abra **Workspace Settings** para corrigir erros/avisos no arquivo e tente novamente.", + "errorConfigurationFileDirty": "Não é possível gravar em configurações, porque o arquivo foi alterado. Por favor, salve o arquivo **User Settings** e tente novamente.", + "errorConfigurationFileDirtyWorkspace": "Não é possível gravar em configurações, porque o arquivo foi alterado. Por favor, salve o arquivo **Workspace Settings** e tente novamente." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/services/crashReporter/common/crashReporterService.i18n.json b/i18n/ptb/src/vs/workbench/services/crashReporter/common/crashReporterService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..63fd1d1955daf5e64d5565101ed0102789a03cd6 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/services/crashReporter/common/crashReporterService.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "telemetryConfigurationTitle": "Telemetria", + "telemetry.enableCrashReporting": "Ativar o envio de relatórios de incidentes à Microsoft. Esta opção requer reinicialização para ser efetiva." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/services/editor/browser/editorService.i18n.json b/i18n/ptb/src/vs/workbench/services/editor/browser/editorService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..50e968f8ee37e64e5723ddba19803fdc8a2c9371 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/services/editor/browser/editorService.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "compareLabels": "{0} ↔ {1}" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/services/files/electron-browser/fileService.i18n.json b/i18n/ptb/src/vs/workbench/services/files/electron-browser/fileService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..49e9152a1dbee103cef1625204f7b0a7ecbb2380 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/services/files/electron-browser/fileService.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "netVersionError": "O Microsoft .NET Framework 4.5 é necessário. Por favor siga o link para instalá-lo.", + "installNet": "Baixar o .NET Framework 4.5", + "neverShowAgain": "Não mostrar novamente", + "trashFailed": "Falha em mover '{0}' para a lixeira" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/services/files/node/fileService.i18n.json b/i18n/ptb/src/vs/workbench/services/files/node/fileService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..b84feecdb4fb3f3398cdba5bf47335a3cb51ff8c --- /dev/null +++ b/i18n/ptb/src/vs/workbench/services/files/node/fileService.i18n.json @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "fileInvalidPath": "Recurso de arquivo inválido ({0})", + "fileIsDirectoryError": "Arquivo é diretório ({0})", + "fileBinaryError": "Arquivo parece ser binário e não pode ser aberto como texto", + "fileNotFoundError": "Arquivo não encontrado ({0})", + "unableToMoveCopyError": "Não é possível mover/copiar. Arquivo poderia substituir a pasta em que está contida.", + "foldersCopyError": "Pastas não podem ser copiadas para a área de trabalho. Por favor selecione arquivos individuais para serem copiados.", + "fileReadOnlyError": "Arquivo é Somente Leitura" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/services/keybinding/common/keybindingEditing.i18n.json b/i18n/ptb/src/vs/workbench/services/keybinding/common/keybindingEditing.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..daa32f59ee9790ceaccf98962bceef09267d2d7d --- /dev/null +++ b/i18n/ptb/src/vs/workbench/services/keybinding/common/keybindingEditing.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "errorKeybindingsFileDirty": "Não é possível gravar porque o arquivo está sujo. Por favor, salve o arquivo **Keybindings** e tente novamente.", + "parseErrors": "Não é possível gravar as combinações de teclas. Por favor abra o **arquivo Keybindings** para corrigir erros/avisos no arquivo e tente novamente.", + "errorInvalidConfiguration": "Não é possível gravar as combinações de teclas. **Arquivo Keybindings** tem um objeto que não é do tipo Matriz. Por favor, abra o arquivo para limpar e tentar novamente.", + "emptyKeybindingsHeader": "Coloque suas combinações de teclas neste arquivo para substituir os padrões" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/services/keybinding/electron-browser/keybindingService.i18n.json b/i18n/ptb/src/vs/workbench/services/keybinding/electron-browser/keybindingService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..2fac75a5675518ce945d0fb2d8fafe45a043c3ff --- /dev/null +++ b/i18n/ptb/src/vs/workbench/services/keybinding/electron-browser/keybindingService.i18n.json @@ -0,0 +1,26 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "nonempty": "Esperado um valor não vazio", + "requirestring": "a propriedade `{0}` é obrigatória e deve ser do tipo `string`", + "optstring": "a propriedade `{0}` é opcional ou pode ser do tipo `string`", + "vscode.extension.contributes.keybindings.command": "Identificador do comando a ser executado quando keybinding é acionado.", + "vscode.extension.contributes.keybindings.key": "Tecla ou sequência de teclas (teclas separadas com o sinal de adição e sequências com espaço, por exemplo Ctrl+O e Ctrl+L L para um acorde", + "vscode.extension.contributes.keybindings.mac": "Chave específica Mac ou sequência de teclas.", + "vscode.extension.contributes.keybindings.linux": "Chave específica Linux ou sequência de teclas.", + "vscode.extension.contributes.keybindings.win": "Chave específica Windows ou sequência de teclas.", + "vscode.extension.contributes.keybindings.when": "Condição quando a chave está ativa.", + "vscode.extension.contributes.keybindings": "Contribui para Atalhos de Teclado.", + "invalid.keybindings": "Inválido `contributes.{0}`: {1}", + "unboundCommands": "Aqui estão outros comandos disponíveis: ", + "keybindings.json.title": "Configuração de combinações de teclas", + "keybindings.json.key": "Tecla ou sequência de teclas (separados por espaço)", + "keybindings.json.command": "Nome do comando a ser executado", + "keybindings.json.when": "Condição quando a chave está ativa.", + "keybindings.json.args": "Argumentos a serem passados para o comando para executar.", + "keyboardConfigurationTitle": "Teclado", + "dispatch": "Controla a lógica de expedição para pressionamentos de teclas para usar `keydown.code` (recomendado) ou 'keydown.keyCode'." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/services/message/browser/messageList.i18n.json b/i18n/ptb/src/vs/workbench/services/message/browser/messageList.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..267b62d179d2a3f6145146b718699a240ea56cf4 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/services/message/browser/messageList.i18n.json @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "alertErrorMessage": "Erro: {0}", + "alertWarningMessage": "Aviso: {0}", + "alertInfoMessage": "Informações: {0}", + "error": "Erro", + "warning": "Aviso", + "info": "Informações", + "close": "Fechar" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/services/message/electron-browser/messageService.i18n.json b/i18n/ptb/src/vs/workbench/services/message/electron-browser/messageService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..cecec4b4c3aabeb5c4e4dcec397e4c3b5bee1368 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/services/message/electron-browser/messageService.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "yesButton": "&&Sim", + "cancelButton": "Cancelar" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/services/mode/common/workbenchModeService.i18n.json b/i18n/ptb/src/vs/workbench/services/mode/common/workbenchModeService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..91df655432d4f9202872d82a2494a4d71745de53 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/services/mode/common/workbenchModeService.i18n.json @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "invalid": "Inválido 'contributes.{0}`. Matriz esperada.", + "invalid.empty": "Valor em branco para` contributes.{0}`", + "require.id": "a propriedade `{0}` é obrigatória e deve ser do tipo `string`", + "opt.extensions": "a propriedade `{0}` pode ser omitida e deve ser do tipo `string[]`", + "opt.filenames": "a propriedade `{0}` pode ser omitida e deve ser do tipo `string[]`", + "opt.firstLine": "a propriedade `{0}` pode ser omitida e deve ser do tipo `string`", + "opt.configuration": "a propriedade `{0}` pode ser omitida e deve ser do tipo `string`", + "opt.aliases": "a propriedade `{0}` pode ser omitida e deve ser do tipo `string[]`", + "opt.mimetypes": "a propriedade `{0}` pode ser omitida e deve ser do tipo `string[]`" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/services/progress/browser/progressService2.i18n.json b/i18n/ptb/src/vs/workbench/services/progress/browser/progressService2.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..6db7d6aae514a031afce5ac346abfd84bb8ee1cc --- /dev/null +++ b/i18n/ptb/src/vs/workbench/services/progress/browser/progressService2.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "progress.text": "{0} - {1}", + "progress.title": "{0}: {1}" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/services/textfile/common/textFileEditorModel.i18n.json b/i18n/ptb/src/vs/workbench/services/textfile/common/textFileEditorModel.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..7eed5484379af34f23b481d45538c4cab4fa6c03 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/services/textfile/common/textFileEditorModel.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "saveFileFirst": "O arquivo está alterado. Por favor, salvá-lo primeiro antes reabri-lo com outra codificação.", + "genericSaveError": "Erro ao salvar '{0}': {1}" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/services/textfile/common/textFileService.i18n.json b/i18n/ptb/src/vs/workbench/services/textfile/common/textFileService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..9fe74ad26f3aa151c497bc1f9659d4dabe00e504 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/services/textfile/common/textFileService.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "files.backup.failSave": "Arquivos não poderiam ser backupeados (erro: {0}), tente salvar seus arquivos para sair." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/services/textfile/electron-browser/textFileService.i18n.json b/i18n/ptb/src/vs/workbench/services/textfile/electron-browser/textFileService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..491b19e87c4efa4dee5923e674c93aed715e7be8 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/services/textfile/electron-browser/textFileService.i18n.json @@ -0,0 +1,18 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "saveChangesMessage": "Você quer salvar as alterações feitas para {0}?", + "saveChangesMessages": "Você quer salvar as alterações para os seguintes {0} arquivos?", + "moreFile": "... 1 arquivo adicional não está mostrado", + "moreFiles": "... {0} arquivos adicionais não estão mostrados", + "saveAll": "&&Salvar tudo", + "save": "&&Salvar", + "dontSave": "&&Não Salvar", + "cancel": "Cancelar", + "saveChangesDetail": "Suas alterações serão perdidas se você não salvá-las.", + "allFiles": "Todos os arquivos", + "noExt": "Sem extensão" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/services/themes/common/colorThemeSchema.i18n.json b/i18n/ptb/src/vs/workbench/services/themes/common/colorThemeSchema.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..02e2bc182734b9f2c32729d5f9e0a92e2e105194 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/services/themes/common/colorThemeSchema.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "schema.colors": "Cores para o realce de sintaxe", + "schema.properties.name": "Descrição da regra", + "schema.fontStyle": "Estilo da fonte da regra: um estilo ou uma combinação de 'itálico', 'negrito' e 'sublinhado'", + "schema.tokenColors.path": "Caminho para um arquivo tmTheme (relativo ao arquivo atual)" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/services/themes/common/fileIconThemeSchema.i18n.json b/i18n/ptb/src/vs/workbench/services/themes/common/fileIconThemeSchema.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..3cf20c82de2cbe2f1bce831aea2603e43eccf17a --- /dev/null +++ b/i18n/ptb/src/vs/workbench/services/themes/common/fileIconThemeSchema.i18n.json @@ -0,0 +1,37 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "schema.folderExpanded": "O ícone de pasta para pastas expandidas. O ícone da pasta expandido é opcional. Se não definido, o ícone definido para a pasta será mostrado.", + "schema.folder": "O ícone de pasta para pastas colapsadas, e se folderExpanded não estiver definido, também para pastas expandidas.", + "schema.file": "O ícone de arquivo padrão, indicado para todos os arquivos que não correspondem a qualquer extensão, nome de arquivo ou idioma.", + "schema.folderNames": "Associa os nomes de pasta à ícones. A chave do objeto é o nome da pasta, não incluindo quaisquer segmentos de caminho. Nenhum padrão ou curinga são permitidos. O nome da pasta de correspondência diferencia maiusculas de minúsculas.", + "schema.folderName": "A ID da definição do ícone para associação.", + "schema.folderNamesExpanded": "Associa os nomes de pasta a ícones para pastas expandidas. A chave do objeto é o nome da pasta, não incluindo quaisquer segmentos do caminho. Padrões ou curingas não são permitidas. A correspondência do nome de pastas não diferencia maiusculas de minúsculas.", + "schema.folderNameExpanded": "A ID da definição do ícone para a associação.", + "schema.fileExtensions": "Associa as extensões de arquivo aos ícones. A chave do objeto é o nome da extensão do arquivo. O nome da extensão é o último segmento de um nome de arquivo após o último ponto (não incluindo o ponto). As extensões não diferenciam maiúsculas de minúsculas.", + "schema.fileExtension": "A ID da definição do ícone para a associação.", + "schema.fileNames": "Associa os nomes de arquivo à ícones. A chave do objeto é o nome completo do arquivo, mas não incluindo quaisquer segmentos do caminho. O nome do arquivo pode incluir pontos e uma extensão de arquivo. Nenhum padrão ou curinga é permitido. A correspondência de nome de arquivo não diferencia maiúsculas de minúsculas.", + "schema.fileName": "A ID da definição do ícone para a associação.", + "schema.languageIds": "Associa idiomas a ícones. A chave do objeto é o id de idioma definido no ponto de contribuição de linguagem.", + "schema.languageId": "O ID da definição do ícone para a associação.", + "schema.fonts": "Fontes que são usadas nas definições de ícone.", + "schema.id": "O ID da fonte.", + "schema.src": "A localização da fonte.", + "schema.font-path": "O caminho do fonte, relativo ao arquivo de tema de ícone atual.", + "schema.font-format": "O formato da fonte.", + "schema.font-weight": "O peso da fonte.", + "schema.font-sstyle": "O estilo da fonte.", + "schema.font-size": "O tamanho padrão da fonte.", + "schema.iconDefinitions": "Descrição de todos os ícones que podem ser usados quando associar arquivos de ícones.", + "schema.iconDefinition": "Uma definição de ícone. A chave do objeto é o ID da definição.", + "schema.iconPath": "Ao usar um SVG ou PNG: O caminho para a imagem. O caminho é relativo ao arquivo de configuração do ícone.", + "schema.fontCharacter": "Ao usar uma fonte glyph: O caractere na fonte para usar.", + "schema.fontColor": "Ao usar uma fonte glyph: A cor a ser utilizada.", + "schema.fontSize": "Quando estiver utilizando uma fonte: O tamanho da fonte em porcentagem para a fonte de texto. Se não for definido, o padrão é o tamanho na definição de fonte.", + "schema.fontId": "Quando estiver utilizando uma fonte: A identificação da fonte. Se não for definido, o padrão é a primeira definição de fonte.", + "schema.light": "Associações opcionais para ícones de arquivo em temas de cor clara.", + "schema.highContrast": "Associações opcionais para ícones de arquivo em temas de alto contraste." +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/services/themes/electron-browser/colorThemeData.i18n.json b/i18n/ptb/src/vs/workbench/services/themes/electron-browser/colorThemeData.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..4ef6944ba7352fc67dd17a3df214afe3efb0a2e7 --- /dev/null +++ b/i18n/ptb/src/vs/workbench/services/themes/electron-browser/colorThemeData.i18n.json @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "error.cannotparsejson": "Problemas ao analisar o arquivo de tema JSON: {0}", + "error.invalidformat.colors": "Problema ao analisar o arquivo de tema de cor: {0}. A propriedade 'colors' não é do tipo 'object'.", + "error.invalidformat.tokenColors": "Problema ao analisar o arquivo de tema de cor: {0}. A propriedade 'tokenColors' deve ser também uma matriz especificando as cores ou um caminho para um arquivo de texto de tema correspondente", + "error.plist.invalidformat": "Problema ao analisar o arquivo tmTheme: {0}. 'settings' não é uma matriz.", + "error.cannotparse": "Problemas ao analisar o arquivo tmTheme: {0}", + "error.cannotload": "Problemas ao carregar o arquivo tmTheme {0}: {1}" +} \ No newline at end of file diff --git a/i18n/ptb/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.i18n.json b/i18n/ptb/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..caeea848338aac8113b1f960fe0026618703be7b --- /dev/null +++ b/i18n/ptb/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.i18n.json @@ -0,0 +1,32 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "vscode.extension.contributes.themes": "Contribui com temas de cores do textmate.", + "vscode.extension.contributes.themes.id": "ID do tema do ícone conforme usado em configurações do usuário.", + "vscode.extension.contributes.themes.label": "Etiqueta da cor do tema como mostrado na interface do usuário.", + "vscode.extension.contributes.themes.uiTheme": "Tema base de definição das cores do editor: 'vs' é o tema de cor clara, 'vs-dark' é o tema de cor escura. 'hc preto' é o tema escuro de alto contraste.", + "vscode.extension.contributes.themes.path": "Caminho do arquivo tmTheme. O caminho é relativo à pasta de extensão e é normalmente './themes/themeFile.tmTheme'.", + "vscode.extension.contributes.iconThemes": "Contribui com temas de ícones de arquivo.", + "vscode.extension.contributes.iconThemes.id": "ID do tema do ícone como usado em configurações do usuário.", + "vscode.extension.contributes.iconThemes.label": "Etiqueta do tema do ícone como mostrado na interface do usuário.", + "vscode.extension.contributes.iconThemes.path": "Caminho do arquivo de definição do tema do ícone. O caminho é relativo à pasta de extensão e é normalmente './icons/awesome-icon-theme.json'.", + "migration.completed": "Foram adicionadas novas configurações de tema para as configurações de usuário. Backup está disponível em {0}.", + "error.cannotloadtheme": "Não é possível carregar {0}: {1}", + "reqarray": "Ponto de extensão '{0}' deve ser uma matriz.", + "reqpath": "Esperada uma string em `contributes.{0}.path`. Valor informado: {1}", + "invalid.path.1": "É esperado que `contributes.{0}.path` ({1}) seja incluído na pasta da extensão ({2}). Isto pode tornar a extensão não portável.", + "reqid": "Esperada sequência em 'contributes.{0}.ID'. Valor fornecido: {1}", + "error.cannotloadicontheme": "Não é possível carregar {0}", + "error.cannotparseicontheme": "Problemas de análise do arquivo de ícones: {0}", + "colorTheme": "Especifica o tema de cores usado no espaço de trabalho.", + "colorThemeError": "Tema é desconhecido ou não está instalado.", + "iconTheme": "Especifica o tema de ícone usado no espaço de trabalho.", + "noIconThemeDesc": "Nenhum arquivo de ícones", + "iconThemeError": "Arquivo de tema de ícones é desconhecido ou não está instalado.", + "workbenchColors": "Substitui as cores do tema do tema de cores atualmente selecionado.", + "workbenchColors.deprecated": "A configuração não é mais experimental e foi renomeada para 'workbench.colorCustomizations'", + "workbenchColors.deprecatedDescription": "Use 'workbench.colorCustomizations'" +} \ No newline at end of file diff --git a/i18n/rus/extensions/git/out/commands.i18n.json b/i18n/rus/extensions/git/out/commands.i18n.json index 0e28cfd0b9a11aeb6a0a5ae15cb1010b98030a7b..728d6ecc10935c570c8bc8ccb3e1775519665a8b 100644 --- a/i18n/rus/extensions/git/out/commands.i18n.json +++ b/i18n/rus/extensions/git/out/commands.i18n.json @@ -18,6 +18,7 @@ "discard": "Отменить изменения", "confirm discard all": "Вы действительно хотите отменить все изменения? Отменить это действие нельзя!", "discardAll": "Отменить все изменения", + "no staged changes": "Отсутствуют промежуточные изменения для фиксации.\n\nВы хотите сделать все изменения промежуточными и зафиксировать их напрямую?", "yes": "Да", "always": "Всегда", "no changes": "Нет изменений для фиксации.", @@ -25,6 +26,9 @@ "provide commit message": "Введите сообщение фиксации.", "branch name": "Имя ветви", "provide branch name": "Укажите имя ветви.", + "select branch to delete": "Выберите ветвь для удаления", + "confirm force delete branch": "Ветвь '{0}' объединена не полностью. Удалить ее?", + "delete branch": "Удалить ветвь", "no remotes to pull": "Для вашего репозитория не настроены удаленные репозитории для получения данных.", "no remotes to push": "Для вашего репозитория не настроены удаленные репозитории для отправки данных.", "nobranch": "Извлеките ветвь, чтобы передать данные в удаленный репозиторий.", diff --git a/i18n/rus/extensions/git/out/statusbar.i18n.json b/i18n/rus/extensions/git/out/statusbar.i18n.json index e2a1fb358d8e9fecdcefa96c7f4dba57438cb111..b70a09ca50856ef6e3324a5e51a93edc07cba2ae 100644 --- a/i18n/rus/extensions/git/out/statusbar.i18n.json +++ b/i18n/rus/extensions/git/out/statusbar.i18n.json @@ -6,6 +6,6 @@ { "checkout": "Извлечь...", "sync changes": "Синхронизировать изменения", - "publish changes": "Публиковать изменения", + "publish changes": "Опубликовать изменения", "syncing changes": "Синхронизация изменений..." } \ No newline at end of file diff --git a/i18n/rus/extensions/git/package.i18n.json b/i18n/rus/extensions/git/package.i18n.json index 5236c98c9748f141c663efd7b3405fb507b409d5..72b1271c65b52a3d913428a1795d39d909e9d235 100644 --- a/i18n/rus/extensions/git/package.i18n.json +++ b/i18n/rus/extensions/git/package.i18n.json @@ -26,12 +26,13 @@ "command.undoCommit": "Отменить последнюю фиксацию", "command.checkout": "Извлечь в...", "command.branch": "Создать ветвь...", + "command.deleteBranch": "Удалить ветвь...", "command.pull": "Получить", "command.pullRebase": "Получить (переместить изменения из одной ветви в другую)", "command.push": "Отправить", "command.pushTo": "Отправить в:", "command.sync": "Синхронизация", - "command.publish": "Опубликовать", + "command.publish": "Опубликовать ветвь", "command.showOutput": "Показать выходные данные GIT", "config.enabled": "Включен ли GIT", "config.path": "Путь к исполняемому файлу GIT", @@ -42,5 +43,7 @@ "config.countBadge": "\nУправляет счетчиком Git. При указании значения \"all\" подсчитываются все изменения, при указании значения \"tracked\" — только отслеживаемые изменения, при указании значения \"off\" счетчик отключается.", "config.checkoutType": "Определяет типы ветвей, которые выводятся при выборе пункта меню \"Извлечь в...\". При указании значения \"all\" отображаются все ссылки, \"local\" — только локальные ветви, \"tags\" — только теги, а \"remote\" — только удаленные ветви.", "config.ignoreLegacyWarning": "Игнорирует предупреждение об устаревшей версии Git", - "config.ignoreLimitWarning": "Игнорировать предупреждение, когда в репозитории слишком много изменений" + "config.ignoreLimitWarning": "Игнорировать предупреждение, когда в репозитории слишком много изменений", + "config.defaultCloneDirectory": "Расположение по умолчанию, в которое будет клонирован репозиторий Git", + "config.enableSmartCommit": "Зафиксировать все изменения при отсутствии промежуточных изменений." } \ No newline at end of file diff --git a/i18n/rus/extensions/jake/out/main.i18n.json b/i18n/rus/extensions/jake/out/main.i18n.json index 8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a..3f8458b5b988ccde70c3533c5001246bf311d730 100644 --- a/i18n/rus/extensions/jake/out/main.i18n.json +++ b/i18n/rus/extensions/jake/out/main.i18n.json @@ -3,4 +3,6 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. -{} \ No newline at end of file +{ + "execFailed": "Сбой автоматического определений заданий Jake. Ошибка: {0}" +} \ No newline at end of file diff --git a/i18n/rus/extensions/jake/package.i18n.json b/i18n/rus/extensions/jake/package.i18n.json index 8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a..57552487f0a66158dd53eabc8d6961f5be611fed 100644 --- a/i18n/rus/extensions/jake/package.i18n.json +++ b/i18n/rus/extensions/jake/package.i18n.json @@ -3,4 +3,6 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. -{} \ No newline at end of file +{ + "config.jake.autoDetect": "Включает или отключает автоматическое определение заданий Jake. Значение по умолчанию — \"включено\"." +} \ No newline at end of file diff --git a/i18n/rus/extensions/markdown/out/extension.i18n.json b/i18n/rus/extensions/markdown/out/extension.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..5c5b3690dc66cead27af50fbe2ab03d27f33f429 --- /dev/null +++ b/i18n/rus/extensions/markdown/out/extension.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "onPreviewStyleLoadError": "Не удалось загрузить 'markdown.styles': {0}" +} \ No newline at end of file diff --git a/i18n/rus/extensions/merge-conflict/out/codelensProvider.i18n.json b/i18n/rus/extensions/merge-conflict/out/codelensProvider.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..8b8980ff833928a1b2d45673b930b3c653fc720b --- /dev/null +++ b/i18n/rus/extensions/merge-conflict/out/codelensProvider.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "acceptCurrentChange": "Принять текущее изменение", + "acceptIncomingChange": "Принять входящее изменение", + "acceptBothChanges": "Принять оба изменения", + "compareChanges": "Сравнить изменения" +} \ No newline at end of file diff --git a/i18n/rus/extensions/merge-conflict/out/commandHandler.i18n.json b/i18n/rus/extensions/merge-conflict/out/commandHandler.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..8dfda28c7353216002a41f8c7213f1357534b30a --- /dev/null +++ b/i18n/rus/extensions/merge-conflict/out/commandHandler.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "cursorNotInConflict": "Курсор не находится на конфликте объединения", + "compareChangesTitle": "{0}: текущие изменения ⟷ входящие изменения", + "cursorOnSplitterRange": "Курсор редактора находится на разделителе блока объединения конфликтов. Переместите его в блок \"Текущее\" или \"Входящее\"", + "noConflicts": "Конфликтов объединения в этом файле не обнаружено", + "noOtherConflictsInThisFile": "Других конфликтов объединения в этом файле не обнаружено" +} \ No newline at end of file diff --git a/i18n/rus/extensions/merge-conflict/out/mergeDecorator.i18n.json b/i18n/rus/extensions/merge-conflict/out/mergeDecorator.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..19166bea629470a78fd4fc5d5fe2ad6535f45675 --- /dev/null +++ b/i18n/rus/extensions/merge-conflict/out/mergeDecorator.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "currentChange": "(текущее изменение)", + "incomingChange": "(входящее изменение)" +} \ No newline at end of file diff --git a/i18n/rus/extensions/merge-conflict/package.i18n.json b/i18n/rus/extensions/merge-conflict/package.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..209c32b7d11b45948293ab64b3c3e51dfd4d9e27 --- /dev/null +++ b/i18n/rus/extensions/merge-conflict/package.i18n.json @@ -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. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "command.category": "Объединить конфликт", + "command.accept.all-incoming": "Принять все входящие", + "command.accept.all-both": "Принять все входящие и текущие", + "command.accept.current": "Принять текущее", + "command.accept.incoming": "Принять входящее", + "command.accept.selection": "Принять выделенное", + "command.accept.both": "Принять оба", + "command.next": "Следующий конфликт", + "command.previous": "Предыдущий конфликт", + "command.compare": "Сравнить текущий конфликт", + "config.title": "Объединить конфликт", + "config.codeLensEnabled": "Включить/отключить блок объединения конфликтов CodeLens в редакторе", + "config.decoratorsEnabled": "Включить/отключить декораторы объединения конфликтов в редакторе" +} \ No newline at end of file diff --git a/i18n/rus/extensions/npm/package.i18n.json b/i18n/rus/extensions/npm/package.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..48afb646815e1ccf0052b9e63568107aef4dd3b9 --- /dev/null +++ b/i18n/rus/extensions/npm/package.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "config.npm.autoDetect": "Включает или отключает автоматическое определение сценариев npm. Значение по умолчанию — \"включено\"." +} \ No newline at end of file diff --git a/i18n/rus/extensions/typescript/out/features/bufferSyncSupport.i18n.json b/i18n/rus/extensions/typescript/out/features/bufferSyncSupport.i18n.json index 9107be78385c639bc5c65ca0b32c82ae4942d778..14d34e0b45e8d8a2b3d6cf5a26f21b8a4f9e4a70 100644 --- a/i18n/rus/extensions/typescript/out/features/bufferSyncSupport.i18n.json +++ b/i18n/rus/extensions/typescript/out/features/bufferSyncSupport.i18n.json @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "versionMismatch": "Обнаружено несоответствие глобального tsc ({0}) и службы языка VS Code ({1}). Это может привести к ошибкам согласованности компиляции.", "moreInformation": "Дополнительные сведения", "doNotCheckAgain": "Больше не проверять", "close": "Закрыть", diff --git a/i18n/rus/extensions/typescript/out/features/directiveCommentCompletionProvider.i18n.json b/i18n/rus/extensions/typescript/out/features/directiveCommentCompletionProvider.i18n.json index 8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a..5c9f3c06ffc8db2abcb358ef30694fd9f3898c13 100644 --- a/i18n/rus/extensions/typescript/out/features/directiveCommentCompletionProvider.i18n.json +++ b/i18n/rus/extensions/typescript/out/features/directiveCommentCompletionProvider.i18n.json @@ -3,4 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. -{} \ No newline at end of file +{ + "ts-check": "Включает семантическую проверку в JavaScript файле. Необходимо расположить в самом начале файла.", + "ts-nocheck": "Отключает семантическую проверку в JavaScript файле. Необходимо расположить в самом начале файла.", + "ts-ignore": "Отключает вывод ошибок @ts-check для следующей строки файла." +} \ No newline at end of file diff --git a/i18n/rus/extensions/typescript/out/utils/projectStatus.i18n.json b/i18n/rus/extensions/typescript/out/utils/projectStatus.i18n.json index 212caa515a98f1be8235912a821a70d25ab926d9..436675958f9c52dfbecaab03686e2e14efae08ad 100644 --- a/i18n/rus/extensions/typescript/out/utils/projectStatus.i18n.json +++ b/i18n/rus/extensions/typescript/out/utils/projectStatus.i18n.json @@ -6,7 +6,6 @@ { "hintExclude": "Чтобы включить языковые функции JavaScript/TypeScript IntelliSense во всем проекте, исключите папки с большим числом файлов, например: {0}.", "hintExclude.generic": "Чтобы включить языковые функции JavaScript/TypeScript IntelliSense во всем проекте, исключите большие папки с исходными файлами, с которыми вы не работаете.", - "open": "Настройка исключений", "large.label": "Настройка исключений", "hintExclude.tooltip": "Чтобы включить языковые функции JavaScript/TypeScript IntelliSense во всем проекте, исключите большие папки с исходными файлами, с которыми вы не работаете." } \ No newline at end of file diff --git a/i18n/rus/extensions/typescript/out/utils/typingsStatus.i18n.json b/i18n/rus/extensions/typescript/out/utils/typingsStatus.i18n.json index 4adb921367a610f6bd678bbd8dd01257e80f0064..8df62bae15bed9df90dbc19b21883890d5b72251 100644 --- a/i18n/rus/extensions/typescript/out/utils/typingsStatus.i18n.json +++ b/i18n/rus/extensions/typescript/out/utils/typingsStatus.i18n.json @@ -5,7 +5,7 @@ // Do not edit this file. It is machine generated. { "installingPackages": "Получение данных для повышения эффективности IntelliSense TypeScript", - "typesInstallerInitializationFailed.title": "Не удалось установить файлы типизации для языка JavaScript. Убедитесь, что NPM установлен и путь к нему указан в переменной PATH", + "typesInstallerInitializationFailed.title": "Не удалось установить файлы типизации для языка JavaScript. Убедитесь, что NPM установлен или укажите путь к файлу 'typescript.npm' в параметрах среды пользователя", "typesInstallerInitializationFailed.moreInformation": "Дополнительные сведения", "typesInstallerInitializationFailed.doNotCheckAgain": "Больше не проверять", "typesInstallerInitializationFailed.close": "Закрыть" diff --git a/i18n/rus/extensions/typescript/package.i18n.json b/i18n/rus/extensions/typescript/package.i18n.json index eefc82f18b2f7056b495b66b8277792c3f55d8f7..ac2e8ab343ad8d41b638d552540caac1b38fe6e4 100644 --- a/i18n/rus/extensions/typescript/package.i18n.json +++ b/i18n/rus/extensions/typescript/package.i18n.json @@ -13,7 +13,6 @@ "typescript.check.tscVersion": "Проверка отличия компилятора TypeScript глобальной установки (например, tsc) от используемой языковой службы TypeScript.", "typescript.tsserver.log": "Включает ведение журнала для сервера TS. Этот журнал можно использовать для диагностики проблем сервера TS. В журнале могут содержаться пути к файлам, исходный код и другие сведения из вашего проекта, в том числе носящие конфиденциальный характер.", "typescript.tsserver.trace": "Включает трассировку сообщений, отправляемых на сервер TS. Эту трассировку можно использовать для диагностики проблем сервера TS. Трассировка может содержать пути к файлам, исходный код и другие сведения из вашего проекта, в том числе конфиденциальные данные.", - "typescript.tsserver.experimentalAutoBuild": "Включает экспериментальную автосборку. Требуется версия 1.9 dev или версия 2.x tsserver и перезапуск VS Code после изменения.", "typescript.validate.enable": "Включение или отключение проверки TypeScript.", "typescript.format.enable": "Включение или отключение модуля форматирования TypeScript по умолчанию.", "javascript.format.enable": "Включение или отключение модуля форматирования JavaScript по умолчанию.", @@ -33,9 +32,16 @@ "javascript.validate.enable": "Включение или отключение проверки JavaScript.", "typescript.goToProjectConfig.title": "Перейти к конфигурации проекта", "javascript.goToProjectConfig.title": "Перейти к конфигурации проекта", + "javascript.referencesCodeLens.enabled": "Включить/отключить ссылки CodeLens для файлов JavaScript.", + "typescript.referencesCodeLens.enabled": "Включить/отключить ссылки CodeLens для файлов TypeScript. Требуется TypeScript версии 2.0.6 или более поздней версии.", "typescript.implementationsCodeLens.enabled": "Включить или отключить CodeLens для реализаций. Требуется TypeScript >= 2.2.0.", + "typescript.openTsServerLog.title": "Открыть журнал сервера TS", + "typescript.restartTsServer": "Перезапустить сервер TS", "typescript.selectTypeScriptVersion.title": "Выберите версию TypeScript.", "jsDocCompletion.enabled": "Включить или отключить JSDoc коментарии", "javascript.implicitProjectConfig.checkJs": "Включает/отключает семантическую проверку файлов JavaScript. Этот параметр может переопределяться в файле jsconfig.json или tsconfig.json. Требуется TypeScript 2.3.1 или более поздней версии.", - "typescript.check.npmIsInstalled": "Проверяет, установлен ли NPM для автоматического получения типов" + "typescript.npm": "Указывает путь к исполняемому файлу NPM, используемому для автоматического получения типа. Требуется TypeScript версии 2.3.4 или более поздней версии.", + "typescript.check.npmIsInstalled": "Проверяет, установлен ли NPM для автоматического получения типов.", + "javascript.nameSuggestions": "Включить/отключить использование уникальных имен из файла в списках предложений JavaScript.", + "typescript.tsc.autoDetect": "Включает или отключает автоматическое определние заданий tsc." } \ No newline at end of file diff --git a/i18n/rus/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json b/i18n/rus/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json index af5b0c29d70d29d55a60bc3b0502b49d4cdd22ac..3ef6f2cac9f8b7a7a7936efa3335159f464cd844 100644 --- a/i18n/rus/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json +++ b/i18n/rus/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json @@ -6,8 +6,7 @@ { "imgMeta": "{0}x{1} {2}", "largeImageError": "Изображение слишком велико для отображения в редакторе. ", - "resourceOpenExternalButton": "Открыть изображение", - "resourceOpenExternalText": " с помощью внешней программы?", + "resourceOpenExternalButton": "Открыть изображение с помощью внешней программы?", "nativeBinaryError": "Файл не будет отображен в редакторе, так как он двоичный, очень большой или использует неподдерживаемую кодировку текста.", "sizeB": "{0} Б", "sizeKB": "{0} КБ", diff --git a/i18n/rus/src/vs/base/common/errorMessage.i18n.json b/i18n/rus/src/vs/base/common/errorMessage.i18n.json index d3403f4afa54b0b3128a7d7f2ca321b4553b76c1..b1ef2e3999bc16e493ababc7b462d063a4f3b5f8 100644 --- a/i18n/rus/src/vs/base/common/errorMessage.i18n.json +++ b/i18n/rus/src/vs/base/common/errorMessage.i18n.json @@ -13,6 +13,5 @@ "error.connection.unknown": "Произошла неизвестная ошибка подключения. Утеряно подключение к Интернету, либо сервер, к которому вы подключены, перешел в автономный режим.", "stackTrace.format": "{0}: {1}", "error.defaultMessage": "Произошла неизвестная ошибка. Подробные сведения см. в журнале.", - "nodeExceptionMessage": "Произошла системная ошибка ({0})", "error.moreErrors": "{0} (всего ошибок: {1})" } \ No newline at end of file diff --git a/i18n/rus/src/vs/base/common/keybindingLabels.i18n.json b/i18n/rus/src/vs/base/common/keybindingLabels.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a --- /dev/null +++ b/i18n/rus/src/vs/base/common/keybindingLabels.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{} \ No newline at end of file diff --git a/i18n/rus/src/vs/code/electron-main/menus.i18n.json b/i18n/rus/src/vs/code/electron-main/menus.i18n.json index 2caee2db03b5bc98a7ae012a854e546027e962d0..ac53c20ecc2e551fbcc35526f6a1e369cd6c8fc1 100644 --- a/i18n/rus/src/vs/code/electron-main/menus.i18n.json +++ b/i18n/rus/src/vs/code/electron-main/menus.i18n.json @@ -14,6 +14,7 @@ "mHelp": "&&Справка", "miNewWindow": "&&Новое окно", "mAbout": "О программе {0}", + "mServices": "Службы", "mHide": "Скрыть {0}", "mHideOthers": "Скрыть другие", "mShowAll": "Показать все", @@ -54,6 +55,9 @@ "miShowEmmetCommands": "E&&mmet...", "miToggleLineComment": "Переключить комментарий &&строки", "miToggleBlockComment": "Переключить комментарий &&блока", + "miMultiCursorAlt": "Для работы в режиме нескольких курсоров нажмите левую кнопку мыши, удерживая клавишу ALT", + "miMultiCursorCmd": "Для работы в режиме нескольких курсоров нажмите левую кнопку мыши, нажав клавишу COMMAND", + "miMultiCursorCtrl": "Для работы в режиме нескольких курсоров нажмите левую кнопку мыши, нажав клавишу CTRL", "miInsertCursorAbove": "Добавить курсор &&выше", "miInsertCursorBelow": "Добавить курсор &&ниже", "miInsertCursorAtEndOfEachLineSelected": "Добавить курсоры в &&окончания строк", @@ -69,6 +73,7 @@ "miSmartSelectShrink": "&&Сжать выделение", "miViewExplorer": "Проводник", "miViewSearch": "Поиск", + "miViewSCM": "S&&CM", "miViewDebug": "Отладка", "miViewExtensions": "Р&&асширения", "miToggleOutput": "Вывод", @@ -113,6 +118,8 @@ "miGotoSymbolInFile": "Перейти к &&символу в файле...", "miGotoSymbolInWorkspace": "Перейти к символу в &&рабочей области...", "miGotoDefinition": "Перейти к &&определению", + "miGotoTypeDefinition": "Перейти к &&определению типа", + "miGotoImplementation": "Перейти к &&реализации", "miGotoLine": "Перейти к &&строке...", "miStartDebugging": "&&Запустить отладку", "miStartWithoutDebugging": "Начать &&без отладки", @@ -129,16 +136,17 @@ "miColumnBreakpoint": "Т&&очка останова столбца", "miFunctionBreakpoint": "&&Точка останова функции...", "miNewBreakpoint": "&&Новая точка останова", + "miEnableAllBreakpoints": "Включить все точки останова", "miDisableAllBreakpoints": "Отключить &&все точки останова", "miRemoveAllBreakpoints": "&&Удалить &&все точки останова", "miInstallAdditionalDebuggers": "У&&становить дополнительные отладчики...", "mMinimize": "Свернуть", - "mClose": "Закрыть", "mBringToFront": "Переместить все на передний план", "miToggleDevTools": "&&Показать/скрыть средства разработчика", "miAccessibilityOptions": "Специальные &&возможности", "miReportIssues": "&&Сообщить о проблемах", "miWelcome": "&&Приветствие", + "miInteractivePlayground": "&&Интерактивная площадка", "miDocumentation": "&&Документация", "miReleaseNotes": "&&Заметки о выпуске", "miKeyboardShortcuts": "С&&правочник по сочетаниям клавиш", @@ -148,6 +156,8 @@ "miLicense": "Просмотреть &&лицензию", "miPrivacyStatement": "&&Заявление о конфиденциальности", "miAbout": "&&О программе", + "miTerminateTask": "&&Завершить задачу", + "accessibilityOptionsWindowTitle": "Специальные возможности", "miRestartToUpdate": "Перезапустить для обновления...", "miCheckingForUpdates": "Идет проверка наличия обновлений...", "miDownloadUpdate": "Скачать доступное обновление", diff --git a/i18n/rus/src/vs/code/electron-main/windows.i18n.json b/i18n/rus/src/vs/code/electron-main/windows.i18n.json index 6a621782e32d16fb9afc9acb4811733c424eefeb..22509376e04ed5722773d7846bcf2fab108071e3 100644 --- a/i18n/rus/src/vs/code/electron-main/windows.i18n.json +++ b/i18n/rus/src/vs/code/electron-main/windows.i18n.json @@ -7,16 +7,11 @@ "ok": "ОК", "pathNotExistTitle": "Путь не существует.", "pathNotExistDetail": "Путь \"{0}\" больше не существует на диске.", - "accessibilityOptionsWindowTitle": "Специальные возможности", "reopen": "Открыть повторно", "wait": "Подождать", "close": "Закрыть", "appStalled": "Окно не отвечает", "appStalledDetail": "Вы можете повторно открыть окно, закрыть его или продолжить ожидание.", "appCrashed": "Сбой окна", - "appCrashedDetail": "Приносим извинения за неудобство! Вы можете повторно открыть окно, чтобы продолжить работу с того места, на котором остановились.", - "newWindow": "Новое окно", - "newWindowDesc": "Открывает новое окно", - "recentFolders": "Недавно использованные папки", - "folderDesc": "{0} {1}" + "appCrashedDetail": "Приносим извинения за неудобство! Вы можете повторно открыть окно, чтобы продолжить работу с того места, на котором остановились." } \ No newline at end of file diff --git a/i18n/rus/src/vs/editor/common/config/commonEditorConfig.i18n.json b/i18n/rus/src/vs/editor/common/config/commonEditorConfig.i18n.json index 9b6838aa6656d4fc32584216021b0bdc0aa22aba..64c88138d02a2c7a61f5797a64e0a82c756dda73 100644 --- a/i18n/rus/src/vs/editor/common/config/commonEditorConfig.i18n.json +++ b/i18n/rus/src/vs/editor/common/config/commonEditorConfig.i18n.json @@ -9,6 +9,7 @@ "fontWeight": "Управляет насыщенностью шрифта.", "fontSize": "Управляет размером шрифта в пикселях.", "lineHeight": "Управляет высотой строк. Укажите 0 для вычисления высоты строки по размеру шрифта.", + "letterSpacing": "Управляет интервалом между буквами в пикселях.", "lineNumbers": "Управляет видимостью номеров строк. Возможные значения: \"on\", \"off\" и \"relative\". Значение \"relative\" показывает количество строк, начиная с текущего положения курсора.", "rulers": "Столбцы, в которых должны отображаться вертикальные линейки", "wordSeparators": "Символы, которые будут использоваться как разделители слов при выполнении навигации или других операций, связанных со словами.", @@ -22,6 +23,8 @@ "minimap.enabled": "Определяет, отображается ли мини-карта", "minimap.renderCharacters": "Отображает фактические символы в строке вместо цветных блоков.", "minimap.maxColumn": "Ограничивает ширину мини-карты для отображения числа столбцов не больше определенного.", + "find.seedSearchStringFromSelection": "Определяет, можно ли передать строку поиска в мини-приложение поиска из текста, выделенного в редакторе", + "find.autoFindInSelection": "Определяет, будет ли снят флажок \"Поиск в выделенном\", когда в редакторе выбрано несколько символов или строк текста", "wordWrap.off": "Строки не будут переноситься никогда.", "wordWrap.on": "Строки будут переноситься по ширине окна просмотра.", "wordWrap.wordWrapColumn": "Строки будут переноситься по \"editor.wordWrapColumn\".", @@ -30,17 +33,19 @@ "wordWrapColumn": "Определяет столбец переноса редактора, если значение \"editor.wordWrap\" — \"wordWrapColumn\" или \"bounded\".", "wrappingIndent": "Управляет отступом строк с переносом по словам. Допустимые значения: \"none\", \"same\" или \"indent\".", "mouseWheelScrollSensitivity": "Множитель, используемый для параметров deltaX и deltaY событий прокрутки колесика мыши.", + "multiCursorModifier.ctrlCmd": "Соответствует клавише CTRL в Windows и Linux и клавише COMMAND в OS X.", + "multiCursorModifier.alt": "Соответствует клавише ALT в Windows и Linux и клавише OPTION в OS X.", + "multiCursorModifier": "Модификатор, который будет использоваться для добавления нескольких курсоров с помощью мыши. \"ctrlCmd\" соответствует клавише CTRL в Windows и Linux и клавише COMMAND в OS X. Жесты мыши \"Перейти к определению\" и \"Открыть ссылку\" будут изменены так, чтобы они не конфликтовали с несколькими курсорами.", "quickSuggestions.strings": "Разрешение кратких предложений в строках.", "quickSuggestions.comments": "Разрешение кратких предложений в комментариях.", "quickSuggestions.other": "Разрешение кратких предложений вне строк и комментариев.", "quickSuggestions": "Определяет, должны ли при вводе текста автоматически отображаться предложения", "quickSuggestionsDelay": "Управляет длительностью задержки (в мс), перед отображением кратких предложений.", - "parameterHints": "Включение подсказок для параметров", "autoClosingBrackets": "Определяет, должен ли редактор автоматически закрывать скобки после открытия.", "formatOnType": "Управляет параметром, определяющим, должен ли редактор автоматически форматировать строку после ввода.", "formatOnPaste": "Определяет, будет ли редактор автоматически форматировать вставленное содержимое. Модуль форматирования должен быть доступен и иметь возможность форматировать диапазон в документе.", "suggestOnTriggerCharacters": "Определяет, должны ли при вводе триггерных символов автоматически отображаться предложения.", - "acceptSuggestionOnEnter": "Определяет, будут ли предложения приниматься клавишей ВВОД в дополнение к клавише TAB. Это помогает избежать неоднозначности между вставкой новых строк и принятием предложений.", + "acceptSuggestionOnEnter": "Определяет, будут ли предложения приниматься клавишей ВВОД в дополнение к клавише TAB. Это помогает избежать неоднозначности между вставкой новых строк и принятием предложений. Значение \"smart\" означает, что при изменении текста предложения будут приниматься только при нажатии клавиши ВВОД.", "acceptSuggestionOnCommitCharacter": "Определяет, будут ли предложения приниматься символами фиксации. Например, в JavaScript точка с запятой (\";\") может быть символом фиксации, принимающим предложение и вводящим данный символ.", "snippetSuggestions": "Управляет отображением фрагментов вместе с другими предложениями и их сортировкой.", "emptySelectionClipboard": "Управляет тем, копируется ли текущая строка при копировании без выделения.", @@ -62,12 +67,17 @@ "renderLineHighlight": "Определяет, должен ли редактор выделять текущую строку. Возможные значения: none, gutter, line и all.", "codeLens": "Управляет показом групп связанных элементов кода в редакторе", "folding": "Определяет, включено ли сворачивание кода в редакторе.", + "showFoldingControls": "Определяет, будут ли автоматически скрываться элементы управления свертыванием на полях.", "matchBrackets": "Выделяет соответствующие скобки при выборе одной из них.", "glyphMargin": "Управляет отображением вертикальных полей глифа в редакторе. Поля глифа в основном используются для отладки.", "useTabStops": "Вставка и удаление пробелов после позиции табуляции", "trimAutoWhitespace": "Удалить автоматически вставляемый конечный пробел", "stablePeek": "Оставлять быстрые редакторы открытыми, даже если дважды щелкнуто их содержимое или нажата клавиша ESC.", "dragAndDrop": "Определяет, следует ли редактору разрешить перемещение выделенных элементов с помощью перетаскивания.", + "accessibilitySupport.auto": "Редактор будет определять, подключено ли средство чтения с экрана, с помощью API-интерфейсов платформы.", + "accessibilitySupport.on": "Редактор будет оптимизирован для использования со средством чтения с экрана в постоянном режиме.", + "accessibilitySupport.off": "Редактор никогда не будет оптимизироваться для использования со средством чтения с экрана.", + "accessibilitySupport": "Определяет, следует ли запустить редактор в режиме оптимизации для средства чтения с экрана.", "sideBySide": "Определяет, как редактор несовпадений отображает отличия: рядом или в тексте.", "ignoreTrimWhitespace": "Определяет, должен ли редактор несовпадений трактовать несовпадения символов-разделителей как различия.", "renderIndicators": "Определяет отображение редактором несовпадений индикаторов +/- для добавленных или удаленных изменений", diff --git a/i18n/rus/src/vs/editor/common/config/editorOptions.i18n.json b/i18n/rus/src/vs/editor/common/config/editorOptions.i18n.json index 90b3992a47d141197ad51a9df3293ba52c9baddd..38312a5dea7cad3b884cdb65512e95c9e1123efb 100644 --- a/i18n/rus/src/vs/editor/common/config/editorOptions.i18n.json +++ b/i18n/rus/src/vs/editor/common/config/editorOptions.i18n.json @@ -4,5 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "accessibilityOffAriaLabel": "Редактор сейчас недоступен. Чтобы открыть список действий, нажмите ALT+F1.", "editorViewAccessibleLabel": "Содержимое редактора" } \ No newline at end of file diff --git a/i18n/rus/src/vs/editor/common/view/editorColorRegistry.i18n.json b/i18n/rus/src/vs/editor/common/view/editorColorRegistry.i18n.json index 84955b080fe0bd2d885e23465443ba72d4d352c6..0292dc310ce953c96d10ca7f0244b84427d87163 100644 --- a/i18n/rus/src/vs/editor/common/view/editorColorRegistry.i18n.json +++ b/i18n/rus/src/vs/editor/common/view/editorColorRegistry.i18n.json @@ -10,5 +10,15 @@ "caret": "Цвет курсора редактора.", "editorWhitespaces": "Цвет пробелов в редакторе.", "editorIndentGuides": "Цвет направляющих для отступов редактора.", - "editorLineNumbers": "Цвет номеров строк редактора." + "editorLineNumbers": "Цвет номеров строк редактора.", + "editorRuler": "Цвет линейки редактора.", + "editorCodeLensForeground": "Цвет переднего плана элемента CodeLens в редакторе", + "editorBracketMatchBackground": "Цвет фона парных скобок", + "editorBracketMatchBorder": "Цвет прямоугольников парных скобок", + "editorOverviewRulerBorder": "Цвет границы для линейки в окне просмотра.", + "editorGutter": "Цвет фона поля в редакторе. В поле размещаются отступы глифов и номера строк.", + "errorForeground": "Цвет волнистой линии для выделения ошибок в редакторе.", + "errorBorder": "Цвет границ волнистой линии для выделения ошибок в редакторе.", + "warningForeground": "Цвет волнистой линии для выделения предупреждений в редакторе.", + "warningBorder": "Цвет границ волнистой линии для выделения предупреждений в редакторе." } \ No newline at end of file diff --git a/i18n/rus/src/vs/editor/contrib/find/common/findController.i18n.json b/i18n/rus/src/vs/editor/contrib/find/common/findController.i18n.json index 69fbb81b34d9b4623866c0a5ba74ced07cbe52b9..d6bc631d96ba911687c7012eb7102d5a4c3ca66e 100644 --- a/i18n/rus/src/vs/editor/contrib/find/common/findController.i18n.json +++ b/i18n/rus/src/vs/editor/contrib/find/common/findController.i18n.json @@ -14,6 +14,5 @@ "addSelectionToPreviousFindMatch": "Добавить выделенный фрагмент в предыдущее найденное совпадение", "moveSelectionToNextFindMatch": "Переместить последнее выделение в следующее найденное совпадение", "moveSelectionToPreviousFindMatch": "Переместить последний выделенный фрагмент в предыдущее найденное совпадение", - "selectAllOccurencesOfFindMatch": "Выбрать все вхождения найденных совпадений", "changeAll.label": "Изменить все вхождения" } \ No newline at end of file diff --git a/i18n/rus/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.i18n.json b/i18n/rus/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..e61942e5d18e7e4149a95f141e6ef3175f12ff1b --- /dev/null +++ b/i18n/rus/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.i18n.json @@ -0,0 +1,23 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "noResultWord": "Определение для \"{0}\" не найдено.", + "generic.noResults": "Определения не найдены.", + "meta.title": " — определения {0}", + "actions.goToDecl.label": "Перейти к определению", + "actions.goToDeclToSide.label": "Открыть определение сбоку", + "actions.previewDecl.label": "Показать определение", + "goToImplementation.noResultWord": "Не найдена реализация для \"{0}\".", + "goToImplementation.generic.noResults": "Не найдена реализация.", + "meta.implementations.title": "— {0} реализаций", + "actions.goToImplementation.label": "Перейти к реализации", + "actions.peekImplementation.label": "Показать реализацию", + "goToTypeDefinition.noResultWord": "Не найдено определение типа для \"{0}\".", + "goToTypeDefinition.generic.noResults": "Не найдено определение типа.", + "meta.typeDefinitions.title": "— {0} определений типов", + "actions.goToTypeDefinition.label": "Перейти к определению типа", + "actions.peekTypeDefinition.label": "Показать определение типа" +} \ No newline at end of file diff --git a/i18n/rus/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.i18n.json b/i18n/rus/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..a403ef380f2f76d7d16a153f8cb940872972599d --- /dev/null +++ b/i18n/rus/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "multipleResults": "Щелкните, чтобы отобразить определения ({0})." +} \ No newline at end of file diff --git a/i18n/rus/src/vs/editor/contrib/links/browser/links.i18n.json b/i18n/rus/src/vs/editor/contrib/links/browser/links.i18n.json index c2c9343c9c5405a6c752c0007498f178a8493bc9..9260a3d43678b8d8ba53f70458e82936e3eb0650 100644 --- a/i18n/rus/src/vs/editor/contrib/links/browser/links.i18n.json +++ b/i18n/rus/src/vs/editor/contrib/links/browser/links.i18n.json @@ -6,6 +6,7 @@ { "links.navigate.mac": "Щелкните с нажатой клавишей Cmd, чтобы перейти по ссылке", "links.navigate": "Щелкните с нажатой клавишей Ctrl, чтобы перейти по ссылке", + "links.navigate.al": "Щелкните с нажатой клавишей ALT, чтобы перейти по ссылке.", "invalid.url": "Не удалось открыть ссылку, так как она имеет неправильный формат: {0}", "missing.url": "Не удалось открыть ссылку, у нее отсутствует целевой объект.", "label": "Открыть ссылку" diff --git a/i18n/rus/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json b/i18n/rus/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json index cbed271e423993f6683a0186a0bdaed99d2aec93..95c9ccbe774e300aff78bd61309b32e661ff3403 100644 --- a/i18n/rus/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json +++ b/i18n/rus/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json @@ -5,8 +5,6 @@ // Do not edit this file. It is machine generated. { "aria.oneReference": "ссылка в {0} в строке {1} и символе {2}", - "aria.fileReferences.1": "Обнаружен 1 символ в {0}", - "aria.fileReferences.N": "{0} символов в {1}", "aria.result.0": "Результаты не найдены", "aria.result.1": "Обнаружен 1 символ в {0}", "aria.result.n1": "Обнаружено {0} символов в {1}", diff --git a/i18n/rus/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.i18n.json b/i18n/rus/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.i18n.json index 222d24b828811d65bc21d927053a1d3d5f512361..9b523c27fc1cec2f27bb6652323cc1026d59e793 100644 --- a/i18n/rus/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.i18n.json +++ b/i18n/rus/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.i18n.json @@ -16,9 +16,12 @@ "peekViewTitleInfoForeground": "Цвет сведений о заголовке быстрого редактора.", "peekViewBorder": "Цвет границ быстрого редактора и массива.", "peekViewResultsBackground": "Цвет фона в списке результатов представления быстрого редактора.", + "peekViewResultsMatchForeground": "Цвет переднего плана узлов строки в списке результатов быстрого редактора.", + "peekViewResultsFileForeground": "Цвет переднего плана узлов файла в списке результатов быстрого редактора.", "peekViewResultsSelectionBackground": "Цвет фона выбранной записи в списке результатов быстрого редактора.", "peekViewResultsSelectionForeground": "Цвет переднего плана выбранной записи в списке результатов быстрого редактора.", "peekViewEditorBackground": "Цвет фона быстрого редактора.", + "peekViewEditorGutterBackground": "Цвет фона поля в окне быстрого редактора.", "peekViewResultsMatchHighlight": "Цвет выделения совпадений в списке результатов быстрого редактора.", "peekViewEditorMatchHighlight": "Цвет выделения совпадений в быстром редакторе." } \ No newline at end of file diff --git a/i18n/rus/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json b/i18n/rus/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json index 83631e142ec2cfb54640760b5e6252b622028f0f..ef1bb257b470ec2d0f5ee562b64e668d135b57d9 100644 --- a/i18n/rus/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json +++ b/i18n/rus/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json @@ -12,6 +12,7 @@ "readMore": "Подробнее...{0}", "suggestionWithDetailsAriaLabel": "{0}, предложение, содержит данные", "suggestionAriaLabel": "{0}, предложение", + "readLess": "Кратко...{0}", "suggestWidget.loading": "Идет загрузка...", "suggestWidget.noSuggestions": "Предложения отсутствуют.", "suggestionAriaAccepted": "{0}, принято", diff --git a/i18n/rus/src/vs/editor/node/languageConfigurationExtensionPoint.i18n.json b/i18n/rus/src/vs/editor/node/languageConfigurationExtensionPoint.i18n.json index 103258a8625740baf021dcd4db261396c9c3fb54..ddeb7dc0a68423ae5975b1d3b6ef7f25707578e6 100644 --- a/i18n/rus/src/vs/editor/node/languageConfigurationExtensionPoint.i18n.json +++ b/i18n/rus/src/vs/editor/node/languageConfigurationExtensionPoint.i18n.json @@ -15,5 +15,9 @@ "schema.brackets": "Определяет символы скобок, увеличивающие или уменьшающие отступ.", "schema.autoClosingPairs": "Определяет пары скобок. Когда введена открывающая скобка, автоматически добавляется закрывающая.", "schema.autoClosingPairs.notIn": "Определяет список областей, где автоматические пары отключены.", - "schema.surroundingPairs": "Определяет пары скобок, в которые заключается выбранная строка." + "schema.surroundingPairs": "Определяет пары скобок, в которые заключается выбранная строка.", + "schema.wordPattern": "Определение слова для языка.", + "schema.wordPattern.pattern": "Шаблон регулярного выражения, используемый для сопоставления слов.", + "schema.wordPattern.flags": "Флаги регулярного выражения, используемого для сопоставления слов.", + "schema.wordPattern.flags.errorMessage": "Должно соответствовать шаблону \"/^([gimuy]+)$/\"." } \ No newline at end of file diff --git a/i18n/rus/src/vs/platform/actions/electron-browser/menusExtensionPoint.i18n.json b/i18n/rus/src/vs/platform/actions/electron-browser/menusExtensionPoint.i18n.json index 7221481729a28d8735298a02df15a958bb6b9571..6b77834c3913bd2e2a3ea93a6a29ea9f6ddedbe2 100644 --- a/i18n/rus/src/vs/platform/actions/electron-browser/menusExtensionPoint.i18n.json +++ b/i18n/rus/src/vs/platform/actions/electron-browser/menusExtensionPoint.i18n.json @@ -21,6 +21,8 @@ "menus.scmTitle": "Меню заголовков для системы управления версиями", "menus.resourceGroupContext": "Контекстное меню группы ресурсов для системы управления версиями", "menus.resourceStateContext": "Контекстное меню состояния ресурсов для системы управления версиями", + "view.viewTitle": "Меню заголовка для окна участников", + "view.itemContext": "Контекстное меню элемента для окна участников", "nonempty": "требуется непустое значение.", "opticon": "Свойство icon может быть пропущено или должно быть строкой или литералом, например \"{dark, light}\"", "requireStringOrObject": "Свойство \"{0}\" обязательно и должно иметь тип \"string\" или \"object\"", diff --git a/i18n/rus/src/vs/platform/extensions/common/extensionsRegistry.i18n.json b/i18n/rus/src/vs/platform/extensions/common/extensionsRegistry.i18n.json index fae3024afe1e2f5c1d977a7806e0f8188054e0a8..1cc3bfcebce6b49caf557821e0d355cec15e4ac2 100644 --- a/i18n/rus/src/vs/platform/extensions/common/extensionsRegistry.i18n.json +++ b/i18n/rus/src/vs/platform/extensions/common/extensionsRegistry.i18n.json @@ -14,6 +14,12 @@ "vscode.extension.contributes": "Все публикации расширения VS Code, представленные этим пакетом.", "vscode.extension.preview": "Добавляет метку \"Предварительная версия\" для расширения в Marketplace.", "vscode.extension.activationEvents": "События активации для расширения кода VS Code.", + "vscode.extension.activationEvents.onLanguage": "Событие активации выдается каждый раз, когда открывается файл, который разрешается к указанному языку.", + "vscode.extension.activationEvents.onCommand": "Событие активации выдается каждый раз при вызове указанной команды.", + "vscode.extension.activationEvents.onDebug": "Событие активации выдается каждый раз при запуске сеанса отладки указанного типа.", + "vscode.extension.activationEvents.workspaceContains": "Событие активации выдается каждый раз при открытии папки, содержащей по крайней мере один файл, который соответствует указанной стандартной маске.", + "vscode.extension.activationEvents.onView": "Событие активации выдается каждый раз при развертывании указанного окна.", + "vscode.extension.activationEvents.star": "Событие активации выдается при запуске VS Code. Для удобства пользователя используйте это событие в своем расширении только в том случае, если другие сочетания событий не подходят.", "vscode.extension.badges": "Массив эмблем, отображаемых на боковой панели страницы расширения Marketplace.", "vscode.extension.badges.url": "URL-адрес изображения эмблемы.", "vscode.extension.badges.href": "Ссылка на эмблему.", diff --git a/i18n/rus/src/vs/platform/history/electron-main/historyMainService.i18n.json b/i18n/rus/src/vs/platform/history/electron-main/historyMainService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..f3243b5f3b96d14482464db9a442512945c2c0c0 --- /dev/null +++ b/i18n/rus/src/vs/platform/history/electron-main/historyMainService.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "newWindow": "Новое окно", + "newWindowDesc": "Открывает новое окно", + "recentFolders": "Недавно использованные папки", + "folderDesc": "{0} {1}" +} \ No newline at end of file diff --git a/i18n/rus/src/vs/platform/markers/common/problemMatcher.i18n.json b/i18n/rus/src/vs/platform/markers/common/problemMatcher.i18n.json index 2595229d2aab299ef11caa15ab5fa863fa85d25b..c79907b2cf8b549ee5674712cae0fe74902bf71b 100644 --- a/i18n/rus/src/vs/platform/markers/common/problemMatcher.i18n.json +++ b/i18n/rus/src/vs/platform/markers/common/problemMatcher.i18n.json @@ -34,6 +34,7 @@ "ProblemMatcherParser.noValidIdentifier": "Ошибка: свойство шаблона {0} не является допустимым именем переменной шаблона.", "ProblemMatcherParser.problemPattern.watchingMatcher": "В сопоставителе проблем должны быть определены как начальный, так и конечный шаблоны для отслеживания.", "ProblemMatcherParser.invalidRegexp": "Ошибка: строка {0} не является допустимым регулярным выражением.\n", + "WatchingPatternSchema.regexp": "Регулярное выражение для обнаружения начала или конца фоновой задачи.", "WatchingPatternSchema.file": "Индекс группы сопоставления для имени файла. Может быть опущен.", "PatternTypeSchema.name": "Имя добавленного или предопределенного шаблона", "PatternTypeSchema.description": "Шаблон проблем либо имя добавленного или предопределенного шаблона проблем. Его можно опустить, если указано базовое значение.", @@ -42,6 +43,12 @@ "ProblemMatcherSchema.severity": "Серьезность по умолчанию для выявленных проблем. Используется, если в шаблоне не определена группа сопоставления для серьезности.", "ProblemMatcherSchema.applyTo": "Определяет, относится ли проблема, о которой сообщается для текстового документа, только к открытым, только к закрытым или ко всем документам.", "ProblemMatcherSchema.fileLocation": "Определяет способ интерпретации имен файлов, указываемых в шаблоне проблемы.", + "ProblemMatcherSchema.background": "Шаблоны для отслеживания начала и окончания фоновой задачи.", + "ProblemMatcherSchema.background.activeOnStart": "Если задано значение true, средство мониторинга фоновых задач будет находиться в активном режиме при запуске задачи. Это аналогично выдаче строки, соответствующей шаблону начала.", + "ProblemMatcherSchema.background.beginsPattern": "При наличии соответствия в выходных данных выдается сигнал о запуске фоновой задачи.", + "ProblemMatcherSchema.background.endsPattern": "При наличии соответствия в выходных данных выдается сигнал о завершении фоновой задачи.", + "ProblemMatcherSchema.watching.deprecated": "Это свойство для отслеживания устарело. Используйте цвет фона.", + "ProblemMatcherSchema.watching": "Шаблоны для отслеживания начала и окончания шаблона отслеживания.", "ProblemMatcherSchema.watching.activeOnStart": "Если задано значение true, наблюдатель находится в активном режиме, когда задача запускается. Это равносильно выдаче строки, соответствующей шаблону начала.", "ProblemMatcherSchema.watching.beginsPattern": "При соответствии в выходных данных сообщает о запуске задачи наблюдения.", "ProblemMatcherSchema.watching.endsPattern": "При соответствии в выходных данных сообщает о завершении задачи наблюдения.", diff --git a/i18n/rus/src/vs/platform/theme/common/colorRegistry.i18n.json b/i18n/rus/src/vs/platform/theme/common/colorRegistry.i18n.json index 6d4a756ac40b8cc92ef2178f732e3774e9aa7339..232f68c8367e47b67b08d8ab8e4074a521276b07 100644 --- a/i18n/rus/src/vs/platform/theme/common/colorRegistry.i18n.json +++ b/i18n/rus/src/vs/platform/theme/common/colorRegistry.i18n.json @@ -12,7 +12,6 @@ "focusBorder": "Общий цвет границ для элементов с фокусом. Этот цвет используется только в том случае, если не переопределен в компоненте.", "contrastBorder": "Дополнительная граница вокруг элементов, которая отделяет их от других элементов для улучшения контраста.", "activeContrastBorder": "Дополнительная граница вокруг активных элементов, которая отделяет их от других элементов для улучшения контраста.", - "selectionBackground": "Цвет фона выделенного текста в элементах пользовательского интерфейса (например, в поле для ввода значений или текстовом поле). Не применяется к области редактора и терминала.", "textSeparatorForeground": "Цвет для разделителей текста.", "textLinkForeground": "Цвет переднего плана для ссылок в тексте.", "textLinkActiveForeground": "Цвет переднего фона для активных ссылок в тексте.", @@ -36,11 +35,13 @@ "dropdownForeground": "Передний план раскрывающегося списка.", "dropdownBorder": "Граница раскрывающегося списка.", "listFocusBackground": "Фоновый цвет находящегося в фокусе элемента List/Tree, когда элемент List/Tree активен. На активном элементе List/Tree есть фокус клавиатуры, на неактивном — нет.", + "listFocusForeground": "Цвет переднего плана находящегося в фокусе элемента List/Tree, когда элемент List/Tree активен. На активном элементе List/Tree есть фокус клавиатуры, на неактивном — нет.", "listActiveSelectionBackground": "Фоновый цвет выбранного элемента List/Tree, когда элемент List/Tree активен. На активном элементе List/Tree есть фокус клавиатуры, на неактивном — нет.", "listActiveSelectionForeground": "Цвет переднего плана выбранного элемента List/Tree, когда элемент List/Tree активен. На активном элементе List/Tree есть фокус клавиатуры, на неактивном — нет.", "listInactiveSelectionBackground": "Фоновый цвет выбранного элемента List/Tree, когда элемент List/Tree неактивен. На активном элементе List/Tree есть фокус клавиатуры, на неактивном — нет.", "listInactiveSelectionForeground": "Цвет текста выбранного элемента List/Tree, когда элемент List/Tree неактивен. На активном элементе List/Tree есть фокус клавиатуры, на неактивном — нет.", "listHoverBackground": "Фоновый цвет элементов List/Tree при наведении курсора мыши.", + "listHoverForeground": "Цвет переднего плана элементов List/Tree при наведении курсора мыши.", "listDropBackground": "Фоновый цвет элементов List/Tree при перемещении с помощью мыши.", "highlight": "Цвет переднего плана для выделения соответствия при поиске по элементу List/Tree.", "pickerGroupForeground": "Цвет средства быстрого выбора для группировки меток.", @@ -54,9 +55,11 @@ "scrollbarSliderBackground": "Цвет фона ползунка.", "scrollbarSliderHoverBackground": "Цвет фона ползунка при наведении.", "scrollbarSliderActiveBackground": "Цвет фона активного ползунка.", + "progressBarBackground": "Цвет фона индикатора выполнения, который может отображаться для длительных операций.", "editorBackground": "Цвет фона редактора.", "editorForeground": "Цвет переднего плана редактора по умолчанию.", "editorWidgetBackground": "Цвет фона виджетов редактора, таких как найти/заменить.", + "editorWidgetBorder": "Цвет границы мини-приложений редактора. Этот цвет используется только в том случае, если у мини-приложения есть граница и если этот цвет не переопределен мини-приложением.", "editorSelection": "Цвет выделения редактора.", "editorInactiveSelection": "Цвет выделения в неактивном редакторе.", "editorSelectionHighlight": "Цвет регионов с тем же содержимым, что и в выделении.", @@ -70,5 +73,12 @@ "diffEditorInserted": "Цвет фона для добавленных строк.", "diffEditorRemoved": "Цвет фона для удаленных строк.", "diffEditorInsertedOutline": "Цвет контура для добавленных строк.", - "diffEditorRemovedOutline": "Цвет контура для удаленных строк." + "diffEditorRemovedOutline": "Цвет контура для удаленных строк.", + "mergeCurrentHeaderBackground": "Цвет фона текущего заголовка во внутренних конфликтах слияния.", + "mergeCurrentContentBackground": "Цвет фона текущего содержимого во внутренних конфликтах слияния.", + "mergeIncomingHeaderBackground": "Цвет фона входящего заголовка во внутренних конфликтах слияния.", + "mergeIncomingContentBackground": "Цвет фона входящего содержимого во внутренних конфликтах слияния.", + "mergeBorder": "Цвет границы заголовков и разделителя во внутренних конфликтах слияния.", + "overviewRulerCurrentContentForeground": "Цвет переднего плана линейки текущего окна во внутренних конфликтах слияния.", + "overviewRulerIncomingContentForeground": "Цвет переднего плана линейки входящего окна во внутренних конфликтах слияния." } \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/api/node/extHostTask.i18n.json b/i18n/rus/src/vs/workbench/api/node/extHostTask.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..4b90a12aaf247b4a1af0e887542958471d8df5e5 --- /dev/null +++ b/i18n/rus/src/vs/workbench/api/node/extHostTask.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "task.label": "{0}: {1}" +} \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/api/node/extHostTreeViews.i18n.json b/i18n/rus/src/vs/workbench/api/node/extHostTreeViews.i18n.json index 8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a..9f9c8f9221d8249c95724d9daae63f7103b1f7fa 100644 --- a/i18n/rus/src/vs/workbench/api/node/extHostTreeViews.i18n.json +++ b/i18n/rus/src/vs/workbench/api/node/extHostTreeViews.i18n.json @@ -3,4 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. -{} \ No newline at end of file +{ + "treeView.notRegistered": "Отсутствует зарегистрированное представление в виде дерева с идентификатором '{0}'.", + "treeItem.notFound": "Отсутствует элемент дерева с идентификатором '{0}'.", + "treeView.duplicateElement": "Элемент {0} уже зарегистрирован" +} \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/browser/actions/configureLocale.i18n.json b/i18n/rus/src/vs/workbench/browser/actions/configureLocale.i18n.json index 4b803b9827d23f9034d6d396343df01ea7e8a782..b6db31f0ebdecfc1a8108dc3dcb383a2bf95870f 100644 --- a/i18n/rus/src/vs/workbench/browser/actions/configureLocale.i18n.json +++ b/i18n/rus/src/vs/workbench/browser/actions/configureLocale.i18n.json @@ -7,6 +7,7 @@ "configureLocale": "Настроить язык", "displayLanguage": "Определяет язык интерфейса VSCode.", "doc": "Список поддерживаемых языков см. в {0}.", + "restart": "Для изменения значения требуется перезапуск VSCode.", "fail.createSettings": "Невозможно создать \"{0}\" ({1}).", "JsonSchema.locale": "Язык пользовательского интерфейса." } \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/browser/parts/activitybar/activitybarPart.i18n.json b/i18n/rus/src/vs/workbench/browser/parts/activitybar/activitybarPart.i18n.json index 8eb0fd363dfe235b909282cecb09ddd5883ee908..cdc81741e9ea8e430c4161cfc95ade3575e06d74 100644 --- a/i18n/rus/src/vs/workbench/browser/parts/activitybar/activitybarPart.i18n.json +++ b/i18n/rus/src/vs/workbench/browser/parts/activitybar/activitybarPart.i18n.json @@ -5,5 +5,6 @@ // Do not edit this file. It is machine generated. { "hideActivitBar": "Скрыть панель действий", - "activityBarAriaLabel": "Переключатель активного представления" + "activityBarAriaLabel": "Переключатель активного представления", + "globalActions": "Глобальные действия" } \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/browser/parts/editor/editorStatus.i18n.json b/i18n/rus/src/vs/workbench/browser/parts/editor/editorStatus.i18n.json index fe621363ede54422e5b12114663c0e1a4bfe02a5..be54f2a8fa9ac4e36c9f86e370af9fde28140bbb 100644 --- a/i18n/rus/src/vs/workbench/browser/parts/editor/editorStatus.i18n.json +++ b/i18n/rus/src/vs/workbench/browser/parts/editor/editorStatus.i18n.json @@ -10,7 +10,7 @@ "multiSelection": "Выделений: {0}", "endOfLineLineFeed": "LF", "endOfLineCarriageReturnLineFeed": "CRLF", - "tabFocusModeEnabled": "Клавиша TAB перемещает фокус", + "screenReaderDetectedExtra": "Если вы не используете средство чтения с экрана, измените значение параметра \"editor.accessibilitySupport\" на \"off\".", "disableTabMode": "Отключить режим специальных возможностей", "gotoLine": "Перейти к строке", "indentation": "Отступ", diff --git a/i18n/rus/src/vs/workbench/browser/parts/quickopen/quickopen.i18n.json b/i18n/rus/src/vs/workbench/browser/parts/quickopen/quickopen.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..b00914a41677c64848213c02aec768c503ff0099 --- /dev/null +++ b/i18n/rus/src/vs/workbench/browser/parts/quickopen/quickopen.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "quickOpen": "Перейти к файлу...", + "quickNavigateNext": "Перейти к следующему элементу в Quick Open.", + "quickNavigatePrevious": "Перейти к предыдущему элементу в Quick Open.", + "quickSelectNext": "Выбрать следующее в Quick Open", + "quickSelectPrevious": "Выбрать предыдущее в Quick Open" +} \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/browser/quickopen.i18n.json b/i18n/rus/src/vs/workbench/browser/quickopen.i18n.json index 2706fe8a1f006befa20731f385a9b2f2ed2c9af9..b1992b59c50ff1d51c95b353a111549aacf285ea 100644 --- a/i18n/rus/src/vs/workbench/browser/quickopen.i18n.json +++ b/i18n/rus/src/vs/workbench/browser/quickopen.i18n.json @@ -6,6 +6,5 @@ { "noResultsMatching": "Нет соответствующих результатов", "noResultsFound2": "Результаты не найдены", - "entryAriaLabel": "{0}, команда", - "noCommands": "Нет соответствующих команд" + "entryAriaLabel": "{0}, команда" } \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/browser/viewlet.i18n.json b/i18n/rus/src/vs/workbench/browser/viewlet.i18n.json index 9df902210c790fd974c3f02bed6031089e38511d..c5dc5c2265a2e328bfa991ee3adf40a897faca65 100644 --- a/i18n/rus/src/vs/workbench/browser/viewlet.i18n.json +++ b/i18n/rus/src/vs/workbench/browser/viewlet.i18n.json @@ -4,6 +4,5 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "collapse": "Свернуть все", - "viewToolbarAriaLabel": "Действий: {0}" + "collapse": "Свернуть все" } \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/common/theme.i18n.json b/i18n/rus/src/vs/workbench/common/theme.i18n.json index 76b8cda3228df3e72defd098f3ec1648d89b5f7c..2addbdf64784d9470aba557911f897fd1a96ab83 100644 --- a/i18n/rus/src/vs/workbench/common/theme.i18n.json +++ b/i18n/rus/src/vs/workbench/common/theme.i18n.json @@ -7,11 +7,16 @@ "tabActiveBackground": "Цвет фона активной вкладки. Вкладки — это контейнеры для редакторов в области редактора. В одной группе редакторов можно открыть несколько вкладок. Может присутствовать несколько групп редакторов.", "tabInactiveBackground": "Цвет фона неактивной вкладки. Вкладки — это контейнеры для редакторов в области редактора. В одной группе редакторов можно открыть несколько вкладок. Может присутствовать несколько групп редакторов.", "tabBorder": "Граница для разделения вкладок. Вкладки — это контейнеры для редакторов в области редакторов. В одной группе редакторов можно открыть несколько вкладок. Может быть несколько групп редакторов.", - "tabActiveEditorGroupActiveForeground": "Цвет переднего плана активной вкладки в активной группе. Вкладки — это контейнеры для редакторов в области редактора. В одной группе редакторов можно открыть несколько вкладок. Может присутствовать несколько групп редакторов.", - "tabInactiveEditorGroupActiveForeground": "Цвет переднего плана неактивной вкладки в активной группе. Вкладки — это контейнеры для редакторов в области редактора. В одной группе редакторов можно открыть несколько вкладок. Может присутствовать несколько групп редакторов.", + "tabActiveForeground": "Цвет переднего плана активной вкладки в активной группе. Вкладки — это контейнеры для редакторов в области редактора. В одной группе редакторов можно открыть несколько вкладок. Может присутствовать несколько групп редакторов.", + "tabInactiveForeground": "Цвет переднего плана неактивной вкладки в активной группе. Вкладки — это контейнеры для редакторов в области редактора. В одной группе редакторов можно открыть несколько вкладок. Может присутствовать несколько групп редакторов.", + "tabUnfocusedActiveForeground": "Цвет переднего плана активной вкладки в неактивной группе. Вкладки — это контейнеры для редакторов в области редактора. В одной группе редакторов можно открыть несколько вкладок. Может присутствовать несколько групп редакторов.", + "tabUnfocusedInactiveForeground": "Цвет переднего плана неактивной вкладки в неактивной группе. Вкладки — это контейнеры для редакторов в области редактора. В одной группе редакторов можно открыть несколько вкладок. Может присутствовать несколько групп редакторов.", "editorGroupBackground": "Цвет фона группы редакторов. Группы редакторов представляют собой контейнеры редакторов. Цвет фона отображается при перетаскивании групп редакторов.", + "tabsContainerBackground": "Цвет фона для заголовка группы редакторов, когда вкладки включены. Группы редакторов представляют собой контейнеры редакторов.", + "tabsContainerBorder": "Цвет границы для заголовка группы редакторов, когда вкладки включены. Группы редакторов представляют собой контейнеры редакторов.", "editorGroupHeaderBackground": "Цвет фона для заголовка группы редакторов, когда вкладки отключены. Группы редакторов представляют собой контейнеры редакторов.", "editorGroupBorder": "Цвет для разделения нескольких групп редакторов. Группы редакторов — это контейнеры редакторов.", + "editorDragAndDropBackground": "Цвет фона при перетаскивании редакторов. Этот цвет должен обладать прозрачностью, чтобы содержимое редактора оставалось видимым.", "panelBackground": "Цвет фона панели. Панели показаны под областью редактора и содержат такие представления, как выходные данные и встроенный терминал.", "panelBorder": "Цвет верхней границы панели, отделяющей ее от редактора. Панели показаны под областью редактора и содержат такие представления, как выходные данные и встроенный терминал.", "panelActiveTitleForeground": "Цвет заголовка для активной панели. Панели отображаются под областью редактора и содержат такие представления, как окно вывода и встроенный терминал.", @@ -19,18 +24,25 @@ "panelActiveTitleBorder": "Цвет границ для заголовка активной панели. Панели отображаются под областью редактора и содержат такие представления, как окно вывода и встроенный терминал.", "statusBarForeground": "Цвет переднего плана панели состояния. Панель состояния отображается внизу окна.", "statusBarBackground": "Цвет фона стандартной панели состояния. Панель состояния отображается внизу окна.", + "statusBarBorder": "Цвет границы строки состояния, который распространяется на боковую панель и редактор. Строка состояния расположена в нижней части окна.", "statusBarNoFolderBackground": "Цвет фона панели состояния, если папка не открыта. Панель состояния отображается внизу окна.", + "statusBarNoFolderForeground": "Цвет переднего плана строки состояния, если папка не открыта. Строка состояния отображается в нижней части окна.", "statusBarItemActiveBackground": "Цвет фона элементов панели состояния при щелчке. Панель состояния отображается внизу окна.", "statusBarItemHoverBackground": "Цвет фона элементов панели состояния при наведении. Панель состояния отображается внизу окна.", "statusBarProminentItemBackground": "Цвет фона приоритетных элементов панели состояния. Приоритетные элементы выделяются на фоне других элементов панели состояния, чтобы подчеркнуть их значение. Панель состояния отображается в нижней части окна.", "statusBarProminentItemHoverBackground": "Цвет фона приоритетных элементов панели состояния при наведении. Приоритетные элементы выделяются на фоне других элементов панели состояния, чтобы подчеркнуть их значение. Панель состояния отображается в нижней части окна.", "activityBarBackground": "Цвет фона панели действий. Панель действий отображается слева или справа и позволяет переключаться между представлениями боковой панели.", "activityBarForeground": "Цвет переднего плана панели действий (например, цвет, используемый для значков). Панель действий отображается слева или справа и позволяет переключаться между представлениями боковой панели.", + "activityBarBorder": "Цвет границы панели действий, который распространяется на боковую панель. Панель действий отображается слева или справа и позволяет переключаться между представлениями в боковой панели.", + "activityBarDragAndDropBackground": "Цвет панели обратной связи при перетаскивании для элементов панели действий. Цвет должен обладать прозрачностью, чтобы содержимое панели действий оставалось видимым. Панель действий отображается с правого или с левого края и позволяет переключаться между представлениями в боковой панели.", "activityBarBadgeBackground": "Цвет фона значка уведомлений о действиях. Панель действий отображается слева или справа и позволяет переключаться между представлениями боковой панели.", "activityBarBadgeForeground": "Цвет переднего плана значка уведомлений о действиях. Панель действий отображается слева или справа и позволяет переключаться между представлениями боковой панели.", "sideBarBackground": "Цвет фона боковой панели. Боковая панель — это контейнер таких представлений, как проводник и поиск.", + "sideBarForeground": "Цвет переднего плана боковой панели. Боковая панель — это контейнер для таких представлений, как проводник и поиск.", + "sideBarBorder": "Цвет границы боковой панели со стороны редактора. Боковая панель — это контейнер для таких представлений, как проводник и поиск.", "sideBarTitleForeground": "Цвет переднего плана заголовка боковой панели. Боковая панель — это контейнер для таких представлений, как проводник и поиск.", "sideBarSectionHeaderBackground": "Цвет фона для заголовка раздела боковой панели. Боковая панель — это контейнер для таких представлений, как проводник и поиск.", + "sideBarSectionHeaderForeground": "Цвет переднего плана для заголовка раздела боковой панели. Боковая панель — это контейнер для таких представлений, как проводник и поиск.", "titleBarActiveForeground": "Передний план панели заголовка, если окно активно. Обратите внимание, что этот цвет сейчас поддерживается только в macOS.", "titleBarInactiveForeground": "Передний план панели заголовка, если окно неактивно. Обратите внимание, что этот цвет сейчас поддерживается только в macOS.", "titleBarActiveBackground": "Фон панели заголовка, если окно активно. Обратите внимание, что этот цвет сейчас поддерживается только в macOS.", diff --git a/i18n/rus/src/vs/workbench/electron-browser/actions.i18n.json b/i18n/rus/src/vs/workbench/electron-browser/actions.i18n.json index 867ffadb0a4bd8c7926a9250a8e1b581bcfb6a3c..5d2a1aca0bb2f8c93e6345445636c31884ad0636 100644 --- a/i18n/rus/src/vs/workbench/electron-browser/actions.i18n.json +++ b/i18n/rus/src/vs/workbench/electron-browser/actions.i18n.json @@ -6,9 +6,6 @@ { "closeActiveEditor": "Закрыть редактор", "closeWindow": "Закрыть окно", - "switchWindow": "Переключить окно", - "switchWindowPlaceHolder": "Выберите окно", - "current": "Текущее окно", "closeFolder": "Закрыть папку", "noFolderOpened": "В настоящий момент в этом экземпляре нет открытой папки, которую можно было бы закрыть.", "newWindow": "Новое окно", @@ -20,7 +17,7 @@ "zoomReset": "Сбросить масштаб", "appPerf": "Производительность запуска", "reloadWindow": "Перезагрузить окно", - "openRecent": "Открыть последний", + "current": "Текущее окно", "folders": "папки", "files": "файлы", "openRecentPlaceHolderMac": "Выбрать путь (удерживайте клавишу CMD, чтобы открыть в новом окне)", @@ -32,10 +29,6 @@ "openDocumentationUrl": "Документация", "openIntroductoryVideosUrl": "Вступительные видео", "toggleSharedProcess": "Переключить общий процесс", - "navigateLeft": "Перейти к части представления слева", - "navigateRight": "Перейти к части представления справа", - "navigateUp": "Перейти к части представления вверху", - "navigateDown": "Перейти к части представления внизу", "increaseViewSize": "Увеличить размер текущего представления", "decreaseViewSize": "Уменьшить размер текущего представления" } \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/electron-browser/main.contribution.i18n.json b/i18n/rus/src/vs/workbench/electron-browser/main.contribution.i18n.json index ff2b65c8faba0c9145c06f4d252017bb57992582..d3dd4c58f44933d291421dfbff71509d629fcdd1 100644 --- a/i18n/rus/src/vs/workbench/electron-browser/main.contribution.i18n.json +++ b/i18n/rus/src/vs/workbench/electron-browser/main.contribution.i18n.json @@ -7,6 +7,7 @@ "view": "Просмотреть", "help": "Справка", "file": "Файл", + "developer": "Разработчик", "showEditorTabs": "Определяет, должны ли открытые редакторы отображаться на вкладках или нет.", "editorTabCloseButton": "Определяет положение кнопок закрытия вкладок редактора или отключает их, если задано значение off.", "showIcons": "Определяет, должны ли открытые редакторы отображаться со значком. Требует включить тему значков.", @@ -30,10 +31,6 @@ "window.openFoldersInNewWindow.off": "Папки будут заменять последнее активное окно.", "window.openFoldersInNewWindow.default": "Папки будут открываться в новом окне, если папка не выбрана в приложении (например, в меню \"Файл\").", "openFoldersInNewWindow": "Определяет, будут ли папки открываться в новом окне или заменять последнее активное окно.\n- default: папки будут открываться в новом окне, если папка не выбрана из приложения (например, из меню \"Файл\").\n- on: папки будут открываться в новом окне.\n- off: папки будут заменять последнее активное окно.\nОбратите внимание, что возможны случаи, когда этот параметр игнорируется (например, при использовании параметра командной строки -new-window или -reuse-window).", - "window.reopenFolders.none": "Запрет повторного открытия папки.", - "window.reopenFolders.one": "Повторное открытие последней активной папки.", - "window.reopenFolders.all": "Повторное открытие всех папок последнего сеанса.", - "reopenFolders": "Управляет повторным открытием папок после перезапуска. Выберите значение \"none\", чтобы не открывать папку повторно, \"one\", чтобы открывалась последняя папка, с которой вы работали, или \"all\", чтобы открывались все папки последнего сеанса.", "restoreFullscreen": "Определяет, должно ли окно восстанавливаться в полноэкранном режиме, если оно было закрыто в полноэкранном режиме.", "zoomLevel": "Настройте масштаб окна. Исходный размер равен 0. Увеличение или уменьшение значения на 1 означает увеличение или уменьшение окна на 20 %. Чтобы более точно задать масштаб, можно также ввести десятичное число.", "title": "Определяет заголовок окна в зависимости от активного редактора. Переменные заменяются на основании контекста.\n${activeEditorShort}: например, myFile.txt\n${activeEditorMedium}: например, myFolder/myFile.txt\n${activeEditorLong}: например, /Users/Development/myProject/myFolder/myFile.txt\n${rootName}: например, myProject\n${rootPath}: например, /Users/Development/myProject\n${appName}: например, VS Code\n${dirty}: индикатор \"грязного\", если активный редактор является \"грязным\"\n${separator}: условный разделитель (\" - \"), который отображается, только если окружен переменными со значениями.", @@ -41,11 +38,13 @@ "window.newWindowDimensions.inherit": "Открывать новые окна того же размера, что и последнее активное окно.", "window.newWindowDimensions.maximized": "Открывать новые окна в развернутом состоянии.", "window.newWindowDimensions.fullscreen": "Открывать новые окна в полноэкранном режиме.", + "newWindowDimensions": "Определяет размеры нового открывающегося окна, если по крайней мере одно окно уже открыто. По умолчанию новое окно будет открыто в центре экрана в уменьшенном размере. Если указано значение \"inherit\", размеры нового окна будут равны размерам последнего активного окна. Если указано значение \"maximized\", окно будет открыто в максимальном размере, а если указано значение \"fullscreen\", окно будет открыто в полноэкранном режиме. Обратите внимание, что этот параметр не влияет на первое открываемое окно. Размеры и расположение первого окна всегда будут совпдаать с размерами и расположением этого окна перед закрытием.", "window.menuBarVisibility.default": "Меню скрыто только в полноэкранном режиме.", "window.menuBarVisibility.visible": "Меню всегда видимо, даже в полноэкранном режиме.", "window.menuBarVisibility.toggle": "Меню скрыто, но его можно вывести с помощью клавиши ALT.", "window.menuBarVisibility.hidden": "Меню всегда скрыто.", "menuBarVisibility": "Определяет видимость строки меню. Значение toggle указывает, что строка меню скрыта и для ее вывода нужно один раз нажать клавишу ALT. По умолчанию строка меню не будет отображаться только в полноэкранном режиме.", + "enableMenuBarMnemonics": "Если этот параметр установлен, главные меню можно открыть с помощью сочетаний клавиш с клавишей ALT. Отключение назначенных клавиш позволит связать эти сочетания клавиш с клавишей ALT с командами редактора.", "autoDetectHighContrast": "Если включено, будет выполняться автоматический переход к высококонтрастной теме, если в Windows используется тема высокой контрастности, или к темной теме при выходе из темы высокой контрастности Windows.", "titleBarStyle": "Настройка внешнего вида заголовка окна. Чтобы применить изменения, потребуется полный перезапуск.", "window.nativeTabs": "Включает вкладки окна macOS Sierra. Обратите внимание, что для применения этих изменений потребуется полная перезагрузка, и что для всех внутренних вкладок будет отключен пользовательский стиль заголовка, если он был настроен.", @@ -55,5 +54,7 @@ "zenMode.hideTabs": "Определяет, будет ли включение режима Zen также скрывать вкладки рабочего места.", "zenMode.hideStatusBar": "Определяет, будет ли включение режима Zen также скрывать строку состояния в нижней части рабочего места.", "zenMode.hideActivityBar": "Определяет, будет ли при включении режима Zen скрыта панель действий в левой части рабочей области.", - "zenMode.restore": "Определяет, должно ли окно восстанавливаться в режиме Zen, если закрылось в режиме Zen." + "zenMode.restore": "Определяет, должно ли окно восстанавливаться в режиме Zen, если закрылось в режиме Zen.", + "workspaceConfigurationTitle": "Рабочая область", + "files.exclude.boolean": "Стандартная маска, соответствующая путям к файлам. Задайте значение true или false, чтобы включить или отключить маску." } \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/electron-browser/workbench.i18n.json b/i18n/rus/src/vs/workbench/electron-browser/workbench.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..1aca4f5d59c4600bfe7f7d8801292165d947c914 --- /dev/null +++ b/i18n/rus/src/vs/workbench/electron-browser/workbench.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "developer": "Разработчик", + "file": "Файл" +} \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/codeEditor/electron-browser/accessibility.i18n.json b/i18n/rus/src/vs/workbench/parts/codeEditor/electron-browser/accessibility.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..b6a2c9c7653f0155fb23855f8518095e734f0876 --- /dev/null +++ b/i18n/rus/src/vs/workbench/parts/codeEditor/electron-browser/accessibility.i18n.json @@ -0,0 +1,26 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "emergencyConfOn": "Установка значения \"on\" для параметра \"editor.accessibilitySupport\".", + "openingDocs": "Открывается страница документации по специальным возможностям VS Code.", + "introMsg": "Благодарим за ознакомление со специальными возможностями VS Code.", + "status": "Состояние:", + "changeConfigToOnMac": "Чтобы включить постоянную оптимизацию редактора для использования со средствами чтения с экрана, нажмите COMMMAND+E.", + "changeConfigToOnWinLinux": "Чтобы включить постоянную оптимизацию редактора для использования со средствами чтения с экрана, нажмите CTRL+E.", + "auto_unknown": "В редакторе настроено определение средства чтения с экрана с помощью API платформы, но текущая среда выполнения это не поддерживает.", + "auto_on": "Редактор автоматически определил, что средство чтения с экрана подключено.", + "auto_off": "В редакторе настроено автоматическое определение средства чтения с экрана, но сейчас это средство не подключено.", + "configuredOn": "Постоянная оптимизацию редактора для использования со средствами чтения с экрана включена. Чтобы ее отключить, измените параметр \"editor.accessibilitySupport\".", + "configuredOff": "Для редактора не настроена оптимизация для использования со средствами чтения с экрана.", + "tabFocusModeOnMsg": "При нажатии клавиши TAB в текущем редакторе фокус ввода переместится на следующий элемент, способный его принять. Чтобы изменить это поведение, нажмите клавишу {0}.", + "tabFocusModeOnMsgNoKb": "При нажатии клавиши TAB в текущем редакторе фокус ввода переместится на следующий элемент, способный его принять. Команду {0} сейчас невозможно выполнить с помощью настраиваемого сочетания клавиш.", + "tabFocusModeOffMsg": "При нажатии клавиши TAB в текущем редакторе будет вставлен символ табуляции. Чтобы изменить это поведение, нажмите клавишу {0}.", + "tabFocusModeOffMsgNoKb": "При нажатии клавиши TAB в текущем редакторе будет вставлен символ табуляции. Команду {0} сейчас невозможно выполнить с помощью настраиваемого сочетания клавиш.", + "openDocMac": "Нажмите COMMAND+H, чтобы открыть окно браузера с дополнительными сведениями о специальных возможностях VS Code.", + "openDocWinLinux": "Нажмите CTRL+H, чтобы открыть окно браузера с дополнительными сведениями о специальных возможностях VS Code.", + "outroMsg": "Вы можете закрыть эту подсказку и вернуться в редактор, нажав клавиши ESCAPE или SHIFT+ESCAPE.", + "ShowAccessibilityHelpAction": "Показать справку по специальным возможностям" +} \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/codeEditor/electron-browser/inspectTMScopes.i18n.json b/i18n/rus/src/vs/workbench/parts/codeEditor/electron-browser/inspectTMScopes.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a --- /dev/null +++ b/i18n/rus/src/vs/workbench/parts/codeEditor/electron-browser/inspectTMScopes.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{} \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/codeEditor/electron-browser/toggleMultiCursorModifier.i18n.json b/i18n/rus/src/vs/workbench/parts/codeEditor/electron-browser/toggleMultiCursorModifier.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..62f29e0311a41b9481189bda628108c3e4c5c5aa --- /dev/null +++ b/i18n/rus/src/vs/workbench/parts/codeEditor/electron-browser/toggleMultiCursorModifier.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "toggleLocation": "Включить или отключить режим с несколькими курсорами" +} \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/debug/browser/debugActions.i18n.json b/i18n/rus/src/vs/workbench/parts/debug/browser/debugActions.i18n.json index 0a2abc6c1db6a301d35b567728696963ed2d0a96..fca987ec803247f896d944075874464f971c5585 100644 --- a/i18n/rus/src/vs/workbench/parts/debug/browser/debugActions.i18n.json +++ b/i18n/rus/src/vs/workbench/parts/debug/browser/debugActions.i18n.json @@ -6,6 +6,7 @@ { "openLaunchJson": "Открыть {0}", "launchJsonNeedsConfigurtion": "Настройте или исправьте \"launch.json\"", + "noFolderDebugConfig": "Чтобы перейти к расширенной конфигурации отладки, сначала откройте папку.", "startDebug": "Начать отладку", "startWithoutDebugging": "Начать без отладки", "selectAndStartDebugging": "Выбрать и начать отладку", diff --git a/i18n/rus/src/vs/workbench/parts/debug/electron-browser/debugCommands.i18n.json b/i18n/rus/src/vs/workbench/parts/debug/electron-browser/debugCommands.i18n.json index 8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a..aa388e9709f749b0add4c4480f4a6e1bd86d7170 100644 --- a/i18n/rus/src/vs/workbench/parts/debug/electron-browser/debugCommands.i18n.json +++ b/i18n/rus/src/vs/workbench/parts/debug/electron-browser/debugCommands.i18n.json @@ -3,4 +3,6 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. -{} \ No newline at end of file +{ + "noFolderDebugConfig": "Перед расширенной настройкой отладки откройте папку." +} \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/debug/electron-browser/debugService.i18n.json b/i18n/rus/src/vs/workbench/parts/debug/electron-browser/debugService.i18n.json index 4dceb7811c07582845940632716f44425f816455..342aae775b8788576ec1185de4195ad9f7f0b2f9 100644 --- a/i18n/rus/src/vs/workbench/parts/debug/electron-browser/debugService.i18n.json +++ b/i18n/rus/src/vs/workbench/parts/debug/electron-browser/debugService.i18n.json @@ -5,8 +5,8 @@ // Do not edit this file. It is machine generated. { "snapshotObj": "Для этого объекта показаны только значения-примитивы.", - "debuggingStarted": "Отладка началась.", "debuggingPaused": "Отладка была приостановлена, причина {0}, {1} {2}", + "debuggingStarted": "Отладка началась.", "debuggingStopped": "Отладка остановилась.", "breakpointAdded": "Добавлена точка останова: строка {0}, файл {1}", "breakpointRemoved": "Удалена точка останова: строка {0}, файл {1}", diff --git a/i18n/rus/src/vs/workbench/parts/debug/electron-browser/debugViews.i18n.json b/i18n/rus/src/vs/workbench/parts/debug/electron-browser/debugViews.i18n.json index 80a8dddc8409a0e2e5cc9d5395b2c0e321152e06..5773174ff02e8b491f1e2f1b1f781bbf30857758 100644 --- a/i18n/rus/src/vs/workbench/parts/debug/electron-browser/debugViews.i18n.json +++ b/i18n/rus/src/vs/workbench/parts/debug/electron-browser/debugViews.i18n.json @@ -5,16 +5,12 @@ // Do not edit this file. It is machine generated. { "variablesSection": "Раздел переменных", - "variables": "Переменные", "variablesAriaTreeLabel": "Отладка переменных", "expressionsSection": "Раздел выражений", - "watch": "Контрольное значение", "watchAriaTreeLabel": "Отладка выражений контрольных значений", "callstackSection": "Раздел стека вызовов", "debugStopped": "Приостановлено на {0}", - "callStack": "Стек вызовов", "callStackAriaLabel": "Отладка стека вызовов", "breakpointsSection": "Раздел точек останова", - "breakpoints": "Точки останова", "breakpointsAriaTreeLabel": "Отладка точек останова" } \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/debug/electron-browser/electronDebugActions.i18n.json b/i18n/rus/src/vs/workbench/parts/debug/electron-browser/electronDebugActions.i18n.json index c4b97bcfe108d57014f469e81091b9bccd60cbb2..3f8d10ed5bd10eaa5d30d46b9839ad283d5de3b6 100644 --- a/i18n/rus/src/vs/workbench/parts/debug/electron-browser/electronDebugActions.i18n.json +++ b/i18n/rus/src/vs/workbench/parts/debug/electron-browser/electronDebugActions.i18n.json @@ -6,5 +6,6 @@ { "copyValue": "Копировать значение", "copy": "Копировать", + "copyAll": "Копировать все", "copyStackTrace": "Копировать стек вызовов" } \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/debug/electron-browser/statusbarColorProvider.i18n.json b/i18n/rus/src/vs/workbench/parts/debug/electron-browser/statusbarColorProvider.i18n.json index fa2fb421cfc1d54a5aa769c9d0587e93e95bb18c..bf63a86ed4abb041df809fc50fa111b16d1e62ee 100644 --- a/i18n/rus/src/vs/workbench/parts/debug/electron-browser/statusbarColorProvider.i18n.json +++ b/i18n/rus/src/vs/workbench/parts/debug/electron-browser/statusbarColorProvider.i18n.json @@ -4,5 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "statusBarDebuggingBackground": "Цвет фона панели состояния при отладке программы. Панель состояния показана внизу окна." + "statusBarDebuggingBackground": "Цвет фона панели состояния при отладке программы. Панель состояния показана внизу окна.", + "statusBarDebuggingForeground": "Цвет переднего плана строки состояния при отладке программы. Строка состояния расположена в нижней части окна." } \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json b/i18n/rus/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json index 90a5d4e861ea8cf1b15f2aeea17390f675f9165c..109e9178c2dd038e4b1777560f4c2a707d9c61b2 100644 --- a/i18n/rus/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json +++ b/i18n/rus/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json @@ -7,6 +7,7 @@ "debugAdapterBinNotFound": "Исполняемый файл адаптера отладки \"{0}\" не существует.", "debugAdapterCannotDetermineExecutable": "Невозможно определить исполняемый файл для адаптера отладки \"{0}\".", "debugType": "Тип конфигурации.", + "debugTypeNotRecognised": "Не удается распознать тип отладки. Убедитесь, что соответствующее расширение отладки установлено и включено.", "node2NotSupported": "Значение \"node2\" больше не поддерживается; используйте \"node\" и задайте для атрибута \"protocol\" значение \"inspector\".", "debugName": "Имя конфигурации; отображается в раскрывающемся меню конфигурации запуска.", "debugRequest": "Запросите тип конфигурации. Возможные типы: \"запуск\" и \"подключение\".", diff --git a/i18n/rus/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json b/i18n/rus/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json index 4a07fdffeba2259ec282fc4863f091417af9f2a2..c7a704d95062a6020d3584ca939f022c42e7fb14 100644 --- a/i18n/rus/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json +++ b/i18n/rus/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json @@ -4,6 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "previousEditPoint": "Emmet: предыдущая точка изменения", - "nextEditPoint": "Emmet: следующая точка изменения" + "previousEditPoint": "Emmet: перейти к предыдущей точке изменения", + "nextEditPoint": "Emmet: перейти к следующей точке изменения" } \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json b/i18n/rus/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json index b632b35fef61783fe96648109df9050cf04134df..92ea6283604db2c2a4bedd94c2388b9753b11ddc 100644 --- a/i18n/rus/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json +++ b/i18n/rus/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json @@ -9,5 +9,6 @@ "emmetPreferences": "Настройки, которые используются для изменения поведения некоторых действий и сопоставителей Emmet.", "emmetSyntaxProfiles": "Задайте профиль для указанного синтаксиса или используйте свой собственный профиль с определенными правилами.", "emmetExclude": "Массив языков, в которых не должны развертываться сокращения Emmet.", - "emmetExtensionsPath": "Путь к папке, содержащей профили Emmet, фрагменты кода и настройки" + "emmetExtensionsPath": "Путь к папке, содержащей профили Emmet, фрагменты кода и настройки", + "useNewEmmet": "Попробуйте новые модули emmet (которые в конечном итоге заменят устаревшую библиотеку emmet), чтобы ознакомиться со всеми функциями emmet." } \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/extensions/browser/extensionEditor.i18n.json b/i18n/rus/src/vs/workbench/parts/extensions/browser/extensionEditor.i18n.json index c74eca64051a2658212a7719000c9cc0a5528387..fd46efd99544846c99c4a6b40a1320936b7b1175 100644 --- a/i18n/rus/src/vs/workbench/parts/extensions/browser/extensionEditor.i18n.json +++ b/i18n/rus/src/vs/workbench/parts/extensions/browser/extensionEditor.i18n.json @@ -24,6 +24,10 @@ "default": "По умолчанию", "debuggers": "Отладчики ({0})", "debugger name": "Имя", + "views": "Представления ({0})", + "view id": "Идентификатор", + "view name": "Имя", + "view location": "Где", "themes": "Темы ({0})", "JSON Validation": "Проверка JSON ({0})", "commands": "Команды ({0})", diff --git a/i18n/rus/src/vs/workbench/parts/extensions/browser/extensionsActions.i18n.json b/i18n/rus/src/vs/workbench/parts/extensions/browser/extensionsActions.i18n.json index 34a96c349af3cddaecfad0f01f964f3a16c2ebcb..b01a24938599c2f028d182bf6682c5bd1b46060c 100644 --- a/i18n/rus/src/vs/workbench/parts/extensions/browser/extensionsActions.i18n.json +++ b/i18n/rus/src/vs/workbench/parts/extensions/browser/extensionsActions.i18n.json @@ -22,6 +22,8 @@ "disableGloballyAction": "Всегда", "disableAction": "Отключить", "checkForUpdates": "Проверка обновлений", + "enableAutoUpdate": "Включить автоматическое обновление расширений", + "disableAutoUpdate": "Отключить автоматическое обновление расширений", "updateAll": "Обновить все расширения", "reloadAction": "Перезагрузка", "postUpdateTooltip": "Обновление окна для обновления", @@ -44,6 +46,8 @@ "showWorkspaceRecommendedExtensions": "Показать рекомендуемые расширения рабочей области", "showRecommendedKeymapExtensions": "Показать рекомендуемые раскладки клавиатуры", "showRecommendedKeymapExtensionsShort": "Раскладки клавиатуры", + "showLanguageExtensions": "Показать расширения языка", + "showLanguageExtensionsShort": "Расширения языка", "configureWorkspaceRecommendedExtensions": "Настроить рекомендуемые расширения (рабочая область)", "ConfigureWorkspaceRecommendations.noWorkspace": "Рекомендации доступны только для папки рабочей области.", "OpenExtensionsFile.failed": "Не удается создать файл \"extensions.json\" в папке \".vscode\" ({0}).", @@ -51,5 +55,8 @@ "disableAll": "Отключить все установленные расширения", "disableAllWorkspace": "Отключить все установленные расширения для этой рабочей области", "enableAll": "Включить все установленные расширения", - "enableAllWorkspace": "Включить все установленные расширения для этой рабочей области" + "enableAllWorkspace": "Включить все установленные расширения для этой рабочей области", + "extensionButtonProminentBackground": "Цвет фона кнопок, соответствующих основным действиям расширения (например, кнопка \"Установить\").", + "extensionButtonProminentForeground": "Цвет переднего плана кнопок, соответствующих основным действиям расширения (например, кнопка \"Установить\").", + "extensionButtonProminentHoverBackground": "Цвет фона кнопок, соответствующих основным действиям расширения, при наведении мыши (например, кнопка \"Установить\")." } \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.i18n.json b/i18n/rus/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.i18n.json index e3fabddede95cd1e902858d9ce42df64b3acdac2..d91b6f992703f8961413d3d26764bac666c651fa 100644 --- a/i18n/rus/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.i18n.json +++ b/i18n/rus/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.i18n.json @@ -9,6 +9,8 @@ "neverShowAgain": "Больше не показывать", "close": "Закрыть", "workspaceRecommended": "Эта рабочая область включает рекомендации по расширениям.", + "ignoreExtensionRecommendations": "Вы действительно хотите проигнорировать все рекомендации по расширениям?", + "ignoreAll": "Да, игнорировать все", "no": "Нет", "cancel": "Отмена" } \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.i18n.json b/i18n/rus/src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.i18n.json index 2796f4f1c1fe259746d4a11827b9b8aa7806bdb0..957fb1a214bbe66ffc4d516bfc86eec9c720ea7b 100644 --- a/i18n/rus/src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.i18n.json +++ b/i18n/rus/src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.i18n.json @@ -10,5 +10,6 @@ "extensions": "Расширения", "view": "Просмотреть", "extensionsConfigurationTitle": "Расширения", - "extensionsAutoUpdate": "Автоматически обновлять расширения" + "extensionsAutoUpdate": "Автоматически обновлять расширения", + "extensionsIgnoreRecommendations": "Игнорировать рекомендации по расширениям" } \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json b/i18n/rus/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json index 8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a..0d3592d30b4afa5bed08457ad79fa24a702e81f2 100644 --- a/i18n/rus/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json +++ b/i18n/rus/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json @@ -3,4 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. -{} \ No newline at end of file +{ + "disableOtherKeymapsConfirmation": "Отключить другие раскладки клавиатуры ({0}), чтобы избежать конфликта между настраиваемыми сочетаниями клавиш?", + "yes": "Да", + "no": "Нет", + "betterMergeDisabled": "В текущую версию встроено средство слияния с лучшей функциональностью. Установленное расширение было отключено и не может быть удалено.", + "uninstall": "Удаление", + "later": "Позже" +} \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/files/browser/files.contribution.i18n.json b/i18n/rus/src/vs/workbench/parts/files/browser/files.contribution.i18n.json index 952d7106938fbae3ee3239b5fda25f37024bc6f4..6c00f987837f475aebeb75a23dff1775daaac3f0 100644 --- a/i18n/rus/src/vs/workbench/parts/files/browser/files.contribution.i18n.json +++ b/i18n/rus/src/vs/workbench/parts/files/browser/files.contribution.i18n.json @@ -16,7 +16,7 @@ "associations": "Настройте сопоставления файлов с языками (например, \"*.extension\": \"html\"). У них будет приоритет перед заданными по умолчанию сопоставлениями установленных языков.", "encoding": "Кодировка набора символов по умолчанию, используемая при чтении и записи файлов", "autoGuessEncoding": "Если параметр включен, производится попытка определить кодировку набора символов при открытии файлов", - "eol": "Символ конца строки по умолчанию.", + "eol": "Символ конца строки по умолчанию. Используйте \\n для LF и \\r\\n для CRLF.", "trimTrailingWhitespace": "Если этот параметр включен, при сохранении файла будут удалены концевые пробелы.", "insertFinalNewline": "Если этот параметр включен, при сохранении файла в его конец вставляется финальная новая строка.", "files.autoSave.off": "\"Грязный\" файл не сохраняется автоматически.", @@ -27,6 +27,7 @@ "autoSaveDelay": "Определяет задержку в мс, после которой измененный файл сохраняется автоматически. Действует, только если параметр \"files.autoSave\" имеет значение \"{0}\".", "watcherExclude": "Настройте стандартные маски путей файлов, чтобы исключить их из списка отслеживаемых файлов. После изменения этого параметра потребуется перезагрузка. При отображении сообщения \"Код потребляет большое количество процессорного времени при запуске\" вы можете исключить большие папки, чтобы уменьшить первоначальную загрузку.", "hotExit.off": "Отключите \"горячий\" выход.", + "hotExit.onExit": "Функция \"горячий выход\" будет активирована при закрытии приложения, то есть при закрытии последнего окна в Windows или Linux или при активации команды workbench.action.quit (палитра команд, настраиваемое сочетание клавиш, меню). Все окна с резервными копиями будут восстановлены при следующем запуске.", "hotExit": "Определяет, запоминаются ли несохраненные файлы между сеансами. В этом случае приглашение на их сохранение при выходе из редактора не появляется.", "defaultLanguage": "Режим языка по умолчанию, который назначается новым файлам.", "editorConfigurationTitle": "Редактор", diff --git a/i18n/rus/src/vs/workbench/parts/files/browser/views/emptyView.i18n.json b/i18n/rus/src/vs/workbench/parts/files/browser/views/emptyView.i18n.json index 6926e676b12d419107f797531de682ca043ba8c6..eaee6522dac6096262e8cd3bf56189224384a3b7 100644 --- a/i18n/rus/src/vs/workbench/parts/files/browser/views/emptyView.i18n.json +++ b/i18n/rus/src/vs/workbench/parts/files/browser/views/emptyView.i18n.json @@ -5,7 +5,5 @@ // Do not edit this file. It is machine generated. { "explorerSection": "Раздел проводника", - "noWorkspace": "Нет открытой папки", - "noWorkspaceHelp": "Вы еще не открыли папку.", "openFolder": "Открыть папку" } \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/files/browser/views/openEditorsView.i18n.json b/i18n/rus/src/vs/workbench/parts/files/browser/views/openEditorsView.i18n.json index 57e8e68aedc82536effe292396dcb94bc13be14e..908990efe61ce1122b2be132fcffd3b90f6ef326 100644 --- a/i18n/rus/src/vs/workbench/parts/files/browser/views/openEditorsView.i18n.json +++ b/i18n/rus/src/vs/workbench/parts/files/browser/views/openEditorsView.i18n.json @@ -4,8 +4,8 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "openEditosrSection": "Раздел открытых редакторов", "openEditors": "Открытые редакторы", + "openEditosrSection": "Раздел открытых редакторов", "treeAriaLabel": "Открытые редакторы: список активных файлов", "dirtyCounter": "Не сохранено: {0}" } \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json b/i18n/rus/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json index ef99a2ea9f3d36cd74db1f1cbc44726a6e3eec9b..c5024f1f1d0ff02e45094c8fe083781b129216e2 100644 --- a/i18n/rus/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json +++ b/i18n/rus/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json @@ -5,5 +5,11 @@ // Do not edit this file. It is machine generated. { "slow": "Обнаружен замедленный запуск.", - "slow.detail": "Сожалеем, что у вас произошел замедленный запуск. Перезапустите \"{0}\" с включенным профилированием и отправьте профили нам, чтобы мы могли ускорить загрузку." + "slow.detail": "Сожалеем, что у вас произошел замедленный запуск. Перезапустите \"{0}\" с включенным профилированием и отправьте профили нам, чтобы мы могли ускорить загрузку.", + "prof.message": "Профили успешно созданы.", + "prof.detail": "Создайте проблему и вручную вложите следующие файлы:\n{0}", + "prof.restartAndFileIssue": "Создать проблему и выполнить перезапуск", + "prof.restart": "Перезапустить", + "prof.thanks": "Спасибо за помощь.", + "prof.detail.restart": "Для продолжения работы с '{0}' необходимо еще раз перезагрузить систему. Благодарим вас за участие." } \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/preferences/browser/keybindingsEditorContribution.i18n.json b/i18n/rus/src/vs/workbench/parts/preferences/browser/keybindingsEditorContribution.i18n.json index 2798a3b44bd633db170f5b6350560915061e0b3b..41c45ab216ed5ef5fd79b1acd98a511f78329747 100644 --- a/i18n/rus/src/vs/workbench/parts/preferences/browser/keybindingsEditorContribution.i18n.json +++ b/i18n/rus/src/vs/workbench/parts/preferences/browser/keybindingsEditorContribution.i18n.json @@ -5,6 +5,7 @@ // Do not edit this file. It is machine generated. { "defineKeybinding.start": "Определить назначение клавиш", - "defineKeybinding.kbLayoutInfoMessage": "Для текущей раскладки клавиатуры нажмите ", - "defineKeybinding.kbLayoutErrorMessage": "Вы не сможете нажать это сочетание клавиш в текущей раскладке клавиатуры." + "defineKeybinding.kbLayoutErrorMessage": "Вы не сможете нажать это сочетание клавиш в текущей раскладке клавиатуры.", + "defineKeybinding.kbLayoutLocalAndUSMessage": "**{0}** для текущей раскладки клавиатуры (**{1}** для стандартной раскладки клавиатуры \"Английский, США\")", + "defineKeybinding.kbLayoutLocalMessage": "**{0}** для текущей раскладки клавиатуры." } \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/preferences/browser/preferencesRenderers.i18n.json b/i18n/rus/src/vs/workbench/parts/preferences/browser/preferencesRenderers.i18n.json index 234e294922c9818261c11462cc7d52f1d7bba9f4..702472aecfb6eb668d91e64914398bab6bdb3e7f 100644 --- a/i18n/rus/src/vs/workbench/parts/preferences/browser/preferencesRenderers.i18n.json +++ b/i18n/rus/src/vs/workbench/parts/preferences/browser/preferencesRenderers.i18n.json @@ -4,6 +4,7 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "errorInvalidConfiguration": "Не удается записать параметры. Устраните ошибки и предупреждения в файле и повторите попытку.", "editTtile": "Изменить", "replaceDefaultValue": "Заменить в параметрах", "copyDefaultValue": "Копировать в параметры", diff --git a/i18n/rus/src/vs/workbench/parts/quickopen/browser/commandsHandler.i18n.json b/i18n/rus/src/vs/workbench/parts/quickopen/browser/commandsHandler.i18n.json index f6f0bf572b20a3aac963443f451a02589bd9e66b..12bcf3ccba9e1ec148a71a7316f9d1e39d3a46d5 100644 --- a/i18n/rus/src/vs/workbench/parts/quickopen/browser/commandsHandler.i18n.json +++ b/i18n/rus/src/vs/workbench/parts/quickopen/browser/commandsHandler.i18n.json @@ -5,6 +5,7 @@ // Do not edit this file. It is machine generated. { "showTriggerActions": "Показать все команды", + "showCommands.label": "Палитра команд...", "entryAriaLabelWithKey": "{0}, {1}, команды", "entryAriaLabel": "{0}, команды", "canNotRun": "Выполнить команду {0} отсюда невозможно.", diff --git a/i18n/rus/src/vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.i18n.json b/i18n/rus/src/vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..33c1e2c5ad7068473960dc79512b70b3cc9bc6d1 --- /dev/null +++ b/i18n/rus/src/vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "relaunchMessage": "После изменения параметра необходима выполнить перезагрузку, чтобы изменения вступили в силу.", + "relaunchDetail": "Нажмите кнопку \"Перезагрузить\", чтобы перезагрузить {0} и включить параметр.", + "restart": "Перезапустить" +} \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.i18n.json b/i18n/rus/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..ce6c4c198e53640025e97af6f051f8e359900666 --- /dev/null +++ b/i18n/rus/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "editorGutterModifiedBackground": "Цвет фона полей редактора для измененных строк.", + "editorGutterAddedBackground": "Цвет фона полей редактора для добавленных строк.", + "editorGutterDeletedBackground": "Цвет фона полей редактора для удаленных строк." +} \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/scm/electron-browser/scm.contribution.i18n.json b/i18n/rus/src/vs/workbench/parts/scm/electron-browser/scm.contribution.i18n.json index 029a91dd1211a2d0d2a7b909a874cad6a54856c1..ba48b09e26359666787720e9b999e646dd5696a1 100644 --- a/i18n/rus/src/vs/workbench/parts/scm/electron-browser/scm.contribution.i18n.json +++ b/i18n/rus/src/vs/workbench/parts/scm/electron-browser/scm.contribution.i18n.json @@ -5,6 +5,7 @@ // Do not edit this file. It is machine generated. { "toggleGitViewlet": "Показать GIT", + "installAdditionalSCMProviders": "Установить дополнительных поставщиков SCM...", "source control": "Система управления версиями", "toggleSCMViewlet": "Показать SCM", "view": "Просмотреть" diff --git a/i18n/rus/src/vs/workbench/parts/scm/electron-browser/scmMenus.i18n.json b/i18n/rus/src/vs/workbench/parts/scm/electron-browser/scmMenus.i18n.json index 0d1ad24f725d37d318dbbd2211d1754410b5c634..f345f2df7faa20915850768b3eea3b531546f7bd 100644 --- a/i18n/rus/src/vs/workbench/parts/scm/electron-browser/scmMenus.i18n.json +++ b/i18n/rus/src/vs/workbench/parts/scm/electron-browser/scmMenus.i18n.json @@ -4,5 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "installAdditionalSCMProviders": "Установить дополнительных поставщиков SCM...", "switch provider": "Переключить поставщик SCM..." } \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json b/i18n/rus/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json index 845c4f038e9c3d1b2c55c77f494a522cf46da16a..cd394a2c256ae3595abf54197c01dcb233ef7384 100644 --- a/i18n/rus/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json +++ b/i18n/rus/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json @@ -6,5 +6,7 @@ { "searchMatches": "Найдено соответствий: {0}", "searchMatch": "Найдено соответствие: {0}", - "fileMatchAriaLabel": "Совпадений в файле {1} папки {2}: {0}, результат поиска" + "fileMatchAriaLabel": "Совпадений в файле {1} папки {2}: {0}, результат поиска", + "replacePreviewResultAria": "Заменить термин {0} на {1} в столбце {2} и строке {3}", + "searchResultAria": "Обнаружен термин {0} в столбце {1} и строке {2}" } \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/snippets/electron-browser/TMSnippets.i18n.json b/i18n/rus/src/vs/workbench/parts/snippets/electron-browser/TMSnippets.i18n.json index d4cbde5d13487955f7d1e24ddb072243929fa5e4..1ed22c6e056cd18363fa8badf44dd6757d74d03d 100644 --- a/i18n/rus/src/vs/workbench/parts/snippets/electron-browser/TMSnippets.i18n.json +++ b/i18n/rus/src/vs/workbench/parts/snippets/electron-browser/TMSnippets.i18n.json @@ -9,5 +9,6 @@ "vscode.extension.contributes.snippets-path": "Путь к файлу фрагментов. Путь указывается относительно папки расширения и обычно начинается с \"./snippets/\".", "invalid.language": "Неизвестный язык в contributes.{0}.language. Указанное значение: {1}", "invalid.path.0": "В contributes.{0}.path требуется строка. Указанное значение: {1}", - "invalid.path.1": "contributes.{0}.path ({1}) должен был быть включен в папку расширения ({2}). Это может сделать расширение непереносимым." + "invalid.path.1": "contributes.{0}.path ({1}) должен был быть включен в папку расширения ({2}). Это может сделать расширение непереносимым.", + "badVariableUse": "Похоже, во фрагменте \"{0}\" перепутаны переменные и заполнители. Дополнительные сведения см. на странице https://code.visualstudio.com/docs/editor/userdefinedsnippets#_snippet-syntax." } \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/snippets/electron-browser/snippets.contribution.i18n.json b/i18n/rus/src/vs/workbench/parts/snippets/electron-browser/snippets.contribution.i18n.json index 328405d58a0acaaafaf1cd7c350d2fb1c3273066..cca07302e3cf780b37bb5ce70537926faabe139b 100644 --- a/i18n/rus/src/vs/workbench/parts/snippets/electron-browser/snippets.contribution.i18n.json +++ b/i18n/rus/src/vs/workbench/parts/snippets/electron-browser/snippets.contribution.i18n.json @@ -11,6 +11,6 @@ "snippetSchema.json.default": "Пустой фрагмент", "snippetSchema.json": "Настройка фрагмента пользователя", "snippetSchema.json.prefix": "Префикс, используемый при выборе фрагмента в Intellisense.", - "snippetSchema.json.body": "Содержимое фрагмента. Используйте \"${id}\", \"${id:label}\", \"${1:label}\" для переменных и \"$0\", \"$1\" для положений курсора", + "snippetSchema.json.body": "Содержимое фрагмента. Используйте '$1', '${1:defaultText}' для определения положения курсора и '$0' для определения конечного положения курсора. Для вставки переменных используйте синтаксис '${varName}' и '${varName:defaultText}', например, \"Это файл: $TM_FILENAME\".", "snippetSchema.json.description": "Описание фрагмента." } \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/surveys/electron-browser/languageSurveys.contribution.i18n.json b/i18n/rus/src/vs/workbench/parts/surveys/electron-browser/languageSurveys.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..87ed9681f0cb821bff1bee0c63917cedea9f14a1 --- /dev/null +++ b/i18n/rus/src/vs/workbench/parts/surveys/electron-browser/languageSurveys.contribution.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "helpUs": "Помогите нам улучшить поддержку {0}", + "takeShortSurvey": "Пройдите краткий опрос", + "remindLater": "Напомнить мне позже", + "neverAgain": "Больше не показывать" +} \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/surveys/electron-browser/nps.contribution.i18n.json b/i18n/rus/src/vs/workbench/parts/surveys/electron-browser/nps.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..10c206f9d2fbeaa5a15583cfde22659b4c9b40dc --- /dev/null +++ b/i18n/rus/src/vs/workbench/parts/surveys/electron-browser/nps.contribution.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "surveyQuestion": "Вас не затруднит пройти краткий опрос?", + "takeSurvey": "Пройти опрос", + "remindLater": "Напомнить мне позже", + "neverAgain": "Больше не показывать" +} \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/tasks/browser/buildQuickOpen.i18n.json b/i18n/rus/src/vs/workbench/parts/tasks/browser/buildQuickOpen.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..2037e5496b95cde07052f088237a11a95da28469 --- /dev/null +++ b/i18n/rus/src/vs/workbench/parts/tasks/browser/buildQuickOpen.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "noTasksMatching": "Нет соответствующих задач" +} \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/tasks/browser/quickOpen.i18n.json b/i18n/rus/src/vs/workbench/parts/tasks/browser/quickOpen.i18n.json index 2f8e368102c131a86aea1bb23d4744d8b7edf282..5a8464f78ea0a72e9641c17bd6fe6d9a526b30f9 100644 --- a/i18n/rus/src/vs/workbench/parts/tasks/browser/quickOpen.i18n.json +++ b/i18n/rus/src/vs/workbench/parts/tasks/browser/quickOpen.i18n.json @@ -4,5 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "entryAriaLabel": "{0}, задачи" + "entryAriaLabel": "{0}, задачи", + "customizeTask": "Настроить задачу" } \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/tasks/browser/testQuickOpen.i18n.json b/i18n/rus/src/vs/workbench/parts/tasks/browser/testQuickOpen.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..2037e5496b95cde07052f088237a11a95da28469 --- /dev/null +++ b/i18n/rus/src/vs/workbench/parts/tasks/browser/testQuickOpen.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "noTasksMatching": "Нет соответствующих задач" +} \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/tasks/common/taskConfiguration.i18n.json b/i18n/rus/src/vs/workbench/parts/tasks/common/taskConfiguration.i18n.json index 450789f1e668dde1e131ec2889fdacce84cde632..90eadea7cc82e2d832baabe9c48d4e1f873cb9f5 100644 --- a/i18n/rus/src/vs/workbench/parts/tasks/common/taskConfiguration.i18n.json +++ b/i18n/rus/src/vs/workbench/parts/tasks/common/taskConfiguration.i18n.json @@ -5,13 +5,13 @@ // Do not edit this file. It is machine generated. { "ConfigurationParser.invalidCWD": "Предупреждение: options.cwd должен иметь тип string. Игнорируется значение {0}\n", - "ConfigurationParser.noShell": "Предупреждение: конфигурация оболочки поддерживается только при выполнении задач в терминале.", "ConfigurationParser.noargs": "Ошибка: аргументы команды должны представлять собой массив строк. Указанное значение:\n{0}", + "ConfigurationParser.noShell": "Предупреждение: конфигурация оболочки поддерживается только при выполнении задач в терминале.", "ConfigurationParser.noName": "Ошибка: сопоставитель проблем в области объявления должен иметь имя:\n{0}\n", "ConfigurationParser.unknownMatcherKind": "Предупреждение: определен неизвестный сопоставитель проблем. Поддерживаемые типы: строка | СопоставительПроблем | (строка | СопоставительПроблем)[].\n{0}\n", "ConfigurationParser.invalidVaraibleReference": "Ошибка: недопустимая ссылка на problemMatcher: {0}\n", "ConfigurationParser.noTaskName": "Ошибка: задачи должны предоставлять свойство taskName. Задача будет проигнорирована.\n{0}\n", "taskConfiguration.shellArgs": "Предупреждение: задача \"{0}\" является командой оболочки, и имя команды или одного из ее аргументов включает пробелы без escape-последовательности. Чтобы обеспечить правильную расстановку кавычек в командной строке, объедините аргументы в команде.", - "taskConfiguration.noCommandOrDependsOn": "Ошибка: задача \"{0}\" не задает команду или свойство dependsOn. Задача будет игнорироваться. Ее определение:\n{1}", + "taskConfiguration.noCommandOrDependsOn": "Ошибка: в задаче \"{0}\" не указаны ни команда, ни свойство dependsOn. Задача будет проигнорирована. Определение задачи:\n{1}", "taskConfiguration.noCommand": "Ошибка: задача \"{0}\" не определяет команду. Задача будет игнорироваться. Ее определение:\n{1}" } \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/tasks/electron-browser/jsonSchemaCommon.i18n.json b/i18n/rus/src/vs/workbench/parts/tasks/electron-browser/jsonSchemaCommon.i18n.json index b2e6776ffdae880361d2991de8375150e734450f..f149850fd4c759dc3ca6b865506f92c9db623449 100644 --- a/i18n/rus/src/vs/workbench/parts/tasks/electron-browser/jsonSchemaCommon.i18n.json +++ b/i18n/rus/src/vs/workbench/parts/tasks/electron-browser/jsonSchemaCommon.i18n.json @@ -7,6 +7,7 @@ "JsonSchema.options": "Дополнительные параметры команды", "JsonSchema.options.cwd": "Текущий рабочий каталог выполняемой программы или сценария. Если этот параметр опущен, используется корневой каталог текущей рабочей области Code.", "JsonSchema.options.env": "Среда выполняемой программы или оболочки. Если этот параметр опущен, используется среда родительского процесса.", + "JsonSchema.shellConfiguration": "Задает используемую оболочку.", "JsonSchema.shell.executable": "Используемая оболочка.", "JsonSchema.shell.args": "Аргументы оболочки.", "JsonSchema.command": "Выполняемая команда. Это может быть внешняя программа или команда оболочки.", diff --git a/i18n/rus/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v1.i18n.json b/i18n/rus/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v1.i18n.json index 02c579648319e39f49e7d89a3f7708b905dae313..e387db19de67407e004002da27a8319181e1a187 100644 --- a/i18n/rus/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v1.i18n.json +++ b/i18n/rus/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v1.i18n.json @@ -5,6 +5,8 @@ // Do not edit this file. It is machine generated. { "JsonSchema.version": "Номер версии конфигурации", + "JsonSchema._runner": "Средство запуска завершило работу. Используйте официальное свойство средства запуска", + "JsonSchema.runner": "Определяет, следует ли запустить задачу в качестве процесса с отображением выходных данных задачи в окне вывода или в терминале.", "JsonSchema.windows": "Настройка команд Windows", "JsonSchema.mac": "Настройка команд Mac", "JsonSchema.linux": "Настройка команд Linux", diff --git a/i18n/rus/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.i18n.json b/i18n/rus/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.i18n.json index 881457afe777ede909de6dbc5216e0923049dadf..41c0b2f756ab33bb595d70ad2f1d149dc51b062e 100644 --- a/i18n/rus/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.i18n.json +++ b/i18n/rus/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.i18n.json @@ -4,11 +4,14 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "JsonSchema.version": "Номер версии конфигурации", - "JsonSchema.windows": "Настройка команд Windows", - "JsonSchema.mac": "Настройка команд Mac", - "JsonSchema.linux": "Настройка команд Linux", "JsonSchema.shell": "Указывает, является ли команда командой оболочки или внешней программой. Если опущено, значение по умолчанию — false.", "JsonSchema.tasks.dependsOn.string": "Другая задача, от которой зависит эта задача.", - "JsonSchema.tasks.dependsOn.array": "Другие задачи, от которых зависит эта задача." + "JsonSchema.tasks.dependsOn.array": "Другие задачи, от которых зависит эта задача.", + "JsonSchema.tasks.group": "Определяет, к какой группе выполнения принадлежит эта задача. Если параметр не указан, задача не принадлежит ни к одной из групп.", + "JsonSchema.tasks.type": "Определяет, выполняется ли задача в виде процесса или в виде команды оболочки. Значение по умолчанию — \"процесс\".", + "JsonSchema.version": "Номер версии конфигурации.", + "JsonSchema.tasks.customize": "Пользовательская задача, которая будет настраиваться.", + "JsonSchema.windows": "Настройка команд Windows", + "JsonSchema.mac": "Настройка команд Mac", + "JsonSchema.linux": "Настройка команд Linux" } \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json b/i18n/rus/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json index 031f694786cb48f5598f2eb9ad83be1e2ccd86db..53e80072245ed05847bd17f414226a5dc96c0358 100644 --- a/i18n/rus/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json +++ b/i18n/rus/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json @@ -18,10 +18,12 @@ "problems": "Проблемы", "manyMarkers": "99+", "tasks": "Задачи", + "TaskSystem.noHotSwap": "Чтобы изменить подсистему выполнения задач, нужно перезапустить VS Code. Изменение игнорируется.", "TaskService.noBuildTask": "Задача сборки не определена. Отметьте задачу с помощью \"isBuildCommand\" в файле tasks.json.", "TaskService.noTestTask": "Задача теста не определена. Отметьте задачу с помощью \"isTestCommand\" в файле tasks.json.", "TaskServer.noTask": "Запрошенная задача {0} для выполнения не найдена.", - "TaskSystem.activeSame": "Задача уже активна и находится в режиме наблюдения. Чтобы завершить задачу, выполните команду \"F1 > terminate task\"", + "customizeParseErrors": "В конфигурации текущей задачи есть ошибки. Исправьте ошибки перед изменением задачи.", + "moreThanOneBuildTask": "В файле tasks.json определено несколько задач сборки. Выполняется первая задача.\n", "TaskSystem.active": "Уже выполняется задача. Завершите ее, прежде чем выполнять другую задачу.", "TaskSystem.restartFailed": "Не удалось завершить и перезапустить задачу {0}", "TaskSystem.configurationErrors": "Ошибка: в конфигурации указанной задачи при проверке были выявлены ошибки, и ее невозможно использовать. Сначала устраните ошибки.", diff --git a/i18n/rus/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.i18n.json b/i18n/rus/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.i18n.json index 32514c87953bd2f3f50af58859a34702bcbec53c..922550c51cb1f2213cd6c91e2bb75f809e710b42 100644 --- a/i18n/rus/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.i18n.json +++ b/i18n/rus/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.i18n.json @@ -6,5 +6,7 @@ { "TerminalTaskSystem.unknownError": "При выполнении задачи произошла неизвестная ошибка. Подробности см. в журнале выходных данных задач.", "TerminalTaskSystem.terminalName": "Задача — {0}", - "TerminalTaskSystem": "Невозможно выполнить команду оболочки на диске UNC." + "reuseTerminal": "Терминал будет повторно использоваться задачами. Чтобы закрыть его, нажмите любую клавишу.", + "TerminalTaskSystem": "Невозможно выполнить команду оболочки на диске UNC.", + "unkownProblemMatcher": "Не удается разрешить сопоставитель проблем {0}. Сопоставитель будет проигнорирован" } \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/tasks/node/processTaskSystem.i18n.json b/i18n/rus/src/vs/workbench/parts/tasks/node/processTaskSystem.i18n.json index 6aeff4e87a2eb64135ab5c42bc1af2dcfbe48f72..2e6dfe20c18763962ee5fc33ab8d8839422b0bf1 100644 --- a/i18n/rus/src/vs/workbench/parts/tasks/node/processTaskSystem.i18n.json +++ b/i18n/rus/src/vs/workbench/parts/tasks/node/processTaskSystem.i18n.json @@ -7,5 +7,6 @@ "TaskRunnerSystem.unknownError": "При выполнении задачи произошла неизвестная ошибка. Подробности см. в журнале выходных данных задач.", "TaskRunnerSystem.watchingBuildTaskFinished": "\nОтслеживание задач сборки завершено.", "TaskRunnerSystem.childProcessError": "Failed to launch external program {0} {1}.", - "TaskRunnerSystem.cancelRequested": "\nЗадача \"{0}\" была завершена по запросу пользователя." + "TaskRunnerSystem.cancelRequested": "\nЗадача \"{0}\" была завершена по запросу пользователя.", + "unkownProblemMatcher": "Не удается разрешить сопоставитель проблем {0}. Сопоставитель будет проигнорирован" } \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/terminal/electron-browser/terminalActions.i18n.json b/i18n/rus/src/vs/workbench/parts/terminal/electron-browser/terminalActions.i18n.json index 8104d226e880075f0a5efb925e7fb22b3838682a..ccd5870dca1b9f2c8433066e7b223fa93e4ae283 100644 --- a/i18n/rus/src/vs/workbench/parts/terminal/electron-browser/terminalActions.i18n.json +++ b/i18n/rus/src/vs/workbench/parts/terminal/electron-browser/terminalActions.i18n.json @@ -8,6 +8,7 @@ "workbench.action.terminal.kill": "Завершить активный экземпляр терминала", "workbench.action.terminal.kill.short": "Завершить работу терминала", "workbench.action.terminal.copySelection": "Скопировать выделение", + "workbench.action.terminal.selectAll": "Выбрать все", "workbench.action.terminal.new": "Создание нового интегрированного терминала", "workbench.action.terminal.new.short": "Новый терминал", "workbench.action.terminal.focus": "Фокус на терминале", @@ -26,5 +27,8 @@ "workbench.action.terminal.scrollUp": "Прокрутить вверх (построчно)", "workbench.action.terminal.scrollUpPage": "Прокрутить вверх (страницу)", "workbench.action.terminal.scrollToTop": "Прокрутить до верхней границы", - "workbench.action.terminal.clear": "Очистить" + "workbench.action.terminal.clear": "Очистить", + "workbench.action.terminal.allowWorkspaceShell": "Разрешить настройку оболочки в рабочей области", + "workbench.action.terminal.disallowWorkspaceShell": "Запретить настройку оболочки в рабочей области", + "workbench.action.terminal.rename": "Переименовать" } \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/terminal/electron-browser/terminalColorRegistry.i18n.json b/i18n/rus/src/vs/workbench/parts/terminal/electron-browser/terminalColorRegistry.i18n.json index 227600f316f4dbc56fc1c57187150b5046799d1a..a43d3077cff1b9cf703d317964bd31c51e83d890 100644 --- a/i18n/rus/src/vs/workbench/parts/terminal/electron-browser/terminalColorRegistry.i18n.json +++ b/i18n/rus/src/vs/workbench/parts/terminal/electron-browser/terminalColorRegistry.i18n.json @@ -4,5 +4,7 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "terminal.background": "Цвет фона терминала. С его помощью можно указать цвет терминала, отличный от цвета панели.", + "terminal.foreground": "Цвет переднего плана терминала.", "terminal.ansiColor": "Цвет ANSI \"{0}\" в терминале." } \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/terminal/electron-browser/terminalFindWidget.i18n.json b/i18n/rus/src/vs/workbench/parts/terminal/electron-browser/terminalFindWidget.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..e03b15626d2d6690df8fcdf69b54b7f01223bc55 --- /dev/null +++ b/i18n/rus/src/vs/workbench/parts/terminal/electron-browser/terminalFindWidget.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "label.find": "Найти", + "placeholder.find": "Найти", + "label.previousMatchButton": "Предыдущее соответствие", + "label.nextMatchButton": "Следующее соответствие", + "label.closeButton": "Закрыть" +} \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.i18n.json b/i18n/rus/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.i18n.json index 2034b9a4ca8cd3aa6035efef18fbd30ba97abc03..07fc306b313d4105e18d5ac188b7e783e291081a 100644 --- a/i18n/rus/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.i18n.json +++ b/i18n/rus/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.i18n.json @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "terminal.integrated.copySelection.noSelection": "Невозможно скопировать выделение в терминале, когда терминал не имеет фокуса", "terminal.integrated.exitedWithCode": "Процесс терминала завершен с кодом выхода: {0}", "terminal.integrated.waitOnExit": "Нажмите любую клавишу, чтобы закрыть терминал.", "terminal.integrated.launchFailed": "Не удалось запустить команду процесса терминала \"{0}{1}\" (код выхода: {2})" diff --git a/i18n/rus/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json b/i18n/rus/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json index 60eb5ce7cf9b4fbf5d2a4aae8cd3baaebfe3b95f..b252e0872aa67be2ad3cc21baa85f6e711893fc8 100644 --- a/i18n/rus/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json +++ b/i18n/rus/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json @@ -6,6 +6,7 @@ { "selectTheme.label": "Цветовая тема", "installColorThemes": "Установить дополнительные цветовые темы...", + "themes.selectTheme": "Выберите цветовую тему (используйте клавиши стрелок вверх и вниз для предварительного просмотра)", "selectIconTheme.label": "Тема значков файлов", "installIconThemes": "Установить дополнительные темы значков файлов...", "noIconThemeLabel": "Нет", diff --git a/i18n/rus/src/vs/workbench/parts/update/electron-browser/update.i18n.json b/i18n/rus/src/vs/workbench/parts/update/electron-browser/update.i18n.json index ef31128d567b2c5b61e355c565e4b3a93226a190..9e8608fc276f4bf1cfd8d37e8703da4fb3a7ef8b 100644 --- a/i18n/rus/src/vs/workbench/parts/update/electron-browser/update.i18n.json +++ b/i18n/rus/src/vs/workbench/parts/update/electron-browser/update.i18n.json @@ -15,5 +15,18 @@ "license": "Прочитать условия лицензии", "updateAvailable": "{0} будет обновлен после перезапуска.", "thereIsUpdateAvailable": "Доступно обновление.", - "noUpdatesAvailable": "В настоящее время нет доступных обновлений." + "noUpdatesAvailable": "В настоящее время нет доступных обновлений.", + "updateIsReady": "Доступно новое обновление.", + "commandPalette": "Палитра команд...", + "settings": "Параметры", + "keyboardShortcuts": "Сочетания клавиш", + "selectTheme.label": "Цветовая тема", + "themes.selectIconTheme.label": "Тема значков файлов", + "not available": "Обновления недоступны", + "checkingForUpdates": "Идет проверка наличия обновлений...", + "DownloadUpdate": "Скачать доступное обновление", + "DownloadingUpdate": "Скачивается обновление...", + "InstallingUpdate": "Идет установка обновления...", + "restartToUpdate": "Перезапустить для обновления...", + "checkForUpdates": "Проверить наличие обновлений..." } \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/views/browser/views.i18n.json b/i18n/rus/src/vs/workbench/parts/views/browser/views.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..761072edd67cf6fb14a79a53de792bb8cd9fca3e --- /dev/null +++ b/i18n/rus/src/vs/workbench/parts/views/browser/views.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "viewToolbarAriaLabel": "Действий: {0}" +} \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/views/browser/viewsExtensionPoint.i18n.json b/i18n/rus/src/vs/workbench/parts/views/browser/viewsExtensionPoint.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..3c41a4d1bdaa5f663890ce9311d28faa03e1ba09 --- /dev/null +++ b/i18n/rus/src/vs/workbench/parts/views/browser/viewsExtensionPoint.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "requirearray": "представления должны быть массивом", + "requirestring": "свойство \"{0}\" является обязательным и должно иметь тип string", + "optstring": "свойство \"{0}\" может быть опущено или должно иметь тип string", + "vscode.extension.contributes.view.id": "Идентификатор представления. Используйте его для регистрации поставщика данных с помощью API-интерфейса \"vscode.window.registerTreeDataProviderForView\", а также для активации расширения с помощью регистрации события \"onView:${id}\" в \"activationEvents\".", + "vscode.extension.contributes.view.name": "Понятное имя представления. Будет отображаться на экране", + "vscode.extension.contributes.views": "Добавляет представления в редактор", + "views.explorer": "Представление проводника", + "locationId.invalid": "\"{0}\" не является допустимым расположением представления" +} \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json b/i18n/rus/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json index 9cf8071dbbf2d164a0496058952d4c454bc24030..cbdb68fe6f74b35ae38fe0619e4eeb0733fe9388 100644 --- a/i18n/rus/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json +++ b/i18n/rus/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json @@ -11,20 +11,26 @@ "welcomePage.openFolder": "Открыть папку...", "welcomePage.cloneGitRepository": "Клонировать репозиторий Git...", "welcomePage.recent": "Последние", + "welcomePage.moreRecent": "Дополнительные сведения...", "welcomePage.noRecentFolders": "Нет последних папок.", "welcomePage.help": "Справка", + "welcomePage.keybindingsCheatsheet": "Список сочетаний клавиш в печатном виде", "welcomePage.introductoryVideos": "Вступительные видео", "welcomePage.productDocumentation": "Документация по продукту", "welcomePage.gitHubRepository": "Репозиторий GitHub", "welcomePage.stackOverflow": "Stack Overflow", "welcomePage.showOnStartup": "Отображать страницу приветствия при запуске", "welcomePage.customize": "Настроить", + "welcomePage.installExtensionPacks": "Средства и языки", + "welcomePage.installExtensionPacksDescription": "Установить поддержку для {0} и {1}", + "welcomePage.moreExtensions": "Еще", "welcomePage.installKeymapDescription": "Установка сочетаний клавиш", + "welcomePage.installKeymapExtension": "Настроить сочетания клавиш для {0} и {1}", "welcomePage.others": "Другие", "welcomePage.colorTheme": "Цветовая тема", "welcomePage.colorThemeDescription": "Настройте редактор и код удобным образом.", + "welcomePage.learn": "Подробнее", "welcomePage.showCommands": "Найти и выполнить все команды.", - "welcomePage.showCommandsDescription": "Быстрый доступ и поиск команд на панели управления ({0})", "welcomePage.interfaceOverview": "Общие сведения об интерфейсе", "welcomePage.interfaceOverviewDescription": "Используйте визуальное наложение с выделением основных компонентов пользовательского интерфейса.", "welcomePage.interactivePlayground": "Интерактивная площадка", diff --git a/i18n/rus/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.contribution.i18n.json b/i18n/rus/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.contribution.i18n.json index 9927d1b163aabea65d4e86b6784c6c3a63bab39d..64481a105b1293063768dc16066724c838175429 100644 --- a/i18n/rus/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.contribution.i18n.json +++ b/i18n/rus/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.contribution.i18n.json @@ -4,7 +4,5 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { - "workbenchConfigurationTitle": "Workbench", - "welcomePage.enabled": "Если этот параметр включен, страница приветствия будет отображаться при запуске.", "help": "Справка" } \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json b/i18n/rus/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json index 901720ad5ddfc60b494cb56788a2d773868bc623..b5de51bfe073ca7f1426e8f042d2375a018c85c7 100644 --- a/i18n/rus/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json +++ b/i18n/rus/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json @@ -4,12 +4,35 @@ *--------------------------------------------------------------------------------------------*/ // Do not edit this file. It is machine generated. { + "workbenchConfigurationTitle": "Рабочее место", + "welcomePage.enabled": "Если этот параметр включен, страница приветствия будет отображаться при запуске.", "welcomePage": "Добро пожаловать", + "welcomePage.javaScript": "JavaScript", + "welcomePage.typeScript": "TypeScript", + "welcomePage.python": "Python", + "welcomePage.php": "PHP", + "welcomePage.docker": "Docker", + "welcomePage.vim": "Vim", + "welcomePage.sublime": "Sublime", + "welcomePage.atom": "Atom", + "welcomePage.extensionPackAlreadyInstalled": "Поддержка {0} уже добавлена.", + "welcomePage.willReloadAfterInstallingExtensionPack": "После установки дополнительной поддержки для {0} окно будет перезагружено.", + "welcomePage.installingExtensionPack": "Установка дополнительной поддержки для {0}...", + "welcomePage.extensionPackNotFound": "Не удается найти поддержку для {0} с идентификатором {1}.", "welcomePage.keymapAlreadyInstalled": "Сочетания клавиш {0} уже установлены.", "welcomePage.willReloadAfterInstallingKeymap": "Окно перезагрузится после установки сочетаний клавиш {0}.", "welcomePage.installingKeymap": "Устанавливаются сочетания клавиш {0}...", "welcomePage.keymapNotFound": "Не удалось найти сочетания клавиш {0} с идентификатором {1}.", "welcome.title": "Добро пожаловать", + "welcomePage.openFolderWithPath": "Открыть папку {0} с путем {1}", + "welcomePage.extensionListSeparator": ",", + "welcomePage.installKeymap": "Установить раскладку клавиатуры {0}", + "welcomePage.installExtensionPack": "Установить дополнительную поддержку для {0}", + "welcomePage.installedKeymap": "Раскладка клавиатуры {0} уже установлена", + "welcomePage.installedExtensionPack": "Поддержка {0} уже установлена", "ok": "ОК", - "cancel": "Отмена" + "details": "Подробности", + "cancel": "Отмена", + "welcomePage.buttonBackground": "Цвет фона кнопок на странице приветствия.", + "welcomePage.buttonHoverBackground": "Цвет фона при наведении указателя для кнопок на странице приветствия." } \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json b/i18n/rus/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json index c86c05dcae5df1803461c75e2e57cce1694aaaad..e79310b57d6afd9c4282d916fc438ae098a31eec 100644 --- a/i18n/rus/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json +++ b/i18n/rus/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json @@ -5,5 +5,6 @@ // Do not edit this file. It is machine generated. { "walkThrough.unboundCommand": "свободный", - "walkThrough.gitNotFound": "Похоже, Git не установлен в вашей системе." + "walkThrough.gitNotFound": "Похоже, Git не установлен в вашей системе.", + "walkThrough.embeddedEditorBackground": "Цвет фона встроенных редакторов для интерактивных площадок." } \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json b/i18n/rus/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json index e87cb2bac2879eebb9ae30a7fd301677c756e1da..11dedf614c641a48a165f8203b59f3a6f0296ffa 100644 --- a/i18n/rus/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json +++ b/i18n/rus/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json @@ -6,6 +6,12 @@ { "open": "Открыть параметры", "close": "Закрыть", + "saveAndRetry": "Сохранить параметры и повторить попытку", "errorUnknownKey": "Не удается выполнить запись в файл конфигурации (неизвестный ключ)", - "errorInvalidTarget": "Не удается выполнить запись в файл конфигурации (недопустимый целевой объект)." + "errorInvalidTarget": "Не удается выполнить запись в файл конфигурации (недопустимый целевой объект).", + "errorNoWorkspaceOpened": "Не удается записать параметры, так как нет открытых папок. Откройте папку и повторите попытку.", + "errorInvalidConfiguration": "Не удается записать параметры. Откройте файл **User Settings**, устраните ошибки и предупреждения в файле и повторите попытку.", + "errorInvalidConfigurationWorkspace": "Не удается записать параметры. Откройте файл **Workspace Settings**, устраните ошибки и предупреждения в файле и повторите попытку.", + "errorConfigurationFileDirty": "Не удается записать параметры, так как файл был изменен. Сохраните файл **User Settings** и повторите попытку.", + "errorConfigurationFileDirtyWorkspace": "Не удается записать параметры, так как файл был изменен. Сохраните файл **Workspace Settings** и повторите попытку." } \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/services/crashReporter/common/crashReporterService.i18n.json b/i18n/rus/src/vs/workbench/services/crashReporter/common/crashReporterService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..b9b24e91bdb0d339db5b2025acf0b9508febd95f --- /dev/null +++ b/i18n/rus/src/vs/workbench/services/crashReporter/common/crashReporterService.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "telemetryConfigurationTitle": "Телеметрия", + "telemetry.enableCrashReporting": "Разрешить отправку отчетов о сбоях в Майкрософт.\nЧтобы этот параметр вступил в силу, требуется перезагрузка." +} \ No newline at end of file diff --git a/i18n/rus/src/vs/workbench/services/progress/browser/progressService2.i18n.json b/i18n/rus/src/vs/workbench/services/progress/browser/progressService2.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..6db7d6aae514a031afce5ac346abfd84bb8ee1cc --- /dev/null +++ b/i18n/rus/src/vs/workbench/services/progress/browser/progressService2.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "progress.text": "{0} - {1}", + "progress.title": "{0}: {1}" +} \ No newline at end of file diff --git a/i18n/trk/extensions/configuration-editing/out/settingsDocumentHelper.i18n.json b/i18n/trk/extensions/configuration-editing/out/settingsDocumentHelper.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..1c2d94b4c209c12d39406e15422f1a7dd6ac597b --- /dev/null +++ b/i18n/trk/extensions/configuration-editing/out/settingsDocumentHelper.i18n.json @@ -0,0 +1,36 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "activeEditorShort": "ör. myFile.txt", + "activeEditorMedium": "ör. myFolder/myFile.txt", + "activeEditorLong": "ör. /Users/Development/myProject/myFolder/myFile.txt", + "rootName": "ör. myProject", + "rootPath": "ör. /Users/Development/myProject", + "appName": "ör. VS Code", + "dirty": "değişiklik göstergesi, aktif düzenleyici kaydedilmemiş değişiklikler içeriyorsa", + "separator": "koşullu ayırıcı ('-') sadece değişkenler tarafından değerlerle çevrildiğinde gösterir", + "assocLabelFile": "Uzantılı Dosyalar", + "assocDescriptionFile": "Dosya adında glob deseniyle eşleşen tüm dosyaları belirtilen tanımlayıcıya sahip olan dile eşleyin.", + "assocLabelPath": "Yollu Dosyalar", + "assocDescriptionPath": "Dosya yolunda mutlak yol glob deseniyle eşleşen tüm dosyaları belirtilen tanımlayıcıya sahip olan dile eşleyin.", + "fileLabel": "Uzantıya Göre Dosyalar", + "fileDescription": "Belirli bir dosya uzantısına sahip tüm dosyaları eşleştirin.", + "filesLabel": "Birden Çok Uzantılı Dosyalar", + "filesDescription": "Tüm dosyaları herhangi bir dosya uzantısıyla eşleştirin.", + "derivedLabel": "Ada Göre Eşdüzeyi Olan Dosyalar", + "derivedDescription": "Aynı ada ancak farklı bir uzantıya sahip eşdüzeyi olan dosyaları eşleştirin.", + "topFolderLabel": "Ada Göre Klasör (En Üst Düzey)", + "topFolderDescription": "En üst düzeydeki bir klasörü belirli bir ad ile eşleştirin.", + "topFoldersLabel": "Birden Çok Ada Sahip Klasör (En Üst Düzey)", + "topFoldersDescription": "Birden çok en üst düzey klasörü eşleştirin.", + "folderLabel": "Ada Göre Klasör (Herhangi Bir Konum)", + "folderDescription": "Bir klasörü herhangi bir konumdaki belirli bir ad ile eşleştirin.", + "falseDescription": "Deseni devre dışı bırakın.", + "trueDescription": "Deseni etkinleştirin.", + "siblingsDescription": "Aynı ada ancak farklı bir uzantıya sahip eşdüzeyi olan dosyaları eşleştirin.", + "languageSpecificEditorSettings": "Dile özel düzenleyici ayarları", + "languageSpecificEditorSettingsDescription": "Dil için düzenleyici ayarlarını geçersiz kıl" +} \ No newline at end of file diff --git a/i18n/trk/extensions/css/client/out/cssMain.i18n.json b/i18n/trk/extensions/css/client/out/cssMain.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..25a60c398285c266eb019dfd8917299185424e42 --- /dev/null +++ b/i18n/trk/extensions/css/client/out/cssMain.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "cssserver.name": "CSS Dil Sunucusu" +} \ No newline at end of file diff --git a/i18n/trk/extensions/css/package.i18n.json b/i18n/trk/extensions/css/package.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..215750e00ed3d7df7ca51f9d1cca11d983f849a3 --- /dev/null +++ b/i18n/trk/extensions/css/package.i18n.json @@ -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. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "css.lint.argumentsInColorFunction.desc": "Geçersiz sayıda parametre", + "css.lint.boxModel.desc": "Doldurma veya kenarlık kullanırken genişlik veya yükseklik kullanmayın", + "css.lint.compatibleVendorPrefixes.desc": "Satıcıya özgü bir ön ek kullanırken satıcıya özgü diğer tüm özellikleri de dahil ettiğinizden emin olun", + "css.lint.duplicateProperties.desc": "Yinelenen stil tanımları kullanmayın", + "css.lint.emptyRules.desc": "Boş kural kümeleri kullanmayın", + "css.lint.float.desc": "'float' kullanmaktan kaçının. Float'lar, düzenin herhangi bir unsuru değiştiğinde kolayca bozulan kırılgan CSS ile sonuçlanır.", + "css.lint.fontFaceProperties.desc": "@font-face kuralı 'src' ve 'font-family' özelliklerini tanımlamalıdır", + "css.lint.hexColorLength.desc": "Onaltılık renkler üç veya altı onaltılık sayıdan oluşmalıdır", + "css.lint.idSelector.desc": "Bu kurallar HTML'ye çok sıkı bağlı olduğundan seçiciler kimlikleri içermemelidir.", + "css.lint.ieHack.desc": "IE izinsiz girişleri yalnızca IE7 ve daha eski sürümler desteklenirken gereklidir", + "css.lint.important.desc": "!important kullanmaktan kaçının. Tüm CSS'nin belirginlik düzeyi üzerindeki denetimin kaybedildiğinin ve yeniden düzenlenmesi gerektiğinin bir belirtisidir.", + "css.lint.importStatement.desc": "İçe aktarma deyimleri paralel olarak yüklenmez", + "css.lint.propertyIgnoredDueToDisplay.desc": "Özellik gösterim nedeniyle yoksayıldı. Örn. 'display: inline' ile width, height, margin-top, margin-bottom ve float özelliklerinin hiçbir etkisi olmaz", + "css.lint.universalSelector.desc": "Evrensel seçici (*) yavaş olarak bilinir", + "css.lint.unknownProperties.desc": "Bilinmeyen özellik.", + "css.lint.unknownVendorSpecificProperties.desc": "Bilinmeyen satıcıya özel özellik.", + "css.lint.vendorPrefix.desc": "Satıcıya özgü bir ön ek kullanırken standart özelliği de dahil edin", + "css.lint.zeroUnits.desc": "Sıfır için birim gerekmez", + "css.validate.desc": "Tüm doğrulamaları etkinleştirir veya devre dışı bırakır", + "less.lint.argumentsInColorFunction.desc": "Geçersiz sayıda parametre", + "less.lint.boxModel.desc": "Doldurma veya kenarlık kullanırken genişlik veya yükseklik kullanmayın", + "less.lint.compatibleVendorPrefixes.desc": "Satıcıya özgü bir ön ek kullanırken satıcıya özgü diğer tüm özellikleri de dahil ettiğinizden emin olun", + "less.lint.duplicateProperties.desc": "Yinelenen stil tanımları kullanmayın", + "less.lint.emptyRules.desc": "Boş kural kümeleri kullanmayın", + "less.lint.float.desc": "'float' kullanmaktan kaçının. Float'lar, düzenin herhangi bir unsuru değiştiğinde kolayca bozulan kırılgan CSS ile sonuçlanır.", + "less.lint.fontFaceProperties.desc": "@font-face kuralı 'src' ve 'font-family' özelliklerini tanımlamalıdır", + "less.lint.hexColorLength.desc": "Onaltılık renkler üç veya altı onaltılık sayıdan oluşmalıdır", + "less.lint.idSelector.desc": "Bu kurallar HTML'ye çok sıkı bağlı olduğundan seçiciler kimlikleri içermemelidir.", + "less.lint.ieHack.desc": "IE izinsiz girişleri yalnızca IE7 ve daha eski sürümler desteklenirken gereklidir", + "less.lint.important.desc": "!important kullanmaktan kaçının. Tüm CSS'nin belirginlik düzeyi üzerindeki denetimin kaybedildiğinin ve yeniden düzenlenmesi gerektiğinin bir belirtisidir.", + "less.lint.importStatement.desc": "İçe aktarma deyimleri paralel olarak yüklenmez", + "less.lint.propertyIgnoredDueToDisplay.desc": "Özellik gösterim nedeniyle yoksayıldı. Örn. 'display: inline' ile width, height, margin-top, margin-bottom ve float özelliklerinin hiçbir etkisi olmaz", + "less.lint.universalSelector.desc": "Evrensel seçici (*) yavaş olarak bilinir", + "less.lint.unknownProperties.desc": "Bilinmeyen özellik.", + "less.lint.unknownVendorSpecificProperties.desc": "Bilinmeyen satıcıya özel özellik.", + "less.lint.vendorPrefix.desc": "Satıcıya özgü bir ön ek kullanırken standart özelliği de dahil edin", + "less.lint.zeroUnits.desc": "Sıfır için birim gerekmez", + "less.validate.desc": "Tüm doğrulamaları etkinleştirir veya devre dışı bırakır", + "scss.lint.argumentsInColorFunction.desc": "Geçersiz sayıda parametre", + "scss.lint.boxModel.desc": "Doldurma veya kenarlık kullanırken genişlik veya yükseklik kullanmayın", + "scss.lint.compatibleVendorPrefixes.desc": "Satıcıya özgü bir ön ek kullanırken satıcıya özgü diğer tüm özellikleri de dahil ettiğinizden emin olun", + "scss.lint.duplicateProperties.desc": "Yinelenen stil tanımları kullanmayın", + "scss.lint.emptyRules.desc": "Boş kural kümeleri kullanmayın", + "scss.lint.float.desc": "'float' kullanmaktan kaçının. Float'lar, düzenin herhangi bir unsuru değiştiğinde kolayca bozulan kırılgan CSS ile sonuçlanır.", + "scss.lint.fontFaceProperties.desc": "@font-face kuralı 'src' ve 'font-family' özelliklerini tanımlamalıdır", + "scss.lint.hexColorLength.desc": "Onaltılık renkler üç veya altı onaltılık sayıdan oluşmalıdır", + "scss.lint.idSelector.desc": "Bu kurallar HTML'ye çok sıkı bağlı olduğundan seçiciler kimlikleri içermemelidir.", + "scss.lint.ieHack.desc": "IE izinsiz girişleri yalnızca IE7 ve daha eski sürümler desteklenirken gereklidir", + "scss.lint.important.desc": "!important kullanmaktan kaçının. Tüm CSS'nin belirginlik düzeyi üzerindeki denetimin kaybedildiğinin ve yeniden düzenlenmesi gerektiğinin bir belirtisidir.", + "scss.lint.importStatement.desc": "İçe aktarma deyimleri paralel olarak yüklenmez", + "scss.lint.propertyIgnoredDueToDisplay.desc": "Özellik gösterim nedeniyle yoksayıldı. Örn. 'display: inline' ile width, height, margin-top, margin-bottom ve float özelliklerinin hiçbir etkisi olmaz", + "scss.lint.universalSelector.desc": "Evrensel seçici (*) yavaş olarak bilinir", + "scss.lint.unknownProperties.desc": "Bilinmeyen özellik.", + "scss.lint.unknownVendorSpecificProperties.desc": "Bilinmeyen satıcıya özel özellik.", + "scss.lint.vendorPrefix.desc": "Satıcıya özgü bir ön ek kullanırken standart özelliği de dahil edin", + "scss.lint.zeroUnits.desc": "Sıfır için birim gerekmez", + "scss.validate.desc": "Tüm doğrulamaları etkinleştirir veya devre dışı bırakır", + "less.colorDecorators.enable.desc": "Renk dekoratörlerini etkinleştirir veya devre dışı bırakır", + "scss.colorDecorators.enable.desc": "Renk dekoratörlerini etkinleştirir veya devre dışı bırakır", + "css.colorDecorators.enable.desc": "Renk dekoratörlerini etkinleştirir veya devre dışı bırakır" +} \ No newline at end of file diff --git a/i18n/trk/extensions/extension-editing/out/packageDocumentHelper.i18n.json b/i18n/trk/extensions/extension-editing/out/packageDocumentHelper.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..727dd6640ef4e606779527bf694971c7cdb0f9a4 --- /dev/null +++ b/i18n/trk/extensions/extension-editing/out/packageDocumentHelper.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "languageSpecificEditorSettings": "Dile özel düzenleyici ayarları", + "languageSpecificEditorSettingsDescription": "Dil için düzenleyici ayarlarını geçersiz kıl" +} \ No newline at end of file diff --git a/i18n/trk/extensions/git/out/askpass-main.i18n.json b/i18n/trk/extensions/git/out/askpass-main.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..56e7f652dd6f5912465d4f225a217b445cfbd597 --- /dev/null +++ b/i18n/trk/extensions/git/out/askpass-main.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "missOrInvalid": "Eksik veya geçersiz kimlik bilgisi." +} \ No newline at end of file diff --git a/i18n/trk/extensions/git/out/commands.i18n.json b/i18n/trk/extensions/git/out/commands.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..b2222807717d2fbd468dbbcf9e94c68b579b9197 --- /dev/null +++ b/i18n/trk/extensions/git/out/commands.i18n.json @@ -0,0 +1,46 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "tag at": "{0} üzerindeki etiket", + "remote branch at": "{0} üzerindeki uzak dal", + "repourl": "Depo URL'si", + "parent": "Üst Klasör", + "cloning": "Git deposu kopyalanıyor...", + "openrepo": "Depoyu Aç", + "proposeopen": "Kopyalanan depoyu açmak ister misiniz?", + "confirm revert": "{0} üzerindeki seçili değişiklikleri geri almak istediğinizden emin misiniz?", + "revert": "Değişiklikleri Geri Al", + "confirm discard": "{0} üzerindeki seçili değişiklikleri göz ardı etmek istediğinizden emin misiniz?", + "confirm discard multiple": "{0} dosyadaki değişiklikleri göz ardı etmek istediğinizden emin misiniz?", + "discard": "Değişiklikleri Göz Ardı Et", + "confirm discard all": "TÜM değişiklikleri göz ardı etmek istediğinizden emin misiniz? Bu, GERİ DÖNDÜRÜLEMEZ!", + "discardAll": "TÜM Değişiklikleri Göz Ardı Et", + "no staged changes": "Commit'lenecek hazırlanmış değişiklik yok.\n\nTüm değişikliklerinizi otomatik olarak hazırlamak ve direkt olarak commit'lemek ister misiniz?", + "yes": "Evet", + "always": "Her Zaman", + "no changes": "Commit'lenecek değişiklik yok.", + "commit message": "Commit mesajı", + "provide commit message": "Lütfen bir commit mesajı belirtin.", + "branch name": "Dal adı", + "provide branch name": "Lütfen bir dal adı belirtin", + "select branch to delete": "Silinecek dalı seçin", + "confirm force delete branch": "'{0}' dalı tamamen birleştirilmemiş. Yine de silinsin mi?", + "delete branch": "Dalı Sil", + "no remotes to pull": "Deponuzda çekme işleminin yapılacağı hiçbir uzak uçbirim yapılandırılmamış.", + "no remotes to push": "Deponuzda gönderimin yapılacağı hiçbir uzak uçbirim yapılandırılmamış.", + "nobranch": "Lütfen uzak uçbirime gönderilecek dala geçiş yapın.", + "pick remote": "'{0}' dalının yayınlanacağı bir uzak uçbirim seçin:", + "sync is unpredictable": "Bu eylem, '{0}' esas projesine commitleri gönderecek ve alacaktır.", + "ok": "Tamam", + "never again": "Tamam, Tekrar Gösterme", + "no remotes to publish": "Deponuzda yayınlamanın yapılacağı hiçbir uzak uçbirim yapılandırılmamış.", + "disabled": "Git, ya devre dışı bırakılmış ya da bu çalışma alanında desteklenmiyor", + "clean repo": "Geçiş yapmadan önce deponuzdaki çalışma ağacınızı temizleyin.", + "cant push": "Başvurular uzak uçbirime gönderilemiyor. Değişikliklerinizi entegre etmeden, ilk olarak 'Çek'i çalıştırın. ", + "git error details": "Git: {0}", + "git error": "Git hatası", + "open git log": "Git Günlüğünü Aç" +} \ No newline at end of file diff --git a/i18n/trk/extensions/git/out/main.i18n.json b/i18n/trk/extensions/git/out/main.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..eda1b0cc9a934b2bc8a8961501a2391ceafe3a17 --- /dev/null +++ b/i18n/trk/extensions/git/out/main.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "using git": "{1} yolundaki git {0} kullanılıyor", + "updateGit": "Git'i Güncelle", + "neverShowAgain": "Tekrar gösterme", + "git20": "git {0} yüklemiş olarak görünüyorsunuz. Code, git >= 2 ile en iyi şekilde çalışır" +} \ No newline at end of file diff --git a/i18n/trk/extensions/git/out/model.i18n.json b/i18n/trk/extensions/git/out/model.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..282a283d443825c66dc7140f4ae0909e56d59543 --- /dev/null +++ b/i18n/trk/extensions/git/out/model.i18n.json @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "open": "Aç", + "merge changes": "Değişiklikleri Birleştir", + "staged changes": "Hazırlanmış Değişiklikler", + "changes": "Değişiklikler", + "ok": "Tamam", + "neveragain": "Tekrar Gösterme", + "huge": "'{0}' yolundaki git deposunda çok fazla aktif değişikliklik var, Git özelliklerinin yalnızca bir alt kümesi etkinleştirilecektir." +} \ No newline at end of file diff --git a/i18n/trk/extensions/git/out/scmProvider.i18n.json b/i18n/trk/extensions/git/out/scmProvider.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..9d509d1398a3993ede68a9e8ca9978b9e1a8c1d5 --- /dev/null +++ b/i18n/trk/extensions/git/out/scmProvider.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "commit": "Commit'le" +} \ No newline at end of file diff --git a/i18n/trk/extensions/git/out/statusbar.i18n.json b/i18n/trk/extensions/git/out/statusbar.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..eb7a0d55141d81b5ff030743fa543eb81b702043 --- /dev/null +++ b/i18n/trk/extensions/git/out/statusbar.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "checkout": "Geçiş yap...", + "sync changes": "Değişiklikleri Senkronize Et", + "publish changes": "Değişiklikleri Yayınla", + "syncing changes": "Değişiklikler Senkronize Ediliyor..." +} \ No newline at end of file diff --git a/i18n/trk/extensions/git/package.i18n.json b/i18n/trk/extensions/git/package.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..9789311accf8647e38e83cd76ba972c8a5c57e9f --- /dev/null +++ b/i18n/trk/extensions/git/package.i18n.json @@ -0,0 +1,49 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "command.clone": "Klonla", + "command.init": "Depo Oluştur", + "command.refresh": "Yenile", + "command.openChange": "Değişiklikleri Aç", + "command.openFile": "Dosya Aç", + "command.stage": "Değişiklikleri Hazırla", + "command.stageAll": "Tüm Değişiklikleri Hazırla", + "command.stageSelectedRanges": "Seçili Aralığı Hazırla", + "command.revertSelectedRanges": "Seçili Aralığı Geri Al", + "command.unstage": "Değişiklikleri Hazırlık Alanından Geri Al", + "command.unstageAll": "Tüm Değişiklikleri Hazırlık Alanından Geri Al", + "command.unstageSelectedRanges": "Seçili Alanı Hazırlık Alanından Geri Al", + "command.clean": "Değişiklikleri Göz Ardı Et", + "command.cleanAll": "Tüm Değişiklikleri Göz Ardı Et", + "command.commit": "Commit'le", + "command.commitStaged": "Hazırlananları Commit'le", + "command.commitStagedSigned": "Hazırlananları Commit'le (İmzalı)", + "command.commitAll": "Tümünü Commit'le", + "command.commitAllSigned": "Tümünü Commit'le (İmzalı)", + "command.undoCommit": "Son Commit'i Geri Al", + "command.checkout": "Geçiş yap...", + "command.branch": "Dal Oluştur...", + "command.deleteBranch": "Dalı Sil...", + "command.pull": "Çek", + "command.pullRebase": "Çek (Yeniden Adresle)", + "command.push": "Gönder", + "command.pushTo": "Gönder...", + "command.sync": "Senkronize Et", + "command.publish": "Dalı Yayınla", + "command.showOutput": "Git Çıktısını Göster", + "config.enabled": "Git'in etkinleştirilip etkinleştirilmediği", + "config.path": "Çalıştırılabilir Git dosyasının yolu", + "config.autorefresh": "Otomatik yenilemenin etkinleştirilip etkinleştirilmediği", + "config.autofetch": "Otomatik getirmenin etkinleştirilip etkinleştirilmediği", + "config.enableLongCommitWarning": "Uzun commit mesajları hakkında uyarıda bulunulup bulunulmayacağı", + "config.confirmSync": "Git depolarını senkronize etmeden önce onaylayın", + "config.countBadge": "Git gösterge sayacını denetler. `all` tüm değişiklikleri sayar. `tracked` sadece izlenen değişikliklikleri sayar. `off` ise kapatır.", + "config.checkoutType": "`Geçiş Yap...` çalıştırılırken listelenecek dal türlerini denetler. `all` tüm başvuruları gösterir, `local` sadece yerel dalları gösterir, `tags` sadece etiketleri gösterir ve `remote` sadece uzak uçbirim dallarını gösterir.", + "config.ignoreLegacyWarning": "Eski Git uyarısını görmezden gelir", + "config.ignoreLimitWarning": "Bir depoda çok fazla değişiklik var uyarısını görmezden gelir", + "config.defaultCloneDirectory": "Bir git deposunun kopyalanacağı varsayılan konum", + "config.enableSmartCommit": "Hazırlanan değişiklik yoksa tüm değişiklikleri commit'le." +} \ No newline at end of file diff --git a/i18n/trk/extensions/grunt/out/main.i18n.json b/i18n/trk/extensions/grunt/out/main.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..a379bb7fabe934d4111463bb414d238b884b7e83 --- /dev/null +++ b/i18n/trk/extensions/grunt/out/main.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "execFailed": "Grunt otomatik tespiti hata ile sonuçlandı: {0}" +} \ No newline at end of file diff --git a/i18n/trk/extensions/grunt/package.i18n.json b/i18n/trk/extensions/grunt/package.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..0a027f4d9547997252ec87da556b21c3b14f160e --- /dev/null +++ b/i18n/trk/extensions/grunt/package.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "config.grunt.autoDetect": "Grunt görevlerinin otomatik olarak algılanıp algılanmayacağını denetler. Varsayılan olarak açıktır." +} \ No newline at end of file diff --git a/i18n/trk/extensions/gulp/out/main.i18n.json b/i18n/trk/extensions/gulp/out/main.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..419e64b90d8255b8decc14d245c0764db4c84dbb --- /dev/null +++ b/i18n/trk/extensions/gulp/out/main.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "execFailed": "Gulp otomatik tespiti hata ile sonuçlandı: {0}" +} \ No newline at end of file diff --git a/i18n/trk/extensions/gulp/package.i18n.json b/i18n/trk/extensions/gulp/package.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..11a00f49019be4aef5f1c53b00fc870a8616e874 --- /dev/null +++ b/i18n/trk/extensions/gulp/package.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "config.gulp.autoDetect": "Gulp görevlerinin otomatik olarak algılanıp algılanmayacağını denetler. Varsayılan olarak açıktır." +} \ No newline at end of file diff --git a/i18n/trk/extensions/html/client/out/htmlMain.i18n.json b/i18n/trk/extensions/html/client/out/htmlMain.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..768300d269bfba939984cdacbec9f7d510501d7e --- /dev/null +++ b/i18n/trk/extensions/html/client/out/htmlMain.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "htmlserver.name": "HTML Dil Sunucusu" +} \ No newline at end of file diff --git a/i18n/trk/extensions/html/package.i18n.json b/i18n/trk/extensions/html/package.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..ee68938c898ccd9a68cfaca7b19754195b958704 --- /dev/null +++ b/i18n/trk/extensions/html/package.i18n.json @@ -0,0 +1,27 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "html.format.enable.desc": "Varsayılan HTML biçimlendiricisini etkinleştirin/devre dışı bırakın (yeniden başlatma gerektirir)", + "html.format.wrapLineLength.desc": "Satır başına en fazla karakter miktarı (0 = devre dışı bırak)", + "html.format.unformatted.desc": "Yeniden biçimlendirilmeyecek virgülle ayrılmış etiketler listesi. 'null' değeri, https://www.w3.org/TR/html5/dom.html#phrasing-content adresinde listelenen tüm etiketleri varsayılan olarak belirler.", + "html.format.contentUnformatted.desc": "İçeriğin yeniden biçimlendirilmeyeceği virgülle ayrılmış etiketler listesi. 'null' değeri, 'pre' etiketini varsayılan olarak belirler.", + "html.format.indentInnerHtml.desc": " ve bölümlerini girintile.", + "html.format.preserveNewLines.desc": "Ögelerden önceki mevcut satır sonlarının korunup korunmayacağı. Yalnızca ögelerden önce çalışır, etiketler içinde veya metinde çalışmaz.", + "html.format.maxPreserveNewLines.desc": "Bir öbekte korunacak maksimum satır sonu sayısı. Sınırsız için 'null' değerini kullanın.", + "html.format.indentHandlebars.desc": "{{#foo}} ve {{/foo}}'yu biçimlendir ve girintile.", + "html.format.endWithNewline.desc": "Boş bir satırla bitir.", + "html.format.extraLiners.desc": "Kendilerinden önce ek bir boş satır bulunması gereken virgülle ayrılmış etiketler listesi. 'null' değeri, \"head, body, /html\" değerini varsayılan olarak belirler.", + "html.format.wrapAttributes.desc": "Öznitelikleri sarmala.", + "html.format.wrapAttributes.auto": "Öznitelikleri sadece satır uzunluğu aşıldığında sarmala.", + "html.format.wrapAttributes.force": "İlki hariç tüm öznitelikleri sarmala.", + "html.format.wrapAttributes.forcealign": "İlki hariç tüm öznitelikleri sarmala ve hizada tut.", + "html.format.wrapAttributes.forcemultiline": "Tüm öznitelikleri sarmala.", + "html.suggest.angular1.desc": "Yerleşik HTML dili desteğinin Angular V1 etiketlerini ve özelliklerini önerip önermeyeceğini yapılandırır.", + "html.suggest.ionic.desc": "Yerleşik HTML dili desteğinin Ionic etiketlerini, özelliklerini ve değerlerini önerip önermeyeceğini yapılandırır.", + "html.suggest.html5.desc": "Yerleşik HTML dili desteğinin HTML5 etiketlerini, özelliklerini ve değerlerini önerip önermeyeceğini yapılandırır.", + "html.validate.scripts": "Yerleşik HTML dili desteğinin HTML5 gömülü betikleri doğrulayıp doğrulamayacağını yapılandırır.", + "html.validate.styles": "Yerleşik HTML dili desteğinin HTML5 gömülü stilleri doğrulayıp doğrulamayacağını yapılandırır." +} \ No newline at end of file diff --git a/i18n/trk/extensions/jake/out/main.i18n.json b/i18n/trk/extensions/jake/out/main.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..c94980eca2f63f634915503269497340709f183f --- /dev/null +++ b/i18n/trk/extensions/jake/out/main.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "execFailed": "Jake otomatik tespiti hata ile sonuçlandı: {0}" +} \ No newline at end of file diff --git a/i18n/trk/extensions/jake/package.i18n.json b/i18n/trk/extensions/jake/package.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..983e8866dea35e5f3a3bfe59e20ce65674a2bfaa --- /dev/null +++ b/i18n/trk/extensions/jake/package.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "config.jake.autoDetect": "Jake görevlerinin otomatik olarak algılanıp algılanmayacağını denetler. Varsayılan olarak açıktır." +} \ No newline at end of file diff --git a/i18n/trk/extensions/javascript/out/features/bowerJSONContribution.i18n.json b/i18n/trk/extensions/javascript/out/features/bowerJSONContribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..8e2b17e627dce0ce3b8a8173e3c3b0ea11089f2a --- /dev/null +++ b/i18n/trk/extensions/javascript/out/features/bowerJSONContribution.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "json.bower.default": "Varsayılan bower.json", + "json.bower.error.repoaccess": "Bower deposuna yapılan istek başarısız oldu: {0}", + "json.bower.latest.version": "en son" +} \ No newline at end of file diff --git a/i18n/trk/extensions/javascript/out/features/packageJSONContribution.i18n.json b/i18n/trk/extensions/javascript/out/features/packageJSONContribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..702ad94d30e0c443378e91526f61ba0227d2db8b --- /dev/null +++ b/i18n/trk/extensions/javascript/out/features/packageJSONContribution.i18n.json @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "json.package.default": "Varsayılan package.json", + "json.npm.error.repoaccess": "NPM deposuna yapılan istek başarısız oldu: {0}", + "json.npm.latestversion": "Paketin şu andaki en son sürümü", + "json.npm.majorversion": "En son birincil sürümle eşleşiyor (1.x.x)", + "json.npm.minorversion": "En son ikincil sürümle eşleşiyor (1.2.x)", + "json.npm.version.hover": "En son sürüm: {0}" +} \ No newline at end of file diff --git a/i18n/trk/extensions/json/client/out/jsonMain.i18n.json b/i18n/trk/extensions/json/client/out/jsonMain.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..f0d4863e7459bb9b56a20d78f7d852fb28d46d1d --- /dev/null +++ b/i18n/trk/extensions/json/client/out/jsonMain.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "jsonserver.name": "JSON Dil Sunucusu" +} \ No newline at end of file diff --git a/i18n/trk/extensions/json/package.i18n.json b/i18n/trk/extensions/json/package.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..bc1296fa6f9b9f659f818176307c107b98805161 --- /dev/null +++ b/i18n/trk/extensions/json/package.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "json.schemas.desc": "Şemaları geçerli projedeki JSON dosyalarıyla ilişkilendir", + "json.schemas.url.desc": "Bir şemanın URL'si veya geçerli dizindeki bir şemanın göreli yolu", + "json.schemas.fileMatch.desc": "JSON dosyaları şemalara çözümlenirken eşleşme için kullanılacak bir dosya düzenleri dizisi.", + "json.schemas.fileMatch.item.desc": "JSON dosyaları şemalara çözümlenirken eşleşme için '*' içerebilen bir dosya düzeni.", + "json.schemas.schema.desc": "Verilen URL için şema tanımı. Şema, yalnızca şema URL'sine erişimi önlemek için sağlanmalıdır.", + "json.format.enable.desc": "Varsayılan JSON biçimlendiricisini etkinleştirin/devre dışı bırakın (yeniden başlatma gerektirir)", + "json.tracing.desc": "VS Code ve JSON dil sunucusu arasındaki iletişimi izler.", + "json.colorDecorators.enable.desc": "Renk dekoratörlerini etkinleştirir veya devre dışı bırakır" +} \ No newline at end of file diff --git a/i18n/trk/extensions/markdown/out/extension.i18n.json b/i18n/trk/extensions/markdown/out/extension.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..de26700eac41879b0e0ca8ceb59cb276286abe84 --- /dev/null +++ b/i18n/trk/extensions/markdown/out/extension.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "onPreviewStyleLoadError": "'markdown.styles' yüklenemedi: {0}" +} \ No newline at end of file diff --git a/i18n/trk/extensions/markdown/out/previewContentProvider.i18n.json b/i18n/trk/extensions/markdown/out/previewContentProvider.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..83d25162ae31e7912f368c3f7774232b1a5a8fce --- /dev/null +++ b/i18n/trk/extensions/markdown/out/previewContentProvider.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "preview.securityMessage.text": "Bu belgede betikler devre dışı bırakıldı", + "preview.securityMessage.title": "Markdown önizlemesinde belgede betikler devre dışı bırakılmıştır. Betikleri etkinleştirmek için Markdown önizleme güvenlik ayarlarını değiştirin", + "preview.securityMessage.label": "Betikler Devre Dışı Güvenlik Uyarısı" +} \ No newline at end of file diff --git a/i18n/trk/extensions/markdown/out/security.i18n.json b/i18n/trk/extensions/markdown/out/security.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..f6bd3d4536474fec47242d1945857d8e13fb059f --- /dev/null +++ b/i18n/trk/extensions/markdown/out/security.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "preview.showPreviewSecuritySelector.disallowScriptsForWorkspaceTitle": "Bu çalışma alanındaki Markdown önizlemelerinde betik çalıştırmayı devre dışı bırak", + "preview.showPreviewSecuritySelector.currentSelection": "Geçerli ayar", + "preview.showPreviewSecuritySelector.allowScriptsForWorkspaceTitle": "Bu çalışma alanındaki Markdown önizlemelerinde betik çalıştırmayı etkinleştir", + "preview.showPreviewSecuritySelector.title": "Markdown önizlemesi için güvenlik ayarlarını değiştir" +} \ No newline at end of file diff --git a/i18n/trk/extensions/markdown/package.i18n.json b/i18n/trk/extensions/markdown/package.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..67c3c86ed88984f1bfdd981090b6f2177d44badf --- /dev/null +++ b/i18n/trk/extensions/markdown/package.i18n.json @@ -0,0 +1,22 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "markdown.preview.doubleClickToSwitchToEditor.desc": "Düzenleyiciye geçiş yapmak için Markdown önizlemesine çift tıklayın.", + "markdown.preview.fontFamily.desc": "Markdown önizlemesinde kullanılan yazı tipi ailesini denetler.", + "markdown.preview.fontSize.desc": "Markdown önizlemesinde kullanılan yazı tipi boyutunu piksel olarak denetler.", + "markdown.preview.lineHeight.desc": "Markdown önizlemesinde kullanılan satır yüksekliğini denetler. Bu sayı yazı tipi boyutuna görecelidir.", + "markdown.preview.markEditorSelection.desc": "Markdown önizlemesinde geçerli düzenleyici seçimini işaretle.", + "markdown.preview.scrollEditorWithPreview.desc": "Markdown önizlemesi kaydırıldığında, düzenleyicinin görünümünü güncelle.", + "markdown.preview.scrollPreviewWithEditorSelection.desc": "Düzenleyicide seçili satırın görünmesi için Markdown önizlemesini kaydırır.", + "markdown.preview.title": "Önizlemeyi Aç", + "markdown.previewFrontMatter.dec": "YAML ön maddesinin Markdown önizlemesinde nasıl gösterilmesi gerektiğini ayarlar. 'hide' ön maddeyi kaldırır. Diğer türlü; ön madde, Markdown içeriği olarak sayılır.", + "markdown.previewSide.title": "Önizlemeyi Yana Aç", + "markdown.showSource.title": "Kaynağı Göster", + "markdown.styles.dec": "Markdown önizlemesinde kullanılmak üzere CSS stil dosyalarını işaret eden bir URL'ler veya yerel yollar listesi. Göreli yollar, gezginde açılan klasöre göreli olarak yorumlanır.", + "markdown.showPreviewSecuritySelector.title": "Markdown Önizleme Güvenlik Ayarlarını Değiştir", + "markdown.preview.enableExperimentalExtensionApi.desc": "[Deneysel] Eklentilere Markdown önizlemesini genişletmek için izin ver.", + "markdown.trace.desc": "Markdown eklentisi için hata ayıklama günlüğünü etkinleştir." +} \ No newline at end of file diff --git a/i18n/trk/extensions/merge-conflict/out/codelensProvider.i18n.json b/i18n/trk/extensions/merge-conflict/out/codelensProvider.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..26571af8cf39cec2552355a3fda3aafc79b56ab6 --- /dev/null +++ b/i18n/trk/extensions/merge-conflict/out/codelensProvider.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "acceptCurrentChange": "Geçerli Değişikliği Kabul Et", + "acceptIncomingChange": "Gelen Değişikliği Kabul Et", + "acceptBothChanges": "Her İki Değişikliği de Kabul Et", + "compareChanges": "Değişiklikleri Karşılaştır" +} \ No newline at end of file diff --git a/i18n/trk/extensions/merge-conflict/out/commandHandler.i18n.json b/i18n/trk/extensions/merge-conflict/out/commandHandler.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..3811062c8a33c10dd99b861489fe13061e544648 --- /dev/null +++ b/i18n/trk/extensions/merge-conflict/out/commandHandler.i18n.json @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "cursorNotInConflict": "Düzenleyici imleci birleştirme çakışması içinde değil", + "compareChangesTitle": "{0}: Geçerli Değişiklikler ⟷ Gelen Değişiklikler", + "cursorOnCommonAncestorsRange": "Düzenleyici imleci ortak atalar bloğunda, imleci lütfen \"geçerli\" veya \"gelen\" bloğundan birine getirin", + "cursorOnSplitterRange": "Düzenleyici imleci birleştirme çakışması ayırıcısında, imleci lütfen \"geçerli\" veya \"gelen\" bloğundan birine getirin", + "noConflicts": "Bu dosyada birleştirme çakışması bulunamadı", + "noOtherConflictsInThisFile": "Bu dosyada başka birleştirme çakışması bulunamadı" +} \ No newline at end of file diff --git a/i18n/trk/extensions/merge-conflict/out/mergeDecorator.i18n.json b/i18n/trk/extensions/merge-conflict/out/mergeDecorator.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..4e7bccae262acab1f27376c54c2453bbb122eadb --- /dev/null +++ b/i18n/trk/extensions/merge-conflict/out/mergeDecorator.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "currentChange": "(Geçerli Değişiklik)", + "incomingChange": "(Gelen Değişiklik)" +} \ No newline at end of file diff --git a/i18n/trk/extensions/merge-conflict/package.i18n.json b/i18n/trk/extensions/merge-conflict/package.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..75e7f2cd722ed995579501f2e801f36f2a3a301a --- /dev/null +++ b/i18n/trk/extensions/merge-conflict/package.i18n.json @@ -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. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "command.category": "Birleştirme Çakışması", + "command.accept.all-incoming": "Gelen Tümünü Kabul Et", + "command.accept.all-both": "Tümünü Birden Kabul Et", + "command.accept.current": "Şuan Geçerli Olanı Kabul Et", + "command.accept.incoming": "Geleni Kabul Et", + "command.accept.selection": "Seçimi Kabul Et", + "command.accept.both": "Her İkisini de Kabul Et", + "command.next": "Sonraki Çakışma", + "command.previous": "Önceki Çakışma", + "command.compare": "Geçerli Çakışmayı Karşılaştır", + "config.title": "Birleştirme Çakışması", + "config.codeLensEnabled": "Düzenleyicideki birleştirme çakışması bloğu kod objektifini etkinleştir veya devre dışı bırak", + "config.decoratorsEnabled": "Düzenleyicideki birleştirme çakışması dekoratörlerini etkinleştir veya devre dışı bırak" +} \ No newline at end of file diff --git a/i18n/trk/extensions/npm/package.i18n.json b/i18n/trk/extensions/npm/package.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..5bda141ad8b60add256dc9350c042cf5a25196ac --- /dev/null +++ b/i18n/trk/extensions/npm/package.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "config.npm.autoDetect": "Npm betiklerinin otomatik olarak algılanıp algılanmayacağını denetler. Varsayılan olarak açıktır." +} \ No newline at end of file diff --git a/i18n/trk/extensions/php/out/features/validationProvider.i18n.json b/i18n/trk/extensions/php/out/features/validationProvider.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..dbfa92074c836e1d59290e7c66f51ac1f1167b77 --- /dev/null +++ b/i18n/trk/extensions/php/out/features/validationProvider.i18n.json @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "php.useExecutablePath": "{0} (çalışma alanı ayarı olarak tanımlı) yürütülebilir dosyasına PHP dosyalarını doğrulama izni veriyor musunuz?", + "php.yes": "İzin Ver", + "php.no": "İzin Verme", + "wrongExecutable": "{0} geçerli bir php yürütülebilir dosyası olmadığı için doğrulanamıyor. PHP yürütülebilir dosyasını yapılandırmak için 'php.validate.executablePath' ayarını kullanın.", + "noExecutable": "Hiçbir PHP yürütülebilir dosyası ayarlanmadığı için doğrulanamıyor. PHP yürütülebilir dosyasını yapılandırmak için 'php.validate.executablePath' ayarını kullanın.", + "unknownReason": "{0} yolu kullanılarak php çalıştırılamadı. Sebep bilinmiyor." +} \ No newline at end of file diff --git a/i18n/trk/extensions/php/package.i18n.json b/i18n/trk/extensions/php/package.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..d0a4266c125c0e4e1608cb0ce6d2e48316c874bb --- /dev/null +++ b/i18n/trk/extensions/php/package.i18n.json @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "configuration.suggest.basic": "Yerleşik PHP dili önerilerinin etkinleştirilip etkinleştirilmediğini yapılandırır. Destek, PHP globalleri ve değişkenleri önerir.", + "configuration.validate.enable": "Yerleşik PHP doğrulamasını etkinleştir/devre dışı bırak.", + "configuration.validate.executablePath": "PHP çalıştırılabilir dosyasına işaret eder.", + "configuration.validate.run": "Doğrulayıcının kayıt esnasında mı tuşlama esnasında mı çalışacağı.", + "configuration.title": "PHP", + "commands.categroy.php": "PHP", + "command.untrustValidationExecutable": "PHP doğrulama yürütülebilir dosyasına izin verme (çalışma alanı ayarı olarak tanımlanır)" +} \ No newline at end of file diff --git a/i18n/trk/extensions/typescript/out/features/bufferSyncSupport.i18n.json b/i18n/trk/extensions/typescript/out/features/bufferSyncSupport.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..a496aae13e05028a2dd920e20712151b0c7199dd --- /dev/null +++ b/i18n/trk/extensions/typescript/out/features/bufferSyncSupport.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "versionMismatch": "Düzenleyici özellikleri için TypeScript ({1}) kullanılıyor. TypeScript ({0}) makinanızda global olarak yüklenmiş durumda. VS Code'daki hatalar TSC hatalarından farklı olabilir", + "moreInformation": "Daha Fazla Bilgi", + "doNotCheckAgain": "Tekrar Kontrol Etme", + "close": "Kapat", + "updateTscCheck": "Kullanıcı ayarı 'typescript.check.tscVersion', \"false\" olarak güncellendi" +} \ No newline at end of file diff --git a/i18n/trk/extensions/typescript/out/features/completionItemProvider.i18n.json b/i18n/trk/extensions/typescript/out/features/completionItemProvider.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..de2a515d9aba7e9a82611ead66a5b5a6d5601986 --- /dev/null +++ b/i18n/trk/extensions/typescript/out/features/completionItemProvider.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "acquiringTypingsLabel": "Tuşlamalar alınıyor...", + "acquiringTypingsDetail": "IntelliSense için tuşlama tanımları alınıyor..." +} \ No newline at end of file diff --git a/i18n/trk/extensions/typescript/out/features/directiveCommentCompletionProvider.i18n.json b/i18n/trk/extensions/typescript/out/features/directiveCommentCompletionProvider.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..de25bb3c5f8d3fab8ae8d792660e30c0d3588264 --- /dev/null +++ b/i18n/trk/extensions/typescript/out/features/directiveCommentCompletionProvider.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "ts-check": "Bir JavaScript dosyasının anlamsal kontrolünü etkinleştirir. Bir dosyanın en üstünde olmalıdır.", + "ts-nocheck": "Bir JavaScript dosyasının anlamsal kontrolünü devre dışı bırakır. Bir dosyanın en üstünde olmalıdır.", + "ts-ignore": "Bir dosyanın sonraki satırında @ts-check hatalarını bastırır." +} \ No newline at end of file diff --git a/i18n/trk/extensions/typescript/out/features/implementationsCodeLensProvider.i18n.json b/i18n/trk/extensions/typescript/out/features/implementationsCodeLensProvider.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..05ad64ea38263a3e063041c28000068884925b02 --- /dev/null +++ b/i18n/trk/extensions/typescript/out/features/implementationsCodeLensProvider.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "oneImplementationLabel": "1 uygulama", + "manyImplementationLabel": "{0} uygulama", + "implementationsErrorLabel": "Uygulamalar belirlenemedi" +} \ No newline at end of file diff --git a/i18n/trk/extensions/typescript/out/features/jsDocCompletionProvider.i18n.json b/i18n/trk/extensions/typescript/out/features/jsDocCompletionProvider.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..203488810a2bb755e5c2471e3cca8f9dbfb57881 --- /dev/null +++ b/i18n/trk/extensions/typescript/out/features/jsDocCompletionProvider.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "typescript.jsDocCompletionItem.documentation": "JSDoc yorumu" +} \ No newline at end of file diff --git a/i18n/trk/extensions/typescript/out/features/referencesCodeLensProvider.i18n.json b/i18n/trk/extensions/typescript/out/features/referencesCodeLensProvider.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..34242b700576b48db2df79d3415a426fc14ca7c7 --- /dev/null +++ b/i18n/trk/extensions/typescript/out/features/referencesCodeLensProvider.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "oneReferenceLabel": "1 başvuru", + "manyReferenceLabel": "{0} başvuru", + "referenceErrorLabel": "Başvurular belirlenemedi" +} \ No newline at end of file diff --git a/i18n/trk/extensions/typescript/out/typescriptMain.i18n.json b/i18n/trk/extensions/typescript/out/typescriptMain.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..2751d3bb07c455357481a32f33edb879ad40badd --- /dev/null +++ b/i18n/trk/extensions/typescript/out/typescriptMain.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "typescript.projectConfigNoWorkspace": "Bir TypeScript veya JavaScript projesini kullanmak için lütfen bir klasör açın", + "typescript.projectConfigUnsupportedFile": "TypeScript mi yoksa JavaScript mi projesi olduğu tespit edilemedi. Desteklenmeyen dosya türü", + "typescript.projectConfigCouldNotGetInfo": "TypeScript mi yoksa JavaScript mi projesi olduğu tespit edilemedi", + "typescript.noTypeScriptProjectConfig": "Dosya bir TypeScript projesinin bir parçası değil", + "typescript.noJavaScriptProjectConfig": "Dosya bir JavaScript projesinin bir parçası değil", + "typescript.configureTsconfigQuickPick": "tsconfig.json'u yapılandır", + "typescript.configureJsconfigQuickPick": "jsconfig.json'u yapılandır", + "typescript.projectConfigLearnMore": "Daha Fazla Bilgi Edin" +} \ No newline at end of file diff --git a/i18n/trk/extensions/typescript/out/typescriptServiceClient.i18n.json b/i18n/trk/extensions/typescript/out/typescriptServiceClient.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..3cdde46b706b6b923a62434ff8ba77f967247617 --- /dev/null +++ b/i18n/trk/extensions/typescript/out/typescriptServiceClient.i18n.json @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "noServerFound": "{0} yolu geçerli bir tsserver kurulumuna işaret etmiyor. Paketlenmiş TypeScript sürümüne geri dönülüyor.", + "noBundledServerFound": "VSCode'un tsserver'ı hatalı bir virüs tespit aracı gibi bir uygulama tarafından silindi. Lütfen VS Code'u yeniden yükleyin", + "versionNumber.custom": "özel", + "serverCouldNotBeStarted": "TypeScript dil sunucusu başlatılamadı. Hata mesajı: {0}", + "useVSCodeVersionOption": "VSCode'un Sürümünü Kullan", + "activeVersion": "Şu an aktif", + "useWorkspaceVersionOption": "Çalışma Alanı Sürümünü Kullan", + "learnMore": "Daha Fazla Bilgi Edin", + "selectTsVersion": "JavaScript ve TypeScript dil özellikleri için kullanılacak TypeScript sürümünü seçin", + "typescript.openTsServerLog.notSupported": "TS Sunucu günlüğü için TS 2.2.2+ gerekiyor", + "typescript.openTsServerLog.loggingNotEnabled": "TS Sunucu günlüğü kapalı. Lütfen `typescript.tsserver.log` ögesini ayarlayın ve günlüğe yazmayı etkinleştirmek için TS sunucusunu yeniden başlatın", + "typescript.openTsServerLog.enableAndReloadOption": "Günlüğe yazmayı etkinleştir ve TS sunucusunu yeniden başlat", + "typescript.openTsServerLog.noLogFile": "TS sunucu günlüğe yazmaya başlamadı.", + "openTsServerLog.openFileFailedFailed": "TS Sunucu günlük dosyası açılamadı", + "serverDiedAfterStart": "TypeScript dil hizmeti, başladıktan hemen sonra 5 kez kapandı. Hizmet yeniden başlatılmayacaktır.", + "serverDiedReportIssue": "Sorun Bildir", + "serverDied": "TypeScript dil hizmeti, son 5 dakikada 5 kez beklenmedik şekilde kapandı." +} \ No newline at end of file diff --git a/i18n/trk/extensions/typescript/out/utils/logger.i18n.json b/i18n/trk/extensions/typescript/out/utils/logger.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..bc738f43d0c37059f5f771d3763cdf52b10ab10d --- /dev/null +++ b/i18n/trk/extensions/typescript/out/utils/logger.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "channelName": "TypeScript" +} \ No newline at end of file diff --git a/i18n/trk/extensions/typescript/out/utils/projectStatus.i18n.json b/i18n/trk/extensions/typescript/out/utils/projectStatus.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..3deea612eabfbc2f081ad743e3c0ff23a8bab29b --- /dev/null +++ b/i18n/trk/extensions/typescript/out/utils/projectStatus.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "hintExclude": "Proje çapında JavaScript/TypeScript dil özelliklerini etkinleştirmek için, şunlar gibi birçok dosyaya sahip klasörleri hariç tutun: {0}", + "hintExclude.generic": "Proje çapında JavaScript/TypeScript dil özelliklerini etkinleştirmek için, üzerinde çalışmadığınız kaynak dosyalar içeren büyük klasörleri hariç tutun.", + "large.label": "Hariç Tutmaları Yapılandır", + "hintExclude.tooltip": "Proje çapında JavaScript/TypeScript dil özelliklerini etkinleştirmek için, üzerinde çalışmadığınız kaynak dosyalar içeren büyük klasörleri hariç tutun." +} \ No newline at end of file diff --git a/i18n/trk/extensions/typescript/out/utils/typingsStatus.i18n.json b/i18n/trk/extensions/typescript/out/utils/typingsStatus.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..acdcdf70be50da60363ecba22e965d476c3d4080 --- /dev/null +++ b/i18n/trk/extensions/typescript/out/utils/typingsStatus.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "installingPackages": "Daha iyi TypeScript IntelliSense için veri alınıyor", + "typesInstallerInitializationFailed.title": "JavaScript dil özellikleri için tuşlama dosyaları yüklenemedi. Lütfen NPM'in yüklenmiş olduğundan veya kullanıcı ayarlarınızda 'typescript.npm' ögesini yapılandırın", + "typesInstallerInitializationFailed.moreInformation": "Daha Fazla Bilgi", + "typesInstallerInitializationFailed.doNotCheckAgain": "Tekrar Kontrol Etme", + "typesInstallerInitializationFailed.close": "Kapat" +} \ No newline at end of file diff --git a/i18n/trk/extensions/typescript/package.i18n.json b/i18n/trk/extensions/typescript/package.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..a730294ce6b933491eca2c95bf447c48893b1d7a --- /dev/null +++ b/i18n/trk/extensions/typescript/package.i18n.json @@ -0,0 +1,48 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "typescript.reloadProjects.title": "Projeyi Yeniden Yükle", + "javascript.reloadProjects.title": "Projeyi Yeniden Yükle", + "configuration.typescript": "TypeScript", + "typescript.useCodeSnippetsOnMethodSuggest.dec": "İşlevleri parametre imzalarıyla tamamlayın.", + "typescript.tsdk.desc": "Kullanılacak tsserver ve lib*.d.ts dosyalarını içeren klasör yolunu belirtir.", + "typescript.disableAutomaticTypeAcquisition": "Otomatik tür kazanımını devre dışı bırakır. TypeScript >= 2.0.6 ve değiştirildikten sonra yeniden başlatma gerektirir.", + "typescript.check.tscVersion": "Global TypeScript derleyicisinin(ör. tsc) kullanılan TypeScript dil hizmetinden farklı olup olmadığını kontrol et.", + "typescript.tsserver.log": "TS sunucusunun bir dosyaya günlük yazmasını etkinleştirir. Bu günlük, TS Sunucu sorunlarını teşhis etmek için kullanılabilir. Günlük dosya yollarını, kaynak kodunu ve projenizdeki diğer muhtemel hassas bilgileri içerebilir.", + "typescript.tsserver.trace": "TS sunucusuna gönderilen mesajları izlemeyi etkinleştirir. Bu izleme, TS Sunucu sorunlarını teşhis etmek için kullanılabilir. İzleme; dosya yollarını, kaynak kodunu ve projenizdeki diğer muhtemel hassas bilgileri içerebilir.", + "typescript.validate.enable": "TypeScript doğrulamasını etkinleştir veya devre dışı bırak.", + "typescript.format.enable": "Varsayılan TypeScript biçimlendiricisini etkinleştirin/devre dışı bırakın.", + "javascript.format.enable": "Varsayılan JavaScript biçimlendiricisini etkinleştir veya devre dışı bırak.", + "format.insertSpaceAfterCommaDelimiter": "Virgül sınırlayıcısından sonra boşluk eklenmesini tanımlar.", + "format.insertSpaceAfterConstructor": "Oluşturucu anahtar kelimesinden sonra boşluk eklenip eklenmeyeceğini tanımlar. TypeScript >= 2.3.0 gerektirir.", + "format.insertSpaceAfterSemicolonInForStatements": "Bir ifade için noktalı virgülden sonra boşluk eklenmesini tanımlar.", + "format.insertSpaceBeforeAndAfterBinaryOperators": "Bir ikili operatöründen sonra boşluk eklenmesini tanımlar.", + "format.insertSpaceAfterKeywordsInControlFlowStatements": "Bir kontrol akışı ifadesi için anahtar kelimelerden sonra boşluk eklenmesini tanımlar.", + "format.insertSpaceAfterFunctionKeywordForAnonymousFunctions": "Anonim fonksiyonlar için \"function\" anahtar kelimesinden sonra boşluk eklenmesini tanımlar.", + "format.insertSpaceBeforeFunctionParenthesis": "Fonksiyon argüman parantezlerinden önce boşluk eklenmesini tanımlar. TypeScript >= 2.1.5 gerektirir.", + "format.insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": "Boş olmayan parantezler açıldıktan sonra ve kapatılmadan önce boşluk eklenmesini tanımlar.", + "format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": "Boş olmayan köşeli parantezler açıldıktan sonra ve kapatılmadan önce boşluk eklenmesini tanımlar.", + "format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": "Boş olmayan küme parantezleri açıldıktan sonra ve kapatılmadan önce boşluk eklenmesini tanımlar. TypeScript >= 2.3.0 gerektirir.", + "format.insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": "Şablon dizesi ayraçları açıldıktan sonra ve kapatılmadan önce boşluk eklenmesini tanımlar. TypeScript >= 2.0.6 gerektirir.", + "format.insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces": "JSX ifadesi ayraçları açıldıktan sonra ve kapatılmadan önce boşluk eklenmesini tanımlar. TypeScript >= 2.0.6 gerektirir.", + "format.placeOpenBraceOnNewLineForFunctions": "Fonksiyonlarda bir açılış ayracının yeni satıra koyulup koyulmayacağını tanımlar.", + "format.placeOpenBraceOnNewLineForControlBlocks": "Kontrol bloklarında bir açılış ayracının yeni satıra koyulup koyulmayacağını tanımlar.", + "javascript.validate.enable": "JavaScript doğrulamasını etkinleştir veya devre dışı bırak.", + "typescript.goToProjectConfig.title": "Proje Yapılandırmasına Git", + "javascript.goToProjectConfig.title": "Proje Yapılandırmasına Git", + "javascript.referencesCodeLens.enabled": "JavaScript dosyalarında başvuru kod objektifini etkinleştir veya devre dışı bırak.", + "typescript.referencesCodeLens.enabled": "TypeScript dosyalarında başvuru kod objektifini etkinleştir veya devre dışı bırak. TypeScript >= 2.0.6 gerektirir.", + "typescript.implementationsCodeLens.enabled": "Uygulama kod objektifini etkinleştir veya devre dışı bırak. TypeScript >= 2.2.0 gerektirir.", + "typescript.openTsServerLog.title": "TS Sunucu günlüğünü aç", + "typescript.restartTsServer": "TS sunucusunu yeniden başlat", + "typescript.selectTypeScriptVersion.title": "TypeScript Sürümünü Seç", + "jsDocCompletion.enabled": "Otomatik JSDoc yorumlarını etkinleştir veya devre dışı bırak.", + "javascript.implicitProjectConfig.checkJs": "JavaScript dosyalarının anlamsal kontrolünü etkinleştir veya devre dışı bırak. Mevcut jsconfig.json veya tsconfig.json dosyaları bu ayarı geçersiz kılar. TypeScript >= 2.3.1 gerektirir.", + "typescript.npm": "Otomatik Tür Kazanımı için kullanılacak NPM yürütülebilir dosyasının yolunu belirtir. TypeScript >= 2.3.4 gerektirir.", + "typescript.check.npmIsInstalled": "Otomatik Tür Kazanımı için NPM'in yüklü olup olmadığını kontrol et.", + "javascript.nameSuggestions": "JavaScript öneri listelerindeki dosyadan benzersiz adları eklemeyi etkinleştir veya devre dışı bırak.", + "typescript.tsc.autoDetect": "Tsc görevlerinin otomatik olarak algılanıp algılanmayacağını denetler. Varsayılan olarak açıktır." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/base/browser/ui/actionbar/actionbar.i18n.json b/i18n/trk/src/vs/base/browser/ui/actionbar/actionbar.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..4ecb2c803f4cd296354114cedc1d8ec138c4677c --- /dev/null +++ b/i18n/trk/src/vs/base/browser/ui/actionbar/actionbar.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "titleLabel": "{0} ({1})" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/base/browser/ui/aria/aria.i18n.json b/i18n/trk/src/vs/base/browser/ui/aria/aria.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..4fa2c84df1026b03f47dd049075157a0f7342f3c --- /dev/null +++ b/i18n/trk/src/vs/base/browser/ui/aria/aria.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "repeated": "{0} (tekrar oluştu)" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/base/browser/ui/findinput/findInput.i18n.json b/i18n/trk/src/vs/base/browser/ui/findinput/findInput.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..93c6910157dffe8eed53f8793ad439d56484e1c0 --- /dev/null +++ b/i18n/trk/src/vs/base/browser/ui/findinput/findInput.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "defaultLabel": "giriş" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/base/browser/ui/findinput/findInputCheckboxes.i18n.json b/i18n/trk/src/vs/base/browser/ui/findinput/findInputCheckboxes.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..d8764ffb9987e25e98f949e9a7a3642d44024637 --- /dev/null +++ b/i18n/trk/src/vs/base/browser/ui/findinput/findInputCheckboxes.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "caseDescription": "Büyük/Küçük Harf Eşleştir", + "wordsDescription": "Sözcüğün Tamamını Eşleştir", + "regexDescription": "Normal İfade Kullan" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/base/browser/ui/inputbox/inputBox.i18n.json b/i18n/trk/src/vs/base/browser/ui/inputbox/inputBox.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..3981d7f1e2d28b1195477ddbe509f659086da573 --- /dev/null +++ b/i18n/trk/src/vs/base/browser/ui/inputbox/inputBox.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "alertErrorMessage": "Hata: {0}", + "alertWarningMessage": "Uyarı: {0}", + "alertInfoMessage": "Bilgi: {0}" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json b/i18n/trk/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..8da49a2d7b0a97b0cd474a53e320c2bc3b4005c1 --- /dev/null +++ b/i18n/trk/src/vs/base/browser/ui/resourceviewer/resourceViewer.i18n.json @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "imgMeta": "{0}x{1} {2}", + "largeImageError": "Resim, düzenleyicide görüntülemek için çok büyük.", + "resourceOpenExternalButton": "Harici program kullanarak resmi aç", + "nativeBinaryError": "Dosya ikili olduğu, çok büyük olduğu veya desteklenmeyen bir metin kodlaması kullandığı için düzenleyicide görüntülenemiyor.", + "sizeB": "{0}B", + "sizeKB": "{0}KB", + "sizeMB": "{0}MB", + "sizeGB": "{0}GB", + "sizeTB": "{0}TB" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/base/browser/ui/toolbar/toolbar.i18n.json b/i18n/trk/src/vs/base/browser/ui/toolbar/toolbar.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..634046fb44b79ad456b5e8b4c33b15552329e2dc --- /dev/null +++ b/i18n/trk/src/vs/base/browser/ui/toolbar/toolbar.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "more": "Diğer" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/base/common/errorMessage.i18n.json b/i18n/trk/src/vs/base/common/errorMessage.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..354f33fe5331e725d31799ae1a59b5fa7ce33649 --- /dev/null +++ b/i18n/trk/src/vs/base/common/errorMessage.i18n.json @@ -0,0 +1,17 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "message": "{0}. Hata kodu: {1}", + "error.permission.verbose": "İzin Verilmedi (HTTP {0})", + "error.permission": "İzin Verilmedi", + "error.http.verbose": "{0} (HTTP {1}: {2})", + "error.http": "{0} (HTTP {1})", + "error.connection.unknown.verbose": "Bilinmeyen Bağlantı Hatası ({0})", + "error.connection.unknown": "Bilinmeyen bir bağlantı hatası oluştu. Artık İnternet'e bağlı değilsiniz veya bağlandığınız sunucu çevrimdışı.", + "stackTrace.format": "{0}: {1}", + "error.defaultMessage": "Bilinmeyen bir hata oluştu. Daha fazla ayrıntı için lütfen günlüğe başvurun.", + "error.moreErrors": "{0} (toplam {1} hata)" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/base/common/jsonErrorMessages.i18n.json b/i18n/trk/src/vs/base/common/jsonErrorMessages.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..e9ca243b5118f7bbcceeb8d95336852b8d930229 --- /dev/null +++ b/i18n/trk/src/vs/base/common/jsonErrorMessages.i18n.json @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "error.invalidSymbol": "Geçersiz sembol", + "error.invalidNumberFormat": "Geçersiz sayı biçimi", + "error.propertyNameExpected": "Özellik adı bekleniyor", + "error.valueExpected": "Değer bekleniyor", + "error.colonExpected": "İki nokta üst üste bekleniyor", + "error.commaExpected": "Virgül bekleniyor", + "error.closeBraceExpected": "Kapanış ayracı bekleniyor", + "error.closeBracketExpected": "Kapanış köşeli ayracı bekleniyor", + "error.endOfFileExpected": "Dosya sonu bekleniyor" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/base/common/keybindingLabels.i18n.json b/i18n/trk/src/vs/base/common/keybindingLabels.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a --- /dev/null +++ b/i18n/trk/src/vs/base/common/keybindingLabels.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{} \ No newline at end of file diff --git a/i18n/trk/src/vs/base/common/processes.i18n.json b/i18n/trk/src/vs/base/common/processes.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..3ffd209b1c97b3da3c8701414495d571e17e747c --- /dev/null +++ b/i18n/trk/src/vs/base/common/processes.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "ExecutableParser.commandMissing": "Hata: yürütülebilir bilgi dize türünde bir komut tanımlamalıdır.", + "ExecutableParser.isShellCommand": "Uyarı: isShellCommand boole türünde olmalıdır. {0} değeri yok sayıldı.", + "ExecutableParser.args": "Uyarı: argümanlar \"string[]\" türünde olmalıdır. {0} değeri yok sayıldı.", + "ExecutableParser.invalidCWD": "Uyarı: options.cwd dize türünde olmalıdır. {0} değeri yok sayıldı." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/base/common/severity.i18n.json b/i18n/trk/src/vs/base/common/severity.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..5cd096b2c9410f9ff48ef0b76fc00481000b25a2 --- /dev/null +++ b/i18n/trk/src/vs/base/common/severity.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "sev.error": "Hata", + "sev.warning": "Uyarı", + "sev.info": "Bilgi" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/base/node/processes.i18n.json b/i18n/trk/src/vs/base/node/processes.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..1e9572a9b919d7fdc36950b9dc31dc5c44d652d5 --- /dev/null +++ b/i18n/trk/src/vs/base/node/processes.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "TaskRunner.UNC": "UNC sürücüsünde kabuk komutu yürütülemez." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/base/node/zip.i18n.json b/i18n/trk/src/vs/base/node/zip.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..1094c4b1628e225ba037dff83b92528da941eaac --- /dev/null +++ b/i18n/trk/src/vs/base/node/zip.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "notFound": "{0}, zip içerisinde bulunamadı." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/base/parts/quickopen/browser/quickOpenModel.i18n.json b/i18n/trk/src/vs/base/parts/quickopen/browser/quickOpenModel.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..300655f6dbde8115e21f0d00435a027aab7947b1 --- /dev/null +++ b/i18n/trk/src/vs/base/parts/quickopen/browser/quickOpenModel.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "quickOpenAriaLabelEntry": "{0}, seçici", + "quickOpenAriaLabel": "seçici" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/base/parts/quickopen/browser/quickOpenWidget.i18n.json b/i18n/trk/src/vs/base/parts/quickopen/browser/quickOpenWidget.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..5603016ef86d226fbb3c3c87a7b4df34dffb3af6 --- /dev/null +++ b/i18n/trk/src/vs/base/parts/quickopen/browser/quickOpenWidget.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "quickOpenAriaLabel": "Hızlı seçici. Sonuçları daraltmak için yazmaya başlayın.", + "treeAriaLabel": "Hızlı Seçici" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/base/parts/tree/browser/treeDefaults.i18n.json b/i18n/trk/src/vs/base/parts/tree/browser/treeDefaults.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..b6850a5f7ed269bfd916d9364692fdee89872b51 --- /dev/null +++ b/i18n/trk/src/vs/base/parts/tree/browser/treeDefaults.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "collapse": "Daralt" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/code/electron-main/menus.i18n.json b/i18n/trk/src/vs/code/electron-main/menus.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..3864423636bc80788bab1157db3e0b3168d653a5 --- /dev/null +++ b/i18n/trk/src/vs/code/electron-main/menus.i18n.json @@ -0,0 +1,178 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "mFile": "&&Dosya", + "mEdit": "Dü&&zen", + "mSelection": "&&Seçim", + "mView": "&&Görünüm", + "mGoto": "G&&it", + "mDebug": "&&Hata Ayıklama", + "mWindow": "Pencere", + "mHelp": "&&Yardım", + "mTask": "Gö&&revler", + "miNewWindow": "Yeni &&Pencere", + "mAbout": "{0} Hakkında", + "mServices": "Hizmetler", + "mHide": "{0} öğesini gizle", + "mHideOthers": "Diğerlerini Gizle", + "mShowAll": "Tümünü Göster", + "miQuit": "{0} Öğesinden Çık", + "miNewFile": "&&Yeni Dosya", + "miOpen": "&Aç", + "miOpenFolder": "&&Klasör Aç...", + "miOpenFile": "&&Dosya Aç...", + "miOpenRecent": "&&Son Kullanılanları Aç", + "miSave": "&&Kaydet", + "miSaveAs": "&&Farklı Kaydet", + "miSaveAll": "&&Tümünü Kaydet", + "miAutoSave": "Otomatik Kaydet", + "miRevert": "Dosyayı &&Geri Al", + "miCloseWindow": "Pen&&cereyi Kapat", + "miCloseFolder": "K&&lasörü Kapat", + "miCloseEditor": "Dü&&zenleyiciyi Kapat", + "miExit": "Çı&&kış", + "miOpenSettings": "&&Ayarlar", + "miOpenKeymap": "&&Klavye Kısayolları", + "miOpenKeymapExtensions": "&&Tuş Haritası Eklentileri", + "miOpenSnippets": "Kullanıcı &&Parçacıkları", + "miSelectColorTheme": "&&Renk Teması", + "miSelectIconTheme": "&&Dosya Simgesi Teması", + "miPreferences": "T&&ercihler", + "miReopenClosedEditor": "&&Kapatılan Düzenleyiciyi Tekrar Aç", + "miMore": "&&Daha Fazlası...", + "miClearRecentOpen": "&&Son Kullanılan Dosyaları Temizle", + "miUndo": "&&Geri Al", + "miRedo": "&&Yinele", + "miCut": "&&Kes", + "miCopy": "K&&opyala", + "miPaste": "Y&&apıştır", + "miFind": "&&Bul", + "miReplace": "&&Değiştir", + "miFindInFiles": "Dosyalarda B&&ul", + "miReplaceInFiles": "Dosyalarda Değiş&&tir", + "miEmmetExpandAbbreviation": "Emmet: Kı&&saltmayı Genişlet", + "miShowEmmetCommands": "E&&mmet...", + "miToggleLineComment": "Satı&&r Yorumunu Aç/Kapat", + "miToggleBlockComment": "Yorum B&&loğunu Aç/Kapat", + "miMultiCursorAlt": "Birden Fazla İmleç İçin Alt+Tıklama Kullan", + "miMultiCursorCmd": "Birden Fazla İmleç İçin Cmd+Tıklama Kullan", + "miMultiCursorCtrl": "Birden Fazla İmleç İçin Ctrl+Tıklama Kullan", + "miInsertCursorAbove": "Yukarıya &&İmleç Ekle", + "miInsertCursorBelow": "Aşağıya İ&&mleç Ekle", + "miInsertCursorAtEndOfEachLineSelected": "&&Satır Sonlarına İmleç Ekle", + "miAddSelectionToNextFindMatch": "S&&onraki Tekrarlamayı Ekle", + "miAddSelectionToPreviousFindMatch": "Ö&&nceki Tekrarlamayı Ekle", + "miSelectHighlights": "Tüm T&&ekrarlamaları Değiştir", + "miCopyLinesUp": "Satırı &&Yukarı Kopyala", + "miCopyLinesDown": "Satırı &&Aşağı Kopyala", + "miMoveLinesUp": "Satırı Y&&ukarı Taşı", + "miMoveLinesDown": "Satı&&rı Aşağı Taşı", + "miSelectAll": "&&Tümünü Seç", + "miSmartSelectGrow": "Seçimi &&Genişlet", + "miSmartSelectShrink": "Seçimi &&Daralt", + "miViewExplorer": "&&Gezgin", + "miViewSearch": "&&Arama", + "miViewSCM": "&&SCM", + "miViewDebug": "&&Hata Ayıklama", + "miViewExtensions": "&&Eklentiler", + "miToggleOutput": "Çı&&ktı", + "miToggleDebugConsole": "Hata &&Ayıklama Konsolu", + "miToggleIntegratedTerminal": "Entegre &&Terminal", + "miMarker": "S&&orunlar", + "miAdditionalViews": "&&Ek Görünümler", + "miCommandPalette": "Komut &&Paleti...", + "miToggleFullScreen": "Tam Ekra&&nı Aç/Kapat", + "miToggleZenMode": "Zen Modunu Aç/Kapat", + "miToggleMenuBar": "&&Menü Çubuğunu Gizle/Göster", + "miSplitEditor": "Düzenleyiciyi &&Böl", + "miToggleEditorLayout": "Dü&&zenleyici Grubu Düzenini Değiştir", + "miToggleSidebar": "Ke&&nar Çubuğunu Aç/Kapat", + "miMoveSidebarRight": "Kenar Çubuğunu S&&ağa Taşı", + "miMoveSidebarLeft": "Kenar Çubuğunu S&&ola Taşı", + "miTogglePanel": "&&Paneli Aç/Kapat", + "miHideStatusbar": "&&Durum Çubuğunu Gizle", + "miShowStatusbar": "&&Du&&rum Çubuğunu Göster", + "miHideActivityBar": "Etkinlik Ç&&ubuğunu Gizle", + "miShowActivityBar": "Etkinlik Çu&&buğunu Göster", + "miToggleWordWrap": "&&Sözcük Kaydırmasını Aç/Kapat", + "miToggleRenderWhitespace": "&&Boşlukları Görüntülemeyi Aç/Kapat", + "miToggleRenderControlCharacters": "&&Kontrol Karakterlerini Aç/Kapat", + "miZoomIn": "&&Yakınlaştır", + "miZoomOut": "&&Uzaklaştır", + "miZoomReset": "Yakınlaştırmayı Sı&&fırla", + "miBack": "&&Geri", + "miForward": "&&İleri", + "miNextEditor": "&&Sonraki Düzenleyici", + "miPreviousEditor": "Ö&&nceki Düzenleyici", + "miNextEditorInGroup": "&&Grupta Sonraki Kullanılan Düzenleyici", + "miPreviousEditorInGroup": "G&&rupta Önceki Kullanılan Düzenleyici", + "miSwitchEditor": "&&Düzenleyici Değiştir", + "miFocusFirstGroup": "İ&&lk Grup", + "miFocusSecondGroup": "İ&&kinci Grup", + "miFocusThirdGroup": "Üçün&&cü Grup", + "miNextGroup": "Sonraki Gr&&up", + "miPreviousGroup": "Önceki Gru&&p", + "miSwitchGroup": "Grup &&Değiştir", + "miGotoFile": "D&&osyaya Git...", + "miGotoSymbolInFile": "Dosyada S&&embole Git...", + "miGotoSymbolInWorkspace": "Çalışma &&Alanında Sembole Git...", + "miGotoDefinition": "&&Tanıma Git", + "miGotoTypeDefinition": "Tü&&r Tanımına Git", + "miGotoImplementation": "U&&ygulamaya Git", + "miGotoLine": "&&Satıra Git...", + "miStartDebugging": "&&Hata Ayıklamaya Başla", + "miStartWithoutDebugging": "Hata Ayıklama &&Olmadan Başlat", + "miStopDebugging": "Hata Ayıklamayı D&&urdur", + "miRestart Debugging": "Hata Ayıklamayı &&Yeniden Başlat", + "miOpenConfigurations": "Ya&&pılandırmaları Aç", + "miAddConfiguration": "Yapı&&landırma Ekle...", + "miStepOver": "&&Adım At", + "miStepInto": "&&İçine Adımla", + "miStepOut": "&&Dışına Adımla", + "miContinue": "De&&vam Et", + "miToggleBreakpoint": "Kesme &&Noktası Ekle/Kaldır", + "miConditionalBreakpoint": "&&Koşullu Kesme Noktası...", + "miColumnBreakpoint": "&&Sütun Kesme Noktası", + "miFunctionBreakpoint": "&&Fonksiyon Kesme Noktası", + "miNewBreakpoint": "&&Yeni Kesme Noktası", + "miEnableAllBreakpoints": "Tüm Kesme Noktalarını Etkinleştir", + "miDisableAllBreakpoints": "&&Tüm Kesme Noktalarını Devre Dışı Bırak", + "miRemoveAllBreakpoints": "Tüm Kesme Noktalarını Kaldı&&r", + "miInstallAdditionalDebuggers": "&&Ek Hata Ayıklayıcıları Yükle", + "mMinimize": "Simge Durumuna Küçült", + "mZoom": "Yakınlaştırma", + "mBringToFront": "Tümünü Öne Getir", + "miSwitchWindow": "&&Pencere Değiştir...", + "miToggleDevTools": "&&Geliştirici Araçlarını Aç/Kapat", + "miAccessibilityOptions": "&&Erişilebilirlik Seçenekleri", + "miReportIssues": "So&&run Bildir", + "miWelcome": "&&Hoş Geldiniz", + "miInteractivePlayground": "&&İnteraktif Oyun Alanı", + "miDocumentation": "&&Belgeler", + "miReleaseNotes": "&&Sürüm Notları", + "miKeyboardShortcuts": "&&Klavye Kısayolları Başvurusu", + "miIntroductoryVideos": "Tanıtım &&Videoları", + "miTwitter": "&&Twitter'da Bize Katıl", + "miUserVoice": "Ö&&zellik İsteklerini Ara", + "miLicense": "&&Lisansı Görüntüle", + "miPrivacyStatement": "Gizlilik &&Beyanı", + "miAbout": "H&&akkında", + "miRunTask": "Görevi Ç&&alıştır", + "miRestartTask": "Görevi &&Yeniden Başlat", + "miTerminateTask": "&&Görevi Sonlandır", + "miBuildTask": "&&Derleme Görevi", + "miTestTask": "&&Test Görevi", + "miShowTaskLog": "&&Görev Günlüğünü Göster", + "accessibilityOptionsWindowTitle": "Erişilebilirlik Seçenekleri", + "miRestartToUpdate": "Güncelleştirmek için Yeniden Başlatın...", + "miCheckingForUpdates": "Güncelleştirmeler Denetleniyor...", + "miDownloadUpdate": "Mevcut Güncelleştirmeyi İndir", + "miDownloadingUpdate": "Güncelleştirme İndiriliyor...", + "miInstallingUpdate": "Güncelleştirme Yükleniyor...", + "miCheckForUpdates": "Güncelleştirmeleri Denetle...", + "aboutDetail": "\nSürüm {0}\nCommit {1}\nTarih {2}\nKabuk {3}\nOluşturucu {4}\nNode {5}", + "okButton": "Tamam" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/code/electron-main/window.i18n.json b/i18n/trk/src/vs/code/electron-main/window.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..ca683aad480e3bfd0410b9bf289657eda1bfc0ea --- /dev/null +++ b/i18n/trk/src/vs/code/electron-main/window.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "hiddenMenuBar": "Menü çubuğuna **Alt** tuşuna basarak hala erişebilirsiniz." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/code/electron-main/windows.i18n.json b/i18n/trk/src/vs/code/electron-main/windows.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..d700eddd2d58481ddfdfa3df20be6afd513e1413 --- /dev/null +++ b/i18n/trk/src/vs/code/electron-main/windows.i18n.json @@ -0,0 +1,17 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "ok": "Tamam", + "pathNotExistTitle": "Yol yok", + "pathNotExistDetail": "'{0}' yolu artık diskte değil.", + "reopen": "Yeniden Aç", + "wait": "Beklemeye Devam Et", + "close": "Kapat", + "appStalled": "Pencere artık yanıt vermiyor", + "appStalledDetail": "Pencereyi yeniden açabilir, kapatabilir veya bekleyebilirsiniz.", + "appCrashed": "Pencere kilitlendi", + "appCrashedDetail": "Verdiğimiz rahatsızlıktan dolayı özür dileriz! Pencereyi yeniden açıp kaldığınız yerden devam edebilirsiniz." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/code/node/cliProcessMain.i18n.json b/i18n/trk/src/vs/code/node/cliProcessMain.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..8ca0b4fc0b406ec03e97f777667250a3f2105504 --- /dev/null +++ b/i18n/trk/src/vs/code/node/cliProcessMain.i18n.json @@ -0,0 +1,17 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "notFound": "'{0}' eklentisi bulunamadı.", + "notInstalled": "'{0}' eklentisi yüklü değil.", + "useId": "Eklentinin tam ID'sini, yayıncı da dahil olmak üzere kullandığınızdan emin olun, ör: {0}", + "successVsixInstall": "'{0}' eklentisi başarıyla yüklendi.", + "alreadyInstalled": "'{0}' eklentisi zaten yüklü.", + "foundExtension": "'{0}' markette bulundu.", + "installing": "Yükleniyor...", + "successInstall": "'{0}' v{1} eklentisi başarıyla kuruldu!", + "uninstalling": "{0} kaldırılıyor...", + "successUninstall": "'{0}' eklentisi başarıyla kaldırıldı!" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/editor/common/config/commonEditorConfig.i18n.json b/i18n/trk/src/vs/editor/common/config/commonEditorConfig.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..6da1720d79cef9cbec42d1390b0a88a35fd75274 --- /dev/null +++ b/i18n/trk/src/vs/editor/common/config/commonEditorConfig.i18n.json @@ -0,0 +1,88 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "editorConfigurationTitle": "Düzenleyici", + "fontFamily": "Yazı tipi ailesini denetler.", + "fontWeight": "Yazı tipi kalınlığını denetler.", + "fontSize": "Yazı tipi boyutunu piksel olarak denetler.", + "lineHeight": "Satır yüksekliğini denetler. lineHeight değerini, fontSize değeri kullanarak hesaplamak için 0 girin.", + "letterSpacing": "Harfler arası boşluğu pixel olarak denetler.", + "lineNumbers": "Satır numaralarının görüntülenmesini denetler. Olası değerler 'on', 'off' ve 'relative'dir. 'relative' satırların geçerli imleç konumundan uzaklıklarını gösterir.", + "rulers": "Dikey cetvellerin gösterileceği sütunlar", + "wordSeparators": "Sözcüklerle ilgili gezinti veya işlem yaparken kelime ayırıcı olarak kullanılacak karakterler", + "tabSize": "Bir sekmenin eşit olduğu boşluk sayısı. Bu ayar, `editor.detectIndentation` açıkken dosya içeriğine bağlı olarak geçersiz kılınır.", + "tabSize.errorMessage": "'sayı' bekleniyor. \"auto\" değerinin `editor.detectIndentation` ile değiştirildiğini unutmayın.", + "insertSpaces": "Tab tuşuna basınca boşluk ekle. Bu ayar, `editor.detectIndentation` açıkken dosya içeriğine bağlı olarak geçersiz kılınır.", + "insertSpaces.errorMessage": "'boole' bekleniyor. \"auto\" değerinin `editor.detectIndentation` ile değiştirildiğini unutmayın.", + "detectIndentation": "Bir dosyayı açarken, `editor.tabSize` ve `editor.insertSpaces` dosya içeriğine bağlı olarak algılanır.", + "roundedSelection": "Seçimlerin köşelerinin yuvarlak olup olmayacağını denetler", + "scrollBeyondLastLine": "Düzenleyicinin son satırın ötesine ilerleyip ilerlemeyeceğini denetler", + "minimap.enabled": "Mini haritanın gösterilip gösterilmeyeceğini denetler", + "minimap.showSlider": "Mini harita kaydıracının otomatik olarak gizlenip gizlenmeyeceğini denetler.", + "minimap.renderCharacters": "(Renk blokları yerine) Bir satırdaki gerçek harfleri göster", + "minimap.maxColumn": "Hazırlanacak mini haritanın azami genişliğini belirli sayıda sütunla sınırla", + "find.seedSearchStringFromSelection": "Bulma Araç Çubuğu'ndaki arama metninin, düzenleyicideki seçili alandan beslenmesini denetler", + "find.autoFindInSelection": "Seçimde bul işaretçisinin, editördeki metnin birden çok karakteri veya satırı seçildiğinde açılmasını denetler.", + "wordWrap.off": "Satırlar hiçbir zaman bir sonraki satıra kaydırılmayacak.", + "wordWrap.on": "Satırlar görüntü alanı genişliğinde bir sonraki satıra kaydırılacak.", + "wordWrap.wordWrapColumn": "Satırlar `editor.wordWrapColumn` değerinde bir sonraki satıra kaydırılacak.", + "wordWrap.bounded": "Satırlar en düşük görüntü alanı genişliğinde ve `editor.wordWrapColumn` değerinde bir sonraki satıra kaydırılacak.", + "wordWrap": "Satırların bir sonraki satıra nasıl kaydırılacağını denetler. Seçenekler:\n - 'off' (kaydırmayı devre dışı bırak),\n - 'on' (görüntü alanında kaydır),\n - 'wordWrapColumn' (`editor.wordWrapColumn` değerinde kaydır) veya\n - 'bounded' (en düşük görüntü alanı genişliğinde ve `editor.wordWrapColumn` değerinde kaydır).", + "wordWrapColumn": "`editor.wordWrap` ögesi, 'wordWrapColumn' veya 'bounded' iken düzenleyicinin kaydırma sütununu denetler.", + "wrappingIndent": "Kaydırılan satır girintisini denetler. 'none', 'same' veya 'indent' değerlerinden biri olabilir.", + "mouseWheelScrollSensitivity": "Fare tekerleği kaydırma olaylarında `deltaX` ve `deltaY` üzerinde kullanılan bir çarpan", + "multiCursorModifier.ctrlCmd": "Windows ve Linux'da `Control` ve OSX'de `Command` ile eşleşir.", + "multiCursorModifier.alt": "Windows ve Linux'da `Alt` ve OSX'de `Option` ile eşleşir.", + "multiCursorModifier": "Fare ile birden çok imleç eklenmesinde kullanılacak değiştirici. `ctrlCmd` Windows ve Linux'da `Control` ve OSX'de `Command` ile eşleşir. Tanıma Git ve Bağlantıyı Aç fare hareketleri, birden çok imleç değiştiricisi ile çakışmayacak şekilde uyum sağlarlar.", + "quickSuggestions.strings": "Dizelerin içinde hızlı önerileri etkinleştir.", + "quickSuggestions.comments": "Yorumların içinde hızlı önerileri etkinleştir.", + "quickSuggestions.other": "Dizeler ve yorumlar dışında hızlı önerileri etkinleştirin.", + "quickSuggestions": "Yazarken önerilerin otomatik olarak gösterilip gösterilmeyeceğini denetler", + "quickSuggestionsDelay": "Hızlı önerilerin gösterilmesinden önce kaç ms bekleneceğini denetler", + "parameterHints": "Siz tuşlara bastıkça parametre belgelerini ve tür bilgisini gösteren açılır pencereyi etkinleştirir.", + "autoClosingBrackets": "Düzenleyicinin köşeli ayracı açtıktan sonra otomatik olarak kapatıp kapatmayacağını denetler", + "formatOnType": "Düzenleyicinin satırı yazıldıktan sonra otomatik biçimlendirip biçimlendirmeyeceğini denetler", + "formatOnPaste": "Düzenleyicinin yapıştırılan içeriği otomatik olarak biçimlendirip biçimlendirmeyeceğini denetler. Bir biçimlendirici mevcut olmalı ve belgede bir aralığı biçimlendirebilmelidir.", + "suggestOnTriggerCharacters": "Tetikleyici karakterler yazılırken otomatik olarak öneri gösterilip gösterilmeyeceğini denetler", + "acceptSuggestionOnEnter": "'Tab' tuşuna ek olarak - önerilerin 'Enter' tuşuna basıldığında kabul edilmesini denetler. Yeni satır ekleme ya da öneri kabul etme arasındaki belirsizlikten kaçınmaya yardımcı olur. 'smart' değeri, bir öneri metinsel değişiklik yapıyorsa, onu sadece Enter tuşu ile kabul etmeyi ifade eder", + "acceptSuggestionOnCommitCharacter": "Önerilerin tamamlama karakterlerinde kabul edilip edilmeyeceğini denetler. Örnek olarak; JavaScript'te noktalı virgül(';') öneri kabul eden ve o karakteri giren tamamlama karakteri olabilir.", + "snippetSuggestions": "Parçacıkların diğer önerilerle gösterilip gösterilmeyeceğini ve bunların nasıl sıralanacaklarını denetler.", + "emptySelectionClipboard": "Bir seçim olmadan geçerli satırı kopyalayıp kopyalamamayı denetler.", + "wordBasedSuggestions": "Tamamlamaların belgedeki sözcüklere dayalı olarak hesaplanıp hesaplanmayacağını denetler.", + "suggestFontSize": "Öneri aracının yazı tipi boyutu", + "suggestLineHeight": "Öneri aracının satır yüksekliği", + "selectionHighlight": "Düzenleyicinin seçime benzer eşleşmeleri vurgulayıp vurgulamayacağını denetler", + "occurrencesHighlight": "Düzenleyicinin semantik sembol tekrarlamalarını vurgulayıp vurgulamayacağını denetler", + "overviewRulerLanes": "Genel bakış cetvelinde aynı konumda gösterilebilecek süsleme sayısını denetler", + "overviewRulerBorder": "Genel bakış cetvelinin etrafına bir kenarlık çizilmesi gerekip gerekmediğini denetler.", + "cursorBlinking": "İmleç animasyon stilini denetler, olası değerler 'blink', 'smooth', 'phase', 'expand' ve 'solid'dir", + "mouseWheelZoom": "Ctrl tuşuna basarken fare tekerleği ile düzenleyici yazı tipini yakınlaştırın", + "cursorStyle": "İmleç stilini denetler, kabul edilen değerler: 'block', 'block-outline', 'line', 'line-thin', 'underline' ve 'underline-thin'", + "fontLigatures": "Yazı tipi ligatürlerini etkinleştirir", + "hideCursorInOverviewRuler": "İmlecin genel bakış cetvelinde gizlenip gizlenmeyeceğini denetler.", + "renderWhitespace": "Düzenleyicinin boşluk karakterlerini nasıl göstereceğini denetler, seçenekler: 'none', 'boundary', ve 'all'. 'boundary' seçeneği sözcükler arasındaki tek boşlukları göstermez.", + "renderControlCharacters": "Düzenleyicinin kontrol karakterlerini gösterip göstermemesini denetler", + "renderIndentGuides": "Düzenleyicinin girinti kılavuzlarını gösterip göstermemesini denetler", + "renderLineHighlight": "Düzenleyicinin geçerli satır vurgusunu nasıl göstereceğini denetler, seçenekler: 'none', 'gutter', 'line', ve 'all'.", + "codeLens": "Düzenleyicinin kod objektiflerini gösterip göstermediğini denetler", + "folding": "Düzenleyicide kod katlamanın etkin olup olmadığını denetler", + "showFoldingControls": "Oluktaki kat kontrollerinin otomatik olarak gizlenip gizlenmeyeceğini denetler.", + "matchBrackets": "Eşleşen ayraçları, onlardan biri seçildiğinde vurgula.", + "glyphMargin": "Düzenleyicinin dikey glif boşluğunu oluşturup oluşturmayacağını kontrol eder. Glif boşluğu çoğunlukla hata ayıklamak için kullanılır.", + "useTabStops": "Boşluk ekleme ve silme sekme duraklarını izler", + "trimAutoWhitespace": "Sondaki otomatik eklenen boşluğu kaldır", + "stablePeek": "Gözetleme düzenleyicilerini, içeriklerine çift tıklandığında veya Escape tuşuna basıldığında bile açık tut.", + "dragAndDrop": "Düzenleyicinin seçimleri sürükleyip bırakarak taşımaya izin verip vermeyeceğini denetler.", + "accessibilitySupport.auto": "Düzenleyici, bir Ekran Okuyucu'nun ne zaman bağlandığını algılamak için platform API'larını kullanacaktır.", + "accessibilitySupport.on": "Düzenleyici bir Ekran Okuyucu ile kullanılmak üzere kalıcı olarak optimize edilecektir.", + "accessibilitySupport.off": "Düzenleyici hiçbir zaman bir Ekran Okuyucu ile kullanılmak üzere optimize edilmeyecektir.", + "accessibilitySupport": "Düzenleyicinin ekran okuyucular için optimize edilmiş bir modda çalışıp çalışmayacağını denetler.", + "links": "Düzenleyicinin bağlantıları otomatik algılayıp, onları tıklanabilir yapıp yapmayacağını denetler", + "sideBySide": "Karşılaştırma düzenleyicisinin farklılıkları yan yana mı yoksa satır içinde mi göstereceğini denetler", + "ignoreTrimWhitespace": "Karşılaştırma düzenleyicisinin baştaki veya sondaki boşluklardaki değişmeleri farklılık olarak gösterip göstermemesini denetler", + "renderIndicators": "Karşılaştırma düzenleyicisinin ekleme/çıkarma değişiklikleri için +/- göstergeleri gösterip göstermemesini denetler.", + "selectionClipboard": "Linux birincil panosunun desteklenip desteklenmeyeceğini denetler." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/editor/common/config/editorOptions.i18n.json b/i18n/trk/src/vs/editor/common/config/editorOptions.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..e9722574046b57008daa4c4aac046b03d61dc35a --- /dev/null +++ b/i18n/trk/src/vs/editor/common/config/editorOptions.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "accessibilityOffAriaLabel": "Düzenleyici şu an erişilebilir değil. Seçenekler için lütfen Alt+F1'e basın.", + "editorViewAccessibleLabel": "Düzenleyici içeriği" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/editor/common/controller/cursor.i18n.json b/i18n/trk/src/vs/editor/common/controller/cursor.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..5ac37adbc122db6bac5bb0c8516570044c76c231 --- /dev/null +++ b/i18n/trk/src/vs/editor/common/controller/cursor.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "corrupt.commands": "Komut yürütülürken beklenmeyen özel durum oluştu." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/editor/common/model/textModelWithTokens.i18n.json b/i18n/trk/src/vs/editor/common/model/textModelWithTokens.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..4884bc2418fc4aca26e747ef8ebb7b4b5f319469 --- /dev/null +++ b/i18n/trk/src/vs/editor/common/model/textModelWithTokens.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "mode.tokenizationSupportFailed": "Mod, girdiyi belirteçlere ayırırken başarısız oldu." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/editor/common/modes/modesRegistry.i18n.json b/i18n/trk/src/vs/editor/common/modes/modesRegistry.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..e559b82874385bd4dfc4b2b3596e17577bd2a3d9 --- /dev/null +++ b/i18n/trk/src/vs/editor/common/modes/modesRegistry.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "plainText.alias": "Düz Metin" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/editor/common/services/bulkEdit.i18n.json b/i18n/trk/src/vs/editor/common/services/bulkEdit.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..b081029e080ee7c8fba755c8d529659f6043f4c2 --- /dev/null +++ b/i18n/trk/src/vs/editor/common/services/bulkEdit.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "conflict": "Bu dosyalar bu arada değiştirildi: {0}", + "summary.0": "Düzenleme yapılmadı", + "summary.nm": "{1} dosyada {0} metin düzenlemesi yapıldı", + "summary.n0": "Bir dosyada {0} metin düzenlemesi yapıldı" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/editor/common/services/modeServiceImpl.i18n.json b/i18n/trk/src/vs/editor/common/services/modeServiceImpl.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..55d69fef9030f297cecb6a11863aee5fe971abb1 --- /dev/null +++ b/i18n/trk/src/vs/editor/common/services/modeServiceImpl.i18n.json @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "vscode.extension.contributes.languages": "Dil bildirimlerine ekleme yapar.", + "vscode.extension.contributes.languages.id": "Dilin ID'si.", + "vscode.extension.contributes.languages.aliases": "Dilin takma adları.", + "vscode.extension.contributes.languages.extensions": "Dil ile ilişkili dosya uzantıları.", + "vscode.extension.contributes.languages.filenames": "Dil ile ilişkili dosya adları.", + "vscode.extension.contributes.languages.filenamePatterns": "Dil ile ilişkili dosya adı glob desenleri.", + "vscode.extension.contributes.languages.mimetypes": "Dil ile ilişkili MIME türleri.", + "vscode.extension.contributes.languages.firstLine": "Dilin bir dosyasının ilk satırıyla eşleşen bir düzenli ifade.", + "vscode.extension.contributes.languages.configuration": "Dil için yapılandırma seçenekleri içeren dosyaya, bir göreli yol." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/editor/common/services/modelServiceImpl.i18n.json b/i18n/trk/src/vs/editor/common/services/modelServiceImpl.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..a12e01358bbaf8f6df021310323af3205d59b90a --- /dev/null +++ b/i18n/trk/src/vs/editor/common/services/modelServiceImpl.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "diagAndSourceMultiline": "[{0}]\n{1}", + "diagAndSource": "[{0}] {1}" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/editor/common/view/editorColorRegistry.i18n.json b/i18n/trk/src/vs/editor/common/view/editorColorRegistry.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..e5f9dca329bf80a54d3d5e0f5254b64d23ec48ce --- /dev/null +++ b/i18n/trk/src/vs/editor/common/view/editorColorRegistry.i18n.json @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "lineHighlight": "İmlecin bulunduğu satırın vurgusunun arka plan rengi.", + "lineHighlightBorderBox": "İmlecin bulunduğu satırın kenarlığının arka plan rengi.", + "rangeHighlight": "Hızlı açma ve bulma özellikleri gibi vurgulanan alanların arka plan rengi.", + "caret": "Düzenleyici imlecinin rengi.", + "editorWhitespaces": "Düzenleyicideki boşluk karakterlerinin rengi.", + "editorIndentGuides": "Düzenleyici girinti kılavuzlarının rengi.", + "editorLineNumbers": "Düzenleyici satır numaralarının rengi.", + "editorRuler": "Düzenleyici cetvellerinin rengi.", + "editorCodeLensForeground": "Düzenleyici kod objektiflerinin ön plan rengi", + "editorBracketMatchBackground": "Eşleşen parantezlerin arka plan rengi", + "editorBracketMatchBorder": "Eşleşen parantez kutularının rengi", + "editorOverviewRulerBorder": "Genel bakış cetvelinin kenarlık rengi.", + "editorGutter": "Düzenleyici oluğunun arka plan rengi. Oluk, glif boşluklarını ve satır numaralarını içerir.", + "errorForeground": "Düzenleyicideki hata karalamalarının ön plan rengi.", + "errorBorder": "Düzenleyicideki hata karalamalarının kenarlık rengi.", + "warningForeground": "Düzenleyicideki uyarı karalamalarının ön plan rengi.", + "warningBorder": "Düzenleyicideki uyarı karalamalarının kenarlık rengi." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/editor/contrib/bracketMatching/common/bracketMatching.i18n.json b/i18n/trk/src/vs/editor/contrib/bracketMatching/common/bracketMatching.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..3156c395100a0f9d9c949c544e7358620ce56c7d --- /dev/null +++ b/i18n/trk/src/vs/editor/contrib/bracketMatching/common/bracketMatching.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "smartSelect.jumpBracket": "Köşeli Ayraca Git" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/editor/contrib/caretOperations/common/caretOperations.i18n.json b/i18n/trk/src/vs/editor/contrib/caretOperations/common/caretOperations.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..c5196837029df4a92708ed2dee72788c07c39acb --- /dev/null +++ b/i18n/trk/src/vs/editor/contrib/caretOperations/common/caretOperations.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "caret.moveLeft": "İmleci Sola Taşı", + "caret.moveRight": "İmleci Sağa Taşı" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/editor/contrib/caretOperations/common/transpose.i18n.json b/i18n/trk/src/vs/editor/contrib/caretOperations/common/transpose.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..5ee978f2342cda840ce1e3effb98a3eeb275ae85 --- /dev/null +++ b/i18n/trk/src/vs/editor/contrib/caretOperations/common/transpose.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "transposeLetters.label": "Harfleri Birbirleriyle Değiştir" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/editor/contrib/clipboard/browser/clipboard.i18n.json b/i18n/trk/src/vs/editor/contrib/clipboard/browser/clipboard.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..768e8e3511f0abe8629e9f6bfec8433ea31a29eb --- /dev/null +++ b/i18n/trk/src/vs/editor/contrib/clipboard/browser/clipboard.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "actions.clipboard.cutLabel": "Kes", + "actions.clipboard.copyLabel": "Kopyala", + "actions.clipboard.pasteLabel": "Yapıştır", + "actions.clipboard.copyWithSyntaxHighlightingLabel": "Sentaks Vurgulaması İle Kopyala" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/editor/contrib/comment/common/comment.i18n.json b/i18n/trk/src/vs/editor/contrib/comment/common/comment.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..30ac850837c3b29cec48f7de73b59a7c1c564f40 --- /dev/null +++ b/i18n/trk/src/vs/editor/contrib/comment/common/comment.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "comment.line": "Satır Yorumunu Aç/Kapat", + "comment.line.add": "Satır Açıklaması Ekle", + "comment.line.remove": "Satır Açıklamasını Kaldır", + "comment.block": "Yorum Bloğunu Aç/Kapat" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/editor/contrib/contextmenu/browser/contextmenu.i18n.json b/i18n/trk/src/vs/editor/contrib/contextmenu/browser/contextmenu.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..fbed232705270d84dbcf9ea7f0ccaac441b07753 --- /dev/null +++ b/i18n/trk/src/vs/editor/contrib/contextmenu/browser/contextmenu.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "action.showContextMenu.label": "Düzenleyici Bağlam Menüsünü Göster" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/editor/contrib/find/browser/findWidget.i18n.json b/i18n/trk/src/vs/editor/contrib/find/browser/findWidget.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..e483c295f196957fc0dc6ffa44bc30986ea53ec4 --- /dev/null +++ b/i18n/trk/src/vs/editor/contrib/find/browser/findWidget.i18n.json @@ -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. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "label.find": "Bul", + "placeholder.find": "Bul", + "label.previousMatchButton": "Önceki eşleşme", + "label.nextMatchButton": "Sonraki eşleşme", + "label.toggleSelectionFind": "Seçimde bul", + "label.closeButton": "Kapat", + "label.replace": "Değiştir", + "placeholder.replace": "Değiştir", + "label.replaceButton": "Değiştir", + "label.replaceAllButton": "Tümünü Değiştir", + "label.toggleReplaceButton": "Değiştirme modunu değiştir", + "title.matchesCountLimit": "Yalnızca ilk 999 sonuç vurgulandı, ancak tüm bulma işlemleri metnin tamamı üzerinde çalışıyor.", + "label.matchesLocation": "{0}/{1}", + "label.noResults": "Sonuç Yok" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/editor/contrib/find/common/findController.i18n.json b/i18n/trk/src/vs/editor/contrib/find/common/findController.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..e9808291987fae522018735071ab2f6f4c4b2640 --- /dev/null +++ b/i18n/trk/src/vs/editor/contrib/find/common/findController.i18n.json @@ -0,0 +1,18 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "startFindAction": "Bul", + "findNextMatchAction": "Sonrakini Bul", + "findPreviousMatchAction": "Öncekini Bul", + "nextSelectionMatchFindAction": "Sonraki Seçimi Bul", + "previousSelectionMatchFindAction": "Önceki Seçimi Bul", + "startReplace": "Değiştir", + "addSelectionToNextFindMatch": "Seçimi Sonraki Bulunan Eşleşmeye Ekle", + "addSelectionToPreviousFindMatch": "Seçimi Önceki Bulunan Eşleşmeye Ekle", + "moveSelectionToNextFindMatch": "Son Seçimi Sonraki Bulunan Eşleşmeye Taşı", + "moveSelectionToPreviousFindMatch": "Son Seçimi Önceki Bulunan Eşleşmeye Taşı", + "changeAll.label": "Tüm Tekrarlamaları Değiştir" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/editor/contrib/folding/browser/folding.i18n.json b/i18n/trk/src/vs/editor/contrib/folding/browser/folding.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..084b78eafffc1ab94239ada1131874439c08a5aa --- /dev/null +++ b/i18n/trk/src/vs/editor/contrib/folding/browser/folding.i18n.json @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "unfoldAction.label": "Katlamayı Aç", + "unFoldRecursivelyAction.label": "Katlamaları Özyinelemeli Olarak Aç", + "foldAction.label": "Katla", + "foldRecursivelyAction.label": "Özyinelemeli Olarak Katla", + "foldAllAction.label": "Hepsini Katla", + "unfoldAllAction.label": "Tüm Katlamaları Aç", + "foldLevelAction.label": "{0}. Düzeyi Katla" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/editor/contrib/format/browser/formatActions.i18n.json b/i18n/trk/src/vs/editor/contrib/format/browser/formatActions.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..265248d706c1b3d3257bbfa3069f7a7b5ac96e5a --- /dev/null +++ b/i18n/trk/src/vs/editor/contrib/format/browser/formatActions.i18n.json @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "hint11": "{0}. satırda 1 biçimlendirme düzenlemesi yapıldı", + "hintn1": "{1}. satırda {0} biçimlendirme düzenlemesi yapıldı", + "hint1n": "{0} ve {1} satırları arasında 1 biçimlendirme düzenlemesi yapıldı", + "hintnn": "{1} ve {2} satırları arasında {0} biçimlendirme düzenlemesi yapıldı", + "formatDocument.label": "Belgeyi Biçimlendir", + "formatSelection.label": "Seçimi Biçimlendir" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.i18n.json b/i18n/trk/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..fae99c4c772abbe000f7a603624d69857e8810c2 --- /dev/null +++ b/i18n/trk/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationCommands.i18n.json @@ -0,0 +1,23 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "noResultWord": "'{0}' için tanım bulunamadı", + "generic.noResults": "Tanım bulunamadı", + "meta.title": " – {0} tanım", + "actions.goToDecl.label": "Tanıma Git", + "actions.goToDeclToSide.label": "Tanımı Yana Aç", + "actions.previewDecl.label": "Tanıma Göz At", + "goToImplementation.noResultWord": "'{0}' için uygulama bulunamadı", + "goToImplementation.generic.noResults": "Uygulama bulunamadı", + "meta.implementations.title": " – {0} uygulama", + "actions.goToImplementation.label": "Uygulamaya Git", + "actions.peekImplementation.label": "Uygulamaya Göz At", + "goToTypeDefinition.noResultWord": "'{0}' için tür tanımı bulunamadı", + "goToTypeDefinition.generic.noResults": "Tür tanımı bulunamadı", + "meta.typeDefinitions.title": " – {0} tür tanımı", + "actions.goToTypeDefinition.label": "Tür Tanımına Git", + "actions.peekTypeDefinition.label": "Tür Tanımına Göz At" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.i18n.json b/i18n/trk/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..010de11a57dae467fbacab6a8875e4ebb0bec445 --- /dev/null +++ b/i18n/trk/src/vs/editor/contrib/goToDeclaration/browser/goToDeclarationMouse.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "multipleResults": "{0} tanımı göstermek için tıklayın." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/editor/contrib/gotoError/browser/gotoError.i18n.json b/i18n/trk/src/vs/editor/contrib/gotoError/browser/gotoError.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..715f05193c2e22d1b83614270dab83a2a181a1e8 --- /dev/null +++ b/i18n/trk/src/vs/editor/contrib/gotoError/browser/gotoError.i18n.json @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "title.wo_source": "({0}/{1})", + "markerAction.next.label": "Sonraki Hata veya Uyarıya Git", + "markerAction.previous.label": "Önceki Hata veya Uyarıya Git", + "editorMarkerNavigationError": "Düzenleyicinin işaretçi gezinti aracının hata rengi.", + "editorMarkerNavigationWarning": "Düzenleyicinin işaretçi gezinti aracının uyarı rengi.", + "editorMarkerNavigationBackground": "Düzenleyicinin işaretçi gezinti aracının arka planı." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/editor/contrib/hover/browser/hover.i18n.json b/i18n/trk/src/vs/editor/contrib/hover/browser/hover.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..e1a331227025cf781ab9bf8077d6c9edbdfe9e95 --- /dev/null +++ b/i18n/trk/src/vs/editor/contrib/hover/browser/hover.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "showHover": "Bağlantı Vurgusunu Göster" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/editor/contrib/hover/browser/modesContentHover.i18n.json b/i18n/trk/src/vs/editor/contrib/hover/browser/modesContentHover.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..1b70c63296f7c6884a382585d196761f6c780550 --- /dev/null +++ b/i18n/trk/src/vs/editor/contrib/hover/browser/modesContentHover.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "modesContentHover.loading": "Yükleniyor..." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/editor/contrib/inPlaceReplace/common/inPlaceReplace.i18n.json b/i18n/trk/src/vs/editor/contrib/inPlaceReplace/common/inPlaceReplace.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..bb4caacacb194cef48f398773fd2c2e9a88c1bc9 --- /dev/null +++ b/i18n/trk/src/vs/editor/contrib/inPlaceReplace/common/inPlaceReplace.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "InPlaceReplaceAction.previous.label": "Önceki Değerle Değiştir", + "InPlaceReplaceAction.next.label": "Sonraki Değerle Değiştir" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/editor/contrib/indentation/common/indentation.i18n.json b/i18n/trk/src/vs/editor/contrib/indentation/common/indentation.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..76b8b3c839160bf08a1a2c3b4c2ae7ad10a4515d --- /dev/null +++ b/i18n/trk/src/vs/editor/contrib/indentation/common/indentation.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "indentationToSpaces": "Girintiyi Boşluklara Dönüştür", + "indentationToTabs": "Girintiyi Sekmelere Dönüştür", + "configuredTabSize": "Yapılandırılmış Sekme Boyutu", + "selectTabWidth": "Geçerli Dosya İçin Sekme Boyutunu Seç", + "indentUsingTabs": "Sekme Kullanarak Girintile", + "indentUsingSpaces": "Boşluk Kullanarak Girintile", + "detectIndentation": "Girintiyi, İçeriği Kontrol Ederek Algıla", + "editor.reindentlines": "Satır Girintilerini Yeniden Ayarla" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/editor/contrib/linesOperations/common/linesOperations.i18n.json b/i18n/trk/src/vs/editor/contrib/linesOperations/common/linesOperations.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..4ae7163c50c3a970d5cef984e3d0dbf6bf8c66f4 --- /dev/null +++ b/i18n/trk/src/vs/editor/contrib/linesOperations/common/linesOperations.i18n.json @@ -0,0 +1,25 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "lines.copyUp": "Satırı Yukarı Kopyala", + "lines.copyDown": "Satırı Aşağı Kopyala", + "lines.moveUp": "Satırı Yukarı Taşı", + "lines.moveDown": "Satırı Aşağı Taşı", + "lines.sortAscending": "Satırları Artan Şekilde Sırala", + "lines.sortDescending": "Satırları Azalan Şekilde Sırala", + "lines.trimTrailingWhitespace": "Sondaki Boşluğu Kırp", + "lines.delete": "Satırı Sil", + "lines.indent": "Satırı Girintile", + "lines.outdent": "Satırın Girintisini Azalt", + "lines.insertBefore": "Üste Satır Ekle", + "lines.insertAfter": "Alta Satır Ekle", + "lines.deleteAllLeft": "Soldaki Her Şeyi Sil", + "lines.deleteAllRight": "Sağdaki Her Şeyi Sil", + "lines.joinLines": "Satırları Birleştir", + "editor.transpose": "İmlecin etrafındaki karakterleri birbirleriyle değiştir", + "editor.transformToUppercase": "Büyük Harfe Dönüştür", + "editor.transformToLowercase": "Küçük Harfe Dönüştür" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/editor/contrib/links/browser/links.i18n.json b/i18n/trk/src/vs/editor/contrib/links/browser/links.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..0d6ac3279c29f592a7d8aa17b84b5922638b5201 --- /dev/null +++ b/i18n/trk/src/vs/editor/contrib/links/browser/links.i18n.json @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "links.navigate.mac": "Bağlantıyı izlemek için Cmd tuşuna basarak tıklayın", + "links.navigate": "Bağlantıyı izlemek için Ctrl tuşuna basarak tıklayın", + "links.navigate.al": "Bağlantıyı izlemek için Alt tuşuna basarak tıklayın", + "invalid.url": "Üzgünüz, bu bağlantı iyi oluşturulmamış olduğu için açılamadı: {0}", + "missing.url": "Üzgünüz; bu bağlantı, hedefi eksik olduğu için açılamadı.", + "label": "Bağlantıyı Aç" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/editor/contrib/multicursor/common/multicursor.i18n.json b/i18n/trk/src/vs/editor/contrib/multicursor/common/multicursor.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..f3fa18b4184ddb92db1a54ad6d054665ff23eaf2 --- /dev/null +++ b/i18n/trk/src/vs/editor/contrib/multicursor/common/multicursor.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "mutlicursor.insertAbove": "Yukarıya İmleç Ekle", + "mutlicursor.insertBelow": "Aşağıya İmleç Ekle", + "mutlicursor.insertAtEndOfEachLineSelected": "Satır Sonlarına İmleç Ekle" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/editor/contrib/parameterHints/browser/parameterHints.i18n.json b/i18n/trk/src/vs/editor/contrib/parameterHints/browser/parameterHints.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..b7a4e43b2b61ffb2fe47729a51b40e76d76fb1ab --- /dev/null +++ b/i18n/trk/src/vs/editor/contrib/parameterHints/browser/parameterHints.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "parameterHints.trigger.label": "Parametre İpuçlarını Tetikle" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.i18n.json b/i18n/trk/src/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..ed56fe64626b7cf7c2385087cce35e880e7812c9 --- /dev/null +++ b/i18n/trk/src/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "hint": "{0}, ipucu" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/editor/contrib/quickFix/browser/quickFixCommands.i18n.json b/i18n/trk/src/vs/editor/contrib/quickFix/browser/quickFixCommands.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..86586e96e0a7d159a925108464b9cdbaa8e45a25 --- /dev/null +++ b/i18n/trk/src/vs/editor/contrib/quickFix/browser/quickFixCommands.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "quickFixWithKb": "Düzeltmeleri Göster ({0})", + "quickFix": "Düzeltmeleri Göster", + "quickfix.trigger.label": "Hızlı Düzeltme" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/editor/contrib/referenceSearch/browser/referenceSearch.i18n.json b/i18n/trk/src/vs/editor/contrib/referenceSearch/browser/referenceSearch.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..9ddf0e9fbe0234fff477d3f996057a8237c90ef4 --- /dev/null +++ b/i18n/trk/src/vs/editor/contrib/referenceSearch/browser/referenceSearch.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "meta.titleReference": "– {0} başvuru", + "references.action.label": "Tüm Başvuruları Bul" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/editor/contrib/referenceSearch/browser/referencesController.i18n.json b/i18n/trk/src/vs/editor/contrib/referenceSearch/browser/referencesController.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..14c77e0d64434336db3ca0b43752c3a71514151f --- /dev/null +++ b/i18n/trk/src/vs/editor/contrib/referenceSearch/browser/referencesController.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "labelLoading": "Yükleniyor..." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json b/i18n/trk/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..a3b4193dbe7c3b6e0b245c39e060b7fabb089a00 --- /dev/null +++ b/i18n/trk/src/vs/editor/contrib/referenceSearch/browser/referencesModel.i18n.json @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "aria.oneReference": "{0} yolunda, {1}. satır {2}. sütundaki sembol", + "aria.fileReferences.1": "{0} içinde 1 sembol, tam yol {1}", + "aria.fileReferences.N": "{1} içinde {0} sembol, tam yol {2}", + "aria.result.0": "Sonuç bulunamadı", + "aria.result.1": "{0} yolunda 1 sembol bulundu", + "aria.result.n1": "{1} yolunda {0} sembol bulundu", + "aria.result.nm": "{1} dosyada {0} sembol bulundu" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.i18n.json b/i18n/trk/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..6165a40b9f90e9ef957a601a5dda0764a0b063b9 --- /dev/null +++ b/i18n/trk/src/vs/editor/contrib/referenceSearch/browser/referencesWidget.i18n.json @@ -0,0 +1,27 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "referencesFailre": "Dosya çözümlenemedi.", + "referencesCount": "{0} başvuru", + "referenceCount": "{0} başvuru", + "missingPreviewMessage": "önizleme yok", + "treeAriaLabel": "Başvurular", + "noResults": "Sonuç yok", + "peekView.alternateTitle": "Başvurular", + "peekViewTitleBackground": "Gözetleme görünümü başlık alanının arka plan rengi.", + "peekViewTitleForeground": "Gözetleme görünümü başlığının rengi.", + "peekViewTitleInfoForeground": "Gözetleme görünümü başlık bilgisinin rengi.", + "peekViewBorder": "Gözetleme görünümü kenarlıkları ve ok işaretinin rengi.", + "peekViewResultsBackground": "Gözetleme görünümü sonuç listesinin arka plan rengi.", + "peekViewResultsMatchForeground": "Gözetleme görünümü sonuç listesindeki satır düğümlerinin ön plan rengi.", + "peekViewResultsFileForeground": "Gözetleme görünümü sonuç listesindeki dosya düğümlerinin ön plan rengi.", + "peekViewResultsSelectionBackground": "Gözetleme görünümü sonuç listesindeki seçilen girdinin arka plan rengi.", + "peekViewResultsSelectionForeground": "Gözetleme görünümü sonuç listesindeki seçilen girdinin ön plan rengi.", + "peekViewEditorBackground": "Gözetleme görünümü düzenleyicisinin arka plan rengi.", + "peekViewEditorGutterBackground": "Gözetleme görünümü düzenleyicisindeki oluğun arka plan rengi.", + "peekViewResultsMatchHighlight": "Gözetleme görünümü sonuç listesindeki eşleşme vurgusu rengi.", + "peekViewEditorMatchHighlight": "Gözetleme görünümü düzenleyicisindeki eşleşme vurgusu rengi." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/editor/contrib/rename/browser/rename.i18n.json b/i18n/trk/src/vs/editor/contrib/rename/browser/rename.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..4440b96d71b563414668771073657882b887b37a --- /dev/null +++ b/i18n/trk/src/vs/editor/contrib/rename/browser/rename.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "no result": "Sonuç yok.", + "aria": "'{0}', '{1}' olarak başarıyla yeniden adlandırıldı. Özet: {2}", + "rename.failed": "Üzgünüz, yeniden adlandırma işlemi başarısız oldu.", + "rename.label": "Sembolü Yeniden Adlandır" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/editor/contrib/rename/browser/renameInputField.i18n.json b/i18n/trk/src/vs/editor/contrib/rename/browser/renameInputField.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..eea4501c3d801778a8fa470c3b09e2c8c922bbee --- /dev/null +++ b/i18n/trk/src/vs/editor/contrib/rename/browser/renameInputField.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "renameAriaLabel": "Girdiyi yeniden adlandır. Yeni adı girin ve işlemek için Enter'a basın." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/editor/contrib/smartSelect/common/smartSelect.i18n.json b/i18n/trk/src/vs/editor/contrib/smartSelect/common/smartSelect.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..b63d95ca27146d4eb61fbcd6984b513f7f8bc0d1 --- /dev/null +++ b/i18n/trk/src/vs/editor/contrib/smartSelect/common/smartSelect.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "smartSelect.grow": "Seçimi Genişlet", + "smartSelect.shrink": "Seçimi Daralt" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/editor/contrib/suggest/browser/suggestController.i18n.json b/i18n/trk/src/vs/editor/contrib/suggest/browser/suggestController.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..d6c0cfacacb93ace25dbf7b5989353d7073a3246 --- /dev/null +++ b/i18n/trk/src/vs/editor/contrib/suggest/browser/suggestController.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "arai.alert.snippet": "'{0}' kabul edildiği için şu metin eklendi: {1}", + "suggest.trigger.label": "Öneriyi Tetikle" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json b/i18n/trk/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..657260a00490ddd9bfd74027c42fc8672de3ebe5 --- /dev/null +++ b/i18n/trk/src/vs/editor/contrib/suggest/browser/suggestWidget.i18n.json @@ -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. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "editorSuggestWidgetBackground": "Öneri aracının arka plan rengi.", + "editorSuggestWidgetBorder": "Öneri aracının kenarlık rengi.", + "editorSuggestWidgetForeground": "Öneri aracının ön plan rengi.", + "editorSuggestWidgetSelectedBackground": "Öneri aracındaki seçilen girdinin arka plan rengi.", + "editorSuggestWidgetHighlightForeground": "Öneri aracındaki eşleşme vurgularının rengi.", + "readMore": "Devamını Oku...{0}", + "suggestionWithDetailsAriaLabel": "{0}, öneri, detaylı", + "suggestionAriaLabel": "{0}, öneri", + "readLess": "Daha azını oku...{0}", + "suggestWidget.loading": "Yükleniyor...", + "suggestWidget.noSuggestions": "Öneri yok.", + "suggestionAriaAccepted": "{0}, kabul edildi", + "ariaCurrentSuggestionWithDetails": "{0}, öneri, detaylı", + "ariaCurrentSuggestion": "{0}, öneri" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/editor/contrib/toggleTabFocusMode/common/toggleTabFocusMode.i18n.json b/i18n/trk/src/vs/editor/contrib/toggleTabFocusMode/common/toggleTabFocusMode.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..720f500431fd37874738ae768692d80b708e06eb --- /dev/null +++ b/i18n/trk/src/vs/editor/contrib/toggleTabFocusMode/common/toggleTabFocusMode.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "toggle.tabMovesFocus": "Tab Tuşu İle Odak Değiştirmeyi Aç/Kapat" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/editor/contrib/wordHighlighter/common/wordHighlighter.i18n.json b/i18n/trk/src/vs/editor/contrib/wordHighlighter/common/wordHighlighter.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..25e86b185b8182cf0c032ef5f88768fabee95f7d --- /dev/null +++ b/i18n/trk/src/vs/editor/contrib/wordHighlighter/common/wordHighlighter.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "wordHighlight": "Bir değişkeni okumak gibi, okuma-erişimi sırasındaki bir sembolün arka plan rengi.", + "wordHighlightStrong": "Bir değişkene yazmak gibi, yazma-erişimi sırasındaki bir sembolün arka plan rengi." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/editor/contrib/zoneWidget/browser/peekViewWidget.i18n.json b/i18n/trk/src/vs/editor/contrib/zoneWidget/browser/peekViewWidget.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..8a312782515d9769a38341d59df24376f27fff88 --- /dev/null +++ b/i18n/trk/src/vs/editor/contrib/zoneWidget/browser/peekViewWidget.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "label.close": "Kapat" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/editor/electron-browser/textMate/TMSyntax.i18n.json b/i18n/trk/src/vs/editor/electron-browser/textMate/TMSyntax.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..cd8f883eda7332ba4055a2d665255f85978be6f0 --- /dev/null +++ b/i18n/trk/src/vs/editor/electron-browser/textMate/TMSyntax.i18n.json @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "invalid.language": "`contributes.{0}.language` ögesinde bilinmeyen dil. Sağlanan değer: {1}", + "invalid.scopeName": "`contributes.{0}.scopeName` ögesinde dize bekleniyor. Sağlanan değer: {1}", + "invalid.path.0": "`contributes.{0}.path` ögesinde dize bekleniyor. Sağlanan değer: {1}", + "invalid.injectTo": "`contributes.{0}.injectTo` ögesinde geçersiz değer. Dil kapsam adlarından oluşan bir dizi olmalıdır. Sağlanan değer: {1}", + "invalid.embeddedLanguages": "`contributes.{0}.embeddedLanguages` ögesinde geçersiz değer. Kapsam adından dile kadar olan bir nesne haritası olmalıdır. Sağlanan değer: {1}", + "invalid.path.1": "`contributes.{0}.path` ögesinin ({1}) eklentinin klasöründe ({2}) yer alması bekleniyor. Bu, eklentiyi taşınamaz yapabilir.", + "no-tm-grammar": "Bu dil için kayıtlı bir TM Grameri yok." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/editor/node/languageConfigurationExtensionPoint.i18n.json b/i18n/trk/src/vs/editor/node/languageConfigurationExtensionPoint.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..270182c4a478e4ce7f2894064b440074e75fe24f --- /dev/null +++ b/i18n/trk/src/vs/editor/node/languageConfigurationExtensionPoint.i18n.json @@ -0,0 +1,23 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "parseErrors": "{0} için ayrıştırma hataları: {1}", + "schema.openBracket": "Açılış ayracı karakteri veya dize sırası.", + "schema.closeBracket": "Kapanış ayracı karakteri veya dize sırası.", + "schema.comments": "Yorum sembollerini tanımlar.", + "schema.blockComments": "Blok açıklamalarının nasıl işaretlendiğini tanımlar.", + "schema.blockComment.begin": "Blok açıklamasını başlatan karakter dizisi.", + "schema.blockComment.end": "Blok açıklamasını bitiren karakter dizisi.", + "schema.lineComment": "Satır açıklamasını başlatan karakter dizisi.", + "schema.brackets": "Girintiyi artıran veya azaltan ayraç sembollerini tanımlar.", + "schema.autoClosingPairs": "Ayraç çiftlerini tanımlar. Bir açılış ayracı girildiğinde, kapanış ayracı otomatik olarak eklenir.", + "schema.autoClosingPairs.notIn": "Otomatik çiftlerin devre dışı bırakıldığı bir kapsamlar listesi tanımlar.", + "schema.surroundingPairs": "Seçili bir dizeyi çevrelemek için kullanılabilecek ayraç çiftlerini tanımlar.", + "schema.wordPattern": "Dilin kelime tanımı.", + "schema.wordPattern.pattern": "Sözcükleri eşleştirmek için kullanılacak Düzenli İfade.", + "schema.wordPattern.flags": "Sözcükleri eşleştirmek için kullanılacak Düzenli İfade işaretleri.", + "schema.wordPattern.flags.errorMessage": "`/^([gimuy]+)$/` kalıbı ile eşleşmelidir." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/editor/node/textMate/TMGrammars.i18n.json b/i18n/trk/src/vs/editor/node/textMate/TMGrammars.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..60439bb3b955c18c094e79fd770f6772529d485b --- /dev/null +++ b/i18n/trk/src/vs/editor/node/textMate/TMGrammars.i18n.json @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "vscode.extension.contributes.grammars": "textmate tokenizerlere ekleme yapar.", + "vscode.extension.contributes.grammars.language": "Bu söz diziminin ekleneceği dil tanımlayıcısı.", + "vscode.extension.contributes.grammars.scopeName": "tmLanguage dosyası tarafından kullanılan Textmate kapsam adı.", + "vscode.extension.contributes.grammars.path": "tmLanguage dosyasının yolu. Yol, eklenti klasörüne görecelidir ve genellikle './syntaxes/' ile başlar.", + "vscode.extension.contributes.grammars.embeddedLanguages": "Bu dil bilgisinin gömülü dilleri içermesi durumundaki bir dil kimliğinin kapsam adı haritası.", + "vscode.extension.contributes.grammars.injectTo": "Bu dil bilgisinin yerleştirileceği dil kapsam adları listesi." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/platform/actions/browser/menuItemActionItem.i18n.json b/i18n/trk/src/vs/platform/actions/browser/menuItemActionItem.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..e64a7d0ed09f01155f7629cf3084270adaad2390 --- /dev/null +++ b/i18n/trk/src/vs/platform/actions/browser/menuItemActionItem.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "titleAndKb": "{0} ({1})" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/platform/actions/electron-browser/menusExtensionPoint.i18n.json b/i18n/trk/src/vs/platform/actions/electron-browser/menusExtensionPoint.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..1fc7a735690183b96ab1c277f777b2365f4693e2 --- /dev/null +++ b/i18n/trk/src/vs/platform/actions/electron-browser/menusExtensionPoint.i18n.json @@ -0,0 +1,43 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "requirearray": "menü ögeleri bir dizi olmalıdır", + "requirestring": "`{0}` özelliği zorunludur ve `string` türünde olmalıdır", + "optstring": "`{0}` özelliği atlanabilir veya `string` türünde olmalıdır", + "vscode.extension.contributes.menuItem.command": "Yürütülecek komutun tanımlayıcısı. Komut 'commands' bölümünde tanımlanmalıdır", + "vscode.extension.contributes.menuItem.alt": "Yürütülecek alternatif bir komutun tanımlayıcısı. Komut 'commands' bölümünde tanımlanmalıdır", + "vscode.extension.contributes.menuItem.when": "Bu ögeyi göstermek için doğru olması gereken koşul", + "vscode.extension.contributes.menuItem.group": "Bu komutun ait olduğu gruba ekle", + "vscode.extension.contributes.menus": "Düzenleyiciye menü ögeleri ekler", + "menus.commandPalette": "Komut Paleti", + "menus.editorTitle": "Düzenleyici başlık menüsü", + "menus.editorContext": "Düzenleyici bağlam menüsü", + "menus.explorerContext": "Dosya gezgini bağlam menüsü", + "menus.editorTabContext": "Düzenleyici sekmeleri bağlam menüsü", + "menus.debugCallstackContext": "Hata ayıklama çağrı yığını bağlam menüsü", + "menus.scmTitle": "Kaynak Denetimi başlık menüsü", + "menus.resourceGroupContext": "Kaynak Denetimi kaynak grubu bağlam menüsü", + "menus.resourceStateContext": "Kaynak Denetimi kaynak durumu bağlam menüsü", + "view.viewTitle": "Katkıda bulunan görünümü başlık menüsü", + "view.itemContext": "Katkıda bulunan görünümü öge bağlam menüsü", + "nonempty": "boş olmayan değer beklendi.", + "opticon": "`icon` özelliği atlanabilir veya bir dize ya da `{dark, light}` gibi bir değişmez değer olmalıdır", + "requireStringOrObject": "`{0}` özelliği zorunludur ve `string` veya `object` türünde olmalıdır", + "requirestrings": "`{0}` ve `{1}` özellikleri zorunludur ve `string` türünde olmalıdır", + "vscode.extension.contributes.commandType.command": "Yürütülecek komutun tanımlayıcısı", + "vscode.extension.contributes.commandType.title": "Komutu kullanıcı arayüzünde temsil edecek başlık", + "vscode.extension.contributes.commandType.category": "(İsteğe Bağlı) Kullanıcı arayüzünde komutun gruplanacağı kategori dizesi", + "vscode.extension.contributes.commandType.icon": "(İsteğe Bağlı) Komutun, Kullanıcı Arayüzü'nde temsil edilmesinde kullanılacak simge. Bir dosya yolu veya tema olarak kullanılabilir bir yapılandırmadır", + "vscode.extension.contributes.commandType.icon.light": "Açık bir tema kullanıldığındaki simge yolu", + "vscode.extension.contributes.commandType.icon.dark": "Koyu bir tema kullanıldığındaki simge yolu", + "vscode.extension.contributes.commands": "Komut paletine komutlar ekler.", + "dup": "`{0}` komutu `commands` bölümünde birden çok kez görünüyor.", + "menuId.invalid": "`{0}` geçerli bir menü tanımlayıcısı değil", + "missing.command": "Menü ögesi, 'commands' bölümünde tanımlanmamış bir `{0}` komutuna başvuruyor.", + "missing.altCommand": "Menü ögesi, 'commands' bölümünde tanımlanmamış bir `{0}` alternatif komutuna başvuruyor.", + "dupe.command": "Menü ögesi, aynı varsayılan ve alternatif komutlarına başvuruyor", + "nosupport.altCommand": "Üzgünüz, fakat sadece 'editor/title' menüsünün 'navigation' grubu alternatif komutları destekliyor" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/platform/configuration/common/configurationRegistry.i18n.json b/i18n/trk/src/vs/platform/configuration/common/configurationRegistry.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..314a88ccc90dab1ea83af1e6a19e02183d043a36 --- /dev/null +++ b/i18n/trk/src/vs/platform/configuration/common/configurationRegistry.i18n.json @@ -0,0 +1,19 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "defaultConfigurations.title": "Varsayılan Yapılandırma Geçersiz Kılmaları", + "overrideSettings.description": "{0} dili için geçersiz kılınacak düzenleyici ayarlarını yapılandırın.", + "overrideSettings.defaultDescription": "Bir dil için geçersiz kılınacak düzenleyici ayarlarını yapılandırın.", + "vscode.extension.contributes.configuration": "Yapılandırma ayarlarına ekleme yapar.", + "vscode.extension.contributes.configuration.title": "Ayarların bir özeti. Bu etiket ayar dosyasında ayırıcı yorum olarak kullanılacaktır.", + "vscode.extension.contributes.configuration.properties": "Yapılandırma özelliklerinin açıklaması.", + "config.property.languageDefault": "'{0}' kaydedilemiyor. Bu, dile özgü düzenleyici ayarlarını tanımlamak için '\\\\[.*\\\\]$' özellik kalıbı ile eşleşir. 'configurationDefaults' ögesini kullanın.", + "config.property.duplicate": "'{0}' kaydedilemiyor. Bu özellik zaten kayıtlı.", + "invalid.properties": "'configuration.properties' bir nesne olmalıdır", + "invalid.type": "eğer ayarlanırsa, 'configuration.type' ögesi 'object' olarak ayarlanmalıdır", + "invalid.title": "'configuration.title' bir dize olmalıdır", + "vscode.extension.contributes.defaultConfiguration": "Varsayılan düzenleyici yapılandırma ayarlarına dil bazında ekleme yapar." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/platform/environment/node/argv.i18n.json b/i18n/trk/src/vs/platform/environment/node/argv.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..f3d197dfba2c1202b4146554b80f00ec2b0cace3 --- /dev/null +++ b/i18n/trk/src/vs/platform/environment/node/argv.i18n.json @@ -0,0 +1,32 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "gotoValidation": "`--goto` modundaki argümanlar `FILE(:LINE(:CHARACTER))` biçiminde olmalıdır.", + "diff": "Bir karşılaştırma düzenleyicisi aç. İki dosya yolu argüman olarak iletilmelidir.", + "goto": "Yoldaki dosyayı satırda ve sütunda aç (yola :line[:character] ekleyin).", + "locale": "Kullanılacak yerel dil (örnek: en-US veya zh-TW).", + "newWindow": "Yeni bir Code örneğini zorla.", + "performance": "'Geliştirici: Başlangıç Performansı' komutu etkinleştirilmiş olarak başlat.", + "prof-startup": "Başlangıç sırasında CPU profil oluşturucusunu çalıştır", + "reuseWindow": "Bir dosya veya klasörü son etkin pencerede açmaya zorlayın.", + "userDataDir": "Kullanıcı verilerinin tutulacağı klasörü belirtir, root olarak çalışırken yararlıdır.", + "verbose": "Ayrıntılı çıktı oluştur (--wait anlamına gelir).", + "wait": "Geri dönmeden önce pencerenin kapanmasını bekle.", + "extensionHomePath": "Eklentilerin kök dizinini belirle.", + "listExtensions": "Yüklü eklentileri listele.", + "showVersions": "--list-extensions'u kullanırken, yüklü eklentilerin sürümlerini gösterir.", + "installExtension": "Bir eklenti yükler.", + "uninstallExtension": "Bir eklentiyi kaldırır.", + "experimentalApis": "Bir eklenti için önerilen API özelliklerini etkinleştirir.", + "disableExtensions": "Yüklü tüm eklentileri devre dışı bırak.", + "disableGPU": "GPU donanım hızlandırmasını devre dışı bırak.", + "version": "Sürümü göster.", + "help": "Kullanımı göster.", + "usage": "Kullanım", + "options": "seçenekler", + "paths": "yollar", + "optionsUpperCase": "Seçenekler" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/platform/extensionManagement/common/extensionEnablementService.i18n.json b/i18n/trk/src/vs/platform/extensionManagement/common/extensionEnablementService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..a616c58befac8fbf7e40cc2653c62cd9cca374ba --- /dev/null +++ b/i18n/trk/src/vs/platform/extensionManagement/common/extensionEnablementService.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "noWorkspace": "Çalışma alanı yok." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/platform/extensionManagement/common/extensionManagement.i18n.json b/i18n/trk/src/vs/platform/extensionManagement/common/extensionManagement.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..b894836196dec26fbd0d9d59f9504da9c9c2a2a8 --- /dev/null +++ b/i18n/trk/src/vs/platform/extensionManagement/common/extensionManagement.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "extensions": "Eklentiler", + "preferences": "Tercihler" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/platform/extensionManagement/node/extensionGalleryService.i18n.json b/i18n/trk/src/vs/platform/extensionManagement/node/extensionGalleryService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..e335acfc388f2820716efebadc628013a0c1e923 --- /dev/null +++ b/i18n/trk/src/vs/platform/extensionManagement/node/extensionGalleryService.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "notFound": "Eklenti bulunamadı", + "noCompatible": "{0} eklentisinin Code'un bu sürümüyle uyumlu bir sürümü bulunamadı." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/platform/extensionManagement/node/extensionManagementService.i18n.json b/i18n/trk/src/vs/platform/extensionManagement/node/extensionManagementService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..46113aaf483da22bbf6c8d33ef3fdb103fc942bb --- /dev/null +++ b/i18n/trk/src/vs/platform/extensionManagement/node/extensionManagementService.i18n.json @@ -0,0 +1,22 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "invalidManifest": "Eklenti geçersiz: package.json bir JSON dosyası değil.", + "restartCode": "{0} eklentisini yeniden yüklemeden önce lütfen Code'u yeniden başlatın.", + "installDependeciesConfirmation": "'{0}' eklentisini yüklediğinizde onun bağımlılıkları da yüklenir. Devam etmek istiyor musunuz?", + "install": "Evet", + "doNotInstall": "Hayır", + "uninstallDependeciesConfirmation": "Yalnızca '{0}' eklentisini mi yoksa bağımlılıklarını da kaldırmak ister misiniz?", + "uninstallOnly": "Sadece Eklenti", + "uninstallAll": "Tümü", + "cancel": "İptal", + "uninstallConfirmation": "'{0}' eklentisini kaldırmak istediğinizden emin misiniz?", + "ok": "Tamam", + "singleDependentError": "'{0}' eklentisi kaldırılamıyor. '{1}' eklentisi buna bağlı.", + "twoDependentsError": "'{0}' eklentisi kaldırılamıyor. '{1}' ve '{2}' eklentileri buna bağlı.", + "multipleDependentsError": "'{0}' eklentisi kaldırılamıyor. '{1}, '{2}' eklentileri ve diğerleri buna bağlı.", + "notExists": "Eklenti bulunamadı" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/platform/extensions/common/abstractExtensionService.i18n.json b/i18n/trk/src/vs/platform/extensions/common/abstractExtensionService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..f48bbd6079549f33255c66d882d01960d90abea1 --- /dev/null +++ b/i18n/trk/src/vs/platform/extensions/common/abstractExtensionService.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "unknownDep": "`{1}` eklentisi etkinleştirilemedi. Neden: bilinmeyen bağımlılık `{0}`.", + "failedDep1": "`{1}` eklentisi etkinleştirilemedi. Neden: bağımlılık `{0}` etkinleştirilemedi.", + "failedDep2": "`{0}` eklentisi etkinleştirilemedi. Neden: 10'dan fazla bağımlılık düzeyi (büyük olasılıkla bağımlılık döngüsü).", + "activationError": "`{0}` eklentisi etkinleştirilemedi: {1}." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/platform/extensions/common/extensionsRegistry.i18n.json b/i18n/trk/src/vs/platform/extensions/common/extensionsRegistry.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..64e1ebd91a4a8d1e5eb66e5dfd87fa1defbdd6a0 --- /dev/null +++ b/i18n/trk/src/vs/platform/extensions/common/extensionsRegistry.i18n.json @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "vscode.extension.engines.vscode": "Eklentinin uyumlu olduğu VS Code sürümünü belirten VS Code eklentileri için. * olamaz. Örneğin: ^0.10.5 uyumlu olduğu minimum VS Code sürümünün 0.10.5 olduğunu gösterir.", + "vscode.extension.publisher": "VS Code eklentisinin yayıncısı.", + "vscode.extension.displayName": "VS Code galerisinde kullanılan eklentinin görünen adı.", + "vscode.extension.categories": "Bu eklentiyi kategorize etmek için VS Code galerisi tarafından kullanılan kategoriler.", + "vscode.extension.galleryBanner": "VS Code markette kullanılan afiş.", + "vscode.extension.galleryBanner.color": "VS Code marketteki sayfa başlığındaki afiş rengi.", + "vscode.extension.galleryBanner.theme": "Afişte kullanılan yazı tipi için renk teması.", + "vscode.extension.contributes": "Bu paketin temsil ettiği VS Code eklentisinin tüm katkıları.", + "vscode.extension.preview": "Markette eklentinin Önizleme olarak işaretlenmesini sağlar.", + "vscode.extension.activationEvents": "VS Code eklentisi için etkinleştirme olayları.", + "vscode.extension.activationEvents.onLanguage": "Belirtilen dilde çözümlenen bir dosya her açıldığında bir etkinleştirme olayı yayınlanır.", + "vscode.extension.activationEvents.onCommand": "Belirtilen komut her çağrıldığında bir etkinleştirme olayı yayınlanır.", + "vscode.extension.activationEvents.onDebug": "Belirtilen türde bir hata ayıklama oturumu her başladığında bir etkinleştirme olayı yayınlanır.", + "vscode.extension.activationEvents.workspaceContains": "Belirtilen glob deseni ile eşleşen en az bir dosya içeren bir klasör her açıldığında bir etkinleştirme olayı yayınlanır.", + "vscode.extension.activationEvents.onView": "Belirtilen görünüm her genişletildiğinde bir etkinleştirme olayı yayınlanır.", + "vscode.extension.activationEvents.star": "VS Code başlatıldığında yayılan etkinleştirme olayı. Mükemmel bir son kullanıcı deneyimi sağlandığından emin olmak için, lütfen bu etkinleştirme olayını eklentinizde sadece kullanım durumunuzda başka hiçbir aktivasyon olayı kombinasyonu çalışmıyorsa kullanın.", + "vscode.extension.badges": "Marketin eklenti sayfasının kenar çubuğunda görüntülenecek göstergeler dizisi.", + "vscode.extension.badges.url": "Gösterge görüntüsü URL'si.", + "vscode.extension.badges.href": "Gösterge bağlantısı.", + "vscode.extension.badges.description": "Gösterge açıklaması.", + "vscode.extension.extensionDependencies": "Diğer uzantılara bağımlılıklar. Bir uzantının tanımlayıcısı her zaman ${publisher}.${name} biçimindedir. Örneğin: vscode.csharp.", + "vscode.extension.scripts.prepublish": "Paket, bir VS Code eklentisi olarak yayımlamadan önce çalıştırılacak betik.", + "vscode.extension.icon": "128x128 piksellik bir simgenin yolu." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/platform/extensions/node/extensionValidator.i18n.json b/i18n/trk/src/vs/platform/extensions/node/extensionValidator.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..1b6d6ecbb85b049ccf9c8d8503bce65c437fc087 --- /dev/null +++ b/i18n/trk/src/vs/platform/extensions/node/extensionValidator.i18n.json @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "versionSyntax": "`engines.vscode` değeri {0} ayrıştırılamadı. Lütfen örnekte verilenlere benzer ifadeler kullanın: ^0.10.0, ^1.2.3, ^0.11.0, ^0.10.x, vb.", + "versionSpecificity1": "`engines.vscode`da belirtilen sürüm ({0}) yeterince belirli değil. vscode 1.0.0'dan önceki sürümler için, lütfen istenecek minimum majör ve minör sürüm numarasını tanımlayın. Örneğin: ^0.10.0, 0.10.x, 0.11.0, vb.", + "versionSpecificity2": "`engines.vscode`da belirtilen sürüm ({0}) yeterince belirli değil. vscode 1.0.0'dan sonraki sürümler için, lütfen istenecek minimum majör sürüm numarasını tanımlayın. Örneğin: ^1.10.0, 1.10.x, 1.x.x, 2.x.x, vb.", + "versionMismatch": "Eklenti, Code {0} ile uyumlu değil. Gereken sürüm: {1}.", + "extensionDescription.empty": "Boş eklenti açıklaması alındı", + "extensionDescription.publisher": "`{0}` özelliği zorunludur ve `string` türünde olmalıdır", + "extensionDescription.name": "`{0}` özelliği zorunludur ve `string` türünde olmalıdır", + "extensionDescription.version": "`{0}` özelliği zorunludur ve `string` türünde olmalıdır", + "extensionDescription.engines": "`{0}` özelliği zorunludur ve `object` türünde olmalıdır", + "extensionDescription.engines.vscode": "`{0}` özelliği zorunludur ve `string` türünde olmalıdır", + "extensionDescription.extensionDependencies": "`{0}` özelliği atlanabilir veya `string[]` türünde olmalıdır", + "extensionDescription.activationEvents1": "`{0}` özelliği atlanabilir veya `string[]` türünde olmalıdır", + "extensionDescription.activationEvents2": "`{0}` ve `{1}` özelliklerinin ikisi birden belirtilmeli veya ikisi birden atlanmalıdır", + "extensionDescription.main1": "`{0}` özelliği atlanabilir veya `string` türünde olmalıdır", + "extensionDescription.main2": "`main` ({0}) yolunun eklentinin klasörü içine ({1}) eklenmiş olacağı beklendi. Bu, eklentiyi taşınamaz yapabilir.", + "extensionDescription.main3": "`{0}` ve `{1}` özelliklerinin ikisi birden belirtilmeli veya ikisi birden atlanmalıdır", + "notSemver": "Eklenti sürümü semver ile uyumlu değil." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/platform/history/electron-main/historyMainService.i18n.json b/i18n/trk/src/vs/platform/history/electron-main/historyMainService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..9e486dd5b431d1e450d10c267524d65119800a00 --- /dev/null +++ b/i18n/trk/src/vs/platform/history/electron-main/historyMainService.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "newWindow": "Yeni Pencere", + "newWindowDesc": "Yeni bir pencere açar", + "recentFolders": "Son Kullanılan Klasörler", + "folderDesc": "{0} {1}" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/platform/integrity/node/integrityServiceImpl.i18n.json b/i18n/trk/src/vs/platform/integrity/node/integrityServiceImpl.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..8d0fe38437997006f64b88fc3f596247e05cfe6b --- /dev/null +++ b/i18n/trk/src/vs/platform/integrity/node/integrityServiceImpl.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "integrity.ok": "Tamam", + "integrity.dontShowAgain": "Tekrar gösterme", + "integrity.moreInfo": "Daha fazla bilgi", + "integrity.prompt": "{0} kurulumunuz bozuk görünüyor. Lütfen yeniden yükleyin." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/platform/jsonschemas/common/jsonValidationExtensionPoint.i18n.json b/i18n/trk/src/vs/platform/jsonschemas/common/jsonValidationExtensionPoint.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..8a050918f96efb19f8cf72d03b4546e9f921f78a --- /dev/null +++ b/i18n/trk/src/vs/platform/jsonschemas/common/jsonValidationExtensionPoint.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "contributes.jsonValidation": "json şema yapılandırmasına ekleme yapar.", + "contributes.jsonValidation.fileMatch": "Eşleşecek dosya örüntüsü, örneğin \"package.json\" veya \"*.launch\".", + "contributes.jsonValidation.url": "Bir şema URL'si ('http:', 'https:') veya eklenti klasörüne ('./') göreceli yol.", + "invalid.jsonValidation": "'configuration.jsonValidation' bir dizi olmalıdır", + "invalid.fileMatch": "'configuration.jsonValidation.fileMatch' tanımlanmalıdır", + "invalid.url": "'configuration.jsonValidation.url' bir URL veya göreli yol olmalıdır", + "invalid.url.fileschema": "'configuration.jsonValidation.url' geçersiz bir göreli URL'dir: {0}", + "invalid.url.schema": "'configuration.jsonValidation.url' ögesi eklentide bulunan şemalara başvurmak için 'http:', 'https:' veya './' ile başlamalıdır" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/platform/keybinding/common/abstractKeybindingService.i18n.json b/i18n/trk/src/vs/platform/keybinding/common/abstractKeybindingService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..3993824999c6dda968281fbd5d85afdbbc7d3d2a --- /dev/null +++ b/i18n/trk/src/vs/platform/keybinding/common/abstractKeybindingService.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "first.chord": "({0}) öğesine basıldı. Akorun ikinci tuşu bekleniyor...", + "missing.chord": "({0}, {1}) tuş bileşimi bir komut değil." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/platform/markers/common/problemMatcher.i18n.json b/i18n/trk/src/vs/platform/markers/common/problemMatcher.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..cce6c021fdc347a56d66c64cc586037589fd1c8c --- /dev/null +++ b/i18n/trk/src/vs/platform/markers/common/problemMatcher.i18n.json @@ -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. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "ProblemPatternParser.loopProperty.notLast": "Döngü özelliği yalnızca son satır eşleştiricisinde desteklenir.", + "ProblemPatternParser.problemPattern.missingRegExp": "Sorun modelinde bir düzenli ifade eksik.", + "ProblemPatternParser.problemPattern.missingProperty": "Sorun modeli hatalı. En az bir dosya, mesaj ve satır veya konum eşleşme grubu bulundurmalıdır.", + "ProblemPatternParser.invalidRegexp": "Hata: Dize {0}, geçerli bir düzenli ifade değil.\n", + "ProblemPatternSchema.regexp": "Çıktıda bir hata, uyarı veya bilgi bulan düzenli ifade.", + "ProblemPatternSchema.file": "Dosya adının eşleştirme grubu indeksi. Atlanırsa 1 kullanılır.", + "ProblemPatternSchema.location": "Sorunun bulunduğu yerin eşleşme grubu indeksi. Geçerli konum örüntüleri şunlardır: (line), (line,column) ve (startLine,startColumn,endLine,endColumn). Atlanmışsa (line,column) varsayılır.", + "ProblemPatternSchema.line": "Sorunun satırının eşleştirme grubu indeksi. Varsayılan değeri 2'dir", + "ProblemPatternSchema.column": "Sorunun satır karakterinin eşleştirme grubu indeksi. Varsayılan değeri 3'tür", + "ProblemPatternSchema.endLine": "Sorunun satır sonunun eşleştirme grubu indeksi. Varsayılan değeri tanımsızdır", + "ProblemPatternSchema.endColumn": "Sorunun satır sonu karakterinin eşleştirme grubu indeksi. Varsayılan değeri tanımsızdır", + "ProblemPatternSchema.severity": "Sorunun öneminin eşleştirme grubu indeksi. Varsayılan değeri tanımsızdır", + "ProblemPatternSchema.code": "Sorunun kodunun eşleştirme grubu indeksi. Varsayılan değeri tanımsızdır", + "ProblemPatternSchema.message": "Mesajın eşleştirme grubu indeksi. Atlanırsa konum belirtildiğinde varsayılan olarak 4 kullanılır. Aksi taktirde varsayılan olarak 5 kullanılır.", + "ProblemPatternSchema.loop": "Birden çok satırlı eşleşmede döngü, bu kalıbın eşleştiği sürece bir döngüde yürütülüp yürütülmeyeceğini gösterir. Yalnızca birden çok satırlı bir kalıbın son kalıbında belirtilebilir.", + "NamedProblemPatternSchema.name": "Sorun modelinin adı.", + "NamedMultiLineProblemPatternSchema.name": "Birden çok satırlı sorun modelinin adı.", + "NamedMultiLineProblemPatternSchema.patterns": "Gerçek modeller.", + "ProblemPatternExtPoint": "Sorun modellerine ekleme yapar", + "ProblemPatternRegistry.error": "Geçersiz sorun modeli. Model yok sayılacaktır.", + "ProblemMatcherParser.noProblemMatcher": "Hata: açıklama bir sorun eşleştiricisine dönüştürülemez:\n{0}\n", + "ProblemMatcherParser.noProblemPattern": "Hata: açıklama geçerli bir sorun modeli tanımlamıyor:\n{0}\n", + "ProblemMatcherParser.noOwner": "Hata: açıklama bir sahip tanımlamıyor:\n{0}\n", + "ProblemMatcherParser.noFileLocation": "Hata: açıklama bir dosya yolu tanımlamıyor:\n{0}\n", + "ProblemMatcherParser.unknownSeverity": "Bilgi: bilinmeyen önem derecesi {0}. Geçerli değerler: error, warning ve info.\n", + "ProblemMatcherParser.noDefinedPatter": "Hata: tanımlayıcısı {0} olan model mevcut değil.", + "ProblemMatcherParser.noIdentifier": "Hata: model özelliği boş bir tanımlayıcıya karşılık geliyor.", + "ProblemMatcherParser.noValidIdentifier": "Hata: model özelliği {0} geçerli bir model değişkeni adı değil.", + "ProblemMatcherParser.problemPattern.watchingMatcher": "Bir sorun eşleştiricisi izlenecek bir başlangıç örüntüsü ve bir bitiş örüntüsü tanımlamalıdır.", + "ProblemMatcherParser.invalidRegexp": "Hata: Dize {0}, geçerli bir düzenli ifade değil.\n", + "WatchingPatternSchema.regexp": "Bir arka plan görevinin başlangıcını ve sonunu tespit edecek düzenli ifade.", + "WatchingPatternSchema.file": "Dosya adının eşleştirme grubu indeksi. Atlanabilir.", + "PatternTypeSchema.name": "Katkıda bulunulan veya ön tanımlı modelin adı", + "PatternTypeSchema.description": "Bir sorun modeli veya bir katkıda bulunulan veya ön tanımlı sorun modelinin adı. Temel model belirtildiyse atlanabilir.", + "ProblemMatcherSchema.base": "Kullanılacak temel sorun eşleştiricisinin adı.", + "ProblemMatcherSchema.owner": "Code'un içindeki sorunun sahibi. Temel model belirtildiyse atlanabilir. Atlanırsa ve temel belirtilmemişse 'external' varsayılır.", + "ProblemMatcherSchema.severity": "Sorun yakalamanın varsayılan önem derecesi. Model, önem derecesi için bir eşleme grubu tanımlamazsa kullanılır.", + "ProblemMatcherSchema.applyTo": "Bir metin belgesinde bildirilen bir sorunun sadece açık, kapalı veya tüm belgelere uygulanıp uygulanmadığını denetler.", + "ProblemMatcherSchema.fileLocation": "Bir sorun modelinde bildirilen dosya adlarının nasıl yorumlanacağını tanımlar.", + "ProblemMatcherSchema.background": "Bir arka plan görevinde aktif bir eşleştiricinin başlangıcını ve sonunu izlemek için kullanılan kalıplar.", + "ProblemMatcherSchema.background.activeOnStart": "\"true\" olarak ayarlanırsa, görev başladığında arka plan izleyicisi etkin modda olur. Bu, beginsPattern ile başlayan bir satırın verilmesi demektir", + "ProblemMatcherSchema.background.beginsPattern": "Çıktıda eşleşmesi halinde, arka plan görevinin başlatılması sinyali verilir.", + "ProblemMatcherSchema.background.endsPattern": "Çıktıda eşleşmesi halinde, arka plan görevinin sonu sinyali verilir.", + "ProblemMatcherSchema.watching.deprecated": "İzleme özelliği kullanım dışıdır. Onun yerine arka planı kullanın.", + "ProblemMatcherSchema.watching": "Bir izleme eşleştiricisinin başlangıcını ve sonunu izlemek için kullanılan kalıplar.", + "ProblemMatcherSchema.watching.activeOnStart": "\"true\" olarak ayarlanırsa, görev başladığında izleyici etkin modda olur. Bu, beginsPattern ile başlayan bir satırın verilmesi demektir", + "ProblemMatcherSchema.watching.beginsPattern": "Çıktıda eşleşmesi halinde, izleme görevinin başlatılması sinyali verilir.", + "ProblemMatcherSchema.watching.endsPattern": "Çıktıda eşleşmesi halinde, izleme görevinin sonu sinyali verilir.", + "LegacyProblemMatcherSchema.watchedBegin.deprecated": "Bu özellik kullanım dışıdır. Bunun yerine 'watching' özelliğini kullanın.", + "LegacyProblemMatcherSchema.watchedBegin": "İzlenen görevlerin yürütülmeye başlanmasının, dosya izleyerek tetiklendiğini işaret eden bir düzenli ifade.", + "LegacyProblemMatcherSchema.watchedEnd.deprecated": "Bu özellik kullanım dışıdır. Bunun yerine 'watching' özelliğini kullanın.", + "LegacyProblemMatcherSchema.watchedEnd": "İzlenen görevlerin yürütülmesinin sona erdiğini işaret eden bir düzenli ifade.", + "NamedProblemMatcherSchema.name": "Sorun eşleştiricisinin adı.", + "ProblemMatcherExtPoint": "Sorun eşleştiricilerine ekleme yapar" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/platform/message/common/message.i18n.json b/i18n/trk/src/vs/platform/message/common/message.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..4f9a44f93833cfe6541dafcb1c0839c572c4c55b --- /dev/null +++ b/i18n/trk/src/vs/platform/message/common/message.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "close": "Kapat", + "later": "Daha Sonra", + "cancel": "İptal" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/platform/request/node/request.i18n.json b/i18n/trk/src/vs/platform/request/node/request.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..90faed28342ff65e308f728911dd545f6358db30 --- /dev/null +++ b/i18n/trk/src/vs/platform/request/node/request.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "httpConfigurationTitle": "HTTP", + "proxy": "Kullanılacak proxy ayarı. Ayarlanmazsa, http_proxy ve https_proxy ortam değişkenlerinden alınır", + "strictSSL": "Proxy sunucu sertifikasının verilen Sertifika Yetkilileri listesine göre doğrulanması gerekip gerekmediği.", + "proxyAuthorization": "Her ağ isteği için 'Proxy-Authorization' başlığı olarak gönderilecek değer." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/platform/telemetry/common/telemetryService.i18n.json b/i18n/trk/src/vs/platform/telemetry/common/telemetryService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..6c5812585d717e2c6736811b32bf1b3b0dabfa92 --- /dev/null +++ b/i18n/trk/src/vs/platform/telemetry/common/telemetryService.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "telemetryConfigurationTitle": "Telemetri", + "telemetry.enableTelemetry": "Kullanım verileri ve hataların Microsoft'a gönderilmesini etkinleştirin." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/platform/theme/common/colorRegistry.i18n.json b/i18n/trk/src/vs/platform/theme/common/colorRegistry.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..0c4954b0a9ac9620fd226999483b9891b1b5347e --- /dev/null +++ b/i18n/trk/src/vs/platform/theme/common/colorRegistry.i18n.json @@ -0,0 +1,88 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "invalid.color": "Geçersiz renk biçimi. #RGB, #RGBA, #RRGGBB veya #RRGGBBAA kullanın", + "schema.colors": "Çalışma ekranında kullanılan renkler.", + "foreground": "Genel ön plan rengi. Bu renk, bir bileşen tarafından geçersiz kılınmadıkça kullanılır.", + "errorForeground": "Hata mesajları için genel ön plan rengi. Bu renk, bir bileşen tarafından geçersiz kılınmadıkça kullanılır.", + "descriptionForeground": "Ek bilgi sağlayan açıklama metni(örneğin bir etiket) için ön plan rengi.", + "focusBorder": "Odaklanılan ögeler için genel kenarlık rengi. Bu renk, bir bileşen tarafından geçersiz kılınmadıkça kullanılır.", + "contrastBorder": "Daha fazla kontrast için, ögelerin etrafında onları diğerlerinden ayıracak ekstra bir kenarlık.", + "activeContrastBorder": "Daha fazla kontrast için, aktif ögelerin etrafında onları diğerlerinden ayıracak ekstra bir kenarlık.", + "selectionBackground": "Çalışma ekranındaki metin seçimlerinin arka plan rengi(örneğin girdi alanları veya metin alanları). Bunun, düzenleyicideki seçimlere uygulanmayacağını unutmayın.", + "textSeparatorForeground": "Metin ayırıcıların rengi.", + "textLinkForeground": "Metindeki bağlantıların ön plan rengi.", + "textLinkActiveForeground": "Metindeki aktif bağlantıların ön plan rengi.", + "textPreformatForeground": "Önceden biçimlendirilmiş metin parçalarının ön plan rengi.", + "textBlockQuoteBackground": "Metindeki alıntı bloklarının arka plan rengi.", + "textBlockQuoteBorder": "Metindeki alıntı bloklarının kenarlık rengi.", + "textCodeBlockBackground": "Metindeki kod bloklarının arka plan rengi.", + "widgetShadow": "Bul/değiştir gibi düzenleyici içindeki araçların gölge rengi.", + "inputBoxBackground": "Giriş kutusu arka planı.", + "inputBoxForeground": "Giriş kutusu ön planı.", + "inputBoxBorder": "Giriş kutusu kenarlığı.", + "inputBoxActiveOptionBorder": "Girdi alanlarındaki aktif seçeneklerin kenarlık rengi.", + "inputPlaceholderForeground": "Yer tutucu metin için girdi kutusu ön plan rengi.", + "inputValidationInfoBackground": "Bilgi önem derecesi için girdi doğrulama arka plan rengi.", + "inputValidationInfoBorder": "Bilgi önem derecesi için girdi doğrulama kenarlık rengi.", + "inputValidationWarningBackground": "Bilgi uyarısı için girdi doğrulama arka plan rengi.", + "inputValidationWarningBorder": "Uyarı önem derecesi için girdi doğrulama kenarlık rengi.", + "inputValidationErrorBackground": "Hata önem derecesi için girdi doğrulama arka plan rengi.", + "inputValidationErrorBorder": "Hata önem derecesi için girdi doğrulama kenarlık rengi.", + "dropdownBackground": "Açılır kutu arka planı.", + "dropdownForeground": "Açılır kutu ön planı.", + "dropdownBorder": "Açılır kutu kenarlığı.", + "listFocusBackground": "Liste/Ağaç aktifken odaklanılan ögenin Lise/Ağaç arka plan rengi. Bir aktif liste/ağaç, klavye odağındadır; pasif olan odakta değildir.", + "listFocusForeground": "Liste/Ağaç aktifken odaklanılan ögenin Lise/Ağaç ön plan rengi. Bir aktif liste/ağaç, klavye odağındadır; pasif olan odakta değildir.", + "listActiveSelectionBackground": "Liste/Ağaç aktifken seçilen ögenin Lise/Ağaç arka plan rengi. Bir aktif liste/ağaç, klavye odağındadır; pasif olan odakta değildir.", + "listActiveSelectionForeground": "Liste/Ağaç aktifken seçilen ögenin Lise/Ağaç ön plan rengi. Bir aktif liste/ağaç, klavye odağındadır; pasif olan odakta değildir.", + "listInactiveSelectionBackground": "Liste/Ağaç pasifken seçilen ögenin Lise/Ağaç arka plan rengi. Bir aktif liste/ağaç, klavye odağındadır; pasif olan odakta değildir.", + "listInactiveSelectionForeground": "Liste/Ağaç pasifken seçilen ögenin Lise/Ağaç ön plan rengi. Bir aktif liste/ağaç, klavye odağındadır; pasif olan odakta değildir.", + "listHoverBackground": "Fare ile ögelerin üzerine gelindiğinde Liste/Ağaç arka planı.", + "listHoverForeground": "Fare ile ögelerin üzerine gelindiğinde Liste/Ağaç ön planı.", + "listDropBackground": "Fare ile ögeler taşınırken Liste/Ağaç sürükle ve bırak arka planı.", + "highlight": "Liste/Ağaç içinde arama yaparken eşleşme vurgularının Liste/Ağaç ön plan rengi.", + "pickerGroupForeground": "Gruplama etiketleri için hızlı seçici rengi.", + "pickerGroupBorder": "Gruplama kenarlıkları için hızlı seçici rengi.", + "buttonForeground": "Buton ön plan rengi.", + "buttonBackground": "Buton arka plan rengi.", + "buttonHoverBackground": "Fareyle üzerine gelindiğinde buton arka plan rengi.", + "badgeBackground": "Gösterge arka plan rengi. Göstergeler küçük bilgi etiketleridir, ör. arama sonucu sayısı için.", + "badgeForeground": "Gösterge ön plan rengi. Göstergeler küçük bilgi etiketleridir, ör. arama sonucu sayısı için.", + "scrollbarShadow": "Görünümün kaydırıldığını belirtmek için kaydırma çubuğu gölgesi.", + "scrollbarSliderBackground": "Kaydıraç arka plan rengi.", + "scrollbarSliderHoverBackground": "Fareyle üzerine gelindiğinde kaydıraç arka plan rengi.", + "scrollbarSliderActiveBackground": "Aktif kaydıraç arka plan rengi.", + "progressBarBackground": "Uzun süren işlemleri gösterebilen ilerleme çubuğunun arka plan rengi.", + "editorBackground": "Düzenleyici arka plan rengi.", + "editorForeground": "Düzenleyici varsayılan ön plan rengi.", + "editorWidgetBackground": "Bul/değiştir gibi düzenleyici araçlarının arka plan rengi.", + "editorWidgetBorder": "Editör araçlarının kenarlık rengi. Renk, araç bir kenarlığı olmasına karar verdiğinde ve renk hiçbir eklenti tarafından geçersiz kılınmadığında kullanılır.", + "editorSelection": "Düzenleyici seçiminin rengi.", + "editorInactiveSelection": "Bir pasif düzenleyicideki seçimin rengi.", + "editorSelectionHighlight": "Seçimle aynı içeriğe sahip bölgelerin rengi.", + "editorFindMatch": "Geçerli arama eşleşmesinin rengi.", + "findMatchHighlight": "Diğer arama eşleşmelerinin rengi.", + "findRangeHighlight": "Aramayı sınırlayan aralığı renklendirin.", + "hoverHighlight": "Bağlantı vurgusu gösterilen bir sözcüğün altını vurgulayın.", + "hoverBackground": "Düzenleyici bağlantı vurgusunun arka plan rengi.", + "hoverBorder": "Düzenleyici bağlantı vurgusunun kenarlık rengi.", + "activeLinkForeground": "Aktif bağlantıların rengi.", + "diffEditorInserted": "Eklenen metnin arka plan rengi.", + "diffEditorRemoved": "Çıkarılan metnin arka plan rengi.", + "diffEditorInsertedOutline": "Eklenen metnin ana hat rengi.", + "diffEditorRemovedOutline": "Çıkarılan metnin ana hat rengi.", + "mergeCurrentHeaderBackground": "Satır içi birleştirme çakışmalarında geçerli üstbilgi arka planı.", + "mergeCurrentContentBackground": "Satır içi birleştirme çakışmalarında geçerli içerik arka planı.", + "mergeIncomingHeaderBackground": "Satır içi birleştirme çakışmalarında gelen üstbilgi arka planı.", + "mergeIncomingContentBackground": "Satır içi birleştirme çakışmalarında gelen içerik arka planı.", + "mergeCommonHeaderBackground": "Satır içi birleştirme çakışmalarında ortak ata üstbilgisi arka planı.", + "mergeCommonContentBackground": "Satır içi birleştirme çakışmalarında ortak ata içeriği arka planı.", + "mergeBorder": "Satır içi birleştirme çakışmalarında üst bilgi ve ayırıcıdaki kenarlık rengi.", + "overviewRulerCurrentContentForeground": "Satır içi birleştirme çakışmalarında geçerli genel bakış cetveli ön planı.", + "overviewRulerIncomingContentForeground": "Satır içi birleştirme çakışmalarında gelen genel bakış cetveli ön planı.", + "overviewRulerCommonContentForeground": "Satır içi birleştirme çakışmalarında ortak ata genel bakış cetveli ön planı." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/api/electron-browser/mainThreadExtensionService.i18n.json b/i18n/trk/src/vs/workbench/api/electron-browser/mainThreadExtensionService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..0a8ef8463d3a7ca88864aef66fde9e6d516c1052 --- /dev/null +++ b/i18n/trk/src/vs/workbench/api/electron-browser/mainThreadExtensionService.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "overwritingExtension": "{0} eklentisinin üzerine {1} yazılıyor.", + "extensionUnderDevelopment": "{0} konumundaki geliştirme eklentisi yükleniyor" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/api/electron-browser/mainThreadMessageService.i18n.json b/i18n/trk/src/vs/workbench/api/electron-browser/mainThreadMessageService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..d3de90fb241d945cb2ea3c1ae369df6abf2f305b --- /dev/null +++ b/i18n/trk/src/vs/workbench/api/electron-browser/mainThreadMessageService.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "close": "Kapat", + "cancel": "İptal", + "ok": "Tamam" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/api/node/extHostDiagnostics.i18n.json b/i18n/trk/src/vs/workbench/api/node/extHostDiagnostics.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..ebbdf8fa988c44eae7604ae9c574f44edd8a64c9 --- /dev/null +++ b/i18n/trk/src/vs/workbench/api/node/extHostDiagnostics.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "limitHit": "Diğer {0} hata ve uyarılar gösterilmiyor." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/api/node/extHostTask.i18n.json b/i18n/trk/src/vs/workbench/api/node/extHostTask.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..4b90a12aaf247b4a1af0e887542958471d8df5e5 --- /dev/null +++ b/i18n/trk/src/vs/workbench/api/node/extHostTask.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "task.label": "{0}: {1}" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/api/node/extHostTreeViews.i18n.json b/i18n/trk/src/vs/workbench/api/node/extHostTreeViews.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..a3dd0ab5f9592ff9fa83f5206912fe6681d60586 --- /dev/null +++ b/i18n/trk/src/vs/workbench/api/node/extHostTreeViews.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "treeView.notRegistered": "Kayıtlı '{0}' Id'li ağaç görünümü yok.", + "treeItem.notFound": "'{0}' Id'li ağaç ögesi yok.", + "treeView.duplicateElement": "{0} ögesi zaten kayıtlı" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/browser/actions/configureLocale.i18n.json b/i18n/trk/src/vs/workbench/browser/actions/configureLocale.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..d7620dc687c54f159c648621def8f499c8704171 --- /dev/null +++ b/i18n/trk/src/vs/workbench/browser/actions/configureLocale.i18n.json @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "configureLocale": "Dili Yapılandır", + "displayLanguage": "VSCode'un görüntüleme dilini tanımlar.", + "doc": "Desteklenen dillerin listesi için göz atın: {0}", + "restart": "Değeri değiştirirseniz VSCode'u yeniden başlatmanız gerekir.", + "fail.createSettings": " '{0}' oluşturulamadı ({1}).", + "JsonSchema.locale": "Kullanılacak Kullanıcı Arayüzü Dili." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/browser/actions/fileActions.i18n.json b/i18n/trk/src/vs/workbench/browser/actions/fileActions.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..68a8df34a5b63232d37c22726f3bc2c8f5a00749 --- /dev/null +++ b/i18n/trk/src/vs/workbench/browser/actions/fileActions.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "openFolder": "Klasör Aç...", + "openFileFolder": "Aç..." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/browser/actions/toggleActivityBarVisibility.i18n.json b/i18n/trk/src/vs/workbench/browser/actions/toggleActivityBarVisibility.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..1af785233f8bda5145bb1503f194fb806b5ba99c --- /dev/null +++ b/i18n/trk/src/vs/workbench/browser/actions/toggleActivityBarVisibility.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "toggleActivityBar": "Etkinlik Çubuğunu Gizle/Göster", + "view": "Görüntüle" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/browser/actions/toggleEditorLayout.i18n.json b/i18n/trk/src/vs/workbench/browser/actions/toggleEditorLayout.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..237f4af975ca465db65310df46f57005e4e95611 --- /dev/null +++ b/i18n/trk/src/vs/workbench/browser/actions/toggleEditorLayout.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "toggleEditorGroupLayout": "Düzenleyici Grubunu Dikey/Yatay Düzende Değiştir", + "horizontalLayout": "Yatay Düzenleyici Grubu Düzeni", + "verticalLayout": "Dikey Düzenleyici Grubu Düzeni", + "view": "Görüntüle" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/browser/actions/toggleSidebarPosition.i18n.json b/i18n/trk/src/vs/workbench/browser/actions/toggleSidebarPosition.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..b5c1cbc783e3af587d183cf00c0050333183aa27 --- /dev/null +++ b/i18n/trk/src/vs/workbench/browser/actions/toggleSidebarPosition.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "toggleLocation": "Kenar Çubuğu Konumunu Değiştir", + "view": "Görüntüle" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/browser/actions/toggleSidebarVisibility.i18n.json b/i18n/trk/src/vs/workbench/browser/actions/toggleSidebarVisibility.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..714ae09d790091b211511c69fad586a9242a9725 --- /dev/null +++ b/i18n/trk/src/vs/workbench/browser/actions/toggleSidebarVisibility.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "toggleSidebar": "Kenar Çubuğunu Gizle/Göster", + "view": "Görüntüle" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/browser/actions/toggleStatusbarVisibility.i18n.json b/i18n/trk/src/vs/workbench/browser/actions/toggleStatusbarVisibility.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..8636912355aee91da29502b4f44d54b5f0d68520 --- /dev/null +++ b/i18n/trk/src/vs/workbench/browser/actions/toggleStatusbarVisibility.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "toggleStatusbar": "Durum Çubuğunu Gizle/Göster", + "view": "Görüntüle" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/browser/actions/toggleZenMode.i18n.json b/i18n/trk/src/vs/workbench/browser/actions/toggleZenMode.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..999c18e1dbdbede88dbbdbc95b064cbfe14fe27c --- /dev/null +++ b/i18n/trk/src/vs/workbench/browser/actions/toggleZenMode.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "toggleZenMode": "Zen Modunu Aç/Kapat", + "view": "Görüntüle" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/browser/parts/activitybar/activitybarActions.i18n.json b/i18n/trk/src/vs/workbench/browser/parts/activitybar/activitybarActions.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..eaa011efe7e3c8fd70277afd8d64fad636d64714 --- /dev/null +++ b/i18n/trk/src/vs/workbench/browser/parts/activitybar/activitybarActions.i18n.json @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "removeFromActivityBar": "Etkinlik Çubuğundan Kaldır", + "keepInActivityBar": "Etkinlik Çubuğunda Tut", + "titleKeybinding": "{0} ({1})", + "additionalViews": "Ek Görünümler", + "numberBadge": "{0} ({1})", + "manageExtension": "Eklentiyi Yönet", + "toggle": "Görünüm Sabitlemeyi Aç/Kapat" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/browser/parts/activitybar/activitybarPart.i18n.json b/i18n/trk/src/vs/workbench/browser/parts/activitybar/activitybarPart.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..32c2c08ce4c1f7453cc7fcf4a0b8c3fe2bb3b57d --- /dev/null +++ b/i18n/trk/src/vs/workbench/browser/parts/activitybar/activitybarPart.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "hideActivitBar": "Etkinlik Çubuğunu Gizle", + "activityBarAriaLabel": "Aktif Görünüm Değiştirici", + "globalActions": "Global Eylemler" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/browser/parts/compositePart.i18n.json b/i18n/trk/src/vs/workbench/browser/parts/compositePart.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..b9eadbfaa893fa3202c62bdd0cd429c10745546d --- /dev/null +++ b/i18n/trk/src/vs/workbench/browser/parts/compositePart.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "ariaCompositeToolbarLabel": "{0} eylem", + "titleTooltip": "{0} ({1})" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/browser/parts/editor/binaryDiffEditor.i18n.json b/i18n/trk/src/vs/workbench/browser/parts/editor/binaryDiffEditor.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..a38af02d663527576754d8164f4e2b729825137b --- /dev/null +++ b/i18n/trk/src/vs/workbench/browser/parts/editor/binaryDiffEditor.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "metadataDiff": "{0} ↔ {1}" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/browser/parts/editor/binaryEditor.i18n.json b/i18n/trk/src/vs/workbench/browser/parts/editor/binaryEditor.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..23b8e1bad3061211d5fedc929a930714d01243c6 --- /dev/null +++ b/i18n/trk/src/vs/workbench/browser/parts/editor/binaryEditor.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "binaryEditor": "İkili Görüntüleyici" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/browser/parts/editor/editor.contribution.i18n.json b/i18n/trk/src/vs/workbench/browser/parts/editor/editor.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..9059d7f92c97e93464e77c8977097b9d82536a3c --- /dev/null +++ b/i18n/trk/src/vs/workbench/browser/parts/editor/editor.contribution.i18n.json @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "textEditor": "Metin Düzenleyicisi", + "textDiffEditor": "Metin Diff Düzenleyicisi", + "binaryDiffEditor": "İkili Diff Düzenleyicisi", + "sideBySideEditor": "Yan Yana Düzenleyici", + "groupOnePicker": "İlk Gruptaki Düzenleyicileri Göster", + "groupTwoPicker": "İkinci Gruptaki Düzenleyicileri Göster", + "groupThreePicker": "Üçüncü Gruptaki Düzenleyicileri Göster", + "allEditorsPicker": "Açık Tüm Düzenleyicileri Göster", + "view": "Görüntüle" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/browser/parts/editor/editorActions.i18n.json b/i18n/trk/src/vs/workbench/browser/parts/editor/editorActions.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..01f0b8ffcc9199716a5699b9af3af6176de6f34f --- /dev/null +++ b/i18n/trk/src/vs/workbench/browser/parts/editor/editorActions.i18n.json @@ -0,0 +1,56 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "splitEditor": "Düzenleyiciyi Böl", + "joinTwoGroups": "İki Gruptaki Düzenleyicileri Birleştir", + "navigateEditorGroups": "Düzenleyici Grupları Arasında Gezin", + "focusActiveEditorGroup": "Aktif Düzenleyici Grubuna Odakla", + "focusFirstEditorGroup": "İlk Düzenleyici Grubuna Odakla", + "focusSecondEditorGroup": "İkinci Düzenleyici Grubuna Odakla", + "focusThirdEditorGroup": "Üçüncü Düzenleyici Grubuna Odakla", + "focusPreviousGroup": "Önceki Gruba Odakla", + "focusNextGroup": "Sonraki Gruba Odakla", + "openToSide": "Yana Aç", + "closeEditor": "Düzenleyiciyi Kapat", + "revertAndCloseActiveEditor": "Geri Al ve Düzenleyiciyi Kapat", + "closeEditorsToTheLeft": "Düzenleyicinin Solundakileri Kapat", + "closeEditorsToTheRight": "Düzenleyicinin Sağındakileri Kapat", + "closeAllEditors": "Tüm Düzenleyicileri Kapat", + "closeUnmodifiedEditors": "Gruptaki Değiştirilmemiş Düzenleyicileri Kapat", + "closeEditorsInOtherGroups": "Diğer Gruplardaki Tüm Düzenleyicileri Kapat", + "closeOtherEditorsInGroup": "Diğer Düzenleyicileri Kapat", + "closeEditorsInGroup": "Gruptaki Tüm Düzenleyicileri Kapat", + "moveActiveGroupLeft": "Düzenleyici Grubunu Sola Taşı", + "moveActiveGroupRight": "Düzenleyici Grubunu Sağa Taşı", + "minimizeOtherEditorGroups": "Diğer Düzenleyici Gruplarını Küçült", + "evenEditorGroups": "Düzenleyici Grup Genişliklerini Eşitle", + "maximizeEditor": "Düzenleyici Grubunu Olabildiğince Genişlet ve Kenar Çubuğunu Gizle", + "keepEditor": "Düzenleyiciyi Tut", + "openNextEditor": "Sonraki Düzenleyiciyi Aç", + "openPreviousEditor": "Önceki Düzenleyiciyi Aç", + "nextEditorInGroup": "Gruptaki Sonraki Düzenleyiciyi Aç", + "openPreviousEditorInGroup": "Gruptaki Önceki Düzenleyiciyi Aç", + "navigateNext": "İleri Git", + "navigatePrevious": "Geri Dön", + "reopenClosedEditor": "Kapatılan Düzenleyiciyi Yeniden Aç", + "clearRecentFiles": "Son Kullanılan Dosyaları Temizle", + "showEditorsInFirstGroup": "İlk Gruptaki Düzenleyicileri Göster", + "showEditorsInSecondGroup": "İkinci Gruptaki Düzenleyicileri Göster", + "showEditorsInThirdGroup": "Üçüncü Gruptaki Düzenleyicileri Göster", + "showEditorsInGroup": "Gruptaki Düzenleyicileri Göster", + "showAllEditors": "Tüm Düzenleyicileri Göster", + "openPreviousRecentlyUsedEditorInGroup": "Gruptaki Son Kullanılan Önceki Düzenleyiciyi Aç", + "openNextRecentlyUsedEditorInGroup": "Gruptaki Son Kullanılan Sonraki Düzenleyiciyi Aç", + "navigateEditorHistoryByInput": "Geçmişteki Önceki Düzenleyiciyi Aç", + "openNextRecentlyUsedEditor": "Son Kullanılan Sonraki Düzenleyiciyi Aç", + "openPreviousRecentlyUsedEditor": "Son Kullanılan Önceki Düzenleyiciyi Aç", + "clearEditorHistory": "Düzenleyici Geçmişini Temizle", + "focusLastEditorInStack": "Gruptaki Son Düzenleyiciyi Aç", + "moveEditorLeft": "Düzenleyiciyi Sola Taşı", + "moveEditorRight": "Düzenleyiciyi Sağa Taşı", + "moveEditorToPreviousGroup": "Düzenleyiciyi Önceki Gruba Taşı", + "moveEditorToNextGroup": "Düzenleyiciyi Sonraki Gruba Taşı" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/browser/parts/editor/editorCommands.i18n.json b/i18n/trk/src/vs/workbench/browser/parts/editor/editorCommands.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..ec6a3cb04f0fb811d0574ae8e666a535efff7f11 --- /dev/null +++ b/i18n/trk/src/vs/workbench/browser/parts/editor/editorCommands.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "editorCommand.activeEditorMove.description": "Aktif düzenleyiciyi sekmeler veya gruplar halinde taşıyın", + "editorCommand.activeEditorMove.arg.name": "Aktif düzenleyici taşıma argümanı", + "editorCommand.activeEditorMove.arg.description": "Argüman Özellikleri:\n\t\t\t\t\t\t* 'to': Nereye taşınacağını belirten dize değeri.\n\t\t\t\t\t\t* 'by': Kaç birim taşınacağını belirten dize değeri. Sekme veya grup olarak.\n\t\t\t\t\t\t* 'value': Kaç tane pozisyonun taşınacağını belirten sayı değeri.\n\t\t\t\t\t", + "commandDeprecated": "**{0}** komutu kaldırıldı. Onun yerine **{1}** komutunu kullanabilirsiniz", + "openKeybindings": "Klavye Kısayollarını Yapılandır" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/browser/parts/editor/editorPart.i18n.json b/i18n/trk/src/vs/workbench/browser/parts/editor/editorPart.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..11fc7d299418227648a91b703429038705b4090d --- /dev/null +++ b/i18n/trk/src/vs/workbench/browser/parts/editor/editorPart.i18n.json @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "groupOneVertical": "Sol", + "groupTwoVertical": "Orta", + "groupThreeVertical": "Sağ", + "groupOneHorizontal": "En Üst", + "groupTwoHorizontal": "Orta", + "groupThreeHorizontal": "En Alt", + "editorOpenError": "'{0}' açılamadı: {1}." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/browser/parts/editor/editorPicker.i18n.json b/i18n/trk/src/vs/workbench/browser/parts/editor/editorPicker.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..3f3f3b4d53858a28105941910ae86353b2c8253c --- /dev/null +++ b/i18n/trk/src/vs/workbench/browser/parts/editor/editorPicker.i18n.json @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "entryAriaLabel": "{0}, düzenleyici grubu seçici", + "groupLabel": "Grup: {0}", + "noResultsFoundInGroup": "Grupta eşleşen açık düzenleyici bulunamadı", + "noOpenedEditors": "Gruptaki açık düzenleyiciler listesi şu an boş", + "noResultsFound": "Eşleşen açık düzenleyici bulunamadı", + "noOpenedEditorsAllGroups": "Açık düzenleyiciler listesi şu an boş" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/browser/parts/editor/editorStatus.i18n.json b/i18n/trk/src/vs/workbench/browser/parts/editor/editorStatus.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..d03a6b69b6a348d31d857bc7781ffeb8f1c671bc --- /dev/null +++ b/i18n/trk/src/vs/workbench/browser/parts/editor/editorStatus.i18n.json @@ -0,0 +1,51 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "singleSelectionRange": "Sat {0}, Süt {1} ({2} seçili)", + "singleSelection": "Sat {0}, Süt {1}", + "multiSelectionRange": "{0} seçim ({1} karakter seçildi)", + "multiSelection": "{0} seçim", + "endOfLineLineFeed": "LF", + "endOfLineCarriageReturnLineFeed": "CRLF", + "tabFocusModeEnabled": "Tab Odak Değiştirir", + "screenReaderDetected": "Ekran Okuyucu Algılandı", + "screenReaderDetectedExtra": "Bir Ekran Okuyucu kullanmıyorsanız, lütfen `editor.accessibilitySupport` ayarını \"off\" olarak değiştirin", + "disableTabMode": "Erişilebilirlik Modunu Devre Dışı Bırak", + "gotoLine": "Satıra Git", + "indentation": "Girinti", + "selectEncoding": "Kodlamayı Seç", + "selectEOL": "Satır Sonu Sıralamasını Seç", + "selectLanguageMode": "Dil Modunu Seçin", + "fileInfo": "Dosya Bilgisi", + "spacesSize": "Boşluk: {0}", + "tabSize": "Sekme Boyutu: {0}", + "showLanguageExtensions": "'{0}' için Market Eklentilerini Ara...", + "changeMode": "Dil Modunu Değiştir", + "noEditor": "Şu an aktif metin düzenleyici yok", + "languageDescription": "({0}) - Yapılandırılan Dil", + "languageDescriptionConfigured": "({0})", + "languagesPicks": "diller (tanımlayıcı)", + "configureModeSettings": "'{0}' dili tabanlı ayarları yapılandır...", + "configureAssociationsExt": "'{0}' için Dosya İlişkilendirmesini Yapılandır...", + "autoDetect": "Otomatik Algıla", + "pickLanguage": "Dil Modunu Seçin", + "currentAssociation": "Geçerli İlişkilendirme", + "pickLanguageToConfigure": " '{0}' ile İlişkilendirilecek Dil Modunu Seçin", + "changeIndentation": "Girintiyi Değiştir", + "noWritableCodeEditor": "Aktif kod düzenleyici salt okunur.", + "indentView": "görünümü değiştir", + "indentConvert": "dosyayı dönüştür", + "pickAction": "Eylem Seçin", + "changeEndOfLine": "Satır Sonu Sıralamasını Değiştir", + "pickEndOfLine": "Satır Sonu Sıralamasını Seç", + "changeEncoding": "Dosya Kodlamasını Değiştir", + "noFileEditor": "Şu an aktif dosya yok", + "saveWithEncoding": "Kodlama ile Kaydet", + "reopenWithEncoding": "Kodlama ile Yeniden Aç", + "guessedEncoding": "İçerikten tahmin edildi", + "pickEncodingForReopen": "Dosyayı Yeniden Açmak İçin Dosya Kodlaması Seçin", + "pickEncodingForSave": "Kaydedilecek Dosya Kodlamasını Seçin" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/browser/parts/editor/tabsTitleControl.i18n.json b/i18n/trk/src/vs/workbench/browser/parts/editor/tabsTitleControl.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..43199d98868ca0ec8fc1cd484285618959002535 --- /dev/null +++ b/i18n/trk/src/vs/workbench/browser/parts/editor/tabsTitleControl.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "araLabelTabActions": "Sekme eylemleri" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/browser/parts/editor/textDiffEditor.i18n.json b/i18n/trk/src/vs/workbench/browser/parts/editor/textDiffEditor.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..9fb7a026e34e17fcd958e5b7a2f1cea1d72665a1 --- /dev/null +++ b/i18n/trk/src/vs/workbench/browser/parts/editor/textDiffEditor.i18n.json @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "textDiffEditor": "Metin Diff Düzenleyicisi", + "readonlyEditorWithInputAriaLabel": "{0}. Salt okunur metin dosyası karşılaştırma düzenleyicisi.", + "readonlyEditorAriaLabel": "Salt okunur metin dosyası karşılaştırma düzenleyicisi.", + "editableEditorWithInputAriaLabel": "{0}. Metin dosyası karşılaştırma düzenleyicisi.", + "editableEditorAriaLabel": "Metin dosyası karşılaştırma düzenleyicisi.", + "navigate.next.label": "Sonraki Değişiklik", + "navigate.prev.label": "Önceki Değişiklik", + "inlineDiffLabel": "Satır İçi Görünüme Geç", + "sideBySideDiffLabel": "Yan Yana Görünüme Geç" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/browser/parts/editor/textEditor.i18n.json b/i18n/trk/src/vs/workbench/browser/parts/editor/textEditor.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..01f8e840c010e7e52132d778d98c6894bc5b29ba --- /dev/null +++ b/i18n/trk/src/vs/workbench/browser/parts/editor/textEditor.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "editorLabelWithGroup": "{0}, Grup {1}." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/browser/parts/editor/textResourceEditor.i18n.json b/i18n/trk/src/vs/workbench/browser/parts/editor/textResourceEditor.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..0b047605199189d2ca78f89053928b7432f13239 --- /dev/null +++ b/i18n/trk/src/vs/workbench/browser/parts/editor/textResourceEditor.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "textEditor": "Metin Düzenleyicisi", + "readonlyEditorWithInputAriaLabel": "{0}. Salt okunur metin düzenleyici.", + "readonlyEditorAriaLabel": "Salt okunur metin düzenleyici.", + "untitledFileEditorWithInputAriaLabel": "{0}. İsimsiz dosya metin düzenleyici.", + "untitledFileEditorAriaLabel": "İsimsiz dosya metin düzenleyici." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/browser/parts/editor/titleControl.i18n.json b/i18n/trk/src/vs/workbench/browser/parts/editor/titleControl.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..18e318decfd8835f0849fe67428da002bafb90b9 --- /dev/null +++ b/i18n/trk/src/vs/workbench/browser/parts/editor/titleControl.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "close": "Kapat", + "closeOthers": "Diğerlerini Kapat", + "closeRight": "Sağdakileri Kapat", + "closeAll": "Tümünü Kapat", + "closeAllUnmodified": "Değiştirilmeyenleri Kapat", + "keepOpen": "Açık Tut", + "showOpenedEditors": "Açık Düzenleyicileri Göster", + "araLabelEditorActions": "Düzenleyici eylemleri" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/browser/parts/panel/panelActions.i18n.json b/i18n/trk/src/vs/workbench/browser/parts/panel/panelActions.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..82be0726e3ed6ca84fdc3fd19653dcf32721853c --- /dev/null +++ b/i18n/trk/src/vs/workbench/browser/parts/panel/panelActions.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "panelActionTooltip": "{0} ({1})", + "closePanel": "Paneli Kapat", + "togglePanel": "Paneli Aç/Kapat", + "focusPanel": "Panele Odakla", + "toggleMaximizedPanel": "Panelin Ekranı Kaplamasını Aç/Kapat", + "maximizePanel": "Panel Boyutunu Olabildiğince Genişlet", + "minimizePanel": "Panel Boyutunu Geri Al", + "view": "Görüntüle" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/browser/parts/panel/panelPart.i18n.json b/i18n/trk/src/vs/workbench/browser/parts/panel/panelPart.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..de9c6eaf5865106ab1948ed5572e4f8c380eab78 --- /dev/null +++ b/i18n/trk/src/vs/workbench/browser/parts/panel/panelPart.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "panelSwitcherBarAriaLabel": "Aktif Panel Değiştirici" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/browser/parts/quickopen/quickOpenController.i18n.json b/i18n/trk/src/vs/workbench/browser/parts/quickopen/quickOpenController.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..8f88539a56e2bb4f204b5ddc33f53eee5ad2467a --- /dev/null +++ b/i18n/trk/src/vs/workbench/browser/parts/quickopen/quickOpenController.i18n.json @@ -0,0 +1,17 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "inputModeEntryDescription": "{0} (Onaylamak için 'Enter' veya iptal etmek için 'Escape' tuşuna basın)", + "inputModeEntry": "Girdinizi onaylamak için 'Enter' veya iptal etmek için 'Escape' tuşuna basın", + "emptyPicks": "Seçilecek girdi yok", + "quickOpenInput": "Buradan gerçekleştirebileceğiniz eylemler hakkında yardım almak için '?' yazın", + "historyMatches": "yakınlarda açıldı", + "noResultsFound1": "Sonuç bulunamadı", + "canNotRunPlaceholder": "Bu hızlı açma işleyicisi geçerli bağlamda kullanılamaz", + "entryAriaLabel": "{0}, yakınlarda açıldı", + "removeFromEditorHistory": "Geçmişten Kaldır", + "pickHistory": "Geçmişten kaldırmak için bir düzenleyici girdisi seçin" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/browser/parts/quickopen/quickopen.i18n.json b/i18n/trk/src/vs/workbench/browser/parts/quickopen/quickopen.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..e6b6bd07b2f784f84d1fe970a1de5ced6a63b4c9 --- /dev/null +++ b/i18n/trk/src/vs/workbench/browser/parts/quickopen/quickopen.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "quickOpen": "Dosyaya Git...", + "quickNavigateNext": "Hızlı Açta Sonrakine Git", + "quickNavigatePrevious": "Hızlı Açta Öncekine Git", + "quickSelectNext": "Hızlı Açta Sonrakini Seç", + "quickSelectPrevious": "Hızlı Açta Öncekini Seç" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/browser/parts/sidebar/sidebarPart.i18n.json b/i18n/trk/src/vs/workbench/browser/parts/sidebar/sidebarPart.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..3ad0767c12165cde1f91e6d7268facca3b0ceb7b --- /dev/null +++ b/i18n/trk/src/vs/workbench/browser/parts/sidebar/sidebarPart.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "focusSideBar": "Kenar Çubuğuna Odakla", + "viewCategory": "Görüntüle" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/browser/parts/statusbar/statusbarPart.i18n.json b/i18n/trk/src/vs/workbench/browser/parts/statusbar/statusbarPart.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..ea87cdb62294bb7485be1cd6d6c8471e50192008 --- /dev/null +++ b/i18n/trk/src/vs/workbench/browser/parts/statusbar/statusbarPart.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "canNotRun": "'{0}' komutu şu an etkin değildir ve çalıştırılamaz.", + "manageExtension": "Eklentiyi Yönet" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/browser/parts/titlebar/titlebarPart.i18n.json b/i18n/trk/src/vs/workbench/browser/parts/titlebar/titlebarPart.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..f143e04de94477b7e04d853f70671c718a770495 --- /dev/null +++ b/i18n/trk/src/vs/workbench/browser/parts/titlebar/titlebarPart.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "patchedWindowTitle": "[Desteklenmiyor]", + "devExtensionWindowTitlePrefix": "[Eklenti Geliştirme Sunucusu]" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/browser/quickopen.i18n.json b/i18n/trk/src/vs/workbench/browser/quickopen.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..a0b7b06168e6cbb740dfcd3e62a35679e188202e --- /dev/null +++ b/i18n/trk/src/vs/workbench/browser/quickopen.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "noResultsMatching": "Eşleşen sonuç yok", + "noResultsFound2": "Sonuç bulunamadı", + "entryAriaLabel": "{0}, komut" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/browser/viewlet.i18n.json b/i18n/trk/src/vs/workbench/browser/viewlet.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..0d41777aa74f79b19276f994ba47a19ea2337751 --- /dev/null +++ b/i18n/trk/src/vs/workbench/browser/viewlet.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "collapse": "Tümünü Daralt" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/common/theme.i18n.json b/i18n/trk/src/vs/workbench/common/theme.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..3c854c09486e38b1c66eefca8ff112ed1bd4e225 --- /dev/null +++ b/i18n/trk/src/vs/workbench/common/theme.i18n.json @@ -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. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "tabActiveBackground": "Aktif sekme arka plan rengi. Sekmeler, düzenleyici alanındaki düzenleyicilerin kapsayıcılarıdır. Bir düzenleyici grubunda birden fazla sekme açılabilir. Birden fazla düzenleyici grupları var olabilir.", + "tabInactiveBackground": "Pasif sekme arka plan rengi. Sekmeler, düzenleyici alanındaki düzenleyicilerin kapsayıcılarıdır. Bir düzenleyici grubunda birden fazla sekme açılabilir. Birden fazla düzenleyici grupları var olabilir.", + "tabBorder": "Sekmeleri birbirinden ayıran kenarlığın rengi. Sekmeler, düzenleyici alanındaki düzenleyicilerin kapsayıcılarıdır. Bir düzenleyici grubunda birden fazla sekme açılabilir. Birden fazla düzenleyici grupları var olabilir.", + "tabActiveForeground": "Aktif bir gruptaki aktif sekmenin ön plan rengi. Sekmeler, düzenleyici alanındaki düzenleyicilerin kapsayıcılarıdır. Bir düzenleyici grubunda birden fazla sekme açılabilir. Birden fazla düzenleyici grupları var olabilir.", + "tabInactiveForeground": "Aktif bir gruptaki pasif sekmenin ön plan rengi. Sekmeler, düzenleyici alanındaki düzenleyicilerin kapsayıcılarıdır. Bir düzenleyici grubunda birden fazla sekme açılabilir. Birden fazla düzenleyici grupları var olabilir.", + "tabUnfocusedActiveForeground": "Pasif bir gruptaki aktif sekmenin ön plan rengi. Sekmeler, düzenleyici alanındaki düzenleyicilerin kapsayıcılarıdır. Bir düzenleyici grubunda birden fazla sekme açılabilir. Birden fazla düzenleyici grupları var olabilir.", + "tabUnfocusedInactiveForeground": "Pasif bir gruptaki pasif sekmenin ön plan rengi. Sekmeler, düzenleyici alanındaki düzenleyicilerin kapsayıcılarıdır. Bir düzenleyici grubunda birden fazla sekme açılabilir. Birden fazla düzenleyici grupları var olabilir.", + "editorGroupBackground": "Bir düzenleyici grubunun arka plan rengi. Düzenleyici grupları, düzenleyicilerin kapsayıcılarıdır. Arka plan rengi, düzenleyici grubunu sürüklerken gösterilir.", + "tabsContainerBackground": "Sekmeler etkinleştirilmiş durumdayken, düzenleyici grubu başlık üstbilgisi arka plan rengi. Düzenleyici grupları, düzenleyicilerin kapsayıcılarıdır. ", + "tabsContainerBorder": "Sekmeler etkinleştirilmiş durumdayken, düzenleyici grubu başlık üstbilgisi kenarlık rengi. Düzenleyici grupları, düzenleyicilerin kapsayıcılarıdır. ", + "editorGroupHeaderBackground": "Sekmeler devre dışı iken, düzenleyici grubu başlık üstbilgisi arka plan rengi. Düzenleyici grupları, düzenleyicilerin kapsayıcılarıdır. ", + "editorGroupBorder": "Birden fazla düzenleyici grubunu birbirinden ayıracak renk. Düzenleyici grupları, düzenleyicilerin kapsayıcılarıdır. ", + "editorDragAndDropBackground": "Düzenleyici grubunu sürüklerken gösterilecek arka plan rengi. Düzenleyici içeriğinin hâlâ iyi görünmeye devam edebilmesi için renk şeffaf olmalıdır.", + "panelBackground": "Panel arka plan rengi. Paneller düzenleyici alanının altında gösterilir ve çıktı ve entegre terminal gibi görünümler içerir.", + "panelBorder": "Paneli düzenleyiciden ayıran üstteki kenarlık rengi. Paneller düzenleyici alanının altında gösterilir ve çıktı ve entegre terminal gibi görünümler içerir.", + "panelActiveTitleForeground": "Aktif panelin başlık rengi. Paneller düzenleyici alanının altında gösterilir ve çıktı ve entegre terminal gibi görünümler içerir.", + "panelInactiveTitleForeground": "Pasif panelin başlık rengi. Paneller düzenleyici alanının altında gösterilir ve çıktı ve entegre terminal gibi görünümler içerir.", + "panelActiveTitleBorder": "Aktif başlığının kenarlık rengi. Paneller düzenleyici alanının altında gösterilir ve çıktı ve entegre terminal gibi görünümler içerir.", + "statusBarForeground": "Durum çubuğu ön plan rengi. Durum çubuğu, pencerenin alt kısmında gösterilir.", + "statusBarBackground": "Standart durum çubuğu arka plan rengi. Durum çubuğu, pencerenin alt kısmında gösterilir.", + "statusBarBorder": "Durum çubuğunu kenar çubuğundan ve düzenleyiciden ayıran kenarlık rengi. Durum çubuğu, pencerenin alt kısmında gösterilir.", + "statusBarNoFolderBackground": "Hiçbir klasör açık değilken durum çubuğu arka plan rengi. Durum çubuğu, pencerenin alt kısmında gösterilir.", + "statusBarNoFolderForeground": "Hiçbir klasör açık değilken durum çubuğu ön plan rengi. Durum çubuğu, pencerenin alt kısmında gösterilir.", + "statusBarItemActiveBackground": "Durum çubuğu ögesi tıklanırken arka plan rengi. Durum çubuğu, pencerenin alt kısmında gösterilir.", + "statusBarItemHoverBackground": "Durum çubuğu ögesinin mouse ile üzerine gelindiğindeki arka plan rengi. Durum çubuğu, pencerenin alt kısmında gösterilir.", + "statusBarProminentItemBackground": "Durum çubuğu belirgin ögelerinin arka plan rengi. Belirgin ögeler, önemi belirtmek için diğer durum çubuğu girdilerinden öne çıkarılır. Durum çubuğu, pencerenin alt kısmında gösterilir.", + "statusBarProminentItemHoverBackground": "Durum çubuğu belirgin ögelerinin mouse ile üzerine gelindiğindeki arka plan rengi. Belirgin ögeler, önemi belirtmek için diğer durum çubuğu girdilerinden öne çıkarılır. Durum çubuğu, pencerenin alt kısmında gösterilir.", + "activityBarBackground": "Etkinlik çubuğu arka plan rengi. Etkinlik çubuğu, en sol veya en sağda gösterilir ve kenar çubuğunun görünümleriyle yer değiştirmeye izin verir.", + "activityBarForeground": "Etkinlik çubuğu ön plan rengi (ör. simgeler için kullanılır). Etkinlik çubuğu, en sol veya en sağda gösterilir ve kenar çubuğunun görünümleriyle yer değiştirmeye izin verir.", + "activityBarBorder": "Etkinlik çubuğunu kenar çubuğundan ayıran kenarlığın rengi. Etkinlik çubuğu, en sol veya en sağda gösterilir ve kenar çubuğunun görünümleriyle yer değiştirmeye izin verir.", + "activityBarDragAndDropBackground": "Etkinlik çubuğu ögeleri için sürükle bırak geri bildirim rengi. Etkinlik çubuğu girdilerinin hâlâ iyi görünmeye devam edebilmesi için renk şeffaf olmalıdır. Etkinlik çubuğu, en sol veya en sağda gösterilir ve kenar çubuğunun görünümleriyle yer değiştirmeye izin verir.", + "activityBarBadgeBackground": "Etkinlik çubuğu bildirim göstergesi arka plan rengi. Etkinlik çubuğu, en sol veya en sağda gösterilir ve kenar çubuğunun görünümleriyle yer değiştirmeye izin verir.", + "activityBarBadgeForeground": "Etkinlik çubuğu bildirim göstergesi ön plan rengi. Etkinlik çubuğu, en sol veya en sağda gösterilir ve kenar çubuğunun görünümleriyle yer değiştirmeye izin verir.", + "sideBarBackground": "Kenar çubuğu arka plan rengi. Kenar çubuğu, gezgin ve arama gibi görünümlerin kapsayıcısıdır.", + "sideBarForeground": "Kenar çubuğu ön plan rengi. Kenar çubuğu, gezgin ve arama gibi görünümlerin kapsayıcısıdır.", + "sideBarBorder": "Kenar çubuğunu düzenleyiciden ayıran taraftaki kenarlığın rengi. Kenar çubuğu, gezgin ve arama gibi görünümlerin kapsayıcısıdır.", + "sideBarTitleForeground": "Kenar çubuğu başlığı ön plan rengi. Kenar çubuğu, gezgin ve arama gibi görünümlerin kapsayıcısıdır.", + "sideBarSectionHeaderBackground": "Kenar çubuğu bölüm başlığı arka plan rengi. Kenar çubuğu, gezgin ve arama gibi görünümlerin kapsayıcısıdır.", + "sideBarSectionHeaderForeground": "Kenar çubuğu bölüm başlığı ön plan rengi. Kenar çubuğu, gezgin ve arama gibi görünümlerin kapsayıcısıdır.", + "titleBarActiveForeground": "Pencere aktifken başlık çubuğu ön planı. Bu rengin sadece macOS'da destekleneceğini unutmayın.", + "titleBarInactiveForeground": "Pencere pasifken başlık çubuğu ön planı. Bu rengin sadece macOS'da destekleneceğini unutmayın.", + "titleBarActiveBackground": "Pencere aktifken başlık çubuğu arka planı. Bu rengin sadece macOS'da destekleneceğini unutmayın.", + "titleBarInactiveBackground": "Pencere pasifken başlık çubuğu arka planı. Bu rengin sadece macOS'da destekleneceğini unutmayın.", + "notificationsForeground": "Bildirim ön plan rengi. Bildirimler pencerenin üst kısmından içeri girer.", + "notificationsBackground": "Bildirim arka plan rengi. Bildirimler pencerenin üst kısmından içeri girer.", + "notificationsButtonBackground": "Bildirim butonu arka plan rengi. Bildirimler pencerenin üst kısmından içeri girer.", + "notificationsButtonHoverBackground": "Fareyle üzerine gelindiğinde bildirim butonu arka plan rengi. Bildirimler pencerenin üst kısmından içeri girer.", + "notificationsButtonForeground": "Bildirim butonu ön plan rengi. Bildirimler pencerenin üst kısmından içeri girer.", + "notificationsInfoBackground": "Bildirimlerdeki bilgi arka plan rengi. Bildirimler pencerenin üst kısmından içeri girer.", + "notificationsInfoForeground": "Bildirimlerdeki bilgi ön plan rengi. Bildirimler pencerenin üst kısmından içeri girer.", + "notificationsWarningBackground": "Bildirim uyarı arka plan rengi. Bildirimler pencerenin üst kısmından içeri girer.", + "notificationsWarningForeground": "Bildirim uyarı ön plan rengi. Bildirimler pencerenin üst kısmından içeri girer.", + "notificationsErrorBackground": "Bildirim hata arka plan rengi. Bildirimler pencerenin üst kısmından içeri girer.", + "notificationsErrorForeground": "Bildirim hata ön plan rengi. Bildirimler pencerenin üst kısmından içeri girer." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/electron-browser/actions.i18n.json b/i18n/trk/src/vs/workbench/electron-browser/actions.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..f4317c69378a126da924b0423d14b245401158ef --- /dev/null +++ b/i18n/trk/src/vs/workbench/electron-browser/actions.i18n.json @@ -0,0 +1,43 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "closeActiveEditor": "Düzenleyiciyi Kapat", + "closeWindow": "Pencereyi Kapat", + "closeFolder": "Klasörü Kapat", + "noFolderOpened": "Şu an bu örnekte kapatmak için açık bir klasör bulunmuyor.", + "newWindow": "Yeni Pencere", + "toggleFullScreen": "Tam Ekranı Aç/Kapat", + "toggleMenuBar": "Menü Çubuğunu Gizle/Göster", + "toggleDevTools": "Geliştirici Araçlarını Aç/Kapat", + "zoomIn": "Yakınlaştır", + "zoomOut": "Uzaklaştır", + "zoomReset": "Yakınlaştırmayı Sıfırla", + "appPerf": "Başlangıç Performansı", + "reloadWindow": "Pencereyi Yeniden Yükle", + "switchWindowPlaceHolder": "Geçilecek pencereyi seçin", + "current": "Geçerli Pencere", + "switchWindow": "Pencere Değiştir...", + "quickSwitchWindow": "Hızlı Pencere Değiştir...", + "folders": "klasörler", + "files": "dosyalar", + "openRecentPlaceHolderMac": "Bir yol seçin (yeni pencerede açmak için Cmd tuşunu basılı tutun)", + "openRecentPlaceHolder": "Açılacak yolu seçin (yeni pencerede açmak için Ctrl tuşunu basılı tutun)", + "openRecent": "Son Kullanılanları Aç...", + "quickOpenRecent": "Son Kullanılanları Hızlı Aç...", + "closeMessages": "Bildirim İletilerini Kapat", + "reportIssues": "Sorunları Bildir", + "reportPerformanceIssue": "Performans Sorunu Bildir", + "keybindingsReference": "Klavye Kısayolları Başvurusu", + "openDocumentationUrl": "Belgeler", + "openIntroductoryVideosUrl": "Tanıtım Videoları", + "toggleSharedProcess": "Paylaşılan İşlemi Göster/Gizle", + "navigateLeft": "Soldaki Görünüme Git", + "navigateRight": "Sağdaki Görünüme Git", + "navigateUp": "Üstteki Görünüme Git", + "navigateDown": "Alttaki Görünüme Git", + "increaseViewSize": "Geçerli Görünüm Boyutunu Artır", + "decreaseViewSize": "Geçerli Görünüm Boyutunu Azalt" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/electron-browser/commands.i18n.json b/i18n/trk/src/vs/workbench/electron-browser/commands.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..3a1051dcfdad7ec7db70524f0a31f277885230df --- /dev/null +++ b/i18n/trk/src/vs/workbench/electron-browser/commands.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "diffLeftRightLabel": "{0} ⟷ {1}" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/electron-browser/extensionHost.i18n.json b/i18n/trk/src/vs/workbench/electron-browser/extensionHost.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..b13594b9af60336abde3bcb54cda97224418eed7 --- /dev/null +++ b/i18n/trk/src/vs/workbench/electron-browser/extensionHost.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "extensionHostProcess.startupFailDebug": "Eklenti sunucusu 10 saniye içinde başlamadı, ilk satırda durdurulmuş olabilir ve devam etmesi için bir hata ayıklayıcıya ihtiyacı olabilir.", + "extensionHostProcess.startupFail": "Eklenti sunucusu 10 saniye içinde başlamadı, bu bir sorun olabilir.", + "extensionHostProcess.error": "Eklenti sunucusundan hata: {0}", + "extensionHostProcess.crash": "Eklenti sunucusu beklenmeyen biçimde sonlandırıldı. Lütfen kurtarmak için pencereyi yeniden yükleyin." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/electron-browser/main.contribution.i18n.json b/i18n/trk/src/vs/workbench/electron-browser/main.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..aaf704581b119df9ec4c59dcdc943b68bfc508e4 --- /dev/null +++ b/i18n/trk/src/vs/workbench/electron-browser/main.contribution.i18n.json @@ -0,0 +1,69 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "view": "Görüntüle", + "help": "Yardım", + "file": "Dosya", + "developer": "Geliştirici", + "showEditorTabs": "Açık düzenleyicilerin sekmelerde gösterilip gösterilmeyeceğini denetler", + "editorTabCloseButton": "Düzenleyici sekmelerinin kapat butonlarının konumunu denetler veya 'off' olarak ayarlandığında devre dışı bırakır.", + "showIcons": "Açık düzenleyicilerin bir simge ile gösterilip gösterilmemelerini denetler. Bu, bir simge temasının etkinleştirilmesini de gerektirir.", + "enablePreview": "Açık düzenleyicilerin önizleme olarak gösterilip gösterilmeyeceğini denetler. Önizleme düzenleyicileri kalıcı olarak açılana kadar (ör. çift tıklama veya düzenleme ile) tekrar kullanılırlar.", + "enablePreviewFromQuickOpen": "Hızlı Aç'taki açık düzenleyicilerin önizleme olarak gösterilip gösterilmeyeceğini denetler. Önizleme düzenleyicileri kalıcı olarak açılana kadar (ör. çift tıklama veya düzenleme ile) tekrar kullanılırlar.", + "editorOpenPositioning": "Düzenleyicilerin nerede açılacağını denetler. Düzenleyicileri, geçerli olanın soluna veya sağına açmak için 'left' veya 'right' seçeneklerinden birini seçin. Düzenleyicileri, geçerli olandan bağımsız bir şekilde açmak için 'first' veya 'last' seçeneklerinden birini seçin.", + "revealIfOpen": "Düzenleyicinin görünen gruplardan herhangi birinde açıldıysa ortaya çıkarılıp çıkarılmayacağını denetler. Devre dışı bırakılırsa; bir düzenleyici, o an aktif düzenleyici grubunda açılmayı tercih edecektir. Etkinleştirilirse; o an aktif düzenleyici grubunda tekrar açılmak yerine, zaten açık olan düzenleyici ortaya çıkarılacaktır. Bu ayarın yok sayılacağı bazı durumların olduğunu unutmayın, ör. bir düzenleyiciyi, belirli bir grupta veya o an aktif grubun yanına açmaya zorladığınızda. ", + "commandHistory": "Komut paleti geçmişinde tutulacak son kullanılan komutların sayısını denetler. Komut geçmişini kapatmak için 0 olarak ayarlayın.", + "preserveInput": "Komut paletine son girilen girdinin, bir sonraki açılışta tekrar yer alıp almayacağını denetler.", + "closeOnFocusLost": "Hızlı Aç'ın odağını kaybettiğinde otomatik olarak kapanıp kapanmayacağını denetler.", + "openDefaultSettings": "Ayarları açmanın ayrıca tüm varsayılan ayarları gösteren bir düzenleyici açıp açmayacağını denetler.", + "sideBarLocation": "Kenar çubuğunun konumunu denetler. Çalışma ekranının ya solunda ya da sağında gösterilebilir.", + "statusBarVisibility": "Çalışma ekranının altındaki durum çubuğunun görünürlüğünü denetler.", + "activityBarVisibility": "Çalışma ekranındaki etkinlik çubuğunun görünürlüğünü denetler.", + "closeOnFileDelete": "Düzenleyicinin gösterdiği bir dosyanın, başka bir işlem tarafından silinmesi veya yeniden adlandırması durumunda dosyayı otomatik olarak kapatıp kapatmamasını denetler. Bunu devre dışı bırakmak, böyle bir durumda düzenleyicinin kaydedilmemiş değişiklikler içeriyor durumunda kalmasını sağlar. Uygulama içinde silmek, düzenleyiciyi her zaman kapatır ve kaydedilmemiş değişiklikler içeren dosyalar, verilerinizin korunması için otomatik olarak kapatılmaz.", + "swipeToNavigate": "Yatay olarak üç parmakla kaydırma ile açık dosyalar arasında gezinin.", + "workbenchConfigurationTitle": "Çalışma Ekranı", + "window.openFilesInNewWindow.on": "Dosyalar yeni bir pencerede açılacak", + "window.openFilesInNewWindow.off": "Dosyalar, dosyaların klasörünün olduğu pencerede veya son aktif pencerede açılacak", + "window.openFilesInNewWindow.default": "Dosyalar, Dock veya Finder ile açılmadıkça (sadece macOS için) dosyaların klasörünün olduğu pencerede veya son aktif pencerede açılacak", + "openFilesInNewWindow": "Dosyaların yeni bir pencerede açılıp açılmayacağını denetler.\n- default: dosyalar, Dock veya Finder ile açılmadıkça (sadece macOS için) dosyaların klasörünün olduğu pencerede veya son aktif pencerede açılacak\n- on: dosyalar yeni bir pencerede açılacak\n- off: dosyalar, dosyaların klasörünün olduğu pencerede veya son aktif pencerede açılacak\nBu ayarın halen yok sayılacağı durumlar olabilir (ör. -new-window veya -reuse-window komut satırı seçenekleri kullanılırken).", + "window.openFoldersInNewWindow.on": "Klasörler yeni bir pencerede açılacak", + "window.openFoldersInNewWindow.off": "Klasörler son aktif pencereyi değiştirir", + "window.openFoldersInNewWindow.default": "Klasörler, bir klasör uygulama içinden seçilmedikçe (ör. Dosya menüsünden) yeni bir pencerede açılır", + "openFoldersInNewWindow": "Klasörlerin yeni bir pencerede mi açılacağını yoksa son aktif pencereyi mi değiştireceğini denetler.\n- default: klasörler, bir klasör uygulama içinden seçilmedikçe (ör. Dosya menüsünden) yeni bir pencerede açılır\n- on: klasörler yeni bir pencerede açılır\n- off: klasörler son aktif pencereyi değiştirir\nBu ayarın halen yok sayılacağı durumlar olabilir (ör. -new-window veya -reuse-window komut satırı seçenekleri kullanılırken).", + "window.reopenFolders.all": "Tüm pencereleri yeniden aç.", + "window.reopenFolders.folders": "Tüm klasörleri yeniden aç. Boş pencereler eski haline dönmeyecektir.", + "window.reopenFolders.one": "Son aktif pencereyi yeniden aç.", + "window.reopenFolders.none": "Asla bir pencereyi yeniden açma. Her zaman boş bir pencereyle başla.", + "restoreWindows": "Pencerelerin, bir yeniden başlatma sonrası nasıl yeniden açılacağını denetler. Her zaman boş bir pencere ile başlamak için 'none', üzerinde çalıştığınız son pencereyi yeniden açmak için 'one', açık olan tüm klasörleri yeniden açmak için 'folders' veya son oturumunuzdaki tüm pencereleri yeniden açmak için 'all' seçeneğini seçin.", + "restoreFullscreen": "Bir pencere tam ekran modundayken çıkıldıysa, bu pencerenin tam ekran moduna geri dönüp dönmeyeceğini denetler.", + "zoomLevel": "Pencerenin yakınlaştırma düzeyini ayarlayın. Orijinal boyut 0'dır ve üstündeki (ör. 1) veya altındaki (ör. -1) her artırma 20% daha fazla veya az yakınlaştırmayı temsil eder. Yakınlaştırma düzeyini daha ince ayrıntılarla ayarlamak için ondalık değerler de girebilirsiniz.", + "title": "Pencere başlığını aktif düzenleyiciye bağlı olarak denetler. Değişkenler, bağlama göre değiştirilir:\n${activeEditorShort}: ör. myFile.txt\n${activeEditorMedium}: ör. myFolder/myFile.txt\n${activeEditorLong}: ör. /Users/Development/myProject/myFolder/myFile.txt\n${rootName}: ör. myProject\n${rootPath}: ör. /Users/Development/myProject\n${appName}: ör. VS Code\n${dirty}: değişiklik göstergesi, eğer aktif düzenleyici kaydedilmemiş değişiklikler içeriyorsa\n${separator}: şartlı ayırıcı (\" - \") yalnızca değer içeren değişkenlerle çevrili olduğunda gösterilir", + "window.newWindowDimensions.default": "Yeni pencereleri ekranın ortasında açın.", + "window.newWindowDimensions.inherit": "Yeni pencereleri son aktif pencere ile aynı ölçülerde açın.", + "window.newWindowDimensions.maximized": "Yeni pencereleri ekranı kapla modunda açın.", + "window.newWindowDimensions.fullscreen": "Yeni pencereleri tam ekran modunda açın.", + "newWindowDimensions": "En az bir pencere açıkken, açılacak yeni bir pencerenin boyutlarını denetler. Varsayılan olarak; yeni pencere ekranın ortasında küçük bir boyutta açılır. 'inherit' olarak ayarlandığında, pencere aktif olan son pencere ile aynı boyutları alacaktır. 'maximized' olarak ayarlandığında, ekranı kaplar biçimde açılır ve 'fullscreen' olarak yapılandırılmışsa, tam ekran olarak açılır. Bu ayarın açılan ilk pencere üzerinde bir etkisi olmadığını unutmayın. İlk pencere, daima boyutunu ve konumunu kapanmadan önce bıraktığınız şekilde geri yükler.", + "window.menuBarVisibility.default": "Menü, sadece tam ekran modunda gizlenir.", + "window.menuBarVisibility.visible": "Menü, tam ekran modunda bile daima görünür.", + "window.menuBarVisibility.toggle": "Menü gizlidir, fakat Alt tuşuyla görüntülenebilir.", + "window.menuBarVisibility.hidden": "Menü daima gizlidir.", + "menuBarVisibility": "Menü çubuğunun gizliliğini denetleyin. 'toggle' ayarı, menü çubuğu gizlidir ve Alt tuşuna bir kez basıldığında gösterilir anlamına gelir. Varsayılan olarak; menü çubuğu, pencere tam ekran değilse görünür durumdadır.", + "enableMenuBarMnemonics": "Etkinleştirilirse, ana menüler Alt tuşu kısayollarıyla açılabilir. Anımsatıcıları devre dışı bırakmak, bu Alt tuşu kısayollarının düzenleyici komutlarının yerine kullanılmasını sağlar.", + "autoDetectHighContrast": "Etkinleştirilirse; eğer Windows bir yüksek karşıtlık teması kullanıyorsa, otomatik olarak yüksek karşıtlık temasına geçiş yapılır; ve Windows, yüksek karşıtlık temasını kullanmayı bıraktığında koyu temaya geçiş yapılır.", + "titleBarStyle": "Pencere başlık çubuğunun görünümünü ayarlayın. Değişikliklerin uygulanması için tam yeniden başlatma gerekir.", + "window.nativeTabs": "macOS Sierra pencere sekmelerini etkinleştirir. Değişikliklerin uygulanması için tam yeniden başlatma gerekeceğini ve yerel sekmelerin, eğer yapılandırılmışsa özel başlık çubuğu stilini devre dışı bıracağını unutmayın.", + "windowConfigurationTitle": "Pencere", + "zenModeConfigurationTitle": "Zen Modu", + "zenMode.fullScreen": "Zen Moduna geçmenin ayrıca çalışma ekranını tam ekran moduna geçirip geçirmeyeceğini denetler.", + "zenMode.hideTabs": "Zen Moduna geçmenin ayrıca çalışma ekranı sekmelerini gizleyip gizlemeyeceğini denetler.", + "zenMode.hideStatusBar": "Zen Moduna geçmenin ayrıca çalışma ekranının altındaki durum çubuğunu gizleyip gizlemeyeceğini denetler.", + "zenMode.hideActivityBar": "Zen Moduna geçmenin ayrıca çalışma ekranının solundaki etkinlik çubuğunu gizleyip gizlemeyeceğini denetler.", + "zenMode.restore": "Bir pencere Zen modundayken çıkıldıysa, bu pencerenin Zen moduna geri dönüp dönmeyeceğini denetler.", + "workspaceConfigurationTitle": "Çalışma Alanı", + "workspaces.title": "Bu çalışma alanının klasör yapılandırması", + "files.exclude.boolean": "Dosya yollarının eşleştirileceği glob deseni. Deseni etkinleştirmek veya devre dışı bırakmak için true veya false olarak ayarlayın.", + "workspaces.additionalFolders": "Bu çalışma alanının klasörleri" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/electron-browser/main.i18n.json b/i18n/trk/src/vs/workbench/electron-browser/main.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..35eeb336c57b50e9c221529b616dce0a682cbccd --- /dev/null +++ b/i18n/trk/src/vs/workbench/electron-browser/main.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "loaderError": "Gerekli bir dosya yüklenemedi. Artık İnternet'e bağlı değilsiniz veya bağlı olduğunuz sunucu çevrimdışı. Yeniden denemek için lütfen tarayıcıyı yenileyin.", + "loaderErrorNative": "Gerekli bir dosya yüklenemedi. Yeniden denemek için lütfen uygulamayı yeniden başlatın. Ayrıntılar: {0}" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/electron-browser/shell.i18n.json b/i18n/trk/src/vs/workbench/electron-browser/shell.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..ef01873077f59eba2182f8dd476e8d476846a52a --- /dev/null +++ b/i18n/trk/src/vs/workbench/electron-browser/shell.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "runningAsRoot": "Code'u 'root' olarak çalıştırmamanız önerilir." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/electron-browser/window.i18n.json b/i18n/trk/src/vs/workbench/electron-browser/window.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..b4855a5a6d23b1be3d4b533df4df4d3fcfd503da --- /dev/null +++ b/i18n/trk/src/vs/workbench/electron-browser/window.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "undo": "Geri Al", + "redo": "Yinele", + "cut": "Kes", + "copy": "Kopyala", + "paste": "Yapıştır", + "selectAll": "Tümünü Seç", + "confirmOpen": "{0} klasörü açmak istediğinizden emin misiniz?", + "confirmOpenButton": "&&Aç" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/electron-browser/workbench.i18n.json b/i18n/trk/src/vs/workbench/electron-browser/workbench.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..d50ab8c89553230fcb9ae8455019347da5b379b0 --- /dev/null +++ b/i18n/trk/src/vs/workbench/electron-browser/workbench.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "developer": "Geliştirici", + "file": "Dosya" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/node/extensionHostMain.i18n.json b/i18n/trk/src/vs/workbench/node/extensionHostMain.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..5c33200c410bedac81a054bf28bebd9cf878b960 --- /dev/null +++ b/i18n/trk/src/vs/workbench/node/extensionHostMain.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "extensionTestError": "{0} yolu, geçerli bir eklenti test çalıştırıcısına işaret etmiyor." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/node/extensionPoints.i18n.json b/i18n/trk/src/vs/workbench/node/extensionPoints.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..17cb5965e96efc1919bf2aec4d0314624a45d87e --- /dev/null +++ b/i18n/trk/src/vs/workbench/node/extensionPoints.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "jsonParseFail": "{0} ayrıştırılamadı: {1}.", + "fileReadFail": "{0} dosyası okunamadı: {1}.", + "jsonsParseFail": "{0} veya {1} ayrıştırılamadı: {2}.", + "missingNLSKey": "{0} anahtarı için mesaj bulunamadı." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/cli/electron-browser/cli.contribution.i18n.json b/i18n/trk/src/vs/workbench/parts/cli/electron-browser/cli.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..11fb1d3f1d6a3172f7983016fa7cde1e12b410a7 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/cli/electron-browser/cli.contribution.i18n.json @@ -0,0 +1,18 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "install": "'{0}' kabuk komutunu PATH'e yükle", + "not available": "Bu komut mevcut değil", + "successIn": "'{0}' kabuk komutu PATH'e başarıyla yüklendi.", + "warnEscalation": "Code, şimdi kabuk komutunu yüklemek üzere yönetici ayrıcalıkları için 'osascript' ile izin isteyecektir.", + "ok": "Tamam", + "cantCreateBinFolder": "'/usr/local/bin' oluşturulamadı.", + "cancel2": "İptal", + "aborted": "Durduruldu", + "uninstall": "'{0}' kabuk komutunu PATH'den kaldır", + "successFrom": "'{0}' kabuk komutu PATH'den başarıyla kaldırıldı.", + "shellCommand": "Kabuk Komutu" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/codeEditor/electron-browser/accessibility.i18n.json b/i18n/trk/src/vs/workbench/parts/codeEditor/electron-browser/accessibility.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..d8f733ac179d76b1ed6811a8794548553c798fac --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/codeEditor/electron-browser/accessibility.i18n.json @@ -0,0 +1,26 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "emergencyConfOn": "Şu an `editor.accessibilitySupport` ayarı 'on' olarak değiştiriliyor.", + "openingDocs": "Şu an VS Code Erişilebilirlik döküman sayfası açılıyor.", + "introMsg": "VS Code'un erişilebilirlik seçeneklerini denediğiniz için teşekkür ederiz.", + "status": "Durum:", + "changeConfigToOnMac": "Düzenleyicinin kalıcı olarak bir Ekran Okuyucu ile kullanılmak üzere optimize edilmesini ayarlamak için Command+E tuşlarına basın.", + "changeConfigToOnWinLinux": "Düzenleyicinin kalıcı olarak bir Ekran Okuyucu ile kullanılmak üzere optimize edilmesini ayarlamak için Control+E tuşlarına basın.", + "auto_unknown": "Düzenleyici, bir Ekran Okuyucu'nun ne zaman bağlandığını algılamak için platform API'larını kullanmak üzere ayarlanmış, fakat geçerli çalışma zamanı bunu desteklemiyor.", + "auto_on": "Düzenleyici, bir Ekran Okuyucu'nun bağlandığını otomatik olarak algıladı.", + "auto_off": "Düzenleyici, bir Ekran Okuyucu'nun ne zaman bağlandığını otomatik olarak algılamak için yapılandırılmış, şu anki durum böyle değil.", + "configuredOn": "Düzenleyici kalıcı olarak bir Ekran Okuyucu ile kullanılmak üzere optimize edilmesi için yapılandırılmış - bunu, `editor.accessibilitySupport` ayarını düzenleyerek değiştirebilirsiniz.", + "configuredOff": "Düzenleyici hiçbir zaman bir Ekran Okuyucu ile kullanılmak üzere optimize edilmemesi için yapılandırılmış.", + "tabFocusModeOnMsg": "Geçerli düzenleyicide Tab tuşuna basmak odağı bir sonraki odaklanabilir ögeye kaydıracaktır. {0} tuşuna basarak bu davranışı açıp kapatın.", + "tabFocusModeOnMsgNoKb": "Geçerli düzenleyicide Tab tuşuna basmak odağı bir sonraki odaklanabilir ögeye kaydıracaktır. {0} komutu, şu an bir tuş bağı ile tetiklenemez.", + "tabFocusModeOffMsg": "Geçerli düzenleyicide Tab tuşuna basmak bir sekme karakteri ekleyecektir. {0} tuşuna basarak bu davranışı açıp kapatın.", + "tabFocusModeOffMsgNoKb": "Geçerli düzenleyicide Tab tuşuna basmak bir sekme karakteri ekleyecektir. {0} komutu, şu an bir tuş bağı ile tetiklenemez.", + "openDocMac": "Erişilebilirlik ile ilgili daha fazla VS Code bilgisi içeren bir tarayıcı penceresi açmak için Command+H tuşlarına basın.", + "openDocWinLinux": "Erişilebilirlik ile ilgili daha fazla VS Code bilgisi içeren bir tarayıcı penceresi açmak için Control+H tuşlarına basın.", + "outroMsg": "Escape veya Shift+Escape tuşlarına basarak bu ipucunu kapatabilir ve düzenleyiciye dönebilirsiniz.", + "ShowAccessibilityHelpAction": "Erişilebilirlik Yardımını Göster" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/codeEditor/electron-browser/inspectKeybindings.i18n.json b/i18n/trk/src/vs/workbench/parts/codeEditor/electron-browser/inspectKeybindings.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..670ac26134976b1b342c13bd3b9b600b2e9338c1 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/codeEditor/electron-browser/inspectKeybindings.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "workbench.action.inspectKeyMap": "Geliştirici: Tuş Eşlemelerini Denetle" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/codeEditor/electron-browser/inspectTMScopes.i18n.json b/i18n/trk/src/vs/workbench/parts/codeEditor/electron-browser/inspectTMScopes.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..8b6ad71cd4e6db3e42f55c9009b9ddb081a5af8a --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/codeEditor/electron-browser/inspectTMScopes.i18n.json @@ -0,0 +1,6 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/codeEditor/electron-browser/toggleMultiCursorModifier.i18n.json b/i18n/trk/src/vs/workbench/parts/codeEditor/electron-browser/toggleMultiCursorModifier.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..e65b16db179e7720f7417dc6a10fa799e85c0dd2 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/codeEditor/electron-browser/toggleMultiCursorModifier.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "toggleLocation": "Çoklu İmleç Değiştiricisini Aç/Kapat" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/codeEditor/electron-browser/toggleRenderControlCharacter.i18n.json b/i18n/trk/src/vs/workbench/parts/codeEditor/electron-browser/toggleRenderControlCharacter.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..5c757ea1565b5000a9d40c80e491306eef1d0efc --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/codeEditor/electron-browser/toggleRenderControlCharacter.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "toggleRenderControlCharacters": "Kontrol Karakterlerini Aç/Kapat" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/codeEditor/electron-browser/toggleRenderWhitespace.i18n.json b/i18n/trk/src/vs/workbench/parts/codeEditor/electron-browser/toggleRenderWhitespace.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..87c50ce448866baa44a0daf5345554a86f7ea4c5 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/codeEditor/electron-browser/toggleRenderWhitespace.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "toggleRenderWhitespace": "Boşlukları Görüntülemeyi Aç/Kapat" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/codeEditor/electron-browser/toggleWordWrap.i18n.json b/i18n/trk/src/vs/workbench/parts/codeEditor/electron-browser/toggleWordWrap.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..44a5560df38298e7844fc9663ac75225f8190805 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/codeEditor/electron-browser/toggleWordWrap.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "toggle.wordwrap": "Görünüm: Sözcük Kaydırmasını Aç/Kapat", + "wordWrap.notInDiffEditor": "Diff düzenleyicisinde sözcük kaydırma açılıp kapatılamıyor", + "unwrapMinified": "Bu dosya için sonraki satıra kaydırmayı devre dışı bırak", + "wrapMinified": "Bu dosya için sonraki satıra kaydırmayı etkinleştir" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/codeEditor/electron-browser/wordWrapMigration.i18n.json b/i18n/trk/src/vs/workbench/parts/codeEditor/electron-browser/wordWrapMigration.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..01e4868daa1a6b51c436a8f1b45475be54126b6f --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/codeEditor/electron-browser/wordWrapMigration.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "wordWrapMigration.ok": "Tamam", + "wordWrapMigration.dontShowAgain": "Tekrar gösterme", + "wordWrapMigration.openSettings": "Ayarları Aç", + "wordWrapMigration.prompt": "`editor.wrappingColumn` ayarı, `editor.wordWrap` yüzünden kullanım dışıdır." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/debug/browser/breakpointWidget.i18n.json b/i18n/trk/src/vs/workbench/parts/debug/browser/breakpointWidget.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..a6f34090c4d7da1b210d89f47672034fa3744968 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/debug/browser/breakpointWidget.i18n.json @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "breakpointWidgetExpressionPlaceholder": "İfade değerlendirmesi doğru olduğunda mola ver. Kabul etmek için 'Enter', iptal etmek için 'Esc' tuşuna basın.", + "breakpointWidgetAriaLabel": "Program, burada sadece bu koşul doğruysa durur. Kabul etmek için Enter veya iptal etmek için Escape tuşuna basın. ", + "breakpointWidgetHitCountPlaceholder": "İsabet sayısı koşulu sağlandığında mola ver. Kabul etmek için 'Enter', iptal etmek için 'Esc' tuşuna basın.", + "breakpointWidgetHitCountAriaLabel": "Program, burada sadece isabet sayısı koşulu sağlandığında durur. Kabul etmek için Enter veya iptal etmek için Escape tuşuna basın. ", + "expression": "İfade", + "hitCount": "İsabet Sayısı" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/debug/browser/debugActionItems.i18n.json b/i18n/trk/src/vs/workbench/parts/debug/browser/debugActionItems.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..8a17f02344dcb887ede397f3f35c2602075348b7 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/debug/browser/debugActionItems.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "addConfiguration": "Yapılandırma Ekle...", + "noConfigurations": "Yapılandırma Yok" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/debug/browser/debugActions.i18n.json b/i18n/trk/src/vs/workbench/parts/debug/browser/debugActions.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..3f796ff047d315693db0630e5cb4e2cb238bc223 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/debug/browser/debugActions.i18n.json @@ -0,0 +1,49 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "openLaunchJson": "{0} Dosyasını Aç", + "launchJsonNeedsConfigurtion": "'launch.json'u Yapılandır veya Düzelt", + "noFolderDebugConfig": "Gelişmiş hata ayıklama yapılandırması yapmak için lütfen ilk olarak bir klasör açın.", + "startDebug": "Hata Ayıklamaya Başla", + "startWithoutDebugging": "Hata Ayıklama Olmadan Başlat", + "selectAndStartDebugging": "Seç ve Hata Ayıklamaya Başla", + "restartDebug": "Yeniden Başlat", + "reconnectDebug": "Yeniden Bağlan", + "stepOverDebug": "Adım At", + "stepIntoDebug": "İçine Adımla", + "stepOutDebug": "Dışına Adımla", + "stopDebug": "Durdur", + "disconnectDebug": "Bağlantıyı Kes", + "continueDebug": "Devam Et", + "pauseDebug": "Duraklat", + "restartFrame": "Çerçeveyi Yeniden Başlat", + "removeBreakpoint": "Kesme Noktasını Kaldır", + "removeAllBreakpoints": "Tüm Kesme Noktalarını Kaldır", + "enableBreakpoint": "Kesme Noktasını Etkinleştir", + "disableBreakpoint": "Kesme Noktasını Devre Dışı Bırak", + "enableAllBreakpoints": "Tüm Kesme Noktalarını Etkinleştir", + "disableAllBreakpoints": "Tüm Kesme Noktalarını Devre Dışı Bırak", + "activateBreakpoints": "Kesme Noktalarını Etkinleştir", + "deactivateBreakpoints": "Kesme Noktalarını Devre Dışı Bırak", + "reapplyAllBreakpoints": "Tüm Kesme Noktalarını Yeniden Uygula", + "addFunctionBreakpoint": "Fonksiyon Kesme Noktası Ekle", + "renameFunctionBreakpoint": "Fonksiyon Kesme Noktasını Kaldır", + "addConditionalBreakpoint": "Koşullu Kesme Noktası Ekle...", + "editConditionalBreakpoint": "Kesme Noktasını Düzenle...", + "setValue": "Değeri Ayarla", + "addWatchExpression": "İfade Ekle", + "editWatchExpression": "İfadeyi Düzenle", + "addToWatchExpressions": "İzlemeye Ekle", + "removeWatchExpression": "İfadeyi Kaldır", + "removeAllWatchExpressions": "Tüm İfadeleri Kaldır", + "clearRepl": "Konsolu Temizle", + "debugConsoleAction": "Hata Ayıklama Konsolu", + "unreadOutput": "Hata Ayıklama Konsolunda Yeni Çıktı", + "debugFocusConsole": "Hata Ayıklama Konsoluna Odakla", + "focusProcess": "İşleme Odakla", + "stepBackDebug": "Geri Adım At", + "reverseContinue": "Tersine Çevir" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/debug/browser/debugActionsWidget.i18n.json b/i18n/trk/src/vs/workbench/parts/debug/browser/debugActionsWidget.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..a9c04322e91bff4f07038842431b6a09befce267 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/debug/browser/debugActionsWidget.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "debugToolBarBackground": "Hata ayıklama araç çubuğu arka plan rengi." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/debug/browser/debugContentProvider.i18n.json b/i18n/trk/src/vs/workbench/parts/debug/browser/debugContentProvider.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..647215e664e9a66fc6bed6022e88970604ca28ea --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/debug/browser/debugContentProvider.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "unable": "Hata ayıklama oturumu olmadan kaynak çözümlenemiyor" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/debug/browser/debugEditorActions.i18n.json b/i18n/trk/src/vs/workbench/parts/debug/browser/debugEditorActions.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..a5745c5e39e40a0d1172fa83f0b0e718f4ae123f --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/debug/browser/debugEditorActions.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "toggleBreakpointAction": "Hata Ayıklama: Kesme Noktası Ekle/Kaldır", + "columnBreakpointAction": "Hata Ayıklama: Sütun Kesme Noktası", + "columnBreakpoint": "Sütun Kesme Noktası Ekle", + "conditionalBreakpointEditorAction": "Hata Ayıklama: Koşullu Kesme Noktası Ekle...", + "runToCursor": "İmlece Kadar Çalıştır", + "debugEvaluate": "Hata Ayıklama: Değerlendir", + "debugAddToWatch": "Hata Ayıklama: İzlemeye Ekle", + "showDebugHover": "Hata Ayıklama: Bağlantı Vurgusunu Göster" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/debug/browser/debugEditorModelManager.i18n.json b/i18n/trk/src/vs/workbench/parts/debug/browser/debugEditorModelManager.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..a9c0632215108fad852c3e66ce13b00996e72bb2 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/debug/browser/debugEditorModelManager.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "breakpointDisabledHover": "Devre Dışı Bırakılmış Kesme Noktası", + "breakpointUnverifieddHover": "Doğrulanmamış Kesme Noktası", + "breakpointDirtydHover": "Doğrulanmamış Kesme Noktası Dosya düzenlendi, lütfen hata ayıklama oturumunu yeniden başlatın.", + "breakpointUnsupported": "Koşullu kesme noktaları bu hata ayıklama türü tarafından desteklenmiyor" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/debug/browser/debugQuickOpen.i18n.json b/i18n/trk/src/vs/workbench/parts/debug/browser/debugQuickOpen.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..6a22d71e97db66e29376779ffd83b342906844f6 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/debug/browser/debugQuickOpen.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "entryAriaLabel": "{0}, hata ayıklama", + "debugAriaLabel": "Çalıştırılacak bir başlatma yapılandırması adı girin.", + "noConfigurationsMatching": "Eşleyen hata ayıklama yapılandırması yok", + "noConfigurationsFound": "Hiçbir hata ayıklama yapılandırması bulunamadı. Lütfen bir 'launch.json' dosyası oluşturun." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/debug/browser/exceptionWidget.i18n.json b/i18n/trk/src/vs/workbench/parts/debug/browser/exceptionWidget.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..3f777293285894fae9c3b18d681f339ec9396cca --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/debug/browser/exceptionWidget.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "debugExceptionWidgetBorder": "İstisna aracı kenarlık rengi.", + "debugExceptionWidgetBackground": "İstisna aracı arka plan rengi.", + "exceptionThrownWithId": "İstisna oluştu: {0}", + "exceptionThrown": "İstisna oluştu." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/debug/browser/linkDetector.i18n.json b/i18n/trk/src/vs/workbench/parts/debug/browser/linkDetector.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..a5db6507a72530805ee79c7bad0e9ac84112bf8e --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/debug/browser/linkDetector.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "fileLinkMac": "Takip etmek için tıklayın (Cmd + tıklama yana açar)", + "fileLink": "Takip etmek için tıklayın (Ctrl + tıklama yana açar)" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/debug/common/debug.i18n.json b/i18n/trk/src/vs/workbench/parts/debug/common/debug.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..52e048c8832dbf10cfe9eb131b47c0bfac64ff63 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/debug/common/debug.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "internalConsoleOptions": "Dahili hata ayıklama konsolunun davranışlarını denetler." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/debug/common/debugModel.i18n.json b/i18n/trk/src/vs/workbench/parts/debug/common/debugModel.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..67633f8688f2a87728442930aea77c607c2d00f0 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/debug/common/debugModel.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "notAvailable": "mevcut değil", + "startDebugFirst": "Lütfen değerlendirilecek bir hata ayıklama oturumu başlatın" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/debug/common/debugSource.i18n.json b/i18n/trk/src/vs/workbench/parts/debug/common/debugSource.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..6d75e323512245c7719a5bdd30fa38750f3ee09c --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/debug/common/debugSource.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "unknownSource": "Bilinmeyen Kaynak" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/debug/electron-browser/debug.contribution.i18n.json b/i18n/trk/src/vs/workbench/parts/debug/electron-browser/debug.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..14c96d48f155a37d64e617020958021738b8be40 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/debug/electron-browser/debug.contribution.i18n.json @@ -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. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "toggleDebugViewlet": "Hata Ayıklamayı Göster", + "toggleDebugPanel": "Hata Ayıklama Konsolu", + "debug": "Hata Ayıklama", + "debugPanel": "Hata Ayıklama Konsolu", + "view": "Görüntüle", + "debugCategory": "Hata Ayıklama", + "debugCommands": "Hata Ayıklama Yapılandırması", + "debugConfigurationTitle": "Hata Ayıklama", + "allowBreakpointsEverywhere": "Herhangi bir dosyada kesme noktası ayarlamaya izin verir", + "openExplorerOnEnd": "Bir hata ayıklama oturumunun sonunda otomatik olarak gezgin görünümünü açın", + "inlineValues": "Hata ayıklama sırasında değişken değerlerini düzenleyicide satır içinde göster", + "hideActionBar": "Dolaştırılabilir hata ayıklama eylem çubuğunun gizlenip gizlenmeyeceğini denetler", + "launch": "Global hata ayıklama başlatma yapılandırması. Çalışma alanlarında paylaşılan 'launch.json'a alternatif olarak kullanılmalıdır" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/debug/electron-browser/debugCommands.i18n.json b/i18n/trk/src/vs/workbench/parts/debug/electron-browser/debugCommands.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..614f97b48db79e42f01e9e6fab8b601845166c8e --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/debug/electron-browser/debugCommands.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "noFolderDebugConfig": "Gelişmiş hata ayıklama yapılandırması yapmak için lütfen ilk olarak bir klasör açın." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/debug/electron-browser/debugConfigurationManager.i18n.json b/i18n/trk/src/vs/workbench/parts/debug/electron-browser/debugConfigurationManager.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..594cc3a08e1c9bb50d10d930308430af41d837f5 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/debug/electron-browser/debugConfigurationManager.i18n.json @@ -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. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "vscode.extension.contributes.debuggers": "Hata ayıklama bağdaştırıcılarına ekleme yapar.", + "vscode.extension.contributes.debuggers.type": "Bu hata ayıklama bağdaştırıcısnın benzersiz tanımlayıcısı.", + "vscode.extension.contributes.debuggers.label": "Bu hata ayıklama bağdaştırıcısnın görünen adı.", + "vscode.extension.contributes.debuggers.program": "Hata ayıklama bağdaştırıcı programının yolu. Yol, ya mutlak ya da eklenti klasörüne görelidir.", + "vscode.extension.contributes.debuggers.args": "Bağdaştırıcıya iletilecek ek argümanlar.", + "vscode.extension.contributes.debuggers.runtime": "Program özniteliğinin yürütülebilir olmadığı halde bir çalışma zamanını gerektirmesi durumu için isteğe bağlı çalışma zamanı.", + "vscode.extension.contributes.debuggers.runtimeArgs": "İsteğe bağlı çalışma zamanı argümanları.", + "vscode.extension.contributes.debuggers.variables": "`launch.json` dosyasındaki interaktif değişkenlerin (ör. ${action.pickProcess}) bir komuta eşlenmesi.", + "vscode.extension.contributes.debuggers.initialConfigurations": "İlk 'launch.json' dosyasının üretimi için yapılandırmalar.", + "vscode.extension.contributes.debuggers.languages": "Hata ayıklama eklentisinin, \"varsayılan hata ayıklayıcı\" olarak değerlendirilebileceği diller listesi.", + "vscode.extension.contributes.debuggers.adapterExecutableCommand": "Belirtilirse; VS Code, hata ayıklama bağdaştırıcısı yürütülebilir dosyasının yolunu ve ona gönderilecek argümanları belirlemek için bu komutu çağırır.", + "vscode.extension.contributes.debuggers.startSessionCommand": "Belirtilirse; VS Code, bu eklenti için hedeflenen \"hata ayıklama\" ve \"çalıştır\" eylemleri için bu komutu çağırır.", + "vscode.extension.contributes.debuggers.configurationSnippets": "'launch.json' dosyasına yeni yapılandırmalar ekleme parçacıkları.", + "vscode.extension.contributes.debuggers.configurationAttributes": "'launch.json' dosyasını doğrulayacak JSON şema yapılandırmaları.", + "vscode.extension.contributes.debuggers.windows": "Windows'a özel ayarlar.", + "vscode.extension.contributes.debuggers.windows.runtime": "Windows'da kullanılacak çalışma zamanı.", + "vscode.extension.contributes.debuggers.osx": "OS X'e özel ayarlar.", + "vscode.extension.contributes.debuggers.osx.runtime": "OS X'de kullanılacak çalışma zamanı.", + "vscode.extension.contributes.debuggers.linux": "Linux'a özel ayarlar.", + "vscode.extension.contributes.debuggers.linux.runtime": "Linux'da kullanılacak çalışma zamanı.", + "vscode.extension.contributes.breakpoints": "Kesme noktalarına ekleme yapar.", + "vscode.extension.contributes.breakpoints.language": "Bu dil için kesme noktalarını etkinleştir.", + "app.launch.json.title": "Başlat", + "app.launch.json.version": "Bu dosya biçiminin sürümü.", + "app.launch.json.configurations": "Yapılandırma listesi. IntelliSense kullanarak yeni yapılandırmalar ekleyin veya mevcut olanları düzenleyin.", + "app.launch.json.compounds": "Bileşikler listesi. Her bileşik, birlikte çalıştırılacak birden çok yapılandırmaya başvurur.", + "app.launch.json.compound.name": "Bileşiğin adı. Başlatma yapılandırması açılır kutu menüsünde görünür.", + "app.launch.json.compounds.configurations": "Bu bileşiğin parçası olarak başlatılacak yapılandırmaların adları.", + "debugNoType": "Hata ayıklama bağdaştırıcısının 'type' ögesi atlanabilir veya 'dize' türünde olmalıdır.", + "DebugConfig.failed": " '.vscode' klasörü içinde 'launch.json' dosyası oluşturulamıyor ({0}).", + "selectDebug": "Ortam Seçin" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/debug/electron-browser/debugEditorContribution.i18n.json b/i18n/trk/src/vs/workbench/parts/debug/electron-browser/debugEditorContribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..dd1bf89582dc28ac3a25ce62533bcb992534221d --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/debug/electron-browser/debugEditorContribution.i18n.json @@ -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. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "removeBreakpoints": "Kesme Noktalarını Kaldır", + "removeBreakpointOnColumn": "{0}. Sütundaki Kesme Noktasını Kaldır", + "removeLineBreakpoint": "Satır Kesme Noktasını Kaldır", + "editBreakpoints": "Kesme Noktalarını Düzenle", + "editBreakpointOnColumn": "{0}. Sütundaki Kesme Noktasını Düzenle", + "editLineBrekapoint": "Satır Kesme Noktasını Düzenle", + "enableDisableBreakpoints": "Kesme Noktalarını Etkinleştir/Devre Dışı Bırak", + "disableColumnBreakpoint": "{0}. Sütundaki Kesme Noktasını Devre Dışı Bırak", + "disableBreakpointOnLine": "Satır Kesme Noktasını Devre Dışı Bırak", + "enableBreakpoints": "{0}. Sütundaki Kesme Noktasını Etkinleştir", + "enableBreakpointOnLine": "Satır Kesme Noktasını Etkinleştir", + "addBreakpoint": "Kesme Noktası Ekle", + "addConfiguration": "Yapılandırma Ekle..." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/debug/electron-browser/debugHover.i18n.json b/i18n/trk/src/vs/workbench/parts/debug/electron-browser/debugHover.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..f805425af1401ccb2bd9cd084602be2531ffc6b8 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/debug/electron-browser/debugHover.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "treeAriaLabel": "Hata Ayıklama Bağlantı Vurgusu" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/debug/electron-browser/debugService.i18n.json b/i18n/trk/src/vs/workbench/parts/debug/electron-browser/debugService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..d90aab83c4cf09456f395d574ffdcc86fcc46210 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/debug/electron-browser/debugService.i18n.json @@ -0,0 +1,25 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "snapshotObj": "Bu nesne için sadece ilkel türler gösterilir.", + "debuggingPaused": "Hata ayıklama duraklatıldı, sebep {0}, {1} {2}", + "debuggingStarted": "Hata ayıklama başlatıldı.", + "debuggingStopped": "Hata ayıklama durduruldu.", + "breakpointAdded": "Kesme noktası eklendi, {0}. satır, {1} dosyası", + "breakpointRemoved": "Kesme noktası kaldırıldı, {0}. satır, {1} dosyası", + "compoundMustHaveConfigurations": "Bileşik, birden çok yapılandırmayı başlatmak için \"configurations\" özniteliği bulundurmalıdır.", + "configMissing": "'launch.json' dosyasında '{0}' yapılandırması eksik.", + "debugTypeNotSupported": "Yapılandırılan hata ayıklama türü '{0}', desteklenmiyor.", + "debugTypeMissing": "Seçilen başlatma yapılandırması için 'type' özelliği eksik.", + "preLaunchTaskErrors": "'{0}' ön başlatma görevi sırasında derleme hataları algılandı.", + "preLaunchTaskError": "'{0}' ön başlatma görevi sırasında derleme hatası algılandı.", + "preLaunchTaskExitCode": "'{0}' ön başlatma görevi {1} çıkış koduyla sonlandı.", + "debugAnyway": "Yine de Hata Ayıkla", + "noFolderWorkspaceDebugError": "Aktif dosyada hata ayıklama yapılamıyor. Lütfen, dosyanın diskte kayıtlı olduğundan ve bu dosya türü için hata ayıklama eklentinizin olduğundan emin olun.", + "NewLaunchConfig": "Lütfen uygulamanızın başlatma yapılandırması dosyasını ayarlayın. {0}", + "DebugTaskNotFound": "'{0}' ön başlatma görevi bulunamadı.", + "differentTaskRunning": "Çalışan bir {0} görevi var. Ön başlatma görevi {1} çalıştırılamıyor." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/debug/electron-browser/debugViewer.i18n.json b/i18n/trk/src/vs/workbench/parts/debug/electron-browser/debugViewer.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..823377981dd9638de3032185287270df5ac42273 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/debug/electron-browser/debugViewer.i18n.json @@ -0,0 +1,28 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "process": "İşlem", + "paused": "Duraklatıldı", + "running": "Çalışıyor", + "thread": "İş Parçacığı", + "pausedOn": "{0} Üzerinde Duraklatıldı", + "loadMoreStackFrames": "Daha Fazla Yığın Çerçevesi Yükleyin", + "threadAriaLabel": "{0} iş parçacığı, çağrı yığını, hata ayıklama", + "stackFrameAriaLabel": "Yığın Çerçevesi {0} satır {1} {2}, çağrı yığını, hata ayıklama", + "variableValueAriaLabel": "Yeni değişken adını girin", + "variableScopeAriaLabel": "{0} kapsamı, değişkenler, hata ayıklama", + "variableAriaLabel": "{0} değeri {1}, değişkenler, hata ayıklama", + "watchExpressionPlaceholder": "İzlenecek ifade", + "watchExpressionInputAriaLabel": "İzleme ifadesi girin", + "watchExpressionAriaLabel": "{0} değeri {1}, izleme, hata ayıklama", + "watchVariableAriaLabel": "{0} değeri {1}, izleme, hata ayıklama", + "functionBreakpointPlaceholder": "Mola verilecek fonksiyon", + "functionBreakPointInputAriaLabel": "Fonksiyon kesme noktasını girin", + "functionBreakpointsNotSupported": "Fonksiyon kesme noktaları bu hata ayıklama türü tarafından desteklenmiyor", + "breakpointAriaLabel": "Kesme noktası satır {0} {1}, kesme noktaları, hata ayıklama", + "functionBreakpointAriaLabel": "Fonksiyon kesme noktası {0}, kesme noktaları, hata ayıklama", + "exceptionBreakpointAriaLabel": "İstisna kesme noktası {0}, kesme noktaları, hata ayıklama" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/debug/electron-browser/debugViews.i18n.json b/i18n/trk/src/vs/workbench/parts/debug/electron-browser/debugViews.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..8a92525c7f53a0553250eea169e19d8775c0b66f --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/debug/electron-browser/debugViews.i18n.json @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "variablesSection": "Değişkenler Bölümü", + "variablesAriaTreeLabel": "Hata Ayıklama Değişkenleri", + "expressionsSection": "İfadeler Bölümü", + "watchAriaTreeLabel": "Hata Ayıklama İzleme İfadeleri", + "callstackSection": "Çağrı Yığını Bölümü", + "debugStopped": "{0} Üzerinde Duraklatıldı", + "callStackAriaLabel": "Hata Ayıklama Çağrı Yığını", + "breakpointsSection": "Kesme Noktaları Bölümü", + "breakpointsAriaTreeLabel": "Hata Ayıklama Kesme Noktaları" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/debug/electron-browser/electronDebugActions.i18n.json b/i18n/trk/src/vs/workbench/parts/debug/electron-browser/electronDebugActions.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..52d6e60d75054bc34ad65dd60b57d3b4a83b6cf8 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/debug/electron-browser/electronDebugActions.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "copyValue": "Değeri Kopyala", + "copy": "Kopyala", + "copyAll": "Tümünü Kopyala", + "copyStackTrace": "Çağrı Yığınını Kopyala" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/debug/electron-browser/rawDebugSession.i18n.json b/i18n/trk/src/vs/workbench/parts/debug/electron-browser/rawDebugSession.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..68bc0009a9cd5067be232d747b3fa0752d245961 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/debug/electron-browser/rawDebugSession.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "moreInfo": "Daha Fazla Bilgi", + "unableToLaunchDebugAdapter": "'{0}' tarafından hata ayıklama bağdaştırıcısı başlatılamadı.", + "unableToLaunchDebugAdapterNoArgs": "Hata ayıklama bağdaştırıcısı başlatılamıyor.", + "stoppingDebugAdapter": "{0}. Hata ayıklama bağdaştırıcısı durduruluyor.", + "debugAdapterCrash": "Hata ayıklama bağdaştırıcısı beklenmeyen biçimde sonlandırıldı" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/debug/electron-browser/repl.i18n.json b/i18n/trk/src/vs/workbench/parts/debug/electron-browser/repl.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..f3b84b06d7c2b58e256555a3fdc773832b302dbe --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/debug/electron-browser/repl.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "replAriaLabel": "Oku Değerlendir Yaz Döngüsü Paneli", + "actions.repl.historyPrevious": "Önceki Geçmiş", + "actions.repl.historyNext": "Sonraki Geçmiş", + "actions.repl.acceptInput": "REPL Girdiyi Kabul Et", + "actions.repl.copyAll": "Hata Ayıklama: Konsol Tümünü Kopyala" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/debug/electron-browser/replViewer.i18n.json b/i18n/trk/src/vs/workbench/parts/debug/electron-browser/replViewer.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..3ee7a24156632bde72a9839ddfbb0e524d4133ce --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/debug/electron-browser/replViewer.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "stateCapture": "Nesne durumu ilk değerlendirmeden alındı", + "replVariableAriaLabel": "{0} değişkeni, {1} değerine sahip, oku değerlendir yaz döngüsü, hata ayıklama", + "replExpressionAriaLabel": "{0} ifadesi, {1} değerine sahip, oku değerlendir yaz döngüsü, hata ayıklama", + "replValueOutputAriaLabel": "{0}, oku değerlendir yaz döngüsü, hata ayıklama", + "replKeyValueOutputAriaLabel": "{0} çıktı değişkeni, {1} değerine sahip, oku değerlendir yaz döngüsü, hata ayıklama" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/debug/electron-browser/statusbarColorProvider.i18n.json b/i18n/trk/src/vs/workbench/parts/debug/electron-browser/statusbarColorProvider.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..9d6394edd4c83b9badb369108d223219d5c600c4 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/debug/electron-browser/statusbarColorProvider.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "statusBarDebuggingBackground": "Bir programda hata ayıklama yapılırken durum çubuğu arka plan rengi. Durum çubuğu, pencerenin alt kısmında gösterilir.", + "statusBarDebuggingForeground": "Bir programda hata ayıklama yapılırken durum çubuğu ön plan rengi. Durum çubuğu, pencerenin alt kısmında gösterilir." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/debug/electron-browser/terminalSupport.i18n.json b/i18n/trk/src/vs/workbench/parts/debug/electron-browser/terminalSupport.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..b5f38fd9078de00122713c91ce286b7dd093c9cd --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/debug/electron-browser/terminalSupport.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "debug.terminal.title": "hata ayıklanan", + "debug.terminal.not.available.error": "Entegre terminal mevcut değil" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json b/i18n/trk/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..6d21fb46e92fe00a8be9d373eb3179f87252aa03 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/debug/node/debugAdapter.i18n.json @@ -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. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "debugAdapterBinNotFound": "Hata ayıklama bağdaştırıcısı yürütülebilir dosyası '{0}', mevcut değil.", + "debugAdapterCannotDetermineExecutable": "Hata ayıklama bağdaştırıcısı yürütülebilir dosyası '{0}' belirlenemedi.", + "debugType": "Yapılandırma türü.", + "debugTypeNotRecognised": "Hata ayıklama türü tanınmıyor. Karşılık gelen hata ayıklama uzantısı yüklemiş olduğunuzdan ve etkinleştirildiğinden emin olun.", + "node2NotSupported": "\"node2\" artık desteklenmiyor, bunun yerine \"node\" kullanın ve \"protocol\" özniteliğini \"inspector\" olarak ayarlayın.", + "debugName": "Yapılandırmanın adı; başlatma yapılandırması açılır kutu menüsünde görünür.", + "debugRequest": "Yapılandırmanın istek türü. \"launch\" veya \"attach\" olabilir.", + "debugServer": "Sadece eklenti geliştirme hata ayıklaması için: eğer port belirtildiyse; Vs Code, bir hata ayıklama bağdaştırıcısına sunucu modunda bağlanmayı dener", + "debugPrelaunchTask": "Hata ayıklama oturumu başlamadan önce çalıştırılacak görev.", + "debugWindowsConfiguration": "Windows'a özel başlangıç yapılandırması öznitelikleri.", + "debugOSXConfiguration": "OS X'e özel başlangıç yapılandırması öznitelikleri.", + "debugLinuxConfiguration": "Linux'a özel başlangıç yapılandırması öznitelikleri.", + "deprecatedVariables": "'env.', 'config.' ve 'command.' kullanım dışıdır, bunların yerine 'env:', 'config:' ve 'command:' kulanın." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/emmet/browser/actions/showEmmetCommands.i18n.json b/i18n/trk/src/vs/workbench/parts/emmet/browser/actions/showEmmetCommands.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..7e019e4d696c1eb45d87c915f6c73fa7a82f5329 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/emmet/browser/actions/showEmmetCommands.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "showEmmetCommands": "Emmet Komutlarını Göster" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/emmet/electron-browser/actions/balance.i18n.json b/i18n/trk/src/vs/workbench/parts/emmet/electron-browser/actions/balance.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..7f2cf686977fae9642b9076c559feebc89c4c159 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/emmet/electron-browser/actions/balance.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "balanceInward": "Emmet: Dengele (içe)", + "balanceOutward": "Emmet: Dengele (dışa)" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json b/i18n/trk/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..7832e96768804b60b55fd2e6e5f8ae417280a4b4 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/emmet/electron-browser/actions/editPoints.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "previousEditPoint": "Emmet: Önceki Düzenleme Noktasına Git", + "nextEditPoint": "Emmet: Sonraki Düzenleme Noktasına Git" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/emmet/electron-browser/actions/evaluateMath.i18n.json b/i18n/trk/src/vs/workbench/parts/emmet/electron-browser/actions/evaluateMath.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..77713e86bc0f384a873901c9ae4a3b430ede1025 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/emmet/electron-browser/actions/evaluateMath.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "evaluateMathExpression": "Emmet: Matematik İfadesini Değerlendir" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/emmet/electron-browser/actions/expandAbbreviation.i18n.json b/i18n/trk/src/vs/workbench/parts/emmet/electron-browser/actions/expandAbbreviation.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..53b34ac42e8e634b93fd4c6d200675f301bebadf --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/emmet/electron-browser/actions/expandAbbreviation.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "expandAbbreviationAction": "Emmet: Kısaltmayı Genişlet" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/emmet/electron-browser/actions/incrementDecrement.i18n.json b/i18n/trk/src/vs/workbench/parts/emmet/electron-browser/actions/incrementDecrement.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..6692ba5badb5f1fc5ca0decd0a8b7d6c19e9e6cc --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/emmet/electron-browser/actions/incrementDecrement.i18n.json @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "incrementNumberByOneTenth": "Emmet: 0.1 Arttır", + "incrementNumberByOne": "Emmet: 1 Arttır", + "incrementNumberByTen": "Emmet: 10 Arttır", + "decrementNumberByOneTenth": "Emmet: 0.1 Azalt", + "decrementNumberByOne": "Emmet: 1 Azalt", + "decrementNumberByTen": "Emmet: 10 Azalt" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/emmet/electron-browser/actions/matchingPair.i18n.json b/i18n/trk/src/vs/workbench/parts/emmet/electron-browser/actions/matchingPair.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..0bae8eb938d2eb52ec29fa72fb4bf1acca5afe32 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/emmet/electron-browser/actions/matchingPair.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "matchingPair": "Emmet: Eşleşen Çifte Git" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/emmet/electron-browser/actions/mergeLines.i18n.json b/i18n/trk/src/vs/workbench/parts/emmet/electron-browser/actions/mergeLines.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..a083c13f1e58e53e1ecd5d582af6945514db4482 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/emmet/electron-browser/actions/mergeLines.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "mergeLines": "Emmet: Satırları Birleştir" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/emmet/electron-browser/actions/reflectCssValue.i18n.json b/i18n/trk/src/vs/workbench/parts/emmet/electron-browser/actions/reflectCssValue.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..8cceaedbe4bf55c04fd56a4831e1ae04b270fcfc --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/emmet/electron-browser/actions/reflectCssValue.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "reflectCSSValue": "Emmet: CSS Değerini Yansıt" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/emmet/electron-browser/actions/removeTag.i18n.json b/i18n/trk/src/vs/workbench/parts/emmet/electron-browser/actions/removeTag.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..13f4115a719a4d3ba20fc6920ef296db11203314 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/emmet/electron-browser/actions/removeTag.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "removeTag": "Emmet: Etiketi Sil" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/emmet/electron-browser/actions/selectItem.i18n.json b/i18n/trk/src/vs/workbench/parts/emmet/electron-browser/actions/selectItem.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..2507b6d025bbee8ee5862dab470d3f211016e4bc --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/emmet/electron-browser/actions/selectItem.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "selectPreviousItem": "Emmet: Önceki Ögeyi Seç", + "selectNextItem": "Emmet: Sonraki Ögeyi Seç" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/emmet/electron-browser/actions/splitJoinTag.i18n.json b/i18n/trk/src/vs/workbench/parts/emmet/electron-browser/actions/splitJoinTag.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..c64d4ead15465d5bd660f6a4fbc57eadc1bc669d --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/emmet/electron-browser/actions/splitJoinTag.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "splitJoinTag": "Emmet: Etiketi Böl/Birleştir" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/emmet/electron-browser/actions/toggleComment.i18n.json b/i18n/trk/src/vs/workbench/parts/emmet/electron-browser/actions/toggleComment.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..4f88ade10dcc859b551a9ccf9a272256cc011050 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/emmet/electron-browser/actions/toggleComment.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "toggleComment": "Emmet: Yorumu Aç/Kapat" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/emmet/electron-browser/actions/updateImageSize.i18n.json b/i18n/trk/src/vs/workbench/parts/emmet/electron-browser/actions/updateImageSize.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..862f8163fb481fc9bce4316b1b3760c0dabca579 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/emmet/electron-browser/actions/updateImageSize.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "updateImageSize": "Emmet: Görüntü Boyutunu Güncelle" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/emmet/electron-browser/actions/updateTag.i18n.json b/i18n/trk/src/vs/workbench/parts/emmet/electron-browser/actions/updateTag.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..48f159524925dd7cc5f567af6272f18ff02b9a16 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/emmet/electron-browser/actions/updateTag.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "updateTag": "Emmet: Etiketi Güncelle", + "enterTag": "Etiketi Gir", + "tag": "Etiket" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/emmet/electron-browser/actions/wrapWithAbbreviation.i18n.json b/i18n/trk/src/vs/workbench/parts/emmet/electron-browser/actions/wrapWithAbbreviation.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..678b349f5715ab35ff6bb3dbb69a0507f389f95c --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/emmet/electron-browser/actions/wrapWithAbbreviation.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "wrapWithAbbreviationAction": "Emmet: Kısaltma ile Sarmala", + "enterAbbreviation": "Kısaltmayı Gir", + "abbreviation": "Kısaltma" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json b/i18n/trk/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..bbcfad4c7f4adc4a392c8ea0ec44fa48181e6325 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.i18n.json @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "emmetConfigurationTitle": "Emmet", + "triggerExpansionOnTab": "Etkinleştirildiğinde, emmet kısaltmaları TAB tuşuna basıldığında genişletilir.", + "emmetPreferences": "Emmet'in bazı eylemleri ve çözümleyicilerinin davranışını değiştirmek için kullanılacak tercihler.", + "emmetSyntaxProfiles": "Belirtilen sentaks için profil tanımlayın veya kendi profilinizi belirli kurallarla kullanın.", + "emmetExclude": "Emmet kısaltmalarının genişletilmeyeceği bir diller dizisi.", + "emmetExtensionsPath": "Emmet profileri, parçacıkları ve tercihlerini içeren bir klasör yolu.", + "useNewEmmet": "Tüm emmet özellikleri için yeni emmet modüllerini deneyin(sonunda eski tekil emmet kütüphanesinin yerini alacaktır)." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/execution/electron-browser/terminal.contribution.i18n.json b/i18n/trk/src/vs/workbench/parts/execution/electron-browser/terminal.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..72d4755b5b47558e0b69add8f242c6e92fb274b3 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/execution/electron-browser/terminal.contribution.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "terminalConfigurationTitle": "Harici Terminal", + "terminal.external.windowsExec": "Windows'da hangi terminalin çalışacağını ayarlar.", + "terminal.external.osxExec": "OS X'de hangi terminalin çalışacağını ayarlar.", + "terminal.external.linuxExec": "Linux'da hangi terminalin çalışacağını ayarlar.", + "globalConsoleActionWin": "Yeni Komut İstemi Aç", + "globalConsoleActionMacLinux": "Yeni Terminal Aç", + "scopedConsoleActionWin": "Komut İsteminde Aç", + "scopedConsoleActionMacLinux": "Terminalde Aç" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/execution/electron-browser/terminalService.i18n.json b/i18n/trk/src/vs/workbench/parts/execution/electron-browser/terminalService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..6e763ea86813d5d06c455c4672edb5cd43ba93cf --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/execution/electron-browser/terminalService.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "console.title": "VS Code Konsolu", + "mac.terminal.script.failed": "'{0}' betiği, {1} çıkış koduyla başarısız oldu", + "mac.terminal.type.not.supported": "'{0}' desteklenmiyor", + "press.any.key": "Devam etmek için bir tuşa basın ...", + "linux.term.failed": "'{0}', {1} çıkış koduyla başarısız oldu" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/explorers/browser/treeExplorer.contribution.i18n.json b/i18n/trk/src/vs/workbench/parts/explorers/browser/treeExplorer.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..1341aa7a5fab06e04eab070396b1eed3ba510d76 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/explorers/browser/treeExplorer.contribution.i18n.json @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "vscode.extension.contributes.view": "Özel görünüme ekleme yapar", + "vscode.extension.contributes.view.id": "vscode.workspace.createTreeView aracılığıyla oluşturulan görünümü tanımlamak için kullanılan benzersiz kimlik", + "vscode.extension.contributes.view.label": "Görünümde gösterilecek insanlar tarafından okunabilir dize", + "vscode.extension.contributes.view.icon": "Görünüm simgesinin yolu", + "vscode.extension.contributes.views": "Özel görünümlere ekleme yapar", + "showViewlet": "{0}'i Göster", + "view": "Görüntüle" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/explorers/browser/treeExplorerActions.i18n.json b/i18n/trk/src/vs/workbench/parts/explorers/browser/treeExplorerActions.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..f9ce5d1c2d7ed9c21e3cb74b3e47d2e395e9747d --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/explorers/browser/treeExplorerActions.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "refresh": "Yenile" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/explorers/browser/treeExplorerService.i18n.json b/i18n/trk/src/vs/workbench/parts/explorers/browser/treeExplorerService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..25fbff908a0e77d04ae65644ce886f551545c267 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/explorers/browser/treeExplorerService.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "treeExplorer.noMatchingProviderId": "{providerId} kimliği ile kayıtlı \"TreeExplorerNodeProvider\" yok." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/explorers/browser/views/treeExplorerView.i18n.json b/i18n/trk/src/vs/workbench/parts/explorers/browser/views/treeExplorerView.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..bc360a62ef3a6eaead2ae47e60d2d85358552a5d --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/explorers/browser/views/treeExplorerView.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "treeExplorerViewlet.tree": "Ağaç Gezgini Bölümü" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/extensions/browser/dependenciesViewer.i18n.json b/i18n/trk/src/vs/workbench/parts/extensions/browser/dependenciesViewer.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..36f005e07fc5bd7f9204651a99a15fbb37d82843 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/extensions/browser/dependenciesViewer.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "error": "Hata", + "Unknown Dependency": "Bilinmeyen Bağımlılık:" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/extensions/browser/extensionEditor.i18n.json b/i18n/trk/src/vs/workbench/parts/extensions/browser/extensionEditor.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..fd30d687af2a79ac29a1313eb369086c1889aad4 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/extensions/browser/extensionEditor.i18n.json @@ -0,0 +1,43 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "name": "Eklenti adı", + "extension id": "Eklenti tanımlayıcısı", + "publisher": "Yayıncı adı", + "install count": "Yüklenme sayısı", + "rating": "Derecelendirme", + "license": "Lisans", + "details": "Detaylar", + "contributions": "Eklemeler", + "changelog": "Değişim Günlüğü", + "dependencies": "Bağımlılıklar", + "noReadme": "README dosyası yok.", + "noChangelog": "Değişim günlüğü yok.", + "noContributions": "Hiçbir Ekleme Yapmıyor", + "noDependencies": "Bağımlılık Yok", + "settings": "Ayarlar ({0})", + "setting name": "Adı", + "description": "Açıklama", + "default": "Varsayılan", + "debuggers": "Hata Ayıklayıcılar ({0})", + "debugger name": "Adı", + "views": "Görünümler ({0})", + "view id": "ID", + "view name": "Adı", + "view location": "Yeri", + "themes": "Temalar ({0})", + "JSON Validation": "JSON Doğrulama ({0})", + "commands": "Komutlar ({0})", + "command name": "Adı", + "keyboard shortcuts": "Klavye Kısayolları", + "menuContexts": "Menü Bağlamları", + "languages": "Diller ({0})", + "language id": "ID", + "language name": "Adı", + "file extensions": "Dosya Uzantıları", + "grammar": "Gramer", + "snippets": "Parçacıklar" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/extensions/browser/extensionsActions.i18n.json b/i18n/trk/src/vs/workbench/parts/extensions/browser/extensionsActions.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..c76e1470bfc35286f98c97709e60d308e6cd17f7 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/extensions/browser/extensionsActions.i18n.json @@ -0,0 +1,62 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "installAction": "Yükle", + "installing": "Yükleniyor", + "uninstallAction": "Kaldır", + "Uninstalling": "Kaldırılıyor", + "updateAction": "Güncelle", + "updateTo": "{0} sürümüne güncelle", + "enableForWorkspaceAction.label": "Etkinleştir (Çalışma Alanı)", + "enableAlwaysAction.label": "Etkinleştir (Daima)", + "disableForWorkspaceAction.label": "Devre Dışı Bırak (Çalışma Alanı)", + "disableAlwaysAction.label": "Devre Dışı Bırak (Daima)", + "ManageExtensionAction.uninstallingTooltip": "Kaldırılıyor", + "enableForWorkspaceAction": "Çalışma Alanı", + "enableGloballyAction": "Daima", + "enableAction": "Etkinleştir", + "disableForWorkspaceAction": "Çalışma Alanı", + "disableGloballyAction": "Daima", + "disableAction": "Devre Dışı Bırak", + "checkForUpdates": "Güncelleştirmeleri Denetle", + "enableAutoUpdate": "Eklentileri Otomatik Olarak Güncelleştirmeyi Etkinleştir", + "disableAutoUpdate": "Eklentileri Otomatik Olarak Güncelleştirmeyi Devre Dışı Bırak", + "updateAll": "Tüm Eklentileri Güncelle", + "reloadAction": "Yeniden Yükle", + "postUpdateTooltip": "Güncellemek için yeniden yükleyin", + "postUpdateMessage": "Güncellenen '{0}' eklentisini etkinleştirmek için bu pencere yeniden yüklensin mi?", + "postEnableTooltip": "Etkinleştirmek için yeniden yükleyin", + "postEnableMessage": "'{0}' eklentisini etkinleştirmek için bu pencere yeniden yüklensin mi?", + "postDisableTooltip": "Devre dışı bırakmak için yeniden yükleyin", + "postDisableMessage": "'{0}' eklentisini devre dışı bırakmak için bu pencere yeniden yüklensin mi?", + "postUninstallTooltip": "Devre dışı bırakmak için yeniden yükleyin", + "postUninstallMessage": "Kaldırılan '{0}' eklentisini devre dışı bırakmak için bu pencere yeniden yüklensin mi?", + "reload": "Pencereyi &&Yeniden Yükle", + "toggleExtensionsViewlet": "Eklentileri Göster", + "installExtensions": "Eklenti Yükle", + "showInstalledExtensions": "Yüklenen Eklentileri Göster", + "showDisabledExtensions": "Devre Dışı Bırakılan Eklentileri Göster", + "clearExtensionsInput": "Eklenti Girdisini Temizle", + "showOutdatedExtensions": "Eski Eklentileri Göster", + "showPopularExtensions": "Popüler Eklentileri Göster", + "showRecommendedExtensions": "Tavsiye Edilen Eklentileri Göster", + "showWorkspaceRecommendedExtensions": "Çalışma Alanının Tavsiye Ettiği Eklentileri Göster", + "showRecommendedKeymapExtensions": "Tavsiye Edilen Tuş Haritalarını Göster", + "showRecommendedKeymapExtensionsShort": "Tuş Haritaları", + "showLanguageExtensions": "Dil Eklentilerini Göster", + "showLanguageExtensionsShort": "Dil Eklentileri", + "configureWorkspaceRecommendedExtensions": "Tavsiye Edilen Eklentileri Yapılandır (Çalışma Alanı)", + "ConfigureWorkspaceRecommendations.noWorkspace": "Tavsiyeler, sadece çalışma alanı klasöründe mevcuttur.", + "OpenExtensionsFile.failed": " '.vscode' klasörü içinde 'extensions.json' dosyası oluşturulamıyor ({0}).", + "builtin": "Yerleşik", + "disableAll": "Yüklü Tüm Eklentileri Devre Dışı Bırak", + "disableAllWorkspace": "Bu Çalışma Alanı için Yüklü Tüm Eklentileri Devre Dışı Bırak", + "enableAll": "Yüklü Tüm Eklentileri Etkinleştir", + "enableAllWorkspace": "Bu Çalışma Alanı için Yüklü Tüm Eklentileri Etkinleştir", + "extensionButtonProminentBackground": "Dikkat çeken eklenti eylemleri için buton arka plan rengi (ör. yükle butonu)", + "extensionButtonProminentForeground": "Dikkat çeken eklenti eylemleri için buton ön plan rengi (ör. yükle butonu)", + "extensionButtonProminentHoverBackground": "Dikkat çeken eklenti eylemleri için buton bağlantı vurgusu arka plan rengi (ör. yükle butonu)" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/extensions/browser/extensionsQuickOpen.i18n.json b/i18n/trk/src/vs/workbench/parts/extensions/browser/extensionsQuickOpen.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..1ac44b7c83d36fe0594efdd5d8f348371412808c --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/extensions/browser/extensionsQuickOpen.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "manage": "Eklentilerinizi yönetmek için Enter'a basın.", + "searchFor": "Markette '{0}' için arama yapmak için Enter'a basın.", + "noExtensionsToInstall": "Bir eklenti adı girin" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/extensions/common/extensionsFileTemplate.i18n.json b/i18n/trk/src/vs/workbench/parts/extensions/common/extensionsFileTemplate.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..006553546294e503732a3410ee855e94967d326a --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/extensions/common/extensionsFileTemplate.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "app.extensions.json.title": "Eklentiler", + "app.extensions.json.recommendations": "Eklenti tavsiyelerinin listesi. Bir eklentinin tanımlayıcısı daima '${yayinci}.${ad}' şeklindedir. Örnek: 'vscode.csharp'.", + "app.extension.identifier.errorMessage": "'${yayinci}.${ad}' biçimi bekleniyor. Örnek: 'vscode.csharp'." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/extensions/common/extensionsInput.i18n.json b/i18n/trk/src/vs/workbench/parts/extensions/common/extensionsInput.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..93faa852946c71a6a43605b644eccac804d69127 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/extensions/common/extensionsInput.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "extensionsInputName": "Eklenti: {0}" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.i18n.json b/i18n/trk/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..640d11588c60ded3fd041dd0cb1160f47c861d64 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.i18n.json @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "reallyRecommended2": "'{0}' eklentisi bu dosya türü için tavsiye edilir.", + "showRecommendations": "Tavsiyeleri Göster", + "neverShowAgain": "Tekrar gösterme", + "close": "Kapat", + "workspaceRecommended": "Bu çalışma alanı bazı eklentileri tavsiye ediyor.", + "ignoreExtensionRecommendations": "Tüm eklenti tavsiyelerini yok saymak istiyor musunuz?", + "ignoreAll": "Evet, Tümünü Yok Say", + "no": "Hayır", + "cancel": "İptal" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.i18n.json b/i18n/trk/src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..f6176cf12ddcd70558ec9f94a6bdf80a867a01c8 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "extensionsCommands": "Eklentileri Yönet", + "galleryExtensionsCommands": "Galeri Eklentileri Yükle", + "extension": "Eklenti", + "extensions": "Eklentiler", + "view": "Görüntüle", + "extensionsConfigurationTitle": "Eklentiler", + "extensionsAutoUpdate": "Eklentileri otomatik olarak güncelle", + "extensionsIgnoreRecommendations": "Eklenti tavsiyelerini yok say" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/extensions/electron-browser/extensionsActions.i18n.json b/i18n/trk/src/vs/workbench/parts/extensions/electron-browser/extensionsActions.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..25237bc8eadfcaac593c237215f169e9b6523b69 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/extensions/electron-browser/extensionsActions.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "openExtensionsFolder": "Eklentiler Klasörünü Aç", + "installVSIX": "VSIX'ten yükle...", + "InstallVSIXAction.success": "Eklenti başarıyla yüklendi. Etkinleştirmek için yeniden başlatın.", + "InstallVSIXAction.reloadNow": "Şimdi Yeniden Yükle" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json b/i18n/trk/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..33992c788d0a5e2b495ee0e7f15491cfc8187875 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.i18n.json @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "disableOtherKeymapsConfirmation": "Tuş bağlamlarında çakışmalardan kaçınmak için diğer tuş haritaları ({0}) devre dışı bırakılsın mı?", + "yes": "Evet", + "no": "Hayır", + "betterMergeDisabled": "\"Better Merge\" artık yerleşik bir eklenti, yüklenen eklendi devre dışı bırakıldı ve kaldırılabilir.", + "uninstall": "Kaldır", + "later": "Daha Sonra" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/extensions/electron-browser/extensionsViewlet.i18n.json b/i18n/trk/src/vs/workbench/parts/extensions/electron-browser/extensionsViewlet.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..1a9d49af7b913eea5024b6e06b006e664b4a993c --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/extensions/electron-browser/extensionsViewlet.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "searchExtensions": "Markette Eklenti Ara", + "extensions": "Eklentiler", + "sort by installs": "Sırala: Yüklenme Sayısına Göre", + "sort by rating": "Sırala: Derecelendirmeye Göre", + "sort by name": "Sırala: Ada Göre", + "no extensions found": "Eklenti yok.", + "suggestProxyError": "Market, 'ECONNREFUSED' döndürdü. Lütfen 'http.proxy' ayarını kontrol edin.", + "outdatedExtensions": "{0} Eski Eklenti" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/extensions/node/extensionsWorkbenchService.i18n.json b/i18n/trk/src/vs/workbench/parts/extensions/node/extensionsWorkbenchService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..c0336e592435de6bf41f102005bb4f181ec48898 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/extensions/node/extensionsWorkbenchService.i18n.json @@ -0,0 +1,17 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "enableDependeciesConfirmation": "'{0}' eklentisini etkinleştirdiğinizde onun bağımlılıkları da etkinleştirilir. Devam etmek istiyor musunuz?", + "enable": "Evet", + "doNotEnable": "Hayır", + "disableDependeciesConfirmation": "Yalnızca '{0}' eklentisini mi devre dışı bırakmak istersiniz yoksa bağımlılıklarını da devre dışı bırakmak ister misiniz?", + "disableOnly": "Sadece Eklenti", + "disableAll": "Tümü", + "cancel": "İptal", + "singleDependentError": "'{0}' eklentisi devre dışı bırakılamıyor. '{1}' eklentisi buna bağlı.", + "twoDependentsError": "'{0}' eklentisi devre dışı bırakılamıyor. '{1}' ve '{2}' eklentileri buna bağlı.", + "multipleDependentsError": "'{0}' eklentisi devre dışı bırakılamıyor. '{1}, '{2}' eklentileri ve diğerleri buna bağlı." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/feedback/electron-browser/feedback.i18n.json b/i18n/trk/src/vs/workbench/parts/feedback/electron-browser/feedback.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..d8da171200fdfa04143c3eebdea6fd9ca6955f66 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/feedback/electron-browser/feedback.i18n.json @@ -0,0 +1,25 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "sendFeedback": "Geri Bildirimi Tweet'le", + "label.sendASmile": "Geri bildiriminizi bize Tweet'leyin.", + "patchedVersion1": "Kurulumunuz bozuk.", + "patchedVersion2": "Eğer bir hata gönderiyorsanız bunu belirtin.", + "sentiment": "Deneyiminiz nasıldı?", + "smileCaption": "Mutlu", + "frownCaption": "Üzgün", + "other ways to contact us": "Bize ulaşmanın diğer yolları", + "submit a bug": "Bir hata gönder", + "request a missing feature": "Eksik bir özellik talebinde bulun", + "tell us why?": "Bize nedenini söyleyin:", + "commentsHeader": "Açıklamalar", + "tweet": "Tweet'le", + "character left": "karakter kaldı", + "characters left": "karakter kaldı", + "feedbackSending": "Gönderiliyor", + "feedbackSent": "Teşekkürler", + "feedbackSendingError": "Yeniden dene" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/files/browser/editors/binaryFileEditor.i18n.json b/i18n/trk/src/vs/workbench/parts/files/browser/editors/binaryFileEditor.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..4c60c43f74a29047132ff0f2d6d80f42328c5fe3 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/files/browser/editors/binaryFileEditor.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "binaryFileEditor": "İkili Dosya Görüntüleyici" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/files/browser/editors/textFileEditor.i18n.json b/i18n/trk/src/vs/workbench/parts/files/browser/editors/textFileEditor.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..694dd68c041383764037b7daa3dc95de76bc0ef8 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/files/browser/editors/textFileEditor.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "textFileEditor": "Metin Dosyası Düzenleyicisi", + "createFile": "Dosya Oluştur", + "fileEditorWithInputAriaLabel": "{0}. Metin dosyası düzenleyici.", + "fileEditorAriaLabel": "Metin dosyası düzenleyici." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/files/browser/fileActions.contribution.i18n.json b/i18n/trk/src/vs/workbench/parts/files/browser/fileActions.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..c9834694967e78957f887afd760f6cf8000cdd3d --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/files/browser/fileActions.contribution.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "filesCategory": "Dosyalar", + "revealInSideBar": "Kenar Çubuğunda Ortaya Çıkar", + "acceptLocalChanges": "Yerel değişiklikleri kullan ve diskk içeriklerinin üzerine yaz", + "revertLocalChanges": "Yerel değişiklikleri göz ardı et ve diskteki içeriğe geri dön" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/files/browser/fileActions.i18n.json b/i18n/trk/src/vs/workbench/parts/files/browser/fileActions.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..6081aa828c70ceb3223e11d5a38bd2599413d0c5 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/files/browser/fileActions.i18n.json @@ -0,0 +1,73 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "retry": "Yeniden Dene", + "rename": "Yeniden Adlandır", + "newFile": "Yeni Dosya", + "newFolder": "Yeni Klasör", + "openFolderFirst": "İçinde dosyalar veya klasörler oluşturmak için ilk olarak bir klasör açın.", + "newUntitledFile": "Yeni İsimsiz Dosya", + "createNewFile": "Yeni Dosya", + "createNewFolder": "Yeni Klasör", + "deleteButtonLabelRecycleBin": "&&Geri Dönüşüm Kutusuna Taşı", + "deleteButtonLabelTrash": "&&Çöp Kutusuna Taşı", + "deleteButtonLabel": "&&Sil", + "dirtyMessageFolderOneDelete": "1 dosyada kaydedilmemiş değişiklik barındıran bir klasörü siliyorsunuz. Devam etmek istiyor musunuz?", + "dirtyMessageFolderDelete": "{0} dosyada kaydedilmemiş değişiklik barındıran bir klasörü siliyorsunuz. Devam etmek istiyor musunuz?", + "dirtyMessageFileDelete": "Kaydedilmemiş değişiklik barındıran bir dosyayı siliyorsunuz. Devam etmek istiyor musunuz?", + "dirtyWarning": "Değişiklikleriniz, kaydetmezseniz kaybolur.", + "confirmMoveTrashMessageFolder": "'{0}' ve içindekileri silmek istediğinizden emin misiniz?", + "confirmMoveTrashMessageFile": "'{0}' öğesini silmek istediğinize emin misiniz?", + "undoBin": "Geri dönüşüm kutusundan geri alabilirsiniz.", + "undoTrash": "Çöp kutusundan geri alabilirsiniz.", + "confirmDeleteMessageFolder": "'{0}' öğesini ve içindekileri kalıcı olarak silmek istediğinizden emin misiniz?", + "confirmDeleteMessageFile": "'{0}' öğesini kalıcı olarak silmek istediğinizden emin misiniz?", + "irreversible": "Bu eylem geri döndürülemez!", + "permDelete": "Kalıcı Olarak Sil", + "delete": "Sil", + "importFiles": "Dosya İçe Aktar", + "confirmOverwrite": "Hedef klasörde aynı ada sahip bir dosya veya klasör zaten var. Değiştirmek istiyor musunuz?", + "replaceButtonLabel": "&&Değiştir", + "copyFile": "Kopyala", + "pasteFile": "Yapıştır", + "duplicateFile": "Çoğalt", + "openToSide": "Yana Aç", + "compareSource": "Karşılaştırma İçin Seç", + "globalCompareFile": "Aktif Dosyayı Karşılaştır...", + "pickHistory": "Karşılaştırmak için daha önce açılan bir dosyayı seçin", + "unableToFileToCompare": "Seçtiğiniz dosya, '{0}' ile karşılaştırılamaz.", + "openFileToCompare": "Bir başka dosya ile karşılaştırmak için ilk olarak bir dosya açın.", + "compareWith": "'{0}' ile karşılaştır", + "compareFiles": "Dosyaları Karşılaştır", + "refresh": "Yenile", + "save": "Kaydet", + "saveAs": "Farklı Kaydet...", + "saveAll": "Tümünü Kaydet", + "saveAllInGroup": "Gruptaki Tümünü Kadet", + "saveFiles": "Kaydedilmemiş Değişiklikler İçeren Dosyaları Kaydet", + "revert": "Dosyayı Geri Döndür", + "focusOpenEditors": "Açık Düzenleyiciler Görünümüne Odakla", + "focusFilesExplorer": "Dosya Gezginine Odakla", + "showInExplorer": "Aktif Dosyayı Kenar Çubuğunda Ortaya Çıkar", + "openFileToShow": "Gezginde göstermek için ilk olarak bir dosya açın", + "collapseExplorerFolders": "Gezgindeki Klasörleri Daralt", + "refreshExplorer": "Gezgini Yenile", + "openFile": "Dosya Aç...", + "openFileInNewWindow": "Aktif Dosyayı Yeni Pencerede Aç", + "openFileToShowInNewWindow": "Yeni pencerede açmak için ilk olarak bir dosya açın", + "revealInWindows": "Gezginde Ortaya Çıkar", + "revealInMac": "Finder'da Ortaya Çıkar", + "openContainer": "İçeren Klasörü Aç", + "revealActiveFileInWindows": "Aktif Dosyayı Windows Gezgini'nde Ortaya Çıkar", + "revealActiveFileInMac": "Aktif Dosyayı Finder'da Ortaya Çıkar", + "openActiveFileContainer": "Aktif Dosyayı İçeren Klasörü Aç", + "copyPath": "Yolu Kopyala", + "copyPathOfActive": "Aktif Dosyanın Yolunu Kopyala", + "emptyFileNameError": "Bir dosya veya klasör adı sağlanması gerekiyor.", + "fileNameExistsError": "Bu konumda bir **{0}** dosyası veya klasörü zaten mevcut. Lütfen başka bir ad seçin.", + "invalidFileNameError": "**{0}** adı, bir dosya veya klasör adı olarak geçerli değildir. Lütfen başka bir ad seçin.", + "filePathTooLongError": "**{0}** adı çok uzun bir yol ile sonuçlanıyor. Lütfen daha kısa bir ad seçin." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/files/browser/fileCommands.i18n.json b/i18n/trk/src/vs/workbench/parts/files/browser/fileCommands.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..699305824d3ed72f4db5e5e739e8de24cc613818 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/files/browser/fileCommands.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "openFileToCopy": "Yolunu kopyalamak için ilk olarak bir dosya açın", + "openFileToReveal": "Ortaya çıkarmak için ilk olarak bir dosya açın" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/files/browser/files.contribution.i18n.json b/i18n/trk/src/vs/workbench/parts/files/browser/files.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..ab865812eb837220cf4abe3ac55f48c77b16c02f --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/files/browser/files.contribution.i18n.json @@ -0,0 +1,41 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "showExplorerViewlet": "Gezgini Göster", + "explore": "Gezgin", + "view": "Görüntüle", + "textFileEditor": "Metin Dosyası Düzenleyicisi", + "binaryFileEditor": "İkili Dosya Düzenleyicisi", + "filesConfigurationTitle": "Dosyalar", + "exclude": "Dosya ve klasörleri hariç tutmak için glob desenlerini yapılandırın.", + "files.exclude.boolean": "Dosya yollarının eşleştirileceği glob deseni. Deseni etkinleştirmek veya devre dışı bırakmak için true veya false olarak ayarlayın.", + "files.exclude.when": "Eşleşen bir dosyanın eşdüzey dosyalarında ek denetim. Eşleşen dosya adı için değişken olarak $(basename) kullanın.", + "associations": "Dillerle dosya ilişkilendirmelerini yapılandırın (ör. \"*.uzanti\": \"html\"). Bunların, kurulu olan dillerin varsayılan ilişkilendirmeleri karşısında önceliği vardır.", + "encoding": "Dosyalar okunurken ve yazılırken kullanılacak varsayılan karakter kümesi kodlaması.", + "autoGuessEncoding": "Etkinleştirildiğinde, dosyaları açarken karakter kümesini tahmin etmeye çalışır", + "eol": "Varsayılan satır sonu karakteri. LF için \\n ve CRLF için \\r\\n kullan.", + "trimTrailingWhitespace": "Etkinleştirildiğinde, bir dosyayı kaydettiğinizde sondaki boşluk kırpılır.", + "insertFinalNewline": "Etkinleştirildiğinde, bir dosyayı kaydederken dosya sonuna bir boş satır ekler.", + "files.autoSave.off": "Kaydedilmemiş değişiklikler içeren bir dosya hiçbir zaman otomatik olarak kaydedilmez.", + "files.autoSave.afterDelay": "Kaydedilmemiş değişiklikler içeren bir dosya, 'files.autoSaveDelay' ayarlandıktan sonra otomatik olarak kaydedilir.", + "files.autoSave.onFocusChange": "Kaydedilmemiş değişiklikler içeren bir dosya, düzenleyici odaktan çıktığı an otomatik olarak kaydedilir.", + "files.autoSave.onWindowChange": "Kaydedilmemiş değişiklikler içeren bir dosya, pencere odaktan çıktığı an otomatik olarak kaydedilir.", + "autoSave": "Kaydedilmemiş değişiklikler içeren dosyaların otomatik kaydedilmesini denetler. Kabul edilen değerler: '{0}', '{1}', '{2}' (düzenleyici odaktan çıktığında), '{3}' (pencere odaktan çıktığında). '{4}' olarak ayarlanırsa, gecikmeyi 'files.autoSaveDelay' ile ayarlayabilirsiniz.", + "autoSaveDelay": "Kaydedilmemiş değişiklikler içeren bir dosyanın kaç ms gecikmeli otomatik olarak kaydedileceğini denetler. Sadece 'files.autoSave', '{0}' olarak ayarlandığında uygulanır.", + "watcherExclude": "Dosya izlemeden hariç tutulacak dosya yollarının glob desenlerini yapılandırın. Bu ayar değiştiğinde yeniden başlatma gerektirir. Code'un başlangıçta çok fazla CPU zamanı harcadığını görürseniz, başlangıç yüklemesini azaltmak için büyük klasörleri hariç tutabilirsiniz.", + "hotExit.off": "Hızlı çıkışı devre dışı bırak.", + "hotExit.onExit": "Hızlı çıkış, uygulama kapandığında tetiklenir, yani Windows/Linux'da son pencere kapandığında veya workbench.action.quit komutu tetiklendiği zaman (komut paleti, tuş bağı, menü). Bir sonraki başlatmada tüm pencereler yedekleriyle geri yüklenir.", + "hotExit.onExitAndWindowClose": "Hızlı çıkış, uygulama kapandığında tetiklenir, yani Windows/Linux'da son pencere kapandığında veya workbench.action.quit komutu tetiklendiği zaman (komut paleti, tuş bağı, menü), ve ayrıca son pencere olmasından bağımsız açık bir klasör bulunan herhangi bir pencere varsa. Bir sonraki başlatmada tüm pencereler yedekleriyle geri yüklenir. Klasör pencerelerini kapatılmadan önceki konumlarına geri yüklemek için \"window.restoreWindows\" ögesini \"all\" olarak ayarlayın.", + "hotExit": "Oturumlar arasında kaydedilmemiş dosyaların hatırlanıp hatırlanmayacağını denetler, düzenleyiciden çıkarken kaydetmek için izin istenmesi atlanacaktır.", + "defaultLanguage": "Yeni dosyalara atanan varsayılan dil modu.", + "editorConfigurationTitle": "Düzenleyici", + "formatOnSave": "Dosyayı kaydederken biçimlendir. Bir biçimlendirici mevcut olmalıdır, dosya otomatik olarak kaydedilmemelidir, ve düzenleyici kapanmıyor olmalıdır.", + "explorerConfigurationTitle": "Dosya Gezgini", + "openEditorsVisible": "Açık Editörler bölmesinde gösterilen düzenleyici sayısı. Bölmeyi gizlemek için 0 olarak ayarlayın.", + "dynamicHeight": "Açık düzenleyiciler bölümü yüksekliğinin öge sayısına göre dinamik olarak uyarlanıp uyarlanmayacağını denetler.", + "autoReveal": "Gezginin dosyaları açarken, onları otomatik olarak ortaya çıkartmasını ve seçmesini denetler.", + "enableDragAndDrop": "Gezgeinin sürükle bırak ile dosyaları ve klasörleri taşımaya izin verip vermeyeceğini denetler." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/files/browser/saveErrorHandler.i18n.json b/i18n/trk/src/vs/workbench/parts/files/browser/saveErrorHandler.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..09d9b7607bd561bf2e51a34ba55d2c7a2f879975 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/files/browser/saveErrorHandler.i18n.json @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "discard": "At", + "overwrite": "Üzerine Yaz", + "retry": "Yeniden Dene", + "readonlySaveError": "'{0}' kaydedilemedi: Dosya yazmaya karşı korunuyor. Korumayı kaldırmak için 'Üzerine Yaz'ı seçin.", + "genericSaveError": "'{0}' kaydedilemedi: ({1}).", + "staleSaveError": "'{0}' kaydedilemedi: Diskteki içerik daha yeni. Sizdeki sürüm ile disktekini karşılaştırmak için **Karşılaştır**a tıklayın.", + "compareChanges": "Karşılaştır", + "saveConflictDiffLabel": "{0} (diskte) ↔ {1} ({2} uygulamasında) - Kaydetme çakışmasını çöz", + "userGuide": "Değişikliklerinizi **geri al**mak veya diskteki içeriğin **üzerine yaz**mak için düzenleyicideki araç çubuğunu kullanabilirsiniz" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/files/browser/views/emptyView.i18n.json b/i18n/trk/src/vs/workbench/parts/files/browser/views/emptyView.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..298fda23b221ae3361f94a8a40d274cf6debdef9 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/files/browser/views/emptyView.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "explorerSection": "Dosya Gezgini Bölümü", + "openFolder": "Klasör Aç" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/files/browser/views/explorerView.i18n.json b/i18n/trk/src/vs/workbench/parts/files/browser/views/explorerView.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..d8b937fc203b5897b8817174612e96cce1a7ae9f --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/files/browser/views/explorerView.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "explorerSection": "Dosya Gezgini Bölümü", + "treeAriaLabel": "Dosya Gezgini" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/files/browser/views/explorerViewer.i18n.json b/i18n/trk/src/vs/workbench/parts/files/browser/views/explorerViewer.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..9dff53f0852e43bfeaedb576c89d8e56084dfad2 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/files/browser/views/explorerViewer.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "fileInputAriaLabel": "Dosya adı girin. Onaylamak için Enter'a, iptal etmek için Escape tuşuna basın.", + "filesExplorerViewerAriaLabel": "{0}, Dosya Gezgini", + "confirmOverwriteMessage": "'{0}' hedef klasörde zaten mevcut. Değiştirmek istiyor musunuz?", + "irreversible": "Bu eylem geri döndürülemez!", + "replaceButtonLabel": "&&Değiştir" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/files/browser/views/openEditorsView.i18n.json b/i18n/trk/src/vs/workbench/parts/files/browser/views/openEditorsView.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..aa9de346ffc7caa6e3b4bfff690c9db2c3f7169c --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/files/browser/views/openEditorsView.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "openEditors": "Açık Düzenleyiciler", + "openEditosrSection": "Açık Düzenleyiciler Bölümü", + "treeAriaLabel": "Açık Düzenleyiciler: Aktif Dosyaların Listesi", + "dirtyCounter": "{0} kaydedilmemiş" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/files/browser/views/openEditorsViewer.i18n.json b/i18n/trk/src/vs/workbench/parts/files/browser/views/openEditorsViewer.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..172555e1368b641133f7fa010a8e883bc32a4a3c --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/files/browser/views/openEditorsViewer.i18n.json @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "editorGroupAriaLabel": "{0}, Düzenleyici Grubu", + "openEditorAriaLabel": "{0}, Açık Düzenleyici", + "saveAll": "Tümünü Kaydet", + "closeAllUnmodified": "Değiştirilmeyenleri Kapat", + "closeAll": "Tümünü Kapat", + "close": "Kapat", + "closeOthers": "Diğerlerini Kapat" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/files/common/dirtyFilesTracker.i18n.json b/i18n/trk/src/vs/workbench/parts/files/common/dirtyFilesTracker.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..0f88a5b2332eed8bd67b685687ada32239a86ebd --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/files/common/dirtyFilesTracker.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "dirtyFiles": "{0} kaydedilmemiş dosya" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/files/common/editors/fileEditorInput.i18n.json b/i18n/trk/src/vs/workbench/parts/files/common/editors/fileEditorInput.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..59355f869fc0cc90a9f34734ae26810a54bd0990 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/files/common/editors/fileEditorInput.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "orphanedFile": "{0} (diskten silindi)" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/html/browser/html.contribution.i18n.json b/i18n/trk/src/vs/workbench/parts/html/browser/html.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..f9aa2193402ca7dbde4f5a31c932be95216c3aa6 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/html/browser/html.contribution.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "html.editor.label": "Html Önizlemesi" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/html/browser/htmlPreviewPart.i18n.json b/i18n/trk/src/vs/workbench/parts/html/browser/htmlPreviewPart.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..13f1ae29ec664cfcbb38fa0cc1cc803be20a2144 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/html/browser/htmlPreviewPart.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "html.voidInput": "Geçersiz düzenleyici girdisi." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/html/browser/webview.i18n.json b/i18n/trk/src/vs/workbench/parts/html/browser/webview.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..cc23f3edf72e5d40137cf8d2758689e3bdaaba59 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/html/browser/webview.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "devtools.webview": "Geliştirici: Web Görünümü Araçları" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/markers/common/messages.i18n.json b/i18n/trk/src/vs/workbench/parts/markers/common/messages.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..80f988e1d75ddf004cd182c07816a60306cdae76 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/markers/common/messages.i18n.json @@ -0,0 +1,39 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "viewCategory": "Görüntüle", + "problems.view.show.label": "Sorunları Göster", + "problems.panel.configuration.title": "Sorunlar Görünümü", + "problems.panel.configuration.autoreveal": "Sorunlar görünümünün; dosyalar açılırken, dosyaları otomatik olarak ortaya çıkarıp çıkarmayacağını denetler.", + "markers.panel.title.problems": "Sorunlar", + "markers.panel.aria.label.problems.tree": "Dosyalara göre gruplandırılmış sorunlar", + "markers.panel.no.problems.build": "Şu ana kadar çalışma alanında herhangi bir sorun tespit edilmedi.", + "markers.panel.no.problems.filters": "Belirtilen süzgeç ölçütleriyle sonuç bulunamadı", + "markers.panel.action.filter": "Sorunları Süz", + "markers.panel.filter.placeholder": "Türe veya metne göre süz", + "markers.panel.filter.errors": "hatalar", + "markers.panel.filter.warnings": "uyarılar", + "markers.panel.filter.infos": "bilgilendirmeler", + "markers.panel.single.error.label": "1 Hata", + "markers.panel.multiple.errors.label": "{0} Hata", + "markers.panel.single.warning.label": "1 Uyarı", + "markers.panel.multiple.warnings.label": "{0} Uyarı", + "markers.panel.single.info.label": "1 Bilgilendirme", + "markers.panel.multiple.infos.label": "{0} Bilgilendirme", + "markers.panel.single.unknown.label": "1 Bilinmeyen", + "markers.panel.multiple.unknowns.label": "{0} Bilinmeyen", + "markers.panel.at.ln.col.number": "({0}, {1})", + "problems.tree.aria.label.resource": "{0} {1} sorun içeriyor", + "problems.tree.aria.label.error.marker": "{0} tarafından oluşturulan hata: {2}. satırın {3}. karakterinde {1}", + "problems.tree.aria.label.error.marker.nosource": "Hata: {1}. satırın {2}. karakterinde {0}", + "problems.tree.aria.label.warning.marker": "{0} tarafından oluşturulan uyarı: {2}. satırın {3}. karakterinde {1}", + "problems.tree.aria.label.warning.marker.nosource": "Uyarı: {1}. satırın {2}. karakterinde {0}", + "problems.tree.aria.label.info.marker": "{0} tarafından oluşturulan bilgilendirme: {2}. satırın {3}. karakterinde {1}", + "problems.tree.aria.label.info.marker.nosource": "Bilgilendirme: {1}. satırın {2}. karakterinde {0}", + "problems.tree.aria.label.marker": "{0} tarafından oluşturulan sorun: {2}. satırın {3}. karakterinde {1}", + "problems.tree.aria.label.marker.nosource": "Sorun: {1}. satırın {2}. karakterinde {0}", + "errors.warnings.show.label": "Hataları ve Uyarıları Göster" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/markers/electron-browser/markersElectronContributions.i18n.json b/i18n/trk/src/vs/workbench/parts/markers/electron-browser/markersElectronContributions.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..22387f166cb252e3c6397523372dff545955e4fa --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/markers/electron-browser/markersElectronContributions.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "copyMarker": "Kopyala" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/nps/electron-browser/nps.contribution.i18n.json b/i18n/trk/src/vs/workbench/parts/nps/electron-browser/nps.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..821add9841da12d69fb3e69e990a6c8aa12608b9 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/nps/electron-browser/nps.contribution.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "surveyQuestion": "Hızlı bir geri bildirim anketine katılmak ister misiniz?", + "takeSurvey": "Ankete Katıl", + "remindLater": "Daha Sonra Hatırlat", + "neverAgain": "Tekrar Gösterme" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/output/browser/output.contribution.i18n.json b/i18n/trk/src/vs/workbench/parts/output/browser/output.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..fe8f6125b1a1e34f4e3d23efb12673f805fe5846 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/output/browser/output.contribution.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "output": "Çıktı", + "viewCategory": "Görüntüle", + "clearOutput.label": "Çıktıyı Temizle" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/output/browser/outputActions.i18n.json b/i18n/trk/src/vs/workbench/parts/output/browser/outputActions.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..c4f84392df6d65a1da0e6053cdb43e11573e7682 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/output/browser/outputActions.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "toggleOutput": "Çıktıyı Aç/Kapat", + "clearOutput": "Çıktıyı Temizle", + "toggleOutputScrollLock": "Çıktı Kaydırma Kilidini Aç/Kapat", + "switchToOutput.label": "Çıktıya Geçiş Yap" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/output/browser/outputPanel.i18n.json b/i18n/trk/src/vs/workbench/parts/output/browser/outputPanel.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..1fde8c9ce8a0b81d1f6210e1df4d86d23bcc64e8 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/output/browser/outputPanel.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "outputPanelWithInputAriaLabel": "{0}, Çıktı paneli", + "outputPanelAriaLabel": "Çıktı paneli" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/output/common/output.i18n.json b/i18n/trk/src/vs/workbench/parts/output/common/output.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..cfbabebaa616ee4f8f9bf85cfbedb645e8484dfc --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/output/common/output.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "output": "Çıktı", + "channel": "'{0}' için" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json b/i18n/trk/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..dc3e6110e346748ef525b581adc2edb287c4876e --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/performance/electron-browser/performance.contribution.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "slow": "Yavaş başlangıç tespit edildi", + "slow.detail": "Az önce yavaş başlangıç yaşadığınız için üzgünüz. Lütfen '{0}' uygulamasını profil oluşturucu etkinleştirilmiş olarak başlatın, profilleri bizle paylaşın, ve biz de başlangıcı yeniden harika yapmak için çok çalışalım.", + "prof.message": "Profiller başarıyla oluşturuldu.", + "prof.detail": "Lütfen bir sorun (bildirimi) oluşturun ve aşağıdaki dosyaları manuel olarak ekleyin:\n{0}", + "prof.restartAndFileIssue": "Sorun Oluştur ve Yeniden Başlat", + "prof.restart": "Yeniden Başlat", + "prof.thanks": "Bize yardımcı olduğunuz için teşekkürler.", + "prof.detail.restart": "'{0}' uygulamasını kullanmaya devam etmek için son bir yeniden başlatma gerekiyor. Katkılarınız için tekrar teşekkür ederiz." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/preferences/browser/keybindingWidgets.i18n.json b/i18n/trk/src/vs/workbench/parts/preferences/browser/keybindingWidgets.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..68b1055180c524a699958831652cb3a90e353aaa --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/preferences/browser/keybindingWidgets.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "defineKeybinding.initial": "İstenen tuş kombinasyonuna basın ve daha sonra ENTER'a basın. İptal etmek için ESCAPE tuşuna basın.", + "defineKeybinding.chordsTo": "ardından" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/preferences/browser/keybindingsEditor.i18n.json b/i18n/trk/src/vs/workbench/parts/preferences/browser/keybindingsEditor.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..a67e224c963a4a9e1675d89a3f218c3c1124d1d5 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/preferences/browser/keybindingsEditor.i18n.json @@ -0,0 +1,35 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "keybindingsInputName": "Klavye Kısayolları", + "SearchKeybindings.AriaLabel": "Tuş bağlarını ara", + "SearchKeybindings.Placeholder": "Tuş bağlarını ara", + "sortByPrecedene": "Önceliğe Göre Sırala", + "header-message": "Gelişmiş özelleştirmeler için açın ve düzenleyin", + "keybindings-file-name": "keybindings.json", + "keybindingsLabel": "Tuş bağları", + "changeLabel": "Tuş Bağını Değiştir", + "addLabel": "Tuş Bağını Ekle", + "removeLabel": "Tuş Bağını Kaldır", + "resetLabel": "Tuş Bağını Sıfırla", + "showConflictsLabel": "Çakışmaları Göster", + "copyLabel": "Kopyala", + "error": "Tuş bağını düzenlerken '{0}' hatası. Lütfen 'keybindings.json' dosyasını açın ve kontrol edin.", + "command": "Command", + "keybinding": "Tuş bağı", + "source": "Kaynak", + "when": "Koşul", + "editKeybindingLabelWithKey": "{0} Tuş Bağını Değiştir", + "editKeybindingLabel": "Tuş Bağını Değiştir", + "addKeybindingLabelWithKey": "{0} Tuş Bağını Ekle", + "addKeybindingLabel": "Tuş Bağını Ekle", + "commandAriaLabel": "Komut {0}'dır.", + "keybindingAriaLabel": "Tuş bağı {0}'dır.", + "noKeybinding": "Tuş bağı atanmamış.", + "sourceAriaLabel": "Kaynak {0}'dır.", + "whenAriaLabel": "Koşul {0} şeklindedir.", + "noWhen": "Koşul içeriği yok." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/preferences/browser/keybindingsEditorContribution.i18n.json b/i18n/trk/src/vs/workbench/parts/preferences/browser/keybindingsEditorContribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..15d8c9861aed8b50ef9dd1730144d2b34b8792ed --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/preferences/browser/keybindingsEditorContribution.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "defineKeybinding.start": "Tuş Bağı Tanımla", + "defineKeybinding.kbLayoutErrorMessage": "Bu tuş kombinasyonunu geçerli klavye düzeninizde üretemeyeceksiniz.", + "defineKeybinding.kbLayoutLocalAndUSMessage": "Geçerli klavye düzeniniz için **{0}** (Birleşik Devletler standardı için **{1}**).", + "defineKeybinding.kbLayoutLocalMessage": "Geçerli klavye düzeniniz için **{0}**." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/preferences/browser/preferences.contribution.i18n.json b/i18n/trk/src/vs/workbench/parts/preferences/browser/preferences.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..76c311091690f6e09180d457e78b749541afa148 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/preferences/browser/preferences.contribution.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "defaultPreferencesEditor": "Varsayılan Tercihler Düzenleyicisi", + "keybindingsEditor": "Tuş Bağları Düzenleyicisi", + "preferences": "Tercihler" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/preferences/browser/preferencesActions.i18n.json b/i18n/trk/src/vs/workbench/parts/preferences/browser/preferencesActions.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..0a5d1d96e7e7d10541fbe0e180b545be8280ef75 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/preferences/browser/preferencesActions.i18n.json @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "openGlobalSettings": "Kullanıcı Ayarlarını Aç", + "openGlobalKeybindings": "Klavye Kısayollarını Aç", + "openGlobalKeybindingsFile": "Klavye Kısayolları Dosyasını Aç", + "openWorkspaceSettings": "Çalışma Alanı Ayarlarını Aç", + "configureLanguageBasedSettings": "Dile Özel Ayarları Yapılandır...", + "languageDescriptionConfigured": "({0})", + "pickLanguage": "Dili Seç" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/preferences/browser/preferencesEditor.i18n.json b/i18n/trk/src/vs/workbench/parts/preferences/browser/preferencesEditor.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..be88513af744e9a4929945ba071fdc62f2997ecb --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/preferences/browser/preferencesEditor.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "settingsEditorName": "Varsayılan Ayarlar", + "SearchSettingsWidget.AriaLabel": "Ayarları ara", + "SearchSettingsWidget.Placeholder": "Ayarları Ara", + "totalSettingsMessage": "Toplam {0} Ayar", + "noSettingsFound": "Sonuç Yok", + "oneSettingFound": "1 ayar eşleşti", + "settingsFound": "{0} ayar eşleşti", + "preferencesAriaLabel": "Varsayılan tercihler. Salt okunabilir metin editörü." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/preferences/browser/preferencesRenderers.i18n.json b/i18n/trk/src/vs/workbench/parts/preferences/browser/preferencesRenderers.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..68b7788b3e0f549624076495141aa8f8039e8f6b --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/preferences/browser/preferencesRenderers.i18n.json @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "errorInvalidConfiguration": "Ayarlara yazılamıyor. Lütfen dosyadaki hataları/uyarıları düzeltin ve tekrar deneyin.", + "editTtile": "Düzenle", + "replaceDefaultValue": "Ayarlarda Değiştir", + "copyDefaultValue": "Ayarlara Kopyala", + "unsupportedPHPExecutablePathSetting": "Bu ayar, bir Kullanıcı Ayarı olmalıdır. PHP'yi çalışma alanı için yapılandırmak için bir PHP dosyasını açın ve durum çubuğundaki 'PHP Yolu'na tıklayın.", + "unsupportedWorkspaceSetting": "Bu ayar, bir Kullanıcı Ayarı olmalıdır." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/preferences/browser/preferencesService.i18n.json b/i18n/trk/src/vs/workbench/parts/preferences/browser/preferencesService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..edeac2f6a8efb6198538066ab502dee8919b47f2 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/preferences/browser/preferencesService.i18n.json @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "openFolderFirst": "Çalışma alanı ayarları oluşturmak için ilk olarak bir klasör açın", + "emptyKeybindingsHeader": "Varsayılanların üzerine yazmak için tuş bağlarınızı bu dosyaya yerleştirin", + "defaultKeybindings": "Varsayılan Tuş Bağları", + "emptySettingsHeader": "Varsayılan ayarların üzerine yazmak için ayarlarınızı bu dosyaya yerleştirin.", + "emptySettingsHeader1": "Varsayılan ayarların ve kullanıcı ayarlarının üzerine yazmak için ayarlarınızı bu dosyaya yerleştirin.", + "fail.createSettings": " '{0}' oluşturulamadı ({1})." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/preferences/browser/preferencesWidgets.i18n.json b/i18n/trk/src/vs/workbench/parts/preferences/browser/preferencesWidgets.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..1814392bc9671a8e78015a0af298a762ec5aa152 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/preferences/browser/preferencesWidgets.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "settingsSwitcherBarAriaLabel": "Ayar Değiştirici", + "userSettings": "Kullanıcı Ayarları", + "workspaceSettings": "Çalışma Alanı Ayarları" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/preferences/common/keybindingsEditorModel.i18n.json b/i18n/trk/src/vs/workbench/parts/preferences/common/keybindingsEditorModel.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..90483c4e7e324c29ac084902c36d43aa0bbad719 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/preferences/common/keybindingsEditorModel.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "default": "Varsayılan", + "user": "Kullanıcı", + "meta": "meta", + "option": "seçenek" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/preferences/common/preferencesModels.i18n.json b/i18n/trk/src/vs/workbench/parts/preferences/common/preferencesModels.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..dc4c28efe529a16d8b78a2405486e63a813e3ada --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/preferences/common/preferencesModels.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "commonlyUsed": "Yaygın Olarak Kullanılan", + "defaultKeybindingsHeader": "Tuş bağları dosyanıza yerleştirerek tuş bağlarının üzerine yazın." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/quickopen/browser/commandsHandler.i18n.json b/i18n/trk/src/vs/workbench/parts/quickopen/browser/commandsHandler.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..bef4db281adccac4f7b7a8b3927fd9e73820c722 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/quickopen/browser/commandsHandler.i18n.json @@ -0,0 +1,19 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "showTriggerActions": "Tüm Komutları Göster", + "clearCommandHistory": "Komut Geçmişini Temizle", + "showCommands.label": "Komut Paleti...", + "entryAriaLabelWithKey": "{0}, {1}, komutlar", + "entryAriaLabel": "{0}, komutlar", + "canNotRun": "'{0}' komutu buradan çalıştırılamıyor.", + "actionNotEnabled": "'{0}' komutu geçerli bağlamda etkin değil.", + "recentlyUsed": "yakınlarda kullanıldı", + "morecCommands": "diğer komutlar", + "commandLabel": "{0}: {1}", + "cat.title": "{0}: {1}", + "noCommandsMatching": "Eşleşen komut yok" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/quickopen/browser/gotoLineHandler.i18n.json b/i18n/trk/src/vs/workbench/parts/quickopen/browser/gotoLineHandler.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..3d256651499130a7ff06ea81a1787c46b15e8c19 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/quickopen/browser/gotoLineHandler.i18n.json @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "gotoLine": "Satıra Git...", + "gotoLineLabelEmptyWithLimit": "Gitmek için 1 ile {0} arasında bir satır numarası yazın", + "gotoLineLabelEmpty": "Gidilecek satır numarasını yazın", + "gotoLineColumnLabel": "{0}. satırın {1}. karakterine git", + "gotoLineLabel": "{0} satırına git", + "gotoLineHandlerAriaLabel": "Gidilecek satır numarasını yazın.", + "cannotRunGotoLine": "Satıra gitmek için ilk olarak bir metin dosyası açın" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/quickopen/browser/gotoSymbolHandler.i18n.json b/i18n/trk/src/vs/workbench/parts/quickopen/browser/gotoSymbolHandler.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..0dfa60b61a4e4b01ee83a4adb435ee0353c3ee57 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/quickopen/browser/gotoSymbolHandler.i18n.json @@ -0,0 +1,34 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "gotoSymbol": "Dosyada Sembole Git...", + "symbols": "semboller ({0})", + "method": "yöntemler ({0})", + "function": "fonksiyonlar ({0})", + "_constructor": "oluşturucular ({0})", + "variable": "değişkenler ({0})", + "class": "sınıflar ({0})", + "interface": "arayüzler ({0})", + "namespace": "isim alanları ({0})", + "package": "paketler ({0})", + "modules": "modüller ({0})", + "property": "özellikler ({0})", + "enum": "numaralandırmalar ({0})", + "string": "dizeler ({0})", + "rule": "kurallar ({0})", + "file": "dosyalar ({0})", + "array": "diziler ({0})", + "number": "sayılar ({0})", + "boolean": "boole değerleri ({0})", + "object": "nesneler ({0})", + "key": "anahtarlar ({0})", + "entryAriaLabel": "{0}, semboller", + "noSymbolsMatching": "Eşleşen sembol yok", + "noSymbolsFound": "Sembol bulunamadı", + "gotoSymbolHandlerAriaLabel": "Geçerli düzenleyicideki sembolleri daraltmak için yazmaya başlayın.", + "cannotRunGotoSymbolInFile": "Dosya için sembol bilgisi yok", + "cannotRunGotoSymbol": "Sembole gitmek için ilk olarak bir metin dosyası açın" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/quickopen/browser/helpHandler.i18n.json b/i18n/trk/src/vs/workbench/parts/quickopen/browser/helpHandler.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..81a2056121e20d9c44f9551f32ec1c99198e7d5f --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/quickopen/browser/helpHandler.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "entryAriaLabel": "{0}, seçici yardımı", + "globalCommands": "genel komutlar", + "editorCommands": "düzenleyici komutları" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/quickopen/browser/quickopen.contribution.i18n.json b/i18n/trk/src/vs/workbench/parts/quickopen/browser/quickopen.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..fe14853bad62054670243378ff8988acd24a83da --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/quickopen/browser/quickopen.contribution.i18n.json @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "commandsHandlerDescriptionDefault": "Komutları Göster ve Çalıştır", + "gotoLineDescriptionMac": "Satıra Git", + "gotoLineDescriptionWin": "Satıra Git", + "gotoSymbolDescription": "Dosyada Sembole Git", + "gotoSymbolDescriptionScoped": "Kategoriye Göre Dosyada Sembole Git", + "helpDescription": "Yardımı Göster", + "viewPickerDescription": "Görünümü Aç" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/quickopen/browser/viewPickerHandler.i18n.json b/i18n/trk/src/vs/workbench/parts/quickopen/browser/viewPickerHandler.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..4451c9909c1b8e72ac68e8e438000cf4fc0a1958 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/quickopen/browser/viewPickerHandler.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "entryAriaLabel": "{0}, görünüm seçici", + "views": "Görünümler", + "panels": "Paneller", + "terminals": "Terminal", + "terminalTitle": "{0}: {1}", + "channels": "Çıktı", + "openView": "Görünümü Aç", + "quickOpenView": "Görünümü Hızlı Aç" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.i18n.json b/i18n/trk/src/vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..b803c2770e70b4095452ce81d8b42dc089236290 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "relaunchMessage": "Yürürlüğe girmesi için yeniden başlatma gerektiren bir ayar değişti.", + "relaunchDetail": "{0} uygulamasını yeniden başlatmak ve bu ayarı etkinleştirmek için lütfen yeniden başlat butonuna basın.", + "restart": "Yeniden Başlat" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.i18n.json b/i18n/trk/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..bc11b3fbd68cd2dce3b0bd54ac8a5f4eac20d766 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "editorGutterModifiedBackground": "Değiştirilen satırlar için düzenleyici oluğu arka plan rengi.", + "editorGutterAddedBackground": "Eklenen satırlar için düzenleyici oluğu arka plan rengi.", + "editorGutterDeletedBackground": "Silinen satırlar için düzenleyici oluğu arka plan rengi." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/scm/electron-browser/scm.contribution.i18n.json b/i18n/trk/src/vs/workbench/parts/scm/electron-browser/scm.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..2fc322d2c8b845da4d8a75940754161227edd755 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/scm/electron-browser/scm.contribution.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "toggleGitViewlet": "Git'i Göster", + "installAdditionalSCMProviders": "Ek SCM Sağlayıcıları Yükle...", + "source control": "Kaynak Kontrolü", + "toggleSCMViewlet": "SCM'yi Göster", + "view": "Görüntüle" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/scm/electron-browser/scmActivity.i18n.json b/i18n/trk/src/vs/workbench/parts/scm/electron-browser/scmActivity.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..e50c48abb0e4e4d78c025cb4799664de543ba549 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/scm/electron-browser/scmActivity.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "scmPendingChangesBadge": "{0} bekleyen değişiklik" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/scm/electron-browser/scmMenus.i18n.json b/i18n/trk/src/vs/workbench/parts/scm/electron-browser/scmMenus.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..560a8a41990dec39887cee02afebb07d51a62997 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/scm/electron-browser/scmMenus.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "installAdditionalSCMProviders": "Ek SCM Sağlayıcıları Yükle...", + "switch provider": "SCM Sağlayıcısı Değiştir..." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/scm/electron-browser/scmViewlet.i18n.json b/i18n/trk/src/vs/workbench/parts/scm/electron-browser/scmViewlet.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..cd21a41cb42be464d59d37426c406273fc0f6404 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/scm/electron-browser/scmViewlet.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "commitMessage": "Mesaj (commit'lemek için {0} tuşlarına basın)", + "source control": "Kaynak Kontrolü", + "viewletTitle": "{0}: {1}" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/search/browser/openAnythingHandler.i18n.json b/i18n/trk/src/vs/workbench/parts/search/browser/openAnythingHandler.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..248e4e17c5b76a52fa560e13e9c47796cfa03c82 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/search/browser/openAnythingHandler.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "fileAndTypeResults": "dosya ve sembol sonuçları", + "fileResults": "dosya sonuçları" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/search/browser/openFileHandler.i18n.json b/i18n/trk/src/vs/workbench/parts/search/browser/openFileHandler.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..31b328bf639820279d0c4301aefb15bcbe9ba9ac --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/search/browser/openFileHandler.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "entryAriaLabel": "{0}, dosya seçici", + "searchResults": "arama sonuçları" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/search/browser/openSymbolHandler.i18n.json b/i18n/trk/src/vs/workbench/parts/search/browser/openSymbolHandler.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..94ab4f458240fd71cc9a7bd10736e61488e97906 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/search/browser/openSymbolHandler.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "entryAriaLabel": "{0}, sembol seçici", + "symbols": "sembol sonuçları", + "noSymbolsMatching": "Eşleşen sembol yok", + "noSymbolsWithoutInput": "Sembolleri aramak için yazmaya başlayın" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/search/browser/patternInputWidget.i18n.json b/i18n/trk/src/vs/workbench/parts/search/browser/patternInputWidget.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..55adfb8b09096b228835df7a9386626acbfc538d --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/search/browser/patternInputWidget.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "defaultLabel": "giriş", + "patternDescription": "Glob Desenlerini Kullan", + "patternHelpInclude": "Eşleşecek kalıp. ör. tüm JavaScript dosyaları ile eşleşmek için **\\*\\*/*.js** veya bir klasör ve tüm alt elemanları ile eşleşmek için **myFolder/\\*\\***.  \n\n**Başvuru**:\n**\\*** 0 veya daha fazla karakterle eşleşir\n**?** 1 karakterle eşleşir\n**\\*\\*** sıfır veya daha fazla klasörle eşleşir\n**[a-z]** bir karakterler aralığı ile eşleşir\n**{a,b}** kalıplardan herhangi biri ile eşleşir)", + "useIgnoreFilesDescription": "Yok Sayma Dosyalarını Kullan", + "useExcludeSettingsDescription": "Hariç Tutma Ayarlarını Kullan" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/search/browser/replaceService.i18n.json b/i18n/trk/src/vs/workbench/parts/search/browser/replaceService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..279186adb713904c97b932c2acebce65c239ee4a --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/search/browser/replaceService.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "fileReplaceChanges": "{0} ↔ {1} (Değiştirme Önizlemesi)" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/search/browser/search.contribution.i18n.json b/i18n/trk/src/vs/workbench/parts/search/browser/search.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..31355023a76908d5763a952ca280b6e7fb1761c0 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/search/browser/search.contribution.i18n.json @@ -0,0 +1,22 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "showTriggerActions": "Çalışma Alanında Sembole Git...", + "name": "Ara", + "showSearchViewlet": "Aramayı Göster", + "view": "Görüntüle", + "findInFiles": "Dosyalarda Bul", + "openAnythingHandlerDescription": "Dosyaya Git", + "openSymbolDescriptionNormal": "Çalışma Alanında Sembole Git", + "searchOutputChannelTitle": "Ara", + "searchConfigurationTitle": "Ara", + "exclude": "Aramalarda dosyaları ve klasörleri hariç tutmak için glob desenlerini yapılandırın. files.exclude ayarından, tüm glob desenlerini devralır.", + "exclude.boolean": "Dosya yollarının eşleştirileceği glob deseni. Deseni etkinleştirmek veya devre dışı bırakmak için true veya false olarak ayarlayın.", + "exclude.when": "Eşleşen bir dosyanın eşdüzey dosyalarında ek denetim. Eşleşen dosya adı için değişken olarak $(basename) kullanın.", + "useRipgrep": "Metin aramasında Ripgrep kullanılıp kullanılmayacağını denetler", + "useIgnoreFilesByDefault": "Yeni bir çalışma alanında arama yaparken .gitignore ve .ignore dosyalarının varsayılan olarak kullanılıp kullanılmayacağını denetler.", + "search.quickOpen.includeSymbols": "Dosya sonuçlarındaki bir global sembol aramasının sonuçlarının Hızlı Aç'a dahil edilip edilmeyeceğini yapılandırın." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/search/browser/searchActions.i18n.json b/i18n/trk/src/vs/workbench/parts/search/browser/searchActions.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..8b542968177b3498b205eb46297f7109b456e9b3 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/search/browser/searchActions.i18n.json @@ -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. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "nextSearchTerm": "Sonraki Arama Terimini Göster", + "previousSearchTerm": "Önceki Arama Terimini Göster", + "focusNextInputBox": "Sonraki Girdi Kutusuna Odakla", + "focusPreviousInputBox": "Önceki Girdi Kutusuna Odakla", + "replaceInFiles": "Dosyalardakileri Değiştir", + "findInFolder": "Klasörde Bul", + "RefreshAction.label": "Yenile", + "ClearSearchResultsAction.label": "Arama Sonuçlarını Temizle", + "FocusNextSearchResult.label": "Sonraki Arama Sonucuna Odakla", + "FocusPreviousSearchResult.label": "Önceki Arama Sonucuna Odakla", + "RemoveAction.label": "Kaldır", + "file.replaceAll.label": "Tümünü Değiştir", + "match.replace.label": "Değiştir", + "ConfigureGlobalExclusionsAction.label": "Ayarları Aç" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json b/i18n/trk/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..f94aa8eb8739a0af16f64d805b9e672282efa924 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/search/browser/searchResultsView.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "searchMatches": "{0} eşleşme bulundu", + "searchMatch": "{0} eşleşme bulundu", + "fileMatchAriaLabel": "{2} klasöründeki {1} dosyasında {0} eşleşme, Arama sonucu", + "replacePreviewResultAria": "{3} metinli satırdaki {2}. sütunda {1} ile arama terimi {0}", + "searchResultAria": "{2} metinli satırdaki {1}. sütunda terim {0} bulundu" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/search/browser/searchViewlet.i18n.json b/i18n/trk/src/vs/workbench/parts/search/browser/searchViewlet.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..a2fb1ccddfd5fd2adcc080304d092f8f7bda1997 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/search/browser/searchViewlet.i18n.json @@ -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. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "moreSearch": "Arama Detaylarını Aç/Kapat", + "searchScope.includes": "dahil edilecek dosyalar", + "label.includes": "Aramaya Dahil Edilen Kalıplar", + "searchScope.excludes": "hariç tutulacak klasörler", + "label.excludes": "Aramada Hariç Tutulan Kalıplar", + "global.searchScope.folders": "ayarlar ile hariç tutulan dosyalar", + "label.global.excludes": "Yapılandırılmış Aramada Hariç Tutulan Kalıplar", + "replaceAll.confirmation.title": "Tümünü Değiştir", + "replaceAll.confirm.button": "Değiştir", + "replaceAll.occurrence.file.message": "{1} dosyadaki {0} tekrarlama '{2}' ile değiştirildi.", + "removeAll.occurrence.file.message": "{1} dosyadaki {0} tekrarlama değiştirildi.", + "replaceAll.occurrence.files.message": "{1} dosyadaki {0} tekrarlama '{2}' ile değiştirildi.", + "removeAll.occurrence.files.message": "{1} dosyadaki {0} tekrarlama değiştirildi.", + "replaceAll.occurrences.file.message": "{1} dosyadaki {0} tekrarlama '{2}' ile değiştirildi.", + "removeAll.occurrences.file.message": "{1} dosyadaki {0} tekrarlama değiştirildi.", + "replaceAll.occurrences.files.message": "{1} dosyadaki {0} tekrarlama '{2}' ile değiştirildi.", + "removeAll.occurrences.files.message": "{1} dosyadaki {0} tekrarlama değiştirildi.", + "removeAll.occurrence.file.confirmation.message": "{1} dosyadaki {0} tekralama '{2}' ile değiştirilsin mi?", + "replaceAll.occurrence.file.confirmation.message": "{1} dosyadaki {0} tekrarlama değiştirilsin mi?", + "removeAll.occurrence.files.confirmation.message": "{1} dosyadaki {0} tekralama '{2}' ile değiştirilsin mi?", + "replaceAll.occurrence.files.confirmation.message": "{1} dosyadaki {0} tekrarlama değiştirilsin mi?", + "removeAll.occurrences.file.confirmation.message": "{1} dosyadaki {0} tekralama '{2}' ile değiştirilsin mi?", + "replaceAll.occurrences.file.confirmation.message": "{1} dosyadaki {0} tekrarlama değiştirilsin mi?", + "removeAll.occurrences.files.confirmation.message": "{1} dosyadaki {0} tekralama '{2}' ile değiştirilsin mi?", + "replaceAll.occurrences.files.confirmation.message": "{1} dosyadaki {0} tekrarlama değiştirilsin mi?", + "treeAriaLabel": "Arama Sonuçları", + "globLabel": "{1} olduğunda {0}", + "searchMaxResultsWarning": "Sonuç kümesi yalnızca tüm eşleşmelerin bir alt kümesini içerir. Lütfen sonuçları daraltmak için aramanızda daha fazla ayrıntı belirtin.", + "searchCanceled": "Arama, hiçbir sonuç bulunamadan iptal edildi - ", + "noResultsIncludesExcludes": "'{0}' içinde '{1}' hariç tutularak sonuç bulunamadı - ", + "noResultsIncludes": "'{0}' içinde sonuç bulunamadı - ", + "noResultsExcludes": "'{0}' hariç tutularak sonuç bulunamadı - ", + "noResultsFound": "Sonuç bulunamadı. Yapılandırılan hariç tutmalar için ayarlarınızı gözden geçirin - ", + "rerunSearch.message": "Yeniden ara", + "rerunSearchInAll.message": "Tüm dosyalarda yeniden ara", + "openSettings.message": "Ayarları Aç", + "ariaSearchResultsStatus": "Arama ile {1} dosyada {0} sonuç bulundu", + "search.file.result": "{1} dosyada {0} sonuç", + "search.files.result": "{1} dosyada {0} sonuç", + "search.file.results": "{1} dosyada {0} sonuç", + "search.files.results": "{1} dosyada {0} sonuç", + "searchWithoutFolder": "Henüz bir klasör açmadınız. Şu an sadece açık dosyalar aranıyor - ", + "openFolder": "Klasör Aç" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/search/browser/searchWidget.i18n.json b/i18n/trk/src/vs/workbench/parts/search/browser/searchWidget.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..ed5a49ea8eafc0bddc6a4df60e914650b3302c57 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/search/browser/searchWidget.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "search.action.replaceAll.disabled.label": "Tümünü Değiştir (Etkinleştirmek İçin Aramayı Gönderin)", + "search.action.replaceAll.enabled.label": "Tümünü Değiştir", + "search.replace.toggle.button.title": "Değiştirmeyi Aç/Kapat", + "label.Search": "Ara: Arama Terimi girin ve aramak için Enter'a, iptal etmek için Escape tuşuna basın", + "search.placeHolder": "Ara", + "label.Replace": "Değiştir: Değiştirme terimini girin ve önizlemek için Enter'a, iptal etmek için Escape tuşuna basın", + "search.replace.placeHolder": "Değiştir", + "regexp.validationFailure": "İfade her öğe ile eşleşiyor" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/snippets/electron-browser/TMSnippets.i18n.json b/i18n/trk/src/vs/workbench/parts/snippets/electron-browser/TMSnippets.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..07bddc32f480d2e6e6852877d0ff5e13238124e9 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/snippets/electron-browser/TMSnippets.i18n.json @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "vscode.extension.contributes.snippets": "Parçacıklara ekleme yapar.", + "vscode.extension.contributes.snippets-language": "Bu parçacığın ekleneceği dilin tanımlayıcısı.", + "vscode.extension.contributes.snippets-path": "Parçacıklar dosyasının yolu. Yol, eklenti klasörüne görecelidir ve genellikle './snippets/' ile başlar.", + "invalid.language": "`contributes.{0}.language` ögesinde bilinmeyen dil. Sağlanan değer: {1}", + "invalid.path.0": "`contributes.{0}.path` ögesinde dize bekleniyor. Sağlanan değer: {1}", + "invalid.path.1": "`contributes.{0}.path` ögesinin ({1}) eklentinin klasöründe ({2}) yer alması bekleniyor. Bu, eklentiyi taşınamaz yapabilir.", + "badVariableUse": "\"{0}\"-parçacığı yüksek olasılıkla parçacık değişkenleri ile parçacık yer tutucularını karıştırıyor. Daha fazla bilgi için https://code.visualstudio.com/docs/editor/userdefinedsnippets#_snippet-syntax adresini ziyaret edin." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/snippets/electron-browser/insertSnippet.i18n.json b/i18n/trk/src/vs/workbench/parts/snippets/electron-browser/insertSnippet.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..c8734bde48f3dc03495b4947b649f2ccb8fba32a --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/snippets/electron-browser/insertSnippet.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "snippet.suggestions.label": "Parçacık Ekle" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/snippets/electron-browser/snippets.contribution.i18n.json b/i18n/trk/src/vs/workbench/parts/snippets/electron-browser/snippets.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..757de65d2f29f922950552d447553070e8b5e2bb --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/snippets/electron-browser/snippets.contribution.i18n.json @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "openSnippet.label": "Kullanıcı Parçacıklarını Aç", + "openSnippet.pickLanguage": "Parçacık için Dil seçin", + "openSnippet.errorOnCreate": "{0} oluşturulamadı", + "preferences": "Tercihler", + "snippetSchema.json.default": "Boş parçacık", + "snippetSchema.json": "Kullanıcı parçacığı yapılandırması", + "snippetSchema.json.prefix": "Parçacığı IntelliSense'de seçerken kullanılacak ön ek", + "snippetSchema.json.body": "Parçacık içeriği. İmleç konumlarını tanımlamak için '$1', '${1:varsayilanMetin}' kullanın, en son imleç konumu için '$0' kullanın. Değişken değerlerini '${degiskenAdi}' ve '${degiskenAdi:varsayilanMetin}' ile ekleyin, ör. 'Bu bir dosyadır: $TM_FILENAME'.", + "snippetSchema.json.description": "Parçacık açıklaması." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/snippets/electron-browser/snippetsService.i18n.json b/i18n/trk/src/vs/workbench/parts/snippets/electron-browser/snippetsService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..67496ec0c542f2c9cd2212fb225a35054f179ceb --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/snippets/electron-browser/snippetsService.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "detail.userSnippet": "Kullanıcı Parçacığı", + "snippetSuggest.longLabel": "{0}, {1}" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/snippets/electron-browser/tabCompletion.i18n.json b/i18n/trk/src/vs/workbench/parts/snippets/electron-browser/tabCompletion.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..534c795a836663b732f9626a9dcb7af4aabe58a0 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/snippets/electron-browser/tabCompletion.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "tabCompletion": "Ön ekleri eşleştiğinde parçacıkları ekleyin. 'quickSuggestions' etkinleştirilmediği zaman en iyi şekilde çalışır." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/surveys/electron-browser/languageSurveys.contribution.i18n.json b/i18n/trk/src/vs/workbench/parts/surveys/electron-browser/languageSurveys.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..e284a5a8da804321bb1b2462ded909359ecbca8f --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/surveys/electron-browser/languageSurveys.contribution.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "helpUs": "{0} için hizmetimizi iyileştirmemize yardımcı olun", + "takeShortSurvey": "Kısa Ankete Katıl", + "remindLater": "Daha Sonra Hatırlat", + "neverAgain": "Tekrar Gösterme" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/surveys/electron-browser/nps.contribution.i18n.json b/i18n/trk/src/vs/workbench/parts/surveys/electron-browser/nps.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..821add9841da12d69fb3e69e990a6c8aa12608b9 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/surveys/electron-browser/nps.contribution.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "surveyQuestion": "Hızlı bir geri bildirim anketine katılmak ister misiniz?", + "takeSurvey": "Ankete Katıl", + "remindLater": "Daha Sonra Hatırlat", + "neverAgain": "Tekrar Gösterme" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/tasks/browser/buildQuickOpen.i18n.json b/i18n/trk/src/vs/workbench/parts/tasks/browser/buildQuickOpen.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..6d47af97b304c870e05b80d29e5b7ac47056419d --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/tasks/browser/buildQuickOpen.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "tasksAriaLabel": "Bir derleme görevinin adını girin", + "noTasksMatching": "Eşleşen görev yok", + "noTasksFound": "Derleme görevi bulunamadı" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/tasks/browser/quickOpen.i18n.json b/i18n/trk/src/vs/workbench/parts/tasks/browser/quickOpen.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..f17885f7a724264556c64c8fff2aacc13697dc52 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/tasks/browser/quickOpen.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "entryAriaLabel": "{0}, görevler", + "customizeTask": "Görevi Özelleştir" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/tasks/browser/restartQuickOpen.i18n.json b/i18n/trk/src/vs/workbench/parts/tasks/browser/restartQuickOpen.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..d0d2568cfbd5db5f0a138ed2c6d6f14c9afff5cc --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/tasks/browser/restartQuickOpen.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "tasksAriaLabel": "Yeniden başlatılacak görevin adını girin", + "noTasksMatching": "Eşleşen görev yok", + "noTasksFound": "Yeniden başlatılacak bir görev bulunamadı" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/tasks/browser/taskQuickOpen.i18n.json b/i18n/trk/src/vs/workbench/parts/tasks/browser/taskQuickOpen.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..3e235cd503a4c4999cf0b196be6647f82e2068a1 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/tasks/browser/taskQuickOpen.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "tasksAriaLabel": "Çalıştırılacak görevin adını girin", + "noTasksMatching": "Eşleşen görev yok", + "noTasksFound": "Görev bulunamadı" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/tasks/browser/terminateQuickOpen.i18n.json b/i18n/trk/src/vs/workbench/parts/tasks/browser/terminateQuickOpen.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..94241e91741290f48d41ea6dbcf2c5861990abe6 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/tasks/browser/terminateQuickOpen.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "tasksAriaLabel": "Sonlandırılacak görevin adını girin", + "noTasksMatching": "Eşleşen görev yok", + "noTasksFound": "Sonlandırılacak bir görev bulunamadı" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/tasks/browser/testQuickOpen.i18n.json b/i18n/trk/src/vs/workbench/parts/tasks/browser/testQuickOpen.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..a68d96b3def0972ed3c9b92eb747978c5f027421 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/tasks/browser/testQuickOpen.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "tasksAriaLabel": "Bir test görevinin adını girin", + "noTasksMatching": "Eşleşen görev yok", + "noTasksFound": "Test görevi bulunamadı" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/tasks/common/taskConfiguration.i18n.json b/i18n/trk/src/vs/workbench/parts/tasks/common/taskConfiguration.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..204c5be86e6ffb0727055b340d410266730a203c --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/tasks/common/taskConfiguration.i18n.json @@ -0,0 +1,17 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "ConfigurationParser.invalidCWD": "Uyarı: options.cwd dize türünde olmalıdır. {0} değeri yok sayıldı.\n", + "ConfigurationParser.noargs": "Hata: komut argümanları dizelerden oluşan bir dizi olmalıdır. Belirtilen değer:\n{0}", + "ConfigurationParser.noShell": "Uyarı: kabuk yapılandırması sadece görevler terminalde çalıştırılırken desteklenir.", + "ConfigurationParser.noName": "Hata: Kapsam bildiriminde Sorun Eşleştirici'nin bir adı olmalıdır:\n{0}\n", + "ConfigurationParser.unknownMatcherKind": "Uyarı: tanımlanan sorun eşleştirici bilinmiyor. Desteklenen türler: dize | ProblemMatcher | (dize | ProblemMatcher)[].\n{0}\n", + "ConfigurationParser.invalidVaraibleReference": "Hata: Geçersiz problemMatcher başvusu: {0}\n", + "ConfigurationParser.noTaskName": "Hata: görevler bir taskName özelliği belirtmelidir. Görev yok sayılacaktır.\n{0}\n", + "taskConfiguration.shellArgs": "Uyarı: '{0}' görevi bir kabuk komutudur ve komut adı veya argümanlarından biri kaçış karakteri içermeyen boşluklar içeriyor. Doğru komut satırı alıntılamasını sağlamak için lütfen argümanları komutlarla birleştirin.", + "taskConfiguration.noCommandOrDependsOn": "Hata: '{0}' görevi bir komut veya dependsOn özelliği belirtmiyor. Görev yok sayılacaktır. Görevin tanımı:\n{1}", + "taskConfiguration.noCommand": "Hata: '{0}' görevi bir komut tanımlamıyor. Görev yok sayılacaktır. Görevin tanımı:\n{1}" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/tasks/common/taskTemplates.i18n.json b/i18n/trk/src/vs/workbench/parts/tasks/common/taskTemplates.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..0ad2a2013d4eb77aa48532cfd682a76192a5e059 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/tasks/common/taskTemplates.i18n.json @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "tsc.config": "Bir TypeScript projesi derler", + "tsc.watch": "İzleme moduna bir TypeScript projesi derler", + "dotnetCore": ".NET Core derleme komutu çalıştırır", + "msbuild": "Derleme hedefini çalıştırır", + "externalCommand": "İsteğe bağlı bir harici komut çalıştırma örneği", + "Maven": "Yaygın maven komutlarını çalıştırır" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/tasks/electron-browser/jsonSchemaCommon.i18n.json b/i18n/trk/src/vs/workbench/parts/tasks/electron-browser/jsonSchemaCommon.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..d02d11f0ce33e6ec18e1b2bc102b161eda9664d8 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/tasks/electron-browser/jsonSchemaCommon.i18n.json @@ -0,0 +1,39 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "JsonSchema.options": "Ek komut seçenekleri", + "JsonSchema.options.cwd": "Çalıştırılan program veya betiğin geçerli çalışma klasörü. Atlanırsa Code'un geçerli çalışma alanının kök dizini kullanılır.", + "JsonSchema.options.env": "Çalıştırılan program veya kabuğun ortamı. Atlanırsa üst işlemin ortamı kullanılır.", + "JsonSchema.shellConfiguration": "Kullanılacak kabuğu özelleştirir.", + "JsonSchema.shell.executable": "Kullanılacak kabuk.", + "JsonSchema.shell.args": "Kabuk argümanları.", + "JsonSchema.command": "Çalıştırılacak komut. Harici bir program veya bir kabuk komutu olabilir.", + "JsonSchema.tasks.args": "Bu görev çağrıldığında, komuta iletilecek argümanlar.", + "JsonSchema.tasks.taskName": "Görevin adı", + "JsonSchema.tasks.windows": "Windows'a özel komut yapılandırması", + "JsonSchema.tasks.mac": "Mac'e özel komut yapılandırması", + "JsonSchema.tasks.linux": "Linux'a özel komut yapılandırması", + "JsonSchema.tasks.suppressTaskName": "Görev adının komuta argüman olarak eklenip eklenmeyeceğini denetler. Atlanırsa global olarak tanımlanan değer kullanılır.", + "JsonSchema.tasks.showOutput": "Çalışan görev çıktısının görünüp görünmeyeceğini denetler. Atlanırsa global olarak tanımlanan değer kullanılır.", + "JsonSchema.echoCommand": "Çalıştırılan komutun çıktıya yazıp yazmayacağını denetler. Varsayılan olarak kapalıdır.", + "JsonSchema.tasks.watching.deprecation": "Kullanım dışı. Bunun yerine isBackground ögesini kullanın.", + "JsonSchema.tasks.watching": "Çalıştırılan görevin etkin tutulup tutulmadığı ve dosya sistemini izleyip izlemediği.", + "JsonSchema.tasks.background": "Çalıştırılan görevin etkin tutulup tutulmadığı ve arka planda çalışıp çalışmadığı.", + "JsonSchema.tasks.promptOnClose": "VS Code'un çalışan bir görevle kapatılırken kullanıcının uyarılıp uyarılmayacağı.", + "JsonSchema.tasks.build": "Bu görevi, Code'un varsayılan derleme komutuna eşler.", + "JsonSchema.tasks.test": "Bu görevi, Code'un varsayılan test komutuna eşler.", + "JsonSchema.tasks.matchers": "Kullanılacak problem eşleştirici(leri). Bir dize veya bir problem eşleştirici tanımı veya bir dize ve problem eşleştiricileri dizisi.", + "JsonSchema.args": "Komuta iletilecek ek argümanlar.", + "JsonSchema.showOutput": "Çalışan görev çıktısının görünüp görünmeyeceğini denetler. Atlanırsa \"daima\" olarak varsayılır.", + "JsonSchema.watching.deprecation": "Kullanım dışı. Bunun yerine isBackground ögesini kullanın.", + "JsonSchema.watching": "Çalıştırılan görevin etkin tutulup tutulmadığı ve dosya sistemini izleyip izlemediği.", + "JsonSchema.background": "Çalıştırılan görevin etkin tutulup tutulmadığı ve arka planda çalışıp çalışmadığı.", + "JsonSchema.promptOnClose": "VS Code'un arka planda çalışan bir görevle kapatılırken kullanıcının uyarılıp uyarılmayacağı.", + "JsonSchema.suppressTaskName": "Görev adının komuta argüman olarak eklenip eklenmeyeceğini denetler. Varsayılan olarak kapalıdır.", + "JsonSchema.taskSelector": "Bir argümanın, görev olduğunu gösterecek ön ek.", + "JsonSchema.matchers": "Kullanılacak problem eşleştirici(leri). Bir dize veya bir problem eşleştirici tanımı veya bir dize ve problem eşleştiricileri dizisi.", + "JsonSchema.tasks": "Görev yapılandırmaları. Genellikle harici görev çalıştırıcısında tanımlı görevin zenginleştirilmesidir." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v1.i18n.json b/i18n/trk/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v1.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..8717a0ca787ef366abc5d35fcfd465062bfd75f5 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v1.i18n.json @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "JsonSchema.version": "Yapılandırmanın sürüm numarası.", + "JsonSchema._runner": "\"runner\" görevini tamamladı. Resmi runner özelliğini kullanın", + "JsonSchema.runner": "Görevin bir işlem olarak çalıştırılıp çalıştırılmayacağını ve çıktının, çıktı penceresinde veya terminalin içinde gösterilip gösterilmeyeceğini denetler.", + "JsonSchema.windows": "Windows'a özel komut yapılandırması", + "JsonSchema.mac": "Mac'e özel komut yapılandırması", + "JsonSchema.linux": "Linux'a özel komut yapılandırması", + "JsonSchema.shell": "Komutun bir kabuk komutu veya harici bir program olup olmadığını belirtir. Atlanırsa hayır olarak kabul edilir." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.i18n.json b/i18n/trk/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..138ef85921ab3b8134a0dc040b4a9e7b5d63ed8b --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.i18n.json @@ -0,0 +1,17 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "JsonSchema.shell": "Komutun bir kabuk komutu veya harici bir program olup olmadığını belirtir. Atlanırsa hayır olarak kabul edilir.", + "JsonSchema.tasks.dependsOn.string": "Bu görevin bağlı olduğu başka bir görev.", + "JsonSchema.tasks.dependsOn.array": "Bu görevin bağlı olduğu diğer görevler.", + "JsonSchema.tasks.group": "Bu görevin ait olduğu çalıştırma grubunu tanımlar. Atlanırsa, görev hiçbir gruba ait olmaz.", + "JsonSchema.tasks.type": "Görevin bir işlem olarak veya bir kabukta komut olarak çalıştırılıp çalıştırılmayacağını tanımlar. Varsayılan işlem olarak çalıştırmaktır.", + "JsonSchema.version": "Yapılandırmanın sürüm numarası.", + "JsonSchema.tasks.customize": "Özelleştirilecek ekleme yapılan görev.", + "JsonSchema.windows": "Windows'a özel komut yapılandırması", + "JsonSchema.mac": "Mac'e özel komut yapılandırması", + "JsonSchema.linux": "Linux'a özel komut yapılandırması" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json b/i18n/trk/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..536ad1269e06ded7f0000125d37f3e1aeb292814 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/tasks/electron-browser/task.contribution.i18n.json @@ -0,0 +1,51 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "tasksCategory": "Görevler", + "ConfigureTaskRunnerAction.noWorkspace": "Görevler, sadece çalışma alanı klasöründe mevcuttur.", + "ConfigureTaskRunnerAction.quickPick.template": "Bir Görev Çalıştırıcısı Seç", + "ConfigureTaskRunnerAction.autoDetecting": "{0} görevleri otomatik algılanıyor", + "ConfigureTaskRunnerAction.autoDetect": "Görev sisteminin otomatik algılanması başarısız oldu. Varsayılan şablon kullanılıyor. Ayrıntılar için görev çıktısına bakın.", + "ConfigureTaskRunnerAction.autoDetectError": "Görev sisteminin otomatik algılanması sırasında hatalar oluştu. Ayrıntılar için görev çıktısına bakın.", + "ConfigureTaskRunnerAction.failed": " '.vscode' klasörü içinde 'tasks.json' dosyası oluşturulamıyor. Ayrıntılar için görev çıktısına bakın.", + "ConfigureTaskRunnerAction.label": "Görev Çalıştırıcısını Yapılandır", + "ConfigureBuildTaskAction.label": "Derleme Görevini Yapılandır", + "CloseMessageAction.label": "Kapat", + "ShowTerminalAction.label": "Terminali Görüntüle", + "problems": "Sorunlar", + "manyMarkers": "99+", + "tasks": "Görevler", + "TaskSystem.noHotSwap": "Görev yürütme motorunu değiştirmek VS Code'u yeniden başlatmayı gerektirir. Değişiklik yok sayıldı.", + "TaskService.noBuildTask": "Derleme görevi tanımlanmamış. task.json dosyasındaki bir görevi 'isBuildCommand' ile işaretleyin.", + "TaskService.noTestTask": "Test görevi tanımlanmamış. task.json dosyasındaki bir testi 'isTestCommand' ile işaretleyin.", + "TaskServer.noTask": " Çalıştırılmak istenen {0} görevi bulunamadı.", + "customizeParseErrors": "Geçerli görev yapılandırmasında hatalar var. Lütfen, bir görevi özelleştirmeden önce ilk olarak hataları düzeltin.", + "moreThanOneBuildTask": "task.json dosyasında tanımlı çok fazla derleme görevi var. İlk görev çalıştırılıyor.\n", + "TaskSystem.activeSame.background": "Görev zaten aktif ve arka plan modunda. Görevi sonlandırmak için `F1 > görevi sonlandır`ı kullanın", + "TaskSystem.active": "Çalışan bir görev zaten var. Bir başkasını çalıştırmadan önce bu görevi sonlandırın.", + "TaskSystem.restartFailed": "{0} görevini sonlandırma ve yeniden başlatma başarısız oldu", + "TaskSystem.configurationErrors": "Hata: belirtilen görev yapılandırmasında doğrulama hataları var ve kullanılamıyor. Lütfen ilk olarak hataları düzeltin.", + "TaskSystem.invalidTaskJson": "Hata: task.json dosyasının içeriğinde sentaks hataları var. Lütfen, bir görevi çalıştırmadan önce hataları düzeltin.\n", + "TaskSystem.runningTask": "Çalışan bir görev var. Bu görevi sonlandırmak istiyor musunuz?", + "TaskSystem.terminateTask": "&&Görevi Sonlandır", + "TaskSystem.noProcess": "Başlatılan görev artık mevcut değil. Eğer görev arka plan işlemleri oluşturduysa, VS Code'dan çıkmak işlemlerin sahipsiz kalmasına neden olabilir. Bunu önlemek için son arka plan işlemini bekle işaretçisiyle başlatın.", + "TaskSystem.exitAnyways": "Yine de &&Çık", + "TerminateAction.label": "Çalışan Görevi Sonlandır", + "TaskSystem.unknownError": "Bir görev çalıştırılırken hata oluştu. Detaylar için görev günlüğüne bakın.", + "TaskService.noWorkspace": "Görevler, sadece çalışma alanı klasöründe mevcuttur.", + "TerminateAction.noProcess": "Başlatılan işlem artık mevcut değil. Eğer görev arka plan görevleri oluşturduysa, VS Code'dan çıkmak işlemlerin sahipsiz kalmasına neden olabilir.", + "TerminateAction.failed": "Çalışan görevi sonlandırma başarısız oldu.", + "ShowLogAction.label": "Görev Günlüğünü Göster", + "RunTaskAction.label": "Görevi Çalıştır", + "RestartTaskAction.label": "Görevi Yeniden Başlat", + "BuildAction.label": "Derleme Görevini Çalıştır", + "TestAction.label": "Test Görevini Çalıştır", + "quickOpen.task": "Görevi Çalıştır", + "quickOpen.terminateTask": "Görevi Sonlandır", + "quickOpen.restartTask": "Görevi Yeniden Başlat", + "quickOpen.buildTask": "Derleme Görevi", + "quickOpen.testTask": "Test Görevi" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.i18n.json b/i18n/trk/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..d3492257f35b4a77b9c8887055c6436596d8bb48 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "TerminalTaskSystem.unknownError": "Görev çalıştırılırken bir hata oluştu. Detaylar için görev çıktısı günlüğüne bakın.", + "TerminalTaskSystem.terminalName": "Görev - {0}", + "reuseTerminal": "Terminal görevler tarafından tekrar kullanılacak, kapatmak için herhangi bir tuşa basın.", + "TerminalTaskSystem": "UNC sürücüsünde kabuk komutu yürütülemez.", + "unkownProblemMatcher": "{0} sorun eşleştirici çözümlenemiyor. Eşleştirici yok sayılacaktır." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/tasks/node/processRunnerDetector.i18n.json b/i18n/trk/src/vs/workbench/parts/tasks/node/processRunnerDetector.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..bd7194ed6ee5bb1dd1b288bbeb14c3db39564d59 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/tasks/node/processRunnerDetector.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "TaskSystemDetector.noGulpTasks": "gulp --tasks-simple komutu çalıştırıldığında herhangi bir görev listelemedi. npm install komutunu çalıştırdınız mı?", + "TaskSystemDetector.noJakeTasks": "jake --tasks komutu çalıştırıldığında herhangi bir görev listelemedi. npm install komutunu çalıştırdınız mı?", + "TaskSystemDetector.noGulpProgram": "Gulp, sisteminizde yüklü değil. Yüklemek için npm install -g gulp komutunu çalıştırın.", + "TaskSystemDetector.noJakeProgram": "Jake, sisteminizde yüklü değil. Yüklemek için npm install -g jake komutunu çalıştırın.", + "TaskSystemDetector.noGruntProgram": "Grunt, sisteminizde yüklü değil. Yüklemek için npm install -g grunt komutunu çalıştırın.", + "TaskSystemDetector.noProgram": "{0} programı bulunamadı. Mesaj: {1}", + "TaskSystemDetector.buildTaskDetected": "'{0}' olarak adlandırılmış derleme görevi algılandı.", + "TaskSystemDetector.testTaskDetected": "'{0}' olarak adlandırılmış test görevi algılandı." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/tasks/node/processTaskSystem.i18n.json b/i18n/trk/src/vs/workbench/parts/tasks/node/processTaskSystem.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..f5da8b2c7db020c2ba63d5a97d860db12af30884 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/tasks/node/processTaskSystem.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "TaskRunnerSystem.unknownError": "Görev çalıştırılırken bir hata oluştu. Detaylar için görev çıktısı günlüğüne bakın.", + "TaskRunnerSystem.watchingBuildTaskFinished": "\nDerleme görevlerinin izlenmesi bitti.", + "TaskRunnerSystem.childProcessError": "Harici program {0} {1} başlatılamadı.", + "TaskRunnerSystem.cancelRequested": "\n'{0}' görevi kullanıcı isteği üzerine sonlandırıldı.", + "unkownProblemMatcher": "{0} sorun eşleştirici çözümlenemiyor. Eşleştirici yok sayılacaktır." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/terminal/electron-browser/terminal.contribution.i18n.json b/i18n/trk/src/vs/workbench/parts/terminal/electron-browser/terminal.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..76b62e0169e5997b7f141ed14b8de9581a97ad64 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/terminal/electron-browser/terminal.contribution.i18n.json @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "terminalIntegratedConfigurationTitle": "Entegre Terminal", + "terminal.integrated.shell.linux": "Terminalin Linux'da kullandığı kabuğun yolu.", + "terminal.integrated.shellArgs.linux": "Linux terminalindeyken kullanılacak komut satırı argümanları.", + "terminal.integrated.shell.osx": "Terminalin OS X'de kullandığı kabuğun yolu.", + "terminal.integrated.shellArgs.osx": "OS X terminalindeyken kullanılacak komut satırı argümanları.", + "terminal.integrated.shell.windows": "Terminalin Windows'da kullandığı kabuğun yolu. Windows ile birlikte gelen kabukları kullanırken (cmd, PowerShell veya Bash on Ubuntu), 64 bit sürümlerini kullanmak için C:\\Windows\\System32 yerine C:\\Windows\\sysnative yolunu tercih edin.", + "terminal.integrated.shellArgs.windows": "Windows terminalindeyken kullanılacak komut satırı argümanları.", + "terminal.integrated.rightClickCopyPaste": "Ayarlandığında, terminal içinde sağ tıklandığında bağlam menüsünün görünmesini engeller, onun yerine bir seçim varsa kopyalama yapar, bir seçim yoksa yapıştırma yapar.", + "terminal.integrated.fontFamily": "Terminalin yazı tipi ailesini denetler; bu, varsayılan olarak editor.fontFamily'nin değeridir.", + "terminal.integrated.fontLigatures": "Terminalde yazı tipi ligatürlerinin etkinleştirilip etkinleştirilmeyeceğini denetler.", + "terminal.integrated.fontSize": "Terminaldeki yazı tipi boyutunu piksel olarak denetler.", + "terminal.integrated.lineHeight": "Terminalin satır yüksekliğini denetler, bu sayı gerçek satır yüksekliğini piksel olarak elde etmek için terminal yazı tipi boyutu ile çarpılır.", + "terminal.integrated.enableBold": "Terminalde kalın yazının etkinleştirilip etkinleştirilmeyeceği; bu, terminal kabuğunun desteğini gerektirir.", + "terminal.integrated.cursorBlinking": "Terminaldeki imlecin yanıp sönmesini denetler.", + "terminal.integrated.cursorStyle": "Terminaldeki imlecin stilini denetler.", + "terminal.integrated.scrollback": "Terminalin tamponunda tuttuğu maksimum satır sayısını denetler.", + "terminal.integrated.setLocaleVariables": "Terminal başlangıcında yereli içeren değişkenlerin ayarlanıp ayarlanmayacağını denetler; bu, OS X'de varsayılan olarak açıktır, diğer platformlarda kapalıdır.", + "terminal.integrated.cwd": "Terminalin nerede başlatılacağına ait açık bir yol; bu, kabuk işlemleri için geçerli çalışma klasörü (cwd) olarak kullanılır. Bu, çalışma alanı ayarlarında kök dizini uygun bir cwd değilse özellikle yararlı olabilir.", + "terminal.integrated.confirmOnExit": "Aktif terminal oturumları varken çıkışta onay istenip istenmeyeceği.", + "terminal.integrated.commandsToSkipShell": "Tuş bağlarının kabuğa gönderilmeyip bunun yerine her zaman Code tarafından işleneceği bir komut ID'leri kümesi. Bu, tuş bağlarının normalde kabuk tarafından terminal odakta değilken nasılsa öyle davranmasını sağlar, örnek olarak Hızlı Aç'ı başlatmak için ctrl+p.", + "terminal": "Terminal", + "terminalCategory": "Terminal", + "viewCategory": "Görüntüle" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/terminal/electron-browser/terminalActions.i18n.json b/i18n/trk/src/vs/workbench/parts/terminal/electron-browser/terminalActions.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..7ee287790c0e3c0991f7946da8d0f7280752e6e5 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/terminal/electron-browser/terminalActions.i18n.json @@ -0,0 +1,37 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "workbench.action.terminal.toggleTerminal": "Entegre Terminali Aç/Kapat", + "workbench.action.terminal.kill": "Aktif Terminal Örneğini Sonlandır", + "workbench.action.terminal.kill.short": "Terminali Sonlandır", + "workbench.action.terminal.copySelection": "Seçimi Kopyala", + "workbench.action.terminal.selectAll": "Tümünü Seç", + "workbench.action.terminal.new": "Yeni Entegre Terminal Oluştur", + "workbench.action.terminal.new.short": "Yeni Terminal", + "workbench.action.terminal.focus": "Terminale Odakla", + "workbench.action.terminal.focusNext": "Sonraki Terminale Odakla", + "workbench.action.terminal.focusAtIndex": "{0}. Terminale Odakla", + "workbench.action.terminal.focusPrevious": "Önceki Terminale Odakla", + "workbench.action.terminal.paste": "Aktif Terminale Yapıştır", + "workbench.action.terminal.DefaultShell": "Varsayılan Kabuğu Seç", + "workbench.action.terminal.runSelectedText": "Seçili Metni Aktif Terminalde Çalıştır", + "workbench.action.terminal.runActiveFile": "Aktif Dosyayı Aktif Terminalde Çalıştır", + "workbench.action.terminal.runActiveFile.noFile": "Sadece diskteki dosyalar terminalde çalıştırılabilir", + "workbench.action.terminal.switchTerminalInstance": "Terminal Örneğini Değiştir", + "workbench.action.terminal.scrollDown": "Aşağı Kaydır (Satır)", + "workbench.action.terminal.scrollDownPage": "Aşağı Kaydır (Sayfa)", + "workbench.action.terminal.scrollToBottom": "En Alta Kaydır", + "workbench.action.terminal.scrollUp": "Yukarı Kaydır (Satır)", + "workbench.action.terminal.scrollUpPage": "Yukarı Kaydır (Sayfa)", + "workbench.action.terminal.scrollToTop": "En Üste Kaydır", + "workbench.action.terminal.clear": "Temizle", + "workbench.action.terminal.allowWorkspaceShell": "Çalışma Alanı Kabuk Yapılandırmasına İzin Ver", + "workbench.action.terminal.disallowWorkspaceShell": "Çalışma Alanı Kabuk Yapılandırmasına İzin Verme", + "workbench.action.terminal.rename": "Yeniden Adlandır", + "workbench.action.terminal.rename.prompt": "Terminal adını girin", + "workbench.action.terminal.focusFindWidget": "Bulma Aracına Odakla", + "workbench.action.terminal.hideFindWidget": "Bulma Aracını Gizle" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/terminal/electron-browser/terminalColorRegistry.i18n.json b/i18n/trk/src/vs/workbench/parts/terminal/electron-browser/terminalColorRegistry.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..56cc70a5239aa3047851fe1b088f31ff3bd0609f --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/terminal/electron-browser/terminalColorRegistry.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "terminal.background": "Terminalin arka plan rengi; bu, terminalin panelden farklı olarak renklendirilmesini sağlar.", + "terminal.foreground": "Terminalin ön plan rengi.", + "terminal.ansiColor": "Terminalde '{0}' ANSI rengi." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/terminal/electron-browser/terminalConfigHelper.i18n.json b/i18n/trk/src/vs/workbench/parts/terminal/electron-browser/terminalConfigHelper.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..745f1badf0aadc61bf2b61adfb915e113257a1cb --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/terminal/electron-browser/terminalConfigHelper.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "terminal.integrated.allowWorkspaceShell": "{0} ögesinin (çalışma alanı ayarı olarak tanımlı) terminalde başlatılmasına izin veriyor musunuz?", + "allow": "İzin Ver", + "disallow": "İzin Verme" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/terminal/electron-browser/terminalFindWidget.i18n.json b/i18n/trk/src/vs/workbench/parts/terminal/electron-browser/terminalFindWidget.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..baad53fc2a424607efe339cd68f013483266350e --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/terminal/electron-browser/terminalFindWidget.i18n.json @@ -0,0 +1,12 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "label.find": "Bul", + "placeholder.find": "Bul", + "label.previousMatchButton": "Önceki eşleşme", + "label.nextMatchButton": "Sonraki eşleşme", + "label.closeButton": "Kapat" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.i18n.json b/i18n/trk/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..38dcd5eb951032baa69d0d134a14c982e1d09b7e --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "terminal.integrated.copySelection.noSelection": "Terminalde kopyalanacak bir seçim bulunmuyor", + "terminal.integrated.exitedWithCode": "Terminal işlemi şu çıkış koduyla sonlandı: {0}", + "terminal.integrated.waitOnExit": "Terminali kapatmak için lütfen bir tuşa basın", + "terminal.integrated.launchFailed": "Terminal işlem komutu `{0}{1}` başlatılamadı (çıkış kodu: {2})" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/terminal/electron-browser/terminalLinkHandler.i18n.json b/i18n/trk/src/vs/workbench/parts/terminal/electron-browser/terminalLinkHandler.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..0b0eeab242ac02b2454ea834a76e6cfe61e787a9 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/terminal/electron-browser/terminalLinkHandler.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "terminalLinkHandler.followLinkCmd": "Bağlantıyı izlemek için Cmd tuşuna basarak tıklayın", + "terminalLinkHandler.followLinkCtrl": "Bağlantıyı izlemek için Ctrl tuşuna basarak tıklayın" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/terminal/electron-browser/terminalPanel.i18n.json b/i18n/trk/src/vs/workbench/parts/terminal/electron-browser/terminalPanel.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..e3fb6347294f4eb30f2dc2e9bbc7e71a3d6b950b --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/terminal/electron-browser/terminalPanel.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "copy": "Kopyala", + "createNewTerminal": "Yeni Terminal", + "paste": "Yapıştır", + "clear": "Temizle" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/terminal/electron-browser/terminalService.i18n.json b/i18n/trk/src/vs/workbench/parts/terminal/electron-browser/terminalService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..28fa93d323a9d15e9a160f397a2c94336b5eed8b --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/terminal/electron-browser/terminalService.i18n.json @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "terminal.integrated.chooseWindowsShellInfo": "Özelleştir butonuna tıklayıp varsayılan terminal kabuğunu seçebilirsiniz.", + "customize": "Özelleştir", + "cancel": "İptal", + "never again": "Tamam, Tekrar Gösterme", + "terminal.integrated.chooseWindowsShell": "Tercih ettiğiniz terminal kabuğunu seçin, bunu daha sonra ayarlarınızdan değiştirebilirsiniz", + "terminalService.terminalCloseConfirmationSingular": "Aktif bir terminal oturumu var, sonlandırmak istiyor musunuz?", + "terminalService.terminalCloseConfirmationPlural": "{0} aktif terminal oturumu var, bunları sonlandırmak istiyor musunuz?", + "yes": "Evet" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json b/i18n/trk/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..ef4e0417b9d60f52a1f127ca410ea12343448fd7 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/themes/electron-browser/themes.contribution.i18n.json @@ -0,0 +1,19 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "selectTheme.label": "Renk Teması", + "installColorThemes": "Ek Renk Temaları Yükle...", + "themes.selectTheme": "Bir Renk Teması Seç (Yukarı/Aşağı Tuşlarıyla Önizleme Yap)", + "selectIconTheme.label": "Dosya Simgesi Teması", + "installIconThemes": "Ek Dosya Simgesi Temaları Yükle...", + "noIconThemeLabel": "Hiçbiri", + "noIconThemeDesc": "Dosya simgelerini devre dışı bırak", + "problemChangingIconTheme": "Simge temasını ayarlama sorunu: {0}", + "themes.selectIconTheme": "Dosya Simgesi Teması Seç", + "generateColorTheme.label": "Geçerli Ayarlardan Renk Teması Oluştur", + "preferences": "Tercihler", + "developer": "Geliştirici" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/trust/electron-browser/unsupportedWorkspaceSettings.contribution.i18n.json b/i18n/trk/src/vs/workbench/parts/trust/electron-browser/unsupportedWorkspaceSettings.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..6e2f9a6845f0254a7e6aeec8742fe74cae5eb375 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/trust/electron-browser/unsupportedWorkspaceSettings.contribution.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "unsupportedWorkspaceSettings": "Bu çalışma alanı sadece Kullanıcı Ayarları'nda ayarlanabilen ayarlar içeriyor. ({0})", + "openWorkspaceSettings": "Çalışma Alanı Ayarlarını Aç", + "openDocumentation": "Daha Fazla Bilgi Edin", + "ignore": "Yok Say" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/update/electron-browser/releaseNotesInput.i18n.json b/i18n/trk/src/vs/workbench/parts/update/electron-browser/releaseNotesInput.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..cd4ef89692af259d3334cc26c14f9841bbd60a25 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/update/electron-browser/releaseNotesInput.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "releaseNotesInputName": "Sürüm Notları: {0}" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/update/electron-browser/update.contribution.i18n.json b/i18n/trk/src/vs/workbench/parts/update/electron-browser/update.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..a8342747ede92f7503ab74fef0ac8ea516a52c99 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/update/electron-browser/update.contribution.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "release notes": "Sürüm notları", + "updateConfigurationTitle": "Güncelle", + "updateChannel": "Güncelleştirme kanalından otomatik güncelleştirmeler alıp almayacağınızı ayarlayın. Değişiklikten sonra yeniden başlatma gerektirir." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/update/electron-browser/update.i18n.json b/i18n/trk/src/vs/workbench/parts/update/electron-browser/update.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..b03c4aaf2303a9b6819383f74d483780f5ec0ada --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/update/electron-browser/update.i18n.json @@ -0,0 +1,32 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "updateNow": "Şimdi Güncelle", + "later": "Daha Sonra", + "unassigned": "atanmamış", + "releaseNotes": "Sürüm Notları", + "showReleaseNotes": "Sürüm Notlarını Göster", + "downloadNow": "Şimdi İndir", + "read the release notes": "{0} v{1} uygulamasına hoş geldiniz! Sürüm Notları'nı okumak ister misiniz?", + "licenseChanged": "Lisans koşullarımız değişti, lütfen inceleyin.", + "license": "Lisansı Oku", + "updateAvailable": "{0} yeniden başlatıldıktan sonra güncellenecektir.", + "thereIsUpdateAvailable": "Bir güncelleştirme var.", + "noUpdatesAvailable": "Şu anda mevcut herhangi bir güncelleme yok.", + "updateIsReady": "Yeni güncelleştirme var.", + "commandPalette": "Komut Paleti...", + "settings": "Ayarlar", + "keyboardShortcuts": "Klavye Kısayolları", + "selectTheme.label": "Renk Teması", + "themes.selectIconTheme.label": "Dosya Simgesi Teması", + "not available": "Güncelleştirme Yok", + "checkingForUpdates": "Güncelleştirmeler Denetleniyor...", + "DownloadUpdate": "Mevcut Güncelleştirmeyi İndir", + "DownloadingUpdate": "Güncelleştirme İndiriliyor...", + "InstallingUpdate": "Güncelleştirme Yükleniyor...", + "restartToUpdate": "Güncelleştirmek için Yeniden Başlatın...", + "checkForUpdates": "Güncelleştirmeleri Denetle..." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/views/browser/views.i18n.json b/i18n/trk/src/vs/workbench/parts/views/browser/views.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..13520a7bd48b5b7157872e3f2987ac5c3743ecd1 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/views/browser/views.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "viewToolbarAriaLabel": "{0} eylem" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/views/browser/viewsExtensionPoint.i18n.json b/i18n/trk/src/vs/workbench/parts/views/browser/viewsExtensionPoint.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..e6729315d5a4e353157d9065d575c852b539a29a --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/views/browser/viewsExtensionPoint.i18n.json @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "requirearray": "görünümler bir dizi olmalıdır", + "requirestring": "`{0}` özelliği zorunludur ve `string` türünde olmalıdır", + "optstring": "`{0}` özelliği atlanabilir veya `string` türünde olmalıdır", + "vscode.extension.contributes.view.id": "Görünümün tanımlayıcısı. Bunu, `vscode.window.registerTreeDataProviderForView` API ile bir veri sağlayıcısı kaydetmek için kullanın. Ayrıca `onView:${id}` olayını `activationEvents` ögesine kaydederek eklentinizi etkinleştirmeyi tetikleyin.", + "vscode.extension.contributes.view.name": "Görünümün insanlar tarafından okunabilir adı. Gösterilecektir", + "vscode.extension.contributes.view.when": "Bu görünümü göstermek için doğru olması gereken koşul", + "vscode.extension.contributes.views": "Görünümleri düzenleyiciye ekler.", + "views.explorer": "Gezgin Görünümü", + "locationId.invalid": "`{0}` geçerli bir görünüm konumu değil" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/watermark/electron-browser/watermark.i18n.json b/i18n/trk/src/vs/workbench/parts/watermark/electron-browser/watermark.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..069fea26d958308489040b3acce07f051d26caa5 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/watermark/electron-browser/watermark.i18n.json @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "watermark.showCommands": "Tüm Komutları Göster", + "watermark.quickOpen": "Dosyaya Git", + "watermark.openFile": "Dosya Aç", + "watermark.openFolder": "Klasör Aç", + "watermark.openFileFolder": "Dosya veya Klasör Aç", + "watermark.openRecent": "Son Kullanılanları Aç", + "watermark.newUntitledFile": "Yeni İsimsiz Dosya", + "watermark.toggleTerminal": "Terminali Aç/Kapat", + "watermark.findInFiles": "Dosyalarda Bul", + "watermark.startDebugging": "Hata Ayıklamaya Başla", + "watermark.selectTheme": "Temayı Değiştir", + "watermark.selectKeymap": "Tuş Haritasını Değiştir", + "watermark.keybindingsReference": "Klavye Başvurusu", + "watermark.openGlobalKeybindings": "Klavye Kısayolları", + "watermark.unboundCommand": "serbest", + "workbenchConfigurationTitle": "Çalışma Ekranı", + "tips.enabled": "Etkinleştirildiğinde, hiçbir düzenleyici açık değilken filigran ipuçları gösterir" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/welcome/overlay/browser/welcomeOverlay.i18n.json b/i18n/trk/src/vs/workbench/parts/welcome/overlay/browser/welcomeOverlay.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..0c942884ab68a618cb871adf4f58e1554a70fa4d --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/welcome/overlay/browser/welcomeOverlay.i18n.json @@ -0,0 +1,17 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "welcomeOverlay.explorer": "Dosya gezgini", + "welcomeOverlay.search": "Dosyalar arasında ara", + "welcomeOverlay.git": "Kaynak kodu yönetimi", + "welcomeOverlay.debug": "Başlat ve hata ayıkla", + "welcomeOverlay.extensions": "Eklentileri yönet", + "welcomeOverlay.problems": "Hataları ve uyarıları görüntüle", + "welcomeOverlay.commandPalette": "Tüm komutları bul ve çalıştır", + "welcomeOverlay": "Kullanıcı Arayüzüne Genel Bakış", + "hideWelcomeOverlay": "Arayüz Genel Bakışını Gizle", + "help": "Yardım" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json b/i18n/trk/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..807fbc62c1565316f86962d913f745e21d64808f --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.i18n.json @@ -0,0 +1,43 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "welcomePage.vscode": "Visual Studio Code", + "welcomePage.editingEvolved": "Düzenleme evrim geçirdi", + "welcomePage.start": "Başlangıç", + "welcomePage.newFile": "Yeni dosya", + "welcomePage.openFolder": "Klasör aç...", + "welcomePage.cloneGitRepository": "Git deposu kopyala...", + "welcomePage.recent": "Son Kullanılanlar", + "welcomePage.moreRecent": "Diğerleri...", + "welcomePage.noRecentFolders": "Son kullanılan klasör yok", + "welcomePage.help": "Yardım", + "welcomePage.keybindingsCheatsheet": "Yazdırılabilir klavye kopya kağıdı", + "welcomePage.introductoryVideos": "Tanıtım videoları", + "welcomePage.productDocumentation": "Ürün belgeleri", + "welcomePage.gitHubRepository": "GitHub deposu", + "welcomePage.stackOverflow": "Stack Overflow", + "welcomePage.showOnStartup": "Başlangıçta hoş geldiniz sayfasını göster", + "welcomePage.customize": "Özelleştir", + "welcomePage.installExtensionPacks": "Araçlar ve diller", + "welcomePage.installExtensionPacksDescription": "{0} ve {1} için destek yükle", + "welcomePage.moreExtensions": "fazlası", + "welcomePage.installKeymapDescription": "Klavye kısayolları yükle", + "welcomePage.installKeymapExtension": "{0} ve {1} için klavye kısayolları yükle", + "welcomePage.others": "diğerleri", + "welcomePage.colorTheme": "Renk teması", + "welcomePage.colorThemeDescription": "Düzenleyici ve kodlarınız sevdiğiniz şekilde görünsün", + "welcomePage.learn": "Öğren", + "welcomePage.showCommands": "Tüm komutları bul ve çalıştır", + "welcomePage.interfaceOverview": "Arayüze genel bakış", + "welcomePage.interfaceOverviewDescription": "Kullanıcı arayüzünün ana bileşenlerini vurgulayan bir kaplamayı görüntüleyin", + "welcomePage.interactivePlayground": "İnteraktif oyun alanı", + "welcomePage.interactivePlaygroundDescription": "Başlıca düzenleyici özelliklerini kısa örneklerle deneyin", + "welcomePage.quickLinks": "Hızlı bağlantılar", + "welcomePage.keybindingsReference": "Klavye kısayolları başvurusu", + "welcomePage.keybindingsReferenceDescription": "En yaygın klavye kısayollarının olduğu yazdırılabilir bir PDF dosyası", + "welcomePage.configureSettings": "Ayarları yapılandır", + "welcomePage.configureSettingsDescription": "Ayarları değiştirerek VS Code'un tam gücünü açın" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.contribution.i18n.json b/i18n/trk/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..03f771bb69e4b3e7a8ddec8ea1cd0d35aca984c4 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.contribution.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "help": "Yardım" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json b/i18n/trk/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..3c96ac13013bec02b8b7e358c4bae26249f167ff --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.i18n.json @@ -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. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "workbenchConfigurationTitle": "Çalışma Ekranı", + "welcomePage.enabled": "Etkinleştirildiğinde, başlangıçta hoş geldiniz sayfası gösterilir.", + "welcomePage": "Hoş Geldiniz", + "welcomePage.javaScript": "JavaScript", + "welcomePage.typeScript": "TypeScript", + "welcomePage.python": "Python", + "welcomePage.php": "PHP", + "welcomePage.docker": "Docker", + "welcomePage.vim": "Vim", + "welcomePage.sublime": "Sublime", + "welcomePage.atom": "Atom", + "welcomePage.extensionPackAlreadyInstalled": "{0} desteği zaten yüklü.", + "welcomePage.willReloadAfterInstallingExtensionPack": "{0} ek desteği yüklendikten sonra pencere yeniden yüklenecektir.", + "welcomePage.installingExtensionPack": "{0} ek desteği yükleniyor...", + "welcomePage.extensionPackNotFound": "{1} Id'li {0} desteği bulunamadı.", + "welcomePage.keymapAlreadyInstalled": "{0} klavye kısayolları zaten yüklü.", + "welcomePage.willReloadAfterInstallingKeymap": "{0} klavye kısayolları yüklendikten sonra pencere yeniden yüklenecektir.", + "welcomePage.installingKeymap": "{0} klavye kısayolları yükleniyor...", + "welcomePage.keymapNotFound": "{1} Id'li {0} klavye kısayolları bulunamadı.", + "welcome.title": "Hoş Geldiniz", + "welcomePage.openFolderWithPath": "{1} yolundaki {0} klasörünü aç", + "welcomePage.extensionListSeparator": ", ", + "welcomePage.installKeymap": "{0} tuş haritasını yükle", + "welcomePage.installExtensionPack": "{0} ek desteği yükleniyor...", + "welcomePage.installedKeymap": "{0} tuş haritası zaten yüklü", + "welcomePage.installedExtensionPack": "{0} desteği zaten yüklü", + "ok": "Tamam", + "details": "Detaylar", + "cancel": "İptal", + "welcomePage.buttonBackground": "Hoş geldiniz sayfasındaki butonların arka plan rengi.", + "welcomePage.buttonHoverBackground": "Hoş geldiniz sayfasındaki butonların bağlantı vurgusu arka plan rengi." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/welcome/walkThrough/electron-browser/editor/editorWalkThrough.i18n.json b/i18n/trk/src/vs/workbench/parts/welcome/walkThrough/electron-browser/editor/editorWalkThrough.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..80ad1bc8870bde0767e5ef44a3d3f7ee2a14f4c6 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/welcome/walkThrough/electron-browser/editor/editorWalkThrough.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "editorWalkThrough": "İnteraktif Oyun Alanı", + "editorWalkThrough.title": "İnteraktif Oyun Alanı" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThrough.contribution.i18n.json b/i18n/trk/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThrough.contribution.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..c56d3c14fe8cdcc777e2b4d58aa524bfbb36cf51 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThrough.contribution.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "walkThrough.editor.label": "İnteraktif Oyun Alanı", + "help": "Yardım", + "interactivePlayground": "İnteraktif Oyun Alanı" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughActions.i18n.json b/i18n/trk/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughActions.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..9e8d2c57063aff200248d471615ded11837cab01 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughActions.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "editorWalkThrough.arrowUp": "Yukarı Kaydır (Satır)", + "editorWalkThrough.arrowDown": "Aşağı Kaydır (Satır)", + "editorWalkThrough.pageUp": "Yukarı Kaydır (Sayfa)", + "editorWalkThrough.pageDown": "Aşağı Kaydır (Sayfa)" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json b/i18n/trk/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..add57fa341b54a635e8ade839bfb104d1b783697 --- /dev/null +++ b/i18n/trk/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.i18n.json @@ -0,0 +1,10 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "walkThrough.unboundCommand": "serbest", + "walkThrough.gitNotFound": "Git, sisteminizde yüklü değil gibi görünüyor.", + "walkThrough.embeddedEditorBackground": "İnteraktif oyun alanındaki gömülü düzenleyicilerin arka plan rengi." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json b/i18n/trk/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..a5088bc7ca63990146248706c0adf50e70f0326d --- /dev/null +++ b/i18n/trk/src/vs/workbench/services/configuration/node/configurationEditingService.i18n.json @@ -0,0 +1,17 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "open": "Ayarları Aç", + "close": "Kapat", + "saveAndRetry": "Ayarları Kaydet ve Yeniden Dene", + "errorUnknownKey": "Yapılandırma dosyasına yazılamıyor (Bilinmeyen Anahtar)", + "errorInvalidTarget": "Yapılandırma dosyasına yazılamıyor (Bilinmeyen Hedef)", + "errorNoWorkspaceOpened": "Hiçbir klasör açık olmadığı için ayarlara yazılamıyor. Lütfen ilk olarak bir klasörü açın ve tekrar deneyin.", + "errorInvalidConfiguration": "Ayarlara yazılamıyor. Lütfen dosyadaki hata/uyarıları düzeltmek için **Kullanıcı Ayarları'nı** açın ve tekrar deneyin.", + "errorInvalidConfigurationWorkspace": "Ayarlara yazılamıyor. Lütfen dosyadaki hata/uyarıları düzeltmek için **Çalışma Alanı Ayarları'nı** açın ve tekrar deneyin.", + "errorConfigurationFileDirty": "Dosya kaydedilmemiş değişiklikler içerdiği için ayarlara yazılamıyor. Lütfen dosyadaki hata/uyarıları düzeltmek için **Kullanıcı Ayarları'nı** açın ve tekrar deneyin.", + "errorConfigurationFileDirtyWorkspace": "Dosya kaydedilmemiş değişiklikler içerdiği için ayarlara yazılamıyor. Lütfen dosyadaki hata/uyarıları düzeltmek için **Çalışma Alanı Ayarları'nı** açın ve tekrar deneyin." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/services/crashReporter/common/crashReporterService.i18n.json b/i18n/trk/src/vs/workbench/services/crashReporter/common/crashReporterService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..4289f712979c3af1d0e603fe1a166e249e6219dd --- /dev/null +++ b/i18n/trk/src/vs/workbench/services/crashReporter/common/crashReporterService.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "telemetryConfigurationTitle": "Telemetri", + "telemetry.enableCrashReporting": "Kilitlenme raporlarının Microsoft'a gönderilmesini etkinleştirin.\nBu seçeneğin yürürlüğe girmesi için yeniden başlatma gerekir." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/services/editor/browser/editorService.i18n.json b/i18n/trk/src/vs/workbench/services/editor/browser/editorService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..50e968f8ee37e64e5723ddba19803fdc8a2c9371 --- /dev/null +++ b/i18n/trk/src/vs/workbench/services/editor/browser/editorService.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "compareLabels": "{0} ↔ {1}" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/services/files/electron-browser/fileService.i18n.json b/i18n/trk/src/vs/workbench/services/files/electron-browser/fileService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..084090af7345798ddb4cbb5d840ad25fa8f29692 --- /dev/null +++ b/i18n/trk/src/vs/workbench/services/files/electron-browser/fileService.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "netVersionError": "Microsoft .NET Framework 4.5 gerekli. Yüklemek için bağlantıyı izleyin.", + "installNet": ".NET Framework 4.5'i İndir", + "neverShowAgain": "Tekrar Gösterme", + "trashFailed": "'{0}' çöpe taşınamadı" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/services/files/node/fileService.i18n.json b/i18n/trk/src/vs/workbench/services/files/node/fileService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..2f174109eabb789e1763f5e7588568414b3d8b7e --- /dev/null +++ b/i18n/trk/src/vs/workbench/services/files/node/fileService.i18n.json @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "fileInvalidPath": "Geçersiz dosya kaynağı ({0})", + "fileIsDirectoryError": "Dosya bir dizindir ({0})", + "fileBinaryError": "Dosya ikili olarak görünüyor ve metin olarak açılamıyor", + "fileNotFoundError": "Dosya bulunamadı ({0})", + "unableToMoveCopyError": "Taşıma/kopyalama yapılamadı. Dosya, içinde bulunduğu klasörü değiştiriyor.", + "foldersCopyError": "Klasörler çalışma alanına kopyalanamaz. Lütfen kopyalamak için dosyaları tek tek seçin.", + "fileReadOnlyError": "Dosya Salt Okunur" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/services/keybinding/common/keybindingEditing.i18n.json b/i18n/trk/src/vs/workbench/services/keybinding/common/keybindingEditing.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..0e3f3b323f118e7771a9831ea6cbaca1d0f5f64b --- /dev/null +++ b/i18n/trk/src/vs/workbench/services/keybinding/common/keybindingEditing.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "errorKeybindingsFileDirty": "Dosya kaydedilmemiş değişiklikler içerdiği için yazılamıyor. Lütfen **tuş bağları** dosyasını kaydedin ve tekrar deneyin.", + "parseErrors": "Tuş bağları yazılamadı. Lütfen dosyadaki hata/uyarıları düzeltmek için **tuş bağları dosyasını** açın ve yeniden deneyin.", + "errorInvalidConfiguration": "Tuş bağları yazılamadı. **Tuş bağları dosyasında** Dizi olmayan bir nesne var. Temizlemek için lütfen dosyayı açın ve yeniden deneyin.", + "emptyKeybindingsHeader": "Varsayılanların üzerine yazmak için tuş bağlarınızı bu dosyaya yerleştirin" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/services/keybinding/electron-browser/keybindingService.i18n.json b/i18n/trk/src/vs/workbench/services/keybinding/electron-browser/keybindingService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..a3dc9a93b6a774de65724fe459fdcc5ec90d11c7 --- /dev/null +++ b/i18n/trk/src/vs/workbench/services/keybinding/electron-browser/keybindingService.i18n.json @@ -0,0 +1,26 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "nonempty": "boş olmayan değer bekleniyordu.", + "requirestring": "`{0}` özelliği zorunludur ve `string` türünde olmalıdır", + "optstring": "`{0}` özelliği atlanabilir veya `string` türünde olmalıdır", + "vscode.extension.contributes.keybindings.command": "Tuş bağı tetiklendiğinde çalıştırılacak komutun tanımlayıcısı.", + "vscode.extension.contributes.keybindings.key": "Tuş veya tuş dizisi (tuşları artı işaretiyle veya boşluk dizisiyle ayırın, ör. bir akor için Ctrl+O ve Ctrl+L", + "vscode.extension.contributes.keybindings.mac": "Mac'e özel tuş veya tuş dizisi.", + "vscode.extension.contributes.keybindings.linux": "Linux'a özel tuş veya tuş dizisi.", + "vscode.extension.contributes.keybindings.win": "Windows'a özel tuş veya tuş dizisi.", + "vscode.extension.contributes.keybindings.when": "Tuşun aktif olacağı koşul", + "vscode.extension.contributes.keybindings": "Tuş bağlarına ekleme yapar.", + "invalid.keybindings": "Geçersiz `contributes.{0}`: {1}", + "unboundCommands": "Kullanılabilen diğer komutlar şunlardır: ", + "keybindings.json.title": "Tuş bağları yapılandırması", + "keybindings.json.key": "Tuş veya tuş dizisi (boşluk ile ayrılmış olarak)", + "keybindings.json.command": "Yürütülecek komutun adı", + "keybindings.json.when": "Tuşun aktif olacağı koşul", + "keybindings.json.args": "Yürütülecek komuta iletilecek argümanlar.", + "keyboardConfigurationTitle": "Klavye", + "dispatch": "Tuş basımlarının ya `keydown.code` (önerilen) ya da ` keydown.keyCode` kullanarak gönderilmesini denetler." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/services/message/browser/messageList.i18n.json b/i18n/trk/src/vs/workbench/services/message/browser/messageList.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..00c0b8b53d5d2fb02175f1f7952b392060e9f6dc --- /dev/null +++ b/i18n/trk/src/vs/workbench/services/message/browser/messageList.i18n.json @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "alertErrorMessage": "Hata: {0}", + "alertWarningMessage": "Uyarı: {0}", + "alertInfoMessage": "Bilgi: {0}", + "error": "Hata", + "warning": "Uyar", + "info": "Bilgi", + "close": "Kapat" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/services/message/electron-browser/messageService.i18n.json b/i18n/trk/src/vs/workbench/services/message/electron-browser/messageService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..ef993fa147f7c7d40d214d0824badd4c518a3a8f --- /dev/null +++ b/i18n/trk/src/vs/workbench/services/message/electron-browser/messageService.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "yesButton": "&&Evet", + "cancelButton": "İptal" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/services/mode/common/workbenchModeService.i18n.json b/i18n/trk/src/vs/workbench/services/mode/common/workbenchModeService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..3adb24cee4c07720facd114796fb5649098b9859 --- /dev/null +++ b/i18n/trk/src/vs/workbench/services/mode/common/workbenchModeService.i18n.json @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "invalid": "Geçersiz `contributes.{0}`. Bir dizi bekleniyordu.", + "invalid.empty": "`contributes.{0}` için boş değer", + "require.id": "`{0}` özelliği zorunludur ve `string` türünde olmalıdır", + "opt.extensions": "`{0}` özelliği atlanabilir veya `string[]` türünde olmalıdır", + "opt.filenames": "`{0}` özelliği atlanabilir veya `string[]` türünde olmalıdır", + "opt.firstLine": "`{0}` özelliği atlanabilir veya `string` türünde olmalıdır", + "opt.configuration": "`{0}` özelliği atlanabilir veya `string` türünde olmalıdır", + "opt.aliases": "`{0}` özelliği atlanabilir veya `string[]` türünde olmalıdır", + "opt.mimetypes": "`{0}` özelliği atlanabilir veya `string[]` türünde olmalıdır" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/services/progress/browser/progressService2.i18n.json b/i18n/trk/src/vs/workbench/services/progress/browser/progressService2.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..6db7d6aae514a031afce5ac346abfd84bb8ee1cc --- /dev/null +++ b/i18n/trk/src/vs/workbench/services/progress/browser/progressService2.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "progress.text": "{0} - {1}", + "progress.title": "{0}: {1}" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/services/textfile/common/textFileEditorModel.i18n.json b/i18n/trk/src/vs/workbench/services/textfile/common/textFileEditorModel.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..7c9f89a2ac8136c6348221c5d87aed7d0eadcab3 --- /dev/null +++ b/i18n/trk/src/vs/workbench/services/textfile/common/textFileEditorModel.i18n.json @@ -0,0 +1,9 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "saveFileFirst": "Dosya kaydedilmemiş değişiklikler içeriyor. Başka bir kodlama ile yeniden açmadan önce lütfen ilk olarak kaydedin.", + "genericSaveError": "'{0}' kaydedilemedi: ({1})." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/services/textfile/common/textFileService.i18n.json b/i18n/trk/src/vs/workbench/services/textfile/common/textFileService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..d3399a79e656ded10f2e5a60c7a7fe91abc3da4a --- /dev/null +++ b/i18n/trk/src/vs/workbench/services/textfile/common/textFileService.i18n.json @@ -0,0 +1,8 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "files.backup.failSave": "Dosyalar yedeklenemedi (Hata: {0}), çıkmak için dosyalarınızı kaydetmeyi deneyin." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/services/textfile/electron-browser/textFileService.i18n.json b/i18n/trk/src/vs/workbench/services/textfile/electron-browser/textFileService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..5284725dbcbe101b6a615d631b63835268055210 --- /dev/null +++ b/i18n/trk/src/vs/workbench/services/textfile/electron-browser/textFileService.i18n.json @@ -0,0 +1,18 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "saveChangesMessage": "{0} dosyasına yaptığınız değişiklikleri kaydetmek istiyor musunuz?", + "saveChangesMessages": "Aşağıdaki {0} dosyaya yaptığınız değişiklikleri kaydetmek istiyor musunuz?", + "moreFile": "...1 ek dosya gösterilmiyor", + "moreFiles": "...{0} ek dosya gösterilmiyor", + "saveAll": "&&Tümünü Kaydet", + "save": "&&Kaydet", + "dontSave": "Kaydet&&me", + "cancel": "İptal", + "saveChangesDetail": "Değişiklikleriniz, kaydetmezseniz kaybolur.", + "allFiles": "Tüm Dosyalar", + "noExt": "Uzantısız" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/services/themes/common/colorThemeSchema.i18n.json b/i18n/trk/src/vs/workbench/services/themes/common/colorThemeSchema.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..70d9757c2552d849b3bb7deb5106f986643613df --- /dev/null +++ b/i18n/trk/src/vs/workbench/services/themes/common/colorThemeSchema.i18n.json @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "schema.colors": "Sentaks vurgulaması renkleri", + "schema.properties.name": "Kuralın açıklaması", + "schema.fontStyle": "Kuralın yazı tipi stili: 'italic', 'bold' ve 'underline' kombinasyonu veya bunlardan bir tanesi", + "schema.tokenColors.path": "Bir tmTheme dosyasının yolu (geçerli dosyaya göreli)" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/services/themes/common/fileIconThemeSchema.i18n.json b/i18n/trk/src/vs/workbench/services/themes/common/fileIconThemeSchema.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..93ef7b84d63088b07b0c2eeec6e0033bd29d8220 --- /dev/null +++ b/i18n/trk/src/vs/workbench/services/themes/common/fileIconThemeSchema.i18n.json @@ -0,0 +1,37 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "schema.folderExpanded": "Genişletilmiş klasörler için klasör simgesi. Genişletilmiş klasör simgesi isteğe bağlıdır. Ayarlanmazsa, klasör için tanımlanan simge gösterilir.", + "schema.folder": "Daraltılmış klasörler için klasör simgesi; eğer folderExpanded ayarlanmamışsa, genişletilen klasörler için de kullanılır.", + "schema.file": "Varsayılan dosya simgesi, bir uzantı, dosya adı veya dil kimliği ile eşleşmeyen tüm dosyalar için gösterilir.", + "schema.folderNames": "Klasör adlarını simgelerle ilişkilendirir. Nesne anahtarı, herhangi bir yol parçası içermeyen klasör adıdır. Örüntüler veya joker karakterlere izin verilmez. Klasör adı eşleştirme büyük/küçük harfe duyarlı değildir.", + "schema.folderName": "İlişkilendirilecek simge tanımı ID'si.", + "schema.folderNamesExpanded": "Klasör adlarını genişletilmiş klasör simgeleriyle ilişkilendirir. Nesne anahtarı, herhangi bir yol parçası içermeyen klasör adıdır. Örüntüler veya joker karakterlere izin verilmez. Klasör adı eşleştirme büyük/küçük harfe duyarlı değildir.", + "schema.folderNameExpanded": "İlişkilendirilecek simge tanımı ID'si.", + "schema.fileExtensions": "Dosya uzantılarını simgelerle ilişkilendirir. Nesne anahtarı, dosya uzantısı adıdır. Uzantı adı, bir dosya adındaki son noktadan sonraki kısmıdır(nokta dahil değil). Uzantılar büyük/küçük harf ayırt etmeksizin karşılaştırılır.", + "schema.fileExtension": "İlişkilendirilecek simge tanımı ID'si.", + "schema.fileNames": "Dosya adlarını simgelerle ilişkilendirir. Nesne anahtarı, herhangi bir yol parçası içermeyen tam dosya adıdır. Dosya adı noktalar ve olası bir dosya uzantısı içerebilir. Örüntüler veya joker karakterlere izin verilmez. Dosya adı eşleştirme büyük/küçük harfe duyarlı değildir.", + "schema.fileName": "İlişkilendirilecek simge tanımı ID'si.", + "schema.languageIds": "Dilleri simgelerle ilişkilendirir. Nesne anahtarı, dil ekleme noktasında tanımlanan dil kimliğidir.", + "schema.languageId": "İlişkilendirilecek simge tanımı ID'si.", + "schema.fonts": "Simge tanımlarında kullanılacak yazı tipleri.", + "schema.id": "Yazı tipinin ID'si.", + "schema.src": "Yazı tipinin konumları.", + "schema.font-path": "Yazı tipi yolu, geçerli simge teması dosyasına göreli yol.", + "schema.font-format": "Yazı tipinin biçimi.", + "schema.font-weight": "Yazı tipinin kalınlığı.", + "schema.font-sstyle": "Yazı tipinin stili.", + "schema.font-size": "Yazı tipinin varsayılan boyutu.", + "schema.iconDefinitions": "Dosyalar simgelerle ilişkilendirirken kullanılabilecek tüm simgelerin açıklaması.", + "schema.iconDefinition": "Bir simge tanımı. Nesne anahtarı, tanımın ID'sidir.", + "schema.iconPath": "SVG veya PNG kullanırken: Görüntünün yolu. Yol, simge kümesi dosyasına görelidir.", + "schema.fontCharacter": "Glif yazı tipi kullanırken: Kullanılacak yazı tipindeki karakter.", + "schema.fontColor": "Glif yazı tipi kullanırken: Kullanılacak renk.", + "schema.fontSize": "Yazı tipi kullanırken: Metin yazı tipi yüzdesine göre yazı tipi boyutu. Ayarlanmazsa, yazı tipi tanımındaki boyut kullanılır.", + "schema.fontId": "Yazı tipi kullanırken: Yazı tipinin kimliği. Ayarlanmazsa, ilk yazı tipi tanımı varsayılan olarak kullanılır.", + "schema.light": "Açık renk temalarındaki dosya simgeleri için isteğe bağlı ilişkilendirmeler.", + "schema.highContrast": "Yüksek karşıtlık renk temalarındaki dosya simgeleri için isteğe bağlı ilişkilendirmeler." +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/services/themes/electron-browser/colorThemeData.i18n.json b/i18n/trk/src/vs/workbench/services/themes/electron-browser/colorThemeData.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..d00686b6cdd37296789b24f93fb2201a420fc04c --- /dev/null +++ b/i18n/trk/src/vs/workbench/services/themes/electron-browser/colorThemeData.i18n.json @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "error.cannotparsejson": "JSON tema dosyasını ayrıştırma sorunları: {0}", + "error.invalidformat.colors": "Renk teması dosyasını ayrıştırma sorunu: {0}. 'colors' özelliği 'nesne' türünde değil.", + "error.invalidformat.tokenColors": "Renk teması dosyasını ayrıştırma sorunu: {0}. 'tokenColors' özelliği ya renkleri belirten bir dizi ya da bir text mate tema dosyasının yolunu içermelidir", + "error.plist.invalidformat": "tmTheme tema dosyasını ayrıştırma sorunları: {0}. 'settings' dizi değil", + "error.cannotparse": "tmTheme tema dosyasını ayrıştırma sorunları: {0}", + "error.cannotload": "{0} tmTheme tema dosyasını yükleme sorunları: {1}" +} \ No newline at end of file diff --git a/i18n/trk/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.i18n.json b/i18n/trk/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.i18n.json new file mode 100644 index 0000000000000000000000000000000000000000..96d6b5ce787707b97f73969a8eba941f25cdae8c --- /dev/null +++ b/i18n/trk/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.i18n.json @@ -0,0 +1,32 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Do not edit this file. It is machine generated. +{ + "vscode.extension.contributes.themes": "Textmate renk temalarına ekleme yapar.", + "vscode.extension.contributes.themes.id": "Kullanıcı ayarlarında kullanılan simge teması Id'si.", + "vscode.extension.contributes.themes.label": "Kullanıcı arayüzünde görünen renk temasının etiketi.", + "vscode.extension.contributes.themes.uiTheme": "Editördeki renkleri tanımlayan temel tema: 'vs' açık renk temasıdır, 'vs-dark' koyu renk temasıdır. 'hc-black' ise yüksek kontrast temasıdır.", + "vscode.extension.contributes.themes.path": "tmLanguage dosyasının yolu. Yol, eklenti klasörüne görecelidir ve genellikle './themes/themeFile.tmTheme'dir.", + "vscode.extension.contributes.iconThemes": "Dosya simgesi temalarına ekleme yapar.", + "vscode.extension.contributes.iconThemes.id": "Kullanıcı ayarlarında kullanılan simge teması Id'si.", + "vscode.extension.contributes.iconThemes.label": "Kullanıcı arayüzünde görünen simge temasının etiketi.", + "vscode.extension.contributes.iconThemes.path": "Simge teması tanımlama dosyasının yolu. Yol, eklenti klasörüne görecelidir ve genellikle './icons/awesome-icon-theme.json'dur.", + "migration.completed": "Yeni tema ayarları kullanıcı ayarlarına eklendi. Yedek, {0} konumunda mevcuttur.", + "error.cannotloadtheme": "{0} yüklenemedi: {1}", + "reqarray": "Eklenti noktası `{0}` bir dizi olmalıdır.", + "reqpath": "`contributes.{0}.path` ögesinde dize bekleniyor. Sağlanan değer: {1}", + "invalid.path.1": "`contributes.{0}.path` ögesinin ({1}) eklentinin klasöründe ({2}) yer alması bekleniyor. Bu, eklentiyi taşınamaz yapabilir.", + "reqid": "`contributes.{0}.id` ögesinde dize bekleniyordu. Belirtilen değer: {1}", + "error.cannotloadicontheme": "{0} yüklenemedi", + "error.cannotparseicontheme": "Dosya simgeleri dosyasını ayrıştırma sorunları: {0}", + "colorTheme": "Çalışma ekranında kullanılan renk temasını belirtir.", + "colorThemeError": "Tema bilinmiyor veya yüklenmemiş.", + "iconTheme": "Çalışma ekranında kullanılan simge temasını belirtir.", + "noIconThemeDesc": "Dosya simgesi yok", + "iconThemeError": "Dosya simgesi teması bilinmiyor veya yüklenmemiş.", + "workbenchColors": "Şu an seçili renk temasındaki renkleri geçersiz kılar.", + "workbenchColors.deprecated": "Ayar, artık deneysel değildir ve 'workbench.colorCustomizations' olarak yeniden adlandırılmıştır", + "workbenchColors.deprecatedDescription": "Bunun yerine 'workbench.colorCustomizations' kullanın" +} \ No newline at end of file diff --git a/issue_template.md b/issue_template.md index ad023f7b7c8e9e6fe6dfadd7b799ba184e024b79..7747f9d337142cba76cafcd1e060994079b1438a 100644 --- a/issue_template.md +++ b/issue_template.md @@ -1,9 +1,10 @@ - +Do you have a question? Please ask it on [Stack Overflow with `vscode` tag](http://stackoverflow.com/questions/tagged/vscode) -- VSCode Version: -- OS Version: +(Use Help > Report Issues to prefill these) +- VSCode Version: +- OS Version: Steps to Reproduce: -1. -1. +1. +2. diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 678f3be8298bb2267cf7f4bfe7e8096bd93c3962..1018efb8ecc2082c77734b7ce4d701cf2aefef65 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -338,9 +338,9 @@ "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz" }, "node-pty": { - "version": "0.6.6", - "from": "node-pty@0.6.6", - "resolved": "https://registry.npmjs.org/node-pty/-/node-pty-0.6.6.tgz", + "version": "0.6.8", + "from": "node-pty@0.6.8", + "resolved": "https://registry.npmjs.org/node-pty/-/node-pty-0.6.8.tgz", "dependencies": { "nan": { "version": "2.5.0", @@ -410,9 +410,9 @@ "resolved": "git://github.com/jrieken/v8-profiler.git#bc0803a4d4b2150b8a1bbffa80270769007036c2" }, "vscode-debugprotocol": { - "version": "1.19.0", - "from": "vscode-debugprotocol@1.19.0", - "resolved": "https://registry.npmjs.org/vscode-debugprotocol/-/vscode-debugprotocol-1.19.0.tgz" + "version": "1.20.0", + "from": "vscode-debugprotocol@1.20.0", + "resolved": "https://registry.npmjs.org/vscode-debugprotocol/-/vscode-debugprotocol-1.20.0.tgz" }, "vscode-ripgrep": { "version": "0.0.12", @@ -420,9 +420,9 @@ "resolved": "https://registry.npmjs.org/vscode-ripgrep/-/vscode-ripgrep-0.0.12.tgz" }, "vscode-textmate": { - "version": "3.1.4", - "from": "vscode-textmate@3.1.4", - "resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-3.1.4.tgz" + "version": "3.1.5", + "from": "vscode-textmate@3.1.5", + "resolved": "https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-3.1.5.tgz" }, "windows-foreground-love": { "version": "0.1.0", @@ -440,14 +440,126 @@ "resolved": "https://registry.npmjs.org/winreg/-/winreg-1.2.0.tgz" }, "xterm": { - "version": "2.6.0", - "from": "Tyriar/xterm.js#vscode-release/1.13", - "resolved": "git+https://github.com/Tyriar/xterm.js.git#32c9eac8ee5a958093d126a06c1c06a7cd6052bf" + "version": "2.7.0", + "from": "Tyriar/xterm.js#vscode-release/1.14", + "resolved": "git+https://github.com/Tyriar/xterm.js.git#16ed764fcc2253721bafc4f9c9acc19e8518f1c0" }, "yauzl": { "version": "2.3.1", "from": "yauzl@2.3.1", "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.3.1.tgz" + }, + "nsfw": { + "version": "1.0.15", + "from": "nsfw@1.0.15", + "resolved": "https://registry.npmjs.org/nsfw/-/nsfw-1.0.15.tgz", + "dependencies": { + "asap": { + "version": "2.0.5", + "from": "asap@>=2.0.3 <2.1.0", + "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.5.tgz" + }, + "balanced-match": { + "version": "1.0.0", + "from": "balanced-match@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz" + }, + "brace-expansion": { + "version": "1.1.8", + "from": "brace-expansion@>=1.1.7 <2.0.0", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz" + }, + "concat-map": { + "version": "0.0.1", + "from": "concat-map@0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" + }, + "fs-extra": { + "version": "0.26.7", + "from": "fs-extra@>=0.26.5 <0.27.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.26.7.tgz" + }, + "fs.realpath": { + "version": "1.0.0", + "from": "fs.realpath@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz" + }, + "glob": { + "version": "7.1.2", + "from": "glob@>=7.0.5 <8.0.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz" + }, + "graceful-fs": { + "version": "4.1.11", + "from": "graceful-fs@>=4.1.2 <5.0.0", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz" + }, + "inflight": { + "version": "1.0.6", + "from": "inflight@>=1.0.4 <2.0.0", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz" + }, + "inherits": { + "version": "2.0.3", + "from": "inherits@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz" + }, + "jsonfile": { + "version": "2.4.0", + "from": "jsonfile@>=2.1.0 <3.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz" + }, + "klaw": { + "version": "1.3.1", + "from": "klaw@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz" + }, + "lodash": { + "version": "4.17.4", + "from": "lodash@>=4.6.1 <5.0.0", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz" + }, + "minimatch": { + "version": "3.0.4", + "from": "minimatch@>=3.0.4 <4.0.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz" + }, + "nan": { + "version": "2.6.2", + "from": "nan@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.6.2.tgz" + }, + "nodegit-promise": { + "version": "4.0.0", + "from": "nodegit-promise@>=4.0.0 <4.1.0", + "resolved": "https://registry.npmjs.org/nodegit-promise/-/nodegit-promise-4.0.0.tgz" + }, + "once": { + "version": "1.4.0", + "from": "once@>=1.3.0 <2.0.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz" + }, + "path-is-absolute": { + "version": "1.0.1", + "from": "path-is-absolute@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz" + }, + "promisify-node": { + "version": "0.3.0", + "from": "promisify-node@>=0.3.0 <0.4.0", + "resolved": "https://registry.npmjs.org/promisify-node/-/promisify-node-0.3.0.tgz" + }, + "rimraf": { + "version": "2.6.1", + "from": "rimraf@>=2.2.8 <3.0.0", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.1.tgz" + }, + "wrappy": { + "version": "1.0.2", + "from": "wrappy@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" + } + } } } } diff --git a/package.json b/package.json index 236e9d787e5755d4e8bb3cf46bdcf2d4fd385e3b..4386a156994b57adee6d6cbb0414e370384258b3 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "code-oss-dev", - "version": "1.13.0", + "version": "1.14.0", "electronVersion": "1.6.6", - "distro": "20d9b7ca9af07894c19dbabde24c7c954510fb5b", + "distro": "e1ebae615f927063affde84ceee25d4c47415821", "author": { "name": "Microsoft Corporation" }, @@ -18,7 +18,8 @@ "monaco-editor-test": "mocha --only-monaco-editor", "precommit": "node build/gulpfile.hygiene.js", "gulp": "gulp --max_old_space_size=4096", - "7z": "7z" + "7z": "7z", + "update-grammars": "node build/npm/update-all-grammars.js" }, "dependencies": { "applicationinsights": "0.17.1", @@ -34,14 +35,15 @@ "jschardet": "^1.4.2", "minimist": "1.2.0", "native-keymap": "1.2.4", - "node-pty": "0.6.6", + "node-pty": "0.6.8", + "nsfw": "1.0.15", "semver": "4.3.6", "v8-profiler": "jrieken/v8-profiler#vscode", - "vscode-debugprotocol": "1.19.0", + "vscode-debugprotocol": "1.20.0", "vscode-ripgrep": "0.0.12", - "vscode-textmate": "^3.1.4", + "vscode-textmate": "^3.1.5", "winreg": "1.2.0", - "xterm": "Tyriar/xterm.js#vscode-release/1.13", + "xterm": "Tyriar/xterm.js#vscode-release/1.14", "yauzl": "2.3.1" }, "devDependencies": { @@ -57,6 +59,7 @@ "cson-parser": "^1.3.3", "debounce": "^1.0.0", "documentdb": "^1.5.1", + "electron-mksnapshot": "1.6.0", "eslint": "^3.4.0", "event-stream": "^3.1.7", "express": "^4.13.1", @@ -69,6 +72,7 @@ "gulp-buffer": "0.0.2", "gulp-concat": "^2.6.0", "gulp-cssnano": "^2.1.0", + "gulp-eslint": "^3.0.1", "gulp-filter": "^3.0.0", "gulp-flatmap": "^1.0.0", "gulp-image-resize": "^0.10.0", @@ -81,7 +85,7 @@ "gulp-sourcemaps": "^1.11.0", "gulp-tsb": "^2.0.3", "gulp-tslint": "^7.0.1", - "gulp-uglify": "^2.0.0", + "gulp-uglify": "^3.0.0", "gulp-util": "^3.0.6", "gulp-vinyl-zip": "^1.2.2", "husky": "^0.13.1", @@ -105,10 +109,11 @@ "tslint": "^4.3.1", "typescript": "2.3.3", "typescript-formatter": "4.0.1", - "uglify-js": "2.4.8", + "uglify-es": "^3.0.18", "underscore": "^1.8.2", "vinyl": "^0.4.5", "vinyl-fs": "^2.4.3", + "vsce": "^1.25.1", "vscode-nls-dev": "^2.0.1" }, "repository": { @@ -123,4 +128,4 @@ "windows-mutex": "^0.2.0", "fsevents": "0.3.8" } -} \ No newline at end of file +} diff --git a/scripts/env.ps1 b/scripts/env.ps1 index 3d34630f391e74d59961e9b1b3b7605e620e54a4..afd26f17baab635b833c3de4b3858aa1eae6bce6 100644 --- a/scripts/env.ps1 +++ b/scripts/env.ps1 @@ -1,5 +1,3 @@ $env:npm_config_disturl="https://atom.io/download/electron" $env:npm_config_target=(node -p "require('./package.json').electronVersion") -$env:npm_config_runtime="electron" -$env:npm_config_cache="$HOME/.npm-electron" -New-Item -Path "$env:npm_config_cache" -Type directory -Force | out-null \ No newline at end of file +$env:npm_config_runtime="electron" \ No newline at end of file diff --git a/src/.eslintrc b/src/.eslintrc index fc504686e192a5de014c49c695287e392f936998..c25b0d558c2c30b36fc1bc34f26ee9fe482ffa74 100644 --- a/src/.eslintrc +++ b/src/.eslintrc @@ -1,17 +1,19 @@ { "parserOptions": { - "ecmaVersion": 3 + "ecmaVersion": 6 }, "env": { "node": true, - "es6": true + "es6": true, + "browser": true, + "amd": true }, "rules": { "no-console": 0, "no-cond-assign": 0, - "no-unused-vars": 1, - "no-extra-semi": "warn", - "semi": "warn" - }, - "extends": "eslint:recommended" -} + "no-unused-vars": "error", + "no-extra-semi": "error", + "semi": "error", + "no-inner-declarations": 0 + } +} \ No newline at end of file diff --git a/src/bootstrap.js b/src/bootstrap.js index 022aa50b6a3685635ec093a32aab3dd395fd4eaf..3f94abadd31cdd39555e1e48bf6d4ede18b6c3c2 100644 --- a/src/bootstrap.js +++ b/src/bootstrap.js @@ -126,4 +126,16 @@ if (process.env['VSCODE_PARENT_PID']) { } } +const crashReporterOptionsRaw = process.env['CRASH_REPORTER_START_OPTIONS']; +if (typeof crashReporterOptionsRaw === 'string') { + try { + const crashReporterOptions = JSON.parse(crashReporterOptionsRaw); + if (crashReporterOptions) { + process.crashReporter.start(crashReporterOptions); + } + } catch (error) { + console.error(error); + } +} + require('./bootstrap-amd').bootstrap(process.env['AMD_ENTRYPOINT']); \ No newline at end of file diff --git a/src/main.js b/src/main.js index 9576d766aafc627dee40fadc701e8bdfd0e36468..0f17a6da5542afe7c1b3d6bdc860f138ebc9cae1 100644 --- a/src/main.js +++ b/src/main.js @@ -19,9 +19,7 @@ if (process.argv.indexOf('--prof-startup') >= 0) { if (process.env.LC_ALL) { process.env.LC_ALL = 'C'; } -if (process.env.LC_NUMERIC) { - process.env.LC_NUMERIC = 'C'; -} +process.env.LC_NUMERIC = 'C'; // Perf measurements global.perfStartTime = Date.now(); @@ -144,7 +142,7 @@ function getNodeCachedDataDir() { var dir = path.join(app.getPath('userData'), 'CachedData', productJson.commit); - return mkdirp(dir).then(undefined, function (err) { /*ignore*/ }); + return mkdirp(dir).then(undefined, function () { /*ignore*/ }); } function mkdirp(dir) { @@ -227,12 +225,13 @@ var nodeCachedDataDir = getNodeCachedDataDir().then(function (value) { } }); -var nlsConfig = getNLSConfiguration(); -process.env['VSCODE_NLS_CONFIG'] = JSON.stringify(nlsConfig); +// Load our code once ready +app.once('ready', function () { + global.perfAppReady = Date.now(); + var nlsConfig = getNLSConfiguration(); + process.env['VSCODE_NLS_CONFIG'] = JSON.stringify(nlsConfig); -var bootstrap = require('./bootstrap-amd'); -nodeCachedDataDir.then(function () { - bootstrap.bootstrap('vs/code/electron-main/main'); -}, function (err) { - console.error(err); + nodeCachedDataDir.then(function () { + require('./bootstrap-amd').bootstrap('vs/code/electron-main/main'); + }, console.error); }); diff --git a/src/typings/electron.d.ts b/src/typings/electron.d.ts index 5a1f5ea3430c0753e5da12cd5c4c966df3e36f94..05aab3a81619f88a7f62ed1fd8f4a81dcc863b5a 100644 --- a/src/typings/electron.d.ts +++ b/src/typings/electron.d.ts @@ -2066,6 +2066,13 @@ declare namespace Electron { * Only string properties are sent correctly, nested objects are not supported. */ extra?: { [prop: string]: string }; + + /** + * Path to a folder where the crashes will be temporarily stored by the electron crash reporter + * Applies only to child processes that need crash reporting. + * Electron figures out the crashesDirectory on its own for Main and Renderer process + */ + crashesDirectory?: string; } interface CrashReport { diff --git a/src/typings/minimist.d.ts b/src/typings/minimist.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d1e1a05252ac603710614b699289f6071f4e9234 --- /dev/null +++ b/src/typings/minimist.d.ts @@ -0,0 +1,35 @@ +// Type definitions for minimist 1.1.3 +// Project: https://github.com/substack/minimist +// Definitions by: Bart van der Schoor , Necroskillz +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module 'minimist' { + function minimist(args?: string[], opts?: minimist.Opts): minimist.ParsedArgs; + + namespace minimist { + export interface Opts { + // a string or array of strings argument names to always treat as strings + string?: string | string[]; + // a string or array of strings to always treat as booleans + boolean?: boolean | string | string[]; + // an object mapping string names to strings or arrays of string argument names to use + alias?: { [key: string]: string | string[] }; + // an object mapping string argument names to default values + default?: { [key: string]: any }; + // when true, populate argv._ with everything after the first non-option + stopEarly?: boolean; + // a function which is invoked with a command line parameter not defined in the opts configuration object. + // If the function returns false, the unknown option is not added to argv + unknown?: (arg: string) => boolean; + // when true, populate argv._ with everything before the -- and argv['--'] with everything after the -- + '--'?: boolean; + } + + export interface ParsedArgs { + [arg: string]: any; + _: string[]; + } + } + + export = minimist; +} diff --git a/src/typings/mocha.d.ts b/src/typings/mocha.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e4bddbd49b91a8bd3d1289d69b538498f4c400a0 --- /dev/null +++ b/src/typings/mocha.d.ts @@ -0,0 +1,234 @@ +// Type definitions for mocha 2.2.5 +// Project: http://mochajs.org/ +// Definitions by: Kazi Manzur Rashid , otiai10 , jt000 , Vadim Macagon +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +interface MochaSetupOptions { + //milliseconds to wait before considering a test slow + slow?: number; + + // timeout in milliseconds + timeout?: number; + + // ui name "bdd", "tdd", "exports" etc + ui?: string; + + //array of accepted globals + globals?: any[]; + + // reporter instance (function or string), defaults to `mocha.reporters.Spec` + reporter?: any; + + // bail on the first test failure + bail?: boolean; + + // ignore global leaks + ignoreLeaks?: boolean; + + // grep string or regexp to filter tests with + grep?: any; +} + +declare var mocha: Mocha; +declare var describe: Mocha.IContextDefinition; +declare var xdescribe: Mocha.IContextDefinition; +// alias for `describe` +declare var context: Mocha.IContextDefinition; +// alias for `describe` +declare var suite: Mocha.IContextDefinition; +declare var it: Mocha.ITestDefinition; +declare var xit: Mocha.ITestDefinition; +// alias for `it` +declare var test: Mocha.ITestDefinition; +declare var specify: Mocha.ITestDefinition; + +// Used with the --delay flag; see https://mochajs.org/#hooks +declare function run(): void; + +interface MochaDone { + (error?: any): any; +} + +declare function setup(callback: (this: Mocha.IBeforeAndAfterContext, done: MochaDone) => any): void; +declare function teardown(callback: (this: Mocha.IBeforeAndAfterContext, done: MochaDone) => any): void; +declare function suiteSetup(callback: (this: Mocha.IHookCallbackContext, done: MochaDone) => any): void; +declare function suiteTeardown(callback: (this: Mocha.IHookCallbackContext, done: MochaDone) => any): void; +declare function before(callback: (this: Mocha.IHookCallbackContext, done: MochaDone) => any): void; +declare function before(description: string, callback: (this: Mocha.IHookCallbackContext, done: MochaDone) => any): void; +declare function after(callback: (this: Mocha.IHookCallbackContext, done: MochaDone) => any): void; +declare function after(description: string, callback: (this: Mocha.IHookCallbackContext, done: MochaDone) => any): void; +declare function beforeEach(callback: (this: Mocha.IBeforeAndAfterContext, done: MochaDone) => any): void; +declare function beforeEach(description: string, callback: (this: Mocha.IBeforeAndAfterContext, done: MochaDone) => any): void; +declare function afterEach(callback: (this: Mocha.IBeforeAndAfterContext, done: MochaDone) => any): void; +declare function afterEach(description: string, callback: (this: Mocha.IBeforeAndAfterContext, done: MochaDone) => any): void; + +declare class Mocha { + currentTest: Mocha.ITestDefinition; + constructor(options?: { + grep?: RegExp; + ui?: string; + reporter?: string; + timeout?: number; + reporterOptions?: any; + slow?: number; + bail?: boolean; + }); + + /** Setup mocha with the given options. */ + setup(options: MochaSetupOptions): Mocha; + bail(value?: boolean): Mocha; + addFile(file: string): Mocha; + /** Sets reporter by name, defaults to "spec". */ + reporter(name: string): Mocha; + /** Sets reporter constructor, defaults to mocha.reporters.Spec. */ + reporter(reporter: (runner: Mocha.IRunner, options: any) => any): Mocha; + ui(value: string): Mocha; + grep(value: string): Mocha; + grep(value: RegExp): Mocha; + invert(): Mocha; + ignoreLeaks(value: boolean): Mocha; + checkLeaks(): Mocha; + /** + * Function to allow assertion libraries to throw errors directly into mocha. + * This is useful when running tests in a browser because window.onerror will + * only receive the 'message' attribute of the Error. + */ + throwError(error: Error): void; + /** Enables growl support. */ + growl(): Mocha; + globals(value: string): Mocha; + globals(values: string[]): Mocha; + useColors(value: boolean): Mocha; + useInlineDiffs(value: boolean): Mocha; + timeout(value: number): Mocha; + slow(value: number): Mocha; + enableTimeouts(value: boolean): Mocha; + asyncOnly(value: boolean): Mocha; + noHighlighting(value: boolean): Mocha; + /** Runs tests and invokes `onComplete()` when finished. */ + run(onComplete?: (failures: number) => void): Mocha.IRunner; +} + +// merge the Mocha class declaration with a module +declare namespace Mocha { + interface ISuiteCallbackContext { + timeout(ms: number): this; + retries(n: number): this; + slow(ms: number): this; + } + + interface IHookCallbackContext { + skip(): this; + timeout(ms: number): this; + [index: string]: any; + } + + + interface ITestCallbackContext { + skip(): this; + timeout(ms: number): this; + retries(n: number): this; + slow(ms: number): this; + [index: string]: any; + } + + /** Partial interface for Mocha's `Runnable` class. */ + interface IRunnable { + title: string; + fn: Function; + async: boolean; + sync: boolean; + timedOut: boolean; + timeout(n: number): this; + } + + /** Partial interface for Mocha's `Suite` class. */ + interface ISuite { + parent: ISuite; + title: string; + + fullTitle(): string; + } + + /** Partial interface for Mocha's `Test` class. */ + interface ITest extends IRunnable { + parent: ISuite; + pending: boolean; + state: 'failed'|'passed'|undefined; + + fullTitle(): string; + } + + interface IBeforeAndAfterContext extends IHookCallbackContext { + currentTest: ITest; + } + + + /** Partial interface for Mocha's `Runner` class. */ + interface IRunner { } + + interface IContextDefinition { + (description: string, callback: (this: ISuiteCallbackContext) => void): ISuite; + only(description: string, callback: (this: ISuiteCallbackContext) => void): ISuite; + skip(description: string, callback: (this: ISuiteCallbackContext) => void): void; + timeout(ms: number): void; + } + + interface ITestDefinition { + (expectation: string, callback?: (this: ITestCallbackContext, done: MochaDone) => any): ITest; + only(expectation: string, callback?: (this: ITestCallbackContext, done: MochaDone) => any): ITest; + skip(expectation: string, callback?: (this: ITestCallbackContext, done: MochaDone) => any): void; + timeout(ms: number): void; + state: "failed" | "passed"; + } + + export module reporters { + export class Base { + stats: { + suites: number; + tests: number; + passes: number; + pending: number; + failures: number; + }; + + constructor(runner: IRunner); + } + + export class Doc extends Base { } + export class Dot extends Base { } + export class HTML extends Base { } + export class HTMLCov extends Base { } + export class JSON extends Base { } + export class JSONCov extends Base { } + export class JSONStream extends Base { } + export class Landing extends Base { } + export class List extends Base { } + export class Markdown extends Base { } + export class Min extends Base { } + export class Nyan extends Base { } + export class Progress extends Base { + /** + * @param options.open String used to indicate the start of the progress bar. + * @param options.complete String used to indicate a complete test on the progress bar. + * @param options.incomplete String used to indicate an incomplete test on the progress bar. + * @param options.close String used to indicate the end of the progress bar. + */ + constructor(runner: IRunner, options?: { + open?: string; + complete?: string; + incomplete?: string; + close?: string; + }); + } + export class Spec extends Base { } + export class TAP extends Base { } + export class XUnit extends Base { + constructor(runner: IRunner, options?: any); + } + } +} + +declare module "mocha" { + export = Mocha; +} \ No newline at end of file diff --git a/src/typings/node.d.ts b/src/typings/node.d.ts index aa5953d8f15fdc5aeb97e3b57000eb77e198138d..8c33c5a8412b5d7523c6da71a7826d4ad0963f6f 100644 --- a/src/typings/node.d.ts +++ b/src/typings/node.d.ts @@ -88,10 +88,10 @@ interface NodeModule { // Same as module.exports declare var exports: any; declare var SlowBuffer: { - new (str: string, encoding?: string): Buffer; - new (size: number): Buffer; - new (size: Uint8Array): Buffer; - new (array: any[]): Buffer; + new(str: string, encoding?: string): Buffer; + new(size: number): Buffer; + new(size: Uint8Array): Buffer; + new(array: any[]): Buffer; prototype: Buffer; isBuffer(obj: any): boolean; byteLength(string: string, encoding?: string): number; @@ -115,19 +115,19 @@ declare var Buffer: { * @param str String to store in buffer. * @param encoding encoding to use, optional. Default is 'utf8' */ - new (str: string, encoding?: string): Buffer; + new(str: string, encoding?: string): Buffer; /** * Allocates a new buffer of {size} octets. * * @param size count of octets to allocate. */ - new (size: number): Buffer; + new(size: number): Buffer; /** * Allocates a new buffer containing the given {array} of octets. * * @param array The octets to store. */ - new (array: Uint8Array): Buffer; + new(array: Uint8Array): Buffer; /** * Produces a Buffer backed by the same allocated memory as * the given {ArrayBuffer}. @@ -135,19 +135,19 @@ declare var Buffer: { * * @param arrayBuffer The ArrayBuffer with which to share memory. */ - new (arrayBuffer: ArrayBuffer): Buffer; + new(arrayBuffer: ArrayBuffer): Buffer; /** * Allocates a new buffer containing the given {array} of octets. * * @param array The octets to store. */ - new (array: any[]): Buffer; + new(array: any[]): Buffer; /** * Copies the passed {buffer} data onto a new {Buffer} instance. * * @param buffer The buffer to copy. */ - new (buffer: Buffer): Buffer; + new(buffer: Buffer): Buffer; prototype: Buffer; /** * Allocates a new Buffer using an {array} of octets. @@ -250,7 +250,7 @@ declare var Buffer: { declare namespace NodeJS { export var Console: { prototype: Console; - new (stdout: WritableStream, stderr?: WritableStream): Console; + new(stdout: WritableStream, stderr?: WritableStream): Console; } export interface ErrnoException extends Error { @@ -1324,7 +1324,7 @@ declare module "https" { } export var Agent: { - new (options?: AgentOptions): Agent; + new(options?: AgentOptions): Agent; }; export interface Server extends tls.Server { } export function createServer(options: ServerOptions, requestListener?: Function): Server; @@ -1959,7 +1959,7 @@ declare module "net" { } export var Socket: { - new (options?: { fd?: string; type?: string; allowHalfOpen?: boolean; }): Socket; + new(options?: { fd?: string; type?: string; allowHalfOpen?: boolean; }): Socket; }; export interface ListenOptions { @@ -2464,6 +2464,7 @@ declare module "fs" { */ export function readFileSync(filename: string, options?: { flag?: string; }): Buffer; export function writeFile(filename: string | number, data: any, callback?: (err: NodeJS.ErrnoException) => void): void; + export function writeFile(filename: string | number, data: any, options: string, callback?: (err: NodeJS.ErrnoException) => void): void; export function writeFile(filename: string | number, data: any, options: { encoding?: string; mode?: number; flag?: string; }, callback?: (err: NodeJS.ErrnoException) => void): void; export function writeFile(filename: string | number, data: any, options: { encoding?: string; mode?: string; flag?: string; }, callback?: (err: NodeJS.ErrnoException) => void): void; export function writeFileSync(filename: string, data: any, options?: { encoding?: string; mode?: number; flag?: string; }): void; @@ -2780,7 +2781,7 @@ declare module "string_decoder" { end(buffer?: Buffer): string; } export var StringDecoder: { - new (encoding?: string): NodeStringDecoder; + new(encoding?: string): NodeStringDecoder; }; } @@ -3184,7 +3185,7 @@ declare module "crypto" { verifySpkac(spkac: Buffer): boolean; } export var Certificate: { - new (): Certificate; + new(): Certificate; (): Certificate; } @@ -4128,6 +4129,6 @@ declare module "_debugger" { } export var Client: { - new (): ClientInstance + new(): ClientInstance } } diff --git a/src/typings/nsfw.d.ts b/src/typings/nsfw.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d7d23f3c2b7ae7e245639ffe1414b3a2e3adcc74 --- /dev/null +++ b/src/typings/nsfw.d.ts @@ -0,0 +1,40 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +declare module 'nsfw' { + interface NsfwWatcher { + start(): any; + stop(): any; + } + + interface NsfwWatchingPromise { + then(): void; + } + + interface NsfwStartWatchingPromise { + then(fn: (watcher: NsfwWatcher) => void): NsfwWatchingPromise; + } + + interface NsfwEvent { + action: number; + directory: string; + file?: string; + newFile?: string; + oldFile?: string; + } + + interface NsfwFunction { + (dir: string, eventHandler: (events: NsfwEvent[]) => void, options?: any): NsfwStartWatchingPromise; + actions: { + CREATED: number; + DELETED: number; + MODIFIED: number; + RENAMED: number; + } + } + + var nsfw: NsfwFunction; + export = nsfw; +} diff --git a/src/typings/semver.d.ts b/src/typings/semver.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..129a83e21fa44b32a363d8edbd447e3286d76e6b --- /dev/null +++ b/src/typings/semver.d.ts @@ -0,0 +1,125 @@ +// Type definitions for semver v2.2.1 +// Project: https://github.com/isaacs/node-semver +// Definitions by: Bart van der Schoor +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module SemVerModule { + /** + * Return the parsed version, or null if it's not valid. + */ + function valid(v: string, loose?: boolean): string; + /** + * Return the version incremented by the release type (major, minor, patch, or prerelease), or null if it's not valid. + */ + function inc(v: string, release: string, loose?: boolean): string; + + // Comparison + /** + * v1 > v2 + */ + function gt(v1: string, v2: string, loose?: boolean): boolean; + /** + * v1 >= v2 + */ + function gte(v1: string, v2: string, loose?: boolean): boolean; + /** + * v1 < v2 + */ + function lt(v1: string, v2: string, loose?: boolean): boolean; + /** + * v1 <= v2 + */ + function lte(v1: string, v2: string, loose?: boolean): boolean; + /** + * v1 == v2 This is true if they're logically equivalent, even if they're not the exact same string. You already know how to compare strings. + */ + function eq(v1: string, v2: string, loose?: boolean): boolean; + /** + * v1 != v2 The opposite of eq. + */ + function neq(v1: string, v2: string, loose?: boolean): boolean; + /** + * Pass in a comparison string, and it'll call the corresponding semver comparison function. "===" and "!==" do simple string comparison, but are included for completeness. Throws if an invalid comparison string is provided. + */ + function cmp(v1: string, comparator: any, v2: string, loose?: boolean): boolean; + /** + * Return 0 if v1 == v2, or 1 if v1 is greater, or -1 if v2 is greater. Sorts in ascending order if passed to Array.sort(). + */ + function compare(v1: string, v2: string, loose?: boolean): number; + /** + * The reverse of compare. Sorts an array of versions in descending order when passed to Array.sort(). + */ + function rcompare(v1: string, v2: string, loose?: boolean): number; + + // Ranges + /** + * Return the valid range or null if it's not valid + */ + function validRange(range: string, loose?: boolean): string; + /** + * Return true if the version satisfies the range. + */ + function satisfies(version: string, range: string, loose?: boolean): boolean; + /** + * Return the highest version in the list that satisfies the range, or null if none of them do. + */ + function maxSatisfying(versions: string[], range: string, loose?: boolean): string; + /** + * Return true if version is greater than all the versions possible in the range. + */ + function gtr(version: string, range: string, loose?: boolean): boolean; + /** + * Return true if version is less than all the versions possible in the range. + */ + function ltr(version: string, range: string, loose?: boolean): boolean; + /** + * Return true if the version is outside the bounds of the range in either the high or low direction. The hilo argument must be either the string '>' or '<'. (This is the function called by gtr and ltr.) + */ + function outside(version: string, range: string, hilo: string, loose?: boolean): boolean; + + class SemVerBase { + raw: string; + loose: boolean; + format(): string; + inspect(): string; + toString(): string; + } + + class SemVer extends SemVerBase { + constructor(version: string, loose?: boolean); + + major: number; + minor: number; + patch: number; + version: string; + build: string[]; + prerelease: string[]; + + compare(other: SemVer): number; + compareMain(other: SemVer): number; + comparePre(other: SemVer): number; + inc(release: string): SemVer; + } + + class Comparator extends SemVerBase { + constructor(comp: string, loose?: boolean); + + semver: SemVer; + operator: string; + value: boolean; + parse(comp: string): void; + test(version: SemVer): boolean; + } + + class Range extends SemVerBase { + constructor(range: string, loose?: boolean); + + set: Comparator[][]; + parseRange(range: string): Comparator[]; + test(version: SemVer): boolean; + } +} + +declare module "semver" { + export = SemVerModule; +} diff --git a/src/typings/sinon.d.ts b/src/typings/sinon.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0ca6c3840a0631598623cd3c273ce5fec70bd626 --- /dev/null +++ b/src/typings/sinon.d.ts @@ -0,0 +1,448 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +// Type definitions for Sinon 1.16.0 +// Project: http://sinonjs.org/ +// Definitions by: William Sears +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module '~sinon/lib/sinon' { + module Sinon { + export interface SinonSpyCallApi { + // Properties + thisValue: any; + args: any[]; + exception: any; + returnValue: any; + + // Methods + calledOn(obj: any): boolean; + calledWith(...args: any[]): boolean; + calledWithExactly(...args: any[]): boolean; + calledWithMatch(...args: any[]): boolean; + notCalledWith(...args: any[]): boolean; + notCalledWithMatch(...args: any[]): boolean; + returned(value: any): boolean; + threw(): boolean; + threw(type: string): boolean; + threw(obj: any): boolean; + callArg(pos: number): void; + callArgOn(pos: number, obj: any, ...args: any[]): void; + callArgWith(pos: number, ...args: any[]): void; + callArgOnWith(pos: number, obj: any, ...args: any[]): void; + yield(...args: any[]): void; + yieldOn(obj: any, ...args: any[]): void; + yieldTo(property: string, ...args: any[]): void; + yieldToOn(property: string, obj: any, ...args: any[]): void; + } + + export interface SinonSpyCall extends SinonSpyCallApi { + calledBefore(call: SinonSpyCall): boolean; + calledAfter(call: SinonSpyCall): boolean; + calledWithNew(call: SinonSpyCall): boolean; + } + + export interface SinonSpy extends SinonSpyCallApi { + // Properties + callCount: number; + called: boolean; + notCalled: boolean; + calledOnce: boolean; + calledTwice: boolean; + calledThrice: boolean; + firstCall: SinonSpyCall; + secondCall: SinonSpyCall; + thirdCall: SinonSpyCall; + lastCall: SinonSpyCall; + thisValues: any[]; + args: any[][]; + exceptions: any[]; + returnValues: any[]; + + // Methods + (...args: any[]): any; + calledBefore(anotherSpy: SinonSpy): boolean; + calledAfter(anotherSpy: SinonSpy): boolean; + calledWithNew(spy: SinonSpy): boolean; + withArgs(...args: any[]): SinonSpy; + alwaysCalledOn(obj: any): boolean; + alwaysCalledWith(...args: any[]): boolean; + alwaysCalledWithExactly(...args: any[]): boolean; + alwaysCalledWithMatch(...args: any[]): boolean; + neverCalledWith(...args: any[]): boolean; + neverCalledWithMatch(...args: any[]): boolean; + alwaysThrew(): boolean; + alwaysThrew(type: string): boolean; + alwaysThrew(obj: any): boolean; + alwaysReturned(): boolean; + invokeCallback(...args: any[]): void; + getCall(n: number): SinonSpyCall; + getCalls(): SinonSpyCall[]; + reset(): void; + printf(format: string, ...args: any[]): string; + restore(): void; + } + + export interface SinonSpyStatic { + (): SinonSpy; + (func: any): SinonSpy; + (obj: any, method: string): SinonSpy; + } + + export interface SinonStatic { + spy: SinonSpyStatic; + } + + export interface SinonStub extends SinonSpy { + resetBehavior(): void; + returns(obj: any): SinonStub; + returnsArg(index: number): SinonStub; + returnsThis(): SinonStub; + throws(type?: string): SinonStub; + throws(obj: any): SinonStub; + callsArg(index: number): SinonStub; + callsArgOn(index: number, context: any): SinonStub; + callsArgWith(index: number, ...args: any[]): SinonStub; + callsArgOnWith(index: number, context: any, ...args: any[]): SinonStub; + callsArgAsync(index: number): SinonStub; + callsArgOnAsync(index: number, context: any): SinonStub; + callsArgWithAsync(index: number, ...args: any[]): SinonStub; + callsArgOnWithAsync(index: number, context: any, ...args: any[]): SinonStub; + onCall(n: number): SinonStub; + onFirstCall(): SinonStub; + onSecondCall(): SinonStub; + onThirdCall(): SinonStub; + yields(...args: any[]): SinonStub; + yieldsOn(context: any, ...args: any[]): SinonStub; + yieldsTo(property: string, ...args: any[]): SinonStub; + yieldsToOn(property: string, context: any, ...args: any[]): SinonStub; + yieldsAsync(...args: any[]): SinonStub; + yieldsOnAsync(context: any, ...args: any[]): SinonStub; + yieldsToAsync(property: string, ...args: any[]): SinonStub; + yieldsToOnAsync(property: string, context: any, ...args: any[]): SinonStub; + withArgs(...args: any[]): SinonStub; + } + + export interface SinonStubStatic { + (): SinonStub; + (obj: any): SinonStub; + (obj: any, method: string): SinonStub; + (obj: any, method: string, func: any): SinonStub; + } + + export interface SinonStatic { + stub: SinonStubStatic; + } + + export interface SinonExpectation extends SinonStub { + atLeast(n: number): SinonExpectation; + atMost(n: number): SinonExpectation; + never(): SinonExpectation; + once(): SinonExpectation; + twice(): SinonExpectation; + thrice(): SinonExpectation; + exactly(n: number): SinonExpectation; + withArgs(...args: any[]): SinonExpectation; + withExactArgs(...args: any[]): SinonExpectation; + on(obj: any): SinonExpectation; + verify(): SinonExpectation; + restore(): void; + } + + export interface SinonExpectationStatic { + create(methodName?: string): SinonExpectation; + } + + export interface SinonMock { + expects(method: string): SinonExpectation; + restore(): void; + verify(): void; + } + + export interface SinonMockStatic { + (): SinonExpectation; + (obj: any): SinonMock; + } + + export interface SinonStatic { + expectation: SinonExpectationStatic; + mock: SinonMockStatic; + } + + export interface SinonFakeTimers { + now: number; + create(now: number): SinonFakeTimers; + setTimeout(callback: (...args: any[]) => void, timeout: number, ...args: any[]): number; + clearTimeout(id: number): void; + setInterval(callback: (...args: any[]) => void, timeout: number, ...args: any[]): number; + clearInterval(id: number): void; + tick(ms: number): number; + reset(): void; + Date(): Date; + Date(year: number): Date; + Date(year: number, month: number): Date; + Date(year: number, month: number, day: number): Date; + Date(year: number, month: number, day: number, hour: number): Date; + Date(year: number, month: number, day: number, hour: number, minute: number): Date; + Date(year: number, month: number, day: number, hour: number, minute: number, second: number): Date; + Date(year: number, month: number, day: number, hour: number, minute: number, second: number, ms: number): Date; + restore(): void; + + /** + * Simulate the user changing the system clock while your program is running. It changes the 'now' timestamp + * without affecting timers, intervals or immediates. + * @param now The new 'now' in unix milliseconds + */ + setSystemTime(now: number): void; + /** + * Simulate the user changing the system clock while your program is running. It changes the 'now' timestamp + * without affecting timers, intervals or immediates. + * @param now The new 'now' as a JavaScript Date + */ + setSystemTime(date: Date): void; + } + + export interface SinonFakeTimersStatic { + (): SinonFakeTimers; + (...timers: string[]): SinonFakeTimers; + (now: number, ...timers: string[]): SinonFakeTimers; + } + + export interface SinonStatic { + useFakeTimers: SinonFakeTimersStatic; + clock: SinonFakeTimers; + } + + export interface SinonFakeUploadProgress { + eventListeners: { + progress: any[]; + load: any[]; + abort: any[]; + error: any[]; + }; + + addEventListener(event: string, listener: (e: Event) => any): void; + removeEventListener(event: string, listener: (e: Event) => any): void; + dispatchEvent(event: Event): void; + } + + export interface SinonFakeXMLHttpRequest { + // Properties + onCreate: (xhr: SinonFakeXMLHttpRequest) => void; + url: string; + method: string; + requestHeaders: any; + requestBody: string; + status: number; + statusText: string; + async: boolean; + username: string; + password: string; + withCredentials: boolean; + upload: SinonFakeUploadProgress; + responseXML: Document; + getResponseHeader(header: string): string; + getAllResponseHeaders(): any; + + // Methods + restore(): void; + useFilters: boolean; + addFilter(filter: (method: string, url: string, async: boolean, username: string, password: string) => boolean): void; + setResponseHeaders(headers: any): void; + setResponseBody(body: string): void; + respond(status: number, headers: any, body: string): void; + autoRespond(ms: number): void; + } + + export interface SinonFakeXMLHttpRequestStatic { + (): SinonFakeXMLHttpRequest; + } + + export interface SinonStatic { + useFakeXMLHttpRequest: SinonFakeXMLHttpRequestStatic; + FakeXMLHttpRequest: SinonFakeXMLHttpRequest; + } + + export interface SinonFakeServer { + // Properties + autoRespond: boolean; + autoRespondAfter: number; + fakeHTTPMethods: boolean; + getHTTPMethod: (request: SinonFakeXMLHttpRequest) => string; + requests: SinonFakeXMLHttpRequest[]; + respondImmediately: boolean; + + // Methods + respondWith(body: string): void; + respondWith(response: any[]): void; + respondWith(fn: (xhr: SinonFakeXMLHttpRequest) => void): void; + respondWith(url: string, body: string): void; + respondWith(url: string, response: any[]): void; + respondWith(url: string, fn: (xhr: SinonFakeXMLHttpRequest) => void): void; + respondWith(method: string, url: string, body: string): void; + respondWith(method: string, url: string, response: any[]): void; + respondWith(method: string, url: string, fn: (xhr: SinonFakeXMLHttpRequest) => void): void; + respondWith(url: RegExp, body: string): void; + respondWith(url: RegExp, response: any[]): void; + respondWith(url: RegExp, fn: (xhr: SinonFakeXMLHttpRequest) => void): void; + respondWith(method: string, url: RegExp, body: string): void; + respondWith(method: string, url: RegExp, response: any[]): void; + respondWith(method: string, url: RegExp, fn: (xhr: SinonFakeXMLHttpRequest) => void): void; + respond(): void; + restore(): void; + } + + export interface SinonFakeServerStatic { + create(): SinonFakeServer; + } + + export interface SinonStatic { + fakeServer: SinonFakeServerStatic; + fakeServerWithClock: SinonFakeServerStatic; + } + + export interface SinonExposeOptions { + prefix?: string; + includeFail?: boolean; + } + + export interface SinonAssert { + // Properties + failException: string; + fail: (message?: string) => void; // Overridable + pass: (assertion: any) => void; // Overridable + + // Methods + notCalled(spy: SinonSpy): void; + called(spy: SinonSpy): void; + calledOnce(spy: SinonSpy): void; + calledTwice(spy: SinonSpy): void; + calledThrice(spy: SinonSpy): void; + callCount(spy: SinonSpy, count: number): void; + callOrder(...spies: SinonSpy[]): void; + calledOn(spy: SinonSpy, obj: any): void; + alwaysCalledOn(spy: SinonSpy, obj: any): void; + calledWith(spy: SinonSpy, ...args: any[]): void; + alwaysCalledWith(spy: SinonSpy, ...args: any[]): void; + neverCalledWith(spy: SinonSpy, ...args: any[]): void; + calledWithExactly(spy: SinonSpy, ...args: any[]): void; + alwaysCalledWithExactly(spy: SinonSpy, ...args: any[]): void; + calledWithMatch(spy: SinonSpy, ...args: any[]): void; + alwaysCalledWithMatch(spy: SinonSpy, ...args: any[]): void; + neverCalledWithMatch(spy: SinonSpy, ...args: any[]): void; + threw(spy: SinonSpy): void; + threw(spy: SinonSpy, exception: string): void; + threw(spy: SinonSpy, exception: any): void; + alwaysThrew(spy: SinonSpy): void; + alwaysThrew(spy: SinonSpy, exception: string): void; + alwaysThrew(spy: SinonSpy, exception: any): void; + expose(obj: any, options?: SinonExposeOptions): void; + } + + export interface SinonStatic { + assert: SinonAssert; + } + + export interface SinonMatcher { + and(expr: SinonMatcher): SinonMatcher; + or(expr: SinonMatcher): SinonMatcher; + } + + export interface SinonMatch { + (value: number): SinonMatcher; + (value: string): SinonMatcher; + (expr: RegExp): SinonMatcher; + (obj: any): SinonMatcher; + (callback: (value: any) => boolean): SinonMatcher; + any: SinonMatcher; + defined: SinonMatcher; + truthy: SinonMatcher; + falsy: SinonMatcher; + bool: SinonMatcher; + number: SinonMatcher; + string: SinonMatcher; + object: SinonMatcher; + func: SinonMatcher; + array: SinonMatcher; + regexp: SinonMatcher; + date: SinonMatcher; + same(obj: any): SinonMatcher; + typeOf(type: string): SinonMatcher; + instanceOf(type: any): SinonMatcher; + has(property: string, expect?: any): SinonMatcher; + hasOwn(property: string, expect?: any): SinonMatcher; + } + + export interface SinonStatic { + match: SinonMatch; + } + + export interface SinonSandboxConfig { + injectInto?: any; + properties?: string[]; + useFakeTimers?: any; + useFakeServer?: any; + } + + export interface SinonSandbox { + clock: SinonFakeTimers; + requests: SinonFakeXMLHttpRequest; + server: SinonFakeServer; + spy: SinonSpyStatic; + stub: SinonStubStatic; + mock: SinonMockStatic; + useFakeTimers: SinonFakeTimersStatic; + useFakeXMLHttpRequest: SinonFakeXMLHttpRequestStatic; + useFakeServer(): SinonFakeServer; + restore(): void; + } + + export interface SinonSandboxStatic { + create(): SinonSandbox; + create(config: SinonSandboxConfig): SinonSandbox; + } + + export interface SinonStatic { + sandbox: SinonSandboxStatic; + } + + export interface SinonTestConfig { + injectIntoThis?: boolean; + injectInto?: any; + properties?: string[]; + useFakeTimers?: boolean; + useFakeServer?: boolean; + } + + export interface SinonTestWrapper extends SinonSandbox { + (...args: any[]): any; + } + + export interface SinonStatic { + config: SinonTestConfig; + test(fn: (...args: any[]) => any): SinonTestWrapper; + testCase(tests: any): any; + } + + // Utility overridables + export interface SinonStatic { + createStubInstance(constructor: any): SinonStub; + format(obj: any): string; + log(message: string): void; + restore(object: any): void; + } + } + + var Sinon: Sinon.SinonStatic; + + export = Sinon; +} +declare module 'sinon/lib/sinon' { + import main = require('~sinon/lib/sinon'); + export = main; +} +declare module 'sinon' { + import main = require('~sinon/lib/sinon'); + export = main; +} \ No newline at end of file diff --git a/src/typings/winreg.d.ts b/src/typings/winreg.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..70047d8b50f504140b12eaf27a9f53196908a40b --- /dev/null +++ b/src/typings/winreg.d.ts @@ -0,0 +1,338 @@ +// Type definitions for Winreg v1.2.0 +// Project: http://fresc81.github.io/node-winreg/ +// Definitions by: RX14 , BobBuehler +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare var Winreg: WinregStatic; + +interface WinregStatic { + /** + * Creates a registry object, which provides access to a single registry key. + * Note: This class is returned by a call to ```require('winreg')```. + * + * @public + * @class + * + * @param {@link Options} options - the options + * + * @example + * var Registry = require('winreg') + * , autoStartCurrentUser = new Registry({ + * hive: Registry.HKCU, + * key: '\\Software\\Microsoft\\Windows\\CurrentVersion\\Run' + * }); + */ + new (options: Winreg.Options): Winreg.Registry; + + /** + * Registry hive key HKEY_LOCAL_MACHINE. + * Note: For writing to this hive your program has to run with admin privileges. + */ + HKLM: string; + + /** + * Registry hive key HKEY_CURRENT_USER. + */ + HKCU: string; + + /** + * Registry hive key HKEY_CLASSES_ROOT. + * Note: For writing to this hive your program has to run with admin privileges. + */ + HKCR: string; + + /** + * Registry hive key HKEY_USERS. + * Note: For writing to this hive your program has to run with admin privileges. + */ + HKU: string; + + /** + * Registry hive key HKEY_CURRENT_CONFIG. + * Note: For writing to this hive your program has to run with admin privileges. + */ + HKCC: string; + + /** + * Collection of available registry hive keys. + */ + HIVES: Array; + + /** + * Registry value type STRING. + * + * Values of this type contain a string. + */ + REG_SZ: string; + + /** + * Registry value type MULTILINE_STRING. + * + * Values of this type contain a multiline string. + */ + REG_MULTI_SZ: string; + + /** + * Registry value type EXPANDABLE_STRING. + * + * Values of this type contain an expandable string. + */ + REG_EXPAND_SZ: string; + + /** + * Registry value type DOUBLE_WORD. + * + * Values of this type contain a double word (32 bit integer). + */ + REG_DWORD: string; + + /** + * Registry value type QUAD_WORD. + * + * Values of this type contain a quad word (64 bit integer). + */ + REG_QWORD: string; + + /** + * Registry value type BINARY. + * + * Values of this type contain a binary value. + */ + REG_BINARY: string; + + /** + * Registry value type UNKNOWN. + * + * Values of this type contain a value of an unknown type. + */ + REG_NONE: string; + + /** + * Collection of available registry value types. + */ + REG_TYPES: Array; + + /** + * The name of the default value. May be used instead of the empty string literal for better readability. + */ + DEFAULT_VALUE: string; +} + +declare namespace Winreg { + export interface Options { + /** + * Optional hostname, must start with '\\' sequence. + */ + host?: string; + + /** + * Optional hive ID, default is HKLM. + */ + hive?: string; + + /** + * Optional key, default is the root key. + */ + key?: string; + + /** + * Optional registry hive architecture ('x86' or 'x64'; only valid on Windows 64 Bit Operating Systems). + */ + arch?: string; + } + + /** + * A registry object, which provides access to a single registry key. + */ + export interface Registry { + /** + * The hostname. + * @readonly + */ + host: string; + + /** + * The hive id. + * @readonly + */ + hive: string; + + /** + * The registry key name. + * @readonly + */ + key: string; + + /** + * The full path to the registry key. + * @readonly + */ + path: string; + + /** + * The registry hive architecture ('x86' or 'x64'). + * @readonly + */ + arch: string; + + /** + * Creates a new {@link Registry} instance that points to the parent registry key. + * @readonly + */ + parent: Registry; + + /** + * Retrieve all values from this registry key. + * @param {valuesCallback} cb - callback function + * @param {error=} cb.err - error object or null if successful + * @param {array=} cb.items - an array of {@link RegistryItem} objects + * @returns {Registry} this registry key object + */ + values(cb: (err: Error, result: Array) => void): Registry; + + /** + * Retrieve all subkeys from this registry key. + * @param {function (err, items)} cb - callback function + * @param {error=} cb.err - error object or null if successful + * @param {array=} cb.items - an array of {@link Registry} objects + * @returns {Registry} this registry key object + */ + keys(cb: (err: Error, result: Array) => void): Registry; + + /** + * Gets a named value from this registry key. + * @param {string} name - the value name, use {@link Registry.DEFAULT_VALUE} or an empty string for the default value + * @param {function (err, item)} cb - callback function + * @param {error=} cb.err - error object or null if successful + * @param {RegistryItem=} cb.item - the retrieved registry item + * @returns {Registry} this registry key object + */ + get(name: string, cb: (err: Error, result: Winreg.RegistryItem) => void): Registry; + + /** + * Sets a named value in this registry key, overwriting an already existing value. + * @param {string} name - the value name, use {@link Registry.DEFAULT_VALUE} or an empty string for the default value + * @param {string} type - the value type + * @param {string} value - the value + * @param {function (err)} cb - callback function + * @param {error=} cb.err - error object or null if successful + * @returns {Registry} this registry key object + */ + set(name: string, type: string, value: string, cb: (err: Error) => void): Registry; + + /** + * Remove a named value from this registry key. If name is empty, sets the default value of this key. + * Note: This key must be already existing. + * @param {string} name - the value name, use {@link Registry.DEFAULT_VALUE} or an empty string for the default value + * @param {function (err)} cb - callback function + * @param {error=} cb.err - error object or null if successful + * @returns {Registry} this registry key object + */ + remove(name: string, cb: (err: Error) => void): Registry; + + /** + * Remove all subkeys and values (including the default value) from this registry key. + * @param {function (err)} cb - callback function + * @param {error=} cb.err - error object or null if successful + * @returns {Registry} this registry key object + */ + clear(cb: (err: Error) => void): Registry; + + /** + * Alias for the clear method to keep it backward compatible. + * @method + * @deprecated Use {@link Registry#clear} or {@link Registry#destroy} in favour of this method. + * @param {function (err)} cb - callback function + * @param {error=} cb.err - error object or null if successful + * @returns {Registry} this registry key object + */ + erase(cb: (err: Error) => void): Registry; + + /** + * Delete this key and all subkeys from the registry. + * @param {function (err)} cb - callback function + * @param {error=} cb.err - error object or null if successful + * @returns {Registry} this registry key object + */ + destroy(cb: (err: Error) => void): Registry; + + /** + * Create this registry key. Note that this is a no-op if the key already exists. + * @param {function (err)} cb - callback function + * @param {error=} cb.err - error object or null if successful + * @returns {Registry} this registry key object + */ + create(cb: (err: Error) => void): Registry; + + /** + * Checks if this key already exists. + * @param {function (err, exists)} cb - callback function + * @param {error=} cb.err - error object or null if successful + * @param {boolean=} cb.exists - true if a registry key with this name already exists + * @returns {Registry} this registry key object + */ + keyExists(cb: (err: Error, exists: boolean) => void): Registry; + + /** + * Checks if a value with the given name already exists within this key. + * @param {string} name - the value name, use {@link Registry.DEFAULT_VALUE} or an empty string for the default value + * @param {function (err, exists)} cb - callback function + * @param {error=} cb.err - error object or null if successful + * @param {boolean=} cb.exists - true if a value with the given name was found in this key + * @returns {Registry} this registry key object + */ + valueExists(name: string, cb: (err: Error, exists: boolean) => void): Registry; + } + + /** + * A single registry value record. + * Objects of this type are created internally and returned by methods of {@link Registry} objects. + */ + export interface RegistryItem { + /** + * The hostname. + * @readonly + */ + host: string; + + /** + * The hive id. + * @readonly + */ + hive: string; + + /** + * The registry key. + * @readonly + */ + key: string; + + /** + * The value name. + * @readonly + */ + name: string; + + /** + * The value type. + * @readonly + */ + type: string; + + /** + * The value. + * @readonly + */ + value: string; + + /** + * The hive architecture. + * @readonly + */ + arch: string; + } +} + +declare module "winreg" { + export = Winreg; +} \ No newline at end of file diff --git a/src/vs/base/browser/dom.ts b/src/vs/base/browser/dom.ts index 228550b57afe7003b4fa48b90f11174174037cfd..d0dfb1d885ced3391b7b123bb305900ac028fd38 100644 --- a/src/vs/base/browser/dom.ts +++ b/src/vs/base/browser/dom.ts @@ -1041,3 +1041,16 @@ export function domContentLoaded(): TPromise { } }); } + +/** + * Find a value usable for a dom node size such that the likelihood that it would be + * displayed with constant screen pixels size is as high as possible. + * + * e.g. We would desire for the cursors to be 2px (CSS px) wide. Under a devicePixelRatio + * of 1.25, the cursor will be 2.5 screen pixels wide. Depending on how the dom node aligns/"snaps" + * with the screen pixels, it will sometimes be rendered with 2 screen pixels, and sometimes with 3 screen pixels. + */ +export function computeScreenAwareSize(cssPx: number): number { + const screenPx = window.devicePixelRatio * cssPx; + return Math.max(1, Math.floor(screenPx)) / window.devicePixelRatio; +} diff --git a/src/vs/base/browser/fastDomNode.ts b/src/vs/base/browser/fastDomNode.ts index ee1dd6cd58f40fa328496b66f1de4df4c6f40aa5..695b48141e7612d873c0a2a62e64f829757321f5 100644 --- a/src/vs/base/browser/fastDomNode.ts +++ b/src/vs/base/browser/fastDomNode.ts @@ -6,7 +6,7 @@ import * as dom from 'vs/base/browser/dom'; -export abstract class FastDomNode { +export class FastDomNode { public readonly domNode: T; private _maxWidth: number; @@ -25,7 +25,7 @@ export abstract class FastDomNode { private _display: string; private _position: string; private _visibility: string; - private _transform: string; + private _layerHint: boolean; constructor(domNode: T) { this.domNode = domNode; @@ -45,7 +45,7 @@ export abstract class FastDomNode { this._display = ''; this._position = ''; this._visibility = ''; - this._transform = ''; + this._layerHint = false; } public setMaxWidth(maxWidth: number): void { @@ -80,10 +80,6 @@ export abstract class FastDomNode { this.domNode.style.height = this._height + 'px'; } - public getHeight(): number { - return this._height; - } - public unsetHeight(): void { if (this._height === -1) { return; @@ -100,10 +96,6 @@ export abstract class FastDomNode { this.domNode.style.top = this._top + 'px'; } - public getTop(): number { - return this._top; - } - public unsetTop(): void { if (this._top === -1) { return; @@ -223,16 +215,14 @@ export abstract class FastDomNode { this.domNode.style.visibility = this._visibility; } - public setTransform(transform: string): void { - if (this._transform === transform) { + public setLayerHinting(layerHint: boolean): void { + if (this._layerHint === layerHint) { return; } - this._transform = transform; - this._setTransform(this.domNode, this._transform); + this._layerHint = layerHint; + (this.domNode.style).willChange = this._layerHint ? 'transform' : 'auto'; } - protected abstract _setTransform(domNode: T, transform: string): void; - public setAttribute(name: string, value: string): void { this.domNode.setAttribute(name, value); } @@ -258,29 +248,6 @@ export abstract class FastDomNode { } } -class WebKitFastDomNode extends FastDomNode { - protected _setTransform(domNode: T, transform: string): void { - (domNode.style).webkitTransform = transform; - } -} - -class StandardFastDomNode extends FastDomNode { - protected _setTransform(domNode: T, transform: string): void { - domNode.style.transform = transform; - } -} - -let useWebKitFastDomNode = false; -(function () { - let testDomNode = document.createElement('div'); - if (typeof (testDomNode.style).webkitTransform !== 'undefined') { - useWebKitFastDomNode = true; - } -})(); export function createFastDomNode(domNode: T): FastDomNode { - if (useWebKitFastDomNode) { - return new WebKitFastDomNode(domNode); - } else { - return new StandardFastDomNode(domNode); - } + return new FastDomNode(domNode); } diff --git a/src/vs/base/browser/htmlContentRenderer.ts b/src/vs/base/browser/htmlContentRenderer.ts index 638afe7f41f96a80787a46eb8cfc73ed116d23e5..f5b1e0ce92ba85c0a4ea8a92d56a433ca8252a33 100644 --- a/src/vs/base/browser/htmlContentRenderer.ts +++ b/src/vs/base/browser/htmlContentRenderer.ts @@ -9,20 +9,50 @@ import DOM = require('vs/base/browser/dom'); import { defaultGenerator } from 'vs/base/common/idGenerator'; import { escape } from 'vs/base/common/strings'; import { TPromise } from 'vs/base/common/winjs.base'; -import { IHTMLContentElement, MarkedString, removeMarkdownEscapes } from 'vs/base/common/htmlContent'; +import { MarkedString, removeMarkdownEscapes } from 'vs/base/common/htmlContent'; import { marked } from 'vs/base/common/marked/marked'; import { IMouseEvent } from 'vs/base/browser/mouseEvent'; -export type RenderableContent = string | IHTMLContentElement | IHTMLContentElement[]; - export interface RenderOptions { + className?: string; + inline?: boolean; actionCallback?: (content: string, event?: IMouseEvent) => void; codeBlockRenderer?: (modeId: string, value: string) => string | TPromise; } +function createElement(options: RenderOptions): HTMLElement { + const tagName = options.inline ? 'span' : 'div'; + const element = document.createElement(tagName); + if (options.className) { + element.className = options.className; + } + return element; +} + + export function renderMarkedString(markedString: MarkedString, options: RenderOptions = {}): Node { - const htmlContentElement = typeof markedString === 'string' ? { markdown: markedString } : { code: markedString }; - return renderHtml(htmlContentElement, options); + // this is sort of legacy given that we have full + // support for markdown. Turn this into markdown + // and continue + let markdown: string; + if (typeof markedString === 'string') { + markdown = markedString; + } else { + markdown = '```' + markedString.language + '\n' + markedString.value + '\n```'; + } + return renderMarkdown(markdown, options); +} + +export function renderText(text: string, options: RenderOptions = {}): Node { + const element = createElement(options); + element.textContent = text; + return element; +} + +export function renderFormattedText(formattedText: string, options: RenderOptions = {}): Node { + const element = createElement(options); + _renderFormattedText(element, parseFormattedText(formattedText), options.actionCallback); + return element; } /** @@ -31,200 +61,114 @@ export function renderMarkedString(markedString: MarkedString, options: RenderOp * @param content a html element description * @param actionCallback a callback function for any action links in the string. Argument is the zero-based index of the clicked action. */ -export function renderHtml(content: RenderableContent, options: RenderOptions = {}): Node { - if (typeof content === 'string') { - return _renderHtml({ isText: true, text: content }, options); - } else if (Array.isArray(content)) { - return _renderHtml({ children: content }, options); - } else if (content) { - return _renderHtml(content, options); - } - return undefined; -} - -function _renderHtml(content: IHTMLContentElement, options: RenderOptions = {}): Node { - - let { codeBlockRenderer, actionCallback } = options; - - if (content.isText) { - return document.createTextNode(content.text); - } - - var tagName = getSafeTagName(content.tagName) || 'div'; - var element = document.createElement(tagName); - - if (content.className) { - element.className = content.className; - } - if (content.text) { - element.textContent = content.text; - } - if (content.style) { - element.setAttribute('style', content.style); - } - if (content.customStyle) { - Object.keys(content.customStyle).forEach((key) => { - element.style[key] = content.customStyle[key]; - }); - } - if (content.children) { - content.children.forEach((child) => { - element.appendChild(renderHtml(child, options)); - }); - } - if (content.formattedText) { - renderFormattedText(element, parseFormattedText(content.formattedText), actionCallback); - } - - if (content.code && codeBlockRenderer) { - // this is sort of legacy given that we have full - // support for markdown. Turn this into markdown - // and continue - let { language, value } = content.code; - content.markdown = '```' + language + '\n' + value + '\n```'; - } - if (content.markdown) { - - // signal to code-block render that the - // element has been created - let signalInnerHTML: Function; - const withInnerHTML = new TPromise(c => signalInnerHTML = c); - - const renderer = new marked.Renderer(); - renderer.image = (href: string, title: string, text: string) => { - let dimensions: string[] = []; - if (href) { - const splitted = href.split('|').map(s => s.trim()); - href = splitted[0]; - const parameters = splitted[1]; - if (parameters) { - const heightFromParams = /height=(\d+)/.exec(parameters); - const widthFromParams = /width=(\d+)/.exec(parameters); - const height = (heightFromParams && heightFromParams[1]); - const width = (widthFromParams && widthFromParams[1]); - const widthIsFinite = isFinite(parseInt(width)); - const heightIsFinite = isFinite(parseInt(height)); - if (widthIsFinite) { - dimensions.push(`width="${width}"`); - } - if (heightIsFinite) { - dimensions.push(`height="${height}"`); - } +export function renderMarkdown(markdown: string, options: RenderOptions = {}): Node { + const element = createElement(options); + + const { codeBlockRenderer, actionCallback } = options; + + // signal to code-block render that the + // element has been created + let signalInnerHTML: Function; + const withInnerHTML = new TPromise(c => signalInnerHTML = c); + + const renderer = new marked.Renderer(); + renderer.image = (href: string, title: string, text: string) => { + let dimensions: string[] = []; + if (href) { + const splitted = href.split('|').map(s => s.trim()); + href = splitted[0]; + const parameters = splitted[1]; + if (parameters) { + const heightFromParams = /height=(\d+)/.exec(parameters); + const widthFromParams = /width=(\d+)/.exec(parameters); + const height = (heightFromParams && heightFromParams[1]); + const width = (widthFromParams && widthFromParams[1]); + const widthIsFinite = isFinite(parseInt(width)); + const heightIsFinite = isFinite(parseInt(height)); + if (widthIsFinite) { + dimensions.push(`width="${width}"`); + } + if (heightIsFinite) { + dimensions.push(`height="${height}"`); } } - let attributes: string[] = []; - if (href) { - attributes.push(`src="${href}"`); - } - if (text) { - attributes.push(`alt="${text}"`); - } - if (title) { - attributes.push(`title="${title}"`); - } - if (dimensions.length) { - attributes = attributes.concat(dimensions); - } - return ''; - }; - renderer.link = (href, title, text): string => { - // Remove markdown escapes. Workaround for https://github.com/chjj/marked/issues/829 - if (href === text) { // raw link case - text = removeMarkdownEscapes(text); - } - title = removeMarkdownEscapes(title); - href = removeMarkdownEscapes(href); - return `${text}`; - }; - renderer.paragraph = (text): string => { - return `